public final ANTLRv3TreeFilter.rewrite_tree_element_return rewrite_tree_element() throws RecognitionException {
        ANTLRv3TreeFilter.rewrite_tree_element_return retval = new ANTLRv3TreeFilter.rewrite_tree_element_return();
        retval.start = input.LT(1);

        try {
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:437:2: ( rewrite_tree_atom | rewrite_tree | rewrite_tree_block | rewrite_tree_ebnf )
            int alt45=4;
            switch ( input.LA(1) ) {
            case LABEL:
            case TOKEN_REF:
            case STRING_LITERAL:
            case CHAR_LITERAL:
            case ACTION:
            case RULE_REF:
                {
                alt45=1;
                }
                break;
            case TREE_BEGIN:
                {
                alt45=2;
                }
                break;
            case BLOCK:
                {
                alt45=3;
                }
                break;
            case OPTIONAL:
            case CLOSURE:
            case POSITIVE_CLOSURE:
                {
                alt45=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 45, 0, input);

                throw nvae;
            }

            switch (alt45) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:437:4: rewrite_tree_atom
                    {
                    pushFollow(FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2220);
                    rewrite_tree_atom();

                    state._fsp--;


                    }
                    break;
                case 2 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:438:4: rewrite_tree
                    {
                    pushFollow(FOLLOW_rewrite_tree_in_rewrite_tree_element2225);
                    rewrite_tree();

                    state._fsp--;


                    }
                    break;
                case 3 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:439:6: rewrite_tree_block
                    {
                    pushFollow(FOLLOW_rewrite_tree_block_in_rewrite_tree_element2232);
                    rewrite_tree_block();

                    state._fsp--;


                    }
                    break;
                case 4 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:440:6: rewrite_tree_ebnf
                    {
                    pushFollow(FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2239);
                    rewrite_tree_ebnf();

                    state._fsp--;


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }