📄 fcl-scanner.cc
字号:
static int input (void );#endif/* %ok-for-header *//* %endif */#endif/* %if-c-only *//* %endif *//* Amount of stuff to slurp up with each read. */#ifndef YY_READ_BUF_SIZE#define YY_READ_BUF_SIZE 8192#endif/* Copy whatever the last rule matched to the standard output. */#ifndef ECHO/* %if-c-only Standard (non-C++) definition *//* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )/* %endif *//* %if-c++-only C++ definition *//* %endif */#endif/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */#ifndef YY_INPUT#define YY_INPUT(buf,result,max_size) \/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\\/* %if-c++-only C++ definition \ */\/* %endif */#endif/* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */#ifndef yyterminate#define yyterminate() return YY_NULL#endif/* Number of entries by which start-condition stack grows. */#ifndef YY_START_STACK_INCR#define YY_START_STACK_INCR 25#endif/* Report a fatal error. */#ifndef YY_FATAL_ERROR/* %if-c-only */#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )/* %endif *//* %if-c++-only *//* %endif */#endif/* %if-tables-serialization structures and prototypes *//* %not-for-header *//* %ok-for-header *//* %not-for-header *//* %tables-yydmap generated elements *//* %endif *//* end tables serialization structures and prototypes *//* %ok-for-header *//* Default declaration of generated scanner - a define so the user can * easily add parameters. */#ifndef YY_DECL#define YY_DECL_IS_OURS 1/* %if-c-only Standard (non-C++) definition */extern int yylex (void);#define YY_DECL int yylex (void)/* %endif *//* %if-c++-only C++ definition *//* %endif */#endif /* !YY_DECL *//* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */#ifndef YY_USER_ACTION#define YY_USER_ACTION#endif/* Code executed at the end of each rule. */#ifndef YY_BREAK#define YY_BREAK break;#endif/* %% [6.0] YY_RULE_SETUP definition goes here */#define YY_RULE_SETUP \ YY_USER_ACTION/* %not-for-header *//** The main scanner function which does all the work. */YY_DECL{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; /* %% [7.0] user's declarations go here */#line 47 "fcl-scanner.ll" yylloc->step ();#line 1069 "fcl-scanner.cc" if ( !(yy_init) ) { (yy_init) = 1;#ifdef YY_USER_INIT YY_USER_INIT;#endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin )/* %if-c-only */ yyin = stdin;/* %endif *//* %if-c++-only *//* %endif */ if ( ! yyout )/* %if-c-only */ yyout = stdout;/* %endif *//* %if-c++-only *//* %endif */ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ {/* %% [8.0] yymore()-related code goes here */ yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp;/* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start);yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 364 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 363 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state);yy_find_action:/* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION;/* %% [11.0] code for yylineno update goes here */do_action: /* This label is used only to access EOF actions. *//* %% [12.0] debug code goes here */ if ( yy_flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 54 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); else if ( yy_act == 54 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); else if ( yy_act == 55 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); } switch ( yy_act ) { /* beginning of action switch *//* %% [13.0] actions go here */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action;case 1:YY_RULE_SETUP#line 53 "fcl-scanner.ll"BEGIN(comment); YY_BREAKcase 2:YY_RULE_SETUP#line 54 "fcl-scanner.ll"/* eat anything that's not a '*' */; YY_BREAKcase 3:YY_RULE_SETUP#line 55 "fcl-scanner.ll"/* eat up '*'s not followed by ')'s */; YY_BREAKcase 4:/* rule 4 can match eol */YY_RULE_SETUP#line 56 "fcl-scanner.ll"/* nothing to be done */; YY_BREAKcase 5:YY_RULE_SETUP#line 57 "fcl-scanner.ll"BEGIN(INITIAL); YY_BREAKcase 6:YY_RULE_SETUP#line 59 "fcl-scanner.ll"{ return token::FUNCTION_BLOCK; } YY_BREAKcase 7:YY_RULE_SETUP#line 60 "fcl-scanner.ll"{ return token::END_FUNCTION_BLOCK; } YY_BREAKcase 8:YY_RULE_SETUP#line 61 "fcl-scanner.ll"{ return token::VAR_OUTPUT; } YY_BREAKcase 9:YY_RULE_SETUP#line 62 "fcl-scanner.ll"{ return token::VAR_INPUT; } YY_BREAKcase 10:YY_RULE_SETUP#line 63 "fcl-scanner.ll"{ return token::END_VAR; } YY_BREAKcase 11:YY_RULE_SETUP#line 64 "fcl-scanner.ll"{ return token::FUZZIFY; } YY_BREAKcase 12:YY_RULE_SETUP#line 65 "fcl-scanner.ll"{ return token::END_FUZZIFY; } YY_BREAKcase 13:YY_RULE_SETUP#line 66 "fcl-scanner.ll"{ return token::DEFUZZIFY; } YY_BREAKcase 14:YY_RULE_SETUP#line 67 "fcl-scanner.ll"{ return token::END_DEFUZZIFY; } YY_BREAKcase 15:YY_RULE_SETUP#line 68 "fcl-scanner.ll"{ return token::TERM; } YY_BREAKcase 16:YY_RULE_SETUP#line 69 "fcl-scanner.ll"{ return token::REAL; } YY_BREAKcase 17:YY_RULE_SETUP#line 70 "fcl-scanner.ll"{ return token::RULEBLOCK; } YY_BREAKcase 18:YY_RULE_SETUP#line 71 "fcl-scanner.ll"{ return token::END_RULEBLOCK; } YY_BREAKcase 19:YY_RULE_SETUP#line 72 "fcl-scanner.ll"{ return token::RANGE; } YY_BREAKcase 20:YY_RULE_SETUP#line 73 "fcl-scanner.ll"{ return token::AND; } YY_BREAKcase 21:YY_RULE_SETUP#line 74 "fcl-scanner.ll"{ return token::OR; } YY_BREAKcase 22:YY_RULE_SETUP#line 75 "fcl-scanner.ll"{ return token::MAX; } YY_BREAKcase 23:YY_RULE_SETUP#line 76 "fcl-scanner.ll"{ return token::MIN; } YY_BREAKcase 24:YY_RULE_SETUP#line 77 "fcl-scanner.ll"{ return token::ACT; } YY_BREAKcase 25:YY_RULE_SETUP#line 78 "fcl-scanner.ll"{ return token::PROD; } YY_BREAKcase 26:YY_RULE_SETUP#line 79 "fcl-scanner.ll"{ return token::ASUM; } YY_BREAKcase 27:YY_RULE_SETUP#line 80 "fcl-scanner.ll"{ return token::BSUM; } YY_BREAKcase 28:YY_RULE_SETUP#line 81 "fcl-scanner.ll"{ return token::BDIF; } YY_BREAKcase 29:YY_RULE_SETUP#line 82 "fcl-scanner.ll"{ return token::NSUM; } YY_BREAKcase 30:YY_RULE_SETUP#line 83 "fcl-scanner.ll"{ return token::ACCU; } YY_BREAKcase 31:YY_RULE_SETUP#line 84 "fcl-scanner.ll"{ return token::RULE; } YY_BREAKcase 32:YY_RULE_SETUP#line 85 "fcl-scanner.ll"{ return token::IF; } YY_BREAKcase 33:YY_RULE_SETUP#line 86 "fcl-scanner.ll"{ return token::THEN; } YY_BREAKcase 34:YY_RULE_SETUP#line 87 "fcl-scanner.ll"{ return token::IS; } YY_BREAKcase 35:YY_RULE_SETUP#line 88 "fcl-scanner.ll"{ return token::METHOD; } YY_BREAKcase 36:YY_RULE_SETUP#line 89 "fcl-scanner.ll"{ return token::COG; } YY_BREAKcase 37:YY_RULE_SETUP#line 90 "fcl-scanner.ll"{ return token::COGS; } YY_BREAKcase 38:YY_RULE_SETUP#line 91 "fcl-scanner.ll"{ return token::COA; } YY_BREAKcase 39:YY_RULE_SETUP#line 92 "fcl-scanner.ll"{ return token::LM; } YY_BREAKcase 40:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -