edn-abnf 0.5.1 → 0.5.3

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