📄 lex.yy.c
字号:
#include <stdio.h>#include <stdlib.h># define U(x) x# define NLSTATE yyprevious=YYNEWLINE# define BEGIN yybgin = yysvec + 1 +# define INITIAL 0# define YYLERR yysvec# define YYSTATE (yyestate-yysvec-1)# define YYOPTIM 1# ifndef YYLMAX # define YYLMAX BUFSIZ# endif #ifndef __cplusplus# define output(c) (void)putc(c,yyout)#else# define lex_output(c) (void)putc(c,yyout)#endif#if defined(__cplusplus) || defined(__STDC__)#if defined(__cplusplus) && defined(__EXTERN_C__)extern "C" {#endif int yyback(int *, int); int yyinput(void); int yylook(void); void yyoutput(int); int yyracc(int); int yyreject(void); void yyunput(int); int yylex(void);#ifdef YYLEX_E void yywoutput(wchar_t); wchar_t yywinput(void);#endif#ifndef yyless int yyless(int);#endif#ifndef yywrap int yywrap(void);#endif#ifdef LEXDEBUG void allprint(char); void sprint(char *);#endif#if defined(__cplusplus) && defined(__EXTERN_C__)}#endif#ifdef __cplusplusextern "C" {#endif void exit(int);#ifdef __cplusplus}#endif#endif# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}# define yymore() (yymorfg=1)#ifndef __cplusplus# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):(yycharno++,getc(yyin)))==10?(yylineno++,yybline=yycharno,yytchar):yytchar)==EOF?0:yytchar)#else# define lex_input() (((yytchar=yysptr>yysbuf?U(*--yysptr):(yycharno++,getc(yyin)))==10?(yylineno++,yybline=yycharno,yytchar):yytchar)==EOF?0:yytchar)#endif#define ECHO fprintf(yyout, "%s",yytext)# define REJECT { nstr = yyreject(); goto yyfussy;}int yyleng;#define YYISARRAYchar yytext[YYLMAX];int yymorfg;extern char *yysptr, yysbuf[];int yytchar;FILE *yyin = {stdin}, *yyout = {stdout};extern long yycharno,yytok,yybline;struct yysvf { struct yywork *yystoff; struct yysvf *yyother; int *yystops;};struct yysvf *yyestate;extern struct yysvf yysvec[], *yybgin;#include <stdio.h>#include "y.tab.h"int dividerCounter = 0;int unionCurlyCounter = 0;int simiColonCounter = 0;int subUnionCurlyCounter = 0;int actionCurlyCounter = 0;# define THEEND 2# define CCODE 4# define UNION 6# define SUBUNION 8# define ACTION 10# define STRING 12# define LIT 14# define YYNEWLINE 10yylex(){int nstr; extern int yyprevious;#ifdef __cplusplus/* to avoid CC and lint complaining yyfussy not being used ...*/static int __lex_hack = 0;if (__lex_hack) goto yyfussy;#endifwhile((nstr = yylook()) >= 0)yyfussy: switch(nstr){case 0:if(yywrap()) return(0); break;case 1:# line 15 "./TransCode/yacc.l" return(':');break;case 2:# line 16 "./TransCode/yacc.l" return(';');break;case 3:# line 17 "./TransCode/yacc.l" return('<');break;case 4:# line 18 "./TransCode/yacc.l" return('>');break;case 5:# line 19 "./TransCode/yacc.l" return('|');break;case 6:# line 20 "./TransCode/yacc.l" return(TOKEN_T);break;case 7:# line 21 "./TransCode/yacc.l" return(LEFT_T);break;case 8:# line 22 "./TransCode/yacc.l" return(RIGHT_T);break;case 9:# line 23 "./TransCode/yacc.l" return(TYPE_T);break;case 10:# line 24 "./TransCode/yacc.l" return(NONASSOC_T);break;case 11:# line 25 "./TransCode/yacc.l" return(PREC_T);break;case 12:# line 26 "./TransCode/yacc.l" return(NAME);break;case 13:# line 27 "./TransCode/yacc.l" return(CHAR);break;case 14:# line 28 "./TransCode/yacc.l" return(CHAR);break;case 15:# line 30 "./TransCode/yacc.l" { dividerCounter++; if (dividerCounter == 2) { BEGIN THEEND; return(ENDDIVIDER); } else { return(DIVIDER); } }break;case 16:# line 42 "./TransCode/yacc.l" return (ENDCHAR);break;case 17:# line 43 "./TransCode/yacc.l" return (ENDCHAR);break;case 18:# line 45 "./TransCode/yacc.l" { BEGIN CCODE; return(LCURL); }break;case 19:# line 49 "./TransCode/yacc.l" return (CCHAR);break;case 20:# line 50 "./TransCode/yacc.l" return (CCHAR);break;case 21:# line 51 "./TransCode/yacc.l" { BEGIN INITIAL; return(RCURL); }break;case 22:# line 56 "./TransCode/yacc.l" { BEGIN UNION; return(UNION_T); }break;case 23:# line 60 "./TransCode/yacc.l" return('{');break;case 24:# line 61 "./TransCode/yacc.l" return(STRUCT_U);break;case 25:# line 62 "./TransCode/yacc.l" return(INT_U);break;case 26:# line 63 "./TransCode/yacc.l" return('x');break;case 27:# line 64 "./TransCode/yacc.l" return('[');break;case 28:# line 65 "./TransCode/yacc.l" return(INT);break;case 29:# line 66 "./TransCode/yacc.l" return(']');break;case 30:# line 67 "./TransCode/yacc.l" { simiColonCounter++; if (simiColonCounter == 1) { BEGIN SUBUNION; } return(';'); }break;case 31:# line 76 "./TransCode/yacc.l" { subUnionCurlyCounter++; return(UCHAR); }break;case 32:# line 80 "./TransCode/yacc.l" { subUnionCurlyCounter--; if (subUnionCurlyCounter < 0) { BEGIN UNION; unionCurlyCounter++; return('}'); } else { return(UCHAR); } }break;case 33:# line 93 "./TransCode/yacc.l" return(UCHAR);break;case 34:# line 94 "./TransCode/yacc.l" return(UCHAR);break;case 35:# line 96 "./TransCode/yacc.l" return(NAME_U);break;case 36:# line 97 "./TransCode/yacc.l" ;break;case 37:# line 98 "./TransCode/yacc.l" { unionCurlyCounter++; if (unionCurlyCounter == 2) { BEGIN INITIAL; } return('}'); }break;case 38:# line 107 "./TransCode/yacc.l" { actionCurlyCounter++; BEGIN ACTION; return('{'); }break;case 39:# line 112 "./TransCode/yacc.l" { actionCurlyCounter++; return(ALCURLY); }break;case 40:# line 116 "./TransCode/yacc.l" { actionCurlyCounter--; if (actionCurlyCounter == 0) { BEGIN INITIAL; return('}'); } else { return(ARCURLY); } }break;case 41:# line 128 "./TransCode/yacc.l" { BEGIN STRING; return('"'); }break;case 42:# line 132 "./TransCode/yacc.l" { BEGIN ACTION; return('"'); }break;case 43:# line 136 "./TransCode/yacc.l" return(SQUOAT);break;case 44:# line 137 "./TransCode/yacc.l" return(SCHAR);break;case 45:# line 139 "./TransCode/yacc.l" { BEGIN LIT; return(BEGINLIT); }break;case 46:# line 143 "./TransCode/yacc.l" { BEGIN ACTION; return(ENDLIT); }break;case 47:# line 147 "./TransCode/yacc.l" return(LQUOAT);break;case 48:# line 148 "./TransCode/yacc.l" return(LCHAR);break;case 49:# line 150 "./TransCode/yacc.l" return(ASPACE);break;case 50:# line 151 "./TransCode/yacc.l" return(ARETURN);break;case 51:# line 152 "./TransCode/yacc.l" return(ACHAR);break;case 52:# line 154 "./TransCode/yacc.l" ;break;case 53:# line 155 "./TransCode/yacc.l" return(JUNK);break;case 54:# line 156 "./TransCode/yacc.l" return(JUNK);break;case 55:# line 157 "./TransCode/yacc.l" return(JUNK);break;case 56:# line 158 "./TransCode/yacc.l" return(JUNK);break;case -1:break;default:(void)fprintf(yyout,"bad switch yylook %d",nstr);} return(0); }/* end of yylex */int yyvstop[] = {0,53,0, 52,53,0, 52,0, 53,0, 53,0, 12,53,0, 1,53,0, 2,53,0, 3,53,0, 4,53,0, 38,53,0, 5,53,0, 16,0, 17,0, 19,0, 20,0, 19,0, 54,0, 36,54,0, 36,0, 28,35,54,0, 30,54,0, 35,54,0, 27,54,0, 29,54,0, 35,54,0, 35,54,0, 26,35,54,0, 23,54,0, 37,54,0, 33,0, 34,0, 31,33,0, 32,33,0, 51,0, 49,50,51,0, 50,0, 41,51,0, 45,51,0, 39,51,0, 40,51,0, 44,0, 55,0, 42,44,0, 44,0, 48,0, 56,0, 46,48,0, 48,0, 15,0, 18,0, 12,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -