mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-16 01:11:50 +00:00
4c9d633a94
- Decided that allowing arbitrary alpha values for color remaps isn't so hot. Changed it back the way it was. SVN r716 (trunk)
1091 lines
22 KiB
C
1091 lines
22 KiB
C
/* Generated by re2c 0.12.3 */
|
|
#line 1 "scanner.re"
|
|
#include <string.h>
|
|
#include <malloc.h>
|
|
#include <stdlib.h>
|
|
#include "dehsupp.h"
|
|
|
|
#define BSIZE 8192
|
|
|
|
#define YYCTYPE uchar
|
|
#define YYCURSOR cursor
|
|
#define YYLIMIT s->lim
|
|
#define YYMARKER s->ptr
|
|
#define YYFILL(n) {cursor = fill(s, cursor);}
|
|
|
|
#define RET(i) {s->cur = cursor; return i;}
|
|
|
|
uchar *fill(Scanner *s, uchar *cursor)
|
|
{
|
|
if(!s->eof)
|
|
{
|
|
ptrdiff_t cnt = s->tok - s->bot;
|
|
if(cnt)
|
|
{
|
|
memcpy(s->bot, s->tok, s->lim - s->tok);
|
|
s->tok = s->bot;
|
|
s->ptr -= cnt;
|
|
cursor -= cnt;
|
|
s->pos -= cnt;
|
|
s->lim -= cnt;
|
|
}
|
|
if((s->top - s->lim) < BSIZE)
|
|
{
|
|
uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
|
|
memcpy(buf, s->tok, s->lim - s->tok);
|
|
s->tok = buf;
|
|
s->ptr = &buf[s->ptr - s->bot];
|
|
cursor = &buf[cursor - s->bot];
|
|
s->pos = &buf[s->pos - s->bot];
|
|
s->lim = &buf[s->lim - s->bot];
|
|
s->top = &s->lim[BSIZE];
|
|
free(s->bot);
|
|
s->bot = buf;
|
|
}
|
|
if((cnt = fread((char*) s->lim, 1, BSIZE, s->fd)) != BSIZE)
|
|
{
|
|
s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
|
|
}
|
|
s->lim += cnt;
|
|
}
|
|
return cursor;
|
|
}
|
|
|
|
int scan(Scanner *s)
|
|
{
|
|
uchar *cursor = s->cur;
|
|
std:
|
|
s->tok = cursor;
|
|
#line 64 "scanner.re"
|
|
|
|
|
|
|
|
#line 64 "scanner.c"
|
|
{
|
|
YYCTYPE yych;
|
|
unsigned int yyaccept = 0;
|
|
|
|
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
|
|
yych = *YYCURSOR;
|
|
switch(yych) {
|
|
case 0x09:
|
|
case 0x0B:
|
|
case 0x0C:
|
|
case ' ': goto yy22;
|
|
case 0x0A: goto yy48;
|
|
case '"': goto yy20;
|
|
case '&': goto yy28;
|
|
case '(': goto yy36;
|
|
case ')': goto yy38;
|
|
case '*': goto yy34;
|
|
case '+': goto yy32;
|
|
case ',': goto yy40;
|
|
case '-': goto yy30;
|
|
case '/': goto yy2;
|
|
case '0': goto yy17;
|
|
case '1':
|
|
case '2':
|
|
case '3':
|
|
case '4':
|
|
case '5':
|
|
case '6':
|
|
case '7':
|
|
case '8':
|
|
case '9': goto yy19;
|
|
case ';': goto yy46;
|
|
case 'A': goto yy7;
|
|
case 'B':
|
|
case 'E':
|
|
case 'G':
|
|
case 'H':
|
|
case 'J':
|
|
case 'K':
|
|
case 'L':
|
|
case 'M':
|
|
case 'N':
|
|
case 'P':
|
|
case 'Q':
|
|
case 'U':
|
|
case 'V':
|
|
case 'W':
|
|
case 'X':
|
|
case 'Y':
|
|
case 'Z':
|
|
case '_':
|
|
case 'a':
|
|
case 'b':
|
|
case 'c':
|
|
case 'd':
|
|
case 'f':
|
|
case 'g':
|
|
case 'h':
|
|
case 'i':
|
|
case 'j':
|
|
case 'k':
|
|
case 'l':
|
|
case 'm':
|
|
case 'n':
|
|
case 'o':
|
|
case 'q':
|
|
case 'r':
|
|
case 's':
|
|
case 't':
|
|
case 'u':
|
|
case 'v':
|
|
case 'w':
|
|
case 'x':
|
|
case 'y':
|
|
case 'z': goto yy16;
|
|
case 'C': goto yy9;
|
|
case 'D': goto yy13;
|
|
case 'F': goto yy14;
|
|
case 'I': goto yy11;
|
|
case 'O': goto yy8;
|
|
case 'R': goto yy15;
|
|
case 'S': goto yy10;
|
|
case 'T': goto yy12;
|
|
case '^': goto yy26;
|
|
case 'e': goto yy4;
|
|
case 'p': goto yy6;
|
|
case '{': goto yy42;
|
|
case '|': goto yy24;
|
|
case '}': goto yy44;
|
|
default: goto yy50;
|
|
}
|
|
yy2:
|
|
yyaccept = 0;
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
|
if(yych == '*') goto yy200;
|
|
if(yych == '/') goto yy198;
|
|
yy3:
|
|
#line 107 "scanner.re"
|
|
{ RET(DIVIDE); }
|
|
#line 164 "scanner.c"
|
|
yy4:
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) == 'n') goto yy194;
|
|
goto yy72;
|
|
yy5:
|
|
#line 91 "scanner.re"
|
|
{ RET(SYM); }
|
|
#line 172 "scanner.c"
|
|
yy6:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'r') goto yy189;
|
|
goto yy72;
|
|
yy7:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'c') goto yy177;
|
|
goto yy72;
|
|
yy8:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'r') goto yy158;
|
|
goto yy72;
|
|
yy9:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'o') goto yy149;
|
|
goto yy72;
|
|
yy10:
|
|
yych = *++YYCURSOR;
|
|
if(yych <= 'p') {
|
|
if(yych <= 'n') goto yy72;
|
|
if(yych <= 'o') goto yy123;
|
|
goto yy124;
|
|
} else {
|
|
if(yych == 't') goto yy125;
|
|
goto yy72;
|
|
}
|
|
yy11:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'n') goto yy114;
|
|
goto yy72;
|
|
yy12:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'h') goto yy105;
|
|
goto yy72;
|
|
yy13:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'e') goto yy95;
|
|
goto yy72;
|
|
yy14:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'i') goto yy85;
|
|
goto yy72;
|
|
yy15:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'e') goto yy73;
|
|
goto yy72;
|
|
yy16:
|
|
yych = *++YYCURSOR;
|
|
goto yy72;
|
|
yy17:
|
|
yyaccept = 1;
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
|
if(yych == 'X') goto yy68;
|
|
if(yych == 'x') goto yy68;
|
|
goto yy67;
|
|
yy18:
|
|
#line 94 "scanner.re"
|
|
{ RET(NUM); }
|
|
#line 231 "scanner.c"
|
|
yy19:
|
|
yych = *++YYCURSOR;
|
|
goto yy65;
|
|
yy20:
|
|
yyaccept = 2;
|
|
yych = *(YYMARKER = ++YYCURSOR);
|
|
if(yych != 0x0A) goto yy54;
|
|
yy21:
|
|
#line 124 "scanner.re"
|
|
{
|
|
printf("unexpected character: %c\n", *s->tok);
|
|
goto std;
|
|
}
|
|
#line 245 "scanner.c"
|
|
yy22:
|
|
++YYCURSOR;
|
|
yych = *YYCURSOR;
|
|
goto yy52;
|
|
yy23:
|
|
#line 99 "scanner.re"
|
|
{ goto std; }
|
|
#line 253 "scanner.c"
|
|
yy24:
|
|
++YYCURSOR;
|
|
#line 101 "scanner.re"
|
|
{ RET(OR); }
|
|
#line 258 "scanner.c"
|
|
yy26:
|
|
++YYCURSOR;
|
|
#line 102 "scanner.re"
|
|
{ RET(XOR); }
|
|
#line 263 "scanner.c"
|
|
yy28:
|
|
++YYCURSOR;
|
|
#line 103 "scanner.re"
|
|
{ RET(AND); }
|
|
#line 268 "scanner.c"
|
|
yy30:
|
|
++YYCURSOR;
|
|
#line 104 "scanner.re"
|
|
{ RET(MINUS); }
|
|
#line 273 "scanner.c"
|
|
yy32:
|
|
++YYCURSOR;
|
|
#line 105 "scanner.re"
|
|
{ RET(PLUS); }
|
|
#line 278 "scanner.c"
|
|
yy34:
|
|
++YYCURSOR;
|
|
#line 106 "scanner.re"
|
|
{ RET(MULTIPLY); }
|
|
#line 283 "scanner.c"
|
|
yy36:
|
|
++YYCURSOR;
|
|
#line 108 "scanner.re"
|
|
{ RET(LPAREN); }
|
|
#line 288 "scanner.c"
|
|
yy38:
|
|
++YYCURSOR;
|
|
#line 109 "scanner.re"
|
|
{ RET(RPAREN); }
|
|
#line 293 "scanner.c"
|
|
yy40:
|
|
++YYCURSOR;
|
|
#line 110 "scanner.re"
|
|
{ RET(COMMA); }
|
|
#line 298 "scanner.c"
|
|
yy42:
|
|
++YYCURSOR;
|
|
#line 111 "scanner.re"
|
|
{ RET(LBRACE); }
|
|
#line 303 "scanner.c"
|
|
yy44:
|
|
++YYCURSOR;
|
|
#line 112 "scanner.re"
|
|
{ RET(RBRACE); }
|
|
#line 308 "scanner.c"
|
|
yy46:
|
|
++YYCURSOR;
|
|
#line 113 "scanner.re"
|
|
{ RET(SEMICOLON); }
|
|
#line 313 "scanner.c"
|
|
yy48:
|
|
++YYCURSOR;
|
|
#line 117 "scanner.re"
|
|
{
|
|
if(cursor == s->eof) RET(EOI);
|
|
s->pos = cursor; s->line++;
|
|
goto std;
|
|
}
|
|
#line 322 "scanner.c"
|
|
yy50:
|
|
yych = *++YYCURSOR;
|
|
goto yy21;
|
|
yy51:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
yy52:
|
|
if(yych <= 0x0A) {
|
|
if(yych == 0x09) goto yy51;
|
|
goto yy23;
|
|
} else {
|
|
if(yych <= 0x0C) goto yy51;
|
|
if(yych == ' ') goto yy51;
|
|
goto yy23;
|
|
}
|
|
yy53:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
yy54:
|
|
if(yych <= '!') {
|
|
if(yych != 0x0A) goto yy53;
|
|
} else {
|
|
if(yych <= '"') goto yy57;
|
|
if(yych == '\\') goto yy56;
|
|
goto yy53;
|
|
}
|
|
yy55:
|
|
YYCURSOR = YYMARKER;
|
|
if(yyaccept <= 1) {
|
|
if(yyaccept <= 0) {
|
|
goto yy3;
|
|
} else {
|
|
goto yy18;
|
|
}
|
|
} else {
|
|
goto yy21;
|
|
}
|
|
yy56:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych <= 'b') {
|
|
if(yych <= '7') {
|
|
if(yych <= '&') {
|
|
if(yych == '"') goto yy53;
|
|
goto yy55;
|
|
} else {
|
|
if(yych <= '\'') goto yy53;
|
|
if(yych <= '/') goto yy55;
|
|
goto yy60;
|
|
}
|
|
} else {
|
|
if(yych <= '[') {
|
|
if(yych == '?') goto yy53;
|
|
goto yy55;
|
|
} else {
|
|
if(yych <= '\\') goto yy53;
|
|
if(yych <= '`') goto yy55;
|
|
goto yy53;
|
|
}
|
|
}
|
|
} else {
|
|
if(yych <= 'r') {
|
|
if(yych <= 'm') {
|
|
if(yych == 'f') goto yy53;
|
|
goto yy55;
|
|
} else {
|
|
if(yych <= 'n') goto yy53;
|
|
if(yych <= 'q') goto yy55;
|
|
goto yy53;
|
|
}
|
|
} else {
|
|
if(yych <= 'u') {
|
|
if(yych == 't') goto yy53;
|
|
goto yy55;
|
|
} else {
|
|
if(yych <= 'v') goto yy53;
|
|
if(yych == 'x') goto yy59;
|
|
goto yy55;
|
|
}
|
|
}
|
|
}
|
|
yy57:
|
|
++YYCURSOR;
|
|
#line 97 "scanner.re"
|
|
{ RET(STRING); }
|
|
#line 411 "scanner.c"
|
|
yy59:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych <= '@') {
|
|
if(yych <= '/') goto yy55;
|
|
if(yych <= '9') goto yy62;
|
|
goto yy55;
|
|
} else {
|
|
if(yych <= 'F') goto yy62;
|
|
if(yych <= '`') goto yy55;
|
|
if(yych <= 'f') goto yy62;
|
|
goto yy55;
|
|
}
|
|
yy60:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych <= '"') {
|
|
if(yych == 0x0A) goto yy55;
|
|
if(yych <= '!') goto yy53;
|
|
goto yy57;
|
|
} else {
|
|
if(yych <= '7') {
|
|
if(yych <= '/') goto yy53;
|
|
goto yy60;
|
|
} else {
|
|
if(yych == '\\') goto yy56;
|
|
goto yy53;
|
|
}
|
|
}
|
|
yy62:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych <= '9') {
|
|
if(yych <= '!') {
|
|
if(yych == 0x0A) goto yy55;
|
|
goto yy53;
|
|
} else {
|
|
if(yych <= '"') goto yy57;
|
|
if(yych <= '/') goto yy53;
|
|
goto yy62;
|
|
}
|
|
} else {
|
|
if(yych <= '[') {
|
|
if(yych <= '@') goto yy53;
|
|
if(yych <= 'F') goto yy62;
|
|
goto yy53;
|
|
} else {
|
|
if(yych <= '\\') goto yy56;
|
|
if(yych <= '`') goto yy53;
|
|
if(yych <= 'f') goto yy62;
|
|
goto yy53;
|
|
}
|
|
}
|
|
yy64:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
yy65:
|
|
if(yych <= '/') goto yy18;
|
|
if(yych <= '9') goto yy64;
|
|
goto yy18;
|
|
yy66:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
yy67:
|
|
if(yych <= '/') goto yy18;
|
|
if(yych <= '9') goto yy66;
|
|
goto yy18;
|
|
yy68:
|
|
yych = *++YYCURSOR;
|
|
if(yych <= '@') {
|
|
if(yych <= '/') goto yy55;
|
|
if(yych >= ':') goto yy55;
|
|
} else {
|
|
if(yych <= 'F') goto yy69;
|
|
if(yych <= '`') goto yy55;
|
|
if(yych >= 'g') goto yy55;
|
|
}
|
|
yy69:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych <= '@') {
|
|
if(yych <= '/') goto yy18;
|
|
if(yych <= '9') goto yy69;
|
|
goto yy18;
|
|
} else {
|
|
if(yych <= 'F') goto yy69;
|
|
if(yych <= '`') goto yy18;
|
|
if(yych <= 'f') goto yy69;
|
|
goto yy18;
|
|
}
|
|
yy71:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
yy72:
|
|
if(yych <= 'Z') {
|
|
if(yych <= '/') goto yy5;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych <= '@') goto yy5;
|
|
goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych <= '^') goto yy5;
|
|
goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy5;
|
|
if(yych <= 'z') goto yy71;
|
|
goto yy5;
|
|
}
|
|
}
|
|
yy73:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'd') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'r') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'S') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'y') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'l') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy84;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy84;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy84:
|
|
#line 89 "scanner.re"
|
|
{ RET(RenderStyles); }
|
|
#line 565 "scanner.c"
|
|
yy85:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'r') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'S') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy94;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy94;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy94:
|
|
#line 88 "scanner.re"
|
|
{ RET(FirstState); }
|
|
#line 599 "scanner.c"
|
|
yy95:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'h') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'S') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy104;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy104;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy104:
|
|
#line 86 "scanner.re"
|
|
{ RET(DeathState); }
|
|
#line 633 "scanner.c"
|
|
yy105:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'g') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'B') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy113;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy113;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy113:
|
|
#line 85 "scanner.re"
|
|
{ RET(ThingBits); }
|
|
#line 665 "scanner.c"
|
|
yy114:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'f') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'o') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'N') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'm') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy122;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy122;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy122:
|
|
#line 84 "scanner.re"
|
|
{ RET(InfoNames); }
|
|
#line 697 "scanner.c"
|
|
yy123:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'u') goto yy142;
|
|
goto yy72;
|
|
yy124:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'a') goto yy133;
|
|
goto yy72;
|
|
yy125:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'M') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'p') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy132;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy132;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy132:
|
|
#line 82 "scanner.re"
|
|
{ RET(StateMap); }
|
|
#line 735 "scanner.c"
|
|
yy133:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'w') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'S') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy141;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy141;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy141:
|
|
#line 87 "scanner.re"
|
|
{ RET(SpawnState); }
|
|
#line 767 "scanner.c"
|
|
yy142:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'd') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'M') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'p') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy148;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy148;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy148:
|
|
#line 83 "scanner.re"
|
|
{ RET(SoundMap); }
|
|
#line 795 "scanner.c"
|
|
yy149:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'd') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'P') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'C') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'o') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'v') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy157;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy157;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy157:
|
|
#line 80 "scanner.re"
|
|
{ RET(CodePConv); }
|
|
#line 827 "scanner.c"
|
|
yy158:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'g') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'H') goto yy160;
|
|
if(yych == 'S') goto yy161;
|
|
goto yy72;
|
|
yy160:
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'e') goto yy170;
|
|
goto yy72;
|
|
yy161:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'p') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'r') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'N') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'a') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'm') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'e') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy169;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy169;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy169:
|
|
#line 81 "scanner.re"
|
|
{ RET(OrgSprNames); }
|
|
#line 870 "scanner.c"
|
|
yy170:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'g') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'h') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy176;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy176;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy176:
|
|
#line 78 "scanner.re"
|
|
{ RET(OrgHeights); }
|
|
#line 898 "scanner.c"
|
|
yy177:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'o') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych == 'L') goto yy184;
|
|
if(yych != 's') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy183;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy183;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy183:
|
|
#line 77 "scanner.re"
|
|
{ RET(Actions); }
|
|
#line 927 "scanner.c"
|
|
yy184:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 's') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy188;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy188;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy188:
|
|
#line 79 "scanner.re"
|
|
{ RET(ActionList); }
|
|
#line 951 "scanner.c"
|
|
yy189:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'i') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'n') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 't') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy193;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy193;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy193:
|
|
#line 76 "scanner.re"
|
|
{ RET(PRINT); }
|
|
#line 975 "scanner.c"
|
|
yy194:
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'd') goto yy72;
|
|
yych = *++YYCURSOR;
|
|
if(yych != 'l') goto yy72;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) <= 'Z') {
|
|
if(yych <= '/') goto yy197;
|
|
if(yych <= '9') goto yy71;
|
|
if(yych >= 'A') goto yy71;
|
|
} else {
|
|
if(yych <= '_') {
|
|
if(yych >= '_') goto yy71;
|
|
} else {
|
|
if(yych <= '`') goto yy197;
|
|
if(yych <= 'z') goto yy71;
|
|
}
|
|
}
|
|
yy197:
|
|
#line 75 "scanner.re"
|
|
{ RET(ENDL); }
|
|
#line 997 "scanner.c"
|
|
yy198:
|
|
++YYCURSOR;
|
|
if(YYLIMIT == YYCURSOR) YYFILL(1);
|
|
yych = *YYCURSOR;
|
|
if(yych == 0x0A) goto yy202;
|
|
goto yy198;
|
|
yy200:
|
|
++YYCURSOR;
|
|
#line 67 "scanner.re"
|
|
{ goto comment; }
|
|
#line 1008 "scanner.c"
|
|
yy202:
|
|
++YYCURSOR;
|
|
#line 69 "scanner.re"
|
|
{
|
|
if(cursor == s->eof) RET(EOI);
|
|
s->tok = s->pos = cursor; s->line++;
|
|
goto std;
|
|
}
|
|
#line 1017 "scanner.c"
|
|
}
|
|
#line 128 "scanner.re"
|
|
|
|
|
|
comment:
|
|
|
|
#line 1024 "scanner.c"
|
|
{
|
|
YYCTYPE yych;
|
|
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
|
|
yych = *YYCURSOR;
|
|
if(yych == 0x0A) goto yy208;
|
|
if(yych != '*') goto yy210;
|
|
++YYCURSOR;
|
|
if((yych = *YYCURSOR) == '/') goto yy211;
|
|
yy207:
|
|
#line 139 "scanner.re"
|
|
{ goto comment; }
|
|
#line 1036 "scanner.c"
|
|
yy208:
|
|
++YYCURSOR;
|
|
#line 134 "scanner.re"
|
|
{
|
|
if(cursor == s->eof) RET(EOI);
|
|
s->tok = s->pos = cursor; s->line++;
|
|
goto comment;
|
|
}
|
|
#line 1045 "scanner.c"
|
|
yy210:
|
|
yych = *++YYCURSOR;
|
|
goto yy207;
|
|
yy211:
|
|
++YYCURSOR;
|
|
#line 132 "scanner.re"
|
|
{ goto std; }
|
|
#line 1053 "scanner.c"
|
|
}
|
|
#line 140 "scanner.re"
|
|
|
|
}
|
|
|
|
int lex(Scanner *s, struct Token *tok)
|
|
{
|
|
int tokentype = scan(s);
|
|
char *p, *q;
|
|
|
|
tok->val = 0;
|
|
tok->string = NULL;
|
|
|
|
switch (tokentype)
|
|
{
|
|
case NUM:
|
|
tok->val = strtol((char *)s->tok, NULL, 0);
|
|
break;
|
|
|
|
case STRING:
|
|
tok->string = (char *)malloc(s->cur - s->tok - 1);
|
|
strncpy(tok->string, (char *)s->tok + 1, s->cur - s->tok - 2);
|
|
tok->string[s->cur - s->tok - 2] = '\0';
|
|
for (p = q = tok->string; *p; ++p, ++q)
|
|
{
|
|
if (p[0] == '\\' && p[1] == '\\')
|
|
++p;
|
|
*q = *p;
|
|
}
|
|
break;
|
|
|
|
case SYM:
|
|
tok->string = (char *)malloc(s->cur - s->tok + 1);
|
|
strncpy(tok->string, (char *)s->tok, s->cur - s->tok);
|
|
tok->string[s->cur - s->tok] = '\0';
|
|
break;
|
|
}
|
|
return tokentype;
|
|
}
|