lrama 0.5.11 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yaml +2 -2
  3. data/Gemfile +1 -1
  4. data/LEGAL.md +1 -0
  5. data/NEWS.md +187 -0
  6. data/README.md +15 -4
  7. data/Steepfile +3 -0
  8. data/lib/lrama/grammar/code/printer_code.rb +1 -1
  9. data/lib/lrama/grammar/code/rule_action.rb +19 -3
  10. data/lib/lrama/grammar/code.rb +19 -7
  11. data/lib/lrama/grammar/parameterizing_rule.rb +6 -0
  12. data/lib/lrama/grammar/parameterizing_rule_builder.rb +34 -0
  13. data/lib/lrama/grammar/parameterizing_rule_resolver.rb +30 -0
  14. data/lib/lrama/grammar/parameterizing_rule_rhs_builder.rb +53 -0
  15. data/lib/lrama/grammar/rule_builder.rb +26 -22
  16. data/lib/lrama/grammar.rb +15 -41
  17. data/lib/lrama/lexer/grammar_file.rb +21 -0
  18. data/lib/lrama/lexer/location.rb +77 -2
  19. data/lib/lrama/lexer/token/instantiate_rule.rb +18 -0
  20. data/lib/lrama/lexer/token/user_code.rb +10 -10
  21. data/lib/lrama/lexer/token.rb +1 -1
  22. data/lib/lrama/lexer.rb +21 -11
  23. data/lib/lrama/parser.rb +619 -454
  24. data/lib/lrama/states_reporter.rb +1 -1
  25. data/lib/lrama/version.rb +1 -1
  26. data/parser.y +95 -30
  27. data/sig/lrama/grammar/code/printer_code.rbs +1 -1
  28. data/sig/lrama/grammar/code.rbs +5 -5
  29. data/sig/lrama/grammar/parameterizing_rule.rbs +10 -0
  30. data/sig/lrama/grammar/parameterizing_rule_builder.rbs +19 -0
  31. data/sig/lrama/grammar/parameterizing_rule_resolver.rbs +16 -0
  32. data/sig/lrama/grammar/parameterizing_rule_rhs_builder.rbs +18 -0
  33. data/sig/lrama/grammar/parameterizing_rules/builder/base.rbs +5 -3
  34. data/sig/lrama/grammar/parameterizing_rules/builder/separated_list.rbs +2 -0
  35. data/sig/lrama/grammar/parameterizing_rules/builder/separated_nonempty_list.rbs +2 -0
  36. data/sig/lrama/grammar/parameterizing_rules/builder.rbs +4 -3
  37. data/sig/lrama/grammar/rule_builder.rbs +2 -4
  38. data/sig/lrama/lexer/grammar_file.rbs +15 -0
  39. data/sig/lrama/lexer/location.rbs +13 -1
  40. data/sig/lrama/lexer/token/instantiate_rule.rbs +12 -0
  41. metadata +16 -6
  42. data/doc/TODO.md +0 -59
  43. data/lib/lrama/lexer/token/parameterizing.rb +0 -34
  44. data/sig/lrama/lexer/token/parameterizing.rbs +0 -17
data/lib/lrama/parser.rb CHANGED
@@ -658,13 +658,12 @@ end
658
658
  module Lrama
659
659
  class Parser < Racc::Parser
660
660
 
661
- module_eval(<<'...end parser.y/module_eval...', 'parser.y', 420)
661
+ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 500)
662
662
 
663
663
  include Lrama::Report::Duration
664
664
 
665
665
  def initialize(text, path, debug = false)
666
- @text = text
667
- @path = path
666
+ @grammar_file = Lrama::Lexer::GrammarFile.new(path, text)
668
667
  @yydebug = debug
669
668
  @rule_counter = Lrama::Grammar::Counter.new(0)
670
669
  @midrule_action_counter = Lrama::Grammar::Counter.new(1)
@@ -672,7 +671,7 @@ end
672
671
 
673
672
  def parse
674
673
  report_duration(:parse) do
675
- @lexer = Lrama::Lexer.new(@text)
674
+ @lexer = Lrama::Lexer.new(@grammar_file)
676
675
  @grammar = Lrama::Grammar.new(@rule_counter)
677
676
  @precedence_number = 0
678
677
  reset_precs
@@ -689,40 +688,26 @@ end
689
688
 
690
689
  def on_error(error_token_id, error_value, value_stack)
691
690
  if error_value.is_a?(Lrama::Lexer::Token)
692
- line = error_value.first_line
693
- first_column = error_value.first_column
694
- last_column = error_value.last_column
691
+ location = error_value.location
695
692
  value = "'#{error_value.s_value}'"
696
693
  else
697
- line = @lexer.line
698
- first_column = @lexer.head_column
699
- last_column = @lexer.column
694
+ location = @lexer.location
700
695
  value = error_value.inspect
701
696
  end
702
697
 
703
- raise ParseError, <<~ERROR
704
- #{@path}:#{line}:#{first_column}: parse error on value #{value} (#{token_to_str(error_token_id) || '?'})
705
- #{@text.split("\n")[line - 1]}
706
- #{carrets(first_column, last_column)}
707
- ERROR
698
+ error_message = "parse error on value #{value} (#{token_to_str(error_token_id) || '?'})"
699
+
700
+ raise_parse_error(error_message, location)
708
701
  end
709
702
 
710
703
  def on_action_error(error_message, error_value)
711
704
  if error_value.is_a?(Lrama::Lexer::Token)
712
- line = error_value.first_line
713
- first_column = error_value.first_column
714
- last_column = error_value.last_column
705
+ location = error_value.location
715
706
  else
716
- line = @lexer.line
717
- first_column = @lexer.head_column
718
- last_column = @lexer.column
707
+ location = @lexer.location
719
708
  end
720
709
 
721
- raise ParseError, <<~ERROR
722
- #{@path}:#{line}: #{error_message}
723
- #{@text.split("\n")[line - 1]}
724
- #{carrets(first_column, last_column)}
725
- ERROR
710
+ raise_parse_error(error_message, location)
726
711
  end
727
712
 
728
713
  private
@@ -742,268 +727,303 @@ def end_c_declaration
742
727
  @lexer.end_symbol = nil
743
728
  end
744
729
 
745
- def carrets(first_column, last_column)
746
- ' ' * (first_column + 1) + '^' * (last_column - first_column)
730
+ def raise_parse_error(error_message, location)
731
+ raise ParseError, location.generate_error_message(error_message)
747
732
  end
748
733
  ...end parser.y/module_eval...
749
734
  ##### State transition tables begin ###
750
735
 
751
736
  racc_action_table = [
752
- 82, 42, 83, 137, 42, 65, 137, 38, 65, 136,
753
- 42, 6, 41, 7, 42, 56, 41, 139, 65, 61,
754
- 139, 135, 42, 42, 41, 41, 20, 22, 23, 24,
755
- 25, 26, 27, 28, 29, 30, 140, 38, 3, 140,
756
- 84, 42, 77, 41, 8, 42, 68, 41, 172, 42,
757
- 68, 41, 32, 173, 68, 39, 20, 22, 23, 24,
758
- 25, 26, 27, 28, 29, 30, 9, 42, 45, 41,
759
- 12, 13, 14, 15, 16, 17, 45, 45, 18, 19,
760
- 20, 22, 23, 24, 25, 26, 27, 28, 29, 30,
761
- 42, 48, 41, 151, 49, 68, 152, 153, 154, 42,
762
- 42, 41, 41, 65, 163, 42, 42, 41, 41, 65,
763
- 163, 42, 42, 41, 41, 65, 163, 42, 42, 41,
764
- 41, 65, 163, 42, 42, 41, 41, 65, 163, 42,
765
- 42, 41, 41, 65, 163, 42, 42, 41, 41, 65,
766
- 65, 42, 42, 41, 41, 65, 65, 42, 42, 41,
767
- 41, 65, 65, 42, 42, 41, 41, 65, 65, 42,
768
- 42, 41, 41, 50, 51, 52, 53, 74, 78, 80,
769
- 85, 85, 85, 87, 93, 97, 98, 101, 101, 101,
770
- 101, 106, 107, 109, 111, 112, 113, 114, 115, 118,
771
- 121, 122, 125, 126, 127, 129, 142, 144, 145, 146,
772
- 147, 148, 125, 80, 158, 159, 167, 170, 167, 177,
773
- 80 ]
737
+ 85, 44, 86, 145, 144, 67, 44, 44, 145, 187,
738
+ 67, 67, 44, 6, 187, 7, 67, 147, 196, 44,
739
+ 143, 43, 147, 188, 58, 163, 164, 165, 188, 3,
740
+ 44, 40, 43, 8, 67, 63, 34, 44, 148, 43,
741
+ 41, 87, 40, 148, 189, 47, 44, 80, 43, 189,
742
+ 21, 23, 24, 25, 26, 27, 28, 29, 30, 31,
743
+ 47, 21, 23, 24, 25, 26, 27, 28, 29, 30,
744
+ 31, 9, 44, 47, 43, 13, 14, 15, 16, 17,
745
+ 18, 50, 51, 19, 20, 21, 23, 24, 25, 26,
746
+ 27, 28, 29, 30, 31, 32, 44, 44, 43, 43,
747
+ 52, 70, 70, 44, 44, 43, 43, 53, 70, 70,
748
+ 44, 44, 43, 43, 67, 173, 44, 44, 43, 43,
749
+ 67, 173, 44, 44, 43, 43, 67, 173, 44, 44,
750
+ 43, 43, 67, 173, 44, 44, 43, 43, 67, 173,
751
+ 44, 44, 43, 43, 67, 173, 44, 44, 43, 43,
752
+ 67, 67, 44, 44, 43, 43, 67, 67, 44, 44,
753
+ 43, 43, 67, 67, 44, 44, 43, 43, 67, 67,
754
+ 44, 44, 43, 43, 67, 67, 163, 164, 165, 83,
755
+ 44, 44, 43, 43, 141, 190, 142, 191, 205, 54,
756
+ 191, 55, 76, 77, 81, 83, 88, 88, 88, 90,
757
+ 96, 100, 101, 104, 104, 104, 104, 107, 110, 111,
758
+ 113, 115, 116, 117, 118, 119, 122, 126, 127, 128,
759
+ 131, 132, 133, 135, 150, 152, 153, 154, 155, 156,
760
+ 157, 158, 131, 160, 168, 169, 178, 182, 183, 185,
761
+ 178, 83, 182, 201, 203, 83, 207, 83 ]
774
762
 
775
763
  racc_action_check = [
776
- 40, 124, 40, 124, 149, 124, 149, 9, 149, 123,
777
- 25, 2, 25, 2, 26, 25, 26, 124, 26, 26,
778
- 149, 123, 13, 55, 13, 55, 9, 9, 9, 9,
779
- 9, 9, 9, 9, 9, 9, 124, 33, 1, 149,
780
- 40, 27, 33, 27, 3, 28, 27, 28, 168, 29,
781
- 28, 29, 7, 168, 29, 12, 33, 33, 33, 33,
782
- 33, 33, 33, 33, 33, 33, 4, 56, 14, 56,
783
- 4, 4, 4, 4, 4, 4, 15, 16, 4, 4,
784
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
785
- 30, 17, 30, 137, 18, 30, 137, 137, 137, 146,
786
- 67, 146, 67, 146, 146, 147, 68, 147, 68, 147,
787
- 147, 148, 93, 148, 93, 148, 148, 160, 95, 160,
788
- 95, 160, 160, 164, 101, 164, 101, 164, 164, 165,
789
- 103, 165, 103, 165, 165, 60, 61, 60, 61, 60,
790
- 61, 98, 100, 98, 100, 98, 100, 119, 140, 119,
791
- 140, 119, 140, 151, 173, 151, 173, 151, 173, 116,
792
- 120, 116, 120, 20, 22, 23, 24, 31, 36, 37,
793
- 44, 46, 47, 48, 54, 58, 59, 66, 71, 72,
794
- 73, 79, 80, 86, 88, 89, 90, 91, 92, 96,
795
- 104, 105, 106, 107, 108, 110, 128, 130, 131, 132,
796
- 133, 134, 135, 138, 141, 143, 150, 156, 172, 174,
797
- 177 ]
764
+ 42, 130, 42, 130, 129, 130, 159, 177, 159, 177,
765
+ 159, 177, 193, 2, 193, 2, 193, 130, 187, 26,
766
+ 129, 26, 159, 177, 26, 187, 187, 187, 193, 1,
767
+ 27, 9, 27, 3, 27, 27, 7, 14, 130, 14,
768
+ 13, 42, 35, 159, 177, 15, 57, 35, 57, 193,
769
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
770
+ 16, 35, 35, 35, 35, 35, 35, 35, 35, 35,
771
+ 35, 4, 58, 17, 58, 4, 4, 4, 4, 4,
772
+ 4, 18, 19, 4, 4, 4, 4, 4, 4, 4,
773
+ 4, 4, 4, 4, 4, 4, 28, 29, 28, 29,
774
+ 21, 28, 29, 30, 31, 30, 31, 23, 30, 31,
775
+ 154, 69, 154, 69, 154, 154, 155, 70, 155, 70,
776
+ 155, 155, 156, 96, 156, 96, 156, 156, 170, 98,
777
+ 170, 98, 170, 170, 174, 104, 174, 104, 174, 174,
778
+ 175, 106, 175, 106, 175, 175, 62, 63, 62, 63,
779
+ 62, 63, 101, 103, 101, 103, 101, 103, 123, 148,
780
+ 123, 148, 123, 148, 160, 189, 160, 189, 160, 189,
781
+ 191, 196, 191, 196, 191, 196, 146, 146, 146, 146,
782
+ 120, 124, 120, 124, 125, 179, 125, 179, 202, 24,
783
+ 202, 25, 32, 33, 38, 39, 46, 48, 49, 50,
784
+ 56, 60, 61, 68, 73, 74, 75, 76, 82, 83,
785
+ 89, 91, 92, 93, 94, 95, 99, 107, 108, 109,
786
+ 110, 111, 112, 114, 134, 136, 137, 138, 139, 140,
787
+ 141, 142, 143, 145, 149, 151, 157, 162, 166, 176,
788
+ 185, 186, 190, 192, 197, 201, 206, 207 ]
798
789
 
799
790
  racc_action_pointer = [
800
- nil, 38, 1, 44, 57, nil, nil, 45, nil, 3,
801
- nil, nil, 49, 19, 49, 57, 58, 86, 75, nil,
802
- 144, nil, 145, 146, 147, 7, 11, 38, 42, 46,
803
- 87, 165, nil, 33, nil, nil, 146, 126, nil, nil,
804
- -5, nil, nil, nil, 151, nil, 152, 153, 154, nil,
805
- nil, nil, nil, nil, 166, 20, 64, nil, 169, 168,
806
- 132, 133, nil, nil, nil, nil, 169, 97, 103, nil,
807
- nil, 170, 171, 172, nil, nil, nil, nil, nil, 148,
808
- 177, nil, nil, nil, nil, nil, 181, nil, 182, 183,
809
- 184, 185, 186, 109, nil, 115, 182, nil, 138, nil,
810
- 139, 121, nil, 127, 179, 189, 157, 149, 192, nil,
811
- 193, nil, nil, nil, nil, nil, 156, nil, nil, 144,
812
- 157, nil, nil, -13, -2, nil, nil, nil, 176, nil,
813
- 177, 178, 179, 180, 181, 167, nil, 57, 160, nil,
814
- 145, 184, nil, 185, nil, nil, 96, 102, 108, 1,
815
- 198, 150, nil, nil, nil, nil, 205, nil, nil, nil,
816
- 114, nil, nil, nil, 120, 126, nil, nil, 11, nil,
817
- nil, nil, 200, 151, 189, nil, nil, 167, nil ]
791
+ nil, 29, 3, 33, 62, nil, nil, 29, nil, 27,
792
+ nil, nil, nil, 34, 34, 26, 41, 54, 76, 63,
793
+ nil, 81, nil, 88, 170, 172, 16, 27, 93, 94,
794
+ 100, 101, 187, 191, nil, 38, nil, nil, 172, 151,
795
+ nil, nil, -5, nil, nil, nil, 177, nil, 178, 179,
796
+ 180, nil, nil, nil, nil, nil, 192, 43, 69, nil,
797
+ 195, 194, 143, 144, nil, nil, nil, nil, 195, 108,
798
+ 114, nil, nil, 196, 197, 198, 173, nil, nil, nil,
799
+ nil, nil, 172, 204, nil, nil, nil, nil, nil, 208,
800
+ nil, 209, 210, 211, 212, 213, 120, nil, 126, 209,
801
+ nil, 149, nil, 150, 132, nil, 138, 212, 207, 217,
802
+ 181, 176, 220, nil, 221, nil, nil, nil, nil, nil,
803
+ 177, nil, nil, 155, 178, 149, nil, nil, nil, -18,
804
+ -2, nil, nil, nil, 204, nil, 205, 206, 207, 208,
805
+ 209, 194, 226, 193, nil, 199, 135, nil, 156, 214,
806
+ nil, 215, nil, nil, 107, 113, 119, 197, nil, 3,
807
+ 161, nil, 229, nil, nil, nil, 236, nil, nil, nil,
808
+ 125, nil, nil, nil, 131, 137, 201, 4, nil, 150,
809
+ nil, nil, nil, nil, nil, 201, 197, -16, nil, 162,
810
+ 234, 167, 223, 9, nil, nil, 168, 242, nil, nil,
811
+ nil, 201, 153, nil, nil, nil, 226, 203, nil ]
818
812
 
819
813
  racc_action_default = [
820
- -2, -113, -8, -113, -113, -3, -4, -113, 179, -113,
821
- -9, -10, -113, -113, -113, -113, -113, -113, -113, -22,
822
- -113, -26, -113, -113, -113, -113, -113, -113, -113, -113,
823
- -113, -113, -7, -98, -73, -75, -113, -95, -97, -11,
824
- -102, -71, -72, -101, -13, -62, -14, -15, -113, -19,
825
- -23, -27, -30, -33, -36, -42, -113, -45, -48, -37,
826
- -52, -113, -55, -57, -58, -110, -38, -65, -113, -68,
827
- -70, -39, -40, -41, -5, -1, -74, -99, -76, -113,
828
- -113, -12, -103, -104, -105, -59, -113, -16, -113, -113,
829
- -113, -113, -113, -113, -46, -43, -50, -49, -113, -56,
830
- -53, -113, -69, -66, -113, -113, -81, -113, -113, -63,
831
- -113, -20, -24, -28, -31, -34, -44, -47, -51, -54,
832
- -67, -6, -100, -77, -78, -82, -96, -60, -113, -17,
833
- -113, -113, -113, -113, -113, -81, -80, -71, -95, -86,
834
- -113, -113, -64, -113, -21, -25, -113, -113, -113, -79,
835
- -111, -113, -90, -91, -92, -83, -113, -89, -61, -18,
836
- -29, -106, -108, -109, -32, -35, -84, -112, -113, -93,
837
- -87, -107, -111, -113, -113, -85, -94, -95, -88 ]
814
+ -2, -128, -8, -128, -128, -3, -4, -128, 209, -128,
815
+ -9, -10, -11, -128, -128, -128, -128, -128, -128, -128,
816
+ -23, -128, -27, -128, -128, -128, -128, -128, -128, -128,
817
+ -128, -128, -128, -128, -7, -113, -88, -90, -128, -110,
818
+ -112, -12, -117, -86, -87, -116, -14, -77, -15, -16,
819
+ -128, -20, -24, -28, -31, -34, -37, -43, -128, -46,
820
+ -63, -38, -67, -128, -70, -72, -73, -125, -39, -80,
821
+ -128, -83, -85, -40, -41, -42, -128, -5, -1, -89,
822
+ -114, -91, -128, -128, -13, -118, -119, -120, -74, -128,
823
+ -17, -128, -128, -128, -128, -128, -128, -47, -44, -65,
824
+ -64, -128, -71, -68, -128, -84, -81, -128, -128, -128,
825
+ -96, -128, -128, -78, -128, -21, -25, -29, -32, -35,
826
+ -45, -48, -66, -69, -82, -128, -50, -6, -115, -92,
827
+ -93, -97, -111, -75, -128, -18, -128, -128, -128, -128,
828
+ -128, -128, -128, -96, -95, -86, -110, -101, -128, -128,
829
+ -79, -128, -22, -26, -128, -128, -128, -54, -51, -94,
830
+ -128, -98, -126, -105, -106, -107, -128, -104, -76, -19,
831
+ -30, -121, -123, -124, -33, -36, -49, -52, -55, -128,
832
+ -108, -99, -127, -102, -122, -54, -110, -86, -59, -128,
833
+ -126, -128, -128, -53, -56, -57, -128, -128, -62, -100,
834
+ -109, -110, -128, -60, -103, -58, -128, -110, -61 ]
838
835
 
