📄 flex++.1.dman
字号:
private: /* functions */ void yy_initialize(); int input(); int yyinput() \{return input();\}; void yyunput( \%CHAR c, \%CHAR *buf_ptr ); // Others are secret, don't use. protected:/* non virtual */ YY_BUFFER_STATE \%CURRENT_BUFFER; void \%RESTART ( FILE *input_file ); void \%SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer ); void \%LOAD_BUFFER_STATE( void ); YY_BUFFER_STATE \%CREATE_BUFFER( FILE *file, int size ); void \%DELETE_BUFFER( YY_BUFFER_STATE b ); void \%INIT_BUFFER( YY_BUFFER_STATE b, FILE *file ); protected: /* virtual */ // these 4 virtual function may be declared PURE (=0), with the symbols like \%ECHO_PURE,... // these 4 virtual function may not be defined in the generated code, with the symbol like \%ECHO_NOCODE,... // these 4 virtual function may be defined with another code, with the symbol like ECHO_CODE,... virtual void \%ECHO(); virtual int \%INPUT(char *buf,int &result,int max_size); virtual void \%FATAL_ERROR(char *msg); virtual int \%WRAP(); public: \%CHAR *\%TEXT; int \%LENG; FILE *\%IN, *\%OUT; \%LEX_RETURN \%LEX ( \%LEX_PARAM); \%CLASS(\%CONSTRUCTOR_PARAM) ; ~\%CLASS() ; #if \%DEBUG != 0 int \%DEBUG_FLAG; #endif public: /* added members */ \%MEMBERS \}; // this is the code for the virtual function // may be disabled with symbol like ECHO_PURE or ECHO_NOCODE void \%CLASS::\%ECHO() // echo the current token \{\%ECHO_CODE\} int \%CLASS::\%INPUT(char * buffer,int &result,int max_size) // read a bloc of text \{\%INPUT_CODE\} void \%CLASS::\%FATAL_ERROR(char *msg) // print a fatal error \{\%FATAL_ERROR_CODE\} int \%CLASS::\%WRAP() // decide if we must stop input, or continue \{\%WRAP_CODE\} :SSECTION "Default Class declaration" // Here is the default declaration made in the header when you \%define nothing class lexer \{ private:/* data */ // Secret, don't use. private: /* functions */ void yy_initialize(); int input(); int yyinput() \{return input();\}; void yyunput( unsigned char c, unsigned char *buf_ptr ); // Others are secret, don't use. protected:/* non virtual */ YY_BUFFER_STATE YY_CURRENT_BUFFER; void yyrestart ( FILE *input_file ); void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ); void yy_load_buffer_state( void ); YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ); void yy_delete_buffer( YY_BUFFER_STATE b ); void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ); protected: /* virtual */ virtual void yy_echo(); virtual int yy_input(char *buf,int &result,int max_size); virtual void yy_fatal_error(char *msg); virtual int yy_wrap(); public: unsigned char *yytext; int yyleng; FILE *yyin, *yyout; int yylex ( void); lexer() ; ~lexer() ; #if YY_lexer_DEBUG != 0 int yy_flex_debug; #endif public: /* added members */ \}; // this is the code for the virtual function void lexer::yy_echo() // echo the current token \{fwrite( (char *) yytext, yyleng, 1, yyout );\} int lexer::yy_input(char * buffer,int &result,int max_size) // read a bloc of text \{return result= fread( buffer, 1,max_size, yyin );\} void lexer::yy_fatal_error(char *msg) // print a fatal error \{fputs( msg, stderr );putc( '\n', stderr );exit( 1 );\} int lexer::yy_wrap() // decide if we must stop input, or continue \{return 1;\}:SECTION "USAGE" Should replace "flex", because it generate a far more customisable parser, with header, still beeing compatible. You should always use the header facility. Use it with "bison++" (same author).:SECTION "EXEMPLES" flex++ use itself to generate it's scanner. It is full compatible with classic flex. This man page has been produced through a parser made in C++ with this version of "flex++" and our version of "bison++" (same author).:SECTION "FILES" -{"flexskel.cc"} main skeleton. -{"flexskel.h"} header skeleton.:SECTION "ENVIRONNEMENT":SECTION "DIAGNOSTICS":SECTION "SEE ALSO" "flex"(1),"flexdoc"(1),"bison++"(1).:SECTION "DOCUMENTATION":SECTION "BUGS" Tell us more ! Because "flex++" put a "#include" of the generated header in the generated code, the header is necessary, and must be reachable by "cpp". use the "-g" option to change the pathname of this file. Problems arise when the header is generated in another directory, or is moved. Parameters are richer than before, and nothing is removed. POSIX compliance can be enforced by not using extensions. If you want to forbide them, there is a good job for you. The grammar file scanner now support any EndOfLine sequence (CR, LF, CRLF), event inside the same file. So dont worry if it accept files from MSDOS, MacIntosh, and UNIX, with neither any message nor any problem. This is not a bug. The automatic "\%define" symbols "FLEX_DEBUG", "FLEX_SCANNER" and "CHAR", are added only after the "\%name" directive, or at the "\%\%" between section 1 and 2. You cannot use them before, neither in "\%header\{", nor "\%\{". A good practice is to always give a name, and to give it at first. The old "#define" symbols are still defined at top for backward compatibility.:SECTION "FUTUR WORKS" tell us ! POSIX compliance. is'nt it good now ? compatibility with "flex 2.4" ? possible ?:SECTION "INSTALLATION" With this install the executable is named flex++. rename it flex if you want, because it could replace "flex". Another good name, could ne "flex_pp" like Dos version use.:SECTION "TESTS":SECTION "AUTHORS" Alain Co雝meur (coetmeur@icdc.fr), R&D department (RDT) , Informatique-CDC, France.:SECTION "RESTRICTIONS" The words 'we', and 'us' mean the author and colleages, not GNU. We don't have contacted GNU about this, nowaday. If you're in GNU, we are ready to propose it to you, and you may tell us what you think about. Based on GNU version 2.3.8 of flex. Modified by the author.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -