|
|
@ -1,6 +1,6 @@ |
|
|
|
/* Generated by re2c 0.9.1-C on Fri Aug 9 17:42:28 2002
|
|
|
|
/* Generated by re2c 0.9.1-C on Thu Aug 15 22:11:10 2002
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#line 1 "scanner.re" |
|
|
|
#line 1 "tools/re2c/scanner.re" |
|
|
|
#include <config.h> |
|
|
|
#include <config.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdlib.h> |
|
|
@ -9,8 +9,6 @@ |
|
|
|
#include "tools/re2c/parse.h" |
|
|
|
#include "tools/re2c/parse.h" |
|
|
|
#include "re2c-parser.h" |
|
|
|
#include "re2c-parser.h" |
|
|
|
|
|
|
|
|
|
|
|
extern YYSTYPE yylval; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define BSIZE 8192 |
|
|
|
#define BSIZE 8192 |
|
|
|
|
|
|
|
|
|
|
|
#define YYCTYPE uchar |
|
|
|
#define YYCTYPE uchar |
|
|
@ -67,7 +65,7 @@ fill(Scanner *s, uchar *cursor) |
|
|
|
return cursor; |
|
|
|
return cursor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#line 76 |
|
|
|
#line 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
int |
|
|
@ -90,11 +88,11 @@ yy0: |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
if(yych == '*') goto yy7; |
|
|
|
if(yych == '*') goto yy7; |
|
|
|
yy3: |
|
|
|
yy3: |
|
|
|
#line 92 |
|
|
|
#line 90 |
|
|
|
{ goto echo; } |
|
|
|
{ goto echo; } |
|
|
|
yy4: yych = *++YYCURSOR; |
|
|
|
yy4: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 88 |
|
|
|
#line 86 |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
fwrite(s->tok, 1, cursor - s->tok, out); |
|
|
|
fwrite(s->tok, 1, cursor - s->tok, out); |
|
|
|
s->tok = s->pos = cursor; s->cline++; |
|
|
|
s->tok = s->pos = cursor; s->cline++; |
|
|
@ -117,12 +115,12 @@ yy9: yych = *++YYCURSOR; |
|
|
|
if(yych != 'c') goto yy8; |
|
|
|
if(yych != 'c') goto yy8; |
|
|
|
yych = *++YYCURSOR; |
|
|
|
yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 85 |
|
|
|
#line 83 |
|
|
|
{ fwrite(s->tok, 1, &cursor[-7] - s->tok, out); |
|
|
|
{ fwrite(s->tok, 1, &cursor[-7] - s->tok, out); |
|
|
|
s->tok = cursor; |
|
|
|
s->tok = cursor; |
|
|
|
RETURN(1); } |
|
|
|
RETURN(1); } |
|
|
|
} |
|
|
|
} |
|
|
|
#line 93 |
|
|
|
#line 91 |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -192,32 +190,32 @@ yy15: |
|
|
|
} |
|
|
|
} |
|
|
|
yy17: yych = *++YYCURSOR; |
|
|
|
yy17: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 108 |
|
|
|
#line 106 |
|
|
|
{ depth = 1; |
|
|
|
{ depth = 1; |
|
|
|
goto code; |
|
|
|
goto code; |
|
|
|
} |
|
|
|
} |
|
|
|
yy19: yych = *++YYCURSOR; |
|
|
|
yy19: yych = *++YYCURSOR; |
|
|
|
if(yych == '*') goto yy54; |
|
|
|
if(yych == '*') goto yy54; |
|
|
|
yy20: |
|
|
|
yy20: |
|
|
|
#line 127 |
|
|
|
#line 125 |
|
|
|
{ RETURN(*s->tok); } |
|
|
|
{ RETURN(*s->tok); } |
|
|
|
yy21: yych = *++YYCURSOR; |
|
|
|
yy21: yych = *++YYCURSOR; |
|
|
|
if(yych == '/') goto yy52; |
|
|
|
if(yych == '/') goto yy52; |
|
|
|
yy22: |
|
|
|
yy22: |
|
|
|
#line 129 |
|
|
|
#line 127 |
|
|
|
{ yylval.op = *s->tok; |
|
|
|
{ yylval.op = *s->tok; |
|
|
|
RETURN(CLOSE); } |
|
|
|
RETURN(CLOSE); } |
|
|
|
yy23: yyaccept = 0; |
|
|
|
yy23: yyaccept = 0; |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
if(yych != '\n') goto yy48; |
|
|
|
if(yych != '\n') goto yy48; |
|
|
|
yy24: |
|
|
|
yy24: |
|
|
|
#line 120 |
|
|
|
#line 118 |
|
|
|
{ Scanner_fatal(s, "bad string"); } |
|
|
|
{ Scanner_fatal(s, "bad string"); } |
|
|
|
yy25: yyaccept = 1; |
|
|
|
yy25: yyaccept = 1; |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
if(yych != '\n') goto yy42; |
|
|
|
if(yych != '\n') goto yy42; |
|
|
|
yy26: |
|
|
|
yy26: |
|
|
|
#line 125 |
|
|
|
#line 123 |
|
|
|
{ Scanner_fatal(s, "bad character constant"); } |
|
|
|
{ Scanner_fatal(s, "bad character constant"); } |
|
|
|
yy27: yych = *++YYCURSOR; |
|
|
|
yy27: yych = *++YYCURSOR; |
|
|
|
goto yy20; |
|
|
|
goto yy20; |
|
|
@ -226,7 +224,7 @@ yy28: yych = *++YYCURSOR; |
|
|
|
yy29: yych = *++YYCURSOR; |
|
|
|
yy29: yych = *++YYCURSOR; |
|
|
|
goto yy40; |
|
|
|
goto yy40; |
|
|
|
yy30: |
|
|
|
yy30: |
|
|
|
#line 132 |
|
|
|
#line 130 |
|
|
|
{ SubStr substr; |
|
|
|
{ SubStr substr; |
|
|
|
s->cur = cursor; |
|
|
|
s->cur = cursor; |
|
|
|
substr = Scanner_token(s); |
|
|
|
substr = Scanner_token(s); |
|
|
@ -235,18 +233,18 @@ yy30: |
|
|
|
yy31: yych = *++YYCURSOR; |
|
|
|
yy31: yych = *++YYCURSOR; |
|
|
|
goto yy38; |
|
|
|
goto yy38; |
|
|
|
yy32: |
|
|
|
yy32: |
|
|
|
#line 138 |
|
|
|
#line 136 |
|
|
|
{ goto scan; } |
|
|
|
{ goto scan; } |
|
|
|
yy33: yych = *++YYCURSOR; |
|
|
|
yy33: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 140 |
|
|
|
#line 138 |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
s->pos = cursor; s->cline++; |
|
|
|
s->pos = cursor; s->cline++; |
|
|
|
goto scan; |
|
|
|
goto scan; |
|
|
|
} |
|
|
|
} |
|
|
|
yy35: yych = *++YYCURSOR; |
|
|
|
yy35: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 145 |
|
|
|
#line 143 |
|
|
|
{ fprintf(stderr, "unexpected character: '%c'\n", *s->tok); |
|
|
|
{ fprintf(stderr, "unexpected character: '%c'\n", *s->tok); |
|
|
|
goto scan; |
|
|
|
goto scan; |
|
|
|
} |
|
|
|
} |
|
|
@ -291,7 +289,7 @@ yy44: ++YYCURSOR; |
|
|
|
goto yy41; |
|
|
|
goto yy41; |
|
|
|
yy45: yych = *++YYCURSOR; |
|
|
|
yy45: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 122 |
|
|
|
#line 120 |
|
|
|
{ s->cur = cursor; |
|
|
|
{ s->cur = cursor; |
|
|
|
yylval.regexp = ranToRE(Scanner_token(s)); |
|
|
|
yylval.regexp = ranToRE(Scanner_token(s)); |
|
|
|
return RANGE; } |
|
|
|
return RANGE; } |
|
|
@ -312,22 +310,22 @@ yy48: if(yych <= '!'){ |
|
|
|
goto yy47; |
|
|
|
goto yy47; |
|
|
|
yy50: yych = *++YYCURSOR; |
|
|
|
yy50: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 117 |
|
|
|
#line 115 |
|
|
|
{ s->cur = cursor; |
|
|
|
{ s->cur = cursor; |
|
|
|
yylval.regexp = strToRE(Scanner_token(s)); |
|
|
|
yylval.regexp = strToRE(Scanner_token(s)); |
|
|
|
return STRING; } |
|
|
|
return STRING; } |
|
|
|
yy52: yych = *++YYCURSOR; |
|
|
|
yy52: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 114 |
|
|
|
#line 112 |
|
|
|
{ s->tok = cursor; |
|
|
|
{ s->tok = cursor; |
|
|
|
RETURN(0); } |
|
|
|
RETURN(0); } |
|
|
|
yy54: yych = *++YYCURSOR; |
|
|
|
yy54: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 111 |
|
|
|
#line 109 |
|
|
|
{ depth = 1; |
|
|
|
{ depth = 1; |
|
|
|
goto comment; } |
|
|
|
goto comment; } |
|
|
|
} |
|
|
|
} |
|
|
|
#line 148 |
|
|
|
#line 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code: |
|
|
|
code: |
|
|
@ -358,7 +356,7 @@ yy56: |
|
|
|
} |
|
|
|
} |
|
|
|
yych = *++YYCURSOR; |
|
|
|
yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 152 |
|
|
|
#line 150 |
|
|
|
{ if(--depth == 0){ |
|
|
|
{ if(--depth == 0){ |
|
|
|
s->cur = cursor; |
|
|
|
s->cur = cursor; |
|
|
|
yylval.token = Token_new(Scanner_token(s), s->tline); |
|
|
|
yylval.token = Token_new(Scanner_token(s), s->tline); |
|
|
@ -367,19 +365,19 @@ yy56: |
|
|
|
goto code; } |
|
|
|
goto code; } |
|
|
|
yy60: yych = *++YYCURSOR; |
|
|
|
yy60: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 158 |
|
|
|
#line 156 |
|
|
|
{ ++depth; |
|
|
|
{ ++depth; |
|
|
|
goto code; } |
|
|
|
goto code; } |
|
|
|
yy62: yych = *++YYCURSOR; |
|
|
|
yy62: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 160 |
|
|
|
#line 158 |
|
|
|
{ if(cursor == s->eof) Scanner_fatal(s, "missing '}'"); |
|
|
|
{ if(cursor == s->eof) Scanner_fatal(s, "missing '}'"); |
|
|
|
s->pos = cursor; s->cline++; |
|
|
|
s->pos = cursor; s->cline++; |
|
|
|
goto code; |
|
|
|
goto code; |
|
|
|
} |
|
|
|
} |
|
|
|
yy64: yych = *++YYCURSOR; |
|
|
|
yy64: yych = *++YYCURSOR; |
|
|
|
yy65: |
|
|
|
yy65: |
|
|
|
#line 164 |
|
|
|
#line 162 |
|
|
|
{ goto code; } |
|
|
|
{ goto code; } |
|
|
|
yy66: yyaccept = 0; |
|
|
|
yy66: yyaccept = 0; |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
|
yych = *(YYMARKER = ++YYCURSOR); |
|
|
@ -424,7 +422,7 @@ yy73: if(yych <= '!'){ |
|
|
|
if(yych == '\n') goto yy70; |
|
|
|
if(yych == '\n') goto yy70; |
|
|
|
goto yy72; |
|
|
|
goto yy72; |
|
|
|
} |
|
|
|
} |
|
|
|
#line 165 |
|
|
|
#line 163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comment: |
|
|
|
comment: |
|
|
@ -447,14 +445,14 @@ yy75: |
|
|
|
yy77: yych = *++YYCURSOR; |
|
|
|
yy77: yych = *++YYCURSOR; |
|
|
|
if(yych == '/') goto yy85; |
|
|
|
if(yych == '/') goto yy85; |
|
|
|
yy78: |
|
|
|
yy78: |
|
|
|
#line 179 |
|
|
|
#line 177 |
|
|
|
{ goto comment; } |
|
|
|
{ goto comment; } |
|
|
|
yy79: yych = *++YYCURSOR; |
|
|
|
yy79: yych = *++YYCURSOR; |
|
|
|
if(yych == '*') goto yy83; |
|
|
|
if(yych == '*') goto yy83; |
|
|
|
goto yy78; |
|
|
|
goto yy78; |
|
|
|
yy80: yych = *++YYCURSOR; |
|
|
|
yy80: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 175 |
|
|
|
#line 173 |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
{ if(cursor == s->eof) RETURN(0); |
|
|
|
s->tok = s->pos = cursor; s->cline++; |
|
|
|
s->tok = s->pos = cursor; s->cline++; |
|
|
|
goto comment; |
|
|
|
goto comment; |
|
|
@ -463,23 +461,23 @@ yy82: yych = *++YYCURSOR; |
|
|
|
goto yy78; |
|
|
|
goto yy78; |
|
|
|
yy83: yych = *++YYCURSOR; |
|
|
|
yy83: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 173 |
|
|
|
#line 171 |
|
|
|
{ ++depth; |
|
|
|
{ ++depth; |
|
|
|
goto comment; } |
|
|
|
goto comment; } |
|
|
|
yy85: yych = *++YYCURSOR; |
|
|
|
yy85: yych = *++YYCURSOR; |
|
|
|
|
|
|
|
|
|
|
|
#line 169 |
|
|
|
#line 167 |
|
|
|
{ if(--depth == 0) |
|
|
|
{ if(--depth == 0) |
|
|
|
goto scan; |
|
|
|
goto scan; |
|
|
|
else |
|
|
|
else |
|
|
|
goto comment; } |
|
|
|
goto comment; } |
|
|
|
} |
|
|
|
} |
|
|
|
#line 180 |
|
|
|
#line 178 |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
Scanner_fatal(Scanner *s, char *msg) |
|
|
|
Scanner_fatal(Scanner *s, const char *msg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fprintf(stderr, "line %d, column %d: %s\n", s->tline, s->tchar + 1, msg); |
|
|
|
fprintf(stderr, "line %d, column %d: %s\n", s->tline, s->tchar + 1, msg); |
|
|
|
exit(1); |
|
|
|
exit(1); |
|
|
|