Class: Ibex::IR::AutomatonItem
- Inherits:
-
Object
- Object
- Ibex::IR::AutomatonItem
- Defined in:
- lib/ibex/ir/automaton_ir.rb
Overview
A merged LALR item with its lookahead token ids.
Instance Attribute Summary collapse
-
#dot ⇒ Object
readonly
: Integer.
-
#lookaheads ⇒ Object
readonly
: Array.
-
#production ⇒ Object
readonly
: Integer.
Instance Method Summary collapse
-
#initialize(production:, dot:, lookaheads:) ⇒ AutomatonItem
constructor
A new instance of AutomatonItem.
- #to_h(grammar) ⇒ Object
Constructor Details
#initialize(production:, dot:, lookaheads:) ⇒ AutomatonItem
Returns a new instance of AutomatonItem.
12 13 14 15 16 17 |
# File 'lib/ibex/ir/automaton_ir.rb', line 12 def initialize(production:, dot:, lookaheads:) @production = production @dot = dot @lookaheads = lookaheads.sort.freeze freeze end |
Instance Attribute Details
#dot ⇒ Object (readonly)
: Integer
8 9 10 |
# File 'lib/ibex/ir/automaton_ir.rb', line 8 def dot @dot end |
#lookaheads ⇒ Object (readonly)
: Array
9 10 11 |
# File 'lib/ibex/ir/automaton_ir.rb', line 9 def lookaheads @lookaheads end |
#production ⇒ Object (readonly)
: Integer
7 8 9 |
# File 'lib/ibex/ir/automaton_ir.rb', line 7 def production @production end |