Zen
A cross-platform functional programming language

ExprVariableDef Class Reference

Base node class for VariableDef-derived classes that has an initialization expression. More...

#include <Ast.hpp>

Inheritance diagram for ExprVariableDef:
VariableDef Node InitVariableDef ParamVariableDef SharedVariableDef StructMemberVariableDef

List of all members.

Public Member Functions

const ExprgetExpr () 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.

Detailed Description

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.


Constructor & Destructor Documentation

ExprVariableDef ( const DefType defType,
const Ast::QualifiedType type,
const z::string name,
const Ast::Expr expr 
) [inline, protected]

Default constructor.

Parameters:
defTypeThe location where the variable is defined.
typeThe type of the variable being defined.
nameThe name of the variable being defined.
exprAST node holding the default value of the variable being defined.

Member Function Documentation

const Expr& getExpr ( ) const [inline]

Returns a reference to the expr node holding the default initial value of this variable.

Returns:
Reference to the init Expr.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines