diff options
author | Roland McGrath <roland@gnu.org> | 1998-07-19 00:19:01 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1998-07-19 00:19:01 +0000 |
commit | 741b594313e118ff4bf0c0980ceceb66222ba291 (patch) | |
tree | ae6555808bc2712daece5d84d72f25b89d3762b3 /lexxer.c | |
parent | b2f4f81c0af08e3599965bad9d7854c9ef09dc94 (diff) | |
download | mig-741b594313e118ff4bf0c0980ceceb66222ba291.tar.gz mig-741b594313e118ff4bf0c0980ceceb66222ba291.tar.bz2 mig-741b594313e118ff4bf0c0980ceceb66222ba291.zip |
1998-07-18 Roland McGrath <roland@baalperazim.frob.com>
* lexxer.c, parser.c: Regenerated in srcdir so #line refs are good.
Diffstat (limited to 'lexxer.c')
-rw-r--r-- | lexxer.c | 298 |
1 files changed, 165 insertions, 133 deletions
@@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: cvs/mig/Attic/lexxer.c,v 1.1.1.1 1998/07/18 23:59:25 frob Exp $ + * $Header: cvs/mig/Attic/lexxer.c,v 1.2 1998/07/19 00:18:29 roland Exp $ */ #define FLEX_SCANNER @@ -126,6 +126,7 @@ extern FILE *yyin, *yyout; { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ @@ -235,7 +236,7 @@ void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); @@ -763,10 +764,11 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "../gnumach/mig/lexxer.l" +#line 1 "lexxer.l" #define INITIAL 0 -#line 15 "../gnumach/mig/lexxer.l" +#line 15 "lexxer.l" /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University @@ -855,7 +857,7 @@ static void doSharp(const char *body); /* process body of # directives */ #define QString 4 #define SkipToEOL 5 -#line 859 "lex.yy.c" +#line 861 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -877,6 +879,10 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr )); static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); @@ -1005,10 +1011,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 101 "../gnumach/mig/lexxer.l" +#line 101 "lexxer.l" -#line 1012 "lex.yy.c" +#line 1018 "lex.yy.c" if ( yy_init ) { @@ -1094,515 +1100,515 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 103 "../gnumach/mig/lexxer.l" +#line 103 "lexxer.l" RETURN(syRoutine); YY_BREAK case 2: YY_RULE_SETUP -#line 104 "../gnumach/mig/lexxer.l" +#line 104 "lexxer.l" RETURN(syFunction); YY_BREAK case 3: YY_RULE_SETUP -#line 105 "../gnumach/mig/lexxer.l" +#line 105 "lexxer.l" RETURN(syProcedure); YY_BREAK case 4: YY_RULE_SETUP -#line 106 "../gnumach/mig/lexxer.l" +#line 106 "lexxer.l" RETURN(sySimpleProcedure); YY_BREAK case 5: YY_RULE_SETUP -#line 107 "../gnumach/mig/lexxer.l" +#line 107 "lexxer.l" RETURN(sySimpleRoutine); YY_BREAK case 6: YY_RULE_SETUP -#line 108 "../gnumach/mig/lexxer.l" +#line 108 "lexxer.l" RETURN(sySubsystem); YY_BREAK case 7: YY_RULE_SETUP -#line 109 "../gnumach/mig/lexxer.l" +#line 109 "lexxer.l" RETURN(syMsgOption); YY_BREAK case 8: YY_RULE_SETUP -#line 110 "../gnumach/mig/lexxer.l" +#line 110 "lexxer.l" RETURN(syMsgSeqno); YY_BREAK case 9: YY_RULE_SETUP -#line 111 "../gnumach/mig/lexxer.l" +#line 111 "lexxer.l" RETURN(syWaitTime); YY_BREAK case 10: YY_RULE_SETUP -#line 112 "../gnumach/mig/lexxer.l" +#line 112 "lexxer.l" RETURN(syNoWaitTime); YY_BREAK case 11: YY_RULE_SETUP -#line 113 "../gnumach/mig/lexxer.l" +#line 113 "lexxer.l" RETURN(syIn); YY_BREAK case 12: YY_RULE_SETUP -#line 114 "../gnumach/mig/lexxer.l" +#line 114 "lexxer.l" RETURN(syOut); YY_BREAK case 13: YY_RULE_SETUP -#line 115 "../gnumach/mig/lexxer.l" +#line 115 "lexxer.l" RETURN(syInOut); YY_BREAK case 14: YY_RULE_SETUP -#line 116 "../gnumach/mig/lexxer.l" +#line 116 "lexxer.l" RETURN(syRequestPort); YY_BREAK case 15: YY_RULE_SETUP -#line 117 "../gnumach/mig/lexxer.l" +#line 117 "lexxer.l" RETURN(syReplyPort); YY_BREAK case 16: YY_RULE_SETUP -#line 118 "../gnumach/mig/lexxer.l" +#line 118 "lexxer.l" RETURN(syUReplyPort); YY_BREAK case 17: YY_RULE_SETUP -#line 119 "../gnumach/mig/lexxer.l" +#line 119 "lexxer.l" RETURN(sySReplyPort); YY_BREAK case 18: YY_RULE_SETUP -#line 120 "../gnumach/mig/lexxer.l" +#line 120 "lexxer.l" RETURN(syArray); YY_BREAK case 19: YY_RULE_SETUP -#line 121 "../gnumach/mig/lexxer.l" +#line 121 "lexxer.l" RETURN(syOf); YY_BREAK case 20: YY_RULE_SETUP -#line 122 "../gnumach/mig/lexxer.l" +#line 122 "lexxer.l" RETURN(syErrorProc); YY_BREAK case 21: YY_RULE_SETUP -#line 123 "../gnumach/mig/lexxer.l" +#line 123 "lexxer.l" RETURN(syServerPrefix); YY_BREAK case 22: YY_RULE_SETUP -#line 124 "../gnumach/mig/lexxer.l" +#line 124 "lexxer.l" RETURN(syUserPrefix); YY_BREAK case 23: YY_RULE_SETUP -#line 125 "../gnumach/mig/lexxer.l" +#line 125 "lexxer.l" RETURN(syServerDemux); YY_BREAK case 24: YY_RULE_SETUP -#line 126 "../gnumach/mig/lexxer.l" +#line 126 "lexxer.l" RETURN(syRCSId); YY_BREAK case 25: YY_RULE_SETUP -#line 127 "../gnumach/mig/lexxer.l" +#line 127 "lexxer.l" RETURN(syImport); YY_BREAK case 26: YY_RULE_SETUP -#line 128 "../gnumach/mig/lexxer.l" +#line 128 "lexxer.l" RETURN(syUImport); YY_BREAK case 27: YY_RULE_SETUP -#line 129 "../gnumach/mig/lexxer.l" +#line 129 "lexxer.l" RETURN(sySImport); YY_BREAK case 28: YY_RULE_SETUP -#line 130 "../gnumach/mig/lexxer.l" +#line 130 "lexxer.l" RETURN(syType); YY_BREAK case 29: YY_RULE_SETUP -#line 131 "../gnumach/mig/lexxer.l" +#line 131 "lexxer.l" RETURN(syKernelServer); YY_BREAK case 30: YY_RULE_SETUP -#line 132 "../gnumach/mig/lexxer.l" +#line 132 "lexxer.l" RETURN(syKernelUser); YY_BREAK case 31: YY_RULE_SETUP -#line 133 "../gnumach/mig/lexxer.l" +#line 133 "lexxer.l" RETURN(sySkip); YY_BREAK case 32: YY_RULE_SETUP -#line 134 "../gnumach/mig/lexxer.l" +#line 134 "lexxer.l" RETURN(syStruct); YY_BREAK case 33: YY_RULE_SETUP -#line 135 "../gnumach/mig/lexxer.l" +#line 135 "lexxer.l" RETURN(syInTran); YY_BREAK case 34: YY_RULE_SETUP -#line 136 "../gnumach/mig/lexxer.l" +#line 136 "lexxer.l" RETURN(syOutTran); YY_BREAK case 35: YY_RULE_SETUP -#line 137 "../gnumach/mig/lexxer.l" +#line 137 "lexxer.l" RETURN(syDestructor); YY_BREAK case 36: YY_RULE_SETUP -#line 138 "../gnumach/mig/lexxer.l" +#line 138 "lexxer.l" RETURN(syCType); YY_BREAK case 37: YY_RULE_SETUP -#line 139 "../gnumach/mig/lexxer.l" +#line 139 "lexxer.l" RETURN(syCUserType); YY_BREAK case 38: YY_RULE_SETUP -#line 140 "../gnumach/mig/lexxer.l" +#line 140 "lexxer.l" RETURN(syCServerType); YY_BREAK case 39: YY_RULE_SETUP -#line 141 "../gnumach/mig/lexxer.l" +#line 141 "lexxer.l" RETURN(syCString); YY_BREAK case 40: YY_RULE_SETUP -#line 143 "../gnumach/mig/lexxer.l" +#line 143 "lexxer.l" FRETURN(flLong); YY_BREAK case 41: YY_RULE_SETUP -#line 144 "../gnumach/mig/lexxer.l" +#line 144 "lexxer.l" FRETURN(flNotLong); YY_BREAK case 42: YY_RULE_SETUP -#line 145 "../gnumach/mig/lexxer.l" +#line 145 "lexxer.l" FRETURN(flDealloc); YY_BREAK case 43: YY_RULE_SETUP -#line 146 "../gnumach/mig/lexxer.l" +#line 146 "lexxer.l" FRETURN(flNotDealloc); YY_BREAK case 44: YY_RULE_SETUP -#line 147 "../gnumach/mig/lexxer.l" +#line 147 "lexxer.l" FRETURN(flServerCopy); YY_BREAK case 45: YY_RULE_SETUP -#line 148 "../gnumach/mig/lexxer.l" +#line 148 "lexxer.l" FRETURN(flCountInOut); YY_BREAK case 46: YY_RULE_SETUP -#line 150 "../gnumach/mig/lexxer.l" +#line 150 "lexxer.l" TRETURN(MACH_MSG_TYPE_POLYMORPHIC,word_size_in_bits); YY_BREAK case 47: YY_RULE_SETUP -#line 152 "../gnumach/mig/lexxer.l" +#line 152 "lexxer.l" TRETURN(MACH_MSG_TYPE_UNSTRUCTURED,0); YY_BREAK case 48: YY_RULE_SETUP -#line 153 "../gnumach/mig/lexxer.l" +#line 153 "lexxer.l" TRETURN(MACH_MSG_TYPE_BIT,1); YY_BREAK case 49: YY_RULE_SETUP -#line 154 "../gnumach/mig/lexxer.l" +#line 154 "lexxer.l" TRETURN(MACH_MSG_TYPE_BOOLEAN,32); YY_BREAK case 50: YY_RULE_SETUP -#line 155 "../gnumach/mig/lexxer.l" +#line 155 "lexxer.l" TRETURN(MACH_MSG_TYPE_INTEGER_16,16); YY_BREAK case 51: YY_RULE_SETUP -#line 156 "../gnumach/mig/lexxer.l" +#line 156 "lexxer.l" TRETURN(MACH_MSG_TYPE_INTEGER_32,32); YY_BREAK case 52: YY_RULE_SETUP -#line 157 "../gnumach/mig/lexxer.l" +#line 157 "lexxer.l" TRETURN(MACH_MSG_TYPE_INTEGER_64,64); YY_BREAK case 53: YY_RULE_SETUP -#line 158 "../gnumach/mig/lexxer.l" +#line 158 "lexxer.l" TRETURN(MACH_MSG_TYPE_CHAR,8); YY_BREAK case 54: YY_RULE_SETUP -#line 159 "../gnumach/mig/lexxer.l" +#line 159 "lexxer.l" TRETURN(MACH_MSG_TYPE_BYTE,8); YY_BREAK case 55: YY_RULE_SETUP -#line 160 "../gnumach/mig/lexxer.l" +#line 160 "lexxer.l" TRETURN(MACH_MSG_TYPE_INTEGER_8,8); YY_BREAK case 56: YY_RULE_SETUP -#line 161 "../gnumach/mig/lexxer.l" +#line 161 "lexxer.l" TRETURN(MACH_MSG_TYPE_REAL,0); YY_BREAK case 57: YY_RULE_SETUP -#line 162 "../gnumach/mig/lexxer.l" +#line 162 "lexxer.l" TRETURN(MACH_MSG_TYPE_STRING,0); YY_BREAK case 58: YY_RULE_SETUP -#line 163 "../gnumach/mig/lexxer.l" +#line 163 "lexxer.l" TRETURN(MACH_MSG_TYPE_STRING_C,0); YY_BREAK case 59: YY_RULE_SETUP -#line 165 "../gnumach/mig/lexxer.l" +#line 165 "lexxer.l" TPRETURN(MACH_MSG_TYPE_MOVE_RECEIVE,MACH_MSG_TYPE_PORT_RECEIVE,word_size_in_bits); YY_BREAK case 60: YY_RULE_SETUP -#line 166 "../gnumach/mig/lexxer.l" +#line 166 "lexxer.l" TPRETURN(MACH_MSG_TYPE_COPY_SEND,MACH_MSG_TYPE_PORT_SEND,word_size_in_bits); YY_BREAK case 61: YY_RULE_SETUP -#line 167 "../gnumach/mig/lexxer.l" +#line 167 "lexxer.l" TPRETURN(MACH_MSG_TYPE_MAKE_SEND,MACH_MSG_TYPE_PORT_SEND,word_size_in_bits); YY_BREAK case 62: YY_RULE_SETUP -#line 168 "../gnumach/mig/lexxer.l" +#line 168 "lexxer.l" TPRETURN(MACH_MSG_TYPE_MOVE_SEND,MACH_MSG_TYPE_PORT_SEND,word_size_in_bits); YY_BREAK case 63: YY_RULE_SETUP -#line 169 "../gnumach/mig/lexxer.l" +#line 169 "lexxer.l" TPRETURN(MACH_MSG_TYPE_MAKE_SEND_ONCE,MACH_MSG_TYPE_PORT_SEND_ONCE,word_size_in_bits); YY_BREAK case 64: YY_RULE_SETUP -#line 170 "../gnumach/mig/lexxer.l" +#line 170 "lexxer.l" TPRETURN(MACH_MSG_TYPE_MOVE_SEND_ONCE,MACH_MSG_TYPE_PORT_SEND_ONCE,word_size_in_bits); YY_BREAK case 65: YY_RULE_SETUP -#line 172 "../gnumach/mig/lexxer.l" +#line 172 "lexxer.l" TRETURN(MACH_MSG_TYPE_PORT_NAME,word_size_in_bits); YY_BREAK case 66: YY_RULE_SETUP -#line 173 "../gnumach/mig/lexxer.l" +#line 173 "lexxer.l" TPRETURN(MACH_MSG_TYPE_POLYMORPHIC,MACH_MSG_TYPE_PORT_RECEIVE,word_size_in_bits); YY_BREAK case 67: YY_RULE_SETUP -#line 174 "../gnumach/mig/lexxer.l" +#line 174 "lexxer.l" TPRETURN(MACH_MSG_TYPE_POLYMORPHIC,MACH_MSG_TYPE_PORT_SEND,word_size_in_bits); YY_BREAK case 68: YY_RULE_SETUP -#line 175 "../gnumach/mig/lexxer.l" +#line 175 "lexxer.l" TPRETURN(MACH_MSG_TYPE_POLYMORPHIC,MACH_MSG_TYPE_PORT_SEND_ONCE,word_size_in_bits); YY_BREAK case 69: YY_RULE_SETUP -#line 176 "../gnumach/mig/lexxer.l" +#line 176 "lexxer.l" TRETURN(MACH_MSG_TYPE_POLYMORPHIC,0); YY_BREAK case 70: YY_RULE_SETUP -#line 178 "../gnumach/mig/lexxer.l" +#line 178 "lexxer.l" RETURN(syColon); YY_BREAK case 71: YY_RULE_SETUP -#line 179 "../gnumach/mig/lexxer.l" +#line 179 "lexxer.l" RETURN(sySemi); YY_BREAK case 72: YY_RULE_SETUP -#line 180 "../gnumach/mig/lexxer.l" +#line 180 "lexxer.l" RETURN(syComma); YY_BREAK case 73: YY_RULE_SETUP -#line 181 "../gnumach/mig/lexxer.l" +#line 181 "lexxer.l" RETURN(syPlus); YY_BREAK case 74: YY_RULE_SETUP -#line 182 "../gnumach/mig/lexxer.l" +#line 182 "lexxer.l" RETURN(syMinus); YY_BREAK case 75: YY_RULE_SETUP -#line 183 "../gnumach/mig/lexxer.l" +#line 183 "lexxer.l" RETURN(syStar); YY_BREAK case 76: YY_RULE_SETUP -#line 184 "../gnumach/mig/lexxer.l" +#line 184 "lexxer.l" RETURN(syDiv); YY_BREAK case 77: YY_RULE_SETUP -#line 185 "../gnumach/mig/lexxer.l" +#line 185 "lexxer.l" RETURN(syLParen); YY_BREAK case 78: YY_RULE_SETUP -#line 186 "../gnumach/mig/lexxer.l" +#line 186 "lexxer.l" RETURN(syRParen); YY_BREAK case 79: YY_RULE_SETUP -#line 187 "../gnumach/mig/lexxer.l" +#line 187 "lexxer.l" RETURN(syEqual); YY_BREAK case 80: YY_RULE_SETUP -#line 188 "../gnumach/mig/lexxer.l" +#line 188 "lexxer.l" RETURN(syCaret); YY_BREAK case 81: YY_RULE_SETUP -#line 189 "../gnumach/mig/lexxer.l" +#line 189 "lexxer.l" RETURN(syTilde); YY_BREAK case 82: YY_RULE_SETUP -#line 190 "../gnumach/mig/lexxer.l" +#line 190 "lexxer.l" RETURN(syLAngle); YY_BREAK case 83: YY_RULE_SETUP -#line 191 "../gnumach/mig/lexxer.l" +#line 191 "lexxer.l" RETURN(syRAngle); YY_BREAK case 84: YY_RULE_SETUP -#line 192 "../gnumach/mig/lexxer.l" +#line 192 "lexxer.l" RETURN(syLBrack); YY_BREAK case 85: YY_RULE_SETUP -#line 193 "../gnumach/mig/lexxer.l" +#line 193 "lexxer.l" RETURN(syRBrack); YY_BREAK case 86: YY_RULE_SETUP -#line 194 "../gnumach/mig/lexxer.l" +#line 194 "lexxer.l" RETURN(syBar); YY_BREAK case 87: YY_RULE_SETUP -#line 196 "../gnumach/mig/lexxer.l" +#line 196 "lexxer.l" { yylval.identifier = strmake(yytext); RETURN(syIdentifier); } YY_BREAK case 88: YY_RULE_SETUP -#line 198 "../gnumach/mig/lexxer.l" +#line 198 "lexxer.l" { yylval.number = atoi(yytext); RETURN(syNumber); } YY_BREAK case 89: YY_RULE_SETUP -#line 200 "../gnumach/mig/lexxer.l" +#line 200 "lexxer.l" { yylval.string = strmake(yytext); BEGIN Normal; RETURN(syString); } YY_BREAK case 90: YY_RULE_SETUP -#line 202 "../gnumach/mig/lexxer.l" +#line 202 "lexxer.l" { yylval.string = strmake(yytext); BEGIN Normal; RETURN(syFileName); } YY_BREAK case 91: YY_RULE_SETUP -#line 204 "../gnumach/mig/lexxer.l" +#line 204 "lexxer.l" { yylval.string = strmake(yytext); BEGIN Normal; RETURN(syQString); } YY_BREAK case 92: YY_RULE_SETUP -#line 207 "../gnumach/mig/lexxer.l" +#line 207 "lexxer.l" { doSharp(yytext+1); SAVE_BEGIN; BEGIN SkipToEOL; } YY_BREAK case 93: YY_RULE_SETUP -#line 210 "../gnumach/mig/lexxer.l" +#line 210 "lexxer.l" { doSharp(yytext+1); SAVE_BEGIN; BEGIN SkipToEOL; } YY_BREAK case 94: YY_RULE_SETUP -#line 213 "../gnumach/mig/lexxer.l" +#line 213 "lexxer.l" { yyerror("illegal # directive"); SAVE_BEGIN; BEGIN SkipToEOL; } YY_BREAK case 95: YY_RULE_SETUP -#line 217 "../gnumach/mig/lexxer.l" +#line 217 "lexxer.l" RSTR_BEGIN; YY_BREAK case 96: YY_RULE_SETUP -#line 218 "../gnumach/mig/lexxer.l" +#line 218 "lexxer.l" ; YY_BREAK case 97: YY_RULE_SETUP -#line 220 "../gnumach/mig/lexxer.l" +#line 220 "lexxer.l" ; YY_BREAK case 98: YY_RULE_SETUP -#line 221 "../gnumach/mig/lexxer.l" +#line 221 "lexxer.l" { lineno++; } YY_BREAK case 99: YY_RULE_SETUP -#line 222 "../gnumach/mig/lexxer.l" +#line 222 "lexxer.l" { BEGIN Normal; RETURN(syError); } YY_BREAK case 100: YY_RULE_SETUP -#line 224 "../gnumach/mig/lexxer.l" +#line 224 "lexxer.l" ECHO; YY_BREAK -#line 1606 "lex.yy.c" +#line 1612 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(Normal): case YY_STATE_EOF(String): @@ -1618,6 +1624,7 @@ case YY_STATE_EOF(SkipToEOL): /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -1763,7 +1770,7 @@ static int yy_get_next_buffer() { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a singled characater, the EOB, so + /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -1790,7 +1797,7 @@ static int yy_get_next_buffer() /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_n_chars = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { @@ -1845,6 +1852,8 @@ static int yy_get_next_buffer() /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) @@ -1970,7 +1979,8 @@ register char *yy_bp; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2008,19 +2018,31 @@ static int input() else { /* need more input */ - yytext_ptr = yy_c_buf_p; + int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + case EOB_ACT_END_OF_FILE: { if ( yywrap() ) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; return EOF; - } if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2032,17 +2054,8 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in yyinput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif } } } @@ -2207,6 +2220,9 @@ YY_BUFFER_STATE b; #endif { + if ( ! b ) + return; + b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -2266,17 +2282,17 @@ yy_size_t size; #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *str ) +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else -YY_BUFFER_STATE yy_scan_string( str ) -yyconst char *str; +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; #endif { int len; - for ( len = 0; str[len]; ++len ) + for ( len = 0; yy_str[len]; ++len ) ; - return yy_scan_bytes( str, len ); + return yy_scan_bytes( yy_str, len ); } #endif @@ -2397,7 +2413,7 @@ char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -2423,6 +2439,22 @@ int n; } #endif +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) @@ -2469,7 +2501,7 @@ int main() return 0; } #endif -#line 224 "../gnumach/mig/lexxer.l" +#line 224 "lexxer.l" extern void |