generate.c
static void code_if_statement(GenerateContext *c, ParseTreeNode *node)
{
    VMUVALUE nxt, end;
    code_rvalue(c, node->u.ifStatement.test);
    putcbyte(c, OP_BRF);
    nxt = putcword(c, 0);
    code_statement_list(c, node->u.ifStatement.thenStatements);
    putcbyte(c, OP_BR);
    end = putcword(c, 0);
    fixupbranch(c, nxt, codeaddr(c));
    code_statement_list(c, node->u.ifStatement.elseStatements);
    fixupbranch(c, end, codeaddr(c));
}
/* code_if_statement - generate code for an IF statement */
generate code for an IF statement
generate code for an IF statement
static void code_if_statement(GenerateContext *c, ParseTreeNode *node)
{
    VMUVALUE nxt, end;
    code_rvalue(c, node->u.ifStatement.test);
    putcbyte(c, OP_BRF);
    nxt = putcword(c, 0);
    code_statement_list(c, node->u.ifStatement.thenStatements);
    putcbyte(c, OP_BR);
    end = putcword(c, 0);
    fixupbranch(c, nxt, codeaddr(c));
    code_statement_list(c, node->u.ifStatement.elseStatements);
    fixupbranch(c, end, codeaddr(c));
}
static void code_if_statement ( GenerateContext * c , ParseTreeNode * node ) { VMUVALUE nxt , end ; code_rvalue ( c , node -> u . ifStatement . test ) ; putcbyte ( c , OP_BRF ) ; nxt = putcword ( c , 0 ) ; code_statement_list ( c , node -> u . ifStatement . thenStatements ) ; putcbyte ( c , OP_BR ) ; end = putcword ( c , 0 ) ; fixupbranch ( c , nxt , codeaddr ( c ) ) ; code_statement_list ( c , node -> u . ifStatement . elseStatements ) ; fixupbranch ( c , end , codeaddr ( c ) ) ; }
code_if_statement - generate code for an IF statement
code_if_statement - generate code for an IF statement