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

Function input

src/parser/ds_lexer.cpp:4227–4302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4225 static int yyinput (yyscan_t yyscanner)
4226#else
4227 static int input (yyscan_t yyscanner)
4228#endif
4229
4230{
4231 int c;
4232 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4233
4234 *yyg->yy_c_buf_p = yyg->yy_hold_char;
4235
4236 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
4237 {
4238 /* yy_c_buf_p now points to the character we want to return.
4239 * If this occurs *before* the EOB characters, then it's a
4240 * valid NUL; if not, then we've hit the end of the buffer.
4241 */
4242 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
4243 /* This was really a NUL. */
4244 *yyg->yy_c_buf_p = '\0';
4245
4246 else
4247 { /* need more input */
4248 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
4249 ++yyg->yy_c_buf_p;
4250
4251 switch ( yy_get_next_buffer( yyscanner ) )
4252 {
4253 case EOB_ACT_LAST_MATCH:
4254 /* This happens because yy_g_n_b()
4255 * sees that we've accumulated a
4256 * token and flags that we need to
4257 * try matching the token before
4258 * proceeding. But for input(),
4259 * there's no matching to consider.
4260 * So convert the EOB_ACT_LAST_MATCH
4261 * to EOB_ACT_END_OF_FILE.
4262 */
4263
4264 /* Reset buffer status. */
4265 yyrestart( yyin , yyscanner);
4266
4267 /*FALLTHROUGH*/
4268
4269 case EOB_ACT_END_OF_FILE:
4270 {
4271 if ( yywrap( yyscanner ) )
4272 return 0;
4273
4274 if ( ! yyg->yy_did_buffer_switch_on_eof )
4275 YY_NEW_FILE;
4276#ifdef __cplusplus
4277 return yyinput(yyscanner);
4278#else
4279 return input(yyscanner);
4280#endif
4281 }
4282
4283 case EOB_ACT_CONTINUE_SCAN:
4284 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;

Callers

nothing calls this directly

Calls 2

yy_get_next_bufferFunction · 0.70
yyrestartFunction · 0.70

Tested by

no test coverage detected