ANTLR3_ARBORETUM_struct Struct Reference

#include <antlr3commontree.h>

Collaboration diagram for ANTLR3_ARBORETUM_struct:

Collaboration graph
[legend]

Detailed Description

ANTLR3 Tree factory interface to create lots of trees efficiently rather than creating and freeing lots of little bits of memory.

Data Fields

void(* close )(struct ANTLR3_ARBORETUM_struct *factory)
 Pointer to a function the destroys the factory.
pANTLR3_BASE_TREE(* newFromToken )(struct ANTLR3_ARBORETUM_struct *factory, pANTLR3_COMMON_TOKEN token)
pANTLR3_BASE_TREE(* newFromTree )(struct ANTLR3_ARBORETUM_struct *factory, pANTLR3_COMMON_TREE tree)
pANTLR3_BASE_TREE(* newTree )(struct ANTLR3_ARBORETUM_struct *factory)
 Pointer to a function that returns a new tree.
ANTLR3_UINT32 nextTree
 The next token to throw out from the pool, will cause a new pool allocation if this exceeds the available tokenCount.
pANTLR3_STACK nilStack
 A resuse stack for reclaiming Nil nodes that were used in rewrites and are now dead.
pANTLR3_COMMON_TREEpools
 Pointers to the array of tokens that this factory has produced so far.
ANTLR3_INT32 thisPool
 Current pool tokens we are allocating from.
ANTLR3_COMMON_TREE unTruc
 Trick to initialize tokens and their API quickly, we set up this token when the factory is created, then just copy the memory it uses into the new token.
pANTLR3_VECTOR_FACTORY vFactory
 Pointer to a vector factory that is used to create child list vectors for any child nodes that need them.

Field Documentation

Pointer to a function the destroys the factory.

Referenced by antlr3ArboretumNew(), and ctaFree().

Referenced by antlr3ArboretumNew().

Referenced by antlr3ArboretumNew(), and dupNode().

Pointer to a function that returns a new tree.

Referenced by antlr3ArboretumNew(), newFromToken(), and newFromTree().

The next token to throw out from the pool, will cause a new pool allocation if this exceeds the available tokenCount.

Referenced by newPool(), and newPoolTree().

A resuse stack for reclaiming Nil nodes that were used in rewrites and are now dead.

The nilNode() method will eat one of these before creating a new node.

Referenced by antlr3ArboretumNew(), factoryClose(), newPoolTree(), and reuse().

Pointers to the array of tokens that this factory has produced so far.

Referenced by antlr3ArboretumNew(), factoryClose(), newPool(), and newPoolTree().

Current pool tokens we are allocating from.

Referenced by antlr3ArboretumNew(), factoryClose(), newPool(), and newPoolTree().

Trick to initialize tokens and their API quickly, we set up this token when the factory is created, then just copy the memory it uses into the new token.

Referenced by antlr3ArboretumNew(), and newPoolTree().

Pointer to a vector factory that is used to create child list vectors for any child nodes that need them.

This means that we auto track the vectors and auto free them when we close the factory. It also means that all rewriting trees can use the same tree factory and the same vector factory and we do not dup any nodes unless we must do so explicitly because of context such as an empty rewrite stream and ->IMAGINARY[ID] so on. This makes memory tracking much simpler and tempts no errors.

Referenced by antlr3ArboretumNew(), and factoryClose().


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

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