parse.c
static ParseTreeNode *ParseCall(ParseContext *c, ParseTreeNode *functionNode)
{
    ParseTreeNode *node = NewParseTreeNode(c, NodeTypeFunctionCall);
    NodeListEntry **pNext;
    int tkn;

    /* intialize the function call node */
    ResolveFunctionRef(c, functionNode);
    node->u.functionCall.fcn = functionNode;
    node->type = &c->integerType;
    pNext = &node->u.functionCall.args;

    /* parse the argument list */
    if ((tkn = GetToken(c)) != ')') {
        SaveToken(c, tkn);
        do {
            NodeListEntry *actual = (NodeListEntry *)AllocateHighMemory(c->sys, sizeof(NodeListEntry));
            actual->node = ParseExpr(c);
            actual->next = node->u.functionCall.args;
            node->u.functionCall.args = actual;
            ++node->u.functionCall.argc;
        } while ((tkn = GetToken(c)) == ',');
        Require(c, tkn, ')');
    }

    /* return the function call node */
    return node;
}
/* ParseCall - parse a function or subroutine call */
parse a function or subroutine call
parse a function or subroutine call
static ParseTreeNode *ParseCall(ParseContext *c, ParseTreeNode *functionNode)
{
    ParseTreeNode *node = NewParseTreeNode(c, NodeTypeFunctionCall);
    NodeListEntry **pNext;
    int tkn;
    ResolveFunctionRef(c, functionNode);
    node->u.functionCall.fcn = functionNode;
    node->type = &c->integerType;
    pNext = &node->u.functionCall.args;
    if ((tkn = GetToken(c)) != ')') {
        SaveToken(c, tkn);
        do {
            NodeListEntry *actual = (NodeListEntry *)AllocateHighMemory(c->sys, sizeof(NodeListEntry));
            actual->node = ParseExpr(c);
            actual->next = node->u.functionCall.args;
            node->u.functionCall.args = actual;
            ++node->u.functionCall.argc;
        } while ((tkn = GetToken(c)) == ',');
        Require(c, tkn, ')');
    }
    return node;
}
static ParseTreeNode * ParseCall ( ParseContext * c , ParseTreeNode * functionNode ) { ParseTreeNode * node = NewParseTreeNode ( c , NodeTypeFunctionCall ) ; NodeListEntry * * pNext ; int tkn ; ResolveFunctionRef ( c , functionNode ) ; node -> u . functionCall . fcn = functionNode ; node -> type = & c -> integerType ; pNext = & node -> u . functionCall . args ; if ( ( tkn = GetToken ( c ) ) != ' ' ) { SaveToken ( c , tkn ) ; do { NodeListEntry * actual = ( NodeListEntry * ) AllocateHighMemory ( c -> sys , sizeof ( NodeListEntry ) ) ; actual -> node = ParseExpr ( c ) ; actual -> next = node -> u . functionCall . args ; node -> u . functionCall . args = actual ; ++ node -> u . functionCall . argc ; } while ( ( tkn = GetToken ( c ) ) == ' ' ) ; Require ( c , tkn , ' ' ) ; } return node ; }
ParseCall - parse a function or subroutine call
ParseCall - parse a function or subroutine call
/* intialize the function call node */ /* parse the argument list */ /* return the function call node */