// $ANTLR start "identPrimary"
    // Hql.g:579:1: identPrimary : ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate );
    public HqlParser.identPrimary_return identPrimary() // throws RecognitionException [1]
    {   
        HqlParser.identPrimary_return retval = new HqlParser.identPrimary_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken o = null;
        IToken op = null;
        IToken DOT259 = null;
        IToken CLOSE262 = null;
        HqlParser.identifier_return identifier258 = default(HqlParser.identifier_return);

        HqlParser.identifier_return identifier260 = default(HqlParser.identifier_return);

        HqlParser.exprList_return exprList261 = default(HqlParser.exprList_return);

        HqlParser.aggregate_return aggregate263 = default(HqlParser.aggregate_return);


        IASTNode o_tree=null;
        IASTNode op_tree=null;
        IASTNode DOT259_tree=null;
        IASTNode CLOSE262_tree=null;

        try 
    	{
            // Hql.g:580:2: ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate )
            int alt93 = 2;
            int LA93_0 = input.LA(1);

            if ( (LA93_0 == IDENT) )
            {
                alt93 = 1;
            }
            else if ( (LA93_0 == AVG || LA93_0 == COUNT || LA93_0 == ELEMENTS || LA93_0 == INDICES || (LA93_0 >= MAX && LA93_0 <= MIN) || LA93_0 == SUM) )
            {
                alt93 = 2;
            }
            else 
            {
                NoViableAltException nvae_d93s0 =
                    new NoViableAltException("", 93, 0, input);

                throw nvae_d93s0;
            }
            switch (alt93) 
            {
                case 1 :
                    // Hql.g:580:4: identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )?
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_identifier_in_identPrimary3030);
                    	identifier258 = identifier();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, identifier258.Tree);
                    	 HandleDotIdent(); 
                    	// Hql.g:581:4: ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )*
                    	do 
                    	{
                    	    int alt91 = 2;
                    	    int LA91_0 = input.LA(1);

                    	    if ( (LA91_0 == DOT) )
                    	    {
                    	        int LA91_2 = input.LA(2);

                    	        if ( (LA91_2 == OBJECT || LA91_2 == IDENT) )
                    	        {
                    	            alt91 = 1;
                    	        }


                    	    }


                    	    switch (alt91) 
                    		{
                    			case 1 :
                    			    // Hql.g:581:31: DOT ( identifier | o= OBJECT )
                    			    {
                    			    	DOT259=(IToken)Match(input,DOT,FOLLOW_DOT_in_identPrimary3048); 
                    			    		DOT259_tree = (IASTNode)adaptor.Create(DOT259);
                    			    		root_0 = (IASTNode)adaptor.BecomeRoot(DOT259_tree, root_0);

                    			    	// Hql.g:581:36: ( identifier | o= OBJECT )
                    			    	int alt90 = 2;
                    			    	int LA90_0 = input.LA(1);

                    			    	if ( (LA90_0 == IDENT) )
                    			    	{
                    			    	    alt90 = 1;
                    			    	}
                    			    	else if ( (LA90_0 == OBJECT) )
                    			    	{
                    			    	    alt90 = 2;
                    			    	}
                    			    	else 
                    			    	{
                    			    	    NoViableAltException nvae_d90s0 =
                    			    	        new NoViableAltException("", 90, 0, input);

                    			    	    throw nvae_d90s0;
                    			    	}
                    			    	switch (alt90) 
                    			    	{
                    			    	    case 1 :
                    			    	        // Hql.g:581:38: identifier
                    			    	        {
                    			    	        	PushFollow(FOLLOW_identifier_in_identPrimary3053);
                    			    	        	identifier260 = identifier();
                    			    	        	state.followingStackPointer--;

                    			    	        	adaptor.AddChild(root_0, identifier260.Tree);

                    			    	        }
                    			    	        break;
                    			    	    case 2 :
                    			    	        // Hql.g:581:51: o= OBJECT
                    			    	        {
                    			    	        	o=(IToken)Match(input,OBJECT,FOLLOW_OBJECT_in_identPrimary3059); 
                    			    	        		o_tree = (IASTNode)adaptor.Create(o);
                    			    	        		adaptor.AddChild(root_0, o_tree);

                    			    	        	 o.Type = IDENT; 

                    			    	        }
                    			    	        break;

                    			    	}


                    			    }
                    			    break;

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

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

                    	// Hql.g:582:4: ( (op= OPEN exprList CLOSE ) )?
                    	int alt92 = 2;
                    	int LA92_0 = input.LA(1);

                    	if ( (LA92_0 == OPEN) )
                    	{
                    	    alt92 = 1;
                    	}
                    	switch (alt92) 
                    	{
                    	    case 1 :
                    	        // Hql.g:582:6: (op= OPEN exprList CLOSE )
                    	        {
                    	        	// Hql.g:582:6: (op= OPEN exprList CLOSE )
                    	        	// Hql.g:582:8: op= OPEN exprList CLOSE
                    	        	{
                    	        		op=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_identPrimary3077); 
                    	        			op_tree = (IASTNode)adaptor.Create(op);
                    	        			root_0 = (IASTNode)adaptor.BecomeRoot(op_tree, root_0);

                    	        		 op.Type = METHOD_CALL;
                    	        		PushFollow(FOLLOW_exprList_in_identPrimary3082);
                    	        		exprList261 = exprList();
                    	        		state.followingStackPointer--;

                    	        		adaptor.AddChild(root_0, exprList261.Tree);
                    	        		CLOSE262=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_identPrimary3084); 

                    	        	}


                    	        }
                    	        break;

                    	}


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

                    	PushFollow(FOLLOW_aggregate_in_identPrimary3100);
                    	aggregate263 = aggregate();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, aggregate263.Tree);

                    }
                    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;
    }
Exemplo n.º 2
0
    // $ANTLR start "identPrimary"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:561:1: identPrimary : ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate );
    public HqlParser.identPrimary_return identPrimary() // throws RecognitionException [1]
    {   
        HqlParser.identPrimary_return retval = new HqlParser.identPrimary_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken o = null;
        IToken op = null;
        IToken DOT246 = null;
        IToken CLOSE249 = null;
        HqlParser.identifier_return identifier245 = default(HqlParser.identifier_return);

        HqlParser.identifier_return identifier247 = default(HqlParser.identifier_return);

        HqlParser.exprList_return exprList248 = default(HqlParser.exprList_return);

        HqlParser.aggregate_return aggregate250 = default(HqlParser.aggregate_return);


        IASTNode o_tree=null;
        IASTNode op_tree=null;
        IASTNode DOT246_tree=null;
        IASTNode CLOSE249_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:562:2: ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate )
            int alt87 = 2;
            int LA87_0 = input.LA(1);

            if ( (LA87_0 == IDENT) )
            {
                alt87 = 1;
            }
            else if ( (LA87_0 == AVG || LA87_0 == COUNT || LA87_0 == ELEMENTS || LA87_0 == INDICES || (LA87_0 >= MAX && LA87_0 <= MIN) || LA87_0 == SUM) )
            {
                alt87 = 2;
            }
            else 
            {
                NoViableAltException nvae_d87s0 =
                    new NoViableAltException("", 87, 0, input);

                throw nvae_d87s0;
            }
            switch (alt87) 
            {
                case 1 :
                    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:562:4: identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )?
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_identifier_in_identPrimary2931);
                    	identifier245 = identifier();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, identifier245.Tree);
                    	 HandleDotIdent(); 
                    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:563:4: ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )*
                    	do 
                    	{
                    	    int alt85 = 2;
                    	    int LA85_0 = input.LA(1);

                    	    if ( (LA85_0 == DOT) )
                    	    {
                    	        int LA85_2 = input.LA(2);

                    	        if ( (LA85_2 == OBJECT || LA85_2 == IDENT) )
                    	        {
                    	            alt85 = 1;
                    	        }


                    	    }


                    	    switch (alt85) 
                    		{
                    			case 1 :
                    			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:563:31: DOT ( identifier | o= OBJECT )
                    			    {
                    			    	DOT246=(IToken)Match(input,DOT,FOLLOW_DOT_in_identPrimary2949); 
                    			    		DOT246_tree = (IASTNode)adaptor.Create(DOT246);
                    			    		root_0 = (IASTNode)adaptor.BecomeRoot(DOT246_tree, root_0);

                    			    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:563:36: ( identifier | o= OBJECT )
                    			    	int alt84 = 2;
                    			    	int LA84_0 = input.LA(1);

                    			    	if ( (LA84_0 == IDENT) )
                    			    	{
                    			    	    alt84 = 1;
                    			    	}
                    			    	else if ( (LA84_0 == OBJECT) )
                    			    	{
                    			    	    alt84 = 2;
                    			    	}
                    			    	else 
                    			    	{
                    			    	    NoViableAltException nvae_d84s0 =
                    			    	        new NoViableAltException("", 84, 0, input);

                    			    	    throw nvae_d84s0;
                    			    	}
                    			    	switch (alt84) 
                    			    	{
                    			    	    case 1 :
                    			    	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:563:38: identifier
                    			    	        {
                    			    	        	PushFollow(FOLLOW_identifier_in_identPrimary2954);
                    			    	        	identifier247 = identifier();
                    			    	        	state.followingStackPointer--;

                    			    	        	adaptor.AddChild(root_0, identifier247.Tree);

                    			    	        }
                    			    	        break;
                    			    	    case 2 :
                    			    	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:563:51: o= OBJECT
                    			    	        {
                    			    	        	o=(IToken)Match(input,OBJECT,FOLLOW_OBJECT_in_identPrimary2960); 
                    			    	        		o_tree = (IASTNode)adaptor.Create(o);
                    			    	        		adaptor.AddChild(root_0, o_tree);

                    			    	        	 o.Type = IDENT; 

                    			    	        }
                    			    	        break;

                    			    	}


                    			    }
                    			    break;

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

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

                    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:564:4: ( (op= OPEN exprList CLOSE ) )?
                    	int alt86 = 2;
                    	int LA86_0 = input.LA(1);

                    	if ( (LA86_0 == OPEN) )
                    	{
                    	    alt86 = 1;
                    	}
                    	switch (alt86) 
                    	{
                    	    case 1 :
                    	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:564:6: (op= OPEN exprList CLOSE )
                    	        {
                    	        	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:564:6: (op= OPEN exprList CLOSE )
                    	        	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:564:8: op= OPEN exprList CLOSE
                    	        	{
                    	        		op=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_identPrimary2978); 
                    	        			op_tree = (IASTNode)adaptor.Create(op);
                    	        			root_0 = (IASTNode)adaptor.BecomeRoot(op_tree, root_0);

                    	        		 op.Type = METHOD_CALL;
                    	        		PushFollow(FOLLOW_exprList_in_identPrimary2983);
                    	        		exprList248 = exprList();
                    	        		state.followingStackPointer--;

                    	        		adaptor.AddChild(root_0, exprList248.Tree);
                    	        		CLOSE249=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_identPrimary2985); 

                    	        	}


                    	        }
                    	        break;

                    	}


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

                    	PushFollow(FOLLOW_aggregate_in_identPrimary3001);
                    	aggregate250 = aggregate();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, aggregate250.Tree);

                    }
                    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;
    }
