class Lit::Interpreter

Included Modules

Defined in:

lit/interpreter.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Lit::Stmt::Visitor

visit_block_stmt(stmt : Block) visit_block_stmt, visit_expression_stmt(stmt : Expression) visit_expression_stmt, visit_function_stmt(stmt : Function) visit_function_stmt, visit_if_stmt(stmt : If) visit_if_stmt, visit_let_stmt(stmt : Let) visit_let_stmt, visit_print_stmt(stmt : Print) visit_print_stmt, visit_println_stmt(stmt : Println) visit_println_stmt, visit_return_stmt(stmt : Return) visit_return_stmt, visit_while_stmt(stmt : While) visit_while_stmt

Instance methods inherited from module Lit::Expr::Visitor

visit_assign_expr(expr : Assign) visit_assign_expr, visit_binary_expr(expr : Binary) visit_binary_expr, visit_call_expr(expr : Call) visit_call_expr, visit_grouping_expr(expr : Grouping) visit_grouping_expr, visit_literal_expr(expr : Literal) visit_literal_expr, visit_logical_expr(expr : Logical) visit_logical_expr, visit_ternary_expr(expr : Ternary) visit_ternary_expr, visit_unary_expr(expr : Unary) visit_unary_expr, visit_variable_expr(expr : Variable) visit_variable_expr

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.interpret(stmts : Array(Stmt)) #

[View source]

Instance Method Detail

def environment : Lit::Environment #

[View source]
def evaluate(expr : Expr) : Value #

[View source]
def execute(stmt : Stmt) : Value #

[View source]
def execute_block(stmts : Array(Stmt), environment : Environment) : Nil #

[View source]
def interpret(stmts) : Nil #

[View source]
def visit_assign_expr(expr) : Value #

[View source]
def visit_binary_expr(expr) : Value #

[View source]
def visit_block_stmt(stmt) : Nil #

[View source]
def visit_call_expr(expr) : Value #

[View source]
def visit_expression_stmt(stmt) : Nil #

[View source]
def visit_function_stmt(stmt) : Nil #

[View source]
def visit_grouping_expr(expr) : Value #

[View source]
def visit_if_stmt(stmt) : Nil #

[View source]
def visit_let_stmt(stmt) : Nil #

[View source]
def visit_literal_expr(expr) : Value #

[View source]
def visit_logical_expr(expr) : Value #

[View source]
def visit_print_stmt(stmt) : Nil #

[View source]
def visit_println_stmt(stmt) : Nil #

[View source]
def visit_return_stmt(stmt) : Nil #

[View source]
def visit_ternary_expr(expr) : Value #

[View source]
def visit_unary_expr(expr) : Value #

[View source]
def visit_variable_expr(expr) : Value #

[View source]
def visit_while_stmt(stmt) : Nil #

[View source]