edn-abnf 0.5.1 → 0.5.4
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.
- checksums.yaml +4 -4
- data/bin/edn-abnf +15 -2
- data/edn-abnf.gemspec +1 -1
- data/lib/parser/edn-util.rb +9 -0
- data/lib/parser/edngrammar.rb +4035 -628
- metadata +2 -2
data/lib/parser/edngrammar.rb
CHANGED
@@ -1624,7 +1624,7 @@ module EDNGRAMMAR
|
|
1624
1624
|
if r2
|
1625
1625
|
s3, i3 = [], index
|
1626
1626
|
loop do
|
1627
|
-
r4 =
|
1627
|
+
r4 = _nt_lcldh
|
1628
1628
|
if r4
|
1629
1629
|
s3 << r4
|
1630
1630
|
else
|
@@ -1651,7 +1651,7 @@ module EDNGRAMMAR
|
|
1651
1651
|
if r6
|
1652
1652
|
s7, i7 = [], index
|
1653
1653
|
loop do
|
1654
|
-
r8 =
|
1654
|
+
r8 = _nt_ucldh
|
1655
1655
|
if r8
|
1656
1656
|
s7 << r8
|
1657
1657
|
else
|
@@ -1696,14 +1696,6 @@ module EDNGRAMMAR
|
|
1696
1696
|
def ast # XXX ignoring h and b64
|
1697
1697
|
data = sqstr.ast.force_encoding(Encoding::UTF_8) # XXX undo .b
|
1698
1698
|
app = app_prefix.text_value
|
1699
|
-
# Find a better place to put a default initialization
|
1700
|
-
EDNGRAMMAR.const_set(:APPS, Hash.new { |h, k|
|
1701
|
-
h[k] = begin ::CBOR_DIAG.const_get("App_#{k.downcase}")
|
1702
|
-
|
1703
|
-
rescue NameError
|
1704
|
-
raise ArgumentError, "cbor-diagnostic: Unknown application-oriented extension '#{k}'", caller
|
1705
|
-
end
|
1706
|
-
}) unless ::EDNGRAMMAR.const_defined?(:APPS)
|
1707
1699
|
::EDNGRAMMAR::APPS[app].decode(app, data)
|
1708
1700
|
end
|
1709
1701
|
end
|
@@ -1756,13 +1748,6 @@ module EDNGRAMMAR
|
|
1756
1748
|
args = seq.ast
|
1757
1749
|
app = app_prefix.text_value
|
1758
1750
|
# Find a better place to put a default initialization
|
1759
|
-
EDNGRAMMAR.const_set(:APPS, Hash.new { |h, k|
|
1760
|
-
h[k] = begin ::CBOR_DIAG.const_get("App_#{k.downcase}")
|
1761
|
-
|
1762
|
-
rescue NameError
|
1763
|
-
raise ArgumentError, "cbor-diagnostic: Unknown application-oriented extension '#{k}'", caller
|
1764
|
-
end
|
1765
|
-
}) unless ::EDNGRAMMAR.const_defined?(:APPS)
|
1766
1751
|
::EDNGRAMMAR::APPS[app].decode(app, args)
|
1767
1752
|
end
|
1768
1753
|
end
|
@@ -1892,28 +1877,40 @@ module EDNGRAMMAR
|
|
1892
1877
|
end
|
1893
1878
|
|
1894
1879
|
i0 = index
|
1895
|
-
r1 =
|
1880
|
+
r1 = _nt_sq_app_string_h
|
1896
1881
|
if r1
|
1897
1882
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
1898
1883
|
r0 = r1
|
1899
1884
|
else
|
1900
|
-
r2 =
|
1885
|
+
r2 = _nt_sq_app_string_b64
|
1901
1886
|
if r2
|
1902
1887
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
1903
1888
|
r0 = r2
|
1904
1889
|
else
|
1905
|
-
r3 =
|
1890
|
+
r3 = _nt_app_string
|
1906
1891
|
if r3
|
1907
1892
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
1908
1893
|
r0 = r3
|
1909
1894
|
else
|
1910
|
-
r4 =
|
1895
|
+
r4 = _nt_sqstr
|
1911
1896
|
if r4
|
1912
1897
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
1913
1898
|
r0 = r4
|
1914
1899
|
else
|
1915
|
-
|
1916
|
-
|
1900
|
+
r5 = _nt_app_sequence
|
1901
|
+
if r5
|
1902
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
1903
|
+
r0 = r5
|
1904
|
+
else
|
1905
|
+
r6 = _nt_embedded
|
1906
|
+
if r6
|
1907
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
1908
|
+
r0 = r6
|
1909
|
+
else
|
1910
|
+
@index = i0
|
1911
|
+
r0 = nil
|
1912
|
+
end
|
1913
|
+
end
|
1917
1914
|
end
|
1918
1915
|
end
|
1919
1916
|
end
|
@@ -2595,24 +2592,18 @@ module EDNGRAMMAR
|
|
2595
2592
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
2596
2593
|
r0 = r2
|
2597
2594
|
else
|
2598
|
-
if has_terminal?(@regexps[gr = '\A[0
|
2595
|
+
if has_terminal?(@regexps[gr = '\A[0-]'] ||= Regexp.new(gr), :regexp, index)
|
2599
2596
|
r3 = true
|
2600
2597
|
@index += 1
|
2601
2598
|
else
|
2602
|
-
terminal_parse_failure('[0
|
2599
|
+
terminal_parse_failure('[0-]')
|
2603
2600
|
r3 = nil
|
2604
2601
|
end
|
2605
2602
|
if r3
|
2606
2603
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
2607
2604
|
r0 = r3
|
2608
2605
|
else
|
2609
|
-
|
2610
|
-
r4 = true
|
2611
|
-
@index += 1
|
2612
|
-
else
|
2613
|
-
terminal_parse_failure('[-]')
|
2614
|
-
r4 = nil
|
2615
|
-
end
|
2606
|
+
r4 = _nt_NONASCII
|
2616
2607
|
if r4
|
2617
2608
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
2618
2609
|
r0 = r4
|
@@ -2663,24 +2654,18 @@ module EDNGRAMMAR
|
|
2663
2654
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
2664
2655
|
r0 = r2
|
2665
2656
|
else
|
2666
|
-
if has_terminal?(@regexps[gr = '\A[\\
|
2657
|
+
if has_terminal?(@regexps[gr = '\A[\\ -]'] ||= Regexp.new(gr), :regexp, index)
|
2667
2658
|
r3 = true
|
2668
2659
|
@index += 1
|
2669
2660
|
else
|
2670
|
-
terminal_parse_failure('[\\
|
2661
|
+
terminal_parse_failure('[\\ -]')
|
2671
2662
|
r3 = nil
|
2672
2663
|
end
|
2673
2664
|
if r3
|
2674
2665
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
2675
2666
|
r0 = r3
|
2676
2667
|
else
|
2677
|
-
|
2678
|
-
r4 = true
|
2679
|
-
@index += 1
|
2680
|
-
else
|
2681
|
-
terminal_parse_failure('[-]')
|
2682
|
-
r4 = nil
|
2683
|
-
end
|
2668
|
+
r4 = _nt_NONASCII
|
2684
2669
|
if r4
|
2685
2670
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
2686
2671
|
r0 = r4
|
@@ -3367,23 +3352,13 @@ module EDNGRAMMAR
|
|
3367
3352
|
end
|
3368
3353
|
|
3369
3354
|
module DoubleQuoted2
|
3370
|
-
def
|
3355
|
+
def escapable_d
|
3371
3356
|
elements[1]
|
3372
3357
|
end
|
3373
3358
|
end
|
3374
3359
|
|
3375
3360
|
module DoubleQuoted3
|
3376
|
-
def ast;
|
3377
|
-
end
|
3378
|
-
|
3379
|
-
module DoubleQuoted4
|
3380
|
-
def escapable
|
3381
|
-
elements[1]
|
3382
|
-
end
|
3383
|
-
end
|
3384
|
-
|
3385
|
-
module DoubleQuoted5
|
3386
|
-
def ast; escapable.ast end
|
3361
|
+
def ast; escapable_d.ast end
|
3387
3362
|
end
|
3388
3363
|
|
3389
3364
|
def _nt_double_quoted
|
@@ -3422,7 +3397,7 @@ module EDNGRAMMAR
|
|
3422
3397
|
end
|
3423
3398
|
s3 << r4
|
3424
3399
|
if r4
|
3425
|
-
r5 =
|
3400
|
+
r5 = _nt_escapable_d
|
3426
3401
|
s3 << r5
|
3427
3402
|
end
|
3428
3403
|
if s3.last
|
@@ -3437,34 +3412,8 @@ module EDNGRAMMAR
|
|
3437
3412
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3438
3413
|
r0 = r3
|
3439
3414
|
else
|
3440
|
-
|
3441
|
-
|
3442
|
-
r7 = true
|
3443
|
-
@index += match_len
|
3444
|
-
else
|
3445
|
-
terminal_parse_failure('"\\\\"')
|
3446
|
-
r7 = nil
|
3447
|
-
end
|
3448
|
-
s6 << r7
|
3449
|
-
if r7
|
3450
|
-
r8 = _nt_escapable
|
3451
|
-
s6 << r8
|
3452
|
-
end
|
3453
|
-
if s6.last
|
3454
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
3455
|
-
r6.extend(DoubleQuoted4)
|
3456
|
-
r6.extend(DoubleQuoted5)
|
3457
|
-
else
|
3458
|
-
@index = i6
|
3459
|
-
r6 = nil
|
3460
|
-
end
|
3461
|
-
if r6
|
3462
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
3463
|
-
r0 = r6
|
3464
|
-
else
|
3465
|
-
@index = i0
|
3466
|
-
r0 = nil
|
3467
|
-
end
|
3415
|
+
@index = i0
|
3416
|
+
r0 = nil
|
3468
3417
|
end
|
3469
3418
|
end
|
3470
3419
|
end
|
@@ -3483,23 +3432,13 @@ module EDNGRAMMAR
|
|
3483
3432
|
end
|
3484
3433
|
|
3485
3434
|
module SingleQuoted2
|
3486
|
-
def
|
3435
|
+
def escapable_s
|
3487
3436
|
elements[1]
|
3488
3437
|
end
|
3489
3438
|
end
|
3490
3439
|
|
3491
3440
|
module SingleQuoted3
|
3492
|
-
def ast;
|
3493
|
-
end
|
3494
|
-
|
3495
|
-
module SingleQuoted4
|
3496
|
-
def escapable
|
3497
|
-
elements[1]
|
3498
|
-
end
|
3499
|
-
end
|
3500
|
-
|
3501
|
-
module SingleQuoted5
|
3502
|
-
def ast; escapable.ast end
|
3441
|
+
def ast; escapable_s.ast end
|
3503
3442
|
end
|
3504
3443
|
|
3505
3444
|
def _nt_single_quoted
|
@@ -3538,7 +3477,7 @@ module EDNGRAMMAR
|
|
3538
3477
|
end
|
3539
3478
|
s3 << r4
|
3540
3479
|
if r4
|
3541
|
-
r5 =
|
3480
|
+
r5 = _nt_escapable_s
|
3542
3481
|
s3 << r5
|
3543
3482
|
end
|
3544
3483
|
if s3.last
|
@@ -3553,34 +3492,8 @@ module EDNGRAMMAR
|
|
3553
3492
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3554
3493
|
r0 = r3
|
3555
3494
|
else
|
3556
|
-
|
3557
|
-
|
3558
|
-
r7 = true
|
3559
|
-
@index += match_len
|
3560
|
-
else
|
3561
|
-
terminal_parse_failure('"\\\\"')
|
3562
|
-
r7 = nil
|
3563
|
-
end
|
3564
|
-
s6 << r7
|
3565
|
-
if r7
|
3566
|
-
r8 = _nt_escapable
|
3567
|
-
s6 << r8
|
3568
|
-
end
|
3569
|
-
if s6.last
|
3570
|
-
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
3571
|
-
r6.extend(SingleQuoted4)
|
3572
|
-
r6.extend(SingleQuoted5)
|
3573
|
-
else
|
3574
|
-
@index = i6
|
3575
|
-
r6 = nil
|
3576
|
-
end
|
3577
|
-
if r6
|
3578
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
3579
|
-
r0 = r6
|
3580
|
-
else
|
3581
|
-
@index = i0
|
3582
|
-
r0 = nil
|
3583
|
-
end
|
3495
|
+
@index = i0
|
3496
|
+
r0 = nil
|
3584
3497
|
end
|
3585
3498
|
end
|
3586
3499
|
end
|
@@ -3590,50 +3503,36 @@ module EDNGRAMMAR
|
|
3590
3503
|
r0
|
3591
3504
|
end
|
3592
3505
|
|
3593
|
-
module
|
3506
|
+
module Escapable10
|
3594
3507
|
def ast; "\b" end
|
3595
3508
|
end
|
3596
3509
|
|
3597
|
-
module
|
3510
|
+
module Escapable11
|
3598
3511
|
def ast; "\f" end
|
3599
3512
|
end
|
3600
3513
|
|
3601
|
-
module
|
3514
|
+
module Escapable12
|
3602
3515
|
def ast; "\n" end
|
3603
3516
|
end
|
3604
3517
|
|
3605
|
-
module
|
3518
|
+
module Escapable13
|
3606
3519
|
def ast; "\r" end
|
3607
3520
|
end
|
3608
3521
|
|
3609
|
-
module
|
3522
|
+
module Escapable14
|
3610
3523
|
def ast; "\t" end
|
3611
3524
|
end
|
3612
3525
|
|
3613
|
-
module
|
3614
|
-
def ast; text_value end
|
3615
|
-
end
|
3616
|
-
|
3617
|
-
module Escapable6
|
3526
|
+
module Escapable15
|
3618
3527
|
def ast; text_value end
|
3619
3528
|
end
|
3620
3529
|
|
3621
|
-
|
3622
|
-
def hexchar
|
3623
|
-
elements[1]
|
3624
|
-
end
|
3625
|
-
end
|
3626
|
-
|
3627
|
-
module Escapable8
|
3628
|
-
def ast; hexchar.ast end
|
3629
|
-
end
|
3630
|
-
|
3631
|
-
def _nt_escapable
|
3530
|
+
def _nt_escapable1
|
3632
3531
|
start_index = index
|
3633
|
-
if node_cache[:
|
3634
|
-
cached = node_cache[:
|
3532
|
+
if node_cache[:escapable1].has_key?(index)
|
3533
|
+
cached = node_cache[:escapable1][index]
|
3635
3534
|
if cached
|
3636
|
-
node_cache[:
|
3535
|
+
node_cache[:escapable1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3637
3536
|
@index = cached.interval.end
|
3638
3537
|
end
|
3639
3538
|
return cached
|
@@ -3642,7 +3541,7 @@ module EDNGRAMMAR
|
|
3642
3541
|
i0 = index
|
3643
3542
|
if (match_len = has_terminal?("b", false, index))
|
3644
3543
|
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3645
|
-
r1.extend(
|
3544
|
+
r1.extend(Escapable10)
|
3646
3545
|
@index += match_len
|
3647
3546
|
else
|
3648
3547
|
terminal_parse_failure('"b"')
|
@@ -3654,7 +3553,7 @@ module EDNGRAMMAR
|
|
3654
3553
|
else
|
3655
3554
|
if (match_len = has_terminal?("f", false, index))
|
3656
3555
|
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3657
|
-
r2.extend(
|
3556
|
+
r2.extend(Escapable11)
|
3658
3557
|
@index += match_len
|
3659
3558
|
else
|
3660
3559
|
terminal_parse_failure('"f"')
|
@@ -3666,7 +3565,7 @@ module EDNGRAMMAR
|
|
3666
3565
|
else
|
3667
3566
|
if (match_len = has_terminal?("n", false, index))
|
3668
3567
|
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3669
|
-
r3.extend(
|
3568
|
+
r3.extend(Escapable12)
|
3670
3569
|
@index += match_len
|
3671
3570
|
else
|
3672
3571
|
terminal_parse_failure('"n"')
|
@@ -3678,7 +3577,7 @@ module EDNGRAMMAR
|
|
3678
3577
|
else
|
3679
3578
|
if (match_len = has_terminal?("r", false, index))
|
3680
3579
|
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3681
|
-
r4.extend(
|
3580
|
+
r4.extend(Escapable13)
|
3682
3581
|
@index += match_len
|
3683
3582
|
else
|
3684
3583
|
terminal_parse_failure('"r"')
|
@@ -3690,7 +3589,7 @@ module EDNGRAMMAR
|
|
3690
3589
|
else
|
3691
3590
|
if (match_len = has_terminal?("t", false, index))
|
3692
3591
|
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3693
|
-
r5.extend(
|
3592
|
+
r5.extend(Escapable14)
|
3694
3593
|
@index += match_len
|
3695
3594
|
else
|
3696
3595
|
terminal_parse_failure('"t"')
|
@@ -3700,59 +3599,20 @@ module EDNGRAMMAR
|
|
3700
3599
|
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
3701
3600
|
r0 = r5
|
3702
3601
|
else
|
3703
|
-
if (match_len = has_terminal?("
|
3602
|
+
if (match_len = has_terminal?("\\", false, index))
|
3704
3603
|
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3705
|
-
r6.extend(
|
3604
|
+
r6.extend(Escapable15)
|
3706
3605
|
@index += match_len
|
3707
3606
|
else
|
3708
|
-
terminal_parse_failure('"
|
3607
|
+
terminal_parse_failure('"\\\\"')
|
3709
3608
|
r6 = nil
|
3710
3609
|
end
|
3711
3610
|
if r6
|
3712
3611
|
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
3713
3612
|
r0 = r6
|
3714
3613
|
else
|
3715
|
-
|
3716
|
-
|
3717
|
-
r7.extend(Escapable6)
|
3718
|
-
@index += match_len
|
3719
|
-
else
|
3720
|
-
terminal_parse_failure('"\\\\"')
|
3721
|
-
r7 = nil
|
3722
|
-
end
|
3723
|
-
if r7
|
3724
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
3725
|
-
r0 = r7
|
3726
|
-
else
|
3727
|
-
i8, s8 = index, []
|
3728
|
-
if (match_len = has_terminal?("u", false, index))
|
3729
|
-
r9 = true
|
3730
|
-
@index += match_len
|
3731
|
-
else
|
3732
|
-
terminal_parse_failure('"u"')
|
3733
|
-
r9 = nil
|
3734
|
-
end
|
3735
|
-
s8 << r9
|
3736
|
-
if r9
|
3737
|
-
r10 = _nt_hexchar
|
3738
|
-
s8 << r10
|
3739
|
-
end
|
3740
|
-
if s8.last
|
3741
|
-
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
3742
|
-
r8.extend(Escapable7)
|
3743
|
-
r8.extend(Escapable8)
|
3744
|
-
else
|
3745
|
-
@index = i8
|
3746
|
-
r8 = nil
|
3747
|
-
end
|
3748
|
-
if r8
|
3749
|
-
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
3750
|
-
r0 = r8
|
3751
|
-
else
|
3752
|
-
@index = i0
|
3753
|
-
r0 = nil
|
3754
|
-
end
|
3755
|
-
end
|
3614
|
+
@index = i0
|
3615
|
+
r0 = nil
|
3756
3616
|
end
|
3757
3617
|
end
|
3758
3618
|
end
|
@@ -3760,39 +3620,188 @@ module EDNGRAMMAR
|
|
3760
3620
|
end
|
3761
3621
|
end
|
3762
3622
|
|
3763
|
-
node_cache[:
|
3623
|
+
node_cache[:escapable1][start_index] = r0
|
3764
3624
|
|
3765
3625
|
r0
|
3766
3626
|
end
|
3767
3627
|
|
3768
|
-
module
|
3628
|
+
module EscapableD0
|
3629
|
+
def ast; text_value end
|
3769
3630
|
end
|
3770
3631
|
|
3771
|
-
module
|
3632
|
+
module EscapableD1
|
3633
|
+
def ast; text_value end
|
3772
3634
|
end
|
3773
3635
|
|
3774
|
-
module
|
3775
|
-
def
|
3636
|
+
module EscapableD2
|
3637
|
+
def hexchar
|
3638
|
+
elements[1]
|
3639
|
+
end
|
3776
3640
|
end
|
3777
3641
|
|
3778
|
-
module
|
3779
|
-
def ast;
|
3642
|
+
module EscapableD3
|
3643
|
+
def ast; hexchar.ast end
|
3780
3644
|
end
|
3781
3645
|
|
3782
|
-
|
3783
|
-
|
3784
|
-
|
3646
|
+
def _nt_escapable_d
|
3647
|
+
start_index = index
|
3648
|
+
if node_cache[:escapable_d].has_key?(index)
|
3649
|
+
cached = node_cache[:escapable_d][index]
|
3650
|
+
if cached
|
3651
|
+
node_cache[:escapable_d][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3652
|
+
@index = cached.interval.end
|
3653
|
+
end
|
3654
|
+
return cached
|
3785
3655
|
end
|
3786
3656
|
|
3787
|
-
|
3788
|
-
|
3657
|
+
i0 = index
|
3658
|
+
r1 = _nt_escapable1
|
3659
|
+
if r1
|
3660
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3661
|
+
r0 = r1
|
3662
|
+
else
|
3663
|
+
r2 = _nt_DQUOTE
|
3664
|
+
r2.extend(EscapableD0)
|
3665
|
+
r2.extend(EscapableD0)
|
3666
|
+
if r2
|
3667
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
3668
|
+
r0 = r2
|
3669
|
+
else
|
3670
|
+
if (match_len = has_terminal?("/", false, index))
|
3671
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
3672
|
+
r3.extend(EscapableD1)
|
3673
|
+
@index += match_len
|
3674
|
+
else
|
3675
|
+
terminal_parse_failure('"/"')
|
3676
|
+
r3 = nil
|
3677
|
+
end
|
3678
|
+
if r3
|
3679
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3680
|
+
r0 = r3
|
3681
|
+
else
|
3682
|
+
i4, s4 = index, []
|
3683
|
+
if (match_len = has_terminal?("u", false, index))
|
3684
|
+
r5 = true
|
3685
|
+
@index += match_len
|
3686
|
+
else
|
3687
|
+
terminal_parse_failure('"u"')
|
3688
|
+
r5 = nil
|
3689
|
+
end
|
3690
|
+
s4 << r5
|
3691
|
+
if r5
|
3692
|
+
r6 = _nt_hexchar
|
3693
|
+
s4 << r6
|
3694
|
+
end
|
3695
|
+
if s4.last
|
3696
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
3697
|
+
r4.extend(EscapableD2)
|
3698
|
+
r4.extend(EscapableD3)
|
3699
|
+
else
|
3700
|
+
@index = i4
|
3701
|
+
r4 = nil
|
3702
|
+
end
|
3703
|
+
if r4
|
3704
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
3705
|
+
r0 = r4
|
3706
|
+
else
|
3707
|
+
@index = i0
|
3708
|
+
r0 = nil
|
3709
|
+
end
|
3710
|
+
end
|
3711
|
+
end
|
3789
3712
|
end
|
3713
|
+
|
3714
|
+
node_cache[:escapable_d][start_index] = r0
|
3715
|
+
|
3716
|
+
r0
|
3790
3717
|
end
|
3791
3718
|
|
3792
|
-
module
|
3793
|
-
def ast
|
3794
|
-
|
3719
|
+
module EscapableS0
|
3720
|
+
def ast; text_value end
|
3721
|
+
end
|
3722
|
+
|
3723
|
+
module EscapableS1
|
3724
|
+
def hexchar_s
|
3725
|
+
elements[1]
|
3726
|
+
end
|
3727
|
+
end
|
3728
|
+
|
3729
|
+
module EscapableS2
|
3730
|
+
def ast; hexchar_s.ast end
|
3731
|
+
end
|
3732
|
+
|
3733
|
+
def _nt_escapable_s
|
3734
|
+
start_index = index
|
3735
|
+
if node_cache[:escapable_s].has_key?(index)
|
3736
|
+
cached = node_cache[:escapable_s][index]
|
3737
|
+
if cached
|
3738
|
+
node_cache[:escapable_s][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3739
|
+
@index = cached.interval.end
|
3740
|
+
end
|
3741
|
+
return cached
|
3742
|
+
end
|
3743
|
+
|
3744
|
+
i0 = index
|
3745
|
+
r1 = _nt_escapable1
|
3746
|
+
if r1
|
3747
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3748
|
+
r0 = r1
|
3749
|
+
else
|
3750
|
+
r2 = _nt_SQUOTE
|
3751
|
+
r2.extend(EscapableS0)
|
3752
|
+
r2.extend(EscapableS0)
|
3753
|
+
if r2
|
3754
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
3755
|
+
r0 = r2
|
3756
|
+
else
|
3757
|
+
i3, s3 = index, []
|
3758
|
+
if (match_len = has_terminal?("u", false, index))
|
3759
|
+
r4 = true
|
3760
|
+
@index += match_len
|
3761
|
+
else
|
3762
|
+
terminal_parse_failure('"u"')
|
3763
|
+
r4 = nil
|
3764
|
+
end
|
3765
|
+
s3 << r4
|
3766
|
+
if r4
|
3767
|
+
r5 = _nt_hexchar_s
|
3768
|
+
s3 << r5
|
3769
|
+
end
|
3770
|
+
if s3.last
|
3771
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
3772
|
+
r3.extend(EscapableS1)
|
3773
|
+
r3.extend(EscapableS2)
|
3774
|
+
else
|
3775
|
+
@index = i3
|
3776
|
+
r3 = nil
|
3777
|
+
end
|
3778
|
+
if r3
|
3779
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3780
|
+
r0 = r3
|
3781
|
+
else
|
3782
|
+
@index = i0
|
3783
|
+
r0 = nil
|
3784
|
+
end
|
3785
|
+
end
|
3795
3786
|
end
|
3787
|
+
|
3788
|
+
node_cache[:escapable_s][start_index] = r0
|
3789
|
+
|
3790
|
+
r0
|
3791
|
+
end
|
3792
|
+
|
3793
|
+
module Hexchar0
|
3794
|
+
end
|
3795
|
+
|
3796
|
+
module Hexchar1
|
3797
|
+
end
|
3798
|
+
|
3799
|
+
module Hexchar2
|
3800
|
+
def ast; elements[1].hex_value.chr(Encoding::UTF_8) end
|
3801
|
+
end
|
3802
|
+
|
3803
|
+
module Hexchar3
|
3804
|
+
def ast; hex_value.chr(Encoding::UTF_8) end
|
3796
3805
|
end
|
3797
3806
|
|
3798
3807
|
def _nt_hexchar
|
@@ -3901,41 +3910,7 @@ module EDNGRAMMAR
|
|
3901
3910
|
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
3902
3911
|
r0 = r11
|
3903
3912
|
else
|
3904
|
-
|
3905
|
-
r13 = _nt_high_surrogate
|
3906
|
-
s12 << r13
|
3907
|
-
if r13
|
3908
|
-
if (match_len = has_terminal?("\\", false, index))
|
3909
|
-
r14 = true
|
3910
|
-
@index += match_len
|
3911
|
-
else
|
3912
|
-
terminal_parse_failure('"\\\\"')
|
3913
|
-
r14 = nil
|
3914
|
-
end
|
3915
|
-
s12 << r14
|
3916
|
-
if r14
|
3917
|
-
if (match_len = has_terminal?("u", false, index))
|
3918
|
-
r15 = true
|
3919
|
-
@index += match_len
|
3920
|
-
else
|
3921
|
-
terminal_parse_failure('"u"')
|
3922
|
-
r15 = nil
|
3923
|
-
end
|
3924
|
-
s12 << r15
|
3925
|
-
if r15
|
3926
|
-
r16 = _nt_low_surrogate
|
3927
|
-
s12 << r16
|
3928
|
-
end
|
3929
|
-
end
|
3930
|
-
end
|
3931
|
-
if s12.last
|
3932
|
-
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
3933
|
-
r12.extend(Hexchar4)
|
3934
|
-
r12.extend(Hexchar5)
|
3935
|
-
else
|
3936
|
-
@index = i12
|
3937
|
-
r12 = nil
|
3938
|
-
end
|
3913
|
+
r12 = _nt_two_surrogate
|
3939
3914
|
if r12
|
3940
3915
|
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
3941
3916
|
r0 = r12
|
@@ -4137,6 +4112,74 @@ module EDNGRAMMAR
|
|
4137
4112
|
r0
|
4138
4113
|
end
|
4139
4114
|
|
4115
|
+
module TwoSurrogate0
|
4116
|
+
def high_surrogate
|
4117
|
+
elements[0]
|
4118
|
+
end
|
4119
|
+
|
4120
|
+
def low_surrogate
|
4121
|
+
elements[3]
|
4122
|
+
end
|
4123
|
+
end
|
4124
|
+
|
4125
|
+
module TwoSurrogate1
|
4126
|
+
def ast
|
4127
|
+
((high_surrogate.ast << 10) + low_surrogate.ast + 0x10000).chr(Encoding::UTF_8)
|
4128
|
+
end
|
4129
|
+
end
|
4130
|
+
|
4131
|
+
def _nt_two_surrogate
|
4132
|
+
start_index = index
|
4133
|
+
if node_cache[:two_surrogate].has_key?(index)
|
4134
|
+
cached = node_cache[:two_surrogate][index]
|
4135
|
+
if cached
|
4136
|
+
node_cache[:two_surrogate][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4137
|
+
@index = cached.interval.end
|
4138
|
+
end
|
4139
|
+
return cached
|
4140
|
+
end
|
4141
|
+
|
4142
|
+
i0, s0 = index, []
|
4143
|
+
r1 = _nt_high_surrogate
|
4144
|
+
s0 << r1
|
4145
|
+
if r1
|
4146
|
+
if (match_len = has_terminal?("\\", false, index))
|
4147
|
+
r2 = true
|
4148
|
+
@index += match_len
|
4149
|
+
else
|
4150
|
+
terminal_parse_failure('"\\\\"')
|
4151
|
+
r2 = nil
|
4152
|
+
end
|
4153
|
+
s0 << r2
|
4154
|
+
if r2
|
4155
|
+
if (match_len = has_terminal?("u", false, index))
|
4156
|
+
r3 = true
|
4157
|
+
@index += match_len
|
4158
|
+
else
|
4159
|
+
terminal_parse_failure('"u"')
|
4160
|
+
r3 = nil
|
4161
|
+
end
|
4162
|
+
s0 << r3
|
4163
|
+
if r3
|
4164
|
+
r4 = _nt_low_surrogate
|
4165
|
+
s0 << r4
|
4166
|
+
end
|
4167
|
+
end
|
4168
|
+
end
|
4169
|
+
if s0.last
|
4170
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4171
|
+
r0.extend(TwoSurrogate0)
|
4172
|
+
r0.extend(TwoSurrogate1)
|
4173
|
+
else
|
4174
|
+
@index = i0
|
4175
|
+
r0 = nil
|
4176
|
+
end
|
4177
|
+
|
4178
|
+
node_cache[:two_surrogate][start_index] = r0
|
4179
|
+
|
4180
|
+
r0
|
4181
|
+
end
|
4182
|
+
|
4140
4183
|
module HighSurrogate0
|
4141
4184
|
end
|
4142
4185
|
|
@@ -4521,438 +4564,3818 @@ module EDNGRAMMAR
|
|
4521
4564
|
r0
|
4522
4565
|
end
|
4523
4566
|
|
4524
|
-
|
4567
|
+
module HexcharS0
|
4568
|
+
end
|
4569
|
+
|
4570
|
+
module HexcharS1
|
4571
|
+
end
|
4572
|
+
|
4573
|
+
module HexcharS2
|
4574
|
+
def ast; elements[1].hex_value.chr(Encoding::UTF_8) end
|
4575
|
+
end
|
4576
|
+
|
4577
|
+
module HexcharS3
|
4578
|
+
def ast; hex_value.chr(Encoding::UTF_8) end
|
4579
|
+
end
|
4580
|
+
|
4581
|
+
def _nt_hexchar_s
|
4525
4582
|
start_index = index
|
4526
|
-
if node_cache[:
|
4527
|
-
cached = node_cache[:
|
4583
|
+
if node_cache[:hexchar_s].has_key?(index)
|
4584
|
+
cached = node_cache[:hexchar_s][index]
|
4528
4585
|
if cached
|
4529
|
-
node_cache[:
|
4586
|
+
node_cache[:hexchar_s][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4530
4587
|
@index = cached.interval.end
|
4531
4588
|
end
|
4532
4589
|
return cached
|
4533
4590
|
end
|
4534
4591
|
|
4535
4592
|
i0 = index
|
4536
|
-
|
4537
|
-
|
4593
|
+
i1, s1 = index, []
|
4594
|
+
if (match_len = has_terminal?("{", false, index))
|
4595
|
+
r2 = true
|
4538
4596
|
@index += match_len
|
4539
4597
|
else
|
4540
|
-
terminal_parse_failure('"
|
4541
|
-
|
4598
|
+
terminal_parse_failure('"{"')
|
4599
|
+
r2 = nil
|
4542
4600
|
end
|
4543
|
-
|
4544
|
-
|
4545
|
-
|
4546
|
-
|
4547
|
-
|
4548
|
-
|
4549
|
-
|
4601
|
+
s1 << r2
|
4602
|
+
if r2
|
4603
|
+
i3 = index
|
4604
|
+
i4, s4 = index, []
|
4605
|
+
s5, i5 = [], index
|
4606
|
+
loop do
|
4607
|
+
if (match_len = has_terminal?("0", false, index))
|
4608
|
+
r6 = true
|
4609
|
+
@index += match_len
|
4610
|
+
else
|
4611
|
+
terminal_parse_failure('"0"')
|
4612
|
+
r6 = nil
|
4613
|
+
end
|
4614
|
+
if r6
|
4615
|
+
s5 << r6
|
4616
|
+
else
|
4617
|
+
break
|
4618
|
+
end
|
4619
|
+
end
|
4620
|
+
if s5.empty?
|
4621
|
+
@index = i5
|
4622
|
+
r5 = nil
|
4550
4623
|
else
|
4551
|
-
|
4552
|
-
r2 = nil
|
4624
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
4553
4625
|
end
|
4554
|
-
|
4555
|
-
|
4556
|
-
|
4626
|
+
s4 << r5
|
4627
|
+
if r5
|
4628
|
+
r8 = _nt_hexscalar_s
|
4629
|
+
if r8
|
4630
|
+
r7 = r8
|
4631
|
+
else
|
4632
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
4633
|
+
end
|
4634
|
+
s4 << r7
|
4635
|
+
end
|
4636
|
+
if s4.last
|
4637
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
4638
|
+
r4.extend(HexcharS0)
|
4557
4639
|
else
|
4558
|
-
|
4559
|
-
|
4560
|
-
|
4640
|
+
@index = i4
|
4641
|
+
r4 = nil
|
4642
|
+
end
|
4643
|
+
if r4
|
4644
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
4645
|
+
r3 = r4
|
4646
|
+
else
|
4647
|
+
r9 = _nt_hexscalar_s
|
4648
|
+
if r9
|
4649
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
4650
|
+
r3 = r9
|
4561
4651
|
else
|
4562
|
-
|
4652
|
+
@index = i3
|
4563
4653
|
r3 = nil
|
4564
4654
|
end
|
4565
|
-
|
4566
|
-
|
4567
|
-
|
4655
|
+
end
|
4656
|
+
s1 << r3
|
4657
|
+
if r3
|
4658
|
+
if (match_len = has_terminal?("}", false, index))
|
4659
|
+
r10 = true
|
4660
|
+
@index += match_len
|
4568
4661
|
else
|
4569
|
-
|
4570
|
-
|
4571
|
-
|
4572
|
-
|
4573
|
-
|
4574
|
-
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
4580
|
-
|
4581
|
-
|
4582
|
-
|
4583
|
-
|
4584
|
-
|
4585
|
-
|
4586
|
-
|
4587
|
-
|
4588
|
-
|
4589
|
-
|
4590
|
-
|
4591
|
-
|
4592
|
-
|
4593
|
-
|
4594
|
-
|
4595
|
-
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4601
|
-
else
|
4602
|
-
if has_terminal?(@regexps[gr = '\A[-]'] ||= Regexp.new(gr), :regexp, index)
|
4603
|
-
r7 = true
|
4604
|
-
@index += 1
|
4605
|
-
else
|
4606
|
-
terminal_parse_failure('[-]')
|
4607
|
-
r7 = nil
|
4608
|
-
end
|
4609
|
-
if r7
|
4610
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
4611
|
-
r0 = r7
|
4612
|
-
else
|
4613
|
-
@index = i0
|
4614
|
-
r0 = nil
|
4615
|
-
end
|
4616
|
-
end
|
4617
|
-
end
|
4618
|
-
end
|
4662
|
+
terminal_parse_failure('"}"')
|
4663
|
+
r10 = nil
|
4664
|
+
end
|
4665
|
+
s1 << r10
|
4666
|
+
end
|
4667
|
+
end
|
4668
|
+
if s1.last
|
4669
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
4670
|
+
r1.extend(HexcharS1)
|
4671
|
+
r1.extend(HexcharS2)
|
4672
|
+
else
|
4673
|
+
@index = i1
|
4674
|
+
r1 = nil
|
4675
|
+
end
|
4676
|
+
if r1
|
4677
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
4678
|
+
r0 = r1
|
4679
|
+
else
|
4680
|
+
r11 = _nt_non_surrogate_s
|
4681
|
+
r11.extend(HexcharS3)
|
4682
|
+
r11.extend(HexcharS3)
|
4683
|
+
if r11
|
4684
|
+
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
4685
|
+
r0 = r11
|
4686
|
+
else
|
4687
|
+
r12 = _nt_two_surrogate
|
4688
|
+
if r12
|
4689
|
+
r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
|
4690
|
+
r0 = r12
|
4691
|
+
else
|
4692
|
+
@index = i0
|
4693
|
+
r0 = nil
|
4619
4694
|
end
|
4620
4695
|
end
|
4621
4696
|
end
|
4622
4697
|
|
4623
|
-
node_cache[:
|
4698
|
+
node_cache[:hexchar_s][start_index] = r0
|
4624
4699
|
|
4625
4700
|
r0
|
4626
4701
|
end
|
4627
4702
|
|
4628
|
-
|
4629
|
-
|
4630
|
-
|
4631
|
-
cached = node_cache[:DQUOTE][index]
|
4632
|
-
if cached
|
4633
|
-
node_cache[:DQUOTE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4634
|
-
@index = cached.interval.end
|
4635
|
-
end
|
4636
|
-
return cached
|
4703
|
+
module NonSurrogateS0
|
4704
|
+
def HEXDIG
|
4705
|
+
elements[2]
|
4637
4706
|
end
|
4707
|
+
end
|
4638
4708
|
|
4639
|
-
|
4640
|
-
|
4709
|
+
module NonSurrogateS1
|
4710
|
+
def HEXDIG1
|
4711
|
+
elements[1]
|
4712
|
+
end
|
4713
|
+
|
4714
|
+
end
|
4715
|
+
|
4716
|
+
def _nt_non_surrogate_s
|
4717
|
+
start_index = index
|
4718
|
+
if node_cache[:non_surrogate_s].has_key?(index)
|
4719
|
+
cached = node_cache[:non_surrogate_s][index]
|
4720
|
+
if cached
|
4721
|
+
node_cache[:non_surrogate_s][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4722
|
+
@index = cached.interval.end
|
4723
|
+
end
|
4724
|
+
return cached
|
4725
|
+
end
|
4726
|
+
|
4727
|
+
i0 = index
|
4728
|
+
if (match_len = has_terminal?("007f", :insens, index))
|
4729
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4730
|
+
@index += match_len
|
4731
|
+
else
|
4732
|
+
terminal_parse_failure('"007F"')
|
4733
|
+
r1 = nil
|
4734
|
+
end
|
4735
|
+
if r1
|
4736
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
4737
|
+
r0 = r1
|
4738
|
+
else
|
4739
|
+
i2, s2 = index, []
|
4740
|
+
if (match_len = has_terminal?("00", false, index))
|
4741
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4742
|
+
@index += match_len
|
4743
|
+
else
|
4744
|
+
terminal_parse_failure('"00"')
|
4745
|
+
r3 = nil
|
4746
|
+
end
|
4747
|
+
s2 << r3
|
4748
|
+
if r3
|
4749
|
+
i4 = index
|
4750
|
+
if (match_len = has_terminal?("0", false, index))
|
4751
|
+
r5 = true
|
4752
|
+
@index += match_len
|
4753
|
+
else
|
4754
|
+
terminal_parse_failure('"0"')
|
4755
|
+
r5 = nil
|
4756
|
+
end
|
4757
|
+
if r5
|
4758
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
4759
|
+
r4 = r5
|
4760
|
+
else
|
4761
|
+
if (match_len = has_terminal?("1", false, index))
|
4762
|
+
r6 = true
|
4763
|
+
@index += match_len
|
4764
|
+
else
|
4765
|
+
terminal_parse_failure('"1"')
|
4766
|
+
r6 = nil
|
4767
|
+
end
|
4768
|
+
if r6
|
4769
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
4770
|
+
r4 = r6
|
4771
|
+
else
|
4772
|
+
if (match_len = has_terminal?("8", false, index))
|
4773
|
+
r7 = true
|
4774
|
+
@index += match_len
|
4775
|
+
else
|
4776
|
+
terminal_parse_failure('"8"')
|
4777
|
+
r7 = nil
|
4778
|
+
end
|
4779
|
+
if r7
|
4780
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
4781
|
+
r4 = r7
|
4782
|
+
else
|
4783
|
+
if (match_len = has_terminal?("9", false, index))
|
4784
|
+
r8 = true
|
4785
|
+
@index += match_len
|
4786
|
+
else
|
4787
|
+
terminal_parse_failure('"9"')
|
4788
|
+
r8 = nil
|
4789
|
+
end
|
4790
|
+
if r8
|
4791
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
4792
|
+
r4 = r8
|
4793
|
+
else
|
4794
|
+
r9 = _nt_HEXDIGA
|
4795
|
+
if r9
|
4796
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
4797
|
+
r4 = r9
|
4798
|
+
else
|
4799
|
+
@index = i4
|
4800
|
+
r4 = nil
|
4801
|
+
end
|
4802
|
+
end
|
4803
|
+
end
|
4804
|
+
end
|
4805
|
+
end
|
4806
|
+
s2 << r4
|
4807
|
+
if r4
|
4808
|
+
r10 = _nt_HEXDIG
|
4809
|
+
s2 << r10
|
4810
|
+
end
|
4811
|
+
end
|
4812
|
+
if s2.last
|
4813
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
4814
|
+
r2.extend(NonSurrogateS0)
|
4815
|
+
else
|
4816
|
+
@index = i2
|
4817
|
+
r2 = nil
|
4818
|
+
end
|
4819
|
+
if r2
|
4820
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
4821
|
+
r0 = r2
|
4822
|
+
else
|
4823
|
+
i11, s11 = index, []
|
4824
|
+
if (match_len = has_terminal?("0", false, index))
|
4825
|
+
r12 = true
|
4826
|
+
@index += match_len
|
4827
|
+
else
|
4828
|
+
terminal_parse_failure('"0"')
|
4829
|
+
r12 = nil
|
4830
|
+
end
|
4831
|
+
s11 << r12
|
4832
|
+
if r12
|
4833
|
+
r13 = _nt_HEXDIG1
|
4834
|
+
s11 << r13
|
4835
|
+
if r13
|
4836
|
+
s14, i14 = [], index
|
4837
|
+
loop do
|
4838
|
+
r15 = _nt_HEXDIG
|
4839
|
+
if r15
|
4840
|
+
s14 << r15
|
4841
|
+
else
|
4842
|
+
break
|
4843
|
+
end
|
4844
|
+
if s14.size == 2
|
4845
|
+
break
|
4846
|
+
end
|
4847
|
+
end
|
4848
|
+
if s14.size < 2
|
4849
|
+
@index = i14
|
4850
|
+
r14 = nil
|
4851
|
+
else
|
4852
|
+
if s14.size < 2
|
4853
|
+
@terminal_failures.pop
|
4854
|
+
end
|
4855
|
+
r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
|
4856
|
+
end
|
4857
|
+
s11 << r14
|
4858
|
+
end
|
4859
|
+
end
|
4860
|
+
if s11.last
|
4861
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
4862
|
+
r11.extend(NonSurrogateS1)
|
4863
|
+
else
|
4864
|
+
@index = i11
|
4865
|
+
r11 = nil
|
4866
|
+
end
|
4867
|
+
if r11
|
4868
|
+
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
4869
|
+
r0 = r11
|
4870
|
+
else
|
4871
|
+
r16 = _nt_non_surrogate_1
|
4872
|
+
if r16
|
4873
|
+
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
4874
|
+
r0 = r16
|
4875
|
+
else
|
4876
|
+
@index = i0
|
4877
|
+
r0 = nil
|
4878
|
+
end
|
4879
|
+
end
|
4880
|
+
end
|
4881
|
+
end
|
4882
|
+
|
4883
|
+
node_cache[:non_surrogate_s][start_index] = r0
|
4884
|
+
|
4885
|
+
r0
|
4886
|
+
end
|
4887
|
+
|
4888
|
+
module NonSurrogate10
|
4889
|
+
end
|
4890
|
+
|
4891
|
+
module NonSurrogate11
|
4892
|
+
def ODIGIT
|
4893
|
+
elements[1]
|
4894
|
+
end
|
4895
|
+
|
4896
|
+
end
|
4897
|
+
|
4898
|
+
def _nt_non_surrogate_1
|
4899
|
+
start_index = index
|
4900
|
+
if node_cache[:non_surrogate_1].has_key?(index)
|
4901
|
+
cached = node_cache[:non_surrogate_1][index]
|
4902
|
+
if cached
|
4903
|
+
node_cache[:non_surrogate_1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4904
|
+
@index = cached.interval.end
|
4905
|
+
end
|
4906
|
+
return cached
|
4907
|
+
end
|
4908
|
+
|
4909
|
+
i0 = index
|
4910
|
+
i1, s1 = index, []
|
4911
|
+
i2 = index
|
4912
|
+
r3 = _nt_DIGIT1
|
4913
|
+
if r3
|
4914
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
4915
|
+
r2 = r3
|
4916
|
+
else
|
4917
|
+
if (match_len = has_terminal?("a", :insens, index))
|
4918
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4919
|
+
@index += match_len
|
4920
|
+
else
|
4921
|
+
terminal_parse_failure('"A"')
|
4922
|
+
r4 = nil
|
4923
|
+
end
|
4924
|
+
if r4
|
4925
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
4926
|
+
r2 = r4
|
4927
|
+
else
|
4928
|
+
if (match_len = has_terminal?("b", :insens, index))
|
4929
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4930
|
+
@index += match_len
|
4931
|
+
else
|
4932
|
+
terminal_parse_failure('"B"')
|
4933
|
+
r5 = nil
|
4934
|
+
end
|
4935
|
+
if r5
|
4936
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
4937
|
+
r2 = r5
|
4938
|
+
else
|
4939
|
+
if (match_len = has_terminal?("c", :insens, index))
|
4940
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4941
|
+
@index += match_len
|
4942
|
+
else
|
4943
|
+
terminal_parse_failure('"C"')
|
4944
|
+
r6 = nil
|
4945
|
+
end
|
4946
|
+
if r6
|
4947
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
4948
|
+
r2 = r6
|
4949
|
+
else
|
4950
|
+
if (match_len = has_terminal?("e", :insens, index))
|
4951
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4952
|
+
@index += match_len
|
4953
|
+
else
|
4954
|
+
terminal_parse_failure('"E"')
|
4955
|
+
r7 = nil
|
4956
|
+
end
|
4957
|
+
if r7
|
4958
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
4959
|
+
r2 = r7
|
4960
|
+
else
|
4961
|
+
if (match_len = has_terminal?("f", :insens, index))
|
4962
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4963
|
+
@index += match_len
|
4964
|
+
else
|
4965
|
+
terminal_parse_failure('"F"')
|
4966
|
+
r8 = nil
|
4967
|
+
end
|
4968
|
+
if r8
|
4969
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
4970
|
+
r2 = r8
|
4971
|
+
else
|
4972
|
+
@index = i2
|
4973
|
+
r2 = nil
|
4974
|
+
end
|
4975
|
+
end
|
4976
|
+
end
|
4977
|
+
end
|
4978
|
+
end
|
4979
|
+
end
|
4980
|
+
s1 << r2
|
4981
|
+
if r2
|
4982
|
+
s9, i9 = [], index
|
4983
|
+
loop do
|
4984
|
+
r10 = _nt_HEXDIG
|
4985
|
+
if r10
|
4986
|
+
s9 << r10
|
4987
|
+
else
|
4988
|
+
break
|
4989
|
+
end
|
4990
|
+
if s9.size == 3
|
4991
|
+
break
|
4992
|
+
end
|
4993
|
+
end
|
4994
|
+
if s9.size < 3
|
4995
|
+
@index = i9
|
4996
|
+
r9 = nil
|
4997
|
+
else
|
4998
|
+
if s9.size < 3
|
4999
|
+
@terminal_failures.pop
|
5000
|
+
end
|
5001
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
5002
|
+
end
|
5003
|
+
s1 << r9
|
5004
|
+
end
|
5005
|
+
if s1.last
|
5006
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
5007
|
+
r1.extend(NonSurrogate10)
|
5008
|
+
else
|
5009
|
+
@index = i1
|
5010
|
+
r1 = nil
|
5011
|
+
end
|
5012
|
+
if r1
|
5013
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5014
|
+
r0 = r1
|
5015
|
+
else
|
5016
|
+
i11, s11 = index, []
|
5017
|
+
if (match_len = has_terminal?("d", :insens, index))
|
5018
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5019
|
+
@index += match_len
|
5020
|
+
else
|
5021
|
+
terminal_parse_failure('"D"')
|
5022
|
+
r12 = nil
|
5023
|
+
end
|
5024
|
+
s11 << r12
|
5025
|
+
if r12
|
5026
|
+
r13 = _nt_ODIGIT
|
5027
|
+
s11 << r13
|
5028
|
+
if r13
|
5029
|
+
s14, i14 = [], index
|
5030
|
+
loop do
|
5031
|
+
r15 = _nt_HEXDIG
|
5032
|
+
if r15
|
5033
|
+
s14 << r15
|
5034
|
+
else
|
5035
|
+
break
|
5036
|
+
end
|
5037
|
+
if s14.size == 2
|
5038
|
+
break
|
5039
|
+
end
|
5040
|
+
end
|
5041
|
+
if s14.size < 2
|
5042
|
+
@index = i14
|
5043
|
+
r14 = nil
|
5044
|
+
else
|
5045
|
+
if s14.size < 2
|
5046
|
+
@terminal_failures.pop
|
5047
|
+
end
|
5048
|
+
r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
|
5049
|
+
end
|
5050
|
+
s11 << r14
|
5051
|
+
end
|
5052
|
+
end
|
5053
|
+
if s11.last
|
5054
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
5055
|
+
r11.extend(NonSurrogate11)
|
5056
|
+
else
|
5057
|
+
@index = i11
|
5058
|
+
r11 = nil
|
5059
|
+
end
|
5060
|
+
if r11
|
5061
|
+
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
5062
|
+
r0 = r11
|
5063
|
+
else
|
5064
|
+
@index = i0
|
5065
|
+
r0 = nil
|
5066
|
+
end
|
5067
|
+
end
|
5068
|
+
|
5069
|
+
node_cache[:non_surrogate_1][start_index] = r0
|
5070
|
+
|
5071
|
+
r0
|
5072
|
+
end
|
5073
|
+
|
5074
|
+
module HexscalarS0
|
5075
|
+
end
|
5076
|
+
|
5077
|
+
module HexscalarS1
|
5078
|
+
def HEXDIG1
|
5079
|
+
elements[0]
|
5080
|
+
end
|
5081
|
+
|
5082
|
+
end
|
5083
|
+
|
5084
|
+
module HexscalarS2
|
5085
|
+
def HEXDIG1
|
5086
|
+
elements[0]
|
5087
|
+
end
|
5088
|
+
|
5089
|
+
end
|
5090
|
+
|
5091
|
+
module HexscalarS3
|
5092
|
+
def HEXDIG
|
5093
|
+
elements[1]
|
5094
|
+
end
|
5095
|
+
end
|
5096
|
+
|
5097
|
+
def _nt_hexscalar_s
|
5098
|
+
start_index = index
|
5099
|
+
if node_cache[:hexscalar_s].has_key?(index)
|
5100
|
+
cached = node_cache[:hexscalar_s][index]
|
5101
|
+
if cached
|
5102
|
+
node_cache[:hexscalar_s][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5103
|
+
@index = cached.interval.end
|
5104
|
+
end
|
5105
|
+
return cached
|
5106
|
+
end
|
5107
|
+
|
5108
|
+
i0 = index
|
5109
|
+
i1, s1 = index, []
|
5110
|
+
if (match_len = has_terminal?("10", false, index))
|
5111
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5112
|
+
@index += match_len
|
5113
|
+
else
|
5114
|
+
terminal_parse_failure('"10"')
|
5115
|
+
r2 = nil
|
5116
|
+
end
|
5117
|
+
s1 << r2
|
5118
|
+
if r2
|
5119
|
+
s3, i3 = [], index
|
5120
|
+
loop do
|
5121
|
+
r4 = _nt_HEXDIG
|
5122
|
+
if r4
|
5123
|
+
s3 << r4
|
5124
|
+
else
|
5125
|
+
break
|
5126
|
+
end
|
5127
|
+
if s3.size == 4
|
5128
|
+
break
|
5129
|
+
end
|
5130
|
+
end
|
5131
|
+
if s3.size < 4
|
5132
|
+
@index = i3
|
5133
|
+
r3 = nil
|
5134
|
+
else
|
5135
|
+
if s3.size < 4
|
5136
|
+
@terminal_failures.pop
|
5137
|
+
end
|
5138
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
5139
|
+
end
|
5140
|
+
s1 << r3
|
5141
|
+
end
|
5142
|
+
if s1.last
|
5143
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
5144
|
+
r1.extend(HexscalarS0)
|
5145
|
+
else
|
5146
|
+
@index = i1
|
5147
|
+
r1 = nil
|
5148
|
+
end
|
5149
|
+
if r1
|
5150
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5151
|
+
r0 = r1
|
5152
|
+
else
|
5153
|
+
i5, s5 = index, []
|
5154
|
+
r6 = _nt_HEXDIG1
|
5155
|
+
s5 << r6
|
5156
|
+
if r6
|
5157
|
+
s7, i7 = [], index
|
5158
|
+
loop do
|
5159
|
+
r8 = _nt_HEXDIG
|
5160
|
+
if r8
|
5161
|
+
s7 << r8
|
5162
|
+
else
|
5163
|
+
break
|
5164
|
+
end
|
5165
|
+
if s7.size == 4
|
5166
|
+
break
|
5167
|
+
end
|
5168
|
+
end
|
5169
|
+
if s7.size < 4
|
5170
|
+
@index = i7
|
5171
|
+
r7 = nil
|
5172
|
+
else
|
5173
|
+
if s7.size < 4
|
5174
|
+
@terminal_failures.pop
|
5175
|
+
end
|
5176
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
5177
|
+
end
|
5178
|
+
s5 << r7
|
5179
|
+
end
|
5180
|
+
if s5.last
|
5181
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
5182
|
+
r5.extend(HexscalarS1)
|
5183
|
+
else
|
5184
|
+
@index = i5
|
5185
|
+
r5 = nil
|
5186
|
+
end
|
5187
|
+
if r5
|
5188
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
5189
|
+
r0 = r5
|
5190
|
+
else
|
5191
|
+
r9 = _nt_non_surrogate_1
|
5192
|
+
if r9
|
5193
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
5194
|
+
r0 = r9
|
5195
|
+
else
|
5196
|
+
i10, s10 = index, []
|
5197
|
+
r11 = _nt_HEXDIG1
|
5198
|
+
s10 << r11
|
5199
|
+
if r11
|
5200
|
+
s12, i12 = [], index
|
5201
|
+
loop do
|
5202
|
+
r13 = _nt_HEXDIG
|
5203
|
+
if r13
|
5204
|
+
s12 << r13
|
5205
|
+
else
|
5206
|
+
break
|
5207
|
+
end
|
5208
|
+
if s12.size == 2
|
5209
|
+
break
|
5210
|
+
end
|
5211
|
+
end
|
5212
|
+
if s12.size < 2
|
5213
|
+
@index = i12
|
5214
|
+
r12 = nil
|
5215
|
+
else
|
5216
|
+
if s12.size < 2
|
5217
|
+
@terminal_failures.pop
|
5218
|
+
end
|
5219
|
+
r12 = instantiate_node(SyntaxNode,input, i12...index, s12)
|
5220
|
+
end
|
5221
|
+
s10 << r12
|
5222
|
+
end
|
5223
|
+
if s10.last
|
5224
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
5225
|
+
r10.extend(HexscalarS2)
|
5226
|
+
else
|
5227
|
+
@index = i10
|
5228
|
+
r10 = nil
|
5229
|
+
end
|
5230
|
+
if r10
|
5231
|
+
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
5232
|
+
r0 = r10
|
5233
|
+
else
|
5234
|
+
i14, s14 = index, []
|
5235
|
+
i15 = index
|
5236
|
+
if (match_len = has_terminal?("1", false, index))
|
5237
|
+
r16 = true
|
5238
|
+
@index += match_len
|
5239
|
+
else
|
5240
|
+
terminal_parse_failure('"1"')
|
5241
|
+
r16 = nil
|
5242
|
+
end
|
5243
|
+
if r16
|
5244
|
+
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
5245
|
+
r15 = r16
|
5246
|
+
else
|
5247
|
+
if (match_len = has_terminal?("8", false, index))
|
5248
|
+
r17 = true
|
5249
|
+
@index += match_len
|
5250
|
+
else
|
5251
|
+
terminal_parse_failure('"8"')
|
5252
|
+
r17 = nil
|
5253
|
+
end
|
5254
|
+
if r17
|
5255
|
+
r17 = SyntaxNode.new(input, (index-1)...index) if r17 == true
|
5256
|
+
r15 = r17
|
5257
|
+
else
|
5258
|
+
if (match_len = has_terminal?("9", false, index))
|
5259
|
+
r18 = true
|
5260
|
+
@index += match_len
|
5261
|
+
else
|
5262
|
+
terminal_parse_failure('"9"')
|
5263
|
+
r18 = nil
|
5264
|
+
end
|
5265
|
+
if r18
|
5266
|
+
r18 = SyntaxNode.new(input, (index-1)...index) if r18 == true
|
5267
|
+
r15 = r18
|
5268
|
+
else
|
5269
|
+
r19 = _nt_HEXDIGA
|
5270
|
+
if r19
|
5271
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
5272
|
+
r15 = r19
|
5273
|
+
else
|
5274
|
+
@index = i15
|
5275
|
+
r15 = nil
|
5276
|
+
end
|
5277
|
+
end
|
5278
|
+
end
|
5279
|
+
end
|
5280
|
+
s14 << r15
|
5281
|
+
if r15
|
5282
|
+
r20 = _nt_HEXDIG
|
5283
|
+
s14 << r20
|
5284
|
+
end
|
5285
|
+
if s14.last
|
5286
|
+
r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
|
5287
|
+
r14.extend(HexscalarS3)
|
5288
|
+
else
|
5289
|
+
@index = i14
|
5290
|
+
r14 = nil
|
5291
|
+
end
|
5292
|
+
if r14
|
5293
|
+
r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
|
5294
|
+
r0 = r14
|
5295
|
+
else
|
5296
|
+
if (match_len = has_terminal?("7f", :insens, index))
|
5297
|
+
r21 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5298
|
+
@index += match_len
|
5299
|
+
else
|
5300
|
+
terminal_parse_failure('"7F"')
|
5301
|
+
r21 = nil
|
5302
|
+
end
|
5303
|
+
if r21
|
5304
|
+
r21 = SyntaxNode.new(input, (index-1)...index) if r21 == true
|
5305
|
+
r0 = r21
|
5306
|
+
else
|
5307
|
+
r22 = _nt_HEXDIG1
|
5308
|
+
if r22
|
5309
|
+
r22 = SyntaxNode.new(input, (index-1)...index) if r22 == true
|
5310
|
+
r0 = r22
|
5311
|
+
else
|
5312
|
+
@index = i0
|
5313
|
+
r0 = nil
|
5314
|
+
end
|
5315
|
+
end
|
5316
|
+
end
|
5317
|
+
end
|
5318
|
+
end
|
5319
|
+
end
|
5320
|
+
end
|
5321
|
+
|
5322
|
+
node_cache[:hexscalar_s][start_index] = r0
|
5323
|
+
|
5324
|
+
r0
|
5325
|
+
end
|
5326
|
+
|
5327
|
+
def _nt_unescaped
|
5328
|
+
start_index = index
|
5329
|
+
if node_cache[:unescaped].has_key?(index)
|
5330
|
+
cached = node_cache[:unescaped][index]
|
5331
|
+
if cached
|
5332
|
+
node_cache[:unescaped][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5333
|
+
@index = cached.interval.end
|
5334
|
+
end
|
5335
|
+
return cached
|
5336
|
+
end
|
5337
|
+
|
5338
|
+
i0 = index
|
5339
|
+
if (match_len = has_terminal?("\n", false, index))
|
5340
|
+
r1 = true
|
5341
|
+
@index += match_len
|
5342
|
+
else
|
5343
|
+
terminal_parse_failure('"\\n"')
|
5344
|
+
r1 = nil
|
5345
|
+
end
|
5346
|
+
if r1
|
5347
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5348
|
+
r0 = r1
|
5349
|
+
else
|
5350
|
+
if (match_len = has_terminal?("\r", false, index))
|
5351
|
+
r2 = true
|
5352
|
+
@index += match_len
|
5353
|
+
else
|
5354
|
+
terminal_parse_failure('"\\r"')
|
5355
|
+
r2 = nil
|
5356
|
+
end
|
5357
|
+
if r2
|
5358
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5359
|
+
r0 = r2
|
5360
|
+
else
|
5361
|
+
if has_terminal?(@regexps[gr = '\A[\\ -!]'] ||= Regexp.new(gr), :regexp, index)
|
5362
|
+
r3 = true
|
5363
|
+
@index += 1
|
5364
|
+
else
|
5365
|
+
terminal_parse_failure('[\\ -!]')
|
5366
|
+
r3 = nil
|
5367
|
+
end
|
5368
|
+
if r3
|
5369
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5370
|
+
r0 = r3
|
5371
|
+
else
|
5372
|
+
if has_terminal?(@regexps[gr = '\A[\\#-&]'] ||= Regexp.new(gr), :regexp, index)
|
5373
|
+
r4 = true
|
5374
|
+
@index += 1
|
5375
|
+
else
|
5376
|
+
terminal_parse_failure('[\\#-&]')
|
5377
|
+
r4 = nil
|
5378
|
+
end
|
5379
|
+
if r4
|
5380
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
5381
|
+
r0 = r4
|
5382
|
+
else
|
5383
|
+
if has_terminal?(@regexps[gr = '\A[\\(-\\[]'] ||= Regexp.new(gr), :regexp, index)
|
5384
|
+
r5 = true
|
5385
|
+
@index += 1
|
5386
|
+
else
|
5387
|
+
terminal_parse_failure('[\\(-\\[]')
|
5388
|
+
r5 = nil
|
5389
|
+
end
|
5390
|
+
if r5
|
5391
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
5392
|
+
r0 = r5
|
5393
|
+
else
|
5394
|
+
if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
|
5395
|
+
r6 = true
|
5396
|
+
@index += 1
|
5397
|
+
else
|
5398
|
+
terminal_parse_failure('[\\]-]')
|
5399
|
+
r6 = nil
|
5400
|
+
end
|
5401
|
+
if r6
|
5402
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
5403
|
+
r0 = r6
|
5404
|
+
else
|
5405
|
+
r7 = _nt_NONASCII
|
5406
|
+
if r7
|
5407
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
5408
|
+
r0 = r7
|
5409
|
+
else
|
5410
|
+
@index = i0
|
5411
|
+
r0 = nil
|
5412
|
+
end
|
5413
|
+
end
|
5414
|
+
end
|
5415
|
+
end
|
5416
|
+
end
|
5417
|
+
end
|
5418
|
+
end
|
5419
|
+
|
5420
|
+
node_cache[:unescaped][start_index] = r0
|
5421
|
+
|
5422
|
+
r0
|
5423
|
+
end
|
5424
|
+
|
5425
|
+
def _nt_DQUOTE
|
5426
|
+
start_index = index
|
5427
|
+
if node_cache[:DQUOTE].has_key?(index)
|
5428
|
+
cached = node_cache[:DQUOTE][index]
|
5429
|
+
if cached
|
5430
|
+
node_cache[:DQUOTE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5431
|
+
@index = cached.interval.end
|
5432
|
+
end
|
5433
|
+
return cached
|
5434
|
+
end
|
5435
|
+
|
5436
|
+
if (match_len = has_terminal?("\"", false, index))
|
5437
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5438
|
+
@index += match_len
|
5439
|
+
else
|
5440
|
+
terminal_parse_failure('"\\""')
|
5441
|
+
r0 = nil
|
5442
|
+
end
|
5443
|
+
|
5444
|
+
node_cache[:DQUOTE][start_index] = r0
|
5445
|
+
|
5446
|
+
r0
|
5447
|
+
end
|
5448
|
+
|
5449
|
+
def _nt_SQUOTE
|
5450
|
+
start_index = index
|
5451
|
+
if node_cache[:SQUOTE].has_key?(index)
|
5452
|
+
cached = node_cache[:SQUOTE][index]
|
5453
|
+
if cached
|
5454
|
+
node_cache[:SQUOTE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5455
|
+
@index = cached.interval.end
|
5456
|
+
end
|
5457
|
+
return cached
|
5458
|
+
end
|
5459
|
+
|
5460
|
+
if (match_len = has_terminal?("'", false, index))
|
5461
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5462
|
+
@index += match_len
|
5463
|
+
else
|
5464
|
+
terminal_parse_failure('"\'"')
|
5465
|
+
r0 = nil
|
5466
|
+
end
|
5467
|
+
|
5468
|
+
node_cache[:SQUOTE][start_index] = r0
|
5469
|
+
|
5470
|
+
r0
|
5471
|
+
end
|
5472
|
+
|
5473
|
+
def _nt_DIGIT
|
5474
|
+
start_index = index
|
5475
|
+
if node_cache[:DIGIT].has_key?(index)
|
5476
|
+
cached = node_cache[:DIGIT][index]
|
5477
|
+
if cached
|
5478
|
+
node_cache[:DIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5479
|
+
@index = cached.interval.end
|
5480
|
+
end
|
5481
|
+
return cached
|
5482
|
+
end
|
5483
|
+
|
5484
|
+
if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index)
|
5485
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5486
|
+
@index += 1
|
5487
|
+
else
|
5488
|
+
terminal_parse_failure('[0-9]')
|
5489
|
+
r0 = nil
|
5490
|
+
end
|
5491
|
+
|
5492
|
+
node_cache[:DIGIT][start_index] = r0
|
5493
|
+
|
5494
|
+
r0
|
5495
|
+
end
|
5496
|
+
|
5497
|
+
def _nt_DIGIT1
|
5498
|
+
start_index = index
|
5499
|
+
if node_cache[:DIGIT1].has_key?(index)
|
5500
|
+
cached = node_cache[:DIGIT1][index]
|
5501
|
+
if cached
|
5502
|
+
node_cache[:DIGIT1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5503
|
+
@index = cached.interval.end
|
5504
|
+
end
|
5505
|
+
return cached
|
5506
|
+
end
|
5507
|
+
|
5508
|
+
if has_terminal?(@regexps[gr = '\A[1-9]'] ||= Regexp.new(gr), :regexp, index)
|
5509
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5510
|
+
@index += 1
|
5511
|
+
else
|
5512
|
+
terminal_parse_failure('[1-9]')
|
5513
|
+
r0 = nil
|
5514
|
+
end
|
5515
|
+
|
5516
|
+
node_cache[:DIGIT1][start_index] = r0
|
5517
|
+
|
5518
|
+
r0
|
5519
|
+
end
|
5520
|
+
|
5521
|
+
def _nt_ODIGIT
|
5522
|
+
start_index = index
|
5523
|
+
if node_cache[:ODIGIT].has_key?(index)
|
5524
|
+
cached = node_cache[:ODIGIT][index]
|
5525
|
+
if cached
|
5526
|
+
node_cache[:ODIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5527
|
+
@index = cached.interval.end
|
5528
|
+
end
|
5529
|
+
return cached
|
5530
|
+
end
|
5531
|
+
|
5532
|
+
if has_terminal?(@regexps[gr = '\A[0-7]'] ||= Regexp.new(gr), :regexp, index)
|
5533
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5534
|
+
@index += 1
|
5535
|
+
else
|
5536
|
+
terminal_parse_failure('[0-7]')
|
5537
|
+
r0 = nil
|
5538
|
+
end
|
5539
|
+
|
5540
|
+
node_cache[:ODIGIT][start_index] = r0
|
5541
|
+
|
5542
|
+
r0
|
5543
|
+
end
|
5544
|
+
|
5545
|
+
def _nt_BDIGIT
|
5546
|
+
start_index = index
|
5547
|
+
if node_cache[:BDIGIT].has_key?(index)
|
5548
|
+
cached = node_cache[:BDIGIT][index]
|
5549
|
+
if cached
|
5550
|
+
node_cache[:BDIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5551
|
+
@index = cached.interval.end
|
5552
|
+
end
|
5553
|
+
return cached
|
5554
|
+
end
|
5555
|
+
|
5556
|
+
if has_terminal?(@regexps[gr = '\A[0-1]'] ||= Regexp.new(gr), :regexp, index)
|
5557
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5558
|
+
@index += 1
|
5559
|
+
else
|
5560
|
+
terminal_parse_failure('[0-1]')
|
5561
|
+
r0 = nil
|
5562
|
+
end
|
5563
|
+
|
5564
|
+
node_cache[:BDIGIT][start_index] = r0
|
5565
|
+
|
5566
|
+
r0
|
5567
|
+
end
|
5568
|
+
|
5569
|
+
def _nt_HEXDIGA
|
5570
|
+
start_index = index
|
5571
|
+
if node_cache[:HEXDIGA].has_key?(index)
|
5572
|
+
cached = node_cache[:HEXDIGA][index]
|
5573
|
+
if cached
|
5574
|
+
node_cache[:HEXDIGA][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5575
|
+
@index = cached.interval.end
|
5576
|
+
end
|
5577
|
+
return cached
|
5578
|
+
end
|
5579
|
+
|
5580
|
+
i0 = index
|
5581
|
+
if (match_len = has_terminal?("a", :insens, index))
|
5582
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5583
|
+
@index += match_len
|
5584
|
+
else
|
5585
|
+
terminal_parse_failure('"A"')
|
5586
|
+
r1 = nil
|
5587
|
+
end
|
5588
|
+
if r1
|
5589
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5590
|
+
r0 = r1
|
5591
|
+
else
|
5592
|
+
if (match_len = has_terminal?("b", :insens, index))
|
5593
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5594
|
+
@index += match_len
|
5595
|
+
else
|
5596
|
+
terminal_parse_failure('"B"')
|
5597
|
+
r2 = nil
|
5598
|
+
end
|
5599
|
+
if r2
|
5600
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5601
|
+
r0 = r2
|
5602
|
+
else
|
5603
|
+
if (match_len = has_terminal?("c", :insens, index))
|
5604
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5605
|
+
@index += match_len
|
5606
|
+
else
|
5607
|
+
terminal_parse_failure('"C"')
|
5608
|
+
r3 = nil
|
5609
|
+
end
|
5610
|
+
if r3
|
5611
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5612
|
+
r0 = r3
|
5613
|
+
else
|
5614
|
+
if (match_len = has_terminal?("d", :insens, index))
|
5615
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5616
|
+
@index += match_len
|
5617
|
+
else
|
5618
|
+
terminal_parse_failure('"D"')
|
5619
|
+
r4 = nil
|
5620
|
+
end
|
5621
|
+
if r4
|
5622
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
5623
|
+
r0 = r4
|
5624
|
+
else
|
5625
|
+
if (match_len = has_terminal?("e", :insens, index))
|
5626
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5627
|
+
@index += match_len
|
5628
|
+
else
|
5629
|
+
terminal_parse_failure('"E"')
|
5630
|
+
r5 = nil
|
5631
|
+
end
|
5632
|
+
if r5
|
5633
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
5634
|
+
r0 = r5
|
5635
|
+
else
|
5636
|
+
if (match_len = has_terminal?("f", :insens, index))
|
5637
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
5638
|
+
@index += match_len
|
5639
|
+
else
|
5640
|
+
terminal_parse_failure('"F"')
|
5641
|
+
r6 = nil
|
5642
|
+
end
|
5643
|
+
if r6
|
5644
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
5645
|
+
r0 = r6
|
5646
|
+
else
|
5647
|
+
@index = i0
|
5648
|
+
r0 = nil
|
5649
|
+
end
|
5650
|
+
end
|
5651
|
+
end
|
5652
|
+
end
|
5653
|
+
end
|
5654
|
+
end
|
5655
|
+
|
5656
|
+
node_cache[:HEXDIGA][start_index] = r0
|
5657
|
+
|
5658
|
+
r0
|
5659
|
+
end
|
5660
|
+
|
5661
|
+
def _nt_HEXDIG
|
5662
|
+
start_index = index
|
5663
|
+
if node_cache[:HEXDIG].has_key?(index)
|
5664
|
+
cached = node_cache[:HEXDIG][index]
|
5665
|
+
if cached
|
5666
|
+
node_cache[:HEXDIG][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5667
|
+
@index = cached.interval.end
|
5668
|
+
end
|
5669
|
+
return cached
|
5670
|
+
end
|
5671
|
+
|
5672
|
+
i0 = index
|
5673
|
+
r1 = _nt_DIGIT
|
5674
|
+
if r1
|
5675
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5676
|
+
r0 = r1
|
5677
|
+
else
|
5678
|
+
r2 = _nt_HEXDIGA
|
5679
|
+
if r2
|
5680
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5681
|
+
r0 = r2
|
5682
|
+
else
|
5683
|
+
@index = i0
|
5684
|
+
r0 = nil
|
5685
|
+
end
|
5686
|
+
end
|
5687
|
+
|
5688
|
+
node_cache[:HEXDIG][start_index] = r0
|
5689
|
+
|
5690
|
+
r0
|
5691
|
+
end
|
5692
|
+
|
5693
|
+
def _nt_HEXDIG1
|
5694
|
+
start_index = index
|
5695
|
+
if node_cache[:HEXDIG1].has_key?(index)
|
5696
|
+
cached = node_cache[:HEXDIG1][index]
|
5697
|
+
if cached
|
5698
|
+
node_cache[:HEXDIG1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5699
|
+
@index = cached.interval.end
|
5700
|
+
end
|
5701
|
+
return cached
|
5702
|
+
end
|
5703
|
+
|
5704
|
+
i0 = index
|
5705
|
+
r1 = _nt_DIGIT1
|
5706
|
+
if r1
|
5707
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5708
|
+
r0 = r1
|
5709
|
+
else
|
5710
|
+
r2 = _nt_HEXDIGA
|
5711
|
+
if r2
|
5712
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5713
|
+
r0 = r2
|
5714
|
+
else
|
5715
|
+
@index = i0
|
5716
|
+
r0 = nil
|
5717
|
+
end
|
5718
|
+
end
|
5719
|
+
|
5720
|
+
node_cache[:HEXDIG1][start_index] = r0
|
5721
|
+
|
5722
|
+
r0
|
5723
|
+
end
|
5724
|
+
|
5725
|
+
def _nt_lcalpha
|
5726
|
+
start_index = index
|
5727
|
+
if node_cache[:lcalpha].has_key?(index)
|
5728
|
+
cached = node_cache[:lcalpha][index]
|
5729
|
+
if cached
|
5730
|
+
node_cache[:lcalpha][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5731
|
+
@index = cached.interval.end
|
5732
|
+
end
|
5733
|
+
return cached
|
5734
|
+
end
|
5735
|
+
|
5736
|
+
if has_terminal?(@regexps[gr = '\A[a-z]'] ||= Regexp.new(gr), :regexp, index)
|
5737
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5738
|
+
@index += 1
|
5739
|
+
else
|
5740
|
+
terminal_parse_failure('[a-z]')
|
5741
|
+
r0 = nil
|
5742
|
+
end
|
5743
|
+
|
5744
|
+
node_cache[:lcalpha][start_index] = r0
|
5745
|
+
|
5746
|
+
r0
|
5747
|
+
end
|
5748
|
+
|
5749
|
+
def _nt_lcldh
|
5750
|
+
start_index = index
|
5751
|
+
if node_cache[:lcldh].has_key?(index)
|
5752
|
+
cached = node_cache[:lcldh][index]
|
5753
|
+
if cached
|
5754
|
+
node_cache[:lcldh][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5755
|
+
@index = cached.interval.end
|
5756
|
+
end
|
5757
|
+
return cached
|
5758
|
+
end
|
5759
|
+
|
5760
|
+
i0 = index
|
5761
|
+
r1 = _nt_lcalpha
|
5762
|
+
if r1
|
5763
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5764
|
+
r0 = r1
|
5765
|
+
else
|
5766
|
+
r2 = _nt_DIGIT
|
5767
|
+
if r2
|
5768
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5769
|
+
r0 = r2
|
5770
|
+
else
|
5771
|
+
if (match_len = has_terminal?("-", false, index))
|
5772
|
+
r3 = true
|
5773
|
+
@index += match_len
|
5774
|
+
else
|
5775
|
+
terminal_parse_failure('"-"')
|
5776
|
+
r3 = nil
|
5777
|
+
end
|
5778
|
+
if r3
|
5779
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5780
|
+
r0 = r3
|
5781
|
+
else
|
5782
|
+
@index = i0
|
5783
|
+
r0 = nil
|
5784
|
+
end
|
5785
|
+
end
|
5786
|
+
end
|
5787
|
+
|
5788
|
+
node_cache[:lcldh][start_index] = r0
|
5789
|
+
|
5790
|
+
r0
|
5791
|
+
end
|
5792
|
+
|
5793
|
+
def _nt_ucalpha
|
5794
|
+
start_index = index
|
5795
|
+
if node_cache[:ucalpha].has_key?(index)
|
5796
|
+
cached = node_cache[:ucalpha][index]
|
5797
|
+
if cached
|
5798
|
+
node_cache[:ucalpha][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5799
|
+
@index = cached.interval.end
|
5800
|
+
end
|
5801
|
+
return cached
|
5802
|
+
end
|
5803
|
+
|
5804
|
+
if has_terminal?(@regexps[gr = '\A[A-Z]'] ||= Regexp.new(gr), :regexp, index)
|
5805
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
5806
|
+
@index += 1
|
5807
|
+
else
|
5808
|
+
terminal_parse_failure('[A-Z]')
|
5809
|
+
r0 = nil
|
5810
|
+
end
|
5811
|
+
|
5812
|
+
node_cache[:ucalpha][start_index] = r0
|
5813
|
+
|
5814
|
+
r0
|
5815
|
+
end
|
5816
|
+
|
5817
|
+
def _nt_ucldh
|
5818
|
+
start_index = index
|
5819
|
+
if node_cache[:ucldh].has_key?(index)
|
5820
|
+
cached = node_cache[:ucldh][index]
|
5821
|
+
if cached
|
5822
|
+
node_cache[:ucldh][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5823
|
+
@index = cached.interval.end
|
5824
|
+
end
|
5825
|
+
return cached
|
5826
|
+
end
|
5827
|
+
|
5828
|
+
i0 = index
|
5829
|
+
r1 = _nt_ucalpha
|
5830
|
+
if r1
|
5831
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5832
|
+
r0 = r1
|
5833
|
+
else
|
5834
|
+
r2 = _nt_DIGIT
|
5835
|
+
if r2
|
5836
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5837
|
+
r0 = r2
|
5838
|
+
else
|
5839
|
+
if (match_len = has_terminal?("-", false, index))
|
5840
|
+
r3 = true
|
5841
|
+
@index += match_len
|
5842
|
+
else
|
5843
|
+
terminal_parse_failure('"-"')
|
5844
|
+
r3 = nil
|
5845
|
+
end
|
5846
|
+
if r3
|
5847
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5848
|
+
r0 = r3
|
5849
|
+
else
|
5850
|
+
@index = i0
|
5851
|
+
r0 = nil
|
5852
|
+
end
|
5853
|
+
end
|
5854
|
+
end
|
5855
|
+
|
5856
|
+
node_cache[:ucldh][start_index] = r0
|
5857
|
+
|
5858
|
+
r0
|
5859
|
+
end
|
5860
|
+
|
5861
|
+
def _nt_ALPHA
|
5862
|
+
start_index = index
|
5863
|
+
if node_cache[:ALPHA].has_key?(index)
|
5864
|
+
cached = node_cache[:ALPHA][index]
|
5865
|
+
if cached
|
5866
|
+
node_cache[:ALPHA][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5867
|
+
@index = cached.interval.end
|
5868
|
+
end
|
5869
|
+
return cached
|
5870
|
+
end
|
5871
|
+
|
5872
|
+
i0 = index
|
5873
|
+
r1 = _nt_lcalpha
|
5874
|
+
if r1
|
5875
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5876
|
+
r0 = r1
|
5877
|
+
else
|
5878
|
+
r2 = _nt_ucalpha
|
5879
|
+
if r2
|
5880
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5881
|
+
r0 = r2
|
5882
|
+
else
|
5883
|
+
@index = i0
|
5884
|
+
r0 = nil
|
5885
|
+
end
|
5886
|
+
end
|
5887
|
+
|
5888
|
+
node_cache[:ALPHA][start_index] = r0
|
5889
|
+
|
5890
|
+
r0
|
5891
|
+
end
|
5892
|
+
|
5893
|
+
def _nt_wordchar
|
5894
|
+
start_index = index
|
5895
|
+
if node_cache[:wordchar].has_key?(index)
|
5896
|
+
cached = node_cache[:wordchar][index]
|
5897
|
+
if cached
|
5898
|
+
node_cache[:wordchar][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5899
|
+
@index = cached.interval.end
|
5900
|
+
end
|
5901
|
+
return cached
|
5902
|
+
end
|
5903
|
+
|
5904
|
+
i0 = index
|
5905
|
+
if (match_len = has_terminal?("_", false, index))
|
5906
|
+
r1 = true
|
5907
|
+
@index += match_len
|
5908
|
+
else
|
5909
|
+
terminal_parse_failure('"_"')
|
5910
|
+
r1 = nil
|
5911
|
+
end
|
5912
|
+
if r1
|
5913
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5914
|
+
r0 = r1
|
5915
|
+
else
|
5916
|
+
r2 = _nt_lcalpha
|
5917
|
+
if r2
|
5918
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5919
|
+
r0 = r2
|
5920
|
+
else
|
5921
|
+
r3 = _nt_DIGIT
|
5922
|
+
if r3
|
5923
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
5924
|
+
r0 = r3
|
5925
|
+
else
|
5926
|
+
r4 = _nt_ucalpha
|
5927
|
+
if r4
|
5928
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
5929
|
+
r0 = r4
|
5930
|
+
else
|
5931
|
+
@index = i0
|
5932
|
+
r0 = nil
|
5933
|
+
end
|
5934
|
+
end
|
5935
|
+
end
|
5936
|
+
end
|
5937
|
+
|
5938
|
+
node_cache[:wordchar][start_index] = r0
|
5939
|
+
|
5940
|
+
r0
|
5941
|
+
end
|
5942
|
+
|
5943
|
+
def _nt_NONASCII
|
5944
|
+
start_index = index
|
5945
|
+
if node_cache[:NONASCII].has_key?(index)
|
5946
|
+
cached = node_cache[:NONASCII][index]
|
5947
|
+
if cached
|
5948
|
+
node_cache[:NONASCII][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5949
|
+
@index = cached.interval.end
|
5950
|
+
end
|
5951
|
+
return cached
|
5952
|
+
end
|
5953
|
+
|
5954
|
+
i0 = index
|
5955
|
+
if has_terminal?(@regexps[gr = '\A[-]'] ||= Regexp.new(gr), :regexp, index)
|
5956
|
+
r1 = true
|
5957
|
+
@index += 1
|
5958
|
+
else
|
5959
|
+
terminal_parse_failure('[-]')
|
5960
|
+
r1 = nil
|
5961
|
+
end
|
5962
|
+
if r1
|
5963
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5964
|
+
r0 = r1
|
5965
|
+
else
|
5966
|
+
if has_terminal?(@regexps[gr = '\A[-]'] ||= Regexp.new(gr), :regexp, index)
|
5967
|
+
r2 = true
|
5968
|
+
@index += 1
|
5969
|
+
else
|
5970
|
+
terminal_parse_failure('[-]')
|
5971
|
+
r2 = nil
|
5972
|
+
end
|
5973
|
+
if r2
|
5974
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5975
|
+
r0 = r2
|
5976
|
+
else
|
5977
|
+
@index = i0
|
5978
|
+
r0 = nil
|
5979
|
+
end
|
5980
|
+
end
|
5981
|
+
|
5982
|
+
node_cache[:NONASCII][start_index] = r0
|
5983
|
+
|
5984
|
+
r0
|
5985
|
+
end
|
5986
|
+
|
5987
|
+
module IHT0
|
5988
|
+
end
|
5989
|
+
|
5990
|
+
module IHT1
|
5991
|
+
end
|
5992
|
+
|
5993
|
+
def _nt_i_HT
|
5994
|
+
start_index = index
|
5995
|
+
if node_cache[:i_HT].has_key?(index)
|
5996
|
+
cached = node_cache[:i_HT][index]
|
5997
|
+
if cached
|
5998
|
+
node_cache[:i_HT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5999
|
+
@index = cached.interval.end
|
6000
|
+
end
|
6001
|
+
return cached
|
6002
|
+
end
|
6003
|
+
|
6004
|
+
i0 = index
|
6005
|
+
if (match_len = has_terminal?("\\t", false, index))
|
6006
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6007
|
+
@index += match_len
|
6008
|
+
else
|
6009
|
+
terminal_parse_failure('"\\\\t"')
|
6010
|
+
r1 = nil
|
6011
|
+
end
|
6012
|
+
if r1
|
6013
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6014
|
+
r0 = r1
|
6015
|
+
else
|
6016
|
+
i2, s2 = index, []
|
6017
|
+
if (match_len = has_terminal?("\\u", false, index))
|
6018
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6019
|
+
@index += match_len
|
6020
|
+
else
|
6021
|
+
terminal_parse_failure('"\\\\u"')
|
6022
|
+
r3 = nil
|
6023
|
+
end
|
6024
|
+
s2 << r3
|
6025
|
+
if r3
|
6026
|
+
i4 = index
|
6027
|
+
if (match_len = has_terminal?("0009", false, index))
|
6028
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6029
|
+
@index += match_len
|
6030
|
+
else
|
6031
|
+
terminal_parse_failure('"0009"')
|
6032
|
+
r5 = nil
|
6033
|
+
end
|
6034
|
+
if r5
|
6035
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
6036
|
+
r4 = r5
|
6037
|
+
else
|
6038
|
+
i6, s6 = index, []
|
6039
|
+
if (match_len = has_terminal?("{", false, index))
|
6040
|
+
r7 = true
|
6041
|
+
@index += match_len
|
6042
|
+
else
|
6043
|
+
terminal_parse_failure('"{"')
|
6044
|
+
r7 = nil
|
6045
|
+
end
|
6046
|
+
s6 << r7
|
6047
|
+
if r7
|
6048
|
+
s8, i8 = [], index
|
6049
|
+
loop do
|
6050
|
+
if (match_len = has_terminal?("0", false, index))
|
6051
|
+
r9 = true
|
6052
|
+
@index += match_len
|
6053
|
+
else
|
6054
|
+
terminal_parse_failure('"0"')
|
6055
|
+
r9 = nil
|
6056
|
+
end
|
6057
|
+
if r9
|
6058
|
+
s8 << r9
|
6059
|
+
else
|
6060
|
+
break
|
6061
|
+
end
|
6062
|
+
end
|
6063
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
6064
|
+
s6 << r8
|
6065
|
+
if r8
|
6066
|
+
if (match_len = has_terminal?("9}", false, index))
|
6067
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6068
|
+
@index += match_len
|
6069
|
+
else
|
6070
|
+
terminal_parse_failure('"9}"')
|
6071
|
+
r10 = nil
|
6072
|
+
end
|
6073
|
+
s6 << r10
|
6074
|
+
end
|
6075
|
+
end
|
6076
|
+
if s6.last
|
6077
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
6078
|
+
r6.extend(IHT0)
|
6079
|
+
else
|
6080
|
+
@index = i6
|
6081
|
+
r6 = nil
|
6082
|
+
end
|
6083
|
+
if r6
|
6084
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
6085
|
+
r4 = r6
|
6086
|
+
else
|
6087
|
+
@index = i4
|
6088
|
+
r4 = nil
|
6089
|
+
end
|
6090
|
+
end
|
6091
|
+
s2 << r4
|
6092
|
+
end
|
6093
|
+
if s2.last
|
6094
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
6095
|
+
r2.extend(IHT1)
|
6096
|
+
else
|
6097
|
+
@index = i2
|
6098
|
+
r2 = nil
|
6099
|
+
end
|
6100
|
+
if r2
|
6101
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6102
|
+
r0 = r2
|
6103
|
+
else
|
6104
|
+
@index = i0
|
6105
|
+
r0 = nil
|
6106
|
+
end
|
6107
|
+
end
|
6108
|
+
|
6109
|
+
node_cache[:i_HT][start_index] = r0
|
6110
|
+
|
6111
|
+
r0
|
6112
|
+
end
|
6113
|
+
|
6114
|
+
module ILF0
|
6115
|
+
end
|
6116
|
+
|
6117
|
+
module ILF1
|
6118
|
+
end
|
6119
|
+
|
6120
|
+
def _nt_i_LF
|
6121
|
+
start_index = index
|
6122
|
+
if node_cache[:i_LF].has_key?(index)
|
6123
|
+
cached = node_cache[:i_LF][index]
|
6124
|
+
if cached
|
6125
|
+
node_cache[:i_LF][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6126
|
+
@index = cached.interval.end
|
6127
|
+
end
|
6128
|
+
return cached
|
6129
|
+
end
|
6130
|
+
|
6131
|
+
i0 = index
|
6132
|
+
if (match_len = has_terminal?("\n", false, index))
|
6133
|
+
r1 = true
|
6134
|
+
@index += match_len
|
6135
|
+
else
|
6136
|
+
terminal_parse_failure('"\\n"')
|
6137
|
+
r1 = nil
|
6138
|
+
end
|
6139
|
+
if r1
|
6140
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6141
|
+
r0 = r1
|
6142
|
+
else
|
6143
|
+
if (match_len = has_terminal?("\\n", false, index))
|
6144
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6145
|
+
@index += match_len
|
6146
|
+
else
|
6147
|
+
terminal_parse_failure('"\\\\n"')
|
6148
|
+
r2 = nil
|
6149
|
+
end
|
6150
|
+
if r2
|
6151
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6152
|
+
r0 = r2
|
6153
|
+
else
|
6154
|
+
i3, s3 = index, []
|
6155
|
+
if (match_len = has_terminal?("\\u", false, index))
|
6156
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6157
|
+
@index += match_len
|
6158
|
+
else
|
6159
|
+
terminal_parse_failure('"\\\\u"')
|
6160
|
+
r4 = nil
|
6161
|
+
end
|
6162
|
+
s3 << r4
|
6163
|
+
if r4
|
6164
|
+
i5 = index
|
6165
|
+
if (match_len = has_terminal?("000a", :insens, index))
|
6166
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6167
|
+
@index += match_len
|
6168
|
+
else
|
6169
|
+
terminal_parse_failure('"000A"')
|
6170
|
+
r6 = nil
|
6171
|
+
end
|
6172
|
+
if r6
|
6173
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
6174
|
+
r5 = r6
|
6175
|
+
else
|
6176
|
+
i7, s7 = index, []
|
6177
|
+
if (match_len = has_terminal?("{", false, index))
|
6178
|
+
r8 = true
|
6179
|
+
@index += match_len
|
6180
|
+
else
|
6181
|
+
terminal_parse_failure('"{"')
|
6182
|
+
r8 = nil
|
6183
|
+
end
|
6184
|
+
s7 << r8
|
6185
|
+
if r8
|
6186
|
+
s9, i9 = [], index
|
6187
|
+
loop do
|
6188
|
+
if (match_len = has_terminal?("0", false, index))
|
6189
|
+
r10 = true
|
6190
|
+
@index += match_len
|
6191
|
+
else
|
6192
|
+
terminal_parse_failure('"0"')
|
6193
|
+
r10 = nil
|
6194
|
+
end
|
6195
|
+
if r10
|
6196
|
+
s9 << r10
|
6197
|
+
else
|
6198
|
+
break
|
6199
|
+
end
|
6200
|
+
end
|
6201
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
6202
|
+
s7 << r9
|
6203
|
+
if r9
|
6204
|
+
if (match_len = has_terminal?("a}", :insens, index))
|
6205
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6206
|
+
@index += match_len
|
6207
|
+
else
|
6208
|
+
terminal_parse_failure('"A}"')
|
6209
|
+
r11 = nil
|
6210
|
+
end
|
6211
|
+
s7 << r11
|
6212
|
+
end
|
6213
|
+
end
|
6214
|
+
if s7.last
|
6215
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
6216
|
+
r7.extend(ILF0)
|
6217
|
+
else
|
6218
|
+
@index = i7
|
6219
|
+
r7 = nil
|
6220
|
+
end
|
6221
|
+
if r7
|
6222
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
6223
|
+
r5 = r7
|
6224
|
+
else
|
6225
|
+
@index = i5
|
6226
|
+
r5 = nil
|
6227
|
+
end
|
6228
|
+
end
|
6229
|
+
s3 << r5
|
6230
|
+
end
|
6231
|
+
if s3.last
|
6232
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
6233
|
+
r3.extend(ILF1)
|
6234
|
+
else
|
6235
|
+
@index = i3
|
6236
|
+
r3 = nil
|
6237
|
+
end
|
6238
|
+
if r3
|
6239
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
6240
|
+
r0 = r3
|
6241
|
+
else
|
6242
|
+
@index = i0
|
6243
|
+
r0 = nil
|
6244
|
+
end
|
6245
|
+
end
|
6246
|
+
end
|
6247
|
+
|
6248
|
+
node_cache[:i_LF][start_index] = r0
|
6249
|
+
|
6250
|
+
r0
|
6251
|
+
end
|
6252
|
+
|
6253
|
+
module ICR0
|
6254
|
+
end
|
6255
|
+
|
6256
|
+
module ICR1
|
6257
|
+
end
|
6258
|
+
|
6259
|
+
def _nt_i_CR
|
6260
|
+
start_index = index
|
6261
|
+
if node_cache[:i_CR].has_key?(index)
|
6262
|
+
cached = node_cache[:i_CR][index]
|
6263
|
+
if cached
|
6264
|
+
node_cache[:i_CR][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6265
|
+
@index = cached.interval.end
|
6266
|
+
end
|
6267
|
+
return cached
|
6268
|
+
end
|
6269
|
+
|
6270
|
+
i0 = index
|
6271
|
+
if (match_len = has_terminal?("\r", false, index))
|
6272
|
+
r1 = true
|
6273
|
+
@index += match_len
|
6274
|
+
else
|
6275
|
+
terminal_parse_failure('"\\r"')
|
6276
|
+
r1 = nil
|
6277
|
+
end
|
6278
|
+
if r1
|
6279
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6280
|
+
r0 = r1
|
6281
|
+
else
|
6282
|
+
if (match_len = has_terminal?("\\r", false, index))
|
6283
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6284
|
+
@index += match_len
|
6285
|
+
else
|
6286
|
+
terminal_parse_failure('"\\\\r"')
|
6287
|
+
r2 = nil
|
6288
|
+
end
|
6289
|
+
if r2
|
6290
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6291
|
+
r0 = r2
|
6292
|
+
else
|
6293
|
+
i3, s3 = index, []
|
6294
|
+
if (match_len = has_terminal?("\\u", false, index))
|
6295
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6296
|
+
@index += match_len
|
6297
|
+
else
|
6298
|
+
terminal_parse_failure('"\\\\u"')
|
6299
|
+
r4 = nil
|
6300
|
+
end
|
6301
|
+
s3 << r4
|
6302
|
+
if r4
|
6303
|
+
i5 = index
|
6304
|
+
if (match_len = has_terminal?("000d", :insens, index))
|
6305
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6306
|
+
@index += match_len
|
6307
|
+
else
|
6308
|
+
terminal_parse_failure('"000D"')
|
6309
|
+
r6 = nil
|
6310
|
+
end
|
6311
|
+
if r6
|
6312
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
6313
|
+
r5 = r6
|
6314
|
+
else
|
6315
|
+
i7, s7 = index, []
|
6316
|
+
if (match_len = has_terminal?("{", false, index))
|
6317
|
+
r8 = true
|
6318
|
+
@index += match_len
|
6319
|
+
else
|
6320
|
+
terminal_parse_failure('"{"')
|
6321
|
+
r8 = nil
|
6322
|
+
end
|
6323
|
+
s7 << r8
|
6324
|
+
if r8
|
6325
|
+
s9, i9 = [], index
|
6326
|
+
loop do
|
6327
|
+
if (match_len = has_terminal?("0", false, index))
|
6328
|
+
r10 = true
|
6329
|
+
@index += match_len
|
6330
|
+
else
|
6331
|
+
terminal_parse_failure('"0"')
|
6332
|
+
r10 = nil
|
6333
|
+
end
|
6334
|
+
if r10
|
6335
|
+
s9 << r10
|
6336
|
+
else
|
6337
|
+
break
|
6338
|
+
end
|
6339
|
+
end
|
6340
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
6341
|
+
s7 << r9
|
6342
|
+
if r9
|
6343
|
+
if (match_len = has_terminal?("d}", :insens, index))
|
6344
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6345
|
+
@index += match_len
|
6346
|
+
else
|
6347
|
+
terminal_parse_failure('"D}"')
|
6348
|
+
r11 = nil
|
6349
|
+
end
|
6350
|
+
s7 << r11
|
6351
|
+
end
|
6352
|
+
end
|
6353
|
+
if s7.last
|
6354
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
6355
|
+
r7.extend(ICR0)
|
6356
|
+
else
|
6357
|
+
@index = i7
|
6358
|
+
r7 = nil
|
6359
|
+
end
|
6360
|
+
if r7
|
6361
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
6362
|
+
r5 = r7
|
6363
|
+
else
|
6364
|
+
@index = i5
|
6365
|
+
r5 = nil
|
6366
|
+
end
|
6367
|
+
end
|
6368
|
+
s3 << r5
|
6369
|
+
end
|
6370
|
+
if s3.last
|
6371
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
6372
|
+
r3.extend(ICR1)
|
6373
|
+
else
|
6374
|
+
@index = i3
|
6375
|
+
r3 = nil
|
6376
|
+
end
|
6377
|
+
if r3
|
6378
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
6379
|
+
r0 = r3
|
6380
|
+
else
|
6381
|
+
@index = i0
|
6382
|
+
r0 = nil
|
6383
|
+
end
|
6384
|
+
end
|
6385
|
+
end
|
6386
|
+
|
6387
|
+
node_cache[:i_CR][start_index] = r0
|
6388
|
+
|
6389
|
+
r0
|
6390
|
+
end
|
6391
|
+
|
6392
|
+
def _nt_i_blank
|
6393
|
+
start_index = index
|
6394
|
+
if node_cache[:i_blank].has_key?(index)
|
6395
|
+
cached = node_cache[:i_blank][index]
|
6396
|
+
if cached
|
6397
|
+
node_cache[:i_blank][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6398
|
+
@index = cached.interval.end
|
6399
|
+
end
|
6400
|
+
return cached
|
6401
|
+
end
|
6402
|
+
|
6403
|
+
i0 = index
|
6404
|
+
r1 = _nt_i_LF
|
6405
|
+
if r1
|
6406
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6407
|
+
r0 = r1
|
6408
|
+
else
|
6409
|
+
r2 = _nt_i_CR
|
6410
|
+
if r2
|
6411
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6412
|
+
r0 = r2
|
6413
|
+
else
|
6414
|
+
if (match_len = has_terminal?(" ", false, index))
|
6415
|
+
r3 = true
|
6416
|
+
@index += match_len
|
6417
|
+
else
|
6418
|
+
terminal_parse_failure('" "')
|
6419
|
+
r3 = nil
|
6420
|
+
end
|
6421
|
+
if r3
|
6422
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
6423
|
+
r0 = r3
|
6424
|
+
else
|
6425
|
+
@index = i0
|
6426
|
+
r0 = nil
|
6427
|
+
end
|
6428
|
+
end
|
6429
|
+
end
|
6430
|
+
|
6431
|
+
node_cache[:i_blank][start_index] = r0
|
6432
|
+
|
6433
|
+
r0
|
6434
|
+
end
|
6435
|
+
|
6436
|
+
def _nt_i_non_lf
|
6437
|
+
start_index = index
|
6438
|
+
if node_cache[:i_non_lf].has_key?(index)
|
6439
|
+
cached = node_cache[:i_non_lf][index]
|
6440
|
+
if cached
|
6441
|
+
node_cache[:i_non_lf][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6442
|
+
@index = cached.interval.end
|
6443
|
+
end
|
6444
|
+
return cached
|
6445
|
+
end
|
6446
|
+
|
6447
|
+
i0 = index
|
6448
|
+
r1 = _nt_i_HT
|
6449
|
+
if r1
|
6450
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6451
|
+
r0 = r1
|
6452
|
+
else
|
6453
|
+
r2 = _nt_i_CR
|
6454
|
+
if r2
|
6455
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6456
|
+
r0 = r2
|
6457
|
+
else
|
6458
|
+
if has_terminal?(@regexps[gr = '\A[\\ -&]'] ||= Regexp.new(gr), :regexp, index)
|
6459
|
+
r3 = true
|
6460
|
+
@index += 1
|
6461
|
+
else
|
6462
|
+
terminal_parse_failure('[\\ -&]')
|
6463
|
+
r3 = nil
|
6464
|
+
end
|
6465
|
+
if r3
|
6466
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
6467
|
+
r0 = r3
|
6468
|
+
else
|
6469
|
+
if (match_len = has_terminal?("\\'", false, index))
|
6470
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6471
|
+
@index += match_len
|
6472
|
+
else
|
6473
|
+
terminal_parse_failure('"\\\\\'"')
|
6474
|
+
r4 = nil
|
6475
|
+
end
|
6476
|
+
if r4
|
6477
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
6478
|
+
r0 = r4
|
6479
|
+
else
|
6480
|
+
if has_terminal?(@regexps[gr = '\A[\\(-\\[]'] ||= Regexp.new(gr), :regexp, index)
|
6481
|
+
r5 = true
|
6482
|
+
@index += 1
|
6483
|
+
else
|
6484
|
+
terminal_parse_failure('[\\(-\\[]')
|
6485
|
+
r5 = nil
|
6486
|
+
end
|
6487
|
+
if r5
|
6488
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
6489
|
+
r0 = r5
|
6490
|
+
else
|
6491
|
+
if (match_len = has_terminal?("\\\\", false, index))
|
6492
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6493
|
+
@index += match_len
|
6494
|
+
else
|
6495
|
+
terminal_parse_failure('"\\\\\\\\"')
|
6496
|
+
r6 = nil
|
6497
|
+
end
|
6498
|
+
if r6
|
6499
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
6500
|
+
r0 = r6
|
6501
|
+
else
|
6502
|
+
if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
|
6503
|
+
r7 = true
|
6504
|
+
@index += 1
|
6505
|
+
else
|
6506
|
+
terminal_parse_failure('[\\]-]')
|
6507
|
+
r7 = nil
|
6508
|
+
end
|
6509
|
+
if r7
|
6510
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
6511
|
+
r0 = r7
|
6512
|
+
else
|
6513
|
+
r8 = _nt_i_NONASCII
|
6514
|
+
if r8
|
6515
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
6516
|
+
r0 = r8
|
6517
|
+
else
|
6518
|
+
@index = i0
|
6519
|
+
r0 = nil
|
6520
|
+
end
|
6521
|
+
end
|
6522
|
+
end
|
6523
|
+
end
|
6524
|
+
end
|
6525
|
+
end
|
6526
|
+
end
|
6527
|
+
end
|
6528
|
+
|
6529
|
+
node_cache[:i_non_lf][start_index] = r0
|
6530
|
+
|
6531
|
+
r0
|
6532
|
+
end
|
6533
|
+
|
6534
|
+
module INONASCII0
|
6535
|
+
def ESCGE7F
|
6536
|
+
elements[1]
|
6537
|
+
end
|
6538
|
+
end
|
6539
|
+
|
6540
|
+
def _nt_i_NONASCII
|
6541
|
+
start_index = index
|
6542
|
+
if node_cache[:i_NONASCII].has_key?(index)
|
6543
|
+
cached = node_cache[:i_NONASCII][index]
|
6544
|
+
if cached
|
6545
|
+
node_cache[:i_NONASCII][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6546
|
+
@index = cached.interval.end
|
6547
|
+
end
|
6548
|
+
return cached
|
6549
|
+
end
|
6550
|
+
|
6551
|
+
i0 = index
|
6552
|
+
r1 = _nt_NONASCII
|
6553
|
+
if r1
|
6554
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6555
|
+
r0 = r1
|
6556
|
+
else
|
6557
|
+
i2, s2 = index, []
|
6558
|
+
if (match_len = has_terminal?("\\u", false, index))
|
6559
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6560
|
+
@index += match_len
|
6561
|
+
else
|
6562
|
+
terminal_parse_failure('"\\\\u"')
|
6563
|
+
r3 = nil
|
6564
|
+
end
|
6565
|
+
s2 << r3
|
6566
|
+
if r3
|
6567
|
+
r4 = _nt_ESCGE7F
|
6568
|
+
s2 << r4
|
6569
|
+
end
|
6570
|
+
if s2.last
|
6571
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
6572
|
+
r2.extend(INONASCII0)
|
6573
|
+
else
|
6574
|
+
@index = i2
|
6575
|
+
r2 = nil
|
6576
|
+
end
|
6577
|
+
if r2
|
6578
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
6579
|
+
r0 = r2
|
6580
|
+
else
|
6581
|
+
@index = i0
|
6582
|
+
r0 = nil
|
6583
|
+
end
|
6584
|
+
end
|
6585
|
+
|
6586
|
+
node_cache[:i_NONASCII][start_index] = r0
|
6587
|
+
|
6588
|
+
r0
|
6589
|
+
end
|
6590
|
+
|
6591
|
+
module ESCGE7F0
|
6592
|
+
end
|
6593
|
+
|
6594
|
+
module ESCGE7F1
|
6595
|
+
def HEXDIG1
|
6596
|
+
elements[1]
|
6597
|
+
end
|
6598
|
+
|
6599
|
+
end
|
6600
|
+
|
6601
|
+
module ESCGE7F2
|
6602
|
+
def TWOHEX1
|
6603
|
+
elements[1]
|
6604
|
+
end
|
6605
|
+
end
|
6606
|
+
|
6607
|
+
module ESCGE7F3
|
6608
|
+
end
|
6609
|
+
|
6610
|
+
module ESCGE7F4
|
6611
|
+
def HEXDIG1
|
6612
|
+
elements[0]
|
6613
|
+
end
|
6614
|
+
|
6615
|
+
end
|
6616
|
+
|
6617
|
+
module ESCGE7F5
|
6618
|
+
def HEXDIG1
|
6619
|
+
elements[0]
|
6620
|
+
end
|
6621
|
+
|
6622
|
+
end
|
6623
|
+
|
6624
|
+
module ESCGE7F6
|
6625
|
+
end
|
6626
|
+
|
6627
|
+
def _nt_ESCGE7F
|
6628
|
+
start_index = index
|
6629
|
+
if node_cache[:ESCGE7F].has_key?(index)
|
6630
|
+
cached = node_cache[:ESCGE7F][index]
|
6631
|
+
if cached
|
6632
|
+
node_cache[:ESCGE7F][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
6633
|
+
@index = cached.interval.end
|
6634
|
+
end
|
6635
|
+
return cached
|
6636
|
+
end
|
6637
|
+
|
6638
|
+
i0 = index
|
6639
|
+
i1, s1 = index, []
|
6640
|
+
if (match_len = has_terminal?("d", :insens, index))
|
6641
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6642
|
+
@index += match_len
|
6643
|
+
else
|
6644
|
+
terminal_parse_failure('"D"')
|
6645
|
+
r2 = nil
|
6646
|
+
end
|
6647
|
+
s1 << r2
|
6648
|
+
if r2
|
6649
|
+
i3 = index
|
6650
|
+
if (match_len = has_terminal?("8", false, index))
|
6651
|
+
r4 = true
|
6652
|
+
@index += match_len
|
6653
|
+
else
|
6654
|
+
terminal_parse_failure('"8"')
|
6655
|
+
r4 = nil
|
6656
|
+
end
|
6657
|
+
if r4
|
6658
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
6659
|
+
r3 = r4
|
6660
|
+
else
|
6661
|
+
if (match_len = has_terminal?("9", false, index))
|
6662
|
+
r5 = true
|
6663
|
+
@index += match_len
|
6664
|
+
else
|
6665
|
+
terminal_parse_failure('"9"')
|
6666
|
+
r5 = nil
|
6667
|
+
end
|
6668
|
+
if r5
|
6669
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
6670
|
+
r3 = r5
|
6671
|
+
else
|
6672
|
+
if (match_len = has_terminal?("a", :insens, index))
|
6673
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6674
|
+
@index += match_len
|
6675
|
+
else
|
6676
|
+
terminal_parse_failure('"A"')
|
6677
|
+
r6 = nil
|
6678
|
+
end
|
6679
|
+
if r6
|
6680
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
6681
|
+
r3 = r6
|
6682
|
+
else
|
6683
|
+
if (match_len = has_terminal?("b", :insens, index))
|
6684
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6685
|
+
@index += match_len
|
6686
|
+
else
|
6687
|
+
terminal_parse_failure('"B"')
|
6688
|
+
r7 = nil
|
6689
|
+
end
|
6690
|
+
if r7
|
6691
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
6692
|
+
r3 = r7
|
6693
|
+
else
|
6694
|
+
@index = i3
|
6695
|
+
r3 = nil
|
6696
|
+
end
|
6697
|
+
end
|
6698
|
+
end
|
6699
|
+
end
|
6700
|
+
s1 << r3
|
6701
|
+
if r3
|
6702
|
+
s8, i8 = [], index
|
6703
|
+
loop do
|
6704
|
+
r9 = _nt_HEXDIG
|
6705
|
+
if r9
|
6706
|
+
s8 << r9
|
6707
|
+
else
|
6708
|
+
break
|
6709
|
+
end
|
6710
|
+
if s8.size == 2
|
6711
|
+
break
|
6712
|
+
end
|
6713
|
+
end
|
6714
|
+
if s8.size < 2
|
6715
|
+
@index = i8
|
6716
|
+
r8 = nil
|
6717
|
+
else
|
6718
|
+
if s8.size < 2
|
6719
|
+
@terminal_failures.pop
|
6720
|
+
end
|
6721
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
6722
|
+
end
|
6723
|
+
s1 << r8
|
6724
|
+
if r8
|
6725
|
+
if (match_len = has_terminal?("\\u", false, index))
|
6726
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6727
|
+
@index += match_len
|
6728
|
+
else
|
6729
|
+
terminal_parse_failure('"\\\\u"')
|
6730
|
+
r10 = nil
|
6731
|
+
end
|
6732
|
+
s1 << r10
|
6733
|
+
if r10
|
6734
|
+
if (match_len = has_terminal?("d", :insens, index))
|
6735
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6736
|
+
@index += match_len
|
6737
|
+
else
|
6738
|
+
terminal_parse_failure('"D"')
|
6739
|
+
r11 = nil
|
6740
|
+
end
|
6741
|
+
s1 << r11
|
6742
|
+
if r11
|
6743
|
+
i12 = index
|
6744
|
+
if (match_len = has_terminal?("c", :insens, index))
|
6745
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6746
|
+
@index += match_len
|
6747
|
+
else
|
6748
|
+
terminal_parse_failure('"C"')
|
6749
|
+
r13 = nil
|
6750
|
+
end
|
6751
|
+
if r13
|
6752
|
+
r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true
|
6753
|
+
r12 = r13
|
6754
|
+
else
|
6755
|
+
if (match_len = has_terminal?("d", :insens, index))
|
6756
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6757
|
+
@index += match_len
|
6758
|
+
else
|
6759
|
+
terminal_parse_failure('"D"')
|
6760
|
+
r14 = nil
|
6761
|
+
end
|
6762
|
+
if r14
|
6763
|
+
r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
|
6764
|
+
r12 = r14
|
6765
|
+
else
|
6766
|
+
if (match_len = has_terminal?("e", :insens, index))
|
6767
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6768
|
+
@index += match_len
|
6769
|
+
else
|
6770
|
+
terminal_parse_failure('"E"')
|
6771
|
+
r15 = nil
|
6772
|
+
end
|
6773
|
+
if r15
|
6774
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
6775
|
+
r12 = r15
|
6776
|
+
else
|
6777
|
+
if (match_len = has_terminal?("f", :insens, index))
|
6778
|
+
r16 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6779
|
+
@index += match_len
|
6780
|
+
else
|
6781
|
+
terminal_parse_failure('"F"')
|
6782
|
+
r16 = nil
|
6783
|
+
end
|
6784
|
+
if r16
|
6785
|
+
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
6786
|
+
r12 = r16
|
6787
|
+
else
|
6788
|
+
@index = i12
|
6789
|
+
r12 = nil
|
6790
|
+
end
|
6791
|
+
end
|
6792
|
+
end
|
6793
|
+
end
|
6794
|
+
s1 << r12
|
6795
|
+
if r12
|
6796
|
+
s17, i17 = [], index
|
6797
|
+
loop do
|
6798
|
+
r18 = _nt_HEXDIG
|
6799
|
+
if r18
|
6800
|
+
s17 << r18
|
6801
|
+
else
|
6802
|
+
break
|
6803
|
+
end
|
6804
|
+
if s17.size == 2
|
6805
|
+
break
|
6806
|
+
end
|
6807
|
+
end
|
6808
|
+
if s17.size < 2
|
6809
|
+
@index = i17
|
6810
|
+
r17 = nil
|
6811
|
+
else
|
6812
|
+
if s17.size < 2
|
6813
|
+
@terminal_failures.pop
|
6814
|
+
end
|
6815
|
+
r17 = instantiate_node(SyntaxNode,input, i17...index, s17)
|
6816
|
+
end
|
6817
|
+
s1 << r17
|
6818
|
+
end
|
6819
|
+
end
|
6820
|
+
end
|
6821
|
+
end
|
6822
|
+
end
|
6823
|
+
end
|
6824
|
+
if s1.last
|
6825
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
6826
|
+
r1.extend(ESCGE7F0)
|
6827
|
+
else
|
6828
|
+
@index = i1
|
6829
|
+
r1 = nil
|
6830
|
+
end
|
6831
|
+
if r1
|
6832
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
6833
|
+
r0 = r1
|
6834
|
+
else
|
6835
|
+
r19 = _nt_FOURHEX1
|
6836
|
+
if r19
|
6837
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
6838
|
+
r0 = r19
|
6839
|
+
else
|
6840
|
+
i20, s20 = index, []
|
6841
|
+
if (match_len = has_terminal?("0", false, index))
|
6842
|
+
r21 = true
|
6843
|
+
@index += match_len
|
6844
|
+
else
|
6845
|
+
terminal_parse_failure('"0"')
|
6846
|
+
r21 = nil
|
6847
|
+
end
|
6848
|
+
s20 << r21
|
6849
|
+
if r21
|
6850
|
+
r22 = _nt_HEXDIG1
|
6851
|
+
s20 << r22
|
6852
|
+
if r22
|
6853
|
+
s23, i23 = [], index
|
6854
|
+
loop do
|
6855
|
+
r24 = _nt_HEXDIG
|
6856
|
+
if r24
|
6857
|
+
s23 << r24
|
6858
|
+
else
|
6859
|
+
break
|
6860
|
+
end
|
6861
|
+
if s23.size == 2
|
6862
|
+
break
|
6863
|
+
end
|
6864
|
+
end
|
6865
|
+
if s23.size < 2
|
6866
|
+
@index = i23
|
6867
|
+
r23 = nil
|
6868
|
+
else
|
6869
|
+
if s23.size < 2
|
6870
|
+
@terminal_failures.pop
|
6871
|
+
end
|
6872
|
+
r23 = instantiate_node(SyntaxNode,input, i23...index, s23)
|
6873
|
+
end
|
6874
|
+
s20 << r23
|
6875
|
+
end
|
6876
|
+
end
|
6877
|
+
if s20.last
|
6878
|
+
r20 = instantiate_node(SyntaxNode,input, i20...index, s20)
|
6879
|
+
r20.extend(ESCGE7F1)
|
6880
|
+
else
|
6881
|
+
@index = i20
|
6882
|
+
r20 = nil
|
6883
|
+
end
|
6884
|
+
if r20
|
6885
|
+
r20 = SyntaxNode.new(input, (index-1)...index) if r20 == true
|
6886
|
+
r0 = r20
|
6887
|
+
else
|
6888
|
+
i25, s25 = index, []
|
6889
|
+
if (match_len = has_terminal?("00", false, index))
|
6890
|
+
r26 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6891
|
+
@index += match_len
|
6892
|
+
else
|
6893
|
+
terminal_parse_failure('"00"')
|
6894
|
+
r26 = nil
|
6895
|
+
end
|
6896
|
+
s25 << r26
|
6897
|
+
if r26
|
6898
|
+
r27 = _nt_TWOHEX1
|
6899
|
+
s25 << r27
|
6900
|
+
end
|
6901
|
+
if s25.last
|
6902
|
+
r25 = instantiate_node(SyntaxNode,input, i25...index, s25)
|
6903
|
+
r25.extend(ESCGE7F2)
|
6904
|
+
else
|
6905
|
+
@index = i25
|
6906
|
+
r25 = nil
|
6907
|
+
end
|
6908
|
+
if r25
|
6909
|
+
r25 = SyntaxNode.new(input, (index-1)...index) if r25 == true
|
6910
|
+
r0 = r25
|
6911
|
+
else
|
6912
|
+
i28, s28 = index, []
|
6913
|
+
if (match_len = has_terminal?("{", false, index))
|
6914
|
+
r29 = true
|
6915
|
+
@index += match_len
|
6916
|
+
else
|
6917
|
+
terminal_parse_failure('"{"')
|
6918
|
+
r29 = nil
|
6919
|
+
end
|
6920
|
+
s28 << r29
|
6921
|
+
if r29
|
6922
|
+
s30, i30 = [], index
|
6923
|
+
loop do
|
6924
|
+
if (match_len = has_terminal?("0", false, index))
|
6925
|
+
r31 = true
|
6926
|
+
@index += match_len
|
6927
|
+
else
|
6928
|
+
terminal_parse_failure('"0"')
|
6929
|
+
r31 = nil
|
6930
|
+
end
|
6931
|
+
if r31
|
6932
|
+
s30 << r31
|
6933
|
+
else
|
6934
|
+
break
|
6935
|
+
end
|
6936
|
+
end
|
6937
|
+
r30 = instantiate_node(SyntaxNode,input, i30...index, s30)
|
6938
|
+
s28 << r30
|
6939
|
+
if r30
|
6940
|
+
i32 = index
|
6941
|
+
i33, s33 = index, []
|
6942
|
+
if (match_len = has_terminal?("10", false, index))
|
6943
|
+
r34 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
6944
|
+
@index += match_len
|
6945
|
+
else
|
6946
|
+
terminal_parse_failure('"10"')
|
6947
|
+
r34 = nil
|
6948
|
+
end
|
6949
|
+
s33 << r34
|
6950
|
+
if r34
|
6951
|
+
s35, i35 = [], index
|
6952
|
+
loop do
|
6953
|
+
r36 = _nt_HEXDIG
|
6954
|
+
if r36
|
6955
|
+
s35 << r36
|
6956
|
+
else
|
6957
|
+
break
|
6958
|
+
end
|
6959
|
+
if s35.size == 4
|
6960
|
+
break
|
6961
|
+
end
|
6962
|
+
end
|
6963
|
+
if s35.size < 4
|
6964
|
+
@index = i35
|
6965
|
+
r35 = nil
|
6966
|
+
else
|
6967
|
+
if s35.size < 4
|
6968
|
+
@terminal_failures.pop
|
6969
|
+
end
|
6970
|
+
r35 = instantiate_node(SyntaxNode,input, i35...index, s35)
|
6971
|
+
end
|
6972
|
+
s33 << r35
|
6973
|
+
end
|
6974
|
+
if s33.last
|
6975
|
+
r33 = instantiate_node(SyntaxNode,input, i33...index, s33)
|
6976
|
+
r33.extend(ESCGE7F3)
|
6977
|
+
else
|
6978
|
+
@index = i33
|
6979
|
+
r33 = nil
|
6980
|
+
end
|
6981
|
+
if r33
|
6982
|
+
r33 = SyntaxNode.new(input, (index-1)...index) if r33 == true
|
6983
|
+
r32 = r33
|
6984
|
+
else
|
6985
|
+
i37, s37 = index, []
|
6986
|
+
r38 = _nt_HEXDIG1
|
6987
|
+
s37 << r38
|
6988
|
+
if r38
|
6989
|
+
s39, i39 = [], index
|
6990
|
+
loop do
|
6991
|
+
r40 = _nt_HEXDIG
|
6992
|
+
if r40
|
6993
|
+
s39 << r40
|
6994
|
+
else
|
6995
|
+
break
|
6996
|
+
end
|
6997
|
+
if s39.size == 4
|
6998
|
+
break
|
6999
|
+
end
|
7000
|
+
end
|
7001
|
+
if s39.size < 4
|
7002
|
+
@index = i39
|
7003
|
+
r39 = nil
|
7004
|
+
else
|
7005
|
+
if s39.size < 4
|
7006
|
+
@terminal_failures.pop
|
7007
|
+
end
|
7008
|
+
r39 = instantiate_node(SyntaxNode,input, i39...index, s39)
|
7009
|
+
end
|
7010
|
+
s37 << r39
|
7011
|
+
end
|
7012
|
+
if s37.last
|
7013
|
+
r37 = instantiate_node(SyntaxNode,input, i37...index, s37)
|
7014
|
+
r37.extend(ESCGE7F4)
|
7015
|
+
else
|
7016
|
+
@index = i37
|
7017
|
+
r37 = nil
|
7018
|
+
end
|
7019
|
+
if r37
|
7020
|
+
r37 = SyntaxNode.new(input, (index-1)...index) if r37 == true
|
7021
|
+
r32 = r37
|
7022
|
+
else
|
7023
|
+
r41 = _nt_FOURHEX1
|
7024
|
+
if r41
|
7025
|
+
r41 = SyntaxNode.new(input, (index-1)...index) if r41 == true
|
7026
|
+
r32 = r41
|
7027
|
+
else
|
7028
|
+
i42, s42 = index, []
|
7029
|
+
r43 = _nt_HEXDIG1
|
7030
|
+
s42 << r43
|
7031
|
+
if r43
|
7032
|
+
s44, i44 = [], index
|
7033
|
+
loop do
|
7034
|
+
r45 = _nt_HEXDIG
|
7035
|
+
if r45
|
7036
|
+
s44 << r45
|
7037
|
+
else
|
7038
|
+
break
|
7039
|
+
end
|
7040
|
+
if s44.size == 2
|
7041
|
+
break
|
7042
|
+
end
|
7043
|
+
end
|
7044
|
+
if s44.size < 2
|
7045
|
+
@index = i44
|
7046
|
+
r44 = nil
|
7047
|
+
else
|
7048
|
+
if s44.size < 2
|
7049
|
+
@terminal_failures.pop
|
7050
|
+
end
|
7051
|
+
r44 = instantiate_node(SyntaxNode,input, i44...index, s44)
|
7052
|
+
end
|
7053
|
+
s42 << r44
|
7054
|
+
end
|
7055
|
+
if s42.last
|
7056
|
+
r42 = instantiate_node(SyntaxNode,input, i42...index, s42)
|
7057
|
+
r42.extend(ESCGE7F5)
|
7058
|
+
else
|
7059
|
+
@index = i42
|
7060
|
+
r42 = nil
|
7061
|
+
end
|
7062
|
+
if r42
|
7063
|
+
r42 = SyntaxNode.new(input, (index-1)...index) if r42 == true
|
7064
|
+
r32 = r42
|
7065
|
+
else
|
7066
|
+
r46 = _nt_TWOHEX1
|
7067
|
+
if r46
|
7068
|
+
r46 = SyntaxNode.new(input, (index-1)...index) if r46 == true
|
7069
|
+
r32 = r46
|
7070
|
+
else
|
7071
|
+
@index = i32
|
7072
|
+
r32 = nil
|
7073
|
+
end
|
7074
|
+
end
|
7075
|
+
end
|
7076
|
+
end
|
7077
|
+
end
|
7078
|
+
s28 << r32
|
7079
|
+
if r32
|
7080
|
+
if (match_len = has_terminal?("}", false, index))
|
7081
|
+
r47 = true
|
7082
|
+
@index += match_len
|
7083
|
+
else
|
7084
|
+
terminal_parse_failure('"}"')
|
7085
|
+
r47 = nil
|
7086
|
+
end
|
7087
|
+
s28 << r47
|
7088
|
+
end
|
7089
|
+
end
|
7090
|
+
end
|
7091
|
+
if s28.last
|
7092
|
+
r28 = instantiate_node(SyntaxNode,input, i28...index, s28)
|
7093
|
+
r28.extend(ESCGE7F6)
|
7094
|
+
else
|
7095
|
+
@index = i28
|
7096
|
+
r28 = nil
|
7097
|
+
end
|
7098
|
+
if r28
|
7099
|
+
r28 = SyntaxNode.new(input, (index-1)...index) if r28 == true
|
7100
|
+
r0 = r28
|
7101
|
+
else
|
7102
|
+
@index = i0
|
7103
|
+
r0 = nil
|
7104
|
+
end
|
7105
|
+
end
|
7106
|
+
end
|
7107
|
+
end
|
7108
|
+
end
|
7109
|
+
|
7110
|
+
node_cache[:ESCGE7F][start_index] = r0
|
7111
|
+
|
7112
|
+
r0
|
7113
|
+
end
|
7114
|
+
|
7115
|
+
module FOURHEX10
|
7116
|
+
end
|
7117
|
+
|
7118
|
+
module FOURHEX11
|
7119
|
+
def ODIGIT
|
7120
|
+
elements[1]
|
7121
|
+
end
|
7122
|
+
|
7123
|
+
end
|
7124
|
+
|
7125
|
+
def _nt_FOURHEX1
|
7126
|
+
start_index = index
|
7127
|
+
if node_cache[:FOURHEX1].has_key?(index)
|
7128
|
+
cached = node_cache[:FOURHEX1][index]
|
7129
|
+
if cached
|
7130
|
+
node_cache[:FOURHEX1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7131
|
+
@index = cached.interval.end
|
7132
|
+
end
|
7133
|
+
return cached
|
7134
|
+
end
|
7135
|
+
|
7136
|
+
i0 = index
|
7137
|
+
i1, s1 = index, []
|
7138
|
+
i2 = index
|
7139
|
+
r3 = _nt_DIGIT1
|
7140
|
+
if r3
|
7141
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
7142
|
+
r2 = r3
|
7143
|
+
else
|
7144
|
+
if (match_len = has_terminal?("a", :insens, index))
|
7145
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7146
|
+
@index += match_len
|
7147
|
+
else
|
7148
|
+
terminal_parse_failure('"A"')
|
7149
|
+
r4 = nil
|
7150
|
+
end
|
7151
|
+
if r4
|
7152
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
7153
|
+
r2 = r4
|
7154
|
+
else
|
7155
|
+
if (match_len = has_terminal?("b", :insens, index))
|
7156
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7157
|
+
@index += match_len
|
7158
|
+
else
|
7159
|
+
terminal_parse_failure('"B"')
|
7160
|
+
r5 = nil
|
7161
|
+
end
|
7162
|
+
if r5
|
7163
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
7164
|
+
r2 = r5
|
7165
|
+
else
|
7166
|
+
if (match_len = has_terminal?("c", :insens, index))
|
7167
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7168
|
+
@index += match_len
|
7169
|
+
else
|
7170
|
+
terminal_parse_failure('"C"')
|
7171
|
+
r6 = nil
|
7172
|
+
end
|
7173
|
+
if r6
|
7174
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
7175
|
+
r2 = r6
|
7176
|
+
else
|
7177
|
+
if (match_len = has_terminal?("e", :insens, index))
|
7178
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7179
|
+
@index += match_len
|
7180
|
+
else
|
7181
|
+
terminal_parse_failure('"E"')
|
7182
|
+
r7 = nil
|
7183
|
+
end
|
7184
|
+
if r7
|
7185
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
7186
|
+
r2 = r7
|
7187
|
+
else
|
7188
|
+
if (match_len = has_terminal?("f", :insens, index))
|
7189
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7190
|
+
@index += match_len
|
7191
|
+
else
|
7192
|
+
terminal_parse_failure('"F"')
|
7193
|
+
r8 = nil
|
7194
|
+
end
|
7195
|
+
if r8
|
7196
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
7197
|
+
r2 = r8
|
7198
|
+
else
|
7199
|
+
@index = i2
|
7200
|
+
r2 = nil
|
7201
|
+
end
|
7202
|
+
end
|
7203
|
+
end
|
7204
|
+
end
|
7205
|
+
end
|
7206
|
+
end
|
7207
|
+
s1 << r2
|
7208
|
+
if r2
|
7209
|
+
s9, i9 = [], index
|
7210
|
+
loop do
|
7211
|
+
r10 = _nt_HEXDIG
|
7212
|
+
if r10
|
7213
|
+
s9 << r10
|
7214
|
+
else
|
7215
|
+
break
|
7216
|
+
end
|
7217
|
+
if s9.size == 3
|
7218
|
+
break
|
7219
|
+
end
|
7220
|
+
end
|
7221
|
+
if s9.size < 3
|
7222
|
+
@index = i9
|
7223
|
+
r9 = nil
|
7224
|
+
else
|
7225
|
+
if s9.size < 3
|
7226
|
+
@terminal_failures.pop
|
7227
|
+
end
|
7228
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
7229
|
+
end
|
7230
|
+
s1 << r9
|
7231
|
+
end
|
7232
|
+
if s1.last
|
7233
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
7234
|
+
r1.extend(FOURHEX10)
|
7235
|
+
else
|
7236
|
+
@index = i1
|
7237
|
+
r1 = nil
|
7238
|
+
end
|
7239
|
+
if r1
|
7240
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
7241
|
+
r0 = r1
|
7242
|
+
else
|
7243
|
+
i11, s11 = index, []
|
7244
|
+
if (match_len = has_terminal?("d", :insens, index))
|
7245
|
+
r12 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7246
|
+
@index += match_len
|
7247
|
+
else
|
7248
|
+
terminal_parse_failure('"D"')
|
7249
|
+
r12 = nil
|
7250
|
+
end
|
7251
|
+
s11 << r12
|
7252
|
+
if r12
|
7253
|
+
r13 = _nt_ODIGIT
|
7254
|
+
s11 << r13
|
7255
|
+
if r13
|
7256
|
+
s14, i14 = [], index
|
7257
|
+
loop do
|
7258
|
+
r15 = _nt_HEXDIG
|
7259
|
+
if r15
|
7260
|
+
s14 << r15
|
7261
|
+
else
|
7262
|
+
break
|
7263
|
+
end
|
7264
|
+
if s14.size == 2
|
7265
|
+
break
|
7266
|
+
end
|
7267
|
+
end
|
7268
|
+
if s14.size < 2
|
7269
|
+
@index = i14
|
7270
|
+
r14 = nil
|
7271
|
+
else
|
7272
|
+
if s14.size < 2
|
7273
|
+
@terminal_failures.pop
|
7274
|
+
end
|
7275
|
+
r14 = instantiate_node(SyntaxNode,input, i14...index, s14)
|
7276
|
+
end
|
7277
|
+
s11 << r14
|
7278
|
+
end
|
7279
|
+
end
|
7280
|
+
if s11.last
|
7281
|
+
r11 = instantiate_node(SyntaxNode,input, i11...index, s11)
|
7282
|
+
r11.extend(FOURHEX11)
|
7283
|
+
else
|
7284
|
+
@index = i11
|
7285
|
+
r11 = nil
|
7286
|
+
end
|
7287
|
+
if r11
|
7288
|
+
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
7289
|
+
r0 = r11
|
7290
|
+
else
|
7291
|
+
@index = i0
|
7292
|
+
r0 = nil
|
7293
|
+
end
|
7294
|
+
end
|
7295
|
+
|
7296
|
+
node_cache[:FOURHEX1][start_index] = r0
|
7297
|
+
|
7298
|
+
r0
|
7299
|
+
end
|
7300
|
+
|
7301
|
+
module TWOHEX10
|
7302
|
+
def HEXDIG
|
7303
|
+
elements[1]
|
7304
|
+
end
|
7305
|
+
end
|
7306
|
+
|
7307
|
+
def _nt_TWOHEX1
|
7308
|
+
start_index = index
|
7309
|
+
if node_cache[:TWOHEX1].has_key?(index)
|
7310
|
+
cached = node_cache[:TWOHEX1][index]
|
7311
|
+
if cached
|
7312
|
+
node_cache[:TWOHEX1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7313
|
+
@index = cached.interval.end
|
7314
|
+
end
|
7315
|
+
return cached
|
7316
|
+
end
|
7317
|
+
|
7318
|
+
i0 = index
|
7319
|
+
i1, s1 = index, []
|
7320
|
+
i2 = index
|
7321
|
+
if (match_len = has_terminal?("8", false, index))
|
7322
|
+
r3 = true
|
7323
|
+
@index += match_len
|
7324
|
+
else
|
7325
|
+
terminal_parse_failure('"8"')
|
7326
|
+
r3 = nil
|
7327
|
+
end
|
7328
|
+
if r3
|
7329
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
7330
|
+
r2 = r3
|
7331
|
+
else
|
7332
|
+
if (match_len = has_terminal?("9", false, index))
|
7333
|
+
r4 = true
|
7334
|
+
@index += match_len
|
7335
|
+
else
|
7336
|
+
terminal_parse_failure('"9"')
|
7337
|
+
r4 = nil
|
7338
|
+
end
|
7339
|
+
if r4
|
7340
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
7341
|
+
r2 = r4
|
7342
|
+
else
|
7343
|
+
r5 = _nt_HEXDIGA
|
7344
|
+
if r5
|
7345
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
7346
|
+
r2 = r5
|
7347
|
+
else
|
7348
|
+
@index = i2
|
7349
|
+
r2 = nil
|
7350
|
+
end
|
7351
|
+
end
|
7352
|
+
end
|
7353
|
+
s1 << r2
|
7354
|
+
if r2
|
7355
|
+
r6 = _nt_HEXDIG
|
7356
|
+
s1 << r6
|
7357
|
+
end
|
7358
|
+
if s1.last
|
7359
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
7360
|
+
r1.extend(TWOHEX10)
|
7361
|
+
else
|
7362
|
+
@index = i1
|
7363
|
+
r1 = nil
|
7364
|
+
end
|
7365
|
+
if r1
|
7366
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
7367
|
+
r0 = r1
|
7368
|
+
else
|
7369
|
+
if (match_len = has_terminal?("7f", :insens, index))
|
7370
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7371
|
+
@index += match_len
|
7372
|
+
else
|
7373
|
+
terminal_parse_failure('"7F"')
|
7374
|
+
r7 = nil
|
7375
|
+
end
|
7376
|
+
if r7
|
7377
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
7378
|
+
r0 = r7
|
7379
|
+
else
|
7380
|
+
@index = i0
|
7381
|
+
r0 = nil
|
7382
|
+
end
|
7383
|
+
end
|
7384
|
+
|
7385
|
+
node_cache[:TWOHEX1][start_index] = r0
|
7386
|
+
|
7387
|
+
r0
|
7388
|
+
end
|
7389
|
+
|
7390
|
+
module SqAppStringH0
|
7391
|
+
def app_string_h
|
7392
|
+
elements[1]
|
7393
|
+
end
|
7394
|
+
|
7395
|
+
end
|
7396
|
+
|
7397
|
+
module SqAppStringH1
|
7398
|
+
def ast; app_string_h.ast end
|
7399
|
+
end
|
7400
|
+
|
7401
|
+
def _nt_sq_app_string_h
|
7402
|
+
start_index = index
|
7403
|
+
if node_cache[:sq_app_string_h].has_key?(index)
|
7404
|
+
cached = node_cache[:sq_app_string_h][index]
|
7405
|
+
if cached
|
7406
|
+
node_cache[:sq_app_string_h][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7407
|
+
@index = cached.interval.end
|
7408
|
+
end
|
7409
|
+
return cached
|
7410
|
+
end
|
7411
|
+
|
7412
|
+
i0, s0 = index, []
|
7413
|
+
if (match_len = has_terminal?("h'", false, index))
|
7414
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4641
7415
|
@index += match_len
|
4642
7416
|
else
|
4643
|
-
terminal_parse_failure('"
|
7417
|
+
terminal_parse_failure('"h\'"')
|
7418
|
+
r1 = nil
|
7419
|
+
end
|
7420
|
+
s0 << r1
|
7421
|
+
if r1
|
7422
|
+
r2 = _nt_app_string_h
|
7423
|
+
s0 << r2
|
7424
|
+
if r2
|
7425
|
+
if (match_len = has_terminal?("'", false, index))
|
7426
|
+
r3 = true
|
7427
|
+
@index += match_len
|
7428
|
+
else
|
7429
|
+
terminal_parse_failure('"\'"')
|
7430
|
+
r3 = nil
|
7431
|
+
end
|
7432
|
+
s0 << r3
|
7433
|
+
end
|
7434
|
+
end
|
7435
|
+
if s0.last
|
7436
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
7437
|
+
r0.extend(SqAppStringH0)
|
7438
|
+
r0.extend(SqAppStringH1)
|
7439
|
+
else
|
7440
|
+
@index = i0
|
7441
|
+
r0 = nil
|
7442
|
+
end
|
7443
|
+
|
7444
|
+
node_cache[:sq_app_string_h][start_index] = r0
|
7445
|
+
|
7446
|
+
r0
|
7447
|
+
end
|
7448
|
+
|
7449
|
+
module AppStringH0
|
7450
|
+
def HEXDIG1
|
7451
|
+
elements[0]
|
7452
|
+
end
|
7453
|
+
|
7454
|
+
def h_S1
|
7455
|
+
elements[1]
|
7456
|
+
end
|
7457
|
+
|
7458
|
+
def HEXDIG2
|
7459
|
+
elements[2]
|
7460
|
+
end
|
7461
|
+
|
7462
|
+
def h_S2
|
7463
|
+
elements[3]
|
7464
|
+
end
|
7465
|
+
end
|
7466
|
+
|
7467
|
+
module AppStringH1
|
7468
|
+
def ast
|
7469
|
+
Integer(elements[0].text_value + elements[2].text_value, 16).chr("BINARY")
|
7470
|
+
end
|
7471
|
+
end
|
7472
|
+
|
7473
|
+
module AppStringH2
|
7474
|
+
def ellipsis
|
7475
|
+
elements[0]
|
7476
|
+
end
|
7477
|
+
|
7478
|
+
def h_S
|
7479
|
+
elements[1]
|
7480
|
+
end
|
7481
|
+
end
|
7482
|
+
|
7483
|
+
module AppStringH3
|
7484
|
+
def ast; ellipsis.ast end
|
7485
|
+
end
|
7486
|
+
|
7487
|
+
module AppStringH4
|
7488
|
+
end
|
7489
|
+
|
7490
|
+
module AppStringH5
|
7491
|
+
def h_S
|
7492
|
+
elements[0]
|
7493
|
+
end
|
7494
|
+
|
7495
|
+
end
|
7496
|
+
|
7497
|
+
module AppStringH6
|
7498
|
+
def unpack_thread(s)
|
7499
|
+
case s[0]
|
7500
|
+
when CBOR::Tagged
|
7501
|
+
s[0]
|
7502
|
+
when String
|
7503
|
+
s.join
|
7504
|
+
else
|
7505
|
+
raise "@@@ unpack_thread #{s.inspect}"
|
7506
|
+
end
|
7507
|
+
end
|
7508
|
+
def ast
|
7509
|
+
e1 = elements[1].elements.map {|e| e.ast}
|
7510
|
+
out = []
|
7511
|
+
curr = []
|
7512
|
+
e1.each { |el|
|
7513
|
+
if curr.size == 0 || curr[0].class == el.class
|
7514
|
+
curr << el
|
7515
|
+
else
|
7516
|
+
out << curr
|
7517
|
+
curr = [el]
|
7518
|
+
end
|
7519
|
+
}
|
7520
|
+
if out.size == 0 && (curr.size == 0 || String === curr[0])
|
7521
|
+
curr.join.b # unpack_thread(curr)
|
7522
|
+
else
|
7523
|
+
CBOR::Tagged.new(888, (out << curr).map {|x| unpack_thread(x)})
|
7524
|
+
end
|
7525
|
+
end
|
7526
|
+
end
|
7527
|
+
|
7528
|
+
def _nt_app_string_h
|
7529
|
+
start_index = index
|
7530
|
+
if node_cache[:app_string_h].has_key?(index)
|
7531
|
+
cached = node_cache[:app_string_h][index]
|
7532
|
+
if cached
|
7533
|
+
node_cache[:app_string_h][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7534
|
+
@index = cached.interval.end
|
7535
|
+
end
|
7536
|
+
return cached
|
7537
|
+
end
|
7538
|
+
|
7539
|
+
i0, s0 = index, []
|
7540
|
+
r1 = _nt_h_S
|
7541
|
+
s0 << r1
|
7542
|
+
if r1
|
7543
|
+
s2, i2 = [], index
|
7544
|
+
loop do
|
7545
|
+
i3 = index
|
7546
|
+
i4, s4 = index, []
|
7547
|
+
r5 = _nt_HEXDIG
|
7548
|
+
s4 << r5
|
7549
|
+
if r5
|
7550
|
+
r6 = _nt_h_S
|
7551
|
+
s4 << r6
|
7552
|
+
if r6
|
7553
|
+
r7 = _nt_HEXDIG
|
7554
|
+
s4 << r7
|
7555
|
+
if r7
|
7556
|
+
r8 = _nt_h_S
|
7557
|
+
s4 << r8
|
7558
|
+
end
|
7559
|
+
end
|
7560
|
+
end
|
7561
|
+
if s4.last
|
7562
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
7563
|
+
r4.extend(AppStringH0)
|
7564
|
+
r4.extend(AppStringH1)
|
7565
|
+
else
|
7566
|
+
@index = i4
|
7567
|
+
r4 = nil
|
7568
|
+
end
|
7569
|
+
if r4
|
7570
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
7571
|
+
r3 = r4
|
7572
|
+
else
|
7573
|
+
i9, s9 = index, []
|
7574
|
+
r10 = _nt_ellipsis
|
7575
|
+
s9 << r10
|
7576
|
+
if r10
|
7577
|
+
r11 = _nt_h_S
|
7578
|
+
s9 << r11
|
7579
|
+
end
|
7580
|
+
if s9.last
|
7581
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
7582
|
+
r9.extend(AppStringH2)
|
7583
|
+
r9.extend(AppStringH3)
|
7584
|
+
else
|
7585
|
+
@index = i9
|
7586
|
+
r9 = nil
|
7587
|
+
end
|
7588
|
+
if r9
|
7589
|
+
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
7590
|
+
r3 = r9
|
7591
|
+
else
|
7592
|
+
@index = i3
|
7593
|
+
r3 = nil
|
7594
|
+
end
|
7595
|
+
end
|
7596
|
+
if r3
|
7597
|
+
s2 << r3
|
7598
|
+
else
|
7599
|
+
break
|
7600
|
+
end
|
7601
|
+
end
|
7602
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
7603
|
+
s0 << r2
|
7604
|
+
if r2
|
7605
|
+
i13, s13 = index, []
|
7606
|
+
if (match_len = has_terminal?("#", false, index))
|
7607
|
+
r14 = true
|
7608
|
+
@index += match_len
|
7609
|
+
else
|
7610
|
+
terminal_parse_failure('"#"')
|
7611
|
+
r14 = nil
|
7612
|
+
end
|
7613
|
+
s13 << r14
|
7614
|
+
if r14
|
7615
|
+
s15, i15 = [], index
|
7616
|
+
loop do
|
7617
|
+
r16 = _nt_i_non_lf
|
7618
|
+
if r16
|
7619
|
+
s15 << r16
|
7620
|
+
else
|
7621
|
+
break
|
7622
|
+
end
|
7623
|
+
end
|
7624
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
7625
|
+
s13 << r15
|
7626
|
+
end
|
7627
|
+
if s13.last
|
7628
|
+
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
7629
|
+
r13.extend(AppStringH4)
|
7630
|
+
else
|
7631
|
+
@index = i13
|
7632
|
+
r13 = nil
|
7633
|
+
end
|
7634
|
+
if r13
|
7635
|
+
r12 = r13
|
7636
|
+
else
|
7637
|
+
r12 = instantiate_node(SyntaxNode,input, index...index)
|
7638
|
+
end
|
7639
|
+
s0 << r12
|
7640
|
+
end
|
7641
|
+
end
|
7642
|
+
if s0.last
|
7643
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
7644
|
+
r0.extend(AppStringH5)
|
7645
|
+
r0.extend(AppStringH6)
|
7646
|
+
else
|
7647
|
+
@index = i0
|
7648
|
+
r0 = nil
|
7649
|
+
end
|
7650
|
+
|
7651
|
+
node_cache[:app_string_h][start_index] = r0
|
7652
|
+
|
7653
|
+
r0
|
7654
|
+
end
|
7655
|
+
|
7656
|
+
module HS0
|
7657
|
+
def h_comment
|
7658
|
+
elements[0]
|
7659
|
+
end
|
7660
|
+
|
7661
|
+
end
|
7662
|
+
|
7663
|
+
module HS1
|
7664
|
+
end
|
7665
|
+
|
7666
|
+
def _nt_h_S
|
7667
|
+
start_index = index
|
7668
|
+
if node_cache[:h_S].has_key?(index)
|
7669
|
+
cached = node_cache[:h_S][index]
|
7670
|
+
if cached
|
7671
|
+
node_cache[:h_S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7672
|
+
@index = cached.interval.end
|
7673
|
+
end
|
7674
|
+
return cached
|
7675
|
+
end
|
7676
|
+
|
7677
|
+
i0, s0 = index, []
|
7678
|
+
s1, i1 = [], index
|
7679
|
+
loop do
|
7680
|
+
r2 = _nt_i_blank
|
7681
|
+
if r2
|
7682
|
+
s1 << r2
|
7683
|
+
else
|
7684
|
+
break
|
7685
|
+
end
|
7686
|
+
end
|
7687
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
7688
|
+
s0 << r1
|
7689
|
+
if r1
|
7690
|
+
s3, i3 = [], index
|
7691
|
+
loop do
|
7692
|
+
i4, s4 = index, []
|
7693
|
+
r5 = _nt_h_comment
|
7694
|
+
s4 << r5
|
7695
|
+
if r5
|
7696
|
+
s6, i6 = [], index
|
7697
|
+
loop do
|
7698
|
+
r7 = _nt_i_blank
|
7699
|
+
if r7
|
7700
|
+
s6 << r7
|
7701
|
+
else
|
7702
|
+
break
|
7703
|
+
end
|
7704
|
+
end
|
7705
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
7706
|
+
s4 << r6
|
7707
|
+
end
|
7708
|
+
if s4.last
|
7709
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
7710
|
+
r4.extend(HS0)
|
7711
|
+
else
|
7712
|
+
@index = i4
|
7713
|
+
r4 = nil
|
7714
|
+
end
|
7715
|
+
if r4
|
7716
|
+
s3 << r4
|
7717
|
+
else
|
7718
|
+
break
|
7719
|
+
end
|
7720
|
+
end
|
7721
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
7722
|
+
s0 << r3
|
7723
|
+
end
|
7724
|
+
if s0.last
|
7725
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
7726
|
+
r0.extend(HS1)
|
7727
|
+
else
|
7728
|
+
@index = i0
|
4644
7729
|
r0 = nil
|
4645
7730
|
end
|
4646
7731
|
|
4647
|
-
node_cache[:
|
7732
|
+
node_cache[:h_S][start_index] = r0
|
7733
|
+
|
7734
|
+
r0
|
7735
|
+
end
|
7736
|
+
|
7737
|
+
def _nt_h_non_slash
|
7738
|
+
start_index = index
|
7739
|
+
if node_cache[:h_non_slash].has_key?(index)
|
7740
|
+
cached = node_cache[:h_non_slash][index]
|
7741
|
+
if cached
|
7742
|
+
node_cache[:h_non_slash][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7743
|
+
@index = cached.interval.end
|
7744
|
+
end
|
7745
|
+
return cached
|
7746
|
+
end
|
7747
|
+
|
7748
|
+
i0 = index
|
7749
|
+
r1 = _nt_i_blank
|
7750
|
+
if r1
|
7751
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
7752
|
+
r0 = r1
|
7753
|
+
else
|
7754
|
+
if has_terminal?(@regexps[gr = '\A[!-&]'] ||= Regexp.new(gr), :regexp, index)
|
7755
|
+
r2 = true
|
7756
|
+
@index += 1
|
7757
|
+
else
|
7758
|
+
terminal_parse_failure('[!-&]')
|
7759
|
+
r2 = nil
|
7760
|
+
end
|
7761
|
+
if r2
|
7762
|
+
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
7763
|
+
r0 = r2
|
7764
|
+
else
|
7765
|
+
if (match_len = has_terminal?("\\'", false, index))
|
7766
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7767
|
+
@index += match_len
|
7768
|
+
else
|
7769
|
+
terminal_parse_failure('"\\\\\'"')
|
7770
|
+
r3 = nil
|
7771
|
+
end
|
7772
|
+
if r3
|
7773
|
+
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
7774
|
+
r0 = r3
|
7775
|
+
else
|
7776
|
+
if has_terminal?(@regexps[gr = '\A[\\(-\\.]'] ||= Regexp.new(gr), :regexp, index)
|
7777
|
+
r4 = true
|
7778
|
+
@index += 1
|
7779
|
+
else
|
7780
|
+
terminal_parse_failure('[\\(-\\.]')
|
7781
|
+
r4 = nil
|
7782
|
+
end
|
7783
|
+
if r4
|
7784
|
+
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
7785
|
+
r0 = r4
|
7786
|
+
else
|
7787
|
+
if has_terminal?(@regexps[gr = '\A[0-\\[]'] ||= Regexp.new(gr), :regexp, index)
|
7788
|
+
r5 = true
|
7789
|
+
@index += 1
|
7790
|
+
else
|
7791
|
+
terminal_parse_failure('[0-\\[]')
|
7792
|
+
r5 = nil
|
7793
|
+
end
|
7794
|
+
if r5
|
7795
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
7796
|
+
r0 = r5
|
7797
|
+
else
|
7798
|
+
if (match_len = has_terminal?("\\\\", false, index))
|
7799
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
7800
|
+
@index += match_len
|
7801
|
+
else
|
7802
|
+
terminal_parse_failure('"\\\\\\\\"')
|
7803
|
+
r6 = nil
|
7804
|
+
end
|
7805
|
+
if r6
|
7806
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
7807
|
+
r0 = r6
|
7808
|
+
else
|
7809
|
+
if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
|
7810
|
+
r7 = true
|
7811
|
+
@index += 1
|
7812
|
+
else
|
7813
|
+
terminal_parse_failure('[\\]-]')
|
7814
|
+
r7 = nil
|
7815
|
+
end
|
7816
|
+
if r7
|
7817
|
+
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
7818
|
+
r0 = r7
|
7819
|
+
else
|
7820
|
+
r8 = _nt_i_NONASCII
|
7821
|
+
if r8
|
7822
|
+
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
7823
|
+
r0 = r8
|
7824
|
+
else
|
7825
|
+
@index = i0
|
7826
|
+
r0 = nil
|
7827
|
+
end
|
7828
|
+
end
|
7829
|
+
end
|
7830
|
+
end
|
7831
|
+
end
|
7832
|
+
end
|
7833
|
+
end
|
7834
|
+
end
|
7835
|
+
|
7836
|
+
node_cache[:h_non_slash][start_index] = r0
|
7837
|
+
|
7838
|
+
r0
|
7839
|
+
end
|
7840
|
+
|
7841
|
+
module HComment0
|
7842
|
+
end
|
7843
|
+
|
7844
|
+
module HComment1
|
7845
|
+
def i_LF
|
7846
|
+
elements[2]
|
7847
|
+
end
|
7848
|
+
end
|
7849
|
+
|
7850
|
+
def _nt_h_comment
|
7851
|
+
start_index = index
|
7852
|
+
if node_cache[:h_comment].has_key?(index)
|
7853
|
+
cached = node_cache[:h_comment][index]
|
7854
|
+
if cached
|
7855
|
+
node_cache[:h_comment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
7856
|
+
@index = cached.interval.end
|
7857
|
+
end
|
7858
|
+
return cached
|
7859
|
+
end
|
7860
|
+
|
7861
|
+
i0 = index
|
7862
|
+
i1, s1 = index, []
|
7863
|
+
if (match_len = has_terminal?("/", false, index))
|
7864
|
+
r2 = true
|
7865
|
+
@index += match_len
|
7866
|
+
else
|
7867
|
+
terminal_parse_failure('"/"')
|
7868
|
+
r2 = nil
|
7869
|
+
end
|
7870
|
+
s1 << r2
|
7871
|
+
if r2
|
7872
|
+
s3, i3 = [], index
|
7873
|
+
loop do
|
7874
|
+
r4 = _nt_h_non_slash
|
7875
|
+
if r4
|
7876
|
+
s3 << r4
|
7877
|
+
else
|
7878
|
+
break
|
7879
|
+
end
|
7880
|
+
end
|
7881
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
7882
|
+
s1 << r3
|
7883
|
+
if r3
|
7884
|
+
if (match_len = has_terminal?("/", false, index))
|
7885
|
+
r5 = true
|
7886
|
+
@index += match_len
|
7887
|
+
else
|
7888
|
+
terminal_parse_failure('"/"')
|
7889
|
+
r5 = nil
|
7890
|
+
end
|
7891
|
+
s1 << r5
|
7892
|
+
end
|
7893
|
+
end
|
7894
|
+
if s1.last
|
7895
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
7896
|
+
r1.extend(HComment0)
|
7897
|
+
else
|
7898
|
+
@index = i1
|
7899
|
+
r1 = nil
|
7900
|
+
end
|
7901
|
+
if r1
|
7902
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
7903
|
+
r0 = r1
|
7904
|
+
else
|
7905
|
+
i6, s6 = index, []
|
7906
|
+
if (match_len = has_terminal?("#", false, index))
|
7907
|
+
r7 = true
|
7908
|
+
@index += match_len
|
7909
|
+
else
|
7910
|
+
terminal_parse_failure('"#"')
|
7911
|
+
r7 = nil
|
7912
|
+
end
|
7913
|
+
s6 << r7
|
7914
|
+
if r7
|
7915
|
+
s8, i8 = [], index
|
7916
|
+
loop do
|
7917
|
+
r9 = _nt_i_non_lf
|
7918
|
+
if r9
|
7919
|
+
s8 << r9
|
7920
|
+
else
|
7921
|
+
break
|
7922
|
+
end
|
7923
|
+
end
|
7924
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
7925
|
+
s6 << r8
|
7926
|
+
if r8
|
7927
|
+
r10 = _nt_i_LF
|
7928
|
+
s6 << r10
|
7929
|
+
end
|
7930
|
+
end
|
7931
|
+
if s6.last
|
7932
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
7933
|
+
r6.extend(HComment1)
|
7934
|
+
else
|
7935
|
+
@index = i6
|
7936
|
+
r6 = nil
|
7937
|
+
end
|
7938
|
+
if r6
|
7939
|
+
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
7940
|
+
r0 = r6
|
7941
|
+
else
|
7942
|
+
@index = i0
|
7943
|
+
r0 = nil
|
7944
|
+
end
|
7945
|
+
end
|
7946
|
+
|
7947
|
+
node_cache[:h_comment][start_index] = r0
|
4648
7948
|
|
4649
7949
|
r0
|
4650
7950
|
end
|
4651
7951
|
|
4652
|
-
|
7952
|
+
module SqAppStringB640
|
7953
|
+
def app_string_b64
|
7954
|
+
elements[1]
|
7955
|
+
end
|
7956
|
+
|
7957
|
+
end
|
7958
|
+
|
7959
|
+
module SqAppStringB641
|
7960
|
+
def ast; app_string_b64.ast end
|
7961
|
+
end
|
7962
|
+
|
7963
|
+
def _nt_sq_app_string_b64
|
4653
7964
|
start_index = index
|
4654
|
-
if node_cache[:
|
4655
|
-
cached = node_cache[:
|
7965
|
+
if node_cache[:sq_app_string_b64].has_key?(index)
|
7966
|
+
cached = node_cache[:sq_app_string_b64][index]
|
4656
7967
|
if cached
|
4657
|
-
node_cache[:
|
7968
|
+
node_cache[:sq_app_string_b64][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4658
7969
|
@index = cached.interval.end
|
4659
7970
|
end
|
4660
7971
|
return cached
|
4661
7972
|
end
|
4662
7973
|
|
4663
|
-
|
4664
|
-
|
7974
|
+
i0, s0 = index, []
|
7975
|
+
if (match_len = has_terminal?("b64'", false, index))
|
7976
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4665
7977
|
@index += match_len
|
4666
7978
|
else
|
4667
|
-
terminal_parse_failure('"\'"')
|
7979
|
+
terminal_parse_failure('"b64\'"')
|
7980
|
+
r1 = nil
|
7981
|
+
end
|
7982
|
+
s0 << r1
|
7983
|
+
if r1
|
7984
|
+
r2 = _nt_app_string_b64
|
7985
|
+
s0 << r2
|
7986
|
+
if r2
|
7987
|
+
if (match_len = has_terminal?("'", false, index))
|
7988
|
+
r3 = true
|
7989
|
+
@index += match_len
|
7990
|
+
else
|
7991
|
+
terminal_parse_failure('"\'"')
|
7992
|
+
r3 = nil
|
7993
|
+
end
|
7994
|
+
s0 << r3
|
7995
|
+
end
|
7996
|
+
end
|
7997
|
+
if s0.last
|
7998
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
7999
|
+
r0.extend(SqAppStringB640)
|
8000
|
+
r0.extend(SqAppStringB641)
|
8001
|
+
else
|
8002
|
+
@index = i0
|
4668
8003
|
r0 = nil
|
4669
8004
|
end
|
4670
8005
|
|
4671
|
-
node_cache[:
|
8006
|
+
node_cache[:sq_app_string_b64][start_index] = r0
|
4672
8007
|
|
4673
8008
|
r0
|
4674
8009
|
end
|
4675
8010
|
|
4676
|
-
|
4677
|
-
|
4678
|
-
|
4679
|
-
cached = node_cache[:DIGIT][index]
|
4680
|
-
if cached
|
4681
|
-
node_cache[:DIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4682
|
-
@index = cached.interval.end
|
4683
|
-
end
|
4684
|
-
return cached
|
8011
|
+
module AppStringB640
|
8012
|
+
def b64dig
|
8013
|
+
elements[0]
|
4685
8014
|
end
|
4686
8015
|
|
4687
|
-
|
4688
|
-
|
4689
|
-
@index += 1
|
4690
|
-
else
|
4691
|
-
terminal_parse_failure('[0-9]')
|
4692
|
-
r0 = nil
|
8016
|
+
def b64_S
|
8017
|
+
elements[1]
|
4693
8018
|
end
|
8019
|
+
end
|
4694
8020
|
|
4695
|
-
|
8021
|
+
module AppStringB641
|
8022
|
+
def b64_S
|
8023
|
+
elements[1]
|
8024
|
+
end
|
4696
8025
|
|
4697
|
-
r0
|
4698
8026
|
end
|
4699
8027
|
|
4700
|
-
|
4701
|
-
|
4702
|
-
|
4703
|
-
cached = node_cache[:DIGIT1][index]
|
4704
|
-
if cached
|
4705
|
-
node_cache[:DIGIT1][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4706
|
-
@index = cached.interval.end
|
4707
|
-
end
|
4708
|
-
return cached
|
8028
|
+
module AppStringB642
|
8029
|
+
def b64dig
|
8030
|
+
elements[0]
|
4709
8031
|
end
|
4710
8032
|
|
4711
|
-
|
4712
|
-
|
4713
|
-
@index += 1
|
4714
|
-
else
|
4715
|
-
terminal_parse_failure('[1-9]')
|
4716
|
-
r0 = nil
|
8033
|
+
def b64_S
|
8034
|
+
elements[1]
|
4717
8035
|
end
|
4718
8036
|
|
4719
|
-
node_cache[:DIGIT1][start_index] = r0
|
4720
|
-
|
4721
|
-
r0
|
4722
8037
|
end
|
4723
8038
|
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
cached = node_cache[:ODIGIT][index]
|
4728
|
-
if cached
|
4729
|
-
node_cache[:ODIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4730
|
-
@index = cached.interval.end
|
4731
|
-
end
|
4732
|
-
return cached
|
8039
|
+
module AppStringB643
|
8040
|
+
def b64dig1
|
8041
|
+
elements[0]
|
4733
8042
|
end
|
4734
8043
|
|
4735
|
-
|
4736
|
-
|
4737
|
-
@index += 1
|
4738
|
-
else
|
4739
|
-
terminal_parse_failure('[0-7]')
|
4740
|
-
r0 = nil
|
8044
|
+
def b64_S1
|
8045
|
+
elements[1]
|
4741
8046
|
end
|
4742
8047
|
|
4743
|
-
|
8048
|
+
def b64dig2
|
8049
|
+
elements[2]
|
8050
|
+
end
|
4744
8051
|
|
4745
|
-
|
4746
|
-
|
8052
|
+
def b64_S2
|
8053
|
+
elements[3]
|
8054
|
+
end
|
4747
8055
|
|
4748
|
-
|
4749
|
-
|
4750
|
-
if node_cache[:BDIGIT].has_key?(index)
|
4751
|
-
cached = node_cache[:BDIGIT][index]
|
4752
|
-
if cached
|
4753
|
-
node_cache[:BDIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4754
|
-
@index = cached.interval.end
|
4755
|
-
end
|
4756
|
-
return cached
|
8056
|
+
def b64_S3
|
8057
|
+
elements[5]
|
4757
8058
|
end
|
8059
|
+
end
|
4758
8060
|
|
4759
|
-
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
|
4764
|
-
|
8061
|
+
module AppStringB644
|
8062
|
+
end
|
8063
|
+
|
8064
|
+
module AppStringB645
|
8065
|
+
def b64_S
|
8066
|
+
elements[0]
|
4765
8067
|
end
|
4766
8068
|
|
4767
|
-
|
8069
|
+
end
|
4768
8070
|
|
4769
|
-
|
8071
|
+
module AppStringB646
|
8072
|
+
def ast
|
8073
|
+
t = text_value.gsub(/\s|#[^\n]*(?:\n|\z)/, '').chars.each_slice(4).map(&:join)
|
8074
|
+
if last = t[-1]
|
8075
|
+
last << "=" * (4 - last.size)
|
8076
|
+
end
|
8077
|
+
b = t.join.tr("-_", "+/")
|
8078
|
+
begin
|
8079
|
+
b.unpack("m0")[0]
|
8080
|
+
rescue ArgumentError
|
8081
|
+
raise ArgumentError, "cbor-diagnostic: invalid base64 #{b.inspect}", caller[1..-1]
|
8082
|
+
end
|
8083
|
+
end
|
4770
8084
|
end
|
4771
8085
|
|
4772
|
-
def
|
8086
|
+
def _nt_app_string_b64
|
4773
8087
|
start_index = index
|
4774
|
-
if node_cache[:
|
4775
|
-
cached = node_cache[:
|
8088
|
+
if node_cache[:app_string_b64].has_key?(index)
|
8089
|
+
cached = node_cache[:app_string_b64][index]
|
4776
8090
|
if cached
|
4777
|
-
node_cache[:
|
8091
|
+
node_cache[:app_string_b64][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4778
8092
|
@index = cached.interval.end
|
4779
8093
|
end
|
4780
8094
|
return cached
|
4781
8095
|
end
|
4782
8096
|
|
4783
|
-
i0 = index
|
4784
|
-
r1 =
|
8097
|
+
i0, s0 = index, []
|
8098
|
+
r1 = _nt_b64_S
|
8099
|
+
s0 << r1
|
4785
8100
|
if r1
|
4786
|
-
|
4787
|
-
|
4788
|
-
|
4789
|
-
|
4790
|
-
|
4791
|
-
|
4792
|
-
|
4793
|
-
|
4794
|
-
|
4795
|
-
|
4796
|
-
|
4797
|
-
|
4798
|
-
|
4799
|
-
|
4800
|
-
if (match_len = has_terminal?("b", :insens, index))
|
4801
|
-
r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4802
|
-
@index += match_len
|
4803
|
-
else
|
4804
|
-
terminal_parse_failure('"B"')
|
4805
|
-
r3 = nil
|
4806
|
-
end
|
4807
|
-
if r3
|
4808
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
4809
|
-
r0 = r3
|
4810
|
-
else
|
4811
|
-
if (match_len = has_terminal?("c", :insens, index))
|
4812
|
-
r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4813
|
-
@index += match_len
|
8101
|
+
s2, i2 = [], index
|
8102
|
+
loop do
|
8103
|
+
s3, i3 = [], index
|
8104
|
+
loop do
|
8105
|
+
i4, s4 = index, []
|
8106
|
+
r5 = _nt_b64dig
|
8107
|
+
s4 << r5
|
8108
|
+
if r5
|
8109
|
+
r6 = _nt_b64_S
|
8110
|
+
s4 << r6
|
8111
|
+
end
|
8112
|
+
if s4.last
|
8113
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
8114
|
+
r4.extend(AppStringB640)
|
4814
8115
|
else
|
4815
|
-
|
8116
|
+
@index = i4
|
4816
8117
|
r4 = nil
|
4817
8118
|
end
|
4818
8119
|
if r4
|
4819
|
-
|
4820
|
-
r0 = r4
|
8120
|
+
s3 << r4
|
4821
8121
|
else
|
4822
|
-
|
4823
|
-
|
4824
|
-
|
4825
|
-
|
4826
|
-
|
4827
|
-
|
4828
|
-
|
4829
|
-
|
4830
|
-
|
4831
|
-
|
4832
|
-
|
4833
|
-
|
4834
|
-
|
4835
|
-
|
4836
|
-
|
4837
|
-
|
4838
|
-
|
4839
|
-
|
4840
|
-
|
4841
|
-
|
4842
|
-
|
4843
|
-
|
4844
|
-
|
4845
|
-
|
8122
|
+
break
|
8123
|
+
end
|
8124
|
+
if s3.size == 4
|
8125
|
+
break
|
8126
|
+
end
|
8127
|
+
end
|
8128
|
+
if s3.size < 4
|
8129
|
+
@index = i3
|
8130
|
+
r3 = nil
|
8131
|
+
else
|
8132
|
+
if s3.size < 4
|
8133
|
+
@terminal_failures.pop
|
8134
|
+
end
|
8135
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
8136
|
+
end
|
8137
|
+
if r3
|
8138
|
+
s2 << r3
|
8139
|
+
else
|
8140
|
+
break
|
8141
|
+
end
|
8142
|
+
end
|
8143
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
8144
|
+
s0 << r2
|
8145
|
+
if r2
|
8146
|
+
i8, s8 = index, []
|
8147
|
+
r9 = _nt_b64dig
|
8148
|
+
s8 << r9
|
8149
|
+
if r9
|
8150
|
+
r10 = _nt_b64_S
|
8151
|
+
s8 << r10
|
8152
|
+
if r10
|
8153
|
+
r11 = _nt_b64dig
|
8154
|
+
s8 << r11
|
8155
|
+
if r11
|
8156
|
+
r12 = _nt_b64_S
|
8157
|
+
s8 << r12
|
8158
|
+
if r12
|
8159
|
+
i14 = index
|
8160
|
+
i15, s15 = index, []
|
8161
|
+
if (match_len = has_terminal?("=", false, index))
|
8162
|
+
r16 = true
|
4846
8163
|
@index += match_len
|
4847
8164
|
else
|
4848
|
-
terminal_parse_failure('"
|
4849
|
-
|
8165
|
+
terminal_parse_failure('"="')
|
8166
|
+
r16 = nil
|
4850
8167
|
end
|
4851
|
-
|
4852
|
-
|
4853
|
-
|
8168
|
+
s15 << r16
|
8169
|
+
if r16
|
8170
|
+
r17 = _nt_b64_S
|
8171
|
+
s15 << r17
|
8172
|
+
if r17
|
8173
|
+
if (match_len = has_terminal?("=", false, index))
|
8174
|
+
r18 = true
|
8175
|
+
@index += match_len
|
8176
|
+
else
|
8177
|
+
terminal_parse_failure('"="')
|
8178
|
+
r18 = nil
|
8179
|
+
end
|
8180
|
+
s15 << r18
|
8181
|
+
end
|
8182
|
+
end
|
8183
|
+
if s15.last
|
8184
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
8185
|
+
r15.extend(AppStringB641)
|
4854
8186
|
else
|
4855
|
-
@index =
|
4856
|
-
|
8187
|
+
@index = i15
|
8188
|
+
r15 = nil
|
8189
|
+
end
|
8190
|
+
if r15
|
8191
|
+
r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
|
8192
|
+
r14 = r15
|
8193
|
+
else
|
8194
|
+
i19, s19 = index, []
|
8195
|
+
r20 = _nt_b64dig
|
8196
|
+
s19 << r20
|
8197
|
+
if r20
|
8198
|
+
r21 = _nt_b64_S
|
8199
|
+
s19 << r21
|
8200
|
+
if r21
|
8201
|
+
if (match_len = has_terminal?("=", false, index))
|
8202
|
+
r23 = true
|
8203
|
+
@index += match_len
|
8204
|
+
else
|
8205
|
+
terminal_parse_failure('"="')
|
8206
|
+
r23 = nil
|
8207
|
+
end
|
8208
|
+
if r23
|
8209
|
+
r22 = r23
|
8210
|
+
else
|
8211
|
+
r22 = instantiate_node(SyntaxNode,input, index...index)
|
8212
|
+
end
|
8213
|
+
s19 << r22
|
8214
|
+
end
|
8215
|
+
end
|
8216
|
+
if s19.last
|
8217
|
+
r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
|
8218
|
+
r19.extend(AppStringB642)
|
8219
|
+
else
|
8220
|
+
@index = i19
|
8221
|
+
r19 = nil
|
8222
|
+
end
|
8223
|
+
if r19
|
8224
|
+
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
8225
|
+
r14 = r19
|
8226
|
+
else
|
8227
|
+
@index = i14
|
8228
|
+
r14 = nil
|
8229
|
+
end
|
8230
|
+
end
|
8231
|
+
if r14
|
8232
|
+
r13 = r14
|
8233
|
+
else
|
8234
|
+
r13 = instantiate_node(SyntaxNode,input, index...index)
|
8235
|
+
end
|
8236
|
+
s8 << r13
|
8237
|
+
if r13
|
8238
|
+
r24 = _nt_b64_S
|
8239
|
+
s8 << r24
|
4857
8240
|
end
|
4858
8241
|
end
|
4859
8242
|
end
|
4860
8243
|
end
|
4861
8244
|
end
|
8245
|
+
if s8.last
|
8246
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
8247
|
+
r8.extend(AppStringB643)
|
8248
|
+
else
|
8249
|
+
@index = i8
|
8250
|
+
r8 = nil
|
8251
|
+
end
|
8252
|
+
if r8
|
8253
|
+
r7 = r8
|
8254
|
+
else
|
8255
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
8256
|
+
end
|
8257
|
+
s0 << r7
|
8258
|
+
if r7
|
8259
|
+
i26, s26 = index, []
|
8260
|
+
if (match_len = has_terminal?("#", false, index))
|
8261
|
+
r27 = true
|
8262
|
+
@index += match_len
|
8263
|
+
else
|
8264
|
+
terminal_parse_failure('"#"')
|
8265
|
+
r27 = nil
|
8266
|
+
end
|
8267
|
+
s26 << r27
|
8268
|
+
if r27
|
8269
|
+
s28, i28 = [], index
|
8270
|
+
loop do
|
8271
|
+
r29 = _nt_i_non_lf
|
8272
|
+
if r29
|
8273
|
+
s28 << r29
|
8274
|
+
else
|
8275
|
+
break
|
8276
|
+
end
|
8277
|
+
end
|
8278
|
+
r28 = instantiate_node(SyntaxNode,input, i28...index, s28)
|
8279
|
+
s26 << r28
|
8280
|
+
end
|
8281
|
+
if s26.last
|
8282
|
+
r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
|
8283
|
+
r26.extend(AppStringB644)
|
8284
|
+
else
|
8285
|
+
@index = i26
|
8286
|
+
r26 = nil
|
8287
|
+
end
|
8288
|
+
if r26
|
8289
|
+
r25 = r26
|
8290
|
+
else
|
8291
|
+
r25 = instantiate_node(SyntaxNode,input, index...index)
|
8292
|
+
end
|
8293
|
+
s0 << r25
|
8294
|
+
end
|
4862
8295
|
end
|
4863
8296
|
end
|
8297
|
+
if s0.last
|
8298
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
8299
|
+
r0.extend(AppStringB645)
|
8300
|
+
r0.extend(AppStringB646)
|
8301
|
+
else
|
8302
|
+
@index = i0
|
8303
|
+
r0 = nil
|
8304
|
+
end
|
4864
8305
|
|
4865
|
-
node_cache[:
|
8306
|
+
node_cache[:app_string_b64][start_index] = r0
|
4866
8307
|
|
4867
8308
|
r0
|
4868
8309
|
end
|
4869
8310
|
|
4870
|
-
def
|
8311
|
+
def _nt_b64dig
|
4871
8312
|
start_index = index
|
4872
|
-
if node_cache[:
|
4873
|
-
cached = node_cache[:
|
8313
|
+
if node_cache[:b64dig].has_key?(index)
|
8314
|
+
cached = node_cache[:b64dig][index]
|
4874
8315
|
if cached
|
4875
|
-
node_cache[:
|
8316
|
+
node_cache[:b64dig][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4876
8317
|
@index = cached.interval.end
|
4877
8318
|
end
|
4878
8319
|
return cached
|
4879
8320
|
end
|
4880
8321
|
|
4881
8322
|
i0 = index
|
4882
|
-
r1 =
|
8323
|
+
r1 = _nt_ALPHA
|
4883
8324
|
if r1
|
4884
8325
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
4885
8326
|
r0 = r1
|
4886
8327
|
else
|
4887
|
-
|
4888
|
-
r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
|
4889
|
-
@index += match_len
|
4890
|
-
else
|
4891
|
-
terminal_parse_failure('"A"')
|
4892
|
-
r2 = nil
|
4893
|
-
end
|
8328
|
+
r2 = _nt_DIGIT
|
4894
8329
|
if r2
|
4895
8330
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
4896
8331
|
r0 = r2
|
4897
8332
|
else
|
4898
|
-
if (match_len = has_terminal?("
|
4899
|
-
r3 =
|
8333
|
+
if (match_len = has_terminal?("-", false, index))
|
8334
|
+
r3 = true
|
4900
8335
|
@index += match_len
|
4901
8336
|
else
|
4902
|
-
terminal_parse_failure('"
|
8337
|
+
terminal_parse_failure('"-"')
|
4903
8338
|
r3 = nil
|
4904
8339
|
end
|
4905
8340
|
if r3
|
4906
8341
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
4907
8342
|
r0 = r3
|
4908
8343
|
else
|
4909
|
-
if (match_len = has_terminal?("
|
4910
|
-
r4 =
|
8344
|
+
if (match_len = has_terminal?("_", false, index))
|
8345
|
+
r4 = true
|
4911
8346
|
@index += match_len
|
4912
8347
|
else
|
4913
|
-
terminal_parse_failure('"
|
8348
|
+
terminal_parse_failure('"_"')
|
4914
8349
|
r4 = nil
|
4915
8350
|
end
|
4916
8351
|
if r4
|
4917
8352
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
4918
8353
|
r0 = r4
|
4919
8354
|
else
|
4920
|
-
if (match_len = has_terminal?("
|
4921
|
-
r5 =
|
8355
|
+
if (match_len = has_terminal?("+", false, index))
|
8356
|
+
r5 = true
|
4922
8357
|
@index += match_len
|
4923
8358
|
else
|
4924
|
-
terminal_parse_failure('"
|
8359
|
+
terminal_parse_failure('"+"')
|
4925
8360
|
r5 = nil
|
4926
8361
|
end
|
4927
8362
|
if r5
|
4928
8363
|
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
4929
8364
|
r0 = r5
|
4930
8365
|
else
|
4931
|
-
if (match_len = has_terminal?("
|
4932
|
-
r6 =
|
8366
|
+
if (match_len = has_terminal?("/", false, index))
|
8367
|
+
r6 = true
|
4933
8368
|
@index += match_len
|
4934
8369
|
else
|
4935
|
-
terminal_parse_failure('"
|
8370
|
+
terminal_parse_failure('"/"')
|
4936
8371
|
r6 = nil
|
4937
8372
|
end
|
4938
8373
|
if r6
|
4939
8374
|
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
4940
8375
|
r0 = r6
|
4941
8376
|
else
|
4942
|
-
|
4943
|
-
|
4944
|
-
@index += match_len
|
4945
|
-
else
|
4946
|
-
terminal_parse_failure('"F"')
|
4947
|
-
r7 = nil
|
4948
|
-
end
|
4949
|
-
if r7
|
4950
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
4951
|
-
r0 = r7
|
4952
|
-
else
|
4953
|
-
@index = i0
|
4954
|
-
r0 = nil
|
4955
|
-
end
|
8377
|
+
@index = i0
|
8378
|
+
r0 = nil
|
4956
8379
|
end
|
4957
8380
|
end
|
4958
8381
|
end
|
@@ -4960,163 +8383,147 @@ module EDNGRAMMAR
|
|
4960
8383
|
end
|
4961
8384
|
end
|
4962
8385
|
|
4963
|
-
node_cache[:
|
8386
|
+
node_cache[:b64dig][start_index] = r0
|
4964
8387
|
|
4965
8388
|
r0
|
4966
8389
|
end
|
4967
8390
|
|
4968
|
-
|
4969
|
-
|
4970
|
-
|
4971
|
-
cached = node_cache[:lcalpha][index]
|
4972
|
-
if cached
|
4973
|
-
node_cache[:lcalpha][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4974
|
-
@index = cached.interval.end
|
4975
|
-
end
|
4976
|
-
return cached
|
4977
|
-
end
|
4978
|
-
|
4979
|
-
if has_terminal?(@regexps[gr = '\A[a-z]'] ||= Regexp.new(gr), :regexp, index)
|
4980
|
-
r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
4981
|
-
@index += 1
|
4982
|
-
else
|
4983
|
-
terminal_parse_failure('[a-z]')
|
4984
|
-
r0 = nil
|
8391
|
+
module B64S0
|
8392
|
+
def b64_comment
|
8393
|
+
elements[0]
|
4985
8394
|
end
|
4986
8395
|
|
4987
|
-
|
8396
|
+
end
|
4988
8397
|
|
4989
|
-
|
8398
|
+
module B64S1
|
4990
8399
|
end
|
4991
8400
|
|
4992
|
-
def
|
8401
|
+
def _nt_b64_S
|
4993
8402
|
start_index = index
|
4994
|
-
if node_cache[:
|
4995
|
-
cached = node_cache[:
|
8403
|
+
if node_cache[:b64_S].has_key?(index)
|
8404
|
+
cached = node_cache[:b64_S][index]
|
4996
8405
|
if cached
|
4997
|
-
node_cache[:
|
8406
|
+
node_cache[:b64_S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
4998
8407
|
@index = cached.interval.end
|
4999
8408
|
end
|
5000
8409
|
return cached
|
5001
8410
|
end
|
5002
8411
|
|
5003
|
-
i0 = index
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
r0 = r1
|
5008
|
-
else
|
5009
|
-
r2 = _nt_DIGIT
|
8412
|
+
i0, s0 = index, []
|
8413
|
+
s1, i1 = [], index
|
8414
|
+
loop do
|
8415
|
+
r2 = _nt_i_blank
|
5010
8416
|
if r2
|
5011
|
-
|
5012
|
-
r0 = r2
|
8417
|
+
s1 << r2
|
5013
8418
|
else
|
5014
|
-
|
5015
|
-
r0 = nil
|
8419
|
+
break
|
5016
8420
|
end
|
5017
8421
|
end
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
|
5026
|
-
|
5027
|
-
|
5028
|
-
|
5029
|
-
|
5030
|
-
|
8422
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
8423
|
+
s0 << r1
|
8424
|
+
if r1
|
8425
|
+
s3, i3 = [], index
|
8426
|
+
loop do
|
8427
|
+
i4, s4 = index, []
|
8428
|
+
r5 = _nt_b64_comment
|
8429
|
+
s4 << r5
|
8430
|
+
if r5
|
8431
|
+
s6, i6 = [], index
|
8432
|
+
loop do
|
8433
|
+
r7 = _nt_i_blank
|
8434
|
+
if r7
|
8435
|
+
s6 << r7
|
8436
|
+
else
|
8437
|
+
break
|
8438
|
+
end
|
8439
|
+
end
|
8440
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
8441
|
+
s4 << r6
|
8442
|
+
end
|
8443
|
+
if s4.last
|
8444
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
8445
|
+
r4.extend(B64S0)
|
8446
|
+
else
|
8447
|
+
@index = i4
|
8448
|
+
r4 = nil
|
8449
|
+
end
|
8450
|
+
if r4
|
8451
|
+
s3 << r4
|
8452
|
+
else
|
8453
|
+
break
|
8454
|
+
end
|
5031
8455
|
end
|
5032
|
-
|
8456
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
8457
|
+
s0 << r3
|
5033
8458
|
end
|
5034
|
-
|
5035
|
-
|
5036
|
-
r0
|
5037
|
-
@index += 1
|
8459
|
+
if s0.last
|
8460
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
8461
|
+
r0.extend(B64S1)
|
5038
8462
|
else
|
5039
|
-
|
8463
|
+
@index = i0
|
5040
8464
|
r0 = nil
|
5041
8465
|
end
|
5042
8466
|
|
5043
|
-
node_cache[:
|
8467
|
+
node_cache[:b64_S][start_index] = r0
|
5044
8468
|
|
5045
8469
|
r0
|
5046
8470
|
end
|
5047
8471
|
|
5048
|
-
|
5049
|
-
start_index = index
|
5050
|
-
if node_cache[:ucalnum].has_key?(index)
|
5051
|
-
cached = node_cache[:ucalnum][index]
|
5052
|
-
if cached
|
5053
|
-
node_cache[:ucalnum][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5054
|
-
@index = cached.interval.end
|
5055
|
-
end
|
5056
|
-
return cached
|
5057
|
-
end
|
5058
|
-
|
5059
|
-
i0 = index
|
5060
|
-
r1 = _nt_ucalpha
|
5061
|
-
if r1
|
5062
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
5063
|
-
r0 = r1
|
5064
|
-
else
|
5065
|
-
r2 = _nt_DIGIT
|
5066
|
-
if r2
|
5067
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5068
|
-
r0 = r2
|
5069
|
-
else
|
5070
|
-
@index = i0
|
5071
|
-
r0 = nil
|
5072
|
-
end
|
5073
|
-
end
|
5074
|
-
|
5075
|
-
node_cache[:ucalnum][start_index] = r0
|
5076
|
-
|
5077
|
-
r0
|
8472
|
+
module B64Comment0
|
5078
8473
|
end
|
5079
8474
|
|
5080
|
-
def
|
8475
|
+
def _nt_b64_comment
|
5081
8476
|
start_index = index
|
5082
|
-
if node_cache[:
|
5083
|
-
cached = node_cache[:
|
8477
|
+
if node_cache[:b64_comment].has_key?(index)
|
8478
|
+
cached = node_cache[:b64_comment][index]
|
5084
8479
|
if cached
|
5085
|
-
node_cache[:
|
8480
|
+
node_cache[:b64_comment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
5086
8481
|
@index = cached.interval.end
|
5087
8482
|
end
|
5088
8483
|
return cached
|
5089
8484
|
end
|
5090
8485
|
|
5091
|
-
i0 = index
|
5092
|
-
if (match_len = has_terminal?("
|
8486
|
+
i0, s0 = index, []
|
8487
|
+
if (match_len = has_terminal?("#", false, index))
|
5093
8488
|
r1 = true
|
5094
8489
|
@index += match_len
|
5095
8490
|
else
|
5096
|
-
terminal_parse_failure('"
|
8491
|
+
terminal_parse_failure('"#"')
|
5097
8492
|
r1 = nil
|
5098
8493
|
end
|
8494
|
+
s0 << r1
|
5099
8495
|
if r1
|
5100
|
-
|
5101
|
-
|
5102
|
-
|
5103
|
-
r2 = _nt_lcalnum
|
5104
|
-
if r2
|
5105
|
-
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
5106
|
-
r0 = r2
|
5107
|
-
else
|
5108
|
-
r3 = _nt_ucalpha
|
8496
|
+
s2, i2 = [], index
|
8497
|
+
loop do
|
8498
|
+
r3 = _nt_i_non_lf
|
5109
8499
|
if r3
|
5110
|
-
|
5111
|
-
r0 = r3
|
8500
|
+
s2 << r3
|
5112
8501
|
else
|
5113
|
-
|
5114
|
-
|
8502
|
+
break
|
8503
|
+
end
|
8504
|
+
end
|
8505
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
8506
|
+
s0 << r2
|
8507
|
+
if r2
|
8508
|
+
if (match_len = has_terminal?("\n", false, index))
|
8509
|
+
r4 = true
|
8510
|
+
@index += match_len
|
8511
|
+
else
|
8512
|
+
terminal_parse_failure('"\\n"')
|
8513
|
+
r4 = nil
|
5115
8514
|
end
|
8515
|
+
s0 << r4
|
5116
8516
|
end
|
5117
8517
|
end
|
8518
|
+
if s0.last
|
8519
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
8520
|
+
r0.extend(B64Comment0)
|
8521
|
+
else
|
8522
|
+
@index = i0
|
8523
|
+
r0 = nil
|
8524
|
+
end
|
5118
8525
|
|
5119
|
-
node_cache[:
|
8526
|
+
node_cache[:b64_comment][start_index] = r0
|
5120
8527
|
|
5121
8528
|
r0
|
5122
8529
|
end
|