#include #include #include # 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); void yywunput(wchar_t); #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 __cplusplus extern "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):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar) #else # define lex_input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar) #endif #define ECHO fprintf(yyout, "%s",yytext) # define REJECT { nstr = yyreject(); goto yyfussy;} int yyleng; #define YYISARRAY char yytext[YYLMAX]; int yymorfg; extern char *yysptr, yysbuf[]; int yytchar; FILE *yyin = {stdin}, *yyout = {stdout}; extern int yylineno; struct yysvf { struct yywork *yystoff; struct yysvf *yyother; int *yystops;}; struct yysvf *yyestate; extern struct yysvf yysvec[], *yybgin; # line 3 "att2.l" /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ # line 26 "att2.l" /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ # line 29 "att2.l" /* All Rights Reserved */ #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */ #include "att1.h" #include #define LL(t,v) return(yylval = v, t) #undef getc #define getc(x) (*argp?tolower(*argp++):EOF) #undef feof #define feof(x) (*argp?0:1) extern int yylval; char *argp = ""; # define YYNEWLINE 10 int yylex(){ 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; #endif while((nstr = yylook()) >= 0) yyfussy: switch(nstr){ case 0: if(yywrap()) return(0); break; case 1: # line 48 "att2.l" ; break; case 2: # line 49 "att2.l" { LL(MONTH, 0); } break; case 3: # line 50 "att2.l" { LL(MONTH, 1); } break; case 4: # line 51 "att2.l" { LL(MONTH, 2); } break; case 5: # line 52 "att2.l" { LL(MONTH, 3); } break; case 6: # line 53 "att2.l" { LL(MONTH, 4); } break; case 7: # line 54 "att2.l" { LL(MONTH, 5); } break; case 8: # line 55 "att2.l" { LL(MONTH, 6); } break; case 9: # line 56 "att2.l" { LL(MONTH, 7); } break; case 10: # line 57 "att2.l" { LL(MONTH, 8); } break; case 11: # line 58 "att2.l" { LL(MONTH, 9); } break; case 12: # line 59 "att2.l" { LL(MONTH, 10); } break; case 13: # line 60 "att2.l" { LL(MONTH, 11); } break; case 14: # line 61 "att2.l" { LL(DAY, 0); } break; case 15: # line 62 "att2.l" { LL(DAY, 1); } break; case 16: # line 63 "att2.l" { LL(DAY, 2); } break; case 17: # line 64 "att2.l" { LL(DAY, 3); } break; case 18: # line 65 "att2.l" { LL(DAY, 4); } break; case 19: # line 66 "att2.l" { LL(DAY, 5); } break; case 20: # line 67 "att2.l" { LL(DAY, 6); } break; case 21: # line 68 "att2.l" { LL(DAY, 7); } break; case 22: # line 69 "att2.l" { LL(DAY, 8); } break; case 23: # line 70 "att2.l" { LL(TIME, NOON); } break; case 24: # line 71 "att2.l" { LL(TIME, MIDNIGHT); } break; case 25: # line 72 "att2.l" { LL(TIME, NOW); } break; case 26: # line 73 "att2.l" { LL(SUFF, AM); } break; case 27: # line 74 "att2.l" { LL(SUFF, PM); } break; case 28: # line 75 "att2.l" { LL(ZONE, ZULU); } break; case 29: # line 76 "att2.l" { LL(ZONE, ZULU); } break; case 30: # line 77 "att2.l" { LL(ZONE, ZULU); } break; case 31: # line 78 "att2.l" { LL(NEXT, 1); } break; case 32: # line 79 "att2.l" { LL(UNIT, MINUTE); } break; case 33: # line 80 "att2.l" { LL(UNIT, HOUR); } break; case 34: # line 81 "att2.l" { LL(UNIT, DAY); } break; case 35: # line 82 "att2.l" { LL(UNIT, WEEK); } break; case 36: # line 83 "att2.l" { LL(UNIT, MONTH); } break; case 37: # line 84 "att2.l" { LL(UNIT, YEAR); } break; case 38: # line 85 "att2.l" { yylval = yytext[0] - '0'; return(NUMB); } break; case 39: # line 86 "att2.l" { LL(COLON, 0); } break; case 40: # line 87 "att2.l" { LL(COMMA, 0); } break; case 41: # line 88 "att2.l" { LL(PLUS, 0); } break; case 42: # line 89 "att2.l" { LL(UNKNOWN, 0); } break; case -1: break; default: (void)fprintf(yyout,"bad switch yylook %d",nstr); } return(0); } /* end of yylex */ int yyvstop[] = { 0, 42, 0, 1, 42, 0, 1, 0, 41, 42, 0, 40, 42, 0, 38, 42, 0, 39, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 42, 0, 26, 0, 27, 0, 5, 0, 9, 0, 34, 0, 13, 0, 3, 0, 19, 0, 30, 0, 2, 0, 8, 0, 7, 0, 4, 0, 6, 0, 32, 0, 15, 0, 12, 0, 25, 0, 11, 0, 20, 0, 10, 0, 14, 0, 18, 0, 16, 0, 29, 0, 17, 0, 34, 0, 33, 0, 8, 0, 7, 0, 32, 0, 31, 0, 23, 0, 35, 0, 37, 0, 28, 0, 5, 0, 33, 0, 4, 0, 36, 0, 21, 0, 35, 0, 37, 0, 9, 0, 19, 0, 32, 0, 15, 0, 36, 0, 14, 0, 2, 0, 11, 0, 16, 0, 13, 0, 3, 0, 24, 0, 12, 0, 20, 0, 18, 0, 22, 0, 10, 0, 17, 0, 0}; # define YYTYPE unsigned char struct yywork { YYTYPE verify, advance; } yycrank[] = { 0,0, 0,0, 1,3, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,4, 1,5, 4,5, 4,5, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 4,5, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,6, 1,7, 0,0, 0,0, 0,0, 1,8, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,9, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,10, 15,35, 18,42, 1,11, 11,29, 1,12, 1,13, 1,14, 11,30, 1,15, 23,51, 24,52, 1,16, 1,17, 1,18, 1,19, 13,33, 14,34, 1,20, 1,21, 1,22, 15,36, 1,23, 2,10, 1,24, 1,25, 2,11, 12,31, 2,12, 2,13, 2,14, 10,26, 2,15, 19,43, 10,27, 2,16, 2,17, 2,18, 2,19, 10,28, 12,32, 2,20, 2,21, 2,22, 16,37, 2,23, 17,40, 2,24, 2,25, 20,44, 21,47, 22,50, 16,38, 20,45, 25,53, 27,54, 17,41, 21,48, 16,39, 28,55, 29,56, 30,57, 31,58, 21,49, 32,59, 33,60, 34,61, 35,62, 36,63, 20,46, 36,64, 37,65, 38,67, 39,69, 40,70, 42,74, 41,71, 44,75, 37,66, 45,76, 46,77, 47,78, 38,68, 41,72, 41,73, 48,79, 49,81, 50,82, 51,83, 51,84, 52,85, 53,86, 54,87, 55,88, 48,80, 56,89, 57,90, 58,91, 59,92, 61,93, 62,94, 63,95, 64,96, 65,97, 67,98, 68,99, 69,101, 68,100, 70,103, 71,104, 72,105, 74,106, 75,107, 76,108, 77,109, 78,110, 79,111, 80,112, 81,113, 83,114, 84,115, 85,116, 69,102, 86,117, 87,118, 88,119, 90,120, 91,121, 92,122, 93,123, 94,124, 97,125, 98,126, 100,127, 101,128, 102,129, 105,130, 106,131, 107,132, 108,133, 109,134, 110,135, 111,136, 112,137, 113,138, 114,139, 115,140, 116,141, 119,142, 120,143, 121,144, 122,145, 124,146, 126,147, 127,148, 128,149, 129,150, 130,151, 131,152, 132,153, 133,154, 134,155, 135,156, 137,157, 138,158, 139,159, 143,160, 144,161, 146,162, 147,163, 148,99, 151,164, 152,165, 153,166, 154,167, 156,168, 157,169, 158,170, 159,171, 160,172, 161,173, 163,174, 164,175, 166,176, 167,177, 168,178, 169,179, 171,180, 177,181, 180,182, 0,0}; struct yysvf yysvec[] = { 0, 0, 0, yycrank+-1, 0, 0, yycrank+-24, yysvec+1, 0, yycrank+0, 0, yyvstop+1, yycrank+3, 0, yyvstop+3, yycrank+0, yysvec+4, yyvstop+6, yycrank+0, 0, yyvstop+8, yycrank+0, 0, yyvstop+11, yycrank+0, 0, yyvstop+14, yycrank+0, 0, yyvstop+17, yycrank+20, 0, yyvstop+20, yycrank+5, 0, yyvstop+22, yycrank+24, 0, yyvstop+24, yycrank+5, 0, yyvstop+26, yycrank+4, 0, yyvstop+28, yycrank+2, 0, yyvstop+30, yycrank+45, 0, yyvstop+32, yycrank+43, 0, yyvstop+34, yycrank+1, 0, yyvstop+36, yycrank+22, 0, yyvstop+38, yycrank+50, 0, yyvstop+40, yycrank+44, 0, yyvstop+42, yycrank+33, 0, yyvstop+44, yycrank+7, 0, yyvstop+46, yycrank+8, 0, yyvstop+48, yycrank+35, 0, yyvstop+50, yycrank+0, 0, yyvstop+52, yycrank+39, 0, 0, yycrank+54, 0, 0, yycrank+37, 0, 0, yycrank+60, 0, 0, yycrank+62, 0, 0, yycrank+57, 0, 0, yycrank+47, 0, 0, yycrank+47, 0, 0, yycrank+55, 0, 0, yycrank+58, 0, 0, yycrank+55, 0, 0, yycrank+70, 0, 0, yycrank+61, 0, 0, yycrank+52, 0, 0, yycrank+63, 0, 0, yycrank+57, 0, 0, yycrank+0, 0, yyvstop+54, yycrank+59, 0, 0, yycrank+65, 0, 0, yycrank+68, 0, 0, yycrank+62, 0, 0, yycrank+83, 0, 0, yycrank+83, 0, 0, yycrank+86, 0, 0, yycrank+86, 0, 0, yycrank+91, 0, 0, yycrank+81, 0, 0, yycrank+85, 0, yyvstop+56, yycrank+74, 0, yyvstop+58, yycrank+78, 0, yyvstop+60, yycrank+93, 0, yyvstop+62, yycrank+81, 0, yyvstop+64, yycrank+96, 0, yyvstop+66, yycrank+0, 0, yyvstop+68, yycrank+83, 0, 0, yycrank+81, 0, yyvstop+70, yycrank+78, 0, yyvstop+72, yycrank+99, 0, yyvstop+74, yycrank+102, 0, yyvstop+76, yycrank+0, 0, yyvstop+78, yycrank+92, 0, 0, yycrank+88, 0, yyvstop+80, yycrank+104, 0, yyvstop+82, yycrank+90, 0, 0, yycrank+97, 0, 0, yycrank+107, 0, yyvstop+84, yycrank+0, 0, yyvstop+86, yycrank+98, 0, yyvstop+88, yycrank+93, 0, yyvstop+90, yycrank+95, 0, yyvstop+92, yycrank+112, 0, yyvstop+94, yycrank+99, 0, yyvstop+96, yycrank+117, 0, 0, yycrank+104, 0, 0, yycrank+101, 0, yyvstop+98, yycrank+0, 0, yyvstop+100, yycrank+107, 0, yyvstop+102, yycrank+111, 0, 0, yycrank+105, 0, 0, yycrank+104, 0, 0, yycrank+114, 0, 0, yycrank+108, 0, 0, yycrank+0, 0, yyvstop+104, yycrank+115, 0, 0, yycrank+108, 0, 0, yycrank+129, 0, 0, yycrank+112, 0, yyvstop+106, yycrank+131, 0, 0, yycrank+0, 0, yyvstop+108, yycrank+0, 0, yyvstop+110, yycrank+125, 0, 0, yycrank+125, 0, 0, yycrank+0, 0, yyvstop+112, yycrank+115, 0, 0, yycrank+135, 0, 0, yycrank+129, 0, 0, yycrank+0, 0, yyvstop+114, yycrank+0, 0, yyvstop+116, yycrank+125, 0, 0, yycrank+137, 0, 0, yycrank+122, 0, 0, yycrank+136, 0, 0, yycrank+141, 0, 0, yycrank+124, 0, 0, yycrank+119, 0, 0, yycrank+127, 0, 0, yycrank+142, 0, 0, yycrank+142, 0, 0, yycrank+129, 0, yyvstop+118, yycrank+130, 0, yyvstop+120, yycrank+0, 0, yyvstop+122, yycrank+0, 0, yyvstop+124, yycrank+130, 0, 0, yycrank+149, 0, 0, yycrank+151, 0, 0, yycrank+128, 0, 0, yycrank+0, 0, yyvstop+126, yycrank+136, 0, 0, yycrank+0, 0, yyvstop+128, yycrank+148, 0, 0, yycrank+151, 0, 0, yycrank+132, 0, 0, yycrank+139, 0, yyvstop+130, yycrank+157, 0, 0, yycrank+155, 0, 0, yycrank+157, 0, 0, yycrank+149, 0, 0, yycrank+138, 0, 0, yycrank+160, 0, 0, yycrank+0, 0, yyvstop+132, yycrank+147, 0, 0, yycrank+165, 0, 0, yycrank+148, 0, 0, yycrank+0, 0, yyvstop+134, yycrank+0, 0, yyvstop+136, yycrank+0, 0, yyvstop+138, yycrank+163, 0, 0, yycrank+151, 0, 0, yycrank+0, 0, yyvstop+140, yycrank+145, 0, 0, yycrank+163, 0, 0, yycrank+153, 0, yyvstop+142, yycrank+0, 0, yyvstop+144, yycrank+0, 0, yyvstop+146, yycrank+168, 0, 0, yycrank+156, 0, 0, yycrank+174, 0, 0, yycrank+174, 0, 0, yycrank+0, 0, yyvstop+148, yycrank+176, 0, 0, yycrank+163, 0, 0, yycrank+154, 0, 0, yycrank+176, 0, 0, yycrank+163, 0, 0, yycrank+157, 0, 0, yycrank+0, 0, yyvstop+150, yycrank+163, 0, 0, yycrank+166, 0, 0, yycrank+0, 0, yyvstop+152, yycrank+160, 0, 0, yycrank+181, 0, 0, yycrank+162, 0, 0, yycrank+165, 0, 0, yycrank+0, 0, yyvstop+154, yycrank+188, 0, 0, yycrank+0, 0, yyvstop+156, yycrank+0, 0, yyvstop+158, yycrank+0, 0, yyvstop+160, yycrank+0, 0, yyvstop+162, yycrank+0, 0, yyvstop+164, yycrank+172, 0, 0, yycrank+0, 0, yyvstop+166, yycrank+0, 0, yyvstop+168, yycrank+166, 0, 0, yycrank+0, 0, yyvstop+170, yycrank+0, 0, yyvstop+172, 0, 0, 0}; struct yywork *yytop = yycrank+287; struct yysvf *yybgin = yysvec+1; char yymatch[] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 9, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 43, 44, 1, 1, 1, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 58, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; char yyextra[] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0}; /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* Copyright (c) 1989 AT&T */ /* All Rights Reserved */ #pragma ident "%Z%%M% %I% %E% SMI" int yylineno =1; # define YYU(x) x # define NLSTATE yyprevious=YYNEWLINE struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp; char yysbuf[YYLMAX]; char *yysptr = yysbuf; int *yyfnd; extern struct yysvf *yyestate; int yyprevious = YYNEWLINE; #if defined(__cplusplus) || defined(__STDC__) int yylook(void) #else yylook() #endif { register struct yysvf *yystate, **lsp; register struct yywork *yyt; struct yysvf *yyz; int yych, yyfirst; struct yywork *yyr; # ifdef LEXDEBUG int debug; # endif char *yylastch; /* start off machines */ # ifdef LEXDEBUG debug = 0; # endif yyfirst=1; if (!yymorfg) yylastch = yytext; else { yymorfg=0; yylastch = yytext+yyleng; } for(;;){ lsp = yylstate; yyestate = yystate = yybgin; if (yyprevious==YYNEWLINE) yystate++; for (;;){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1); # endif yyt = yystate->yystoff; if(yyt == yycrank && !yyfirst){ /* may not be any transitions */ yyz = yystate->yyother; if(yyz == 0)break; if(yyz->yystoff == yycrank)break; } #ifndef __cplusplus *yylastch++ = yych = input(); #else *yylastch++ = yych = lex_input(); #endif #ifdef YYISARRAY if(yylastch > &yytext[YYLMAX]) { fprintf(yyout,"Input string too long, limit %d\n",YYLMAX); exit(1); } #else if (yylastch >= &yytext[ yytextsz ]) { int x = yylastch - yytext; yytextsz += YYTEXTSZINC; if (yytext == yy_tbuf) { yytext = (char *) malloc(yytextsz); memcpy(yytext, yy_tbuf, sizeof (yy_tbuf)); } else yytext = (char *) realloc(yytext, yytextsz); if (!yytext) { fprintf(yyout, "Cannot realloc yytext\n"); exit(1); } yylastch = yytext + x; } #endif yyfirst=0; tryagain: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"char "); allprint(yych); putchar('\n'); } # endif yyr = yyt; if ( (uintptr_t)yyt > (uintptr_t)yycrank){ yyt = yyr + yych; if (yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; if(lsp > &yylstate[YYLMAX]) { fprintf(yyout,"Input string too long, limit %d\n",YYLMAX); exit(1); } goto contin; } } # ifdef YYOPTIM else if((uintptr_t)yyt < (uintptr_t)yycrank) { /* r < yycrank */ yyt = yyr = yycrank+(yycrank-yyt); # ifdef LEXDEBUG if(debug)fprintf(yyout,"compressed state\n"); # endif yyt = yyt + yych; if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transitions */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; if(lsp > &yylstate[YYLMAX]) { fprintf(yyout,"Input string too long, limit %d\n",YYLMAX); exit(1); } goto contin; } yyt = yyr + YYU(yymatch[yych]); # ifdef LEXDEBUG if(debug){ fprintf(yyout,"try fall back character "); allprint(YYU(yymatch[yych])); putchar('\n'); } # endif if(yyt <= yytop && yyt->verify+yysvec == yystate){ if(yyt->advance+yysvec == YYLERR) /* error transition */ {unput(*--yylastch);break;} *lsp++ = yystate = yyt->advance+yysvec; if(lsp > &yylstate[YYLMAX]) { fprintf(yyout,"Input string too long, limit %d\n",YYLMAX); exit(1); } goto contin; } } if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){ # ifdef LEXDEBUG if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1); # endif goto tryagain; } # endif else {unput(*--yylastch);break;} contin: # ifdef LEXDEBUG if(debug){ fprintf(yyout,"state %d char ",yystate-yysvec-1); allprint(yych); putchar('\n'); } # endif ; } # ifdef LEXDEBUG if(debug){ fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); allprint(yych); putchar('\n'); } # endif while (lsp-- > yylstate){ *yylastch-- = 0; if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){ yyolsp = lsp; if(yyextra[*yyfnd]){ /* must backup */ while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){ lsp--; unput(*yylastch--); } } yyprevious = YYU(*yylastch); yylsp = lsp; yyleng = yylastch-yytext+1; yytext[yyleng] = 0; # ifdef LEXDEBUG if(debug){ fprintf(yyout,"\nmatch "); sprint(yytext); fprintf(yyout," action %d\n",*yyfnd); } # endif return(*yyfnd++); } unput(*yylastch); } if (yytext[0] == 0 && feof(yyin) ) { yysptr=yysbuf; return(0); } #ifndef __cplusplus yyprevious = yytext[0] = input(); if (yyprevious>0) output(yyprevious); #else yyprevious = yytext[0] = lex_input(); if (yyprevious>0) lex_output(yyprevious); #endif yylastch=yytext; # ifdef LEXDEBUG if(debug)putchar('\n'); # endif } } #if defined(__cplusplus) || defined(__STDC__) int yyback(int *p, int m) #else yyback(p, m) int *p; #endif { if (p==0) return(0); while (*p) { if (*p++ == m) return(1); } return(0); } /* the following are only used in the lex library */ #if defined(__cplusplus) || defined(__STDC__) int yyinput(void) #else yyinput() #endif { #ifndef __cplusplus return(input()); #else return(lex_input()); #endif } #if defined(__cplusplus) || defined(__STDC__) void yyoutput(int c) #else yyoutput(c) int c; #endif { #ifndef __cplusplus output(c); #else lex_output(c); #endif } #if defined(__cplusplus) || defined(__STDC__) void yyunput(int c) #else yyunput(c) int c; #endif { unput(c); }