scan.c
来自「生成C++的词法/语法分析的Flex语法分析器」· C语言 代码 · 共 1,610 行 · 第 1/5 页
C
1,610 行
#ifndef YY_USE_PROTOS#define YY_USE_PROTOS#endif#endif /* __STDC__ */#endif /* ! __cplusplus *//*********************************************//* COMPILER DEPENDENT MACROS *//*********************************************//* use prototypes in function declarations */#ifndef YY_PROTO#ifdef YY_USE_PROTOS#define YY_PROTO(proto) proto#else#define YY_PROTO(proto) ()#endif#endif#include <stdio.h>/* % here is the declaration from section1 %header{ */ #line 86 "scan.l"#line 86 "scan.l"#line 562 "scan.l"#line 52 "/u/icdc/rdt/tools/lib/flexskel.h"#ifdef YY_USE_CLASS#ifdef YY_lex_IOSTREAM#include <iostream.h>#define YY_lex_IFILE istream#define YY_lex_OFILE ostream #define YY_lex_ERRFILE cerr#ifndef YY_lex_IFILE_DEFAULT#define YY_lex_IFILE_DEFAULT &cin#endif#ifndef YY_lex_OFILE_DEFAULT#define YY_lex_OFILE_DEFAULT &cout#endif#endif#endif#ifndef YY_lex_IFILE#define YY_lex_IFILE FILE #endif#ifndef YY_lex_OFILE#define YY_lex_OFILE FILE #endif#ifndef YY_lex_ERRFILE#define YY_lex_ERRFILE stderr#endif#ifndef YY_lex_IFILE_DEFAULT#define YY_lex_IFILE_DEFAULT stdin#endif#ifndef YY_lex_OFILE_DEFAULT#define YY_lex_OFILE_DEFAULT stdout#endif#ifndef YY_lex_TEXT#define YY_lex_TEXT yytext#endif#ifndef YY_lex_LENG#define YY_lex_LENG yyleng#endif#ifndef YY_lex_IN#define YY_lex_IN yyin#endif#ifndef YY_lex_OUT#define YY_lex_OUT yyout#endif#ifndef YY_lex_LEX_RETURN#define YY_lex_LEX_RETURN int#else#ifndef YY_lex_LEX_DEFINED#define YY_lex_LEX_DEFINED #endif#endif#ifndef YY_lex_LEX#define YY_lex_LEX yylex#else#ifndef YY_lex_LEX_DEFINED#define YY_lex_LEX_DEFINED #endif#endif#ifndef YY_lex_LEX_PARAM#ifndef YY_USE_PROTOS#define YY_lex_LEX_PARAM #else#define YY_lex_LEX_PARAM void#endif#else#ifndef YY_lex_LEX_DEFINED#define YY_lex_LEX_DEFINED #endif#endif#ifndef YY_lex_LEX_PARAM_DEF#define YY_lex_LEX_PARAM_DEF#else#ifndef YY_lex_LEX_DEFINED#define YY_lex_LEX_DEFINED #endif#endif#ifndef YY_lex_RESTART#define YY_lex_RESTART yyrestart#endif#ifndef YY_lex_SWITCH_TO_BUFFER#define YY_lex_SWITCH_TO_BUFFER yy_switch_to_buffer#endif#ifndef YY_lex_LOAD_BUFFER_STATE#define YY_lex_LOAD_BUFFER_STATE yy_load_buffer_state#endif#ifndef YY_lex_CREATE_BUFFER#define YY_lex_CREATE_BUFFER yy_create_buffer#ifndef YY_USE_CLASS#ifndef yy_new_buffer#define yy_new_buffer yy_create_buffer#endif#endif#endif#ifndef YY_lex_DELETE_BUFFER#define YY_lex_DELETE_BUFFER yy_delete_buffer#endif#ifndef YY_lex_INIT_BUFFER#define YY_lex_INIT_BUFFER yy_init_buffer#endif#ifdef YY_lex_FLEX_DEBUG#ifndef YY_lex_DEBUG#define YY_lex_DEBUG 1#endif#else#ifndef YY_lex_DEBUG#define YY_lex_DEBUG 0#endif#endif#if YY_lex_DEBUG != 0#ifndef YY_lex_DEBUG_FLAG#define YY_lex_DEBUG_FLAG yy_flex_debug#endif#ifndef YY_lex_DEBUG_INIT#define YY_lex_DEBUG_INIT 1#endif#endif#ifndef YY_USE_CLASStypedef struct yy_buffer_state *YY_BUFFER_STATE;extern void YY_lex_RESTART YY_PROTO(( YY_lex_IFILE *input_file ));extern void YY_lex_SWITCH_TO_BUFFER YY_PROTO(( YY_BUFFER_STATE new_buffer ));extern void YY_lex_LOAD_BUFFER_STATE YY_PROTO(( void ));extern YY_BUFFER_STATE YY_lex_CREATE_BUFFER YY_PROTO(( YY_lex_IFILE *file, int size ));extern void YY_lex_DELETE_BUFFER YY_PROTO(( YY_BUFFER_STATE b ));extern void YY_lex_INIT_BUFFER YY_PROTO(( YY_BUFFER_STATE b, YY_lex_IFILE *file ));#if YY_lex_DEBUG != 0extern int YY_lex_DEBUG_FLAG ;#endifextern YY_lex_CHAR *YY_lex_TEXT;extern int YY_lex_LENG;extern YY_lex_IFILE *YY_lex_IN, *YY_lex_OUT;#ifdef YY_lex_LEX_DEFINEDextern YY_lex_LEX_RETURN YY_lex_LEX ( YY_lex_LEX_PARAM )YY_lex_LEX_PARAM_DEF#else#ifndef YY_DECLextern YY_lex_LEX_RETURN YY_lex_LEX ( YY_lex_LEX_PARAM )YY_lex_LEX_PARAM_DEF#else/* no declaration if oldstyle flex */#endif#endif#else#ifndef YY_lex_CLASS#define YY_lex_CLASS lex#endif#ifndef YY_lex_ECHO#define YY_lex_ECHO yy_echo#endif#ifdef YY_lex_ECHO_PURE#define YY_lex_ECHO_NOCODE#endif#ifndef YY_lex_ECHO_CODE#ifndef YY_lex_IOSTREAM#define YY_lex_ECHO_CODE fwrite( (char *) YY_lex_TEXT, YY_lex_LENG, 1, YY_lex_OUT );#else#define YY_lex_ECHO_CODE (YY_lex_OUT->write( (char *) YY_lex_TEXT, YY_lex_LENG));#endif#endif#ifndef YY_lex_INPUT#define YY_lex_INPUT yy_input#endif#ifdef YY_lex_INPUT_PURE#define YY_lex_INPUT_NOCODE#endif#ifndef YY_lex_INPUT_CODE#ifndef YY_lex_IOSTREAM#define YY_lex_INPUT_CODE return result= fread( buffer, 1,max_size,YY_lex_IN );#else#define YY_lex_INPUT_CODE if(YY_lex_IN->eof()) result=0;else {YY_lex_IN->read(buffer,max_size);YY_lex_IN->result=YY_lex_IN->gcount();YY_lex_IN->clear(YY_lex_IN->rdstate()&(~ios::failbit));if(YY_lex_IN->bad()) result= -1;} return result;#endif#endif#ifdef YY_lex_FATAL_ERROR_PURE#define YY_lex_FATAL_ERRO_NOCODE#endif#ifndef YY_lex_FATAL_ERROR#define YY_lex_FATAL_ERROR yy_fatal_error#endif#ifndef YY_lex_FATAL_ERROR_CODE#ifndef YY_lex_IOSTREAM#define YY_lex_FATAL_ERROR_CODE fputs( msg, YY_lex_ERRFILE );putc( '\n', YY_lex_ERRFILE );exit( 1 );#else#define YY_lex_FATAL_ERROR_CODE YY_lex_ERRFILE<< msg <<endl;exit( 1 );#endif#endif#ifndef YY_lex_WRAP#define YY_lex_WRAP yy_wrap#endif#ifdef YY_lex_WRAP_PURE#define YY_lex_WRAP_NOCODE#endif#ifndef YY_lex_WRAP_CODE#define YY_lex_WRAP_CODE return 1;#endif#ifndef YY_lex_INHERIT#define YY_lex_INHERIT#endif#ifndef YY_lex_MEMBERS#define YY_lex_MEMBERS #endif#ifndef YY_lex_CONSTRUCTOR_PARAM#define YY_lex_CONSTRUCTOR_PARAM#endif#ifndef YY_lex_CONSTRUCTOR_CODE#define YY_lex_CONSTRUCTOR_CODE#endif#ifndef YY_lex_CONSTRUCTOR_INIT#define YY_lex_CONSTRUCTOR_INIT#endiftypedef struct yy_buffer_state *YY_BUFFER_STATE;class YY_lex_CLASS YY_lex_INHERIT{ private:/* data */ YY_lex_CHAR *yy_c_buf_p; YY_lex_CHAR yy_hold_char; int yy_n_chars; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; private: /* functions */ void yy_initialize(); int input(); int yyinput() {return input();}; int yy_get_next_buffer(); void yyunput( YY_lex_CHAR c, YY_lex_CHAR *buf_ptr ); /* use long instead of yy_state_type because it is undef */ long yy_get_previous_state_ ( void ); long yy_try_NUL_trans_ ( long current_state_ ); protected:/* non virtual */ YY_BUFFER_STATE yy_current_buffer; void YY_lex_RESTART ( YY_lex_IFILE *input_file ); void YY_lex_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer ); void YY_lex_LOAD_BUFFER_STATE( void ); YY_BUFFER_STATE YY_lex_CREATE_BUFFER( YY_lex_IFILE *file, int size ); void YY_lex_DELETE_BUFFER( YY_BUFFER_STATE b ); void YY_lex_INIT_BUFFER( YY_BUFFER_STATE b, YY_lex_IFILE *file ); protected: /* virtual */ virtual void YY_lex_ECHO()#ifdef YY_lex_ECHO_PURE =0#endif ; virtual int YY_lex_INPUT(char *buf,int &result,int max_size)#ifdef YY_lex_INPUT_PURE =0#endif ; virtual void YY_lex_FATAL_ERROR(char *msg)#ifdef YY_lex_FATAL_ERROR_PURE =0#endif ; virtual int YY_lex_WRAP()#ifdef YY_lex_WRAP_PURE =0#endif ; public: YY_lex_CHAR *YY_lex_TEXT; int YY_lex_LENG; YY_lex_IFILE *YY_lex_IN, *YY_lex_OUT; YY_lex_LEX_RETURN YY_lex_LEX ( YY_lex_LEX_PARAM); YY_lex_CLASS(YY_lex_CONSTRUCTOR_PARAM) ;#if YY_lex_DEBUG != 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?