// $ANTLR start "compoundExpr"
    // Hql.g:613:1: compoundExpr : ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) );
    public HqlParser.compoundExpr_return compoundExpr() // throws RecognitionException [1]
    {   
        HqlParser.compoundExpr_return retval = new HqlParser.compoundExpr_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken OPEN281 = null;
        IToken COMMA284 = null;
        IToken CLOSE286 = null;
        HqlParser.collectionExpr_return collectionExpr279 = default(HqlParser.collectionExpr_return);

        HqlParser.path_return path280 = default(HqlParser.path_return);

        HqlParser.subQuery_return subQuery282 = default(HqlParser.subQuery_return);

        HqlParser.expression_return expression283 = default(HqlParser.expression_return);

        HqlParser.expression_return expression285 = default(HqlParser.expression_return);


        IASTNode OPEN281_tree=null;
        IASTNode COMMA284_tree=null;
        IASTNode CLOSE286_tree=null;

        try 
    	{
            // Hql.g:614:2: ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) )
            int alt102 = 3;
            switch ( input.LA(1) ) 
            {
            case ELEMENTS:
            case INDICES:
            	{
                alt102 = 1;
                }
                break;
            case IDENT:
            	{
                alt102 = 2;
                }
                break;
            case OPEN:
            	{
                alt102 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d102s0 =
            	        new NoViableAltException("", 102, 0, input);

            	    throw nvae_d102s0;
            }

            switch (alt102) 
            {
                case 1 :
                    // Hql.g:614:4: collectionExpr
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_collectionExpr_in_compoundExpr3334);
                    	collectionExpr279 = collectionExpr();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, collectionExpr279.Tree);

                    }
                    break;
                case 2 :
                    // Hql.g:615:4: path
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_path_in_compoundExpr3339);
                    	path280 = path();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, path280.Tree);

                    }
                    break;
                case 3 :
                    // Hql.g:616:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	// Hql.g:616:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    	// Hql.g:616:5: OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE
                    	{
                    		OPEN281=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_compoundExpr3345); 
                    		// Hql.g:616:11: ( subQuery | ( expression ( COMMA expression )* ) )
                    		int alt101 = 2;
                    		int LA101_0 = input.LA(1);

                    		if ( (LA101_0 == EOF || LA101_0 == FROM || (LA101_0 >= GROUP && LA101_0 <= HAVING) || LA101_0 == ORDER || LA101_0 == SELECT || LA101_0 == SKIP || LA101_0 == TAKE || LA101_0 == UNION || LA101_0 == WHERE || LA101_0 == CLOSE) )
                    		{
                    		    alt101 = 1;
                    		}
                    		else if ( ((LA101_0 >= ALL && LA101_0 <= ANY) || LA101_0 == AVG || LA101_0 == COUNT || LA101_0 == ELEMENTS || (LA101_0 >= EXISTS && LA101_0 <= FALSE) || LA101_0 == INDICES || (LA101_0 >= MAX && LA101_0 <= MIN) || (LA101_0 >= NOT && LA101_0 <= NULL) || (LA101_0 >= SOME && LA101_0 <= SUM) || LA101_0 == TRUE || LA101_0 == CASE || LA101_0 == EMPTY || (LA101_0 >= NUM_INT && LA101_0 <= NUM_LONG) || LA101_0 == OPEN || (LA101_0 >= COLON && LA101_0 <= PARAM) || LA101_0 == BNOT || (LA101_0 >= PLUS && LA101_0 <= MINUS) || (LA101_0 >= QUOTED_String && LA101_0 <= IDENT)) )
                    		{
                    		    alt101 = 2;
                    		}
                    		else 
                    		{
                    		    NoViableAltException nvae_d101s0 =
                    		        new NoViableAltException("", 101, 0, input);

                    		    throw nvae_d101s0;
                    		}
                    		switch (alt101) 
                    		{
                    		    case 1 :
                    		        // Hql.g:616:13: subQuery
                    		        {
                    		        	PushFollow(FOLLOW_subQuery_in_compoundExpr3350);
                    		        	subQuery282 = subQuery();
                    		        	state.followingStackPointer--;

                    		        	adaptor.AddChild(root_0, subQuery282.Tree);

                    		        }
                    		        break;
                    		    case 2 :
                    		        // Hql.g:616:24: ( expression ( COMMA expression )* )
                    		        {
                    		        	// Hql.g:616:24: ( expression ( COMMA expression )* )
                    		        	// Hql.g:616:25: expression ( COMMA expression )*
                    		        	{
                    		        		PushFollow(FOLLOW_expression_in_compoundExpr3355);
                    		        		expression283 = expression();
                    		        		state.followingStackPointer--;

                    		        		adaptor.AddChild(root_0, expression283.Tree);
                    		        		// Hql.g:616:36: ( COMMA expression )*
                    		        		do 
                    		        		{
                    		        		    int alt100 = 2;
                    		        		    int LA100_0 = input.LA(1);

                    		        		    if ( (LA100_0 == COMMA) )
                    		        		    {
                    		        		        alt100 = 1;
                    		        		    }


                    		        		    switch (alt100) 
                    		        			{
                    		        				case 1 :
                    		        				    // Hql.g:616:37: COMMA expression
                    		        				    {
                    		        				    	COMMA284=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_compoundExpr3358); 
                    		        				    	PushFollow(FOLLOW_expression_in_compoundExpr3361);
                    		        				    	expression285 = expression();
                    		        				    	state.followingStackPointer--;

                    		        				    	adaptor.AddChild(root_0, expression285.Tree);

                    		        				    }
                    		        				    break;

                    		        				default:
                    		        				    goto loop100;
                    		        		    }
                    		        		} while (true);

                    		        		loop100:
                    		        			;	// Stops C# compiler whining that label 'loop100' has no statements


                    		        	}


                    		        }
                    		        break;

                    		}

                    		CLOSE286=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_compoundExpr3368); 

                    	}


                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
