Class: YABFI::Lexer
Overview
This module consumes tokens produced by the Parser and produces an unoptimized syntax tree.
Constant Summary collapse
- DISPATCH_TABLE =
This Hash maps tokens to method names to optimize the performance of the lexer.
{ loop: :while_loop, succ: :change_value, pred: :change_value, next: :change_pointer, prev: :change_pointer, get: :get, put: :put }
Constants inherited from Consumer
Consumer::EndOfInput, Consumer::Unsatisfied
Instance Attribute Summary
Attributes inherited from Consumer
Class Method Summary collapse
-
.run!(tokens) ⇒ Array<Object>
Run the lexer on the given tokens.
Methods inherited from Consumer
#advance, #attempt, #consume_index, #end_of_input?, #eq, #initialize, #many, #many_one, #one_of, #peek, #satisfy, #seek
Constructor Details
This class inherits a constructor from YABFI::Consumer
Class Method Details
.run!(tokens) ⇒ Array<Object>
Run the lexer on the given tokens.
22 23 24 |
# File 'lib/yabfi/lexer.rb', line 22 def self.run!(tokens) new(tokens).send(:run!) end |