MysoreScript
|
If statement. More...
#include <ast.hh>
Public Member Functions | |
void | interpret (Interpreter::Context &c) override |
Interpret the condition, then interpret the body if the condition is true. More... | |
virtual void | compile (Compiler::Context &c) override |
Compile the if statement. More... | |
void | collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override |
Collect all of the variables used and defined in this statement. More... | |
Public Attributes | |
ASTPtr< Expression > | condition |
The condition. More... | |
ASTPtr< Statements > | body |
The body of the if statement. More... | |
|
inlineoverridevirtual |
Collect all of the variables used and defined in this statement.
Implements AST::Statement.
|
overridevirtual |
Compile the if statement.
Reimplemented from AST::Statement.
Definition at line 519 of file compiler.cc.
|
overridevirtual |
Interpret the condition, then interpret the body if the condition is true.
Implements AST::Statement.
Definition at line 634 of file interpreter.cc.
ASTPtr<Statements> AST::IfStatement::body |
ASTPtr<Expression> AST::IfStatement::condition |