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

        try {
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:458:2: ( ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* ) )
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:458:4: ^( TREE_BEGIN rewrite_tree_atom ( rewrite_tree_element )* )
            {
            match(input,TREE_BEGIN,FOLLOW_TREE_BEGIN_in_rewrite_tree2331); 

            match(input, Token.DOWN, null); 
            pushFollow(FOLLOW_rewrite_tree_atom_in_rewrite_tree2333);
            rewrite_tree_atom();

            state._fsp--;

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:458:35: ( rewrite_tree_element )*
            loop47:
            do {
                int alt47=2;
                int LA47_0 = input.LA(1);

                if ( ((LA47_0>=BLOCK && LA47_0<=POSITIVE_CLOSURE)||LA47_0==LABEL||LA47_0==TREE_BEGIN||(LA47_0>=TOKEN_REF && LA47_0<=ACTION)||LA47_0==RULE_REF) ) {
                    alt47=1;
                }


                switch (alt47) {
            	case 1 :
            	    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:458:35: rewrite_tree_element
            	    {
            	    pushFollow(FOLLOW_rewrite_tree_element_in_rewrite_tree2335);
            	    rewrite_tree_element();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop47;
                }
            } while (true);


            match(input, Token.UP, null); 

            }

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