MysoreScript
|
Reference to a variable. More...
#include <ast.hh>
Public Member Functions | |
void | collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override |
Add this variable to the set of referenced variables. More... | |
Public Member Functions inherited from AST::Expression | |
virtual bool | isConstantExpression () |
Returns true if the expression is constant and therefore doesn't need interpreting every time. More... | |
Obj | evaluate (Interpreter::Context &c) |
Evaluate the expression, caching the result if it's a constant expression. More... | |
void | interpret (Interpreter::Context &c) override final |
Interpret this expression as if it were a statement. More... | |
void | compile (Compiler::Context &c) override final |
Compile this expression as if it were a statement. More... | |
Public Attributes | |
ASTChild< Identifier > | name |
The name of the referenced variable. More... | |
Protected Member Functions | |
Obj | evaluateExpr (Interpreter::Context &c) override |
Evaluate this by looking up the variable in the interpreter's symbol table and loading it. More... | |
llvm::Value * | compileExpression (Compiler::Context &c) override |
Compile the reference by looking up the value in the compiler's symbol table and generating code to load it. More... | |
Additional Inherited Members | |
Protected Attributes inherited from AST::Expression | |
Interpreter::Value | cache |
Cached result for constant expression. More... | |
|
inlineoverridevirtual |
Add this variable to the set of referenced variables.
Implements AST::Statement.
|
overrideprotectedvirtual |
Compile the reference by looking up the value in the compiler's symbol table and generating code to load it.
Implements AST::Expression.
Definition at line 620 of file compiler.cc.
|
overrideprotectedvirtual |
Evaluate this by looking up the variable in the interpreter's symbol table and loading it.
Implements AST::Expression.
Definition at line 450 of file interpreter.cc.
ASTChild<Identifier> AST::VarRef::name |