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.
14 15 16 17 18 19 |
# File 'lib/ibex/ir/automaton_ir.rb', line 14 def initialize(production:, dot:, lookaheads:) @production = production @dot = dot @lookaheads = lookaheads.sort.dup.freeze freeze end |
Instance Attribute Details
#dot ⇒ Object (readonly)
: Integer
10 11 12 |
# File 'lib/ibex/ir/automaton_ir.rb', line 10 def dot @dot end |
#lookaheads ⇒ Object (readonly)
: Array
11 12 13 |
# File 'lib/ibex/ir/automaton_ir.rb', line 11 def lookaheads @lookaheads end |
#production ⇒ Object (readonly)
: Integer
9 10 11 |
# File 'lib/ibex/ir/automaton_ir.rb', line 9 def production @production end |