Class: Lrama::Counterexamples::StateItem
- Inherits:
-
Object
- Object
- Lrama::Counterexamples::StateItem
- Defined in:
- lib/lrama/counterexamples/state_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
: Integer.
-
#item ⇒ Object
readonly
: State::Item.
-
#state ⇒ Object
readonly
: State.
Instance Method Summary collapse
-
#initialize(id, state, item) ⇒ StateItem
constructor
A new instance of StateItem.
- #type ⇒ Object
Constructor Details
#initialize(id, state, item) ⇒ StateItem
12 13 14 15 16 |
# File 'lib/lrama/counterexamples/state_item.rb', line 12 def initialize(id, state, item) @id = id @state = state @item = item end |
Instance Attribute Details
#id ⇒ Object (readonly)
: Integer
7 8 9 |
# File 'lib/lrama/counterexamples/state_item.rb', line 7 def id @id end |
#item ⇒ Object (readonly)
: State::Item
9 10 11 |
# File 'lib/lrama/counterexamples/state_item.rb', line 9 def item @item end |
#state ⇒ Object (readonly)
: State
8 9 10 |
# File 'lib/lrama/counterexamples/state_item.rb', line 8 def state @state end |
Instance Method Details
#type ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lrama/counterexamples/state_item.rb', line 19 def type case when item.start_item? :start when item.beginning_of_rule? :production else :transition end end |