Exemplo n.º 3
0
    // $ANTLR start "identPrimary"
    // Hql.g:574:1: identPrimary : ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate );
    public HqlParser.identPrimary_return identPrimary() // throws RecognitionException [1]
    {   
        HqlParser.identPrimary_return retval = new HqlParser.identPrimary_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken o = null;
        IToken op = null;
        IToken DOT253 = null;
        IToken CLOSE256 = null;
        HqlParser.identifier_return identifier252 = default(HqlParser.identifier_return);

        HqlParser.identifier_return identifier254 = default(HqlParser.identifier_return);

        HqlParser.exprList_return exprList255 = default(HqlParser.exprList_return);

        HqlParser.aggregate_return aggregate257 = default(HqlParser.aggregate_return);


        IASTNode o_tree=null;
        IASTNode op_tree=null;
        IASTNode DOT253_tree=null;
        IASTNode CLOSE256_tree=null;

        try 
    	{
            // Hql.g:575:2: ( identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )? | aggregate )
            int alt89 = 2;
            int LA89_0 = input.LA(1);

            if ( (LA89_0 == IDENT) )
            {
                alt89 = 1;
            }
            else if ( (LA89_0 == AVG || LA89_0 == COUNT || LA89_0 == ELEMENTS || LA89_0 == INDICES || (LA89_0 >= MAX && LA89_0 <= MIN) || LA89_0 == SUM) )
            {
                alt89 = 2;
            }
            else 
            {
                NoViableAltException nvae_d89s0 =
                    new NoViableAltException("", 89, 0, input);

                throw nvae_d89s0;
            }
            switch (alt89) 
            {
                case 1 :
                    // Hql.g:575:4: identifier ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )* ( (op= OPEN exprList CLOSE ) )?
                    {
                    	root_0 = (IASTNode)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_identifier_in_identPrimary2993);
                    	identifier252 = identifier();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, identifier252.Tree);
                    	 HandleDotIdent(); 
                    	// Hql.g:576:4: ( options {greedy=true; } : DOT ( identifier | o= OBJECT ) )*
                    	do 
                    	{
                    	    int alt87 = 2;
                    	    int LA87_0 = input.LA(1);

                    	    if ( (LA87_0 == DOT) )
                    	    {
                    	        int LA87_2 = input.LA(2);

                    	        if ( (LA87_2 == OBJECT || LA87_2 == IDENT) )
                    	        {
                    	            alt87 = 1;
                    	        }


                    	    }


                    	    switch (alt87) 
                    		{
                    			case 1 :
                    			    // Hql.g:576:31: DOT ( identifier | o= OBJECT )
                    			    {
                    			    	DOT253=(IToken)Match(input,DOT,FOLLOW_DOT_in_identPrimary3011); 
                    			    		DOT253_tree = (IASTNode)adaptor.Create(DOT253);
                    			    		root_0 = (IASTNode)adaptor.BecomeRoot(DOT253_tree, root_0);

                    			    	// Hql.g:576:36: ( identifier | o= OBJECT )
                    			    	int alt86 = 2;
                    			    	int LA86_0 = input.LA(1);

                    			    	if ( (LA86_0 == IDENT) )
                    			    	{
                    			    	    alt86 = 1;
                    			    	}
                    			    	else if ( (LA86_0 == OBJECT) )
                    			    	{
                    			    	    alt86 = 2;
                    			    	}
                    			    	else 
                    			    	{
                    			    	    NoViableAltException nvae_d86s0 =
                    			    	        new NoViableAltException("", 86, 0, input);

                    			    	    throw nvae_d86s0;
                    			    	}
                    			    	switch (alt86) 
                    			    	{
                    			    	    case 1 :
                    			    	        // Hql.g:576:38: identifier
                    			    	        {
                    			    	        	PushFollow(FOLLOW_identifier_in_identPrimary3016);
                    			    	        	identifier254 = identifier();
                    			    	        	state.followingStackPointer--;

                    			    	        	adaptor.AddChild(root_0, identifier254.Tree);

                    			    	        }
                    			    	        break;
                    			    	    case 2 :
                    			    	        // Hql.g:576:51: o= OBJECT
                    			    	        {
                    			    	        	o=(IToken)Match(input,OBJECT,FOLLOW_OBJECT_in_identPrimary3022); 
                    			    	        		o_tree = (IASTNode)adaptor.Create(o);
                    			    	        		adaptor.AddChild(root_0, o_tree);

                    			    	        	 o.Type = IDENT; 

                    			    	        }
                    			    	        break;

                    			    	}


                    			    }
                    			    break;

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

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

                    	// Hql.g:577:4: ( (op= OPEN exprList CLOSE ) )?
                    	int alt88 = 2;
                    	int LA88_0 = input.LA(1);

                    	if ( (LA88_0 == OPEN) )
                    	{
                    	    alt88 = 1;
                    	}
                    	switch (alt88) 
                    	{
                    	    case 1 :
                    	        // Hql.g:577:6: (op= OPEN exprList CLOSE )
                    	        {
                    	        	// Hql.g:577:6: (op= OPEN exprList CLOSE )
                    	        	// Hql.g:577:8: op= OPEN exprList CLOSE
                    	        	{
                    	        		op=(IToken)Match(input,OPEN,FOLLOW_OPEN_in_identPrimary3040); 
                    	        			op_tree = (IASTNode)adaptor.Create(op);
                    	        			root_0 = (IASTNode)adaptor.BecomeRoot(op_tree, root_0);

                    	        		 op.Type = METHOD_CALL;
                    	        		PushFollow(FOLLOW_exprList_in_identPrimary3045);
                    	        		exprList255 = exprList();
                    	        		state.followingStackPointer--;

                    	        		adaptor.AddChild(root_0, exprList255.Tree);
                    	        		CLOSE256=(IToken)Match(input,CLOSE,FOLLOW_CLOSE_in_identPrimary3047); 

                    	        	}


                    	        }
                    	        break;

                    	}


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

                    	PushFollow(FOLLOW_aggregate_in_identPrimary3063);
                    	aggregate257 = aggregate();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, aggregate257.Tree);

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