db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattba...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg/oql OQLParser.java
Date Tue, 24 Jun 2003 21:43:27 GMT
mattbaird    2003/06/24 14:43:27

  Modified:    src/java/org/apache/ojb/odmg/oql OQLParser.java
  Log:
  add prefetching functionality to OQL. prefetch statements should be comma separated at the
end of the query. ie: 
  
  select allProductGroups from " + ProductGroup.class.getName() + " where groupId <= $1
order by groupId prefetch allArticlesInGroup
  
  Revision  Changes    Path
  1.13      +278 -198  db-ojb/src/java/org/apache/ojb/odmg/oql/OQLParser.java
  
  Index: OQLParser.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/oql/OQLParser.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- OQLParser.java	21 Jun 2003 11:05:20 -0000	1.12
  +++ OQLParser.java	24 Jun 2003 21:43:27 -0000	1.13
  @@ -40,23 +40,25 @@
    */
   package org.apache.ojb.odmg.oql;
   
  -import java.util.ArrayList;
  -import java.util.Collection;
  -import java.util.Vector;
  +import org.apache.ojb.broker.query.*;
  +import java.util.*;
   
  -import org.apache.ojb.broker.query.Criteria;
  -import org.apache.ojb.broker.query.Query;
  -import org.apache.ojb.broker.query.QueryByCriteria;
  -import org.apache.ojb.broker.query.QueryFactory;
  -import org.apache.ojb.broker.util.ClassHelper;
  -import antlr.NoViableAltException;
  -import antlr.ParserSharedInputState;
  -import antlr.RecognitionException;
  -import antlr.Token;
   import antlr.TokenBuffer;
  -import antlr.TokenStream;
   import antlr.TokenStreamException;
  +import antlr.TokenStreamIOException;
  +import antlr.ANTLRException;
  +import antlr.LLkParser;
  +import antlr.Token;
  +import antlr.TokenStream;
  +import antlr.RecognitionException;
  +import antlr.NoViableAltException;
  +import antlr.MismatchedTokenException;
  +import antlr.SemanticException;
  +import antlr.ParserSharedInputState;
   import antlr.collections.impl.BitSet;
  +import antlr.collections.AST;
  +import antlr.ASTPair;
  +import antlr.collections.impl.ASTArray;
   
   public class OQLParser extends antlr.LLkParser
          implements OQLLexerTokenTypes
  @@ -87,8 +89,8 @@
   
   	public final Query  buildQuery() throws RecognitionException, TokenStreamException {
   		Query query = null;
  -
  -
  +		
  +		
   		try {      // for error handling
   			query=selectQuery();
   			{
  @@ -100,7 +102,7 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   		}
   		catch (RecognitionException ex) {
  @@ -110,32 +112,32 @@
   		}
   		return query;
   	}
  -
  +	
   	public final QueryByCriteria  selectQuery() throws RecognitionException, TokenStreamException
{
   		QueryByCriteria query = null;
  -
  -
  +		
  +		
   		try {      // for error handling
  -
  +			
   			Class clazz = null;
   			Criteria criteria = new Criteria();
   			String[] projectionAttrs;
   			boolean distinct = false;
  -
  +			
   			match(LITERAL_select);
   			{
   			if ((LA(1)==LITERAL_distinct)) {
   				match(LITERAL_distinct);
  -
  +				
   				distinct = true;
  -
  +				
   			}
   			else if ((LA(1)==TOK_STAR||LA(1)==Identifier)) {
   			}
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			projectionAttrs=projectionAttributes();
   			match(LITERAL_from);
  @@ -150,9 +152,9 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
  -
  +			
   			if (clazz != null) {
   			if (projectionAttrs[0].indexOf('.') < 0)
   			{
  @@ -168,71 +170,83 @@
   			criteria, distinct);
   			}
   			}
  -
  +			
   			{
   			if ((LA(1)==LITERAL_order)) {
   				match(LITERAL_order);
   				match(LITERAL_by);
   				orderClause(query);
   			}
  +			else if ((_tokenSet_2.member(LA(1)))) {
  +			}
  +			else {
  +				throw new NoViableAltException(LT(1), getFilename());
  +			}
  +			
  +			}
  +			{
  +			if ((LA(1)==LITERAL_prefetch)) {
  +				match(LITERAL_prefetch);
  +				prefetchClause(query);
  +			}
   			else if ((LA(1)==EOF||LA(1)==TOK_RPAREN||LA(1)==TOK_SEMIC)) {
   			}
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_2);
  +			consumeUntil(_tokenSet_3);
   		}
   		return query;
   	}
  -
  +	
   	public final String[]  projectionAttributes() throws RecognitionException, TokenStreamException
{
   		String[] projectionAttrs = null;
  -
  +		
   		Token  id = null;
   		Token  id1 = null;
  -
  +		
   		try {      // for error handling
  -
  +			
   			String first = null;
   			ArrayList list = null;
  -
  +			
   			{
   			if ((LA(1)==Identifier)) {
   				id = LT(1);
   				match(Identifier);
   				{
  -
  +				
   				first = id.getText();
  -
  +				
   				}
   				{
  -				_loop78:
  +				_loop79:
   				do {
   					if ((LA(1)==TOK_COMMA)) {
   						match(TOK_COMMA);
   						id1 = LT(1);
   						match(Identifier);
   						{
  -
  +						
   						if (list == null)
   						{
   						list = new ArrayList();
   						list.add(first);
   						}
   						list.add(id1.getText());
  -
  +						
   						}
   					}
   					else {
  -						break _loop78;
  +						break _loop79;
   					}
  -
  +					
   				} while (true);
   				}
   			}
  @@ -242,9 +256,9 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
  -
  +			
   			if (list == null)
   			{
   			projectionAttrs = new String[] {first};
  @@ -253,73 +267,74 @@
   			{
   			projectionAttrs = (String[]) list.toArray(new String[list.size()]);
   			}
  -
  -
  +			
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_3);
  +			consumeUntil(_tokenSet_4);
   		}
   		return projectionAttrs;
   	}
  -
  +	
   	public final Class  fromClause() throws RecognitionException, TokenStreamException {
   		Class clazz = null;
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
   			id = LT(1);
   			match(Identifier);
  -
  +			
   			try {
  -			clazz = ClassHelper.getClass(id.getText());
  +			clazz = Class.forName(id.getText(), true,
  +			Thread.currentThread().getContextClassLoader());
   			} catch (Exception e) {
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_4);
  +			consumeUntil(_tokenSet_5);
   		}
   		return clazz;
   	}
  -
  +	
   	public final void whereClause(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
   			orExpr(criteria);
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void orderClause(
   		QueryByCriteria query
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
   			sortCriterion(query);
   			{
  -			_loop81:
  +			_loop82:
   			do {
   				if ((LA(1)==TOK_COMMA)) {
   					match(TOK_COMMA);
   					sortCriterion(query);
   				}
   				else {
  -					break _loop81;
  +					break _loop82;
   				}
  -
  +				
   			} while (true);
   			}
   		}
  @@ -329,16 +344,44 @@
   			consumeUntil(_tokenSet_2);
   		}
   	}
  -
  +	
  +	public final void prefetchClause(
  +		QueryByCriteria query
  +	) throws RecognitionException, TokenStreamException {
  +		
  +		
  +		try {      // for error handling
  +			prefetchCriterion(query);
  +			{
  +			_loop88:
  +			do {
  +				if ((LA(1)==TOK_COMMA)) {
  +					match(TOK_COMMA);
  +					prefetchCriterion(query);
  +				}
  +				else {
  +					break _loop88;
  +				}
  +				
  +			} while (true);
  +			}
  +		}
  +		catch (RecognitionException ex) {
  +			reportError(ex);
  +			consume();
  +			consumeUntil(_tokenSet_3);
  +		}
  +	}
  +	
   	public final Query  existsQuery() throws RecognitionException, TokenStreamException {
   		Query query = null;
  -
  -
  +		
  +		
   		try {      // for error handling
  -
  +			
   			Class clazz = null;
   			Criteria criteria = new Criteria();
  -
  +			
   			match(LITERAL_exists);
   			projectionAttributes();
   			match(LITERAL_in);
  @@ -348,63 +391,63 @@
   				match(TOK_COLON);
   				whereClause(criteria);
   			}
  -			else if ((_tokenSet_5.member(LA(1)))) {
  +			else if ((_tokenSet_6.member(LA(1)))) {
   			}
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
  -
  +			
   			if (clazz != null) {
   			query = QueryFactory.newQuery(clazz, criteria);
   			}
  -
  +					
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   		return query;
   	}
  -
  +	
   	public final void orExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
   			andExpr(criteria);
   			{
  -			_loop87:
  +			_loop92:
   			do {
  -				if ((LA(1)==LITERAL_or) && (_tokenSet_6.member(LA(2))) && (_tokenSet_7.member(LA(3))))
{
  +				if ((LA(1)==LITERAL_or) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3))))
{
   					match(LITERAL_or);
   					Criteria orCriteria = new Criteria();
   					andExpr(orCriteria);
   					criteria.addOrCriteria(orCriteria);
   				}
   				else {
  -					break _loop87;
  +					break _loop92;
   				}
  -
  +				
   			} while (true);
   			}
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void sortCriterion(
   		QueryByCriteria query
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
   			boolean descending = false;
   			id = LT(1);
  @@ -423,66 +466,86 @@
   				else {
   					throw new NoViableAltException(LT(1), getFilename());
   				}
  -
  +				
   				}
   			}
  -			else if ((_tokenSet_8.member(LA(1)))) {
  +			else if ((_tokenSet_9.member(LA(1)))) {
   			}
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
  -
  +			
   			if (descending) {
   			query.addOrderByDescending(id.getText());
   			} else {
   			query.addOrderByAscending(id.getText());
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_8);
  +			consumeUntil(_tokenSet_9);
   		}
   	}
  -
  +	
  +	public final void prefetchCriterion(
  +		QueryByCriteria query
  +	) throws RecognitionException, TokenStreamException {
  +		
  +		Token  id = null;
  +		
  +		try {      // for error handling
  +			id = LT(1);
  +			match(Identifier);
  +			
  +			query.addPrefetchedRelationship(id.getText());
  +			
  +		}
  +		catch (RecognitionException ex) {
  +			reportError(ex);
  +			consume();
  +			consumeUntil(_tokenSet_10);
  +		}
  +	}
  +	
   	public final void andExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
   			quantifierExpr(criteria);
   			{
  -			_loop90:
  +			_loop95:
   			do {
  -				if ((LA(1)==LITERAL_and) && (_tokenSet_6.member(LA(2))) && (_tokenSet_7.member(LA(3))))
{
  +				if ((LA(1)==LITERAL_and) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3))))
{
   					match(LITERAL_and);
   					Criteria andCriteria = new Criteria();
   					quantifierExpr(andCriteria);
   					criteria.addAndCriteria(andCriteria);
   				}
   				else {
  -					break _loop90;
  +					break _loop95;
   				}
  -
  +				
   			} while (true);
   			}
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void quantifierExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
   			switch ( LA(1)) {
   			case TOK_LPAREN:
  @@ -505,16 +568,16 @@
   				break;
   			}
   			default:
  -				if ((LA(1)==Identifier) && (_tokenSet_9.member(LA(2)))) {
  +				if ((LA(1)==Identifier) && (_tokenSet_11.member(LA(2)))) {
   					equalityExpr(criteria);
   				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_like) &&
(_tokenSet_10.member(LA(3)))) {
  +				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_like) &&
