Пример #1
0
    // $ANTLR start "altWhenClause"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:510:1: altWhenClause : ( WHEN unaryExpression THEN expression ) ;
    public HqlParser.altWhenClause_return altWhenClause() // throws RecognitionException [1]
    {   
        HqlParser.altWhenClause_return retval = new HqlParser.altWhenClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken WHEN207 = null;
        IToken THEN209 = null;
        HqlParser.unaryExpression_return unaryExpression208 = default(HqlParser.unaryExpression_return);

        HqlParser.expression_return expression210 = default(HqlParser.expression_return);


        IASTNode WHEN207_tree=null;
        IASTNode THEN209_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:511:2: ( ( WHEN unaryExpression THEN expression ) )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:511:4: ( WHEN unaryExpression THEN expression )
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:511:4: ( WHEN unaryExpression THEN expression )
            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:511:5: WHEN unaryExpression THEN expression
            	{
            		WHEN207=(IToken)Match(input,WHEN,FOLLOW_WHEN_in_altWhenClause2586); 
            			WHEN207_tree = (IASTNode)adaptor.Create(WHEN207);
            			root_0 = (IASTNode)adaptor.BecomeRoot(WHEN207_tree, root_0);

            		PushFollow(FOLLOW_unaryExpression_in_altWhenClause2589);
            		unaryExpression208 = unaryExpression();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, unaryExpression208.Tree);
            		THEN209=(IToken)Match(input,THEN,FOLLOW_THEN_in_altWhenClause2591); 
            		PushFollow(FOLLOW_expression_in_altWhenClause2594);
            		expression210 = expression();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, expression210.Tree);

            	}


            }

            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 "altWhenClause"
    // Hql.g:528:1: altWhenClause : ( WHEN unaryExpression THEN expression ) ;
    public HqlParser.altWhenClause_return altWhenClause() // throws RecognitionException [1]
    {   
        HqlParser.altWhenClause_return retval = new HqlParser.altWhenClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken WHEN220 = null;
        IToken THEN222 = null;
        HqlParser.unaryExpression_return unaryExpression221 = default(HqlParser.unaryExpression_return);

        HqlParser.expression_return expression223 = default(HqlParser.expression_return);


        IASTNode WHEN220_tree=null;
        IASTNode THEN222_tree=null;

        try 
    	{
            // Hql.g:529:2: ( ( WHEN unaryExpression THEN expression ) )
            // Hql.g:529:4: ( WHEN unaryExpression THEN expression )
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// Hql.g:529:4: ( WHEN unaryExpression THEN expression )
            	// Hql.g:529:5: WHEN unaryExpression THEN expression
            	{
            		WHEN220=(IToken)Match(input,WHEN,FOLLOW_WHEN_in_altWhenClause2685); 
            			WHEN220_tree = (IASTNode)adaptor.Create(WHEN220);
            			root_0 = (IASTNode)adaptor.BecomeRoot(WHEN220_tree, root_0);

            		PushFollow(FOLLOW_unaryExpression_in_altWhenClause2688);
            		unaryExpression221 = unaryExpression();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, unaryExpression221.Tree);
            		THEN222=(IToken)Match(input,THEN,FOLLOW_THEN_in_altWhenClause2690); 
            		PushFollow(FOLLOW_expression_in_altWhenClause2693);
            		expression223 = expression();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, expression223.Tree);

            	}


            }

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