839
836
  racc_goto_table = [
840
- 62, 79, 43, 60, 103, 55, 94, 102, 34, 166,
841
- 124, 44, 46, 47, 58, 1, 70, 70, 70, 70,
842
- 171, 160, 164, 165, 171, 171, 66, 71, 72, 73,
843
- 2, 175, 76, 4, 99, 62, 95, 120, 100, 149,
844
- 33, 75, 5, 102, 58, 58, 94, 31, 104, 10,
845
- 11, 40, 81, 110, 143, 88, 70, 70, 130, 89,
846
- 102, 131, 90, 132, 91, 133, 92, 94, 134, 54,
847
- 59, 96, 62, 116, 99, 119, 117, 108, 141, 86,
848
- 128, 123, 58, 150, 58, 168, 156, 174, 105, nil,
849
- 70, nil, 70, 99, nil, nil, nil, nil, 138, nil,
850
- nil, nil, 155, nil, nil, 58, nil, nil, nil, 70,
851
- nil, nil, nil, nil, 157, nil, nil, nil, nil, nil,
852
- nil, nil, nil, 138, nil, 169, nil, nil, nil, nil,
837
+ 64, 45, 57, 62, 105, 82, 97, 162, 106, 177,
838
+ 179, 1, 181, 60, 2, 72, 72, 72, 72, 130,
839
+ 184, 4, 35, 36, 184, 184, 68, 73, 74, 75,
840
+ 46, 48, 49, 78, 98, 102, 64, 193, 5, 103,
841
+ 199, 105, 124, 33, 60, 60, 202, 97, 195, 79,
842
+ 108, 10, 159, 170, 174, 175, 72, 72, 11, 105,
843
+ 12, 42, 84, 114, 151, 91, 136, 92, 137, 97,
844
+ 93, 138, 120, 94, 64, 139, 102, 123, 95, 140,
845
+ 56, 61, 99, 60, 121, 60, 125, 176, 197, 206,
846
+ 112, 72, 149, 72, 89, 134, 102, 129, 166, 192,
847
+ 109, nil, nil, 146, nil, nil, nil, 60, nil, nil,
848
+ nil, 72, 161, nil, nil, nil, nil, nil, nil, nil,
849
+ nil, 167, nil, nil, nil, nil, nil, nil, nil, nil,
850
+ nil, nil, 146, 180, nil, nil, nil, nil, nil, nil,
853
851
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
854
- nil, 178, nil, nil, nil, nil, nil, 176 ]
852
+ 186, nil, 194, nil, nil, nil, nil, nil, nil, nil,
853
+ nil, nil, 198, nil, 200, nil, 186, 204, nil, 180,
854
+ nil, nil, nil, 208 ]
855
855
 
856
856
  racc_goto_check = [
857
- 37, 48, 33, 36, 43, 31, 32, 44, 45, 52,
858
- 50, 13, 13, 13, 33, 1, 33, 33, 33, 33,
859
- 57, 19, 19, 19, 57, 57, 30, 30, 30, 30,
860
- 2, 52, 45, 3, 37, 37, 31, 43, 36, 50,
861
- 4, 5, 6, 44, 33, 33, 32, 7, 8, 9,
862
- 10, 11, 12, 14, 15, 16, 33, 33, 17, 20,
863
- 44, 21, 22, 23, 24, 25, 26, 32, 27, 28,
864
- 29, 34, 37, 31, 37, 36, 35, 39, 40, 41,
865
- 42, 49, 33, 51, 33, 53, 54, 55, 56, nil,
866
- 33, nil, 33, 37, nil, nil, nil, nil, 37, nil,
867
- nil, nil, 48, nil, nil, 33, nil, nil, nil, 33,
868
- nil, nil, nil, nil, 37, nil, nil, nil, nil, nil,
869
- nil, nil, nil, 37, nil, 37, nil, nil, nil, nil,
857
+ 40, 34, 32, 46, 53, 41, 33, 42, 52, 39,
858
+ 43, 1, 59, 34, 2, 34, 34, 34, 34, 58,
859
+ 63, 3, 4, 54, 63, 63, 31, 31, 31, 31,
860
+ 14, 14, 14, 5, 32, 40, 40, 39, 6, 46,
861
+ 59, 53, 52, 7, 34, 34, 43, 33, 42, 54,
862
+ 8, 9, 58, 20, 20, 20, 34, 34, 10, 53,
863
+ 11, 12, 13, 15, 16, 17, 18, 21, 22, 33,
864
+ 23, 24, 32, 25, 40, 26, 40, 46, 27, 28,
865
+ 29, 30, 35, 34, 36, 34, 37, 38, 44, 45,
866
+ 48, 34, 49, 34, 50, 51, 40, 57, 60, 61,
867
+ 62, nil, nil, 40, nil, nil, nil, 34, nil, nil,
868
+ nil, 34, 41, nil, nil, nil, nil, nil, nil, nil,
869
+ nil, 40, nil, nil, nil, nil, nil, nil, nil, nil,
870
+ nil, nil, 40, 40, nil, nil, nil, nil, nil, nil,
870
871
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
871
- nil, 48, nil, nil, nil, nil, nil, 37 ]
872
+ 40, nil, 41, nil, nil, nil, nil, nil, nil, nil,
873
+ nil, nil, 40, nil, 40, nil, 40, 41, nil, 40,
874
+ nil, nil, nil, 41 ]
872
875
 
873
876
  racc_goto_pointer = [
874
- nil, 15, 30, 31, 31, 8, 40, 41, -26, 45,
875
- 46, 38, 12, -3, -34, -75, 6, -53, nil, -125,
876
- 9, -51, 11, -50, 12, -49, 13, -47, 44, 44,
877
- -1, -20, -49, -11, 13, -20, -23, -26, nil, -8,
878
- -49, 34, -29, -64, -60, -1, nil, nil, -36, -25,
879
- -96, -54, -141, -66, -53, -83, 11, -140 ]
877
+ nil, 11, 14, 19, 13, -2, 36, 37, -27, 47,
878
+ 54, 56, 47, 20, 15, -27, -71, 14, -49, nil,
879
+ -101, 15, -48, 17, -46, 19, -43, 23, -40, 54,
880
+ 54, -2, -24, -51, -13, 22, -15, -21, -70, -148,
881
+ -27, -34, -139, -150, -100, -114, -24, nil, 2, -41,
882
+ 47, -18, -62, -65, 14, nil, nil, -13, -91, -150,
883
+ -49, -84, 20, -150 ]
880
884
 
881
885
  racc_goto_default = [
882
886
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
883
- 36, nil, nil, nil, nil, nil, nil, nil, 21, nil,
887
+ 38, nil, nil, nil, nil, nil, nil, nil, nil, 22,
884
888
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
885
- nil, nil, 57, 63, nil, nil, nil, 162, 64, nil,
886
- nil, nil, nil, 67, 69, nil, 35, 37, nil, nil,
887
- nil, nil, nil, nil, nil, nil, nil, 161 ]
889
+ nil, nil, nil, 59, 65, nil, nil, nil, nil, nil,
890
+ 172, nil, nil, nil, nil, nil, nil, 66, nil, nil,
891
+ nil, nil, 69, 71, nil, 37, 39, nil, nil, nil,
892
+ nil, nil, nil, 171 ]
888
893
 
889
894
  racc_reduce_table = [
890
895
  0, 0, :racc_error,
891
- 5, 47, :_reduce_none,
892
- 0, 48, :_reduce_none,
893
- 2, 48, :_reduce_none,
894
- 0, 53, :_reduce_4,
895
- 0, 54, :_reduce_5,
896
- 5, 52, :_reduce_6,
897
- 2, 52, :_reduce_none,
898
- 0, 49, :_reduce_8,
896
+ 5, 48, :_reduce_none,
897
+ 0, 49, :_reduce_none,
899
898
  2, 49, :_reduce_none,
900
- 1, 55, :_reduce_none,
901
- 2, 55, :_reduce_11,
902
- 3, 55, :_reduce_none,
903
- 2, 55, :_reduce_none,
904
- 2, 55, :_reduce_14,
905
- 2, 55, :_reduce_15,
906
- 0, 60, :_reduce_16,
907
- 0, 61, :_reduce_17,
908
- 7, 55, :_reduce_18,
909
- 0, 62, :_reduce_19,
910
- 0, 63, :_reduce_20,
911
- 6, 55, :_reduce_21,
912
- 1, 55, :_reduce_none,
913
- 0, 66, :_reduce_23,
914
- 0, 67, :_reduce_24,
915
- 6, 56, :_reduce_25,
916
- 1, 56, :_reduce_none,
917
- 0, 68, :_reduce_27,
918
- 0, 69, :_reduce_28,
919
- 7, 56, :_reduce_none,
920
- 0, 70, :_reduce_30,
921
- 0, 71, :_reduce_31,
922
- 7, 56, :_reduce_32,
923
- 0, 72, :_reduce_33,
924
- 0, 73, :_reduce_34,
925
- 7, 56, :_reduce_35,
926
- 2, 64, :_reduce_none,
927
- 2, 64, :_reduce_37,
928
- 2, 64, :_reduce_38,
929
- 2, 64, :_reduce_39,
930
- 2, 64, :_reduce_40,
931
- 2, 64, :_reduce_41,
932
- 1, 74, :_reduce_42,
933
- 2, 74, :_reduce_43,
934
- 3, 74, :_reduce_44,
935
- 1, 77, :_reduce_45,
936
- 2, 77, :_reduce_46,
937
- 3, 78, :_reduce_47,
938
- 0, 80, :_reduce_none,
939
- 1, 80, :_reduce_none,
940
- 0, 81, :_reduce_none,
941
- 1, 81, :_reduce_none,
942
- 1, 75, :_reduce_52,
943
- 2, 75, :_reduce_53,
944
- 3, 75, :_reduce_54,
945
- 1, 82, :_reduce_55,
946
- 2, 82, :_reduce_56,
947
- 1, 83, :_reduce_none,
948
- 1, 83, :_reduce_none,
949
- 0, 85, :_reduce_59,
950
- 0, 86, :_reduce_60,
951
- 6, 59, :_reduce_61,
952
- 0, 87, :_reduce_62,
953
- 0, 88, :_reduce_63,
954
- 5, 59, :_reduce_64,
955
- 1, 76, :_reduce_65,
956
- 2, 76, :_reduce_66,
957
- 3, 76, :_reduce_67,
958
- 1, 89, :_reduce_68,
959
- 2, 89, :_reduce_69,
960
- 1, 90, :_reduce_none,
961
- 1, 79, :_reduce_71,
962
- 1, 79, :_reduce_72,
963
- 1, 50, :_reduce_none,
899
+ 0, 54, :_reduce_4,
900
+ 0, 55, :_reduce_5,
901
+ 5, 53, :_reduce_6,
902
+ 2, 53, :_reduce_none,
903
+ 0, 50, :_reduce_8,
964
904
  2, 50, :_reduce_none,
965
- 1, 91, :_reduce_none,
966
- 2, 91, :_reduce_none,
967
- 4, 92, :_reduce_77,
968
- 1, 95, :_reduce_78,
969
- 3, 95, :_reduce_79,
970
- 2, 95, :_reduce_none,
971
- 0, 96, :_reduce_81,
972
- 1, 96, :_reduce_82,
973
- 3, 96, :_reduce_83,
974
- 4, 96, :_reduce_84,
975
- 6, 96, :_reduce_85,
976
- 0, 100, :_reduce_86,
977
- 0, 101, :_reduce_87,
978
- 7, 96, :_reduce_88,
979
- 3, 96, :_reduce_89,
980
- 1, 97, :_reduce_none,
981
- 1, 97, :_reduce_none,
982
- 1, 97, :_reduce_none,
983
- 1, 99, :_reduce_93,
984
- 3, 99, :_reduce_94,
985
- 0, 94, :_reduce_none,
986
- 3, 94, :_reduce_96,
987
- 1, 93, :_reduce_none,
988
- 0, 51, :_reduce_none,
989
- 0, 102, :_reduce_99,
990
- 3, 51, :_reduce_100,
905
+ 1, 56, :_reduce_none,
906
+ 1, 56, :_reduce_none,
907
+ 2, 56, :_reduce_12,
908
+ 3, 56, :_reduce_none,
909
+ 2, 56, :_reduce_none,
910
+ 2, 56, :_reduce_15,
911
+ 2, 56, :_reduce_16,
912
+ 0, 62, :_reduce_17,
913
+ 0, 63, :_reduce_18,
914
+ 7, 56, :_reduce_19,
915
+ 0, 64, :_reduce_20,
916
+ 0, 65, :_reduce_21,
917
+ 6, 56, :_reduce_22,
918
+ 1, 56, :_reduce_none,
919
+ 0, 68, :_reduce_24,
920
+ 0, 69, :_reduce_25,
921
+ 6, 57, :_reduce_26,
991
922
  1, 57, :_reduce_none,
992
- 0, 58, :_reduce_none,
993
- 1, 58, :_reduce_none,
994
- 1, 58, :_reduce_none,
995
- 1, 58, :_reduce_none,
996
- 1, 65, :_reduce_106,
997
- 2, 65, :_reduce_107,
998
- 1, 103, :_reduce_none,
923
+ 0, 70, :_reduce_28,
924
+ 0, 71, :_reduce_29,
925
+ 7, 57, :_reduce_none,
926
+ 0, 72, :_reduce_31,
927
+ 0, 73, :_reduce_32,
928
+ 7, 57, :_reduce_33,
929
+ 0, 74, :_reduce_34,
930
+ 0, 75, :_reduce_35,
931
+ 7, 57, :_reduce_36,
932
+ 2, 66, :_reduce_none,
933
+ 2, 66, :_reduce_38,
934
+ 2, 66, :_reduce_39,
935
+ 2, 66, :_reduce_40,
936
+ 2, 66, :_reduce_41,
937
+ 2, 66, :_reduce_42,
938
+ 1, 76, :_reduce_43,
939
+ 2, 76, :_reduce_44,
940
+ 3, 76, :_reduce_45,
941
+ 1, 79, :_reduce_46,
942
+ 2, 79, :_reduce_47,
943
+ 3, 80, :_reduce_48,
944
+ 7, 58, :_reduce_49,
945
+ 1, 84, :_reduce_50,
946
+ 3, 84, :_reduce_51,
947
+ 1, 85, :_reduce_52,
948
+ 3, 85, :_reduce_53,
949
+ 0, 86, :_reduce_54,
950
+ 1, 86, :_reduce_55,
951
+ 3, 86, :_reduce_56,
952
+ 3, 86, :_reduce_57,
953
+ 5, 86, :_reduce_58,
954
+ 0, 91, :_reduce_59,
955
+ 0, 92, :_reduce_60,
956
+ 7, 86, :_reduce_61,
957
+ 3, 86, :_reduce_62,
958
+ 0, 82, :_reduce_none,
959
+ 1, 82, :_reduce_none,
960
+ 0, 83, :_reduce_none,
961
+ 1, 83, :_reduce_none,
962
+ 1, 77, :_reduce_67,
963
+ 2, 77, :_reduce_68,
964
+ 3, 77, :_reduce_69,
965
+ 1, 93, :_reduce_70,
966
+ 2, 93, :_reduce_71,
967
+ 1, 87, :_reduce_none,
968
+ 1, 87, :_reduce_none,
969
+ 0, 95, :_reduce_74,
970
+ 0, 96, :_reduce_75,
971
+ 6, 61, :_reduce_76,
972
+ 0, 97, :_reduce_77,
973
+ 0, 98, :_reduce_78,
974
+ 5, 61, :_reduce_79,
975
+ 1, 78, :_reduce_80,
976
+ 2, 78, :_reduce_81,
977
+ 3, 78, :_reduce_82,
978
+ 1, 99, :_reduce_83,
979
+ 2, 99, :_reduce_84,
980
+ 1, 100, :_reduce_none,
981
+ 1, 81, :_reduce_86,
982
+ 1, 81, :_reduce_87,
983
+ 1, 51, :_reduce_none,
984
+ 2, 51, :_reduce_none,
985
+ 1, 101, :_reduce_none,
986
+ 2, 101, :_reduce_none,
987
+ 4, 102, :_reduce_92,
988
+ 1, 104, :_reduce_93,
989
+ 3, 104, :_reduce_94,
990
+ 2, 104, :_reduce_none,
991
+ 0, 105, :_reduce_96,
992
+ 1, 105, :_reduce_97,
993
+ 3, 105, :_reduce_98,
994
+ 4, 105, :_reduce_99,
995
+ 6, 105, :_reduce_100,
996
+ 0, 107, :_reduce_101,
997
+ 0, 108, :_reduce_102,
998
+ 7, 105, :_reduce_103,
999
+ 3, 105, :_reduce_104,
1000
+ 1, 89, :_reduce_none,
1001
+ 1, 89, :_reduce_none,
1002
+ 1, 89, :_reduce_none,
1003
+ 1, 90, :_reduce_108,
1004
+ 3, 90, :_reduce_109,
1005
+ 0, 88, :_reduce_none,
1006
+ 3, 88, :_reduce_111,
999
1007
  1, 103, :_reduce_none,
1000
- 1, 84, :_reduce_110,
1001
- 0, 98, :_reduce_none,
1002
- 1, 98, :_reduce_none ]
1003
-
1004
- racc_reduce_n = 113
1005
-
1006
- racc_shift_n = 179
1008
+ 0, 52, :_reduce_none,
1009
+ 0, 109, :_reduce_114,
1010
+ 3, 52, :_reduce_115,
1011
+ 1, 59, :_reduce_none,
1012
+ 0, 60, :_reduce_none,
1013
+ 1, 60, :_reduce_none,
1014
+ 1, 60, :_reduce_none,
1015
+ 1, 60, :_reduce_none,
1016
+ 1, 67, :_reduce_121,
1017
+ 2, 67, :_reduce_122,
1018
+ 1, 110, :_reduce_none,
1019
+ 1, 110, :_reduce_none,
1020
+ 1, 94, :_reduce_125,
1021
+ 0, 106, :_reduce_none,
1022
+ 1, 106, :_reduce_none ]
1023
+
1024
+ racc_reduce_n = 128
1025
+
1026
+ racc_shift_n = 209
1007
1027
 
1008
1028
  racc_token_table = {
1009
1029
  false => 0,
@@ -1039,21 +1059,22 @@ racc_token_table = {
1039
1059
  "%right" => 30,
1040
1060
  "%precedence" => 31,
1041
1061
  "%nonassoc" => 32,
1042
- ":" => 33,
1043
- "|" => 34,
1044
- "%empty" => 35,
1045
- "(" => 36,
1046
- ")" => 37,
1047
- "%prec" => 38,
1048
- "?" => 39,
1049
- "+" => 40,
1050
- "*" => 41,
1051
- "," => 42,
1052
- "[" => 43,
1053
- "]" => 44,
1054
- "{...}" => 45 }
1055
-
1056
- racc_nt_base = 46
1062
+ "%rule" => 33,
1063
+ "(" => 34,
1064
+ ")" => 35,
1065
+ ":" => 36,
1066
+ "," => 37,
1067
+ "|" => 38,
1068
+ "%empty" => 39,
1069
+ "%prec" => 40,
1070
+ "?" => 41,
1071
+ "+" => 42,
1072
+ "*" => 43,
1073
+ "[" => 44,
1074
+ "]" => 45,
1075
+ "{...}" => 46 }
1076
+
1077
+ racc_nt_base = 47
1057
1078
 
1058
1079
  racc_use_result_var = true
1059
1080
 
@@ -1108,16 +1129,17 @@ Racc_token_to_s_table = [
1108
1129
  "\"%right\"",
1109
1130
  "\"%precedence\"",
1110
1131
  "\"%nonassoc\"",
1132
+ "\"%rule\"",
1133
+ "\"(\"",
1134
+ "\")\"",
1111
1135
  "\":\"",
1136
+ "\",\"",
1112
1137
  "\"|\"",
1113
1138
  "\"%empty\"",
1114
- "\"(\"",
1115
- "\")\"",
1116
1139
  "\"%prec\"",
1117
1140
  "\"?\"",
1118
1141
  "\"+\"",
1119
1142
  "\"*\"",
1120
- "\",\"",
1121
1143
  "\"[\"",
1122
1144
  "\"]\"",
1123
1145
  "\"{...}\"",
@@ -1132,6 +1154,7 @@ Racc_token_to_s_table = [
1132
1154
  "@2",
1133
1155
  "bison_declaration",
1134
1156
  "grammar_declaration",
1157
+ "rule_declaration",
1135
1158
  "variable",
1136
1159
  "value",
1137
1160
  "params",
@@ -1157,27 +1180,32 @@ Racc_token_to_s_table = [
1157
1180
  "id",
1158
1181
  "int_opt",
1159
1182
  "alias",
1160
- "symbol_declaration_list",
1183
+ "rule_args",
1184
+ "rule_rhs_list",
1185
+ "rule_rhs",
1161
1186
  "symbol",
1162
- "string_as_id",
1187
+ "named_ref_opt",
1188
+ "parameterizing_suffix",
1189
+ "parameterizing_args",
1163
1190
  "@15",
1164
1191
  "@16",
1192
+ "symbol_declaration_list",
1193
+ "string_as_id",
1165
1194
  "@17",
1166
1195
  "@18",
1196
+ "@19",
1197
+ "@20",
1167
1198
  "token_declaration_list_for_precedence",
1168
1199
  "token_declaration_for_precedence",
1169
1200
  "rules_or_grammar_declaration",
1170
1201
  "rules",
1171
1202
  "id_colon",
1172
- "named_ref_opt",
1173
1203
  "rhs_list",
1174
1204
  "rhs",
1175
- "parameterizing_suffix",
1176
1205
  "tag_opt",
1177
- "parameterizing_args",
1178
- "@19",
1179
- "@20",
1180
1206
  "@21",
1207
+ "@22",
1208
+ "@23",
1181
1209
  "generic_symlist_item" ]
1182
1210
  Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
1183
1211
 
@@ -1231,19 +1259,21 @@ module_eval(<<'.,.,', 'parser.y', 27)
1231
1259
 
1232
1260
  # reduce 10 omitted
1233
1261
 
1234
- module_eval(<<'.,.,', 'parser.y', 31)
1235
- def _reduce_11(val, _values, result)
1262
+ # reduce 11 omitted
1263
+
1264
+ module_eval(<<'.,.,', 'parser.y', 32)
1265
+ def _reduce_12(val, _values, result)
1236
1266
  @grammar.expect = val[1]
1237
1267
  result
1238
1268
  end
1239
1269
  .,.,
1240
1270
 
1241
- # reduce 12 omitted
1242
-
1243
1271
  # reduce 13 omitted
1244
1272
 
1245
- module_eval(<<'.,.,', 'parser.y', 36)
1246
- def _reduce_14(val, _values, result)
1273
+ # reduce 14 omitted
1274
+
1275
+ module_eval(<<'.,.,', 'parser.y', 37)
1276
+ def _reduce_15(val, _values, result)
1247
1277
  val[1].each {|token|
1248
1278
  @grammar.lex_param = Grammar::Code::NoReferenceCode.new(type: :lex_param, token_code: token).token_code.s_value
1249
1279
  }
@@ -1252,8 +1282,8 @@ module_eval(<<'.,.,', 'parser.y', 36)
1252
1282
  end
1253
1283
  .,.,
1254
1284
 
1255
- module_eval(<<'.,.,', 'parser.y', 42)
1256
- def _reduce_15(val, _values, result)
1285
+ module_eval(<<'.,.,', 'parser.y', 43)
1286
+ def _reduce_16(val, _values, result)
1257
1287
  val[1].each {|token|
1258
1288
  @grammar.parse_param = Grammar::Code::NoReferenceCode.new(type: :parse_param, token_code: token).token_code.s_value
1259
1289
  }
@@ -1262,74 +1292,74 @@ module_eval(<<'.,.,', 'parser.y', 42)
1262
1292
  end
1263
1293
  .,.,
1264
1294
 
1265
- module_eval(<<'.,.,', 'parser.y', 48)
1266
- def _reduce_16(val, _values, result)
1295
+ module_eval(<<'.,.,', 'parser.y', 49)
1296
+ def _reduce_17(val, _values, result)
1267
1297
  begin_c_declaration("}")
1268
1298
 
1269
1299
  result
1270
1300
  end
1271
1301
  .,.,
1272
1302
 
1273
- module_eval(<<'.,.,', 'parser.y', 52)
1274
- def _reduce_17(val, _values, result)
1303
+ module_eval(<<'.,.,', 'parser.y', 53)
1304
+ def _reduce_18(val, _values, result)
1275
1305
  end_c_declaration
1276
1306
 
1277
1307
  result
1278
1308
  end
1279
1309
  .,.,
1280
1310
 
1281
- module_eval(<<'.,.,', 'parser.y', 56)
1282
- def _reduce_18(val, _values, result)
1311
+ module_eval(<<'.,.,', 'parser.y', 57)
1312
+ def _reduce_19(val, _values, result)
1283
1313
  @grammar.add_percent_code(id: val[1], code: val[4])
1284
1314
 
1285
1315
  result
1286
1316
  end
1287
1317
  .,.,
1288
1318
 
1289
- module_eval(<<'.,.,', 'parser.y', 60)
1290
- def _reduce_19(val, _values, result)
1319
+ module_eval(<<'.,.,', 'parser.y', 61)
1320
+ def _reduce_20(val, _values, result)
1291
1321
  begin_c_declaration("}")
1292
1322
 
1293
1323
  result
1294
1324
  end
1295
1325
  .,.,
1296
1326
 
1297
- module_eval(<<'.,.,', 'parser.y', 64)
1298
- def _reduce_20(val, _values, result)
1327
+ module_eval(<<'.,.,', 'parser.y', 65)
1328
+ def _reduce_21(val, _values, result)
1299
1329
  end_c_declaration
1300
1330
 
1301
1331
  result
1302
1332
  end
1303
1333
  .,.,
1304
1334
 
1305
- module_eval(<<'.,.,', 'parser.y', 68)
1306
- def _reduce_21(val, _values, result)
1335
+ module_eval(<<'.,.,', 'parser.y', 69)
1336
+ def _reduce_22(val, _values, result)
1307
1337
  @grammar.initial_action = Grammar::Code::InitialActionCode.new(type: :initial_action, token_code: val[3])
1308
1338
 
1309
1339
  result
1310
1340
  end
1311
1341
  .,.,
1312
1342
 
1313
- # reduce 22 omitted
1343
+ # reduce 23 omitted
1314
1344
 
1315
- module_eval(<<'.,.,', 'parser.y', 74)
1316
- def _reduce_23(val, _values, result)
1345
+ module_eval(<<'.,.,', 'parser.y', 75)
1346
+ def _reduce_24(val, _values, result)
1317
1347
  begin_c_declaration("}")
1318
1348
 
1319
1349
  result
1320
1350
  end
1321
1351
  .,.,
1322
1352
 
1323
- module_eval(<<'.,.,', 'parser.y', 78)
1324
- def _reduce_24(val, _values, result)
1353
+ module_eval(<<'.,.,', 'parser.y', 79)
1354
+ def _reduce_25(val, _values, result)
1325
1355
  end_c_declaration
1326
1356
 
1327
1357
  result
1328
1358
  end
1329
1359
  .,.,
1330
1360
 
1331
- module_eval(<<'.,.,', 'parser.y', 82)
1332
- def _reduce_25(val, _values, result)
1361
+ module_eval(<<'.,.,', 'parser.y', 83)
1362
+ def _reduce_26(val, _values, result)
1333
1363
  @grammar.set_union(
1334
1364
  Grammar::Code::NoReferenceCode.new(type: :union, token_code: val[3]),
1335
1365
  val[3].line
@@ -1339,44 +1369,44 @@ module_eval(<<'.,.,', 'parser.y', 82)
1339
1369
  end
1340
1370
  .,.,
1341
1371
 
1342
- # reduce 26 omitted
1372
+ # reduce 27 omitted
1343
1373
 
1344
- module_eval(<<'.,.,', 'parser.y', 90)
1345
- def _reduce_27(val, _values, result)
1374
+ module_eval(<<'.,.,', 'parser.y', 91)
1375
+ def _reduce_28(val, _values, result)
1346
1376
  begin_c_declaration("}")
1347
1377
 
1348
1378
  result
1349
1379
  end
1350
1380
  .,.,
1351
1381
 
1352
- module_eval(<<'.,.,', 'parser.y', 94)
1353
- def _reduce_28(val, _values, result)
1382
+ module_eval(<<'.,.,', 'parser.y', 95)
1383
+ def _reduce_29(val, _values, result)
1354
1384
  end_c_declaration
1355
1385
 
1356
1386
  result
1357
1387
  end
1358
1388
  .,.,
1359
1389
 
1360
- # reduce 29 omitted
1390
+ # reduce 30 omitted
1361
1391
 
1362
- module_eval(<<'.,.,', 'parser.y', 99)
1363
- def _reduce_30(val, _values, result)
1392
+ module_eval(<<'.,.,', 'parser.y', 100)
1393
+ def _reduce_31(val, _values, result)
1364
1394
  begin_c_declaration("}")
1365
1395
 
1366
1396
  result
1367
1397
  end
1368
1398
  .,.,
1369
1399
 
1370
- module_eval(<<'.,.,', 'parser.y', 103)
1371
- def _reduce_31(val, _values, result)
1400
+ module_eval(<<'.,.,', 'parser.y', 104)
1401
+ def _reduce_32(val, _values, result)
1372
1402
  end_c_declaration
1373
1403
 
1374
1404
  result
1375
1405
  end
1376
1406
  .,.,
1377
1407
 
1378
- module_eval(<<'.,.,', 'parser.y', 107)
1379
- def _reduce_32(val, _values, result)
1408
+ module_eval(<<'.,.,', 'parser.y', 108)
1409
+ def _reduce_33(val, _values, result)
1380
1410
  @grammar.add_printer(
1381
1411
  ident_or_tags: val[6],
1382
1412
  token_code: val[3],
@@ -1387,24 +1417,24 @@ module_eval(<<'.,.,', 'parser.y', 107)
1387
1417
  end
1388
1418
  .,.,
1389
1419
 
1390
- module_eval(<<'.,.,', 'parser.y', 115)
1391
- def _reduce_33(val, _values, result)
1420
+ module_eval(<<'.,.,', 'parser.y', 116)
1421
+ def _reduce_34(val, _values, result)
1392
1422
  begin_c_declaration("}")
1393
1423
 
1394
1424
  result
1395
1425
  end
1396
1426
  .,.,
1397
1427
 
1398
- module_eval(<<'.,.,', 'parser.y', 119)
1399
- def _reduce_34(val, _values, result)
1428
+ module_eval(<<'.,.,', 'parser.y', 120)
1429
+ def _reduce_35(val, _values, result)
1400
1430
  end_c_declaration
1401
1431
 
1402
1432
  result
1403
1433
  end
1404
1434
  .,.,
1405
1435
 
1406
- module_eval(<<'.,.,', 'parser.y', 123)
1407
- def _reduce_35(val, _values, result)
1436
+ module_eval(<<'.,.,', 'parser.y', 124)
1437
+ def _reduce_36(val, _values, result)
1408
1438
  @grammar.add_error_token(
1409
1439
  ident_or_tags: val[6],
1410
1440
  token_code: val[3],
@@ -1415,10 +1445,10 @@ module_eval(<<'.,.,', 'parser.y', 123)
1415
1445
  end
1416
1446
  .,.,
1417
1447
 
1418
- # reduce 36 omitted
1448
+ # reduce 37 omitted
1419
1449
 
1420
- module_eval(<<'.,.,', 'parser.y', 133)
1421
- def _reduce_37(val, _values, result)
1450
+ module_eval(<<'.,.,', 'parser.y', 134)
1451
+ def _reduce_38(val, _values, result)
1422
1452
  val[1].each {|hash|
1423
1453
  hash[:tokens].each {|id|
1424
1454
  @grammar.add_type(id: id, tag: hash[:tag])
@@ -1429,8 +1459,8 @@ module_eval(<<'.,.,', 'parser.y', 133)
1429
1459
  end
1430
1460
  .,.,
1431
1461
 
1432
- module_eval(<<'.,.,', 'parser.y', 141)
1433
- def _reduce_38(val, _values, result)
1462
+ module_eval(<<'.,.,', 'parser.y', 142)
1463
+ def _reduce_39(val, _values, result)
1434
1464
  val[1].each {|hash|
1435
1465
  hash[:tokens].each {|id|
1436
1466
  sym = @grammar.add_term(id: id)
@@ -1443,8 +1473,8 @@ module_eval(<<'.,.,', 'parser.y', 141)
1443
1473
  end
1444
1474
  .,.,
1445
1475
 
1446
- module_eval(<<'.,.,', 'parser.y', 151)
1447
- def _reduce_39(val, _values, result)
1476
+ module_eval(<<'.,.,', 'parser.y', 152)
1477
+ def _reduce_40(val, _values, result)
1448
1478
  val[1].each {|hash|
1449
1479
  hash[:tokens].each {|id|
1450
1480
  sym = @grammar.add_term(id: id)
@@ -1457,8 +1487,8 @@ module_eval(<<'.,.,', 'parser.y', 151)
1457
1487
  end
1458
1488
  .,.,
1459
1489
 
1460
- module_eval(<<'.,.,', 'parser.y', 161)
1461
- def _reduce_40(val, _values, result)
1490
+ module_eval(<<'.,.,', 'parser.y', 162)
1491
+ def _reduce_41(val, _values, result)
1462
1492
  val[1].each {|hash|
1463
1493
  hash[:tokens].each {|id|
1464
1494
  sym = @grammar.add_term(id: id)
@@ -1471,8 +1501,8 @@ module_eval(<<'.,.,', 'parser.y', 161)
1471
1501
  end
1472
1502
  .,.,
1473
1503
 
1474
- module_eval(<<'.,.,', 'parser.y', 171)
1475
- def _reduce_41(val, _values, result)
1504
+ module_eval(<<'.,.,', 'parser.y', 172)
1505
+ def _reduce_42(val, _values, result)
1476
1506
  val[1].each {|hash|
1477
1507
  hash[:tokens].each {|id|
1478
1508
  sym = @grammar.add_term(id: id)
@@ -1485,8 +1515,8 @@ module_eval(<<'.,.,', 'parser.y', 171)
1485
1515
  end
1486
1516
  .,.,
1487
1517
 
1488
- module_eval(<<'.,.,', 'parser.y', 182)
1489
- def _reduce_42(val, _values, result)
1518
+ module_eval(<<'.,.,', 'parser.y', 183)
1519
+ def _reduce_43(val, _values, result)
1490
1520
  val[0].each {|token_declaration|
1491
1521
  @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: nil, replace: true)
1492
1522
  }
@@ -1495,8 +1525,8 @@ module_eval(<<'.,.,', 'parser.y', 182)
1495
1525
  end
1496
1526
  .,.,
1497
1527
 
1498
- module_eval(<<'.,.,', 'parser.y', 188)
1499
- def _reduce_43(val, _values, result)
1528
+ module_eval(<<'.,.,', 'parser.y', 189)
1529
+ def _reduce_44(val, _values, result)
1500
1530
  val[1].each {|token_declaration|
1501
1531
  @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[0], replace: true)
1502
1532
  }
@@ -1505,8 +1535,8 @@ module_eval(<<'.,.,', 'parser.y', 188)
1505
1535
  end
1506
1536
  .,.,
1507
1537
 
1508
- module_eval(<<'.,.,', 'parser.y', 194)
1509
- def _reduce_44(val, _values, result)
1538
+ module_eval(<<'.,.,', 'parser.y', 195)
1539
+ def _reduce_45(val, _values, result)
1510
1540
  val[2].each {|token_declaration|
1511
1541
  @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[1], replace: true)
1512
1542
  }
@@ -1515,86 +1545,131 @@ module_eval(<<'.,.,', 'parser.y', 194)
1515
1545
  end
1516
1546
  .,.,
1517
1547
 
1518
- module_eval(<<'.,.,', 'parser.y', 199)
1519
- def _reduce_45(val, _values, result)
1548
+ module_eval(<<'.,.,', 'parser.y', 200)
1549
+ def _reduce_46(val, _values, result)
1520
1550
  result = [val[0]]
1521
1551
  result
1522
1552
  end
1523
1553
  .,.,
1524
1554
 
1525
- module_eval(<<'.,.,', 'parser.y', 200)
1526
- def _reduce_46(val, _values, result)
1555
+ module_eval(<<'.,.,', 'parser.y', 201)
1556
+ def _reduce_47(val, _values, result)
1527
1557
  result = val[0].append(val[1])
1528
1558
  result
1529
1559
  end
1530
1560
  .,.,
1531
1561
 
1532
- module_eval(<<'.,.,', 'parser.y', 202)
1533
- def _reduce_47(val, _values, result)
1562
+ module_eval(<<'.,.,', 'parser.y', 203)
1563
+ def _reduce_48(val, _values, result)
1534
1564
  result = val
1535
1565
  result
1536
1566
  end
1537
1567
  .,.,
1538
1568
 
1539
- # reduce 48 omitted
1540
-
1541
- # reduce 49 omitted
1569
+ module_eval(<<'.,.,', 'parser.y', 207)
1570
+ def _reduce_49(val, _values, result)
1571
+ builder = Grammar::ParameterizingRuleBuilder.new(val[1].s_value, val[3], val[6])
1572
+ @grammar.add_parameterizing_rule_builder(builder)
1542
1573
 
1543
- # reduce 50 omitted
1574
+ result
1575
+ end
1576
+ .,.,
1544
1577
 
1545
- # reduce 51 omitted
1578
+ module_eval(<<'.,.,', 'parser.y', 211)
1579
+ def _reduce_50(val, _values, result)
1580
+ result = [val[0]]
1581
+ result
1582
+ end
1583
+ .,.,
1546
1584
 
1547
1585
  module_eval(<<'.,.,', 'parser.y', 212)
1586
+ def _reduce_51(val, _values, result)
1587
+ result = val[0].append(val[2])
1588
+ result
1589
+ end
1590
+ .,.,
1591
+
1592
+ module_eval(<<'.,.,', 'parser.y', 216)
1548
1593
  def _reduce_52(val, _values, result)
1549
- result = [{tag: nil, tokens: val[0]}]
1594
+ builder = val[0]
1595
+ result = [builder]
1550
1596
 
1551
1597
  result
1552
1598
  end
1553
1599
  .,.,
1554
1600
 
1555
- module_eval(<<'.,.,', 'parser.y', 216)
1601
+ module_eval(<<'.,.,', 'parser.y', 221)
1556
1602
  def _reduce_53(val, _values, result)
1557
- result = [{tag: val[0], tokens: val[1]}]
1603
+ builder = val[2]
1604
+ result = val[0].append(builder)
1558
1605
 
1559
1606
  result
1560
1607
  end
1561
1608
  .,.,
1562
1609
 
1563
- module_eval(<<'.,.,', 'parser.y', 220)
1610
+ module_eval(<<'.,.,', 'parser.y', 227)
1564
1611
  def _reduce_54(val, _values, result)
1565
- result = val[0].append({tag: val[1], tokens: val[2]})
1612
+ reset_precs
1613
+ result = Grammar::ParameterizingRuleRhsBuilder.new
1566
1614
 
1567
1615
  result
1568
1616
  end
1569
1617
  .,.,
1570
1618
 
1571
- module_eval(<<'.,.,', 'parser.y', 223)
1619
+ module_eval(<<'.,.,', 'parser.y', 232)
1572
1620
  def _reduce_55(val, _values, result)
1573
- result = [val[0]]
1621
+ reset_precs
1622
+ result = Grammar::ParameterizingRuleRhsBuilder.new
1623
+
1574
1624
  result
1575
1625
  end
1576
1626
  .,.,
1577
1627
 
1578
- module_eval(<<'.,.,', 'parser.y', 224)
1628
+ module_eval(<<'.,.,', 'parser.y', 237)
1579
1629
  def _reduce_56(val, _values, result)
1580
- result = val[0].append(val[1])
1630
+ token = val[1]
1631
+ token.alias_name = val[2]
1632
+ builder = val[0]
1633
+ builder.symbols << token
1634
+ result = builder
1635
+
1581
1636
  result
1582
1637
  end
1583
1638
  .,.,
1584
1639
 
1585
- # reduce 57 omitted
1640
+ module_eval(<<'.,.,', 'parser.y', 245)
1641
+ def _reduce_57(val, _values, result)
1642
+ builder = val[0]
1643
+ builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]])
1644
+ result = builder
1645
+
1646
+ result
1647
+ end
1648
+ .,.,
1649
+
1650
+ module_eval(<<'.,.,', 'parser.y', 251)
1651
+ def _reduce_58(val, _values, result)
1652
+ builder = val[0]
1653
+ builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3])
1654
+ result = builder
1586
1655
 
1587
- # reduce 58 omitted
1656
+ result
1657
+ end
1658
+ .,.,
1588
1659
 
1589
- module_eval(<<'.,.,', 'parser.y', 231)
1660
+ module_eval(<<'.,.,', 'parser.y', 257)
1590
1661
  def _reduce_59(val, _values, result)
1591
- begin_c_declaration("}")
1662
+ if @prec_seen
1663
+ on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec
1664
+ @code_after_prec = true
1665
+ end
1666
+ begin_c_declaration("}")
1592
1667
 
1593
1668
  result
1594
1669
  end
1595
1670
  .,.,
1596
1671
 
1597
- module_eval(<<'.,.,', 'parser.y', 235)
1672
+ module_eval(<<'.,.,', 'parser.y', 265)
1598
1673
  def _reduce_60(val, _values, result)
1599
1674
  end_c_declaration
1600
1675
 
@@ -1602,102 +1677,192 @@ module_eval(<<'.,.,', 'parser.y', 235)
1602
1677
  end
1603
1678
  .,.,
1604
1679
 
1605
- module_eval(<<'.,.,', 'parser.y', 239)
1680
+ module_eval(<<'.,.,', 'parser.y', 269)
1606
1681
  def _reduce_61(val, _values, result)
1607
- result = val[0].append(val[3])
1682
+ user_code = val[3]
1683
+ user_code.alias_name = val[6]
1684
+ builder = val[0]
1685
+ builder.user_code = user_code
1686
+ result = builder
1608
1687
 
1609
1688
  result
1610
1689
  end
1611
1690
  .,.,
1612
1691
 
1613
- module_eval(<<'.,.,', 'parser.y', 243)
1692
+ module_eval(<<'.,.,', 'parser.y', 277)
1614
1693
  def _reduce_62(val, _values, result)
1694
+ sym = @grammar.find_symbol_by_id!(val[2])
1695
+ @prec_seen = true
1696
+ builder = val[0]
1697
+ builder.precedence_sym = sym
1698
+ result = builder
1699
+
1700
+ result
1701
+ end
1702
+ .,.,
1703
+
1704
+ # reduce 63 omitted
1705
+
1706
+ # reduce 64 omitted
1707
+
1708
+ # reduce 65 omitted
1709
+
1710
+ # reduce 66 omitted
1711
+
1712
+ module_eval(<<'.,.,', 'parser.y', 292)
1713
+ def _reduce_67(val, _values, result)
1714
+ result = [{tag: nil, tokens: val[0]}]
1715
+
1716
+ result
1717
+ end
1718
+ .,.,
1719
+
1720
+ module_eval(<<'.,.,', 'parser.y', 296)
1721
+ def _reduce_68(val, _values, result)
1722
+ result = [{tag: val[0], tokens: val[1]}]
1723
+
1724
+ result
1725
+ end
1726
+ .,.,
1727
+
1728
+ module_eval(<<'.,.,', 'parser.y', 300)
1729
+ def _reduce_69(val, _values, result)
1730
+ result = val[0].append({tag: val[1], tokens: val[2]})
1731
+
1732
+ result
1733
+ end
1734
+ .,.,
1735
+
1736
+ module_eval(<<'.,.,', 'parser.y', 303)
1737
+ def _reduce_70(val, _values, result)
1738
+ result = [val[0]]
1739
+ result
1740
+ end
1741
+ .,.,
1742
+
1743
+ module_eval(<<'.,.,', 'parser.y', 304)
1744
+ def _reduce_71(val, _values, result)
1745
+ result = val[0].append(val[1])
1746
+ result
1747
+ end
1748
+ .,.,
1749
+
1750
+ # reduce 72 omitted
1751
+
1752
+ # reduce 73 omitted
1753
+
1754
+ module_eval(<<'.,.,', 'parser.y', 311)
1755
+ def _reduce_74(val, _values, result)
1615
1756
  begin_c_declaration("}")
1616
1757
 
1617
1758
  result
1618
1759
  end
1619
1760
  .,.,
1620
1761
 
1621
- module_eval(<<'.,.,', 'parser.y', 247)
1622
- def _reduce_63(val, _values, result)
1762
+ module_eval(<<'.,.,', 'parser.y', 315)
1763
+ def _reduce_75(val, _values, result)
1623
1764
  end_c_declaration
1624
1765
 
1625
1766
  result
1626
1767
  end
1627
1768
  .,.,
1628
1769
 
1629
- module_eval(<<'.,.,', 'parser.y', 251)
1630
- def _reduce_64(val, _values, result)
1770
+ module_eval(<<'.,.,', 'parser.y', 319)
1771
+ def _reduce_76(val, _values, result)
1772
+ result = val[0].append(val[3])
1773
+
1774
+ result
1775
+ end
1776
+ .,.,
1777
+
1778
+ module_eval(<<'.,.,', 'parser.y', 323)
1779
+ def _reduce_77(val, _values, result)
1780
+ begin_c_declaration("}")
1781
+
1782
+ result
1783
+ end
1784
+ .,.,
1785
+
1786
+ module_eval(<<'.,.,', 'parser.y', 327)
1787
+ def _reduce_78(val, _values, result)
1788
+ end_c_declaration
1789
+
1790
+ result
1791
+ end
1792
+ .,.,
1793
+
1794
+ module_eval(<<'.,.,', 'parser.y', 331)
1795
+ def _reduce_79(val, _values, result)
1631
1796
  result = [val[2]]
1632
1797
 
1633
1798
  result
1634
1799
  end
1635
1800
  .,.,
1636
1801
 
1637
- module_eval(<<'.,.,', 'parser.y', 256)
1638
- def _reduce_65(val, _values, result)
1802
+ module_eval(<<'.,.,', 'parser.y', 336)
1803
+ def _reduce_80(val, _values, result)
1639
1804
  result = [{tag: nil, tokens: val[0]}]
1640
1805
 
1641
1806
  result
1642
1807
  end
1643
1808
  .,.,
1644
1809
 
1645
- module_eval(<<'.,.,', 'parser.y', 260)
1646
- def _reduce_66(val, _values, result)
1810
+ module_eval(<<'.,.,', 'parser.y', 340)
1811
+ def _reduce_81(val, _values, result)
1647
1812
  result = [{tag: val[0], tokens: val[1]}]
1648
1813
 
1649
1814
  result
1650
1815
  end
1651
1816
  .,.,
1652
1817
 
1653
- module_eval(<<'.,.,', 'parser.y', 264)
1654
- def _reduce_67(val, _values, result)
1818
+ module_eval(<<'.,.,', 'parser.y', 344)
1819
+ def _reduce_82(val, _values, result)
1655
1820
  result = val[0].append({tag: val[1], tokens: val[2]})
1656
1821
 
1657
1822
  result
1658
1823
  end
1659
1824
  .,.,
1660
1825
 
1661
- module_eval(<<'.,.,', 'parser.y', 267)
1662
- def _reduce_68(val, _values, result)
1826
+ module_eval(<<'.,.,', 'parser.y', 347)
1827
+ def _reduce_83(val, _values, result)
1663
1828
  result = [val[0]]
1664
1829
  result
1665
1830
  end
1666
1831
  .,.,
1667
1832
 
1668
- module_eval(<<'.,.,', 'parser.y', 268)
1669
- def _reduce_69(val, _values, result)
1833
+ module_eval(<<'.,.,', 'parser.y', 348)
1834
+ def _reduce_84(val, _values, result)
1670
1835
  result = val[0].append(val[1])
1671
1836
  result
1672
1837
  end
1673
1838
  .,.,
1674
1839
 
1675
- # reduce 70 omitted
1840
+ # reduce 85 omitted
1676
1841
 
1677
- module_eval(<<'.,.,', 'parser.y', 272)
1678
- def _reduce_71(val, _values, result)
1842
+ module_eval(<<'.,.,', 'parser.y', 352)
1843
+ def _reduce_86(val, _values, result)
1679
1844
  on_action_error("ident after %prec", val[0]) if @prec_seen
1680
1845
  result
1681
1846
  end
1682
1847
  .,.,
1683
1848
 
1684
- module_eval(<<'.,.,', 'parser.y', 273)
1685
- def _reduce_72(val, _values, result)
1849
+ module_eval(<<'.,.,', 'parser.y', 353)
1850
+ def _reduce_87(val, _values, result)
1686
1851
  on_action_error("char after %prec", val[0]) if @prec_seen
1687
1852
  result
1688
1853
  end
1689
1854
  .,.,
1690
1855
 
1691
- # reduce 73 omitted
1856
+ # reduce 88 omitted
1692
1857
 
1693
- # reduce 74 omitted
1858
+ # reduce 89 omitted
1694
1859
 
1695
- # reduce 75 omitted
1860
+ # reduce 90 omitted
1696
1861
 
1697
- # reduce 76 omitted
1862
+ # reduce 91 omitted
1698
1863
 
1699
- module_eval(<<'.,.,', 'parser.y', 283)
1700
- def _reduce_77(val, _values, result)
1864
+ module_eval(<<'.,.,', 'parser.y', 363)
1865
+ def _reduce_92(val, _values, result)
1701
1866
  lhs = val[0]
1702
1867
  lhs.alias_name = val[1]
1703
1868
  val[3].each do |builder|
@@ -1710,8 +1875,8 @@ module_eval(<<'.,.,', 'parser.y', 283)
1710
1875
  end
1711
1876
  .,.,
1712
1877
 
1713
- module_eval(<<'.,.,', 'parser.y', 294)
1714
- def _reduce_78(val, _values, result)
1878
+ module_eval(<<'.,.,', 'parser.y', 374)
1879
+ def _reduce_93(val, _values, result)
1715
1880
  builder = val[0]
1716
1881
  if !builder.line
1717
1882
  builder.line = @lexer.line - 1
@@ -1722,8 +1887,8 @@ module_eval(<<'.,.,', 'parser.y', 294)
1722
1887
  end
1723
1888
  .,.,
1724
1889
 
1725
- module_eval(<<'.,.,', 'parser.y', 302)
1726
- def _reduce_79(val, _values, result)
1890
+ module_eval(<<'.,.,', 'parser.y', 382)
1891
+ def _reduce_94(val, _values, result)
1727
1892
  builder = val[2]
1728
1893
  if !builder.line
1729
1894
  builder.line = @lexer.line - 1
@@ -1734,10 +1899,10 @@ module_eval(<<'.,.,', 'parser.y', 302)
1734
1899
  end
1735
1900
  .,.,
1736
1901
 
1737
- # reduce 80 omitted
1902
+ # reduce 95 omitted
1738
1903
 
1739
- module_eval(<<'.,.,', 'parser.y', 312)
1740
- def _reduce_81(val, _values, result)
1904
+ module_eval(<<'.,.,', 'parser.y', 392)
1905
+ def _reduce_96(val, _values, result)
1741
1906
  reset_precs
1742
1907
  result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)
1743
1908
 
@@ -1745,8 +1910,8 @@ module_eval(<<'.,.,', 'parser.y', 312)
1745
1910
  end
1746
1911
  .,.,
1747
1912
 
1748
- module_eval(<<'.,.,', 'parser.y', 317)
1749
- def _reduce_82(val, _values, result)
1913
+ module_eval(<<'.,.,', 'parser.y', 397)
1914
+ def _reduce_97(val, _values, result)
1750
1915
  reset_precs
1751
1916
  result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)
1752
1917
 
@@ -1754,8 +1919,8 @@ module_eval(<<'.,.,', 'parser.y', 317)
1754
1919
  end
1755
1920
  .,.,
1756
1921
 
1757
- module_eval(<<'.,.,', 'parser.y', 322)
1758
- def _reduce_83(val, _values, result)
1922
+ module_eval(<<'.,.,', 'parser.y', 402)
1923
+ def _reduce_98(val, _values, result)
1759
1924
  token = val[1]
1760
1925
  token.alias_name = val[2]
1761
1926
  builder = val[0]
@@ -1766,9 +1931,9 @@ module_eval(<<'.,.,', 'parser.y', 322)
1766
1931
  end
1767
1932
  .,.,
1768
1933
 
1769
- module_eval(<<'.,.,', 'parser.y', 330)
1770
- def _reduce_84(val, _values, result)
1771
- token = Lrama::Lexer::Token::Parameterizing.new(s_value: val[2], location: @lexer.location, args: [val[1]])
1934
+ module_eval(<<'.,.,', 'parser.y', 410)
1935
+ def _reduce_99(val, _values, result)
1936
+ token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]])
1772
1937
  builder = val[0]
1773
1938
  builder.add_rhs(token)
1774
1939
  builder.lhs_tag = val[3]
@@ -1779,9 +1944,9 @@ module_eval(<<'.,.,', 'parser.y', 330)
1779
1944
  end
1780
1945
  .,.,
1781
1946
 
1782
- module_eval(<<'.,.,', 'parser.y', 339)
1783
- def _reduce_85(val, _values, result)
1784
- token = Lrama::Lexer::Token::Parameterizing.new(s_value: val[1].s_value, location: @lexer.location, args: val[3])
1947
+ module_eval(<<'.,.,', 'parser.y', 419)
1948
+ def _reduce_100(val, _values, result)
1949
+ token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3])
1785
1950
  builder = val[0]
