mojoshader_lexer.c
author Ryan C. Gordon <icculus@icculus.org>
Thu, 12 Feb 2009 02:42:52 -0500
changeset 580 a7b038eb688c
parent 555 940821555fda
child 584 9aea8877564d
permissions -rw-r--r--
Updated re2c-generated lexer code.

/* Generated by re2c 0.12.1 on Thu Feb 12 01:23:03 2009 */
#line 1 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
/**
 * 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_internal_lexer(IncludeState *s)
{
    const uchar *cursor = (const uchar *) s->source;
    const uchar *token;
    const uchar *limit = cursor + s->bytes_left;
    int saw_newline = 0;

scanner_loop:
    token = cursor;

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

#line 67 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"



#line 61 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
{
	YYCTYPE yych;
	unsigned int yyaccept = 0;

	if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
	yych = *YYCURSOR;
	switch(yych) {
	case 0x09:
	case 0x0B:
	case 0x0C:
	case ' ':	goto yy62;
	case 0x0A:	goto yy64;
	case 0x0D:	goto yy66;
	case '!':	goto yy24;
	case '"':	goto yy13;
	case '#':	goto yy26;
	case '%':	goto yy46;
	case '&':	goto yy18;
	case '\'':	goto yy9;
	case '(':	goto yy28;
	case ')':	goto yy30;
	case '*':	goto yy44;
	case '+':	goto yy42;
	case ',':	goto yy36;
	case '-':	goto yy40;
	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 yy50;
	case ';':	goto yy52;
	case '<':	goto yy16;
	case '=':	goto yy22;
	case '>':	goto yy14;
	case '?':	goto yy58;
	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 yy32;
	case '\\':	goto yy60;
	case ']':	goto yy34;
	case '^':	goto yy48;
	case '{':	goto yy54;
	case '|':	goto yy20;
	case '}':	goto yy56;
	case '~':	goto yy38;
	default:	goto yy67;
	}
yy2:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '*') goto yy209;
	if(yych == '/') goto yy207;
#line 107 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('/'); }
#line 174 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy4:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy206;
yy5:
#line 73 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_IDENTIFIER); }
#line 182 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy6:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych <= 'X') {
		if(yych <= 'T') {
			if(yych == 'L') goto yy181;
			goto yy197;
		} else {
			if(yych <= 'U') goto yy181;
			if(yych <= 'W') goto yy197;
			goto yy198;
		}
	} else {
		if(yych <= 't') {
			if(yych == 'l') goto yy181;
			goto yy197;
		} else {
			if(yych <= 'u') goto yy181;
			if(yych == 'x') goto yy198;
			goto yy197;
		}
	}
yy7:
#line 77 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_INT_LITERAL); }
#line 208 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy8:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	goto yy179;
yy9:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych != 0x0A) goto yy169;
yy10:
#line 136 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ printf("bad char\n"); goto scanner_loop; }
#line 220 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy11:
	yyaccept = 2;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == '.') goto yy157;
	if(yych <= '/') goto yy12;
	if(yych <= '9') goto yy158;
yy12:
#line 99 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('.'); }
#line 230 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy13:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 0x0A) goto yy10;
	goto yy148;
yy14:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= '<') goto yy15;
	if(yych <= '=') goto yy143;
	if(yych <= '>') goto yy145;
yy15:
#line 110 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('>'); }
#line 244 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy16:
	++YYCURSOR;
	if((yych = *YYCURSOR) <= ';') goto yy17;
	if(yych <= '<') goto yy141;
	if(yych <= '=') goto yy139;
yy17:
#line 109 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('<'); }
#line 253 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy18:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '&') goto yy137;
#line 101 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('&'); }
#line 259 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy20:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '|') goto yy135;
#line 112 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('|'); }
#line 265 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy22:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy133;
#line 117 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('='); }
#line 271 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy24:
	++YYCURSOR;
	if((yych = *YYCURSOR) == '=') goto yy131;
#line 102 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('!'); }
#line 277 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy26:
	yyaccept = 3;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych <= 'c') {
		if(yych <= 0x1F) {
			if(yych == 0x09) goto yy72;
		} else {
			if(yych <= ' ') goto yy72;
			if(yych == '#') goto yy79;
		}
	} else {
		if(yych <= 'k') {
			if(yych <= 'e') goto yy72;
			if(yych == 'i') goto yy72;
		} else {
			if(yych <= 'l') goto yy72;
			if(yych == 'u') goto yy72;
		}
	}
yy27:
#line 120 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('#'); }
#line 300 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy28:
	++YYCURSOR;
#line 95 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('('); }
#line 305 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy30:
	++YYCURSOR;
#line 96 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(')'); }
#line 310 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy32:
	++YYCURSOR;
#line 97 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('['); }
#line 315 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy34:
	++YYCURSOR;
#line 98 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(']'); }
#line 320 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy36:
	++YYCURSOR;
#line 100 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(','); }
#line 325 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy38:
	++YYCURSOR;
#line 103 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('~'); }
#line 330 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy40:
	++YYCURSOR;
#line 104 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('-'); }
#line 335 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy42:
	++YYCURSOR;
#line 105 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('+'); }
#line 340 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy44:
	++YYCURSOR;
#line 106 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('*'); }
#line 345 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy46:
	++YYCURSOR;
#line 108 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('%'); }
#line 350 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy48:
	++YYCURSOR;
#line 111 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('^'); }
#line 355 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy50:
	++YYCURSOR;
#line 113 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(':'); }
#line 360 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy52:
	++YYCURSOR;
#line 114 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(';'); }
#line 365 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy54:
	++YYCURSOR;
#line 115 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('{'); }
#line 370 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy56:
	++YYCURSOR;
#line 116 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('}'); }
#line 375 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy58:
	++YYCURSOR;
#line 118 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('?'); }
#line 380 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy60:
	++YYCURSOR;
#line 119 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET('\\'); }
#line 385 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy62:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy70;
yy63:
#line 134 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto scanner_loop; }
#line 393 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy64:
	++YYCURSOR;
yy65:
#line 135 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ s->line++; RET('\n'); }
#line 399 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy66:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy68;
	goto yy65;
yy67:
	yych = *++YYCURSOR;
	goto yy10;
yy68:
	yych = *++YYCURSOR;
	goto yy65;
yy69:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy70:
	if(yych <= 0x0A) {
		if(yych == 0x09) goto yy69;
		goto yy63;
	} else {
		if(yych <= 0x0C) goto yy69;
		if(yych == ' ') goto yy69;
		goto yy63;
	}
yy71:
	++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
	yych = *YYCURSOR;
yy72:
	if(yych <= 'e') {
		if(yych <= 0x1F) {
			if(yych == 0x09) goto yy71;
		} else {
			if(yych <= ' ') goto yy71;
			if(yych <= 'c') goto yy73;
			if(yych <= 'd') goto yy77;
			goto yy74;
		}
	} else {
		if(yych <= 'k') {
			if(yych == 'i') goto yy75;
		} else {
			if(yych <= 'l') goto yy78;
			if(yych == 'u') goto yy76;
		}
	}
yy73:
	YYCURSOR = YYMARKER;
	if(yyaccept <= 2) {
		if(yyaccept <= 1) {
			if(yyaccept <= 0) {
				goto yy7;
			} else {
				goto yy10;
			}
		} else {
			goto yy12;
		}
	} else {
		if(yyaccept <= 4) {
			if(yyaccept <= 3) {
				goto yy27;
			} else {
				goto yy98;
			}
		} else {
			goto yy160;
		}
	}
yy74:
	yych = *++YYCURSOR;
	if(yych <= 'm') {
		if(yych == 'l') goto yy114;
		goto yy73;
	} else {
		if(yych <= 'n') goto yy115;
		if(yych == 'r') goto yy116;
		goto yy73;
	}
yy75:
	yych = *++YYCURSOR;
	if(yych == 'f') goto yy97;
	if(yych == 'n') goto yy96;
	goto yy73;
yy76:
	yych = *++YYCURSOR;
	if(yych == 'n') goto yy91;
	goto yy73;
yy77:
	yych = *++YYCURSOR;
	if(yych == 'e') goto yy85;
	goto yy73;
yy78:
	yych = *++YYCURSOR;
	if(yych == 'i') goto yy81;
	goto yy73;
yy79:
	++YYCURSOR;
#line 94 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_HASHHASH); }
#line 499 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy81:
	yych = *++YYCURSOR;
	if(yych != 'n') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	++YYCURSOR;
#line 123 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_LINE); }
#line 508 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy85:
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'i') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'n') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	++YYCURSOR;
#line 124 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_DEFINE); }
#line 521 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy91:
	yych = *++YYCURSOR;
	if(yych != 'd') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy73;
	++YYCURSOR;
#line 125 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_UNDEF); }
#line 532 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy96:
	yych = *++YYCURSOR;
	if(yych == 'c') goto yy108;
	goto yy73;
yy97:
	yyaccept = 4;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 'd') goto yy100;
	if(yych == 'n') goto yy99;
yy98:
#line 126 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_IF); }
#line 545 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy99:
	yych = *++YYCURSOR;
	if(yych == 'd') goto yy104;
	goto yy73;
yy100:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy73;
	++YYCURSOR;
#line 127 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_IFDEF); }
#line 558 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy104:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy73;
	++YYCURSOR;
#line 128 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_IFNDEF); }
#line 567 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy108:
	yych = *++YYCURSOR;
	if(yych != 'l') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'u') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'd') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	++YYCURSOR;
#line 122 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_INCLUDE); }
#line 580 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy114:
	yych = *++YYCURSOR;
	if(yych == 'i') goto yy125;
	if(yych == 's') goto yy126;
	goto yy73;
yy115:
	yych = *++YYCURSOR;
	if(yych == 'd') goto yy121;
	goto yy73;
yy116:
	yych = *++YYCURSOR;
	if(yych != 'r') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'o') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'r') goto yy73;
	++YYCURSOR;
#line 132 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_ERROR); }
#line 600 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy121:
	yych = *++YYCURSOR;
	if(yych != 'i') goto yy73;
	yych = *++YYCURSOR;
	if(yych != 'f') goto yy73;
	++YYCURSOR;
#line 131 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_ENDIF); }
#line 609 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy125:
	yych = *++YYCURSOR;
	if(yych == 'f') goto yy129;
	goto yy73;
yy126:
	yych = *++YYCURSOR;
	if(yych != 'e') goto yy73;
	++YYCURSOR;
#line 129 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_ELSE); }
#line 620 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy129:
	++YYCURSOR;
#line 130 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_PP_ELIF); }
#line 625 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy131:
	++YYCURSOR;
#line 93 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_NEQ); }
#line 630 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy133:
	++YYCURSOR;
#line 92 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_EQL); }
#line 635 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy135:
	++YYCURSOR;
#line 89 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_OROR); }
#line 640 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy137:
	++YYCURSOR;
#line 88 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_ANDAND); }
#line 645 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy139:
	++YYCURSOR;
#line 90 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_LEQ); }
#line 650 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy141:
	++YYCURSOR;
#line 87 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_LSHIFT); }
#line 655 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy143:
	++YYCURSOR;
#line 91 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_GEQ); }
#line 660 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy145:
	++YYCURSOR;
#line 86 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_RSHIFT); }
#line 665 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy147:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy148:
	if(yych <= '!') {
		if(yych == 0x0A) goto yy73;
		goto yy147;
	} else {
		if(yych <= '"') goto yy150;
		if(yych != '\\') goto yy147;
	}
yy149:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'b') {
		if(yych <= '7') {
			if(yych <= '&') {
				if(yych == '"') goto yy147;
				goto yy73;
			} else {
				if(yych <= '\'') goto yy147;
				if(yych <= '/') goto yy73;
				goto yy153;
			}
		} else {
			if(yych <= '[') {
				if(yych == '?') goto yy147;
				goto yy73;
			} else {
				if(yych <= '\\') goto yy147;
				if(yych <= '`') goto yy73;
				goto yy147;
			}
		}
	} else {
		if(yych <= 'r') {
			if(yych <= 'm') {
				if(yych == 'f') goto yy147;
				goto yy73;
			} else {
				if(yych <= 'n') goto yy147;
				if(yych <= 'q') goto yy73;
				goto yy147;
			}
		} else {
			if(yych <= 'u') {
				if(yych == 't') goto yy147;
				goto yy73;
			} else {
				if(yych <= 'v') goto yy147;
				if(yych == 'x') goto yy152;
				goto yy73;
			}
		}
	}
yy150:
	++YYCURSOR;
#line 83 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_STRING_LITERAL); }
#line 727 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy152:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy155;
		goto yy73;
	} else {
		if(yych <= 'F') goto yy155;
		if(yych <= '`') goto yy73;
		if(yych <= 'f') goto yy155;
		goto yy73;
	}
yy153:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '"') {
		if(yych == 0x0A) goto yy73;
		if(yych <= '!') goto yy147;
		goto yy150;
	} else {
		if(yych <= '7') {
			if(yych <= '/') goto yy147;
			goto yy153;
		} else {
			if(yych == '\\') goto yy149;
			goto yy147;
		}
	}
yy155:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '9') {
		if(yych <= '!') {
			if(yych == 0x0A) goto yy73;
			goto yy147;
		} else {
			if(yych <= '"') goto yy150;
			if(yych <= '/') goto yy147;
			goto yy155;
		}
	} else {
		if(yych <= '[') {
			if(yych <= '@') goto yy147;
			if(yych <= 'F') goto yy155;
			goto yy147;
		} else {
			if(yych <= '\\') goto yy149;
			if(yych <= '`') goto yy147;
			if(yych <= 'f') goto yy155;
			goto yy147;
		}
	}
yy157:
	yych = *++YYCURSOR;
	if(yych == '.') goto yy166;
	goto yy73;
yy158:
	yyaccept = 5;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= 'D') {
			if(yych <= '/') goto yy160;
			if(yych <= '9') goto yy158;
		} else {
			if(yych <= 'E') goto yy161;
			if(yych <= 'F') goto yy162;
		}
	} else {
		if(yych <= 'e') {
			if(yych <= 'L') goto yy162;
			if(yych >= 'e') goto yy161;
		} else {
			if(yych <= 'f') goto yy162;
			if(yych == 'l') goto yy162;
		}
	}
yy160:
#line 80 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_FLOAT_LITERAL); }
#line 813 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy161:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych == '+') goto yy163;
		goto yy73;
	} else {
		if(yych <= '-') goto yy163;
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy164;
		goto yy73;
	}
yy162:
	yych = *++YYCURSOR;
	goto yy160;
yy163:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy73;
	if(yych >= ':') goto yy73;
yy164:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy160;
			goto yy164;
		} else {
			if(yych == 'F') goto yy162;
			goto yy160;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy162;
			if(yych <= 'e') goto yy160;
			goto yy162;
		} else {
			if(yych == 'l') goto yy162;
			goto yy160;
		}
	}
yy166:
	++YYCURSOR;
#line 85 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ RET(TOKEN_ELLIPSIS); }
#line 858 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy168:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy169:
	if(yych <= '&') {
		if(yych == 0x0A) goto yy73;
		goto yy168;
	} else {
		if(yych <= '\'') goto yy171;
		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 yy73;
			} else {
				if(yych <= '\'') goto yy168;
				if(yych <= '/') goto yy73;
				goto yy173;
			}
		} else {
			if(yych <= '[') {
				if(yych == '?') goto yy168;
				goto yy73;
			} else {
				if(yych <= '\\') goto yy168;
				if(yych <= '`') goto yy73;
				goto yy168;
			}
		}
	} else {
		if(yych <= 'r') {
			if(yych <= 'm') {
				if(yych == 'f') goto yy168;
				goto yy73;
			} else {
				if(yych <= 'n') goto yy168;
				if(yych <= 'q') goto yy73;
				goto yy168;
			}
		} else {
			if(yych <= 'u') {
				if(yych == 't') goto yy168;
				goto yy73;
			} else {
				if(yych <= 'v') goto yy168;
				if(yych == 'x') goto yy172;
				goto yy73;
			}
		}
	}
yy171:
	yych = *++YYCURSOR;
	goto yy7;
yy172:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy175;
		goto yy73;
	} else {
		if(yych <= 'F') goto yy175;
		if(yych <= '`') goto yy73;
		if(yych <= 'f') goto yy175;
		goto yy73;
	}
yy173:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '\'') {
		if(yych == 0x0A) goto yy73;
		if(yych <= '&') goto yy168;
		goto yy171;
	} else {
		if(yych <= '7') {
			if(yych <= '/') goto yy168;
			goto yy173;
		} else {
			if(yych == '\\') goto yy170;
			goto yy168;
		}
	}
yy175:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= '9') {
		if(yych <= '&') {
			if(yych == 0x0A) goto yy73;
			goto yy168;
		} else {
			if(yych <= '\'') goto yy171;
			if(yych <= '/') goto yy168;
			goto yy175;
		}
	} else {
		if(yych <= '[') {
			if(yych <= '@') goto yy168;
			if(yych <= 'F') goto yy175;
			goto yy168;
		} else {
			if(yych <= '\\') goto yy170;
			if(yych <= '`') goto yy168;
			if(yych <= 'f') goto yy175;
			goto yy168;
		}
	}
yy177:
	yyaccept = 5;
	yych = *(YYMARKER = ++YYCURSOR);
	if(yych == 'E') goto yy188;
	if(yych == 'e') goto yy188;
	goto yy187;
yy178:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy179:
	if(yych <= 'L') {
		if(yych <= '9') {
			if(yych == '.') goto yy177;
			if(yych <= '/') goto yy7;
			goto yy178;
		} else {
			if(yych == 'E') goto yy180;
			if(yych <= 'K') goto yy7;
			goto yy181;
		}
	} else {
		if(yych <= 'e') {
			if(yych == 'U') goto yy181;
			if(yych <= 'd') goto yy7;
		} else {
			if(yych <= 'l') {
				if(yych <= 'k') goto yy7;
				goto yy181;
			} else {
				if(yych == 'u') goto yy181;
				goto yy7;
			}
		}
	}
yy180:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych == '+') goto yy183;
		goto yy73;
	} else {
		if(yych <= '-') goto yy183;
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy184;
		goto yy73;
	}
yy181:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy181;
		if(yych <= 'T') goto yy7;
		goto yy181;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy181;
		} else {
			if(yych == 'u') goto yy181;
			goto yy7;
		}
	}
yy183:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy73;
	if(yych >= ':') goto yy73;
yy184:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy160;
			goto yy184;
		} else {
			if(yych == 'F') goto yy162;
			goto yy160;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy162;
			if(yych <= 'e') goto yy160;
			goto yy162;
		} else {
			if(yych == 'l') goto yy162;
			goto yy160;
		}
	}
yy186:
	yyaccept = 5;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
	yych = *YYCURSOR;
yy187:
	if(yych <= 'K') {
		if(yych <= 'D') {
			if(yych <= '/') goto yy160;
			if(yych <= '9') goto yy186;
			goto yy160;
		} else {
			if(yych <= 'E') goto yy192;
			if(yych <= 'F') goto yy162;
			goto yy160;
		}
	} else {
		if(yych <= 'e') {
			if(yych <= 'L') goto yy162;
			if(yych <= 'd') goto yy160;
			goto yy192;
		} else {
			if(yych <= 'f') goto yy162;
			if(yych == 'l') goto yy162;
			goto yy160;
		}
	}
yy188:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych != '+') goto yy73;
	} else {
		if(yych <= '-') goto yy189;
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy190;
		goto yy73;
	}
yy189:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy73;
	if(yych >= ':') goto yy73;
yy190:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy160;
			goto yy190;
		} else {
			if(yych == 'F') goto yy162;
			goto yy160;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy162;
			if(yych <= 'e') goto yy160;
			goto yy162;
		} else {
			if(yych == 'l') goto yy162;
			goto yy160;
		}
	}
yy192:
	yych = *++YYCURSOR;
	if(yych <= ',') {
		if(yych != '+') goto yy73;
	} else {
		if(yych <= '-') goto yy193;
		if(yych <= '/') goto yy73;
		if(yych <= '9') goto yy194;
		goto yy73;
	}
yy193:
	yych = *++YYCURSOR;
	if(yych <= '/') goto yy73;
	if(yych >= ':') goto yy73;
yy194:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'K') {
		if(yych <= '9') {
			if(yych <= '/') goto yy160;
			goto yy194;
		} else {
			if(yych == 'F') goto yy162;
			goto yy160;
		}
	} else {
		if(yych <= 'f') {
			if(yych <= 'L') goto yy162;
			if(yych <= 'e') goto yy160;
			goto yy162;
		} else {
			if(yych == 'l') goto yy162;
			goto yy160;
		}
	}
yy196:
	yyaccept = 0;
	YYMARKER = ++YYCURSOR;
	if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
	yych = *YYCURSOR;
yy197:
	if(yych <= 'L') {
		if(yych <= '9') {
			if(yych == '.') goto yy177;
			if(yych <= '/') goto yy7;
			goto yy196;
		} else {
			if(yych == 'E') goto yy180;
			if(yych <= 'K') goto yy7;
			goto yy203;
		}
	} else {
		if(yych <= 'e') {
			if(yych == 'U') goto yy203;
			if(yych <= 'd') goto yy7;
			goto yy180;
		} else {
			if(yych <= 'l') {
				if(yych <= 'k') goto yy7;
				goto yy203;
			} else {
				if(yych == 'u') goto yy203;
				goto yy7;
			}
		}
	}
yy198:
	yych = *++YYCURSOR;
	if(yych <= '@') {
		if(yych <= '/') goto yy73;
		if(yych >= ':') goto yy73;
	} else {
		if(yych <= 'F') goto yy199;
		if(yych <= '`') goto yy73;
		if(yych >= 'g') goto yy73;
	}
yy199:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'T') {
		if(yych <= '@') {
			if(yych <= '/') goto yy7;
			if(yych <= '9') goto yy199;
			goto yy7;
		} else {
			if(yych <= 'F') goto yy199;
			if(yych != 'L') goto yy7;
		}
	} else {
		if(yych <= 'k') {
			if(yych <= 'U') goto yy201;
			if(yych <= '`') goto yy7;
			if(yych <= 'f') goto yy199;
			goto yy7;
		} else {
			if(yych <= 'l') goto yy201;
			if(yych != 'u') goto yy7;
		}
	}
yy201:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy201;
		if(yych <= 'T') goto yy7;
		goto yy201;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy201;
		} else {
			if(yych == 'u') goto yy201;
			goto yy7;
		}
	}
yy203:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	if(yych <= 'U') {
		if(yych == 'L') goto yy203;
		if(yych <= 'T') goto yy7;
		goto yy203;
	} else {
		if(yych <= 'l') {
			if(yych <= 'k') goto yy7;
			goto yy203;
		} else {
			if(yych == 'u') goto yy203;
			goto yy7;
		}
	}
yy205:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy206:
	if(yych <= 'Z') {
		if(yych <= '/') goto yy5;
		if(yych <= '9') goto yy205;
		if(yych <= '@') goto yy5;
		goto yy205;
	} else {
		if(yych <= '_') {
			if(yych <= '^') goto yy5;
			goto yy205;
		} else {
			if(yych <= '`') goto yy5;
			if(yych <= 'z') goto yy205;
			goto yy5;
		}
	}
yy207:
	++YYCURSOR;
#line 71 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto singlelinecomment; }
#line 1287 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy209:
	++YYCURSOR;
#line 70 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto multilinecomment; }
#line 1292 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
}
#line 137 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"


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

#line 1302 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
{
	YYCTYPE yych;
	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	if(yych <= 0x0C) {
		if(yych == 0x0A) goto yy215;
		goto yy218;
	} else {
		if(yych <= 0x0D) goto yy217;
		if(yych != '*') goto yy218;
	}
	++YYCURSOR;
	if((yych = *YYCURSOR) == '/') goto yy220;
yy214:
#line 155 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto multilinecomment; }
#line 1319 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy215:
	++YYCURSOR;
yy216:
#line 149 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{
                        s->line++;
                        token = cursor-1;
                        saw_newline = 1;
                        goto multilinecomment;
                    }
#line 1330 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy217:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy219;
	goto yy216;
yy218:
	yych = *++YYCURSOR;
	goto yy214;
yy219:
	yych = *++YYCURSOR;
	goto yy216;
yy220:
	++YYCURSOR;
#line 144 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{
                        if (saw_newline)
                            RET('\n');
                        goto scanner_loop;
                    }
#line 1349 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
}
#line 156 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"


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

#line 1358 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
{
	YYCTYPE yych;
	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	if(yych == 0x0A) goto yy224;
	if(yych == 0x0D) goto yy226;
	goto yy227;
yy224:
	++YYCURSOR;
yy225:
#line 162 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ s->line++; token = cursor-1; RET('\n'); }
#line 1371 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy226:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy229;
	goto yy225;
yy227:
	++YYCURSOR;
#line 163 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto singlelinecomment; }
#line 1380 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy229:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy225;
}
#line 164 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"


// !!! FIXME
/*
bad_chars:
    if (YYLIMIT == YYCURSOR)
        RET(TOKEN_BAD_TOKEN);
*/


#line 1397 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
{
	YYCTYPE yych;
	if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	yych = *YYCURSOR;
	if(yych <= 0x0C) {
		if(yych <= 0x08) goto yy237;
		if(yych != 0x0A) goto yy235;
	} else {
		if(yych <= 0x0D) goto yy234;
		if(yych == ' ') goto yy235;
		goto yy237;
	}
	++YYCURSOR;
yy233:
#line 174 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ s->line++; goto scanner_loop; }
#line 1414 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy234:
	yych = *++YYCURSOR;
	if(yych == 0x0A) goto yy241;
	goto yy233;
yy235:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy240;
yy236:
#line 175 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto scanner_loop; }
#line 1426 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy237:
	++YYCURSOR;
#line 176 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"
	{ goto singlelinecomment; }
#line 1431 "/home/icculus/projects/mojoshader/mojoshader_lexer.c"
yy239:
	++YYCURSOR;
	if(YYLIMIT == YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy240:
	if(yych <= 0x0A) {
		if(yych == 0x09) goto yy239;
		goto yy236;
	} else {
		if(yych <= 0x0C) goto yy239;
		if(yych == ' ') goto yy239;
		goto yy236;
	}
yy241:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy233;
}
#line 177 "/home/icculus/projects/mojoshader/mojoshader_lexer.re"


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

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