📄 myparser.v
字号:
#############################################################################
# U N R E G I S T E R E D C O P Y
#
# You are on day 63 of your 30 day trial period.
#
# This file was produced by an UNREGISTERED COPY of Parser Generator. It is
# for evaluation purposes only. If you continue to use Parser Generator 30
# days after installation then you are required to purchase a license. For
# more information see the online help or go to the Bumble-Bee Software
# homepage at:
#
# http://www.bumblebeesoftware.com
#
# This notice must remain present in the file. It cannot be removed.
#############################################################################
#############################################################################
# myparser.v
# YACC verbose file generated from myparser.y.
#
# Date: 01/03/08
# Time: 20:58:04
#
# AYACC Version: 2.06
#############################################################################
##############################################################################
# Rules
##############################################################################
0 $accept : lines $end
1 lines : MAIN LPAREN RPAREN compound_statement
2 type_statement : type_specifier id_list SEMI
3 id_list : id
4 | id_list COMMON id
5 assign_statement : id EQ expr SEMI
6 selection_statement : IF LPAREN expr RPAREN statement
7 repeat_statement : WHILE LPAREN expr RPAREN statement
8 | FOR LPAREN expr RPAREN statement
9 print_statement : PRINT LPAREN expr RPAREN SEMI
10 input_statement : INPUT LPAREN id RPAREN SEMI
11 statement : assign_statement
12 | selection_statement
13 | repeat_statement
14 | type_statement
15 | print_statement
16 | compound_statement
17 | input_statement
18 statement_list : statement
19 | statement_list statement
20 compound_statement : LEFTBIG RIGHTBIG
21 | LEFTBIG statement_list RIGHTBIG
22 expr : uexpr AND uexpr
23 | uexpr OR uexpr
24 | uexpr
25 uexpr : simple_exp LT simple_exp
26 | simple_exp EQ_OP simple_exp
27 | simple_exp GT simple_exp
28 | simple_exp LE simple_exp
29 | simple_exp GE simple_exp
30 | simple_exp NEQ simple_exp
31 | simple_exp
32 simple_exp : NOT simple_exp
33 | simple_exp PLUS term
34 | simple_exp MINUS term
35 | term
36 term : term TIMES factor
37 | term OVER factor
38 | factor
39 factor : LPAREN expr RPAREN
40 | id
41 | num
42 id : ID
43 num : NUM
44 type_specifier : CHAR
45 | INT
46 | DOUBLE
##############################################################################
# States
##############################################################################
state 0
$accept : . lines $end
MAIN shift 1
lines goto 2
state 1
lines : MAIN . LPAREN RPAREN compound_statement
LPAREN shift 3
state 2
$accept : lines . $end (0)
$end accept
state 3
lines : MAIN LPAREN . RPAREN compound_statement
RPAREN shift 4
state 4
lines : MAIN LPAREN RPAREN . compound_statement
LEFTBIG shift 5
compound_statement goto 6
state 5
compound_statement : LEFTBIG . RIGHTBIG
compound_statement : LEFTBIG . statement_list RIGHTBIG
ID shift 7
IF shift 8
CHAR shift 9
DOUBLE shift 10
INT shift 11
WHILE shift 12
LEFTBIG shift 5
RIGHTBIG shift 13
FOR shift 14
PRINT shift 15
INPUT shift 16
compound_statement goto 17
type_statement goto 18
type_specifier goto 19
id goto 20
assign_statement goto 21
selection_statement goto 22
statement goto 23
repeat_statement goto 24
print_statement goto 25
input_statement goto 26
statement_list goto 27
state 6
lines : MAIN LPAREN RPAREN compound_statement . (1)
. reduce 1
state 7
id : ID . (42)
. reduce 42
state 8
selection_statement : IF . LPAREN expr RPAREN statement
LPAREN shift 28
state 9
type_specifier : CHAR . (44)
. reduce 44
state 10
type_specifier : DOUBLE . (46)
. reduce 46
state 11
type_specifier : INT . (45)
. reduce 45
state 12
repeat_statement : WHILE . LPAREN expr RPAREN statement
LPAREN shift 29
state 13
compound_statement : LEFTBIG RIGHTBIG . (20)
. reduce 20
state 14
repeat_statement : FOR . LPAREN expr RPAREN statement
LPAREN shift 30
state 15
print_statement : PRINT . LPAREN expr RPAREN SEMI
LPAREN shift 31
state 16
input_statement : INPUT . LPAREN id RPAREN SEMI
LPAREN shift 32
state 17
statement : compound_statement . (16)
. reduce 16
state 18
statement : type_statement . (14)
. reduce 14
state 19
type_statement : type_specifier . id_list SEMI
ID shift 7
id_list goto 33
id goto 34
state 20
assign_statement : id . EQ expr SEMI
EQ shift 35
state 21
statement : assign_statement . (11)
. reduce 11
state 22
statement : selection_statement . (12)
. reduce 12
state 23
statement_list : statement . (18)
. reduce 18
state 24
statement : repeat_statement . (13)
. reduce 13
state 25
statement : print_statement . (15)
. reduce 15
state 26
statement : input_statement . (17)
. reduce 17
state 27
statement_list : statement_list . statement
compound_statement : LEFTBIG statement_list . RIGHTBIG
ID shift 7
IF shift 8
CHAR shift 9
DOUBLE shift 10
INT shift 11
WHILE shift 12
LEFTBIG shift 5
RIGHTBIG shift 36
FOR shift 14
PRINT shift 15
INPUT shift 16
compound_statement goto 17
type_statement goto 18
type_specifier goto 19
id goto 20
assign_statement goto 21
selection_statement goto 22
statement goto 37
repeat_statement goto 24
print_statement goto 25
input_statement goto 26
state 28
selection_statement : IF LPAREN . expr RPAREN statement
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 42
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 29
repeat_statement : WHILE LPAREN . expr RPAREN statement
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 48
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 30
repeat_statement : FOR LPAREN . expr RPAREN statement
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 49
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 31
print_statement : PRINT LPAREN . expr RPAREN SEMI
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 50
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 32
input_statement : INPUT LPAREN . id RPAREN SEMI
ID shift 7
id goto 51
state 33
type_statement : type_specifier id_list . SEMI
id_list : id_list . COMMON id
SEMI shift 52
COMMON shift 53
state 34
id_list : id . (3)
. reduce 3
state 35
assign_statement : id EQ . expr SEMI
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 54
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 36
compound_statement : LEFTBIG statement_list RIGHTBIG . (21)
. reduce 21
state 37
statement_list : statement_list statement . (19)
. reduce 19
state 38
num : NUM . (43)
. reduce 43
state 39
factor : LPAREN . expr RPAREN
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
expr goto 55
uexpr goto 43
simple_exp goto 44
term goto 45
factor goto 46
num goto 47
state 40
simple_exp : NOT . simple_exp
ID shift 7
NUM shift 38
LPAREN shift 39
NOT shift 40
id goto 41
simple_exp goto 56
term goto 45
factor goto 46
num goto 47
state 41
factor : id . (40)
. reduce 40
state 42
selection_statement : IF LPAREN expr . RPAREN statement
RPAREN shift 57
state 43
expr : uexpr . AND uexpr
expr : uexpr . OR uexpr
expr : uexpr . (24)
AND shift 58
OR shift 59
. reduce 24
state 44
uexpr : simple_exp . LT simple_exp
uexpr : simple_exp . EQ_OP simple_exp
uexpr : simple_exp . GT simple_exp
uexpr : simple_exp . LE simple_exp
uexpr : simple_exp . GE simple_exp
uexpr : simple_exp . NEQ simple_exp
uexpr : simple_exp . (31)
simple_exp : simple_exp . PLUS term
simple_exp : simple_exp . MINUS term
LT shift 60
PLUS shift 61
MINUS shift 62
EQ_OP shift 63
LE shift 64
GT shift 65
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -