ANTLR3C 3.3.1
ANTLR3_COMMON_TREE_struct Struct Reference

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

#include <antlr3commontree.h>

Collaboration diagram for ANTLR3_COMMON_TREE_struct:

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

◆ baseTree

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

◆ childIndex

ANTLR3_INT32 ANTLR3_COMMON_TREE_struct::childIndex

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

Referenced by antlr3SetCTAPI().

◆ factory

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

◆ parent

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

◆ startIndex

ANTLR3_MARKER ANTLR3_COMMON_TREE_struct::startIndex

Start token index that encases this tree.

Referenced by antlr3SetCTAPI(), and setTokenBoundaries().

◆ stopIndex

ANTLR3_MARKER ANTLR3_COMMON_TREE_struct::stopIndex

End token that encases this tree.

Referenced by antlr3SetCTAPI(), and setTokenBoundaries().

◆ super

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.

◆ token


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