mojoshader_lexer.c
author Ryan C. Gordon <icculus@icculus.org>
Wed, 18 Feb 2009 08:29:48 -0500
changeset 649 527cfe6f2d45
parent 619 e98a8aa6efb0
child 653 c1eb8cca56f8
permissions -rw-r--r--
Renamed preprocessor_internal_lexer to preprocessor_lexer.

/* Generated by re2c 0.12.1 */
/**
 * MojoShader; generate shader programs from bytecode of compiled
 *  Direct3D shaders.
 *
 * Please see the file LICENSE.txt in the source's root directory.
 *
 *  This file written by Ryan C. Gordon.
 */

// This was originally based on examples/pp-c.re from re2c: http://re2c.org/
//   re2c is public domain code.
//
// You build mojoshader_lexer_preprocessor.c from the .re file with re2c...
// re2c -is -o mojoshader_lexer_preprocessor.c mojoshader_lexer_preprocessor.re
//
// Changes to the lexer are done to the .re file, not the C code!
//
// Please note that this isn't a perfect C lexer, since it is used for both
//  HLSL and shader assembly language, and follows the quirks of Microsoft's
//  tools.

#define __MOJOSHADER_INTERNAL__ 1
#include "mojoshader_internal.h"

typedef unsigned char uchar;

#define RET(t) do { update_state(s, cursor, token); return t; } while (0)
#define YYCTYPE uchar
#define YYCURSOR cursor
#define YYLIMIT limit
#define YYMARKER s->lexer_marker
#define YYFILL(n) { if ((n) == 1) { RET(TOKEN_EOI); } }

static void update_state(IncludeState *s, const uchar *cur, const uchar *tok)
{
    s->bytes_left -= (unsigned int) (cur - ((const uchar *) s->source));
    s->source = (const char *) cur;
    s->token = (const char *) tok;
} // update_state

Token preprocessor_lexer(IncludeState *s)
{
    const uchar *cursor = (const uchar *) s->source;
    const uchar *token;
    const uchar *matchptr;
    const uchar *limit = cursor + s->bytes_left;
    int saw_newline = 0;

scanner_loop:
    token = cursor;

    if (YYLIMIT == YYCURSOR)
        RET(TOKEN_EOI);




{
	YYCTYPE yych;
	unsigned int yyaccept = 0;

	if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
	yych = *YYCURSOR;
	switch(yych) {
	case 0x09:
	case 0x0B:
	case 0x0C:
	case ' ':	goto yy61;
	case 0x0A:	goto yy63;
	case 0x0D:	goto yy65;
	case '!':	goto yy34;
	case '"':	goto yy13;
	case '#':	goto yy36;
	case '%':	goto yy24;
	case '&':	goto yy28;
	case '\'':	goto yy9;
	case '(':	goto yy37;
	case ')':	goto yy39;
	case '*':	goto yy22;
	case '+':	goto yy18;
	case ',':	goto yy45;
	case '-':	goto yy20;
	case '.':	goto yy11;
	case '/':	goto yy2;
	case '0':	goto yy6;
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy8;
	case ':':	goto yy49;
	case ';':	goto yy51;
	case '<':	goto yy16;
	case '=':	goto yy32;
	case '>':	goto yy14;
	case '?':	goto yy57;
	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 yy4;
	case '[':	goto yy41;
	case '\\':	goto yy59;
	case ']':	goto yy43;
	case '^':	goto yy26;
	case '{':	goto yy53;
	case '|':	goto yy30;
	case '}':	goto yy55;
	case '~':	goto yy47;
	default:	goto yy66;
	}
yy2:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= '.') {
		if(yych == '*') goto yy229;
	} else {
		if(yych <= '/') goto yy227;
		if(yych == '=') goto yy225;
	}
	{ RET('/'); }
yy4:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy224;
yy5:
	{ RET(TOKEN_IDENTIFIER); }
yy6:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych <= 'X') {
		if(yych <= 'T') {
			if(yych == 'L') goto yy199;
			goto yy215;
		} else {
			if(yych <= 'U') goto yy199;
			if(yych <= 'W') goto yy215;
			goto yy216;
		}
	} else {
		if(yych <= 't') {
			if(yych == 'l') goto yy199;
			goto yy215;
		} else {
			if(yych <= 'u') goto yy199;
			if(yych == 'x') goto yy216;
			goto yy215;
		}
	}
