#include <ast.h>
Inheritance diagram for subdeclNode::
Public Methods | |
subdeclNode (declNode *orig, int index) | |
Create a sub-declaration. More... | |
virtual | ~subdeclNode () |
Destroy a subdeclNode. More... | |
string | name_with_index () |
Get the name with index. More... | |
virtual Node * | clone () const |
Clone the input node. More... | |
virtual void | output (output_context &ct, Node *par) |
Generate C code. More... | |
Accessors | |
Methods to get and set fields in the class. | |
virtual declNode * | original () |
SSA original declaration. More... | |
int | index () 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 | |
REF declNode * | _original |
int | _index |
Subclass of declNode used to create derived indexed declarations. It is currently only used in the SSA pass, which creates a series of indexed version of each variable. A subdeclNode consists of a base declaration and a subscript. For example, the indexed declaration for
has the declaration for x as it base and has a subscript of 1. Sometimes, the subdeclNode's base is also refered to as its "original" declaration. The subdeclNode's subscript is also called its version or its index.
The NodeType is Decl.
|
Create a sub-declaration. This constructor creates a new sub-declaration of the given input declaration. The index indicates which version (or subscript) to associate with the sub-declaration.
|
|
Destroy a subdeclNode.
|
|
Dispatch a Changer. This abstract method works much the walker, but allows the tree to be changed.
Reimplemented from declNode. |
|
Clone the input node. This is not a "deep" clone, so be careful. For a deep clone, use the clone_changer class.
Reimplemented from declNode. |
|
|
|
Get the name with index.
This method returns the name of the declaration, with its index appended. For example, when this method is called on the subdeclaration for
|
|
SSA original declaration. For use with subdeclNode when the code is in SSA form. This method returns the original declaration from which the sub-declaration was derived.
Reimplemented from declNode. |
|
Generate C code. Each subclass overrides this method to define how to produce the output C code. To use this method, pass an output_context and a null parent.
Reimplemented from declNode. |
|
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 declNode. |
|
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 declNode. |
|
|
|
|