Advanced Compiler HW#03 Homework 3: What are the so-called "action table" and "goto table" of GCC? (Hint: Try to find them in c-parse.c.) The "action table" and "goto table" of a typical LR parser are combined into a single table in GCC -- yytable. Positive numbers in the table are used for shift action; negative numbers are used for reduce action; and 0, together with the most negative number, is used to indicate errors. In c-parse.c, yyn = yytable[yyn]; Comments are listed below: /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ Related source files: int yyparse (YYPARSE_PARAM_ARG) //[c-parse.c] static const short yytable[] = {...} //[c-parse.c] (a long one) static const short yytable[] = {...} //[gengtype-yacc.c] (a short one)