racc 1.4.14 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/COPYING +22 -515
- data/README.ja.rdoc +3 -4
- data/README.rdoc +6 -8
- data/Rakefile +32 -53
- data/bin/racc +39 -27
- data/ext/racc/com/headius/racc/Cparse.java +66 -23
- data/ext/racc/{cparse.c → cparse/cparse.c} +82 -47
- data/ext/racc/{extconf.rb → cparse/extconf.rb} +2 -1
- data/lib/racc/compat.rb +5 -4
- data/lib/racc/debugflags.rb +5 -4
- data/lib/racc/exception.rb +5 -4
- data/lib/racc/grammar.rb +25 -22
- data/lib/racc/grammarfileparser.rb +10 -8
- data/lib/racc/info.rb +6 -5
- data/lib/racc/iset.rb +6 -5
- data/lib/racc/logfilegenerator.rb +6 -5
- data/lib/racc/parser-text.rb +20 -23
- data/lib/racc/parser.rb +20 -23
- data/lib/racc/parserfilegenerator.rb +10 -10
- data/lib/racc/sourcetext.rb +5 -4
- data/lib/racc/state.rb +13 -12
- data/lib/racc/statetransitiontable.rb +7 -6
- data/rdoc/ja/command.ja.html +1 -1
- data/sample/array.y +1 -1
- data/sample/array2.y +1 -1
- data/sample/calc-ja.y +2 -2
- data/sample/calc.y +2 -2
- data/sample/conflict.y +1 -1
- data/sample/hash.y +1 -1
- data/sample/lalr.y +1 -1
- data/sample/lists.y +1 -1
- data/sample/syntax.y +1 -1
- data/sample/yyerr.y +1 -1
- data/test/assets/cadenza.y +170 -0
- data/test/assets/cast.y +926 -0
- data/test/assets/csspool.y +729 -0
- data/test/assets/edtf.y +583 -0
- data/test/assets/huia.y +318 -0
- data/test/assets/intp.y +4 -4
- data/test/assets/journey.y +47 -0
- data/test/assets/liquor.y +313 -0
- data/test/assets/machete.y +423 -0
- data/test/assets/macruby.y +2197 -0
- data/test/assets/mailp.y +27 -27
- data/test/assets/mediacloth.y +599 -0
- data/test/assets/mof.y +649 -0
- data/test/assets/namae.y +302 -0
- data/test/assets/nasl.y +626 -0
- data/test/assets/nokogiri-css.y +255 -0
- data/test/assets/nullbug2.y +2 -2
- data/test/assets/opal.y +1807 -0
- data/test/assets/php_serialization.y +98 -0
- data/test/assets/recv.y +20 -20
- data/test/assets/riml.y +665 -0
- data/test/assets/ruby18.y +1943 -0
- data/test/assets/ruby19.y +2174 -0
- data/test/assets/ruby20.y +2350 -0
- data/test/assets/ruby21.y +2359 -0
- data/test/assets/ruby22.y +2381 -0
- data/test/assets/syntax.y +1 -1
- data/test/assets/tp_plus.y +622 -0
- data/test/assets/twowaysql.y +278 -0
- data/test/helper.rb +68 -41
- data/test/regress/cadenza +796 -0
- data/test/regress/cast +3428 -0
- data/test/regress/csspool +2314 -0
- data/test/regress/edtf +1794 -0
- data/test/regress/huia +1392 -0
- data/test/regress/journey +222 -0
- data/test/regress/liquor +885 -0
- data/test/regress/machete +833 -0
- data/test/regress/mediacloth +1463 -0
- data/test/regress/mof +1368 -0
- data/test/regress/namae +634 -0
- data/test/regress/nasl +2058 -0
- data/test/regress/nokogiri-css +836 -0
- data/test/regress/opal +6431 -0
- data/test/regress/php_serialization +336 -0
- data/test/regress/riml +3283 -0
- data/test/regress/ruby18 +6344 -0
- data/test/regress/ruby22 +7460 -0
- data/test/regress/tp_plus +1933 -0
- data/test/regress/twowaysql +556 -0
- data/test/test_chk_y.rb +1 -0
- data/test/test_racc_command.rb +177 -2
- data/test/test_scan_y.rb +1 -0
- data/test/testscanner.rb +1 -1
- metadata +59 -83
- data/DEPENDS +0 -4
- data/Manifest.txt +0 -102
- data/bin/racc2y +0 -195
- data/bin/y2racc +0 -339
- data/ext/racc/depend +0 -1
- data/fastcache/extconf.rb +0 -2
- data/fastcache/fastcache.c +0 -185
- data/misc/dist.sh +0 -31
- data/setup.rb +0 -1587
- data/tasks/doc.rb +0 -12
- data/tasks/email.rb +0 -55
@@ -0,0 +1,556 @@
|
|
1
|
+
#
|
2
|
+
# DO NOT MODIFY!!!!
|
3
|
+
# This file is automatically generated by Racc 1.5.0
|
4
|
+
# from Racc grammar file "".
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'racc/parser.rb'
|
8
|
+
module TwoWaySQL
|
9
|
+
class Parser < Racc::Parser
|
10
|
+
|
11
|
+
module_eval(<<'...end twowaysql.y/module_eval...', 'twowaysql.y', 148)
|
12
|
+
|
13
|
+
require 'strscan'
|
14
|
+
|
15
|
+
def initialize(opts={})
|
16
|
+
opts = {
|
17
|
+
:debug => false,
|
18
|
+
:preserve_space => true,
|
19
|
+
:preserve_comment => false
|
20
|
+
}.merge(opts)
|
21
|
+
@yydebug = opts[:debug]
|
22
|
+
@preserve_space = opts[:preserve_space]
|
23
|
+
@preserve_comment = opts[:preserve_comment]
|
24
|
+
@num_questions = 0
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
PAREN_EXAMPLE = '\([^\)]+\)'
|
29
|
+
BEGIN_BIND_VARIABLE = '(\/|\#)\*([^\*]+)\*\1'
|
30
|
+
BIND_VARIABLE_PATTERN = /\A#{BEGIN_BIND_VARIABLE}\s*/
|
31
|
+
PAREN_BIND_VARIABLE_PATTERN = /\A#{BEGIN_BIND_VARIABLE}\s*#{PAREN_EXAMPLE}/
|
32
|
+
EMBED_VARIABLE_PATTERN = /\A(\/|\#)\*\$([^\*]+)\*\1\s*/
|
33
|
+
|
34
|
+
CONDITIONAL_PATTERN = /\A(\/|\#)\*(IF)\s+([^\*]+)\s*\*\1/
|
35
|
+
BEGIN_END_PATTERN = /\A(\/|\#)\*(BEGIN|END)\s*\*\1/
|
36
|
+
STRING_LITERAL_PATTERN = /\A(\'(?:[^\']+|\'\')*\')/ ## quoted string
|
37
|
+
SPLIT_TOKEN_PATTERN = /\A(\S+?)(?=\s*(?:(?:\/|\#)\*|-{2,}|\(|\)|\,))/ ## stop on delimiters --,/*,#*,',',(,)
|
38
|
+
LITERAL_PATTERN = /\A([^;\s]+)/
|
39
|
+
SPACES_PATTERN = /\A(\s+)/
|
40
|
+
QUESTION_PATTERN = /\A\?/
|
41
|
+
COMMA_PATTERN = /\A\,/
|
42
|
+
LPAREN_PATTERN = /\A\(/
|
43
|
+
RPAREN_PATTERN = /\A\)/
|
44
|
+
ACTUAL_COMMENT_PATTERN = /\A(\/|\#)\*(\s{1,}(?:.*?))\*\1/m ## start with spaces
|
45
|
+
SEMICOLON_AT_INPUT_END_PATTERN = /\A\;\s*\Z/
|
46
|
+
UNMATCHED_COMMENT_START_PATTERN = /\A(?:(?:\/|\#)\*)/
|
47
|
+
|
48
|
+
#TODO: remove trailing spaces for S2Dao compatibility, but this spec sometimes causes SQL bugs...
|
49
|
+
ELSE_PATTERN = /\A\-{2,}\s*ELSE\s*/
|
50
|
+
AND_PATTERN = /\A(\ *AND)\b/i
|
51
|
+
OR_PATTERN = /\A(\ *OR)\b/i
|
52
|
+
|
53
|
+
|
54
|
+
def parse( io )
|
55
|
+
@q = []
|
56
|
+
io.each_line(nil) do |whole|
|
57
|
+
@s = StringScanner.new(whole)
|
58
|
+
end
|
59
|
+
scan_str
|
60
|
+
|
61
|
+
# @q.push [ false, nil ]
|
62
|
+
@q.push [ false, [@s.pos, nil] ]
|
63
|
+
|
64
|
+
## call racc's private parse method
|
65
|
+
do_parse
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
## called by racc
|
70
|
+
def next_token
|
71
|
+
@q.shift
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
def scan_str
|
76
|
+
until @s.eos? do
|
77
|
+
case
|
78
|
+
when @s.scan(AND_PATTERN)
|
79
|
+
@q.push [ :AND, [@s.pos, @s[1]] ]
|
80
|
+
when @s.scan(OR_PATTERN)
|
81
|
+
@q.push [ :OR, [@s.pos, @s[1]] ]
|
82
|
+
when @s.scan(SPACES_PATTERN)
|
83
|
+
@q.push [ :SPACES, [@s.pos, @s[1]] ]
|
84
|
+
when @s.scan(QUESTION_PATTERN)
|
85
|
+
@q.push [ :QUESTION, [@s.pos, nil] ]
|
86
|
+
when @s.scan(COMMA_PATTERN)
|
87
|
+
@q.push [ :COMMA, [@s.pos, ','] ]
|
88
|
+
when @s.scan(LPAREN_PATTERN)
|
89
|
+
@q.push [ :LPAREN, [@s.pos, '('] ]
|
90
|
+
when @s.scan(RPAREN_PATTERN)
|
91
|
+
@q.push [ :RPAREN, [@s.pos, ')'] ]
|
92
|
+
when @s.scan(ELSE_PATTERN)
|
93
|
+
@q.push [ :ELSE, [@s.pos, nil] ]
|
94
|
+
when @s.scan(ACTUAL_COMMENT_PATTERN)
|
95
|
+
@q.push [ :ACTUAL_COMMENT, [@s.pos, @s[1], @s[2]] ] if @preserve_comment
|
96
|
+
when @s.scan(BEGIN_END_PATTERN)
|
97
|
+
@q.push [ @s[2].intern, [@s.pos, nil] ]
|
98
|
+
when @s.scan(CONDITIONAL_PATTERN)
|
99
|
+
@q.push [ @s[2].intern, [@s.pos, @s[3]] ]
|
100
|
+
when @s.scan(EMBED_VARIABLE_PATTERN)
|
101
|
+
@q.push [ :EMBED_VARIABLE, [@s.pos, @s[2]] ]
|
102
|
+
when @s.scan(PAREN_BIND_VARIABLE_PATTERN)
|
103
|
+
@q.push [ :PAREN_BIND_VARIABLE, [@s.pos, @s[2]] ]
|
104
|
+
when @s.scan(BIND_VARIABLE_PATTERN)
|
105
|
+
@q.push [ :BIND_VARIABLE, [@s.pos, @s[2]] ]
|
106
|
+
when @s.scan(STRING_LITERAL_PATTERN)
|
107
|
+
@q.push [ :STRING_LITERAL, [@s.pos, @s[1]] ]
|
108
|
+
when @s.scan(SPLIT_TOKEN_PATTERN)
|
109
|
+
@q.push [ :IDENT, [@s.pos, @s[1]] ]
|
110
|
+
when @s.scan(UNMATCHED_COMMENT_START_PATTERN) ## unmatched comment start, '/*','#*'
|
111
|
+
raise Racc::ParseError, "unmatched comment. line:[#{line_no(@s.pos)}], str:[#{@s.rest}]"
|
112
|
+
when @s.scan(LITERAL_PATTERN) ## other string token
|
113
|
+
@q.push [ :IDENT, [@s.pos, @s[1]] ]
|
114
|
+
when @s.scan(SEMICOLON_AT_INPUT_END_PATTERN)
|
115
|
+
#drop semicolon at input end
|
116
|
+
else
|
117
|
+
raise Racc::ParseError, "syntax error at or near line:[#{line_no(@s.pos)}], str:[#{@s.rest}]"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
## override racc's default on_error method
|
124
|
+
def on_error(t, v, vstack)
|
125
|
+
## cursor in value-stack is an array of two items,
|
126
|
+
## that have position value as 0th item. like [731, "ctx[:limit] "]
|
127
|
+
cursor = vstack.find do |tokens|
|
128
|
+
tokens.size == 2 and tokens[0].kind_of?(Fixnum)
|
129
|
+
end
|
130
|
+
pos = cursor[0]
|
131
|
+
line = line_no(pos)
|
132
|
+
rest = @s.string[pos .. -1]
|
133
|
+
raise Racc::ParseError, "syntax error at or near line:[#{line}], str:[#{rest}]"
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
def line_no(pos)
|
138
|
+
lines = 0
|
139
|
+
scanned = @s.string[0..(pos)]
|
140
|
+
scanned.each_line { lines += 1 }
|
141
|
+
lines
|
142
|
+
end
|
143
|
+
...end twowaysql.y/module_eval...
|
144
|
+
##### State transition tables begin ###
|
145
|
+
|
146
|
+
racc_action_table = [
|
147
|
+
8, 36, 9, 37, 12, 13, 10, 11, 14, 15,
|
148
|
+
16, 17, 18, 19, 22, 23, 24, 8, 38, 9,
|
149
|
+
3, 12, 13, 10, 11, 14, 15, 16, 17, 18,
|
150
|
+
19, 22, 23, 24, 8, 25, 9, 40, 12, 13,
|
151
|
+
10, 11, 14, 15, 16, 17, 18, 19, 22, 23,
|
152
|
+
24, 8, 45, 9, 46, 12, 13, 10, 11, 14,
|
153
|
+
15, 16, 17, 18, 19, 22, 23, 24, 8, nil,
|
154
|
+
9, nil, 12, 13, 10, 11, 14, 15, 16, 17,
|
155
|
+
18, 19, 22, 23, 24, 35, 33, 34, 31, 32,
|
156
|
+
44, 43, 31, 32 ]
|
157
|
+
|
158
|
+
racc_action_check = [
|
159
|
+
2, 24, 2, 24, 2, 2, 2, 2, 2, 2,
|
160
|
+
2, 2, 2, 2, 2, 2, 2, 26, 26, 26,
|
161
|
+
1, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
162
|
+
26, 26, 26, 26, 27, 3, 27, 28, 27, 27,
|
163
|
+
27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
164
|
+
27, 41, 37, 41, 39, 41, 41, 41, 41, 41,
|
165
|
+
41, 41, 41, 41, 41, 41, 41, 41, 42, nil,
|
166
|
+
42, nil, 42, 42, 42, 42, 42, 42, 42, 42,
|
167
|
+
42, 42, 42, 42, 42, 22, 22, 22, 9, 9,
|
168
|
+
34, 34, 40, 40 ]
|
169
|
+
|
170
|
+
racc_action_pointer = [
|
171
|
+
nil, 20, -2, 35, nil, nil, nil, nil, nil, 82,
|
172
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
173
|
+
nil, nil, 77, nil, -7, nil, 15, 32, 32, nil,
|
174
|
+
nil, nil, nil, nil, 82, nil, nil, 44, nil, 51,
|
175
|
+
86, 49, 66, nil, nil, nil, nil, nil ]
|
176
|
+
|
177
|
+
racc_action_default = [
|
178
|
+
-2, -35, -1, -35, -3, -4, -5, -6, -2, -2,
|
179
|
+
-16, -17, -18, -19, -20, -21, -22, -23, -24, -25,
|
180
|
+
-26, -27, -35, -32, -35, 48, -35, -13, -10, -11,
|
181
|
+
-12, -2, -2, -28, -35, -30, -33, -35, -7, -35,
|
182
|
+
-2, -14, -15, -29, -31, -34, -8, -9 ]
|
183
|
+
|
184
|
+
racc_goto_table = [
|
185
|
+
2, 1, 28, 39, nil, nil, nil, nil, 26, nil,
|
186
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
187
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
188
|
+
nil, 41, 42, 47 ]
|
189
|
+
|
190
|
+
racc_goto_check = [
|
191
|
+
2, 1, 7, 8, nil, nil, nil, nil, 2, nil,
|
192
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
193
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
194
|
+
nil, 2, 2, 7 ]
|
195
|
+
|
196
|
+
racc_goto_pointer = [
|
197
|
+
nil, 1, 0, nil, nil, nil, nil, -7, -25, nil,
|
198
|
+
nil, nil, nil ]
|
199
|
+
|
200
|
+
racc_goto_default = [
|
201
|
+
nil, nil, 27, 4, 5, 6, 7, nil, nil, 29,
|
202
|
+
30, 20, 21 ]
|
203
|
+
|
204
|
+
racc_reduce_table = [
|
205
|
+
0, 0, :racc_error,
|
206
|
+
1, 20, :_reduce_1,
|
207
|
+
0, 21, :_reduce_2,
|
208
|
+
2, 21, :_reduce_3,
|
209
|
+
1, 22, :_reduce_none,
|
210
|
+
1, 22, :_reduce_none,
|
211
|
+
1, 22, :_reduce_none,
|
212
|
+
3, 25, :_reduce_7,
|
213
|
+
4, 24, :_reduce_8,
|
214
|
+
2, 27, :_reduce_9,
|
215
|
+
0, 27, :_reduce_10,
|
216
|
+
1, 26, :_reduce_none,
|
217
|
+
1, 26, :_reduce_none,
|
218
|
+
1, 26, :_reduce_none,
|
219
|
+
2, 28, :_reduce_14,
|
220
|
+
2, 29, :_reduce_15,
|
221
|
+
1, 23, :_reduce_16,
|
222
|
+
1, 23, :_reduce_17,
|
223
|
+
1, 23, :_reduce_18,
|
224
|
+
1, 23, :_reduce_19,
|
225
|
+
1, 23, :_reduce_20,
|
226
|
+
1, 23, :_reduce_21,
|
227
|
+
1, 23, :_reduce_22,
|
228
|
+
1, 23, :_reduce_23,
|
229
|
+
1, 23, :_reduce_24,
|
230
|
+
1, 23, :_reduce_25,
|
231
|
+
1, 23, :_reduce_none,
|
232
|
+
1, 23, :_reduce_none,
|
233
|
+
2, 30, :_reduce_28,
|
234
|
+
3, 30, :_reduce_29,
|
235
|
+
2, 30, :_reduce_30,
|
236
|
+
3, 30, :_reduce_31,
|
237
|
+
1, 30, :_reduce_32,
|
238
|
+
2, 31, :_reduce_33,
|
239
|
+
3, 31, :_reduce_34 ]
|
240
|
+
|
241
|
+
racc_reduce_n = 35
|
242
|
+
|
243
|
+
racc_shift_n = 48
|
244
|
+
|
245
|
+
racc_token_table = {
|
246
|
+
false => 0,
|
247
|
+
:error => 1,
|
248
|
+
:BEGIN => 2,
|
249
|
+
:END => 3,
|
250
|
+
:IF => 4,
|
251
|
+
:ELSE => 5,
|
252
|
+
:AND => 6,
|
253
|
+
:OR => 7,
|
254
|
+
:IDENT => 8,
|
255
|
+
:STRING_LITERAL => 9,
|
256
|
+
:SPACES => 10,
|
257
|
+
:COMMA => 11,
|
258
|
+
:LPAREN => 12,
|
259
|
+
:RPAREN => 13,
|
260
|
+
:QUESTION => 14,
|
261
|
+
:ACTUAL_COMMENT => 15,
|
262
|
+
:BIND_VARIABLE => 16,
|
263
|
+
:PAREN_BIND_VARIABLE => 17,
|
264
|
+
:EMBED_VARIABLE => 18 }
|
265
|
+
|
266
|
+
racc_nt_base = 19
|
267
|
+
|
268
|
+
racc_use_result_var = true
|
269
|
+
|
270
|
+
Racc_arg = [
|
271
|
+
racc_action_table,
|
272
|
+
racc_action_check,
|
273
|
+
racc_action_default,
|
274
|
+
racc_action_pointer,
|
275
|
+
racc_goto_table,
|
276
|
+
racc_goto_check,
|
277
|
+
racc_goto_default,
|
278
|
+
racc_goto_pointer,
|
279
|
+
racc_nt_base,
|
280
|
+
racc_reduce_table,
|
281
|
+
racc_token_table,
|
282
|
+
racc_shift_n,
|
283
|
+
racc_reduce_n,
|
284
|
+
racc_use_result_var ]
|
285
|
+
|
286
|
+
Racc_token_to_s_table = [
|
287
|
+
"$end",
|
288
|
+
"error",
|
289
|
+
"BEGIN",
|
290
|
+
"END",
|
291
|
+
"IF",
|
292
|
+
"ELSE",
|
293
|
+
"AND",
|
294
|
+
"OR",
|
295
|
+
"IDENT",
|
296
|
+
"STRING_LITERAL",
|
297
|
+
"SPACES",
|
298
|
+
"COMMA",
|
299
|
+
"LPAREN",
|
300
|
+
"RPAREN",
|
301
|
+
"QUESTION",
|
302
|
+
"ACTUAL_COMMENT",
|
303
|
+
"BIND_VARIABLE",
|
304
|
+
"PAREN_BIND_VARIABLE",
|
305
|
+
"EMBED_VARIABLE",
|
306
|
+
"$start",
|
307
|
+
"sql",
|
308
|
+
"stmt_list",
|
309
|
+
"stmt",
|
310
|
+
"primary",
|
311
|
+
"if_stmt",
|
312
|
+
"begin_stmt",
|
313
|
+
"sub_stmt",
|
314
|
+
"else_stmt",
|
315
|
+
"and_stmt",
|
316
|
+
"or_stmt",
|
317
|
+
"bind_var",
|
318
|
+
"embed_var" ]
|
319
|
+
|
320
|
+
Racc_debug_parser = false
|
321
|
+
|
322
|
+
##### State transition tables end #####
|
323
|
+
|
324
|
+
# reduce 0 omitted
|
325
|
+
|
326
|
+
module_eval(<<'.,.,', 'twowaysql.y', 20)
|
327
|
+
def _reduce_1(val, _values, result)
|
328
|
+
result = RootNode.new( val[0] )
|
329
|
+
|
330
|
+
result
|
331
|
+
end
|
332
|
+
.,.,
|
333
|
+
|
334
|
+
module_eval(<<'.,.,', 'twowaysql.y', 25)
|
335
|
+
def _reduce_2(val, _values, result)
|
336
|
+
result = []
|
337
|
+
|
338
|
+
result
|
339
|
+
end
|
340
|
+
.,.,
|
341
|
+
|
342
|
+
module_eval(<<'.,.,', 'twowaysql.y', 29)
|
343
|
+
def _reduce_3(val, _values, result)
|
344
|
+
result.push val[1]
|
345
|
+
|
346
|
+
result
|
347
|
+
end
|
348
|
+
.,.,
|
349
|
+
|
350
|
+
# reduce 4 omitted
|
351
|
+
|
352
|
+
# reduce 5 omitted
|
353
|
+
|
354
|
+
# reduce 6 omitted
|
355
|
+
|
356
|
+
module_eval(<<'.,.,', 'twowaysql.y', 38)
|
357
|
+
def _reduce_7(val, _values, result)
|
358
|
+
result = BeginNode.new( val[1] )
|
359
|
+
|
360
|
+
result
|
361
|
+
end
|
362
|
+
.,.,
|
363
|
+
|
364
|
+
module_eval(<<'.,.,', 'twowaysql.y', 43)
|
365
|
+
def _reduce_8(val, _values, result)
|
366
|
+
result = IfNode.new( val[0][1], val[1], val[2] )
|
367
|
+
|
368
|
+
result
|
369
|
+
end
|
370
|
+
.,.,
|
371
|
+
|
372
|
+
module_eval(<<'.,.,', 'twowaysql.y', 48)
|
373
|
+
def _reduce_9(val, _values, result)
|
374
|
+
result = val[1]
|
375
|
+
|
376
|
+
result
|
377
|
+
end
|
378
|
+
.,.,
|
379
|
+
|
380
|
+
module_eval(<<'.,.,', 'twowaysql.y', 52)
|
381
|
+
def _reduce_10(val, _values, result)
|
382
|
+
result = nil
|
383
|
+
|
384
|
+
result
|
385
|
+
end
|
386
|
+
.,.,
|
387
|
+
|
388
|
+
# reduce 11 omitted
|
389
|
+
|
390
|
+
# reduce 12 omitted
|
391
|
+
|
392
|
+
# reduce 13 omitted
|
393
|
+
|
394
|
+
module_eval(<<'.,.,', 'twowaysql.y', 61)
|
395
|
+
def _reduce_14(val, _values, result)
|
396
|
+
result = SubStatementNode.new( val[0][1], val[1] )
|
397
|
+
|
398
|
+
result
|
399
|
+
end
|
400
|
+
.,.,
|
401
|
+
|
402
|
+
module_eval(<<'.,.,', 'twowaysql.y', 66)
|
403
|
+
def _reduce_15(val, _values, result)
|
404
|
+
result = SubStatementNode.new( val[0][1], val[1] )
|
405
|
+
|
406
|
+
result
|
407
|
+
end
|
408
|
+
.,.,
|
409
|
+
|
410
|
+
module_eval(<<'.,.,', 'twowaysql.y', 71)
|
411
|
+
def _reduce_16(val, _values, result)
|
412
|
+
result = LiteralNode.new( val[0][1] )
|
413
|
+
|
414
|
+
result
|
415
|
+
end
|
416
|
+
.,.,
|
417
|
+
|
418
|
+
module_eval(<<'.,.,', 'twowaysql.y', 75)
|
419
|
+
def _reduce_17(val, _values, result)
|
420
|
+
result = LiteralNode.new( val[0][1] )
|
421
|
+
|
422
|
+
result
|
423
|
+
end
|
424
|
+
.,.,
|
425
|
+
|
426
|
+
module_eval(<<'.,.,', 'twowaysql.y', 79)
|
427
|
+
def _reduce_18(val, _values, result)
|
428
|
+
result = LiteralNode.new( val[0][1] )
|
429
|
+
|
430
|
+
result
|
431
|
+
end
|
432
|
+
.,.,
|
433
|
+
|
434
|
+
module_eval(<<'.,.,', 'twowaysql.y', 83)
|
435
|
+
def _reduce_19(val, _values, result)
|
436
|
+
result = LiteralNode.new( val[0][1] )
|
437
|
+
|
438
|
+
result
|
439
|
+
end
|
440
|
+
.,.,
|
441
|
+
|
442
|
+
module_eval(<<'.,.,', 'twowaysql.y', 87)
|
443
|
+
def _reduce_20(val, _values, result)
|
444
|
+
result = WhiteSpaceNode.new( val[0][1], @preserve_space )
|
445
|
+
|
446
|
+
result
|
447
|
+
end
|
448
|
+
.,.,
|
449
|
+
|
450
|
+
module_eval(<<'.,.,', 'twowaysql.y', 91)
|
451
|
+
def _reduce_21(val, _values, result)
|
452
|
+
result = LiteralNode.new( val[0][1] )
|
453
|
+
|
454
|
+
result
|
455
|
+
end
|
456
|
+
.,.,
|
457
|
+
|
458
|
+
module_eval(<<'.,.,', 'twowaysql.y', 95)
|
459
|
+
def _reduce_22(val, _values, result)
|
460
|
+
result = LiteralNode.new( val[0][1] )
|
461
|
+
|
462
|
+
result
|
463
|
+
end
|
464
|
+
.,.,
|
465
|
+
|
466
|
+
module_eval(<<'.,.,', 'twowaysql.y', 99)
|
467
|
+
def _reduce_23(val, _values, result)
|
468
|
+
result = LiteralNode.new( val[0][1] )
|
469
|
+
|
470
|
+
result
|
471
|
+
end
|
472
|
+
.,.,
|
473
|
+
|
474
|
+
module_eval(<<'.,.,', 'twowaysql.y', 103)
|
475
|
+
def _reduce_24(val, _values, result)
|
476
|
+
@num_questions += 1
|
477
|
+
result = QuestionNode.new( @num_questions )
|
478
|
+
|
479
|
+
result
|
480
|
+
end
|
481
|
+
.,.,
|
482
|
+
|
483
|
+
module_eval(<<'.,.,', 'twowaysql.y', 108)
|
484
|
+
def _reduce_25(val, _values, result)
|
485
|
+
result = ActualCommentNode.new( val[0][1] , val[0][2] )
|
486
|
+
|
487
|
+
result
|
488
|
+
end
|
489
|
+
.,.,
|
490
|
+
|
491
|
+
# reduce 26 omitted
|
492
|
+
|
493
|
+
# reduce 27 omitted
|
494
|
+
|
495
|
+
module_eval(<<'.,.,', 'twowaysql.y', 115)
|
496
|
+
def _reduce_28(val, _values, result)
|
497
|
+
result = BindVariableNode.new( val[0][1] )
|
498
|
+
|
499
|
+
result
|
500
|
+
end
|
501
|
+
.,.,
|
502
|
+
|
503
|
+
module_eval(<<'.,.,', 'twowaysql.y', 119)
|
504
|
+
def _reduce_29(val, _values, result)
|
505
|
+
result = BindVariableNode.new( val[0][1] )
|
506
|
+
|
507
|
+
result
|
508
|
+
end
|
509
|
+
.,.,
|
510
|
+
|
511
|
+
module_eval(<<'.,.,', 'twowaysql.y', 123)
|
512
|
+
def _reduce_30(val, _values, result)
|
513
|
+
result = BindVariableNode.new( val[0][1] )
|
514
|
+
|
515
|
+
result
|
516
|
+
end
|
517
|
+
.,.,
|
518
|
+
|
519
|
+
module_eval(<<'.,.,', 'twowaysql.y', 127)
|
520
|
+
def _reduce_31(val, _values, result)
|
521
|
+
result = BindVariableNode.new( val[0][1] )
|
522
|
+
|
523
|
+
result
|
524
|
+
end
|
525
|
+
.,.,
|
526
|
+
|
527
|
+
module_eval(<<'.,.,', 'twowaysql.y', 131)
|
528
|
+
def _reduce_32(val, _values, result)
|
529
|
+
result = ParenBindVariableNode.new( val[0][1] )
|
530
|
+
|
531
|
+
result
|
532
|
+
end
|
533
|
+
.,.,
|
534
|
+
|
535
|
+
module_eval(<<'.,.,', 'twowaysql.y', 136)
|
536
|
+
def _reduce_33(val, _values, result)
|
537
|
+
result = EmbedVariableNode.new( val[0][1] )
|
538
|
+
|
539
|
+
result
|
540
|
+
end
|
541
|
+
.,.,
|
542
|
+
|
543
|
+
module_eval(<<'.,.,', 'twowaysql.y', 140)
|
544
|
+
def _reduce_34(val, _values, result)
|
545
|
+
result = EmbedVariableNode.new( val[0][1] )
|
546
|
+
|
547
|
+
result
|
548
|
+
end
|
549
|
+
.,.,
|
550
|
+
|
551
|
+
def _reduce_none(val, _values, result)
|
552
|
+
val[0]
|
553
|
+
end
|
554
|
+
|
555
|
+
end # class Parser
|
556
|
+
end # module TwoWaySQL
|