示例#1
0
    // $ANTLR start "subQuery"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:619:1: subQuery : innerSubQuery ( UNION innerSubQuery )* ;
    public HqlParser.subQuery_return subQuery() // throws RecognitionException [1]
    {   
        HqlParser.subQuery_return retval = new HqlParser.subQuery_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken UNION285 = null;
        HqlParser.innerSubQuery_return innerSubQuery284 = default(HqlParser.innerSubQuery_return);

        HqlParser.innerSubQuery_return innerSubQuery286 = default(HqlParser.innerSubQuery_return);


        IASTNode UNION285_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:620:2: ( innerSubQuery ( UNION innerSubQuery )* )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:620:4: innerSubQuery ( UNION innerSubQuery )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	PushFollow(FOLLOW_innerSubQuery_in_subQuery3414);
            	innerSubQuery284 = innerSubQuery();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, innerSubQuery284.Tree);
            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:620:18: ( UNION innerSubQuery )*
            	do 
            	{
            	    int alt101 = 2;
            	    int LA101_0 = input.LA(1);

            	    if ( (LA101_0 == UNION) )
            	    {
            	        alt101 = 1;
            	    }


            	    switch (alt101) 
            		{
            			case 1 :
            			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:620:19: UNION innerSubQuery
            			    {
            			    	UNION285=(IToken)Match(input,UNION,FOLLOW_UNION_in_subQuery3417); 
            			    		UNION285_tree = (IASTNode)adaptor.Create(UNION285);
            			    		root_0 = (IASTNode)adaptor.BecomeRoot(UNION285_tree, root_0);

            			    	PushFollow(FOLLOW_innerSubQuery_in_subQuery3420);
            			    	innerSubQuery286 = innerSubQuery();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, innerSubQuery286.Tree);

            			    }
            			    break;

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

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


            }

            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;
    }
    // $ANTLR start "subQuery"
    // Hql.g:637:1: subQuery : innerSubQuery ( UNION innerSubQuery )* ;
    public HqlParser.subQuery_return subQuery() // throws RecognitionException [1]
    {   
        HqlParser.subQuery_return retval = new HqlParser.subQuery_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken UNION298 = null;
        HqlParser.innerSubQuery_return innerSubQuery297 = default(HqlParser.innerSubQuery_return);

        HqlParser.innerSubQuery_return innerSubQuery299 = default(HqlParser.innerSubQuery_return);


        IASTNode UNION298_tree=null;

        try 
    	{
            // Hql.g:638:2: ( innerSubQuery ( UNION innerSubQuery )* )
            // Hql.g:638:4: innerSubQuery ( UNION innerSubQuery )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	PushFollow(FOLLOW_innerSubQuery_in_subQuery3513);
            	innerSubQuery297 = innerSubQuery();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, innerSubQuery297.Tree);
            	// Hql.g:638:18: ( UNION innerSubQuery )*
            	do 
            	{
            	    int alt107 = 2;
            	    int LA107_0 = input.LA(1);

            	    if ( (LA107_0 == UNION) )
            	    {
            	        alt107 = 1;
            	    }


            	    switch (alt107) 
            		{
            			case 1 :
            			    // Hql.g:638:19: UNION innerSubQuery
            			    {
            			    	UNION298=(IToken)Match(input,UNION,FOLLOW_UNION_in_subQuery3516); 
            			    		UNION298_tree = (IASTNode)adaptor.Create(UNION298);
            			    		root_0 = (IASTNode)adaptor.BecomeRoot(UNION298_tree, root_0);

            			    	PushFollow(FOLLOW_innerSubQuery_in_subQuery3519);
            			    	innerSubQuery299 = innerSubQuery();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, innerSubQuery299.Tree);

            			    }
            			    break;

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

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


            }

            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;
    }