1786
1951
  builder.add_rhs(token)
1787
1952
  builder.lhs_tag = val[5]
@@ -1792,8 +1957,8 @@ module_eval(<<'.,.,', 'parser.y', 339)
1792
1957
  end
1793
1958
  .,.,
1794
1959
 
1795
- module_eval(<<'.,.,', 'parser.y', 348)
1796
- def _reduce_86(val, _values, result)
1960
+ module_eval(<<'.,.,', 'parser.y', 428)
1961
+ def _reduce_101(val, _values, result)
1797
1962
  if @prec_seen
1798
1963
  on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec
1799
1964
  @code_after_prec = true
@@ -1804,16 +1969,16 @@ module_eval(<<'.,.,', 'parser.y', 348)
1804
1969
  end
1805
1970
  .,.,
1806
1971
 
1807
- module_eval(<<'.,.,', 'parser.y', 356)
1808
- def _reduce_87(val, _values, result)
1972
+ module_eval(<<'.,.,', 'parser.y', 436)
1973
+ def _reduce_102(val, _values, result)
1809
1974
  end_c_declaration
1810
1975
 
1811
1976
  result
1812
1977
  end
1813
1978
  .,.,
1814
1979
 
1815
- module_eval(<<'.,.,', 'parser.y', 360)
1816
- def _reduce_88(val, _values, result)
1980
+ module_eval(<<'.,.,', 'parser.y', 440)
1981
+ def _reduce_103(val, _values, result)
1817
1982
  user_code = val[3]
1818
1983
  user_code.alias_name = val[6]
1819
1984
  builder = val[0]
@@ -1824,8 +1989,8 @@ module_eval(<<'.,.,', 'parser.y', 360)
1824
1989
  end
1825
1990
  .,.,
1826
1991
 
1827
- module_eval(<<'.,.,', 'parser.y', 368)
1828
- def _reduce_89(val, _values, result)
1992
+ module_eval(<<'.,.,', 'parser.y', 448)
1993
+ def _reduce_104(val, _values, result)
1829
1994
  sym = @grammar.find_symbol_by_id!(val[2])
1830
1995
  @prec_seen = true
1831
1996
  builder = val[0]
@@ -1836,41 +2001,41 @@ module_eval(<<'.,.,', 'parser.y', 368)
1836
2001
  end
1837
2002
  .,.,
1838
2003
 
1839
- # reduce 90 omitted
2004
+ # reduce 105 omitted
1840
2005
 
1841
- # reduce 91 omitted
2006
+ # reduce 106 omitted
1842
2007
 
1843
- # reduce 92 omitted
2008
+ # reduce 107 omitted
1844
2009
 
1845
- module_eval(<<'.,.,', 'parser.y', 379)
1846
- def _reduce_93(val, _values, result)
2010
+ module_eval(<<'.,.,', 'parser.y', 459)
2011
+ def _reduce_108(val, _values, result)
1847
2012
  result = [val[0]]
1848
2013
  result
1849
2014
  end
1850
2015
  .,.,
1851
2016
 
1852
- module_eval(<<'.,.,', 'parser.y', 380)
1853
- def _reduce_94(val, _values, result)
2017
+ module_eval(<<'.,.,', 'parser.y', 460)
2018
+ def _reduce_109(val, _values, result)
1854
2019
  result = val[0].append(val[2])
1855
2020
  result
1856
2021
  end
1857
2022
  .,.,
1858
2023
 
1859
- # reduce 95 omitted
2024
+ # reduce 110 omitted
1860
2025
 
1861
- module_eval(<<'.,.,', 'parser.y', 383)
1862
- def _reduce_96(val, _values, result)
2026
+ module_eval(<<'.,.,', 'parser.y', 463)
2027
+ def _reduce_111(val, _values, result)
1863
2028
  result = val[1].s_value
1864
2029
  result
1865
2030
  end
1866
2031
  .,.,
1867
2032
 
1868
- # reduce 97 omitted
2033
+ # reduce 112 omitted
1869
2034
 
1870
- # reduce 98 omitted
2035
+ # reduce 113 omitted
1871
2036
 
1872
- module_eval(<<'.,.,', 'parser.y', 390)
1873
- def _reduce_99(val, _values, result)
2037
+ module_eval(<<'.,.,', 'parser.y', 470)
2038
+ def _reduce_114(val, _values, result)
1874
2039
  begin_c_declaration('\Z')
1875
2040
  @grammar.epilogue_first_lineno = @lexer.line + 1
1876
2041
 
@@ -1878,8 +2043,8 @@ module_eval(<<'.,.,', 'parser.y', 390)
1878
2043
  end
1879
2044
  .,.,
1880
2045
 
1881
- module_eval(<<'.,.,', 'parser.y', 395)
1882
- def _reduce_100(val, _values, result)
2046
+ module_eval(<<'.,.,', 'parser.y', 475)
2047
+ def _reduce_115(val, _values, result)
1883
2048
  end_c_declaration
1884
2049
  @grammar.epilogue = val[2].s_value
1885
2050
 
@@ -1887,44 +2052,44 @@ module_eval(<<'.,.,', 'parser.y', 395)
1887
2052
  end
1888
2053
  .,.,
1889
2054
 
1890
- # reduce 101 omitted
2055
+ # reduce 116 omitted
1891
2056
 
1892
- # reduce 102 omitted
2057
+ # reduce 117 omitted
1893
2058
 
1894
- # reduce 103 omitted
2059
+ # reduce 118 omitted
1895
2060
 
1896
- # reduce 104 omitted
2061
+ # reduce 119 omitted
1897
2062
 
1898
- # reduce 105 omitted
2063
+ # reduce 120 omitted
1899
2064
 
1900
- module_eval(<<'.,.,', 'parser.y', 406)
1901
- def _reduce_106(val, _values, result)
2065
+ module_eval(<<'.,.,', 'parser.y', 486)
2066
+ def _reduce_121(val, _values, result)
1902
2067
  result = [val[0]]
1903
2068
  result
1904
2069
  end
1905
2070
  .,.,
1906
2071
 
1907
- module_eval(<<'.,.,', 'parser.y', 407)
1908
- def _reduce_107(val, _values, result)
2072
+ module_eval(<<'.,.,', 'parser.y', 487)
2073
+ def _reduce_122(val, _values, result)
1909
2074
  result = val[0].append(val[1])
1910
2075
  result
1911
2076
  end
1912
2077
  .,.,
1913
2078
 
1914
- # reduce 108 omitted
2079
+ # reduce 123 omitted
1915
2080
 
1916
- # reduce 109 omitted
2081
+ # reduce 124 omitted
1917
2082
 
1918
- module_eval(<<'.,.,', 'parser.y', 412)
1919
- def _reduce_110(val, _values, result)
2083
+ module_eval(<<'.,.,', 'parser.y', 492)
2084
+ def _reduce_125(val, _values, result)
1920
2085
  result = Lrama::Lexer::Token::Ident.new(s_value: val[0])
1921
2086
  result
1922
2087
  end
1923
2088
  .,.,
1924
2089
 
1925
- # reduce 111 omitted
2090
+ # reduce 126 omitted
1926
2091
 
1927
- # reduce 112 omitted
2092
+ # reduce 127 omitted
1928
2093
 
1929
2094
  def _reduce_none(val, _values, result)
1930
2095
  val[0]