Files

1880 lines
37 KiB
Plaintext

Grammar
0 $accept: Program $end
1 Program: Externs T_PACKAGE T_ID '{' FieldDecls MethodDecls '}'
2 Externs: %empty
3 | ExternDefn Externs
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' ExternParmList ')' MethodType ';'
5 ExternParmList: %empty
6 | FullExternParmList
7 FullExternParmList: ExternType
8 | ExternType ',' ExternParmList
9 FieldDecls: %empty
10 | FieldDecl FieldDecls
11 FieldDecl: T_VAR T_ID Type ';'
12 | T_VAR T_ID ArrayType ';'
13 | T_VAR T_ID Type T_ASSIGN Constant ';'
14 MethodDecls: %empty
15 | MethodDecl MethodDecls
16 MethodDecl: T_FUNC T_ID '(' IdTypeList ')' MethodType Block
17 IdTypeList: %empty
18 | IdTypeList1
19 IdTypeList1: T_ID Type
20 | T_ID Type ',' IdTypeList
21 Block: '{' VarDecls Statements '}'
22 VarDecls: %empty
23 | VarDecl VarDecls
24 VarDecl: T_VAR T_ID Type ';'
25 | T_VAR T_ID ArrayType ';'
26 Statements: %empty
27 | Statement Statements
28 Statement: Block
29 | Assign ';'
30 | MethodCall ';'
31 | IfStmt
32 | WhileStmt
33 | ReturnStmt
34 | BreakStmt
35 | ContinueStmt
36 ContinueStmt: T_CONTINUE ';'
37 WhileStmt: T_WHILE '(' Expr ')' Block
38 BreakStmt: T_BREAK ';'
39 IfStmt: T_IF '(' Expr ')' Block T_ELSE Block
40 | T_IF '(' Expr ')' Block
41 ReturnStmt: T_RETURN ';'
42 | T_RETURN '(' ')' ';'
43 | T_RETURN '(' Expr ')' ';'
44 Assign: Lvalue T_ASSIGN Expr
45 Lvalue: T_ID
46 | T_ID '[' Expr ']'
47 MethodCall: T_ID '(' MethodArgs ')'
48 MethodArg: Expr
49 MethodArgs: %empty
50 | FullMethodArgs
51 FullMethodArgs: MethodArg
52 | MethodArg ',' MethodArgs
53 Expr: Simpleexpression
54 Simpleexpression: Additiveexpression
55 | Simpleexpression Relop Additiveexpression
56 Relop: '<'
57 | '>'
58 | T_EQ
59 | T_LEQ
60 | T_GEQ
61 | T_NEQ
62 Additiveexpression: Term
63 | Additiveexpression Addop Term
64 Addop: '+'
65 | '-'
66 Term: Factor
67 | Term Multop Factor
68 Multop: '*'
69 | '/'
70 | '%'
71 | T_AND
72 | T_OR
73 | T_LEFTSHIFT
74 | T_RIGHTSHIFT
75 Factor: T_ID
76 | MethodCall
77 | T_ID '[' Expr ']'
78 | Constant
79 | '(' Expr ')'
80 | '!' Factor
81 | T_STRINGCONSTANT
82 | '-' Factor
83 ExternType: T_STRINGTYPE
84 | Type
85 Type: T_INTTYPE
86 | T_BOOLTYPE
87 MethodType: T_VOID
88 | Type
89 BoolConstant: T_TRUE
90 | T_FALSE
91 ArrayType: '[' T_INTCONSTANT ']' Type
92 Constant: T_INTCONSTANT
93 | BoolConstant
Terminals, with rules where they appear
$end (0) 0
'!' (33) 80
'%' (37) 70
'(' (40) 4 16 37 39 40 42 43 47 79
')' (41) 4 16 37 39 40 42 43 47 79
'*' (42) 68
'+' (43) 64
',' (44) 8 20 52
'-' (45) 65 82
'/' (47) 69
';' (59) 4 11 12 13 24 25 29 30 36 38 41 42 43
'<' (60) 56
'>' (62) 57
'[' (91) 46 77 91
']' (93) 46 77 91
'{' (123) 1 21
'}' (125) 1 21
error (256)
T_AND (258) 71
T_ASSIGN (259) 13 44
T_BOOLTYPE (260) 86
T_BREAK (261) 38
T_CONTINUE (262) 36
T_ELSE (263) 39
T_EQ (264) 58
T_EXTERN (265) 4
T_FALSE (266) 90
T_FUNC (267) 4 16
T_GEQ (268) 60
T_ID (269) 1 4 11 12 13 16 19 20 24 25 45 46 47 75 77
T_IF (270) 39 40
T_INTCONSTANT (271) 91 92
T_INTTYPE (272) 85
T_LEFTSHIFT (273) 73
T_LEQ (274) 59
T_NEQ (275) 61
T_OR (276) 72
T_PACKAGE (277) 1
T_RETURN (278) 41 42 43
T_RIGHTSHIFT (279) 74
T_STRINGCONSTANT (280) 81
T_STRINGTYPE (281) 83
T_TRUE (282) 89
T_VAR (283) 11 12 13 24 25
T_VOID (284) 87
T_WHILE (285) 37
Nonterminals, with rules where they appear
$accept (47)
on left: 0
Program (48)
on left: 1, on right: 0
Externs (49)
on left: 2 3, on right: 1 3
ExternDefn (50)
on left: 4, on right: 3
ExternParmList (51)
on left: 5 6, on right: 4 8
FullExternParmList (52)
on left: 7 8, on right: 6
FieldDecls (53)
on left: 9 10, on right: 1 10
FieldDecl (54)
on left: 11 12 13, on right: 10
MethodDecls (55)
on left: 14 15, on right: 1 15
MethodDecl (56)
on left: 16, on right: 15
IdTypeList (57)
on left: 17 18, on right: 16 20
IdTypeList1 (58)
on left: 19 20, on right: 18
Block (59)
on left: 21, on right: 16 28 37 39 40
VarDecls (60)
on left: 22 23, on right: 21 23
VarDecl (61)
on left: 24 25, on right: 23
Statements (62)
on left: 26 27, on right: 21 27
Statement (63)
on left: 28 29 30 31 32 33 34 35, on right: 27
ContinueStmt (64)
on left: 36, on right: 35
WhileStmt (65)
on left: 37, on right: 32
BreakStmt (66)
on left: 38, on right: 34
IfStmt (67)
on left: 39 40, on right: 31
ReturnStmt (68)
on left: 41 42 43, on right: 33
Assign (69)
on left: 44, on right: 29
Lvalue (70)
on left: 45 46, on right: 44
MethodCall (71)
on left: 47, on right: 30 76
MethodArg (72)
on left: 48, on right: 51 52
MethodArgs (73)
on left: 49 50, on right: 47 52
FullMethodArgs (74)
on left: 51 52, on right: 50
Expr (75)
on left: 53, on right: 37 39 40 43 44 46 48 77 79
Simpleexpression (76)
on left: 54 55, on right: 53 55
Relop (77)
on left: 56 57 58 59 60 61, on right: 55
Additiveexpression (78)
on left: 62 63, on right: 54 55 63
Addop (79)
on left: 64 65, on right: 63
Term (80)
on left: 66 67, on right: 62 63 67
Multop (81)
on left: 68 69 70 71 72 73 74, on right: 67
Factor (82)
on left: 75 76 77 78 79 80 81 82, on right: 66 67 80 82
ExternType (83)
on left: 83 84, on right: 7 8
Type (84)
on left: 85 86, on right: 11 13 19 20 24 84 88 91
MethodType (85)
on left: 87 88, on right: 4 16
BoolConstant (86)
on left: 89 90, on right: 93
ArrayType (87)
on left: 91, on right: 12 25
Constant (88)
on left: 92 93, on right: 13 78
State 0
0 $accept: . Program $end
T_EXTERN shift, and go to state 1
$default reduce using rule 2 (Externs)
Program go to state 2
Externs go to state 3
ExternDefn go to state 4
State 1
4 ExternDefn: T_EXTERN . T_FUNC T_ID '(' ExternParmList ')' MethodType ';'
T_FUNC shift, and go to state 5
State 2
0 $accept: Program . $end
$end shift, and go to state 6
State 3
1 Program: Externs . T_PACKAGE T_ID '{' FieldDecls MethodDecls '}'
T_PACKAGE shift, and go to state 7
State 4
3 Externs: ExternDefn . Externs
T_EXTERN shift, and go to state 1
$default reduce using rule 2 (Externs)
Externs go to state 8
ExternDefn go to state 4
State 5
4 ExternDefn: T_EXTERN T_FUNC . T_ID '(' ExternParmList ')' MethodType ';'
T_ID shift, and go to state 9
State 6
0 $accept: Program $end .
$default accept
State 7
1 Program: Externs T_PACKAGE . T_ID '{' FieldDecls MethodDecls '}'
T_ID shift, and go to state 10
State 8
3 Externs: ExternDefn Externs .
$default reduce using rule 3 (Externs)
State 9
4 ExternDefn: T_EXTERN T_FUNC T_ID . '(' ExternParmList ')' MethodType ';'
'(' shift, and go to state 11
State 10
1 Program: Externs T_PACKAGE T_ID . '{' FieldDecls MethodDecls '}'
'{' shift, and go to state 12
State 11
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' . ExternParmList ')' MethodType ';'
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
T_STRINGTYPE shift, and go to state 15
$default reduce using rule 5 (ExternParmList)
ExternParmList go to state 16
FullExternParmList go to state 17
ExternType go to state 18
Type go to state 19
State 12
1 Program: Externs T_PACKAGE T_ID '{' . FieldDecls MethodDecls '}'
T_VAR shift, and go to state 20
$default reduce using rule 9 (FieldDecls)
FieldDecls go to state 21
FieldDecl go to state 22
State 13
86 Type: T_BOOLTYPE .
$default reduce using rule 86 (Type)
State 14
85 Type: T_INTTYPE .
$default reduce using rule 85 (Type)
State 15
83 ExternType: T_STRINGTYPE .
$default reduce using rule 83 (ExternType)
State 16
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' ExternParmList . ')' MethodType ';'
')' shift, and go to state 23
State 17
6 ExternParmList: FullExternParmList .
$default reduce using rule 6 (ExternParmList)
State 18
7 FullExternParmList: ExternType .
8 | ExternType . ',' ExternParmList
',' shift, and go to state 24
$default reduce using rule 7 (FullExternParmList)
State 19
84 ExternType: Type .
$default reduce using rule 84 (ExternType)
State 20
11 FieldDecl: T_VAR . T_ID Type ';'
12 | T_VAR . T_ID ArrayType ';'
13 | T_VAR . T_ID Type T_ASSIGN Constant ';'
T_ID shift, and go to state 25
State 21
1 Program: Externs T_PACKAGE T_ID '{' FieldDecls . MethodDecls '}'
T_FUNC shift, and go to state 26
$default reduce using rule 14 (MethodDecls)
MethodDecls go to state 27
MethodDecl go to state 28
State 22
10 FieldDecls: FieldDecl . FieldDecls
T_VAR shift, and go to state 20
$default reduce using rule 9 (FieldDecls)
FieldDecls go to state 29
FieldDecl go to state 22
State 23
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' ExternParmList ')' . MethodType ';'
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
T_VOID shift, and go to state 30
Type go to state 31
MethodType go to state 32
State 24
8 FullExternParmList: ExternType ',' . ExternParmList
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
T_STRINGTYPE shift, and go to state 15
$default reduce using rule 5 (ExternParmList)
ExternParmList go to state 33
FullExternParmList go to state 17
ExternType go to state 18
Type go to state 19
State 25
11 FieldDecl: T_VAR T_ID . Type ';'
12 | T_VAR T_ID . ArrayType ';'
13 | T_VAR T_ID . Type T_ASSIGN Constant ';'
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
'[' shift, and go to state 34
Type go to state 35
ArrayType go to state 36
State 26
16 MethodDecl: T_FUNC . T_ID '(' IdTypeList ')' MethodType Block
T_ID shift, and go to state 37
State 27
1 Program: Externs T_PACKAGE T_ID '{' FieldDecls MethodDecls . '}'
'}' shift, and go to state 38
State 28
15 MethodDecls: MethodDecl . MethodDecls
T_FUNC shift, and go to state 26
$default reduce using rule 14 (MethodDecls)
MethodDecls go to state 39
MethodDecl go to state 28
State 29
10 FieldDecls: FieldDecl FieldDecls .
$default reduce using rule 10 (FieldDecls)
State 30
87 MethodType: T_VOID .
$default reduce using rule 87 (MethodType)
State 31
88 MethodType: Type .
$default reduce using rule 88 (MethodType)
State 32
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' ExternParmList ')' MethodType . ';'
';' shift, and go to state 40
State 33
8 FullExternParmList: ExternType ',' ExternParmList .
$default reduce using rule 8 (FullExternParmList)
State 34
91 ArrayType: '[' . T_INTCONSTANT ']' Type
T_INTCONSTANT shift, and go to state 41
State 35
11 FieldDecl: T_VAR T_ID Type . ';'
13 | T_VAR T_ID Type . T_ASSIGN Constant ';'
T_ASSIGN shift, and go to state 42
';' shift, and go to state 43
State 36
12 FieldDecl: T_VAR T_ID ArrayType . ';'
';' shift, and go to state 44
State 37
16 MethodDecl: T_FUNC T_ID . '(' IdTypeList ')' MethodType Block
'(' shift, and go to state 45
State 38
1 Program: Externs T_PACKAGE T_ID '{' FieldDecls MethodDecls '}' .
$default reduce using rule 1 (Program)
State 39
15 MethodDecls: MethodDecl MethodDecls .
$default reduce using rule 15 (MethodDecls)
State 40
4 ExternDefn: T_EXTERN T_FUNC T_ID '(' ExternParmList ')' MethodType ';' .
$default reduce using rule 4 (ExternDefn)
State 41
91 ArrayType: '[' T_INTCONSTANT . ']' Type
']' shift, and go to state 46
State 42
13 FieldDecl: T_VAR T_ID Type T_ASSIGN . Constant ';'
T_FALSE shift, and go to state 47
T_INTCONSTANT shift, and go to state 48
T_TRUE shift, and go to state 49
BoolConstant go to state 50
Constant go to state 51
State 43
11 FieldDecl: T_VAR T_ID Type ';' .
$default reduce using rule 11 (FieldDecl)
State 44
12 FieldDecl: T_VAR T_ID ArrayType ';' .
$default reduce using rule 12 (FieldDecl)
State 45
16 MethodDecl: T_FUNC T_ID '(' . IdTypeList ')' MethodType Block
T_ID shift, and go to state 52
$default reduce using rule 17 (IdTypeList)
IdTypeList go to state 53
IdTypeList1 go to state 54
State 46
91 ArrayType: '[' T_INTCONSTANT ']' . Type
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
Type go to state 55
State 47
90 BoolConstant: T_FALSE .
$default reduce using rule 90 (BoolConstant)
State 48
92 Constant: T_INTCONSTANT .
$default reduce using rule 92 (Constant)
State 49
89 BoolConstant: T_TRUE .
$default reduce using rule 89 (BoolConstant)
State 50
93 Constant: BoolConstant .
$default reduce using rule 93 (Constant)
State 51
13 FieldDecl: T_VAR T_ID Type T_ASSIGN Constant . ';'
';' shift, and go to state 56
State 52
19 IdTypeList1: T_ID . Type
20 | T_ID . Type ',' IdTypeList
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
Type go to state 57
State 53
16 MethodDecl: T_FUNC T_ID '(' IdTypeList . ')' MethodType Block
')' shift, and go to state 58
State 54
18 IdTypeList: IdTypeList1 .
$default reduce using rule 18 (IdTypeList)
State 55
91 ArrayType: '[' T_INTCONSTANT ']' Type .
$default reduce using rule 91 (ArrayType)
State 56
13 FieldDecl: T_VAR T_ID Type T_ASSIGN Constant ';' .
$default reduce using rule 13 (FieldDecl)
State 57
19 IdTypeList1: T_ID Type .
20 | T_ID Type . ',' IdTypeList
',' shift, and go to state 59
$default reduce using rule 19 (IdTypeList1)
State 58
16 MethodDecl: T_FUNC T_ID '(' IdTypeList ')' . MethodType Block
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
T_VOID shift, and go to state 30
Type go to state 31
MethodType go to state 60
State 59
20 IdTypeList1: T_ID Type ',' . IdTypeList
T_ID shift, and go to state 52
$default reduce using rule 17 (IdTypeList)
IdTypeList go to state 61
IdTypeList1 go to state 54
State 60
16 MethodDecl: T_FUNC T_ID '(' IdTypeList ')' MethodType . Block
'{' shift, and go to state 62
Block go to state 63
State 61
20 IdTypeList1: T_ID Type ',' IdTypeList .
$default reduce using rule 20 (IdTypeList1)
State 62
21 Block: '{' . VarDecls Statements '}'
T_VAR shift, and go to state 64
$default reduce using rule 22 (VarDecls)
VarDecls go to state 65
VarDecl go to state 66
State 63
16 MethodDecl: T_FUNC T_ID '(' IdTypeList ')' MethodType Block .
$default reduce using rule 16 (MethodDecl)
State 64
24 VarDecl: T_VAR . T_ID Type ';'
25 | T_VAR . T_ID ArrayType ';'
T_ID shift, and go to state 67
State 65
21 Block: '{' VarDecls . Statements '}'
T_BREAK shift, and go to state 68
T_CONTINUE shift, and go to state 69
T_ID shift, and go to state 70
T_IF shift, and go to state 71
T_RETURN shift, and go to state 72
T_WHILE shift, and go to state 73
'{' shift, and go to state 62
$default reduce using rule 26 (Statements)
Block go to state 74
Statements go to state 75
Statement go to state 76
ContinueStmt go to state 77
WhileStmt go to state 78
BreakStmt go to state 79
IfStmt go to state 80
ReturnStmt go to state 81
Assign go to state 82
Lvalue go to state 83
MethodCall go to state 84
State 66
23 VarDecls: VarDecl . VarDecls
T_VAR shift, and go to state 64
$default reduce using rule 22 (VarDecls)
VarDecls go to state 85
VarDecl go to state 66
State 67
24 VarDecl: T_VAR T_ID . Type ';'
25 | T_VAR T_ID . ArrayType ';'
T_BOOLTYPE shift, and go to state 13
T_INTTYPE shift, and go to state 14
'[' shift, and go to state 34
Type go to state 86
ArrayType go to state 87
State 68
38 BreakStmt: T_BREAK . ';'
';' shift, and go to state 88
State 69
36 ContinueStmt: T_CONTINUE . ';'
';' shift, and go to state 89
State 70
45 Lvalue: T_ID .
46 | T_ID . '[' Expr ']'
47 MethodCall: T_ID . '(' MethodArgs ')'
'(' shift, and go to state 90
'[' shift, and go to state 91
$default reduce using rule 45 (Lvalue)
State 71
39 IfStmt: T_IF . '(' Expr ')' Block T_ELSE Block
40 | T_IF . '(' Expr ')' Block
'(' shift, and go to state 92
State 72
41 ReturnStmt: T_RETURN . ';'
42 | T_RETURN . '(' ')' ';'
43 | T_RETURN . '(' Expr ')' ';'
'(' shift, and go to state 93
';' shift, and go to state 94
State 73
37 WhileStmt: T_WHILE . '(' Expr ')' Block
'(' shift, and go to state 95
State 74
28 Statement: Block .
$default reduce using rule 28 (Statement)
State 75
21 Block: '{' VarDecls Statements . '}'
'}' shift, and go to state 96
State 76
27 Statements: Statement . Statements
T_BREAK shift, and go to state 68
T_CONTINUE shift, and go to state 69
T_ID shift, and go to state 70
T_IF shift, and go to state 71
T_RETURN shift, and go to state 72
T_WHILE shift, and go to state 73
'{' shift, and go to state 62
$default reduce using rule 26 (Statements)
Block go to state 74
Statements go to state 97
Statement go to state 76
ContinueStmt go to state 77
WhileStmt go to state 78
BreakStmt go to state 79
IfStmt go to state 80
ReturnStmt go to state 81
Assign go to state 82
Lvalue go to state 83
MethodCall go to state 84
State 77
35 Statement: ContinueStmt .
$default reduce using rule 35 (Statement)
State 78
32 Statement: WhileStmt .
$default reduce using rule 32 (Statement)
State 79
34 Statement: BreakStmt .
$default reduce using rule 34 (Statement)
State 80
31 Statement: IfStmt .
$default reduce using rule 31 (Statement)
State 81
33 Statement: ReturnStmt .
$default reduce using rule 33 (Statement)
State 82
29 Statement: Assign . ';'
';' shift, and go to state 98
State 83
44 Assign: Lvalue . T_ASSIGN Expr
T_ASSIGN shift, and go to state 99
State 84
30 Statement: MethodCall . ';'
';' shift, and go to state 100
State 85
23 VarDecls: VarDecl VarDecls .
$default reduce using rule 23 (VarDecls)
State 86
24 VarDecl: T_VAR T_ID Type . ';'
';' shift, and go to state 101
State 87
25 VarDecl: T_VAR T_ID ArrayType . ';'
';' shift, and go to state 102
State 88
38 BreakStmt: T_BREAK ';' .
$default reduce using rule 38 (BreakStmt)
State 89
36 ContinueStmt: T_CONTINUE ';' .
$default reduce using rule 36 (ContinueStmt)
State 90
47 MethodCall: T_ID '(' . MethodArgs ')'
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
$default reduce using rule 49 (MethodArgs)
MethodCall go to state 108
MethodArg go to state 109
MethodArgs go to state 110
FullMethodArgs go to state 111
Expr go to state 112
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 91
46 Lvalue: T_ID '[' . Expr ']'
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 118
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 92
39 IfStmt: T_IF '(' . Expr ')' Block T_ELSE Block
40 | T_IF '(' . Expr ')' Block
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 119
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 93
42 ReturnStmt: T_RETURN '(' . ')' ';'
43 | T_RETURN '(' . Expr ')' ';'
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
')' shift, and go to state 120
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 121
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 94
41 ReturnStmt: T_RETURN ';' .
$default reduce using rule 41 (ReturnStmt)
State 95
37 WhileStmt: T_WHILE '(' . Expr ')' Block
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 122
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 96
21 Block: '{' VarDecls Statements '}' .
$default reduce using rule 21 (Block)
State 97
27 Statements: Statement Statements .
$default reduce using rule 27 (Statements)
State 98
29 Statement: Assign ';' .
$default reduce using rule 29 (Statement)
State 99
44 Assign: Lvalue T_ASSIGN . Expr
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 123
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 100
30 Statement: MethodCall ';' .
$default reduce using rule 30 (Statement)
State 101
24 VarDecl: T_VAR T_ID Type ';' .
$default reduce using rule 24 (VarDecl)
State 102
25 VarDecl: T_VAR T_ID ArrayType ';' .
$default reduce using rule 25 (VarDecl)
State 103
47 MethodCall: T_ID . '(' MethodArgs ')'
75 Factor: T_ID .
77 | T_ID . '[' Expr ']'
'(' shift, and go to state 90
'[' shift, and go to state 124
$default reduce using rule 75 (Factor)
State 104
81 Factor: T_STRINGCONSTANT .
$default reduce using rule 81 (Factor)
State 105
79 Factor: '(' . Expr ')'
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 125
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 106
82 Factor: '-' . Factor
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Factor go to state 126
BoolConstant go to state 50
Constant go to state 117
State 107
80 Factor: '!' . Factor
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Factor go to state 127
BoolConstant go to state 50
Constant go to state 117
State 108
76 Factor: MethodCall .
$default reduce using rule 76 (Factor)
State 109
51 FullMethodArgs: MethodArg .
52 | MethodArg . ',' MethodArgs
',' shift, and go to state 128
$default reduce using rule 51 (FullMethodArgs)
State 110
47 MethodCall: T_ID '(' MethodArgs . ')'
')' shift, and go to state 129
State 111
50 MethodArgs: FullMethodArgs .
$default reduce using rule 50 (MethodArgs)
State 112
48 MethodArg: Expr .
$default reduce using rule 48 (MethodArg)
State 113
53 Expr: Simpleexpression .
55 Simpleexpression: Simpleexpression . Relop Additiveexpression
T_EQ shift, and go to state 130
T_GEQ shift, and go to state 131
T_LEQ shift, and go to state 132
T_NEQ shift, and go to state 133
'<' shift, and go to state 134
'>' shift, and go to state 135
$default reduce using rule 53 (Expr)
Relop go to state 136
State 114
54 Simpleexpression: Additiveexpression .
63 Additiveexpression: Additiveexpression . Addop Term
'+' shift, and go to state 137
'-' shift, and go to state 138
$default reduce using rule 54 (Simpleexpression)
Addop go to state 139
State 115
62 Additiveexpression: Term .
67 Term: Term . Multop Factor
T_AND shift, and go to state 140
T_LEFTSHIFT shift, and go to state 141
T_OR shift, and go to state 142
T_RIGHTSHIFT shift, and go to state 143
'*' shift, and go to state 144
'/' shift, and go to state 145
'%' shift, and go to state 146
$default reduce using rule 62 (Additiveexpression)
Multop go to state 147
State 116
66 Term: Factor .
$default reduce using rule 66 (Term)
State 117
78 Factor: Constant .
$default reduce using rule 78 (Factor)
State 118
46 Lvalue: T_ID '[' Expr . ']'
']' shift, and go to state 148
State 119
39 IfStmt: T_IF '(' Expr . ')' Block T_ELSE Block
40 | T_IF '(' Expr . ')' Block
')' shift, and go to state 149
State 120
42 ReturnStmt: T_RETURN '(' ')' . ';'
';' shift, and go to state 150
State 121
43 ReturnStmt: T_RETURN '(' Expr . ')' ';'
')' shift, and go to state 151
State 122
37 WhileStmt: T_WHILE '(' Expr . ')' Block
')' shift, and go to state 152
State 123
44 Assign: Lvalue T_ASSIGN Expr .
$default reduce using rule 44 (Assign)
State 124
77 Factor: T_ID '[' . Expr ']'
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Expr go to state 153
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 125
79 Factor: '(' Expr . ')'
')' shift, and go to state 154
State 126
82 Factor: '-' Factor .
$default reduce using rule 82 (Factor)
State 127
80 Factor: '!' Factor .
$default reduce using rule 80 (Factor)
State 128
52 FullMethodArgs: MethodArg ',' . MethodArgs
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
$default reduce using rule 49 (MethodArgs)
MethodCall go to state 108
MethodArg go to state 109
MethodArgs go to state 155
FullMethodArgs go to state 111
Expr go to state 112
Simpleexpression go to state 113
Additiveexpression go to state 114
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 129
47 MethodCall: T_ID '(' MethodArgs ')' .
$default reduce using rule 47 (MethodCall)
State 130
58 Relop: T_EQ .
$default reduce using rule 58 (Relop)
State 131
60 Relop: T_GEQ .
$default reduce using rule 60 (Relop)
State 132
59 Relop: T_LEQ .
$default reduce using rule 59 (Relop)
State 133
61 Relop: T_NEQ .
$default reduce using rule 61 (Relop)
State 134
56 Relop: '<' .
$default reduce using rule 56 (Relop)
State 135
57 Relop: '>' .
$default reduce using rule 57 (Relop)
State 136
55 Simpleexpression: Simpleexpression Relop . Additiveexpression
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Additiveexpression go to state 156
Term go to state 115
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 137
64 Addop: '+' .
$default reduce using rule 64 (Addop)
State 138
65 Addop: '-' .
$default reduce using rule 65 (Addop)
State 139
63 Additiveexpression: Additiveexpression Addop . Term
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Term go to state 157
Factor go to state 116
BoolConstant go to state 50
Constant go to state 117
State 140
71 Multop: T_AND .
$default reduce using rule 71 (Multop)
State 141
73 Multop: T_LEFTSHIFT .
$default reduce using rule 73 (Multop)
State 142
72 Multop: T_OR .
$default reduce using rule 72 (Multop)
State 143
74 Multop: T_RIGHTSHIFT .
$default reduce using rule 74 (Multop)
State 144
68 Multop: '*' .
$default reduce using rule 68 (Multop)
State 145
69 Multop: '/' .
$default reduce using rule 69 (Multop)
State 146
70 Multop: '%' .
$default reduce using rule 70 (Multop)
State 147
67 Term: Term Multop . Factor
T_FALSE shift, and go to state 47
T_ID shift, and go to state 103
T_INTCONSTANT shift, and go to state 48
T_STRINGCONSTANT shift, and go to state 104
T_TRUE shift, and go to state 49
'(' shift, and go to state 105
'-' shift, and go to state 106
'!' shift, and go to state 107
MethodCall go to state 108
Factor go to state 158
BoolConstant go to state 50
Constant go to state 117
State 148
46 Lvalue: T_ID '[' Expr ']' .
$default reduce using rule 46 (Lvalue)
State 149
39 IfStmt: T_IF '(' Expr ')' . Block T_ELSE Block
40 | T_IF '(' Expr ')' . Block
'{' shift, and go to state 62
Block go to state 159
State 150
42 ReturnStmt: T_RETURN '(' ')' ';' .
$default reduce using rule 42 (ReturnStmt)
State 151
43 ReturnStmt: T_RETURN '(' Expr ')' . ';'
';' shift, and go to state 160
State 152
37 WhileStmt: T_WHILE '(' Expr ')' . Block
'{' shift, and go to state 62
Block go to state 161
State 153
77 Factor: T_ID '[' Expr . ']'
']' shift, and go to state 162
State 154
79 Factor: '(' Expr ')' .
$default reduce using rule 79 (Factor)
State 155
52 FullMethodArgs: MethodArg ',' MethodArgs .
$default reduce using rule 52 (FullMethodArgs)
State 156
55 Simpleexpression: Simpleexpression Relop Additiveexpression .
63 Additiveexpression: Additiveexpression . Addop Term
'+' shift, and go to state 137
'-' shift, and go to state 138
$default reduce using rule 55 (Simpleexpression)
Addop go to state 139
State 157
63 Additiveexpression: Additiveexpression Addop Term .
67 Term: Term . Multop Factor
T_AND shift, and go to state 140
T_LEFTSHIFT shift, and go to state 141
T_OR shift, and go to state 142
T_RIGHTSHIFT shift, and go to state 143
'*' shift, and go to state 144
'/' shift, and go to state 145
'%' shift, and go to state 146
$default reduce using rule 63 (Additiveexpression)
Multop go to state 147
State 158
67 Term: Term Multop Factor .
$default reduce using rule 67 (Term)
State 159
39 IfStmt: T_IF '(' Expr ')' Block . T_ELSE Block
40 | T_IF '(' Expr ')' Block .
T_ELSE shift, and go to state 163
$default reduce using rule 40 (IfStmt)
State 160
43 ReturnStmt: T_RETURN '(' Expr ')' ';' .
$default reduce using rule 43 (ReturnStmt)
State 161
37 WhileStmt: T_WHILE '(' Expr ')' Block .
$default reduce using rule 37 (WhileStmt)
State 162
77 Factor: T_ID '[' Expr ']' .
$default reduce using rule 77 (Factor)
State 163
39 IfStmt: T_IF '(' Expr ')' Block T_ELSE . Block
'{' shift, and go to state 62
Block go to state 164
State 164
39 IfStmt: T_IF '(' Expr ')' Block T_ELSE Block .
$default reduce using rule 39 (IfStmt)