yy7:
	{ RET(TOKEN_INT_LITERAL); }
yy8:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	goto yy197;
yy9:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 0x0A) goto yy10;
	if(yych != 0x0D) goto yy187;
yy10:
	{ goto bad_chars; }
yy11:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= '/') goto yy12;
	if(yych <= '9') goto yy178;
yy12:
	{ RET('.'); }
yy13:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 0x0A) goto yy10;
	if(yych == 0x0D) goto yy10;
	goto yy169;
yy14:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= '<') goto yy15;
	if(yych <= '=') goto yy162;
	if(yych <= '>') goto yy164;
yy15:
	{ RET('>'); }
yy16:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= ';') goto yy17;
	if(yych <= '<') goto yy158;
	if(yych <= '=') goto yy156;
yy17:
	{ RET('<'); }
yy18:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '+') goto yy152;
	if(yych == '=') goto yy154;
	{ RET('+'); }
yy20:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '-') goto yy148;
	if(yych == '=') goto yy150;
	{ RET('-'); }
yy22:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy146;
	{ RET('*'); }
yy24:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy144;
	{ RET('%'); }
yy26:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy142;
	{ RET('^'); }
yy28:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '&') goto yy138;
	if(yych == '=') goto yy140;
	{ RET('&'); }
yy30:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy136;
	if(yych == '|') goto yy134;
	{ RET('|'); }
yy32:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy132;
	{ RET('='); }
yy34:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy130;
	{ RET('!'); }
yy36:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych <= 'c') {
		if(yych <= 0x1F) {
			if(yych == 0x09) goto yy71;
			goto yy10;
		} else {
			if(yych <= ' ') goto yy71;
			if(yych == '#') goto yy78;
			goto yy10;
		}
	} else {
		if(yych <= 'k') {
			if(yych <= 'e') goto yy71;
			if(yych == 'i') goto yy71;
			goto yy10;
		} else {
			if(yych <= 'l') goto yy71;
			if(yych == 'u') goto yy71;
			goto yy10;
		}
	}
yy37:
	++YYCURSOR;
	{ RET('('); }
yy39:
	++YYCURSOR;
	{ RET(')'); }
yy41:
	++YYCURSOR;
	{ RET('['); }
yy43:
	++YYCURSOR;
	{ RET(']'); }
yy45:
	++YYCURSOR;
	{ RET(','); }
yy47:
	++YYCURSOR;
	{ RET('~'); }
yy49:
	++YYCURSOR;
	{ RET(':'); }
yy51:
	++YYCURSOR;
	{ RET(';'); }
yy53:
	++YYCURSOR;
	{ RET('{'); }
yy55:
	++YYCURSOR;
	{ RET('}'); }
yy57:
	++YYCURSOR;
	{ RET('?'); }
yy59:
	++YYCURSOR;
	{ RET('\\'); }
yy61:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy69;
yy62:
	{ goto scanner_loop; }
yy63:
	++YYCURSOR;
yy64:
	{ s->line++; RET('\n'); }
yy65:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy67;
	goto yy64;
yy66:
	yych = *++YYCURSOR;
	goto yy10;
yy67:
	yych = *++YYCURSOR;
	goto yy64;
yy68:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy69:
	if(yych <= 0x0A) {
		if(yych == 0x09) goto yy68;
		goto yy62;
	} else {
		if(yych <= 0x0C) goto yy68;
		if(yych == ' ') goto yy68;
		goto yy62;
	}
yy70:
	++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
	yych = *YYCURSOR;
