rdf-n3 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,30 @@
1
1
  #encoding: utf-8
2
2
  grammar N3Grammer
3
- # Entry point to grammer
3
+ # Entry point to grammar
4
4
  rule document
5
5
  statements
6
6
  end
7
7
 
8
- rule alpha
9
- [A-Z_a-z\p{Alpha}]
8
+ rule barename
9
+ barename_start barename_tail*
10
10
  end
11
11
 
12
- rule alphanumeric
13
- alpha / [0-9]
12
+ rule barename_start
13
+ [A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd\u{10000}-\u{effff}]
14
14
  end
15
-
15
+
16
+ rule barename_tail
17
+ barename_start / [-0-9\u00b7\u0300-\u036f\u203f-\u2040\\]
18
+ end
19
+
20
+ rule hexdigit
21
+ [0-9a-fA-F]
22
+ end
23
+
24
+ rule integer
25
+ [+-]? [0-9]+
26
+ end
27
+
16
28
  rule barename_csl
17
29
  space+ barename barename_csl_tail
18
30
  / ""
@@ -68,20 +80,8 @@ grammar N3Grammer
68
80
  / pathitem
69
81
  end
70
82
 
71
- rule barename
72
- alpha (alphanumeric / '-')*
73
- end
74
-
75
- rule hexdigit
76
- [0-9a-fA-F]
77
- end
78
-
79
- rule integer
80
- [+-]? [0-9]+
81
- end
82
-
83
83
  rule language
84
- [a-z]+ ( "-" [a-z0-9]+ )*
84
+ [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )*
85
85
  end
86
86
 
87
87
  rule literal
@@ -89,11 +89,11 @@ grammar N3Grammer
89
89
  end
90
90
 
91
91
  rule localname
92
- alpha (alphanumeric / '-')*
92
+ barename
93
93
  end
94
94
 
95
95
  rule nprefix
96
- alpha (alphanumeric / '-')*
96
+ barename
97
97
  end
98
98
 
99
99
  rule numericliteral
