MysoreScript
|
The abstract superclass for all statements. More...
#include <ast.hh>
Public Member Functions | |
virtual void | interpret (Interpreter::Context &c)=0 |
Execute this statement in the interpreter. More... | |
virtual void | compile (Compiler::Context &c) |
Compile this statement to LLVM IR. More... | |
virtual void | collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses)=0 |
Recursively visit all of the children of this statement, collecting variables that are declared and used in it. More... | |
|
pure virtual |
Recursively visit all of the children of this statement, collecting variables that are declared and used in it.
This is used to allocate space for all declared variables and to bind variables to closures.
Implemented in AST::ClassDecl, AST::WhileLoop, AST::IfStatement, AST::Return, AST::Decl, AST::Call, AST::Assignment, AST::VarRef, AST::BinOpBase, AST::StringLiteral, and AST::Number.
|
inlinevirtual |
Compile this statement to LLVM IR.
Reimplemented in AST::WhileLoop, AST::IfStatement, AST::Return, AST::Decl, AST::Assignment, and AST::Expression.
|
pure virtual |
Execute this statement in the interpreter.
Implemented in AST::ClassDecl, AST::WhileLoop, AST::IfStatement, AST::Return, AST::Decl, AST::Assignment, and AST::Expression.