#include <ast.h>
Inheritance diagram for primNode::
Public Methods | |
primNode (Type_qualifiers tq, basic_type basic, const Coord coord=Coord::Unknown) | |
Create a new primitive type. More... | |
primNode (Type_qualifiers tq, const Coord coord=Coord::Unknown) | |
Create a new default type primitive type. More... | |
primNode (const Coord coord) | |
Create a new default primitive type. More... | |
primNode (basic_type basic, const Coord coord=Coord::Unknown) | |
Create a new primitive type without type qualifiers. More... | |
virtual | ~primNode () |
Destroy a primNode. More... | |
bool | qualified_equal_to (typeNode *node2, bool strict_toplevel, bool strict_recursive) |
Virtual type comparison routine. 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. | |
const basic_type & | basic () const |
basic_type & | basic () |
void | basic (basic_type basic) |
Parser methods | |
These methods are only used during parsing. | |
void | finish () |
primNode * | finish_and () |
void | merge_in (primNode *other) |
primNode * | merge_in_and (primNode *other) |
Type predicates | |
virtual bool | is_int () const |
virtual bool | is_char () const |
virtual bool | is_float () const |
virtual bool | is_void () const |
virtual bool | is_ellipsis () const |
virtual bool | is_integer () const |
virtual bool | is_arithmetic () const |
virtual bool | is_scalar () const |
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 | |
basic_type | _basic |
The basic type. More... |
This class represents a primitive type and is really just an AST node container for a basic_type. Note that this includes the void
type.
The NodeType is Prim.
|
Create a new primitive type. The new type has the given basic type and type qualifiers.
|
|
Create a new default type primitive type. The new type has the given type qualifiers and the default basic type of int. This default is determined by calling the no-arg constructor for basic_type. (Was MakeDefaultPrimType in type.c)
|
|
Create a new default primitive type. The new type has no type qualifiers and the default basic type of int. This default is determined by calling the no-arg constructor for basic_type.
|
|
Create a new primitive type without type qualifiers. The new type has the given basic type and no type qualifiers. (Was StartPrimType in type.c)
|
|
Destroy a primNode.
|
|
|
|
|
|
|
|
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. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
Reimplemented from typeNode. |
|
|
|
|
|
Output a type.
Reimplemented from typeNode. |
|
Virtual type comparison routine. Each typeNode subclass overrides this routine to provide its specific type comparison. This is used by the static equal_to() method to perform general deep type comparison.
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 basic type. The basic_type class represents all the different variations of primitive types, such as int, char, float, etc. |