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

        try {
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:444:5: ( CHAR_LITERAL | TOKEN_REF | ^( TOKEN_REF ARG_ACTION ) | RULE_REF | STRING_LITERAL | LABEL | ACTION )
            int alt46=7;
            switch ( input.LA(1) ) {
            case CHAR_LITERAL:
                {
                alt46=1;
                }
                break;
            case TOKEN_REF:
                {
                int LA46_2 = input.LA(2);

                if ( (LA46_2==DOWN) ) {
                    alt46=3;
                }
                else if ( (LA46_2==UP||(LA46_2>=BLOCK && LA46_2<=POSITIVE_CLOSURE)||LA46_2==EOA||LA46_2==LABEL||LA46_2==TREE_BEGIN||(LA46_2>=TOKEN_REF && LA46_2<=ACTION)||LA46_2==RULE_REF) ) {
                    alt46=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 46, 2, input);

                    throw nvae;
                }
                }
                break;
            case RULE_REF:
                {
                alt46=4;
                }
                break;
            case STRING_LITERAL:
                {
                alt46=5;
                }
                break;
            case LABEL:
                {
                alt46=6;
                }
                break;
            case ACTION:
                {
                alt46=7;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 46, 0, input);

                throw nvae;
            }

            switch (alt46) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:444:9: CHAR_LITERAL
                    {
                    match(input,CHAR_LITERAL,FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2255); 

                    }
                    break;
                case 2 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:445:6: TOKEN_REF
                    {
                    match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewrite_tree_atom2262); 

                    }
                    break;
                case 3 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:446:6: ^( TOKEN_REF ARG_ACTION )
                    {
                    match(input,TOKEN_REF,FOLLOW_TOKEN_REF_in_rewrite_tree_atom2270); 

                    match(input, Token.DOWN, null); 
                    match(input,ARG_ACTION,FOLLOW_ARG_ACTION_in_rewrite_tree_atom2272); 

                    match(input, Token.UP, null); 

                    }
                    break;
                case 4 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:447:9: RULE_REF
                    {
                    match(input,RULE_REF,FOLLOW_RULE_REF_in_rewrite_tree_atom2284); 

                    }
                    break;
                case 5 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:448:6: STRING_LITERAL
                    {
                    match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2291); 

                    }
                    break;
                case 6 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:449:6: LABEL
                    {
                    match(input,LABEL,FOLLOW_LABEL_in_rewrite_tree_atom2298); 

                    }
                    break;
                case 7 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:450:4: ACTION
                    {
                    match(input,ACTION,FOLLOW_ACTION_in_rewrite_tree_atom2303); 

                    }
                    break;

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