ANTLR3_COMMON_TREE_struct man page

ANTLR3_COMMON_TREE_struct — Interface for an ANTLR3 common tree which is what gets passed around by the AST producing parser.

Synopsis

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

Detailed Description

Interface for an ANTLR3 common tree which is what gets passed around by the AST producing parser.

Field Documentation

ANTLR3_BASE_TREE ANTLR3_COMMON_TREE_struct::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. 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 _LT(), addNavigationNode(), antlr3ArboretumNew(), antlr3SetCTAPI(), getMissingSymbol(), LB(), newDownNode(), newFromTree(), newPoolTree(), newUpNode(), and reuse().

ANTLR3_INT32 ANTLR3_COMMON_TREE_struct::childIndex

What index is this particular node in the child list it belongs to?

Referenced by antlr3SetCTAPI().

pANTLR3_ARBORETUM ANTLR3_COMMON_TREE_struct::factory

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

pANTLR3_COMMON_TREE ANTLR3_COMMON_TREE_struct::parent

Points to the node that has this node as a child. If this is NULL, then this is the root node.

Referenced by antlr3SetCTAPI().

ANTLR3_MARKER ANTLR3_COMMON_TREE_struct::startIndex

Start token index that encases this tree.

Referenced by antlr3SetCTAPI(), and setTokenBoundaries().

ANTLR3_MARKER ANTLR3_COMMON_TREE_struct::stopIndex

End token that encases this tree.

Referenced by antlr3SetCTAPI(), and setTokenBoundaries().

void* ANTLR3_COMMON_TREE_struct::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 ANTLR3_COMMON_TREE_struct::token

A single token, this is the payload for the tree.

Referenced by antlr3CommonTreeNewFromToken(), antlr3CommonTreeNodeStreamFree(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3RecognitionExceptionNew(), antlr3SetCTAPI(), getLine(), getType(), and newFromTree().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.

Referenced By

antlr3-baseTree(3), antlr3-childIndex(3), antlr3-factory(3), antlr3-parent(3), antlr3-startIndex(3), antlr3-stopIndex(3) and antlr3-token(3) are aliases of ANTLR3_COMMON_TREE_struct(3).

Tue Oct 4 2016 Version 3.3.1 ANTLR3C