#include <antlr3basetree.h>
You must subclass to actually have any user data. ANTLR v3 uses a list of children approach instead of the child-sibling approach in v2. A flat tree (a list) is an empty node whose children represent the list. An empty (as in it does not have payload itself), but non-null node is called "nil".
Data Fields | |
void(* | addChild )(struct ANTLR3_BASE_TREE_struct *tree, void *child) |
void(* | addChildren )(struct ANTLR3_BASE_TREE_struct *tree, pANTLR3_LIST kids) |
pANTLR3_VECTOR | children |
The list of all the children that belong to this node. | |
void(* | createChildrenList )(struct ANTLR3_BASE_TREE_struct *tree) |
void *(* | deleteChild )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i) |
void *(* | dupNode )(struct ANTLR3_BASE_TREE_struct *dupNode) |
void *(* | dupTree )(struct ANTLR3_BASE_TREE_struct *tree) |
void(* | free )(struct ANTLR3_BASE_TREE_struct *tree) |
void(* | freshenPACIndexes )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 offset) |
void(* | freshenPACIndexesAll )(struct ANTLR3_BASE_TREE_struct *tree) |
ANTLR3_UINT32(* | getCharPositionInLine )(struct ANTLR3_BASE_TREE_struct *tree) |
void *(* | getChild )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i) |
ANTLR3_UINT32(* | getChildCount )(struct ANTLR3_BASE_TREE_struct *tree) |
ANTLR3_INT32(* | getChildIndex )(struct ANTLR3_BASE_TREE_struct *tree) |
void *(* | getFirstChildWithType )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 type) |
ANTLR3_UINT32(* | getLine )(struct ANTLR3_BASE_TREE_struct *tree) |
struct ANTLR3_BASE_TREE_struct *(* | getParent )(struct ANTLR3_BASE_TREE_struct *tree) |
pANTLR3_STRING(* | getText )(struct ANTLR3_BASE_TREE_struct *tree) |
pANTLR3_COMMON_TOKEN(* | getToken )(struct ANTLR3_BASE_TREE_struct *tree) |
A pointer to a function that returns the common token pointer for the payload in the supplied tree. | |
ANTLR3_UINT32(* | getType )(struct ANTLR3_BASE_TREE_struct *tree) |
ANTLR3_BOOLEAN(* | isNilNode )(struct ANTLR3_BASE_TREE_struct *tree) |
void(* | replaceChildren )(struct ANTLR3_BASE_TREE_struct *parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, struct ANTLR3_BASE_TREE_struct *t) |
void(* | reuse )(struct ANTLR3_BASE_TREE_struct *tree) |
ANTLR3_MARKER | savedIndex |
This is used to store the current child index position while descending and ascending trees as the tree walk progresses. | |
void(* | setChild )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i, void *child) |
void(* | setChildIndex )(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_INT32) |
void(* | setParent )(struct ANTLR3_BASE_TREE_struct *tree, struct ANTLR3_BASE_TREE_struct *parent) |
pANTLR3_STRING_FACTORY | strFactory |
A string factory to produce strings for toString etc. | |
void * | super |
Implementers of this interface sometimes require a pointer to their selves. | |
pANTLR3_STRING(* | toString )(struct ANTLR3_BASE_TREE_struct *tree) |
pANTLR3_STRING(* | toStringTree )(struct ANTLR3_BASE_TREE_struct *tree) |
void * | u |
Generic void pointer allows the grammar programmer to attach any structure they like to a tree node, in many cases saving the need to create their own tree and tree adaptors. |
void(* ANTLR3_BASE_TREE_struct::addChild)(struct ANTLR3_BASE_TREE_struct *tree, void *child) |
Referenced by addChild(), addChildren(), antlr3BaseTreeNew(), becomeRoot(), dbgAddChild(), and dupTree().
void(* ANTLR3_BASE_TREE_struct::addChildren)(struct ANTLR3_BASE_TREE_struct *tree, pANTLR3_LIST kids) |
Referenced by antlr3BaseTreeNew().
The list of all the children that belong to this node.
They are not part of the node as they belong to the common tree node that implements this.
Referenced by addChild(), antlr3BaseTreeNew(), antlr3SetCTAPI(), createChildrenList(), deleteChild(), dupTree(), getChild(), getChildCount(), getFirstChildWithType(), replaceChildren(), reuse(), setChild(), and toStringTree().
void(* ANTLR3_BASE_TREE_struct::createChildrenList)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by addChild(), antlr3SetCTAPI(), and setChild().
void*(* ANTLR3_BASE_TREE_struct::deleteChild)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i) |
Referenced by antlr3BaseTreeNew(), and deleteChild().
void*(* ANTLR3_BASE_TREE_struct::dupNode)(struct ANTLR3_BASE_TREE_struct *dupNode) |
Referenced by antlr3SetCTAPI(), dupNode(), dupTree(), dupTreeTT(), and getMissingSymbol().
void*(* ANTLR3_BASE_TREE_struct::dupTree)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew(), and dupTree().
void(* ANTLR3_BASE_TREE_struct::free)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by addChild(), and antlr3SetCTAPI().
void(* ANTLR3_BASE_TREE_struct::freshenPACIndexes)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 offset) |
Referenced by antlr3BaseTreeNew(), freshenPACIndexesAll(), and replaceChildren().
void(* ANTLR3_BASE_TREE_struct::freshenPACIndexesAll)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew().
ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getCharPositionInLine)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew(), antlr3SetCTAPI(), displayRecognitionError(), and getCharPositionInLine().
void*(* ANTLR3_BASE_TREE_struct::getChild)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i) |
Referenced by antlr3BaseTreeNew(), becomeRoot(), freshenPACIndexes(), getCharPositionInLine(), getChild(), getLine(), and rulePostProcessing().
ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getChildCount)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew(), becomeRoot(), fillBuffer(), freshenPACIndexes(), getCharPositionInLine(), getChildCount(), getLine(), and rulePostProcessing().
ANTLR3_INT32(* ANTLR3_BASE_TREE_struct::getChildIndex)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3SetCTAPI(), dupTreeTT(), and getChildIndex().
void*(* ANTLR3_BASE_TREE_struct::getFirstChildWithType)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 type) |
Referenced by antlr3BaseTreeNew().
ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getLine)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew(), antlr3SetCTAPI(), and getLine().
struct ANTLR3_BASE_TREE_struct*(* ANTLR3_BASE_TREE_struct::getParent)(struct ANTLR3_BASE_TREE_struct *tree) [read] |
Referenced by antlr3SetCTAPI(), and getParent().
pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::getText)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3SetCTAPI(), getText(), and replaceChildren().
pANTLR3_COMMON_TOKEN(* ANTLR3_BASE_TREE_struct::getToken)(struct ANTLR3_BASE_TREE_struct *tree) |
A pointer to a function that returns the common token pointer for the payload in the supplied tree.
Referenced by antlr3SetCTAPI(), displayRecognitionError(), and getMissingSymbol().
ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getType)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3SetCTAPI(), getFirstChildWithType(), and getType().
ANTLR3_BOOLEAN(* ANTLR3_BASE_TREE_struct::isNilNode)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by addChild(), antlr3SetCTAPI(), becomeRoot(), freeNodeRS(), isNilNode(), replaceChildren(), rulePostProcessing(), toString(), and toStringTree().
void(* ANTLR3_BASE_TREE_struct::replaceChildren)(struct ANTLR3_BASE_TREE_struct *parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, struct ANTLR3_BASE_TREE_struct *t) |
Referenced by antlr3BaseTreeNew(), and replaceChildren().
void(* ANTLR3_BASE_TREE_struct::reuse)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3SetCTAPI(), becomeRoot(), and rulePostProcessing().
This is used to store the current child index position while descending and ascending trees as the tree walk progresses.
void(* ANTLR3_BASE_TREE_struct::setChild)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i, void *child) |
Referenced by antlr3BaseTreeNew(), and setChild().
void(* ANTLR3_BASE_TREE_struct::setChildIndex)(struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_INT32) |
Referenced by antlr3SetCTAPI(), freshenPACIndexes(), replaceChildren(), rulePostProcessing(), and setChildIndex().
void(* ANTLR3_BASE_TREE_struct::setParent)(struct ANTLR3_BASE_TREE_struct *tree, struct ANTLR3_BASE_TREE_struct *parent) |
Referenced by antlr3SetCTAPI(), freshenPACIndexes(), replaceChildren(), rulePostProcessing(), and setParent().
A string factory to produce strings for toString etc.
Referenced by antlr3ArboretumNew(), antlr3BaseTreeNew(), antlr3CommonTreeNodeStreamNewTree(), newPoolTree(), toString(), and toStringTree().
Implementers of this interface sometimes require a pointer to their selves.
Referenced by antlr3SetCTAPI(), createChildrenList(), displayRecognitionError(), dupNode(), getCharPositionInLine(), getChildIndex(), getLine(), getMissingSymbol(), getParent(), getToken(), getTokenStartIndex(), getTokenStopIndex(), getType(), isNilNode(), newFromToken(), newFromTree(), newPoolTree(), reuse(), setChildIndex(), setParent(), setTokenBoundaries(), and toString().
pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::toString)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3SetCTAPI(), getText(), and toStringTree().
pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::toStringTree)(struct ANTLR3_BASE_TREE_struct *tree) |
Referenced by antlr3BaseTreeNew(), displayRecognitionError(), and toStringTree().
Generic void pointer allows the grammar programmer to attach any structure they like to a tree node, in many cases saving the need to create their own tree and tree adaptors.
ANTLR does not use this pointer, but will copy it for you and so on.
Referenced by antlr3SetCTAPI(), and newFromTree().