Class: Interpreter

Inherits:
Object
  • Object
show all
Defined in:
lib/turmali/interpreter.rb

Instance Method Summary collapse

Constructor Details

#initializeInterpreter

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