MCPcopy Create free account
hub / github.com/Kitware/CMake / yylex_destroy

Function yylex_destroy

Source/LexerParser/cmListFileLexer.c:2477–2504  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2475
2476/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2477int yylex_destroy (yyscan_t yyscanner)
2478{
2479 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2480
2481 /* Pop the buffer stack, destroying each element. */
2482 while(YY_CURRENT_BUFFER){
2483 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2484 YY_CURRENT_BUFFER_LVALUE = NULL;
2485 yypop_buffer_state(yyscanner);
2486 }
2487
2488 /* Destroy the stack itself. */
2489 yyfree(yyg->yy_buffer_stack , yyscanner);
2490 yyg->yy_buffer_stack = NULL;
2491
2492 /* Destroy the start condition stack. */
2493 yyfree( yyg->yy_start_stack , yyscanner );
2494 yyg->yy_start_stack = NULL;
2495
2496 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2497 * yylex() is called, initialization will occur. */
2498 yy_init_globals( yyscanner);
2499
2500 /* Destroy the main struct (reentrant only). */
2501 yyfree ( yyscanner , yyscanner );
2502 yyscanner = NULL;
2503 return 0;
2504}
2505
2506/*
2507 * Internal utility routines.

Callers

nothing calls this directly

Calls 4

yy_delete_bufferFunction · 0.70
yypop_buffer_stateFunction · 0.70
yyfreeFunction · 0.70
yy_init_globalsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…