Zen
A cross-platform functional programming language
|
Base node class for all variable definitions. More...
#include <Ast.hpp>
Public Types | |
enum | DefType { Param, Closure, Local, Shared } |
Enumerates different places wher variables are defined. More... | |
typedef z::list< VariableDef * > | List |
Default list of VariableDef nodes To be used wherever required by any of the other nodes. | |
Public Member Functions | |
VariableDef (const DefType &defType, const Ast::QualifiedType &type, const z::string &name) | |
Constructor for VariableDef. | |
const DefType & | getDefType () const |
Returns the location where the variable is defined. | |
const Ast::QualifiedType & | getType () const |
Returns the type of the defined variable. | |
const z::string & | getName () const |
Returns the variable name. | |
Private Attributes | |
const DefType | _defType |
The location where the variable is defined. | |
const Ast::QualifiedType & | _type |
The type of the defined variable. | |
z::string | _name |
The variable name. |
Base node class for all variable definitions.
There are various places where variables can be defined, such as local variables in a function block, function in-parameters, struct members, etc. This class is the base class for all AST nodes representing variable definitions.
enum DefType |
Enumerates different places wher variables are defined.
Closure |
A function in-param.
|
Local |
A named closure within a continuation. |
Shared |
A local variable within a function block. |
VariableDef | ( | const DefType & | defType, |
const Ast::QualifiedType & | type, | ||
const z::string & | name | ||
) | [inline] |
Constructor for VariableDef.
defType | The location where the variable is defined. |
type | The type of the variable being defined. |
name | The name of the variable being defined. |
const DefType& getDefType | ( | ) | const [inline] |
Returns the location where the variable is defined.
const z::string& getName | ( | ) | const [inline] |
Returns the variable name.
const Ast::QualifiedType& getType | ( | ) | const [inline] |
Returns the type of the defined variable.