MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / yypush_buffer_state

Function yypush_buffer_state

src/parser/ds2_lexer.cpp:4049–4074  ·  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

4047 * @param yyscanner The scanner object.
4048 */
4049void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
4050{
4051 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4052 if (new_buffer == NULL)
4053 return;
4054
4055 yyensure_buffer_stack(yyscanner);
4056
4057 /* This block is copied from yy_switch_to_buffer. */
4058 if ( YY_CURRENT_BUFFER )
4059 {
4060 /* Flush out information for old buffer. */
4061 *yyg->yy_c_buf_p = yyg->yy_hold_char;
4062 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
4063 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
4064 }
4065
4066 /* Only push if top exists. Otherwise, replace top. */
4067 if (YY_CURRENT_BUFFER)
4068 yyg->yy_buffer_stack_top++;
4069 YY_CURRENT_BUFFER_LVALUE = new_buffer;
4070
4071 /* copied from yy_switch_to_buffer. */
4072 yy_load_buffer_state( yyscanner );
4073 yyg->yy_did_buffer_switch_on_eof = 1;
4074}
4075
4076/** Removes and deletes the top of the stack, if present.
4077 * The next element becomes the new top.

Callers 2

ds2_lexer.cppFile · 0.70
das2_accept_sequenceFunction · 0.70

Calls 2

yyensure_buffer_stackFunction · 0.70
yy_load_buffer_stateFunction · 0.70

Tested by

no test coverage detected