Zen
A cross-platform functional programming language

EnumMemberDef Class Reference

Concrete AST Node representing a member of a user-defined enumeration. More...

#include <Ast.hpp>

Inheritance diagram for EnumMemberDef:
ChildTypeSpec TypeSpec Node

List of all members.

Public Member Functions

 EnumMemberDef (const AccessType::T &accessType, const z::string &name, const bool &hasInit, const Ast::Expr &initExpr)
 Default constructor.
const bool & hasInitExpr () const
 Checks whether the enum member has an init expression.
const Ast::ExprgetInitExpr () const
 Returns the initial value expression of the member.

Private Member Functions

virtual void visit (TypeSpec::Visitor &visitor) const
 Visitor pattern implementation.

Private Attributes

const bool _hasInit
 True if member has an init value, else false.
const Ast::Expr_initExpr
 A reference to the initial value expression for this member.

Detailed Description

Concrete AST Node representing a member of a user-defined enumeration.


Constructor & Destructor Documentation

EnumMemberDef ( const AccessType::T accessType,
const z::string name,
const bool &  hasInit,
const Ast::Expr initExpr 
) [inline]

Default constructor.

Parameters:
accessTypeThe AccessType for this enum member.
nameName of the member
hasInitTrue if the member has an initial value
initExprExpr representing the initial value of the member

Member Function Documentation

const Ast::Expr& getInitExpr ( ) const [inline]

Returns the initial value expression of the member.

Returns:
A reference to the initial value expression for the member
const bool& hasInitExpr ( ) const [inline]

Checks whether the enum member has an init expression.

Returns:
True if member has an init value, else false
void visit ( TypeSpec::Visitor visitor) const [private, virtual]

Visitor pattern implementation.

Parameters:
visitorThe visitor object.

Implements TypeSpec.


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