Zen
A cross-platform functional programming language
|
AST Node representing Variable Scope. More...
#include <Ast.hpp>
Public Types | |
enum | Type { InParam, Block, Continuation } |
The type of the scope. More... | |
Public Member Functions | |
Scope (const Type &type) | |
Default constructor. | |
const Type & | getType () const |
Returns the scope type. | |
const Ast::VariableDef & | addDef (const Ast::VariableDef &child) |
Adds a VariableDef to the scope. | |
const VariableDefMap & | getDefList () const |
Returns a reference to the VariableDef list. | |
Private Attributes | |
const Type | _type |
The type of this scope. | |
VariableDefMap | _defList |
The VariableDef list managed by this class. |
AST Node representing Variable Scope.
Every VariableDef has a scope within which it is visible and alive. For example, a local variable's scope is the compound block sorrounding the variable declaration, or a for() variable's scope is the statement's compound block. A continuation is a sequence of named closures, each of which is represented as a named variable that exists for the lifetime of the continuation.
enum Type |
const Ast::VariableDef& addDef | ( | const Ast::VariableDef & | child | ) | [inline] |
Adds a VariableDef to the scope.
child | VariableDef to add |
const VariableDefMap& getDefList | ( | ) | const [inline] |
Returns a reference to the VariableDef list.
const Type& getType | ( | ) | const [inline] |
Returns the scope type.