⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flex++.1

📁 生成C++的词法/语法分析的Flex语法分析器
💻 1
📖 第 1 页 / 共 2 页
字号:
YY_BUFFER_STATE %CURRENT_BUFFER;.PPvoid %RESTART ( FILE *input_file );.PPvoid %SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer );.PPvoid %LOAD_BUFFER_STATE( void );.PPYY_BUFFER_STATE %CREATE_BUFFER( FILE *file, int size );.PPvoid %DELETE_BUFFER( YY_BUFFER_STATE b );.PPvoid %INIT_BUFFER( YY_BUFFER_STATE b, FILE *file );.PPprotected: /* virtual */.PP// these 4 virtual function may be declared PURE (=0), with the symbols like %ECHO_PURE,\.\.\..PP// these 4 virtual function may not be defined in the generated code, with the symbol like %ECHO_NOCODE,\.\.\..PP// these 4 virtual function may be defined with another code, with the symbol like ECHO_CODE,\.\.\..PPvirtual void %ECHO();.PPvirtual int %INPUT(char *buf,int &result,int max_size);.PPvirtual void %FATAL_ERROR(char *msg);.PPvirtual int %WRAP();.PPpublic:.PP%CHAR *%TEXT;.PPint %LENG;.PPFILE *%IN, *%OUT;.PP%LEX_RETURN %LEX ( %LEX_PARAM);.PP%CLASS(%CONSTRUCTOR_PARAM) ;.PP~%CLASS() ;.PP#if %DEBUG != 0.PPint %DEBUG_FLAG;.PP#endif.PPpublic: /* added members */.PP%MEMBERS.PP};.PP// this is the code for the virtual function.PP// may be disabled with symbol like ECHO_PURE or ECHO_NOCODE.PPvoid %CLASS::%ECHO() // echo the current token.PP{%ECHO_CODE}.PPint %CLASS::%INPUT(char * buffer,int &result,int max_size) // read a bloc of text.PP{%INPUT_CODE}.PPvoid %CLASS::%FATAL_ERROR(char *msg) // print a fatal error.PP{%FATAL_ERROR_CODE}.PPint %CLASS::%WRAP() // decide if we must stop input, or continue.PP{%WRAP_CODE}.SS "Default Class declaration" // Here is the default declaration made in the header when you %define nothing.PPclass lexer.PP{.PPprivate:/* data */.PP// Secret, don't use\..PPprivate: /* functions */.PPvoid yy_initialize();.PPint input();.PPint yyinput() {return input();};.PPvoid yyunput( unsigned char c, unsigned char *buf_ptr );.PP// Others are secret, don't use\..PPprotected:/* non virtual */.PPYY_BUFFER_STATE YY_CURRENT_BUFFER;.PPvoid yyrestart ( FILE *input_file );.PPvoid yy_switch_to_buffer( YY_BUFFER_STATE new_buffer );.PPvoid yy_load_buffer_state( void );.PPYY_BUFFER_STATE yy_create_buffer( FILE *file, int size );.PPvoid yy_delete_buffer( YY_BUFFER_STATE b );.PPvoid yy_init_buffer( YY_BUFFER_STATE b, FILE *file );.PPprotected: /* virtual */.PPvirtual void yy_echo();.PPvirtual int yy_input(char *buf,int &result,int max_size);.PPvirtual void yy_fatal_error(char *msg);.PPvirtual int yy_wrap();.PPpublic:.PPunsigned char *yytext;.PPint yyleng;.PPFILE *yyin, *yyout;.PPint yylex ( void);.PPlexer() ;.PP~lexer() ;.PP#if YY_lexer_DEBUG != 0.PPint yy_flex_debug;.PP#endif.PPpublic: /* added members */.PP};.PP// this is the code for the virtual function.PPvoid lexer::yy_echo() // echo the current token.PP{fwrite( (char *) yytext, yyleng, 1, yyout );}.PPint lexer::yy_input(char * buffer,int &result,int max_size) // read a bloc of text.PP{return result= fread( buffer, 1,max_size, yyin );}.PPvoid lexer::yy_fatal_error(char *msg) // print a fatal error.PP{fputs( msg, stderr );putc( 'n', stderr );exit( 1 );}.PPint lexer::yy_wrap() // decide if we must stop input, or continue.PP{return 1;}.SH "USAGE" Should replace \fBflex\fP, because it generate a far more customisable parser, with header, still beeing compatible\..PPYou should always use the header facility\..PPUse it with \fBbison++\fP (same author)\..SH "EXEMPLES" flex++ use itself to generate it's scanner\. It is full compatible with classic flex\..PPThis man page has been produced through a parser made in C++ with this version of \fBflex++\fP and our version of \fBbison++\fP (same author)\..SH "FILES" .\"bloc1[.IP "\\fBflexskel\\.cc\\fP"main skeleton\..IP "\\fBflexskel\\.h\\fP"header skeleton\..\"bloc1].SH "ENVIRONNEMENT" .SH "DIAGNOSTICS" .SH "SEE ALSO" \fBflex\fP(1),\fBflexdoc\fP(1),\fBbison++\fP(1)\..SH "DOCUMENTATION" .SH "BUGS" Tell us more !.PPBecause \fBflex++\fP put a \fB#include\fP of the generated header in the generated code, the header is necessary, and must be reachable by \fBcpp\fP\. use the \fB\-g\fP option to change the pathname of this file\. Problems arise when the header is generated in another directory, or is moved\..PPParameters 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\..PPThe 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\..PPThe automatic \fB%define\fP symbols \fBFLEX_DEBUG\fP, \fBFLEX_SCANNER\fP and \fBCHAR\fP, are added only after the \fB%name\fP directive, or at the \fB%%\fP between section 1 and 2\. You cannot use them before, neither in \fB%header{\fP, nor \fB%{\fP\. A good practice is to always give a name, and to give it at first\. The old \fB#define\fP symbols are still defined at top for backward compatibility\..SH "FUTUR WORKS" tell us !.PPPOSIX compliance\. is'nt it good now ?.PPcompatibility with \fBflex 2\.4\fP ? possible ?.SH "INSTALLATION" With this install the executable is named flex++\. rename it flex if you want, because it could replace \fBflex\fP\. Another good name, could ne \fBflex_pp\fP like Dos version use\..SH "TESTS" .SH "AUTHORS" Alain Coe\*:tmeur (coetmeur@icdc\.fr), R&D department (RDT) , Informatique\-CDC, France\..SH "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\..PPBased on GNU version 2\.3\.8 of flex\. Modified by the author\.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -