public final JPoclASTParser.expr4_return expr4() throws RecognitionException {
        JPoclASTParser.expr4_return retval = new JPoclASTParser.expr4_return();
        retval.start = input.LT(1);


        TypeTree root_0 = null;

        Token char_literal93=null;
        Token char_literal94=null;
        JPoclASTParser.expr5_return expr592 =null;

        JPoclASTParser.expr2b_return expr2b95 =null;


        TypeTree char_literal93_tree=null;
        TypeTree char_literal94_tree=null;
        RewriteRuleTokenStream stream_21=new RewriteRuleTokenStream(adaptor,"token 21");
        RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");
        RewriteRuleSubtreeStream stream_expr2b=new RewriteRuleSubtreeStream(adaptor,"rule expr2b");
        RewriteRuleSubtreeStream stream_expr5=new RewriteRuleSubtreeStream(adaptor,"rule expr5");
        try {
            // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:7: ( ( expr5 -> expr5 ) ( ( '!' -> ^( '!' $expr4) )* '^' expr2b -> ^( '^' $expr4 expr2b ) )? )
            // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:9: ( expr5 -> expr5 ) ( ( '!' -> ^( '!' $expr4) )* '^' expr2b -> ^( '^' $expr4 expr2b ) )?
            {
            // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:9: ( expr5 -> expr5 )
            // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:10: expr5
            {
            pushFollow(FOLLOW_expr5_in_expr4970);
            expr592=expr5();

            state._fsp--;

            stream_expr5.add(expr592.getTree());

            // AST REWRITE
            // elements: expr5
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (TypeTree)adaptor.nil();
            // 117:16: -> expr5
            {
                adaptor.addChild(root_0, stream_expr5.nextTree());

            }


            retval.tree = root_0;

            }


            // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:26: ( ( '!' -> ^( '!' $expr4) )* '^' expr2b -> ^( '^' $expr4 expr2b ) )?
            int alt22=2;
            alt22 = dfa22.predict(input);
            switch (alt22) {
                case 1 :
                    // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:27: ( '!' -> ^( '!' $expr4) )* '^' expr2b
                    {
                    // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:27: ( '!' -> ^( '!' $expr4) )*
                    loop21:
                    do {
                        int alt21=2;
                        int LA21_0 = input.LA(1);

                        if ( (LA21_0==21) ) {
                            alt21=1;
                        }


                        switch (alt21) {
                    	case 1 :
                    	    // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:28: '!'
                    	    {
                    	    char_literal93=(Token)match(input,21,FOLLOW_21_in_expr4979);  
                    	    stream_21.add(char_literal93);


                    	    // AST REWRITE
                    	    // elements: 21, expr4
                    	    // token labels: 
                    	    // rule labels: retval
                    	    // token list labels: 
                    	    // rule list labels: 
                    	    // wildcard labels: 
                    	    retval.tree = root_0;
                    	    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    	    root_0 = (TypeTree)adaptor.nil();
                    	    // 117:32: -> ^( '!' $expr4)
                    	    {
                    	        // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:35: ^( '!' $expr4)
                    	        {
                    	        TypeTree root_1 = (TypeTree)adaptor.nil();
                    	        root_1 = (TypeTree)adaptor.becomeRoot(
                    	        stream_21.nextNode()
                    	        , root_1);

                    	        adaptor.addChild(root_1, stream_retval.nextTree());

                    	        adaptor.addChild(root_0, root_1);
                    	        }

                    	    }


                    	    retval.tree = root_0;

                    	    }
                    	    break;

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


                    char_literal94=(Token)match(input,38,FOLLOW_38_in_expr4992);  
                    stream_38.add(char_literal94);


                    pushFollow(FOLLOW_expr2b_in_expr4994);
                    expr2b95=expr2b();

                    state._fsp--;

                    stream_expr2b.add(expr2b95.getTree());

                    // AST REWRITE
                    // elements: expr4, expr2b, 38
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (TypeTree)adaptor.nil();
                    // 117:62: -> ^( '^' $expr4 expr2b )
                    {
                        // C:\\Users\\pc\\Desktop\\IPL\\ew\\JPocl\\JPoclAST.g:117:65: ^( '^' $expr4 expr2b )
                        {
                        TypeTree root_1 = (TypeTree)adaptor.nil();
                        root_1 = (TypeTree)adaptor.becomeRoot(
                        stream_38.nextNode()
                        , root_1);

                        adaptor.addChild(root_1, stream_retval.nextTree());

                        adaptor.addChild(root_1, stream_expr2b.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (TypeTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }

        catch (RecognitionException re) {
        	reportError(re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }