#include <ast.h>
Inheritance diagram for tdefNode::
Public Methods | |
tdefNode (Type_qualifiers tq, const char *name, const Coord coord=Coord::Unknown) | |
Create a new typedef type. More... | |
tdefNode (idNode *the_id, Type_qualifiers tq, typeNode *the_type) | |
Create a typedef type from an identifier. More... | |
virtual | ~tdefNode () |
Destroy a tdefNode. More... | |
typeNode * | base_type (bool TdefIndir) const |
Return the base data type of a node. More... | |
virtual Node * | clone () const |
Clone the input node. More... | |
virtual void | output_type (output_context &ct, Node *par, Assoc context, Type_qualifiers q) |
Output a type. More... | |
Accessors | |
Methods to get and set fields in the class. | |
string & | name () |
Return the name of this typedef Node. More... | |
void | name (string name) |
Set the name of this typedef Node to the given value. More... | |
typeNode * | def () const |
Return this typedef Node's type definition. More... | |
void | def (typeNode *d) |
Set this typedef Node's type definition. More... | |
AST Traversal | |
virtual void | visit (Visitor *the_visitor) |
Dispatch a Visitor. More... | |
virtual void | walk (Walker &the_walker) |
Dispatch a Walker. More... | |
virtual Node * | change (Changer &the_changer, bool redispatch=false) |
Dispatch a Changer. More... | |
Private Attributes | |
string | _name |
Name of the type. More... | |
REF typeNode * | _def |
The underlying type. More... |
This class represents a typedef type. Since these types are just names for other types, objects of this class refer to the real underlying types that they represent. The original types can by found on the declaration with the typedef storage class specifier.
|
Create a new typedef type. The new typedef type has the given name and type qualifiers. The name should by in the scope of an appropriate typedef declaration.
|
|
Create a typedef type from an identifier.
|
|
Destroy a tdefNode.
|
|
Return the base data type of a node. This method differs from the Node::type() method in two respects. First, it follows some of the simple type inferences. For example, calling it on an idNode will return the type of its declaration. Second, the boolean argument indicates whether or not to follow typedef links.
Reimplemented from typeNode. |
|
Dispatch a Changer. This abstract method works much the walker, but allows the tree to be changed.
Reimplemented from Node. |
|
Clone the input node. This is not a "deep" clone, so be careful. For a deep clone, use the clone_changer class.
Reimplemented from Node. |
|
Set this typedef Node's type definition. To set the type definition to be empty, call this method with a value of NULL. |
|
Return this typedef Node's type definition.
|
|
Set the name of this typedef Node to the given value.
|
|
Return the name of this typedef Node.
|
|
Output a type.
Reimplemented from typeNode. |
|
Dispatch a Visitor. This abstract method is the entry point for the visitor design pattern. Each node subclass defines a visit() method that calls the appropriate at_ method in the visitor. For more information see the Visitor documentation.
Reimplemented from Node. |
|
Dispatch a Walker. This abstract method works much like the visitor, but instead walks the entire underlying subtree calling the appropriate at_ method at each node. For more information see the Walker documentation.
Reimplemented from Node. |
|
The underlying type. This is a reference to the underlying type. This reference is set up by the id_lookup_walker.
|
|
Name of the type. This name is the same as the name in the declaration that introduced the typedef. |