gzdoom/tools/re2c/scanner.cc

1635 lines
27 KiB
C++
Raw Normal View History

/* Generated by re2c 0.10.3 on Wed May 24 19:55:36 2006 */
#line 1 "scanner.re"
/* $Id: scanner.re,v 1.42 2006/04/17 00:18:45 helly Exp $ */
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include "scanner.h"
#include "parser.h"
#include "y.tab.h"
#include "globals.h"
#include "dfa.h"
extern YYSTYPE yylval;
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#define BSIZE 8192
#define YYCTYPE char
#define YYCURSOR cursor
#define YYLIMIT lim
#define YYMARKER ptr
#define YYFILL(n) {cursor = fill(cursor);}
#define RETURN(i) {cur = cursor; return i;}
namespace re2c
{
Scanner::Scanner(const char *fn, std::istream& i, std::ostream& o)
: in(i)
, out(o)
, bot(NULL), tok(NULL), ptr(NULL), cur(NULL), pos(NULL), lim(NULL)
, top(NULL), eof(NULL), tchar(0), tline(0), cline(1), iscfg(0)
, filename(fn)
{
;
}
char *Scanner::fill(char *cursor)
{
if(!eof)
{
uint cnt = tok - bot;
if(cnt)
{
memcpy(bot, tok, lim - tok);
tok = bot;
ptr -= cnt;
cursor -= cnt;
pos -= cnt;
lim -= cnt;
}
if((top - lim) < BSIZE)
{
char *buf = new char[(lim - bot) + BSIZE];
memcpy(buf, tok, lim - tok);
tok = buf;
ptr = &buf[ptr - bot];
cursor = &buf[cursor - bot];
pos = &buf[pos - bot];
lim = &buf[lim - bot];
top = &lim[BSIZE];
delete [] bot;
bot = buf;
}
in.read(lim, BSIZE);
if ((cnt = in.gcount()) != BSIZE )
{
eof = &lim[cnt]; *eof++ = '\0';
}
lim += cnt;
}
return cursor;
}
#line 96 "scanner.re"
int Scanner::echo()
{
char *cursor = cur;
bool ignore_eoc = false;
int ignore_cnt = 0;
if (eof && cursor == eof) // Catch EOF
{
return 0;
}
tok = cursor;
echo:
#line 98 "<stdout>"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if((YYLIMIT - YYCURSOR) < 16) YYFILL(16);
yych = *YYCURSOR;
switch(yych){
case 0x00: goto yy7;
case 0x0A: goto yy5;
case '*': goto yy4;
case '/': goto yy2;
default: goto yy9;
}
yy2:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case '*': goto yy16;
default: goto yy3;
}
yy3:
#line 185 "scanner.re"
{
goto echo;
}
#line 124 "<stdout>"
yy4:
yych = *++YYCURSOR;
switch(yych){
case '/': goto yy10;
default: goto yy3;
}
yy5:
++YYCURSOR;
#line 168 "scanner.re"
{
if (ignore_eoc) {
ignore_cnt++;
} else {
out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
}
tok = pos = cursor; cline++;
goto echo;
}
#line 143 "<stdout>"
yy7:
++YYCURSOR;
#line 177 "scanner.re"
{
if (!ignore_eoc) {
out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok) - 1); // -1 so we don't write out the \0
}
if(cursor == eof) {
RETURN(0);
}
}
#line 155 "<stdout>"
yy9:
yych = *++YYCURSOR;
goto yy3;
yy10:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy14;
case 0x0D: goto yy12;
default: goto yy11;
}
yy11:
#line 155 "scanner.re"
{
if (ignore_eoc) {
if (ignore_cnt) {
out << "\n" << sourceFileInfo;
}
ignore_eoc = false;
ignore_cnt = 0;
} else {
out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
}
tok = pos = cursor;
goto echo;
}
#line 182 "<stdout>"
yy12:
yych = *++YYCURSOR;
switch(yych){
case 0x0A: goto yy14;
default: goto yy13;
}
yy13:
YYCURSOR = YYMARKER;
switch(yyaccept) {
case 0: goto yy3;
case 1: goto yy11;
}
yy14:
++YYCURSOR;
#line 141 "scanner.re"
{
cline++;
if (ignore_eoc) {
if (ignore_cnt) {
out << sourceFileInfo;
}
ignore_eoc = false;
ignore_cnt = 0;
} else {
out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
}
tok = pos = cursor;
goto echo;
}
#line 212 "<stdout>"
yy16:
yych = *++YYCURSOR;
switch(yych){
case '!': goto yy17;
default: goto yy13;
}
yy17:
yych = *++YYCURSOR;
switch(yych){
case 'g': goto yy19;
case 'i': goto yy18;
case 'm': goto yy20;
case 'r': goto yy21;
default: goto yy13;
}
yy18:
yych = *++YYCURSOR;
switch(yych){
case 'g': goto yy47;
default: goto yy13;
}
yy19:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy34;
default: goto yy13;
}
yy20:
yych = *++YYCURSOR;
switch(yych){
case 'a': goto yy26;
default: goto yy13;
}
yy21:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy22;
default: goto yy13;
}
yy22:
yych = *++YYCURSOR;
switch(yych){
case '2': goto yy23;
default: goto yy13;
}
yy23:
yych = *++YYCURSOR;
switch(yych){
case 'c': goto yy24;
default: goto yy13;
}
yy24:
++YYCURSOR;
#line 112 "scanner.re"
{
if (bUsedYYMaxFill && bSinglePass) {
fatal("found scanner block after YYMAXFILL declaration");
}
out.write((const char*)(tok), (const char*)(&cursor[-7]) - (const char*)(tok));
tok = cursor;
RETURN(1);
}
#line 275 "<stdout>"
yy26:
yych = *++YYCURSOR;
switch(yych){
case 'x': goto yy27;
default: goto yy13;
}
yy27:
yych = *++YYCURSOR;
switch(yych){
case ':': goto yy28;
default: goto yy13;
}
yy28:
yych = *++YYCURSOR;
switch(yych){
case 'r': goto yy29;
default: goto yy13;
}
yy29:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy30;
default: goto yy13;
}
yy30:
yych = *++YYCURSOR;
switch(yych){
case '2': goto yy31;
default: goto yy13;
}
yy31:
yych = *++YYCURSOR;
switch(yych){
case 'c': goto yy32;
default: goto yy13;
}
yy32:
++YYCURSOR;
#line 120 "scanner.re"
{
if (bUsedYYMaxFill) {
fatal("cannot generate YYMAXFILL twice");
}
out << "#define YYMAXFILL " << maxFill << std::endl;
tok = pos = cursor;
ignore_eoc = true;
bUsedYYMaxFill = true;
goto echo;
}
#line 325 "<stdout>"
yy34:
yych = *++YYCURSOR;
switch(yych){
case 't': goto yy35;
default: goto yy13;
}
yy35:
yych = *++YYCURSOR;
switch(yych){
case 's': goto yy36;
default: goto yy13;
}
yy36:
yych = *++YYCURSOR;
switch(yych){
case 't': goto yy37;
default: goto yy13;
}
yy37:
yych = *++YYCURSOR;
switch(yych){
case 'a': goto yy38;
default: goto yy13;
}
yy38:
yych = *++YYCURSOR;
switch(yych){
case 't': goto yy39;
default: goto yy13;
}
yy39:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy40;
default: goto yy13;
}
yy40:
yych = *++YYCURSOR;
switch(yych){
case ':': goto yy41;
default: goto yy13;
}
yy41:
yych = *++YYCURSOR;
switch(yych){
case 'r': goto yy42;
default: goto yy13;
}
yy42:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy43;
default: goto yy13;
}
yy43:
yych = *++YYCURSOR;
switch(yych){
case '2': goto yy44;
default: goto yy13;
}
yy44:
yych = *++YYCURSOR;
switch(yych){
case 'c': goto yy45;
default: goto yy13;
}
yy45:
++YYCURSOR;
#line 130 "scanner.re"
{
tok = pos = cursor;
genGetState(out, topIndent, 0);
ignore_eoc = true;
goto echo;
}
#line 401 "<stdout>"
yy47:
yych = *++YYCURSOR;
switch(yych){
case 'n': goto yy48;
default: goto yy13;
}
yy48:
yych = *++YYCURSOR;
switch(yych){
case 'o': goto yy49;
default: goto yy13;
}
yy49:
yych = *++YYCURSOR;
switch(yych){
case 'r': goto yy50;
default: goto yy13;
}
yy50:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy51;
default: goto yy13;
}
yy51:
yych = *++YYCURSOR;
switch(yych){
case ':': goto yy52;
default: goto yy13;
}
yy52:
yych = *++YYCURSOR;
switch(yych){
case 'r': goto yy53;
default: goto yy13;
}
yy53:
yych = *++YYCURSOR;
switch(yych){
case 'e': goto yy54;
default: goto yy13;
}
yy54:
yych = *++YYCURSOR;
switch(yych){
case '2': goto yy55;
default: goto yy13;
}
yy55:
yych = *++YYCURSOR;
switch(yych){
case 'c': goto yy56;
default: goto yy13;
}
yy56:
++YYCURSOR;
#line 136 "scanner.re"
{
tok = pos = cursor;
ignore_eoc = true;
goto echo;
}
#line 464 "<stdout>"
}
#line 188 "scanner.re"
}
int Scanner::scan()
{
char *cursor = cur;
uint depth;
scan:
tchar = cursor - pos;
tline = cline;
tok = cursor;
if (iscfg == 1)
{
goto config;
}
else if (iscfg == 2)
{
goto value;
}
#line 489 "<stdout>"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case ' ': goto yy79;
case 0x0A: goto yy81;
case 0x0D: goto yy83;
case '"': goto yy66;
case '\'': goto yy68;
case '(':
case ')':
case ';':
case '=':
case '\\':
case '|': goto yy72;
case '*': goto yy64;
case '+':
case '?': goto yy73;
case '.': goto yy77;
case '/': goto yy62;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy76;
case '[': goto yy70;
case 'r': goto yy74;
case '{': goto yy60;
default: goto yy85;
}
yy60:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case ',': goto yy126;
case '0': goto yy123;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy124;
default: goto yy61;
}
yy61:
#line 210 "scanner.re"
{ depth = 1;
goto code;
}
#line 591 "<stdout>"
yy62:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case '*': goto yy121;
default: goto yy63;
}
yy63:
#line 240 "scanner.re"
{ RETURN(*tok); }
#line 601 "<stdout>"
yy64:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case '/': goto yy119;
default: goto yy65;
}
yy65:
#line 242 "scanner.re"
{ yylval.op = *tok;
RETURN(CLOSE); }
#line 612 "<stdout>"
yy66:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy67;
default: goto yy115;
}
yy67:
#line 227 "scanner.re"
{ fatal("unterminated string constant (missing \")"); }
#line 623 "<stdout>"
yy68:
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy69;
default: goto yy110;
}
yy69:
#line 228 "scanner.re"
{ fatal("unterminated string constant (missing ')"); }
#line 634 "<stdout>"
yy70:
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy71;
case '^': goto yy101;
default: goto yy100;
}
yy71:
#line 238 "scanner.re"
{ fatal("unterminated range (missing ])"); }
#line 646 "<stdout>"
yy72:
yych = *++YYCURSOR;
goto yy63;
yy73:
yych = *++YYCURSOR;
goto yy65;
yy74:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case 'e': goto yy91;
default: goto yy90;
}
yy75:
#line 269 "scanner.re"
{ cur = cursor;
yylval.symbol = Symbol::find(token());
return ID; }
#line 664 "<stdout>"
yy76:
yych = *++YYCURSOR;
goto yy90;
yy77:
++YYCURSOR;
#line 273 "scanner.re"
{ cur = cursor;
yylval.regexp = mkDot();
return RANGE;
}
#line 675 "<stdout>"
yy79:
++YYCURSOR;
yych = *YYCURSOR;
goto yy88;
yy80:
#line 278 "scanner.re"
{ goto scan; }
#line 683 "<stdout>"
yy81:
++YYCURSOR;
yy82:
#line 280 "scanner.re"
{ if(cursor == eof) RETURN(0);
pos = cursor; cline++;
goto scan;
}
#line 692 "<stdout>"
yy83:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case 0x0A: goto yy86;
default: goto yy84;
}
yy84:
#line 285 "scanner.re"
{ std::ostringstream msg;
msg << "unexpected character: ";
prtChOrHex(msg, *tok);
fatal(msg.str().c_str());
goto scan;
}
#line 707 "<stdout>"
yy85:
yych = *++YYCURSOR;
goto yy84;
yy86:
yych = *++YYCURSOR;
goto yy82;
yy87:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy88:
switch(yych){
case 0x09:
case ' ': goto yy87;
default: goto yy80;
}
yy89:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy90:
switch(yych){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy89;
default: goto yy75;
}
yy91:
yych = *++YYCURSOR;
switch(yych){
case '2': goto yy92;
default: goto yy90;
}
yy92:
yych = *++YYCURSOR;
switch(yych){
case 'c': goto yy93;
default: goto yy90;
}
yy93:
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case ':': goto yy94;
default: goto yy90;
}
yy94:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy96;
default: goto yy95;
}
yy95:
YYCURSOR = YYMARKER;
switch(yyaccept) {
case 0: goto yy61;
case 1: goto yy67;
case 2: goto yy69;
case 3: goto yy71;
case 4: goto yy75;
case 5: goto yy98;
case 6: goto yy127;
}
yy96:
yyaccept = 5;
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy96;
case ':': goto yy94;
default: goto yy98;
}
yy98:
#line 262 "scanner.re"
{ cur = cursor;
tok+= 5; /* skip "re2c:" */
iscfg = 1;
yylval.str = new Str(token());
return CONFIG;
}
#line 963 "<stdout>"
yy99:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy100:
switch(yych){
case 0x0A: goto yy95;
case '\\': goto yy103;
case ']': goto yy104;
default: goto yy99;
}
yy101:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy95;
case '\\': goto yy106;
case ']': goto yy107;
default: goto yy101;
}
yy103:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy95;
default: goto yy99;
}
yy104:
++YYCURSOR;
#line 234 "scanner.re"
{ cur = cursor;
yylval.regexp = ranToRE(token());
return RANGE; }
#line 999 "<stdout>"
yy106:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy95;
default: goto yy101;
}
yy107:
++YYCURSOR;
#line 230 "scanner.re"
{ cur = cursor;
yylval.regexp = invToRE(token());
return RANGE; }
#line 1014 "<stdout>"
yy109:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy110:
switch(yych){
case 0x0A: goto yy95;
case '\'': goto yy112;
case '\\': goto yy111;
default: goto yy109;
}
yy111:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy95;
default: goto yy109;
}
yy112:
++YYCURSOR;
#line 223 "scanner.re"
{ cur = cursor;
yylval.regexp = strToCaseInsensitiveRE(token());
return STRING; }
#line 1040 "<stdout>"
yy114:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy115:
switch(yych){
case 0x0A: goto yy95;
case '"': goto yy117;
case '\\': goto yy116;
default: goto yy114;
}
yy116:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy95;
default: goto yy114;
}
yy117:
++YYCURSOR;
#line 219 "scanner.re"
{ cur = cursor;
yylval.regexp = strToRE(token());
return STRING; }
#line 1066 "<stdout>"
yy119:
++YYCURSOR;
#line 216 "scanner.re"
{ tok = cursor;
RETURN(0); }
#line 1072 "<stdout>"
yy121:
++YYCURSOR;
#line 213 "scanner.re"
{ depth = 1;
goto comment; }
#line 1078 "<stdout>"
yy123:
yych = *++YYCURSOR;
switch(yych){
case ',': goto yy137;
default: goto yy125;
}
yy124:
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
yy125:
switch(yych){
case ',': goto yy130;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy124;
case '}': goto yy128;
default: goto yy95;
}
yy126:
++YYCURSOR;
yy127:
#line 260 "scanner.re"
{ fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); }
#line 1110 "<stdout>"
yy128:
++YYCURSOR;
#line 248 "scanner.re"
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = atoi((char *)tok+1);
RETURN(CLOSESIZE); }
#line 1117 "<stdout>"
yy130:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy133;
case '}': goto yy131;
default: goto yy127;
}
yy131:
++YYCURSOR;
#line 256 "scanner.re"
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = -1;
RETURN(CLOSESIZE); }
#line 1141 "<stdout>"
yy133:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy133;
case '}': goto yy135;
default: goto yy95;
}
yy135:
++YYCURSOR;
#line 252 "scanner.re"
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
RETURN(CLOSESIZE); }
#line 1166 "<stdout>"
yy137:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy133;
case '}': goto yy138;
default: goto yy127;
}
yy138:
++YYCURSOR;
#line 245 "scanner.re"
{ yylval.op = '*';
RETURN(CLOSE); }
#line 1189 "<stdout>"
}
#line 291 "scanner.re"
code:
#line 1196 "<stdout>"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy146;
case '"': goto yy150;
case '\'': goto yy151;
case '{': goto yy144;
case '}': goto yy142;
default: goto yy148;
}
yy142:
++YYCURSOR;
#line 295 "scanner.re"
{ if(--depth == 0){
cur = cursor;
yylval.token = new Token(token(), tline);
return CODE;
}
goto code; }
#line 1218 "<stdout>"
yy144:
++YYCURSOR;
#line 301 "scanner.re"
{ ++depth;
goto code; }
#line 1224 "<stdout>"
yy146:
++YYCURSOR;
#line 303 "scanner.re"
{ if(cursor == eof) fatal("missing '}'");
pos = cursor; cline++;
goto code;
}
#line 1232 "<stdout>"
yy148:
++YYCURSOR;
yy149:
#line 307 "scanner.re"
{ goto code; }
#line 1238 "<stdout>"
yy150:
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy149;
default: goto yy157;
}
yy151:
yych = *(YYMARKER = ++YYCURSOR);
switch(yych){
case 0x0A: goto yy149;
default: goto yy153;
}
yy152:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy153:
switch(yych){
case 0x0A: goto yy154;
case '\'': goto yy148;
case '\\': goto yy155;
default: goto yy152;
}
yy154:
YYCURSOR = YYMARKER;
goto yy149;
yy155:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy154;
default: goto yy152;
}
yy156:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy157:
switch(yych){
case 0x0A: goto yy154;
case '"': goto yy148;
case '\\': goto yy158;
default: goto yy156;
}
yy158:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy154;
default: goto yy156;
}
}
#line 308 "scanner.re"
comment:
#line 1298 "<stdout>"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy164;
case '*': goto yy161;
case '/': goto yy163;
default: goto yy166;
}
yy161:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case '/': goto yy169;
default: goto yy162;
}
yy162:
#line 323 "scanner.re"
{ if(cursor == eof) RETURN(0);
goto comment; }
#line 1319 "<stdout>"
yy163:
yych = *++YYCURSOR;
switch(yych){
case '*': goto yy167;
default: goto yy162;
}
yy164:
++YYCURSOR;
#line 319 "scanner.re"
{ if(cursor == eof) RETURN(0);
tok = pos = cursor; cline++;
goto comment;
}
#line 1333 "<stdout>"
yy166:
yych = *++YYCURSOR;
goto yy162;
yy167:
++YYCURSOR;
#line 316 "scanner.re"
{ ++depth;
fatal("ambiguous /* found");
goto comment; }
#line 1343 "<stdout>"
yy169:
++YYCURSOR;
#line 312 "scanner.re"
{ if(--depth == 0)
goto scan;
else
goto comment; }
#line 1351 "<stdout>"
}
#line 325 "scanner.re"
config:
#line 1358 "<stdout>"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case ' ': goto yy173;
case '=': goto yy175;
default: goto yy177;
}
yy173:
++YYCURSOR;
yych = *YYCURSOR;
goto yy182;
yy174:
#line 329 "scanner.re"
{ goto config; }
#line 1376 "<stdout>"
yy175:
++YYCURSOR;
yych = *YYCURSOR;
goto yy180;
yy176:
#line 330 "scanner.re"
{ iscfg = 2;
cur = cursor;
RETURN('=');
}
#line 1387 "<stdout>"
yy177:
++YYCURSOR;
#line 334 "scanner.re"
{ fatal("missing '='"); }
#line 1392 "<stdout>"
yy179:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy180:
switch(yych){
case 0x09:
case ' ': goto yy179;
default: goto yy176;
}
yy181:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy182:
switch(yych){
case 0x09:
case ' ': goto yy181;
default: goto yy174;
}
}
#line 335 "scanner.re"
value:
#line 1419 "<stdout>"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0A:
case 0x0D:
case ' ':
case ';': goto yy185;
case '"': goto yy193;
case '\'': goto yy195;
case '-': goto yy188;
case '0': goto yy186;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy189;
default: goto yy191;
}
yy185:
#line 344 "scanner.re"
{ cur = cursor;
yylval.str = new Str(token());
iscfg = 0;
return VALUE;
}
#line 1452 "<stdout>"
yy186:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
case 0x09:
case 0x0A:
case 0x0D:
case ' ':
case ';': goto yy187;
default: goto yy191;
}
yy187:
#line 339 "scanner.re"
{ cur = cursor;
yylval.number = atoi(token().to_string().c_str());
iscfg = 0;
return NUMBER;
}
#line 1470 "<stdout>"
yy188:
yych = *++YYCURSOR;
switch(yych){
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy189;
default: goto yy192;
}
yy189:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0A:
case 0x0D:
case ' ':
case ';': goto yy187;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy189;
default: goto yy191;
}
yy191:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy192:
switch(yych){
case 0x09:
case 0x0A:
case 0x0D:
case ' ':
case ';': goto yy185;
default: goto yy191;
}
yy193:
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0D:
case ' ':
case ';': goto yy203;
case 0x0A: goto yy185;
case '"': goto yy191;
case '\\': goto yy205;
default: goto yy193;
}
yy195:
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0D:
case ' ':
case ';': goto yy197;
case 0x0A: goto yy185;
case '\'': goto yy191;
case '\\': goto yy200;
default: goto yy195;
}
yy197:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy199;
case '\'': goto yy201;
case '\\': goto yy202;
default: goto yy197;
}
yy199:
YYCURSOR = YYMARKER;
goto yy185;
yy200:
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0D:
case ' ':
case ';': goto yy197;
case 0x0A: goto yy185;
default: goto yy195;
}
yy201:
yych = *++YYCURSOR;
goto yy185;
yy202:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy199;
default: goto yy197;
}
yy203:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy199;
case '"': goto yy201;
case '\\': goto yy206;
default: goto yy203;
}
yy205:
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x09:
case 0x0D:
case ' ':
case ';': goto yy203;
case 0x0A: goto yy185;
default: goto yy193;
}
yy206:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch(yych){
case 0x0A: goto yy199;
default: goto yy203;
}
}
#line 349 "scanner.re"
}
void Scanner::fatal(uint ofs, const char *msg) const
{
out.flush();
#ifdef _MSC_VER
std::cerr << filename << "(" << tline << "): error : "
<< "column " << (tchar + ofs + 1) << ": "
<< msg << std::endl;
#else
std::cerr << "re2c: error: "
<< "line " << tline << ", column " << (tchar + ofs + 1) << ": "
<< msg << std::endl;
#endif
exit(1);
}
} // end namespace re2c