lrama 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +2 -0
- data/.github/workflows/codespell.yaml +1 -1
- data/.github/workflows/gh-pages.yml +5 -6
- data/.github/workflows/test.yaml +25 -14
- data/Gemfile +4 -3
- data/NEWS.md +370 -35
- data/README.md +7 -88
- data/Rakefile +3 -2
- data/Steepfile +11 -5
- data/doc/Index.md +1 -1
- data/doc/development/compressed_state_table/parser.rb +2 -0
- data/doc/development/profiling.md +44 -0
- data/exe/lrama +1 -1
- data/lib/lrama/bitmap.rb +18 -5
- data/lib/lrama/command.rb +95 -43
- data/lib/lrama/context.rb +22 -24
- data/lib/lrama/counterexamples/derivation.rb +14 -4
- data/lib/lrama/counterexamples/example.rb +47 -22
- data/lib/lrama/counterexamples/node.rb +30 -0
- data/lib/lrama/counterexamples/path.rb +12 -14
- data/lib/lrama/counterexamples/state_item.rb +24 -1
- data/lib/lrama/counterexamples/triple.rb +27 -9
- data/lib/lrama/counterexamples.rb +216 -88
- data/lib/lrama/diagram.rb +77 -0
- data/lib/lrama/digraph.rb +28 -7
- data/lib/lrama/erb.rb +29 -0
- data/lib/lrama/grammar/auxiliary.rb +6 -1
- data/lib/lrama/grammar/binding.rb +37 -25
- data/lib/lrama/grammar/code/destructor_code.rb +11 -0
- data/lib/lrama/grammar/code/initial_action_code.rb +3 -0
- data/lib/lrama/grammar/code/no_reference_code.rb +3 -0
- data/lib/lrama/grammar/code/printer_code.rb +11 -0
- data/lib/lrama/grammar/code/rule_action.rb +17 -0
- data/lib/lrama/grammar/code.rb +16 -1
- data/lib/lrama/grammar/counter.rb +10 -0
- data/lib/lrama/grammar/destructor.rb +14 -1
- data/lib/lrama/grammar/error_token.rb +14 -1
- data/lib/lrama/grammar/inline/resolver.rb +80 -0
- data/lib/lrama/grammar/inline.rb +3 -0
- data/lib/lrama/grammar/{parameterizing_rule → parameterized}/resolver.rb +19 -8
- data/lib/lrama/grammar/{parameterizing_rule → parameterized}/rhs.rb +7 -2
- data/lib/lrama/grammar/parameterized/rule.rb +36 -0
- data/lib/lrama/grammar/parameterized.rb +5 -0
- data/lib/lrama/grammar/percent_code.rb +12 -1
- data/lib/lrama/grammar/precedence.rb +43 -1
- data/lib/lrama/grammar/printer.rb +9 -0
- data/lib/lrama/grammar/reference.rb +13 -0
- data/lib/lrama/grammar/rule.rb +61 -1
- data/lib/lrama/grammar/rule_builder.rb +84 -69
- data/lib/lrama/grammar/stdlib.y +68 -48
- data/lib/lrama/grammar/symbol.rb +63 -19
- data/lib/lrama/grammar/symbols/resolver.rb +64 -3
- data/lib/lrama/grammar/type.rb +13 -1
- data/lib/lrama/grammar/union.rb +12 -1
- data/lib/lrama/grammar.rb +231 -35
- data/lib/lrama/lexer/location.rb +25 -8
- data/lib/lrama/lexer/token/base.rb +73 -0
- data/lib/lrama/lexer/token/char.rb +15 -2
- data/lib/lrama/lexer/token/empty.rb +14 -0
- data/lib/lrama/lexer/token/ident.rb +2 -2
- data/lib/lrama/lexer/token/instantiate_rule.rb +4 -4
- data/lib/lrama/lexer/token/int.rb +14 -0
- data/lib/lrama/lexer/token/str.rb +11 -0
- data/lib/lrama/lexer/token/tag.rb +2 -2
- data/lib/lrama/lexer/token/token.rb +11 -0
- data/lib/lrama/lexer/token/user_code.rb +63 -37
- data/lib/lrama/lexer/token.rb +6 -56
- data/lib/lrama/lexer.rb +51 -23
- data/lib/lrama/logger.rb +12 -2
- data/lib/lrama/option_parser.rb +63 -9
- data/lib/lrama/options.rb +25 -7
- data/lib/lrama/output.rb +4 -11
- data/lib/lrama/parser.rb +854 -723
- data/lib/lrama/reporter/conflicts.rb +44 -0
- data/lib/lrama/reporter/grammar.rb +39 -0
- data/lib/lrama/reporter/precedences.rb +54 -0
- data/lib/lrama/reporter/profile/call_stack.rb +45 -0
- data/lib/lrama/reporter/profile/memory.rb +44 -0
- data/lib/lrama/reporter/profile.rb +4 -0
- data/lib/lrama/reporter/rules.rb +43 -0
- data/lib/lrama/reporter/states.rb +387 -0
- data/lib/lrama/reporter/terms.rb +44 -0
- data/lib/lrama/reporter.rb +39 -0
- data/lib/lrama/state/action/goto.rb +33 -0
- data/lib/lrama/state/action/reduce.rb +71 -0
- data/lib/lrama/state/action/shift.rb +39 -0
- data/lib/lrama/state/action.rb +5 -0
- data/lib/lrama/state/inadequacy_annotation.rb +140 -0
- data/lib/lrama/{states → state}/item.rb +33 -4
- data/lib/lrama/state/reduce_reduce_conflict.rb +14 -1
- data/lib/lrama/state/resolved_conflict.rb +38 -4
- data/lib/lrama/state/shift_reduce_conflict.rb +14 -1
- data/lib/lrama/state.rb +301 -200
- data/lib/lrama/states.rb +447 -175
- data/lib/lrama/tracer/actions.rb +22 -0
- data/lib/lrama/tracer/closure.rb +30 -0
- data/lib/lrama/tracer/duration.rb +38 -0
- data/lib/lrama/tracer/only_explicit_rules.rb +24 -0
- data/lib/lrama/tracer/rules.rb +23 -0
- data/lib/lrama/tracer/state.rb +33 -0
- data/lib/lrama/tracer.rb +51 -0
- data/lib/lrama/version.rb +2 -1
- data/lib/lrama/warnings/conflicts.rb +27 -0
- data/lib/lrama/warnings/implicit_empty.rb +29 -0
- data/lib/lrama/warnings/name_conflicts.rb +63 -0
- data/lib/lrama/warnings/redefined_rules.rb +23 -0
- data/lib/lrama/warnings/required.rb +23 -0
- data/lib/lrama/warnings/useless_precedence.rb +25 -0
- data/lib/lrama/warnings.rb +33 -0
- data/lib/lrama.rb +5 -5
- data/parser.y +495 -404
- data/rbs_collection.lock.yaml +27 -3
- data/rbs_collection.yaml +2 -0
- data/sig/generated/lrama/bitmap.rbs +12 -4
- data/sig/generated/lrama/counterexamples/derivation.rbs +36 -0
- data/sig/generated/lrama/counterexamples/example.rbs +58 -0
- data/sig/generated/lrama/counterexamples/node.rbs +18 -0
- data/sig/generated/lrama/counterexamples/path.rbs +23 -0
- data/sig/generated/lrama/counterexamples/state_item.rbs +19 -0
- data/sig/generated/lrama/counterexamples/triple.rbs +32 -0
- data/sig/generated/lrama/counterexamples.rbs +98 -0
- data/sig/generated/lrama/diagram.rbs +34 -0
- data/sig/generated/lrama/digraph.rbs +26 -6
- data/sig/generated/lrama/erb.rbs +14 -0
- data/sig/generated/lrama/grammar/auxiliary.rbs +16 -0
- data/sig/generated/lrama/grammar/binding.rbs +18 -12
- data/sig/generated/lrama/grammar/code/destructor_code.rbs +26 -0
- data/sig/{lrama → generated/lrama}/grammar/code/initial_action_code.rbs +6 -0
- data/sig/{lrama → generated/lrama}/grammar/code/no_reference_code.rbs +6 -0
- data/sig/generated/lrama/grammar/code/printer_code.rbs +26 -0
- data/sig/generated/lrama/grammar/code/rule_action.rbs +63 -0
- data/sig/generated/lrama/grammar/code.rbs +38 -0
- data/sig/{lrama → generated/lrama}/grammar/counter.rbs +4 -0
- data/sig/generated/lrama/grammar/destructor.rbs +19 -0
- data/sig/generated/lrama/grammar/error_token.rbs +19 -0
- data/sig/generated/lrama/grammar/inline/resolver.rbs +26 -0
- data/sig/generated/lrama/grammar/parameterized/resolver.rbs +42 -0
- data/sig/generated/lrama/grammar/parameterized/rhs.rbs +21 -0
- data/sig/generated/lrama/grammar/parameterized/rule.rbs +28 -0
- data/sig/{lrama → generated/lrama}/grammar/percent_code.rbs +8 -0
- data/sig/generated/lrama/grammar/precedence.rbs +45 -0
- data/sig/{lrama/grammar/error_token.rbs → generated/lrama/grammar/printer.rbs} +8 -3
- data/sig/generated/lrama/grammar/reference.rbs +31 -0
- data/sig/generated/lrama/grammar/rule.rbs +83 -0
- data/sig/generated/lrama/grammar/rule_builder.rbs +91 -0
- data/sig/generated/lrama/grammar/symbol.rbs +89 -0
- data/sig/generated/lrama/grammar/symbols/resolver.rbs +131 -0
- data/sig/generated/lrama/grammar/type.rbs +21 -0
- data/sig/generated/lrama/grammar/union.rbs +17 -0
- data/sig/generated/lrama/grammar.rbs +289 -0
- data/sig/generated/lrama/lexer/location.rbs +12 -3
- data/sig/generated/lrama/lexer/token/base.rbs +53 -0
- data/sig/generated/lrama/lexer/token/char.rbs +9 -2
- data/sig/generated/lrama/lexer/token/empty.rbs +11 -0
- data/sig/generated/lrama/lexer/token/ident.rbs +2 -2
- data/sig/generated/lrama/lexer/token/instantiate_rule.rbs +5 -5
- data/sig/generated/lrama/lexer/token/int.rbs +13 -0
- data/sig/generated/lrama/lexer/token/str.rbs +10 -0
- data/sig/generated/lrama/lexer/token/tag.rbs +2 -2
- data/sig/generated/lrama/lexer/token/token.rbs +10 -0
- data/sig/generated/lrama/lexer/token/user_code.rbs +2 -2
- data/sig/generated/lrama/lexer/token.rbs +1 -39
- data/sig/generated/lrama/lexer.rbs +54 -0
- data/sig/generated/lrama/logger.rbs +6 -0
- data/sig/generated/lrama/option_parser.rbs +52 -0
- data/sig/{lrama → generated/lrama}/options.rbs +27 -3
- data/sig/generated/lrama/reporter/conflicts.rbs +18 -0
- data/sig/generated/lrama/reporter/grammar.rbs +13 -0
- data/sig/generated/lrama/reporter/precedences.rbs +15 -0
- data/sig/generated/lrama/reporter/profile/call_stack.rbs +19 -0
- data/sig/generated/lrama/reporter/profile/memory.rbs +19 -0
- data/sig/generated/lrama/reporter/rules.rbs +13 -0
- data/sig/generated/lrama/reporter/states.rbs +69 -0
- data/sig/generated/lrama/reporter/terms.rbs +13 -0
- data/sig/generated/lrama/reporter.rbs +13 -0
- data/sig/generated/lrama/state/action/goto.rbs +28 -0
- data/sig/generated/lrama/state/action/reduce.rbs +49 -0
- data/sig/generated/lrama/state/action/shift.rbs +33 -0
- data/sig/generated/lrama/state/inadequacy_annotation.rbs +45 -0
- data/sig/generated/lrama/state/item.rbs +75 -0
- data/sig/generated/lrama/state/reduce_reduce_conflict.rbs +19 -0
- data/sig/generated/lrama/state/resolved_conflict.rbs +38 -0
- data/sig/generated/lrama/state/shift_reduce_conflict.rbs +19 -0
- data/sig/generated/lrama/state.rbs +231 -0
- data/sig/generated/lrama/states.rbs +215 -0
- data/sig/generated/lrama/tracer/actions.rbs +13 -0
- data/sig/generated/lrama/tracer/closure.rbs +13 -0
- data/sig/generated/lrama/tracer/duration.rbs +18 -0
- data/sig/generated/lrama/tracer/only_explicit_rules.rbs +13 -0
- data/sig/generated/lrama/tracer/rules.rbs +13 -0
- data/sig/generated/lrama/tracer/state.rbs +16 -0
- data/sig/generated/lrama/tracer.rbs +23 -0
- data/sig/generated/lrama/version.rbs +5 -0
- data/sig/generated/lrama/warnings/conflicts.rbs +13 -0
- data/sig/generated/lrama/warnings/implicit_empty.rbs +17 -0
- data/sig/generated/lrama/warnings/name_conflicts.rbs +31 -0
- data/sig/generated/lrama/warnings/redefined_rules.rbs +13 -0
- data/sig/generated/lrama/warnings/required.rbs +13 -0
- data/sig/generated/lrama/warnings/useless_precedence.rbs +13 -0
- data/sig/generated/lrama/warnings.rbs +11 -0
- data/sig/railroad_diagrams/railroad_diagrams.rbs +16 -0
- data/template/bison/_yacc.h +8 -0
- data/template/diagram/diagram.html +102 -0
- metadata +126 -66
- data/lib/lrama/counterexamples/production_path.rb +0 -19
- data/lib/lrama/counterexamples/start_path.rb +0 -23
- data/lib/lrama/counterexamples/transition_path.rb +0 -19
- data/lib/lrama/diagnostics.rb +0 -36
- data/lib/lrama/grammar/parameterizing_rule/rule.rb +0 -24
- data/lib/lrama/grammar/parameterizing_rule.rb +0 -5
- data/lib/lrama/grammar_validator.rb +0 -37
- data/lib/lrama/report/duration.rb +0 -27
- data/lib/lrama/report/profile.rb +0 -16
- data/lib/lrama/report.rb +0 -4
- data/lib/lrama/state/reduce.rb +0 -37
- data/lib/lrama/state/shift.rb +0 -15
- data/lib/lrama/states_reporter.rb +0 -362
- data/lib/lrama/trace_reporter.rb +0 -45
- data/sig/generated/lrama/trace_reporter.rbs +0 -25
- data/sig/lrama/counterexamples/derivation.rbs +0 -33
- data/sig/lrama/counterexamples/example.rbs +0 -45
- data/sig/lrama/counterexamples/path.rbs +0 -21
- data/sig/lrama/counterexamples/production_path.rbs +0 -11
- data/sig/lrama/counterexamples/start_path.rbs +0 -13
- data/sig/lrama/counterexamples/state_item.rbs +0 -10
- data/sig/lrama/counterexamples/transition_path.rbs +0 -11
- data/sig/lrama/counterexamples/triple.rbs +0 -20
- data/sig/lrama/counterexamples.rbs +0 -29
- data/sig/lrama/grammar/auxiliary.rbs +0 -10
- data/sig/lrama/grammar/code/destructor_code.rbs +0 -14
- data/sig/lrama/grammar/code/printer_code.rbs +0 -14
- data/sig/lrama/grammar/code/rule_action.rbs +0 -19
- data/sig/lrama/grammar/code.rbs +0 -24
- data/sig/lrama/grammar/destructor.rbs +0 -13
- data/sig/lrama/grammar/parameterizing_rule/resolver.rbs +0 -24
- data/sig/lrama/grammar/parameterizing_rule/rhs.rbs +0 -14
- data/sig/lrama/grammar/parameterizing_rule/rule.rbs +0 -16
- data/sig/lrama/grammar/parameterizing_rule.rbs +0 -6
- data/sig/lrama/grammar/precedence.rbs +0 -13
- data/sig/lrama/grammar/printer.rbs +0 -13
- data/sig/lrama/grammar/reference.rbs +0 -22
- data/sig/lrama/grammar/rule.rbs +0 -45
- data/sig/lrama/grammar/rule_builder.rbs +0 -47
- data/sig/lrama/grammar/symbol.rbs +0 -38
- data/sig/lrama/grammar/symbols/resolver.rbs +0 -60
- data/sig/lrama/grammar/type.rbs +0 -11
- data/sig/lrama/grammar/union.rbs +0 -12
- data/sig/lrama/grammar.rbs +0 -108
- data/sig/lrama/report/duration.rbs +0 -11
- data/sig/lrama/report/profile.rbs +0 -7
- data/sig/lrama/state/reduce.rbs +0 -20
- data/sig/lrama/state/reduce_reduce_conflict.rbs +0 -13
- data/sig/lrama/state/resolved_conflict.rbs +0 -14
- data/sig/lrama/state/shift.rbs +0 -14
- data/sig/lrama/state/shift_reduce_conflict.rbs +0 -13
- data/sig/lrama/state.rbs +0 -79
- data/sig/lrama/states/item.rbs +0 -30
- data/sig/lrama/states.rbs +0 -101
- data/sig/lrama/warning.rbs +0 -16
data/rbs_collection.lock.yaml
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
path: ".gem_rbs_collection"
|
|
3
3
|
gems:
|
|
4
|
+
- name: dbm
|
|
5
|
+
version: '0'
|
|
6
|
+
source:
|
|
7
|
+
type: stdlib
|
|
4
8
|
- name: diff-lcs
|
|
5
9
|
version: '1.5'
|
|
6
10
|
source:
|
|
7
11
|
type: git
|
|
8
12
|
name: ruby/gem_rbs_collection
|
|
9
|
-
revision:
|
|
13
|
+
revision: 01f77ce44d0ac13c8ebfc3cfdd7104320021f991
|
|
10
14
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
11
15
|
repo_dir: gems
|
|
12
16
|
- name: erb
|
|
@@ -21,24 +25,44 @@ gems:
|
|
|
21
25
|
version: '0'
|
|
22
26
|
source:
|
|
23
27
|
type: stdlib
|
|
28
|
+
- name: optparse
|
|
29
|
+
version: '0'
|
|
30
|
+
source:
|
|
31
|
+
type: stdlib
|
|
32
|
+
- name: pstore
|
|
33
|
+
version: '0'
|
|
34
|
+
source:
|
|
35
|
+
type: stdlib
|
|
36
|
+
- name: psych
|
|
37
|
+
version: '0'
|
|
38
|
+
source:
|
|
39
|
+
type: stdlib
|
|
24
40
|
- name: rake
|
|
25
41
|
version: '13.0'
|
|
26
42
|
source:
|
|
27
43
|
type: git
|
|
28
44
|
name: ruby/gem_rbs_collection
|
|
29
|
-
revision:
|
|
45
|
+
revision: 01f77ce44d0ac13c8ebfc3cfdd7104320021f991
|
|
30
46
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
31
47
|
repo_dir: gems
|
|
48
|
+
- name: rdoc
|
|
49
|
+
version: '0'
|
|
50
|
+
source:
|
|
51
|
+
type: stdlib
|
|
32
52
|
- name: stackprof
|
|
33
53
|
version: '0.2'
|
|
34
54
|
source:
|
|
35
55
|
type: git
|
|
36
56
|
name: ruby/gem_rbs_collection
|
|
37
|
-
revision:
|
|
57
|
+
revision: 01f77ce44d0ac13c8ebfc3cfdd7104320021f991
|
|
38
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
39
59
|
repo_dir: gems
|
|
40
60
|
- name: strscan
|
|
41
61
|
version: '0'
|
|
42
62
|
source:
|
|
43
63
|
type: stdlib
|
|
64
|
+
- name: timeout
|
|
65
|
+
version: '0'
|
|
66
|
+
source:
|
|
67
|
+
type: stdlib
|
|
44
68
|
gemfile_lock_path: Gemfile.lock
|
data/rbs_collection.yaml
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
module Lrama
|
|
4
4
|
module Bitmap
|
|
5
|
-
|
|
6
|
-
def self.from_array: (Array[Integer] ary) -> Integer
|
|
5
|
+
type bitmap = Integer
|
|
7
6
|
|
|
8
|
-
# @rbs (Integer
|
|
9
|
-
def self.
|
|
7
|
+
# @rbs (Array[Integer] ary) -> bitmap
|
|
8
|
+
def self.from_array: (Array[Integer] ary) -> bitmap
|
|
9
|
+
|
|
10
|
+
# @rbs (Integer int) -> bitmap
|
|
11
|
+
def self.from_integer: (Integer int) -> bitmap
|
|
12
|
+
|
|
13
|
+
# @rbs (bitmap int) -> Array[Integer]
|
|
14
|
+
def self.to_array: (bitmap int) -> Array[Integer]
|
|
15
|
+
|
|
16
|
+
# @rbs (bitmap int, Integer size) -> Array[bool]
|
|
17
|
+
def self.to_bool_array: (bitmap int, Integer size) -> Array[bool]
|
|
10
18
|
end
|
|
11
19
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/derivation.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
class Derivation
|
|
6
|
+
@item: State::Item
|
|
7
|
+
|
|
8
|
+
@left: Derivation?
|
|
9
|
+
|
|
10
|
+
attr_reader item: State::Item
|
|
11
|
+
|
|
12
|
+
attr_reader left: Derivation?
|
|
13
|
+
|
|
14
|
+
attr_accessor right: Derivation?
|
|
15
|
+
|
|
16
|
+
# @rbs (State::Item item, Derivation? left) -> void
|
|
17
|
+
def initialize: (State::Item item, Derivation? left) -> void
|
|
18
|
+
|
|
19
|
+
# @rbs () -> ::String
|
|
20
|
+
def to_s: () -> ::String
|
|
21
|
+
|
|
22
|
+
alias inspect to_s
|
|
23
|
+
|
|
24
|
+
# @rbs () -> Array[String]
|
|
25
|
+
def render_strings_for_report: () -> Array[String]
|
|
26
|
+
|
|
27
|
+
# @rbs () -> String
|
|
28
|
+
def render_for_report: () -> String
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
# @rbs (Derivation derivation, Integer offset, Array[String] strings, Integer index) -> Integer
|
|
33
|
+
def _render_for_report: (Derivation derivation, Integer offset, Array[String] strings, Integer index) -> Integer
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/example.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
class Example
|
|
6
|
+
@path1: ::Array[StateItem]
|
|
7
|
+
|
|
8
|
+
@path2: ::Array[StateItem]
|
|
9
|
+
|
|
10
|
+
@conflict: State::conflict
|
|
11
|
+
|
|
12
|
+
@conflict_symbol: Grammar::Symbol
|
|
13
|
+
|
|
14
|
+
@counterexamples: Counterexamples
|
|
15
|
+
|
|
16
|
+
@derivations1: Derivation
|
|
17
|
+
|
|
18
|
+
@derivations2: Derivation
|
|
19
|
+
|
|
20
|
+
attr_reader path1: ::Array[StateItem]
|
|
21
|
+
|
|
22
|
+
attr_reader path2: ::Array[StateItem]
|
|
23
|
+
|
|
24
|
+
attr_reader conflict: State::conflict
|
|
25
|
+
|
|
26
|
+
attr_reader conflict_symbol: Grammar::Symbol
|
|
27
|
+
|
|
28
|
+
# path1 is shift conflict when S/R conflict
|
|
29
|
+
# path2 is always reduce conflict
|
|
30
|
+
#
|
|
31
|
+
# @rbs (Array[StateItem]? path1, Array[StateItem]? path2, State::conflict conflict, Grammar::Symbol conflict_symbol, Counterexamples counterexamples) -> void
|
|
32
|
+
def initialize: (Array[StateItem]? path1, Array[StateItem]? path2, State::conflict conflict, Grammar::Symbol conflict_symbol, Counterexamples counterexamples) -> void
|
|
33
|
+
|
|
34
|
+
# @rbs () -> (:shift_reduce | :reduce_reduce)
|
|
35
|
+
def type: () -> (:shift_reduce | :reduce_reduce)
|
|
36
|
+
|
|
37
|
+
# @rbs () -> State::Item
|
|
38
|
+
def path1_item: () -> State::Item
|
|
39
|
+
|
|
40
|
+
# @rbs () -> State::Item
|
|
41
|
+
def path2_item: () -> State::Item
|
|
42
|
+
|
|
43
|
+
# @rbs () -> Derivation
|
|
44
|
+
def derivations1: () -> Derivation
|
|
45
|
+
|
|
46
|
+
# @rbs () -> Derivation
|
|
47
|
+
def derivations2: () -> Derivation
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
# @rbs (Array[StateItem] state_items) -> Derivation
|
|
52
|
+
def _derivations: (Array[StateItem] state_items) -> Derivation
|
|
53
|
+
|
|
54
|
+
# @rbs (StateItem state_item, Grammar::Symbol sym) -> Derivation?
|
|
55
|
+
def find_derivation_for_symbol: (StateItem state_item, Grammar::Symbol sym) -> Derivation?
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/node.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
# @rbs generic E < Object -- Type of an element
|
|
6
|
+
class Node[E < Object]
|
|
7
|
+
attr_reader elem: E
|
|
8
|
+
|
|
9
|
+
attr_reader next_node: Node[E]?
|
|
10
|
+
|
|
11
|
+
# @rbs [E < Object] (Node[E] node) -> Array[E]
|
|
12
|
+
def self.to_a: [E < Object] (Node[E] node) -> Array[E]
|
|
13
|
+
|
|
14
|
+
# @rbs (E elem, Node[E]? next_node) -> void
|
|
15
|
+
def initialize: (E elem, Node[E]? next_node) -> void
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/path.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
class Path
|
|
6
|
+
@state_item: StateItem
|
|
7
|
+
|
|
8
|
+
@parent: Path?
|
|
9
|
+
|
|
10
|
+
attr_reader state_item: StateItem
|
|
11
|
+
|
|
12
|
+
attr_reader parent: Path?
|
|
13
|
+
|
|
14
|
+
# @rbs (StateItem state_item, Path? parent) -> void
|
|
15
|
+
def initialize: (StateItem state_item, Path? parent) -> void
|
|
16
|
+
|
|
17
|
+
# @rbs () -> ::String
|
|
18
|
+
def to_s: () -> ::String
|
|
19
|
+
|
|
20
|
+
alias inspect to_s
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/state_item.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
class StateItem
|
|
6
|
+
attr_reader id: Integer
|
|
7
|
+
|
|
8
|
+
attr_reader state: State
|
|
9
|
+
|
|
10
|
+
attr_reader item: State::Item
|
|
11
|
+
|
|
12
|
+
# @rbs (Integer id, State state, State::Item item) -> void
|
|
13
|
+
def initialize: (Integer id, State state, State::Item item) -> void
|
|
14
|
+
|
|
15
|
+
# @rbs () -> (:start | :transition | :production)
|
|
16
|
+
def type: () -> (:start | :transition | :production)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples/triple.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Counterexamples
|
|
5
|
+
class Triple
|
|
6
|
+
attr_reader precise_lookahead_set: Bitmap::bitmap
|
|
7
|
+
|
|
8
|
+
alias l precise_lookahead_set
|
|
9
|
+
|
|
10
|
+
# @rbs (StateItem state_item, Bitmap::bitmap precise_lookahead_set) -> void
|
|
11
|
+
def initialize: (StateItem state_item, Bitmap::bitmap precise_lookahead_set) -> void
|
|
12
|
+
|
|
13
|
+
# @rbs () -> State
|
|
14
|
+
def state: () -> State
|
|
15
|
+
|
|
16
|
+
alias s state
|
|
17
|
+
|
|
18
|
+
# @rbs () -> State::Item
|
|
19
|
+
def item: () -> State::Item
|
|
20
|
+
|
|
21
|
+
alias itm item
|
|
22
|
+
|
|
23
|
+
# @rbs () -> StateItem
|
|
24
|
+
def state_item: () -> StateItem
|
|
25
|
+
|
|
26
|
+
# @rbs () -> ::String
|
|
27
|
+
def inspect: () -> ::String
|
|
28
|
+
|
|
29
|
+
alias to_s inspect
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Generated from lib/lrama/counterexamples.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
# See: https://www.cs.cornell.edu/andru/papers/cupex/cupex.pdf
|
|
5
|
+
# 4. Constructing Nonunifying Counterexamples
|
|
6
|
+
class Counterexamples
|
|
7
|
+
PathSearchTimeLimit: ::Integer
|
|
8
|
+
|
|
9
|
+
CumulativeTimeLimit: ::Integer
|
|
10
|
+
|
|
11
|
+
@states: States
|
|
12
|
+
|
|
13
|
+
@iterate_count: Integer
|
|
14
|
+
|
|
15
|
+
@total_duration: Float
|
|
16
|
+
|
|
17
|
+
@exceed_cumulative_time_limit: bool
|
|
18
|
+
|
|
19
|
+
@state_items: Hash[[ State, State::Item ], StateItem]
|
|
20
|
+
|
|
21
|
+
@triples: Hash[Integer, Triple]
|
|
22
|
+
|
|
23
|
+
@transitions: Hash[[ StateItem, Grammar::Symbol ], StateItem]
|
|
24
|
+
|
|
25
|
+
@reverse_transitions: Hash[[ StateItem, Grammar::Symbol ], Set[StateItem]]
|
|
26
|
+
|
|
27
|
+
@productions: Hash[StateItem, Set[StateItem]]
|
|
28
|
+
|
|
29
|
+
@reverse_productions: Hash[[ State, Grammar::Symbol ], Set[StateItem]]
|
|
30
|
+
|
|
31
|
+
@state_item_shift: Integer
|
|
32
|
+
|
|
33
|
+
attr_reader transitions: Hash[[ StateItem, Grammar::Symbol ], StateItem]
|
|
34
|
+
|
|
35
|
+
attr_reader productions: Hash[StateItem, Set[StateItem]]
|
|
36
|
+
|
|
37
|
+
# @rbs (States states) -> void
|
|
38
|
+
def initialize: (States states) -> void
|
|
39
|
+
|
|
40
|
+
# @rbs () -> "#<Counterexamples>"
|
|
41
|
+
def to_s: () -> "#<Counterexamples>"
|
|
42
|
+
|
|
43
|
+
alias inspect to_s
|
|
44
|
+
|
|
45
|
+
# @rbs (State conflict_state) -> Array[Example]
|
|
46
|
+
def compute: (State conflict_state) -> Array[Example]
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
# @rbs (State state, State::Item item) -> StateItem
|
|
51
|
+
def get_state_item: (State state, State::Item item) -> StateItem
|
|
52
|
+
|
|
53
|
+
# For optimization, create all StateItem in advance
|
|
54
|
+
# and use them by fetching an instance from `@state_items`.
|
|
55
|
+
# Do not create new StateItem instance in the shortest path search process
|
|
56
|
+
# to avoid miss hash lookup.
|
|
57
|
+
#
|
|
58
|
+
# @rbs () -> void
|
|
59
|
+
def setup_state_items: () -> void
|
|
60
|
+
|
|
61
|
+
# @rbs () -> void
|
|
62
|
+
def setup_transitions: () -> void
|
|
63
|
+
|
|
64
|
+
# @rbs () -> void
|
|
65
|
+
def setup_productions: () -> void
|
|
66
|
+
|
|
67
|
+
# For optimization, use same Triple if it's already created.
|
|
68
|
+
# Do not create new Triple instance anywhere else
|
|
69
|
+
# to avoid miss hash lookup.
|
|
70
|
+
#
|
|
71
|
+
# @rbs (StateItem state_item, Bitmap::bitmap precise_lookahead_set) -> Triple
|
|
72
|
+
def get_triple: (StateItem state_item, Bitmap::bitmap precise_lookahead_set) -> Triple
|
|
73
|
+
|
|
74
|
+
# @rbs (State conflict_state, State::ShiftReduceConflict conflict) -> Example
|
|
75
|
+
def shift_reduce_example: (State conflict_state, State::ShiftReduceConflict conflict) -> Example
|
|
76
|
+
|
|
77
|
+
# @rbs (State conflict_state, State::ReduceReduceConflict conflict) -> Example
|
|
78
|
+
def reduce_reduce_examples: (State conflict_state, State::ReduceReduceConflict conflict) -> Example
|
|
79
|
+
|
|
80
|
+
# @rbs (Array[StateItem]? reduce_state_items, State conflict_state, State::Item conflict_item) -> Array[StateItem]
|
|
81
|
+
def find_shift_conflict_shortest_path: (Array[StateItem]? reduce_state_items, State conflict_state, State::Item conflict_item) -> Array[StateItem]
|
|
82
|
+
|
|
83
|
+
# @rbs (StateItem target) -> Set[StateItem]
|
|
84
|
+
def reachable_state_items: (StateItem target) -> Set[StateItem]
|
|
85
|
+
|
|
86
|
+
# @rbs (State conflict_state, State::Item conflict_reduce_item, Grammar::Symbol conflict_term) -> ::Array[StateItem]?
|
|
87
|
+
def shortest_path: (State conflict_state, State::Item conflict_reduce_item, Grammar::Symbol conflict_term) -> ::Array[StateItem]?
|
|
88
|
+
|
|
89
|
+
# @rbs (State::Item item, Bitmap::bitmap current_l) -> Bitmap::bitmap
|
|
90
|
+
def follow_l: (State::Item item, Bitmap::bitmap current_l) -> Bitmap::bitmap
|
|
91
|
+
|
|
92
|
+
# @rbs [T] (String message) { -> T } -> T
|
|
93
|
+
def with_timeout: [T] (String message) { () -> T } -> T
|
|
94
|
+
|
|
95
|
+
# @rbs (Float|Integer duration) -> void
|
|
96
|
+
def increment_total_duration: (Float | Integer duration) -> void
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Generated from lib/lrama/diagram.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Diagram
|
|
5
|
+
# @rbs (IO out, Grammar grammar, String template_name) -> void
|
|
6
|
+
def self.render: (IO out, Grammar grammar, String template_name) -> void
|
|
7
|
+
|
|
8
|
+
# @rbs () -> bool
|
|
9
|
+
def self.require_railroad_diagrams: () -> bool
|
|
10
|
+
|
|
11
|
+
# @rbs (IO out, Grammar grammar, String template_name) -> void
|
|
12
|
+
def initialize: (IO out, Grammar grammar, String template_name) -> void
|
|
13
|
+
|
|
14
|
+
# @rbs () -> void
|
|
15
|
+
def render: () -> void
|
|
16
|
+
|
|
17
|
+
# @rbs () -> string
|
|
18
|
+
def default_style: () -> string
|
|
19
|
+
|
|
20
|
+
# @rbs () -> string
|
|
21
|
+
def diagrams: () -> string
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
# @rbs () -> string
|
|
26
|
+
def template_dir: () -> string
|
|
27
|
+
|
|
28
|
+
# @rbs () -> string
|
|
29
|
+
def template_file: () -> string
|
|
30
|
+
|
|
31
|
+
# @rbs (String name, RailroadDiagrams::Diagram diagram, String result) -> void
|
|
32
|
+
def add_diagram: (String name, RailroadDiagrams::Diagram diagram, String result) -> void
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
# Generated from lib/lrama/digraph.rb with RBS::Inline
|
|
2
2
|
|
|
3
3
|
module Lrama
|
|
4
|
-
# Algorithm
|
|
4
|
+
# Digraph Algorithm of https://dl.acm.org/doi/pdf/10.1145/69622.357187 (P. 625)
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
6
|
+
# Digraph is an algorithm for graph data structure.
|
|
7
|
+
# The algorithm efficiently traverses SCC (Strongly Connected Component) of graph
|
|
8
|
+
# and merges nodes attributes within the same SCC.
|
|
9
|
+
#
|
|
10
|
+
# `compute_read_sets` and `compute_follow_sets` have the same structure.
|
|
11
|
+
# Graph of gotos and attributes of gotos are given then compute propagated attributes for each node.
|
|
12
|
+
#
|
|
13
|
+
# In the case of `compute_read_sets`:
|
|
14
|
+
#
|
|
15
|
+
# * Set of gotos is nodes of graph
|
|
16
|
+
# * `reads_relation` is edges of graph
|
|
17
|
+
# * `direct_read_sets` is nodes attributes
|
|
18
|
+
#
|
|
19
|
+
# In the case of `compute_follow_sets`:
|
|
20
|
+
#
|
|
21
|
+
# * Set of gotos is nodes of graph
|
|
22
|
+
# * `includes_relation` is edges of graph
|
|
23
|
+
# * `read_sets` is nodes attributes
|
|
24
|
+
#
|
|
25
|
+
#
|
|
26
|
+
# @rbs generic X < Object -- Type of a node
|
|
27
|
+
# @rbs generic Y < _Or -- Type of attribute sets assigned to a node which should support merge operation (#| method)
|
|
8
28
|
class Digraph[X < Object, Y < _Or]
|
|
9
29
|
interface _Or
|
|
10
30
|
def |: (self) -> self
|
|
@@ -22,9 +42,9 @@ module Lrama
|
|
|
22
42
|
|
|
23
43
|
@result: Hash[X, Y]
|
|
24
44
|
|
|
25
|
-
# @rbs sets: Array[X]
|
|
26
|
-
# @rbs relation: Hash[X, Array[X]]
|
|
27
|
-
# @rbs base_function: Hash[X, Y]
|
|
45
|
+
# @rbs sets: Array[X] -- Nodes of graph
|
|
46
|
+
# @rbs relation: Hash[X, Array[X]] -- Edges of graph
|
|
47
|
+
# @rbs base_function: Hash[X, Y] -- Attributes of nodes
|
|
28
48
|
# @rbs return: void
|
|
29
49
|
def initialize: (Array[X] sets, Hash[X, Array[X]] relation, Hash[X, Y] base_function) -> void
|
|
30
50
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Generated from lib/lrama/erb.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class ERB
|
|
5
|
+
# @rbs (String file, **untyped kwargs) -> String
|
|
6
|
+
def self.render: (String file, **untyped kwargs) -> String
|
|
7
|
+
|
|
8
|
+
# @rbs (String file) -> void
|
|
9
|
+
def initialize: (String file) -> void
|
|
10
|
+
|
|
11
|
+
# @rbs (**untyped kwargs) -> String
|
|
12
|
+
def render: (**untyped kwargs) -> String
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Generated from lib/lrama/grammar/auxiliary.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Grammar
|
|
5
|
+
# Grammar file information not used by States but by Output
|
|
6
|
+
class Auxiliary
|
|
7
|
+
attr_accessor prologue_first_lineno: Integer?
|
|
8
|
+
|
|
9
|
+
attr_accessor prologue: String?
|
|
10
|
+
|
|
11
|
+
attr_accessor epilogue_first_lineno: Integer?
|
|
12
|
+
|
|
13
|
+
attr_accessor epilogue: String?
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -3,29 +3,35 @@
|
|
|
3
3
|
module Lrama
|
|
4
4
|
class Grammar
|
|
5
5
|
class Binding
|
|
6
|
-
@actual_args: Array[Lexer::Token]
|
|
6
|
+
@actual_args: Array[Lexer::Token::Base]
|
|
7
7
|
|
|
8
|
-
@param_to_arg: Hash[String, Lexer::Token]
|
|
8
|
+
@param_to_arg: Hash[String, Lexer::Token::Base]
|
|
9
9
|
|
|
10
|
-
# @rbs (Array[Lexer::Token] params, Array[Lexer::Token] actual_args) -> void
|
|
11
|
-
def initialize: (Array[Lexer::Token] params, Array[Lexer::Token] actual_args) -> void
|
|
10
|
+
# @rbs (Array[Lexer::Token::Base] params, Array[Lexer::Token::Base] actual_args) -> void
|
|
11
|
+
def initialize: (Array[Lexer::Token::Base] params, Array[Lexer::Token::Base] actual_args) -> void
|
|
12
12
|
|
|
13
|
-
# @rbs (Lexer::Token sym) -> Lexer::Token
|
|
14
|
-
def resolve_symbol: (Lexer::Token sym) -> Lexer::Token
|
|
13
|
+
# @rbs (Lexer::Token::Base sym) -> Lexer::Token::Base
|
|
14
|
+
def resolve_symbol: (Lexer::Token::Base sym) -> Lexer::Token::Base
|
|
15
15
|
|
|
16
16
|
# @rbs (Lexer::Token::InstantiateRule token) -> String
|
|
17
17
|
def concatenated_args_str: (Lexer::Token::InstantiateRule token) -> String
|
|
18
18
|
|
|
19
19
|
private
|
|
20
20
|
|
|
21
|
-
# @rbs (
|
|
22
|
-
def
|
|
21
|
+
# @rbs (Lexer::Token::InstantiateRule sym) -> Lexer::Token::InstantiateRule
|
|
22
|
+
def create_instantiate_rule: (Lexer::Token::InstantiateRule sym) -> Lexer::Token::InstantiateRule
|
|
23
23
|
|
|
24
|
-
# @rbs (Lexer::Token::
|
|
25
|
-
def
|
|
24
|
+
# @rbs (Array[Lexer::Token::Base]) -> Array[Lexer::Token::Base]
|
|
25
|
+
def resolve_args: (Array[Lexer::Token::Base]) -> Array[Lexer::Token::Base]
|
|
26
26
|
|
|
27
|
-
# @rbs (Lexer::Token sym) -> Lexer::Token
|
|
28
|
-
def
|
|
27
|
+
# @rbs (Lexer::Token::Base sym) -> Lexer::Token::Base
|
|
28
|
+
def find_arg_for_param: (Lexer::Token::Base sym) -> Lexer::Token::Base
|
|
29
|
+
|
|
30
|
+
# @rbs (Array[Lexer::Token::Base] params, Array[Lexer::Token::Base] actual_args) -> Hash[String, Lexer::Token::Base?]
|
|
31
|
+
def build_param_to_arg: (Array[Lexer::Token::Base] params, Array[Lexer::Token::Base] actual_args) -> Hash[String, Lexer::Token::Base?]
|
|
32
|
+
|
|
33
|
+
# @rbs (Lexer::Token::InstantiateRule token) -> String
|
|
34
|
+
def format_args: (Lexer::Token::InstantiateRule token) -> String
|
|
29
35
|
|
|
30
36
|
# @rbs (Lexer::Token::InstantiateRule token) -> Array[String]
|
|
31
37
|
def token_to_args_s_values: (Lexer::Token::InstantiateRule token) -> Array[String]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated from lib/lrama/grammar/code/destructor_code.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Grammar
|
|
5
|
+
class Code
|
|
6
|
+
class DestructorCode < Code
|
|
7
|
+
@tag: Lexer::Token::Tag
|
|
8
|
+
|
|
9
|
+
# @rbs (type: ::Symbol, token_code: Lexer::Token::UserCode, tag: Lexer::Token::Tag) -> void
|
|
10
|
+
def initialize: (type: ::Symbol, token_code: Lexer::Token::UserCode, tag: Lexer::Token::Tag) -> void
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
# * ($$) *yyvaluep
|
|
15
|
+
# * (@$) *yylocationp
|
|
16
|
+
# * ($:$) error
|
|
17
|
+
# * ($1) error
|
|
18
|
+
# * (@1) error
|
|
19
|
+
# * ($:1) error
|
|
20
|
+
#
|
|
21
|
+
# @rbs (Reference ref) -> (String | bot)
|
|
22
|
+
def reference_to_c: (Reference ref) -> (String | bot)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# Generated from lib/lrama/grammar/code/initial_action_code.rb with RBS::Inline
|
|
2
|
+
|
|
1
3
|
module Lrama
|
|
2
4
|
class Grammar
|
|
3
5
|
class Code
|
|
@@ -6,8 +8,12 @@ module Lrama
|
|
|
6
8
|
|
|
7
9
|
# * ($$) yylval
|
|
8
10
|
# * (@$) yylloc
|
|
11
|
+
# * ($:$) error
|
|
9
12
|
# * ($1) error
|
|
10
13
|
# * (@1) error
|
|
14
|
+
# * ($:1) error
|
|
15
|
+
#
|
|
16
|
+
# @rbs (Reference ref) -> (String | bot)
|
|
11
17
|
def reference_to_c: (Reference ref) -> (String | bot)
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# Generated from lib/lrama/grammar/code/no_reference_code.rb with RBS::Inline
|
|
2
|
+
|
|
1
3
|
module Lrama
|
|
2
4
|
class Grammar
|
|
3
5
|
class Code
|
|
@@ -6,8 +8,12 @@ module Lrama
|
|
|
6
8
|
|
|
7
9
|
# * ($$) error
|
|
8
10
|
# * (@$) error
|
|
11
|
+
# * ($:$) error
|
|
9
12
|
# * ($1) error
|
|
10
13
|
# * (@1) error
|
|
14
|
+
# * ($:1) error
|
|
15
|
+
#
|
|
16
|
+
# @rbs (Reference ref) -> bot
|
|
11
17
|
def reference_to_c: (Reference ref) -> bot
|
|
12
18
|
end
|
|
13
19
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated from lib/lrama/grammar/code/printer_code.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Lrama
|
|
4
|
+
class Grammar
|
|
5
|
+
class Code
|
|
6
|
+
class PrinterCode < Code
|
|
7
|
+
@tag: Lexer::Token::Tag
|
|
8
|
+
|
|
9
|
+
# @rbs (type: ::Symbol, token_code: Lexer::Token::UserCode, tag: Lexer::Token::Tag) -> void
|
|
10
|
+
def initialize: (type: ::Symbol, token_code: Lexer::Token::UserCode, tag: Lexer::Token::Tag) -> void
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
# * ($$) *yyvaluep
|
|
15
|
+
# * (@$) *yylocationp
|
|
16
|
+
# * ($:$) error
|
|
17
|
+
# * ($1) error
|
|
18
|
+
# * (@1) error
|
|
19
|
+
# * ($:1) error
|
|
20
|
+
#
|
|
21
|
+
# @rbs (Reference ref) -> (String | bot)
|
|
22
|
+
def reference_to_c: (Reference ref) -> (String | bot)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|