Class: PLang::VM::Interpreter

Inherits:
Object
  • Object
show all
Includes:
PFunctions
Defined in:
lib/vm/interpreter.rb

Instance Method Summary collapse

Methods included from PFunctions

#add_to_interpreter_boolean_functions, #add_to_interpreter_char_functions, #add_to_interpreter_decimal_functions, #add_to_interpreter_integer_functions, #add_to_interpreter_list_functions, #add_to_interpreter_string_functions, #def_function, #def_object_message, #def_var, #object, #plambda

Constructor Details

#initialize(ast) ⇒ Interpreter

Returns a new instance of Interpreter.



6
7
8
# File 'lib/vm/interpreter.rb', line 6

def initialize(ast)
  @ast = ast
end

Instance Method Details

#execute!Object



10
11
12
13
14
15
16
17
# File 'lib/vm/interpreter.rb', line 10

def execute!
  result = nil
  env = load_basic_environment
  @ast.each do |ast|
    result = execute(ast, env)
  end
  result
end