MysoreScript
Public Member Functions | Public Attributes | List of all members
AST::Return Struct Reference

Return statement. More...

#include <ast.hh>

Inheritance diagram for AST::Return:
Inheritance graph
[legend]
Collaboration diagram for AST::Return:
Collaboration graph
[legend]

Public Member Functions

void interpret (Interpreter::Context &c) override
 Interpret the returned expression and then indicate in the context that we have hit a return statement and so should stop interpreting. More...
 
virtual void compile (Compiler::Context &c) override
 Compile the return statement. More...
 
void collectVarUses (std::unordered_set< std::string > &decls, std::unordered_set< std::string > &uses) override
 Collect any variables that are referenced. More...
 

Public Attributes

ASTPtr< Expressionexpr
 The expression that is returned. More...
 

Detailed Description

Return statement.

Definition at line 720 of file ast.hh.

Member Function Documentation

§ collectVarUses()

void AST::Return::collectVarUses ( std::unordered_set< std::string > &  decls,
std::unordered_set< std::string > &  uses 
)
inlineoverridevirtual

Collect any variables that are referenced.

Implements AST::Statement.

Definition at line 738 of file ast.hh.

§ compile()

void Return::compile ( Compiler::Context c)
overridevirtual

Compile the return statement.

Reimplemented from AST::Statement.

Definition at line 509 of file compiler.cc.

Here is the call graph for this function:

§ interpret()

void Return::interpret ( Interpreter::Context c)
overridevirtual

Interpret the returned expression and then indicate in the context that we have hit a return statement and so should stop interpreting.

Implements AST::Statement.

Definition at line 690 of file interpreter.cc.

Member Data Documentation

§ expr

ASTPtr<Expression> AST::Return::expr

The expression that is returned.

Definition at line 725 of file ast.hh.


The documentation for this struct was generated from the following files: