Пример #1
0
    // $ANTLR start "collectionExpr"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:591:1: collectionExpr : ( ELEMENTS | INDICES ) OPEN path CLOSE ;
    public HqlParser.collectionExpr_return collectionExpr() // throws RecognitionException [1]
    {   
        HqlParser.collectionExpr_return retval = new HqlParser.collectionExpr_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken ELEMENTS261 = null;
        IToken INDICES262 = null;
        IToken OPEN263 = null;
        IToken CLOSE265 = null;
        HqlParser.path_return path264 = default(HqlParser.path_return);


        IASTNode ELEMENTS261_tree=null;
        IASTNode INDICES262_tree=null;
        IASTNode OPEN263_tree=null;
        IASTNode CLOSE265_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:592:2: ( ( ELEMENTS | INDICES ) OPEN path CLOSE )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:592:4: ( ELEMENTS | INDICES ) OPEN path CLOSE
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:592:4: ( ELEMENTS | INDICES )
            	int alt93 = 2;
            	int LA93_0 = input.LA(1);

            	if ( (LA93_0 == ELEMENTS) )
            	{
            	    alt93 = 1;
            	}
            	else if ( (LA93_0 == INDICES) )
            	{
            	    alt93 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d93s0 =
            	        new NoViableAltException("", 93, 0, input);

            	    throw nvae_d93s0;
            	}
            	switch (alt93) 
            	{
            	    case 1 :
            	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:592:5: ELEMENTS
            	        {
            	        	ELEMENTS261=(IToken)Match(input,ELEMENTS,FOLLOW_ELEMENTS_in_collectionExpr3166); 
            	        		ELEMENTS261_tree = (IASTNode)adaptor.Create(ELEMENTS261);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(ELEMENTS261_tree, root_0);


            	        }
            	        break;
            	    case 2 :
            	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:592:17: INDICES
            	        {
            	        	INDICES262=(IToken)Match(input,INDICES,FOLLOW_INDICES_in_collectionExpr3171); 
            	        		INDICES262_tree = (IASTNode)adaptor.Create(INDICES262);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(INDICES262_tree, root_0);


            	        }
            	        break;

            	}

            	OPEN263=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_collectionExpr3175); 
            	PushFollow(FOLLOW_path_in_collectionExpr3178);
            	path264 = path();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, path264.Tree);
            	CLOSE265=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_collectionExpr3180); 

            }

            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 "collectionExpr"
    // Hql.g:609:1: collectionExpr : ( ELEMENTS | INDICES ) OPEN path CLOSE ;
    public HqlParser.collectionExpr_return collectionExpr() // throws RecognitionException [1]
    {   
        HqlParser.collectionExpr_return retval = new HqlParser.collectionExpr_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken ELEMENTS274 = null;
        IToken INDICES275 = null;
        IToken OPEN276 = null;
        IToken CLOSE278 = null;
        HqlParser.path_return path277 = default(HqlParser.path_return);


        IASTNode ELEMENTS274_tree=null;
        IASTNode INDICES275_tree=null;
        IASTNode OPEN276_tree=null;
        IASTNode CLOSE278_tree=null;

        try 
    	{
            // Hql.g:610:2: ( ( ELEMENTS | INDICES ) OPEN path CLOSE )
            // Hql.g:610:4: ( ELEMENTS | INDICES ) OPEN path CLOSE
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// Hql.g:610:4: ( ELEMENTS | INDICES )
            	int alt99 = 2;
            	int LA99_0 = input.LA(1);

            	if ( (LA99_0 == ELEMENTS) )
            	{
            	    alt99 = 1;
            	}
            	else if ( (LA99_0 == INDICES) )
            	{
            	    alt99 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d99s0 =
            	        new NoViableAltException("", 99, 0, input);

            	    throw nvae_d99s0;
            	}
            	switch (alt99) 
            	{
            	    case 1 :
            	        // Hql.g:610:5: ELEMENTS
            	        {
            	        	ELEMENTS274=(IToken)Match(input,ELEMENTS,FOLLOW_ELEMENTS_in_collectionExpr3265); 
            	        		ELEMENTS274_tree = (IASTNode)adaptor.Create(ELEMENTS274);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(ELEMENTS274_tree, root_0);


            	        }
            	        break;
            	    case 2 :
            	        // Hql.g:610:17: INDICES
            	        {
            	        	INDICES275=(IToken)Match(input,INDICES,FOLLOW_INDICES_in_collectionExpr3270); 
            	        		INDICES275_tree = (IASTNode)adaptor.Create(INDICES275);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(INDICES275_tree, root_0);


            	        }
            	        break;

            	}

            	OPEN276=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_collectionExpr3274); 
            	PushFollow(FOLLOW_path_in_collectionExpr3277);
            	path277 = path();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, path277.Tree);
            	CLOSE278=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_collectionExpr3279); 

            }

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