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

        ANTLRv3TreeFilter.block_return block13 = null;

        ANTLRv3TreeFilter.block_return block14 = null;

        ANTLRv3TreeFilter.block_return block15 = null;


        try {
            // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:327:2: ( ^( SYNPRED block ) -> {%{\"[>SYNPRED<]\"}} | SYN_SEMPRED -> {%{\"[>SYN_SEMPRED<]\"}} | ^( OPTIONAL block ) -> opt(block=$block.st) | ^( CLOSURE block ) -> star(block=$block.st) | ^( POSITIVE_CLOSURE block ) -> {%{\"[>POSITIVE_CLOSURE block<]\"}} | block -> {$block.st})
            int alt38=6;
            switch ( input.LA(1) ) {
            case SYNPRED:
                {
                alt38=1;
                }
                break;
            case SYN_SEMPRED:
                {
                alt38=2;
                }
                break;
            case OPTIONAL:
                {
                alt38=3;
                }
                break;
            case CLOSURE:
                {
                alt38=4;
                }
                break;
            case POSITIVE_CLOSURE:
                {
                alt38=5;
                }
                break;
            case BLOCK:
                {
                alt38=6;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 38, 0, input);

                throw nvae;
            }

            switch (alt38) {
                case 1 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:327:4: ^( SYNPRED block )
                    {
                    match(input,SYNPRED,FOLLOW_SYNPRED_in_ebnf1705); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_block_in_ebnf1707);
                    block();

                    state._fsp--;


                    match(input, Token.UP, null); 


                    // TEMPLATE REWRITE
                    // 329:5: -> {%{\"[>SYNPRED<]\"}}
                    {
                        retval.st = new StringTemplate(templateLib,"[>SYNPRED<]");
                    }


                    }
                    break;
                case 2 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:331:4: SYN_SEMPRED
                    {
                    match(input,SYN_SEMPRED,FOLLOW_SYN_SEMPRED_in_ebnf1723); 


                    // TEMPLATE REWRITE
                    // 333:5: -> {%{\"[>SYN_SEMPRED<]\"}}
                    {
                        retval.st = new StringTemplate(templateLib,"[>SYN_SEMPRED<]");
                    }


                    }
                    break;
                case 3 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:335:5: ^( OPTIONAL block )
                    {
                    match(input,OPTIONAL,FOLLOW_OPTIONAL_in_ebnf1740); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_block_in_ebnf1742);
                    block13=block();

                    state._fsp--;


                    match(input, Token.UP, null); 


                    // TEMPLATE REWRITE
                    // 337:5: -> opt(block=$block.st)
                    {
                        retval.st = templateLib.getInstanceOf("opt",
                      new STAttrMap().put("block", (block13!=null?block13.st:null)));
                    }


                    }
                    break;
                case 4 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:341:5: ^( CLOSURE block )
                    {
                    match(input,CLOSURE,FOLLOW_CLOSURE_in_ebnf1779); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_block_in_ebnf1781);
                    block14=block();

                    state._fsp--;


                    match(input, Token.UP, null); 


                    // TEMPLATE REWRITE
                    // 343:5: -> star(block=$block.st)
                    {
                        retval.st = templateLib.getInstanceOf("star",
                      new STAttrMap().put("block", (block14!=null?block14.st:null)));
                    }


                    }
                    break;
                case 5 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:347:5: ^( POSITIVE_CLOSURE block )
                    {
                    match(input,POSITIVE_CLOSURE,FOLLOW_POSITIVE_CLOSURE_in_ebnf1818); 

                    match(input, Token.DOWN, null); 
                    pushFollow(FOLLOW_block_in_ebnf1820);
                    block();

                    state._fsp--;


                    match(input, Token.UP, null); 
                     if (true) throw new UnsupportedSyntaxException("Positive closures not supported (yet)."); 


                    // TEMPLATE REWRITE
                    // 351:5: -> {%{\"[>POSITIVE_CLOSURE block<]\"}}
                    {
                        retval.st = new StringTemplate(templateLib,"[>POSITIVE_CLOSURE block<]");
                    }


                    }
                    break;
                case 6 :
                    // back-end/koopa/trees/antlr/filter/generator/ANTLRv3TreeFilter.g:353:4: block
                    {
                    pushFollow(FOLLOW_block_in_ebnf1843);
                    block15=block();

                    state._fsp--;



                    // TEMPLATE REWRITE
                    // 355:5: -> {$block.st}
                    {
                        retval.st = (block15!=null?block15.st:null);
                    }


                    }
                    break;

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