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
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Counterexamples
|
|
3
|
-
class Triple
|
|
4
|
-
attr_accessor s: State
|
|
5
|
-
attr_accessor itm: States::Item
|
|
6
|
-
attr_accessor l: Set[Grammar::Symbol]
|
|
7
|
-
|
|
8
|
-
alias state s
|
|
9
|
-
alias item itm
|
|
10
|
-
alias precise_lookahead_set l
|
|
11
|
-
|
|
12
|
-
def initialize: (State s, States::Item itm, Set[Grammar::Symbol] l) -> void
|
|
13
|
-
|
|
14
|
-
def state_item: () -> StateItem
|
|
15
|
-
def inspect: () -> ::String
|
|
16
|
-
|
|
17
|
-
alias to_s inspect
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Counterexamples
|
|
3
|
-
@states: States
|
|
4
|
-
@transitions: Hash[[StateItem, Grammar::Symbol], StateItem]
|
|
5
|
-
@reverse_transitions: Hash[[StateItem, Grammar::Symbol], Set[StateItem]]
|
|
6
|
-
@productions: Hash[StateItem, Set[States::Item]]
|
|
7
|
-
@reverse_productions: Hash[[State, Grammar::Symbol], Set[States::Item]]
|
|
8
|
-
|
|
9
|
-
attr_reader transitions: Hash[[StateItem, Grammar::Symbol], StateItem]
|
|
10
|
-
attr_reader productions: Hash[StateItem, Set[States::Item]]
|
|
11
|
-
|
|
12
|
-
def initialize: (States states) -> void
|
|
13
|
-
def to_s: () -> "#<Counterexamples>"
|
|
14
|
-
alias inspect to_s
|
|
15
|
-
def compute: (State conflict_state) -> Array[Example]
|
|
16
|
-
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
def setup_transitions: () -> void
|
|
20
|
-
def setup_productions: () -> void
|
|
21
|
-
def shift_reduce_example: (State conflict_state, State::ShiftReduceConflict conflict) -> Example
|
|
22
|
-
def reduce_reduce_examples: (State conflict_state, State::ReduceReduceConflict conflict) -> Example
|
|
23
|
-
def find_shift_conflict_shortest_path: (::Array[StartPath|TransitionPath|ProductionPath]? reduce_path, State conflict_state, States::Item conflict_item) -> ::Array[StartPath|TransitionPath|ProductionPath]
|
|
24
|
-
def find_shift_conflict_shortest_state_items: (::Array[StartPath|TransitionPath|ProductionPath]? reduce_path, State conflict_state, States::Item conflict_item) -> Array[StateItem]
|
|
25
|
-
def build_paths_from_state_items: (Array[StateItem] state_items) -> ::Array[StartPath|TransitionPath|ProductionPath]
|
|
26
|
-
def shortest_path: (State conflict_state, States::Item conflict_reduce_item, Grammar::Symbol conflict_term) -> ::Array[StartPath|TransitionPath|ProductionPath]?
|
|
27
|
-
def follow_l: (States::Item item, Set[Grammar::Symbol] current_l) -> Set[Grammar::Symbol]
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Code
|
|
4
|
-
class DestructorCode < Code
|
|
5
|
-
@tag: Lexer::Token::Tag
|
|
6
|
-
def initialize: (type: ::Symbol, token_code: Grammar::Code, tag: Lexer::Token::Tag) -> void
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
def reference_to_c: (Reference ref) -> (String | bot)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Code
|
|
4
|
-
class PrinterCode < Code
|
|
5
|
-
@tag: Lexer::Token::Tag
|
|
6
|
-
def initialize: (type: ::Symbol, token_code: Grammar::Code, tag: Lexer::Token::Tag) -> void
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
def reference_to_c: (Reference ref) -> (String | bot)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Code
|
|
4
|
-
class RuleAction < Code
|
|
5
|
-
@rule: Rule
|
|
6
|
-
|
|
7
|
-
def initialize: (type: ::Symbol, token_code: Grammar::Code, rule: Rule) -> void
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
def reference_to_c: (Reference ref) -> String
|
|
12
|
-
def position_in_rhs: () -> Integer
|
|
13
|
-
def rhs: () -> Array[Grammar::Symbol]
|
|
14
|
-
def lhs: () -> Grammar::Symbol
|
|
15
|
-
def raise_tag_not_found_error: (Reference ref) -> bot
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
data/sig/lrama/grammar/code.rbs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Code
|
|
4
|
-
extend Forwardable
|
|
5
|
-
|
|
6
|
-
attr_accessor type: ::Symbol
|
|
7
|
-
attr_accessor token_code: Grammar::Code
|
|
8
|
-
|
|
9
|
-
# delegated
|
|
10
|
-
def s_value: -> String
|
|
11
|
-
def line: -> Integer
|
|
12
|
-
def column: -> Integer
|
|
13
|
-
def references: -> Array[Lrama::Grammar::Reference]
|
|
14
|
-
|
|
15
|
-
def initialize: (type: ::Symbol, token_code: Grammar::Code) -> void
|
|
16
|
-
|
|
17
|
-
def translated_code: () -> String
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
|
|
21
|
-
def reference_to_c: (untyped ref) -> untyped
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Destructor
|
|
4
|
-
attr_accessor ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag]
|
|
5
|
-
attr_accessor token_code: Grammar::Code
|
|
6
|
-
attr_accessor lineno: Integer
|
|
7
|
-
|
|
8
|
-
def initialize: (ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag], token_code: Grammar::Code, lineno: Integer) -> void
|
|
9
|
-
|
|
10
|
-
def translated_code: (Lexer::Token::Tag tag) -> String
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class ParameterizingRule
|
|
4
|
-
class Resolver
|
|
5
|
-
attr_accessor rules: Array[Grammar::ParameterizingRule::Rule]
|
|
6
|
-
attr_accessor created_lhs_list: Array[Lexer::Token]
|
|
7
|
-
|
|
8
|
-
@rules: Array[Grammar::ParameterizingRule::Rule]
|
|
9
|
-
|
|
10
|
-
def initialize: () -> void
|
|
11
|
-
def add_parameterizing_rule: (Grammar::ParameterizingRule::Rule rule) -> Array[Grammar::ParameterizingRule::Rule]
|
|
12
|
-
def find_rule: (Lexer::Token::InstantiateRule token) -> Grammar::ParameterizingRule::Rule?
|
|
13
|
-
def find_inline: (Lexer::Token token) -> Grammar::ParameterizingRule::Rule?
|
|
14
|
-
def created_lhs: (String lhs_s_value) -> Lexer::Token?
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
|
|
18
|
-
def select_rules: (Array[Grammar::ParameterizingRule::Rule] rules, Lexer::Token::InstantiateRule token) -> Array[Grammar::ParameterizingRule::Rule]
|
|
19
|
-
def select_not_inline_rules: (Array[Grammar::ParameterizingRule::Rule] rules) -> Array[Grammar::ParameterizingRule::Rule]
|
|
20
|
-
def select_rules_by_name: (Array[Grammar::ParameterizingRule::Rule] rules, String rule_name) -> Array[Grammar::ParameterizingRule::Rule]
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class ParameterizingRule
|
|
4
|
-
class Rhs
|
|
5
|
-
attr_reader symbols: Array[untyped]
|
|
6
|
-
attr_reader user_code: Lexer::Token::UserCode?
|
|
7
|
-
attr_reader precedence_sym: Grammar::Symbol?
|
|
8
|
-
|
|
9
|
-
def initialize: () -> void
|
|
10
|
-
def resolve_user_code: (Grammar::Binding bindings) -> Lexer::Token::UserCode?
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class ParameterizingRule
|
|
4
|
-
class Rule
|
|
5
|
-
attr_reader name: String
|
|
6
|
-
attr_reader parameters: Array[Lexer::Token]
|
|
7
|
-
attr_reader rhs_list: Array[Grammar::ParameterizingRule::Rhs]
|
|
8
|
-
attr_reader required_parameters_count: Integer
|
|
9
|
-
attr_reader tag: Lexer::Token::Tag?
|
|
10
|
-
attr_reader is_inline: bool
|
|
11
|
-
|
|
12
|
-
def initialize: (String name, Array[Lexer::Token] parameters, Array[Grammar::ParameterizingRule::Rhs] rhs_list, ?tag: Lexer::Token::Tag, ?is_inline: bool) -> void
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Precedence
|
|
4
|
-
include Comparable
|
|
5
|
-
attr_accessor type: ::Symbol
|
|
6
|
-
attr_accessor precedence: Integer
|
|
7
|
-
|
|
8
|
-
def initialize: (?type: ::Symbol, ?precedence: Integer) -> void
|
|
9
|
-
|
|
10
|
-
def <=>: (Precedence other) -> Integer
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Printer
|
|
4
|
-
attr_accessor ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag]
|
|
5
|
-
attr_accessor token_code: Grammar::Code
|
|
6
|
-
attr_accessor lineno: Integer
|
|
7
|
-
|
|
8
|
-
def initialize: (?ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag], ?token_code: Grammar::Code, ?lineno: Integer) -> void
|
|
9
|
-
|
|
10
|
-
def translated_code: (Lexer::Token::Tag tag) -> String
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Reference
|
|
4
|
-
attr_accessor type: ::Symbol
|
|
5
|
-
attr_accessor name: String
|
|
6
|
-
attr_accessor number: Integer
|
|
7
|
-
attr_accessor index: Integer
|
|
8
|
-
attr_accessor ex_tag: Lexer::Token?
|
|
9
|
-
attr_accessor first_column: Integer
|
|
10
|
-
attr_accessor last_column: Integer
|
|
11
|
-
attr_accessor position_in_rhs: Integer?
|
|
12
|
-
|
|
13
|
-
def initialize: (
|
|
14
|
-
type: ::Symbol, ?name: String, ?number: Integer, ?index: Integer, ?ex_tag: Lexer::Token?,
|
|
15
|
-
first_column: Integer, last_column: Integer,
|
|
16
|
-
?position_in_rhs: Integer?
|
|
17
|
-
) -> void
|
|
18
|
-
|
|
19
|
-
def value: () -> (String|Integer)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
data/sig/lrama/grammar/rule.rbs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Rule
|
|
4
|
-
attr_accessor id: Integer
|
|
5
|
-
attr_accessor _lhs: Lexer::Token
|
|
6
|
-
attr_accessor lhs: Grammar::Symbol
|
|
7
|
-
attr_accessor lhs_tag: Lexer::Token::Tag?
|
|
8
|
-
attr_accessor _rhs: Array[Lexer::Token]
|
|
9
|
-
attr_accessor rhs: Array[Grammar::Symbol]
|
|
10
|
-
attr_accessor token_code: Grammar::Code?
|
|
11
|
-
attr_accessor position_in_original_rule_rhs: Integer
|
|
12
|
-
attr_accessor nullable: bool
|
|
13
|
-
attr_accessor precedence_sym: Grammar::Symbol?
|
|
14
|
-
attr_accessor lineno: Integer?
|
|
15
|
-
attr_accessor original_rule: Rule
|
|
16
|
-
|
|
17
|
-
def initialize: (
|
|
18
|
-
?id: Integer, ?_lhs: Lexer::Token, ?lhs: Lexer::Token, ?lhs_tag: Lexer::Token::Tag?, ?_rhs: Array[Lexer::Token], ?rhs: Array[Grammar::Symbol],
|
|
19
|
-
?token_code: Lexer::Token::UserCode?, ?position_in_original_rule_rhs: Integer?, ?nullable: bool,
|
|
20
|
-
?precedence_sym: Grammar::Symbol?, ?lineno: Integer?
|
|
21
|
-
) -> void
|
|
22
|
-
|
|
23
|
-
def display_name: () -> String
|
|
24
|
-
|
|
25
|
-
def as_comment: -> String
|
|
26
|
-
|
|
27
|
-
def empty_rule?: -> bool
|
|
28
|
-
|
|
29
|
-
def initial_rule?: -> bool
|
|
30
|
-
|
|
31
|
-
def precedence: -> Precedence?
|
|
32
|
-
|
|
33
|
-
def translated_code: -> String?
|
|
34
|
-
|
|
35
|
-
def with_actions: -> String
|
|
36
|
-
|
|
37
|
-
def contains_at_reference?: -> bool
|
|
38
|
-
|
|
39
|
-
interface _DelegatedMethods
|
|
40
|
-
def lhs: -> Grammar::Symbol
|
|
41
|
-
def rhs: -> Array[Grammar::Symbol]
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class RuleBuilder
|
|
4
|
-
attr_accessor lhs: Lexer::Token
|
|
5
|
-
attr_accessor line: Integer?
|
|
6
|
-
attr_reader lhs_tag: Lexer::Token::Tag?
|
|
7
|
-
attr_reader rhs: Array[Lexer::Token]
|
|
8
|
-
attr_reader user_code: Lexer::Token::UserCode?
|
|
9
|
-
attr_reader precedence_sym: Grammar::Symbol?
|
|
10
|
-
|
|
11
|
-
@rule_counter: Counter
|
|
12
|
-
@midrule_action_counter: Counter
|
|
13
|
-
@parameterizing_rule_resolver: Grammar::ParameterizingRule::Resolver
|
|
14
|
-
@position_in_original_rule_rhs: Integer?
|
|
15
|
-
@skip_preprocess_references: bool
|
|
16
|
-
@user_code: Lexer::Token::UserCode?
|
|
17
|
-
@rule_builders_for_parameterizing_rules: Array[RuleBuilder]
|
|
18
|
-
@rule_builders_for_derived_rules: Array[RuleBuilder]
|
|
19
|
-
@rules: Array[Rule]
|
|
20
|
-
@replaced_rhs: Array[Lexer::Token]
|
|
21
|
-
@parameterizing_rules: Array[Rule]
|
|
22
|
-
@midrule_action_rules: Array[Rule]
|
|
23
|
-
|
|
24
|
-
def initialize: (Counter rule_counter, Counter midrule_action_counter, Grammar::ParameterizingRule::Resolver parameterizing_rule_resolver, ?Integer position_in_original_rule_rhs, ?lhs_tag: Lexer::Token::Tag?, ?skip_preprocess_references: bool) -> void
|
|
25
|
-
def add_rhs: (Lexer::Token rhs) -> void
|
|
26
|
-
def has_inline_rules?: -> bool
|
|
27
|
-
def resolve_inline_rules: -> Array[RuleBuilder]
|
|
28
|
-
def user_code=: (Lexer::Token::UserCode? user_code) -> void
|
|
29
|
-
def precedence_sym=: (Grammar::Symbol? precedence_sym) -> void
|
|
30
|
-
def complete_input: () -> void
|
|
31
|
-
def setup_rules: () -> void
|
|
32
|
-
def rules: () -> Array[Rule]
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
def freeze_rhs: () -> void
|
|
37
|
-
def preprocess_references: () -> void
|
|
38
|
-
def build_rules: () -> void
|
|
39
|
-
def process_rhs: () -> void
|
|
40
|
-
def resolve_inline: () -> void
|
|
41
|
-
def resolve_inline_rhs: (RuleBuilder rule_builder, Grammar::ParameterizingRule::Rhs inline_rhs, Integer index, ?Binding bindings) -> void
|
|
42
|
-
def replace_inline_user_code: (Grammar::ParameterizingRule::Rhs inline_rhs, Integer index) -> Lexer::Token::UserCode?
|
|
43
|
-
def numberize_references: () -> void
|
|
44
|
-
def flush_user_code: () -> void
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Symbol
|
|
4
|
-
attr_accessor id: Lexer::Token
|
|
5
|
-
attr_accessor alias_name: String?
|
|
6
|
-
attr_accessor number: Integer
|
|
7
|
-
attr_accessor tag: Lexer::Token::Tag?
|
|
8
|
-
attr_accessor term: bool
|
|
9
|
-
attr_accessor token_id: Integer
|
|
10
|
-
attr_accessor nullable: bool
|
|
11
|
-
attr_accessor precedence: Precedence?
|
|
12
|
-
attr_accessor printer: Printer?
|
|
13
|
-
attr_accessor destructor: Destructor?
|
|
14
|
-
attr_accessor error_token: ErrorToken
|
|
15
|
-
|
|
16
|
-
attr_accessor first_set: Set[Grammar::Symbol]
|
|
17
|
-
attr_accessor first_set_bitmap: Integer
|
|
18
|
-
attr_writer eof_symbol: bool
|
|
19
|
-
attr_writer error_symbol: bool
|
|
20
|
-
attr_writer undef_symbol: bool
|
|
21
|
-
attr_writer accept_symbol: bool
|
|
22
|
-
|
|
23
|
-
def initialize: (
|
|
24
|
-
id: Lexer::Token, term: bool, ?alias_name: String?, ?number: Integer?, ?tag: Lexer::Token?,
|
|
25
|
-
?token_id: Integer?, ?nullable: bool?, ?precedence: Precedence?, ?printer: Printer?) -> void
|
|
26
|
-
|
|
27
|
-
def term?: () -> bool
|
|
28
|
-
def nterm?: () -> bool
|
|
29
|
-
def eof_symbol?: () -> bool
|
|
30
|
-
def error_symbol?: () -> bool
|
|
31
|
-
def undef_symbol?: () -> bool
|
|
32
|
-
def accept_symbol?: () -> bool
|
|
33
|
-
def display_name: () -> String
|
|
34
|
-
def enum_name: () -> String
|
|
35
|
-
def comment: () -> String?
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Symbols
|
|
4
|
-
class Resolver
|
|
5
|
-
attr_reader terms: Array[Grammar::Symbol]
|
|
6
|
-
attr_reader nterms: Array[Grammar::Symbol]
|
|
7
|
-
|
|
8
|
-
@symbols: Array[Grammar::Symbol]?
|
|
9
|
-
@number: Integer
|
|
10
|
-
@used_numbers: Hash[Integer, bool]
|
|
11
|
-
|
|
12
|
-
def initialize: () -> void
|
|
13
|
-
def symbols: () -> Array[Grammar::Symbol]
|
|
14
|
-
def sort_by_number!: () -> Array[Grammar::Symbol]
|
|
15
|
-
def add_term: (id: Lexer::Token, ?alias_name: String?, ?tag: Lexer::Token::Tag?, ?token_id: Integer?, ?replace: bool) -> Grammar::Symbol
|
|
16
|
-
def add_nterm: (id: Lexer::Token, ?alias_name: String?, ?tag: Lexer::Token::Tag?) -> Grammar::Symbol
|
|
17
|
-
def find_symbol_by_s_value: (::String s_value) -> Grammar::Symbol?
|
|
18
|
-
def find_symbol_by_s_value!: (::String s_value) -> Grammar::Symbol
|
|
19
|
-
def find_symbol_by_id: (Lexer::Token id) -> Grammar::Symbol?
|
|
20
|
-
def find_symbol_by_id!: (Lexer::Token id) -> Grammar::Symbol
|
|
21
|
-
def find_symbol_by_token_id: (Integer token_id) -> Grammar::Symbol?
|
|
22
|
-
def find_symbol_by_number!: (Integer number) -> Grammar::Symbol
|
|
23
|
-
def fill_symbol_number: () -> void
|
|
24
|
-
def fill_destructor: (Array[Destructor] destructors) -> (Array[Grammar::Symbol] | bot)
|
|
25
|
-
def fill_nterm_type: (Array[Grammar::Type] types) -> void
|
|
26
|
-
def fill_printer: (Array[Grammar::Printer] printers) -> void
|
|
27
|
-
def fill_error_token: (Array[Grammar::ErrorToken] error_tokens) -> void
|
|
28
|
-
def token_to_symbol: (Lexer::Token token) -> Grammar::Symbol
|
|
29
|
-
def validate!: () -> void
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
def find_nterm_by_id!: (Lexer::Token id) -> Grammar::Symbol
|
|
34
|
-
def fill_terms_number: () -> void
|
|
35
|
-
def fill_nterms_number: () -> void
|
|
36
|
-
def used_numbers: () -> Hash[Integer, bool]
|
|
37
|
-
def validate_number_uniqueness!: () -> void
|
|
38
|
-
def validate_alias_name_uniqueness!: () -> void
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
interface _DelegatedMethods
|
|
42
|
-
def symbols: () -> Array[Grammar::Symbol]
|
|
43
|
-
def nterms: () -> Array[Grammar::Symbol]
|
|
44
|
-
def terms: () -> Array[Grammar::Symbol]
|
|
45
|
-
def add_nterm: (id: Lexer::Token, ?alias_name: String?, ?tag: Lexer::Token::Tag?) -> Grammar::Symbol
|
|
46
|
-
def add_term: (id: Lexer::Token, ?alias_name: String?, ?tag: Lexer::Token::Tag?, ?token_id: Integer?, ?replace: bool) -> Grammar::Symbol
|
|
47
|
-
def find_symbol_by_number!: (Integer number) -> Grammar::Symbol
|
|
48
|
-
def find_symbol_by_id!: (Lexer::Token id) -> Grammar::Symbol
|
|
49
|
-
def token_to_symbol: (Lexer::Token token) -> Grammar::Symbol
|
|
50
|
-
def find_symbol_by_s_value!: (::String s_value) -> Grammar::Symbol
|
|
51
|
-
def fill_nterm_type: (Array[Grammar::Type] types) -> void
|
|
52
|
-
def fill_symbol_number: () -> void
|
|
53
|
-
def fill_printer: (Array[Grammar::Printer] printers) -> void
|
|
54
|
-
def fill_destructor: (Array[Destructor] destructors) -> (Destructor | bot)
|
|
55
|
-
def fill_error_token: (Array[Grammar::ErrorToken] error_tokens) -> void
|
|
56
|
-
def sort_by_number!: () -> Array[Grammar::Symbol]
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
data/sig/lrama/grammar/type.rbs
DELETED
data/sig/lrama/grammar/union.rbs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
class Union
|
|
4
|
-
attr_accessor code: Grammar::Code::NoReferenceCode
|
|
5
|
-
attr_accessor lineno: Integer
|
|
6
|
-
|
|
7
|
-
def initialize: (code: Grammar::Code::NoReferenceCode, lineno: Integer) -> void
|
|
8
|
-
|
|
9
|
-
def braces_less_code: () -> String
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
data/sig/lrama/grammar.rbs
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class Grammar
|
|
3
|
-
include Symbols::_DelegatedMethods
|
|
4
|
-
|
|
5
|
-
@rule_counter: Counter
|
|
6
|
-
@percent_codes: Array[PercentCode]
|
|
7
|
-
@printers: Array[Printer]
|
|
8
|
-
@destructors: Array[Destructor]
|
|
9
|
-
@error_tokens: Array[ErrorToken]
|
|
10
|
-
@symbols_resolver: Symbols::Resolver
|
|
11
|
-
@types: Array[Type]
|
|
12
|
-
@rule_builders: Array[RuleBuilder]
|
|
13
|
-
@rules: Array[Rule]
|
|
14
|
-
@sym_to_rules: Hash[Integer, Array[Rule]]
|
|
15
|
-
@parameterizing_rule_resolver: ParameterizingRule::Resolver
|
|
16
|
-
@empty_symbol: Grammar::Symbol
|
|
17
|
-
@eof_symbol: Grammar::Symbol
|
|
18
|
-
@error_symbol: Grammar::Symbol
|
|
19
|
-
@undef_symbol: Grammar::Symbol
|
|
20
|
-
@accept_symbol: Grammar::Symbol
|
|
21
|
-
@aux: Auxiliary
|
|
22
|
-
@no_stdlib: bool
|
|
23
|
-
@locations: bool
|
|
24
|
-
@union: Union
|
|
25
|
-
|
|
26
|
-
extend Forwardable
|
|
27
|
-
|
|
28
|
-
attr_reader percent_codes: Array[PercentCode]
|
|
29
|
-
attr_reader eof_symbol: Grammar::Symbol
|
|
30
|
-
attr_reader error_symbol: Grammar::Symbol
|
|
31
|
-
attr_reader undef_symbol: Grammar::Symbol
|
|
32
|
-
attr_reader accept_symbol: Grammar::Symbol
|
|
33
|
-
attr_reader aux: Auxiliary
|
|
34
|
-
attr_accessor union: Union
|
|
35
|
-
attr_accessor expect: Integer
|
|
36
|
-
attr_accessor printers: Array[Printer]
|
|
37
|
-
attr_accessor error_tokens: Array[ErrorToken]
|
|
38
|
-
attr_accessor lex_param: String
|
|
39
|
-
attr_accessor parse_param: String
|
|
40
|
-
attr_accessor initial_action: Grammar::Code::InitialActionCode
|
|
41
|
-
attr_accessor after_shift: Lexer::Token
|
|
42
|
-
attr_accessor before_reduce: Lexer::Token
|
|
43
|
-
attr_accessor after_reduce: Lexer::Token
|
|
44
|
-
attr_accessor after_shift_error_token: Lexer::Token
|
|
45
|
-
attr_accessor after_pop_stack: Lexer::Token
|
|
46
|
-
attr_accessor symbols_resolver: Symbols::Resolver
|
|
47
|
-
attr_accessor types: Array[Type]
|
|
48
|
-
attr_accessor rules: Array[Rule]
|
|
49
|
-
attr_accessor rule_builders: Array[RuleBuilder]
|
|
50
|
-
attr_accessor sym_to_rules: Hash[Integer, Array[Rule]]
|
|
51
|
-
attr_accessor no_stdlib: bool
|
|
52
|
-
|
|
53
|
-
def initialize: (Counter rule_counter) -> void
|
|
54
|
-
def create_rule_builder: (Counter rule_counter, Counter midrule_action_counter) -> RuleBuilder
|
|
55
|
-
def add_percent_code: (id: Lexer::Token, code: Lexer::Token::UserCode) -> Array[PercentCode]
|
|
56
|
-
def add_destructor: (ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag], token_code: Code, lineno: Integer) -> Array[Destructor]
|
|
57
|
-
def add_printer: (ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag], token_code: Code, lineno: Integer) -> Array[Printer]
|
|
58
|
-
def add_error_token: (ident_or_tags: Array[Lexer::Token::Ident|Lexer::Token::Tag], token_code: Code, lineno: Integer) -> Array[ErrorToken]
|
|
59
|
-
def add_type: (id: Lexer::Token, tag: Lexer::Token::Tag) -> Array[Type]
|
|
60
|
-
def add_nonassoc: (Grammar::Symbol sym, Integer precedence) -> Precedence
|
|
61
|
-
def add_left: (Grammar::Symbol sym, Integer precedence) -> Precedence
|
|
62
|
-
def add_right: (Grammar::Symbol sym, Integer precedence) -> Precedence
|
|
63
|
-
def add_precedence: (Grammar::Symbol sym, Integer precedence) -> Precedence
|
|
64
|
-
def set_precedence: (Grammar::Symbol sym, Precedence precedence) -> (Precedence | bot)
|
|
65
|
-
def set_union: (Grammar::Code::NoReferenceCode code, Integer lineno) -> Union
|
|
66
|
-
def add_rule_builder: (RuleBuilder builder) -> Array[RuleBuilder]
|
|
67
|
-
def add_parameterizing_rule: (ParameterizingRule::Rule rule) -> Array[ParameterizingRule::Rule]
|
|
68
|
-
def parameterizing_rules: () -> Array[ParameterizingRule::Rule]
|
|
69
|
-
def insert_before_parameterizing_rules: (Array[ParameterizingRule::Rule] rules) -> Array[ParameterizingRule::Rule]
|
|
70
|
-
def prologue_first_lineno=: (Integer prologue_first_lineno) -> Integer
|
|
71
|
-
def prologue=: (String prologue) -> String
|
|
72
|
-
def epilogue_first_lineno=: (Integer epilogue_first_lineno) -> Integer
|
|
73
|
-
def epilogue=: (String epilogue) -> String
|
|
74
|
-
def prepare: () -> void
|
|
75
|
-
def validate!: () -> void
|
|
76
|
-
def find_rules_by_symbol!: (Grammar::Symbol sym) -> Array[Rule]
|
|
77
|
-
def find_rules_by_symbol: (Grammar::Symbol sym) -> Array[Rule]?
|
|
78
|
-
|
|
79
|
-
private
|
|
80
|
-
|
|
81
|
-
def compute_nullable: () -> Array[Grammar::Symbol]
|
|
82
|
-
def compute_first_set: () -> Array[Grammar::Symbol]
|
|
83
|
-
def resolve_inline_rules: () -> void
|
|
84
|
-
def setup_rules: () -> Array[RuleBuilder]
|
|
85
|
-
def append_special_symbols: () -> Grammar::Symbol
|
|
86
|
-
def normalize_rules: () -> Array[Rule]
|
|
87
|
-
def collect_symbols: () -> Array[Lexer::Token]
|
|
88
|
-
def set_lhs_and_rhs: () -> void
|
|
89
|
-
def fill_default_precedence: () -> void
|
|
90
|
-
def fill_symbols: () -> Array[Grammar::Symbol]
|
|
91
|
-
def fill_sym_to_rules: () -> Array[Rule]
|
|
92
|
-
def validate_rule_lhs_is_nterm!: () -> void
|
|
93
|
-
def set_locations: () -> void
|
|
94
|
-
|
|
95
|
-
interface _DelegatedMethods
|
|
96
|
-
def rules: () -> Array[Rule]
|
|
97
|
-
def accept_symbol: () -> Grammar::Symbol
|
|
98
|
-
def eof_symbol: () -> Grammar::Symbol
|
|
99
|
-
def undef_symbol: () -> Grammar::Symbol
|
|
100
|
-
|
|
101
|
-
# delegate to @symbols_resolver
|
|
102
|
-
def symbols: () -> Array[Grammar::Symbol]
|
|
103
|
-
def terms: () -> Array[Grammar::Symbol]
|
|
104
|
-
def nterms: () -> Array[Grammar::Symbol]
|
|
105
|
-
def find_symbol_by_s_value!: (::String s_value) -> Grammar::Symbol
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
end
|
data/sig/lrama/state/reduce.rbs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class State
|
|
3
|
-
class Reduce
|
|
4
|
-
@item: States::Item
|
|
5
|
-
@look_ahead: Array[Grammar::Symbol]?
|
|
6
|
-
@not_selected_symbols: Array[Grammar::Symbol]
|
|
7
|
-
|
|
8
|
-
attr_reader item: States::Item
|
|
9
|
-
attr_reader look_ahead: Array[Grammar::Symbol]?
|
|
10
|
-
attr_reader not_selected_symbols: Array[Grammar::Symbol]
|
|
11
|
-
attr_accessor default_reduction: bool
|
|
12
|
-
|
|
13
|
-
def initialize: (States::Item item) -> void
|
|
14
|
-
def rule: -> Grammar::Rule
|
|
15
|
-
def look_ahead=: (Array[Grammar::Symbol] look_ahead) -> Array[Grammar::Symbol]
|
|
16
|
-
def add_not_selected_symbol: (Grammar::Symbol sym) -> Array[Grammar::Symbol]
|
|
17
|
-
def selected_look_ahead: () -> (::Array[Grammar::Symbol?])
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module Lrama
|
|
2
|
-
class State
|
|
3
|
-
class ReduceReduceConflict
|
|
4
|
-
attr_accessor symbols: Array[Grammar::Symbol]
|
|
5
|
-
attr_accessor reduce1: State::Reduce
|
|
6
|
-
attr_accessor reduce2: State::Reduce
|
|
7
|
-
|
|
8
|
-
def initialize: (?symbols: Array[Grammar::Symbol], ?reduce1: State::Reduce, ?reduce2: State::Reduce) -> void
|
|
9
|
-
|
|
10
|
-
def type: () -> :reduce_reduce
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|