ANTLR3C  3.3.1
ANTLR3_BASE_TREE_struct Struct Reference

A generic tree implementation with no payload. More...

#include <antlr3basetree.h>

Collaboration diagram for ANTLR3_BASE_TREE_struct:

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. More...
 
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. More...
 
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. More...
 
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. More...
 
void * super
 Implementers of this interface sometimes require a pointer to their selves. More...
 
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. More...
 

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".

Field Documentation

◆ addChild

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

◆ addChildren

void(* ANTLR3_BASE_TREE_struct::addChildren) (struct ANTLR3_BASE_TREE_struct *tree, pANTLR3_LIST kids)

Referenced by antlr3BaseTreeNew().

◆ children

pANTLR3_VECTOR ANTLR3_BASE_TREE_struct::children

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

◆ createChildrenList

void(* ANTLR3_BASE_TREE_struct::createChildrenList) (struct ANTLR3_BASE_TREE_struct *tree)

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

◆ deleteChild

void*(* ANTLR3_BASE_TREE_struct::deleteChild) (struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i)

Referenced by antlr3BaseTreeNew(), and deleteChild().

◆ dupNode

void*(* ANTLR3_BASE_TREE_struct::dupNode) (struct ANTLR3_BASE_TREE_struct *dupNode)

◆ dupTree

void*(* ANTLR3_BASE_TREE_struct::dupTree) (struct ANTLR3_BASE_TREE_struct *tree)

Referenced by antlr3BaseTreeNew(), and dupTree().

◆ free

void(* ANTLR3_BASE_TREE_struct::free) (struct ANTLR3_BASE_TREE_struct *tree)

Referenced by addChild(), and antlr3SetCTAPI().

◆ freshenPACIndexes

void(* ANTLR3_BASE_TREE_struct::freshenPACIndexes) (struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 offset)

◆ freshenPACIndexesAll

void(* ANTLR3_BASE_TREE_struct::freshenPACIndexesAll) (struct ANTLR3_BASE_TREE_struct *tree)

Referenced by antlr3BaseTreeNew().

◆ getCharPositionInLine

ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getCharPositionInLine) (struct ANTLR3_BASE_TREE_struct *tree)

◆ getChild

◆ getChildCount

◆ getChildIndex

ANTLR3_INT32(* ANTLR3_BASE_TREE_struct::getChildIndex) (struct ANTLR3_BASE_TREE_struct *tree)

◆ getFirstChildWithType

void*(* ANTLR3_BASE_TREE_struct::getFirstChildWithType) (struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 type)

Referenced by antlr3BaseTreeNew().

◆ getLine

ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getLine) (struct ANTLR3_BASE_TREE_struct *tree)

◆ getParent

struct ANTLR3_BASE_TREE_struct*(* ANTLR3_BASE_TREE_struct::getParent) (struct ANTLR3_BASE_TREE_struct *tree)

Referenced by antlr3SetCTAPI(), and getParent().

◆ getText

pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::getText) (struct ANTLR3_BASE_TREE_struct *tree)

◆ getToken

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

◆ getType

ANTLR3_UINT32(* ANTLR3_BASE_TREE_struct::getType) (struct ANTLR3_BASE_TREE_struct *tree)

◆ isNilNode

◆ replaceChildren

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

◆ reuse

void(* ANTLR3_BASE_TREE_struct::reuse) (struct ANTLR3_BASE_TREE_struct *tree)

◆ savedIndex

ANTLR3_MARKER ANTLR3_BASE_TREE_struct::savedIndex

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

◆ setChild

void(* ANTLR3_BASE_TREE_struct::setChild) (struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_UINT32 i, void *child)

Referenced by antlr3BaseTreeNew(), and setChild().

◆ setChildIndex

void(* ANTLR3_BASE_TREE_struct::setChildIndex) (struct ANTLR3_BASE_TREE_struct *tree, ANTLR3_INT32)

◆ setParent

void(* ANTLR3_BASE_TREE_struct::setParent) (struct ANTLR3_BASE_TREE_struct *tree, struct ANTLR3_BASE_TREE_struct *parent)

◆ strFactory

pANTLR3_STRING_FACTORY ANTLR3_BASE_TREE_struct::strFactory

A string factory to produce strings for toString etc.

Referenced by antlr3ArboretumNew(), antlr3BaseTreeNew(), antlr3CommonTreeNodeStreamNewTree(), newPoolTree(), toString(), and toStringTree().

◆ super

◆ toString

pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::toString) (struct ANTLR3_BASE_TREE_struct *tree)

◆ toStringTree

pANTLR3_STRING(* ANTLR3_BASE_TREE_struct::toStringTree) (struct ANTLR3_BASE_TREE_struct *tree)

◆ u

void* ANTLR3_BASE_TREE_struct::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.

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: