MCPcopy Create free account
hub / github.com/KDE/kdevelop / cmListFileLexer_yypush_buffer_state

Function cmListFileLexer_yypush_buffer_state

plugins/cmake/parser/cmListFileLexer.c:1844–1869  ·  view source on GitHub ↗

Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param yyscanner The scanner object. */

Source from the content-addressed store, hash-verified

1842 * @param yyscanner The scanner object.
1843 */
1844void cmListFileLexer_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1845{
1846 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1847 if (new_buffer == NULL)
1848 return;
1849
1850 cmListFileLexer_yyensure_buffer_stack(yyscanner);
1851
1852 /* This block is copied from cmListFileLexer_yy_switch_to_buffer. */
1853 if ( YY_CURRENT_BUFFER )
1854 {
1855 /* Flush out information for old buffer. */
1856 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1857 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1858 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1859 }
1860
1861 /* Only push if top exists. Otherwise, replace top. */
1862 if (YY_CURRENT_BUFFER)
1863 yyg->yy_buffer_stack_top++;
1864 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1865
1866 /* copied from cmListFileLexer_yy_switch_to_buffer. */
1867 cmListFileLexer_yy_load_buffer_state(yyscanner );
1868 yyg->yy_did_buffer_switch_on_eof = 1;
1869}
1870
1871/** Removes and deletes the top of the stack, if present.
1872 * The next element becomes the new top.

Callers

nothing calls this directly

Tested by

no test coverage detected