class Evaluator::Evaluator
- Evaluator::Evaluator
- Reference
- Object
Defined in:
evaluator/evaluator.crConstant Summary
-
FALSE =
PheltObject::Boolean.new(false)
-
NULL =
PheltObject::Null.new
-
TRUE =
PheltObject::Boolean.new(true)
Constructors
Instance Method Summary
- #apply_function(function : PheltObject::Function | PheltObject::Builtin, args : Array(PheltObject::Object), env : PheltObject::Environment)
- #bool_to_boolean(value)
- #env : PheltObject::Environment
- #env=(env : PheltObject::Environment)
- #error(error : String)
- #error?(value)
- #eval(node : AST::Node, env : PheltObject::Environment) : PheltObject::Object
- #eval(node : Nil)
- #eval
- #eval_array_index_expression(array : PheltObject::Array, index : PheltObject::Integer)
- #eval_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment)
- #eval_bang_operator_expression(right : PheltObject::Object)
- #eval_block_statement(block : AST::BlockStatement, env : PheltObject::Environment)
- #eval_broad_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment)
- #eval_do(body : AST::BlockStatement, env : PheltObject::Environment)
- #eval_expressions(expressions : Array(AST::Expression), env : PheltObject::Environment)
- #eval_for(node : AST::ForExpression, env : PheltObject::Environment)
- #eval_hash_index_expression(hash : PheltObject::Hash, index : PheltObject::Hashable)
- #eval_hash_literal(node : AST::HashLiteral, env : PheltObject::Environment)
- #eval_identifier(node : AST::Identifier, env : PheltObject::Environment)
- #eval_if_expression(expression : AST::IfExpression, env : PheltObject::Environment)
- #eval_indecrement_infix_expression(operator : String, left : AST::Expression, env : PheltObject::Environment)
- #eval_indecrement_prefix_operator_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment)
- #eval_index_expression(left, index : PheltObject::Object)
- #eval_infix_expression(operator : String, left : PheltObject::Object, right : PheltObject::Object)
- #eval_internal_object_access(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil)
- #eval_minus_prefix_operator_expression(right : PheltObject::Object)
- #eval_number_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Number, env : PheltObject::Environment)
- #eval_number_infix_expression(operator : String, left : PheltObject::Number, right : PheltObject::Number)
- #eval_object_access_expression(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil = nil)
- #eval_prefix_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment)
- #eval_program(statements : Array(AST::Statement), env : PheltObject::Environment)
- #eval_string_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::String, env : PheltObject::Environment)
- #eval_string_index_expression(string : PheltObject::String, index : PheltObject::Integer)
- #eval_string_infix_expression(operator : String, left : PheltObject::String, right : PheltObject::String)
- #eval_while(node : AST::WhileExpression, env : PheltObject::Environment)
- #extend_function_env(function : PheltObject::Function, args : Array(PheltObject::Object))
- #load_objects_env
- #program : AST::Program
- #program=(program : AST::Program)
- #truthy?(object : PheltObject::Object)
- #unwrap_return_value(object : PheltObject::Object)
Constructor Detail
def self.new(program : AST::Program, env : PheltObject::Environment = PheltObject::Environment.new)
#
Instance Method Detail
def apply_function(function : PheltObject::Function | PheltObject::Builtin, args : Array(PheltObject::Object), env : PheltObject::Environment)
#
def eval_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment)
#
def eval_broad_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Object, env : PheltObject::Environment)
#
def eval_indecrement_infix_expression(operator : String, left : AST::Expression, env : PheltObject::Environment)
#
def eval_indecrement_prefix_operator_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment)
#
def eval_infix_expression(operator : String, left : PheltObject::Object, right : PheltObject::Object)
#
def eval_internal_object_access(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil)
#
def eval_number_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::Number, env : PheltObject::Environment)
#
def eval_number_infix_expression(operator : String, left : PheltObject::Number, right : PheltObject::Number)
#
def eval_object_access_expression(object : PheltObject::Object, index : PheltObject::String, env : PheltObject::Environment, args : Array(PheltObject::Object) | Nil = nil)
#
def eval_prefix_expression(node : AST::PrefixExpression, right : PheltObject::Object, env : PheltObject::Environment)
#
def eval_string_assignment_infix_expression(operator : String, left : AST::Expression, right : PheltObject::String, env : PheltObject::Environment)
#
def eval_string_infix_expression(operator : String, left : PheltObject::String, right : PheltObject::String)
#