The following is an automated report about my lexical parsing and grammar for this C compiler.
input grammar: parser.y
TOK_CHAR TOK_BLOCK TOK_CALL TOK_IFELSE TOK_INITDECL TOK_POS TOK_NEG TOK_NEWARRAY TOK_FIELD TOK_ORD TOK_CHR TOK_ROOT TOK_NEWSTRING TOK_RETURNVOID TOK_VARDECL TOK_FUNCTION TOK_PARAMLIST TOK_PROTOTYPE TOK_INDEX TOK_DECLID '%'
State 66 conflicts: 13 shift/reduce State 104 conflicts: 13 shift/reduce State 123 conflicts: 1 shift/reduce
0 $accept → start $end 1 start → program 2 program → program structdef 3 | program function 4 | program statement 5 | program error '}' 6 | program error ';' 7 | %empty 8 structdef_ellipse → '{' fielddecl ';' 9 | structdef_ellipse fielddecl ';' 10 structdef → TOK_STRUCT TOK_IDENT structdef_ellipse '}' 11 | TOK_STRUCT TOK_IDENT '{' '}' 12 fielddecl → basetype TOK_IDENT 13 | basetype TOK_ARRAY TOK_IDENT 14 basetype → TOK_VOID 15 | TOK_INT 16 | TOK_STRING 17 | TOK_TYPEID 18 | TOK_IDENT 19 function_ellipse → '(' identdecl 20 | function_ellipse ',' identdecl 21 function → identdecl function_ellipse ')' block 22 | identdecl function_ellipse ')' ';' 23 | identdecl '(' ')' block 24 | identdecl '(' ')' ';' 25 identdecl → basetype TOK_IDENT 26 | basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → '{' statement 28 | block_ellipse statement 29 block → block_ellipse '}' 30 | '{' '}' 31 statement → block 32 | vardecl 33 | while 34 | ifelse 35 | return 36 | expr ';' 37 | ';' 38 vardecl → identdecl '=' expr ';' 39 while → TOK_WHILE '(' expr ')' statement 40 ifelse → TOK_IF '(' expr ')' statement TOK_ELSE statement 41 | TOK_IF '(' expr ')' statement 42 return → TOK_RETURN expr ';' 43 | TOK_RETURN ';' 44 binop → TOK_EQ 45 | TOK_NE 46 | TOK_LT 47 | TOK_LE 48 | TOK_GT 49 | TOK_GE 50 | '=' 51 | '+' 52 | '-' 53 | '*' 54 | '/' 55 unop → '+' 56 | '-' 57 | '!' 58 | TOK_NEW 59 expr → expr binop expr 60 | unop expr 61 | allocator 62 | call 63 | '(' expr ')' 64 | variable 65 | constant 66 allocator → TOK_NEW TOK_IDENT '(' ')' 67 | TOK_NEW TOK_STRING '(' expr ')' 68 | TOK_NEW basetype '[' expr ']' 69 call_elipse → TOK_IDENT '(' expr 70 | call_elipse ',' expr 71 call → call_elipse ')' 72 | TOK_IDENT '(' ')' 73 variable → TOK_IDENT 74 | expr '[' expr ']' 75 | expr '.' TOK_IDENT 76 constant → TOK_INTCON 77 | TOK_CHARCON 78 | TOK_STRINGCON 79 | TOK_NULL
$end (0) 0 '!' (33) 57 '%' (37) '(' (40) 19 23 24 39 40 41 63 66 67 69 72 ')' (41) 21 22 23 24 39 40 41 63 66 67 71 72 '*' (42) 53 '+' (43) 51 55 ',' (44) 20 70 '-' (45) 52 56 '.' (46) 75 '/' (47) 54 ';' (59) 6 8 9 22 24 36 37 38 42 43 '=' (61) 38 50 '[' (91) 68 74 ']' (93) 68 74 '{' (123) 8 11 27 30 '}' (125) 5 10 11 29 30 error (256) 5 6 TOK_VOID (258) 14 TOK_CHAR (259) TOK_INT (260) 15 TOK_STRING (261) 16 67 TOK_IF (262) 40 41 TOK_ELSE (263) 40 TOK_WHILE (264) 39 TOK_RETURN (265) 42 43 TOK_STRUCT (266) 10 11 TOK_NULL (267) 79 TOK_NEW (268) 58 66 67 68 TOK_ARRAY (269) 13 26 TOK_EQ (270) 44 TOK_NE (271) 45 TOK_LT (272) 46 TOK_LE (273) 47 TOK_GT (274) 48 TOK_GE (275) 49 TOK_IDENT (276) 10 11 12 13 18 25 26 66 69 72 73 75 TOK_INTCON (277) 76 TOK_CHARCON (278) 77 TOK_STRINGCON (279) 78 TOK_BLOCK (280) TOK_CALL (281) TOK_IFELSE (282) TOK_INITDECL (283) TOK_POS (284) TOK_NEG (285) TOK_NEWARRAY (286) TOK_TYPEID (287) 17 TOK_FIELD (288) TOK_ORD (289) TOK_CHR (290) TOK_ROOT (291) TOK_NEWSTRING (292) TOK_RETURNVOID (293) TOK_VARDECL (294) TOK_FUNCTION (295) TOK_PARAMLIST (296) TOK_PROTOTYPE (297) TOK_INDEX (298) TOK_DECLID (299)
$accept (61) on left: 0 start (62) on left: 1 on right: 0 program (63) on left: 2 3 4 5 6 7 on right: 1 2 3 4 5 6 structdef_ellipse (64) on left: 8 9 on right: 9 10 structdef (65) on left: 10 11 on right: 2 fielddecl (66) on left: 12 13 on right: 8 9 basetype (67) on left: 14 15 16 17 18 on right: 12 13 25 26 68 function_ellipse (68) on left: 19 20 on right: 20 21 22 function (69) on left: 21 22 23 24 on right: 3 identdecl (70) on left: 25 26 on right: 19 20 21 22 23 24 38 block_ellipse (71) on left: 27 28 on right: 28 29 block (72) on left: 29 30 on right: 21 23 31 statement (73) on left: 31 32 33 34 35 36 37 on right: 4 27 28 39 40 41 vardecl (74) on left: 38 on right: 32 while (75) on left: 39 on right: 33 ifelse (76) on left: 40 41 on right: 34 return (77) on left: 42 43 on right: 35 binop (78) on left: 44 45 46 47 48 49 50 51 52 53 54 on right: 59 unop (79) on left: 55 56 57 58 on right: 60 expr (80) on left: 59 60 61 62 63 64 65 on right: 36 38 39 40 41 42 59 60 63 67 68 69 70 74 75 allocator (81) on left: 66 67 68 on right: 61 call_elipse (82) on left: 69 70 on right: 70 71 call (83) on left: 71 72 on right: 62 variable (84) on left: 73 74 75 on right: 64 constant (85) on left: 76 77 78 79 on right: 65
0 $accept → . start $end 1 start → . program 2 program → . program structdef 3 | . program function 4 | . program statement 5 | . program error '}' 6 | . program error ';' 7 | . %empty $default reduce using rule 7 (program) start go to state 1 program go to state 2
0 $accept → start . $end $end shift, and go to state 3
1 start → program . [$end] 2 program → program . structdef 3 | program . function 4 | program . statement 5 | program . error '}' 6 | program . error ';' 10 structdef → . TOK_STRUCT TOK_IDENT structdef_ellipse '}' 11 | . TOK_STRUCT TOK_IDENT '{' '}' 14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 21 function → . identdecl function_ellipse ')' block 22 | . identdecl function_ellipse ')' ';' 23 | . identdecl '(' ')' block 24 | . identdecl '(' ')' ';' 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 41 | . TOK_IF '(' expr ')' statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL error shift, and go to state 4 TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_STRUCT shift, and go to state 11 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 ';' shift, and go to state 23 '(' shift, and go to state 24 $end reduce using rule 1 (start) structdef go to state 25 basetype go to state 26 function go to state 27 identdecl go to state 28 block_ellipse go to state 29 block go to state 30 statement go to state 31 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
0 $accept → start $end . $default accept
5 program → program error . '}' 6 | program error . ';' '}' shift, and go to state 43 ';' shift, and go to state 44
14 basetype → TOK_VOID . $default reduce using rule 14 (basetype)
15 basetype → TOK_INT . $default reduce using rule 15 (basetype)
16 basetype → TOK_STRING . $default reduce using rule 16 (basetype)
40 ifelse → TOK_IF . '(' expr ')' statement TOK_ELSE statement 41 | TOK_IF . '(' expr ')' statement '(' shift, and go to state 45
39 while → TOK_WHILE . '(' expr ')' statement '(' shift, and go to state 46
42 return → TOK_RETURN . expr ';' 43 | TOK_RETURN . ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 ';' shift, and go to state 48 '(' shift, and go to state 24 unop go to state 36 expr go to state 49 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
10 structdef → TOK_STRUCT . TOK_IDENT structdef_ellipse '}' 11 | TOK_STRUCT . TOK_IDENT '{' '}' TOK_IDENT shift, and go to state 50
79 constant → TOK_NULL . $default reduce using rule 79 (constant)
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 58 unop → TOK_NEW . [TOK_NULL, TOK_NEW, TOK_INTCON, TOK_CHARCON, TOK_STRINGCON, '+', '-', '!', '('] 66 allocator → TOK_NEW . TOK_IDENT '(' ')' 67 | TOK_NEW . TOK_STRING '(' expr ')' 68 | TOK_NEW . basetype '[' expr ']' TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 51 TOK_IDENT shift, and go to state 52 TOK_TYPEID shift, and go to state 18 $default reduce using rule 58 (unop) basetype go to state 53 Conflict between rule 58 and token TOK_IDENT resolved as shift (TOK_NEW < TOK_IDENT).
18 basetype → TOK_IDENT . [TOK_ARRAY, TOK_IDENT] 69 call_elipse → TOK_IDENT . '(' expr 72 call → TOK_IDENT . '(' ')' 73 variable → TOK_IDENT . [TOK_EQ, TOK_NE, TOK_LT, TOK_LE, TOK_GT, TOK_GE, '=', '+', '-', '*', '/', '.', ';', '['] '(' shift, and go to state 54 TOK_ARRAY reduce using rule 18 (basetype) TOK_IDENT reduce using rule 18 (basetype) $default reduce using rule 73 (variable)
76 constant → TOK_INTCON . $default reduce using rule 76 (constant)
77 constant → TOK_CHARCON . $default reduce using rule 77 (constant)
78 constant → TOK_STRINGCON . $default reduce using rule 78 (constant)
17 basetype → TOK_TYPEID . $default reduce using rule 17 (basetype)
55 unop → '+' . $default reduce using rule 55 (unop)
56 unop → '-' . $default reduce using rule 56 (unop)
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 27 | '{' . statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' 30 | '{' . '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 41 | . TOK_IF '(' expr ')' statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 '}' shift, and go to state 55 ';' shift, and go to state 23 '(' shift, and go to state 24 basetype go to state 26 identdecl go to state 56 block_ellipse go to state 29 block go to state 30 statement go to state 57 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
57 unop → '!' . $default reduce using rule 57 (unop)
37 statement → ';' . $default reduce using rule 37 (statement)
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 63 | '(' . expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 58 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
2 program → program structdef . $default reduce using rule 2 (program)
25 identdecl → basetype . TOK_IDENT 26 | basetype . TOK_ARRAY TOK_IDENT TOK_ARRAY shift, and go to state 59 TOK_IDENT shift, and go to state 60
3 program → program function . $default reduce using rule 3 (program)
19 function_ellipse → . '(' identdecl 20 | . function_ellipse ',' identdecl 21 function → identdecl . function_ellipse ')' block 22 | identdecl . function_ellipse ')' ';' 23 | identdecl . '(' ')' block 24 | identdecl . '(' ')' ';' 38 vardecl → identdecl . '=' expr ';' '=' shift, and go to state 61 '(' shift, and go to state 62 function_ellipse go to state 63
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 28 | block_ellipse . statement 29 block → . block_ellipse '}' 29 | block_ellipse . '}' 30 | . '{' '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 41 | . TOK_IF '(' expr ')' statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 '}' shift, and go to state 64 ';' shift, and go to state 23 '(' shift, and go to state 24 basetype go to state 26 identdecl go to state 56 block_ellipse go to state 29 block go to state 30 statement go to state 65 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
31 statement → block . $default reduce using rule 31 (statement)
4 program → program statement . $default reduce using rule 4 (program)
32 statement → vardecl . $default reduce using rule 32 (statement)
33 statement → while . $default reduce using rule 33 (statement)
34 statement → ifelse . $default reduce using rule 34 (statement)
35 statement → return . $default reduce using rule 35 (statement)
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 60 | unop . expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 66 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
36 statement → expr . ';' 44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ';' shift, and go to state 79 '[' shift, and go to state 80 binop go to state 81
61 expr → allocator . $default reduce using rule 61 (expr)
70 call_elipse → call_elipse . ',' expr 71 call → call_elipse . ')' ',' shift, and go to state 82 ')' shift, and go to state 83
62 expr → call . $default reduce using rule 62 (expr)
64 expr → variable . $default reduce using rule 64 (expr)
65 expr → constant . $default reduce using rule 65 (expr)
5 program → program error '}' . $default reduce using rule 5 (program)
6 program → program error ';' . $default reduce using rule 6 (program)
40 ifelse → TOK_IF '(' . expr ')' statement TOK_ELSE statement 41 | TOK_IF '(' . expr ')' statement 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 84 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
39 while → TOK_WHILE '(' . expr ')' statement 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 85 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
69 call_elipse → TOK_IDENT . '(' expr 72 call → TOK_IDENT . '(' ')' 73 variable → TOK_IDENT . [TOK_EQ, TOK_NE, TOK_LT, TOK_LE, TOK_GT, TOK_GE, '=', '+', '-', '*', '/', '.', ';', ',', ')', '[', ']'] '(' shift, and go to state 54 $default reduce using rule 73 (variable)
43 return → TOK_RETURN ';' . $default reduce using rule 43 (return)
42 return → TOK_RETURN expr . ';' 44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ';' shift, and go to state 86 '[' shift, and go to state 80 binop go to state 81
8 structdef_ellipse → . '{' fielddecl ';' 9 | . structdef_ellipse fielddecl ';' 10 structdef → TOK_STRUCT TOK_IDENT . structdef_ellipse '}' 11 | TOK_STRUCT TOK_IDENT . '{' '}' '{' shift, and go to state 87 structdef_ellipse go to state 88
16 basetype → TOK_STRING . ['['] 67 allocator → TOK_NEW TOK_STRING . '(' expr ')' '(' shift, and go to state 89 $default reduce using rule 16 (basetype)
18 basetype → TOK_IDENT . ['['] 66 allocator → TOK_NEW TOK_IDENT . '(' ')' '(' shift, and go to state 90 $default reduce using rule 18 (basetype)
68 allocator → TOK_NEW basetype . '[' expr ']' '[' shift, and go to state 91
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 69 | TOK_IDENT '(' . expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 72 | TOK_IDENT '(' . ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 ')' shift, and go to state 92 unop go to state 36 expr go to state 93 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
30 block → '{' '}' . $default reduce using rule 30 (block)
38 vardecl → identdecl . '=' expr ';' '=' shift, and go to state 61
27 block_ellipse → '{' statement . $default reduce using rule 27 (block_ellipse)
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 63 | '(' expr . ')' 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ')' shift, and go to state 94 '[' shift, and go to state 80 binop go to state 81
26 identdecl → basetype TOK_ARRAY . TOK_IDENT TOK_IDENT shift, and go to state 95
25 identdecl → basetype TOK_IDENT . $default reduce using rule 25 (identdecl)
38 vardecl → identdecl '=' . expr ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 96 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 19 function_ellipse → '(' . identdecl 23 function → identdecl '(' . ')' block 24 | identdecl '(' . ')' ';' 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IDENT shift, and go to state 97 TOK_TYPEID shift, and go to state 18 ')' shift, and go to state 98 basetype go to state 26 identdecl go to state 99
20 function_ellipse → function_ellipse . ',' identdecl 21 function → identdecl function_ellipse . ')' block 22 | identdecl function_ellipse . ')' ';' ',' shift, and go to state 100 ')' shift, and go to state 101
29 block → block_ellipse '}' . $default reduce using rule 29 (block)
28 block_ellipse → block_ellipse statement . $default reduce using rule 28 (block_ellipse)
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 60 | unop expr . [TOK_EQ, TOK_NE, TOK_LT, TOK_LE, TOK_GT, TOK_GE, '=', '+', '-', '*', '/', '.', ';', ',', ')', '[', ']'] 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 TOK_EQ [reduce using rule 60 (expr)] TOK_NE [reduce using rule 60 (expr)] TOK_LT [reduce using rule 60 (expr)] TOK_LE [reduce using rule 60 (expr)] TOK_GT [reduce using rule 60 (expr)] TOK_GE [reduce using rule 60 (expr)] '=' [reduce using rule 60 (expr)] '+' [reduce using rule 60 (expr)] '-' [reduce using rule 60 (expr)] '*' [reduce using rule 60 (expr)] '/' [reduce using rule 60 (expr)] '.' [reduce using rule 60 (expr)] '[' [reduce using rule 60 (expr)] $default reduce using rule 60 (expr) binop go to state 81
44 binop → TOK_EQ . $default reduce using rule 44 (binop)
45 binop → TOK_NE . $default reduce using rule 45 (binop)
46 binop → TOK_LT . $default reduce using rule 46 (binop)
47 binop → TOK_LE . $default reduce using rule 47 (binop)
48 binop → TOK_GT . $default reduce using rule 48 (binop)
49 binop → TOK_GE . $default reduce using rule 49 (binop)
50 binop → '=' . $default reduce using rule 50 (binop)
51 binop → '+' . $default reduce using rule 51 (binop)
52 binop → '-' . $default reduce using rule 52 (binop)
53 binop → '*' . $default reduce using rule 53 (binop)
54 binop → '/' . $default reduce using rule 54 (binop)
75 variable → expr '.' . TOK_IDENT TOK_IDENT shift, and go to state 102
36 statement → expr ';' . $default reduce using rule 36 (statement)
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 74 | expr '[' . expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 103 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 59 | expr binop . expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 104 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 70 | call_elipse ',' . expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 105 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
71 call → call_elipse ')' . $default reduce using rule 71 (call)
40 ifelse → TOK_IF '(' expr . ')' statement TOK_ELSE statement 41 | TOK_IF '(' expr . ')' statement 44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ')' shift, and go to state 106 '[' shift, and go to state 80 binop go to state 81
39 while → TOK_WHILE '(' expr . ')' statement 44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ')' shift, and go to state 107 '[' shift, and go to state 80 binop go to state 81
42 return → TOK_RETURN expr ';' . $default reduce using rule 42 (return)
8 structdef_ellipse → '{' . fielddecl ';' 11 structdef → TOK_STRUCT TOK_IDENT '{' . '}' 12 fielddecl → . basetype TOK_IDENT 13 | . basetype TOK_ARRAY TOK_IDENT 14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IDENT shift, and go to state 97 TOK_TYPEID shift, and go to state 18 '}' shift, and go to state 108 fielddecl go to state 109 basetype go to state 110
9 structdef_ellipse → structdef_ellipse . fielddecl ';' 10 structdef → TOK_STRUCT TOK_IDENT structdef_ellipse . '}' 12 fielddecl → . basetype TOK_IDENT 13 | . basetype TOK_ARRAY TOK_IDENT 14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IDENT shift, and go to state 97 TOK_TYPEID shift, and go to state 18 '}' shift, and go to state 111 fielddecl go to state 112 basetype go to state 110
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 67 | TOK_NEW TOK_STRING '(' . expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 113 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
66 allocator → TOK_NEW TOK_IDENT '(' . ')' ')' shift, and go to state 114
55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 68 | TOK_NEW basetype '[' . expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 47 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 '+' shift, and go to state 19 '-' shift, and go to state 20 '!' shift, and go to state 22 '(' shift, and go to state 24 unop go to state 36 expr go to state 115 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
72 call → TOK_IDENT '(' ')' . $default reduce using rule 72 (call)
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 69 call_elipse → TOK_IDENT '(' expr . [',', ')'] 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 $default reduce using rule 69 (call_elipse) binop go to state 81
63 expr → '(' expr ')' . $default reduce using rule 63 (expr)
26 identdecl → basetype TOK_ARRAY TOK_IDENT . $default reduce using rule 26 (identdecl)
38 vardecl → identdecl '=' expr . ';' 44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ';' shift, and go to state 116 '[' shift, and go to state 80 binop go to state 81
18 basetype → TOK_IDENT . $default reduce using rule 18 (basetype)
23 function → identdecl '(' ')' . block 24 | identdecl '(' ')' . ';' 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' '{' shift, and go to state 21 ';' shift, and go to state 117 block_ellipse go to state 29 block go to state 118
19 function_ellipse → '(' identdecl . $default reduce using rule 19 (function_ellipse)
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 20 function_ellipse → function_ellipse ',' . identdecl 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IDENT shift, and go to state 97 TOK_TYPEID shift, and go to state 18 basetype go to state 26 identdecl go to state 119
21 function → identdecl function_ellipse ')' . block 22 | identdecl function_ellipse ')' . ';' 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' '{' shift, and go to state 21 ';' shift, and go to state 120 block_ellipse go to state 29 block go to state 121
75 variable → expr '.' TOK_IDENT . $default reduce using rule 75 (variable)
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 74 variable → expr . '[' expr ']' 74 | expr '[' expr . ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 ']' shift, and go to state 122 binop go to state 81
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 59 | expr binop expr . [TOK_EQ, TOK_NE, TOK_LT, TOK_LE, TOK_GT, TOK_GE, '=', '+', '-', '*', '/', '.', ';', ',', ')', '[', ']'] 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 TOK_EQ [reduce using rule 59 (expr)] TOK_NE [reduce using rule 59 (expr)] TOK_LT [reduce using rule 59 (expr)] TOK_LE [reduce using rule 59 (expr)] TOK_GT [reduce using rule 59 (expr)] TOK_GE [reduce using rule 59 (expr)] '=' [reduce using rule 59 (expr)] '+' [reduce using rule 59 (expr)] '-' [reduce using rule 59 (expr)] '*' [reduce using rule 59 (expr)] '/' [reduce using rule 59 (expr)] '.' [reduce using rule 59 (expr)] '[' [reduce using rule 59 (expr)] $default reduce using rule 59 (expr) binop go to state 81
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 70 call_elipse → call_elipse ',' expr . [',', ')'] 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 $default reduce using rule 70 (call_elipse) binop go to state 81
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 40 | TOK_IF '(' expr ')' . statement TOK_ELSE statement 41 | . TOK_IF '(' expr ')' statement 41 | TOK_IF '(' expr ')' . statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 ';' shift, and go to state 23 '(' shift, and go to state 24 basetype go to state 26 identdecl go to state 56 block_ellipse go to state 29 block go to state 30 statement go to state 123 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 39 | TOK_WHILE '(' expr ')' . statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 41 | . TOK_IF '(' expr ')' statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 ';' shift, and go to state 23 '(' shift, and go to state 24 basetype go to state 26 identdecl go to state 56 block_ellipse go to state 29 block go to state 30 statement go to state 124 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
11 structdef → TOK_STRUCT TOK_IDENT '{' '}' . $default reduce using rule 11 (structdef)
8 structdef_ellipse → '{' fielddecl . ';' ';' shift, and go to state 125
12 fielddecl → basetype . TOK_IDENT 13 | basetype . TOK_ARRAY TOK_IDENT TOK_ARRAY shift, and go to state 126 TOK_IDENT shift, and go to state 127
10 structdef → TOK_STRUCT TOK_IDENT structdef_ellipse '}' . $default reduce using rule 10 (structdef)
9 structdef_ellipse → structdef_ellipse fielddecl . ';' ';' shift, and go to state 128
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 67 allocator → TOK_NEW TOK_STRING '(' expr . ')' 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 ')' shift, and go to state 129 '[' shift, and go to state 80 binop go to state 81
66 allocator → TOK_NEW TOK_IDENT '(' ')' . $default reduce using rule 66 (allocator)
44 binop → . TOK_EQ 45 | . TOK_NE 46 | . TOK_LT 47 | . TOK_LE 48 | . TOK_GT 49 | . TOK_GE 50 | . '=' 51 | . '+' 52 | . '-' 53 | . '*' 54 | . '/' 59 expr → expr . binop expr 68 allocator → TOK_NEW basetype '[' expr . ']' 74 variable → expr . '[' expr ']' 75 | expr . '.' TOK_IDENT TOK_EQ shift, and go to state 67 TOK_NE shift, and go to state 68 TOK_LT shift, and go to state 69 TOK_LE shift, and go to state 70 TOK_GT shift, and go to state 71 TOK_GE shift, and go to state 72 '=' shift, and go to state 73 '+' shift, and go to state 74 '-' shift, and go to state 75 '*' shift, and go to state 76 '/' shift, and go to state 77 '.' shift, and go to state 78 '[' shift, and go to state 80 ']' shift, and go to state 130 binop go to state 81
38 vardecl → identdecl '=' expr ';' . $default reduce using rule 38 (vardecl)
24 function → identdecl '(' ')' ';' . $default reduce using rule 24 (function)
23 function → identdecl '(' ')' block . $default reduce using rule 23 (function)
20 function_ellipse → function_ellipse ',' identdecl . $default reduce using rule 20 (function_ellipse)
22 function → identdecl function_ellipse ')' ';' . $default reduce using rule 22 (function)
21 function → identdecl function_ellipse ')' block . $default reduce using rule 21 (function)
74 variable → expr '[' expr ']' . $default reduce using rule 74 (variable)
40 ifelse → TOK_IF '(' expr ')' statement . TOK_ELSE statement 41 | TOK_IF '(' expr ')' statement . [$end, error, TOK_VOID, TOK_INT, TOK_STRING, TOK_IF, TOK_ELSE, TOK_WHILE, TOK_RETURN, TOK_STRUCT, TOK_NULL, TOK_NEW, TOK_IDENT, TOK_INTCON, TOK_CHARCON, TOK_STRINGCON, TOK_TYPEID, '+', '-', '{', '!', '}', ';', '('] TOK_ELSE shift, and go to state 131 TOK_ELSE [reduce using rule 41 (ifelse)] $default reduce using rule 41 (ifelse)
39 while → TOK_WHILE '(' expr ')' statement . $default reduce using rule 39 (while)
8 structdef_ellipse → '{' fielddecl ';' . $default reduce using rule 8 (structdef_ellipse)
13 fielddecl → basetype TOK_ARRAY . TOK_IDENT TOK_IDENT shift, and go to state 132
12 fielddecl → basetype TOK_IDENT . $default reduce using rule 12 (fielddecl)
9 structdef_ellipse → structdef_ellipse fielddecl ';' . $default reduce using rule 9 (structdef_ellipse)
67 allocator → TOK_NEW TOK_STRING '(' expr ')' . $default reduce using rule 67 (allocator)
68 allocator → TOK_NEW basetype '[' expr ']' . $default reduce using rule 68 (allocator)
14 basetype → . TOK_VOID 15 | . TOK_INT 16 | . TOK_STRING 17 | . TOK_TYPEID 18 | . TOK_IDENT 25 identdecl → . basetype TOK_IDENT 26 | . basetype TOK_ARRAY TOK_IDENT 27 block_ellipse → . '{' statement 28 | . block_ellipse statement 29 block → . block_ellipse '}' 30 | . '{' '}' 31 statement → . block 32 | . vardecl 33 | . while 34 | . ifelse 35 | . return 36 | . expr ';' 37 | . ';' 38 vardecl → . identdecl '=' expr ';' 39 while → . TOK_WHILE '(' expr ')' statement 40 ifelse → . TOK_IF '(' expr ')' statement TOK_ELSE statement 40 | TOK_IF '(' expr ')' statement TOK_ELSE . statement 41 | . TOK_IF '(' expr ')' statement 42 return → . TOK_RETURN expr ';' 43 | . TOK_RETURN ';' 55 unop → . '+' 56 | . '-' 57 | . '!' 58 | . TOK_NEW 59 expr → . expr binop expr 60 | . unop expr 61 | . allocator 62 | . call 63 | . '(' expr ')' 64 | . variable 65 | . constant 66 allocator → . TOK_NEW TOK_IDENT '(' ')' 67 | . TOK_NEW TOK_STRING '(' expr ')' 68 | . TOK_NEW basetype '[' expr ']' 69 call_elipse → . TOK_IDENT '(' expr 70 | . call_elipse ',' expr 71 call → . call_elipse ')' 72 | . TOK_IDENT '(' ')' 73 variable → . TOK_IDENT 74 | . expr '[' expr ']' 75 | . expr '.' TOK_IDENT 76 constant → . TOK_INTCON 77 | . TOK_CHARCON 78 | . TOK_STRINGCON 79 | . TOK_NULL TOK_VOID shift, and go to state 5 TOK_INT shift, and go to state 6 TOK_STRING shift, and go to state 7 TOK_IF shift, and go to state 8 TOK_WHILE shift, and go to state 9 TOK_RETURN shift, and go to state 10 TOK_NULL shift, and go to state 12 TOK_NEW shift, and go to state 13 TOK_IDENT shift, and go to state 14 TOK_INTCON shift, and go to state 15 TOK_CHARCON shift, and go to state 16 TOK_STRINGCON shift, and go to state 17 TOK_TYPEID shift, and go to state 18 '+' shift, and go to state 19 '-' shift, and go to state 20 '{' shift, and go to state 21 '!' shift, and go to state 22 ';' shift, and go to state 23 '(' shift, and go to state 24 basetype go to state 26 identdecl go to state 56 block_ellipse go to state 29 block go to state 30 statement go to state 133 vardecl go to state 32 while go to state 33 ifelse go to state 34 return go to state 35 unop go to state 36 expr go to state 37 allocator go to state 38 call_elipse go to state 39 call go to state 40 variable go to state 41 constant go to state 42
13 fielddecl → basetype TOK_ARRAY TOK_IDENT . $default reduce using rule 13 (fielddecl)
40 ifelse → TOK_IF '(' expr ')' statement TOK_ELSE statement . $default reduce using rule 40 (ifelse)
This document was generated using GNU Bison 3.0.4 XML Automaton Report.
Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.