class Drizzle::Evaluator

Overview

Module containing an overloaded evaluation function that evaluates all the various node types

Defined in:

drizzle/evaluator.cr

Class Method Summary

Class Method Detail

def self.eval(node : AST::Program, env : Environment) : Object::Object #

eval method for program nodes, the starting point of any drizzle program


[View source]
def self.eval(node : AST::BlockStatement, env : Environment) : Object::Object #

eval method for block nodes, which represent a collection of statements


[View source]
def self.eval(node : AST::IfStatement, env : Environment) : Object::Object #

eval method for if statements


[View source]
def self.eval(node : AST::Return, env : Environment) : Object::Object #

eval method for return statements


[View source]
def self.eval(node : AST::Let, env : Environment) : Object::Object #

eval method for let statements


[View source]
def self.eval(node : AST::Function, env : Environment) : Object::Object #

eval statement for function definitions


[View source]
def self.eval(node : AST::ExpressionStatement, env : Environment) : Object::Object #

eval method for expression statement nodes, which represent expressions on their own (e.g. an integer literal on its own)


[View source]
def self.eval(node : AST::PrefixExpression, env : Environment) : Object::Object #

eval method for prefix expression nddes


[View source]
def self.eval(node : AST::InfixExpression, env : Environment) : Object::Object #

eval method for infix expression nodes


[View source]
def self.eval(node : AST::CallExpression, env : Environment) : Object::Object #

eval method for call expressions, formed as a result of calling a function


[View source]
def self.eval(node : AST::IntegerLiteral, env : Environment) : Object::Object #

eval method for integer literal nodes


[View source]
def self.eval(node : AST::BooleanLiteral, env : Environment) : Object::Object #

eval method for boolean literal nodes


[View source]
def self.eval(node : AST::Identifier, env : Environment) : Object::Object #

eval method for identifiers


[View source]
def self.eval(node : AST::Node, env : Environment) : Object::Object #

temp catchall method


[View source]
def self.eval(node : Nil, env : Environment) : Object::Object #

temp handling for nil nodes since expressionstatement can have a nil expression


[View source]