Class: Ibex::Verify::LanguageWitness::CanonicalMachine
- Inherits:
-
Object
- Object
- Ibex::Verify::LanguageWitness::CanonicalMachine
- Defined in:
- lib/ibex/verify/language_witness.rb
Overview
Canonical collection is intentionally built here rather than through the production construction entry point, keeping this witness independent from construction code.
Instance Method Summary collapse
-
#initialize(grammar, max_states:, max_items:) ⇒ CanonicalMachine
constructor
A new instance of CanonicalMachine.
- #simulate(entry, tokens) ⇒ Object
Constructor Details
#initialize(grammar, max_states:, max_items:) ⇒ CanonicalMachine
Returns a new instance of CanonicalMachine.
145 146 147 148 149 150 151 152 |
# File 'lib/ibex/verify/language_witness.rb', line 145 def initialize(grammar, max_states:, max_items:) collection = ReferenceCollection.new( grammar, max_states: max_states, max_items: max_items ).build(:lr1) @grammar = grammar @states = build_states(collection) @entry_states = grammar.starts.each_with_index.to_h end |