-/* Generated by re2c 0.9.1-C on Thu Aug 14 20:37:33 2003
+/* Generated by re2c 0.9.1-C on Sat Oct 8 17:52:50 2005
*/
#line 1 "scanner.re"
#include <stdlib.h>
#include "tools/re2c/globals.h"
#include "re2c-parser.h"
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
#define BSIZE 8192
#define YYCTYPE unsigned char
return cursor;
}
-#line 75 "scanner.re"
+#line 77 "scanner.re"
int
s->tok = cursor;
echo:
-#line 85 "scanner.c"
+#line 87 "scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept;
yych = *(YYMARKER = ++YYCURSOR);
if(yych == '*') goto yy7;
yy3:
-#line 96 "scanner.re"
+#line 98 "scanner.re"
{ goto echo; }
-#line 102 "scanner.c"
+#line 104 "scanner.c"
yy4: yych = *++YYCURSOR;
-#line 92 "scanner.re"
+#line 94 "scanner.re"
{ if(cursor == s->eof) RETURN(0);
fwrite(s->tok, 1, cursor - s->tok, out);
s->tok = s->pos = cursor; s->cline++; oline++;
goto echo; }
-#line 110 "scanner.c"
+#line 112 "scanner.c"
yy6: yych = *++YYCURSOR;
goto yy3;
yy7: yych = *++YYCURSOR;
if(yych != 'c') goto yy8;
yych = *++YYCURSOR;
-#line 89 "scanner.re"
+#line 91 "scanner.re"
{ fwrite(s->tok, 1, &cursor[-7] - s->tok, out);
s->tok = cursor;
RETURN(1); }
-#line 133 "scanner.c"
+#line 135 "scanner.c"
}
-#line 97 "scanner.re"
+#line 99 "scanner.re"
}
s->tline = s->cline;
s->tok = cursor;
-#line 151 "scanner.c"
+#line 153 "scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept;
}
}
}
-yy17: yych = *++YYCURSOR;
-
-#line 112 "scanner.re"
+yy17: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/') goto yy18;
+ if(yych <= '9') goto yy56;
+yy18:
+#line 114 "scanner.re"
{ depth = 1;
goto code;
}
-#line 211 "scanner.c"
+#line 216 "scanner.c"
yy19: yych = *++YYCURSOR;
if(yych == '*') goto yy54;
yy20:
-#line 131 "scanner.re"
+#line 133 "scanner.re"
{ RETURN(*s->tok); }
-#line 217 "scanner.c"
+#line 222 "scanner.c"
yy21: yych = *++YYCURSOR;
if(yych == '/') goto yy52;
yy22:
-#line 133 "scanner.re"
+#line 135 "scanner.re"
{ yylval.op = *s->tok;
RETURN(CLOSE); }
-#line 224 "scanner.c"
-yy23: yyaccept = 0;
+#line 229 "scanner.c"
+yy23: yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if(yych != '\n') goto yy48;
yy24:
-#line 124 "scanner.re"
+#line 126 "scanner.re"
{ Scanner_fatal(s, "bad string"); }
-#line 231 "scanner.c"
-yy25: yyaccept = 1;
+#line 236 "scanner.c"
+yy25: yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
if(yych != '\n') goto yy42;
yy26:
-#line 129 "scanner.re"
+#line 131 "scanner.re"
{ Scanner_fatal(s, "bad character constant"); }
-#line 238 "scanner.c"
+#line 243 "scanner.c"
yy27: yych = *++YYCURSOR;
goto yy20;
yy28: yych = *++YYCURSOR;
yy29: yych = *++YYCURSOR;
goto yy40;
yy30:
-#line 136 "scanner.re"
+#line 150 "scanner.re"
{ SubStr substr;
s->cur = cursor;
substr = Scanner_token(s);
yylval.symbol = Symbol_find(&substr);
return ID; }
-#line 252 "scanner.c"
+#line 257 "scanner.c"
yy31: yych = *++YYCURSOR;
goto yy38;
yy32:
-#line 142 "scanner.re"
+#line 156 "scanner.re"
{ goto scan; }
-#line 258 "scanner.c"
+#line 263 "scanner.c"
yy33: yych = *++YYCURSOR;
-#line 144 "scanner.re"
+#line 158 "scanner.re"
{ if(cursor == s->eof) RETURN(0);
s->pos = cursor; s->cline++;
goto scan;
}
-#line 266 "scanner.c"
+#line 271 "scanner.c"
yy35: yych = *++YYCURSOR;
-#line 149 "scanner.re"
+#line 163 "scanner.re"
{ fprintf(stderr, "unexpected character: '%c'\n", *s->tok);
goto scan;
}
-#line 273 "scanner.c"
+#line 278 "scanner.c"
yy37: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
}
yy43: YYCURSOR = YYMARKER;
switch(yyaccept){
- case 0: goto yy24;
- case 1: goto yy26;
+ case 0: goto yy18;
+ case 1: goto yy24;
+ case 2: goto yy26;
}
yy44: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
goto yy41;
yy45: yych = *++YYCURSOR;
-#line 126 "scanner.re"
+#line 128 "scanner.re"
{ s->cur = cursor;
yylval.regexp = ranToRE(Scanner_token(s));
return RANGE; }
-#line 319 "scanner.c"
+#line 325 "scanner.c"
yy47: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
goto yy47;
yy50: yych = *++YYCURSOR;
-#line 121 "scanner.re"
+#line 123 "scanner.re"
{ s->cur = cursor;
yylval.regexp = strToRE(Scanner_token(s));
return STRING; }
-#line 341 "scanner.c"
+#line 347 "scanner.c"
yy52: yych = *++YYCURSOR;
-#line 118 "scanner.re"
+#line 120 "scanner.re"
{ s->tok = cursor;
RETURN(0); }
-#line 347 "scanner.c"
+#line 353 "scanner.c"
yy54: yych = *++YYCURSOR;
-#line 115 "scanner.re"
+#line 117 "scanner.re"
{ depth = 1;
goto comment; }
-#line 353 "scanner.c"
+#line 359 "scanner.c"
+yy56: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '/'){
+ if(yych == ',') goto yy60;
+ goto yy43;
+ } else {
+ if(yych <= '9') goto yy56;
+ if(yych != '}') goto yy43;
+ }
+ yych = *++YYCURSOR;
+
+#line 138 "scanner.re"
+{ yylval.extop.minsize = atoi((char *)s->tok+1);
+ yylval.extop.maxsize = atoi((char *)s->tok+1);
+ RETURN(CLOSESIZE); }
+#line 376 "scanner.c"
+yy60: yych = *++YYCURSOR;
+ if(yych != '}') goto yy64;
+ yych = *++YYCURSOR;
+
+#line 146 "scanner.re"
+{ yylval.extop.minsize = atoi((char *)s->tok+1);
+ yylval.extop.maxsize = -1;
+ RETURN(CLOSESIZE); }
+#line 385 "scanner.c"
+yy63: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy64: if(yych <= '/') goto yy43;
+ if(yych <= '9') goto yy63;
+ if(yych != '}') goto yy43;
+ yych = *++YYCURSOR;
+
+#line 142 "scanner.re"
+{ yylval.extop.minsize = atoi((char *)s->tok+1);
+ yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)s->tok, ',')+1));
+ RETURN(CLOSESIZE); }
+#line 398 "scanner.c"
}
-#line 152 "scanner.re"
+#line 166 "scanner.re"
code:
-#line 360 "scanner.c"
+#line 405 "scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept;
- goto yy56;
+ goto yy67;
++YYCURSOR;
-yy56:
+yy67:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych <= '&'){
if(yych <= '\n'){
- if(yych <= '\t') goto yy64;
- goto yy62;
+ if(yych <= '\t') goto yy75;
+ goto yy73;
} else {
- if(yych == '"') goto yy66;
- goto yy64;
+ if(yych == '"') goto yy77;
+ goto yy75;
}
} else {
if(yych <= '{'){
- if(yych <= '\'') goto yy67;
- if(yych <= 'z') goto yy64;
- goto yy60;
+ if(yych <= '\'') goto yy78;
+ if(yych <= 'z') goto yy75;
+ goto yy71;
} else {
- if(yych != '}') goto yy64;
+ if(yych != '}') goto yy75;
}
}
yych = *++YYCURSOR;
-#line 156 "scanner.re"
+#line 170 "scanner.re"
{ if(--depth == 0){
s->cur = cursor;
yylval.token = Token_new(Scanner_token(s), s->tline);
return CODE;
}
goto code; }
-#line 395 "scanner.c"
-yy60: yych = *++YYCURSOR;
+#line 440 "scanner.c"
+yy71: yych = *++YYCURSOR;
-#line 162 "scanner.re"
+#line 176 "scanner.re"
{ ++depth;
goto code; }
-#line 401 "scanner.c"
-yy62: yych = *++YYCURSOR;
+#line 446 "scanner.c"
+yy73: yych = *++YYCURSOR;
-#line 164 "scanner.re"
+#line 178 "scanner.re"
{ if(cursor == s->eof) Scanner_fatal(s, "missing '}'");
s->pos = cursor; s->cline++;
goto code;
}
-#line 409 "scanner.c"
-yy64: yych = *++YYCURSOR;
-yy65:
-#line 168 "scanner.re"
+#line 454 "scanner.c"
+yy75: yych = *++YYCURSOR;
+yy76:
+#line 182 "scanner.re"
{ goto code; }
-#line 414 "scanner.c"
-yy66: yyaccept = 0;
+#line 459 "scanner.c"
+yy77: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '\n') goto yy65;
- goto yy73;
-yy67: yyaccept = 0;
+ if(yych == '\n') goto yy76;
+ goto yy84;
+yy78: yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '\n') goto yy65;
- goto yy69;
-yy68: ++YYCURSOR;
+ if(yych == '\n') goto yy76;
+ goto yy80;
+yy79: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy69: if(yych <= '&'){
- if(yych != '\n') goto yy68;
+yy80: if(yych <= '&'){
+ if(yych != '\n') goto yy79;
} else {
- if(yych <= '\'') goto yy64;
- if(yych == '\\') goto yy71;
- goto yy68;
+ if(yych <= '\'') goto yy75;
+ if(yych == '\\') goto yy82;
+ goto yy79;
}
-yy70: YYCURSOR = YYMARKER;
+yy81: YYCURSOR = YYMARKER;
switch(yyaccept){
- case 0: goto yy65;
+ case 0: goto yy76;
}
-yy71: ++YYCURSOR;
+yy82: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if(yych == '\n') goto yy70;
- goto yy68;
-yy72: ++YYCURSOR;
+ if(yych == '\n') goto yy81;
+ goto yy79;
+yy83: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy73: if(yych <= '!'){
- if(yych == '\n') goto yy70;
- goto yy72;
+yy84: if(yych <= '!'){
+ if(yych == '\n') goto yy81;
+ goto yy83;
} else {
- if(yych <= '"') goto yy64;
- if(yych != '\\') goto yy72;
+ if(yych <= '"') goto yy75;
+ if(yych != '\\') goto yy83;
}
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if(yych == '\n') goto yy70;
- goto yy72;
+ if(yych == '\n') goto yy81;
+ goto yy83;
}
-#line 169 "scanner.re"
+#line 183 "scanner.re"
comment:
-#line 463 "scanner.c"
+#line 508 "scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept;
- goto yy75;
+ goto yy86;
++YYCURSOR;
-yy75:
+yy86:
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if(yych <= ')'){
- if(yych == '\n') goto yy80;
- goto yy82;
+ if(yych == '\n') goto yy91;
+ goto yy93;
} else {
- if(yych <= '*') goto yy77;
- if(yych == '/') goto yy79;
- goto yy82;
+ if(yych <= '*') goto yy88;
+ if(yych == '/') goto yy90;
+ goto yy93;
}
-yy77: yych = *++YYCURSOR;
- if(yych == '/') goto yy85;
-yy78:
-#line 183 "scanner.re"
+yy88: yych = *++YYCURSOR;
+ if(yych == '/') goto yy96;
+yy89:
+#line 197 "scanner.re"
{ goto comment; }
-#line 485 "scanner.c"
-yy79: yych = *++YYCURSOR;
- if(yych == '*') goto yy83;
- goto yy78;
-yy80: yych = *++YYCURSOR;
+#line 530 "scanner.c"
+yy90: yych = *++YYCURSOR;
+ if(yych == '*') goto yy94;
+ goto yy89;
+yy91: yych = *++YYCURSOR;
-#line 179 "scanner.re"
+#line 193 "scanner.re"
{ if(cursor == s->eof) RETURN(0);
s->tok = s->pos = cursor; s->cline++;
goto comment;
}
-#line 496 "scanner.c"
-yy82: yych = *++YYCURSOR;
- goto yy78;
-yy83: yych = *++YYCURSOR;
+#line 541 "scanner.c"
+yy93: yych = *++YYCURSOR;
+ goto yy89;
+yy94: yych = *++YYCURSOR;
-#line 177 "scanner.re"
+#line 191 "scanner.re"
{ ++depth;
goto comment; }
-#line 504 "scanner.c"
-yy85: yych = *++YYCURSOR;
+#line 549 "scanner.c"
+yy96: yych = *++YYCURSOR;
-#line 173 "scanner.re"
+#line 187 "scanner.re"
{ if(--depth == 0)
goto scan;
else
goto comment; }
-#line 512 "scanner.c"
+#line 557 "scanner.c"
}
-#line 184 "scanner.re"
+#line 198 "scanner.re"
}