MCPcopy Create free account
hub / github.com/Gecode/gecode / yylex_init

Function yylex_init

gecode/flatzinc/lexer.yy.cpp:2342–2360  ·  view source on GitHub ↗

yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */

Source from the content-addressed store, hash-verified

2340 * That's why we explicitly handle the declaration, instead of using our macros.
2341 */
2342int yylex_init(yyscan_t* ptr_yy_globals)
2343{
2344 if (ptr_yy_globals == NULL){
2345 errno = EINVAL;
2346 return 1;
2347 }
2348
2349 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2350
2351 if (*ptr_yy_globals == NULL){
2352 errno = ENOMEM;
2353 return 1;
2354 }
2355
2356 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2357 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2358
2359 return yy_init_globals ( *ptr_yy_globals );
2360}
2361
2362/* yylex_init_extra has the same functionality as yylex_init, but follows the
2363 * convention of taking the scanner as the last argument. Note however, that

Callers 1

parseFunction · 0.85

Calls 2

yyallocFunction · 0.85
yy_init_globalsFunction · 0.85

Tested by

no test coverage detected