Class: Lrama::Counterexamples::Example
- Inherits:
-
Object
- Object
- Lrama::Counterexamples::Example
- Defined in:
- lib/lrama/counterexamples/example.rb
Instance Attribute Summary collapse
-
#conflict ⇒ Object
readonly
: State::conflict.
-
#conflict_symbol ⇒ Object
readonly
: Grammar::Symbol.
-
#path1 ⇒ Object
readonly
TODO: rbs-inline 0.11.0 doesn’t support instance variables.
-
#path2 ⇒ Object
readonly
: ::Array.
Instance Method Summary collapse
- #derivations1 ⇒ Object
- #derivations2 ⇒ Object
-
#initialize(path1, path2, conflict, conflict_symbol, counterexamples) ⇒ Example
constructor
path1 is shift conflict when S/R conflict path2 is always reduce conflict.
- #path1_item ⇒ Object
- #path2_item ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(path1, path2, conflict, conflict_symbol, counterexamples) ⇒ Example
path1 is shift conflict when S/R conflict path2 is always reduce conflict
29 30 31 32 33 34 35 |
# File 'lib/lrama/counterexamples/example.rb', line 29 def initialize(path1, path2, conflict, conflict_symbol, counterexamples) @path1 = path1 @path2 = path2 @conflict = conflict @conflict_symbol = conflict_symbol @counterexamples = counterexamples end |
Instance Attribute Details
#conflict ⇒ Object (readonly)
: State::conflict
22 23 24 |
# File 'lib/lrama/counterexamples/example.rb', line 22 def conflict @conflict end |
#conflict_symbol ⇒ Object (readonly)
: Grammar::Symbol
23 24 25 |
# File 'lib/lrama/counterexamples/example.rb', line 23 def conflict_symbol @conflict_symbol end |
#path1 ⇒ Object (readonly)
TODO: rbs-inline 0.11.0 doesn’t support instance variables.
Move these type declarations above instance variable definitions, once it's supported.
see: https://github.com/soutaro/rbs-inline/pull/149
@rbs!
@path1: ::Array[StateItem]
@path2: ::Array[StateItem]
@conflict: State::conflict
@conflict_symbol: Grammar::Symbol
@counterexamples: Counterexamples
@derivations1: Derivation
@derivations2: Derivation
20 21 22 |
# File 'lib/lrama/counterexamples/example.rb', line 20 def path1 @path1 end |
#path2 ⇒ Object (readonly)
: ::Array
21 22 23 |
# File 'lib/lrama/counterexamples/example.rb', line 21 def path2 @path2 end |
Instance Method Details
#derivations1 ⇒ Object
53 54 55 |
# File 'lib/lrama/counterexamples/example.rb', line 53 def derivations1 @derivations1 ||= _derivations(path1) end |
#derivations2 ⇒ Object
58 59 60 |
# File 'lib/lrama/counterexamples/example.rb', line 58 def derivations2 @derivations2 ||= _derivations(path2) end |
#path1_item ⇒ Object
43 44 45 |
# File 'lib/lrama/counterexamples/example.rb', line 43 def path1_item @path1.last.item end |
#path2_item ⇒ Object
48 49 50 |
# File 'lib/lrama/counterexamples/example.rb', line 48 def path2_item @path2.last.item end |
#type ⇒ Object
38 39 40 |
# File 'lib/lrama/counterexamples/example.rb', line 38 def type @conflict.type end |