Zen
A cross-platform functional programming language
|
Base node class typespecs that have a parent type. More...
#include <Ast.hpp>
Public Member Functions | |
void | setParent (TypeSpec &parent) |
Sets the parent type for this type. | |
TypeSpec * | hasParent () const |
Checks if this TypeSpec has a parent TypeSpec. | |
TypeSpec & | getParent () const |
Returns the parent TypeSpec. | |
virtual z::string | getFullName (const z::string &sep) const |
Returns the full name of the type, calling it's parent recursively. | |
Protected Member Functions | |
ChildTypeSpec (const AccessType::T &accessType, const z::string &name) | |
The constructor for the type without an initial parent. | |
ChildTypeSpec (const AccessType::T &accessType, TypeSpec &parent, const z::string &name) | |
The constructor for the type with an initial parent. | |
Private Attributes | |
TypeSpec * | _parent |
Pointer to parent TypeSpec. |
Base node class typespecs that have a parent type.
All ChildTypeSpec-derived classes must have a parent TypeSpec.
ChildTypeSpec | ( | const AccessType::T & | accessType, |
const z::string & | name | ||
) | [inline, protected] |
The constructor for the type without an initial parent.
The parent member must be set after instantion , but before use, using setParent()
accessType | Specifies the AccessType for this type, for example, whether it is a public or a private type. |
name | The name of the type. |
ChildTypeSpec | ( | const AccessType::T & | accessType, |
TypeSpec & | parent, | ||
const z::string & | name | ||
) | [inline, protected] |
The constructor for the type with an initial parent.
accessType | Specifies the AccessType for this type, for example, whether it is a public or a private type. |
parent | The parent type of this type. |
name | The name of the type. |
TypeSpec* hasParent | ( | ) | const [inline] |
void setParent | ( | TypeSpec & | parent | ) | [inline] |
Sets the parent type for this type.
This is a one-time operation, parent cannot be set more than once.
parent | The parent TypeSpec |