Exemplo n.º 1
0
    // $ANTLR start "fromClause"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:235:1: fromClause : FROM fromRange ( fromJoin | COMMA fromRange )* ;
    public HqlParser.fromClause_return fromClause() // throws RecognitionException [1]
    {   
        HqlParser.fromClause_return retval = new HqlParser.fromClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken FROM54 = null;
        IToken COMMA57 = null;
        HqlParser.fromRange_return fromRange55 = default(HqlParser.fromRange_return);

        HqlParser.fromJoin_return fromJoin56 = default(HqlParser.fromJoin_return);

        HqlParser.fromRange_return fromRange58 = default(HqlParser.fromRange_return);


        IASTNode FROM54_tree=null;
        IASTNode COMMA57_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:236:2: ( FROM fromRange ( fromJoin | COMMA fromRange )* )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:236:4: FROM fromRange ( fromJoin | COMMA fromRange )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	FROM54=(IToken)Match(input,FROM,FOLLOW_FROM_in_fromClause1093); 
            		FROM54_tree = (IASTNode)adaptor.Create(FROM54);
            		root_0 = (IASTNode)adaptor.BecomeRoot(FROM54_tree, root_0);

            	 WeakKeywords(); 
            	PushFollow(FOLLOW_fromRange_in_fromClause1098);
            	fromRange55 = fromRange();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, fromRange55.Tree);
            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:236:40: ( fromJoin | COMMA fromRange )*
            	do 
            	{
            	    int alt16 = 3;
            	    int LA16_0 = input.LA(1);

            	    if ( (LA16_0 == FULL || LA16_0 == INNER || (LA16_0 >= JOIN && LA16_0 <= LEFT) || LA16_0 == RIGHT) )
            	    {
            	        alt16 = 1;
            	    }
            	    else if ( (LA16_0 == COMMA) )
            	    {
            	        alt16 = 2;
            	    }


            	    switch (alt16) 
            		{
            			case 1 :
            			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:236:42: fromJoin
            			    {
            			    	PushFollow(FOLLOW_fromJoin_in_fromClause1102);
            			    	fromJoin56 = fromJoin();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, fromJoin56.Tree);

            			    }
            			    break;
            			case 2 :
            			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:236:53: COMMA fromRange
            			    {
            			    	COMMA57=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_fromClause1106); 
            			    	 WeakKeywords(); 
            			    	PushFollow(FOLLOW_fromRange_in_fromClause1111);
            			    	fromRange58 = fromRange();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, fromRange58.Tree);

            			    }
            			    break;

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

            	loop16:
            		;	// Stops C# compiler whining that label 'loop16' 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 "fromClause"
    // Hql.g:241:1: fromClause : FROM fromRange ( fromJoin | COMMA fromRange )* ;
    public HqlParser.fromClause_return fromClause() // throws RecognitionException [1]
    {   
        HqlParser.fromClause_return retval = new HqlParser.fromClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken FROM58 = null;
        IToken COMMA61 = null;
        HqlParser.fromRange_return fromRange59 = default(HqlParser.fromRange_return);

        HqlParser.fromJoin_return fromJoin60 = default(HqlParser.fromJoin_return);

        HqlParser.fromRange_return fromRange62 = default(HqlParser.fromRange_return);


        IASTNode FROM58_tree=null;
        IASTNode COMMA61_tree=null;

        try 
    	{
            // Hql.g:242:2: ( FROM fromRange ( fromJoin | COMMA fromRange )* )
            // Hql.g:242:4: FROM fromRange ( fromJoin | COMMA fromRange )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	FROM58=(IToken)Match(input,FROM,FOLLOW_FROM_in_fromClause1133); 
            		FROM58_tree = (IASTNode)adaptor.Create(FROM58);
            		root_0 = (IASTNode)adaptor.BecomeRoot(FROM58_tree, root_0);

            	 WeakKeywords(); 
            	PushFollow(FOLLOW_fromRange_in_fromClause1138);
            	fromRange59 = fromRange();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, fromRange59.Tree);
            	// Hql.g:242:40: ( fromJoin | COMMA fromRange )*
            	do 
            	{
            	    int alt19 = 3;
            	    int LA19_0 = input.LA(1);

            	    if ( (LA19_0 == FULL || LA19_0 == INNER || (LA19_0 >= JOIN && LA19_0 <= LEFT) || LA19_0 == RIGHT) )
            	    {
            	        alt19 = 1;
            	    }
            	    else if ( (LA19_0 == COMMA) )
            	    {
            	        alt19 = 2;
            	    }


            	    switch (alt19) 
            		{
            			case 1 :
            			    // Hql.g:242:42: fromJoin
            			    {
            			    	PushFollow(FOLLOW_fromJoin_in_fromClause1142);
            			    	fromJoin60 = fromJoin();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, fromJoin60.Tree);

            			    }
            			    break;
            			case 2 :
            			    // Hql.g:242:53: COMMA fromRange
            			    {
            			    	COMMA61=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_fromClause1146); 
            			    	 WeakKeywords(); 
            			    	PushFollow(FOLLOW_fromRange_in_fromClause1151);
            			    	fromRange62 = fromRange();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, fromRange62.Tree);

            			    }
            			    break;

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

            	loop19:
            		;	// Stops C# compiler whining that label 'loop19' 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;
    }