ANTLR3_BASE_TREE_struct Struct Reference

#include <antlr3basetree.h>

Collaboration diagram for ANTLR3_BASE_TREE_struct:

Collaboration graph
[legend]

Detailed Description

A generic tree implementation with no payload.

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.


Field Documentation

void(* ANTLR3_BASE_TREE_struct::addChild)(struct ANTLR3_BASE_TREE_struct *tree, void *child)

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().

Referenced by addChild(), antlr3SetCTAPI(), and setChild().

Referenced by antlr3BaseTreeNew(), and deleteChild().

Referenced by antlr3BaseTreeNew(), and dupTree().

Referenced by addChild(), and antlr3SetCTAPI().

Referenced by antlr3BaseTreeNew().

Referenced by antlr3BaseTreeNew().

Referenced by antlr3SetCTAPI(), and getParent().

A pointer to a function that returns the common token pointer for the payload in the supplied tree.

Referenced by antlr3SetCTAPI(), displayRecognitionError(), and getMissingSymbol().

void(* ANTLR3_BASE_TREE_struct::replaceChildren)(struct ANTLR3_BASE_TREE_struct *parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, struct ANTLR3_BASE_TREE_struct *t)

This is used to store the current child index position while descending and ascending trees as the tree walk progresses.

Referenced by antlr3BaseTreeNew(), and setChild().

A string factory to produce strings for toString etc.

Referenced by antlr3ArboretumNew(), antlr3BaseTreeNew(), antlr3CommonTreeNodeStreamNewTree(), newPoolTree(), toString(), 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().


The documentation for this struct was generated from the following file:

Generated on Mon Nov 29 17:24:03 2010 for ANTLR3C by  doxygen 1.5.5