// $ANTLR start "groupByClause"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:290:1: groupByClause : GROUP 'by' expression ( COMMA expression )* ( havingClause )? ;
    public HqlParser.groupByClause_return groupByClause() // throws RecognitionException [1]
    {   
        HqlParser.groupByClause_return retval = new HqlParser.groupByClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken GROUP117 = null;
        IToken string_literal118 = null;
        IToken COMMA120 = null;
        HqlParser.expression_return expression119 = default(HqlParser.expression_return);

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

        HqlParser.havingClause_return havingClause122 = default(HqlParser.havingClause_return);


        IASTNode GROUP117_tree=null;
        IASTNode string_literal118_tree=null;
        IASTNode COMMA120_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:291:2: ( GROUP 'by' expression ( COMMA expression )* ( havingClause )? )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:291:4: GROUP 'by' expression ( COMMA expression )* ( havingClause )?
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	GROUP117=(IToken)Match(input,GROUP,FOLLOW_GROUP_in_groupByClause1545); 
            		GROUP117_tree = (IASTNode)adaptor.Create(GROUP117);
            		root_0 = (IASTNode)adaptor.BecomeRoot(GROUP117_tree, root_0);

            	string_literal118=(IToken)Match(input,LITERAL_by,FOLLOW_LITERAL_by_in_groupByClause1551); 
            	PushFollow(FOLLOW_expression_in_groupByClause1554);
            	expression119 = expression();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, expression119.Tree);
            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:292:20: ( COMMA expression )*
            	do 
            	{
            	    int alt36 = 2;
            	    int LA36_0 = input.LA(1);

            	    if ( (LA36_0 == COMMA) )
            	    {
            	        alt36 = 1;
            	    }


            	    switch (alt36) 
            		{
            			case 1 :
            			    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:292:22: COMMA expression
            			    {
            			    	COMMA120=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_groupByClause1558); 
            			    	PushFollow(FOLLOW_expression_in_groupByClause1561);
            			    	expression121 = expression();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, expression121.Tree);

            			    }
            			    break;

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

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

            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:293:3: ( havingClause )?
            	int alt37 = 2;
            	int LA37_0 = input.LA(1);

            	if ( (LA37_0 == HAVING) )
            	{
            	    alt37 = 1;
            	}
            	switch (alt37) 
            	{
            	    case 1 :
            	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:293:4: havingClause
            	        {
            	        	PushFollow(FOLLOW_havingClause_in_groupByClause1569);
            	        	havingClause122 = havingClause();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, havingClause122.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;
    }
    // $ANTLR start "groupByClause"
    // Hql.g:296:1: groupByClause : GROUP 'by' expression ( COMMA expression )* ;
    public HqlParser.groupByClause_return groupByClause() // throws RecognitionException [1]
    {   
        HqlParser.groupByClause_return retval = new HqlParser.groupByClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken GROUP121 = null;
        IToken string_literal122 = null;
        IToken COMMA124 = null;
        HqlParser.expression_return expression123 = default(HqlParser.expression_return);

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


        IASTNode GROUP121_tree=null;
        IASTNode string_literal122_tree=null;
        IASTNode COMMA124_tree=null;

        try 
    	{
            // Hql.g:297:2: ( GROUP 'by' expression ( COMMA expression )* )
            // Hql.g:297:4: GROUP 'by' expression ( COMMA expression )*
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	GROUP121=(IToken)Match(input,GROUP,FOLLOW_GROUP_in_groupByClause1585); 
            		GROUP121_tree = (IASTNode)adaptor.Create(GROUP121);
            		root_0 = (IASTNode)adaptor.BecomeRoot(GROUP121_tree, root_0);

            	string_literal122=(IToken)Match(input,LITERAL_by,FOLLOW_LITERAL_by_in_groupByClause1591); 
            	PushFollow(FOLLOW_expression_in_groupByClause1594);
            	expression123 = expression();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, expression123.Tree);
            	// Hql.g:298:20: ( COMMA expression )*
            	do 
            	{
            	    int alt39 = 2;
            	    int LA39_0 = input.LA(1);

            	    if ( (LA39_0 == COMMA) )
            	    {
            	        alt39 = 1;
            	    }


            	    switch (alt39) 
            		{
            			case 1 :
            			    // Hql.g:298:22: COMMA expression
            			    {
            			    	COMMA124=(IToken)Match(input,COMMA,FOLLOW_COMMA_in_groupByClause1598); 
            			    	PushFollow(FOLLOW_expression_in_groupByClause1601);
            			    	expression125 = expression();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, expression125.Tree);

            			    }
            			    break;

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

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