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

// Expect a null-terminated string.
private int lex(const(char)* yycursor) {
    uint count = 0;

    for (;;) {
    
#line 13 "d/eof/01_sentinel.d"
{
    char yych;
    yych = *yycursor;
    switch (yych) {
        case 0x00: goto yy1;
        case ' ': goto yy3;
        case 'a': .. case 'z': goto yy5;
        default: goto yy2;
    }
yy1:
    ++yycursor;
#line 14 "d/eof/01_sentinel.re"
    { return count; }
#line 27 "d/eof/01_sentinel.d"
yy2:
    ++yycursor;
#line 13 "d/eof/01_sentinel.re"
    { return -1; }
#line 32 "d/eof/01_sentinel.d"
yy3:
    yych = *++yycursor;
    switch (yych) {
        case ' ': goto yy3;
        default: goto yy4;
    }
yy4:
#line 16 "d/eof/01_sentinel.re"
    { continue; }
#line 42 "d/eof/01_sentinel.d"
yy5:
    yych = *++yycursor;
    switch (yych) {
        case 'a': .. case 'z': goto yy5;
        default: goto yy6;
    }
yy6:
#line 15 "d/eof/01_sentinel.re"
    { ++count; continue; }
#line 52 "d/eof/01_sentinel.d"
}
#line 17 "d/eof/01_sentinel.re"

    }
    assert(0); // unreachable
}

void main() {
    assert(lex("") == 0);
    assert(lex("one two three") == 3);
    assert(lex("f0ur") == -1);
}
