Пример #1
0
    // $ANTLR start "multiplyExpression"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:486:1: multiplyExpression : unaryExpression ( ( STAR | DIV ) unaryExpression )* ;
    public HqlParser.multiplyExpression_return multiplyExpression() // throws RecognitionException [1]
    {   
        HqlParser.multiplyExpression_return retval = new HqlParser.multiplyExpression_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken STAR191 = null;
        IToken DIV192 = null;
        HqlParser.unaryExpression_return unaryExpression190 = default(HqlParser.unaryExpression_return);

        HqlParser.unaryExpression_return unaryExpression193 = default(HqlParser.unaryExpression_return);


        IASTNode STAR191_tree=null;
        IASTNode DIV192_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:2: ( unaryExpression ( ( STAR | DIV ) unaryExpression )* )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:4: unaryExpression ( ( STAR | DIV ) unaryExpression )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	PushFollow(FOLLOW_unaryExpression_in_multiplyExpression2366);
            	unaryExpression190 = unaryExpression();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, unaryExpression190.Tree);
            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:20: ( ( STAR | DIV ) unaryExpression )*
            	do 
            	{
            	    int alt67 = 2;
            	    int LA67_0 = input.LA(1);

            	    if ( ((LA67_0 >= STAR && LA67_0 <= DIV)) )
            	    {
            	        alt67 = 1;
            	    }


            	    switch (alt67) 
            		{
            			case 1 :
            			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:22: ( STAR | DIV ) unaryExpression
            			    {
            			    	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:22: ( STAR | DIV )
            			    	int alt66 = 2;
            			    	int LA66_0 = input.LA(1);

            			    	if ( (LA66_0 == STAR) )
            			    	{
            			    	    alt66 = 1;
            			    	}
            			    	else if ( (LA66_0 == DIV) )
            			    	{
            			    	    alt66 = 2;
            			    	}
            			    	else 
            			    	{
            			    	    NoViableAltException nvae_d66s0 =
            			    	        new NoViableAltException("", 66, 0, input);

            			    	    throw nvae_d66s0;
            			    	}
            			    	switch (alt66) 
            			    	{
            			    	    case 1 :
            			    	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:24: STAR
            			    	        {
            			    	        	STAR191=(IToken)Match(input,STAR,FOLLOW_STAR_in_multiplyExpression2372); 
            			    	        		STAR191_tree = (IASTNode)adaptor.Create(STAR191);
            			    	        		root_0 = (IASTNode)adaptor.BecomeRoot(STAR191_tree, root_0);


            			    	        }
            			    	        break;
            			    	    case 2 :
            			    	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:487:32: DIV
            			    	        {
            			    	        	DIV192=(IToken)Match(input,DIV,FOLLOW_DIV_in_multiplyExpression2377); 
            			    	        		DIV192_tree = (IASTNode)adaptor.Create(DIV192);
            			    	        		root_0 = (IASTNode)adaptor.BecomeRoot(DIV192_tree, root_0);


            			    	        }
            			    	        break;

            			    	}

            			    	PushFollow(FOLLOW_unaryExpression_in_multiplyExpression2382);
            			    	unaryExpression193 = unaryExpression();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, unaryExpression193.Tree);

            			    }
            			    break;

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

            	loop67:
            		;	// Stops C# compiler whining that label 'loop67' 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 "multiplyExpression"
    // Hql.g:504:1: multiplyExpression : unaryExpression ( ( STAR | DIV ) unaryExpression )* ;
    public HqlParser.multiplyExpression_return multiplyExpression() // throws RecognitionException [1]
    {   
        HqlParser.multiplyExpression_return retval = new HqlParser.multiplyExpression_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken STAR204 = null;
        IToken DIV205 = null;
        HqlParser.unaryExpression_return unaryExpression203 = default(HqlParser.unaryExpression_return);

        HqlParser.unaryExpression_return unaryExpression206 = default(HqlParser.unaryExpression_return);


        IASTNode STAR204_tree=null;
        IASTNode DIV205_tree=null;

        try 
    	{
            // Hql.g:505:2: ( unaryExpression ( ( STAR | DIV ) unaryExpression )* )
            // Hql.g:505:4: unaryExpression ( ( STAR | DIV ) unaryExpression )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	PushFollow(FOLLOW_unaryExpression_in_multiplyExpression2464);
            	unaryExpression203 = unaryExpression();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, unaryExpression203.Tree);
            	// Hql.g:505:20: ( ( STAR | DIV ) unaryExpression )*
            	do 
            	{
            	    int alt73 = 2;
            	    int LA73_0 = input.LA(1);

            	    if ( ((LA73_0 >= STAR && LA73_0 <= DIV)) )
            	    {
            	        alt73 = 1;
            	    }


            	    switch (alt73) 
            		{
            			case 1 :
            			    // Hql.g:505:22: ( STAR | DIV ) unaryExpression
            			    {
            			    	// Hql.g:505:22: ( STAR | DIV )
            			    	int alt72 = 2;
            			    	int LA72_0 = input.LA(1);

            			    	if ( (LA72_0 == STAR) )
            			    	{
            			    	    alt72 = 1;
            			    	}
            			    	else if ( (LA72_0 == DIV) )
            			    	{
            			    	    alt72 = 2;
            			    	}
            			    	else 
            			    	{
            			    	    NoViableAltException nvae_d72s0 =
            			    	        new NoViableAltException("", 72, 0, input);

            			    	    throw nvae_d72s0;
            			    	}
            			    	switch (alt72) 
            			    	{
            			    	    case 1 :
            			    	        // Hql.g:505:24: STAR
            			    	        {
            			    	        	STAR204=(IToken)Match(input,STAR,FOLLOW_STAR_in_multiplyExpression2470); 
            			    	        		STAR204_tree = (IASTNode)adaptor.Create(STAR204);
            			    	        		root_0 = (IASTNode)adaptor.BecomeRoot(STAR204_tree, root_0);


            			    	        }
            			    	        break;
            			    	    case 2 :
            			    	        // Hql.g:505:32: DIV
            			    	        {
            			    	        	DIV205=(IToken)Match(input,DIV,FOLLOW_DIV_in_multiplyExpression2475); 
            			    	        		DIV205_tree = (IASTNode)adaptor.Create(DIV205);
            			    	        		root_0 = (IASTNode)adaptor.BecomeRoot(DIV205_tree, root_0);


            			    	        }
            			    	        break;

            			    	}

            			    	PushFollow(FOLLOW_unaryExpression_in_multiplyExpression2480);
            			    	unaryExpression206 = unaryExpression();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, unaryExpression206.Tree);

            			    }
            			    break;

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

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