yy71:
	if(yych <= 'e') {
		if(yych <= 0x1F) {
			if(yych == 0x09) goto yy70;
		} else {
			if(yych <= ' ') goto yy70;
			if(yych <= 'c') goto yy72;
			if(yych <= 'd') goto yy76;
			goto yy73;
		}
	} else {
		if(yych <= 'k') {
			if(yych == 'i') goto yy74;
		} else {
			if(yych <= 'l') goto yy77;
			if(yych == 'u') goto yy75;
		}
	}
yy72:
	YYCURSOR = YYMARKER;
	if(yyaccept <= 1) {
		if(yyaccept <= 0) {
			goto yy7;
		} else {
			goto yy10;
		}
	} else {
		if(yyaccept <= 2) {
			goto yy97;
		} else {
			goto yy180;
		}
	}
yy73:
	yych = *++YYCURSOR;
	if(yych <= 'm') {
		if(yych == 'l') goto yy113;
		goto yy72;
	} else {
		if(yych <= 'n') goto yy114;
		if(yych == 'r') goto yy115;
		goto yy72;
	}
yy74:
	yych = *++YYCURSOR;
	if(yych == 'f') goto yy96;
	if(yych == 'n') goto yy95;
	goto yy72;
yy75:
	yych = *++YYCURSOR;
	if(yych == 'n') goto yy90;
	goto yy72;
yy76:
	yych = *++YYCURSOR;
	if(yych == 'e') goto yy84;
	goto yy72;
yy77:
	yych = *++YYCURSOR;
	if(yych == 'i') goto yy80;
	goto yy72;
yy78:
	++YYCURSOR;
	{ RET(TOKEN_HASHHASH); }
yy80:
	yych = *++YYCURSOR;
	if(yych != 'n') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_LINE); }
yy84:
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'i') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'n') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_DEFINE); }
yy90:
	yych = *++YYCURSOR;
	if(yych != 'd') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_UNDEF); }
yy95:
	yych = *++YYCURSOR;
	if(yych == 'c') goto yy107;
	goto yy72;
yy96:
	yyaccept = 2;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 'd') goto yy99;
	if(yych == 'n') goto yy98;
yy97:
	{ RET(TOKEN_PP_IF); }
yy98:
	yych = *++YYCURSOR;
	if(yych == 'd') goto yy103;
	goto yy72;
yy99:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_IFDEF); }
yy103:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_IFNDEF); }
yy107:
	yych = *++YYCURSOR;
	if(yych != 'l') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'u') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'd') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_INCLUDE); }
yy113:
	yych = *++YYCURSOR;
	if(yych == 'i') goto yy124;
	if(yych == 's') goto yy125;
	goto yy72;
yy114:
	yych = *++YYCURSOR;
	if(yych == 'd') goto yy120;
	goto yy72;
yy115:
	yych = *++YYCURSOR;
	if(yych != 'r') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'o') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'r') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_ERROR); }
yy120:
	yych = *++YYCURSOR;
	if(yych != 'i') goto yy72;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_ENDIF); }
yy124:
	yych = *++YYCURSOR;
	if(yych == 'f') goto yy128;
	goto yy72;
yy125:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy72;
	++YYCURSOR;
	{ RET(TOKEN_PP_ELSE); }
yy128:
	++YYCURSOR;
	{ RET(TOKEN_PP_ELIF); }
yy130:
	++YYCURSOR;
	{ RET(TOKEN_NEQ); }
yy132:
	++YYCURSOR;
	{ RET(TOKEN_EQL); }
yy134:
	++YYCURSOR;
	{ RET(TOKEN_OROR); }
yy136:
	++YYCURSOR;
	{ RET(TOKEN_ORASSIGN); }
yy138:
	++YYCURSOR;
	{ RET(TOKEN_ANDAND); }
yy140:
	++YYCURSOR;
	{ RET(TOKEN_ANDASSIGN); }
yy142:
	++YYCURSOR;
	{ RET(TOKEN_XORASSIGN); }
yy144:
	++YYCURSOR;
	{ RET(TOKEN_MODASSIGN); }
yy146:
	++YYCURSOR;
	{ RET(TOKEN_MULTASSIGN); }
yy148:
	++YYCURSOR;
	{ RET(TOKEN_DECREMENT); }
yy150:
	++YYCURSOR;
	{ RET(TOKEN_SUBASSIGN); }
yy152:
	++YYCURSOR;
	{ RET(TOKEN_INCREMENT); }
yy154:
	++YYCURSOR;
	{ RET(TOKEN_ADDASSIGN); }
yy156:
	++YYCURSOR;
	{ RET(TOKEN_LEQ); }
yy158:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy160;
	{ RET(TOKEN_LSHIFT); }
yy160:
	++YYCURSOR;
	{ RET(TOKEN_LSHIFTASSIGN); }
yy162:
	++YYCURSOR;
	{ RET(TOKEN_GEQ); }
yy164:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy166;
	{ RET(TOKEN_RSHIFT); }
yy166:
	++YYCURSOR;
	{ RET(TOKEN_RSHIFTASSIGN); }
yy168:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy169:
	if(yych <= 0x0D) {
		if(yych == 0x0A) goto yy72;
		if(yych <= 0x0C) goto yy168;
		goto yy72;
	} else {
		if(yych <= '"') {
			if(yych <= '!') goto yy168;
			goto yy171;
		} else {
			if(yych != '\\') goto yy168;
		}
	}
yy170:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'b') {
		if(yych <= '7') {
			if(yych <= '&') {
				if(yych == '"') goto yy168;
				goto yy72;
			} else {
				if(yych <= '\'') goto yy168;
				if(yych <= '/') goto yy72;
				goto yy174;
			}
		} else {
			if(yych <= '[') {
				if(yych == '?') goto yy168;
				goto yy72;
			} else {
				if(yych <= '\\') goto yy168;
				if(yych <= '`') goto yy72;
				goto yy168;
			}
		}
	} else {
		if(yych <= 'r') {
			if(yych <= 'm') {
				if(yych == 'f') goto yy168;
				goto yy72;
			} else {
				if(yych <= 'n') goto yy168;
				if(yych <= 'q') goto yy72;
				goto yy168;
			}
		} else {
			if(yych <= 'u') {
				if(yych == 't') goto yy168;
				goto yy72;
			} else {
				if(yych <= 'v') goto yy168;
				if(yych == 'x') goto yy173;
				goto yy72;
			}
		}
	}
yy171:
	++YYCURSOR;
	{ RET(TOKEN_STRING_LITERAL); }
yy173:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy176;
		goto yy72;
	} else {
		if(yych <= 'F') goto yy176;
		if(yych <= '`') goto yy72;
		if(yych <= 'f') goto yy176;
		goto yy72;
	}
yy174:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '!') {
		if(yych <= 0x0A) {
			if(yych <= 0x09) goto yy168;
			goto yy72;
		} else {
			if(yych == 0x0D) goto yy72;
			goto yy168;
		}
	} else {
		if(yych <= '7') {
			if(yych <= '"') goto yy171;
			if(yych <= '/') goto yy168;
			goto yy174;
		} else {
			if(yych == '\\') goto yy170;
			goto yy168;
		}
	}
yy176:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '/') {
		if(yych <= 0x0C) {
			if(yych == 0x0A) goto yy72;
			goto yy168;
		} else {
			if(yych <= 0x0D) goto yy72;
			if(yych == '"') goto yy171;
			goto yy168;
		}
	} else {
		if(yych <= '[') {
			if(yych <= '9') goto yy176;
			if(yych <= '@') goto yy168;
			if(yych <= 'F') goto yy176;
			goto yy168;
		} else {
			if(yych <= '\\') goto yy170;
			if(yych <= '`') goto yy168;
			if(yych <= 'f') goto yy176;
			goto yy168;
		}
	}
yy178:
	yyaccept = 3;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= 'D') {
			if(yych <= '/') goto yy180;
			if(yych <= '9') goto yy178;
		} else {
			if(yych <= 'E') goto yy181;
			if(yych <= 'F') goto yy182;
		}
	} else {
		if(yych <= 'e') {
			if(yych <= 'L') goto yy182;
			if(yych >= 'e') goto yy181;
		} else {
			if(yych <= 'f') goto yy182;
			if(yych == 'l') goto yy182;
		}
	}
