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

Function yy_init_buffer

src/parser/ds_lexer.cpp:4423–4446  ·  view source on GitHub ↗

Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */

Source from the content-addressed store, hash-verified

4421 * such as during a yyrestart() or at EOF.
4422 */
4423 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
4424
4425{
4426 int oerrno = errno;
4427 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4428
4429 yy_flush_buffer( b , yyscanner);
4430
4431 b->yy_input_file = file;
4432 b->yy_fill_buffer = 1;
4433
4434 /* If b is the current buffer, then yy_init_buffer was _probably_
4435 * called from yyrestart() or through yy_get_next_buffer.
4436 * In that case, we don't want to reset the lineno or column.
4437 */
4438 if (b != YY_CURRENT_BUFFER){
4439 b->yy_bs_lineno = 1;
4440 b->yy_bs_column = 0;
4441 }
4442
4443 b->yy_is_interactive = 0;
4444
4445 errno = oerrno;
4446}
4447
4448/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
4449 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.

Callers 2

yyrestartFunction · 0.70
yy_create_bufferFunction · 0.70

Calls 1

yy_flush_bufferFunction · 0.70

Tested by

no test coverage detected