public final hqlParser.compoundExpr_return compoundExpr() throws RecognitionException {
		hqlParser.compoundExpr_return retval = new hqlParser.compoundExpr_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token OPEN281=null;
		Token COMMA284=null;
		Token CLOSE286=null;
		ParserRuleReturnScope collectionExpr279 =null;
		ParserRuleReturnScope path280 =null;
		ParserRuleReturnScope subQuery282 =null;
		ParserRuleReturnScope expression283 =null;
		ParserRuleReturnScope expression285 =null;

		CommonTree OPEN281_tree=null;
		CommonTree COMMA284_tree=null;
		CommonTree CLOSE286_tree=null;

		try {
			// hql.g:654:2: ( collectionExpr | path | ( OPEN ! ( subQuery | ( expression ( COMMA ! expression )* ) ) CLOSE !) )
			int alt102=3;
			switch ( input.LA(1) ) {
			case ELEMENTS:
			case INDICES:
				{
				alt102=1;
				}
				break;
			case IDENT:
				{
				alt102=2;
				}
				break;
			case OPEN:
				{
				alt102=3;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 102, 0, input);
				throw nvae;
			}
			switch (alt102) {
				case 1 :
					// hql.g:654:4: collectionExpr
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_collectionExpr_in_compoundExpr3322);
					collectionExpr279=collectionExpr();
					state._fsp--;

					adaptor.addChild(root_0, collectionExpr279.getTree());

					}
					break;
				case 2 :
					// hql.g:655:4: path
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_path_in_compoundExpr3327);
					path280=path();
					state._fsp--;

					adaptor.addChild(root_0, path280.getTree());

					}
					break;
				case 3 :
					// hql.g:656:4: ( OPEN ! ( subQuery | ( expression ( COMMA ! expression )* ) ) CLOSE !)
					{
					root_0 = (CommonTree)adaptor.nil();


					// hql.g:656:4: ( OPEN ! ( subQuery | ( expression ( COMMA ! expression )* ) ) CLOSE !)
					// hql.g:656:5: OPEN ! ( subQuery | ( expression ( COMMA ! expression )* ) ) CLOSE !
					{
					OPEN281=(Token)match(input,OPEN,FOLLOW_OPEN_in_compoundExpr3333);
					// hql.g:656:11: ( subQuery | ( expression ( COMMA ! expression )* ) )
					int alt101=2;
					int LA101_0 = input.LA(1);
					if ( (LA101_0==EOF||LA101_0==CLOSE||LA101_0==FROM||LA101_0==GROUP||LA101_0==HAVING||LA101_0==ORDER||LA101_0==SELECT||LA101_0==SKIP||LA101_0==TAKE||LA101_0==UNION||LA101_0==WHERE) ) {
						alt101=1;
					}
					else if ( (LA101_0==ALL||LA101_0==ANY||LA101_0==AVG||LA101_0==BNOT||LA101_0==CASE||LA101_0==COLON||LA101_0==COUNT||LA101_0==ELEMENTS||LA101_0==EMPTY||LA101_0==EXISTS||LA101_0==FALSE||LA101_0==IDENT||LA101_0==INDICES||LA101_0==MAX||(LA101_0 >= MIN && LA101_0 <= MINUS)||LA101_0==NOT||(LA101_0 >= NULL && LA101_0 <= NUM_LONG)||LA101_0==OPEN||(LA101_0 >= PARAM && LA101_0 <= PLUS)||LA101_0==QUOTED_String||LA101_0==SOME||LA101_0==SUM||LA101_0==TRUE) ) {
						alt101=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 101, 0, input);
						throw nvae;
					}

					switch (alt101) {
						case 1 :
							// hql.g:656:13: subQuery
							{
							pushFollow(FOLLOW_subQuery_in_compoundExpr3338);
							subQuery282=subQuery();
							state._fsp--;

							adaptor.addChild(root_0, subQuery282.getTree());

							}
							break;
						case 2 :
							// hql.g:656:24: ( expression ( COMMA ! expression )* )
							{
							// hql.g:656:24: ( expression ( COMMA ! expression )* )
							// hql.g:656:25: expression ( COMMA ! expression )*
							{
							pushFollow(FOLLOW_expression_in_compoundExpr3343);
							expression283=expression();
							state._fsp--;

							adaptor.addChild(root_0, expression283.getTree());

							// hql.g:656:36: ( COMMA ! expression )*
							loop100:
							while (true) {
								int alt100=2;
								int LA100_0 = input.LA(1);
								if ( (LA100_0==COMMA) ) {
									alt100=1;
								}

								switch (alt100) {
								case 1 :
									// hql.g:656:37: COMMA ! expression
									{
									COMMA284=(Token)match(input,COMMA,FOLLOW_COMMA_in_compoundExpr3346);
									pushFollow(FOLLOW_expression_in_compoundExpr3349);
									expression285=expression();
									state._fsp--;

									adaptor.addChild(root_0, expression285.getTree());

									}
									break;

								default :
									break loop100;
								}
							}

							}

							}
							break;

					}

					CLOSE286=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_compoundExpr3356);
					}

					}
					break;

			}
			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
public final hqlParser . compoundExpr_return compoundExpr ( ) throws RecognitionException { hqlParser . compoundExpr_return retval = new hqlParser . compoundExpr_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token OPEN281 = null ; Token COMMA284 = null ; Token CLOSE286 = null ; ParserRuleReturnScope collectionExpr279 = null ; ParserRuleReturnScope path280 = null ; ParserRuleReturnScope subQuery282 = null ; ParserRuleReturnScope expression283 = null ; ParserRuleReturnScope expression285 = null ; CommonTree OPEN281_tree = null ; CommonTree COMMA284_tree = null ; CommonTree CLOSE286_tree = null ; try { int alt102 = 3 ; switch ( input . LA ( 1 ) ) { case ELEMENTS : case INDICES : { alt102 = 1 ; } break ; case IDENT : { alt102 = 2 ; } break ; case OPEN : { alt102 = 3 ; } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 102 , 0 , input ) ; throw nvae ; } switch ( alt102 ) { case 1 : { root_0 = ( CommonTree ) adaptor . nil ( ) ; pushFollow ( FOLLOW_collectionExpr_in_compoundExpr3322 ) ; collectionExpr279 = collectionExpr ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , collectionExpr279 . getTree ( ) ) ; } break ; case 2 : { root_0 = ( CommonTree ) adaptor . nil ( ) ; pushFollow ( FOLLOW_path_in_compoundExpr3327 ) ; path280 = path ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , path280 . getTree ( ) ) ; } break ; case 3 : { root_0 = ( CommonTree ) adaptor . nil ( ) ; { OPEN281 = ( Token ) match ( input , OPEN , FOLLOW_OPEN_in_compoundExpr3333 ) ; int alt101 = 2 ; int LA101_0 = input . LA ( 1 ) ; if ( ( LA101_0 == EOF || LA101_0 == CLOSE || LA101_0 == FROM || LA101_0 == GROUP || LA101_0 == HAVING || LA101_0 == ORDER || LA101_0 == SELECT || LA101_0 == SKIP || LA101_0 == TAKE || LA101_0 == UNION || LA101_0 == WHERE ) ) { alt101 = 1 ; } else if ( ( LA101_0 == ALL || LA101_0 == ANY || LA101_0 == AVG || LA101_0 == BNOT || LA101_0 == CASE || LA101_0 == COLON || LA101_0 == COUNT || LA101_0 == ELEMENTS || LA101_0 == EMPTY || LA101_0 == EXISTS || LA101_0 == FALSE || LA101_0 == IDENT || LA101_0 == INDICES || LA101_0 == MAX || ( LA101_0 >= MIN && LA101_0 <= MINUS ) || LA101_0 == NOT || ( LA101_0 >= NULL && LA101_0 <= NUM_LONG ) || LA101_0 == OPEN || ( LA101_0 >= PARAM && LA101_0 <= PLUS ) || LA101_0 == QUOTED_String || LA101_0 == SOME || LA101_0 == SUM || LA101_0 == TRUE ) ) { alt101 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 101 , 0 , input ) ; throw nvae ; } switch ( alt101 ) { case 1 : { pushFollow ( FOLLOW_subQuery_in_compoundExpr3338 ) ; subQuery282 = subQuery ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , subQuery282 . getTree ( ) ) ; } break ; case 2 : { { pushFollow ( FOLLOW_expression_in_compoundExpr3343 ) ; expression283 = expression ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , expression283 . getTree ( ) ) ; loop100 : while ( true ) { int alt100 = 2 ; int LA100_0 = input . LA ( 1 ) ; if ( ( LA100_0 == COMMA ) ) { alt100 = 1 ; } switch ( alt100 ) { case 1 : { COMMA284 = ( Token ) match ( input , COMMA , FOLLOW_COMMA_in_compoundExpr3346 ) ; pushFollow ( FOLLOW_expression_in_compoundExpr3349 ) ; expression285 = expression ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , expression285 . getTree ( ) ) ; } break ; default : break loop100 ; } } } } break ; } CLOSE286 = ( Token ) match ( input , CLOSE , FOLLOW_CLOSE_in_compoundExpr3356 ) ; } } break ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { } return retval ; }
hql.g:653:1: compoundExpr : ( collectionExpr | path | ( OPEN ! ( subQuery | ( expression ( COMMA ! expression )* ) ) CLOSE !) );