/* Generated by re2c 3.1 on Tue Dec  3 10:42:26 2024 */
#line 1 "/home/kaminski/Documents/git/potassco/clingo/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 44 "/home/kaminski/Documents/git/potassco/clingo/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 "/home/kaminski/Documents/git/potassco/clingo/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 yy5;
            case '"':
                goto yy6;
            case '#':
                goto yy7;
            case '&':
                goto yy8;
            case '\'':
            case '_':
                goto yy9;
            case '(':
                goto yy10;
            case ')':
                goto yy11;
            case '*':
                goto yy12;
            case '+':
                goto yy14;
            case ',':
                goto yy15;
            case '-':
                goto yy16;
            case '/':
                goto yy17;
            case '0':
                goto yy18;
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                goto yy20;
            case '?':
                goto yy21;
            case '\\':
                goto yy22;
            case '^':
                goto yy23;
            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 yy24;
            case '|':
                goto yy26;
            case '~':
                goto yy27;
            default:
                goto yy1;
        }
    yy1:
        ++YYCURSOR;
    yy2:
#line 74 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        lexerError(string(), log);
        goto start;
    }
#line 114 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy3:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '\t':
            case '\r':
            case ' ':
                goto yy3;
            default:
                goto yy4;
        }
    yy4:
#line 51 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        goto start;
    }
#line 128 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy5:
        ++YYCURSOR;
#line 52 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        {
            if (eof())
                return 0;
            step();
            goto start;
        }
#line 133 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy6:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case '\n':
                goto yy2;
            default:
                goto yy29;
        }
    yy7:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case 'i':
                goto yy33;
            case 's':
                goto yy34;
            default:
                goto yy2;
        }
    yy8:
        ++YYCURSOR;
#line 68 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::AND; }
#line 153 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy9:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case '\'':
            case '_':
                goto yy35;
            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 yy24;
            default:
                goto yy2;
        }
    yy10:
        ++YYCURSOR;
#line 60 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::LPAREN; }
#line 192 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy11:
        ++YYCURSOR;
#line 61 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::RPAREN; }
#line 197 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy12:
        yych = *++YYCURSOR;
        switch (yych) {
            case '*':
                goto yy36;
            default:
                goto yy13;
        }
    yy13:
#line 66 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        return GroundTermGrammar::parser::token::MUL;
    }
#line 207 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy14:
        ++YYCURSOR;
#line 62 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::ADD; }
#line 212 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy15:
        ++YYCURSOR;
#line 72 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::COMMA; }
#line 217 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy16:
        ++YYCURSOR;
#line 63 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::SUB; }
#line 222 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy17:
        ++YYCURSOR;
#line 67 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::SLASH; }
#line 227 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy18:
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case 'b':
                goto yy37;
            case 'o':
                goto yy38;
            case 'x':
                goto yy39;
            default:
                goto yy19;
        }
    yy19:
#line 57 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        value.num = clingo_number();
        return GroundTermGrammar::parser::token::NUMBER;
    }
#line 240 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy20:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                goto yy20;
            default:
                goto yy19;
        }
    yy21:
        ++YYCURSOR;
#line 71 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::QUESTION; }
#line 262 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy22:
        ++YYCURSOR;
#line 65 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::MOD; }
#line 267 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy23:
        ++YYCURSOR;
#line 69 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::XOR; }
#line 272 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy24:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        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 yy24;
            default:
                goto yy25;
        }
    yy25:
#line 56 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        value.str = String(string()).c_str();
        return GroundTermGrammar::parser::token::IDENTIFIER;
    }
#line 347 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy26:
        ++YYCURSOR;
#line 73 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::VBAR; }
#line 352 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy27:
        ++YYCURSOR;
