Zen
A cross-platform functional programming language
|
Concrete AST Node representing a user-defined struct. More...
#include <Ast.hpp>
Public Member Functions | |
StructDef (const AccessType::T &accessType, const z::string &name, const NativeType &ntype) | |
Default constructor. | |
void | setDefList (const VariableDefMap &defList) |
Sets the list of member variables for this struct. | |
bool | hasDefList () const |
Checks whether the member list has been set. | |
const VariableDefMap & | getDefList () const |
Returns a reference to the VariableDef list. | |
void | setSubTypeList (const StructDefList &subTypeList) |
Sets the list of subtypes for this struct. | |
bool | hasSubTypeList () const |
Checks whether the subtype list has been set. | |
const StructDefList & | getSubTypeList () const |
Returns a reference to the subtype list. | |
Private Member Functions | |
virtual void | visit (TypeSpec::Visitor &visitor) const |
Visitor pattern implementation. | |
virtual const Ast::VariableDef * | hasMember (const z::string &name) const |
Checks if struct member exists. | |
Private Attributes | |
const VariableDefMap * | _defList |
struct member list | |
const StructDefList * | _subTypeList |
struct subtype list |
Concrete AST Node representing a user-defined struct.
StructDef | ( | const AccessType::T & | accessType, |
const z::string & | name, | ||
const NativeType & | ntype | ||
) | [inline] |
Default constructor.
accessType | The AccessType for this UDT. |
name | Name of the UDT |
ntype | The NativeType of this UDT. |
const VariableDefMap& getDefList | ( | ) | const [inline] |
Returns a reference to the VariableDef list.
const StructDefList& getSubTypeList | ( | ) | const [inline] |
Returns a reference to the subtype list.
bool hasDefList | ( | ) | const [inline] |
Checks whether the member list has been set.
const Ast::VariableDef * hasMember | ( | const z::string & | name | ) | const [private, virtual] |
Checks if struct member exists.
name | Name of member to be checked |
Reimplemented from TypeSpec.
bool hasSubTypeList | ( | ) | const [inline] |
Checks whether the subtype list has been set.
void setDefList | ( | const VariableDefMap & | defList | ) | [inline] |
Sets the list of member variables for this struct.
This is a one-time operation, the list cannot be set more than once.
defList | The member list |
void setSubTypeList | ( | const StructDefList & | subTypeList | ) | [inline] |
Sets the list of subtypes for this struct.
This is a one-time operation, the list cannot be set more than once.
subTypeList | The subtype list |
void visit | ( | TypeSpec::Visitor & | visitor | ) | const [private, virtual] |