#include <antlr3commontree.h>
Data Fields | |
ANTLR3_BASE_TREE | baseTree |
An encapsulated BASE TREE structure (NOT a pointer) that performs a lot of the dirty work of node management To this we add just a few functions that are specific to the payload. | |
ANTLR3_INT32 | childIndex |
What index is this particular node in the child list it belongs to? | |
pANTLR3_ARBORETUM | factory |
Pointer to the tree factory that manufactured this token. | |
pANTLR3_COMMON_TREE | parent |
Points to the node that has this node as a child. | |
ANTLR3_MARKER | startIndex |
Start token index that encases this tree. | |
ANTLR3_MARKER | stopIndex |
End token that encases this tree. | |
void * | super |
Not used by ANTLR, but if a super structure is created above this structure, it can be used to point to the start of the super structure, where additional data and function pointers can be stored. | |
pANTLR3_COMMON_TOKEN | token |
A single token, this is the payload for the tree. |
An encapsulated BASE TREE structure (NOT a pointer) that performs a lot of the dirty work of node management To this we add just a few functions that are specific to the payload.
You can further abstract common tree so long as you always have a baseTree pointer in the top structure and copy it from the next one down. So, lets say we have a structure JIMS_TREE. It needs an ANTLR3_BASE_TREE that will support all the general tree duplication stuff. It needs a ANTLR3_COMMON_TREE structure embedded or completely provides the equivalent interface. It provides it's own methods and data. To create a new one of these, the function provided to the tree adaptor (see comments there) should allocate the memory for a new JIMS_TREE structure, then call antlr3InitCommonTree(<addressofembeddedCOMMON_TREE>) antlr3BaseTreeNew(<addressofBASETREE>) The interfaces for BASE_TREE and COMMON_TREE will then be initialized. You then call and you can override them or just init JIMS_TREE (note that the base tree in common tree will be ignored) just the top level base tree is used). Codegen will take care of the rest.
Referenced by antlr3ArboretumNew(), antlr3SetCTAPI(), getMissingSymbol(), LB(), newFromTree(), newPoolTree(), and reuse().
Pointer to the tree factory that manufactured this token.
This can be used by duplication methods and so on to manufacture another auto-tracked common tree structure
Referenced by antlr3ArboretumNew(), dupNode(), newPoolTree(), and reuse().
Points to the node that has this node as a child.
If this is NULL, then this is the root node.
Referenced by antlr3SetCTAPI().
Not used by ANTLR, but if a super structure is created above this structure, it can be used to point to the start of the super structure, where additional data and function pointers can be stored.
A single token, this is the payload for the tree.
Referenced by antlr3CommonTreeNewFromToken(), antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3RecognitionExceptionNew(), antlr3SetCTAPI(), getLine(), getType(), and newFromTree().