Class: Interpreter
- Inherits:
-
Object
- Object
- Interpreter
- Defined in:
- lib/turmali/interpreter.rb
Instance Method Summary collapse
- #eval(code) ⇒ Object
-
#initialize ⇒ Interpreter
constructor
A new instance of Interpreter.
Constructor Details
#initialize ⇒ Interpreter
Returns a new instance of Interpreter.
9 10 11 |
# File 'lib/turmali/interpreter.rb', line 9 def initialize @parser = Parser.new end |
Instance Method Details
#eval(code) ⇒ Object
13 14 15 |
# File 'lib/turmali/interpreter.rb', line 13 def eval(code) @parser.parse(code).eval(RootContext) end |