parse.c
static ParseTreeNode *BuildHandlerCall(ParseContext *c, char *name, ParseTreeNode *devExpr, ParseTreeNode *expr)
{
    ParseTreeNode *functionNode, *callNode, *node;
    NodeListEntry **pNext;
    Symbol *symbol;

    if (!(symbol = FindGlobal(c, name)))
        ParseError(c, "print helper not defined: %s", name);
        
    functionNode = NewParseTreeNode(c, NodeTypeGlobalRef);
    functionNode->u.symbolRef.symbol = symbol;
    
    /* intialize the function call node */
    callNode = NewParseTreeNode(c, NodeTypeFunctionCall);
    callNode->u.functionCall.fcn = functionNode;
    callNode->u.functionCall.args = NULL;
    pNext = &callNode->u.functionCall.args;
    
    if (expr) {
        AddNodeToList(c, &pNext, expr);
        ++callNode->u.functionCall.argc;
    }

    AddNodeToList(c, &pNext, devExpr);
    ++callNode->u.functionCall.argc;

    /* build the function call statement */
    node = NewParseTreeNode(c, NodeTypeCallStatement);
    node->u.callStatement.expr = callNode;
    
    /* return the function call statement */
    return node;
}
/* BuildHandlerFunctionCall - compile a call to a runtime print function */
compile a call to a runtime print function
compile a call to a runtime print function
static ParseTreeNode *BuildHandlerCall(ParseContext *c, char *name, ParseTreeNode *devExpr, ParseTreeNode *expr)
{
    ParseTreeNode *functionNode, *callNode, *node;
    NodeListEntry **pNext;
    Symbol *symbol;
    if (!(symbol = FindGlobal(c, name)))
        ParseError(c, "print helper not defined: %s", name);
    functionNode = NewParseTreeNode(c, NodeTypeGlobalRef);
    functionNode->u.symbolRef.symbol = symbol;
    callNode = NewParseTreeNode(c, NodeTypeFunctionCall);
    callNode->u.functionCall.fcn = functionNode;
    callNode->u.functionCall.args = NULL;
    pNext = &callNode->u.functionCall.args;
    if (expr) {
        AddNodeToList(c, &pNext, expr);
        ++callNode->u.functionCall.argc;
    }
    AddNodeToList(c, &pNext, devExpr);
    ++callNode->u.functionCall.argc;
    node = NewParseTreeNode(c, NodeTypeCallStatement);
    node->u.callStatement.expr = callNode;
    return node;
}
static ParseTreeNode * BuildHandlerCall ( ParseContext * c , char * name , ParseTreeNode * devExpr , ParseTreeNode * expr ) { ParseTreeNode * functionNode , * callNode , * node ; NodeListEntry * * pNext ; Symbol * symbol ; if ( ! ( symbol = FindGlobal ( c , name ) ) ) ParseError ( c , " " , name ) ; functionNode = NewParseTreeNode ( c , NodeTypeGlobalRef ) ; functionNode -> u . symbolRef . symbol = symbol ; callNode = NewParseTreeNode ( c , NodeTypeFunctionCall ) ; callNode -> u . functionCall . fcn = functionNode ; callNode -> u . functionCall . args = NULL ; pNext = & callNode -> u . functionCall . args ; if ( expr ) { AddNodeToList ( c , & pNext , expr ) ; ++ callNode -> u . functionCall . argc ; } AddNodeToList ( c , & pNext , devExpr ) ; ++ callNode -> u . functionCall . argc ; node = NewParseTreeNode ( c , NodeTypeCallStatement ) ; node -> u . callStatement . expr = callNode ; return node ; }
BuildHandlerFunctionCall - compile a call to a runtime print function
BuildHandlerFunctionCall - compile a call to a runtime print function
/* intialize the function call node */ /* build the function call statement */ /* return the function call statement */