MysoreScript
|
Assignment statements, setting the value of a variable. More...
#include <ast.hh>
Public Member Functions | |
void | interpret (Interpreter::Context &c) override |
Interpret the assignment, updating the stored value. More... | |
void | compile (Compiler::Context &c) override |
Compile the assignment, looking up the address of the target and storing the result of compiling the expression in it. More... | |
void | collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override |
Collect any variables use in this expression. More... | |
Public Attributes | |
ASTPtr< VarRef > | target |
The variable being assigned to. More... | |
ASTPtr< Expression > | expr |
The expression being assigned. More... | |
Assignment statements, setting the value of a variable.
Note that MysoreScript does not provide compound-assignment operators.
|
inlineoverridevirtual |
Collect any variables use in this expression.
Implements AST::Statement.
|
overridevirtual |
Compile the assignment, looking up the address of the target and storing the result of compiling the expression in it.
Reimplemented from AST::Statement.
Definition at line 612 of file compiler.cc.
|
overridevirtual |
Interpret the assignment, updating the stored value.
Implements AST::Statement.
Definition at line 660 of file interpreter.cc.
ASTPtr<Expression> AST::Assignment::expr |
ASTPtr<VarRef> AST::Assignment::target |