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

        CommonTree ID2=null;
        ANTLRv3TreeFilter.altList_return al = null;


        try {
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:108:2: ( ^( RULE ID ( modifier )? ( ^( ARG ARG_ACTION ) )? ( ^( RET ARG_ACTION ) )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* al= altList ( exceptionGroup )? EOR ) -> rule(id=$IDbody=al))
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:108:4: ^( RULE ID ( modifier )? ( ^( ARG ARG_ACTION ) )? ( ^( RET ARG_ACTION ) )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* al= altList ( exceptionGroup )? EOR )
            {
            match(input,RULE,FOLLOW_RULE_in_rule431); 

            match(input, Token.DOWN, null); 
            ID2=(CommonTree)match(input,ID,FOLLOW_ID_in_rule433); 
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:7: ( modifier )?
            int alt12=2;
            int LA12_0 = input.LA(1);

            if ( (LA12_0==FRAGMENT||(LA12_0>=75 && LA12_0<=77)) ) {
                alt12=1;
            }
            switch (alt12) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:7: modifier
                    {
                    pushFollow(FOLLOW_modifier_in_rule450);
                    modifier();

                    state._fsp--;


                    }
                    break;

            }

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:17: ( ^( ARG ARG_ACTION ) )?
            int alt13=2;
            int LA13_0 = input.LA(1);

            if ( (LA13_0==ARG) ) {
                alt13=1;
            }
            switch (alt13) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:18: ^( ARG ARG_ACTION )
                    {
                    match(input,ARG,FOLLOW_ARG_in_rule455); 

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

                    match(input, Token.UP, null); 

                    }
                    break;

            }

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:38: ( ^( RET ARG_ACTION ) )?
            int alt14=2;
            int LA14_0 = input.LA(1);

            if ( (LA14_0==RET) ) {
                alt14=1;
            }
            switch (alt14) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:110:39: ^( RET ARG_ACTION )
                    {
                    match(input,RET,FOLLOW_RET_in_rule464); 

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

                    match(input, Token.UP, null); 

                    }
                    break;

            }

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:7: ( optionsSpec )?
            int alt15=2;
            int LA15_0 = input.LA(1);

            if ( (LA15_0==OPTIONS) ) {
                alt15=1;
            }
            switch (alt15) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:7: optionsSpec
                    {
                    pushFollow(FOLLOW_optionsSpec_in_rule477);
                    optionsSpec();

                    state._fsp--;


                    }
                    break;

            }

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:20: ( ruleScopeSpec )?
            int alt16=2;
            int LA16_0 = input.LA(1);

            if ( (LA16_0==SCOPE) ) {
                alt16=1;
            }
            switch (alt16) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:20: ruleScopeSpec
                    {
                    pushFollow(FOLLOW_ruleScopeSpec_in_rule480);
                    ruleScopeSpec();

                    state._fsp--;


                    }
                    break;

            }

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:35: ( ruleAction )*
            loop17:
            do {
                int alt17=2;
                int LA17_0 = input.LA(1);

                if ( (LA17_0==72) ) {
                    alt17=1;
                }


                switch (alt17) {
            	case 1 :
            	    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:111:35: ruleAction
            	    {
            	    pushFollow(FOLLOW_ruleAction_in_rule483);
            	    ruleAction();

            	    state._fsp--;


            	    }
            	    break;

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

            pushFollow(FOLLOW_altList_in_rule501);
            al=altList();

            state._fsp--;

            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:115:8: ( exceptionGroup )?
            int alt18=2;
            int LA18_0 = input.LA(1);

            if ( ((LA18_0>=85 && LA18_0<=86)) ) {
                alt18=1;
            }
            switch (alt18) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:115:8: exceptionGroup
                    {
                    pushFollow(FOLLOW_exceptionGroup_in_rule518);
                    exceptionGroup();

                    state._fsp--;


                    }
                    break;

            }

            match(input,EOR,FOLLOW_EOR_in_rule528); 

            match(input, Token.UP, null); 


            // TEMPLATE REWRITE
            // 119:4: -> rule(id=$IDbody=al)
            {
                retval.st = templateLib.getInstanceOf("rule",
              new STAttrMap().put("id", ID2).put("body", al));
            }


            }

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