depager 0.2.3 → 0.3.0.b20160729
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.en +4 -19
- data/README.ja +42 -79
- data/bin/depager +42 -45
- data/examples/action_pl0d/pl0d.action.dr +421 -0
- data/examples/action_pl0d/test.pl0ds +49 -0
- data/examples/c89/c89.dr +493 -496
- data/examples/c89/test.c89 +10 -10
- data/examples/extension/astdf.rb +10 -0
- data/examples/extension/atree.dr +55 -0
- data/examples/{sample_calc → extension}/calc.atree.dr +42 -43
- data/examples/extension/calc.simple_action.dr +33 -0
- data/examples/extension/paction.dr +16 -15
- data/examples/extension/pactiontest.dr +14 -14
- data/examples/extension/simple_action.rb +44 -0
- data/examples/pl0d/pl0ds.dr +337 -334
- data/examples/pl0d/test.pl0ds +33 -33
- data/examples/rie_calc/calc.rie.dr +57 -0
- data/examples/rie_calc/test.calc +4 -0
- data/examples/rie_dcuse/dcuse.rie.dr +71 -0
- data/examples/rie_dcuse/test.dcuse +1 -0
- data/examples/rie_pl0/orig_ex/exerrdg.pl0 +44 -0
- data/examples/rie_pl0/orig_ex/exerrm.pl0 +19 -0
- data/examples/rie_pl0/orig_ex/exerrmre.pl0 +20 -0
- data/examples/rie_pl0/orig_ex/exerrtok.pl0 +18 -0
- data/examples/rie_pl0/orig_ex/exmdg.pl0 +40 -0
- data/examples/rie_pl0/orig_ex/exmdgwwl.pl0 +43 -0
- data/examples/rie_pl0/orig_ex/exmrw.pl0 +22 -0
- data/examples/rie_pl0/orig_ex/exmwwl.pl0 +18 -0
- data/examples/rie_pl0/orig_ex/exnorw.pl0 +17 -0
- data/examples/rie_pl0/pl0.rie.dr +450 -0
- data/examples/rie_pl0/test.pl0 +10 -0
- data/examples/sample_calc/calc.action.dr +33 -33
- data/examples/sample_calc/calc.ast.action.dr +65 -66
- data/examples/sample_calc/calc.ast.dr +55 -55
- data/examples/sample_calc/calc.cst.dr +45 -45
- data/examples/sample_calc/calc.dr +43 -43
- data/examples/sample_calc/calc.lex.dr +29 -29
- data/examples/sample_calc/{calc_prec.nvaction.dr → calc_prec.action.dr} +31 -31
- data/examples/slex_test/divreg.slex.dr +29 -29
- data/examples/slex_test/ljoin.slex.dr +36 -36
- data/examples/slex_test/test.divreg +1 -1
- data/examples/slex_test/test.ljoin +3 -3
- data/lib/depager.rb +582 -670
- data/lib/depager/grammar.rb +256 -291
- data/lib/depager/lr.rb +574 -579
- data/lib/depager/parser.rb +282 -277
- data/lib/depager/ruby/plugins/_rie_debug.rb +35 -0
- data/lib/depager/ruby/plugins/action.rb +53 -43
- data/lib/depager/ruby/plugins/ast.dr +364 -269
- data/lib/depager/ruby/plugins/ast.rb +1367 -1308
- data/lib/depager/ruby/plugins/cst.dr +172 -180
- data/lib/depager/ruby/plugins/cst.rb +587 -626
- data/lib/depager/ruby/plugins/lex.dr +85 -89
- data/lib/depager/ruby/plugins/lex.rb +310 -336
- data/lib/depager/ruby/plugins/rie.dr +723 -0
- data/lib/depager/ruby/plugins/rie.rb +1653 -0
- data/lib/depager/ruby/plugins/slex.dr +202 -200
- data/lib/depager/ruby/plugins/slex.rb +780 -817
- data/lib/depager/ruby/plugins/srp.rb +56 -51
- data/lib/depager/ruby/templates/extension_lalr_master.erb +46 -51
- data/lib/depager/ruby/templates/extension_lalr_slave.erb +99 -107
- data/lib/depager/ruby/templates/single_lalr_parser.erb +115 -117
- data/lib/depager/utils.rb +148 -318
- data/lib/depager/version.rb +4 -3
- metadata +52 -60
- data/ChangeLog +0 -16
- data/data/depager/pre-setup.rb +0 -3
- data/examples/c89/c89.tab.rb +0 -7127
- data/examples/pl0d/pl0ds.tab.rb +0 -2698
- data/examples/sample_calc/calc.action.tab.rb +0 -457
- data/examples/sample_calc/calc.ast.action.tab.rb +0 -749
- data/examples/sample_calc/calc.ast.tab.rb +0 -665
- data/examples/sample_calc/calc.astdf.dr +0 -54
- data/examples/sample_calc/calc.astdf.tab.rb +0 -672
- data/examples/sample_calc/calc.atree.tab.rb +0 -451
- data/examples/sample_calc/calc.cst.tab.rb +0 -644
- data/examples/sample_calc/calc.lex.tab.rb +0 -374
- data/examples/sample_calc/calc.nvaction.dr +0 -33
- data/examples/sample_calc/calc.nvaction.tab.rb +0 -465
- data/examples/sample_calc/calc.tab.rb +0 -365
- data/examples/sample_calc/calc_prec.nvaction.tab.rb +0 -431
- data/examples/slex_test/divreg.slex.tab.rb +0 -303
- data/examples/slex_test/ljoin.slex.tab.rb +0 -370
- data/lib/depager/ruby/plugins/_ast_tmpl.rb +0 -73
- data/lib/depager/ruby/plugins/astdf.rb +0 -6
- data/lib/depager/ruby/plugins/atree.dr +0 -55
- data/lib/depager/ruby/plugins/atree.rb +0 -347
- data/lib/depager/ruby/plugins/nvaction.rb +0 -19
- data/lib/depager/ruby/templates/simple.erb +0 -23
- data/setup.rb +0 -1585
data/examples/pl0d/pl0ds.tab.rb
DELETED
@@ -1,2698 +0,0 @@
|
|
1
|
-
|
2
|
-
begin; require 'rubygems'; rescue Exception; end
|
3
|
-
require 'depager/parser.rb'
|
4
|
-
|
5
|
-
|
6
|
-
module Depager::DecoratorUtils; end
|
7
|
-
module D4PL0d; end
|
8
|
-
|
9
|
-
class PL0d < Depager::LALR::Basis
|
10
|
-
|
11
|
-
|
12
|
-
### Reduce Table
|
13
|
-
reduce_table = [
|
14
|
-
[ -1, 1 ], # ( 0) $start : program
|
15
|
-
[ 0, 2 ], # ( 1) program : block '.'
|
16
|
-
[ 1, 2 ], # ( 2) block : opt_decl_list statement
|
17
|
-
[ 2, 0 ], # ( 3) opt_decl_list :
|
18
|
-
[ 2, 2 ], # ( 4) opt_decl_list : opt_decl_list decl
|
19
|
-
[ 4, 3 ], # ( 5) decl : CONST const_init_list ';'
|
20
|
-
[ 4, 3 ], # ( 6) decl : VAR ident_list ';'
|
21
|
-
[ 4, 6 ], # ( 7) decl : FUNCTION IDENT '(' ')' block ';'
|
22
|
-
[ 4, 7 ], # ( 8) decl : FUNCTION IDENT '(' ident_list ')' block ';'
|
23
|
-
[ 5, 1 ], # ( 9) const_init_list : const_init
|
24
|
-
[ 5, 3 ], # ( 10) const_init_list : const_init_list ',' const_init
|
25
|
-
[ 7, 3 ], # ( 11) const_init : IDENT EQ NUMBER
|
26
|
-
[ 6, 1 ], # ( 12) ident_list : IDENT
|
27
|
-
[ 6, 3 ], # ( 13) ident_list : ident_list ',' IDENT
|
28
|
-
[ 3, 0 ], # ( 14) statement :
|
29
|
-
[ 3, 3 ], # ( 15) statement : IDENT COLOEQ expression
|
30
|
-
[ 3, 4 ], # ( 16) statement : BEGINN statement opt_state_list END
|
31
|
-
[ 3, 4 ], # ( 17) statement : IF condition THEN statement
|
32
|
-
[ 3, 4 ], # ( 18) statement : WHILE condition DO statement
|
33
|
-
[ 3, 2 ], # ( 19) statement : RETURN expression
|
34
|
-
[ 3, 2 ], # ( 20) statement : WRITE expression
|
35
|
-
[ 3, 1 ], # ( 21) statement : WRITELN
|
36
|
-
[ 9, 0 ], # ( 22) opt_state_list :
|
37
|
-
[ 9, 3 ], # ( 23) opt_state_list : opt_state_list ';' statement
|
38
|
-
[ 10, 2 ], # ( 24) condition : ODD expression
|
39
|
-
[ 10, 3 ], # ( 25) condition : expression EQ expression
|
40
|
-
[ 10, 3 ], # ( 26) condition : expression NOTEQ expression
|
41
|
-
[ 10, 3 ], # ( 27) condition : expression LT expression
|
42
|
-
[ 10, 3 ], # ( 28) condition : expression GT expression
|
43
|
-
[ 10, 3 ], # ( 29) condition : expression LE expression
|
44
|
-
[ 10, 3 ], # ( 30) condition : expression GE expression
|
45
|
-
[ 8, 3 ], # ( 31) expression : expression '+' term
|
46
|
-
[ 8, 3 ], # ( 32) expression : expression '-' term
|
47
|
-
[ 8, 1 ], # ( 33) expression : term
|
48
|
-
[ 8, 2 ], # ( 34) expression : '-' term
|
49
|
-
[ 11, 3 ], # ( 35) term : term '*' factor
|
50
|
-
[ 11, 3 ], # ( 36) term : term '/' factor
|
51
|
-
[ 11, 1 ], # ( 37) term : factor
|
52
|
-
[ 12, 1 ], # ( 38) factor : IDENT
|
53
|
-
[ 12, 1 ], # ( 39) factor : NUMBER
|
54
|
-
[ 12, 3 ], # ( 40) factor : IDENT '(' ')'
|
55
|
-
[ 12, 4 ], # ( 41) factor : IDENT '(' exp_list ')'
|
56
|
-
[ 12, 3 ], # ( 42) factor : '(' expression ')'
|
57
|
-
[ 13, 1 ], # ( 43) exp_list : expression
|
58
|
-
[ 13, 3 ], # ( 44) exp_list : exp_list ',' expression
|
59
|
-
]
|
60
|
-
### Extension Params
|
61
|
-
nparams = {
|
62
|
-
'ASTBuilder' => 2,
|
63
|
-
}
|
64
|
-
### Term to Int
|
65
|
-
t2i = {
|
66
|
-
nil => 0,
|
67
|
-
false => 1,
|
68
|
-
"." => 2,
|
69
|
-
:CONST => 3,
|
70
|
-
";" => 4,
|
71
|
-
:VAR => 5,
|
72
|
-
:FUNCTION => 6,
|
73
|
-
:IDENT => 7,
|
74
|
-
"(" => 8,
|
75
|
-
")" => 9,
|
76
|
-
"," => 10,
|
77
|
-
:EQ => 11,
|
78
|
-
:NUMBER => 12,
|
79
|
-
:COLOEQ => 13,
|
80
|
-
:BEGINN => 14,
|
81
|
-
:END => 15,
|
82
|
-
:IF => 16,
|
83
|
-
:THEN => 17,
|
84
|
-
:WHILE => 18,
|
85
|
-
:DO => 19,
|
86
|
-
:RETURN => 20,
|
87
|
-
:WRITE => 21,
|
88
|
-
:WRITELN => 22,
|
89
|
-
:ODD => 23,
|
90
|
-
:NOTEQ => 24,
|
91
|
-
:LT => 25,
|
92
|
-
:GT => 26,
|
93
|
-
:LE => 27,
|
94
|
-
:GE => 28,
|
95
|
-
"+" => 29,
|
96
|
-
"-" => 30,
|
97
|
-
"*" => 31,
|
98
|
-
"/" => 32,
|
99
|
-
}
|
100
|
-
### Int to Term
|
101
|
-
i2t = [
|
102
|
-
nil,
|
103
|
-
false,
|
104
|
-
".",
|
105
|
-
:CONST,
|
106
|
-
";",
|
107
|
-
:VAR,
|
108
|
-
:FUNCTION,
|
109
|
-
:IDENT,
|
110
|
-
"(",
|
111
|
-
")",
|
112
|
-
",",
|
113
|
-
:EQ,
|
114
|
-
:NUMBER,
|
115
|
-
:COLOEQ,
|
116
|
-
:BEGINN,
|
117
|
-
:END,
|
118
|
-
:IF,
|
119
|
-
:THEN,
|
120
|
-
:WHILE,
|
121
|
-
:DO,
|
122
|
-
:RETURN,
|
123
|
-
:WRITE,
|
124
|
-
:WRITELN,
|
125
|
-
:ODD,
|
126
|
-
:NOTEQ,
|
127
|
-
:LT,
|
128
|
-
:GT,
|
129
|
-
:LE,
|
130
|
-
:GE,
|
131
|
-
"+",
|
132
|
-
"-",
|
133
|
-
"*",
|
134
|
-
"/",
|
135
|
-
]
|
136
|
-
### Action Table
|
137
|
-
action_table = [
|
138
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
139
|
-
[ ACC, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
140
|
-
[ nil, nil, 4, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
141
|
-
[ nil, nil, nil, 8, nil, 12, 16, 7, nil, nil, nil, nil, nil, nil, 9, nil, 13, nil, 6, nil, 10, 11, 14, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
142
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
143
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
144
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 18, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
145
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
146
|
-
[ nil, nil, nil, nil, nil, nil, nil, 27, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
147
|
-
[ nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, nil, 9, nil, 13, nil, 6, nil, 10, 11, 14, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
148
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
149
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
150
|
-
[ nil, nil, nil, nil, nil, nil, nil, 33, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
151
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 18, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
152
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
153
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
154
|
-
[ nil, nil, nil, nil, nil, nil, nil, 36, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
155
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
156
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
157
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 38, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
158
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
159
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
160
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
161
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, 43, ],
|
162
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
163
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 50, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 45, 47, 48, 49, 51, 44, 46, nil, nil, ],
|
164
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
165
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 53, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
166
|
-
[ nil, nil, nil, nil, 54, nil, nil, nil, nil, nil, 55, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
167
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
168
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
169
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
170
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
171
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
172
|
-
[ nil, nil, nil, nil, 57, nil, nil, nil, nil, nil, 58, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
173
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 59, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
174
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 60, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
175
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
176
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, 61, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
177
|
-
[ nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, nil, 9, nil, 13, nil, 6, nil, 10, 11, 14, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
178
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 65, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
179
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, 43, ],
|
180
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
181
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
182
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
183
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
184
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
185
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
186
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
187
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
188
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
189
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
190
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
191
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 76, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
192
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
193
|
-
[ nil, nil, nil, nil, nil, nil, nil, 27, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
194
|
-
[ nil, nil, nil, nil, 78, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 79, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
195
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
196
|
-
[ nil, nil, nil, nil, nil, nil, nil, 80, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
197
|
-
[ nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, nil, 9, nil, 13, nil, 6, nil, 10, 11, 14, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
198
|
-
[ nil, nil, nil, nil, nil, nil, nil, 33, nil, 83, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
199
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
200
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 84, 85, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
201
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
202
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
203
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
204
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
205
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
206
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, 43, ],
|
207
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
208
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, 43, ],
|
209
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
210
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
211
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
212
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
213
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
214
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
215
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
216
|
-
[ nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, nil, 9, nil, 13, nil, 6, nil, 10, 11, 14, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
217
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
218
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
219
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
220
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 87, 58, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
221
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
222
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
223
|
-
[ nil, nil, nil, nil, nil, nil, nil, 19, 21, nil, nil, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, ],
|
224
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
225
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
226
|
-
[ nil, nil, nil, nil, 91, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
227
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 44, 46, nil, nil, ],
|
228
|
-
[ nil, nil, nil, nil, 92, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
229
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
230
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
231
|
-
]
|
232
|
-
### Default Reduce Table
|
233
|
-
defred_table = [
|
234
|
-
-3,
|
235
|
-
nil,
|
236
|
-
nil,
|
237
|
-
-14,
|
238
|
-
-1,
|
239
|
-
-4,
|
240
|
-
nil,
|
241
|
-
nil,
|
242
|
-
nil,
|
243
|
-
-14,
|
244
|
-
nil,
|
245
|
-
nil,
|
246
|
-
nil,
|
247
|
-
nil,
|
248
|
-
-21,
|
249
|
-
-2,
|
250
|
-
nil,
|
251
|
-
-39,
|
252
|
-
nil,
|
253
|
-
-38,
|
254
|
-
nil,
|
255
|
-
nil,
|
256
|
-
nil,
|
257
|
-
-33,
|
258
|
-
-37,
|
259
|
-
nil,
|
260
|
-
nil,
|
261
|
-
nil,
|
262
|
-
nil,
|
263
|
-
-9,
|
264
|
-
-22,
|
265
|
-
-19,
|
266
|
-
-20,
|
267
|
-
-12,
|
268
|
-
nil,
|
269
|
-
nil,
|
270
|
-
nil,
|
271
|
-
-24,
|
272
|
-
nil,
|
273
|
-
-14,
|
274
|
-
nil,
|
275
|
-
-34,
|
276
|
-
nil,
|
277
|
-
nil,
|
278
|
-
nil,
|
279
|
-
nil,
|
280
|
-
nil,
|
281
|
-
nil,
|
282
|
-
nil,
|
283
|
-
nil,
|
284
|
-
nil,
|
285
|
-
nil,
|
286
|
-
-15,
|
287
|
-
nil,
|
288
|
-
-5,
|
289
|
-
nil,
|
290
|
-
nil,
|
291
|
-
-6,
|
292
|
-
nil,
|
293
|
-
-14,
|
294
|
-
nil,
|
295
|
-
-40,
|
296
|
-
nil,
|
297
|
-
-43,
|
298
|
-
-18,
|
299
|
-
-42,
|
300
|
-
-35,
|
301
|
-
-36,
|
302
|
-
-31,
|
303
|
-
-26,
|
304
|
-
-32,
|
305
|
-
-27,
|
306
|
-
-28,
|
307
|
-
-29,
|
308
|
-
-25,
|
309
|
-
-30,
|
310
|
-
-11,
|
311
|
-
-10,
|
312
|
-
-14,
|
313
|
-
-16,
|
314
|
-
-13,
|
315
|
-
-17,
|
316
|
-
nil,
|
317
|
-
-3,
|
318
|
-
-41,
|
319
|
-
nil,
|
320
|
-
-23,
|
321
|
-
-3,
|
322
|
-
nil,
|
323
|
-
-44,
|
324
|
-
nil,
|
325
|
-
-7,
|
326
|
-
-8,
|
327
|
-
]
|
328
|
-
defred_after_shift_table = [
|
329
|
-
-3,
|
330
|
-
nil,
|
331
|
-
nil,
|
332
|
-
nil,
|
333
|
-
-1,
|
334
|
-
-4,
|
335
|
-
nil,
|
336
|
-
nil,
|
337
|
-
nil,
|
338
|
-
nil,
|
339
|
-
nil,
|
340
|
-
nil,
|
341
|
-
nil,
|
342
|
-
nil,
|
343
|
-
-21,
|
344
|
-
-2,
|
345
|
-
nil,
|
346
|
-
-39,
|
347
|
-
nil,
|
348
|
-
nil,
|
349
|
-
nil,
|
350
|
-
nil,
|
351
|
-
nil,
|
352
|
-
nil,
|
353
|
-
-37,
|
354
|
-
nil,
|
355
|
-
nil,
|
356
|
-
nil,
|
357
|
-
nil,
|
358
|
-
-9,
|
359
|
-
-22,
|
360
|
-
nil,
|
361
|
-
nil,
|
362
|
-
-12,
|
363
|
-
nil,
|
364
|
-
nil,
|
365
|
-
nil,
|
366
|
-
nil,
|
367
|
-
nil,
|
368
|
-
nil,
|
369
|
-
nil,
|
370
|
-
nil,
|
371
|
-
nil,
|
372
|
-
nil,
|
373
|
-
nil,
|
374
|
-
nil,
|
375
|
-
nil,
|
376
|
-
nil,
|
377
|
-
nil,
|
378
|
-
nil,
|
379
|
-
nil,
|
380
|
-
nil,
|
381
|
-
nil,
|
382
|
-
nil,
|
383
|
-
-5,
|
384
|
-
nil,
|
385
|
-
nil,
|
386
|
-
-6,
|
387
|
-
nil,
|
388
|
-
nil,
|
389
|
-
nil,
|
390
|
-
-40,
|
391
|
-
nil,
|
392
|
-
nil,
|
393
|
-
-18,
|
394
|
-
-42,
|
395
|
-
-35,
|
396
|
-
-36,
|
397
|
-
nil,
|
398
|
-
nil,
|
399
|
-
nil,
|
400
|
-
nil,
|
401
|
-
nil,
|
402
|
-
nil,
|
403
|
-
nil,
|
404
|
-
nil,
|
405
|
-
-11,
|
406
|
-
-10,
|
407
|
-
nil,
|
408
|
-
-16,
|
409
|
-
-13,
|
410
|
-
-17,
|
411
|
-
nil,
|
412
|
-
-3,
|
413
|
-
-41,
|
414
|
-
nil,
|
415
|
-
-23,
|
416
|
-
-3,
|
417
|
-
nil,
|
418
|
-
nil,
|
419
|
-
nil,
|
420
|
-
-7,
|
421
|
-
-8,
|
422
|
-
]
|
423
|
-
### Nonterm to Int
|
424
|
-
nt2i = {
|
425
|
-
:program => 0,
|
426
|
-
:block => 1,
|
427
|
-
:opt_decl_list => 2,
|
428
|
-
:statement => 3,
|
429
|
-
:decl => 4,
|
430
|
-
:const_init_list => 5,
|
431
|
-
:ident_list => 6,
|
432
|
-
:const_init => 7,
|
433
|
-
:expression => 8,
|
434
|
-
:opt_state_list => 9,
|
435
|
-
:condition => 10,
|
436
|
-
:term => 11,
|
437
|
-
:factor => 12,
|
438
|
-
:exp_list => 13,
|
439
|
-
}
|
440
|
-
### Int to Nonterm
|
441
|
-
i2nt = [
|
442
|
-
:program,
|
443
|
-
:block,
|
444
|
-
:opt_decl_list,
|
445
|
-
:statement,
|
446
|
-
:decl,
|
447
|
-
:const_init_list,
|
448
|
-
:ident_list,
|
449
|
-
:const_init,
|
450
|
-
:expression,
|
451
|
-
:opt_state_list,
|
452
|
-
:condition,
|
453
|
-
:term,
|
454
|
-
:factor,
|
455
|
-
:exp_list,
|
456
|
-
]
|
457
|
-
### Goto Table
|
458
|
-
goto_table = [
|
459
|
-
[ 1, 2, 3, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
460
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
461
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
462
|
-
[ nil, nil, nil, 15, 5, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
463
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
464
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
465
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 25, nil, 20, 23, 24, nil, ],
|
466
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
467
|
-
[ nil, nil, nil, nil, nil, 28, nil, 29, nil, nil, nil, nil, nil, nil, ],
|
468
|
-
[ nil, nil, nil, 30, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
469
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 31, nil, nil, 23, 24, nil, ],
|
470
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 32, nil, nil, 23, 24, nil, ],
|
471
|
-
[ nil, nil, nil, nil, nil, nil, 34, nil, nil, nil, nil, nil, nil, nil, ],
|
472
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 25, nil, 35, 23, 24, nil, ],
|
473
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
474
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
475
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
476
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
477
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 37, nil, nil, 23, 24, nil, ],
|
478
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
479
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
480
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 40, nil, nil, 23, 24, nil, ],
|
481
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 41, 24, nil, ],
|
482
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
483
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
484
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
485
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 52, nil, nil, 23, 24, nil, ],
|
486
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
487
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
488
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
489
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 56, nil, nil, nil, nil, ],
|
490
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
491
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
492
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
493
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
494
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
495
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
496
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
497
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 63, nil, nil, 23, 24, 62, ],
|
498
|
-
[ nil, nil, nil, 64, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
499
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
500
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
501
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 66, nil, ],
|
502
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 67, nil, ],
|
503
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 68, 24, nil, ],
|
504
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 69, nil, nil, 23, 24, nil, ],
|
505
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 70, 24, nil, ],
|
506
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 71, nil, nil, 23, 24, nil, ],
|
507
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 72, nil, nil, 23, 24, nil, ],
|
508
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 73, nil, nil, 23, 24, nil, ],
|
509
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 74, nil, nil, 23, 24, nil, ],
|
510
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 75, nil, nil, 23, 24, nil, ],
|
511
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
512
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
513
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
514
|
-
[ nil, nil, nil, nil, nil, nil, nil, 77, nil, nil, nil, nil, nil, nil, ],
|
515
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
516
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
517
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
518
|
-
[ nil, nil, nil, 81, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
519
|
-
[ nil, nil, nil, nil, nil, nil, 82, nil, nil, nil, nil, nil, nil, nil, ],
|
520
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
521
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
522
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
523
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
524
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
525
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
526
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
527
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
528
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
529
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
530
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
531
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
532
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
533
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
534
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
535
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
536
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
537
|
-
[ nil, nil, nil, 86, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
538
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
539
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
540
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
541
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
542
|
-
[ nil, 88, 3, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
543
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
544
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 89, nil, nil, 23, 24, nil, ],
|
545
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
546
|
-
[ nil, 90, 3, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
547
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
548
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
549
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
550
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
551
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
552
|
-
]
|
553
|
-
|
554
|
-
|
555
|
-
alias orig_error error
|
556
|
-
def error
|
557
|
-
orig_error
|
558
|
-
warn "current state: #{StateInfo[@stack.last]}"
|
559
|
-
end
|
560
|
-
|
561
|
-
### States
|
562
|
-
StateInfo = [
|
563
|
-
<<'----------',
|
564
|
-
I000 =
|
565
|
-
( 0) $start : _ program
|
566
|
-
|
567
|
-
|
568
|
-
$default reduce using rule 3 (opt_decl_list) [after shift]
|
569
|
-
|
570
|
-
----------
|
571
|
-
|
572
|
-
<<'----------',
|
573
|
-
I001 =
|
574
|
-
( 0) $start : program _
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
$end accept
|
579
|
-
|
580
|
-
----------
|
581
|
-
|
582
|
-
<<'----------',
|
583
|
-
I002 =
|
584
|
-
( 1) program : block _ '.'
|
585
|
-
|
586
|
-
'.' shift, and goto to state 4
|
587
|
-
|
588
|
-
|
589
|
-
----------
|
590
|
-
|
591
|
-
<<'----------',
|
592
|
-
I003 =
|
593
|
-
( 2) block : opt_decl_list _ statement
|
594
|
-
( 4) opt_decl_list : opt_decl_list _ decl
|
595
|
-
|
596
|
-
CONST shift, and goto to state 8
|
597
|
-
VAR shift, and goto to state 12
|
598
|
-
FUNCTION shift, and goto to state 16
|
599
|
-
IDENT shift, and goto to state 7
|
600
|
-
BEGINN shift, and goto to state 9
|
601
|
-
IF shift, and goto to state 13
|
602
|
-
WHILE shift, and goto to state 6
|
603
|
-
RETURN shift, and goto to state 10
|
604
|
-
WRITE shift, and goto to state 11
|
605
|
-
WRITELN shift, and goto to state 14
|
606
|
-
|
607
|
-
$default reduce using rule 14 (statement)
|
608
|
-
|
609
|
-
----------
|
610
|
-
|
611
|
-
<<'----------',
|
612
|
-
I004 =
|
613
|
-
( 1) program : block '.' _
|
614
|
-
|
615
|
-
|
616
|
-
$default reduce using rule 1 (program) [after shift]
|
617
|
-
|
618
|
-
----------
|
619
|
-
|
620
|
-
<<'----------',
|
621
|
-
I005 =
|
622
|
-
( 4) opt_decl_list : opt_decl_list decl _
|
623
|
-
|
624
|
-
|
625
|
-
$default reduce using rule 4 (opt_decl_list) [after shift]
|
626
|
-
|
627
|
-
----------
|
628
|
-
|
629
|
-
<<'----------',
|
630
|
-
I006 =
|
631
|
-
( 18) statement : WHILE _ condition DO statement
|
632
|
-
|
633
|
-
IDENT shift, and goto to state 19
|
634
|
-
'(' shift, and goto to state 21
|
635
|
-
NUMBER shift, and goto to state 17
|
636
|
-
ODD shift, and goto to state 18
|
637
|
-
'-' shift, and goto to state 22
|
638
|
-
|
639
|
-
|
640
|
-
----------
|
641
|
-
|
642
|
-
<<'----------',
|
643
|
-
I007 =
|
644
|
-
( 15) statement : IDENT _ COLOEQ expression
|
645
|
-
|
646
|
-
COLOEQ shift, and goto to state 26
|
647
|
-
|
648
|
-
|
649
|
-
----------
|
650
|
-
|
651
|
-
<<'----------',
|
652
|
-
I008 =
|
653
|
-
( 5) decl : CONST _ const_init_list ';'
|
654
|
-
|
655
|
-
IDENT shift, and goto to state 27
|
656
|
-
|
657
|
-
|
658
|
-
----------
|
659
|
-
|
660
|
-
<<'----------',
|
661
|
-
I009 =
|
662
|
-
( 16) statement : BEGINN _ statement opt_state_list END
|
663
|
-
|
664
|
-
IDENT shift, and goto to state 7
|
665
|
-
BEGINN shift, and goto to state 9
|
666
|
-
IF shift, and goto to state 13
|
667
|
-
WHILE shift, and goto to state 6
|
668
|
-
RETURN shift, and goto to state 10
|
669
|
-
WRITE shift, and goto to state 11
|
670
|
-
WRITELN shift, and goto to state 14
|
671
|
-
|
672
|
-
$default reduce using rule 14 (statement)
|
673
|
-
|
674
|
-
----------
|
675
|
-
|
676
|
-
<<'----------',
|
677
|
-
I010 =
|
678
|
-
( 19) statement : RETURN _ expression
|
679
|
-
|
680
|
-
IDENT shift, and goto to state 19
|
681
|
-
'(' shift, and goto to state 21
|
682
|
-
NUMBER shift, and goto to state 17
|
683
|
-
'-' shift, and goto to state 22
|
684
|
-
|
685
|
-
|
686
|
-
----------
|
687
|
-
|
688
|
-
<<'----------',
|
689
|
-
I011 =
|
690
|
-
( 20) statement : WRITE _ expression
|
691
|
-
|
692
|
-
IDENT shift, and goto to state 19
|
693
|
-
'(' shift, and goto to state 21
|
694
|
-
NUMBER shift, and goto to state 17
|
695
|
-
'-' shift, and goto to state 22
|
696
|
-
|
697
|
-
|
698
|
-
----------
|
699
|
-
|
700
|
-
<<'----------',
|
701
|
-
I012 =
|
702
|
-
( 6) decl : VAR _ ident_list ';'
|
703
|
-
|
704
|
-
IDENT shift, and goto to state 33
|
705
|
-
|
706
|
-
|
707
|
-
----------
|
708
|
-
|
709
|
-
<<'----------',
|
710
|
-
I013 =
|
711
|
-
( 17) statement : IF _ condition THEN statement
|
712
|
-
|
713
|
-
IDENT shift, and goto to state 19
|
714
|
-
'(' shift, and goto to state 21
|
715
|
-
NUMBER shift, and goto to state 17
|
716
|
-
ODD shift, and goto to state 18
|
717
|
-
'-' shift, and goto to state 22
|
718
|
-
|
719
|
-
|
720
|
-
----------
|
721
|
-
|
722
|
-
<<'----------',
|
723
|
-
I014 =
|
724
|
-
( 21) statement : WRITELN _
|
725
|
-
|
726
|
-
|
727
|
-
$default reduce using rule 21 (statement) [after shift]
|
728
|
-
|
729
|
-
----------
|
730
|
-
|
731
|
-
<<'----------',
|
732
|
-
I015 =
|
733
|
-
( 2) block : opt_decl_list statement _
|
734
|
-
|
735
|
-
|
736
|
-
$default reduce using rule 2 (block) [after shift]
|
737
|
-
|
738
|
-
----------
|
739
|
-
|
740
|
-
<<'----------',
|
741
|
-
I016 =
|
742
|
-
( 7) decl : FUNCTION _ IDENT '(' ')' block ';'
|
743
|
-
( 8) decl : FUNCTION _ IDENT '(' ident_list ')' block ';'
|
744
|
-
|
745
|
-
IDENT shift, and goto to state 36
|
746
|
-
|
747
|
-
|
748
|
-
----------
|
749
|
-
|
750
|
-
<<'----------',
|
751
|
-
I017 =
|
752
|
-
( 39) factor : NUMBER _
|
753
|
-
|
754
|
-
|
755
|
-
$default reduce using rule 39 (factor) [after shift]
|
756
|
-
|
757
|
-
----------
|
758
|
-
|
759
|
-
<<'----------',
|
760
|
-
I018 =
|
761
|
-
( 24) condition : ODD _ expression
|
762
|
-
|
763
|
-
IDENT shift, and goto to state 19
|
764
|
-
'(' shift, and goto to state 21
|
765
|
-
NUMBER shift, and goto to state 17
|
766
|
-
'-' shift, and goto to state 22
|
767
|
-
|
768
|
-
|
769
|
-
----------
|
770
|
-
|
771
|
-
<<'----------',
|
772
|
-
I019 =
|
773
|
-
( 38) factor : IDENT _
|
774
|
-
( 40) factor : IDENT _ '(' ')'
|
775
|
-
( 41) factor : IDENT _ '(' exp_list ')'
|
776
|
-
|
777
|
-
'(' shift, and goto to state 38
|
778
|
-
|
779
|
-
$default reduce using rule 38 (factor)
|
780
|
-
|
781
|
-
----------
|
782
|
-
|
783
|
-
<<'----------',
|
784
|
-
I020 =
|
785
|
-
( 18) statement : WHILE condition _ DO statement
|
786
|
-
|
787
|
-
DO shift, and goto to state 39
|
788
|
-
|
789
|
-
|
790
|
-
----------
|
791
|
-
|
792
|
-
<<'----------',
|
793
|
-
I021 =
|
794
|
-
( 42) factor : '(' _ expression ')'
|
795
|
-
|
796
|
-
IDENT shift, and goto to state 19
|
797
|
-
'(' shift, and goto to state 21
|
798
|
-
NUMBER shift, and goto to state 17
|
799
|
-
'-' shift, and goto to state 22
|
800
|
-
|
801
|
-
|
802
|
-
----------
|
803
|
-
|
804
|
-
<<'----------',
|
805
|
-
I022 =
|
806
|
-
( 34) expression : '-' _ term
|
807
|
-
|
808
|
-
IDENT shift, and goto to state 19
|
809
|
-
'(' shift, and goto to state 21
|
810
|
-
NUMBER shift, and goto to state 17
|
811
|
-
|
812
|
-
|
813
|
-
----------
|
814
|
-
|
815
|
-
<<'----------',
|
816
|
-
I023 =
|
817
|
-
( 33) expression : term _
|
818
|
-
( 35) term : term _ '*' factor
|
819
|
-
( 36) term : term _ '/' factor
|
820
|
-
|
821
|
-
'*' shift, and goto to state 42
|
822
|
-
'/' shift, and goto to state 43
|
823
|
-
|
824
|
-
$default reduce using rule 33 (expression)
|
825
|
-
|
826
|
-
----------
|
827
|
-
|
828
|
-
<<'----------',
|
829
|
-
I024 =
|
830
|
-
( 37) term : factor _
|
831
|
-
|
832
|
-
|
833
|
-
$default reduce using rule 37 (term) [after shift]
|
834
|
-
|
835
|
-
----------
|
836
|
-
|
837
|
-
<<'----------',
|
838
|
-
I025 =
|
839
|
-
( 25) condition : expression _ EQ expression
|
840
|
-
( 26) condition : expression _ NOTEQ expression
|
841
|
-
( 27) condition : expression _ LT expression
|
842
|
-
( 28) condition : expression _ GT expression
|
843
|
-
( 29) condition : expression _ LE expression
|
844
|
-
( 30) condition : expression _ GE expression
|
845
|
-
( 31) expression : expression _ '+' term
|
846
|
-
( 32) expression : expression _ '-' term
|
847
|
-
|
848
|
-
EQ shift, and goto to state 50
|
849
|
-
NOTEQ shift, and goto to state 45
|
850
|
-
LT shift, and goto to state 47
|
851
|
-
GT shift, and goto to state 48
|
852
|
-
LE shift, and goto to state 49
|
853
|
-
GE shift, and goto to state 51
|
854
|
-
'+' shift, and goto to state 44
|
855
|
-
'-' shift, and goto to state 46
|
856
|
-
|
857
|
-
|
858
|
-
----------
|
859
|
-
|
860
|
-
<<'----------',
|
861
|
-
I026 =
|
862
|
-
( 15) statement : IDENT COLOEQ _ expression
|
863
|
-
|
864
|
-
IDENT shift, and goto to state 19
|
865
|
-
'(' shift, and goto to state 21
|
866
|
-
NUMBER shift, and goto to state 17
|
867
|
-
'-' shift, and goto to state 22
|
868
|
-
|
869
|
-
|
870
|
-
----------
|
871
|
-
|
872
|
-
<<'----------',
|
873
|
-
I027 =
|
874
|
-
( 11) const_init : IDENT _ EQ NUMBER
|
875
|
-
|
876
|
-
EQ shift, and goto to state 53
|
877
|
-
|
878
|
-
|
879
|
-
----------
|
880
|
-
|
881
|
-
<<'----------',
|
882
|
-
I028 =
|
883
|
-
( 5) decl : CONST const_init_list _ ';'
|
884
|
-
( 10) const_init_list : const_init_list _ ',' const_init
|
885
|
-
|
886
|
-
';' shift, and goto to state 54
|
887
|
-
',' shift, and goto to state 55
|
888
|
-
|
889
|
-
|
890
|
-
----------
|
891
|
-
|
892
|
-
<<'----------',
|
893
|
-
I029 =
|
894
|
-
( 9) const_init_list : const_init _
|
895
|
-
|
896
|
-
|
897
|
-
$default reduce using rule 9 (const_init_list) [after shift]
|
898
|
-
|
899
|
-
----------
|
900
|
-
|
901
|
-
<<'----------',
|
902
|
-
I030 =
|
903
|
-
( 16) statement : BEGINN statement _ opt_state_list END
|
904
|
-
|
905
|
-
|
906
|
-
$default reduce using rule 22 (opt_state_list) [after shift]
|
907
|
-
|
908
|
-
----------
|
909
|
-
|
910
|
-
<<'----------',
|
911
|
-
I031 =
|
912
|
-
( 19) statement : RETURN expression _
|
913
|
-
( 31) expression : expression _ '+' term
|
914
|
-
( 32) expression : expression _ '-' term
|
915
|
-
|
916
|
-
'+' shift, and goto to state 44
|
917
|
-
'-' shift, and goto to state 46
|
918
|
-
|
919
|
-
$default reduce using rule 19 (statement)
|
920
|
-
|
921
|
-
----------
|
922
|
-
|
923
|
-
<<'----------',
|
924
|
-
I032 =
|
925
|
-
( 20) statement : WRITE expression _
|
926
|
-
( 31) expression : expression _ '+' term
|
927
|
-
( 32) expression : expression _ '-' term
|
928
|
-
|
929
|
-
'+' shift, and goto to state 44
|
930
|
-
'-' shift, and goto to state 46
|
931
|
-
|
932
|
-
$default reduce using rule 20 (statement)
|
933
|
-
|
934
|
-
----------
|
935
|
-
|
936
|
-
<<'----------',
|
937
|
-
I033 =
|
938
|
-
( 12) ident_list : IDENT _
|
939
|
-
|
940
|
-
|
941
|
-
$default reduce using rule 12 (ident_list) [after shift]
|
942
|
-
|
943
|
-
----------
|
944
|
-
|
945
|
-
<<'----------',
|
946
|
-
I034 =
|
947
|
-
( 6) decl : VAR ident_list _ ';'
|
948
|
-
( 13) ident_list : ident_list _ ',' IDENT
|
949
|
-
|
950
|
-
';' shift, and goto to state 57
|
951
|
-
',' shift, and goto to state 58
|
952
|
-
|
953
|
-
|
954
|
-
----------
|
955
|
-
|
956
|
-
<<'----------',
|
957
|
-
I035 =
|
958
|
-
( 17) statement : IF condition _ THEN statement
|
959
|
-
|
960
|
-
THEN shift, and goto to state 59
|
961
|
-
|
962
|
-
|
963
|
-
----------
|
964
|
-
|
965
|
-
<<'----------',
|
966
|
-
I036 =
|
967
|
-
( 7) decl : FUNCTION IDENT _ '(' ')' block ';'
|
968
|
-
( 8) decl : FUNCTION IDENT _ '(' ident_list ')' block ';'
|
969
|
-
|
970
|
-
'(' shift, and goto to state 60
|
971
|
-
|
972
|
-
|
973
|
-
----------
|
974
|
-
|
975
|
-
<<'----------',
|
976
|
-
I037 =
|
977
|
-
( 24) condition : ODD expression _
|
978
|
-
( 31) expression : expression _ '+' term
|
979
|
-
( 32) expression : expression _ '-' term
|
980
|
-
|
981
|
-
'+' shift, and goto to state 44
|
982
|
-
'-' shift, and goto to state 46
|
983
|
-
|
984
|
-
$default reduce using rule 24 (condition)
|
985
|
-
|
986
|
-
----------
|
987
|
-
|
988
|
-
<<'----------',
|
989
|
-
I038 =
|
990
|
-
( 40) factor : IDENT '(' _ ')'
|
991
|
-
( 41) factor : IDENT '(' _ exp_list ')'
|
992
|
-
|
993
|
-
IDENT shift, and goto to state 19
|
994
|
-
'(' shift, and goto to state 21
|
995
|
-
')' shift, and goto to state 61
|
996
|
-
NUMBER shift, and goto to state 17
|
997
|
-
'-' shift, and goto to state 22
|
998
|
-
|
999
|
-
|
1000
|
-
----------
|
1001
|
-
|
1002
|
-
<<'----------',
|
1003
|
-
I039 =
|
1004
|
-
( 18) statement : WHILE condition DO _ statement
|
1005
|
-
|
1006
|
-
IDENT shift, and goto to state 7
|
1007
|
-
BEGINN shift, and goto to state 9
|
1008
|
-
IF shift, and goto to state 13
|
1009
|
-
WHILE shift, and goto to state 6
|
1010
|
-
RETURN shift, and goto to state 10
|
1011
|
-
WRITE shift, and goto to state 11
|
1012
|
-
WRITELN shift, and goto to state 14
|
1013
|
-
|
1014
|
-
$default reduce using rule 14 (statement)
|
1015
|
-
|
1016
|
-
----------
|
1017
|
-
|
1018
|
-
<<'----------',
|
1019
|
-
I040 =
|
1020
|
-
( 42) factor : '(' expression _ ')'
|
1021
|
-
( 31) expression : expression _ '+' term
|
1022
|
-
( 32) expression : expression _ '-' term
|
1023
|
-
|
1024
|
-
')' shift, and goto to state 65
|
1025
|
-
'+' shift, and goto to state 44
|
1026
|
-
'-' shift, and goto to state 46
|
1027
|
-
|
1028
|
-
|
1029
|
-
----------
|
1030
|
-
|
1031
|
-
<<'----------',
|
1032
|
-
I041 =
|
1033
|
-
( 34) expression : '-' term _
|
1034
|
-
( 35) term : term _ '*' factor
|
1035
|
-
( 36) term : term _ '/' factor
|
1036
|
-
|
1037
|
-
'*' shift, and goto to state 42
|
1038
|
-
'/' shift, and goto to state 43
|
1039
|
-
|
1040
|
-
$default reduce using rule 34 (expression)
|
1041
|
-
|
1042
|
-
----------
|
1043
|
-
|
1044
|
-
<<'----------',
|
1045
|
-
I042 =
|
1046
|
-
( 35) term : term '*' _ factor
|
1047
|
-
|
1048
|
-
IDENT shift, and goto to state 19
|
1049
|
-
'(' shift, and goto to state 21
|
1050
|
-
NUMBER shift, and goto to state 17
|
1051
|
-
|
1052
|
-
|
1053
|
-
----------
|
1054
|
-
|
1055
|
-
<<'----------',
|
1056
|
-
I043 =
|
1057
|
-
( 36) term : term '/' _ factor
|
1058
|
-
|
1059
|
-
IDENT shift, and goto to state 19
|
1060
|
-
'(' shift, and goto to state 21
|
1061
|
-
NUMBER shift, and goto to state 17
|
1062
|
-
|
1063
|
-
|
1064
|
-
----------
|
1065
|
-
|
1066
|
-
<<'----------',
|
1067
|
-
I044 =
|
1068
|
-
( 31) expression : expression '+' _ term
|
1069
|
-
|
1070
|
-
IDENT shift, and goto to state 19
|
1071
|
-
'(' shift, and goto to state 21
|
1072
|
-
NUMBER shift, and goto to state 17
|
1073
|
-
|
1074
|
-
|
1075
|
-
----------
|
1076
|
-
|
1077
|
-
<<'----------',
|
1078
|
-
I045 =
|
1079
|
-
( 26) condition : expression NOTEQ _ expression
|
1080
|
-
|
1081
|
-
IDENT shift, and goto to state 19
|
1082
|
-
'(' shift, and goto to state 21
|
1083
|
-
NUMBER shift, and goto to state 17
|
1084
|
-
'-' shift, and goto to state 22
|
1085
|
-
|
1086
|
-
|
1087
|
-
----------
|
1088
|
-
|
1089
|
-
<<'----------',
|
1090
|
-
I046 =
|
1091
|
-
( 32) expression : expression '-' _ term
|
1092
|
-
|
1093
|
-
IDENT shift, and goto to state 19
|
1094
|
-
'(' shift, and goto to state 21
|
1095
|
-
NUMBER shift, and goto to state 17
|
1096
|
-
|
1097
|
-
|
1098
|
-
----------
|
1099
|
-
|
1100
|
-
<<'----------',
|
1101
|
-
I047 =
|
1102
|
-
( 27) condition : expression LT _ expression
|
1103
|
-
|
1104
|
-
IDENT shift, and goto to state 19
|
1105
|
-
'(' shift, and goto to state 21
|
1106
|
-
NUMBER shift, and goto to state 17
|
1107
|
-
'-' shift, and goto to state 22
|
1108
|
-
|
1109
|
-
|
1110
|
-
----------
|
1111
|
-
|
1112
|
-
<<'----------',
|
1113
|
-
I048 =
|
1114
|
-
( 28) condition : expression GT _ expression
|
1115
|
-
|
1116
|
-
IDENT shift, and goto to state 19
|
1117
|
-
'(' shift, and goto to state 21
|
1118
|
-
NUMBER shift, and goto to state 17
|
1119
|
-
'-' shift, and goto to state 22
|
1120
|
-
|
1121
|
-
|
1122
|
-
----------
|
1123
|
-
|
1124
|
-
<<'----------',
|
1125
|
-
I049 =
|
1126
|
-
( 29) condition : expression LE _ expression
|
1127
|
-
|
1128
|
-
IDENT shift, and goto to state 19
|
1129
|
-
'(' shift, and goto to state 21
|
1130
|
-
NUMBER shift, and goto to state 17
|
1131
|
-
'-' shift, and goto to state 22
|
1132
|
-
|
1133
|
-
|
1134
|
-
----------
|
1135
|
-
|
1136
|
-
<<'----------',
|
1137
|
-
I050 =
|
1138
|
-
( 25) condition : expression EQ _ expression
|
1139
|
-
|
1140
|
-
IDENT shift, and goto to state 19
|
1141
|
-
'(' shift, and goto to state 21
|
1142
|
-
NUMBER shift, and goto to state 17
|
1143
|
-
'-' shift, and goto to state 22
|
1144
|
-
|
1145
|
-
|
1146
|
-
----------
|
1147
|
-
|
1148
|
-
<<'----------',
|
1149
|
-
I051 =
|
1150
|
-
( 30) condition : expression GE _ expression
|
1151
|
-
|
1152
|
-
IDENT shift, and goto to state 19
|
1153
|
-
'(' shift, and goto to state 21
|
1154
|
-
NUMBER shift, and goto to state 17
|
1155
|
-
'-' shift, and goto to state 22
|
1156
|
-
|
1157
|
-
|
1158
|
-
----------
|
1159
|
-
|
1160
|
-
<<'----------',
|
1161
|
-
I052 =
|
1162
|
-
( 15) statement : IDENT COLOEQ expression _
|
1163
|
-
( 31) expression : expression _ '+' term
|
1164
|
-
( 32) expression : expression _ '-' term
|
1165
|
-
|
1166
|
-
'+' shift, and goto to state 44
|
1167
|
-
'-' shift, and goto to state 46
|
1168
|
-
|
1169
|
-
$default reduce using rule 15 (statement)
|
1170
|
-
|
1171
|
-
----------
|
1172
|
-
|
1173
|
-
<<'----------',
|
1174
|
-
I053 =
|
1175
|
-
( 11) const_init : IDENT EQ _ NUMBER
|
1176
|
-
|
1177
|
-
NUMBER shift, and goto to state 76
|
1178
|
-
|
1179
|
-
|
1180
|
-
----------
|
1181
|
-
|
1182
|
-
<<'----------',
|
1183
|
-
I054 =
|
1184
|
-
( 5) decl : CONST const_init_list ';' _
|
1185
|
-
|
1186
|
-
|
1187
|
-
$default reduce using rule 5 (decl) [after shift]
|
1188
|
-
|
1189
|
-
----------
|
1190
|
-
|
1191
|
-
<<'----------',
|
1192
|
-
I055 =
|
1193
|
-
( 10) const_init_list : const_init_list ',' _ const_init
|
1194
|
-
|
1195
|
-
IDENT shift, and goto to state 27
|
1196
|
-
|
1197
|
-
|
1198
|
-
----------
|
1199
|
-
|
1200
|
-
<<'----------',
|
1201
|
-
I056 =
|
1202
|
-
( 16) statement : BEGINN statement opt_state_list _ END
|
1203
|
-
( 23) opt_state_list : opt_state_list _ ';' statement
|
1204
|
-
|
1205
|
-
';' shift, and goto to state 78
|
1206
|
-
END shift, and goto to state 79
|
1207
|
-
|
1208
|
-
|
1209
|
-
----------
|
1210
|
-
|
1211
|
-
<<'----------',
|
1212
|
-
I057 =
|
1213
|
-
( 6) decl : VAR ident_list ';' _
|
1214
|
-
|
1215
|
-
|
1216
|
-
$default reduce using rule 6 (decl) [after shift]
|
1217
|
-
|
1218
|
-
----------
|
1219
|
-
|
1220
|
-
<<'----------',
|
1221
|
-
I058 =
|
1222
|
-
( 13) ident_list : ident_list ',' _ IDENT
|
1223
|
-
|
1224
|
-
IDENT shift, and goto to state 80
|
1225
|
-
|
1226
|
-
|
1227
|
-
----------
|
1228
|
-
|
1229
|
-
<<'----------',
|
1230
|
-
I059 =
|
1231
|
-
( 17) statement : IF condition THEN _ statement
|
1232
|
-
|
1233
|
-
IDENT shift, and goto to state 7
|
1234
|
-
BEGINN shift, and goto to state 9
|
1235
|
-
IF shift, and goto to state 13
|
1236
|
-
WHILE shift, and goto to state 6
|
1237
|
-
RETURN shift, and goto to state 10
|
1238
|
-
WRITE shift, and goto to state 11
|
1239
|
-
WRITELN shift, and goto to state 14
|
1240
|
-
|
1241
|
-
$default reduce using rule 14 (statement)
|
1242
|
-
|
1243
|
-
----------
|
1244
|
-
|
1245
|
-
<<'----------',
|
1246
|
-
I060 =
|
1247
|
-
( 7) decl : FUNCTION IDENT '(' _ ')' block ';'
|
1248
|
-
( 8) decl : FUNCTION IDENT '(' _ ident_list ')' block ';'
|
1249
|
-
|
1250
|
-
IDENT shift, and goto to state 33
|
1251
|
-
')' shift, and goto to state 83
|
1252
|
-
|
1253
|
-
|
1254
|
-
----------
|
1255
|
-
|
1256
|
-
<<'----------',
|
1257
|
-
I061 =
|
1258
|
-
( 40) factor : IDENT '(' ')' _
|
1259
|
-
|
1260
|
-
|
1261
|
-
$default reduce using rule 40 (factor) [after shift]
|
1262
|
-
|
1263
|
-
----------
|
1264
|
-
|
1265
|
-
<<'----------',
|
1266
|
-
I062 =
|
1267
|
-
( 41) factor : IDENT '(' exp_list _ ')'
|
1268
|
-
( 44) exp_list : exp_list _ ',' expression
|
1269
|
-
|
1270
|
-
')' shift, and goto to state 84
|
1271
|
-
',' shift, and goto to state 85
|
1272
|
-
|
1273
|
-
|
1274
|
-
----------
|
1275
|
-
|
1276
|
-
<<'----------',
|
1277
|
-
I063 =
|
1278
|
-
( 43) exp_list : expression _
|
1279
|
-
( 31) expression : expression _ '+' term
|
1280
|
-
( 32) expression : expression _ '-' term
|
1281
|
-
|
1282
|
-
'+' shift, and goto to state 44
|
1283
|
-
'-' shift, and goto to state 46
|
1284
|
-
|
1285
|
-
$default reduce using rule 43 (exp_list)
|
1286
|
-
|
1287
|
-
----------
|
1288
|
-
|
1289
|
-
<<'----------',
|
1290
|
-
I064 =
|
1291
|
-
( 18) statement : WHILE condition DO statement _
|
1292
|
-
|
1293
|
-
|
1294
|
-
$default reduce using rule 18 (statement) [after shift]
|
1295
|
-
|
1296
|
-
----------
|
1297
|
-
|
1298
|
-
<<'----------',
|
1299
|
-
I065 =
|
1300
|
-
( 42) factor : '(' expression ')' _
|
1301
|
-
|
1302
|
-
|
1303
|
-
$default reduce using rule 42 (factor) [after shift]
|
1304
|
-
|
1305
|
-
----------
|
1306
|
-
|
1307
|
-
<<'----------',
|
1308
|
-
I066 =
|
1309
|
-
( 35) term : term '*' factor _
|
1310
|
-
|
1311
|
-
|
1312
|
-
$default reduce using rule 35 (term) [after shift]
|
1313
|
-
|
1314
|
-
----------
|
1315
|
-
|
1316
|
-
<<'----------',
|
1317
|
-
I067 =
|
1318
|
-
( 36) term : term '/' factor _
|
1319
|
-
|
1320
|
-
|
1321
|
-
$default reduce using rule 36 (term) [after shift]
|
1322
|
-
|
1323
|
-
----------
|
1324
|
-
|
1325
|
-
<<'----------',
|
1326
|
-
I068 =
|
1327
|
-
( 31) expression : expression '+' term _
|
1328
|
-
( 35) term : term _ '*' factor
|
1329
|
-
( 36) term : term _ '/' factor
|
1330
|
-
|
1331
|
-
'*' shift, and goto to state 42
|
1332
|
-
'/' shift, and goto to state 43
|
1333
|
-
|
1334
|
-
$default reduce using rule 31 (expression)
|
1335
|
-
|
1336
|
-
----------
|
1337
|
-
|
1338
|
-
<<'----------',
|
1339
|
-
I069 =
|
1340
|
-
( 26) condition : expression NOTEQ expression _
|
1341
|
-
( 31) expression : expression _ '+' term
|
1342
|
-
( 32) expression : expression _ '-' term
|
1343
|
-
|
1344
|
-
'+' shift, and goto to state 44
|
1345
|
-
'-' shift, and goto to state 46
|
1346
|
-
|
1347
|
-
$default reduce using rule 26 (condition)
|
1348
|
-
|
1349
|
-
----------
|
1350
|
-
|
1351
|
-
<<'----------',
|
1352
|
-
I070 =
|
1353
|
-
( 32) expression : expression '-' term _
|
1354
|
-
( 35) term : term _ '*' factor
|
1355
|
-
( 36) term : term _ '/' factor
|
1356
|
-
|
1357
|
-
'*' shift, and goto to state 42
|
1358
|
-
'/' shift, and goto to state 43
|
1359
|
-
|
1360
|
-
$default reduce using rule 32 (expression)
|
1361
|
-
|
1362
|
-
----------
|
1363
|
-
|
1364
|
-
<<'----------',
|
1365
|
-
I071 =
|
1366
|
-
( 27) condition : expression LT expression _
|
1367
|
-
( 31) expression : expression _ '+' term
|
1368
|
-
( 32) expression : expression _ '-' term
|
1369
|
-
|
1370
|
-
'+' shift, and goto to state 44
|
1371
|
-
'-' shift, and goto to state 46
|
1372
|
-
|
1373
|
-
$default reduce using rule 27 (condition)
|
1374
|
-
|
1375
|
-
----------
|
1376
|
-
|
1377
|
-
<<'----------',
|
1378
|
-
I072 =
|
1379
|
-
( 28) condition : expression GT expression _
|
1380
|
-
( 31) expression : expression _ '+' term
|
1381
|
-
( 32) expression : expression _ '-' term
|
1382
|
-
|
1383
|
-
'+' shift, and goto to state 44
|
1384
|
-
'-' shift, and goto to state 46
|
1385
|
-
|
1386
|
-
$default reduce using rule 28 (condition)
|
1387
|
-
|
1388
|
-
----------
|
1389
|
-
|
1390
|
-
<<'----------',
|
1391
|
-
I073 =
|
1392
|
-
( 29) condition : expression LE expression _
|
1393
|
-
( 31) expression : expression _ '+' term
|
1394
|
-
( 32) expression : expression _ '-' term
|
1395
|
-
|
1396
|
-
'+' shift, and goto to state 44
|
1397
|
-
'-' shift, and goto to state 46
|
1398
|
-
|
1399
|
-
$default reduce using rule 29 (condition)
|
1400
|
-
|
1401
|
-
----------
|
1402
|
-
|
1403
|
-
<<'----------',
|
1404
|
-
I074 =
|
1405
|
-
( 25) condition : expression EQ expression _
|
1406
|
-
( 31) expression : expression _ '+' term
|
1407
|
-
( 32) expression : expression _ '-' term
|
1408
|
-
|
1409
|
-
'+' shift, and goto to state 44
|
1410
|
-
'-' shift, and goto to state 46
|
1411
|
-
|
1412
|
-
$default reduce using rule 25 (condition)
|
1413
|
-
|
1414
|
-
----------
|
1415
|
-
|
1416
|
-
<<'----------',
|
1417
|
-
I075 =
|
1418
|
-
( 30) condition : expression GE expression _
|
1419
|
-
( 31) expression : expression _ '+' term
|
1420
|
-
( 32) expression : expression _ '-' term
|
1421
|
-
|
1422
|
-
'+' shift, and goto to state 44
|
1423
|
-
'-' shift, and goto to state 46
|
1424
|
-
|
1425
|
-
$default reduce using rule 30 (condition)
|
1426
|
-
|
1427
|
-
----------
|
1428
|
-
|
1429
|
-
<<'----------',
|
1430
|
-
I076 =
|
1431
|
-
( 11) const_init : IDENT EQ NUMBER _
|
1432
|
-
|
1433
|
-
|
1434
|
-
$default reduce using rule 11 (const_init) [after shift]
|
1435
|
-
|
1436
|
-
----------
|
1437
|
-
|
1438
|
-
<<'----------',
|
1439
|
-
I077 =
|
1440
|
-
( 10) const_init_list : const_init_list ',' const_init _
|
1441
|
-
|
1442
|
-
|
1443
|
-
$default reduce using rule 10 (const_init_list) [after shift]
|
1444
|
-
|
1445
|
-
----------
|
1446
|
-
|
1447
|
-
<<'----------',
|
1448
|
-
I078 =
|
1449
|
-
( 23) opt_state_list : opt_state_list ';' _ statement
|
1450
|
-
|
1451
|
-
IDENT shift, and goto to state 7
|
1452
|
-
BEGINN shift, and goto to state 9
|
1453
|
-
IF shift, and goto to state 13
|
1454
|
-
WHILE shift, and goto to state 6
|
1455
|
-
RETURN shift, and goto to state 10
|
1456
|
-
WRITE shift, and goto to state 11
|
1457
|
-
WRITELN shift, and goto to state 14
|
1458
|
-
|
1459
|
-
$default reduce using rule 14 (statement)
|
1460
|
-
|
1461
|
-
----------
|
1462
|
-
|
1463
|
-
<<'----------',
|
1464
|
-
I079 =
|
1465
|
-
( 16) statement : BEGINN statement opt_state_list END _
|
1466
|
-
|
1467
|
-
|
1468
|
-
$default reduce using rule 16 (statement) [after shift]
|
1469
|
-
|
1470
|
-
----------
|
1471
|
-
|
1472
|
-
<<'----------',
|
1473
|
-
I080 =
|
1474
|
-
( 13) ident_list : ident_list ',' IDENT _
|
1475
|
-
|
1476
|
-
|
1477
|
-
$default reduce using rule 13 (ident_list) [after shift]
|
1478
|
-
|
1479
|
-
----------
|
1480
|
-
|
1481
|
-
<<'----------',
|
1482
|
-
I081 =
|
1483
|
-
( 17) statement : IF condition THEN statement _
|
1484
|
-
|
1485
|
-
|
1486
|
-
$default reduce using rule 17 (statement) [after shift]
|
1487
|
-
|
1488
|
-
----------
|
1489
|
-
|
1490
|
-
<<'----------',
|
1491
|
-
I082 =
|
1492
|
-
( 8) decl : FUNCTION IDENT '(' ident_list _ ')' block ';'
|
1493
|
-
( 13) ident_list : ident_list _ ',' IDENT
|
1494
|
-
|
1495
|
-
')' shift, and goto to state 87
|
1496
|
-
',' shift, and goto to state 58
|
1497
|
-
|
1498
|
-
|
1499
|
-
----------
|
1500
|
-
|
1501
|
-
<<'----------',
|
1502
|
-
I083 =
|
1503
|
-
( 7) decl : FUNCTION IDENT '(' ')' _ block ';'
|
1504
|
-
|
1505
|
-
|
1506
|
-
$default reduce using rule 3 (opt_decl_list) [after shift]
|
1507
|
-
|
1508
|
-
----------
|
1509
|
-
|
1510
|
-
<<'----------',
|
1511
|
-
I084 =
|
1512
|
-
( 41) factor : IDENT '(' exp_list ')' _
|
1513
|
-
|
1514
|
-
|
1515
|
-
$default reduce using rule 41 (factor) [after shift]
|
1516
|
-
|
1517
|
-
----------
|
1518
|
-
|
1519
|
-
<<'----------',
|
1520
|
-
I085 =
|
1521
|
-
( 44) exp_list : exp_list ',' _ expression
|
1522
|
-
|
1523
|
-
IDENT shift, and goto to state 19
|
1524
|
-
'(' shift, and goto to state 21
|
1525
|
-
NUMBER shift, and goto to state 17
|
1526
|
-
'-' shift, and goto to state 22
|
1527
|
-
|
1528
|
-
|
1529
|
-
----------
|
1530
|
-
|
1531
|
-
<<'----------',
|
1532
|
-
I086 =
|
1533
|
-
( 23) opt_state_list : opt_state_list ';' statement _
|
1534
|
-
|
1535
|
-
|
1536
|
-
$default reduce using rule 23 (opt_state_list) [after shift]
|
1537
|
-
|
1538
|
-
----------
|
1539
|
-
|
1540
|
-
<<'----------',
|
1541
|
-
I087 =
|
1542
|
-
( 8) decl : FUNCTION IDENT '(' ident_list ')' _ block ';'
|
1543
|
-
|
1544
|
-
|
1545
|
-
$default reduce using rule 3 (opt_decl_list) [after shift]
|
1546
|
-
|
1547
|
-
----------
|
1548
|
-
|
1549
|
-
<<'----------',
|
1550
|
-
I088 =
|
1551
|
-
( 7) decl : FUNCTION IDENT '(' ')' block _ ';'
|
1552
|
-
|
1553
|
-
';' shift, and goto to state 91
|
1554
|
-
|
1555
|
-
|
1556
|
-
----------
|
1557
|
-
|
1558
|
-
<<'----------',
|
1559
|
-
I089 =
|
1560
|
-
( 44) exp_list : exp_list ',' expression _
|
1561
|
-
( 31) expression : expression _ '+' term
|
1562
|
-
( 32) expression : expression _ '-' term
|
1563
|
-
|
1564
|
-
'+' shift, and goto to state 44
|
1565
|
-
'-' shift, and goto to state 46
|
1566
|
-
|
1567
|
-
$default reduce using rule 44 (exp_list)
|
1568
|
-
|
1569
|
-
----------
|
1570
|
-
|
1571
|
-
<<'----------',
|
1572
|
-
I090 =
|
1573
|
-
( 8) decl : FUNCTION IDENT '(' ident_list ')' block _ ';'
|
1574
|
-
|
1575
|
-
';' shift, and goto to state 92
|
1576
|
-
|
1577
|
-
|
1578
|
-
----------
|
1579
|
-
|
1580
|
-
<<'----------',
|
1581
|
-
I091 =
|
1582
|
-
( 7) decl : FUNCTION IDENT '(' ')' block ';' _
|
1583
|
-
|
1584
|
-
|
1585
|
-
$default reduce using rule 7 (decl) [after shift]
|
1586
|
-
|
1587
|
-
----------
|
1588
|
-
|
1589
|
-
<<'----------',
|
1590
|
-
I092 =
|
1591
|
-
( 8) decl : FUNCTION IDENT '(' ident_list ')' block ';' _
|
1592
|
-
|
1593
|
-
|
1594
|
-
$default reduce using rule 8 (decl) [after shift]
|
1595
|
-
|
1596
|
-
----------
|
1597
|
-
]
|
1598
|
-
|
1599
|
-
|
1600
|
-
Tables = [ reduce_table, nparams, action_table,
|
1601
|
-
defred_table, defred_after_shift_table, goto_table,
|
1602
|
-
t2i, i2t, nt2i, i2nt ]
|
1603
|
-
|
1604
|
-
def self.createDecoratedParser
|
1605
|
-
D4PL0d::ASTBuilder.new(PL0d.new())
|
1606
|
-
end
|
1607
|
-
|
1608
|
-
### Inner Code
|
1609
|
-
|
1610
|
-
def lex
|
1611
|
-
begin
|
1612
|
-
until @line.empty?
|
1613
|
-
case @line
|
1614
|
-
|
1615
|
-
when /\A\s+/
|
1616
|
-
@oldline = @line; @line = $'
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
when /\A:=/
|
1621
|
-
@oldline = @line; @line = $'
|
1622
|
-
yield token(:COLOEQ, $&)
|
1623
|
-
|
1624
|
-
|
1625
|
-
when /\A<>/
|
1626
|
-
@oldline = @line; @line = $'
|
1627
|
-
yield token(:NOTEQ, $&)
|
1628
|
-
|
1629
|
-
|
1630
|
-
when /\A<=/
|
1631
|
-
@oldline = @line; @line = $'
|
1632
|
-
yield token(:LE, $&)
|
1633
|
-
|
1634
|
-
|
1635
|
-
when /\A>=/
|
1636
|
-
@oldline = @line; @line = $'
|
1637
|
-
yield token(:GE, $&)
|
1638
|
-
|
1639
|
-
|
1640
|
-
when /\A=/
|
1641
|
-
@oldline = @line; @line = $'
|
1642
|
-
yield token(:EQ, $&)
|
1643
|
-
|
1644
|
-
|
1645
|
-
when /\A</
|
1646
|
-
@oldline = @line; @line = $'
|
1647
|
-
yield token(:LT, $&)
|
1648
|
-
|
1649
|
-
|
1650
|
-
when /\A>/
|
1651
|
-
@oldline = @line; @line = $'
|
1652
|
-
yield token(:GT, $&)
|
1653
|
-
|
1654
|
-
|
1655
|
-
when /\Aconst/
|
1656
|
-
@oldline = @line; @line = $'
|
1657
|
-
yield token(:CONST, $&)
|
1658
|
-
|
1659
|
-
|
1660
|
-
when /\Avar/
|
1661
|
-
@oldline = @line; @line = $'
|
1662
|
-
yield token(:VAR, $&)
|
1663
|
-
|
1664
|
-
|
1665
|
-
when /\Afunction/
|
1666
|
-
@oldline = @line; @line = $'
|
1667
|
-
yield token(:FUNCTION, $&)
|
1668
|
-
|
1669
|
-
|
1670
|
-
when /\Abegin/
|
1671
|
-
@oldline = @line; @line = $'
|
1672
|
-
yield token(:BEGINN, $&)
|
1673
|
-
|
1674
|
-
|
1675
|
-
when /\Aend/
|
1676
|
-
@oldline = @line; @line = $'
|
1677
|
-
yield token(:END, $&)
|
1678
|
-
|
1679
|
-
|
1680
|
-
when /\Aif/
|
1681
|
-
@oldline = @line; @line = $'
|
1682
|
-
yield token(:IF, $&)
|
1683
|
-
|
1684
|
-
|
1685
|
-
when /\Athen/
|
1686
|
-
@oldline = @line; @line = $'
|
1687
|
-
yield token(:THEN, $&)
|
1688
|
-
|
1689
|
-
|
1690
|
-
when /\Awhile/
|
1691
|
-
@oldline = @line; @line = $'
|
1692
|
-
yield token(:WHILE, $&)
|
1693
|
-
|
1694
|
-
|
1695
|
-
when /\Ado/
|
1696
|
-
@oldline = @line; @line = $'
|
1697
|
-
yield token(:DO, $&)
|
1698
|
-
|
1699
|
-
|
1700
|
-
when /\Areturn/
|
1701
|
-
@oldline = @line; @line = $'
|
1702
|
-
yield token(:RETURN, $&)
|
1703
|
-
|
1704
|
-
|
1705
|
-
when /\Awriteln/
|
1706
|
-
@oldline = @line; @line = $'
|
1707
|
-
yield token(:WRITELN, $&)
|
1708
|
-
|
1709
|
-
|
1710
|
-
when /\Awrite/
|
1711
|
-
@oldline = @line; @line = $'
|
1712
|
-
yield token(:WRITE, $&)
|
1713
|
-
|
1714
|
-
|
1715
|
-
when /\Aodd/
|
1716
|
-
@oldline = @line; @line = $'
|
1717
|
-
yield token(:ODD, $&)
|
1718
|
-
|
1719
|
-
|
1720
|
-
when /\A[a-zA-Z][a-zA-Z0-9_]*/
|
1721
|
-
@oldline = @line; @line = $'
|
1722
|
-
yield token(:IDENT, $&)
|
1723
|
-
|
1724
|
-
|
1725
|
-
when /\A[0-9]+/
|
1726
|
-
@oldline = @line; @line = $'
|
1727
|
-
yield token(:NUMBER, $&.to_i)
|
1728
|
-
|
1729
|
-
|
1730
|
-
when /\A./
|
1731
|
-
@oldline = @line; @line = $'
|
1732
|
-
yield token($&, $&)
|
1733
|
-
|
1734
|
-
|
1735
|
-
else
|
1736
|
-
raise RuntimeError, "must not happen #{@line}"
|
1737
|
-
end
|
1738
|
-
end
|
1739
|
-
end while @line0 = @line = getline
|
1740
|
-
yield nil, nil
|
1741
|
-
end
|
1742
|
-
|
1743
|
-
end
|
1744
|
-
|
1745
|
-
### Outer Code
|
1746
|
-
class Node
|
1747
|
-
attr_accessor :lineno
|
1748
|
-
attr_accessor :value
|
1749
|
-
|
1750
|
-
def initialize
|
1751
|
-
@value = nil
|
1752
|
-
|
1753
|
-
end
|
1754
|
-
|
1755
|
-
def self.[] lineno, *args
|
1756
|
-
self.new lineno, *args
|
1757
|
-
end
|
1758
|
-
def accept v
|
1759
|
-
end
|
1760
|
-
end
|
1761
|
-
class NodeList < Node
|
1762
|
-
attr_accessor :lineno
|
1763
|
-
def initialize(lineno, lst=[])
|
1764
|
-
@lineno = lineno
|
1765
|
-
@lst = lst.to_a.select{|i| ! i.is_a?(NilNode)}
|
1766
|
-
end
|
1767
|
-
|
1768
|
-
def all_value
|
1769
|
-
@lst.map{|i| i.value}
|
1770
|
-
end
|
1771
|
-
|
1772
|
-
def size
|
1773
|
-
@lst.size
|
1774
|
-
end
|
1775
|
-
alias length size
|
1776
|
-
def push(i)
|
1777
|
-
@lst.push i unless i.is_a? NilNode
|
1778
|
-
self
|
1779
|
-
end
|
1780
|
-
def concat(i)
|
1781
|
-
@lst.concat i
|
1782
|
-
self
|
1783
|
-
end
|
1784
|
-
def to_ary()
|
1785
|
-
@lst
|
1786
|
-
end
|
1787
|
-
alias to_a to_ary
|
1788
|
-
alias list to_ary
|
1789
|
-
def accept(v)
|
1790
|
-
@lst.each{|i| i.accept(v) }
|
1791
|
-
end
|
1792
|
-
end
|
1793
|
-
class NilNode
|
1794
|
-
attr_accessor :lineno
|
1795
|
-
attr_accessor :value
|
1796
|
-
def initialize(lineno, *args)
|
1797
|
-
@lineno = lineno
|
1798
|
-
end
|
1799
|
-
def accept v
|
1800
|
-
end
|
1801
|
-
end
|
1802
|
-
class Node_program < Node
|
1803
|
-
attr_accessor :block
|
1804
|
-
attr_accessor
|
1805
|
-
def initialize lineno, block
|
1806
|
-
super()
|
1807
|
-
@lineno = lineno
|
1808
|
-
@lineno = lineno
|
1809
|
-
@block = block
|
1810
|
-
|
1811
|
-
end
|
1812
|
-
def accept v
|
1813
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1814
|
-
|
1815
|
-
v.visit_Node_program(self)
|
1816
|
-
self
|
1817
|
-
end
|
1818
|
-
end
|
1819
|
-
class Node_block < Node
|
1820
|
-
attr_accessor :decls, :stmt
|
1821
|
-
attr_accessor
|
1822
|
-
def initialize lineno, decls, stmt
|
1823
|
-
super()
|
1824
|
-
@lineno = lineno
|
1825
|
-
@lineno = lineno
|
1826
|
-
@decls = decls
|
1827
|
-
@stmt = stmt
|
1828
|
-
|
1829
|
-
end
|
1830
|
-
def accept v
|
1831
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1832
|
-
|
1833
|
-
v.visit_Node_block(self)
|
1834
|
-
self
|
1835
|
-
end
|
1836
|
-
end
|
1837
|
-
class Node_var_decl < Node
|
1838
|
-
attr_accessor :idents
|
1839
|
-
attr_accessor :idents
|
1840
|
-
def initialize lineno, idents
|
1841
|
-
super()
|
1842
|
-
@lineno = lineno
|
1843
|
-
@lineno = lineno
|
1844
|
-
@idents = idents
|
1845
|
-
|
1846
|
-
end
|
1847
|
-
def accept v
|
1848
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1849
|
-
|
1850
|
-
v.visit_Node_var_decl(self)
|
1851
|
-
self
|
1852
|
-
end
|
1853
|
-
end
|
1854
|
-
class Node_const_decl < Node
|
1855
|
-
attr_accessor :const_inits
|
1856
|
-
attr_accessor
|
1857
|
-
def initialize lineno, const_inits
|
1858
|
-
super()
|
1859
|
-
@lineno = lineno
|
1860
|
-
@lineno = lineno
|
1861
|
-
@const_inits = const_inits
|
1862
|
-
|
1863
|
-
end
|
1864
|
-
def accept v
|
1865
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1866
|
-
|
1867
|
-
v.visit_Node_const_decl(self)
|
1868
|
-
self
|
1869
|
-
end
|
1870
|
-
end
|
1871
|
-
class Node_const_init < Node
|
1872
|
-
attr_accessor :ident, :number
|
1873
|
-
attr_accessor :ident, :number
|
1874
|
-
def initialize lineno, ident, number
|
1875
|
-
super()
|
1876
|
-
@lineno = lineno
|
1877
|
-
@lineno = lineno
|
1878
|
-
@ident = ident
|
1879
|
-
@number = number
|
1880
|
-
|
1881
|
-
end
|
1882
|
-
def accept v
|
1883
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1884
|
-
|
1885
|
-
v.visit_Node_const_init(self)
|
1886
|
-
self
|
1887
|
-
end
|
1888
|
-
end
|
1889
|
-
class Node_func_decl < Node
|
1890
|
-
attr_accessor :ident, :params, :block
|
1891
|
-
attr_accessor :ident, :params, :block
|
1892
|
-
def initialize lineno, ident, params, block
|
1893
|
-
super()
|
1894
|
-
@lineno = lineno
|
1895
|
-
@lineno = lineno
|
1896
|
-
@ident = ident
|
1897
|
-
@params = params
|
1898
|
-
@block = block
|
1899
|
-
|
1900
|
-
end
|
1901
|
-
def accept v
|
1902
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1903
|
-
|
1904
|
-
v.visit_Node_func_decl(self)
|
1905
|
-
self
|
1906
|
-
end
|
1907
|
-
end
|
1908
|
-
class Node_nop_stmt < Node
|
1909
|
-
attr_accessor :nop
|
1910
|
-
attr_accessor :nop
|
1911
|
-
def initialize lineno, nop
|
1912
|
-
super()
|
1913
|
-
@lineno = lineno
|
1914
|
-
@lineno = lineno
|
1915
|
-
@nop = nop
|
1916
|
-
|
1917
|
-
end
|
1918
|
-
def accept v
|
1919
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1920
|
-
|
1921
|
-
v.visit_Node_nop_stmt(self)
|
1922
|
-
self
|
1923
|
-
end
|
1924
|
-
end
|
1925
|
-
class Node_assign_stmt < Node
|
1926
|
-
attr_accessor :ident, :expr
|
1927
|
-
attr_accessor :ident
|
1928
|
-
def initialize lineno, ident, expr
|
1929
|
-
super()
|
1930
|
-
@lineno = lineno
|
1931
|
-
@lineno = lineno
|
1932
|
-
@ident = ident
|
1933
|
-
@expr = expr
|
1934
|
-
|
1935
|
-
end
|
1936
|
-
def accept v
|
1937
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1938
|
-
|
1939
|
-
v.visit_Node_assign_stmt(self)
|
1940
|
-
self
|
1941
|
-
end
|
1942
|
-
end
|
1943
|
-
class Node_begin_stmt < Node
|
1944
|
-
attr_accessor :stmt, :stmts
|
1945
|
-
attr_accessor
|
1946
|
-
def initialize lineno, stmt, stmts
|
1947
|
-
super()
|
1948
|
-
@lineno = lineno
|
1949
|
-
@lineno = lineno
|
1950
|
-
@stmt = stmt
|
1951
|
-
@stmts = stmts
|
1952
|
-
|
1953
|
-
end
|
1954
|
-
def accept v
|
1955
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1956
|
-
|
1957
|
-
v.visit_Node_begin_stmt(self)
|
1958
|
-
self
|
1959
|
-
end
|
1960
|
-
end
|
1961
|
-
class Node_if_stmt < Node
|
1962
|
-
attr_accessor :cond, :stmt
|
1963
|
-
attr_accessor
|
1964
|
-
def initialize lineno, cond, stmt
|
1965
|
-
super()
|
1966
|
-
@lineno = lineno
|
1967
|
-
@lineno = lineno
|
1968
|
-
@cond = cond
|
1969
|
-
@stmt = stmt
|
1970
|
-
|
1971
|
-
end
|
1972
|
-
def accept v
|
1973
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1974
|
-
|
1975
|
-
v.visit_Node_if_stmt(self)
|
1976
|
-
self
|
1977
|
-
end
|
1978
|
-
end
|
1979
|
-
class Node_while_stmt < Node
|
1980
|
-
attr_accessor :cond, :stmt
|
1981
|
-
attr_accessor
|
1982
|
-
def initialize lineno, cond, stmt
|
1983
|
-
super()
|
1984
|
-
@lineno = lineno
|
1985
|
-
@lineno = lineno
|
1986
|
-
@cond = cond
|
1987
|
-
@stmt = stmt
|
1988
|
-
|
1989
|
-
end
|
1990
|
-
def accept v
|
1991
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
1992
|
-
|
1993
|
-
v.visit_Node_while_stmt(self)
|
1994
|
-
self
|
1995
|
-
end
|
1996
|
-
end
|
1997
|
-
class Node_return_stmt < Node
|
1998
|
-
attr_accessor :expr
|
1999
|
-
attr_accessor
|
2000
|
-
def initialize lineno, expr
|
2001
|
-
super()
|
2002
|
-
@lineno = lineno
|
2003
|
-
@lineno = lineno
|
2004
|
-
@expr = expr
|
2005
|
-
|
2006
|
-
end
|
2007
|
-
def accept v
|
2008
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
2009
|
-
|
2010
|
-
v.visit_Node_return_stmt(self)
|
2011
|
-
self
|
2012
|
-
end
|
2013
|
-
end
|
2014
|
-
class Node_apply < Node
|
2015
|
-
attr_accessor :ident, :args
|
2016
|
-
attr_accessor :ident, :args
|
2017
|
-
def initialize lineno, ident, args
|
2018
|
-
super()
|
2019
|
-
@lineno = lineno
|
2020
|
-
@lineno = lineno
|
2021
|
-
@ident = ident
|
2022
|
-
@args = args
|
2023
|
-
|
2024
|
-
end
|
2025
|
-
def accept v
|
2026
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
2027
|
-
|
2028
|
-
v.visit_Node_apply(self)
|
2029
|
-
self
|
2030
|
-
end
|
2031
|
-
end
|
2032
|
-
class Node_refv < Node
|
2033
|
-
attr_accessor :ident
|
2034
|
-
attr_accessor :ident
|
2035
|
-
def initialize lineno, ident
|
2036
|
-
super()
|
2037
|
-
@lineno = lineno
|
2038
|
-
@lineno = lineno
|
2039
|
-
@ident = ident
|
2040
|
-
|
2041
|
-
end
|
2042
|
-
def accept v
|
2043
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
2044
|
-
|
2045
|
-
v.visit_Node_refv(self)
|
2046
|
-
self
|
2047
|
-
end
|
2048
|
-
end
|
2049
|
-
class Node_number < Node
|
2050
|
-
attr_accessor :n
|
2051
|
-
attr_accessor :n
|
2052
|
-
def initialize lineno, n
|
2053
|
-
super()
|
2054
|
-
@lineno = lineno
|
2055
|
-
@lineno = lineno
|
2056
|
-
@n = n
|
2057
|
-
|
2058
|
-
end
|
2059
|
-
def accept v
|
2060
|
-
warn @lineno.to_s+':'+self.class.to_s if $DEBUG
|
2061
|
-
|
2062
|
-
v.visit_Node_number(self)
|
2063
|
-
self
|
2064
|
-
end
|
2065
|
-
end
|
2066
|
-
|
2067
|
-
class Visitor
|
2068
|
-
def visit node
|
2069
|
-
node.accept(self)
|
2070
|
-
end
|
2071
|
-
|
2072
|
-
module_eval <<-'.,.,122745803753111.,.,', 'pl0d/pl0ds.dr', 38
|
2073
|
-
|
2074
|
-
STEntry = Struct.new(:kind, :narg, :value)
|
2075
|
-
def initialize
|
2076
|
-
@global = {
|
2077
|
-
'+' => STEntry.new(:FUNC, 2, proc{|a| a[0] + a[1] }),
|
2078
|
-
'-' => STEntry.new(:FUNC, 2, proc{|a| a[0] - a[1] }),
|
2079
|
-
'*' => STEntry.new(:FUNC, 2, proc{|a| a[0] * a[1] }),
|
2080
|
-
'/' => STEntry.new(:FUNC, 2, proc{|a| a[0] / a[1] }),
|
2081
|
-
'=' => STEntry.new(:FUNC, 2, proc{|a| a[0] == a[1] ? 1 : 0}),
|
2082
|
-
'<>' => STEntry.new(:FUNC, 2, proc{|a| a[0] != a[1] ? 1 : 0}),
|
2083
|
-
'<' => STEntry.new(:FUNC, 2, proc{|a| a[0] < a[1] ? 1 : 0}),
|
2084
|
-
'>' => STEntry.new(:FUNC, 2, proc{|a| a[0] > a[1] ? 1 : 0}),
|
2085
|
-
'<=' => STEntry.new(:FUNC, 2, proc{|a| a[0] <= a[1] ? 1 : 0}),
|
2086
|
-
'>=' => STEntry.new(:FUNC, 2, proc{|a| a[0] >= a[1] ? 1 : 0}),
|
2087
|
-
'odd'=> STEntry.new(:FUNC, 1, proc{|a| a[0] & 1 }),
|
2088
|
-
|
2089
|
-
'write' => STEntry.new(:FUNC, 1, proc{|a| print "#{a[0]} "; 1}),
|
2090
|
-
'writeln' => STEntry.new(:FUNC, 0, proc{|a| puts ''; 1}),
|
2091
|
-
}
|
2092
|
-
@env = [@global]
|
2093
|
-
end
|
2094
|
-
def lookup name
|
2095
|
-
@env.reverse_each{|s| return s[name] if s[name]}
|
2096
|
-
return nil
|
2097
|
-
end
|
2098
|
-
def dump_env n = 2
|
2099
|
-
n = @env.size if n > @env.size
|
2100
|
-
e = @env[n..-1].map{|i| Hash[* i.map{|k, v| [k, v.value]}.flatten ] }
|
2101
|
-
warn e.pretty_inspect
|
2102
|
-
end
|
2103
|
-
|
2104
|
-
.,.,122745803753111.,.,
|
2105
|
-
|
2106
|
-
module_eval <<-'.,.,122745803710602.,.,', 'pl0d/pl0ds.dr', 69
|
2107
|
-
def visit_Node_program node
|
2108
|
-
|
2109
|
-
visit(node.block)
|
2110
|
-
|
2111
|
-
rescue
|
2112
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2113
|
-
raise
|
2114
|
-
|
2115
|
-
end
|
2116
|
-
.,.,122745803710602.,.,
|
2117
|
-
|
2118
|
-
module_eval <<-'.,.,122745803712198.,.,', 'pl0d/pl0ds.dr', 73
|
2119
|
-
def visit_Node_block node
|
2120
|
-
|
2121
|
-
@env.push({})
|
2122
|
-
visit(node.decls)
|
2123
|
-
visit(node.stmt)
|
2124
|
-
@env.pop
|
2125
|
-
|
2126
|
-
rescue
|
2127
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2128
|
-
raise
|
2129
|
-
|
2130
|
-
end
|
2131
|
-
.,.,122745803712198.,.,
|
2132
|
-
|
2133
|
-
module_eval <<-'.,.,122745803756671.,.,', 'pl0d/pl0ds.dr', 80
|
2134
|
-
def visit_Node_var_decl node
|
2135
|
-
|
2136
|
-
node.idents.to_a.each do |ident|
|
2137
|
-
if @env.last[ident.value]
|
2138
|
-
warn "'#{ident.value}' already exist."; exit
|
2139
|
-
else
|
2140
|
-
@env.last[ident.value] = STEntry.new(:VAR, 0, 0)
|
2141
|
-
end
|
2142
|
-
end
|
2143
|
-
|
2144
|
-
rescue
|
2145
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2146
|
-
raise
|
2147
|
-
|
2148
|
-
end
|
2149
|
-
.,.,122745803756671.,.,
|
2150
|
-
|
2151
|
-
module_eval <<-'.,.,122745803763047.,.,', 'pl0d/pl0ds.dr', 90
|
2152
|
-
def visit_Node_const_decl node
|
2153
|
-
|
2154
|
-
visit(node.const_inits)
|
2155
|
-
|
2156
|
-
rescue
|
2157
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2158
|
-
raise
|
2159
|
-
|
2160
|
-
end
|
2161
|
-
.,.,122745803763047.,.,
|
2162
|
-
|
2163
|
-
module_eval <<-'.,.,12274580374346.,.,', 'pl0d/pl0ds.dr', 94
|
2164
|
-
def visit_Node_const_init node
|
2165
|
-
|
2166
|
-
if @env.last[node.ident.value]
|
2167
|
-
warn "'#{node.ident.value}' already exist."; exit
|
2168
|
-
else
|
2169
|
-
@env.last[node.ident.value] = STEntry.new(:CONST, 0, node.number.value)
|
2170
|
-
end
|
2171
|
-
|
2172
|
-
rescue
|
2173
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2174
|
-
raise
|
2175
|
-
|
2176
|
-
end
|
2177
|
-
.,.,12274580374346.,.,
|
2178
|
-
|
2179
|
-
module_eval <<-'.,.,122745803759988.,.,', 'pl0d/pl0ds.dr', 102
|
2180
|
-
def visit_Node_func_decl node
|
2181
|
-
|
2182
|
-
if @env[0][node.ident.value]
|
2183
|
-
warn "'#{node.ident.value}' already exist."; exit
|
2184
|
-
end
|
2185
|
-
body = proc do |args|
|
2186
|
-
value = 0
|
2187
|
-
n = @env.size
|
2188
|
-
@env.push({})
|
2189
|
-
value = catch(:return) do
|
2190
|
-
@env.last['return'] = STEntry.new(:VAR, 0, :return)
|
2191
|
-
node.params.to_a.each_with_index do |a, x|
|
2192
|
-
@env.last[a.value] = STEntry.new(:VAR, 0, args[x])
|
2193
|
-
end
|
2194
|
-
visit(node.block)
|
2195
|
-
end
|
2196
|
-
@env = @env[0, n]
|
2197
|
-
value
|
2198
|
-
end
|
2199
|
-
@env.last[node.ident.value] = STEntry.new(:FUNC, node.params.size, body)
|
2200
|
-
|
2201
|
-
rescue
|
2202
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2203
|
-
raise
|
2204
|
-
|
2205
|
-
end
|
2206
|
-
.,.,122745803759988.,.,
|
2207
|
-
|
2208
|
-
module_eval <<-'.,.,122745803743066.,.,', 'pl0d/pl0ds.dr', 123
|
2209
|
-
def visit_Node_nop_stmt node
|
2210
|
-
|
2211
|
-
|
2212
|
-
rescue
|
2213
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2214
|
-
raise
|
2215
|
-
|
2216
|
-
end
|
2217
|
-
.,.,122745803743066.,.,
|
2218
|
-
|
2219
|
-
module_eval <<-'.,.,12274580372012.,.,', 'pl0d/pl0ds.dr', 126
|
2220
|
-
def visit_Node_assign_stmt node
|
2221
|
-
|
2222
|
-
if ent = lookup(node.ident.value)
|
2223
|
-
unless ent.kind == :VAR
|
2224
|
-
warn "'#{node.ident.value}' not var."; exit
|
2225
|
-
end
|
2226
|
-
ent.value = visit(node.expr).value
|
2227
|
-
else
|
2228
|
-
warn @env.pretty_inspect
|
2229
|
-
warn "'#{node.ident.value}' not found."; exit
|
2230
|
-
end
|
2231
|
-
|
2232
|
-
rescue
|
2233
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2234
|
-
raise
|
2235
|
-
|
2236
|
-
end
|
2237
|
-
.,.,12274580372012.,.,
|
2238
|
-
|
2239
|
-
module_eval <<-'.,.,122745803760775.,.,', 'pl0d/pl0ds.dr', 138
|
2240
|
-
def visit_Node_begin_stmt node
|
2241
|
-
|
2242
|
-
visit(node.stmt)
|
2243
|
-
visit(node.stmts)
|
2244
|
-
|
2245
|
-
rescue
|
2246
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2247
|
-
raise
|
2248
|
-
|
2249
|
-
end
|
2250
|
-
.,.,122745803760775.,.,
|
2251
|
-
|
2252
|
-
module_eval <<-'.,.,122745803752460.,.,', 'pl0d/pl0ds.dr', 143
|
2253
|
-
def visit_Node_if_stmt node
|
2254
|
-
|
2255
|
-
if visit(node.cond).value != 0
|
2256
|
-
visit(node.stmt)
|
2257
|
-
end
|
2258
|
-
|
2259
|
-
rescue
|
2260
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2261
|
-
raise
|
2262
|
-
|
2263
|
-
end
|
2264
|
-
.,.,122745803752460.,.,
|
2265
|
-
|
2266
|
-
module_eval <<-'.,.,122745803711909.,.,', 'pl0d/pl0ds.dr', 149
|
2267
|
-
def visit_Node_while_stmt node
|
2268
|
-
|
2269
|
-
while visit(node.cond).value != 0
|
2270
|
-
visit(node.stmt)
|
2271
|
-
end
|
2272
|
-
|
2273
|
-
rescue
|
2274
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2275
|
-
raise
|
2276
|
-
|
2277
|
-
end
|
2278
|
-
.,.,122745803711909.,.,
|
2279
|
-
|
2280
|
-
module_eval <<-'.,.,12274580374630.,.,', 'pl0d/pl0ds.dr', 155
|
2281
|
-
def visit_Node_return_stmt node
|
2282
|
-
|
2283
|
-
ent = nil
|
2284
|
-
@env.reverse_each{|s| break if ent = s['return'] }
|
2285
|
-
unless ent
|
2286
|
-
warn "'return' not in func."; exit
|
2287
|
-
end
|
2288
|
-
throw :return, visit(node.expr).value
|
2289
|
-
|
2290
|
-
rescue
|
2291
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2292
|
-
raise
|
2293
|
-
|
2294
|
-
end
|
2295
|
-
.,.,12274580374630.,.,
|
2296
|
-
|
2297
|
-
module_eval <<-'.,.,122745803718131.,.,', 'pl0d/pl0ds.dr', 164
|
2298
|
-
def visit_Node_apply node
|
2299
|
-
|
2300
|
-
ent = nil
|
2301
|
-
@env.reverse_each{|s| break if ent = s[node.ident.value] }
|
2302
|
-
unless ent
|
2303
|
-
warn "'#{node.ident.value}' not found."; exit
|
2304
|
-
end
|
2305
|
-
unless ent.kind == :FUNC
|
2306
|
-
warn "'#{node.ident.value}' not func."; exit
|
2307
|
-
end
|
2308
|
-
|
2309
|
-
args = node.args.to_a.map{|a| visit(a).value }
|
2310
|
-
# warn "#{' '*(@env.size-2)}|#{node.ident.value} : #{args.inspect}"
|
2311
|
-
unless ent.narg == args.size
|
2312
|
-
warn "#{ent.narg} #{args.size} #{args.inspect}"
|
2313
|
-
warn "'#{node.ident.value}' unmatch args."; exit
|
2314
|
-
end
|
2315
|
-
node.value = ent.value.call(args)
|
2316
|
-
# warn "#{' '*(@env.size-2)}|-> #{node.value} @ #{node.ident.value}"
|
2317
|
-
|
2318
|
-
rescue
|
2319
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2320
|
-
raise
|
2321
|
-
|
2322
|
-
end
|
2323
|
-
.,.,122745803718131.,.,
|
2324
|
-
|
2325
|
-
module_eval <<-'.,.,122745803748774.,.,', 'pl0d/pl0ds.dr', 184
|
2326
|
-
def visit_Node_refv node
|
2327
|
-
|
2328
|
-
unless ent = lookup(node.ident.value)
|
2329
|
-
warn "'#{node.ident.value}' not found."; exit
|
2330
|
-
end
|
2331
|
-
if ent.kind == :VAR || ent.kind == :CONST
|
2332
|
-
node.value = ent.value
|
2333
|
-
else
|
2334
|
-
warn "'#{node.ident.value}' not var."; exit
|
2335
|
-
end
|
2336
|
-
|
2337
|
-
rescue
|
2338
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2339
|
-
raise
|
2340
|
-
|
2341
|
-
end
|
2342
|
-
.,.,122745803748774.,.,
|
2343
|
-
|
2344
|
-
module_eval <<-'.,.,122745803759286.,.,', 'pl0d/pl0ds.dr', 195
|
2345
|
-
def visit_Node_number node
|
2346
|
-
|
2347
|
-
node.value = node.n.value
|
2348
|
-
|
2349
|
-
rescue
|
2350
|
-
warn "raise at src:#{node.lineno}/#{node.class.name}"
|
2351
|
-
raise
|
2352
|
-
|
2353
|
-
end
|
2354
|
-
.,.,122745803759286.,.,
|
2355
|
-
|
2356
|
-
end
|
2357
|
-
|
2358
|
-
class D4PL0d::ASTBuilder < Depager::LALR::Action #:nodoc:all
|
2359
|
-
include Depager::DecoratorUtils
|
2360
|
-
|
2361
|
-
on_reduce = [
|
2362
|
-
nil,
|
2363
|
-
:_ast_0,
|
2364
|
-
:_ast_1,
|
2365
|
-
:_ast_2,
|
2366
|
-
:_ast_3,
|
2367
|
-
:_ast_4,
|
2368
|
-
:_ast_5,
|
2369
|
-
:_ast_6,
|
2370
|
-
:_ast_7,
|
2371
|
-
:_ast_8,
|
2372
|
-
:_ast_9,
|
2373
|
-
:_ast_10,
|
2374
|
-
:_ast_11,
|
2375
|
-
:_ast_12,
|
2376
|
-
:_ast_13,
|
2377
|
-
:_ast_14,
|
2378
|
-
:_ast_15,
|
2379
|
-
:_ast_16,
|
2380
|
-
:_ast_17,
|
2381
|
-
:_ast_18,
|
2382
|
-
:_ast_19,
|
2383
|
-
:_ast_20,
|
2384
|
-
:_ast_21,
|
2385
|
-
:_ast_22,
|
2386
|
-
:_ast_23,
|
2387
|
-
:_ast_24,
|
2388
|
-
:_ast_25,
|
2389
|
-
:_ast_26,
|
2390
|
-
:_ast_27,
|
2391
|
-
:_ast_28,
|
2392
|
-
:_ast_29,
|
2393
|
-
:_ast_30,
|
2394
|
-
:_ast_31,
|
2395
|
-
:_ast_32,
|
2396
|
-
:_ast_33,
|
2397
|
-
:_ast_34,
|
2398
|
-
:_ast_35,
|
2399
|
-
:_ast_36,
|
2400
|
-
:_ast_37,
|
2401
|
-
:_ast_38,
|
2402
|
-
:_ast_39,
|
2403
|
-
:_ast_40,
|
2404
|
-
:_ast_41,
|
2405
|
-
:_ast_42,
|
2406
|
-
:_ast_43,
|
2407
|
-
|
2408
|
-
]
|
2409
|
-
Tables = [on_reduce]
|
2410
|
-
def initialize inside
|
2411
|
-
super inside, 'ASTBuilder'
|
2412
|
-
@on_reduce, = self.class::Tables
|
2413
|
-
init_parser
|
2414
|
-
end
|
2415
|
-
|
2416
|
-
|
2417
|
-
module_eval <<-'.,.,122745803713657.,.,', 'pl0d/pl0ds.dr', 202
|
2418
|
-
def _ast_0 val
|
2419
|
-
Node_program.new(val[0].lineno, val[0])
|
2420
|
-
end
|
2421
|
-
.,.,122745803713657.,.,
|
2422
|
-
|
2423
|
-
module_eval <<-'.,.,122745803762417.,.,', 'pl0d/pl0ds.dr', 207
|
2424
|
-
def _ast_1 val
|
2425
|
-
Node_block.new(val[0].lineno, val[0], val[1])
|
2426
|
-
end
|
2427
|
-
.,.,122745803762417.,.,
|
2428
|
-
|
2429
|
-
module_eval <<-'.,.,122745803749311.,.,', 'pl0d/pl0ds.dr', 211
|
2430
|
-
def _ast_2 val
|
2431
|
-
NodeList.new(basis.file.lineno, [])
|
2432
|
-
end
|
2433
|
-
.,.,122745803749311.,.,
|
2434
|
-
|
2435
|
-
module_eval <<-'.,.,122745803732974.,.,', 'pl0d/pl0ds.dr', 213
|
2436
|
-
def _ast_3 val
|
2437
|
-
val[0].push(val[1])
|
2438
|
-
end
|
2439
|
-
.,.,122745803732974.,.,
|
2440
|
-
|
2441
|
-
module_eval <<-'.,.,122745803722420.,.,', 'pl0d/pl0ds.dr', 218
|
2442
|
-
def _ast_4 val
|
2443
|
-
Node_const_decl.new(val[0].lineno, val[1])
|
2444
|
-
end
|
2445
|
-
.,.,122745803722420.,.,
|
2446
|
-
|
2447
|
-
module_eval <<-'.,.,12274580377011.,.,', 'pl0d/pl0ds.dr', 220
|
2448
|
-
def _ast_5 val
|
2449
|
-
Node_var_decl.new(val[0].lineno, val[1])
|
2450
|
-
end
|
2451
|
-
.,.,12274580377011.,.,
|
2452
|
-
|
2453
|
-
module_eval <<-'.,.,12274580372583.,.,', 'pl0d/pl0ds.dr', 222
|
2454
|
-
def _ast_6 val
|
2455
|
-
Node_func_decl.new(val[0].lineno, val[1], NodeList.new(basis.file.lineno, []), val[4])
|
2456
|
-
end
|
2457
|
-
.,.,12274580372583.,.,
|
2458
|
-
|
2459
|
-
module_eval <<-'.,.,122745803761637.,.,', 'pl0d/pl0ds.dr', 224
|
2460
|
-
def _ast_7 val
|
2461
|
-
Node_func_decl.new(val[0].lineno, val[1], val[3], val[5])
|
2462
|
-
end
|
2463
|
-
.,.,122745803761637.,.,
|
2464
|
-
|
2465
|
-
module_eval <<-'.,.,12274580378445.,.,', 'pl0d/pl0ds.dr', 229
|
2466
|
-
def _ast_8 val
|
2467
|
-
NodeList.new(val[0].lineno, [val[0]])
|
2468
|
-
end
|
2469
|
-
.,.,12274580378445.,.,
|
2470
|
-
|
2471
|
-
module_eval <<-'.,.,122745803733482.,.,', 'pl0d/pl0ds.dr', 231
|
2472
|
-
def _ast_9 val
|
2473
|
-
val[0].push(val[2])
|
2474
|
-
end
|
2475
|
-
.,.,122745803733482.,.,
|
2476
|
-
|
2477
|
-
module_eval <<-'.,.,122745803723547.,.,', 'pl0d/pl0ds.dr', 236
|
2478
|
-
def _ast_10 val
|
2479
|
-
Node_const_init.new(val[0].lineno, val[0], val[2])
|
2480
|
-
end
|
2481
|
-
.,.,122745803723547.,.,
|
2482
|
-
|
2483
|
-
module_eval <<-'.,.,12274580375797.,.,', 'pl0d/pl0ds.dr', 241
|
2484
|
-
def _ast_11 val
|
2485
|
-
NodeList.new(val[0].lineno, [val[0]])
|
2486
|
-
end
|
2487
|
-
.,.,12274580375797.,.,
|
2488
|
-
|
2489
|
-
module_eval <<-'.,.,122745803727046.,.,', 'pl0d/pl0ds.dr', 243
|
2490
|
-
def _ast_12 val
|
2491
|
-
val[0].push(val[2])
|
2492
|
-
end
|
2493
|
-
.,.,122745803727046.,.,
|
2494
|
-
|
2495
|
-
module_eval <<-'.,.,12274580376389.,.,', 'pl0d/pl0ds.dr', 247
|
2496
|
-
def _ast_13 val
|
2497
|
-
Node_nop_stmt.new(basis.file.lineno, NodeList.new(basis.file.lineno, []))
|
2498
|
-
end
|
2499
|
-
.,.,12274580376389.,.,
|
2500
|
-
|
2501
|
-
module_eval <<-'.,.,122745803758162.,.,', 'pl0d/pl0ds.dr', 249
|
2502
|
-
def _ast_14 val
|
2503
|
-
Node_assign_stmt.new(val[0].lineno, val[0], val[2])
|
2504
|
-
end
|
2505
|
-
.,.,122745803758162.,.,
|
2506
|
-
|
2507
|
-
module_eval <<-'.,.,122745803757908.,.,', 'pl0d/pl0ds.dr', 251
|
2508
|
-
def _ast_15 val
|
2509
|
-
Node_begin_stmt.new(val[0].lineno, val[1], val[2])
|
2510
|
-
end
|
2511
|
-
.,.,122745803757908.,.,
|
2512
|
-
|
2513
|
-
module_eval <<-'.,.,122745803737264.,.,', 'pl0d/pl0ds.dr', 253
|
2514
|
-
def _ast_16 val
|
2515
|
-
Node_if_stmt.new(val[0].lineno, val[1], val[3])
|
2516
|
-
end
|
2517
|
-
.,.,122745803737264.,.,
|
2518
|
-
|
2519
|
-
module_eval <<-'.,.,122745803762624.,.,', 'pl0d/pl0ds.dr', 255
|
2520
|
-
def _ast_17 val
|
2521
|
-
Node_while_stmt.new(val[0].lineno, val[1], val[3])
|
2522
|
-
end
|
2523
|
-
.,.,122745803762624.,.,
|
2524
|
-
|
2525
|
-
module_eval <<-'.,.,122745803760629.,.,', 'pl0d/pl0ds.dr', 257
|
2526
|
-
def _ast_18 val
|
2527
|
-
Node_return_stmt.new(val[0].lineno, val[1])
|
2528
|
-
end
|
2529
|
-
.,.,122745803760629.,.,
|
2530
|
-
|
2531
|
-
module_eval <<-'.,.,122745803718773.,.,', 'pl0d/pl0ds.dr', 259
|
2532
|
-
def _ast_19 val
|
2533
|
-
Node_apply.new(val[0].lineno, Depager::Token['write'], NodeList.new(val[0].lineno, [val[1]]))
|
2534
|
-
end
|
2535
|
-
.,.,122745803718773.,.,
|
2536
|
-
|
2537
|
-
module_eval <<-'.,.,122745803738626.,.,', 'pl0d/pl0ds.dr', 261
|
2538
|
-
def _ast_20 val
|
2539
|
-
Node_apply.new(val[0].lineno, Depager::Token['writeln'], NodeList.new(basis.file.lineno, []))
|
2540
|
-
end
|
2541
|
-
.,.,122745803738626.,.,
|
2542
|
-
|
2543
|
-
module_eval <<-'.,.,122745803715270.,.,', 'pl0d/pl0ds.dr', 265
|
2544
|
-
def _ast_21 val
|
2545
|
-
NodeList.new(basis.file.lineno, [])
|
2546
|
-
end
|
2547
|
-
.,.,122745803715270.,.,
|
2548
|
-
|
2549
|
-
module_eval <<-'.,.,122745803715959.,.,', 'pl0d/pl0ds.dr', 267
|
2550
|
-
def _ast_22 val
|
2551
|
-
val[0].push(val[2])
|
2552
|
-
end
|
2553
|
-
.,.,122745803715959.,.,
|
2554
|
-
|
2555
|
-
module_eval <<-'.,.,12274580378713.,.,', 'pl0d/pl0ds.dr', 272
|
2556
|
-
def _ast_23 val
|
2557
|
-
Node_apply.new(val[0].lineno, Depager::Token['odd'], NodeList.new(val[0].lineno, [val[1]]))
|
2558
|
-
end
|
2559
|
-
.,.,12274580378713.,.,
|
2560
|
-
|
2561
|
-
module_eval <<-'.,.,12274580374814.,.,', 'pl0d/pl0ds.dr', 274
|
2562
|
-
def _ast_24 val
|
2563
|
-
Node_apply.new(val[0].lineno, Depager::Token['='], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2564
|
-
end
|
2565
|
-
.,.,12274580374814.,.,
|
2566
|
-
|
2567
|
-
module_eval <<-'.,.,122745803734597.,.,', 'pl0d/pl0ds.dr', 276
|
2568
|
-
def _ast_25 val
|
2569
|
-
Node_apply.new(val[0].lineno, Depager::Token['<>'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2570
|
-
end
|
2571
|
-
.,.,122745803734597.,.,
|
2572
|
-
|
2573
|
-
module_eval <<-'.,.,122745803754023.,.,', 'pl0d/pl0ds.dr', 278
|
2574
|
-
def _ast_26 val
|
2575
|
-
Node_apply.new(val[0].lineno, Depager::Token['<'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2576
|
-
end
|
2577
|
-
.,.,122745803754023.,.,
|
2578
|
-
|
2579
|
-
module_eval <<-'.,.,122745803747744.,.,', 'pl0d/pl0ds.dr', 280
|
2580
|
-
def _ast_27 val
|
2581
|
-
Node_apply.new(val[0].lineno, Depager::Token['>'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2582
|
-
end
|
2583
|
-
.,.,122745803747744.,.,
|
2584
|
-
|
2585
|
-
module_eval <<-'.,.,122745803723623.,.,', 'pl0d/pl0ds.dr', 282
|
2586
|
-
def _ast_28 val
|
2587
|
-
Node_apply.new(val[0].lineno, Depager::Token['<='], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2588
|
-
end
|
2589
|
-
.,.,122745803723623.,.,
|
2590
|
-
|
2591
|
-
module_eval <<-'.,.,122745803731202.,.,', 'pl0d/pl0ds.dr', 284
|
2592
|
-
def _ast_29 val
|
2593
|
-
Node_apply.new(val[0].lineno, Depager::Token['>='], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2594
|
-
end
|
2595
|
-
.,.,122745803731202.,.,
|
2596
|
-
|
2597
|
-
module_eval <<-'.,.,122745803753646.,.,', 'pl0d/pl0ds.dr', 289
|
2598
|
-
def _ast_30 val
|
2599
|
-
Node_apply.new(val[0].lineno, Depager::Token['+'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2600
|
-
end
|
2601
|
-
.,.,122745803753646.,.,
|
2602
|
-
|
2603
|
-
module_eval <<-'.,.,122745803723858.,.,', 'pl0d/pl0ds.dr', 291
|
2604
|
-
def _ast_31 val
|
2605
|
-
Node_apply.new(val[0].lineno, Depager::Token['-'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2606
|
-
end
|
2607
|
-
.,.,122745803723858.,.,
|
2608
|
-
|
2609
|
-
module_eval <<-'.,.,122745803731132.,.,', 'pl0d/pl0ds.dr', 293
|
2610
|
-
def _ast_32 val
|
2611
|
-
val[0]
|
2612
|
-
end
|
2613
|
-
.,.,122745803731132.,.,
|
2614
|
-
|
2615
|
-
module_eval <<-'.,.,122745803722247.,.,', 'pl0d/pl0ds.dr', 295
|
2616
|
-
def _ast_33 val
|
2617
|
-
Node_apply.new(val[0].lineno, Depager::Token['UMINUS'], NodeList.new(val[0].lineno, [val[1]]))
|
2618
|
-
end
|
2619
|
-
.,.,122745803722247.,.,
|
2620
|
-
|
2621
|
-
module_eval <<-'.,.,122745803761813.,.,', 'pl0d/pl0ds.dr', 300
|
2622
|
-
def _ast_34 val
|
2623
|
-
Node_apply.new(val[0].lineno, Depager::Token['*'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2624
|
-
end
|
2625
|
-
.,.,122745803761813.,.,
|
2626
|
-
|
2627
|
-
module_eval <<-'.,.,122745803758885.,.,', 'pl0d/pl0ds.dr', 302
|
2628
|
-
def _ast_35 val
|
2629
|
-
Node_apply.new(val[0].lineno, Depager::Token['/'], NodeList.new(val[0].lineno, [val[0], val[2]]))
|
2630
|
-
end
|
2631
|
-
.,.,122745803758885.,.,
|
2632
|
-
|
2633
|
-
module_eval <<-'.,.,122745803738159.,.,', 'pl0d/pl0ds.dr', 304
|
2634
|
-
def _ast_36 val
|
2635
|
-
val[0]
|
2636
|
-
end
|
2637
|
-
.,.,122745803738159.,.,
|
2638
|
-
|
2639
|
-
module_eval <<-'.,.,122745803725103.,.,', 'pl0d/pl0ds.dr', 309
|
2640
|
-
def _ast_37 val
|
2641
|
-
Node_refv.new(val[0].lineno, val[0])
|
2642
|
-
end
|
2643
|
-
.,.,122745803725103.,.,
|
2644
|
-
|
2645
|
-
module_eval <<-'.,.,12274580372405.,.,', 'pl0d/pl0ds.dr', 311
|
2646
|
-
def _ast_38 val
|
2647
|
-
Node_number.new(val[0].lineno, val[0])
|
2648
|
-
end
|
2649
|
-
.,.,12274580372405.,.,
|
2650
|
-
|
2651
|
-
module_eval <<-'.,.,1227458037216.,.,', 'pl0d/pl0ds.dr', 313
|
2652
|
-
def _ast_39 val
|
2653
|
-
Node_apply.new(val[0].lineno, val[0], NodeList.new(basis.file.lineno, []))
|
2654
|
-
end
|
2655
|
-
.,.,1227458037216.,.,
|
2656
|
-
|
2657
|
-
module_eval <<-'.,.,12274580371820.,.,', 'pl0d/pl0ds.dr', 315
|
2658
|
-
def _ast_40 val
|
2659
|
-
Node_apply.new(val[0].lineno, val[0], val[2])
|
2660
|
-
end
|
2661
|
-
.,.,12274580371820.,.,
|
2662
|
-
|
2663
|
-
module_eval <<-'.,.,122745803748521.,.,', 'pl0d/pl0ds.dr', 317
|
2664
|
-
def _ast_41 val
|
2665
|
-
val[1]
|
2666
|
-
end
|
2667
|
-
.,.,122745803748521.,.,
|
2668
|
-
|
2669
|
-
module_eval <<-'.,.,122745803744691.,.,', 'pl0d/pl0ds.dr', 322
|
2670
|
-
def _ast_42 val
|
2671
|
-
NodeList.new(val[0].lineno, [val[0]])
|
2672
|
-
end
|
2673
|
-
.,.,122745803744691.,.,
|
2674
|
-
|
2675
|
-
module_eval <<-'.,.,122745803717899.,.,', 'pl0d/pl0ds.dr', 324
|
2676
|
-
def _ast_43 val
|
2677
|
-
val[0].push(val[2])
|
2678
|
-
end
|
2679
|
-
.,.,122745803717899.,.,
|
2680
|
-
|
2681
|
-
end
|
2682
|
-
|
2683
|
-
|
2684
|
-
def createDecoratedPL0d
|
2685
|
-
D4PL0d::ASTBuilder.new(PL0d.new())
|
2686
|
-
end
|
2687
|
-
|
2688
|
-
### main
|
2689
|
-
if __FILE__ == $0
|
2690
|
-
### Main Code
|
2691
|
-
require 'pp'
|
2692
|
-
psr = createDecoratedPL0d
|
2693
|
-
t, = psr.parse(STDIN)
|
2694
|
-
# pp t
|
2695
|
-
v = Visitor.new
|
2696
|
-
t.accept(v)
|
2697
|
-
|
2698
|
-
end
|