#line 70 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::BNOT; }
#line 357 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy28:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
    yy29:
        switch (yych) {
            case '\n':
                goto yy30;
            case '"':
                goto yy31;
            case '\\':
                goto yy32;
            default:
                goto yy28;
        }
    yy30:
        YYCURSOR = YYMARKER;
        switch (yyaccept) {
            case 0:
                goto yy2;
            case 1:
                goto yy19;
            case 2:
                goto yy46;
            default:
                goto yy48;
        }
    yy31:
        ++YYCURSOR;
#line 58 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        {
            value.str = String(unquote(string(1, 1)).c_str()).c_str();
            return GroundTermGrammar::parser::token::STRING;
        }
#line 381 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy32:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '"':
            case '\\':
            case 'n':
                goto yy28;
            default:
                goto yy30;
        }
    yy33:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'n':
                goto yy40;
            default:
                goto yy30;
        }
    yy34:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'u':
                goto yy41;
            default:
                goto yy30;
        }
    yy35:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '\'':
            case '_':
                goto yy35;
            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 yy24;
            default:
                goto yy30;
        }
    yy36:
        ++YYCURSOR;
#line 64 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
        { return GroundTermGrammar::parser::token::POW; }
#line 443 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy37:
        yych = *++YYCURSOR;
        switch (yych) {
            case '0':
            case '1':
                goto yy42;
            default:
                goto yy30;
        }
    yy38:
        yych = *++YYCURSOR;
        switch (yych) {
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
                goto yy43;
            default:
                goto yy30;
        }
    yy39:
        yych = *++YYCURSOR;
        switch (yych) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
            case 'A':
            case 'B':
            case 'C':
            case 'D':
            case 'E':
            case 'F':
            case 'a':
            case 'b':
            case 'c':
            case 'd':
            case 'e':
            case 'f':
                goto yy44;
            default:
                goto yy30;
        }
    yy40:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'f':
                goto yy45;
            default:
                goto yy30;
        }
    yy41:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'p':
                goto yy47;
            default:
                goto yy30;
        }
    yy42:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '0':
            case '1':
                goto yy42;
            default:
                goto yy19;
        }
    yy43:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
                goto yy43;
            default:
                goto yy19;
        }
    yy44:
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR)
            YYFILL(1);
        yych = *YYCURSOR;
        switch (yych) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
            case 'A':
            case 'B':
            case 'C':
            case 'D':
            case 'E':
            case 'F':
            case 'a':
            case 'b':
            case 'c':
            case 'd':
            case 'e':
            case 'f':
                goto yy44;
            default:
                goto yy19;
        }
    yy45:
        yyaccept = 2;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case 'i':
                goto yy49;
            default:
                goto yy46;
        }
    yy46:
#line 53 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        return GroundTermGrammar::parser::token::INFIMUM;
    }
#line 564 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy47:
        yyaccept = 3;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
            case 'r':
                goto yy50;
            default:
                goto yy48;
        }
    yy48:
#line 54 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"
    {
        return GroundTermGrammar::parser::token::SUPREMUM;
    }
#line 575 "/home/kaminski/Documents/git/potassco/clingo/build/debug/libgringo//src/input/groundtermlexer.hh"
    yy49:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'm':
                goto yy51;
            default:
                goto yy30;
        }
    yy50:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'e':
                goto yy52;
            default:
                goto yy30;
        }
    yy51:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'u':
                goto yy53;
            default:
                goto yy30;
        }
    yy52:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'm':
                goto yy54;
            default:
                goto yy30;
        }
    yy53:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'm':
                goto yy55;
            default:
                goto yy30;
        }
    yy54:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'u':
                goto yy56;
            default:
                goto yy30;
        }
    yy55:
        ++YYCURSOR;
        goto yy46;
    yy56:
        yych = *++YYCURSOR;
        switch (yych) {
            case 'm':
                goto yy57;
            default:
                goto yy30;
        }
    yy57:
        ++YYCURSOR;
        goto yy48;
    }
#line 75 "/home/kaminski/Documents/git/potassco/clingo/libgringo//src/input/groundtermlexer.xh"

    assert(false);
    return 0;
}

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