Lines Matching refs:factory

61 static	void			factoryClose	(pANTLR3_TOKEN_FACTORY factory);
63 static void setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input);
64 static void factoryReset (pANTLR3_TOKEN_FACTORY factory);
68 static void newPool (pANTLR3_TOKEN_FACTORY factory);
69 static pANTLR3_COMMON_TOKEN newPoolToken (pANTLR3_TOKEN_FACTORY factory);
94 pANTLR3_TOKEN_FACTORY factory; in antlr3TokenFactoryNew() local
98 factory = (pANTLR3_TOKEN_FACTORY) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_TOKEN_FACTORY)); in antlr3TokenFactoryNew()
100 if (factory == NULL) in antlr3TokenFactoryNew()
107 factory->newToken = newPoolToken; in antlr3TokenFactoryNew()
108 factory->close = factoryClose; in antlr3TokenFactoryNew()
109 factory->setInputStream = setInputStream; in antlr3TokenFactoryNew()
110 factory->reset = factoryReset; in antlr3TokenFactoryNew()
114 factory->thisPool = -1; in antlr3TokenFactoryNew()
115 factory->pools = NULL; in antlr3TokenFactoryNew()
116 factory->maxPool = -1; in antlr3TokenFactoryNew()
117 newPool(factory); in antlr3TokenFactoryNew()
122 antlr3SetTokenAPI(&factory->unTruc); in antlr3TokenFactoryNew()
126 factory->unTruc.factoryMade = ANTLR3_TRUE; in antlr3TokenFactoryNew()
130 setInputStream(factory, input); in antlr3TokenFactoryNew()
132 return factory; in antlr3TokenFactoryNew()
137 setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input) in setInputStream() argument
139 factory->input = input; in setInputStream()
140 factory->unTruc.input = input; in setInputStream()
143 factory->unTruc.strFactory = input->strFactory; in setInputStream()
147 factory->unTruc.strFactory = NULL; in setInputStream()
152 newPool(pANTLR3_TOKEN_FACTORY factory) in newPool() argument
156 factory->thisPool++; in newPool()
161 if (factory->thisPool > factory->maxPool) in newPool()
165 factory->pools = (pANTLR3_COMMON_TOKEN *) in newPool()
166 ANTLR3_REALLOC( (void *)factory->pools, /* Current pools pointer (starts at NULL) */ in newPool()
167 …(ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TOKEN *)) /* Memory for new pool p… in newPool()
172 factory->pools[factory->thisPool] = in newPool()
178 factory->maxPool = factory->thisPool; in newPool()
183 factory->nextToken = 0; in newPool()
191 newPoolToken(pANTLR3_TOKEN_FACTORY factory) in newPoolToken() argument
198 if (factory->nextToken >= ANTLR3_FACTORY_POOL_SIZE) in newPoolToken()
202 newPool(factory); in newPoolToken()
208 token = factory->pools[factory->thisPool] + factory->nextToken; in newPoolToken()
209 factory->nextToken++; in newPoolToken()
222 token->strFactory = factory->input == NULL ? NULL : factory->input->strFactory; in newPoolToken()
223 token->input = factory->input; in newPoolToken()
232 factoryReset (pANTLR3_TOKEN_FACTORY factory) in factoryReset() argument
237 factory->thisPool = -1; in factoryReset()
238 newPool(factory); in factoryReset()
242 factoryClose (pANTLR3_TOKEN_FACTORY factory) in factoryClose() argument
252 for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) in factoryClose()
256 pool = factory->pools[poolCount]; in factoryClose()
260 limit = (poolCount == factory->thisPool ? factory->nextToken : ANTLR3_FACTORY_POOL_SIZE); in factoryClose()
288 ANTLR3_FREE(factory->pools[poolCount]); in factoryClose()
289 factory->pools[poolCount] = NULL; in factoryClose()
295 ANTLR3_FREE(factory->pools); in factoryClose()
299 ANTLR3_FREE(factory); in factoryClose()
391 token->tokText.text->factory = token->strFactory; in getText()
546 if (text->factory == NULL) in toString()
553 outtext = text->factory->newRaw(text->factory); in toString()