/* Generated by re2d */
#line 1 "d/reuse/usedir.re"
// re2d $INPUT -o $OUTPUT
module main;

// This example shows how to combine reusable re2c blocks: two blocks
// ('colors' and 'fish') are merged into one. The 'salmon' rule occurs
// in both blocks; the 'fish' block takes priority because it is used
// earlier. Default rule * occurs in all three blocks; the local (not
// inherited) definition takes priority.

enum What { COLOR, FISH, DUNNO };

#line 15 "d/reuse/usedir.re"


#line 20 "d/reuse/usedir.re"


private What lex(const(char)* s) {
    const(char)* yycursor = s, yymarker;
    
#line 24 "d/reuse/usedir.d"
{
    char yych;
    yych = *yycursor;
    switch (yych) {
        case 'e': goto yy3;
        case 'h': goto yy4;
        case 'm': goto yy5;
        case 'r': goto yy6;
        case 's': goto yy7;
        default: goto yy1;
    }
yy1:
    ++yycursor;
yy2:
#line 30 "d/reuse/usedir.re"
    { return What.DUNNO; }
#line 41 "d/reuse/usedir.d"
yy3:
    yych = *(yymarker = ++yycursor);
    switch (yych) {
        case 'e': goto yy8;
        default: goto yy2;
    }
yy4:
    yych = *(yymarker = ++yycursor);
    switch (yych) {
        case 'a': goto yy10;
        default: goto yy2;
    }
yy5:
    yych = *(yymarker = ++yycursor);
    switch (yych) {
        case 'a': goto yy11;
        default: goto yy2;
    }
yy6:
    yych = *(yymarker = ++yycursor);
    switch (yych) {
        case 'e': goto yy12;
        default: goto yy2;
    }
yy7:
    yych = *(yymarker = ++yycursor);
    switch (yych) {
        case 'a': goto yy13;
        default: goto yy2;
    }
yy8:
    yych = *++yycursor;
    switch (yych) {
        case 'l': goto yy14;
        default: goto yy9;
    }
yy9:
    yycursor = yymarker;
    goto yy2;
yy10:
    yych = *++yycursor;
    switch (yych) {
        case 'd': goto yy15;
        default: goto yy9;
    }
yy11:
    yych = *++yycursor;
    switch (yych) {
        case 'g': goto yy16;
        default: goto yy9;
    }
yy12:
    yych = *++yycursor;
    switch (yych) {
        case 'd': goto yy17;
        default: goto yy9;
    }
yy13:
    yych = *++yycursor;
    switch (yych) {
        case 'l': goto yy18;
        default: goto yy9;
    }
yy14:
    ++yycursor;
#line 19 "d/reuse/usedir.re"
    { return What.FISH; }
#line 109 "d/reuse/usedir.d"
yy15:
    yych = *++yycursor;
    switch (yych) {
        case 'd': goto yy19;
        default: goto yy9;
    }
yy16:
    yych = *++yycursor;
    switch (yych) {
        case 'e': goto yy20;
        default: goto yy9;
    }
yy17:
    ++yycursor;
#line 14 "d/reuse/usedir.re"
    { return What.COLOR; }
#line 126 "d/reuse/usedir.d"
yy18:
    yych = *++yycursor;
    switch (yych) {
        case 'm': goto yy21;
        default: goto yy9;
    }
yy19:
    yych = *++yycursor;
    switch (yych) {
        case 'o': goto yy22;
        default: goto yy9;
    }
yy20:
    yych = *++yycursor;
    switch (yych) {
        case 'n': goto yy23;
        default: goto yy9;
    }
yy21:
    yych = *++yycursor;
    switch (yych) {
        case 'o': goto yy24;
        default: goto yy9;
    }
yy22:
    yych = *++yycursor;
    switch (yych) {
        case 'c': goto yy25;
        default: goto yy9;
    }
yy23:
    yych = *++yycursor;
    switch (yych) {
        case 't': goto yy26;
        default: goto yy9;
    }
yy24:
    yych = *++yycursor;
    switch (yych) {
        case 'n': goto yy14;
        default: goto yy9;
    }
yy25:
    yych = *++yycursor;
    switch (yych) {
        case 'k': goto yy14;
        default: goto yy9;
    }
yy26:
    yych = *++yycursor;
    switch (yych) {
        case 'a': goto yy17;
        default: goto yy9;
    }
}
#line 31 "d/reuse/usedir.re"

}

void main() {
    assert(lex("salmon") == What.FISH);
    assert(lex("what?") == What.DUNNO);
}
