lrama 0.5.8 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +6 -1
- data/.gitignore +7 -4
- data/Gemfile +10 -6
- data/README.md +3 -3
- data/Rakefile +15 -7
- data/Steepfile +15 -1
- data/lib/lrama/command.rb +6 -1
- data/lib/lrama/context.rb +1 -3
- data/lib/lrama/counterexamples/path.rb +0 -46
- data/lib/lrama/counterexamples/production_path.rb +17 -0
- data/lib/lrama/counterexamples/start_path.rb +21 -0
- data/lib/lrama/counterexamples/transition_path.rb +17 -0
- data/lib/lrama/counterexamples.rb +3 -0
- data/lib/lrama/grammar/code/initial_action_code.rb +28 -0
- data/lib/lrama/grammar/code/no_reference_code.rb +24 -0
- data/lib/lrama/grammar/code/printer_code.rb +34 -0
- data/lib/lrama/grammar/code/rule_action.rb +62 -0
- data/lib/lrama/grammar/code.rb +9 -93
- data/lib/lrama/grammar/counter.rb +15 -0
- data/lib/lrama/grammar/error_token.rb +3 -3
- data/lib/lrama/grammar/parameterizing_rules/builder/base.rb +28 -0
- data/lib/lrama/grammar/parameterizing_rules/builder/list.rb +20 -0
- data/lib/lrama/grammar/parameterizing_rules/builder/nonempty_list.rb +20 -0
- data/lib/lrama/grammar/parameterizing_rules/builder/option.rb +20 -0
- data/lib/lrama/grammar/parameterizing_rules/builder/separated_list.rb +28 -0
- data/lib/lrama/grammar/parameterizing_rules/builder/separated_nonempty_list.rb +27 -0
- data/lib/lrama/grammar/parameterizing_rules/builder.rb +43 -0
- data/lib/lrama/grammar/percent_code.rb +12 -0
- data/lib/lrama/grammar/printer.rb +3 -3
- data/lib/lrama/grammar/reference.rb +7 -16
- data/lib/lrama/grammar/rule.rb +18 -2
- data/lib/lrama/grammar/rule_builder.rb +179 -0
- data/lib/lrama/grammar/symbol.rb +2 -2
- data/lib/lrama/grammar.rb +132 -302
- data/lib/lrama/lexer/location.rb +22 -0
- data/lib/lrama/lexer/token/char.rb +8 -0
- data/lib/lrama/lexer/token/ident.rb +8 -0
- data/lib/lrama/lexer/token/parameterizing.rb +34 -0
- data/lib/lrama/lexer/token/tag.rb +12 -0
- data/lib/lrama/lexer/token/user_code.rb +64 -0
- data/lib/lrama/lexer/token.rb +23 -63
- data/lib/lrama/lexer.rb +38 -37
- data/lib/lrama/option_parser.rb +2 -1
- data/lib/lrama/options.rb +2 -2
- data/lib/lrama/output.rb +11 -2
- data/lib/lrama/parser.rb +607 -488
- data/lib/lrama/report/profile.rb +1 -12
- data/lib/lrama/version.rb +1 -1
- data/parser.y +177 -96
- data/rbs_collection.lock.yaml +17 -1
- data/rbs_collection.yaml +1 -0
- data/sample/calc.y +3 -1
- data/sample/parse.y +5 -1
- data/sig/lrama/grammar/code/printer_code.rbs +15 -0
- data/sig/lrama/grammar/code.rbs +24 -0
- data/sig/lrama/grammar/counter.rbs +11 -0
- data/sig/lrama/grammar/parameterizing_rules/builder.rbs +10 -0
- data/sig/lrama/grammar/percent_code.rbs +10 -0
- data/sig/lrama/grammar/precedence.rbs +11 -0
- data/sig/lrama/grammar/printer.rbs +11 -0
- data/sig/lrama/grammar/reference.rbs +22 -0
- data/sig/lrama/grammar/rule.rbs +13 -0
- data/sig/lrama/grammar/rule_builder.rbs +41 -0
- data/sig/lrama/grammar.rbs +5 -0
- data/sig/lrama/lexer/location.rbs +14 -0
- data/sig/lrama/lexer/token/char.rbs +8 -0
- data/sig/lrama/lexer/token/ident.rbs +8 -0
- data/sig/lrama/lexer/token/parameterizing.rbs +15 -0
- data/sig/lrama/lexer/token/tag.rbs +9 -0
- data/sig/lrama/lexer/token/user_code.rbs +16 -0
- data/sig/lrama/lexer/token.rbs +22 -0
- data/sig/stdlib/strscan/string_scanner.rbs +5 -0
- data/template/bison/_yacc.h +2 -2
- data/template/bison/yacc.c +5 -2
- metadata +44 -4
- data/lib/lrama/lexer/token/type.rb +0 -8
- data/sig/lrama/lexer/token/type.rbs +0 -17
data/lib/lrama/parser.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.7.
|
4
|
-
# from Racc grammar file "".
|
3
|
+
# This file is automatically generated by Racc 1.7.3
|
4
|
+
# from Racc grammar file "parser.y".
|
5
5
|
#
|
6
6
|
|
7
7
|
###### racc/parser.rb begin
|
8
8
|
unless $".find {|p| p.end_with?('/racc/parser.rb')}
|
9
9
|
$".push "#{__dir__}/racc/parser.rb"
|
10
10
|
self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb', 1)
|
11
|
-
# frozen_string_literal: false
|
12
11
|
#--
|
13
12
|
# Copyright (c) 1999-2006 Minero Aoki
|
14
13
|
#
|
@@ -22,20 +21,9 @@ self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb
|
|
22
21
|
|
23
22
|
unless $".find {|p| p.end_with?('/racc/info.rb')}
|
24
23
|
$".push "#{__dir__}/racc/info.rb"
|
25
|
-
#--
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# Copyright (c) 1999-2006 Minero Aoki
|
30
|
-
#
|
31
|
-
# This program is free software.
|
32
|
-
# You can distribute/modify this program under the same terms of ruby.
|
33
|
-
# see the file "COPYING".
|
34
|
-
#
|
35
|
-
#++
|
36
24
|
|
37
25
|
module Racc
|
38
|
-
VERSION = '1.7.
|
26
|
+
VERSION = '1.7.3'
|
39
27
|
Version = VERSION
|
40
28
|
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
41
29
|
end
|
@@ -84,10 +72,12 @@ end
|
|
84
72
|
# [-v, --verbose]
|
85
73
|
# verbose mode. create +filename+.output file, like yacc's y.output file.
|
86
74
|
# [-g, --debug]
|
87
|
-
# add debug code to parser class. To display
|
75
|
+
# add debug code to parser class. To display debugging information,
|
88
76
|
# use this '-g' option and set @yydebug true in parser class.
|
89
77
|
# [-E, --embedded]
|
90
78
|
# Output parser which doesn't need runtime files (racc/parser.rb).
|
79
|
+
# [-F, --frozen]
|
80
|
+
# Output parser which declares frozen_string_literals: true
|
91
81
|
# [-C, --check-only]
|
92
82
|
# Check syntax of racc grammar file and quit.
|
93
83
|
# [-S, --output-status]
|
@@ -566,7 +556,7 @@ module Racc
|
|
566
556
|
#
|
567
557
|
# If this method returns, parsers enter "error recovering mode".
|
568
558
|
def on_error(t, val, vstack)
|
569
|
-
raise ParseError, sprintf("
|
559
|
+
raise ParseError, sprintf("parse error on value %s (%s)",
|
570
560
|
val.inspect, token_to_str(t) || '?')
|
571
561
|
end
|
572
562
|
|
@@ -668,25 +658,26 @@ end
|
|
668
658
|
module Lrama
|
669
659
|
class Parser < Racc::Parser
|
670
660
|
|
671
|
-
module_eval(<<'...end parser.y/module_eval...', 'parser.y',
|
661
|
+
module_eval(<<'...end parser.y/module_eval...', 'parser.y', 418)
|
672
662
|
|
673
663
|
include Lrama::Report::Duration
|
674
664
|
|
675
|
-
def initialize(text, path)
|
665
|
+
def initialize(text, path, debug = false)
|
676
666
|
@text = text
|
677
667
|
@path = path
|
668
|
+
@yydebug = debug
|
669
|
+
@rule_counter = Lrama::Grammar::Counter.new(0)
|
670
|
+
@midrule_action_counter = Lrama::Grammar::Counter.new(1)
|
678
671
|
end
|
679
672
|
|
680
673
|
def parse
|
681
674
|
report_duration(:parse) do
|
682
675
|
@lexer = Lrama::Lexer.new(@text)
|
683
|
-
@grammar = Lrama::Grammar.new
|
676
|
+
@grammar = Lrama::Grammar.new(@rule_counter)
|
684
677
|
@precedence_number = 0
|
678
|
+
reset_precs
|
685
679
|
do_parse
|
686
|
-
@grammar.extract_references
|
687
680
|
@grammar.prepare
|
688
|
-
@grammar.compute_nullable
|
689
|
-
@grammar.compute_first_set
|
690
681
|
@grammar.validate!
|
691
682
|
@grammar
|
692
683
|
end
|
@@ -697,253 +688,320 @@ def next_token
|
|
697
688
|
end
|
698
689
|
|
699
690
|
def on_error(error_token_id, error_value, value_stack)
|
700
|
-
|
691
|
+
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
|
695
|
+
value = "'#{error_value.s_value}'"
|
696
|
+
else
|
697
|
+
line = @lexer.line
|
698
|
+
first_column = @lexer.head_column
|
699
|
+
last_column = @lexer.column
|
700
|
+
value = error_value.inspect
|
701
|
+
end
|
702
|
+
|
701
703
|
raise ParseError, <<~ERROR
|
702
|
-
#{@path}:#{
|
703
|
-
#{
|
704
|
-
#{
|
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)}
|
705
707
|
ERROR
|
706
708
|
end
|
709
|
+
|
710
|
+
def on_action_error(error_message, error_value)
|
711
|
+
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
|
715
|
+
else
|
716
|
+
line = @lexer.line
|
717
|
+
first_column = @lexer.head_column
|
718
|
+
last_column = @lexer.column
|
719
|
+
end
|
720
|
+
|
721
|
+
raise ParseError, <<~ERROR
|
722
|
+
#{@path}:#{line}: #{error_message}
|
723
|
+
#{@text.split("\n")[line - 1]}
|
724
|
+
#{carrets(first_column, last_column)}
|
725
|
+
ERROR
|
726
|
+
end
|
727
|
+
|
728
|
+
private
|
729
|
+
|
730
|
+
def reset_precs
|
731
|
+
@prec_seen = false
|
732
|
+
@code_after_prec = false
|
733
|
+
end
|
734
|
+
|
735
|
+
def begin_c_declaration(end_symbol)
|
736
|
+
@lexer.status = :c_declaration
|
737
|
+
@lexer.end_symbol = end_symbol
|
738
|
+
end
|
739
|
+
|
740
|
+
def end_c_declaration
|
741
|
+
@lexer.status = :initial
|
742
|
+
@lexer.end_symbol = nil
|
743
|
+
end
|
744
|
+
|
745
|
+
def carrets(first_column, last_column)
|
746
|
+
' ' * (first_column + 1) + '^' * (last_column - first_column)
|
747
|
+
end
|
707
748
|
...end parser.y/module_eval...
|
708
749
|
##### State transition tables begin ###
|
709
750
|
|
710
751
|
racc_action_table = [
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
752
|
+
84, 43, 85, 139, 39, 67, 43, 138, 139, 153,
|
753
|
+
67, 171, 172, 154, 155, 156, 43, 141, 42, 137,
|
754
|
+
3, 58, 141, 21, 23, 24, 25, 26, 27, 28,
|
755
|
+
29, 30, 31, 39, 6, 8, 7, 142, 79, 43,
|
756
|
+
86, 42, 142, 67, 63, 43, 43, 42, 42, 33,
|
757
|
+
70, 70, 21, 23, 24, 25, 26, 27, 28, 29,
|
758
|
+
30, 31, 9, 40, 45, 14, 12, 13, 15, 16,
|
759
|
+
17, 18, 47, 47, 19, 20, 21, 23, 24, 25,
|
760
|
+
26, 27, 28, 29, 30, 31, 43, 43, 42, 42,
|
761
|
+
47, 70, 70, 43, 43, 42, 42, 67, 165, 43,
|
762
|
+
43, 42, 42, 67, 165, 43, 43, 42, 42, 67,
|
763
|
+
165, 43, 43, 42, 42, 67, 165, 43, 43, 42,
|
764
|
+
42, 67, 165, 43, 43, 42, 42, 67, 165, 43,
|
765
|
+
43, 42, 42, 67, 67, 43, 43, 42, 42, 67,
|
766
|
+
67, 43, 43, 42, 42, 67, 67, 43, 43, 42,
|
767
|
+
42, 67, 67, 43, 43, 42, 42, 43, 43, 42,
|
768
|
+
42, 43, 50, 42, 51, 52, 53, 54, 55, 76,
|
769
|
+
80, 82, 87, 87, 87, 89, 95, 99, 100, 103,
|
770
|
+
103, 103, 103, 108, 109, 111, 113, 114, 115, 116,
|
771
|
+
117, 120, 123, 124, 127, 128, 129, 131, 144, 146,
|
772
|
+
147, 148, 149, 150, 127, 82, 160, 161, 169, 175,
|
773
|
+
176, 82 ]
|
731
774
|
|
732
775
|
racc_action_check = [
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
4, 4,
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
776
|
+
41, 126, 41, 126, 9, 126, 151, 125, 151, 139,
|
777
|
+
151, 168, 168, 139, 139, 139, 26, 126, 26, 125,
|
778
|
+
1, 26, 151, 9, 9, 9, 9, 9, 9, 9,
|
779
|
+
9, 9, 9, 34, 2, 3, 2, 126, 34, 27,
|
780
|
+
41, 27, 151, 27, 27, 28, 29, 28, 29, 7,
|
781
|
+
28, 29, 34, 34, 34, 34, 34, 34, 34, 34,
|
782
|
+
34, 34, 4, 12, 14, 4, 4, 4, 4, 4,
|
783
|
+
4, 4, 15, 16, 4, 4, 4, 4, 4, 4,
|
784
|
+
4, 4, 4, 4, 4, 4, 30, 31, 30, 31,
|
785
|
+
17, 30, 31, 148, 13, 148, 13, 148, 148, 149,
|
786
|
+
57, 149, 57, 149, 149, 150, 58, 150, 58, 150,
|
787
|
+
150, 162, 69, 162, 69, 162, 162, 166, 70, 166,
|
788
|
+
70, 166, 166, 167, 95, 167, 95, 167, 167, 62,
|
789
|
+
63, 62, 63, 62, 63, 100, 102, 100, 102, 100,
|
790
|
+
102, 121, 142, 121, 142, 121, 142, 153, 172, 153,
|
791
|
+
172, 153, 172, 97, 103, 97, 103, 105, 118, 105,
|
792
|
+
118, 122, 18, 122, 19, 21, 23, 24, 25, 32,
|
793
|
+
37, 38, 46, 48, 49, 50, 56, 60, 61, 68,
|
794
|
+
73, 74, 75, 81, 82, 88, 90, 91, 92, 93,
|
795
|
+
94, 98, 106, 107, 108, 109, 110, 112, 130, 132,
|
796
|
+
133, 134, 135, 136, 137, 140, 143, 145, 158, 173,
|
797
|
+
174, 175 ]
|
753
798
|
|
754
799
|
racc_action_pointer = [
|
755
|
-
nil,
|
756
|
-
nil, nil,
|
757
|
-
|
758
|
-
|
759
|
-
-5, nil, nil, nil, nil,
|
760
|
-
nil, nil, nil, nil,
|
761
|
-
|
762
|
-
nil,
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
nil,
|
770
|
-
|
771
|
-
|
800
|
+
nil, 20, 24, 35, 53, nil, nil, 42, nil, 0,
|
801
|
+
nil, nil, 57, 91, 57, 53, 54, 71, 157, 145,
|
802
|
+
nil, 146, nil, 147, 148, 149, 13, 36, 42, 43,
|
803
|
+
83, 84, 167, nil, 29, nil, nil, 148, 128, nil,
|
804
|
+
nil, -5, nil, nil, nil, nil, 153, nil, 154, 155,
|
805
|
+
156, nil, nil, nil, nil, nil, 168, 97, 103, nil,
|
806
|
+
171, 170, 126, 127, nil, nil, nil, nil, 171, 109,
|
807
|
+
115, nil, nil, 172, 173, 174, nil, nil, nil, nil,
|
808
|
+
nil, 150, 179, nil, nil, nil, nil, nil, 183, nil,
|
809
|
+
184, 185, 186, 187, 188, 121, nil, 150, 184, nil,
|
810
|
+
132, nil, 133, 151, nil, 154, 181, 191, 159, 151,
|
811
|
+
194, nil, 195, nil, nil, nil, nil, nil, 155, nil,
|
812
|
+
nil, 138, 158, nil, nil, -15, -2, nil, nil, nil,
|
813
|
+
178, nil, 179, 180, 181, 182, 183, 169, nil, -27,
|
814
|
+
162, nil, 139, 186, nil, 187, nil, nil, 90, 96,
|
815
|
+
102, 3, nil, 144, nil, nil, nil, nil, 206, nil,
|
816
|
+
nil, nil, 108, nil, nil, nil, 114, 120, -26, nil,
|
817
|
+
nil, nil, 145, 189, 173, 168, nil, nil ]
|
772
818
|
|
773
819
|
racc_action_default = [
|
774
|
-
-2, -
|
775
|
-
-9, -10, -
|
776
|
-
-
|
777
|
-
-
|
778
|
-
-
|
779
|
-
-
|
780
|
-
-
|
781
|
-
-
|
782
|
-
|
783
|
-
-
|
784
|
-
|
785
|
-
|
786
|
-
-
|
787
|
-
-
|
788
|
-
-
|
789
|
-
|
790
|
-
-
|
820
|
+
-2, -111, -8, -111, -111, -3, -4, -111, 178, -111,
|
821
|
+
-9, -10, -111, -111, -111, -111, -111, -111, -111, -111,
|
822
|
+
-23, -111, -27, -111, -111, -111, -111, -111, -111, -111,
|
823
|
+
-111, -111, -111, -7, -98, -74, -76, -111, -95, -97,
|
824
|
+
-11, -102, -72, -73, -101, -13, -14, -63, -15, -16,
|
825
|
+
-111, -20, -24, -28, -31, -34, -37, -43, -111, -46,
|
826
|
+
-49, -38, -53, -111, -56, -58, -59, -110, -39, -66,
|
827
|
+
-111, -69, -71, -40, -41, -42, -5, -1, -75, -99,
|
828
|
+
-77, -111, -111, -12, -103, -104, -105, -60, -111, -17,
|
829
|
+
-111, -111, -111, -111, -111, -111, -47, -44, -51, -50,
|
830
|
+
-111, -57, -54, -111, -70, -67, -111, -111, -82, -111,
|
831
|
+
-111, -64, -111, -21, -25, -29, -32, -35, -45, -48,
|
832
|
+
-52, -55, -68, -6, -100, -78, -79, -83, -96, -61,
|
833
|
+
-111, -18, -111, -111, -111, -111, -111, -82, -81, -72,
|
834
|
+
-95, -88, -111, -111, -65, -111, -22, -26, -111, -111,
|
835
|
+
-111, -80, -85, -111, -92, -93, -94, -84, -111, -91,
|
836
|
+
-62, -19, -30, -106, -108, -109, -33, -36, -111, -89,
|
837
|
+
-107, -86, -111, -111, -111, -95, -87, -90 ]
|
791
838
|
|
792
839
|
racc_goto_table = [
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
nil, nil,
|
804
|
-
nil,
|
805
|
-
|
840
|
+
64, 81, 57, 44, 62, 96, 105, 35, 104, 126,
|
841
|
+
170, 46, 48, 49, 170, 170, 60, 1, 72, 72,
|
842
|
+
72, 72, 68, 73, 74, 75, 162, 166, 167, 2,
|
843
|
+
4, 34, 78, 77, 97, 101, 64, 5, 151, 122,
|
844
|
+
102, 32, 106, 10, 104, 96, 11, 60, 60, 41,
|
845
|
+
83, 112, 145, 90, 132, 91, 133, 92, 134, 72,
|
846
|
+
72, 104, 93, 135, 94, 136, 96, 56, 61, 98,
|
847
|
+
119, 118, 110, 64, 143, 101, 88, 121, 130, 125,
|
848
|
+
152, 158, 173, 107, nil, 60, nil, 60, nil, nil,
|
849
|
+
nil, nil, nil, 72, 101, 72, nil, nil, nil, 140,
|
850
|
+
nil, nil, nil, 157, nil, nil, nil, nil, 60, nil,
|
851
|
+
nil, nil, 72, nil, nil, 159, nil, nil, nil, nil,
|
852
|
+
nil, nil, nil, nil, 140, nil, 168, nil, nil, nil,
|
853
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 177, nil,
|
854
|
+
nil, nil, nil, nil, nil, 174 ]
|
806
855
|
|
807
856
|
racc_goto_check = [
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
nil, nil,
|
819
|
-
nil,
|
820
|
-
|
857
|
+
37, 48, 31, 33, 36, 32, 43, 45, 44, 50,
|
858
|
+
55, 13, 13, 13, 55, 55, 33, 1, 33, 33,
|
859
|
+
33, 33, 30, 30, 30, 30, 19, 19, 19, 2,
|
860
|
+
3, 4, 45, 5, 31, 37, 37, 6, 50, 43,
|
861
|
+
36, 7, 8, 9, 44, 32, 10, 33, 33, 11,
|
862
|
+
12, 14, 15, 16, 17, 20, 21, 22, 23, 33,
|
863
|
+
33, 44, 24, 25, 26, 27, 32, 28, 29, 34,
|
864
|
+
35, 31, 39, 37, 40, 37, 41, 36, 42, 49,
|
865
|
+
51, 52, 53, 54, nil, 33, nil, 33, nil, nil,
|
866
|
+
nil, nil, nil, 33, 37, 33, nil, nil, nil, 37,
|
867
|
+
nil, nil, nil, 48, nil, nil, nil, nil, 33, nil,
|
868
|
+
nil, nil, 33, nil, nil, 37, nil, nil, nil, nil,
|
869
|
+
nil, nil, nil, nil, 37, nil, 37, nil, nil, nil,
|
870
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 48, nil,
|
871
|
+
nil, nil, nil, nil, nil, 37 ]
|
821
872
|
|
822
873
|
racc_goto_pointer = [
|
823
|
-
nil,
|
824
|
-
|
825
|
-
|
826
|
-
-
|
827
|
-
-
|
828
|
-
-
|
874
|
+
nil, 17, 29, 28, 22, -1, 35, 35, -34, 39,
|
875
|
+
42, 36, 9, -4, -38, -79, 2, -59, nil, -122,
|
876
|
+
3, -58, 4, -57, 8, -53, 9, -52, 41, 41,
|
877
|
+
-6, -24, -52, -10, 9, -28, -23, -27, nil, -15,
|
878
|
+
-55, 29, -33, -64, -61, -2, nil, nil, -37, -29,
|
879
|
+
-99, -59, -60, -87, 4, -152 ]
|
829
880
|
|
830
881
|
racc_goto_default = [
|
831
882
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
832
|
-
|
883
|
+
37, nil, nil, nil, nil, nil, nil, nil, 22, nil,
|
833
884
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
834
|
-
|
835
|
-
nil,
|
836
|
-
nil, nil, nil, nil,
|
885
|
+
nil, nil, 59, 65, nil, nil, nil, 164, 66, nil,
|
886
|
+
nil, nil, nil, 69, 71, nil, 36, 38, nil, nil,
|
887
|
+
nil, nil, nil, nil, nil, 163 ]
|
837
888
|
|
838
889
|
racc_reduce_table = [
|
839
890
|
0, 0, :racc_error,
|
840
|
-
5,
|
841
|
-
0,
|
842
|
-
2,
|
843
|
-
0,
|
844
|
-
0,
|
845
|
-
5,
|
846
|
-
2,
|
847
|
-
0,
|
848
|
-
2,
|
849
|
-
1,
|
850
|
-
2,
|
851
|
-
3,
|
852
|
-
2,
|
853
|
-
2,
|
854
|
-
2,
|
855
|
-
2,
|
856
|
-
0,
|
857
|
-
0,
|
858
|
-
|
859
|
-
|
860
|
-
0,
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
0,
|
865
|
-
|
866
|
-
|
867
|
-
0,
|
868
|
-
0,
|
869
|
-
7,
|
870
|
-
0,
|
871
|
-
0,
|
872
|
-
7,
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
2,
|
877
|
-
2,
|
878
|
-
2,
|
879
|
-
|
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,
|
899
|
+
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_none,
|
905
|
+
2, 55, :_reduce_15,
|
906
|
+
2, 55, :_reduce_16,
|
907
|
+
0, 60, :_reduce_17,
|
908
|
+
0, 61, :_reduce_18,
|
909
|
+
7, 55, :_reduce_19,
|
910
|
+
0, 62, :_reduce_20,
|
911
|
+
0, 63, :_reduce_21,
|
912
|
+
6, 55, :_reduce_22,
|
913
|
+
1, 55, :_reduce_none,
|
914
|
+
0, 66, :_reduce_24,
|
915
|
+
0, 67, :_reduce_25,
|
916
|
+
6, 56, :_reduce_26,
|
917
|
+
1, 56, :_reduce_none,
|
918
|
+
0, 68, :_reduce_28,
|
919
|
+
0, 69, :_reduce_29,
|
920
|
+
7, 56, :_reduce_none,
|
921
|
+
0, 70, :_reduce_31,
|
922
|
+
0, 71, :_reduce_32,
|
923
|
+
7, 56, :_reduce_33,
|
924
|
+
0, 72, :_reduce_34,
|
925
|
+
0, 73, :_reduce_35,
|
926
|
+
7, 56, :_reduce_36,
|
927
|
+
2, 64, :_reduce_none,
|
928
|
+
2, 64, :_reduce_38,
|
929
|
+
2, 64, :_reduce_39,
|
930
|
+
2, 64, :_reduce_40,
|
880
931
|
2, 64, :_reduce_41,
|
881
|
-
|
882
|
-
1,
|
883
|
-
2,
|
884
|
-
3,
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
1, 65, :_reduce_50,
|
890
|
-
2, 65, :_reduce_51,
|
891
|
-
3, 65, :_reduce_52,
|
892
|
-
1, 72, :_reduce_53,
|
893
|
-
2, 72, :_reduce_54,
|
894
|
-
1, 73, :_reduce_none,
|
895
|
-
1, 73, :_reduce_none,
|
896
|
-
0, 75, :_reduce_57,
|
897
|
-
0, 76, :_reduce_58,
|
898
|
-
6, 51, :_reduce_59,
|
899
|
-
0, 77, :_reduce_60,
|
900
|
-
0, 78, :_reduce_61,
|
901
|
-
5, 51, :_reduce_62,
|
902
|
-
1, 66, :_reduce_63,
|
903
|
-
2, 66, :_reduce_64,
|
904
|
-
2, 66, :_reduce_65,
|
905
|
-
1, 79, :_reduce_66,
|
906
|
-
2, 79, :_reduce_67,
|
932
|
+
2, 64, :_reduce_42,
|
933
|
+
1, 74, :_reduce_43,
|
934
|
+
2, 74, :_reduce_44,
|
935
|
+
3, 74, :_reduce_45,
|
936
|
+
1, 77, :_reduce_46,
|
937
|
+
2, 77, :_reduce_47,
|
938
|
+
3, 78, :_reduce_48,
|
939
|
+
0, 80, :_reduce_none,
|
907
940
|
1, 80, :_reduce_none,
|
908
|
-
|
909
|
-
1, 69, :_reduce_70,
|
910
|
-
1, 42, :_reduce_none,
|
911
|
-
2, 42, :_reduce_none,
|
941
|
+
0, 81, :_reduce_none,
|
912
942
|
1, 81, :_reduce_none,
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
2,
|
918
|
-
0, 86, :_reduce_79,
|
919
|
-
3, 86, :_reduce_80,
|
920
|
-
0, 87, :_reduce_81,
|
921
|
-
0, 88, :_reduce_82,
|
922
|
-
7, 86, :_reduce_83,
|
923
|
-
0, 89, :_reduce_84,
|
924
|
-
0, 90, :_reduce_85,
|
925
|
-
6, 86, :_reduce_86,
|
926
|
-
3, 86, :_reduce_87,
|
927
|
-
0, 84, :_reduce_none,
|
928
|
-
3, 84, :_reduce_89,
|
943
|
+
1, 75, :_reduce_53,
|
944
|
+
2, 75, :_reduce_54,
|
945
|
+
3, 75, :_reduce_55,
|
946
|
+
1, 82, :_reduce_56,
|
947
|
+
2, 82, :_reduce_57,
|
929
948
|
1, 83, :_reduce_none,
|
930
|
-
|
931
|
-
0,
|
932
|
-
|
933
|
-
|
934
|
-
0,
|
935
|
-
|
936
|
-
|
949
|
+
1, 83, :_reduce_none,
|
950
|
+
0, 85, :_reduce_60,
|
951
|
+
0, 86, :_reduce_61,
|
952
|
+
6, 59, :_reduce_62,
|
953
|
+
0, 87, :_reduce_63,
|
954
|
+
0, 88, :_reduce_64,
|
955
|
+
5, 59, :_reduce_65,
|
956
|
+
1, 76, :_reduce_66,
|
957
|
+
2, 76, :_reduce_67,
|
958
|
+
3, 76, :_reduce_68,
|
959
|
+
1, 89, :_reduce_69,
|
960
|
+
2, 89, :_reduce_70,
|
961
|
+
1, 90, :_reduce_none,
|
962
|
+
1, 79, :_reduce_72,
|
963
|
+
1, 79, :_reduce_73,
|
937
964
|
1, 50, :_reduce_none,
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
1,
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
965
|
+
2, 50, :_reduce_none,
|
966
|
+
1, 91, :_reduce_none,
|
967
|
+
2, 91, :_reduce_none,
|
968
|
+
4, 92, :_reduce_78,
|
969
|
+
1, 95, :_reduce_79,
|
970
|
+
3, 95, :_reduce_80,
|
971
|
+
2, 95, :_reduce_none,
|
972
|
+
0, 96, :_reduce_82,
|
973
|
+
1, 96, :_reduce_83,
|
974
|
+
3, 96, :_reduce_84,
|
975
|
+
3, 96, :_reduce_85,
|
976
|
+
5, 96, :_reduce_86,
|
977
|
+
7, 96, :_reduce_87,
|
978
|
+
0, 98, :_reduce_88,
|
979
|
+
0, 99, :_reduce_89,
|
980
|
+
7, 96, :_reduce_90,
|
981
|
+
3, 96, :_reduce_91,
|
982
|
+
1, 97, :_reduce_none,
|
983
|
+
1, 97, :_reduce_none,
|
984
|
+
1, 97, :_reduce_none,
|
985
|
+
0, 94, :_reduce_none,
|
986
|
+
3, 94, :_reduce_96,
|
987
|
+
1, 93, :_reduce_none,
|
988
|
+
0, 51, :_reduce_none,
|
989
|
+
0, 100, :_reduce_99,
|
990
|
+
3, 51, :_reduce_100,
|
991
|
+
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, 101, :_reduce_none,
|
999
|
+
1, 101, :_reduce_none,
|
1000
|
+
1, 84, :_reduce_110 ]
|
1001
|
+
|
1002
|
+
racc_reduce_n = 111
|
1003
|
+
|
1004
|
+
racc_shift_n = 178
|
947
1005
|
|
948
1006
|
racc_token_table = {
|
949
1007
|
false => 0,
|
@@ -964,28 +1022,36 @@ racc_token_table = {
|
|
964
1022
|
"%param" => 15,
|
965
1023
|
"%lex-param" => 16,
|
966
1024
|
"%parse-param" => 17,
|
967
|
-
"%
|
1025
|
+
"%code" => 18,
|
968
1026
|
"{" => 19,
|
969
1027
|
"}" => 20,
|
970
|
-
"
|
971
|
-
"
|
972
|
-
"%
|
973
|
-
"%
|
974
|
-
"%
|
975
|
-
"%token" => 26,
|
976
|
-
"%
|
977
|
-
"%
|
978
|
-
"%
|
979
|
-
"%
|
980
|
-
"%
|
981
|
-
"
|
982
|
-
"
|
983
|
-
"
|
984
|
-
"
|
985
|
-
"
|
986
|
-
"
|
987
|
-
|
988
|
-
|
1028
|
+
"%initial-action" => 21,
|
1029
|
+
";" => 22,
|
1030
|
+
"%union" => 23,
|
1031
|
+
"%destructor" => 24,
|
1032
|
+
"%printer" => 25,
|
1033
|
+
"%error-token" => 26,
|
1034
|
+
"%token" => 27,
|
1035
|
+
"%type" => 28,
|
1036
|
+
"%left" => 29,
|
1037
|
+
"%right" => 30,
|
1038
|
+
"%precedence" => 31,
|
1039
|
+
"%nonassoc" => 32,
|
1040
|
+
":" => 33,
|
1041
|
+
"|" => 34,
|
1042
|
+
"%empty" => 35,
|
1043
|
+
"(" => 36,
|
1044
|
+
")" => 37,
|
1045
|
+
"," => 38,
|
1046
|
+
"%prec" => 39,
|
1047
|
+
"?" => 40,
|
1048
|
+
"+" => 41,
|
1049
|
+
"*" => 42,
|
1050
|
+
"[" => 43,
|
1051
|
+
"]" => 44,
|
1052
|
+
"{...}" => 45 }
|
1053
|
+
|
1054
|
+
racc_nt_base = 46
|
989
1055
|
|
990
1056
|
racc_use_result_var = true
|
991
1057
|
|
@@ -1025,9 +1091,10 @@ Racc_token_to_s_table = [
|
|
1025
1091
|
"\"%param\"",
|
1026
1092
|
"\"%lex-param\"",
|
1027
1093
|
"\"%parse-param\"",
|
1028
|
-
"\"%
|
1094
|
+
"\"%code\"",
|
1029
1095
|
"\"{\"",
|
1030
1096
|
"\"}\"",
|
1097
|
+
"\"%initial-action\"",
|
1031
1098
|
"\";\"",
|
1032
1099
|
"\"%union\"",
|
1033
1100
|
"\"%destructor\"",
|
@@ -1041,7 +1108,14 @@ Racc_token_to_s_table = [
|
|
1041
1108
|
"\"%nonassoc\"",
|
1042
1109
|
"\":\"",
|
1043
1110
|
"\"|\"",
|
1111
|
+
"\"%empty\"",
|
1112
|
+
"\"(\"",
|
1113
|
+
"\")\"",
|
1114
|
+
"\",\"",
|
1044
1115
|
"\"%prec\"",
|
1116
|
+
"\"?\"",
|
1117
|
+
"\"+\"",
|
1118
|
+
"\"*\"",
|
1045
1119
|
"\"[\"",
|
1046
1120
|
"\"]\"",
|
1047
1121
|
"\"{...}\"",
|
@@ -1061,16 +1135,18 @@ Racc_token_to_s_table = [
|
|
1061
1135
|
"params",
|
1062
1136
|
"@3",
|
1063
1137
|
"@4",
|
1064
|
-
"symbol_declaration",
|
1065
|
-
"generic_symlist",
|
1066
1138
|
"@5",
|
1067
1139
|
"@6",
|
1140
|
+
"symbol_declaration",
|
1141
|
+
"generic_symlist",
|
1068
1142
|
"@7",
|
1069
1143
|
"@8",
|
1070
1144
|
"@9",
|
1071
1145
|
"@10",
|
1072
1146
|
"@11",
|
1073
1147
|
"@12",
|
1148
|
+
"@13",
|
1149
|
+
"@14",
|
1074
1150
|
"token_declarations",
|
1075
1151
|
"symbol_declarations",
|
1076
1152
|
"token_declarations_for_precedence",
|
@@ -1082,10 +1158,10 @@ Racc_token_to_s_table = [
|
|
1082
1158
|
"symbol_declaration_list",
|
1083
1159
|
"symbol",
|
1084
1160
|
"string_as_id",
|
1085
|
-
"@13",
|
1086
|
-
"@14",
|
1087
1161
|
"@15",
|
1088
1162
|
"@16",
|
1163
|
+
"@17",
|
1164
|
+
"@18",
|
1089
1165
|
"token_declaration_list_for_precedence",
|
1090
1166
|
"token_declaration_for_precedence",
|
1091
1167
|
"rules_or_grammar_declaration",
|
@@ -1094,15 +1170,14 @@ Racc_token_to_s_table = [
|
|
1094
1170
|
"named_ref_opt",
|
1095
1171
|
"rhs_list",
|
1096
1172
|
"rhs",
|
1097
|
-
"
|
1098
|
-
"@18",
|
1173
|
+
"parameterizing_suffix",
|
1099
1174
|
"@19",
|
1100
1175
|
"@20",
|
1101
1176
|
"@21",
|
1102
1177
|
"generic_symlist_item" ]
|
1103
1178
|
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
|
1104
1179
|
|
1105
|
-
Racc_debug_parser =
|
1180
|
+
Racc_debug_parser = true
|
1106
1181
|
|
1107
1182
|
##### State transition tables end #####
|
1108
1183
|
|
@@ -1114,26 +1189,24 @@ Racc_debug_parser = false
|
|
1114
1189
|
|
1115
1190
|
# reduce 3 omitted
|
1116
1191
|
|
1117
|
-
module_eval(<<'.,.,', 'parser.y',
|
1192
|
+
module_eval(<<'.,.,', 'parser.y', 14)
|
1118
1193
|
def _reduce_4(val, _values, result)
|
1119
|
-
|
1120
|
-
@lexer.end_symbol = '%}'
|
1194
|
+
begin_c_declaration("%}")
|
1121
1195
|
@grammar.prologue_first_lineno = @lexer.line
|
1122
1196
|
|
1123
1197
|
result
|
1124
1198
|
end
|
1125
1199
|
.,.,
|
1126
1200
|
|
1127
|
-
module_eval(<<'.,.,', 'parser.y',
|
1201
|
+
module_eval(<<'.,.,', 'parser.y', 19)
|
1128
1202
|
def _reduce_5(val, _values, result)
|
1129
|
-
|
1130
|
-
@lexer.end_symbol = nil
|
1203
|
+
end_c_declaration
|
1131
1204
|
|
1132
1205
|
result
|
1133
1206
|
end
|
1134
1207
|
.,.,
|
1135
1208
|
|
1136
|
-
module_eval(<<'.,.,', 'parser.y',
|
1209
|
+
module_eval(<<'.,.,', 'parser.y', 23)
|
1137
1210
|
def _reduce_6(val, _values, result)
|
1138
1211
|
@grammar.prologue = val[2].s_value
|
1139
1212
|
|
@@ -1143,7 +1216,7 @@ module_eval(<<'.,.,', 'parser.y', 21)
|
|
1143
1216
|
|
1144
1217
|
# reduce 7 omitted
|
1145
1218
|
|
1146
|
-
module_eval(<<'.,.,', 'parser.y',
|
1219
|
+
module_eval(<<'.,.,', 'parser.y', 27)
|
1147
1220
|
def _reduce_8(val, _values, result)
|
1148
1221
|
result = ""
|
1149
1222
|
result
|
@@ -1154,7 +1227,7 @@ module_eval(<<'.,.,', 'parser.y', 25)
|
|
1154
1227
|
|
1155
1228
|
# reduce 10 omitted
|
1156
1229
|
|
1157
|
-
module_eval(<<'.,.,', 'parser.y',
|
1230
|
+
module_eval(<<'.,.,', 'parser.y', 31)
|
1158
1231
|
def _reduce_11(val, _values, result)
|
1159
1232
|
@grammar.expect = val[1]
|
1160
1233
|
result
|
@@ -1167,22 +1240,20 @@ module_eval(<<'.,.,', 'parser.y', 29)
|
|
1167
1240
|
|
1168
1241
|
# reduce 14 omitted
|
1169
1242
|
|
1170
|
-
module_eval(<<'.,.,', 'parser.y',
|
1243
|
+
module_eval(<<'.,.,', 'parser.y', 37)
|
1171
1244
|
def _reduce_15(val, _values, result)
|
1172
1245
|
val[1].each {|token|
|
1173
|
-
|
1174
|
-
@grammar.lex_param = @grammar.build_code(:lex_param, token).token_code.s_value
|
1246
|
+
@grammar.lex_param = Grammar::Code::NoReferenceCode.new(type: :lex_param, token_code: token).token_code.s_value
|
1175
1247
|
}
|
1176
1248
|
|
1177
1249
|
result
|
1178
1250
|
end
|
1179
1251
|
.,.,
|
1180
1252
|
|
1181
|
-
module_eval(<<'.,.,', 'parser.y',
|
1253
|
+
module_eval(<<'.,.,', 'parser.y', 43)
|
1182
1254
|
def _reduce_16(val, _values, result)
|
1183
1255
|
val[1].each {|token|
|
1184
|
-
|
1185
|
-
@grammar.parse_param = @grammar.build_code(:parse_param, token).token_code.s_value
|
1256
|
+
@grammar.parse_param = Grammar::Code::NoReferenceCode.new(type: :parse_param, token_code: token).token_code.s_value
|
1186
1257
|
}
|
1187
1258
|
|
1188
1259
|
result
|
@@ -1191,73 +1262,76 @@ module_eval(<<'.,.,', 'parser.y', 42)
|
|
1191
1262
|
|
1192
1263
|
module_eval(<<'.,.,', 'parser.y', 49)
|
1193
1264
|
def _reduce_17(val, _values, result)
|
1194
|
-
|
1195
|
-
@lexer.end_symbol = '}'
|
1265
|
+
begin_c_declaration("}")
|
1196
1266
|
|
1197
1267
|
result
|
1198
1268
|
end
|
1199
1269
|
.,.,
|
1200
1270
|
|
1201
|
-
module_eval(<<'.,.,', 'parser.y',
|
1271
|
+
module_eval(<<'.,.,', 'parser.y', 53)
|
1202
1272
|
def _reduce_18(val, _values, result)
|
1203
|
-
|
1204
|
-
@lexer.end_symbol = nil
|
1273
|
+
end_c_declaration
|
1205
1274
|
|
1206
1275
|
result
|
1207
1276
|
end
|
1208
1277
|
.,.,
|
1209
1278
|
|
1210
|
-
module_eval(<<'.,.,', 'parser.y',
|
1279
|
+
module_eval(<<'.,.,', 'parser.y', 57)
|
1211
1280
|
def _reduce_19(val, _values, result)
|
1212
|
-
@grammar.
|
1281
|
+
@grammar.add_percent_code(id: val[1], code: val[4])
|
1213
1282
|
|
1214
1283
|
result
|
1215
1284
|
end
|
1216
1285
|
.,.,
|
1217
1286
|
|
1218
|
-
|
1287
|
+
module_eval(<<'.,.,', 'parser.y', 61)
|
1288
|
+
def _reduce_20(val, _values, result)
|
1289
|
+
begin_c_declaration("}")
|
1290
|
+
|
1291
|
+
result
|
1292
|
+
end
|
1293
|
+
.,.,
|
1219
1294
|
|
1220
1295
|
module_eval(<<'.,.,', 'parser.y', 65)
|
1221
1296
|
def _reduce_21(val, _values, result)
|
1222
|
-
|
1223
|
-
@lexer.end_symbol = '}'
|
1297
|
+
end_c_declaration
|
1224
1298
|
|
1225
1299
|
result
|
1226
1300
|
end
|
1227
1301
|
.,.,
|
1228
1302
|
|
1229
|
-
module_eval(<<'.,.,', 'parser.y',
|
1303
|
+
module_eval(<<'.,.,', 'parser.y', 69)
|
1230
1304
|
def _reduce_22(val, _values, result)
|
1231
|
-
|
1232
|
-
@lexer.end_symbol = nil
|
1305
|
+
@grammar.initial_action = Grammar::Code::InitialActionCode.new(type: :initial_action, token_code: val[3])
|
1233
1306
|
|
1234
1307
|
result
|
1235
1308
|
end
|
1236
1309
|
.,.,
|
1237
1310
|
|
1311
|
+
# reduce 23 omitted
|
1312
|
+
|
1238
1313
|
module_eval(<<'.,.,', 'parser.y', 75)
|
1239
|
-
def
|
1240
|
-
|
1314
|
+
def _reduce_24(val, _values, result)
|
1315
|
+
begin_c_declaration("}")
|
1241
1316
|
|
1242
1317
|
result
|
1243
1318
|
end
|
1244
1319
|
.,.,
|
1245
1320
|
|
1246
|
-
|
1247
|
-
|
1248
|
-
module_eval(<<'.,.,', 'parser.y', 80)
|
1321
|
+
module_eval(<<'.,.,', 'parser.y', 79)
|
1249
1322
|
def _reduce_25(val, _values, result)
|
1250
|
-
|
1251
|
-
@lexer.end_symbol = '}'
|
1323
|
+
end_c_declaration
|
1252
1324
|
|
1253
1325
|
result
|
1254
1326
|
end
|
1255
1327
|
.,.,
|
1256
1328
|
|
1257
|
-
module_eval(<<'.,.,', 'parser.y',
|
1329
|
+
module_eval(<<'.,.,', 'parser.y', 83)
|
1258
1330
|
def _reduce_26(val, _values, result)
|
1259
|
-
@
|
1260
|
-
|
1331
|
+
@grammar.set_union(
|
1332
|
+
Grammar::Code::NoReferenceCode.new(type: :union, token_code: val[3]),
|
1333
|
+
val[3].line
|
1334
|
+
)
|
1261
1335
|
|
1262
1336
|
result
|
1263
1337
|
end
|
@@ -1267,60 +1341,82 @@ module_eval(<<'.,.,', 'parser.y', 85)
|
|
1267
1341
|
|
1268
1342
|
module_eval(<<'.,.,', 'parser.y', 91)
|
1269
1343
|
def _reduce_28(val, _values, result)
|
1270
|
-
|
1271
|
-
@lexer.end_symbol = '}'
|
1344
|
+
begin_c_declaration("}")
|
1272
1345
|
|
1273
1346
|
result
|
1274
1347
|
end
|
1275
1348
|
.,.,
|
1276
1349
|
|
1277
|
-
module_eval(<<'.,.,', 'parser.y',
|
1350
|
+
module_eval(<<'.,.,', 'parser.y', 95)
|
1278
1351
|
def _reduce_29(val, _values, result)
|
1279
|
-
|
1280
|
-
@lexer.end_symbol = nil
|
1352
|
+
end_c_declaration
|
1281
1353
|
|
1282
1354
|
result
|
1283
1355
|
end
|
1284
1356
|
.,.,
|
1285
1357
|
|
1286
|
-
|
1287
|
-
def _reduce_30(val, _values, result)
|
1288
|
-
@grammar.add_printer(ident_or_tags: val[6], code: @grammar.build_code(:printer, val[3]), lineno: val[3].line)
|
1358
|
+
# reduce 30 omitted
|
1289
1359
|
|
1290
|
-
|
1291
|
-
end
|
1292
|
-
.,.,
|
1293
|
-
|
1294
|
-
module_eval(<<'.,.,', 'parser.y', 105)
|
1360
|
+
module_eval(<<'.,.,', 'parser.y', 100)
|
1295
1361
|
def _reduce_31(val, _values, result)
|
1296
|
-
|
1297
|
-
@lexer.end_symbol = '}'
|
1362
|
+
begin_c_declaration("}")
|
1298
1363
|
|
1299
1364
|
result
|
1300
1365
|
end
|
1301
1366
|
.,.,
|
1302
1367
|
|
1303
|
-
module_eval(<<'.,.,', 'parser.y',
|
1368
|
+
module_eval(<<'.,.,', 'parser.y', 104)
|
1304
1369
|
def _reduce_32(val, _values, result)
|
1305
|
-
|
1306
|
-
@lexer.end_symbol = nil
|
1370
|
+
end_c_declaration
|
1307
1371
|
|
1308
1372
|
result
|
1309
1373
|
end
|
1310
1374
|
.,.,
|
1311
1375
|
|
1312
|
-
module_eval(<<'.,.,', 'parser.y',
|
1376
|
+
module_eval(<<'.,.,', 'parser.y', 108)
|
1313
1377
|
def _reduce_33(val, _values, result)
|
1314
|
-
@grammar.
|
1378
|
+
@grammar.add_printer(
|
1379
|
+
ident_or_tags: val[6],
|
1380
|
+
token_code: val[3],
|
1381
|
+
lineno: val[3].line
|
1382
|
+
)
|
1315
1383
|
|
1316
1384
|
result
|
1317
1385
|
end
|
1318
1386
|
.,.,
|
1319
1387
|
|
1320
|
-
|
1388
|
+
module_eval(<<'.,.,', 'parser.y', 116)
|
1389
|
+
def _reduce_34(val, _values, result)
|
1390
|
+
begin_c_declaration("}")
|
1321
1391
|
|
1322
|
-
|
1392
|
+
result
|
1393
|
+
end
|
1394
|
+
.,.,
|
1395
|
+
|
1396
|
+
module_eval(<<'.,.,', 'parser.y', 120)
|
1323
1397
|
def _reduce_35(val, _values, result)
|
1398
|
+
end_c_declaration
|
1399
|
+
|
1400
|
+
result
|
1401
|
+
end
|
1402
|
+
.,.,
|
1403
|
+
|
1404
|
+
module_eval(<<'.,.,', 'parser.y', 124)
|
1405
|
+
def _reduce_36(val, _values, result)
|
1406
|
+
@grammar.add_error_token(
|
1407
|
+
ident_or_tags: val[6],
|
1408
|
+
token_code: val[3],
|
1409
|
+
lineno: val[3].line
|
1410
|
+
)
|
1411
|
+
|
1412
|
+
result
|
1413
|
+
end
|
1414
|
+
.,.,
|
1415
|
+
|
1416
|
+
# reduce 37 omitted
|
1417
|
+
|
1418
|
+
module_eval(<<'.,.,', 'parser.y', 134)
|
1419
|
+
def _reduce_38(val, _values, result)
|
1324
1420
|
val[1].each {|hash|
|
1325
1421
|
hash[:tokens].each {|id|
|
1326
1422
|
@grammar.add_type(id: id, tag: hash[:tag])
|
@@ -1331,8 +1427,8 @@ module_eval(<<'.,.,', 'parser.y', 121)
|
|
1331
1427
|
end
|
1332
1428
|
.,.,
|
1333
1429
|
|
1334
|
-
module_eval(<<'.,.,', 'parser.y',
|
1335
|
-
def
|
1430
|
+
module_eval(<<'.,.,', 'parser.y', 142)
|
1431
|
+
def _reduce_39(val, _values, result)
|
1336
1432
|
val[1].each {|hash|
|
1337
1433
|
hash[:tokens].each {|id|
|
1338
1434
|
sym = @grammar.add_term(id: id)
|
@@ -1345,8 +1441,8 @@ module_eval(<<'.,.,', 'parser.y', 129)
|
|
1345
1441
|
end
|
1346
1442
|
.,.,
|
1347
1443
|
|
1348
|
-
module_eval(<<'.,.,', 'parser.y',
|
1349
|
-
def
|
1444
|
+
module_eval(<<'.,.,', 'parser.y', 152)
|
1445
|
+
def _reduce_40(val, _values, result)
|
1350
1446
|
val[1].each {|hash|
|
1351
1447
|
hash[:tokens].each {|id|
|
1352
1448
|
sym = @grammar.add_term(id: id)
|
@@ -1359,8 +1455,8 @@ module_eval(<<'.,.,', 'parser.y', 139)
|
|
1359
1455
|
end
|
1360
1456
|
.,.,
|
1361
1457
|
|
1362
|
-
module_eval(<<'.,.,', 'parser.y',
|
1363
|
-
def
|
1458
|
+
module_eval(<<'.,.,', 'parser.y', 162)
|
1459
|
+
def _reduce_41(val, _values, result)
|
1364
1460
|
val[1].each {|hash|
|
1365
1461
|
hash[:tokens].each {|id|
|
1366
1462
|
sym = @grammar.add_term(id: id)
|
@@ -1373,8 +1469,8 @@ module_eval(<<'.,.,', 'parser.y', 149)
|
|
1373
1469
|
end
|
1374
1470
|
.,.,
|
1375
1471
|
|
1376
|
-
module_eval(<<'.,.,', 'parser.y',
|
1377
|
-
def
|
1472
|
+
module_eval(<<'.,.,', 'parser.y', 172)
|
1473
|
+
def _reduce_42(val, _values, result)
|
1378
1474
|
val[1].each {|hash|
|
1379
1475
|
hash[:tokens].each {|id|
|
1380
1476
|
sym = @grammar.add_term(id: id)
|
@@ -1387,8 +1483,8 @@ module_eval(<<'.,.,', 'parser.y', 159)
|
|
1387
1483
|
end
|
1388
1484
|
.,.,
|
1389
1485
|
|
1390
|
-
module_eval(<<'.,.,', 'parser.y',
|
1391
|
-
def
|
1486
|
+
module_eval(<<'.,.,', 'parser.y', 183)
|
1487
|
+
def _reduce_43(val, _values, result)
|
1392
1488
|
val[0].each {|token_declaration|
|
1393
1489
|
@grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: nil, replace: true)
|
1394
1490
|
}
|
@@ -1397,8 +1493,8 @@ module_eval(<<'.,.,', 'parser.y', 170)
|
|
1397
1493
|
end
|
1398
1494
|
.,.,
|
1399
1495
|
|
1400
|
-
module_eval(<<'.,.,', 'parser.y',
|
1401
|
-
def
|
1496
|
+
module_eval(<<'.,.,', 'parser.y', 189)
|
1497
|
+
def _reduce_44(val, _values, result)
|
1402
1498
|
val[1].each {|token_declaration|
|
1403
1499
|
@grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[0], replace: true)
|
1404
1500
|
}
|
@@ -1407,8 +1503,8 @@ module_eval(<<'.,.,', 'parser.y', 176)
|
|
1407
1503
|
end
|
1408
1504
|
.,.,
|
1409
1505
|
|
1410
|
-
module_eval(<<'.,.,', 'parser.y',
|
1411
|
-
def
|
1506
|
+
module_eval(<<'.,.,', 'parser.y', 195)
|
1507
|
+
def _reduce_45(val, _values, result)
|
1412
1508
|
val[2].each {|token_declaration|
|
1413
1509
|
@grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[1], replace: true)
|
1414
1510
|
}
|
@@ -1417,379 +1513,402 @@ module_eval(<<'.,.,', 'parser.y', 182)
|
|
1417
1513
|
end
|
1418
1514
|
.,.,
|
1419
1515
|
|
1420
|
-
module_eval(<<'.,.,', 'parser.y',
|
1421
|
-
def
|
1516
|
+
module_eval(<<'.,.,', 'parser.y', 200)
|
1517
|
+
def _reduce_46(val, _values, result)
|
1422
1518
|
result = [val[0]]
|
1423
1519
|
result
|
1424
1520
|
end
|
1425
1521
|
.,.,
|
1426
1522
|
|
1427
|
-
module_eval(<<'.,.,', 'parser.y',
|
1428
|
-
def
|
1523
|
+
module_eval(<<'.,.,', 'parser.y', 201)
|
1524
|
+
def _reduce_47(val, _values, result)
|
1429
1525
|
result = val[0].append(val[1])
|
1430
1526
|
result
|
1431
1527
|
end
|
1432
1528
|
.,.,
|
1433
1529
|
|
1434
|
-
module_eval(<<'.,.,', 'parser.y',
|
1435
|
-
def
|
1530
|
+
module_eval(<<'.,.,', 'parser.y', 203)
|
1531
|
+
def _reduce_48(val, _values, result)
|
1436
1532
|
result = val
|
1437
1533
|
result
|
1438
1534
|
end
|
1439
1535
|
.,.,
|
1440
1536
|
|
1441
|
-
# reduce
|
1537
|
+
# reduce 49 omitted
|
1442
1538
|
|
1443
|
-
# reduce
|
1539
|
+
# reduce 50 omitted
|
1444
1540
|
|
1445
|
-
# reduce
|
1541
|
+
# reduce 51 omitted
|
1446
1542
|
|
1447
|
-
# reduce
|
1543
|
+
# reduce 52 omitted
|
1448
1544
|
|
1449
|
-
module_eval(<<'.,.,', 'parser.y',
|
1450
|
-
def
|
1545
|
+
module_eval(<<'.,.,', 'parser.y', 213)
|
1546
|
+
def _reduce_53(val, _values, result)
|
1451
1547
|
result = [{tag: nil, tokens: val[0]}]
|
1452
1548
|
|
1453
1549
|
result
|
1454
1550
|
end
|
1455
1551
|
.,.,
|
1456
1552
|
|
1457
|
-
module_eval(<<'.,.,', 'parser.y',
|
1458
|
-
def
|
1553
|
+
module_eval(<<'.,.,', 'parser.y', 217)
|
1554
|
+
def _reduce_54(val, _values, result)
|
1459
1555
|
result = [{tag: val[0], tokens: val[1]}]
|
1460
1556
|
|
1461
1557
|
result
|
1462
1558
|
end
|
1463
1559
|
.,.,
|
1464
1560
|
|
1465
|
-
module_eval(<<'.,.,', 'parser.y',
|
1466
|
-
def
|
1561
|
+
module_eval(<<'.,.,', 'parser.y', 221)
|
1562
|
+
def _reduce_55(val, _values, result)
|
1467
1563
|
result = val[0].append({tag: val[1], tokens: val[2]})
|
1468
1564
|
|
1469
1565
|
result
|
1470
1566
|
end
|
1471
1567
|
.,.,
|
1472
1568
|
|
1473
|
-
module_eval(<<'.,.,', 'parser.y',
|
1474
|
-
def
|
1569
|
+
module_eval(<<'.,.,', 'parser.y', 224)
|
1570
|
+
def _reduce_56(val, _values, result)
|
1475
1571
|
result = [val[0]]
|
1476
1572
|
result
|
1477
1573
|
end
|
1478
1574
|
.,.,
|
1479
1575
|
|
1480
|
-
module_eval(<<'.,.,', 'parser.y',
|
1481
|
-
def
|
1576
|
+
module_eval(<<'.,.,', 'parser.y', 225)
|
1577
|
+
def _reduce_57(val, _values, result)
|
1482
1578
|
result = val[0].append(val[1])
|
1483
1579
|
result
|
1484
1580
|
end
|
1485
1581
|
.,.,
|
1486
1582
|
|
1487
|
-
# reduce
|
1583
|
+
# reduce 58 omitted
|
1488
1584
|
|
1489
|
-
# reduce
|
1585
|
+
# reduce 59 omitted
|
1490
1586
|
|
1491
|
-
module_eval(<<'.,.,', 'parser.y',
|
1492
|
-
def
|
1493
|
-
|
1494
|
-
@lexer.end_symbol = '}'
|
1587
|
+
module_eval(<<'.,.,', 'parser.y', 232)
|
1588
|
+
def _reduce_60(val, _values, result)
|
1589
|
+
begin_c_declaration("}")
|
1495
1590
|
|
1496
1591
|
result
|
1497
1592
|
end
|
1498
1593
|
.,.,
|
1499
1594
|
|
1500
|
-
module_eval(<<'.,.,', 'parser.y',
|
1501
|
-
def
|
1502
|
-
|
1503
|
-
@lexer.end_symbol = nil
|
1595
|
+
module_eval(<<'.,.,', 'parser.y', 236)
|
1596
|
+
def _reduce_61(val, _values, result)
|
1597
|
+
end_c_declaration
|
1504
1598
|
|
1505
1599
|
result
|
1506
1600
|
end
|
1507
1601
|
.,.,
|
1508
1602
|
|
1509
|
-
module_eval(<<'.,.,', 'parser.y',
|
1510
|
-
def
|
1603
|
+
module_eval(<<'.,.,', 'parser.y', 240)
|
1604
|
+
def _reduce_62(val, _values, result)
|
1511
1605
|
result = val[0].append(val[3])
|
1512
1606
|
|
1513
1607
|
result
|
1514
1608
|
end
|
1515
1609
|
.,.,
|
1516
1610
|
|
1517
|
-
module_eval(<<'.,.,', 'parser.y',
|
1518
|
-
def
|
1519
|
-
|
1520
|
-
@lexer.end_symbol = '}'
|
1611
|
+
module_eval(<<'.,.,', 'parser.y', 244)
|
1612
|
+
def _reduce_63(val, _values, result)
|
1613
|
+
begin_c_declaration("}")
|
1521
1614
|
|
1522
1615
|
result
|
1523
1616
|
end
|
1524
1617
|
.,.,
|
1525
1618
|
|
1526
|
-
module_eval(<<'.,.,', 'parser.y',
|
1527
|
-
def
|
1528
|
-
|
1529
|
-
@lexer.end_symbol = nil
|
1619
|
+
module_eval(<<'.,.,', 'parser.y', 248)
|
1620
|
+
def _reduce_64(val, _values, result)
|
1621
|
+
end_c_declaration
|
1530
1622
|
|
1531
1623
|
result
|
1532
1624
|
end
|
1533
1625
|
.,.,
|
1534
1626
|
|
1535
|
-
module_eval(<<'.,.,', 'parser.y',
|
1536
|
-
def
|
1627
|
+
module_eval(<<'.,.,', 'parser.y', 252)
|
1628
|
+
def _reduce_65(val, _values, result)
|
1537
1629
|
result = [val[2]]
|
1538
1630
|
|
1539
1631
|
result
|
1540
1632
|
end
|
1541
1633
|
.,.,
|
1542
1634
|
|
1543
|
-
module_eval(<<'.,.,', 'parser.y',
|
1544
|
-
def
|
1635
|
+
module_eval(<<'.,.,', 'parser.y', 257)
|
1636
|
+
def _reduce_66(val, _values, result)
|
1545
1637
|
result = [{tag: nil, tokens: val[0]}]
|
1546
1638
|
|
1547
1639
|
result
|
1548
1640
|
end
|
1549
1641
|
.,.,
|
1550
1642
|
|
1551
|
-
module_eval(<<'.,.,', 'parser.y',
|
1552
|
-
def
|
1643
|
+
module_eval(<<'.,.,', 'parser.y', 261)
|
1644
|
+
def _reduce_67(val, _values, result)
|
1553
1645
|
result = [{tag: val[0], tokens: val[1]}]
|
1554
1646
|
|
1555
1647
|
result
|
1556
1648
|
end
|
1557
1649
|
.,.,
|
1558
1650
|
|
1559
|
-
module_eval(<<'.,.,', 'parser.y',
|
1560
|
-
def
|
1561
|
-
result = val[0].append({tag:
|
1651
|
+
module_eval(<<'.,.,', 'parser.y', 265)
|
1652
|
+
def _reduce_68(val, _values, result)
|
1653
|
+
result = val[0].append({tag: val[1], tokens: val[2]})
|
1562
1654
|
|
1563
1655
|
result
|
1564
1656
|
end
|
1565
1657
|
.,.,
|
1566
1658
|
|
1567
|
-
module_eval(<<'.,.,', 'parser.y',
|
1568
|
-
def
|
1659
|
+
module_eval(<<'.,.,', 'parser.y', 268)
|
1660
|
+
def _reduce_69(val, _values, result)
|
1569
1661
|
result = [val[0]]
|
1570
1662
|
result
|
1571
1663
|
end
|
1572
1664
|
.,.,
|
1573
1665
|
|
1574
|
-
module_eval(<<'.,.,', 'parser.y',
|
1575
|
-
def
|
1666
|
+
module_eval(<<'.,.,', 'parser.y', 269)
|
1667
|
+
def _reduce_70(val, _values, result)
|
1576
1668
|
result = val[0].append(val[1])
|
1577
1669
|
result
|
1578
1670
|
end
|
1579
1671
|
.,.,
|
1580
1672
|
|
1581
|
-
# reduce
|
1673
|
+
# reduce 71 omitted
|
1582
1674
|
|
1583
|
-
module_eval(<<'.,.,', 'parser.y',
|
1584
|
-
def
|
1585
|
-
|
1675
|
+
module_eval(<<'.,.,', 'parser.y', 273)
|
1676
|
+
def _reduce_72(val, _values, result)
|
1677
|
+
on_action_error("ident after %prec", val[0]) if @prec_seen
|
1586
1678
|
result
|
1587
1679
|
end
|
1588
1680
|
.,.,
|
1589
1681
|
|
1590
|
-
module_eval(<<'.,.,', 'parser.y',
|
1591
|
-
def
|
1592
|
-
|
1682
|
+
module_eval(<<'.,.,', 'parser.y', 274)
|
1683
|
+
def _reduce_73(val, _values, result)
|
1684
|
+
on_action_error("char after %prec", val[0]) if @prec_seen
|
1593
1685
|
result
|
1594
1686
|
end
|
1595
1687
|
.,.,
|
1596
1688
|
|
1597
|
-
# reduce
|
1689
|
+
# reduce 74 omitted
|
1598
1690
|
|
1599
|
-
# reduce
|
1691
|
+
# reduce 75 omitted
|
1600
1692
|
|
1601
|
-
# reduce
|
1693
|
+
# reduce 76 omitted
|
1602
1694
|
|
1603
|
-
# reduce
|
1695
|
+
# reduce 77 omitted
|
1604
1696
|
|
1605
|
-
module_eval(<<'.,.,', 'parser.y',
|
1606
|
-
def
|
1697
|
+
module_eval(<<'.,.,', 'parser.y', 284)
|
1698
|
+
def _reduce_78(val, _values, result)
|
1607
1699
|
lhs = val[0]
|
1608
|
-
lhs.
|
1609
|
-
val[3].each
|
1610
|
-
|
1611
|
-
|
1700
|
+
lhs.alias_name = val[1]
|
1701
|
+
val[3].each do |builder|
|
1702
|
+
builder.lhs = lhs
|
1703
|
+
builder.complete_input
|
1704
|
+
@grammar.add_rule_builder(builder)
|
1705
|
+
end
|
1612
1706
|
|
1613
1707
|
result
|
1614
1708
|
end
|
1615
1709
|
.,.,
|
1616
1710
|
|
1617
|
-
module_eval(<<'.,.,', 'parser.y',
|
1618
|
-
def
|
1619
|
-
|
1711
|
+
module_eval(<<'.,.,', 'parser.y', 295)
|
1712
|
+
def _reduce_79(val, _values, result)
|
1713
|
+
builder = val[0]
|
1714
|
+
if !builder.line
|
1715
|
+
builder.line = @lexer.line - 1
|
1716
|
+
end
|
1717
|
+
result = [builder]
|
1620
1718
|
|
1621
1719
|
result
|
1622
1720
|
end
|
1623
1721
|
.,.,
|
1624
1722
|
|
1625
|
-
module_eval(<<'.,.,', 'parser.y',
|
1626
|
-
def
|
1627
|
-
|
1723
|
+
module_eval(<<'.,.,', 'parser.y', 303)
|
1724
|
+
def _reduce_80(val, _values, result)
|
1725
|
+
builder = val[2]
|
1726
|
+
if !builder.line
|
1727
|
+
builder.line = @lexer.line - 1
|
1728
|
+
end
|
1729
|
+
result = val[0].append(builder)
|
1628
1730
|
|
1629
1731
|
result
|
1630
1732
|
end
|
1631
1733
|
.,.,
|
1632
1734
|
|
1633
|
-
# reduce
|
1735
|
+
# reduce 81 omitted
|
1634
1736
|
|
1635
|
-
module_eval(<<'.,.,', 'parser.y',
|
1636
|
-
def
|
1637
|
-
|
1638
|
-
|
1639
|
-
@code_after_prec = false
|
1737
|
+
module_eval(<<'.,.,', 'parser.y', 313)
|
1738
|
+
def _reduce_82(val, _values, result)
|
1739
|
+
reset_precs
|
1740
|
+
result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)
|
1640
1741
|
|
1641
1742
|
result
|
1642
1743
|
end
|
1643
1744
|
.,.,
|
1644
1745
|
|
1645
|
-
module_eval(<<'.,.,', 'parser.y',
|
1646
|
-
def
|
1746
|
+
module_eval(<<'.,.,', 'parser.y', 318)
|
1747
|
+
def _reduce_83(val, _values, result)
|
1748
|
+
reset_precs
|
1749
|
+
result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)
|
1750
|
+
|
1751
|
+
result
|
1752
|
+
end
|
1753
|
+
.,.,
|
1754
|
+
|
1755
|
+
module_eval(<<'.,.,', 'parser.y', 323)
|
1756
|
+
def _reduce_84(val, _values, result)
|
1647
1757
|
token = val[1]
|
1648
|
-
token.
|
1649
|
-
|
1758
|
+
token.alias_name = val[2]
|
1759
|
+
builder = val[0]
|
1760
|
+
builder.add_rhs(token)
|
1761
|
+
result = builder
|
1650
1762
|
|
1651
1763
|
result
|
1652
1764
|
end
|
1653
1765
|
.,.,
|
1654
1766
|
|
1655
|
-
module_eval(<<'.,.,', 'parser.y',
|
1656
|
-
def
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
@lexer.status = :c_declaration
|
1662
|
-
@lexer.end_symbol = '}'
|
1767
|
+
module_eval(<<'.,.,', 'parser.y', 331)
|
1768
|
+
def _reduce_85(val, _values, result)
|
1769
|
+
token = Lrama::Lexer::Token::Parameterizing.new(s_value: val[2], location: @lexer.location, args: [val[1]])
|
1770
|
+
builder = val[0]
|
1771
|
+
builder.add_rhs(token)
|
1772
|
+
result = builder
|
1663
1773
|
|
1664
1774
|
result
|
1665
1775
|
end
|
1666
1776
|
.,.,
|
1667
1777
|
|
1668
|
-
module_eval(<<'.,.,', 'parser.y',
|
1669
|
-
def
|
1670
|
-
@lexer.
|
1671
|
-
|
1778
|
+
module_eval(<<'.,.,', 'parser.y', 338)
|
1779
|
+
def _reduce_86(val, _values, result)
|
1780
|
+
token = Lrama::Lexer::Token::Parameterizing.new(s_value: val[1].s_value, location: @lexer.location, args: [val[3]])
|
1781
|
+
builder = val[0]
|
1782
|
+
builder.add_rhs(token)
|
1783
|
+
result = builder
|
1672
1784
|
|
1673
1785
|
result
|
1674
1786
|
end
|
1675
1787
|
.,.,
|
1676
1788
|
|
1677
|
-
module_eval(<<'.,.,', 'parser.y',
|
1678
|
-
def
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1789
|
+
module_eval(<<'.,.,', 'parser.y', 345)
|
1790
|
+
def _reduce_87(val, _values, result)
|
1791
|
+
token = Lrama::Lexer::Token::Parameterizing.new(s_value: val[1].s_value, location: @lexer.location, args: [val[3], val[5]])
|
1792
|
+
builder = val[0]
|
1793
|
+
builder.add_rhs(token)
|
1794
|
+
result = builder
|
1682
1795
|
|
1683
1796
|
result
|
1684
1797
|
end
|
1685
1798
|
.,.,
|
1686
1799
|
|
1687
|
-
module_eval(<<'.,.,', 'parser.y',
|
1688
|
-
def
|
1800
|
+
module_eval(<<'.,.,', 'parser.y', 352)
|
1801
|
+
def _reduce_88(val, _values, result)
|
1689
1802
|
if @prec_seen
|
1690
|
-
|
1803
|
+
on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec
|
1691
1804
|
@code_after_prec = true
|
1692
1805
|
end
|
1693
|
-
|
1694
|
-
@lexer.end_symbol = '}'
|
1806
|
+
begin_c_declaration("}")
|
1695
1807
|
|
1696
1808
|
result
|
1697
1809
|
end
|
1698
1810
|
.,.,
|
1699
1811
|
|
1700
|
-
module_eval(<<'.,.,', 'parser.y',
|
1701
|
-
def
|
1702
|
-
|
1703
|
-
@lexer.end_symbol = nil
|
1812
|
+
module_eval(<<'.,.,', 'parser.y', 360)
|
1813
|
+
def _reduce_89(val, _values, result)
|
1814
|
+
end_c_declaration
|
1704
1815
|
|
1705
1816
|
result
|
1706
1817
|
end
|
1707
1818
|
.,.,
|
1708
1819
|
|
1709
|
-
module_eval(<<'.,.,', 'parser.y',
|
1710
|
-
def
|
1711
|
-
token = val[
|
1712
|
-
token.
|
1713
|
-
|
1820
|
+
module_eval(<<'.,.,', 'parser.y', 364)
|
1821
|
+
def _reduce_90(val, _values, result)
|
1822
|
+
token = val[3]
|
1823
|
+
token.alias_name = val[6]
|
1824
|
+
builder = val[0]
|
1825
|
+
builder.user_code = token
|
1826
|
+
result = builder
|
1714
1827
|
|
1715
1828
|
result
|
1716
1829
|
end
|
1717
1830
|
.,.,
|
1718
1831
|
|
1719
|
-
module_eval(<<'.,.,', 'parser.y',
|
1720
|
-
def
|
1832
|
+
module_eval(<<'.,.,', 'parser.y', 372)
|
1833
|
+
def _reduce_91(val, _values, result)
|
1721
1834
|
sym = @grammar.find_symbol_by_id!(val[2])
|
1722
|
-
result = val[0].append(sym)
|
1723
1835
|
@prec_seen = true
|
1836
|
+
builder = val[0]
|
1837
|
+
builder.precedence_sym = sym
|
1838
|
+
result = builder
|
1724
1839
|
|
1725
1840
|
result
|
1726
1841
|
end
|
1727
1842
|
.,.,
|
1728
1843
|
|
1729
|
-
# reduce
|
1844
|
+
# reduce 92 omitted
|
1730
1845
|
|
1731
|
-
|
1732
|
-
|
1846
|
+
# reduce 93 omitted
|
1847
|
+
|
1848
|
+
# reduce 94 omitted
|
1849
|
+
|
1850
|
+
# reduce 95 omitted
|
1851
|
+
|
1852
|
+
module_eval(<<'.,.,', 'parser.y', 384)
|
1853
|
+
def _reduce_96(val, _values, result)
|
1733
1854
|
result = val[1].s_value
|
1734
1855
|
result
|
1735
1856
|
end
|
1736
1857
|
.,.,
|
1737
1858
|
|
1738
|
-
# reduce
|
1859
|
+
# reduce 97 omitted
|
1739
1860
|
|
1740
|
-
# reduce
|
1861
|
+
# reduce 98 omitted
|
1741
1862
|
|
1742
|
-
module_eval(<<'.,.,', 'parser.y',
|
1743
|
-
def
|
1744
|
-
|
1745
|
-
@lexer.end_symbol = '\Z'
|
1863
|
+
module_eval(<<'.,.,', 'parser.y', 391)
|
1864
|
+
def _reduce_99(val, _values, result)
|
1865
|
+
begin_c_declaration('\Z')
|
1746
1866
|
@grammar.epilogue_first_lineno = @lexer.line + 1
|
1747
1867
|
|
1748
1868
|
result
|
1749
1869
|
end
|
1750
1870
|
.,.,
|
1751
1871
|
|
1752
|
-
module_eval(<<'.,.,', 'parser.y',
|
1753
|
-
def
|
1754
|
-
|
1755
|
-
@lexer.end_symbol = nil
|
1872
|
+
module_eval(<<'.,.,', 'parser.y', 396)
|
1873
|
+
def _reduce_100(val, _values, result)
|
1874
|
+
end_c_declaration
|
1756
1875
|
@grammar.epilogue = val[2].s_value
|
1757
1876
|
|
1758
1877
|
result
|
1759
1878
|
end
|
1760
1879
|
.,.,
|
1761
1880
|
|
1762
|
-
# reduce
|
1881
|
+
# reduce 101 omitted
|
1763
1882
|
|
1764
|
-
# reduce
|
1883
|
+
# reduce 102 omitted
|
1765
1884
|
|
1766
|
-
# reduce
|
1885
|
+
# reduce 103 omitted
|
1767
1886
|
|
1768
|
-
# reduce
|
1887
|
+
# reduce 104 omitted
|
1769
1888
|
|
1770
|
-
# reduce
|
1889
|
+
# reduce 105 omitted
|
1771
1890
|
|
1772
|
-
module_eval(<<'.,.,', 'parser.y',
|
1773
|
-
def
|
1891
|
+
module_eval(<<'.,.,', 'parser.y', 407)
|
1892
|
+
def _reduce_106(val, _values, result)
|
1774
1893
|
result = [val[0]]
|
1775
1894
|
result
|
1776
1895
|
end
|
1777
1896
|
.,.,
|
1778
1897
|
|
1779
|
-
module_eval(<<'.,.,', 'parser.y',
|
1780
|
-
def
|
1898
|
+
module_eval(<<'.,.,', 'parser.y', 408)
|
1899
|
+
def _reduce_107(val, _values, result)
|
1781
1900
|
result = val[0].append(val[1])
|
1782
1901
|
result
|
1783
1902
|
end
|
1784
1903
|
.,.,
|
1785
1904
|
|
1786
|
-
# reduce
|
1905
|
+
# reduce 108 omitted
|
1787
1906
|
|
1788
|
-
# reduce
|
1907
|
+
# reduce 109 omitted
|
1789
1908
|
|
1790
|
-
module_eval(<<'.,.,', 'parser.y',
|
1791
|
-
def
|
1792
|
-
result = Lrama::Lexer::Token.new(
|
1909
|
+
module_eval(<<'.,.,', 'parser.y', 413)
|
1910
|
+
def _reduce_110(val, _values, result)
|
1911
|
+
result = Lrama::Lexer::Token::Ident.new(s_value: val[0])
|
1793
1912
|
result
|
1794
1913
|
end
|
1795
1914
|
.,.,
|