yy180:
	{ RET(TOKEN_FLOAT_LITERAL); }
yy181:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych == '+') goto yy183;
		goto yy72;
	} else {
		if(yych <= '-') goto yy183;
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy184;
		goto yy72;
	}
yy182:
	yych = *++YYCURSOR;
	goto yy180;
yy183:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy72;
	if(yych >= ':') goto yy72;
yy184:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy180;
			goto yy184;
		} else {
			if(yych == 'F') goto yy182;
			goto yy180;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy182;
			if(yych <= 'e') goto yy180;
			goto yy182;
		} else {
			if(yych == 'l') goto yy182;
			goto yy180;
		}
	}
yy186:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy187:
	if(yych <= 0x0D) {
		if(yych == 0x0A) goto yy72;
		if(yych <= 0x0C) goto yy186;
		goto yy72;
	} else {
		if(yych <= '\'') {
			if(yych <= '&') goto yy186;
			goto yy189;
		} else {
			if(yych != '\\') goto yy186;
		}
	}
yy188:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'b') {
		if(yych <= '7') {
			if(yych <= '&') {
				if(yych == '"') goto yy186;
				goto yy72;
			} else {
				if(yych <= '\'') goto yy186;
				if(yych <= '/') goto yy72;
				goto yy191;
			}
		} else {
			if(yych <= '[') {
				if(yych == '?') goto yy186;
				goto yy72;
			} else {
				if(yych <= '\\') goto yy186;
				if(yych <= '`') goto yy72;
				goto yy186;
			}
		}
	} else {
		if(yych <= 'r') {
			if(yych <= 'm') {
				if(yych == 'f') goto yy186;
				goto yy72;
			} else {
				if(yych <= 'n') goto yy186;
				if(yych <= 'q') goto yy72;
				goto yy186;
			}
		} else {
			if(yych <= 'u') {
				if(yych == 't') goto yy186;
				goto yy72;
			} else {
				if(yych <= 'v') goto yy186;
				if(yych == 'x') goto yy190;
				goto yy72;
			}
		}
	}
yy189:
	yych = *++YYCURSOR;
	goto yy7;
yy190:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy193;
		goto yy72;
	} else {
		if(yych <= 'F') goto yy193;
		if(yych <= '`') goto yy72;
		if(yych <= 'f') goto yy193;
		goto yy72;
	}
yy191:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '&') {
		if(yych <= 0x0A) {
			if(yych <= 0x09) goto yy186;
			goto yy72;
		} else {
			if(yych == 0x0D) goto yy72;
			goto yy186;
		}
	} else {
		if(yych <= '7') {
			if(yych <= '\'') goto yy189;
			if(yych <= '/') goto yy186;
			goto yy191;
		} else {
			if(yych == '\\') goto yy188;
			goto yy186;
		}
	}
yy193:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '/') {
		if(yych <= 0x0C) {
			if(yych == 0x0A) goto yy72;
			goto yy186;
		} else {
			if(yych <= 0x0D) goto yy72;
			if(yych == '\'') goto yy189;
			goto yy186;
		}
	} else {
		if(yych <= '[') {
			if(yych <= '9') goto yy193;
			if(yych <= '@') goto yy186;
			if(yych <= 'F') goto yy193;
			goto yy186;
		} else {
			if(yych <= '\\') goto yy188;
			if(yych <= '`') goto yy186;
			if(yych <= 'f') goto yy193;
			goto yy186;
		}
	}
yy195:
	yyaccept = 3;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 'E') goto yy206;
	if(yych == 'e') goto yy206;
	goto yy205;
