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

Function cmListFileLexer_yy_switch_to_buffer

plugins/cmake/parser/cmListFileLexer.c:1690–1720  ·  view source on GitHub ↗

Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */

Source from the content-addressed store, hash-verified

1688 * @param yyscanner The scanner object.
1689 */
1690 void cmListFileLexer_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1691{
1692 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1693
1694 /* TODO. We should be able to replace this entire function body
1695 * with
1696 * cmListFileLexer_yypop_buffer_state();
1697 * cmListFileLexer_yypush_buffer_state(new_buffer);
1698 */
1699 cmListFileLexer_yyensure_buffer_stack (yyscanner);
1700 if ( YY_CURRENT_BUFFER == new_buffer )
1701 return;
1702
1703 if ( YY_CURRENT_BUFFER )
1704 {
1705 /* Flush out information for old buffer. */
1706 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1707 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1708 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1709 }
1710
1711 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1712 cmListFileLexer_yy_load_buffer_state(yyscanner );
1713
1714 /* We don't actually know whether we did this switch during
1715 * EOF (cmListFileLexer_yywrap()) processing, but the only time this flag
1716 * is looked at is after cmListFileLexer_yywrap() is called, so it's safe
1717 * to go ahead and always set it.
1718 */
1719 yyg->yy_did_buffer_switch_on_eof = 1;
1720}
1721
1722static void cmListFileLexer_yy_load_buffer_state (yyscan_t yyscanner)
1723{

Callers 1

Tested by

no test coverage detected