ANTLR3_ARBORETUM_struct(3)
π ANTLR3_ARBORETUM_struct(3) π
okay bestie, welcome to the ANTLR3C man page for ANTLR3_ARBORETUM_struct β yes it's a mouthful, yes it's iconic, and yes it's literally the tree factory that makes a TON of trees efficiently instead of doing the chaotic little create-and-free-every-single-bit-of-memory dance. π³β¨
πΈ NAME πΈ
ANTLR3_ARBORETUM_struct β the ANTLR3 Tree factory interface to create lots of trees efficiently rather than creating and freeing lots of little bits of memory. no cap, that's the whole vibe π
π¦ SYNOPSIS π¦
#include <antlr3commontree.h>
β¨ 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_TREE * poolsβ 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.
π Detailed Description π
ANTLR3_ARBORETUM_struct β the ANTLR3 Tree factory interface to create lots of trees efficiently rather than creating and freeing lots of little bits of memory. periodt. π
π Field Documentation π
π void(* ANTLR3_ARBORETUM_struct::close) (struct ANTLR3_ARBORETUM_struct *factory)
Pointer to a function the destroys the factory.
Referenced by antlr3ArboretumNew(), and ctaFree().
π pANTLR3_BASE_TREE(* ANTLR3_ARBORETUM_struct::newFromToken) (struct ANTLR3_ARBORETUM_struct *factory, pANTLR3_COMMON_TOKEN token)
Referenced by antlr3ArboretumNew().
π pANTLR3_BASE_TREE(* ANTLR3_ARBORETUM_struct::newFromTree) (struct ANTLR3_ARBORETUM_struct *factory, pANTLR3_COMMON_TREE tree)
Referenced by antlr3ArboretumNew(), and dupNode().
π pANTLR3_BASE_TREE(* ANTLR3_ARBORETUM_struct::newTree) (struct ANTLR3_ARBORETUM_struct *factory)
Pointer to a function that returns a new tree.
Referenced by antlr3ArboretumNew(), newFromToken(), and newFromTree().
π ANTLR3_UINT32 ANTLR3_ARBORETUM_struct::nextTree
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().
π pANTLR3_STACK ANTLR3_ARBORETUM_struct::nilStack
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. bestie is recycling π₯
Referenced by antlr3ArboretumNew(), factoryClose(), newPoolTree(), and reuse().
π pANTLR3_COMMON_TREE* ANTLR3_ARBORETUM_struct::pools
Pointers to the array of tokens that this factory has produced so far.
Referenced by antlr3ArboretumNew(), factoryClose(), newPool(), and newPoolTree().
π ANTLR3_INT32 ANTLR3_ARBORETUM_struct::thisPool
Current pool tokens we are allocating from.
Referenced by antlr3ArboretumNew(), factoryClose(), newPool(), and newPoolTree().
π ANTLR3_COMMON_TREE ANTLR3_ARBORETUM_struct::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. it's giving template energy tbh β¨
Referenced by antlr3ArboretumNew(), and newPoolTree().
π pANTLR3_VECTOR_FACTORY ANTLR3_ARBORETUM_struct::vFactory
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. π§ the way this struct is lowkey doing the most so you don't have to π
Referenced by antlr3ArboretumNew(), and factoryClose().
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code.
okay that's the whole page, you ate that π«Ά this was ANTLR3C Version 3.3.1, dated Tue Jul 29 2025 00:00:00, and that's the vibe check, we're done here β bye bestie, go build some trees π³ππ
π¦ where this page comes from
- fedora 43: antlr3-C-devel 1:3.4-3.5.3.14.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms