/* Generated by re2c 0.13.5 on Mon Nov  6 18:02:20 2017 */
#line 1 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
// {{{ MIT License

// Copyright 2017 Roland Kaminski

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.

// }}}

#define YYCTYPE     char
#define YYCURSOR    cursor()
#define YYLIMIT     limit()
#define YYMARKER    marker()
#define YYCTXMARKER ctxmarker()
#define YYFILL(n)   {fill(n);}

#line 40 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"


int Gringo::Input::GroundTermParser::lex_impl(void *pValue, Logger &log) {
start:
    start();
    auto &value = *static_cast<Gringo::Input::GroundTermGrammar::parser::semantic_type*>(pValue);
    
#line 43 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
{
	YYCTYPE yych;
	unsigned int yyaccept = 0;

	if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
	yych = *YYCURSOR;
	switch (yych) {
	case '\t':
	case '\r':
	case ' ':	goto yy3;
	case '\n':	goto yy4;
	case '"':	goto yy14;
	case '#':	goto yy6;
	case '&':	goto yy29;
	case '(':	goto yy15;
	case ')':	goto yy17;
	case '*':	goto yy23;
	case '+':	goto yy19;
	case ',':	goto yy37;
	case '-':	goto yy21;
	case '/':	goto yy27;
	case '0':	goto yy11;
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy13;
	case '?':	goto yy35;
	case '\\':	goto yy25;
	case '^':	goto yy31;
	case '_':	goto yy8;
	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 yy9;
	case '|':	goto yy39;
	case '~':	goto yy33;
	default:	goto yy41;
	}
yy2:
#line 47 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ goto start; }
#line 112 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy3:
	yych = *++YYCURSOR;
	goto yy74;
yy4:
	++YYCURSOR;
#line 48 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ if(eof()) return 0; step(); goto start; }
#line 120 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy6:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'i':	goto yy57;
	case 's':	goto yy56;
	default:	goto yy7;
	}
yy7:
#line 70 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ lexerError(string(), log); goto start; }
#line 132 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy8:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '_':	goto yy54;
	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 yy52;
	default:	goto yy7;
	}
yy9:
	++YYCURSOR;
	yych = *YYCURSOR;
	goto yy53;
yy10:
#line 52 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ value.str = String(string()).c_str(); return GroundTermGrammar::parser::token::IDENTIFIER; }
#line 173 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy11:
	++YYCURSOR;
yy12:
#line 53 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ value.num = integer(); return GroundTermGrammar::parser::token::NUMBER; }
#line 179 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy13:
	yych = *++YYCURSOR;
	goto yy51;
yy14:
	yyaccept = 0;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case '\n':	goto yy7;
	default:	goto yy45;
	}
yy15:
	++YYCURSOR;
#line 56 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::LPAREN; }
#line 194 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy17:
	++YYCURSOR;
#line 57 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::RPAREN; }
#line 199 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy19:
	++YYCURSOR;
#line 58 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::ADD; }
#line 204 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy21:
	++YYCURSOR;
#line 59 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::SUB; }
#line 209 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy23:
	++YYCURSOR;
	switch ((yych = *YYCURSOR)) {
	case '*':	goto yy42;
	default:	goto yy24;
	}
yy24:
#line 62 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::MUL; }
#line 219 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy25:
	++YYCURSOR;
#line 61 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::MOD; }
#line 224 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy27:
	++YYCURSOR;
#line 63 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::SLASH; }
#line 229 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy29:
	++YYCURSOR;
#line 64 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::AND; }
#line 234 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy31:
	++YYCURSOR;
#line 65 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::XOR; }
#line 239 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy33:
	++YYCURSOR;
#line 66 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::BNOT; }
#line 244 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy35:
	++YYCURSOR;
#line 67 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::QUESTION; }
#line 249 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy37:
	++YYCURSOR;
#line 68 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::COMMA; }
#line 254 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy39:
	++YYCURSOR;
#line 69 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::VBAR; }
#line 259 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy41:
	yych = *++YYCURSOR;
	goto yy7;
yy42:
	++YYCURSOR;
#line 60 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::POW; }
#line 267 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy44:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy45:
	switch (yych) {
	case '\n':	goto yy46;
	case '"':	goto yy48;
	case '\\':	goto yy47;
	default:	goto yy44;
	}
yy46:
	YYCURSOR = YYMARKER;
	switch (yyaccept) {
	case 0: 	goto yy7;
	case 1: 	goto yy60;
	case 2: 	goto yy67;
	}
yy47:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '"':
	case '\\':
	case 'n':	goto yy44;
	default:	goto yy46;
	}
yy48:
	++YYCURSOR;
#line 54 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ value.str = String(unquote(string(1, 1)).c_str()).c_str(); return GroundTermGrammar::parser::token::STRING; }
#line 300 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy50:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy51:
	switch (yych) {
	case '0':
	case '1':
	case '2':
	case '3':
	case '4':
	case '5':
	case '6':
	case '7':
	case '8':
	case '9':	goto yy50;
	default:	goto yy12;
	}
yy52:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy53:
	switch (yych) {
	case '\'':
	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 yy52;
	default:	goto yy10;
	}
yy54:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
	case '_':	goto yy54;
	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 yy52;
	default:	goto yy46;
	}
yy56:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'u':	goto yy65;
	default:	goto yy46;
	}
yy57:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'n':	goto yy58;
	default:	goto yy46;
	}
yy58:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'f':	goto yy59;
	default:	goto yy46;
	}
yy59:
	yyaccept = 1;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'i':	goto yy61;
	default:	goto yy60;
	}
yy60:
#line 49 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::INFIMUM; }
#line 453 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy61:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'm':	goto yy62;
	default:	goto yy46;
	}
yy62:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'u':	goto yy63;
	default:	goto yy46;
	}
yy63:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'm':	goto yy64;
	default:	goto yy46;
	}
yy64:
	yych = *++YYCURSOR;
	goto yy60;
yy65:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'p':	goto yy66;
	default:	goto yy46;
	}
yy66:
	yyaccept = 2;
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
	case 'r':	goto yy68;
	default:	goto yy67;
	}
yy67:
#line 50 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"
	{ return GroundTermGrammar::parser::token::SUPREMUM; }
#line 491 "/tmp/clingo-release/build/debug/libgringo//src/input/groundtermlexer.hh"
yy68:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'e':	goto yy69;
	default:	goto yy46;
	}
yy69:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'm':	goto yy70;
	default:	goto yy46;
	}
yy70:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'u':	goto yy71;
	default:	goto yy46;
	}
yy71:
	yych = *++YYCURSOR;
	switch (yych) {
	case 'm':	goto yy72;
	default:	goto yy46;
	}
yy72:
	yych = *++YYCURSOR;
	goto yy67;
yy73:
	++YYCURSOR;
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
yy74:
	switch (yych) {
	case '\t':
	case '\r':
	case ' ':	goto yy73;
	default:	goto yy2;
	}
}
#line 71 "/tmp/clingo-release/libgringo//src/input/groundtermlexer.xh"

    assert(false);
    return 0;
}

#undef YYCTYPE
#undef YYCURSOR
#undef YYLIMIT
#undef YYMARKER
#undef YYFILL