@@ -0,0 +1,3764 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ #encoding: utf-8
5
+ module N3Grammer
6
+ include Treetop::Runtime
7
+
8
+ def root
9
+ @root ||= :document
10
+ end
11
+
12
+ def _nt_document
13
+ start_index = index
14
+ if node_cache[:document].has_key?(index)
15
+ cached = node_cache[:document][index]
16
+ if cached
17
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
18
+ @index = cached.interval.end
19
+ end
20
+ return cached
21
+ end
22
+
23
+ r0 = _nt_statements
24
+
25
+ node_cache[:document][start_index] = r0
26
+
27
+ r0
28
+ end
29
+
30
+ module Barename0
31
+ def barename_start
32
+ elements[0]
33
+ end
34
+
35
+ end
36
+
37
+ def _nt_barename
38
+ start_index = index
39
+ if node_cache[:barename].has_key?(index)
40
+ cached = node_cache[:barename][index]
41
+ if cached
42
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
43
+ @index = cached.interval.end
44
+ end
45
+ return cached
46
+ end
47
+
48
+ i0, s0 = index, []
49
+ r1 = _nt_barename_start
50
+ s0 << r1
51
+ if r1
52
+ s2, i2 = [], index
53
+ loop do
54
+ r3 = _nt_barename_tail
55
+ if r3
56
+ s2 << r3
57
+ else
58
+ break
59
+ end
60
+ end
61
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
62
+ s0 << r2
63
+ end
64
+ if s0.last
65
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
66
+ r0.extend(Barename0)
67
+ else
68
+ @index = i0
69
+ r0 = nil
70
+ end
71
+
72
+ node_cache[:barename][start_index] = r0
73
+
74
+ r0
75
+ end
76
+
77
+ def _nt_barename_start
78
+ start_index = index
79
+ if node_cache[:barename_start].has_key?(index)
80
+ cached = node_cache[:barename_start][index]
81
+ if cached
82
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
83
+ @index = cached.interval.end
84
+ end
85
+ return cached
86
+ end
87
+
88
+ if has_terminal?('\G[A-Z_a-z\\p{Alpha}]', true, index)
89
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
90
+ @index += 1
91
+ else
92
+ r0 = nil
93
+ end
94
+
95
+ node_cache[:barename_start][start_index] = r0
96
+
97
+ r0
98
+ end
99
+
100
+ def _nt_barename_tail
101
+ start_index = index
102
+ if node_cache[:barename_tail].has_key?(index)
103
+ cached = node_cache[:barename_tail][index]
104
+ if cached
105
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
106
+ @index = cached.interval.end
107
+ end
108
+ return cached
109
+ end
110
+
111
+ i0 = index
112
+ r1 = _nt_barename_start
113
+ if r1
114
+ r0 = r1
115
+ else
116
+ if has_terminal?('\G[-0-9\\\\]', true, index)
117
+ r2 = true
118
+ @index += 1
119
+ else
120
+ r2 = nil
121
+ end
122
+ if r2
123
+ r0 = r2
124
+ else
125
+ @index = i0
126
+ r0 = nil
127
+ end
128
+ end
129
+
130
+ node_cache[:barename_tail][start_index] = r0
131
+
132
+ r0
133
+ end
134
+
135
+ def _nt_hexdigit
136
+ start_index = index
137
+ if node_cache[:hexdigit].has_key?(index)
138
+ cached = node_cache[:hexdigit][index]
139
+ if cached
140
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
141
+ @index = cached.interval.end
142
+ end
143
+ return cached
144
+ end
145
+
146
+ if has_terminal?('\G[0-9a-fA-F]', true, index)
147
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
148
+ @index += 1
149
+ else
150
+ r0 = nil
151
+ end
152
+
153
+ node_cache[:hexdigit][start_index] = r0
154
+
155
+ r0
156
+ end
157
+
158
+ module Integer0
159
+ end
160
+
161
+ def _nt_integer
162
+ start_index = index
163
+ if node_cache[:integer].has_key?(index)
164
+ cached = node_cache[:integer][index]
165
+ if cached
166
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
167
+ @index = cached.interval.end
168
+ end
169
+ return cached
170
+ end
171
+
172
+ i0, s0 = index, []
173
+ if has_terminal?('\G[+-]', true, index)
174
+ r2 = true
175
+ @index += 1
176
+ else
177
+ r2 = nil
178
+ end
179
+ if r2
180
+ r1 = r2
181
+ else
182
+ r1 = instantiate_node(SyntaxNode,input, index...index)
183
+ end
184
+ s0 << r1
185
+ if r1
186
+ s3, i3 = [], index
187
+ loop do
188
+ if has_terminal?('\G[0-9]', true, index)
189
+ r4 = true
190
+ @index += 1
191
+ else
192
+ r4 = nil
193
+ end
194
+ if r4
195
+ s3 << r4
196
+ else
197
+ break
198
+ end
199
+ end
200
+ if s3.empty?
201
+ @index = i3
202
+ r3 = nil
203
+ else
204
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
205
+ end
206
+ s0 << r3
207
+ end
208
+ if s0.last
209
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
210
+ r0.extend(Integer0)
211
+ else
212
+ @index = i0
213
+ r0 = nil
214
+ end
215
+
216
+ node_cache[:integer][start_index] = r0
217
+
218
+ r0
219
+ end
220
+
221
+ module BarenameCsl0
222
+ def barename
223
+ elements[1]
224
+ end
225
+
226
+ def barename_csl_tail
227
+ elements[2]
228
+ end
229
+ end
230
+
231
+ def _nt_barename_csl
232
+ start_index = index
233
+ if node_cache[:barename_csl].has_key?(index)
234
+ cached = node_cache[:barename_csl][index]
235
+ if cached
236
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
237
+ @index = cached.interval.end
238
+ end
239
+ return cached
240
+ end
241
+
242
+ i0 = index
243
+ i1, s1 = index, []
244
+ s2, i2 = [], index
245
+ loop do
246
+ r3 = _nt_space
247
+ if r3
248
+ s2 << r3
249
+ else
250
+ break
251
+ end
252
+ end
253
+ if s2.empty?
254
+ @index = i2
255
+ r2 = nil
256
+ else
257
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
258
+ end
259
+ s1 << r2
260
+ if r2
261
+ r4 = _nt_barename
262
+ s1 << r4
263
+ if r4
264
+ r5 = _nt_barename_csl_tail
265
+ s1 << r5
266
+ end
267
+ end
268
+ if s1.last
269
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
270
+ r1.extend(BarenameCsl0)
271
+ else
272
+ @index = i1
273
+ r1 = nil
274
+ end
275
+ if r1
276
+ r0 = r1
277
+ else
278
+ if has_terminal?("", false, index)
279
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 0))
280
+ @index += 0
281
+ else
282
+ terminal_parse_failure("")
283
+ r6 = nil
284
+ end
285
+ if r6
286
+ r0 = r6
287
+ else
288
+ @index = i0
289
+ r0 = nil
290
+ end
291
+ end
292
+
293
+ node_cache[:barename_csl][start_index] = r0
294
+
295
+ r0
296
+ end
297
+
298
+ module BarenameCslTail0
299
+ def barename
300
+ elements[3]
301
+ end
302
+
303
+ def barename_csl_tail
304
+ elements[5]
305
+ end
306
+ end
307
+
308
+ def _nt_barename_csl_tail
309
+ start_index = index
310
+ if node_cache[:barename_csl_tail].has_key?(index)
311
+ cached = node_cache[:barename_csl_tail][index]
312
+ if cached
313
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
314
+ @index = cached.interval.end
315
+ end
316
+ return cached
317
+ end
318
+
319
+ i0 = index
320
+ i1, s1 = index, []
321
+ s2, i2 = [], index
322
+ loop do
323
+ r3 = _nt_space
324
+ if r3
325
+ s2 << r3
326
+ else
327
+ break
328
+ end
329
+ end
330
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
331
+ s1 << r2
332
+ if r2
333
+ if has_terminal?(",", false, index)
334
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
335
+ @index += 1
336
+ else
337
+ terminal_parse_failure(",")
338
+ r4 = nil
339
+ end
340
+ s1 << r4
341
+ if r4
342
+ s5, i5 = [], index
343
+ loop do
344
+ r6 = _nt_space
345
+ if r6
346
+ s5 << r6
347
+ else
348
+ break
349
+ end
350
+ end
351
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
352
+ s1 << r5
353
+ if r5
354
+ r7 = _nt_barename
355
+ s1 << r7
356
+ if r7
357
+ s8, i8 = [], index
358
+ loop do
359
+ r9 = _nt_space
360
+ if r9
361
+ s8 << r9
362
+ else
363
+ break
364
+ end
365
+ end
366
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
367
+ s1 << r8
368
+ if r8
369
+ r10 = _nt_barename_csl_tail
370
+ s1 << r10
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+ if s1.last
377
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
378
+ r1.extend(BarenameCslTail0)
379
+ else
380
+ @index = i1
381
+ r1 = nil
382
+ end
383
+ if r1
384
+ r0 = r1
385
+ else
386
+ if has_terminal?("", false, index)
387
+ r11 = instantiate_node(SyntaxNode,input, index...(index + 0))
388
+ @index += 0
389
+ else
390
+ terminal_parse_failure("")
391
+ r11 = nil
392
+ end
393
+ if r11
394
+ r0 = r11
395
+ else
396
+ @index = i0
397
+ r0 = nil
398
+ end
399
+ end
400
+
401
+ node_cache[:barename_csl_tail][start_index] = r0
402
+
403
+ r0
404
+ end
405
+
406
+ module Boolean0
407
+ end
408
+
409
+ def _nt_boolean
410
+ start_index = index
411
+ if node_cache[:boolean].has_key?(index)
412
+ cached = node_cache[:boolean][index]
413
+ if cached
414
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
415
+ @index = cached.interval.end
416
+ end
417
+ return cached
418
+ end
419
+
420
+ i0, s0 = index, []
421
+ s1, i1 = [], index
422
+ loop do
423
+ if has_terminal?("@", false, index)
424
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
425
+ @index += 1
426
+ else
427
+ terminal_parse_failure("@")
428
+ r2 = nil
429
+ end
430
+ if r2
431
+ s1 << r2
432
+ else
433
+ break
434
+ end
435
+ end
436
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
437
+ s0 << r1
438
+ if r1
439
+ i3 = index
440
+ if has_terminal?("true", false, index)
441
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 4))
442
+ @index += 4
443
+ else
444
+ terminal_parse_failure("true")
445
+ r4 = nil
446
+ end
447
+ if r4
448
+ r3 = r4
449
+ else
450
+ if has_terminal?("false", false, index)
451
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 5))
452
+ @index += 5
453
+ else
454
+ terminal_parse_failure("false")
455
+ r5 = nil
456
+ end
457
+ if r5
458
+ r3 = r5
459
+ else
460
+ @index = i3
461
+ r3 = nil
462
+ end
463
+ end
464
+ s0 << r3
465
+ end
466
+ if s0.last
467
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
468
+ r0.extend(Boolean0)
469
+ else
470
+ @index = i0
471
+ r0 = nil
472
+ end
473
+
474
+ node_cache[:boolean][start_index] = r0
475
+
476
+ r0
477
+ end
478
+
479
+ module Comment0
480
+ end
481
+
482
+ module Comment1
483
+ end
484
+
485
+ def _nt_comment
486
+ start_index = index
487
+ if node_cache[:comment].has_key?(index)
488
+ cached = node_cache[:comment][index]
489
+ if cached
490
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
491
+ @index = cached.interval.end
492
+ end
493
+ return cached
494
+ end
495
+
496
+ i0, s0 = index, []
497
+ if has_terminal?('#', false, index)
498
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
499
+ @index += 1
500
+ else
501
+ terminal_parse_failure('#')
502
+ r1 = nil
503
+ end
504
+ s0 << r1
505
+ if r1
506
+ s2, i2 = [], index
507
+ loop do
508
+ i3, s3 = index, []
509
+ i4 = index
510
+ if has_terminal?('\G[\\n\\r]', true, index)
511
+ r5 = true
512
+ @index += 1
513
+ else
514
+ r5 = nil
515
+ end
516
+ if r5
517
+ r4 = nil
518
+ else
519
+ @index = i4
520
+ r4 = instantiate_node(SyntaxNode,input, index...index)
521
+ end
522
+ s3 << r4
523
+ if r4
524
+ if index < input_length
525
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
526
+ @index += 1
527
+ else
528
+ terminal_parse_failure("any character")
529
+ r6 = nil
530
+ end
531
+ s3 << r6
532
+ end
533
+ if s3.last
534
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
535
+ r3.extend(Comment0)
536
+ else
537
+ @index = i3
538
+ r3 = nil
539
+ end
540
+ if r3
541
+ s2 << r3
542
+ else
543
+ break
544
+ end
545
+ end
546
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
547
+ s0 << r2
548
+ end
549
+ if s0.last
550
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
551
+ r0.extend(Comment1)
552
+ else
553
+ @index = i0
554
+ r0 = nil
555
+ end
556
+
557
+ node_cache[:comment][start_index] = r0
558
+
559
+ r0
560
+ end
561
+
562
+ module Declaration0
563
+ def barename_csl
564
+ elements[2]
565
+ end
566
+ end
567
+
568
+ module Declaration1
569
+ def declaration; true; end
570
+ def keywords; true;end
571
+ end
572
+
573
+ module Declaration2
574
+ def explicituri
575
+ elements[3]
576
+ end
577
+ end
578
+
579
+ module Declaration3
580
+ def declaration; true; end
581
+ def base; true; end
582
+ end
583
+
584
+ module Declaration4
585
+ def nprefix
586
+ elements[3]
587
+ end
588
+
589
+ def explicituri
590
+ elements[6]
591
+ end
592
+ end
593
+
594
+ module Declaration5
595
+ def declaration; true; end
596
+ end
597
+
598
+ def _nt_declaration
599
+ start_index = index
600
+ if node_cache[:declaration].has_key?(index)
601
+ cached = node_cache[:declaration][index]
602
+ if cached
603
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
604
+ @index = cached.interval.end
605
+ end
606
+ return cached
607
+ end
608
+
609
+ i0 = index
610
+ i1, s1 = index, []
611
+ if has_terminal?("@", false, index)
612
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
613
+ @index += 1
614
+ else
615
+ terminal_parse_failure("@")
616
+ r3 = nil
617
+ end
618
+ if r3
619
+ r2 = r3
620
+ else
621
+ r2 = instantiate_node(SyntaxNode,input, index...index)
622
+ end
623
+ s1 << r2
624
+ if r2
625
+ if has_terminal?('keywords', false, index)
626
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 8))
627
+ @index += 8
628
+ else
629
+ terminal_parse_failure('keywords')
630
+ r4 = nil
631
+ end
632
+ s1 << r4
633
+ if r4
634
+ r5 = _nt_barename_csl
635
+ s1 << r5
636
+ end
637
+ end
638
+ if s1.last
639
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
640
+ r1.extend(Declaration0)
641
+ r1.extend(Declaration1)
642
+ else
643
+ @index = i1
644
+ r1 = nil
645
+ end
646
+ if r1
647
+ r0 = r1
648
+ else
649
+ i6, s6 = index, []
650
+ if has_terminal?("@", false, index)
651
+ r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
652
+ @index += 1
653
+ else
654
+ terminal_parse_failure("@")
655
+ r8 = nil
656
+ end
657
+ if r8
658
+ r7 = r8
659
+ else
660
+ r7 = instantiate_node(SyntaxNode,input, index...index)
661
+ end
662
+ s6 << r7
663
+ if r7
664
+ if has_terminal?('base', false, index)
665
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 4))
666
+ @index += 4
667
+ else
668
+ terminal_parse_failure('base')
669
+ r9 = nil
670
+ end
671
+ s6 << r9
672
+ if r9
673
+ s10, i10 = [], index
674
+ loop do
675
+ r11 = _nt_space
676
+ if r11
677
+ s10 << r11
678
+ else
679
+ break
680
+ end
681
+ end
682
+ if s10.empty?
683
+ @index = i10
684
+ r10 = nil
685
+ else
686
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
687
+ end
688
+ s6 << r10
689
+ if r10
690
+ r12 = _nt_explicituri
691
+ s6 << r12
692
+ end
693
+ end
694
+ end
695
+ if s6.last
696
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
697
+ r6.extend(Declaration2)
698
+ r6.extend(Declaration3)
699
+ else
700
+ @index = i6
701
+ r6 = nil
702
+ end
703
+ if r6
704
+ r0 = r6
705
+ else
706
+ i13, s13 = index, []
707
+ if has_terminal?("@", false, index)
708
+ r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
709
+ @index += 1
710
+ else
711
+ terminal_parse_failure("@")
712
+ r15 = nil
713
+ end
714
+ if r15
715
+ r14 = r15
716
+ else
717
+ r14 = instantiate_node(SyntaxNode,input, index...index)
718
+ end
719
+ s13 << r14
720
+ if r14
721
+ if has_terminal?('prefix', false, index)
722
+ r16 = instantiate_node(SyntaxNode,input, index...(index + 6))
723
+ @index += 6
724
+ else
725
+ terminal_parse_failure('prefix')
726
+ r16 = nil
727
+ end
728
+ s13 << r16
729
+ if r16
730
+ s17, i17 = [], index
731
+ loop do
732
+ r18 = _nt_space
733
+ if r18
734
+ s17 << r18
735
+ else
736
+ break
737
+ end
738
+ end
739
+ if s17.empty?
740
+ @index = i17
741
+ r17 = nil
742
+ else
743
+ r17 = instantiate_node(SyntaxNode,input, i17...index, s17)
744
+ end
745
+ s13 << r17
746
+ if r17
747
+ r20 = _nt_nprefix
748
+ if r20
749
+ r19 = r20
750
+ else
751
+ r19 = instantiate_node(SyntaxNode,input, index...index)
752
+ end
753
+ s13 << r19
754
+ if r19
755
+ if has_terminal?(':', false, index)
756
+ r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
757
+ @index += 1
758
+ else
759
+ terminal_parse_failure(':')
760
+ r21 = nil
761
+ end
762
+ s13 << r21
763
+ if r21
764
+ s22, i22 = [], index
765
+ loop do
766
+ r23 = _nt_space
767
+ if r23
768
+ s22 << r23
769
+ else
770
+ break
771
+ end
772
+ end
773
+ r22 = instantiate_node(SyntaxNode,input, i22...index, s22)
774
+ s13 << r22
775
+ if r22
776
+ r24 = _nt_explicituri
777
+ s13 << r24
778
+ end
779
+ end
780
+ end
781
+ end
782
+ end
783
+ end
784
+ if s13.last
785
+ r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
786
+ r13.extend(Declaration4)
787
+ r13.extend(Declaration5)
788
+ else
789
+ @index = i13
790
+ r13 = nil
791
+ end
792
+ if r13
793
+ r0 = r13
794
+ else
795
+ @index = i0
796
+ r0 = nil
797
+ end
798
+ end
799
+ end
800
+
801
+ node_cache[:declaration][start_index] = r0
802
+
803
+ r0
804
+ end
805
+
806
+ module Decimal0
807
+ def integer
808
+ elements[0]
809
+ end
810
+
811
+ end
812
+
813
+ def _nt_decimal
814
+ start_index = index
815
+ if node_cache[:decimal].has_key?(index)
816
+ cached = node_cache[:decimal][index]
817
+ if cached
818
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
819
+ @index = cached.interval.end
820
+ end
821
+ return cached
822
+ end
823
+
824
+ i0, s0 = index, []
825
+ r1 = _nt_integer
826
+ s0 << r1
827
+ if r1
828
+ if has_terminal?('.', false, index)
829
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
830
+ @index += 1
831
+ else
832
+ terminal_parse_failure('.')
833
+ r2 = nil
834
+ end
835
+ s0 << r2
836
+ if r2
837
+ s3, i3 = [], index
838
+ loop do
839
+ if has_terminal?('\G[0-9]', true, index)
840
+ r4 = true
841
+ @index += 1
842
+ else
843
+ r4 = nil
844
+ end
845
+ if r4
846
+ s3 << r4
847
+ else
848
+ break
849
+ end
850
+ end
851
+ if s3.empty?
852
+ @index = i3
853
+ r3 = nil
854
+ else
855
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
856
+ end
857
+ s0 << r3
858
+ end
859
+ end
860
+ if s0.last
861
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
862
+ r0.extend(Decimal0)
863
+ else
864
+ @index = i0
865
+ r0 = nil
866
+ end
867
+
868
+ node_cache[:decimal][start_index] = r0
869
+
870
+ r0
871
+ end
872
+
873
+ module Double0
874
+ def decimal
875
+ elements[0]
876
+ end
877
+
878
+ def integer
879
+ elements[2]
880
+ end
881
+ end
882
+
883
+ def _nt_double
884
+ start_index = index
885
+ if node_cache[:double].has_key?(index)
886
+ cached = node_cache[:double][index]
887
+ if cached
888
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
889
+ @index = cached.interval.end
890
+ end
891
+ return cached
892
+ end
893
+
894
+ i0, s0 = index, []
895
+ r1 = _nt_decimal
896
+ s0 << r1
897
+ if r1
898
+ if has_terminal?('\G[eE]', true, index)
899
+ r2 = true
900
+ @index += 1
901
+ else
902
+ r2 = nil
903
+ end
904
+ s0 << r2
905
+ if r2
906
+ r3 = _nt_integer
907
+ s0 << r3
908
+ end
909
+ end
910
+ if s0.last
911
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
912
+ r0.extend(Double0)
913
+ else
914
+ @index = i0
915
+ r0 = nil
916
+ end
917
+
918
+ node_cache[:double][start_index] = r0
919
+
920
+ r0
921
+ end
922
+
923
+ module Existential0
924
+ def symbol_csl
925
+ elements[3]
926
+ end
927
+ end
928
+
929
+ def _nt_existential
930
+ start_index = index
931
+ if node_cache[:existential].has_key?(index)
932
+ cached = node_cache[:existential][index]
933
+ if cached
934
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
935
+ @index = cached.interval.end
936
+ end
937
+ return cached
938
+ end
939
+
940
+ i0, s0 = index, []
941
+ if has_terminal?("@", false, index)
942
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
943
+ @index += 1
944
+ else
945
+ terminal_parse_failure("@")
946
+ r2 = nil
947
+ end
948
+ if r2
949
+ r1 = r2
950
+ else
951
+ r1 = instantiate_node(SyntaxNode,input, index...index)
952
+ end
953
+ s0 << r1
954
+ if r1
955
+ if has_terminal?("forSome", false, index)
956
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 7))
957
+ @index += 7
958
+ else
959
+ terminal_parse_failure("forSome")
960
+ r3 = nil
961
+ end
962
+ s0 << r3
963
+ if r3
964
+ s4, i4 = [], index
965
+ loop do
966
+ r5 = _nt_space
967
+ if r5
968
+ s4 << r5
969
+ else
970
+ break
971
+ end
972
+ end
973
+ if s4.empty?
974
+ @index = i4
975
+ r4 = nil
976
+ else
977
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
978
+ end
979
+ s0 << r4
980
+ if r4
981
+ r6 = _nt_symbol_csl
982
+ s0 << r6
983
+ end
984
+ end
985
+ end
986
+ if s0.last
987
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
988
+ r0.extend(Existential0)
989
+ else
990
+ @index = i0
991
+ r0 = nil
992
+ end
993
+
994
+ node_cache[:existential][start_index] = r0
995
+
996
+ r0
997
+ end
998
+
999
+ module Explicituri0
1000
+ def uri
1001
+ elements[1]
1002
+ end
1003
+
1004
+ end
1005
+
1006
+ def _nt_explicituri
1007
+ start_index = index
1008
+ if node_cache[:explicituri].has_key?(index)
1009
+ cached = node_cache[:explicituri][index]
1010
+ if cached
1011
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1012
+ @index = cached.interval.end
1013
+ end
1014
+ return cached
1015
+ end
1016
+
1017
+ i0, s0 = index, []
1018
+ if has_terminal?("<", false, index)
1019
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
1020
+ @index += 1
1021
+ else
1022
+ terminal_parse_failure("<")
1023
+ r1 = nil
1024
+ end
1025
+ s0 << r1
1026
+ if r1
1027
+ r2 = _nt_URI_Reference
1028
+ s0 << r2
1029
+ if r2
1030
+ if has_terminal?(">", false, index)
1031
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
1032
+ @index += 1
1033
+ else
1034
+ terminal_parse_failure(">")
1035
+ r3 = nil
1036
+ end
1037
+ s0 << r3
1038
+ end
1039
+ end
1040
+ if s0.last
1041
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1042
+ r0.extend(Explicituri0)
1043
+ else
1044
+ @index = i0
1045
+ r0 = nil
1046
+ end
1047
+
1048
+ node_cache[:explicituri][start_index] = r0
1049
+
1050
+ r0
1051
+ end
1052
+
1053
+ module Expression0
1054
+ def pathitem
1055
+ elements[0]
1056
+ end
1057
+
1058
+ def expression
1059
+ elements[3]
1060
+ end
1061
+ end
1062
+
1063
+ module Expression1
1064
+ def pathitem
1065
+ elements[0]
1066
+ end
1067
+
1068
+ def expression
1069
+ elements[4]
1070
+ end
1071
+ end
1072
+
1073
+ module Expression2
1074
+ def pathitem
1075
+ elements[0]
1076
+ end
1077
+
1078
+ def expression
1079
+ elements[4]
1080
+ end
1081
+ end
1082
+
1083
+ module Expression3
1084
+ def reverse; true; end
1085
+ end
1086
+
1087
+ def _nt_expression
1088
+ start_index = index
1089
+ if node_cache[:expression].has_key?(index)
1090
+ cached = node_cache[:expression][index]
1091
+ if cached
1092
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1093
+ @index = cached.interval.end
1094
+ end
1095
+ return cached
1096
+ end
1097
+
1098
+ i0 = index
1099
+ i1, s1 = index, []
1100
+ r2 = _nt_pathitem
1101
+ s1 << r2
1102
+ if r2
1103
+ s3, i3 = [], index
1104
+ loop do
1105
+ r4 = _nt_space
1106
+ if r4
1107
+ s3 << r4
1108
+ else
1109
+ break
1110
+ end
1111
+ end
1112
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1113
+ s1 << r3
1114
+ if r3
1115
+ if has_terminal?('.', false, index)
1116
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
1117
+ @index += 1
1118
+ else
1119
+ terminal_parse_failure('.')
1120
+ r5 = nil
1121
+ end
1122
+ s1 << r5
1123
+ if r5
1124
+ r6 = _nt_expression
1125
+ s1 << r6
1126
+ end
1127
+ end
1128
+ end
1129
+ if s1.last
1130
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1131
+ r1.extend(Expression0)
1132
+ else
1133
+ @index = i1
1134
+ r1 = nil
1135
+ end
1136
+ if r1
1137
+ r0 = r1
1138
+ else
1139
+ i7, s7 = index, []
1140
+ r8 = _nt_pathitem
1141
+ s7 << r8
1142
+ if r8
1143
+ s9, i9 = [], index
1144
+ loop do
1145
+ r10 = _nt_space
1146
+ if r10
1147
+ s9 << r10
1148
+ else
1149
+ break
1150
+ end
1151
+ end
1152
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
1153
+ s7 << r9
1154
+ if r9
1155
+ if has_terminal?("!", false, index)
1156
+ r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
1157
+ @index += 1
1158
+ else
1159
+ terminal_parse_failure("!")
1160
+ r11 = nil
1161
+ end
1162
+ s7 << r11
1163
+ if r11
1164
+ s12, i12 = [], index
1165
+ loop do
1166
+ r13 = _nt_space
1167
+ if r13
1168
+ s12 << r13
1169
+ else
1170
+ break
1171
+ end
1172
+ end
1173
+ r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
1174
+ s7 << r12
1175
+ if r12
1176
+ r14 = _nt_expression
1177
+ s7 << r14
1178
+ end
1179
+ end
1180
+ end
1181
+ end
1182
+ if s7.last
1183
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
1184
+ r7.extend(Expression1)
1185
+ else
1186
+ @index = i7
1187
+ r7 = nil
1188
+ end
1189
+ if r7
1190
+ r0 = r7
1191
+ else
1192
+ i15, s15 = index, []
1193
+ r16 = _nt_pathitem
1194
+ s15 << r16
1195
+ if r16
1196
+ s17, i17 = [], index
1197
+ loop do
1198
+ r18 = _nt_space
1199
+ if r18
1200
+ s17 << r18
1201
+ else
1202
+ break
1203
+ end
1204
+ end
1205
+ r17 = instantiate_node(SyntaxNode,input, i17...index, s17)
1206
+ s15 << r17
1207
+ if r17
1208
+ if has_terminal?("^", false, index)
1209
+ r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
1210
+ @index += 1
1211
+ else
1212
+ terminal_parse_failure("^")
1213
+ r19 = nil
1214
+ end
1215
+ s15 << r19
1216
+ if r19
1217
+ s20, i20 = [], index
1218
+ loop do
1219
+ r21 = _nt_space
1220
+ if r21
1221
+ s20 << r21
1222
+ else
1223
+ break
1224
+ end
1225
+ end
1226
+ r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
1227
+ s15 << r20
1228
+ if r20
1229
+ r22 = _nt_expression
1230
+ s15 << r22
1231
+ end
1232
+ end
1233
+ end
1234
+ end
1235
+ if s15.last
1236
+ r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
1237
+ r15.extend(Expression2)
1238
+ r15.extend(Expression3)
1239
+ else
1240
+ @index = i15
1241
+ r15 = nil
1242
+ end
1243
+ if r15
1244
+ r0 = r15
1245
+ else
1246
+ r23 = _nt_pathitem
1247
+ if r23
1248
+ r0 = r23
1249
+ else
1250
+ @index = i0
1251
+ r0 = nil
1252
+ end
1253
+ end
1254
+ end
1255
+ end
1256
+
1257
+ node_cache[:expression][start_index] = r0
1258
+
1259
+ r0
1260
+ end
1261
+
1262
+ module Language0
1263
+ end
1264
+
1265
+ module Language1
1266
+ end
1267
+
1268
+ def _nt_language
1269
+ start_index = index
1270
+ if node_cache[:language].has_key?(index)
1271
+ cached = node_cache[:language][index]
1272
+ if cached
1273
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1274
+ @index = cached.interval.end
1275
+ end
1276
+ return cached
1277
+ end
1278
+
1279
+ i0, s0 = index, []
1280
+ s1, i1 = [], index
1281
+ loop do
1282
+ if has_terminal?('\G[a-zA-Z]', true, index)
1283
+ r2 = true
1284
+ @index += 1
1285
+ else
1286
+ r2 = nil
1287
+ end
1288
+ if r2
1289
+ s1 << r2
1290
+ else
1291
+ break
1292
+ end
1293
+ end
1294
+ if s1.empty?
1295
+ @index = i1
1296
+ r1 = nil
1297
+ else
1298
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1299
+ end
1300
+ s0 << r1
1301
+ if r1
1302
+ s3, i3 = [], index
1303
+ loop do
1304
+ i4, s4 = index, []
1305
+ if has_terminal?("-", false, index)
1306
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
1307
+ @index += 1
1308
+ else
1309
+ terminal_parse_failure("-")
1310
+ r5 = nil
1311
+ end
1312
+ s4 << r5
1313
+ if r5
1314
+ s6, i6 = [], index
1315
+ loop do
1316
+ if has_terminal?('\G[a-zA-Z0-9]', true, index)
1317
+ r7 = true
1318
+ @index += 1
1319
+ else
1320
+ r7 = nil
1321
+ end
1322
+ if r7
1323
+ s6 << r7
1324
+ else
1325
+ break
1326
+ end
1327
+ end
1328
+ if s6.empty?
1329
+ @index = i6
1330
+ r6 = nil
1331
+ else
1332
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
1333
+ end
1334
+ s4 << r6
1335
+ end
1336
+ if s4.last
1337
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
1338
+ r4.extend(Language0)
1339
+ else
1340
+ @index = i4
1341
+ r4 = nil
1342
+ end
1343
+ if r4
1344
+ s3 << r4
1345
+ else
1346
+ break
1347
+ end
1348
+ end
1349
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1350
+ s0 << r3
1351
+ end
1352
+ if s0.last
1353
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1354
+ r0.extend(Language1)
1355
+ else
1356
+ @index = i0
1357
+ r0 = nil
1358
+ end
1359
+
1360
+ node_cache[:language][start_index] = r0
1361
+
1362
+ r0
1363
+ end
1364
+
1365
+ module Literal0
1366
+ def symbol
1367
+ elements[1]
1368
+ end
1369
+ end
1370
+
1371
+ module Literal1
1372
+ def language
1373
+ elements[1]
1374
+ end
1375
+ end
1376
+
1377
+ module Literal2
1378
+ end
1379
+
1380
+ def _nt_literal
1381
+ start_index = index
1382
+ if node_cache[:literal].has_key?(index)
1383
+ cached = node_cache[:literal][index]
1384
+ if cached
1385
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1386
+ @index = cached.interval.end
1387
+ end
1388
+ return cached
1389
+ end
1390
+
1391
+ i0, s0 = index, []
1392
+ i1 = index
1393
+ r2 = _nt_string_single
1394
+ if r2
1395
+ r1 = r2
1396
+ else
1397
+ r3 = _nt_string_multi
1398
+ if r3
1399
+ r1 = r3
1400
+ else
1401
+ @index = i1
1402
+ r1 = nil
1403
+ end
1404
+ end
1405
+ s0 << r1
1406
+ if r1
1407
+ i5 = index
1408
+ i6, s6 = index, []
1409
+ if has_terminal?("^^", false, index)
1410
+ r7 = instantiate_node(SyntaxNode,input, index...(index + 2))
1411
+ @index += 2
1412
+ else
1413
+ terminal_parse_failure("^^")
1414
+ r7 = nil
1415
+ end
1416
+ s6 << r7
1417
+ if r7
1418
+ r8 = _nt_symbol
1419
+ s6 << r8
1420
+ end
1421
+ if s6.last
1422
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
1423
+ r6.extend(Literal0)
1424
+ else
1425
+ @index = i6
1426
+ r6 = nil
1427
+ end
1428
+ if r6
1429
+ r5 = r6
1430
+ else
1431
+ i9, s9 = index, []
1432
+ if has_terminal?("@", false, index)
1433
+ r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
1434
+ @index += 1
1435
+ else
1436
+ terminal_parse_failure("@")
1437
+ r10 = nil
1438
+ end
1439
+ s9 << r10
1440
+ if r10
1441
+ r11 = _nt_language
1442
+ s9 << r11
1443
+ end
1444
+ if s9.last
1445
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
1446
+ r9.extend(Literal1)
1447
+ else
1448
+ @index = i9
1449
+ r9 = nil
1450
+ end
1451
+ if r9
1452
+ r5 = r9
1453
+ else
1454
+ @index = i5
1455
+ r5 = nil
1456
+ end
1457
+ end
1458
+ if r5
1459
+ r4 = r5
1460
+ else
1461
+ r4 = instantiate_node(SyntaxNode,input, index...index)
1462
+ end
1463
+ s0 << r4
1464
+ end
1465
+ if s0.last
1466
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1467
+ r0.extend(Literal2)
1468
+ else
1469
+ @index = i0
1470
+ r0 = nil
1471
+ end
1472
+
1473
+ node_cache[:literal][start_index] = r0
1474
+
1475
+ r0
1476
+ end
1477
+
1478
+ def _nt_localname
1479
+ start_index = index
1480
+ if node_cache[:localname].has_key?(index)
1481
+ cached = node_cache[:localname][index]
1482
+ if cached
1483
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1484
+ @index = cached.interval.end
1485
+ end
1486
+ return cached
1487
+ end
1488
+
1489
+ r0 = _nt_barename
1490
+
1491
+ node_cache[:localname][start_index] = r0
1492
+
1493
+ r0
1494
+ end
1495
+
1496
+ def _nt_nprefix
1497
+ start_index = index
1498
+ if node_cache[:nprefix].has_key?(index)
1499
+ cached = node_cache[:nprefix][index]
1500
+ if cached
1501
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1502
+ @index = cached.interval.end
1503
+ end
1504
+ return cached
1505
+ end
1506
+
1507
+ r0 = _nt_barename
1508
+
1509
+ node_cache[:nprefix][start_index] = r0
1510
+
1511
+ r0
1512
+ end
1513
+
1514
+ module Numericliteral0
1515
+ def numericliteral; "double"; end
1516
+ end
1517
+
1518
+ module Numericliteral1
1519
+ def numericliteral; "decimal"; end
1520
+ end
1521
+
1522
+ module Numericliteral2
1523
+ def numericliteral; "integer"; end
1524
+ end
1525
+
1526
+ def _nt_numericliteral
1527
+ start_index = index
1528
+ if node_cache[:numericliteral].has_key?(index)
1529
+ cached = node_cache[:numericliteral][index]
1530
+ if cached
1531
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1532
+ @index = cached.interval.end
1533
+ end
1534
+ return cached
1535
+ end
1536
+
1537
+ i0 = index
1538
+ r1 = _nt_double
1539
+ r1.extend(Numericliteral0)
1540
+ if r1
1541
+ r0 = r1
1542
+ else
1543
+ r2 = _nt_decimal
1544
+ r2.extend(Numericliteral1)
1545
+ if r2
1546
+ r0 = r2
1547
+ else
1548
+ r3 = _nt_integer
1549
+ r3.extend(Numericliteral2)
1550
+ if r3
1551
+ r0 = r3
1552
+ else
1553
+ @index = i0
1554
+ r0 = nil
1555
+ end
1556
+ end
1557
+ end
1558
+
1559
+ node_cache[:numericliteral][start_index] = r0
1560
+
1561
+ r0
1562
+ end
1563
+
1564
+ def _nt_object
1565
+ start_index = index
1566
+ if node_cache[:object].has_key?(index)
1567
+ cached = node_cache[:object][index]
1568
+ if cached
1569
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1570
+ @index = cached.interval.end
1571
+ end
1572
+ return cached
1573
+ end
1574
+
1575
+ r0 = _nt_expression
1576
+
1577
+ node_cache[:object][start_index] = r0
1578
+
1579
+ r0
1580
+ end
1581
+
1582
+ module ObjectList0
1583
+ def object
1584
+ elements[0]
1585
+ end
1586
+
1587
+ def object_list
1588
+ elements[4]
1589
+ end
1590
+ end
1591
+
1592
+ def _nt_object_list
1593
+ start_index = index
1594
+ if node_cache[:object_list].has_key?(index)
1595
+ cached = node_cache[:object_list][index]
1596
+ if cached
1597
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1598
+ @index = cached.interval.end
1599
+ end
1600
+ return cached
1601
+ end
1602
+
1603
+ i0 = index
1604
+ i1, s1 = index, []
1605
+ r2 = _nt_object
1606
+ s1 << r2
1607
+ if r2
1608
+ s3, i3 = [], index
1609
+ loop do
1610
+ r4 = _nt_space
1611
+ if r4
1612
+ s3 << r4
1613
+ else
1614
+ break
1615
+ end
1616
+ end
1617
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1618
+ s1 << r3
1619
+ if r3
1620
+ if has_terminal?(",", false, index)
1621
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
1622
+ @index += 1
1623
+ else
1624
+ terminal_parse_failure(",")
1625
+ r5 = nil
1626
+ end
1627
+ s1 << r5
1628
+ if r5
1629
+ s6, i6 = [], index
1630
+ loop do
1631
+ r7 = _nt_space
1632
+ if r7
1633
+ s6 << r7
1634
+ else
1635
+ break
1636
+ end
1637
+ end
1638
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
1639
+ s1 << r6
1640
+ if r6
1641
+ r8 = _nt_object_list
1642
+ s1 << r8
1643
+ end
1644
+ end
1645
+ end
1646
+ end
1647
+ if s1.last
1648
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1649
+ r1.extend(ObjectList0)
1650
+ else
1651
+ @index = i1
1652
+ r1 = nil
1653
+ end
1654
+ if r1
1655
+ r0 = r1
1656
+ else
1657
+ r9 = _nt_object
1658
+ if r9
1659
+ r0 = r9
1660
+ else
1661
+ @index = i0
1662
+ r0 = nil
1663
+ end
1664
+ end
1665
+
1666
+ node_cache[:object_list][start_index] = r0
1667
+
1668
+ r0
1669
+ end
1670
+
1671
+ module Pathitem0
1672
+ def boolean; true; end
1673
+ end
1674
+
1675
+ module Pathitem1
1676
+ def literal; true; end
1677
+ end
1678
+
1679
+ module Pathitem2
1680
+ end
1681
+
1682
+ module Pathitem3
1683
+ def anonnode; true; end
1684
+ end
1685
+
1686
+ module Pathitem4
1687
+ def property_list
1688
+ elements[2]
1689
+ end
1690
+
1691
+ end
1692
+
1693
+ module Pathitem5
1694
+ def anonnode; true; end
1695
+ end
1696
+
1697
+ module Pathitem6
1698
+ def statements
1699
+ elements[2]
1700
+ end
1701
+
1702
+ end
1703
+
1704
+ module Pathitem7
1705
+ def anonnode; true; end
1706
+ end
1707
+
1708
+ module Pathitem8
1709
+ def path_list
1710
+ elements[2]
1711
+ end
1712
+
1713
+ end
1714
+
1715
+ module Pathitem9
1716
+ def anonnode; true; end
1717
+ end
1718
+
1719
+ def _nt_pathitem
1720
+ start_index = index
1721
+ if node_cache[:pathitem].has_key?(index)
1722
+ cached = node_cache[:pathitem][index]
1723
+ if cached
1724
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1725
+ @index = cached.interval.end
1726
+ end
1727
+ return cached
1728
+ end
1729
+
1730
+ i0 = index
1731
+ r1 = _nt_boolean
1732
+ r1.extend(Pathitem0)
1733
+ if r1
1734
+ r0 = r1
1735
+ else
1736
+ r2 = _nt_literal
1737
+ r2.extend(Pathitem1)
1738
+ if r2
1739
+ r0 = r2
1740
+ else
1741
+ r3 = _nt_numericliteral
1742
+ if r3
1743
+ r0 = r3
1744
+ else
1745
+ r4 = _nt_symbol
1746
+ if r4
1747
+ r0 = r4
1748
+ else
1749
+ i5, s5 = index, []
1750
+ if has_terminal?("[", false, index)
1751
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
1752
+ @index += 1
1753
+ else
1754
+ terminal_parse_failure("[")
1755
+ r6 = nil
1756
+ end
1757
+ s5 << r6
1758
+ if r6
1759
+ s7, i7 = [], index
1760
+ loop do
1761
+ r8 = _nt_space
1762
+ if r8
1763
+ s7 << r8
1764
+ else
1765
+ break
1766
+ end
1767
+ end
1768
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
1769
+ s5 << r7
1770
+ if r7
1771
+ if has_terminal?("]", false, index)
1772
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
1773
+ @index += 1
1774
+ else
1775
+ terminal_parse_failure("]")
1776
+ r9 = nil
1777
+ end
1778
+ s5 << r9
1779
+ end
1780
+ end
1781
+ if s5.last
1782
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1783
+ r5.extend(Pathitem2)
1784
+ r5.extend(Pathitem3)
1785
+ else
1786
+ @index = i5
1787
+ r5 = nil
1788
+ end
1789
+ if r5
1790
+ r0 = r5
1791
+ else
1792
+ i10, s10 = index, []
1793
+ if has_terminal?("[", false, index)
1794
+ r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
1795
+ @index += 1
1796
+ else
1797
+ terminal_parse_failure("[")
1798
+ r11 = nil
1799
+ end
1800
+ s10 << r11
1801
+ if r11
1802
+ s12, i12 = [], index
1803
+ loop do
1804
+ r13 = _nt_space
1805
+ if r13
1806
+ s12 << r13
1807
+ else
1808
+ break
1809
+ end
1810
+ end
1811
+ r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
1812
+ s10 << r12
1813
+ if r12
1814
+ r14 = _nt_property_list
1815
+ s10 << r14
1816
+ if r14
1817
+ s15, i15 = [], index
1818
+ loop do
1819
+ r16 = _nt_space
1820
+ if r16
1821
+ s15 << r16
1822
+ else
1823
+ break
1824
+ end
1825
+ end
1826
+ r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
1827
+ s10 << r15
1828
+ if r15
1829
+ if has_terminal?("]", false, index)
1830
+ r17 = instantiate_node(SyntaxNode,input, index...(index + 1))
1831
+ @index += 1
1832
+ else
1833
+ terminal_parse_failure("]")
1834
+ r17 = nil
1835
+ end
1836
+ s10 << r17
1837
+ end
1838
+ end
1839
+ end
1840
+ end
1841
+ if s10.last
1842
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
1843
+ r10.extend(Pathitem4)
1844
+ r10.extend(Pathitem5)
1845
+ else
1846
+ @index = i10
1847
+ r10 = nil
1848
+ end
1849
+ if r10
1850
+ r0 = r10
1851
+ else
1852
+ i18, s18 = index, []
1853
+ if has_terminal?("{", false, index)
1854
+ r19 = instantiate_node(SyntaxNode,input, index...(index + 1))
1855
+ @index += 1
1856
+ else
1857
+ terminal_parse_failure("{")
1858
+ r19 = nil
1859
+ end
1860
+ s18 << r19
1861
+ if r19
1862
+ s20, i20 = [], index
1863
+ loop do
1864
+ r21 = _nt_space
1865
+ if r21
1866
+ s20 << r21
1867
+ else
1868
+ break
1869
+ end
1870
+ end
1871
+ r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
1872
+ s18 << r20
1873
+ if r20
1874
+ r22 = _nt_statements
1875
+ s18 << r22
1876
+ if r22
1877
+ s23, i23 = [], index
1878
+ loop do
1879
+ r24 = _nt_space
1880
+ if r24
1881
+ s23 << r24
1882
+ else
1883
+ break
1884
+ end
1885
+ end
1886
+ r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
1887
+ s18 << r23
1888
+ if r23
1889
+ if has_terminal?("}", false, index)
1890
+ r25 = instantiate_node(SyntaxNode,input, index...(index + 1))
1891
+ @index += 1
1892
+ else
1893
+ terminal_parse_failure("}")
1894
+ r25 = nil
1895
+ end
1896
+ s18 << r25
1897
+ end
1898
+ end
1899
+ end
1900
+ end
1901
+ if s18.last
1902
+ r18 = instantiate_node(SyntaxNode,input, i18...index, s18)
1903
+ r18.extend(Pathitem6)
1904
+ r18.extend(Pathitem7)
1905
+ else
1906
+ @index = i18
1907
+ r18 = nil
1908
+ end
1909
+ if r18
1910
+ r0 = r18
1911
+ else
1912
+ i26, s26 = index, []
1913
+ if has_terminal?("(", false, index)
1914
+ r27 = instantiate_node(SyntaxNode,input, index...(index + 1))
1915
+ @index += 1
1916
+ else
1917
+ terminal_parse_failure("(")
1918
+ r27 = nil
1919
+ end
1920
+ s26 << r27
1921
+ if r27
1922
+ s28, i28 = [], index
1923
+ loop do
1924
+ r29 = _nt_space
1925
+ if r29
1926
+ s28 << r29
1927
+ else
1928
+ break
1929
+ end
1930
+ end
1931
+ r28 = instantiate_node(SyntaxNode,input, i28...index, s28)
1932
+ s26 << r28
1933
+ if r28
1934
+ r30 = _nt_path_list
1935
+ s26 << r30
1936
+ if r30
1937
+ s31, i31 = [], index
1938
+ loop do
1939
+ r32 = _nt_space
1940
+ if r32
1941
+ s31 << r32
1942
+ else
1943
+ break
1944
+ end
1945
+ end
1946
+ r31 = instantiate_node(SyntaxNode,input, i31...index, s31)
1947
+ s26 << r31
1948
+ if r31
1949
+ if has_terminal?(")", false, index)
1950
+ r33 = instantiate_node(SyntaxNode,input, index...(index + 1))
1951
+ @index += 1
1952
+ else
1953
+ terminal_parse_failure(")")
1954
+ r33 = nil
1955
+ end
1956
+ s26 << r33
1957
+ end
1958
+ end
1959
+ end
1960
+ end
1961
+ if s26.last
1962
+ r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
1963
+ r26.extend(Pathitem8)
1964
+ r26.extend(Pathitem9)
1965
+ else
1966
+ @index = i26
1967
+ r26 = nil
1968
+ end
1969
+ if r26
1970
+ r0 = r26
1971
+ else
1972
+ @index = i0
1973
+ r0 = nil
1974
+ end
1975
+ end
1976
+ end
1977
+ end
1978
+ end
1979
+ end
1980
+ end
1981
+ end
1982
+
1983
+ node_cache[:pathitem][start_index] = r0
1984
+
1985
+ r0
1986
+ end
1987
+
1988
+ module PathList0
1989
+ def expression
1990
+ elements[0]
1991
+ end
1992
+
1993
+ def path_list
1994
+ elements[2]
1995
+ end
1996
+ end
1997
+
1998
+ def _nt_path_list
1999
+ start_index = index
2000
+ if node_cache[:path_list].has_key?(index)
2001
+ cached = node_cache[:path_list][index]
2002
+ if cached
2003
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2004
+ @index = cached.interval.end
2005
+ end
2006
+ return cached
2007
+ end
2008
+
2009
+ i0 = index
2010
+ i1, s1 = index, []
2011
+ r2 = _nt_expression
2012
+ s1 << r2
2013
+ if r2
2014
+ s3, i3 = [], index
2015
+ loop do
2016
+ r4 = _nt_space
2017
+ if r4
2018
+ s3 << r4
2019
+ else
2020
+ break
2021
+ end
2022
+ end
2023
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
2024
+ s1 << r3
2025
+ if r3
2026
+ r5 = _nt_path_list
2027
+ s1 << r5
2028
+ end
2029
+ end
2030
+ if s1.last
2031
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2032
+ r1.extend(PathList0)
2033
+ else
2034
+ @index = i1
2035
+ r1 = nil
2036
+ end
2037
+ if r1
2038
+ r0 = r1
2039
+ else
2040
+ if has_terminal?("", false, index)
2041
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 0))
2042
+ @index += 0
2043
+ else
2044
+ terminal_parse_failure("")
2045
+ r6 = nil
2046
+ end
2047
+ if r6
2048
+ r0 = r6
2049
+ else
2050
+ @index = i0
2051
+ r0 = nil
2052
+ end
2053
+ end
2054
+
2055
+ node_cache[:path_list][start_index] = r0
2056
+
2057
+ r0
2058
+ end
2059
+
2060
+ def _nt_prop
2061
+ start_index = index
2062
+ if node_cache[:prop].has_key?(index)
2063
+ cached = node_cache[:prop][index]
2064
+ if cached
2065
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2066
+ @index = cached.interval.end
2067
+ end
2068
+ return cached
2069
+ end
2070
+
2071
+ r0 = _nt_expression
2072
+
2073
+ node_cache[:prop][start_index] = r0
2074
+
2075
+ r0
2076
+ end
2077
+
2078
+ module PropertyList0
2079
+ def verb
2080
+ elements[0]
2081
+ end
2082
+
2083
+ def object_list
2084
+ elements[2]
2085
+ end
2086
+
2087
+ def property_list
2088
+ elements[6]
2089
+ end
2090
+ end
2091
+
2092
+ module PropertyList1
2093
+ def verb
2094
+ elements[0]
2095
+ end
2096
+
2097
+ def object_list
2098
+ elements[2]
2099
+ end
2100
+
2101
+ end
2102
+
2103
+ module PropertyList2
2104
+ def verb
2105
+ elements[0]
2106
+ end
2107
+
2108
+ end
2109
+
2110
+ module PropertyList3
2111
+ def object_missing; true; end
2112
+ end
2113
+
2114
+ def _nt_property_list
2115
+ start_index = index
2116
+ if node_cache[:property_list].has_key?(index)
2117
+ cached = node_cache[:property_list][index]
2118
+ if cached
2119
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2120
+ @index = cached.interval.end
2121
+ end
2122
+ return cached
2123
+ end
2124
+
2125
+ i0 = index
2126
+ i1, s1 = index, []
2127
+ r2 = _nt_verb
2128
+ s1 << r2
2129
+ if r2
2130
+ s3, i3 = [], index
2131
+ loop do
2132
+ r4 = _nt_space
2133
+ if r4
2134
+ s3 << r4
2135
+ else
2136
+ break
2137
+ end
2138
+ end
2139
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
2140
+ s1 << r3
2141
+ if r3
2142
+ r5 = _nt_object_list
2143
+ s1 << r5
2144
+ if r5
2145
+ s6, i6 = [], index
2146
+ loop do
2147
+ r7 = _nt_space
2148
+ if r7
2149
+ s6 << r7
2150
+ else
2151
+ break
2152
+ end
2153
+ end
2154
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
2155
+ s1 << r6
2156
+ if r6
2157
+ s8, i8 = [], index
2158
+ loop do
2159
+ if has_terminal?(";", false, index)
2160
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
2161
+ @index += 1
2162
+ else
2163
+ terminal_parse_failure(";")
2164
+ r9 = nil
2165
+ end
2166
+ if r9
2167
+ s8 << r9
2168
+ else
2169
+ break
2170
+ end
2171
+ end
2172
+ if s8.empty?
2173
+ @index = i8
2174
+ r8 = nil
2175
+ else
2176
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
2177
+ end
2178
+ s1 << r8
2179
+ if r8
2180
+ s10, i10 = [], index
2181
+ loop do
2182
+ r11 = _nt_space
2183
+ if r11
2184
+ s10 << r11
2185
+ else
2186
+ break
2187
+ end
2188
+ end
2189
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
2190
+ s1 << r10
2191
+ if r10
2192
+ r12 = _nt_property_list
2193
+ s1 << r12
2194
+ end
2195
+ end
2196
+ end
2197
+ end
2198
+ end
2199
+ end
2200
+ if s1.last
2201
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2202
+ r1.extend(PropertyList0)
2203
+ else
2204
+ @index = i1
2205
+ r1 = nil
2206
+ end
2207
+ if r1
2208
+ r0 = r1
2209
+ else
2210
+ i13, s13 = index, []
2211
+ r14 = _nt_verb
2212
+ s13 << r14
2213
+ if r14
2214
+ s15, i15 = [], index
2215
+ loop do
2216
+ r16 = _nt_space
2217
+ if r16
2218
+ s15 << r16
2219
+ else
2220
+ break
2221
+ end
2222
+ end
2223
+ r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
2224
+ s13 << r15
2225
+ if r15
2226
+ r17 = _nt_object_list
2227
+ s13 << r17
2228
+ if r17
2229
+ s18, i18 = [], index
2230
+ loop do
2231
+ r19 = _nt_space
2232
+ if r19
2233
+ s18 << r19
2234
+ else
2235
+ break
2236
+ end
2237
+ end
2238
+ r18 = instantiate_node(SyntaxNode,input, i18...index, s18)
2239
+ s13 << r18
2240
+ if r18
2241
+ s20, i20 = [], index
2242
+ loop do
2243
+ if has_terminal?(";", false, index)
2244
+ r21 = instantiate_node(SyntaxNode,input, index...(index + 1))
2245
+ @index += 1
2246
+ else
2247
+ terminal_parse_failure(";")
2248
+ r21 = nil
2249
+ end
2250
+ if r21
2251
+ s20 << r21
2252
+ else
2253
+ break
2254
+ end
2255
+ end
2256
+ r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
2257
+ s13 << r20
2258
+ end
2259
+ end
2260
+ end
2261
+ end
2262
+ if s13.last
2263
+ r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
2264
+ r13.extend(PropertyList1)
2265
+ else
2266
+ @index = i13
2267
+ r13 = nil
2268
+ end
2269
+ if r13
2270
+ r0 = r13
2271
+ else
2272
+ i22, s22 = index, []
2273
+ r23 = _nt_verb
2274
+ s22 << r23
2275
+ if r23
2276
+ s24, i24 = [], index
2277
+ loop do
2278
+ r25 = _nt_space
2279
+ if r25
2280
+ s24 << r25
2281
+ else
2282
+ break
2283
+ end
2284
+ end
2285
+ r24 = instantiate_node(SyntaxNode,input, i24...index, s24)
2286
+ s22 << r24
2287
+ if r24
2288
+ s26, i26 = [], index
2289
+ loop do
2290
+ if has_terminal?(";", false, index)
2291
+ r27 = instantiate_node(SyntaxNode,input, index...(index + 1))
2292
+ @index += 1
2293
+ else
2294
+ terminal_parse_failure(";")
2295
+ r27 = nil
2296
+ end
2297
+ if r27
2298
+ s26 << r27
2299
+ else
2300
+ break
2301
+ end
2302
+ end
2303
+ r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
2304
+ s22 << r26
2305
+ end
2306
+ end
2307
+ if s22.last
2308
+ r22 = instantiate_node(SyntaxNode,input, i22...index, s22)
2309
+ r22.extend(PropertyList2)
2310
+ r22.extend(PropertyList3)
2311
+ else
2312
+ @index = i22
2313
+ r22 = nil
2314
+ end
2315
+ if r22
2316
+ r0 = r22
2317
+ else
2318
+ if has_terminal?("", false, index)
2319
+ r28 = instantiate_node(SyntaxNode,input, index...(index + 0))
2320
+ @index += 0
2321
+ else
2322
+ terminal_parse_failure("")
2323
+ r28 = nil
2324
+ end
2325
+ if r28
2326
+ r0 = r28
2327
+ else
2328
+ @index = i0
2329
+ r0 = nil
2330
+ end
2331
+ end
2332
+ end
2333
+ end
2334
+
2335
+ node_cache[:property_list][start_index] = r0
2336
+
2337
+ r0
2338
+ end
2339
+
2340
+ module Qname0
2341
+ def nprefix
2342
+ elements[0]
2343
+ end
2344
+
2345
+ def localname
2346
+ elements[2]
2347
+ end
2348
+ end
2349
+
2350
+ module Qname1
2351
+ def nprefix
2352
+ elements[0]
2353
+ end
2354
+
2355
+ end
2356
+
2357
+ module Qname2
2358
+ def text_value; ""; end
2359
+ end
2360
+
2361
+ module Qname3
2362
+ end
2363
+
2364
+ module Qname4
2365
+ def barename; true; end
2366
+ end
2367
+
2368
+ def _nt_qname
2369
+ start_index = index
2370
+ if node_cache[:qname].has_key?(index)
2371
+ cached = node_cache[:qname][index]
2372
+ if cached
2373
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2374
+ @index = cached.interval.end
2375
+ end
2376
+ return cached
2377
+ end
2378
+
2379
+ i0 = index
2380
+ i1, s1 = index, []
2381
+ r2 = _nt_nprefix
2382
+ s1 << r2
2383
+ if r2
2384
+ if has_terminal?(":", false, index)
2385
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
2386
+ @index += 1
2387
+ else
2388
+ terminal_parse_failure(":")
2389
+ r3 = nil
2390
+ end
2391
+ s1 << r3
2392
+ if r3
2393
+ r4 = _nt_localname
2394
+ s1 << r4
2395
+ end
2396
+ end
2397
+ if s1.last
2398
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2399
+ r1.extend(Qname0)
2400
+ else
2401
+ @index = i1
2402
+ r1 = nil
2403
+ end
2404
+ if r1
2405
+ r0 = r1
2406
+ else
2407
+ i5, s5 = index, []
2408
+ r6 = _nt_nprefix
2409
+ s5 << r6
2410
+ if r6
2411
+ if has_terminal?(':', false, index)
2412
+ r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
2413
+ @index += 1
2414
+ else
2415
+ terminal_parse_failure(':')
2416
+ r7 = nil
2417
+ end
2418
+ s5 << r7
2419
+ end
2420
+ if s5.last
2421
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
2422
+ r5.extend(Qname1)
2423
+ r5.extend(Qname2)
2424
+ else
2425
+ @index = i5
2426
+ r5 = nil
2427
+ end
2428
+ if r5
2429
+ r0 = r5
2430
+ else
2431
+ i8, s8 = index, []
2432
+ if has_terminal?(':', false, index)
2433
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
2434
+ @index += 1
2435
+ else
2436
+ terminal_parse_failure(':')
2437
+ r9 = nil
2438
+ end
2439
+ s8 << r9
2440
+ if r9
2441
+ s10, i10 = [], index
2442
+ loop do
2443
+ r11 = _nt_localname
2444
+ if r11
2445
+ s10 << r11
2446
+ else
2447
+ break
2448
+ end
2449
+ end
2450
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
2451
+ s8 << r10
2452
+ end
2453
+ if s8.last
2454
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
2455
+ r8.extend(Qname3)
2456
+ else
2457
+ @index = i8
2458
+ r8 = nil
2459
+ end
2460
+ if r8
2461
+ r0 = r8
2462
+ else
2463
+ r12 = _nt_localname
2464
+ r12.extend(Qname4)
2465
+ if r12
2466
+ r0 = r12
2467
+ else
2468
+ @index = i0
2469
+ r0 = nil
2470
+ end
2471
+ end
2472
+ end
2473
+ end
2474
+
2475
+ node_cache[:qname][start_index] = r0
2476
+
2477
+ r0
2478
+ end
2479
+
2480
+ module SimpleStatement0
2481
+ def subject
2482
+ elements[0]
2483
+ end
2484
+
2485
+ def property_list
2486
+ elements[2]
2487
+ end
2488
+ end
2489
+
2490
+ def _nt_simpleStatement
2491
+ start_index = index
2492
+ if node_cache[:simpleStatement].has_key?(index)
2493
+ cached = node_cache[:simpleStatement][index]
2494
+ if cached
2495
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2496
+ @index = cached.interval.end
2497
+ end
2498
+ return cached
2499
+ end
2500
+
2501
+ i0 = index
2502
+ i1, s1 = index, []
2503
+ r2 = _nt_subject
2504
+ s1 << r2
2505
+ if r2
2506
+ s3, i3 = [], index
2507
+ loop do
2508
+ r4 = _nt_space
2509
+ if r4
2510
+ s3 << r4
2511
+ else
2512
+ break
2513
+ end
2514
+ end
2515
+ if s3.empty?
2516
+ @index = i3
2517
+ r3 = nil
2518
+ else
2519
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
2520
+ end
2521
+ s1 << r3
2522
+ if r3
2523
+ r5 = _nt_property_list
2524
+ s1 << r5
2525
+ end
2526
+ end
2527
+ if s1.last
2528
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2529
+ r1.extend(SimpleStatement0)
2530
+ else
2531
+ @index = i1
2532
+ r1 = nil
2533
+ end
2534
+ if r1
2535
+ r0 = r1
2536
+ else
2537
+ r6 = _nt_subject
2538
+ if r6
2539
+ r0 = r6
2540
+ else
2541
+ @index = i0
2542
+ r0 = nil
2543
+ end
2544
+ end
2545
+
2546
+ node_cache[:simpleStatement][start_index] = r0
2547
+
2548
+ r0
2549
+ end
2550
+
2551
+ def _nt_space
2552
+ start_index = index
2553
+ if node_cache[:space].has_key?(index)
2554
+ cached = node_cache[:space][index]
2555
+ if cached
2556
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2557
+ @index = cached.interval.end
2558
+ end
2559
+ return cached
2560
+ end
2561
+
2562
+ i0 = index
2563
+ s1, i1 = [], index
2564
+ loop do
2565
+ if has_terminal?('\G[ \\t\\n\\r]', true, index)
2566
+ r2 = true
2567
+ @index += 1
2568
+ else
2569
+ r2 = nil
2570
+ end
2571
+ if r2
2572
+ s1 << r2
2573
+ else
2574
+ break
2575
+ end
2576
+ end
2577
+ if s1.empty?
2578
+ @index = i1
2579
+ r1 = nil
2580
+ else
2581
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2582
+ end
2583
+ if r1
2584
+ r0 = r1
2585
+ else
2586
+ r3 = _nt_comment
2587
+ if r3
2588
+ r0 = r3
2589
+ else
2590
+ @index = i0
2591
+ r0 = nil
2592
+ end
2593
+ end
2594
+
2595
+ node_cache[:space][start_index] = r0
2596
+
2597
+ r0
2598
+ end
2599
+
2600
+ def _nt_statement
2601
+ start_index = index
2602
+ if node_cache[:statement].has_key?(index)
2603
+ cached = node_cache[:statement][index]
2604
+ if cached
2605
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2606
+ @index = cached.interval.end
2607
+ end
2608
+ return cached
2609
+ end
2610
+
2611
+ i0 = index
2612
+ r1 = _nt_declaration
2613
+ if r1
2614
+ r0 = r1
2615
+ else
2616
+ r2 = _nt_existential
2617
+ if r2
2618
+ r0 = r2
2619
+ else
2620
+ r3 = _nt_simpleStatement
2621
+ if r3
2622
+ r0 = r3
2623
+ else
2624
+ r4 = _nt_universal
2625
+ if r4
2626
+ r0 = r4
2627
+ else
2628
+ @index = i0
2629
+ r0 = nil
2630
+ end
2631
+ end
2632
+ end
2633
+ end
2634
+
2635
+ node_cache[:statement][start_index] = r0
2636
+
2637
+ r0
2638
+ end
2639
+
2640
+ module Statements0
2641
+ end
2642
+
2643
+ module Statements1
2644
+ def statement
2645
+ elements[0]
2646
+ end
2647
+
2648
+ end
2649
+
2650
+ def _nt_statements
2651
+ start_index = index
2652
+ if node_cache[:statements].has_key?(index)
2653
+ cached = node_cache[:statements][index]
2654
+ if cached
2655
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2656
+ @index = cached.interval.end
2657
+ end
2658
+ return cached
2659
+ end
2660
+
2661
+ s0, i0 = [], index
2662
+ loop do
2663
+ i1 = index
2664
+ r2 = _nt_space
2665
+ if r2
2666
+ r1 = r2
2667
+ else
2668
+ i3, s3 = index, []
2669
+ r4 = _nt_statement
2670
+ s3 << r4
2671
+ if r4
2672
+ s5, i5 = [], index
2673
+ loop do
2674
+ r6 = _nt_space
2675
+ if r6
2676
+ s5 << r6
2677
+ else
2678
+ break
2679
+ end
2680
+ end
2681
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
2682
+ s3 << r5
2683
+ if r5
2684
+ i8, s8 = index, []
2685
+ if has_terminal?('.', false, index)
2686
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
2687
+ @index += 1
2688
+ else
2689
+ terminal_parse_failure('.')
2690
+ r9 = nil
2691
+ end
2692
+ s8 << r9
2693
+ if r9
2694
+ s10, i10 = [], index
2695
+ loop do
2696
+ r11 = _nt_space
2697
+ if r11
2698
+ s10 << r11
2699
+ else
2700
+ break
2701
+ end
2702
+ end
2703
+ r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
2704
+ s8 << r10
2705
+ end
2706
+ if s8.last
2707
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
2708
+ r8.extend(Statements0)
2709
+ else
2710
+ @index = i8
2711
+ r8 = nil
2712
+ end
2713
+ if r8
2714
+ r7 = r8
2715
+ else
2716
+ r7 = instantiate_node(SyntaxNode,input, index...index)
2717
+ end
2718
+ s3 << r7
2719
+ end
2720
+ end
2721
+ if s3.last
2722
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
2723
+ r3.extend(Statements1)
2724
+ else
2725
+ @index = i3
2726
+ r3 = nil
2727
+ end
2728
+ if r3
2729
+ r1 = r3
2730
+ else
2731
+ @index = i1
2732
+ r1 = nil
2733
+ end
2734
+ end
2735
+ if r1
2736
+ s0 << r1
2737
+ else
2738
+ break
2739
+ end
2740
+ end
2741
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
2742
+
2743
+ node_cache[:statements][start_index] = r0
2744
+
2745
+ r0
2746
+ end
2747
+
2748
+ module StringSingle0
2749
+ end
2750
+
2751
+ module StringSingle1
2752
+ end
2753
+
2754
+ def _nt_string_single
2755
+ start_index = index
2756
+ if node_cache[:string_single].has_key?(index)
2757
+ cached = node_cache[:string_single][index]
2758
+ if cached
2759
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2760
+ @index = cached.interval.end
2761
+ end
2762
+ return cached
2763
+ end
2764
+
2765
+ i0 = index
2766
+ i1, s1 = index, []
2767
+ if has_terminal?('""', false, index)
2768
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 2))
2769
+ @index += 2
2770
+ else
2771
+ terminal_parse_failure('""')
2772
+ r2 = nil
2773
+ end
2774
+ s1 << r2
2775
+ if r2
2776
+ i3 = index
2777
+ if has_terminal?('\G["]', true, index)
2778
+ r4 = true
2779
+ @index += 1
2780
+ else
2781
+ r4 = nil
2782
+ end
2783
+ if r4
2784
+ r3 = nil
2785
+ else
2786
+ @index = i3
2787
+ r3 = instantiate_node(SyntaxNode,input, index...index)
2788
+ end
2789
+ s1 << r3
2790
+ end
2791
+ if s1.last
2792
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
2793
+ r1.extend(StringSingle0)
2794
+ else
2795
+ @index = i1
2796
+ r1 = nil
2797
+ end
2798
+ if r1
2799
+ r0 = r1
2800
+ else
2801
+ i5, s5 = index, []
2802
+ if has_terminal?('"', false, index)
2803
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
2804
+ @index += 1
2805
+ else
2806
+ terminal_parse_failure('"')
2807
+ r6 = nil
2808
+ end
2809
+ s5 << r6
2810
+ if r6
2811
+ s7, i7 = [], index
2812
+ loop do
2813
+ r8 = _nt_string_single_char
2814
+ if r8
2815
+ s7 << r8
2816
+ else
2817
+ break
2818
+ end
2819
+ end
2820
+ if s7.empty?
2821
+ @index = i7
2822
+ r7 = nil
2823
+ else
2824
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
2825
+ end
2826
+ s5 << r7
2827
+ if r7
2828
+ if has_terminal?('"', false, index)
2829
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
2830
+ @index += 1
2831
+ else
2832
+ terminal_parse_failure('"')
2833
+ r9 = nil
2834
+ end
2835
+ s5 << r9
2836
+ end
2837
+ end
2838
+ if s5.last
2839
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
2840
+ r5.extend(StringSingle1)
2841
+ else
2842
+ @index = i5
2843
+ r5 = nil
2844
+ end
2845
+ if r5
2846
+ r0 = r5
2847
+ else
2848
+ @index = i0
2849
+ r0 = nil
2850
+ end
2851
+ end
2852
+
2853
+ node_cache[:string_single][start_index] = r0
2854
+
2855
+ r0
2856
+ end
2857
+
2858
+ module StringSingleChar0
2859
+ end
2860
+
2861
+ module StringSingleChar1
2862
+ def hexdigit1
2863
+ elements[1]
2864
+ end
2865
+
2866
+ def hexdigit2
2867
+ elements[2]
2868
+ end
2869
+
2870
+ def hexdigit3
2871
+ elements[3]
2872
+ end
2873
+
2874
+ def hexdigit4
2875
+ elements[4]
2876
+ end
2877
+ end
2878
+
2879
+ module StringSingleChar2
2880
+ def hexdigit1
2881
+ elements[2]
2882
+ end
2883
+
2884
+ def hexdigit2
2885
+ elements[3]
2886
+ end
2887
+
2888
+ def hexdigit3
2889
+ elements[4]
2890
+ end
2891
+
2892
+ def hexdigit4
2893
+ elements[5]
2894
+ end
2895
+
2896
+ def hexdigit5
2897
+ elements[6]
2898
+ end
2899
+
2900
+ def hexdigit6
2901
+ elements[7]
2902
+ end
2903
+ end
2904
+
2905
+ module StringSingleChar3
2906
+ end
2907
+
2908
+ def _nt_string_single_char
2909
+ start_index = index
2910
+ if node_cache[:string_single_char].has_key?(index)
2911
+ cached = node_cache[:string_single_char][index]
2912
+ if cached
2913
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
2914
+ @index = cached.interval.end
2915
+ end
2916
+ return cached
2917
+ end
2918
+
2919
+ i0, s0 = index, []
2920
+ i1 = index
2921
+ if has_terminal?('\G["\\n\\r]', true, index)
2922
+ r2 = true
2923
+ @index += 1
2924
+ else
2925
+ r2 = nil
2926
+ end
2927
+ if r2
2928
+ r1 = nil
2929
+ else
2930
+ @index = i1
2931
+ r1 = instantiate_node(SyntaxNode,input, index...index)
2932
+ end
2933
+ s0 << r1
2934
+ if r1
2935
+ i3 = index
2936
+ i4 = index
2937
+ i5, s5 = index, []
2938
+ if has_terminal?("\\", false, index)
2939
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
2940
+ @index += 1
2941
+ else
2942
+ terminal_parse_failure("\\")
2943
+ r6 = nil
2944
+ end
2945
+ s5 << r6
2946
+ if r6
2947
+ if has_terminal?('\G[\\\\\\"bfnrt]', true, index)
2948
+ r7 = true
2949
+ @index += 1
2950
+ else
2951
+ r7 = nil
2952
+ end
2953
+ s5 << r7
2954
+ end
2955
+ if s5.last
2956
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
2957
+ r5.extend(StringSingleChar0)
2958
+ else
2959
+ @index = i5
2960
+ r5 = nil
2961
+ end
2962
+ if r5
2963
+ r4 = r5
2964
+ else
2965
+ i8, s8 = index, []
2966
+ if has_terminal?("u", false, index)
2967
+ r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
2968
+ @index += 1
2969
+ else
2970
+ terminal_parse_failure("u")
2971
+ r9 = nil
2972
+ end
2973
+ s8 << r9
2974
+ if r9
2975
+ r10 = _nt_hexdigit
2976
+ s8 << r10
2977
+ if r10
2978
+ r11 = _nt_hexdigit
2979
+ s8 << r11
2980
+ if r11
2981
+ r12 = _nt_hexdigit
2982
+ s8 << r12
2983
+ if r12
2984
+ r13 = _nt_hexdigit
2985
+ s8 << r13
2986
+ end
2987
+ end
2988
+ end
2989
+ end
2990
+ if s8.last
2991
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
2992
+ r8.extend(StringSingleChar1)
2993
+ else
2994
+ @index = i8
2995
+ r8 = nil
2996
+ end
2997
+ if r8
2998
+ r4 = r8
2999
+ else
3000
+ i14, s14 = index, []
3001
+ if has_terminal?("U", false, index)
3002
+ r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
3003
+ @index += 1
3004
+ else
3005
+ terminal_parse_failure("U")
3006
+ r15 = nil
3007
+ end
3008
+ s14 << r15
3009
+ if r15
3010
+ if has_terminal?("00", false, index)
3011
+ r16 = instantiate_node(SyntaxNode,input, index...(index + 2))
3012
+ @index += 2
3013
+ else
3014
+ terminal_parse_failure("00")
3015
+ r16 = nil
3016
+ end
3017
+ s14 << r16
3018
+ if r16
3019
+ r17 = _nt_hexdigit
3020
+ s14 << r17
3021
+ if r17
3022
+ r18 = _nt_hexdigit
3023
+ s14 << r18
3024
+ if r18
3025
+ r19 = _nt_hexdigit
3026
+ s14 << r19
3027
+ if r19
3028
+ r20 = _nt_hexdigit
3029
+ s14 << r20
3030
+ if r20
3031
+ r21 = _nt_hexdigit
3032
+ s14 << r21
3033
+ if r21
3034
+ r22 = _nt_hexdigit
3035
+ s14 << r22
3036
+ end
3037
+ end
3038
+ end
3039
+ end
3040
+ end
3041
+ end
3042
+ end
3043
+ if s14.last
3044
+ r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
3045
+ r14.extend(StringSingleChar2)
3046
+ else
3047
+ @index = i14
3048
+ r14 = nil
3049
+ end
3050
+ if r14
3051
+ r4 = r14
3052
+ else
3053
+ @index = i4
3054
+ r4 = nil
3055
+ end
3056
+ end
3057
+ end
3058
+ if r4
3059
+ r3 = r4
3060
+ else
3061
+ if index < input_length
3062
+ r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
3063
+ @index += 1
3064
+ else
3065
+ terminal_parse_failure("any character")
3066
+ r23 = nil
3067
+ end
3068
+ if r23
3069
+ r3 = r23
3070
+ else
3071
+ @index = i3
3072
+ r3 = nil
3073
+ end
3074
+ end
3075
+ s0 << r3
3076
+ end
3077
+ if s0.last
3078
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
3079
+ r0.extend(StringSingleChar3)
3080
+ else
3081
+ @index = i0
3082
+ r0 = nil
3083
+ end
3084
+
3085
+ node_cache[:string_single_char][start_index] = r0
3086
+
3087
+ r0
3088
+ end
3089
+
3090
+ module StringMulti0
3091
+ end
3092
+
3093
+ def _nt_string_multi
3094
+ start_index = index
3095
+ if node_cache[:string_multi].has_key?(index)
3096
+ cached = node_cache[:string_multi][index]
3097
+ if cached
3098
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3099
+ @index = cached.interval.end
3100
+ end
3101
+ return cached
3102
+ end
3103
+
3104
+ i0, s0 = index, []
3105
+ if has_terminal?('"""', false, index)
3106
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
3107
+ @index += 3
3108
+ else
3109
+ terminal_parse_failure('"""')
3110
+ r1 = nil
3111
+ end
3112
+ s0 << r1
3113
+ if r1
3114
+ s2, i2 = [], index
3115
+ loop do
3116
+ r3 = _nt_string_multi_single_char
3117
+ if r3
3118
+ s2 << r3
3119
+ else
3120
+ break
3121
+ end
3122
+ end
3123
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
3124
+ s0 << r2
3125
+ if r2
3126
+ if has_terminal?('"""', false, index)
3127
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 3))
3128
+ @index += 3
3129
+ else
3130
+ terminal_parse_failure('"""')
3131
+ r4 = nil
3132
+ end
3133
+ s0 << r4
3134
+ end
3135
+ end
3136
+ if s0.last
3137
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
3138
+ r0.extend(StringMulti0)
3139
+ else
3140
+ @index = i0
3141
+ r0 = nil
3142
+ end
3143
+
3144
+ node_cache[:string_multi][start_index] = r0
3145
+
3146
+ r0
3147
+ end
3148
+
3149
+ module StringMultiSingleChar0
3150
+ end
3151
+
3152
+ def _nt_string_multi_single_char
3153
+ start_index = index
3154
+ if node_cache[:string_multi_single_char].has_key?(index)
3155
+ cached = node_cache[:string_multi_single_char][index]
3156
+ if cached
3157
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3158
+ @index = cached.interval.end
3159
+ end
3160
+ return cached
3161
+ end
3162
+
3163
+ i0 = index
3164
+ if has_terminal?("\\\"", false, index)
3165
+ r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
3166
+ @index += 2
3167
+ else
3168
+ terminal_parse_failure("\\\"")
3169
+ r1 = nil
3170
+ end
3171
+ if r1
3172
+ r0 = r1
3173
+ else
3174
+ i2, s2 = index, []
3175
+ i3 = index
3176
+ if has_terminal?('"""', false, index)
3177
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 3))
3178
+ @index += 3
3179
+ else
3180
+ terminal_parse_failure('"""')
3181
+ r4 = nil
3182
+ end
3183
+ if r4
3184
+ r3 = nil
3185
+ else
3186
+ @index = i3
3187
+ r3 = instantiate_node(SyntaxNode,input, index...index)
3188
+ end
3189
+ s2 << r3
3190
+ if r3
3191
+ if index < input_length
3192
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
3193
+ @index += 1
3194
+ else
3195
+ terminal_parse_failure("any character")
3196
+ r5 = nil
3197
+ end
3198
+ s2 << r5
3199
+ end
3200
+ if s2.last
3201
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
3202
+ r2.extend(StringMultiSingleChar0)
3203
+ else
3204
+ @index = i2
3205
+ r2 = nil
3206
+ end
3207
+ if r2
3208
+ r0 = r2
3209
+ else
3210
+ @index = i0
3211
+ r0 = nil
3212
+ end
3213
+ end
3214
+
3215
+ node_cache[:string_multi_single_char][start_index] = r0
3216
+
3217
+ r0
3218
+ end
3219
+
3220
+ def _nt_subject
3221
+ start_index = index
3222
+ if node_cache[:subject].has_key?(index)
3223
+ cached = node_cache[:subject][index]
3224
+ if cached
3225
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3226
+ @index = cached.interval.end
3227
+ end
3228
+ return cached
3229
+ end
3230
+
3231
+ r0 = _nt_expression
3232
+
3233
+ node_cache[:subject][start_index] = r0
3234
+
3235
+ r0
3236
+ end
3237
+
3238
+ def _nt_symbol
3239
+ start_index = index
3240
+ if node_cache[:symbol].has_key?(index)
3241
+ cached = node_cache[:symbol][index]
3242
+ if cached
3243
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3244
+ @index = cached.interval.end
3245
+ end
3246
+ return cached
3247
+ end
3248
+
3249
+ i0 = index
3250
+ r1 = _nt_qname
3251
+ if r1
3252
+ r0 = r1
3253
+ else
3254
+ r2 = _nt_explicituri
3255
+ if r2
3256
+ r0 = r2
3257
+ else
3258
+ @index = i0
3259
+ r0 = nil
3260
+ end
3261
+ end
3262
+
3263
+ node_cache[:symbol][start_index] = r0
3264
+
3265
+ r0
3266
+ end
3267
+
3268
+ module SymbolCsl0
3269
+ def symbol
3270
+ elements[0]
3271
+ end
3272
+
3273
+ def symbol_csl
3274
+ elements[4]
3275
+ end
3276
+ end
3277
+
3278
+ def _nt_symbol_csl
3279
+ start_index = index
3280
+ if node_cache[:symbol_csl].has_key?(index)
3281
+ cached = node_cache[:symbol_csl][index]
3282
+ if cached
3283
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3284
+ @index = cached.interval.end
3285
+ end
3286
+ return cached
3287
+ end
3288
+
3289
+ i0 = index
3290
+ i1, s1 = index, []
3291
+ r2 = _nt_symbol
3292
+ s1 << r2
3293
+ if r2
3294
+ s3, i3 = [], index
3295
+ loop do
3296
+ r4 = _nt_space
3297
+ if r4
3298
+ s3 << r4
3299
+ else
3300
+ break
3301
+ end
3302
+ end
3303
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
3304
+ s1 << r3
3305
+ if r3
3306
+ if has_terminal?(",", false, index)
3307
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
3308
+ @index += 1
3309
+ else
3310
+ terminal_parse_failure(",")
3311
+ r5 = nil
3312
+ end
3313
+ s1 << r5
3314
+ if r5
3315
+ s6, i6 = [], index
3316
+ loop do
3317
+ r7 = _nt_space
3318
+ if r7
3319
+ s6 << r7
3320
+ else
3321
+ break
3322
+ end
3323
+ end
3324
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
3325
+ s1 << r6
3326
+ if r6
3327
+ r8 = _nt_symbol_csl
3328
+ s1 << r8
3329
+ end
3330
+ end
3331
+ end
3332
+ end
3333
+ if s1.last
3334
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
3335
+ r1.extend(SymbolCsl0)
3336
+ else
3337
+ @index = i1
3338
+ r1 = nil
3339
+ end
3340
+ if r1
3341
+ r0 = r1
3342
+ else
3343
+ r9 = _nt_symbol
3344
+ if r9
3345
+ r0 = r9
3346
+ else
3347
+ @index = i0
3348
+ r0 = nil
3349
+ end
3350
+ end
3351
+
3352
+ node_cache[:symbol_csl][start_index] = r0
3353
+
3354
+ r0
3355
+ end
3356
+
3357
+ module Verb0
3358
+ def prop
3359
+ elements[3]
3360
+ end
3361
+ end
3362
+
3363
+ module Verb1
3364
+ def prop
3365
+ elements[3]
3366
+ end
3367
+
3368
+ end
3369
+
3370
+ module Verb2
3371
+ # is xxx of
3372
+ def invert; true; end
3373
+ end
3374
+
3375
+ module Verb3
3376
+ end
3377
+
3378
+ module Verb4
3379
+ def invert; true; end
3380
+ end
3381
+
3382
+ def _nt_verb
3383
+ start_index = index
3384
+ if node_cache[:verb].has_key?(index)
3385
+ cached = node_cache[:verb][index]
3386
+ if cached
3387
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3388
+ @index = cached.interval.end
3389
+ end
3390
+ return cached
3391
+ end
3392
+
3393
+ i0 = index
3394
+ i1, s1 = index, []
3395
+ if has_terminal?("@", false, index)
3396
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
3397
+ @index += 1
3398
+ else
3399
+ terminal_parse_failure("@")
3400
+ r3 = nil
3401
+ end
3402
+ if r3
3403
+ r2 = r3
3404
+ else
3405
+ r2 = instantiate_node(SyntaxNode,input, index...index)
3406
+ end
3407
+ s1 << r2
3408
+ if r2
3409
+ if has_terminal?("has", false, index)
3410
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 3))
3411
+ @index += 3
3412
+ else
3413
+ terminal_parse_failure("has")
3414
+ r4 = nil
3415
+ end
3416
+ s1 << r4
3417
+ if r4
3418
+ s5, i5 = [], index
3419
+ loop do
3420
+ r6 = _nt_space
3421
+ if r6
3422
+ s5 << r6
3423
+ else
3424
+ break
3425
+ end
3426
+ end
3427
+ if s5.empty?
3428
+ @index = i5
3429
+ r5 = nil
3430
+ else
3431
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
3432
+ end
3433
+ s1 << r5
3434
+ if r5
3435
+ r7 = _nt_prop
3436
+ s1 << r7
3437
+ end
3438
+ end
3439
+ end
3440
+ if s1.last
3441
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
3442
+ r1.extend(Verb0)
3443
+ else
3444
+ @index = i1
3445
+ r1 = nil
3446
+ end
3447
+ if r1
3448
+ r0 = r1
3449
+ else
3450
+ i8, s8 = index, []
3451
+ if has_terminal?("@", false, index)
3452
+ r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
3453
+ @index += 1
3454
+ else
3455
+ terminal_parse_failure("@")
3456
+ r10 = nil
3457
+ end
3458
+ if r10
3459
+ r9 = r10
3460
+ else
3461
+ r9 = instantiate_node(SyntaxNode,input, index...index)
3462
+ end
3463
+ s8 << r9
3464
+ if r9
3465
+ if has_terminal?("is", false, index)
3466
+ r11 = instantiate_node(SyntaxNode,input, index...(index + 2))
3467
+ @index += 2
3468
+ else
3469
+ terminal_parse_failure("is")
3470
+ r11 = nil
3471
+ end
3472
+ s8 << r11
3473
+ if r11
3474
+ s12, i12 = [], index
3475
+ loop do
3476
+ r13 = _nt_space
3477
+ if r13
3478
+ s12 << r13
3479
+ else
3480
+ break
3481
+ end
3482
+ end
3483
+ if s12.empty?
3484
+ @index = i12
3485
+ r12 = nil
3486
+ else
3487
+ r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
3488
+ end
3489
+ s8 << r12
3490
+ if r12
3491
+ r14 = _nt_prop
3492
+ s8 << r14
3493
+ if r14
3494
+ s15, i15 = [], index
3495
+ loop do
3496
+ r16 = _nt_space
3497
+ if r16
3498
+ s15 << r16
3499
+ else
3500
+ break
3501
+ end
3502
+ end
3503
+ if s15.empty?
3504
+ @index = i15
3505
+ r15 = nil
3506
+ else
3507
+ r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
3508
+ end
3509
+ s8 << r15
3510
+ if r15
3511
+ if has_terminal?("@", false, index)
3512
+ r18 = instantiate_node(SyntaxNode,input, index...(index + 1))
3513
+ @index += 1
3514
+ else
3515
+ terminal_parse_failure("@")
3516
+ r18 = nil
3517
+ end
3518
+ if r18
3519
+ r17 = r18
3520
+ else
3521
+ r17 = instantiate_node(SyntaxNode,input, index...index)
3522
+ end
3523
+ s8 << r17
3524
+ if r17
3525
+ if has_terminal?("of", false, index)
3526
+ r19 = instantiate_node(SyntaxNode,input, index...(index + 2))
3527
+ @index += 2
3528
+ else
3529
+ terminal_parse_failure("of")
3530
+ r19 = nil
3531
+ end
3532
+ s8 << r19
3533
+ end
3534
+ end
3535
+ end
3536
+ end
3537
+ end
3538
+ end
3539
+ if s8.last
3540
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
3541
+ r8.extend(Verb1)
3542
+ r8.extend(Verb2)
3543
+ else
3544
+ @index = i8
3545
+ r8 = nil
3546
+ end
3547
+ if r8
3548
+ r0 = r8
3549
+ else
3550
+ i20, s20 = index, []
3551
+ if has_terminal?("@", false, index)
3552
+ r22 = instantiate_node(SyntaxNode,input, index...(index + 1))
3553
+ @index += 1
3554
+ else
3555
+ terminal_parse_failure("@")
3556
+ r22 = nil
3557
+ end
3558
+ if r22
3559
+ r21 = r22
3560
+ else
3561
+ r21 = instantiate_node(SyntaxNode,input, index...index)
3562
+ end
3563
+ s20 << r21
3564
+ if r21
3565
+ if has_terminal?("a", false, index)
3566
+ r23 = instantiate_node(SyntaxNode,input, index...(index + 1))
3567
+ @index += 1
3568
+ else
3569
+ terminal_parse_failure("a")
3570
+ r23 = nil
3571
+ end
3572
+ s20 << r23
3573
+ if r23
3574
+ i24 = index
3575
+ if has_terminal?(":", false, index)
3576
+ r25 = instantiate_node(SyntaxNode,input, index...(index + 1))
3577
+ @index += 1
3578
+ else
3579
+ terminal_parse_failure(":")
3580
+ r25 = nil
3581
+ end
3582
+ if r25
3583
+ r24 = nil
3584
+ else
3585
+ @index = i24
3586
+ r24 = instantiate_node(SyntaxNode,input, index...index)
3587
+ end
3588
+ s20 << r24
3589
+ end
3590
+ end
3591
+ if s20.last
3592
+ r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
3593
+ r20.extend(Verb3)
3594
+ else
3595
+ @index = i20
3596
+ r20 = nil
3597
+ end
3598
+ if r20
3599
+ r0 = r20
3600
+ else
3601
+ if has_terminal?("=>", false, index)
3602
+ r26 = instantiate_node(SyntaxNode,input, index...(index + 2))
3603
+ @index += 2
3604
+ else
3605
+ terminal_parse_failure("=>")
3606
+ r26 = nil
3607
+ end
3608
+ if r26
3609
+ r0 = r26
3610
+ else
3611
+ if has_terminal?("<=", false, index)
3612
+ r27 = instantiate_node(SyntaxNode,input, index...(index + 2))
3613
+ r27.extend(Verb4)
3614
+ @index += 2
3615
+ else
3616
+ terminal_parse_failure("<=")
3617
+ r27 = nil
3618
+ end
3619
+ if r27
3620
+ r0 = r27
3621
+ else
3622
+ if has_terminal?("=", false, index)
3623
+ r28 = instantiate_node(SyntaxNode,input, index...(index + 1))
3624
+ @index += 1
3625
+ else
3626
+ terminal_parse_failure("=")
3627
+ r28 = nil
3628
+ end
3629
+ if r28
3630
+ r0 = r28
3631
+ else
3632
+ r29 = _nt_prop
3633
+ if r29
3634
+ r0 = r29
3635
+ else
3636
+ @index = i0
3637
+ r0 = nil
3638
+ end
3639
+ end
3640
+ end
3641
+ end
3642
+ end
3643
+ end
3644
+ end
3645
+
3646
+ node_cache[:verb][start_index] = r0
3647
+
3648
+ r0
3649
+ end
3650
+
3651
+ module Universal0
3652
+ def symbol_csl
3653
+ elements[3]
3654
+ end
3655
+ end
3656
+
3657
+ def _nt_universal
3658
+ start_index = index
3659
+ if node_cache[:universal].has_key?(index)
3660
+ cached = node_cache[:universal][index]
3661
+ if cached
3662
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3663
+ @index = cached.interval.end
3664
+ end
3665
+ return cached
3666
+ end
3667
+
3668
+ i0, s0 = index, []
3669
+ if has_terminal?("@", false, index)
3670
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
3671
+ @index += 1
3672
+ else
3673
+ terminal_parse_failure("@")
3674
+ r2 = nil
3675
+ end
3676
+ if r2
3677
+ r1 = r2
3678
+ else
3679
+ r1 = instantiate_node(SyntaxNode,input, index...index)
3680
+ end
3681
+ s0 << r1
3682
+ if r1
3683
+ if has_terminal?("forAll", false, index)
3684
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 6))
3685
+ @index += 6
3686
+ else
3687
+ terminal_parse_failure("forAll")
3688
+ r3 = nil
3689
+ end
3690
+ s0 << r3
3691
+ if r3
3692
+ s4, i4 = [], index
3693
+ loop do
3694
+ r5 = _nt_space
3695
+ if r5
3696
+ s4 << r5
3697
+ else
3698
+ break
3699
+ end
3700
+ end
3701
+ if s4.empty?
3702
+ @index = i4
3703
+ r4 = nil
3704
+ else
3705
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
3706
+ end
3707
+ s0 << r4
3708
+ if r4
3709
+ r6 = _nt_symbol_csl
3710
+ s0 << r6
3711
+ end
3712
+ end
3713
+ end
3714
+ if s0.last
3715
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
3716
+ r0.extend(Universal0)
3717
+ else
3718
+ @index = i0
3719
+ r0 = nil
3720
+ end
3721
+
3722
+ node_cache[:universal][start_index] = r0
3723
+
3724
+ r0
3725
+ end
3726
+
3727
+ def _nt_URI_Reference
3728
+ start_index = index
3729
+ if node_cache[:URI_Reference].has_key?(index)
3730
+ cached = node_cache[:URI_Reference][index]
3731
+ if cached
3732
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
3733
+ @index = cached.interval.end
3734
+ end
3735
+ return cached
3736
+ end
3737
+
3738
+ s0, i0 = [], index
3739
+ loop do
3740
+ if has_terminal?('\G[^{}<>]', true, index)
3741
+ r1 = true
3742
+ @index += 1
3743
+ else
3744
+ r1 = nil
3745
+ end
3746
+ if r1
3747
+ s0 << r1
3748
+ else
3749
+ break
3750
+ end
3751
+ end
3752
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
3753
+
3754
+ node_cache[:URI_Reference][start_index] = r0
3755
+
3756
+ r0
3757
+ end
3758
+
3759
+ end
3760
+
3761
+ class N3GrammerParser < Treetop::Runtime::CompiledParser
3762
+ include N3Grammer
3763
+ end
3764
+