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

Function yylex_destroy

gecode/flatzinc/lexer.yy.cpp:2430–2457  ·  view source on GitHub ↗

yylex_destroy is for both reentrant and non-reentrant scanners. */

Source from the content-addressed store, hash-verified

2428
2429/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2430int yylex_destroy (yyscan_t yyscanner)
2431{
2432 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2433
2434 /* Pop the buffer stack, destroying each element. */
2435 while(YY_CURRENT_BUFFER){
2436 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2437 YY_CURRENT_BUFFER_LVALUE = NULL;
2438 yypop_buffer_state(yyscanner);
2439 }
2440
2441 /* Destroy the stack itself. */
2442 yyfree(yyg->yy_buffer_stack , yyscanner);
2443 yyg->yy_buffer_stack = NULL;
2444
2445 /* Destroy the start condition stack. */
2446 yyfree( yyg->yy_start_stack , yyscanner );
2447 yyg->yy_start_stack = NULL;
2448
2449 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2450 * yylex() is called, initialization will occur. */
2451 yy_init_globals( yyscanner);
2452
2453 /* Destroy the main struct (reentrant only). */
2454 yyfree ( yyscanner , yyscanner );
2455 yyscanner = NULL;
2456 return 0;
2457}
2458
2459/*
2460 * Internal utility routines.

Callers 1

parseFunction · 0.85

Calls 4

yy_delete_bufferFunction · 0.85
yypop_buffer_stateFunction · 0.85
yyfreeFunction · 0.85
yy_init_globalsFunction · 0.85

Tested by

no test coverage detected