yy196:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy197:
	if(yych <= 'L') {
		if(yych <= '9') {
			if(yych == '.') goto yy195;
			if(yych <= '/') goto yy7;
			goto yy196;
		} else {
			if(yych == 'E') goto yy198;
			if(yych <= 'K') goto yy7;
			goto yy199;
		}
	} else {
		if(yych <= 'e') {
			if(yych == 'U') goto yy199;
			if(yych <= 'd') goto yy7;
		} else {
			if(yych <= 'l') {
				if(yych <= 'k') goto yy7;
				goto yy199;
			} else {
				if(yych == 'u') goto yy199;
				goto yy7;
			}
		}
	}
yy198:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych == '+') goto yy201;
		goto yy72;
	} else {
		if(yych <= '-') goto yy201;
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy202;
		goto yy72;
	}
yy199:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy199;
		if(yych <= 'T') goto yy7;
		goto yy199;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy199;
		} else {
			if(yych == 'u') goto yy199;
			goto yy7;
		}
	}
yy201:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy72;
	if(yych >= ':') goto yy72;
yy202:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy180;
			goto yy202;
		} else {
			if(yych == 'F') goto yy182;
			goto yy180;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy182;
			if(yych <= 'e') goto yy180;
			goto yy182;
		} else {
			if(yych == 'l') goto yy182;
			goto yy180;
		}
	}
yy204:
	yyaccept = 3;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
yy205:
	if(yych <= 'K') {
		if(yych <= 'D') {
			if(yych <= '/') goto yy180;
			if(yych <= '9') goto yy204;
			goto yy180;
		} else {
			if(yych <= 'E') goto yy210;
			if(yych <= 'F') goto yy182;
			goto yy180;
		}
	} else {
		if(yych <= 'e') {
			if(yych <= 'L') goto yy182;
			if(yych <= 'd') goto yy180;
			goto yy210;
		} else {
			if(yych <= 'f') goto yy182;
			if(yych == 'l') goto yy182;
			goto yy180;
		}
	}
yy206:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych != '+') goto yy72;
	} else {
		if(yych <= '-') goto yy207;
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy208;
		goto yy72;
	}
yy207:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy72;
	if(yych >= ':') goto yy72;
yy208:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy180;
			goto yy208;
		} else {
			if(yych == 'F') goto yy182;
			goto yy180;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy182;
			if(yych <= 'e') goto yy180;
			goto yy182;
		} else {
			if(yych == 'l') goto yy182;
			goto yy180;
		}
	}
yy210:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych != '+') goto yy72;
	} else {
		if(yych <= '-') goto yy211;
		if(yych <= '/') goto yy72;
		if(yych <= '9') goto yy212;
		goto yy72;
	}
yy211:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy72;
	if(yych >= ':') goto yy72;
yy212:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy180;
			goto yy212;
		} else {
			if(yych == 'F') goto yy182;
			goto yy180;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy182;
			if(yych <= 'e') goto yy180;
			goto yy182;
		} else {
			if(yych == 'l') goto yy182;
			goto yy180;
		}
	}
yy214:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy215:
	if(yych <= 'L') {
		if(yych <= '9') {
			if(yych == '.') goto yy195;
			if(yych <= '/') goto yy7;
			goto yy214;
		} else {
			if(yych == 'E') goto yy198;
			if(yych <= 'K') goto yy7;
			goto yy221;
		}
	} else {
		if(yych <= 'e') {
			if(yych == 'U') goto yy221;
			if(yych <= 'd') goto yy7;
			goto yy198;
		} else {
			if(yych <= 'l') {
				if(yych <= 'k') goto yy7;
				goto yy221;
			} else {
				if(yych == 'u') goto yy221;
				goto yy7;
			}
		}
	}
yy216:
	yych = *++YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy72;
		if(yych >= ':') goto yy72;
	} else {
		if(yych <= 'F') goto yy217;
		if(yych <= '`') goto yy72;
		if(yych >= 'g') goto yy72;
	}
yy217:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'T') {
		if(yych <= '@') {
			if(yych <= '/') goto yy7;
			if(yych <= '9') goto yy217;
			goto yy7;
		} else {
			if(yych <= 'F') goto yy217;
			if(yych != 'L') goto yy7;
		}
	} else {
		if(yych <= 'k') {
			if(yych <= 'U') goto yy219;
			if(yych <= '`') goto yy7;
			if(yych <= 'f') goto yy217;
			goto yy7;
		} else {
			if(yych <= 'l') goto yy219;
			if(yych != 'u') goto yy7;
		}
	}
yy219:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy219;
		if(yych <= 'T') goto yy7;
		goto yy219;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy219;
		} else {
			if(yych == 'u') goto yy219;
			goto yy7;
		}
	}
yy221:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy221;
		if(yych <= 'T') goto yy7;
		goto yy221;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy221;
		} else {
			if(yych == 'u') goto yy221;
			goto yy7;
		}
	}
yy223:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy224:
	if(yych <= 'Z') {
		if(yych <= '/') goto yy5;
		if(yych <= '9') goto yy223;
		if(yych <= '@') goto yy5;
		goto yy223;
	} else {
		if(yych <= '_') {
			if(yych <= '^') goto yy5;
			goto yy223;
		} else {
			if(yych <= '`') goto yy5;
			if(yych <= 'z') goto yy223;
			goto yy5;
		}
	}
yy225:
	++YYCURSOR;
	{ RET(TOKEN_DIVASSIGN); }
yy227:
	++YYCURSOR;
	{ goto singlelinecomment; }
yy229:
	++YYCURSOR;
	{ goto multilinecomment; }
}


multilinecomment:
    if (YYLIMIT == YYCURSOR)
        RET(TOKEN_INCOMPLETE_COMMENT);
    matchptr = cursor;
// The "*\/" is just to avoid screwing up text editor syntax highlighting.

{
	YYCTYPE yych;
	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	if(yych <= 0x0C) {
		if(yych == 0x0A) goto yy235;
		goto yy238;
	} else {
		if(yych <= 0x0D) goto yy237;
		if(yych != '*') goto yy238;
	}
	++YYCURSOR;
	if((yych = *YYCURSOR) == '/') goto yy240;
yy234:
	{ goto multilinecomment; }
yy235:
	++YYCURSOR;
yy236:
	{
                        s->line++;
                        token = matchptr;
                        saw_newline = 1;
                        goto multilinecomment;
                    }
yy237:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy239;
	goto yy236;
yy238:
	yych = *++YYCURSOR;
	goto yy234;
yy239:
	yych = *++YYCURSOR;
	goto yy236;
yy240:
	++YYCURSOR;
	{
                        if (saw_newline)
                            RET('\n');
                        goto scanner_loop;
                    }
}


singlelinecomment:
    if (YYLIMIT == YYCURSOR)
        RET(TOKEN_EOI);
    matchptr = cursor;

{
	YYCTYPE yych;
	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	if(yych == 0x0A) goto yy244;
	if(yych == 0x0D) goto yy246;
	goto yy247;
yy244:
	++YYCURSOR;
yy245:
	{ s->line++; token = matchptr; RET('\n'); }
yy246:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy249;
	goto yy245;
yy247:
	++YYCURSOR;
	{ goto singlelinecomment; }
yy249:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy245;
}


bad_chars:
    if (YYLIMIT == YYCURSOR)
        RET(TOKEN_BAD_CHARS);


{
	YYCTYPE yych;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '#') {
		if(yych <= 0x1F) {
			if(yych <= 0x08) goto yy254;
			if(yych >= 0x0E) goto yy254;
		} else {
			if(yych == '"') goto yy254;
		}
	} else {
		if(yych <= '@') {
			if(yych <= '$') goto yy254;
			if(yych >= '@') goto yy254;
		} else {
			if(yych == '`') goto yy254;
			if(yych >= 0x7F) goto yy254;
		}
	}
	++YYCURSOR;
	{ cursor--; RET(TOKEN_BAD_CHARS); }
yy254:
	++YYCURSOR;
	{ goto bad_chars; }
}


    assert(0 && "Shouldn't hit this code");
    RET(TOKEN_UNKNOWN);
} // preprocessor_lexer

// end of mojoshader_lexer_preprocessor.re (or .c) ...