Class: Tracekit::Evaluator::Parser
- Inherits:
-
Object
- Object
- Tracekit::Evaluator::Parser
- Defined in:
- lib/tracekit/evaluator.rb
Overview
Recursive-descent parser and evaluator. Operator precedence (lowest to highest):
|| -> && -> == != -> < > <= >= -> + - -> * / -> ! (unary) -> primary
Instance Method Summary collapse
-
#initialize(tokens, env) ⇒ Parser
constructor
A new instance of Parser.
- #parse_expression ⇒ Object
Constructor Details
#initialize(tokens, env) ⇒ Parser
Returns a new instance of Parser.
327 328 329 330 331 |
# File 'lib/tracekit/evaluator.rb', line 327 def initialize(tokens, env) @tokens = tokens @env = env @pos = 0 end |
Instance Method Details
#parse_expression ⇒ Object
333 334 335 |
# File 'lib/tracekit/evaluator.rb', line 333 def parse_expression parse_or end |