235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
# File 'lib/oracle-sql-parser/grammar/select/row_limit.rb', line 235
def _nt_fetch
start_index = index
if node_cache[:fetch].has_key?(index)
cached = node_cache[:fetch][index]
if cached
node_cache[:fetch][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
r1 = _nt_fetch_keyword
s0 << r1
if r1
r2 = _nt_space
s0 << r2
if r2
i3 = index
r4 = _nt_first_keyword
if r4
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
r3 = r4
else
r5 = _nt_next_keyword
if r5
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
r3 = r5
else
@index = i3
r3 = nil
end
end
s0 << r3
if r3
r6 = _nt_space
s0 << r6
if r6
i7 = index
i8, s8 = index, []
r9 = _nt_integer
s8 << r9
if s8.last
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
r8.extend(Fetch0)
else
@index = i8
r8 = nil
end
if r8
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
r7 = r8
else
i10, s10 = index, []
r11 = _nt_integer
s10 << r11
if r11
r12 = _nt_percentage_keyword
s10 << r12
end
if s10.last
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
r10.extend(Fetch1)
else
@index = i10
r10 = nil
end
if r10
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
r7 = r10
else
@index = i7
r7 = nil
end
end
s0 << r7
if r7
r13 = _nt_space
s0 << r13
if r13
i14 = index
r15 = _nt_row_keyword
if r15
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
r14 = r15
else
r16 = _nt_rows_keyword
if r16
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
r14 = r16
else
@index = i14
r14 = nil
end
end
s0 << r14
if r14
r17 = _nt_space
s0 << r17
if r17
i18 = index
i19, s19 = index, []
r20 = _nt_only_keyword
s19 << r20
if s19.last
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
r19.extend(Fetch2)
else
@index = i19
r19 = nil
end
if r19
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
r18 = r19
else
i21, s21 = index, []
r22 = _nt_with_keyword
s21 << r22
if r22
r23 = _nt_space
s21 << r23
if r23
r24 = _nt_ties_keyword
s21 << r24
end
end
if s21.last
r21 = instantiate_node(SyntaxNode,input, i21...index, s21)
r21.extend(Fetch3)
else
@index = i21
r21 = nil
end
if r21
r21 = SyntaxNode.new(input, (index-1)...index) if r21 == true
r18 = r21
else
@index = i18
r18 = nil
end
end
s0 << r18
end
end
end
end
end
end
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(Fetch4)
r0.extend(Fetch5)
else
@index = i0
r0 = nil
end
node_cache[:fetch][start_index] = r0
r0
end
|