Ejemplo n.º 2
0
    // $ANTLR start "compoundExpr"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:595:1: compoundExpr : ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) );
    public HqlParser.compoundExpr_return compoundExpr() // throws RecognitionException [1]
    {   
        HqlParser.compoundExpr_return retval = new HqlParser.compoundExpr_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken OPEN268 = null;
        IToken COMMA271 = null;
        IToken CLOSE273 = null;
        HqlParser.collectionExpr_return collectionExpr266 = default(HqlParser.collectionExpr_return);

        HqlParser.path_return path267 = default(HqlParser.path_return);

        HqlParser.subQuery_return subQuery269 = default(HqlParser.subQuery_return);

        HqlParser.expression_return expression270 = default(HqlParser.expression_return);

        HqlParser.expression_return expression272 = default(HqlParser.expression_return);


        IASTNode OPEN268_tree=null;
        IASTNode COMMA271_tree=null;
        IASTNode CLOSE273_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:596:2: ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) )
            int alt96 = 3;
            switch ( input.LA(1) ) 
            {
            case ELEMENTS:
            case INDICES:
            	{
                alt96 = 1;
                }
                break;
            case IDENT:
            	{
                alt96 = 2;
                }
                break;
            case OPEN:
            	{
                alt96 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d96s0 =
            	        new NoViableAltException("", 96, 0, input);

            	    throw nvae_d96s0;
            }

            switch (alt96) 
            {
                case 1 :
                    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:596:4: collectionExpr
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_collectionExpr_in_compoundExpr3235);
                    	collectionExpr266 = collectionExpr();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, collectionExpr266.Tree);

                    }
                    break;
                case 2 :
                    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:597:4: path
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_path_in_compoundExpr3240);
                    	path267 = path();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, path267.Tree);

                    }
                    break;
                case 3 :
                    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:5: OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE
                    	{
                    		OPEN268=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_compoundExpr3246); 
                    		// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:11: ( subQuery | ( expression ( COMMA expression )* ) )
                    		int alt95 = 2;
                    		int LA95_0 = input.LA(1);

                    		if ( (LA95_0 == EOF || LA95_0 == FROM || LA95_0 == GROUP || LA95_0 == ORDER || LA95_0 == SELECT || LA95_0 == UNION || LA95_0 == WHERE || LA95_0 == CLOSE) )
                    		{
                    		    alt95 = 1;
                    		}
                    		else if ( ((LA95_0 >= ALL && LA95_0 <= ANY) || LA95_0 == AVG || LA95_0 == COUNT || LA95_0 == ELEMENTS || (LA95_0 >= EXISTS && LA95_0 <= FALSE) || LA95_0 == INDICES || (LA95_0 >= MAX && LA95_0 <= MIN) || (LA95_0 >= NOT && LA95_0 <= NULL) || (LA95_0 >= SOME && LA95_0 <= TRUE) || LA95_0 == CASE || LA95_0 == EMPTY || (LA95_0 >= NUM_INT && LA95_0 <= NUM_LONG) || LA95_0 == OPEN || LA95_0 == BNOT || (LA95_0 >= PLUS && LA95_0 <= MINUS) || (LA95_0 >= COLON && LA95_0 <= IDENT)) )
                    		{
                    		    alt95 = 2;
                    		}
                    		else 
                    		{
                    		    NoViableAltException nvae_d95s0 =
                    		        new NoViableAltException("", 95, 0, input);

                    		    throw nvae_d95s0;
                    		}
                    		switch (alt95) 
                    		{
                    		    case 1 :
                    		        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:13: subQuery
                    		        {
                    		        	PushFollow(FOLLOW_subQuery_in_compoundExpr3251);
                    		        	subQuery269 = subQuery();
                    		        	state.followingStackPointer--;

                    		        	adaptor.AddChild(root_0, subQuery269.Tree);

                    		        }
                    		        break;
                    		    case 2 :
                    		        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:24: ( expression ( COMMA expression )* )
                    		        {
                    		        	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:24: ( expression ( COMMA expression )* )
                    		        	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:25: expression ( COMMA expression )*
                    		        	{
                    		        		PushFollow(FOLLOW_expression_in_compoundExpr3256);
                    		        		expression270 = expression();
                    		        		state.followingStackPointer--;

                    		        		adaptor.AddChild(root_0, expression270.Tree);
                    		        		// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:36: ( COMMA expression )*
                    		        		do 
                    		        		{
                    		        		    int alt94 = 2;
                    		        		    int LA94_0 = input.LA(1);

                    		        		    if ( (LA94_0 == COMMA) )
                    		        		    {
                    		        		        alt94 = 1;
                    		        		    }


                    		        		    switch (alt94) 
                    		        			{
                    		        				case 1 :
                    		        				    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:598:37: COMMA expression
                    		        				    {
                    		        				    	COMMA271=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_compoundExpr3259); 
                    		        				    	PushFollow(FOLLOW_expression_in_compoundExpr3262);
                    		        				    	expression272 = expression();
                    		        				    	state.followingStackPointer--;

                    		        				    	adaptor.AddChild(root_0, expression272.Tree);

                    		        				    }
                    		        				    break;

                    		        				default:
                    		        				    goto loop94;
                    		        		    }
                    		        		} while (true);

                    		        		loop94:
                    		        			;	// Stops C# compiler whining that label 'loop94' has no statements


                    		        	}


                    		        }
                    		        break;

                    		}

                    		CLOSE273=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_compoundExpr3269); 

                    	}


                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
Ejemplo n.º 3
0
    // $ANTLR start "compoundExpr"
    // Hql.g:608:1: compoundExpr : ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) );
    public HqlParser.compoundExpr_return compoundExpr() // throws RecognitionException [1]
    {   
        HqlParser.compoundExpr_return retval = new HqlParser.compoundExpr_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken OPEN275 = null;
        IToken COMMA278 = null;
        IToken CLOSE280 = null;
        HqlParser.collectionExpr_return collectionExpr273 = default(HqlParser.collectionExpr_return);

        HqlParser.path_return path274 = default(HqlParser.path_return);

        HqlParser.subQuery_return subQuery276 = default(HqlParser.subQuery_return);

        HqlParser.expression_return expression277 = default(HqlParser.expression_return);

        HqlParser.expression_return expression279 = default(HqlParser.expression_return);


        IASTNode OPEN275_tree=null;
        IASTNode COMMA278_tree=null;
        IASTNode CLOSE280_tree=null;

        try 
    	{
            // Hql.g:609:2: ( collectionExpr | path | ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE ) )
            int alt98 = 3;
            switch ( input.LA(1) ) 
            {
            case ELEMENTS:
            case INDICES:
            	{
                alt98 = 1;
                }
                break;
            case IDENT:
            	{
                alt98 = 2;
                }
                break;
            case OPEN:
            	{
                alt98 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d98s0 =
            	        new NoViableAltException("", 98, 0, input);

            	    throw nvae_d98s0;
            }

            switch (alt98) 
            {
                case 1 :
                    // Hql.g:609:4: collectionExpr
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_collectionExpr_in_compoundExpr3297);
                    	collectionExpr273 = collectionExpr();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, collectionExpr273.Tree);

                    }
                    break;
                case 2 :
                    // Hql.g:610:4: path
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_path_in_compoundExpr3302);
                    	path274 = path();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, path274.Tree);

                    }
                    break;
                case 3 :
                    // Hql.g:611:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	// Hql.g:611:4: ( OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE )
                    	// Hql.g:611:5: OPEN ( subQuery | ( expression ( COMMA expression )* ) ) CLOSE
                    	{
                    		OPEN275=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_compoundExpr3308); 
                    		// Hql.g:611:11: ( subQuery | ( expression ( COMMA expression )* ) )
                    		int alt97 = 2;
                    		int LA97_0 = input.LA(1);

                    		if ( (LA97_0 == EOF || LA97_0 == FROM || (LA97_0 >= GROUP && LA97_0 <= HAVING) || LA97_0 == ORDER || LA97_0 == SELECT || LA97_0 == SKIP || LA97_0 == TAKE || LA97_0 == UNION || LA97_0 == WHERE || LA97_0 == CLOSE) )
                    		{
                    		    alt97 = 1;
                    		}
                    		else if ( ((LA97_0 >= ALL && LA97_0 <= ANY) || LA97_0 == AVG || LA97_0 == COUNT || LA97_0 == ELEMENTS || (LA97_0 >= EXISTS && LA97_0 <= FALSE) || LA97_0 == INDICES || (LA97_0 >= MAX && LA97_0 <= MIN) || (LA97_0 >= NOT && LA97_0 <= NULL) || (LA97_0 >= SOME && LA97_0 <= SUM) || LA97_0 == TRUE || LA97_0 == CASE || LA97_0 == EMPTY || (LA97_0 >= NUM_INT && LA97_0 <= NUM_LONG) || LA97_0 == OPEN || LA97_0 == BNOT || (LA97_0 >= PLUS && LA97_0 <= MINUS) || (LA97_0 >= COLON && LA97_0 <= IDENT)) )
                    		{
                    		    alt97 = 2;
                    		}
                    		else 
                    		{
                    		    NoViableAltException nvae_d97s0 =
                    		        new NoViableAltException("", 97, 0, input);

                    		    throw nvae_d97s0;
                    		}
                    		switch (alt97) 
                    		{
                    		    case 1 :
                    		        // Hql.g:611:13: subQuery
                    		        {
                    		        	PushFollow(FOLLOW_subQuery_in_compoundExpr3313);
                    		        	subQuery276 = subQuery();
                    		        	state.followingStackPointer--;

                    		        	adaptor.AddChild(root_0, subQuery276.Tree);

                    		        }
                    		        break;
                    		    case 2 :
                    		        // Hql.g:611:24: ( expression ( COMMA expression )* )
                    		        {
                    		        	// Hql.g:611:24: ( expression ( COMMA expression )* )
                    		        	// Hql.g:611:25: expression ( COMMA expression )*
                    		        	{
                    		        		PushFollow(FOLLOW_expression_in_compoundExpr3318);
                    		        		expression277 = expression();
                    		        		state.followingStackPointer--;

                    		        		adaptor.AddChild(root_0, expression277.Tree);
                    		        		// Hql.g:611:36: ( COMMA expression )*
                    		        		do 
                    		        		{
                    		        		    int alt96 = 2;
                    		        		    int LA96_0 = input.LA(1);

                    		        		    if ( (LA96_0 == COMMA) )
                    		        		    {
                    		        		        alt96 = 1;
                    		        		    }


                    		        		    switch (alt96) 
                    		        			{
                    		        				case 1 :
                    		        				    // Hql.g:611:37: COMMA expression
                    		        				    {
                    		        				    	COMMA278=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_compoundExpr3321); 
                    		        				    	PushFollow(FOLLOW_expression_in_compoundExpr3324);
                    		        				    	expression279 = expression();
                    		        				    	state.followingStackPointer--;

                    		        				    	adaptor.AddChild(root_0, expression279.Tree);

                    		        				    }
                    		        				    break;

                    		        				default:
                    		        				    goto loop96;
                    		        		    }
                    		        		} while (true);

                    		        		loop96:
                    		        			;	// Stops C# compiler whining that label 'loop96' has no statements


                    		        	}


                    		        }
                    		        break;

                    		}

                    		CLOSE280=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_compoundExpr3331); 

                    	}


                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }