Zen
A cross-platform functional programming language
|
Base node class for VariableDef-derived classes that has an initialization expression. More...
#include <Ast.hpp>
Public Member Functions | |
const Expr & | getExpr () const |
Returns a reference to the expr node holding the default initial value of this variable. | |
Protected Member Functions | |
ExprVariableDef (const DefType &defType, const Ast::QualifiedType &type, const z::string &name, const Ast::Expr &expr) | |
Default constructor. | |
Private Attributes | |
const Ast::Expr & | _expr |
Reference to the init Expr. |
Base node class for VariableDef-derived classes that has an initialization expression.
The Zen syntax allows default values to be assigned to certain variable definitions. For example, all struct members must have a default init value, as does all local declarations.
ExprVariableDef | ( | const DefType & | defType, |
const Ast::QualifiedType & | type, | ||
const z::string & | name, | ||
const Ast::Expr & | expr | ||
) | [inline, protected] |
Default constructor.
defType | The location where the variable is defined. |
type | The type of the variable being defined. |
name | The name of the variable being defined. |
expr | AST node holding the default value of the variable being defined. |
const Expr& getExpr | ( | ) | const [inline] |
Returns a reference to the expr node holding the default initial value of this variable.