// $ANTLR start "aggregateExpr" // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g:194:1: aggregateExpr : ( expr | collectionFunction ); public HqlSqlWalker.aggregateExpr_return aggregateExpr() // throws RecognitionException [1] { HqlSqlWalker.aggregateExpr_return retval = new HqlSqlWalker.aggregateExpr_return(); retval.Start = input.LT(1); IASTNode root_0 = null; IASTNode _first_0 = null; IASTNode _last = null; HqlSqlWalker.expr_return expr56 = default(HqlSqlWalker.expr_return); HqlSqlWalker.collectionFunction_return collectionFunction57 = default(HqlSqlWalker.collectionFunction_return); try { // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g:195:2: ( expr | collectionFunction ) int alt23 = 2; int LA23_0 = input.LA(1); if ( (LA23_0 == COUNT || LA23_0 == DOT || LA23_0 == FALSE || LA23_0 == NULL || LA23_0 == TRUE || LA23_0 == CASE || LA23_0 == AGGREGATE || LA23_0 == CASE2 || LA23_0 == INDEX_OP || LA23_0 == METHOD_CALL || LA23_0 == UNARY_MINUS || (LA23_0 >= VECTOR_EXPR && LA23_0 <= WEIRD_IDENT) || (LA23_0 >= NUM_INT && LA23_0 <= JAVA_CONSTANT) || (LA23_0 >= BNOT && LA23_0 <= DIV) || (LA23_0 >= COLON && LA23_0 <= IDENT)) ) { alt23 = 1; } else if ( (LA23_0 == ELEMENTS || LA23_0 == INDICES) ) { alt23 = 2; } else { NoViableAltException nvae_d23s0 = new NoViableAltException("", 23, 0, input); throw nvae_d23s0; } switch (alt23) { case 1 : // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g:195:4: expr { root_0 = (IASTNode)adaptor.GetNilNode(); _last = (IASTNode)input.LT(1); PushFollow(FOLLOW_expr_in_aggregateExpr943); expr56 = expr(); state.followingStackPointer--; adaptor.AddChild(root_0, expr56.Tree); } break; case 2 : // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g:196:4: collectionFunction { root_0 = (IASTNode)adaptor.GetNilNode(); _last = (IASTNode)input.LT(1); PushFollow(FOLLOW_collectionFunction_in_aggregateExpr949); collectionFunction57 = collectionFunction(); state.followingStackPointer--; adaptor.AddChild(root_0, collectionFunction57.Tree); } break; } retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0); } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { } return retval; }
// $ANTLR start "aggregateExpr" // HqlSqlWalker.g:210:1: aggregateExpr : ( expr | collectionFunction ); public HqlSqlWalker.aggregateExpr_return aggregateExpr() // throws RecognitionException [1] { HqlSqlWalker.aggregateExpr_return retval = new HqlSqlWalker.aggregateExpr_return(); retval.Start = input.LT(1); IASTNode root_0 = null; IASTNode _first_0 = null; IASTNode _last = null; HqlSqlWalker.expr_return expr65 = default(HqlSqlWalker.expr_return); HqlSqlWalker.collectionFunction_return collectionFunction66 = default(HqlSqlWalker.collectionFunction_return); try { // HqlSqlWalker.g:211:2: ( expr | collectionFunction ) int alt29 = 2; int LA29_0 = input.LA(1); if ( (LA29_0 == COUNT || LA29_0 == DOT || LA29_0 == FALSE || LA29_0 == NULL || LA29_0 == TRUE || LA29_0 == CASE || LA29_0 == AGGREGATE || LA29_0 == CASE2 || LA29_0 == INDEX_OP || LA29_0 == METHOD_CALL || LA29_0 == UNARY_MINUS || (LA29_0 >= VECTOR_EXPR && LA29_0 <= WEIRD_IDENT) || (LA29_0 >= NUM_INT && LA29_0 <= JAVA_CONSTANT) || (LA29_0 >= COLON && LA29_0 <= PARAM) || (LA29_0 >= BNOT && LA29_0 <= DIV) || (LA29_0 >= QUOTED_String && LA29_0 <= IDENT)) ) { alt29 = 1; } else if ( (LA29_0 == ELEMENTS || LA29_0 == INDICES) ) { alt29 = 2; } else { NoViableAltException nvae_d29s0 = new NoViableAltException("", 29, 0, input); throw nvae_d29s0; } switch (alt29) { case 1 : // HqlSqlWalker.g:211:4: expr { root_0 = (IASTNode)adaptor.GetNilNode(); _last = (IASTNode)input.LT(1); PushFollow(FOLLOW_expr_in_aggregateExpr1052); expr65 = expr(); state.followingStackPointer--; adaptor.AddChild(root_0, expr65.Tree); } break; case 2 : // HqlSqlWalker.g:212:4: collectionFunction { root_0 = (IASTNode)adaptor.GetNilNode(); _last = (IASTNode)input.LT(1); PushFollow(FOLLOW_collectionFunction_in_aggregateExpr1058); collectionFunction66 = collectionFunction(); state.followingStackPointer--; adaptor.AddChild(root_0, collectionFunction66.Tree); } break; } retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0); } catch (RecognitionException re) { ReportError(re); Recover(input,re); } finally { } return retval; }