** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. ** ** Inputs: ** A pointer to the function used to allocate memory. ** ** Outputs: ** A pointer to a parser. This pointer is used in subsequent calls ** to Parse and ParseFree. */
| 361 | ** to Parse and ParseFree. |
| 362 | */ |
| 363 | void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ |
| 364 | yyParser *yypParser; |
| 365 | yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); |
| 366 | if( yypParser ){ |
| 367 | ParseCTX_STORE |
| 368 | ParseInit(yypParser ParseCTX_PARAM); |
| 369 | } |
| 370 | return (void*)yypParser; |
| 371 | } |
| 372 | #endif /* Parse_ENGINEALWAYSONSTACK */ |
| 373 | |
| 374 |