📄 y.output
字号:
state 65
unaryop : '!' . (80)
. reduce 80
state 66
unary_expr : unaryop . unary_expr (54)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 88
factor goto 69
unary_expr goto 89
call goto 80
state 67
expr : var . '=' expr (44)
factor : var . (57)
'=' shift 90
EQ reduce 57
NE reduce 57
LT reduce 57
GT reduce 57
LE reduce 57
GE reduce 57
'+' reduce 57
'-' reduce 57
'*' reduce 57
'/' reduce 57
'%' reduce 57
';' reduce 57
']' reduce 57
')' reduce 57
',' reduce 57
state 68
expr_stmt : expr . ';' (37)
';' shift 91
. error
state 69
unary_expr : factor . (55)
. reduce 55
state 70
term : unary_expr . (53)
. reduce 53
state 71
add_expr : term . (51)
term : term . mulop unary_expr (52)
'*' shift 92
'/' shift 93
'%' shift 94
EQ reduce 51
NE reduce 51
LT reduce 51
GT reduce 51
LE reduce 51
GE reduce 51
'+' reduce 51
'-' reduce 51
';' reduce 51
']' reduce 51
')' reduce 51
',' reduce 51
mulop goto 95
state 72
simple_expr : add_expr . relop add_expr (48)
simple_expr : add_expr . (49)
add_expr : add_expr . addop term (50)
EQ shift 96
NE shift 97
LT shift 98
GT shift 99
LE shift 100
GE shift 101
'+' shift 102
'-' shift 103
';' reduce 49
']' reduce 49
')' reduce 49
',' reduce 49
addop goto 104
relop goto 105
state 73
expr : simple_expr . (45)
. reduce 45
state 74
stmt : comp_stmt . (33)
. reduce 33
state 75
stmt : if_stmt . (34)
. reduce 34
state 76
stmt : while_stmt . (35)
. reduce 35
state 77
stmt_list : stmt_list stmt . (30)
. reduce 30
state 78
stmt : expr_stmt . (32)
. reduce 32
state 79
stmt : return_stmt . (36)
. reduce 36
state 80
factor : call . (58)
. reduce 58
state 81
var : ID '[' . expr ']' (47)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 106
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 82
call : ID '(' . args ')' (62)
args : . (64)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
')' reduce 64
unaryop goto 66
args goto 107
arg_list goto 108
var goto 67
expr goto 109
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 83
if_stmt : IF '(' . expr ')' stmt (39)
if_stmt : IF '(' . expr ')' stmt ELSE stmt (40)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 110
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 84
while_stmt : WHILE '(' . expr ')' stmt (41)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 111
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 85
return_stmt : RETURN ';' . (42)
. reduce 42
state 86
return_stmt : RETURN expr . ';' (43)
';' shift 112
. error
state 87
factor : '(' expr . ')' (56)
')' shift 113
. error
state 88
factor : var . (57)
. reduce 57
state 89
unary_expr : unaryop unary_expr . (54)
. reduce 54
state 90
expr : var '=' . expr (44)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 114
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 91
expr_stmt : expr ';' . (37)
. reduce 37
state 92
mulop : '*' . (77)
. reduce 77
state 93
mulop : '/' . (78)
. reduce 78
state 94
mulop : '%' . (79)
. reduce 79
state 95
term : term mulop . unary_expr (52)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 88
factor goto 69
unary_expr goto 115
call goto 80
state 96
relop : EQ . (75)
. reduce 75
state 97
relop : NE . (76)
. reduce 76
state 98
relop : LT . (72)
. reduce 72
state 99
relop : GT . (73)
. reduce 73
state 100
relop : LE . (71)
. reduce 71
state 101
relop : GE . (74)
. reduce 74
state 102
addop : '+' . (69)
. reduce 69
state 103
addop : '-' . (70)
. reduce 70
state 104
add_expr : add_expr addop . term (50)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 88
factor goto 69
unary_expr goto 70
term goto 116
call goto 80
state 105
simple_expr : add_expr relop . add_expr (48)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 88
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 117
call goto 80
state 106
var : ID '[' expr . ']' (47)
']' shift 118
. error
state 107
call : ID '(' args . ')' (62)
')' shift 119
. error
state 108
args : arg_list . (63)
arg_list : arg_list . ',' expr (65)
',' shift 120
')' reduce 63
state 109
arg_list : expr . (66)
. reduce 66
state 110
if_stmt : IF '(' expr . ')' stmt (39)
if_stmt : IF '(' expr . ')' stmt ELSE stmt (40)
')' shift 121
. error
state 111
while_stmt : WHILE '(' expr . ')' stmt (41)
')' shift 122
. error
state 112
return_stmt : RETURN expr ';' . (43)
. reduce 43
state 113
factor : '(' expr ')' . (56)
. reduce 56
state 114
expr : var '=' expr . (44)
. reduce 44
state 115
term : term mulop unary_expr . (52)
. reduce 52
state 116
add_expr : add_expr addop term . (50)
term : term . mulop unary_expr (52)
'*' shift 92
'/' shift 93
'%' shift 94
EQ reduce 50
NE reduce 50
LT reduce 50
GT reduce 50
LE reduce 50
GE reduce 50
'+' reduce 50
'-' reduce 50
';' reduce 50
']' reduce 50
')' reduce 50
',' reduce 50
mulop goto 95
state 117
simple_expr : add_expr relop add_expr . (48)
add_expr : add_expr . addop term (50)
'+' shift 102
'-' shift 103
';' reduce 48
']' reduce 48
')' reduce 48
',' reduce 48
addop goto 104
state 118
var : ID '[' expr ']' . (47)
. reduce 47
state 119
call : ID '(' args ')' . (62)
. reduce 62
state 120
arg_list : arg_list ',' . expr (65)
ID shift 54
NUM shift 55
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
'(' shift 63
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 123
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
call goto 80
state 121
if_stmt : IF '(' expr ')' . stmt (39)
if_stmt : IF '(' expr ')' . stmt ELSE stmt (40)
ID shift 54
NUM shift 55
IF shift 56
WHILE shift 57
RETURN shift 58
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
';' shift 62
'(' shift 63
'{' shift 45
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 68
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
comp_stmt goto 74
if_stmt goto 75
while_stmt goto 76
stmt goto 124
expr_stmt goto 78
return_stmt goto 79
call goto 80
state 122
while_stmt : WHILE '(' expr ')' . stmt (41)
ID shift 54
NUM shift 55
IF shift 56
WHILE shift 57
RETURN shift 58
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
';' shift 62
'(' shift 63
'{' shift 45
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 68
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
comp_stmt goto 74
if_stmt goto 75
while_stmt goto 76
stmt goto 125
expr_stmt goto 78
return_stmt goto 79
call goto 80
state 123
arg_list : arg_list ',' expr . (65)
. reduce 65
state 124
if_stmt : IF '(' expr ')' stmt . (39)
if_stmt : IF '(' expr ')' stmt . ELSE stmt (40)
ELSE shift 126
ID reduce 39
NUM reduce 39
IF reduce 39
WHILE reduce 39
RETURN reduce 39
STRING_LITERAL reduce 39
CHAR_LITERAL reduce 39
'-' reduce 39
';' reduce 39
'(' reduce 39
'{' reduce 39
'}' reduce 39
'!' reduce 39
state 125
while_stmt : WHILE '(' expr ')' stmt . (41)
. reduce 41
state 126
if_stmt : IF '(' expr ')' stmt ELSE . stmt (40)
ID shift 54
NUM shift 55
IF shift 56
WHILE shift 57
RETURN shift 58
STRING_LITERAL shift 59
CHAR_LITERAL shift 60
'-' shift 61
';' shift 62
'(' shift 63
'{' shift 45
'!' shift 65
. error
unaryop goto 66
var goto 67
expr goto 68
factor goto 69
unary_expr goto 70
term goto 71
add_expr goto 72
simple_expr goto 73
comp_stmt goto 74
if_stmt goto 75
while_stmt goto 76
stmt goto 127
expr_stmt goto 78
return_stmt goto 79
call goto 80
state 127
if_stmt : IF '(' expr ')' stmt ELSE stmt . (40)
. reduce 40
48 terminals, 36 nonterminals
82 grammar rules, 128 states
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -