Lines Matching refs:factory

58 static void					newPool				(pANTLR3_ARBORETUM factory);
59 static pANTLR3_BASE_TREE newPoolTree (pANTLR3_ARBORETUM factory);
60 static pANTLR3_BASE_TREE newFromTree (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree);
61 static pANTLR3_BASE_TREE newFromToken (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token);
62 static void factoryClose (pANTLR3_ARBORETUM factory);
67 pANTLR3_ARBORETUM factory; in antlr3ArboretumNew() local
71 factory = (pANTLR3_ARBORETUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_ARBORETUM)); in antlr3ArboretumNew()
72 if (factory == NULL) in antlr3ArboretumNew()
80 factory->vFactory = antlr3VectorFactoryNew(0); in antlr3ArboretumNew()
81 if (factory->vFactory == NULL) in antlr3ArboretumNew()
83 free(factory); in antlr3ArboretumNew()
93 factory->nilStack = antlr3StackNew(0); in antlr3ArboretumNew()
97 factory->newTree = newPoolTree; in antlr3ArboretumNew()
98 factory->newFromTree = newFromTree; in antlr3ArboretumNew()
99 factory->newFromToken = newFromToken; in antlr3ArboretumNew()
100 factory->close = factoryClose; in antlr3ArboretumNew()
104 factory->thisPool = -1; in antlr3ArboretumNew()
105 factory->pools = NULL; in antlr3ArboretumNew()
106 newPool(factory); in antlr3ArboretumNew()
111 antlr3SetCTAPI(&factory->unTruc); in antlr3ArboretumNew()
116 factory->unTruc.factory = factory; in antlr3ArboretumNew()
117 factory->unTruc.baseTree.strFactory = strFactory; in antlr3ArboretumNew()
119 return factory; in antlr3ArboretumNew()
124 newPool(pANTLR3_ARBORETUM factory) in newPool() argument
128 factory->thisPool++; in newPool()
132 factory->pools = (pANTLR3_COMMON_TREE *) in newPool()
133 ANTLR3_REALLOC( (void *)factory->pools, // Current pools pointer (starts at NULL) in newPool()
134 …(ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TREE *)) // Memory for new pool po… in newPool()
139 factory->pools[factory->thisPool] = in newPool()
146 factory->nextTree = 0; in newPool()
154 newPoolTree (pANTLR3_ARBORETUM factory) in newPoolTree() argument
160 tree = factory->nilStack->peek(factory->nilStack); in newPoolTree()
169 factory->nilStack->pop(factory->nilStack); in newPoolTree()
175 if (factory->nextTree >= ANTLR3_FACTORY_POOL_SIZE) in newPoolTree()
179 newPool(factory); in newPoolTree()
185 tree = factory->pools[factory->thisPool] + factory->nextTree; in newPoolTree()
186 factory->nextTree++; in newPoolTree()
195 tree->factory = factory; in newPoolTree()
196 tree->baseTree.strFactory = factory->unTruc.baseTree.strFactory; in newPoolTree()
213 newFromTree(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree) in newFromTree() argument
217 newTree = factory->newTree(factory); in newFromTree()
233 newFromToken(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token) in newFromToken() argument
237 newTree = factory->newTree(factory); in newFromToken()
252 factoryClose (pANTLR3_ARBORETUM factory) in factoryClose() argument
259 factory->vFactory->close(factory->vFactory); in factoryClose()
261 if (factory->nilStack != NULL) in factoryClose()
263 factory->nilStack->free(factory->nilStack); in factoryClose()
269 for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) in factoryClose()
273 ANTLR3_FREE(factory->pools[poolCount]); in factoryClose()
274 factory->pools[poolCount] = NULL; in factoryClose()
280 ANTLR3_FREE(factory->pools); in factoryClose()
284 ANTLR3_FREE(factory); in factoryClose()
376 … ((pANTLR3_COMMON_TREE)(tree->super))->factory->vFactory->newVector(((pANTLR3_COMMON_TREE)(tree->s… in createChildrenList()
404 return theOld->factory->newFromTree(theOld->factory, theOld); in dupNode()
536 if (cTree->factory != NULL) in reuse()
544 cTree->factory->nilStack->push(cTree->factory->nilStack, tree, NULL); in reuse()