int main(void) { SymTab st; //symbol table // set this to 1 if you would like to print a trace // of the entire parsing process (it prints to stdout) yydebug = 0; // after parsing, the global "ast" should be set to the // syntax tree that we have built up during the parse yyparse(); // walk over the ast and print it out as a dot file dopass_ast2dot( ast ); dopass_typecheck(ast, &st); return 0; }
int main(void) { SymTab st; //symbol table // set this to 1 if you would like to print a trace // of the entire parsing process (it prints to stdout) yydebug = 0; // after parsing, the global "ast" should be set to the // syntax tree that we have built up during the parse yyparse(); if (ast) { dopass_typecheck( ast, &st ); dopass_constantfolding(ast, &st); // do codegen! dopass_codegen( ast, &st ); } return 0; }