// Generated by re2java
// re2java $INPUT -o $OUTPUT



class Main {
    static final int YYMAXNMATCH = 3;


    static int lex_tags(String str) {
        int cur = 0, mar = 0, x, y;
        int yyt1 = -1;
int yyt2 = -1;

        
{
    char yych = 0;
    int yystate = 0;
    yyl: while (true) {
        switch (yystate) {
            case 0:
                mar = cur;
                yych = str.charAt(cur);
                switch (yych) {
                    case 0x62:
                        cur += 1;
                        yystate = 2;
                        continue yyl;
                    default:
                        yyt1 = -1;
                        yystate = 1;
                        continue yyl;
                }
            case 1:
                y = yyt1;
                x = yyt1;
                yyt1 = -1;
                if (x != yyt1) x += -1;
                { return (x == -1) ? -1 : y - x; }
            case 2:
                yych = str.charAt(cur);
                switch (yych) {
                    case 0x61:
                        cur += 1;
                        yystate = 4;
                        continue yyl;
                    default:
                        yystate = 3;
                        continue yyl;
                }
            case 3:
                cur = mar;
                yyt1 = -1;
                yystate = 1;
                continue yyl;
            case 4:
                yyt1 = cur;
                yystate = 1;
                continue yyl;
            default:
                throw new IllegalStateException("internal lexer error");
        }
    }
}

    }

    static int lex_captures(String str) {
        int cur = 0, yynmatch;
        int[] yypmatch = new int[YYMAXNMATCH * 2];
        int yyt1 = -1;
int yyt2 = -1;

        
{
    char yych = 0;
    int yystate = 0;
    yyl: while (true) {
        switch (yystate) {
            case 0:
                yych = str.charAt(cur);
                switch (yych) {
                    case 0x61:
                        yyt1 = cur;
                        cur += 1;
                        yystate = 2;
                        continue yyl;
                    default:
                        yyt1 = cur;
                        yyt2 = -1;
                        yystate = 1;
                        continue yyl;
                }
            case 1:
                yynmatch = 3;
                yypmatch[0] = yyt1;
                yypmatch[3] = yyt2;
                yypmatch[5] = yyt2;
                yypmatch[1] = cur;
                yypmatch[2] = yyt2;
                yyt2 = -1;
                if (yypmatch[2] != yyt2) yypmatch[2] += -1;
                yypmatch[4] = yypmatch[2];
                { return yypmatch[4]; }
            case 2:
                yyt2 = cur;
                yystate = 1;
                continue yyl;
            default:
                throw new IllegalStateException("internal lexer error");
        }
    }
}

    }

    public static void main(String []args) {
        assert lex_tags("\0") == -1;
        assert lex_tags("ba\0") == 1;
        assert lex_captures("\0") == -1;
        assert lex_captures("a\0") == 0;
    }
};
codegen/java/nested_fixed_tags.re:24:29: warning: rule matches empty string [-Wmatch-empty-string]
codegen/java/nested_fixed_tags.re:34:21: warning: rule matches empty string [-Wmatch-empty-string]
