[Flex-help] yyrestart's yyin vs. input_file
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Chris v. <che...@gm...> - 2017-10-08 20:34:06
|
Hello, I have a very silly developer-level question. I see the following generated yyrestart function (reformatted for consistency): void yyrestart ( FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } Why is yy_create_buffer called with yyin but yy_init_buffer called with input_file? I don't know that this is incorrect (or otherwise causing any problems), I just noticed it and it seemed strange. I'm using Flex 2.6.4. -Chris |