rtor 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ module RTor
2
+ grammar Primitives
3
+ rule Year
4
+ [0-9] [0-9] [0-9] [0-9]
5
+ end
6
+
7
+ rule Month
8
+ [0] [1-9] / [1] [0-2]
9
+ end
10
+
11
+ rule Day
12
+ [0-2] [0-9] / [3] [0-1]
13
+ end
14
+
15
+ rule Hour
16
+ [0] [0-9] / [1] [0-9] / [2] [0-4]
17
+ end
18
+
19
+ rule Minute
20
+ [0] [0-9] / [1-5] [0-9]
21
+ end
22
+
23
+ rule Second
24
+ [0] [0-9] / [1-5] [0-9]
25
+ end
26
+
27
+ rule DateTime
28
+ Year "-" Month "-" Day " " Hour ":" Minute ":" Second
29
+ end
30
+
31
+ rule Base64Char
32
+ [A-Za-z0-9+/]
33
+ end
34
+
35
+ rule Base64Hash
36
+ Base64Char+
37
+ end
38
+
39
+ rule IPv4Byte
40
+ [2] [5] [0-5] / [2] [0-4] [0-9] / [1] [0-9] [0-9] / [1-9] [0-9] / [0-9]
41
+ end
42
+
43
+ rule IPv4Address
44
+ IPv4Byte "." IPv4Byte "." IPv4Byte "." IPv4Byte
45
+ end
46
+
47
+ rule IP
48
+ IPv4Address
49
+ end
50
+
51
+ rule Hostname
52
+ [a-zA-Z\.\-]+ # TODO: Wow this is a garbage production....
53
+ end
54
+
55
+ rule Address
56
+ Hostname / IP
57
+ end
58
+
59
+ rule Port
60
+ [0-9]+
61
+ end
62
+
63
+ rule ORPort
64
+ Port
65
+ end
66
+
67
+ rule SocksPOrt
68
+ [0]
69
+ end
70
+
71
+ rule DirPort
72
+ Port
73
+ end
74
+
75
+ rule SP
76
+ " "
77
+ end
78
+
79
+ rule NL
80
+ "\r\n"
81
+ end
82
+
83
+ rule ALPHA
84
+ [A-Z] / [a-z]
85
+ end
86
+
87
+ rule DIGIT
88
+ [0-9]
89
+ end
90
+
91
+ rule HEXDIG
92
+ DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
93
+ end
94
+
95
+ rule Boolean
96
+ [0] / [1]
97
+ end
98
+
99
+ rule IDChar
100
+ ALPHA / DIGIT
101
+ end
102
+
103
+ rule NicknameChar
104
+ [A-Z] / [a-z] / [0-9]
105
+ end
106
+
107
+ rule Nickname
108
+ NicknameChar 1..19
109
+ end
110
+
111
+ rule Fingerprint
112
+ "$" HEXDIG 40..40 / HEXDIG 40..40
113
+ end
114
+
115
+ rule ServerID
116
+ Nickname / Fingerprint
117
+ end
118
+
119
+ rule LongName
120
+ f:Fingerprint "=" n:Nickname / Fingerprint
121
+ end
122
+
123
+ rule ServerSpec
124
+ LongName / Nickname
125
+ end
126
+
127
+ rule StreamID
128
+ IDChar 1..16
129
+ end
130
+
131
+ rule CircuitID
132
+ IDChar 1..16
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,1784 @@
1
+ # Autogenerated from a Treetop grammar. Edits may be lost.
2
+
3
+
4
+ module RTor
5
+ module Primitives
6
+ include Treetop::Runtime
7
+
8
+ def root
9
+ @root ||= :Year
10
+ end
11
+
12
+ module Year0
13
+ end
14
+
15
+ def _nt_Year
16
+ start_index = index
17
+ if node_cache[:Year].has_key?(index)
18
+ cached = node_cache[:Year][index]
19
+ if cached
20
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
21
+ @index = cached.interval.end
22
+ end
23
+ return cached
24
+ end
25
+
26
+ i0, s0 = index, []
27
+ if has_terminal?('\G[0-9]', true, index)
28
+ r1 = true
29
+ @index += 1
30
+ else
31
+ r1 = nil
32
+ end
33
+ s0 << r1
34
+ if r1
35
+ if has_terminal?('\G[0-9]', true, index)
36
+ r2 = true
37
+ @index += 1
38
+ else
39
+ r2 = nil
40
+ end
41
+ s0 << r2
42
+ if r2
43
+ if has_terminal?('\G[0-9]', true, index)
44
+ r3 = true
45
+ @index += 1
46
+ else
47
+ r3 = nil
48
+ end
49
+ s0 << r3
50
+ if r3
51
+ if has_terminal?('\G[0-9]', true, index)
52
+ r4 = true
53
+ @index += 1
54
+ else
55
+ r4 = nil
56
+ end
57
+ s0 << r4
58
+ end
59
+ end
60
+ end
61
+ if s0.last
62
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
63
+ r0.extend(Year0)
64
+ else
65
+ @index = i0
66
+ r0 = nil
67
+ end
68
+
69
+ node_cache[:Year][start_index] = r0
70
+
71
+ r0
72
+ end
73
+
74
+ module Month0
75
+ end
76
+
77
+ module Month1
78
+ end
79
+
80
+ def _nt_Month
81
+ start_index = index
82
+ if node_cache[:Month].has_key?(index)
83
+ cached = node_cache[:Month][index]
84
+ if cached
85
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
86
+ @index = cached.interval.end
87
+ end
88
+ return cached
89
+ end
90
+
91
+ i0 = index
92
+ i1, s1 = index, []
93
+ if has_terminal?('\G[0]', true, index)
94
+ r2 = true
95
+ @index += 1
96
+ else
97
+ r2 = nil
98
+ end
99
+ s1 << r2
100
+ if r2
101
+ if has_terminal?('\G[1-9]', true, index)
102
+ r3 = true
103
+ @index += 1
104
+ else
105
+ r3 = nil
106
+ end
107
+ s1 << r3
108
+ end
109
+ if s1.last
110
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
111
+ r1.extend(Month0)
112
+ else
113
+ @index = i1
114
+ r1 = nil
115
+ end
116
+ if r1
117
+ r0 = r1
118
+ else
119
+ i4, s4 = index, []
120
+ if has_terminal?('\G[1]', true, index)
121
+ r5 = true
122
+ @index += 1
123
+ else
124
+ r5 = nil
125
+ end
126
+ s4 << r5
127
+ if r5
128
+ if has_terminal?('\G[0-2]', true, index)
129
+ r6 = true
130
+ @index += 1
131
+ else
132
+ r6 = nil
133
+ end
134
+ s4 << r6
135
+ end
136
+ if s4.last
137
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
138
+ r4.extend(Month1)
139
+ else
140
+ @index = i4
141
+ r4 = nil
142
+ end
143
+ if r4
144
+ r0 = r4
145
+ else
146
+ @index = i0
147
+ r0 = nil
148
+ end
149
+ end
150
+
151
+ node_cache[:Month][start_index] = r0
152
+
153
+ r0
154
+ end
155
+
156
+ module Day0
157
+ end
158
+
159
+ module Day1
160
+ end
161
+
162
+ def _nt_Day
163
+ start_index = index
164
+ if node_cache[:Day].has_key?(index)
165
+ cached = node_cache[:Day][index]
166
+ if cached
167
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
168
+ @index = cached.interval.end
169
+ end
170
+ return cached
171
+ end
172
+
173
+ i0 = index
174
+ i1, s1 = index, []
175
+ if has_terminal?('\G[0-2]', true, index)
176
+ r2 = true
177
+ @index += 1
178
+ else
179
+ r2 = nil
180
+ end
181
+ s1 << r2
182
+ if r2
183
+ if has_terminal?('\G[0-9]', true, index)
184
+ r3 = true
185
+ @index += 1
186
+ else
187
+ r3 = nil
188
+ end
189
+ s1 << r3
190
+ end
191
+ if s1.last
192
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
193
+ r1.extend(Day0)
194
+ else
195
+ @index = i1
196
+ r1 = nil
197
+ end
198
+ if r1
199
+ r0 = r1
200
+ else
201
+ i4, s4 = index, []
202
+ if has_terminal?('\G[3]', true, index)
203
+ r5 = true
204
+ @index += 1
205
+ else
206
+ r5 = nil
207
+ end
208
+ s4 << r5
209
+ if r5
210
+ if has_terminal?('\G[0-1]', true, index)
211
+ r6 = true
212
+ @index += 1
213
+ else
214
+ r6 = nil
215
+ end
216
+ s4 << r6
217
+ end
218
+ if s4.last
219
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
220
+ r4.extend(Day1)
221
+ else
222
+ @index = i4
223
+ r4 = nil
224
+ end
225
+ if r4
226
+ r0 = r4
227
+ else
228
+ @index = i0
229
+ r0 = nil
230
+ end
231
+ end
232
+
233
+ node_cache[:Day][start_index] = r0
234
+
235
+ r0
236
+ end
237
+
238
+ module Hour0
239
+ end
240
+
241
+ module Hour1
242
+ end
243
+
244
+ module Hour2
245
+ end
246
+
247
+ def _nt_Hour
248
+ start_index = index
249
+ if node_cache[:Hour].has_key?(index)
250
+ cached = node_cache[:Hour][index]
251
+ if cached
252
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
253
+ @index = cached.interval.end
254
+ end
255
+ return cached
256
+ end
257
+
258
+ i0 = index
259
+ i1, s1 = index, []
260
+ if has_terminal?('\G[0]', true, index)
261
+ r2 = true
262
+ @index += 1
263
+ else
264
+ r2 = nil
265
+ end
266
+ s1 << r2
267
+ if r2
268
+ if has_terminal?('\G[0-9]', true, index)
269
+ r3 = true
270
+ @index += 1
271
+ else
272
+ r3 = nil
273
+ end
274
+ s1 << r3
275
+ end
276
+ if s1.last
277
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
278
+ r1.extend(Hour0)
279
+ else
280
+ @index = i1
281
+ r1 = nil
282
+ end
283
+ if r1
284
+ r0 = r1
285
+ else
286
+ i4, s4 = index, []
287
+ if has_terminal?('\G[1]', true, index)
288
+ r5 = true
289
+ @index += 1
290
+ else
291
+ r5 = nil
292
+ end
293
+ s4 << r5
294
+ if r5
295
+ if has_terminal?('\G[0-9]', true, index)
296
+ r6 = true
297
+ @index += 1
298
+ else
299
+ r6 = nil
300
+ end
301
+ s4 << r6
302
+ end
303
+ if s4.last
304
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
305
+ r4.extend(Hour1)
306
+ else
307
+ @index = i4
308
+ r4 = nil
309
+ end
310
+ if r4
311
+ r0 = r4
312
+ else
313
+ i7, s7 = index, []
314
+ if has_terminal?('\G[2]', true, index)
315
+ r8 = true
316
+ @index += 1
317
+ else
318
+ r8 = nil
319
+ end
320
+ s7 << r8
321
+ if r8
322
+ if has_terminal?('\G[0-4]', true, index)
323
+ r9 = true
324
+ @index += 1
325
+ else
326
+ r9 = nil
327
+ end
328
+ s7 << r9
329
+ end
330
+ if s7.last
331
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
332
+ r7.extend(Hour2)
333
+ else
334
+ @index = i7
335
+ r7 = nil
336
+ end
337
+ if r7
338
+ r0 = r7
339
+ else
340
+ @index = i0
341
+ r0 = nil
342
+ end
343
+ end
344
+ end
345
+
346
+ node_cache[:Hour][start_index] = r0
347
+
348
+ r0
349
+ end
350
+
351
+ module Minute0
352
+ end
353
+
354
+ module Minute1
355
+ end
356
+
357
+ def _nt_Minute
358
+ start_index = index
359
+ if node_cache[:Minute].has_key?(index)
360
+ cached = node_cache[:Minute][index]
361
+ if cached
362
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
363
+ @index = cached.interval.end
364
+ end
365
+ return cached
366
+ end
367
+
368
+ i0 = index
369
+ i1, s1 = index, []
370
+ if has_terminal?('\G[0]', true, index)
371
+ r2 = true
372
+ @index += 1
373
+ else
374
+ r2 = nil
375
+ end
376
+ s1 << r2
377
+ if r2
378
+ if has_terminal?('\G[0-9]', true, index)
379
+ r3 = true
380
+ @index += 1
381
+ else
382
+ r3 = nil
383
+ end
384
+ s1 << r3
385
+ end
386
+ if s1.last
387
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
388
+ r1.extend(Minute0)
389
+ else
390
+ @index = i1
391
+ r1 = nil
392
+ end
393
+ if r1
394
+ r0 = r1
395
+ else
396
+ i4, s4 = index, []
397
+ if has_terminal?('\G[1-5]', true, index)
398
+ r5 = true
399
+ @index += 1
400
+ else
401
+ r5 = nil
402
+ end
403
+ s4 << r5
404
+ if r5
405
+ if has_terminal?('\G[0-9]', true, index)
406
+ r6 = true
407
+ @index += 1
408
+ else
409
+ r6 = nil
410
+ end
411
+ s4 << r6
412
+ end
413
+ if s4.last
414
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
415
+ r4.extend(Minute1)
416
+ else
417
+ @index = i4
418
+ r4 = nil
419
+ end
420
+ if r4
421
+ r0 = r4
422
+ else
423
+ @index = i0
424
+ r0 = nil
425
+ end
426
+ end
427
+
428
+ node_cache[:Minute][start_index] = r0
429
+
430
+ r0
431
+ end
432
+
433
+ module Second0
434
+ end
435
+
436
+ module Second1
437
+ end
438
+
439
+ def _nt_Second
440
+ start_index = index
441
+ if node_cache[:Second].has_key?(index)
442
+ cached = node_cache[:Second][index]
443
+ if cached
444
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
445
+ @index = cached.interval.end
446
+ end
447
+ return cached
448
+ end
449
+
450
+ i0 = index
451
+ i1, s1 = index, []
452
+ if has_terminal?('\G[0]', true, index)
453
+ r2 = true
454
+ @index += 1
455
+ else
456
+ r2 = nil
457
+ end
458
+ s1 << r2
459
+ if r2
460
+ if has_terminal?('\G[0-9]', true, index)
461
+ r3 = true
462
+ @index += 1
463
+ else
464
+ r3 = nil
465
+ end
466
+ s1 << r3
467
+ end
468
+ if s1.last
469
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
470
+ r1.extend(Second0)
471
+ else
472
+ @index = i1
473
+ r1 = nil
474
+ end
475
+ if r1
476
+ r0 = r1
477
+ else
478
+ i4, s4 = index, []
479
+ if has_terminal?('\G[1-5]', true, index)
480
+ r5 = true
481
+ @index += 1
482
+ else
483
+ r5 = nil
484
+ end
485
+ s4 << r5
486
+ if r5
487
+ if has_terminal?('\G[0-9]', true, index)
488
+ r6 = true
489
+ @index += 1
490
+ else
491
+ r6 = nil
492
+ end
493
+ s4 << r6
494
+ end
495
+ if s4.last
496
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
497
+ r4.extend(Second1)
498
+ else
499
+ @index = i4
500
+ r4 = nil
501
+ end
502
+ if r4
503
+ r0 = r4
504
+ else
505
+ @index = i0
506
+ r0 = nil
507
+ end
508
+ end
509
+
510
+ node_cache[:Second][start_index] = r0
511
+
512
+ r0
513
+ end
514
+
515
+ module DateTime0
516
+ def Year
517
+ elements[0]
518
+ end
519
+
520
+ def Month
521
+ elements[2]
522
+ end
523
+
524
+ def Day
525
+ elements[4]
526
+ end
527
+
528
+ def Hour
529
+ elements[6]
530
+ end
531
+
532
+ def Minute
533
+ elements[8]
534
+ end
535
+
536
+ def Second
537
+ elements[10]
538
+ end
539
+ end
540
+
541
+ def _nt_DateTime
542
+ start_index = index
543
+ if node_cache[:DateTime].has_key?(index)
544
+ cached = node_cache[:DateTime][index]
545
+ if cached
546
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
547
+ @index = cached.interval.end
548
+ end
549
+ return cached
550
+ end
551
+
552
+ i0, s0 = index, []
553
+ r1 = _nt_Year
554
+ s0 << r1
555
+ if r1
556
+ if has_terminal?("-", false, index)
557
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
558
+ @index += 1
559
+ else
560
+ terminal_parse_failure("-")
561
+ r2 = nil
562
+ end
563
+ s0 << r2
564
+ if r2
565
+ r3 = _nt_Month
566
+ s0 << r3
567
+ if r3
568
+ if has_terminal?("-", false, index)
569
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
570
+ @index += 1
571
+ else
572
+ terminal_parse_failure("-")
573
+ r4 = nil
574
+ end
575
+ s0 << r4
576
+ if r4
577
+ r5 = _nt_Day
578
+ s0 << r5
579
+ if r5
580
+ if has_terminal?(" ", false, index)
581
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
582
+ @index += 1
583
+ else
584
+ terminal_parse_failure(" ")
585
+ r6 = nil
586
+ end
587
+ s0 << r6
588
+ if r6
589
+ r7 = _nt_Hour
590
+ s0 << r7
591
+ if r7
592
+ if has_terminal?(":", false, index)
593
+ r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
594
+ @index += 1
595
+ else
596
+ terminal_parse_failure(":")
597
+ r8 = nil
598
+ end
599
+ s0 << r8
600
+ if r8
601
+ r9 = _nt_Minute
602
+ s0 << r9
603
+ if r9
604
+ if has_terminal?(":", false, index)
605
+ r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
606
+ @index += 1
607
+ else
608
+ terminal_parse_failure(":")
609
+ r10 = nil
610
+ end
611
+ s0 << r10
612
+ if r10
613
+ r11 = _nt_Second
614
+ s0 << r11
615
+ end
616
+ end
617
+ end
618
+ end
619
+ end
620
+ end
621
+ end
622
+ end
623
+ end
624
+ end
625
+ if s0.last
626
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
627
+ r0.extend(DateTime0)
628
+ else
629
+ @index = i0
630
+ r0 = nil
631
+ end
632
+
633
+ node_cache[:DateTime][start_index] = r0
634
+
635
+ r0
636
+ end
637
+
638
+ def _nt_Base64Char
639
+ start_index = index
640
+ if node_cache[:Base64Char].has_key?(index)
641
+ cached = node_cache[:Base64Char][index]
642
+ if cached
643
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
644
+ @index = cached.interval.end
645
+ end
646
+ return cached
647
+ end
648
+
649
+ if has_terminal?('\G[A-Za-z0-9+/]', true, index)
650
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
651
+ @index += 1
652
+ else
653
+ r0 = nil
654
+ end
655
+
656
+ node_cache[:Base64Char][start_index] = r0
657
+
658
+ r0
659
+ end
660
+
661
+ def _nt_Base64Hash
662
+ start_index = index
663
+ if node_cache[:Base64Hash].has_key?(index)
664
+ cached = node_cache[:Base64Hash][index]
665
+ if cached
666
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
667
+ @index = cached.interval.end
668
+ end
669
+ return cached
670
+ end
671
+
672
+ s0, i0 = [], index
673
+ loop do
674
+ r1 = _nt_Base64Char
675
+ if r1
676
+ s0 << r1
677
+ else
678
+ break
679
+ end
680
+ end
681
+ if s0.empty?
682
+ @index = i0
683
+ r0 = nil
684
+ else
685
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
686
+ end
687
+
688
+ node_cache[:Base64Hash][start_index] = r0
689
+
690
+ r0
691
+ end
692
+
693
+ module IPv4Byte0
694
+ end
695
+
696
+ module IPv4Byte1
697
+ end
698
+
699
+ module IPv4Byte2
700
+ end
701
+
702
+ module IPv4Byte3
703
+ end
704
+
705
+ def _nt_IPv4Byte
706
+ start_index = index
707
+ if node_cache[:IPv4Byte].has_key?(index)
708
+ cached = node_cache[:IPv4Byte][index]
709
+ if cached
710
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
711
+ @index = cached.interval.end
712
+ end
713
+ return cached
714
+ end
715
+
716
+ i0 = index
717
+ i1, s1 = index, []
718
+ if has_terminal?('\G[2]', true, index)
719
+ r2 = true
720
+ @index += 1
721
+ else
722
+ r2 = nil
723
+ end
724
+ s1 << r2
725
+ if r2
726
+ if has_terminal?('\G[5]', true, index)
727
+ r3 = true
728
+ @index += 1
729
+ else
730
+ r3 = nil
731
+ end
732
+ s1 << r3
733
+ if r3
734
+ if has_terminal?('\G[0-5]', true, index)
735
+ r4 = true
736
+ @index += 1
737
+ else
738
+ r4 = nil
739
+ end
740
+ s1 << r4
741
+ end
742
+ end
743
+ if s1.last
744
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
745
+ r1.extend(IPv4Byte0)
746
+ else
747
+ @index = i1
748
+ r1 = nil
749
+ end
750
+ if r1
751
+ r0 = r1
752
+ else
753
+ i5, s5 = index, []
754
+ if has_terminal?('\G[2]', true, index)
755
+ r6 = true
756
+ @index += 1
757
+ else
758
+ r6 = nil
759
+ end
760
+ s5 << r6
761
+ if r6
762
+ if has_terminal?('\G[0-4]', true, index)
763
+ r7 = true
764
+ @index += 1
765
+ else
766
+ r7 = nil
767
+ end
768
+ s5 << r7
769
+ if r7
770
+ if has_terminal?('\G[0-9]', true, index)
771
+ r8 = true
772
+ @index += 1
773
+ else
774
+ r8 = nil
775
+ end
776
+ s5 << r8
777
+ end
778
+ end
779
+ if s5.last
780
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
781
+ r5.extend(IPv4Byte1)
782
+ else
783
+ @index = i5
784
+ r5 = nil
785
+ end
786
+ if r5
787
+ r0 = r5
788
+ else
789
+ i9, s9 = index, []
790
+ if has_terminal?('\G[1]', true, index)
791
+ r10 = true
792
+ @index += 1
793
+ else
794
+ r10 = nil
795
+ end
796
+ s9 << r10
797
+ if r10
798
+ if has_terminal?('\G[0-9]', true, index)
799
+ r11 = true
800
+ @index += 1
801
+ else
802
+ r11 = nil
803
+ end
804
+ s9 << r11
805
+ if r11
806
+ if has_terminal?('\G[0-9]', true, index)
807
+ r12 = true
808
+ @index += 1
809
+ else
810
+ r12 = nil
811
+ end
812
+ s9 << r12
813
+ end
814
+ end
815
+ if s9.last
816
+ r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
817
+ r9.extend(IPv4Byte2)
818
+ else
819
+ @index = i9
820
+ r9 = nil
821
+ end
822
+ if r9
823
+ r0 = r9
824
+ else
825
+ i13, s13 = index, []
826
+ if has_terminal?('\G[1-9]', true, index)
827
+ r14 = true
828
+ @index += 1
829
+ else
830
+ r14 = nil
831
+ end
832
+ s13 << r14
833
+ if r14
834
+ if has_terminal?('\G[0-9]', true, index)
835
+ r15 = true
836
+ @index += 1
837
+ else
838
+ r15 = nil
839
+ end
840
+ s13 << r15
841
+ end
842
+ if s13.last
843
+ r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
844
+ r13.extend(IPv4Byte3)
845
+ else
846
+ @index = i13
847
+ r13 = nil
848
+ end
849
+ if r13
850
+ r0 = r13
851
+ else
852
+ if has_terminal?('\G[0-9]', true, index)
853
+ r16 = true
854
+ @index += 1
855
+ else
856
+ r16 = nil
857
+ end
858
+ if r16
859
+ r0 = r16
860
+ else
861
+ @index = i0
862
+ r0 = nil
863
+ end
864
+ end
865
+ end
866
+ end
867
+ end
868
+
869
+ node_cache[:IPv4Byte][start_index] = r0
870
+
871
+ r0
872
+ end
873
+
874
+ module IPv4Address0
875
+ def IPv4Byte1
876
+ elements[0]
877
+ end
878
+
879
+ def IPv4Byte2
880
+ elements[2]
881
+ end
882
+
883
+ def IPv4Byte3
884
+ elements[4]
885
+ end
886
+
887
+ def IPv4Byte4
888
+ elements[6]
889
+ end
890
+ end
891
+
892
+ def _nt_IPv4Address
893
+ start_index = index
894
+ if node_cache[:IPv4Address].has_key?(index)
895
+ cached = node_cache[:IPv4Address][index]
896
+ if cached
897
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
898
+ @index = cached.interval.end
899
+ end
900
+ return cached
901
+ end
902
+
903
+ i0, s0 = index, []
904
+ r1 = _nt_IPv4Byte
905
+ s0 << r1
906
+ if r1
907
+ if has_terminal?(".", false, index)
908
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
909
+ @index += 1
910
+ else
911
+ terminal_parse_failure(".")
912
+ r2 = nil
913
+ end
914
+ s0 << r2
915
+ if r2
916
+ r3 = _nt_IPv4Byte
917
+ s0 << r3
918
+ if r3
919
+ if has_terminal?(".", false, index)
920
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
921
+ @index += 1
922
+ else
923
+ terminal_parse_failure(".")
924
+ r4 = nil
925
+ end
926
+ s0 << r4
927
+ if r4
928
+ r5 = _nt_IPv4Byte
929
+ s0 << r5
930
+ if r5
931
+ if has_terminal?(".", false, index)
932
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
933
+ @index += 1
934
+ else
935
+ terminal_parse_failure(".")
936
+ r6 = nil
937
+ end
938
+ s0 << r6
939
+ if r6
940
+ r7 = _nt_IPv4Byte
941
+ s0 << r7
942
+ end
943
+ end
944
+ end
945
+ end
946
+ end
947
+ end
948
+ if s0.last
949
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
950
+ r0.extend(IPv4Address0)
951
+ else
952
+ @index = i0
953
+ r0 = nil
954
+ end
955
+
956
+ node_cache[:IPv4Address][start_index] = r0
957
+
958
+ r0
959
+ end
960
+
961
+ def _nt_IP
962
+ start_index = index
963
+ if node_cache[:IP].has_key?(index)
964
+ cached = node_cache[:IP][index]
965
+ if cached
966
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
967
+ @index = cached.interval.end
968
+ end
969
+ return cached
970
+ end
971
+
972
+ r0 = _nt_IPv4Address
973
+
974
+ node_cache[:IP][start_index] = r0
975
+
976
+ r0
977
+ end
978
+
979
+ def _nt_Hostname
980
+ start_index = index
981
+ if node_cache[:Hostname].has_key?(index)
982
+ cached = node_cache[:Hostname][index]
983
+ if cached
984
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
985
+ @index = cached.interval.end
986
+ end
987
+ return cached
988
+ end
989
+
990
+ s0, i0 = [], index
991
+ loop do
992
+ if has_terminal?('\G[a-zA-Z\\.\\-]', true, index)
993
+ r1 = true
994
+ @index += 1
995
+ else
996
+ r1 = nil
997
+ end
998
+ if r1
999
+ s0 << r1
1000
+ else
1001
+ break
1002
+ end
1003
+ end
1004
+ if s0.empty?
1005
+ @index = i0
1006
+ r0 = nil
1007
+ else
1008
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1009
+ end
1010
+
1011
+ node_cache[:Hostname][start_index] = r0
1012
+
1013
+ r0
1014
+ end
1015
+
1016
+ def _nt_Address
1017
+ start_index = index
1018
+ if node_cache[:Address].has_key?(index)
1019
+ cached = node_cache[:Address][index]
1020
+ if cached
1021
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1022
+ @index = cached.interval.end
1023
+ end
1024
+ return cached
1025
+ end
1026
+
1027
+ i0 = index
1028
+ r1 = _nt_Hostname
1029
+ if r1
1030
+ r0 = r1
1031
+ else
1032
+ r2 = _nt_IP
1033
+ if r2
1034
+ r0 = r2
1035
+ else
1036
+ @index = i0
1037
+ r0 = nil
1038
+ end
1039
+ end
1040
+
1041
+ node_cache[:Address][start_index] = r0
1042
+
1043
+ r0
1044
+ end
1045
+
1046
+ def _nt_Port
1047
+ start_index = index
1048
+ if node_cache[:Port].has_key?(index)
1049
+ cached = node_cache[:Port][index]
1050
+ if cached
1051
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1052
+ @index = cached.interval.end
1053
+ end
1054
+ return cached
1055
+ end
1056
+
1057
+ s0, i0 = [], index
1058
+ loop do
1059
+ if has_terminal?('\G[0-9]', true, index)
1060
+ r1 = true
1061
+ @index += 1
1062
+ else
1063
+ r1 = nil
1064
+ end
1065
+ if r1
1066
+ s0 << r1
1067
+ else
1068
+ break
1069
+ end
1070
+ end
1071
+ if s0.empty?
1072
+ @index = i0
1073
+ r0 = nil
1074
+ else
1075
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1076
+ end
1077
+
1078
+ node_cache[:Port][start_index] = r0
1079
+
1080
+ r0
1081
+ end
1082
+
1083
+ def _nt_ORPort
1084
+ start_index = index
1085
+ if node_cache[:ORPort].has_key?(index)
1086
+ cached = node_cache[:ORPort][index]
1087
+ if cached
1088
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1089
+ @index = cached.interval.end
1090
+ end
1091
+ return cached
1092
+ end
1093
+
1094
+ r0 = _nt_Port
1095
+
1096
+ node_cache[:ORPort][start_index] = r0
1097
+
1098
+ r0
1099
+ end
1100
+
1101
+ def _nt_SocksPOrt
1102
+ start_index = index
1103
+ if node_cache[:SocksPOrt].has_key?(index)
1104
+ cached = node_cache[:SocksPOrt][index]
1105
+ if cached
1106
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1107
+ @index = cached.interval.end
1108
+ end
1109
+ return cached
1110
+ end
1111
+
1112
+ if has_terminal?('\G[0]', true, index)
1113
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
1114
+ @index += 1
1115
+ else
1116
+ r0 = nil
1117
+ end
1118
+
1119
+ node_cache[:SocksPOrt][start_index] = r0
1120
+
1121
+ r0
1122
+ end
1123
+
1124
+ def _nt_DirPort
1125
+ start_index = index
1126
+ if node_cache[:DirPort].has_key?(index)
1127
+ cached = node_cache[:DirPort][index]
1128
+ if cached
1129
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1130
+ @index = cached.interval.end
1131
+ end
1132
+ return cached
1133
+ end
1134
+
1135
+ r0 = _nt_Port
1136
+
1137
+ node_cache[:DirPort][start_index] = r0
1138
+
1139
+ r0
1140
+ end
1141
+
1142
+ def _nt_SP
1143
+ start_index = index
1144
+ if node_cache[:SP].has_key?(index)
1145
+ cached = node_cache[:SP][index]
1146
+ if cached
1147
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1148
+ @index = cached.interval.end
1149
+ end
1150
+ return cached
1151
+ end
1152
+
1153
+ if has_terminal?(" ", false, index)
1154
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
1155
+ @index += 1
1156
+ else
1157
+ terminal_parse_failure(" ")
1158
+ r0 = nil
1159
+ end
1160
+
1161
+ node_cache[:SP][start_index] = r0
1162
+
1163
+ r0
1164
+ end
1165
+
1166
+ def _nt_NL
1167
+ start_index = index
1168
+ if node_cache[:NL].has_key?(index)
1169
+ cached = node_cache[:NL][index]
1170
+ if cached
1171
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1172
+ @index = cached.interval.end
1173
+ end
1174
+ return cached
1175
+ end
1176
+
1177
+ if has_terminal?("\r\n", false, index)
1178
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 2))
1179
+ @index += 2
1180
+ else
1181
+ terminal_parse_failure("\r\n")
1182
+ r0 = nil
1183
+ end
1184
+
1185
+ node_cache[:NL][start_index] = r0
1186
+
1187
+ r0
1188
+ end
1189
+
1190
+ def _nt_ALPHA
1191
+ start_index = index
1192
+ if node_cache[:ALPHA].has_key?(index)
1193
+ cached = node_cache[:ALPHA][index]
1194
+ if cached
1195
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1196
+ @index = cached.interval.end
1197
+ end
1198
+ return cached
1199
+ end
1200
+
1201
+ i0 = index
1202
+ if has_terminal?('\G[A-Z]', true, index)
1203
+ r1 = true
1204
+ @index += 1
1205
+ else
1206
+ r1 = nil
1207
+ end
1208
+ if r1
1209
+ r0 = r1
1210
+ else
1211
+ if has_terminal?('\G[a-z]', true, index)
1212
+ r2 = true
1213
+ @index += 1
1214
+ else
1215
+ r2 = nil
1216
+ end
1217
+ if r2
1218
+ r0 = r2
1219
+ else
1220
+ @index = i0
1221
+ r0 = nil
1222
+ end
1223
+ end
1224
+
1225
+ node_cache[:ALPHA][start_index] = r0
1226
+
1227
+ r0
1228
+ end
1229
+
1230
+ def _nt_DIGIT
1231
+ start_index = index
1232
+ if node_cache[:DIGIT].has_key?(index)
1233
+ cached = node_cache[:DIGIT][index]
1234
+ if cached
1235
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1236
+ @index = cached.interval.end
1237
+ end
1238
+ return cached
1239
+ end
1240
+
1241
+ if has_terminal?('\G[0-9]', true, index)
1242
+ r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
1243
+ @index += 1
1244
+ else
1245
+ r0 = nil
1246
+ end
1247
+
1248
+ node_cache[:DIGIT][start_index] = r0
1249
+
1250
+ r0
1251
+ end
1252
+
1253
+ def _nt_HEXDIG
1254
+ start_index = index
1255
+ if node_cache[:HEXDIG].has_key?(index)
1256
+ cached = node_cache[:HEXDIG][index]
1257
+ if cached
1258
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1259
+ @index = cached.interval.end
1260
+ end
1261
+ return cached
1262
+ end
1263
+
1264
+ i0 = index
1265
+ r1 = _nt_DIGIT
1266
+ if r1
1267
+ r0 = r1
1268
+ else
1269
+ if has_terminal?("A", false, index)
1270
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
1271
+ @index += 1
1272
+ else
1273
+ terminal_parse_failure("A")
1274
+ r2 = nil
1275
+ end
1276
+ if r2
1277
+ r0 = r2
1278
+ else
1279
+ if has_terminal?("B", false, index)
1280
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
1281
+ @index += 1
1282
+ else
1283
+ terminal_parse_failure("B")
1284
+ r3 = nil
1285
+ end
1286
+ if r3
1287
+ r0 = r3
1288
+ else
1289
+ if has_terminal?("C", false, index)
1290
+ r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
1291
+ @index += 1
1292
+ else
1293
+ terminal_parse_failure("C")
1294
+ r4 = nil
1295
+ end
1296
+ if r4
1297
+ r0 = r4
1298
+ else
1299
+ if has_terminal?("D", false, index)
1300
+ r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
1301
+ @index += 1
1302
+ else
1303
+ terminal_parse_failure("D")
1304
+ r5 = nil
1305
+ end
1306
+ if r5
1307
+ r0 = r5
1308
+ else
1309
+ if has_terminal?("E", false, index)
1310
+ r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
1311
+ @index += 1
1312
+ else
1313
+ terminal_parse_failure("E")
1314
+ r6 = nil
1315
+ end
1316
+ if r6
1317
+ r0 = r6
1318
+ else
1319
+ if has_terminal?("F", false, index)
1320
+ r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
1321
+ @index += 1
1322
+ else
1323
+ terminal_parse_failure("F")
1324
+ r7 = nil
1325
+ end
1326
+ if r7
1327
+ r0 = r7
1328
+ else
1329
+ @index = i0
1330
+ r0 = nil
1331
+ end
1332
+ end
1333
+ end
1334
+ end
1335
+ end
1336
+ end
1337
+ end
1338
+
1339
+ node_cache[:HEXDIG][start_index] = r0
1340
+
1341
+ r0
1342
+ end
1343
+
1344
+ def _nt_Boolean
1345
+ start_index = index
1346
+ if node_cache[:Boolean].has_key?(index)
1347
+ cached = node_cache[:Boolean][index]
1348
+ if cached
1349
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1350
+ @index = cached.interval.end
1351
+ end
1352
+ return cached
1353
+ end
1354
+
1355
+ i0 = index
1356
+ if has_terminal?('\G[0]', true, index)
1357
+ r1 = true
1358
+ @index += 1
1359
+ else
1360
+ r1 = nil
1361
+ end
1362
+ if r1
1363
+ r0 = r1
1364
+ else
1365
+ if has_terminal?('\G[1]', true, index)
1366
+ r2 = true
1367
+ @index += 1
1368
+ else
1369
+ r2 = nil
1370
+ end
1371
+ if r2
1372
+ r0 = r2
1373
+ else
1374
+ @index = i0
1375
+ r0 = nil
1376
+ end
1377
+ end
1378
+
1379
+ node_cache[:Boolean][start_index] = r0
1380
+
1381
+ r0
1382
+ end
1383
+
1384
+ def _nt_IDChar
1385
+ start_index = index
1386
+ if node_cache[:IDChar].has_key?(index)
1387
+ cached = node_cache[:IDChar][index]
1388
+ if cached
1389
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1390
+ @index = cached.interval.end
1391
+ end
1392
+ return cached
1393
+ end
1394
+
1395
+ i0 = index
1396
+ r1 = _nt_ALPHA
1397
+ if r1
1398
+ r0 = r1
1399
+ else
1400
+ r2 = _nt_DIGIT
1401
+ if r2
1402
+ r0 = r2
1403
+ else
1404
+ @index = i0
1405
+ r0 = nil
1406
+ end
1407
+ end
1408
+
1409
+ node_cache[:IDChar][start_index] = r0
1410
+
1411
+ r0
1412
+ end
1413
+
1414
+ def _nt_NicknameChar
1415
+ start_index = index
1416
+ if node_cache[:NicknameChar].has_key?(index)
1417
+ cached = node_cache[:NicknameChar][index]
1418
+ if cached
1419
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1420
+ @index = cached.interval.end
1421
+ end
1422
+ return cached
1423
+ end
1424
+
1425
+ i0 = index
1426
+ if has_terminal?('\G[A-Z]', true, index)
1427
+ r1 = true
1428
+ @index += 1
1429
+ else
1430
+ r1 = nil
1431
+ end
1432
+ if r1
1433
+ r0 = r1
1434
+ else
1435
+ if has_terminal?('\G[a-z]', true, index)
1436
+ r2 = true
1437
+ @index += 1
1438
+ else
1439
+ r2 = nil
1440
+ end
1441
+ if r2
1442
+ r0 = r2
1443
+ else
1444
+ if has_terminal?('\G[0-9]', true, index)
1445
+ r3 = true
1446
+ @index += 1
1447
+ else
1448
+ r3 = nil
1449
+ end
1450
+ if r3
1451
+ r0 = r3
1452
+ else
1453
+ @index = i0
1454
+ r0 = nil
1455
+ end
1456
+ end
1457
+ end
1458
+
1459
+ node_cache[:NicknameChar][start_index] = r0
1460
+
1461
+ r0
1462
+ end
1463
+
1464
+ def _nt_Nickname
1465
+ start_index = index
1466
+ if node_cache[:Nickname].has_key?(index)
1467
+ cached = node_cache[:Nickname][index]
1468
+ if cached
1469
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1470
+ @index = cached.interval.end
1471
+ end
1472
+ return cached
1473
+ end
1474
+
1475
+ s0, i0 = [], index
1476
+ loop do
1477
+ r1 = _nt_NicknameChar
1478
+ if r1
1479
+ s0 << r1
1480
+ else
1481
+ break
1482
+ end
1483
+ if s0.size == 19
1484
+ break
1485
+ end
1486
+ end
1487
+ if s0.size < 1
1488
+ @index = i0
1489
+ r0 = nil
1490
+ else
1491
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1492
+ end
1493
+
1494
+ node_cache[:Nickname][start_index] = r0
1495
+
1496
+ r0
1497
+ end
1498
+
1499
+ module Fingerprint0
1500
+ end
1501
+
1502
+ def _nt_Fingerprint
1503
+ start_index = index
1504
+ if node_cache[:Fingerprint].has_key?(index)
1505
+ cached = node_cache[:Fingerprint][index]
1506
+ if cached
1507
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1508
+ @index = cached.interval.end
1509
+ end
1510
+ return cached
1511
+ end
1512
+
1513
+ i0 = index
1514
+ i1, s1 = index, []
1515
+ if has_terminal?("$", false, index)
1516
+ r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
1517
+ @index += 1
1518
+ else
1519
+ terminal_parse_failure("$")
1520
+ r2 = nil
1521
+ end
1522
+ s1 << r2
1523
+ if r2
1524
+ s3, i3 = [], index
1525
+ loop do
1526
+ r4 = _nt_HEXDIG
1527
+ if r4
1528
+ s3 << r4
1529
+ else
1530
+ break
1531
+ end
1532
+ if s3.size == 40
1533
+ break
1534
+ end
1535
+ end
1536
+ if s3.size < 40
1537
+ @index = i3
1538
+ r3 = nil
1539
+ else
1540
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
1541
+ end
1542
+ s1 << r3
1543
+ end
1544
+ if s1.last
1545
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1546
+ r1.extend(Fingerprint0)
1547
+ else
1548
+ @index = i1
1549
+ r1 = nil
1550
+ end
1551
+ if r1
1552
+ r0 = r1
1553
+ else
1554
+ s5, i5 = [], index
1555
+ loop do
1556
+ r6 = _nt_HEXDIG
1557
+ if r6
1558
+ s5 << r6
1559
+ else
1560
+ break
1561
+ end
1562
+ if s5.size == 40
1563
+ break
1564
+ end
1565
+ end
1566
+ if s5.size < 40
1567
+ @index = i5
1568
+ r5 = nil
1569
+ else
1570
+ r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
1571
+ end
1572
+ if r5
1573
+ r0 = r5
1574
+ else
1575
+ @index = i0
1576
+ r0 = nil
1577
+ end
1578
+ end
1579
+
1580
+ node_cache[:Fingerprint][start_index] = r0
1581
+
1582
+ r0
1583
+ end
1584
+
1585
+ def _nt_ServerID
1586
+ start_index = index
1587
+ if node_cache[:ServerID].has_key?(index)
1588
+ cached = node_cache[:ServerID][index]
1589
+ if cached
1590
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1591
+ @index = cached.interval.end
1592
+ end
1593
+ return cached
1594
+ end
1595
+
1596
+ i0 = index
1597
+ r1 = _nt_Nickname
1598
+ if r1
1599
+ r0 = r1
1600
+ else
1601
+ r2 = _nt_Fingerprint
1602
+ if r2
1603
+ r0 = r2
1604
+ else
1605
+ @index = i0
1606
+ r0 = nil
1607
+ end
1608
+ end
1609
+
1610
+ node_cache[:ServerID][start_index] = r0
1611
+
1612
+ r0
1613
+ end
1614
+
1615
+ module LongName0
1616
+ def f
1617
+ elements[0]
1618
+ end
1619
+
1620
+ def n
1621
+ elements[2]
1622
+ end
1623
+ end
1624
+
1625
+ def _nt_LongName
1626
+ start_index = index
1627
+ if node_cache[:LongName].has_key?(index)
1628
+ cached = node_cache[:LongName][index]
1629
+ if cached
1630
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1631
+ @index = cached.interval.end
1632
+ end
1633
+ return cached
1634
+ end
1635
+
1636
+ i0 = index
1637
+ i1, s1 = index, []
1638
+ r2 = _nt_Fingerprint
1639
+ s1 << r2
1640
+ if r2
1641
+ if has_terminal?("=", false, index)
1642
+ r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
1643
+ @index += 1
1644
+ else
1645
+ terminal_parse_failure("=")
1646
+ r3 = nil
1647
+ end
1648
+ s1 << r3
1649
+ if r3
1650
+ r4 = _nt_Nickname
1651
+ s1 << r4
1652
+ end
1653
+ end
1654
+ if s1.last
1655
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
1656
+ r1.extend(LongName0)
1657
+ else
1658
+ @index = i1
1659
+ r1 = nil
1660
+ end
1661
+ if r1
1662
+ r0 = r1
1663
+ else
1664
+ r5 = _nt_Fingerprint
1665
+ if r5
1666
+ r0 = r5
1667
+ else
1668
+ @index = i0
1669
+ r0 = nil
1670
+ end
1671
+ end
1672
+
1673
+ node_cache[:LongName][start_index] = r0
1674
+
1675
+ r0
1676
+ end
1677
+
1678
+ def _nt_ServerSpec
1679
+ start_index = index
1680
+ if node_cache[:ServerSpec].has_key?(index)
1681
+ cached = node_cache[:ServerSpec][index]
1682
+ if cached
1683
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1684
+ @index = cached.interval.end
1685
+ end
1686
+ return cached
1687
+ end
1688
+
1689
+ i0 = index
1690
+ r1 = _nt_LongName
1691
+ if r1
1692
+ r0 = r1
1693
+ else
1694
+ r2 = _nt_Nickname
1695
+ if r2
1696
+ r0 = r2
1697
+ else
1698
+ @index = i0
1699
+ r0 = nil
1700
+ end
1701
+ end
1702
+
1703
+ node_cache[:ServerSpec][start_index] = r0
1704
+
1705
+ r0
1706
+ end
1707
+
1708
+ def _nt_StreamID
1709
+ start_index = index
1710
+ if node_cache[:StreamID].has_key?(index)
1711
+ cached = node_cache[:StreamID][index]
1712
+ if cached
1713
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1714
+ @index = cached.interval.end
1715
+ end
1716
+ return cached
1717
+ end
1718
+
1719
+ s0, i0 = [], index
1720
+ loop do
1721
+ r1 = _nt_IDChar
1722
+ if r1
1723
+ s0 << r1
1724
+ else
1725
+ break
1726
+ end
1727
+ if s0.size == 16
1728
+ break
1729
+ end
1730
+ end
1731
+ if s0.size < 1
1732
+ @index = i0
1733
+ r0 = nil
1734
+ else
1735
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1736
+ end
1737
+
1738
+ node_cache[:StreamID][start_index] = r0
1739
+
1740
+ r0
1741
+ end
1742
+
1743
+ def _nt_CircuitID
1744
+ start_index = index
1745
+ if node_cache[:CircuitID].has_key?(index)
1746
+ cached = node_cache[:CircuitID][index]
1747
+ if cached
1748
+ cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
1749
+ @index = cached.interval.end
1750
+ end
1751
+ return cached
1752
+ end
1753
+
1754
+ s0, i0 = [], index
1755
+ loop do
1756
+ r1 = _nt_IDChar
1757
+ if r1
1758
+ s0 << r1
1759
+ else
1760
+ break
1761
+ end
1762
+ if s0.size == 16
1763
+ break
1764
+ end
1765
+ end
1766
+ if s0.size < 1
1767
+ @index = i0
1768
+ r0 = nil
1769
+ else
1770
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
1771
+ end
1772
+
1773
+ node_cache[:CircuitID][start_index] = r0
1774
+
1775
+ r0
1776
+ end
1777
+
1778
+ end
1779
+
1780
+ class PrimitivesParser < Treetop::Runtime::CompiledParser
1781
+ include Primitives
1782
+ end
1783
+
1784
+ end