(_tokenSet_12.member(LA(3)))) {
   					likeExpr(criteria);
   				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_between)
&& (_tokenSet_11.member(LA(3)))) {
  +				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_between)
&& (_tokenSet_13.member(LA(3)))) {
   					betweenExpr(criteria);
   				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_in||LA(2)==LITERAL_not) &&
(LA(3)==TOK_LPAREN||LA(3)==LITERAL_in)) {
  +				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_in||LA(2)==LITERAL_not) &&
(LA(3)==TOK_LPAREN||LA(3)==LITERAL_in||LA(3)==LITERAL_list)) {
   					inExpr(criteria);
   				}
   			else {
  @@ -525,20 +588,20 @@
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void equalityExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
  -
  +			
   				Object value = null;
  -
  +			
   			id = LT(1);
   			match(Identifier);
   			{
  @@ -552,14 +615,14 @@
   					match(LITERAL_nil);
   					criteria.addIsNull(id.getText());
   				}
  -				else if ((_tokenSet_12.member(LA(1)))) {
  +				else if ((_tokenSet_14.member(LA(1)))) {
   					value=literal();
   					criteria.addEqualTo(id.getText(), value);
   				}
   				else {
   					throw new NoViableAltException(LT(1), getFilename());
   				}
  -
  +				
   				}
   				break;
   			}
  @@ -571,14 +634,14 @@
   					match(LITERAL_nil);
   					criteria.addNotNull(id.getText());
   				}
  -				else if ((_tokenSet_12.member(LA(1)))) {
  +				else if ((_tokenSet_14.member(LA(1)))) {
   					value=literal();
   					criteria.addNotEqualTo(id.getText(), value);
   				}
   				else {
   					throw new NoViableAltException(LT(1), getFilename());
   				}
  -
  +				
   				}
   				break;
   			}
  @@ -590,14 +653,14 @@
   					match(LITERAL_nil);
   					criteria.addNotNull(id.getText());
   				}
  -				else if ((_tokenSet_12.member(LA(1)))) {
  +				else if ((_tokenSet_14.member(LA(1)))) {
   					value=literal();
   					criteria.addNotEqualTo(id.getText(), value);
   				}
   				else {
   					throw new NoViableAltException(LT(1), getFilename());
   				}
  -
  +				
   				}
   				break;
   			}
  @@ -640,21 +703,21 @@
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void likeExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
  -
  +			
   			boolean negative = false;
   			Object value = null;
  -
  +			
   			id = LT(1);
   			match(Identifier);
   			{
  @@ -667,31 +730,31 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			match(LITERAL_like);
   			value=literal();
  -
  +			
   			if (negative) {
   			criteria.addNotLike(id.getText(), value);
   			} else {
   			criteria.addLike(id.getText(), value);
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void undefinedExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
   			boolean negative = false;
   			{
  @@ -706,39 +769,39 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			match(TOK_LPAREN);
   			id = LT(1);
   			match(Identifier);
   			match(TOK_RPAREN);
  -
  +			
   			if (negative) {
   			criteria.addNotNull(id.getText());
   			} else {
   			criteria.addIsNull(id.getText());
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void betweenExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
  -
  +			
   			boolean negative = false;
   			Object lower = null;
   			Object upper = null;
  -
  +			
   			id = LT(1);
   			match(Identifier);
   			{
  @@ -751,38 +814,38 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			match(LITERAL_between);
   			lower=literal();
   			match(LITERAL_and);
   			upper=literal();
  -
  +			
   			if (negative) {
   			criteria.addNotBetween(id.getText(), lower, upper);
   			} else {
   			criteria.addBetween(id.getText(), lower, upper);
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void inExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  +		
   		Token  id = null;
  -
  +		
   		try {      // for error handling
  -
  +			
   				 boolean negative = false;
   				 Collection coll;
  -
  +			
   			id = LT(1);
   			match(Identifier);
   			{
  @@ -795,35 +858,46 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			match(LITERAL_in);
  +			{
  +			if ((LA(1)==LITERAL_list)) {
  +				match(LITERAL_list);
  +			}
  +			else if ((LA(1)==TOK_LPAREN)) {
  +			}
  +			else {
  +				throw new NoViableAltException(LT(1), getFilename());
  +			}
  +			
  +			}
   			coll=argList();
  -
  +			
   			if (negative) {
   			criteria.addNotIn(id.getText(), coll);
   			} else {
   			criteria.addIn(id.getText(), coll);
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final void existsExpr(
   		Criteria criteria
   	) throws RecognitionException, TokenStreamException {
  -
  -
  +		
  +		
   		try {      // for error handling
  -
  +			
   			Query subQuery = null;
   			boolean negative = false;
  -
  +			
   			{
   			if ((LA(1)==LITERAL_not)) {
   				match(LITERAL_not);
  @@ -834,7 +908,7 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			{
   			if ((LA(1)==LITERAL_exists) && (LA(2)==TOK_LPAREN)) {
  @@ -849,26 +923,26 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
  -
  +			
   			if (negative) {
   			criteria.addNotExists(subQuery);
   			} else {
   			criteria.addExists(subQuery);
   			}
  -
  +			
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   	}
  -
  +	
   	public final Object  literal() throws RecognitionException, TokenStreamException {
   		Object value = null;
  -
  +		
   		Token  tokInt = null;
   		Token  tokADbl = null;
   		Token  tokEDbl = null;
  @@ -877,7 +951,7 @@
   		Token  tokDate = null;
   		Token  tokTime = null;
   		Token  tokTs = null;
  -
  +		
   		try {      // for error handling
   			switch ( LA(1)) {
   			case TOK_DOLLAR:
  @@ -903,7 +977,7 @@
   			{
   				tokInt = LT(1);
   				match(TOK_UNSIGNED_INTEGER);
  -
  +				
   					try
   					{
   						value = Integer.valueOf(tokInt.getText());
  @@ -912,7 +986,7 @@
   					{
   						value = Long.valueOf(tokInt.getText());
   					}
  -
  +				
   				break;
   			}
   			case TOK_APPROXIMATE_NUMERIC_LITERAL:
  @@ -976,27 +1050,27 @@
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_13);
  +			consumeUntil(_tokenSet_15);
   		}
   		return value;
   	}
  -
  +	
   	public final Collection  argList() throws RecognitionException, TokenStreamException {
   		Collection coll = null;
  -
  -
  +		
  +		
   		try {      // for error handling
  -
  +			
   					Collection temp = new Vector();
   				    Object val;
  -
  +				
   			match(TOK_LPAREN);
   			{
  -			if ((_tokenSet_12.member(LA(1)))) {
  +			if ((_tokenSet_14.member(LA(1)))) {
   				val=literal();
   				if (val != null) {temp.add(val);}
   				{
  -				_loop113:
  +				_loop119:
   				do {
   					if ((LA(1)==TOK_COMMA)) {
   						match(TOK_COMMA);
  @@ -1004,9 +1078,9 @@
   						if (val != null) {temp.add(val);}
   					}
   					else {
  -						break _loop113;
  +						break _loop119;
   					}
  -
  +					
   				} while (true);
   				}
   			}
  @@ -1015,22 +1089,22 @@
   			else {
   				throw new NoViableAltException(LT(1), getFilename());
   			}
  -
  +			
   			}
   			match(TOK_RPAREN);
  -
  +			
   					if (!temp.isEmpty()) {coll = temp;}
  -
  +					
   		}
   		catch (RecognitionException ex) {
   			reportError(ex);
   			consume();
  -			consumeUntil(_tokenSet_5);
  +			consumeUntil(_tokenSet_6);
   		}
   		return coll;
   	}
  -
  -
  +	
  +	
   	public static final String[] _tokenNames = {
   		"<0>",
   		"EOF",
  @@ -1076,6 +1150,7 @@
   		"\"where\"",
   		"\"order\"",
   		"\"by\"",
  +		"\"prefetch\"",
   		"\"exists\"",
   		"\"in\"",
   		"\"asc\"",
  @@ -1084,6 +1159,7 @@
   		"\"and\"",
   		"\"nil\"",
   		"\"not\"",
  +		"\"list\"",
   		"\"between\"",
   		"\"is_undefined\"",
   		"\"is_defined\"",
  @@ -1094,34 +1170,38 @@
   		"\"time\"",
   		"\"timestamp\""
   	};
  -
  +	
   	private static final long _tokenSet_0_data_[] = { 2L, 0L };
   	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
  -	private static final long _tokenSet_1_data_[] = { 4398046511250L, 0L };
  +	private static final long _tokenSet_1_data_[] = { 21990232555666L, 0L };
   	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
  -	private static final long _tokenSet_2_data_[] = { 146L, 0L };
  +	private static final long _tokenSet_2_data_[] = { 17592186044562L, 0L };
   	public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
  -	private static final long _tokenSet_3_data_[] = { 36283883716608L, 0L };
  +	private static final long _tokenSet_3_data_[] = { 146L, 0L };
   	public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
  -	private static final long _tokenSet_4_data_[] = { 851021999899026L, 0L };
  +	private static final long _tokenSet_4_data_[] = { 71468255805440L, 0L };
   	public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
  -	private static final long _tokenSet_5_data_[] = { 848822976643218L, 0L };
  +	private static final long _tokenSet_5_data_[] = { 1713039116075410L, 0L };
   	public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
  -	private static final long _tokenSet_6_data_[] = { 29290990032388128L, 0L };
  +	private static final long _tokenSet_6_data_[] = { 1710840092819602L, 0L };
   	public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
  -	private static final long _tokenSet_7_data_[] = { 69858571059138592L, 0L };
  +	private static final long _tokenSet_7_data_[] = { 112625175324786720L, 0L };
   	public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
  -	private static final long _tokenSet_8_data_[] = { 210L, 0L };
  +	private static final long _tokenSet_8_data_[] = { 274825130662629408L, 0L };
   	public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
  -	private static final long _tokenSet_9_data_[] = { 8261632L, 0L };
  +	private static final long _tokenSet_9_data_[] = { 17592186044626L, 0L };
   	public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
  -	private static final long _tokenSet_10_data_[] = { 2269814228871282688L, 0L };
  +	private static final long _tokenSet_10_data_[] = { 210L, 0L };
   	public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
  -	private static final long _tokenSet_11_data_[] = { 2238289031479689216L, 0L };
  +	private static final long _tokenSet_11_data_[] = { 8261632L, 0L };
   	public static final BitSet _tokenSet_11 = new BitSet(_tokenSet_11_data_);
  -	private static final long _tokenSet_12_data_[] = { 2233785431852318720L, 0L };
  +	private static final long _tokenSet_12_data_[] = { 9079256865455472640L, 0L };
   	public static final BitSet _tokenSet_12 = new BitSet(_tokenSet_12_data_);
  -	private static final long _tokenSet_13_data_[] = { 848822976643282L, 0L };
  +	private static final long _tokenSet_13_data_[] = { 8953156075889098752L, 0L };
   	public static final BitSet _tokenSet_13 = new BitSet(_tokenSet_13_data_);
  -
  +	private static final long _tokenSet_14_data_[] = { 8935141677379616768L, 0L };
  +	public static final BitSet _tokenSet_14 = new BitSet(_tokenSet_14_data_);
  +	private static final long _tokenSet_15_data_[] = { 1710840092819666L, 0L };
  +	public static final BitSet _tokenSet_15 = new BitSet(_tokenSet_15_data_);
  +	
   	}
  
  
  

Mime
View raw message