You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by to...@apache.org on 2006/11/02 22:57:43 UTC

svn commit: r470538 [1/2] - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/exp/ main/java/org/apache/cayenne/exp/parser/ test/java/org/apache/cayenne/exp/ test/java/org/...

Author: torehalset
Date: Thu Nov  2 13:57:42 2006
New Revision: 470538

URL: http://svn.apache.org/viewvc?view=rev&rev=470538
Log:
CAY-696 - true/false in expression
 TODO: true/false in sql does not work on all databases..

Added:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTFalse.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTTrue.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/Expression.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.jjt
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/JavaCharStream.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/query/SelectQueryTst.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/trans/QualifierTranslator.java Thu Nov  2 13:57:42 2006
@@ -277,7 +277,7 @@
 
     public void startNode(Expression node, Expression parentNode) {
         int count = node.getOperandCount();
-
+        
         if (count == 2) {
             // binary nodes are the only ones that currently require this
             detectObjectMatch(node);
@@ -286,6 +286,14 @@
         if (parenthesisNeeded(node, parentNode)) {
             qualBuf.append('(');
         }
+        
+        if (count == 0) {
+            if (node.getType() == Expression.TRUE || node.getType() == Expression.FALSE) {
+                // TODO: some databases do not handle true/false
+                // "true" or "false"
+                qualBuf.append(node.evaluate(null).toString());
+            }
+        }
 
         if (count == 1) {
             if (node.getType() == Expression.NEGATIVE)
@@ -351,7 +359,13 @@
 
         if (node.getType() == Expression.DB_PATH)
             return false;
+        
+        if (node.getType() == Expression.TRUE)
+            return false;
 
+        if (node.getType() == Expression.FALSE)
+            return false;
+        
         return true;
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/Expression.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/Expression.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/Expression.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/Expression.java Thu Nov  2 13:57:42 2006
@@ -70,6 +70,8 @@
     public static final int MULTIPLY = 18;
     public static final int DIVIDE = 19;
     public static final int NEGATIVE = 20;
+    public static final int TRUE = 21;
+    public static final int FALSE = 22;
 
     /**
      * Expression describes a path relative to an ObjEntity. OBJ_PATH expression is

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java Thu Nov  2 13:57:42 2006
@@ -31,6 +31,7 @@
 import org.apache.cayenne.exp.parser.ASTDbPath;
 import org.apache.cayenne.exp.parser.ASTDivide;
 import org.apache.cayenne.exp.parser.ASTEqual;
+import org.apache.cayenne.exp.parser.ASTFalse;
 import org.apache.cayenne.exp.parser.ASTGreater;
 import org.apache.cayenne.exp.parser.ASTGreaterOrEqual;
 import org.apache.cayenne.exp.parser.ASTIn;
@@ -50,6 +51,7 @@
 import org.apache.cayenne.exp.parser.ASTObjPath;
 import org.apache.cayenne.exp.parser.ASTOr;
 import org.apache.cayenne.exp.parser.ASTSubtract;
+import org.apache.cayenne.exp.parser.ASTTrue;
 import org.apache.cayenne.exp.parser.SimpleNode;
 
 /**
@@ -74,7 +76,7 @@
                 Expression.MULTIPLY, Expression.DIVIDE, Expression.NEGATIVE,
                 Expression.OBJ_PATH, Expression.DB_PATH, Expression.LIST,
                 Expression.NOT_BETWEEN, Expression.NOT_IN, Expression.NOT_LIKE,
-                Expression.NOT_LIKE_IGNORE_CASE
+                Expression.NOT_LIKE_IGNORE_CASE, Expression.TRUE, Expression.FALSE
         };
 
         int max = 0;
@@ -126,6 +128,9 @@
         typeLookup[Expression.OBJ_PATH] = ASTObjPath.class;
         typeLookup[Expression.DB_PATH] = ASTDbPath.class;
         typeLookup[Expression.LIST] = ASTList.class;
+        
+        typeLookup[Expression.TRUE] = ASTTrue.class;
+        typeLookup[Expression.FALSE] = ASTFalse.class;
     }
 
     /**
@@ -515,6 +520,24 @@
      */
     public static Expression notLikeIgnoreCaseDbExp(String pathSpec, Object value) {
         return new ASTNotLikeIgnoreCase(new ASTDbPath(pathSpec), value);
+    }
+
+    /**
+     * A convenience shortcut for boolean true expression.
+     * 
+     * @since 3.0
+     */
+    public static Expression expTrue() {
+        return new ASTTrue();
+    }
+
+    /**
+     * A convenience shortcut for boolean false expression.
+     * 
+     * @since 3.0
+     */
+    public static Expression expFalse() {
+        return new ASTFalse();
     }
 
     /**

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTFalse.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTFalse.java?view=auto&rev=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTFalse.java (added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTFalse.java Thu Nov  2 13:57:42 2006
@@ -0,0 +1,72 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.exp.parser;
+
+import java.io.PrintWriter;
+
+import org.apache.cayenne.exp.Expression;
+
+/**
+ * Boolean false expression element
+ * 
+ * Notice that there is one ASTTrue and one ASTFalse instead of a ASTBoolean with a
+ * Boolean value. The main reason for doing this is that a common ASTBoolean will have
+ * operand count of 1 and that will default to a prepared statmenet like " where ? and
+ * (...)", but we only need " where true and (...)".
+ * 
+ * @see ASTTrue
+ * @author halset
+ * @since 3.0
+ */
+public class ASTFalse extends ConditionNode {
+
+    /**
+     * Constructor used by expression parser. Do not invoke directly.
+     */
+    ASTFalse(int id) {
+        super(id);
+    }
+
+    public ASTFalse() {
+        super(ExpressionParserTreeConstants.JJTFALSE);
+    }
+
+    protected Object evaluateNode(Object o) throws Exception {
+        return Boolean.FALSE;
+    }
+
+    protected String getExpressionOperator(int index) {
+        throw new UnsupportedOperationException("No operator for '"
+                + ExpressionParserTreeConstants.jjtNodeName[id]
+                + "'");
+    }
+
+    public Expression shallowCopy() {
+        return new ASTFalse(id);
+    }
+
+    public int getType() {
+        return Expression.FALSE;
+    }
+    
+    public void encodeAsString(PrintWriter pw) {
+        pw.append("false");
+    }
+
+}

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTTrue.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTTrue.java?view=auto&rev=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTTrue.java (added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ASTTrue.java Thu Nov  2 13:57:42 2006
@@ -0,0 +1,72 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.exp.parser;
+
+import java.io.PrintWriter;
+
+import org.apache.cayenne.exp.Expression;
+
+/**
+ * Boolean true expression element
+ * 
+ * Notice that there is one ASTTrue and one ASTFalse instead of a ASTBoolean with a
+ * Boolean value. The main reason for doing this is that a common ASTBoolean will have
+ * operand count of 1 and that will default to a prepared statmenet like " where ? and
+ * (...)", but we only need " where true and (...)".
+ * 
+ * @see ASTFalse
+ * @author halset
+ * @since 3.0
+ */
+public class ASTTrue extends ConditionNode {
+
+    /**
+     * Constructor used by expression parser. Do not invoke directly.
+     */
+    ASTTrue(int id) {
+        super(id);
+    }
+
+    public ASTTrue() {
+        super(ExpressionParserTreeConstants.JJTTRUE);
+    }
+
+    protected Object evaluateNode(Object o) throws Exception {
+        return Boolean.TRUE;
+    }
+
+    protected String getExpressionOperator(int index) {
+        throw new UnsupportedOperationException("No operator for '"
+                + ExpressionParserTreeConstants.jjtNodeName[id]
+                + "'");
+    }
+
+    public Expression shallowCopy() {
+        return new ASTTrue(id);
+    }
+
+    public int getType() {
+        return Expression.TRUE;
+    }
+    
+    public void encodeAsString(PrintWriter pw) {
+        pw.append("true");
+    }
+
+}

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java Thu Nov  2 13:57:42 2006
@@ -180,6 +180,8 @@
     case 25:
     case 26:
     case NULL:
+    case TRUE:
+    case FALSE:
     case PROPERTY_PATH:
     case SINGLE_QUOTED_STRING:
     case DOUBLE_QUOTED_STRING:
@@ -195,167 +197,150 @@
   }
 
   final public void simpleCondition() throws ParseException {
-    scalarExpression();
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-    case 11:
-    case 12:
-    case 13:
-    case 14:
-    case 15:
-    case 18:
+    case TRUE:
+          ASTTrue jjtn001 = new ASTTrue(JJTTRUE);
+          boolean jjtc001 = true;
+          jjtree.openNodeScope(jjtn001);
+      try {
+        jj_consume_token(TRUE);
+      } finally {
+          if (jjtc001) {
+            jjtree.closeNodeScope(jjtn001, true);
+          }
+      }
+      break;
+    case FALSE:
+          ASTFalse jjtn002 = new ASTFalse(JJTFALSE);
+          boolean jjtc002 = true;
+          jjtree.openNodeScope(jjtn002);
+      try {
+        jj_consume_token(FALSE);
+      } finally {
+          if (jjtc002) {
+            jjtree.closeNodeScope(jjtn002, true);
+          }
+      }
+      break;
+    case 16:
+    case 20:
+    case 21:
+    case 24:
+    case 25:
+    case 26:
+    case NULL:
+    case PROPERTY_PATH:
+    case SINGLE_QUOTED_STRING:
+    case DOUBLE_QUOTED_STRING:
+    case INT_LITERAL:
+    case FLOAT_LITERAL:
+      scalarExpression();
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case 3:
       case 4:
-        simpleNotCondition();
-        break;
       case 5:
       case 6:
+      case 7:
+      case 8:
+      case 9:
+      case 10:
+      case 11:
+      case 12:
+      case 13:
+      case 14:
+      case 15:
+      case 18:
         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case 5:
-          jj_consume_token(5);
+        case 3:
+        case 4:
+          simpleNotCondition();
           break;
+        case 5:
         case 6:
-          jj_consume_token(6);
-          break;
-        default:
-          jj_la1[4] = jj_gen;
-          jj_consume_token(-1);
-          throw new ParseException();
-        }
-                          ASTEqual jjtn001 = new ASTEqual(JJTEQUAL);
-                          boolean jjtc001 = true;
-                          jjtree.openNodeScope(jjtn001);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte001) {
-                          if (jjtc001) {
-                            jjtree.clearNodeScope(jjtn001);
-                            jjtc001 = false;
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case 5:
+            jj_consume_token(5);
+            break;
+          case 6:
+            jj_consume_token(6);
+            break;
+          default:
+            jj_la1[4] = jj_gen;
+            jj_consume_token(-1);
+            throw new ParseException();
+          }
+                          ASTEqual jjtn003 = new ASTEqual(JJTEQUAL);
+                          boolean jjtc003 = true;
+                          jjtree.openNodeScope(jjtn003);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte003) {
+                          if (jjtc003) {
+                            jjtree.clearNodeScope(jjtn003);
+                            jjtc003 = false;
                           } else {
                             jjtree.popNode();
                           }
-                          if (jjte001 instanceof RuntimeException) {
-                            {if (true) throw (RuntimeException)jjte001;}
+                          if (jjte003 instanceof RuntimeException) {
+                            {if (true) throw (RuntimeException)jjte003;}
                           }
-                          if (jjte001 instanceof ParseException) {
-                            {if (true) throw (ParseException)jjte001;}
+                          if (jjte003 instanceof ParseException) {
+                            {if (true) throw (ParseException)jjte003;}
                           }
-                          {if (true) throw (Error)jjte001;}
-        } finally {
-                          if (jjtc001) {
-                            jjtree.closeNodeScope(jjtn001,  2);
+                          {if (true) throw (Error)jjte003;}
+          } finally {
+                          if (jjtc003) {
+                            jjtree.closeNodeScope(jjtn003,  2);
                           }
-        }
-        break;
-      case 7:
-      case 8:
-        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-        case 7:
-          jj_consume_token(7);
+          }
           break;
+        case 7:
         case 8:
-          jj_consume_token(8);
-          break;
-        default:
-          jj_la1[5] = jj_gen;
-          jj_consume_token(-1);
-          throw new ParseException();
-        }
-                           ASTNotEqual jjtn002 = new ASTNotEqual(JJTNOTEQUAL);
-                           boolean jjtc002 = true;
-                           jjtree.openNodeScope(jjtn002);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte002) {
-                           if (jjtc002) {
-                             jjtree.clearNodeScope(jjtn002);
-                             jjtc002 = false;
+          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+          case 7:
+            jj_consume_token(7);
+            break;
+          case 8:
+            jj_consume_token(8);
+            break;
+          default:
+            jj_la1[5] = jj_gen;
+            jj_consume_token(-1);
+            throw new ParseException();
+          }
+                           ASTNotEqual jjtn004 = new ASTNotEqual(JJTNOTEQUAL);
+                           boolean jjtc004 = true;
+                           jjtree.openNodeScope(jjtn004);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte004) {
+                           if (jjtc004) {
+                             jjtree.clearNodeScope(jjtn004);
+                             jjtc004 = false;
                            } else {
                              jjtree.popNode();
                            }
-                           if (jjte002 instanceof RuntimeException) {
-                             {if (true) throw (RuntimeException)jjte002;}
+                           if (jjte004 instanceof RuntimeException) {
+                             {if (true) throw (RuntimeException)jjte004;}
                            }
-                           if (jjte002 instanceof ParseException) {
-                             {if (true) throw (ParseException)jjte002;}
+                           if (jjte004 instanceof ParseException) {
+                             {if (true) throw (ParseException)jjte004;}
                            }
-                           {if (true) throw (Error)jjte002;}
-        } finally {
-                           if (jjtc002) {
-                             jjtree.closeNodeScope(jjtn002,  2);
+                           {if (true) throw (Error)jjte004;}
+          } finally {
+                           if (jjtc004) {
+                             jjtree.closeNodeScope(jjtn004,  2);
                            }
-        }
-        break;
-      case 9:
-        jj_consume_token(9);
-                 ASTLessOrEqual jjtn003 = new ASTLessOrEqual(JJTLESSOREQUAL);
-                 boolean jjtc003 = true;
-                 jjtree.openNodeScope(jjtn003);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte003) {
-                 if (jjtc003) {
-                   jjtree.clearNodeScope(jjtn003);
-                   jjtc003 = false;
-                 } else {
-                   jjtree.popNode();
-                 }
-                 if (jjte003 instanceof RuntimeException) {
-                   {if (true) throw (RuntimeException)jjte003;}
-                 }
-                 if (jjte003 instanceof ParseException) {
-                   {if (true) throw (ParseException)jjte003;}
-                 }
-                 {if (true) throw (Error)jjte003;}
-        } finally {
-                 if (jjtc003) {
-                   jjtree.closeNodeScope(jjtn003,  2);
-                 }
-        }
-        break;
-      case 10:
-        jj_consume_token(10);
-                ASTLess jjtn004 = new ASTLess(JJTLESS);
-                boolean jjtc004 = true;
-                jjtree.openNodeScope(jjtn004);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte004) {
-                if (jjtc004) {
-                  jjtree.clearNodeScope(jjtn004);
-                  jjtc004 = false;
-                } else {
-                  jjtree.popNode();
-                }
-                if (jjte004 instanceof RuntimeException) {
-                  {if (true) throw (RuntimeException)jjte004;}
-                }
-                if (jjte004 instanceof ParseException) {
-                  {if (true) throw (ParseException)jjte004;}
-                }
-                {if (true) throw (Error)jjte004;}
-        } finally {
-                if (jjtc004) {
-                  jjtree.closeNodeScope(jjtn004,  2);
-                }
-        }
-        break;
-      case 11:
-        jj_consume_token(11);
-                 ASTGreater jjtn005 = new ASTGreater(JJTGREATER);
+          }
+          break;
+        case 9:
+          jj_consume_token(9);
+                 ASTLessOrEqual jjtn005 = new ASTLessOrEqual(JJTLESSOREQUAL);
                  boolean jjtc005 = true;
                  jjtree.openNodeScope(jjtn005);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte005) {
+          try {
+            scalarExpression();
+          } catch (Throwable jjte005) {
                  if (jjtc005) {
                    jjtree.clearNodeScope(jjtn005);
                    jjtc005 = false;
@@ -369,171 +354,231 @@
                    {if (true) throw (ParseException)jjte005;}
                  }
                  {if (true) throw (Error)jjte005;}
-        } finally {
+          } finally {
                  if (jjtc005) {
                    jjtree.closeNodeScope(jjtn005,  2);
                  }
-        }
-        break;
-      case 12:
-        jj_consume_token(12);
-                 ASTGreaterOrEqual jjtn006 = new ASTGreaterOrEqual(JJTGREATEROREQUAL);
-                 boolean jjtc006 = true;
-                 jjtree.openNodeScope(jjtn006);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte006) {
-                 if (jjtc006) {
-                   jjtree.clearNodeScope(jjtn006);
-                   jjtc006 = false;
+          }
+          break;
+        case 10:
+          jj_consume_token(10);
+                ASTLess jjtn006 = new ASTLess(JJTLESS);
+                boolean jjtc006 = true;
+                jjtree.openNodeScope(jjtn006);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte006) {
+                if (jjtc006) {
+                  jjtree.clearNodeScope(jjtn006);
+                  jjtc006 = false;
+                } else {
+                  jjtree.popNode();
+                }
+                if (jjte006 instanceof RuntimeException) {
+                  {if (true) throw (RuntimeException)jjte006;}
+                }
+                if (jjte006 instanceof ParseException) {
+                  {if (true) throw (ParseException)jjte006;}
+                }
+                {if (true) throw (Error)jjte006;}
+          } finally {
+                if (jjtc006) {
+                  jjtree.closeNodeScope(jjtn006,  2);
+                }
+          }
+          break;
+        case 11:
+          jj_consume_token(11);
+                 ASTGreater jjtn007 = new ASTGreater(JJTGREATER);
+                 boolean jjtc007 = true;
+                 jjtree.openNodeScope(jjtn007);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte007) {
+                 if (jjtc007) {
+                   jjtree.clearNodeScope(jjtn007);
+                   jjtc007 = false;
                  } else {
                    jjtree.popNode();
                  }
-                 if (jjte006 instanceof RuntimeException) {
-                   {if (true) throw (RuntimeException)jjte006;}
+                 if (jjte007 instanceof RuntimeException) {
+                   {if (true) throw (RuntimeException)jjte007;}
                  }
-                 if (jjte006 instanceof ParseException) {
-                   {if (true) throw (ParseException)jjte006;}
+                 if (jjte007 instanceof ParseException) {
+                   {if (true) throw (ParseException)jjte007;}
                  }
-                 {if (true) throw (Error)jjte006;}
-        } finally {
-                 if (jjtc006) {
-                   jjtree.closeNodeScope(jjtn006,  2);
+                 {if (true) throw (Error)jjte007;}
+          } finally {
+                 if (jjtc007) {
+                   jjtree.closeNodeScope(jjtn007,  2);
                  }
-        }
-        break;
-      case 13:
-        jj_consume_token(13);
-                         ASTLike jjtn007 = new ASTLike(JJTLIKE);
-                         boolean jjtc007 = true;
-                         jjtree.openNodeScope(jjtn007);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte007) {
-                         if (jjtc007) {
-                           jjtree.clearNodeScope(jjtn007);
-                           jjtc007 = false;
+          }
+          break;
+        case 12:
+          jj_consume_token(12);
+                 ASTGreaterOrEqual jjtn008 = new ASTGreaterOrEqual(JJTGREATEROREQUAL);
+                 boolean jjtc008 = true;
+                 jjtree.openNodeScope(jjtn008);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte008) {
+                 if (jjtc008) {
+                   jjtree.clearNodeScope(jjtn008);
+                   jjtc008 = false;
+                 } else {
+                   jjtree.popNode();
+                 }
+                 if (jjte008 instanceof RuntimeException) {
+                   {if (true) throw (RuntimeException)jjte008;}
+                 }
+                 if (jjte008 instanceof ParseException) {
+                   {if (true) throw (ParseException)jjte008;}
+                 }
+                 {if (true) throw (Error)jjte008;}
+          } finally {
+                 if (jjtc008) {
+                   jjtree.closeNodeScope(jjtn008,  2);
+                 }
+          }
+          break;
+        case 13:
+          jj_consume_token(13);
+                         ASTLike jjtn009 = new ASTLike(JJTLIKE);
+                         boolean jjtc009 = true;
+                         jjtree.openNodeScope(jjtn009);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte009) {
+                         if (jjtc009) {
+                           jjtree.clearNodeScope(jjtn009);
+                           jjtc009 = false;
                          } else {
                            jjtree.popNode();
                          }
-                         if (jjte007 instanceof RuntimeException) {
-                           {if (true) throw (RuntimeException)jjte007;}
+                         if (jjte009 instanceof RuntimeException) {
+                           {if (true) throw (RuntimeException)jjte009;}
                          }
-                         if (jjte007 instanceof ParseException) {
-                           {if (true) throw (ParseException)jjte007;}
+                         if (jjte009 instanceof ParseException) {
+                           {if (true) throw (ParseException)jjte009;}
                          }
-                         {if (true) throw (Error)jjte007;}
-        } finally {
-                         if (jjtc007) {
-                           jjtree.closeNodeScope(jjtn007,  2);
+                         {if (true) throw (Error)jjte009;}
+          } finally {
+                         if (jjtc009) {
+                           jjtree.closeNodeScope(jjtn009,  2);
                          }
-        }
-        break;
-      case 14:
-        jj_consume_token(14);
-                                ASTLikeIgnoreCase jjtn008 = new ASTLikeIgnoreCase(JJTLIKEIGNORECASE);
-                                boolean jjtc008 = true;
-                                jjtree.openNodeScope(jjtn008);
-        try {
-          scalarExpression();
-        } catch (Throwable jjte008) {
-                                if (jjtc008) {
-                                  jjtree.clearNodeScope(jjtn008);
-                                  jjtc008 = false;
+          }
+          break;
+        case 14:
+          jj_consume_token(14);
+                                ASTLikeIgnoreCase jjtn010 = new ASTLikeIgnoreCase(JJTLIKEIGNORECASE);
+                                boolean jjtc010 = true;
+                                jjtree.openNodeScope(jjtn010);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte010) {
+                                if (jjtc010) {
+                                  jjtree.clearNodeScope(jjtn010);
+                                  jjtc010 = false;
                                 } else {
                                   jjtree.popNode();
                                 }
-                                if (jjte008 instanceof RuntimeException) {
-                                  {if (true) throw (RuntimeException)jjte008;}
+                                if (jjte010 instanceof RuntimeException) {
+                                  {if (true) throw (RuntimeException)jjte010;}
                                 }
-                                if (jjte008 instanceof ParseException) {
-                                  {if (true) throw (ParseException)jjte008;}
+                                if (jjte010 instanceof ParseException) {
+                                  {if (true) throw (ParseException)jjte010;}
                                 }
-                                {if (true) throw (Error)jjte008;}
-        } finally {
-                                if (jjtc008) {
-                                  jjtree.closeNodeScope(jjtn008,  2);
+                                {if (true) throw (Error)jjte010;}
+          } finally {
+                                if (jjtc010) {
+                                  jjtree.closeNodeScope(jjtn010,  2);
                                 }
-        }
-        break;
-      case 15:
-        jj_consume_token(15);
-                  ASTIn jjtn009 = new ASTIn(JJTIN);
-                  boolean jjtc009 = true;
-                  jjtree.openNodeScope(jjtn009);
-        try {
-          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-          case 24:
-            namedParameter();
-            break;
-          case 16:
-            jj_consume_token(16);
-            scalarCommaList();
-            jj_consume_token(17);
-            break;
-          default:
-            jj_la1[6] = jj_gen;
-            jj_consume_token(-1);
-            throw new ParseException();
           }
-        } catch (Throwable jjte009) {
-                  if (jjtc009) {
-                    jjtree.clearNodeScope(jjtn009);
-                    jjtc009 = false;
+          break;
+        case 15:
+          jj_consume_token(15);
+                  ASTIn jjtn011 = new ASTIn(JJTIN);
+                  boolean jjtc011 = true;
+                  jjtree.openNodeScope(jjtn011);
+          try {
+            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+            case 24:
+              namedParameter();
+              break;
+            case 16:
+              jj_consume_token(16);
+              scalarCommaList();
+              jj_consume_token(17);
+              break;
+            default:
+              jj_la1[6] = jj_gen;
+              jj_consume_token(-1);
+              throw new ParseException();
+            }
+          } catch (Throwable jjte011) {
+                  if (jjtc011) {
+                    jjtree.clearNodeScope(jjtn011);
+                    jjtc011 = false;
                   } else {
                     jjtree.popNode();
                   }
-                  if (jjte009 instanceof RuntimeException) {
-                    {if (true) throw (RuntimeException)jjte009;}
+                  if (jjte011 instanceof RuntimeException) {
+                    {if (true) throw (RuntimeException)jjte011;}
                   }
-                  if (jjte009 instanceof ParseException) {
-                    {if (true) throw (ParseException)jjte009;}
+                  if (jjte011 instanceof ParseException) {
+                    {if (true) throw (ParseException)jjte011;}
                   }
-                  {if (true) throw (Error)jjte009;}
-        } finally {
-                  if (jjtc009) {
-                    jjtree.closeNodeScope(jjtn009,  2);
+                  {if (true) throw (Error)jjte011;}
+          } finally {
+                  if (jjtc011) {
+                    jjtree.closeNodeScope(jjtn011,  2);
                   }
-        }
-        break;
-      case 18:
-        jj_consume_token(18);
-        scalarExpression();
-        jj_consume_token(2);
-                                                      ASTBetween jjtn010 = new ASTBetween(JJTBETWEEN);
-                                                      boolean jjtc010 = true;
-                                                      jjtree.openNodeScope(jjtn010);
-        try {
+          }
+          break;
+        case 18:
+          jj_consume_token(18);
           scalarExpression();
-        } catch (Throwable jjte010) {
-                                                      if (jjtc010) {
-                                                        jjtree.clearNodeScope(jjtn010);
-                                                        jjtc010 = false;
+          jj_consume_token(2);
+                                                      ASTBetween jjtn012 = new ASTBetween(JJTBETWEEN);
+                                                      boolean jjtc012 = true;
+                                                      jjtree.openNodeScope(jjtn012);
+          try {
+            scalarExpression();
+          } catch (Throwable jjte012) {
+                                                      if (jjtc012) {
+                                                        jjtree.clearNodeScope(jjtn012);
+                                                        jjtc012 = false;
                                                       } else {
                                                         jjtree.popNode();
                                                       }
-                                                      if (jjte010 instanceof RuntimeException) {
-                                                        {if (true) throw (RuntimeException)jjte010;}
+                                                      if (jjte012 instanceof RuntimeException) {
+                                                        {if (true) throw (RuntimeException)jjte012;}
                                                       }
-                                                      if (jjte010 instanceof ParseException) {
-                                                        {if (true) throw (ParseException)jjte010;}
+                                                      if (jjte012 instanceof ParseException) {
+                                                        {if (true) throw (ParseException)jjte012;}
                                                       }
-                                                      {if (true) throw (Error)jjte010;}
-        } finally {
-                                                      if (jjtc010) {
-                                                        jjtree.closeNodeScope(jjtn010,  3);
+                                                      {if (true) throw (Error)jjte012;}
+          } finally {
+                                                      if (jjtc012) {
+                                                        jjtree.closeNodeScope(jjtn012,  3);
                                                       }
+          }
+          break;
+        default:
+          jj_la1[7] = jj_gen;
+          jj_consume_token(-1);
+          throw new ParseException();
         }
         break;
       default:
-        jj_la1[7] = jj_gen;
-        jj_consume_token(-1);
-        throw new ParseException();
+        jj_la1[8] = jj_gen;
+        ;
       }
       break;
     default:
-      jj_la1[8] = jj_gen;
-      ;
+      jj_la1[9] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
     }
   }
 
@@ -546,7 +591,7 @@
       jj_consume_token(4);
       break;
     default:
-      jj_la1[9] = jj_gen;
+      jj_la1[10] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -621,7 +666,7 @@
           jj_consume_token(17);
           break;
         default:
-          jj_la1[10] = jj_gen;
+          jj_la1[11] = jj_gen;
           jj_consume_token(-1);
           throw new ParseException();
         }
@@ -675,7 +720,7 @@
       }
       break;
     default:
-      jj_la1[11] = jj_gen;
+      jj_la1[12] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -694,7 +739,7 @@
           ;
           break;
         default:
-          jj_la1[12] = jj_gen;
+          jj_la1[13] = jj_gen;
           break label_3;
         }
         jj_consume_token(19);
@@ -777,7 +822,7 @@
       }
       break;
     default:
-      jj_la1[13] = jj_gen;
+      jj_la1[14] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -849,7 +894,7 @@
       }
       break;
     default:
-      jj_la1[14] = jj_gen;
+      jj_la1[15] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -865,7 +910,7 @@
         ;
         break;
       default:
-        jj_la1[15] = jj_gen;
+        jj_la1[16] = jj_gen;
         break label_4;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -924,7 +969,7 @@
         }
         break;
       default:
-        jj_la1[16] = jj_gen;
+        jj_la1[17] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -941,7 +986,7 @@
         ;
         break;
       default:
-        jj_la1[17] = jj_gen;
+        jj_la1[18] = jj_gen;
         break label_5;
       }
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1000,7 +1045,7 @@
         }
         break;
       default:
-        jj_la1[18] = jj_gen;
+        jj_la1[19] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
       }
@@ -1022,7 +1067,7 @@
         jj_consume_token(20);
         break;
       default:
-        jj_la1[19] = jj_gen;
+        jj_la1[20] = jj_gen;
         ;
       }
       numericPrimary();
@@ -1055,7 +1100,7 @@
       }
       break;
     default:
-      jj_la1[20] = jj_gen;
+      jj_la1[21] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -1107,7 +1152,7 @@
       }
       break;
     default:
-      jj_la1[21] = jj_gen;
+      jj_la1[22] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -1182,7 +1227,7 @@
       }
       break;
     default:
-      jj_la1[22] = jj_gen;
+      jj_la1[23] = jj_gen;
       jj_consume_token(-1);
       throw new ParseException();
     }
@@ -1193,7 +1238,7 @@
   public Token token, jj_nt;
   private int jj_ntk;
   private int jj_gen;
-  final private int[] jj_la1 = new int[23];
+  final private int[] jj_la1 = new int[24];
   static private int[] jj_la1_0;
   static private int[] jj_la1_1;
   static {
@@ -1201,29 +1246,35 @@
       jj_la1_1();
    }
    private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0x2,0x4,0x18,0x87310018,0x60,0x180,0x1010000,0x4fff8,0x4fff8,0x18,0x1010000,0x4e000,0x80000,0x87310000,0x1000000,0x300000,0x300000,0xc00000,0xc00000,0x100000,0x7310000,0x7010000,0x6000000,};
+      jj_la1_0 = new int[] {0x2,0x4,0x18,0x87310018,0x60,0x180,0x1010000,0x4fff8,0x4fff8,0x87310000,0x18,0x1010000,0x4e000,0x80000,0x87310000,0x1000000,0x300000,0x300000,0xc00000,0xc00000,0x100000,0x7310000,0x7010000,0x6000000,};
    }
    private static void jj_la1_1() {
-      jj_la1_1 = new int[] {0x0,0x0,0x0,0x3901,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3901,0x3900,0x0,0x0,0x0,0x0,0x0,0x3001,0x3001,0x1,};
+      jj_la1_1 = new int[] {0x0,0x0,0x0,0xe407,0x0,0x0,0x0,0x0,0x0,0xe407,0x0,0x0,0x0,0x0,0xe404,0xe400,0x0,0x0,0x0,0x0,0x0,0xc004,0xc004,0x4,};
    }
 
   public ExpressionParser(java.io.InputStream stream) {
-    jj_input_stream = new JavaCharStream(stream, 1, 1);
+     this(stream, null);
+  }
+  public ExpressionParser(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
     token_source = new ExpressionParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   public void ReInit(java.io.InputStream stream) {
-    jj_input_stream.ReInit(stream, 1, 1);
+     ReInit(stream, null);
+  }
+  public void ReInit(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
     token_source.ReInit(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   public ExpressionParser(java.io.Reader stream) {
@@ -1232,7 +1283,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   public void ReInit(java.io.Reader stream) {
@@ -1242,7 +1293,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   public ExpressionParser(ExpressionParserTokenManager tm) {
@@ -1250,7 +1301,7 @@
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   public void ReInit(ExpressionParserTokenManager tm) {
@@ -1259,7 +1310,7 @@
     jj_ntk = -1;
     jjtree.reset();
     jj_gen = 0;
-    for (int i = 0; i < 23; i++) jj_la1[i] = -1;
+    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
   }
 
   final private Token jj_consume_token(int kind) throws ParseException {
@@ -1306,15 +1357,15 @@
 
   public ParseException generateParseException() {
     jj_expentries.removeAllElements();
-    boolean[] la1tokens = new boolean[50];
-    for (int i = 0; i < 50; i++) {
+    boolean[] la1tokens = new boolean[52];
+    for (int i = 0; i < 52; i++) {
       la1tokens[i] = false;
     }
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
     }
-    for (int i = 0; i < 23; i++) {
+    for (int i = 0; i < 24; i++) {
       if (jj_la1[i] == jj_gen) {
         for (int j = 0; j < 32; j++) {
           if ((jj_la1_0[i] & (1<<j)) != 0) {
@@ -1326,7 +1377,7 @@
         }
       }
     }
-    for (int i = 0; i < 50; i++) {
+    for (int i = 0; i < 52; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.jjt
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.jjt?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.jjt (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.jjt Thu Nov  2 13:57:42 2006
@@ -89,6 +89,10 @@
 
 void simpleCondition() : {} 
 {
+	<TRUE> #True
+	| 
+	<FALSE> #False
+	| 
 	  scalarExpression()
 	(
 	   simpleNotCondition()
@@ -324,6 +328,10 @@
 
 TOKEN : {
 	<NULL: "null" | "NULL" >
+|
+	<TRUE: "true" | "TRUE" >
+|
+	<FALSE: "false" | "FALSE" >
 }
 
 TOKEN : {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java Thu Nov  2 13:57:42 2006
@@ -25,20 +25,22 @@
 
   int EOF = 0;
   int NULL = 31;
-  int PROPERTY_PATH = 32;
-  int IDENTIFIER = 33;
-  int LETTER = 34;
-  int DIGIT = 35;
-  int ESC = 38;
-  int SINGLE_QUOTED_STRING = 40;
-  int STRING_ESC = 41;
-  int DOUBLE_QUOTED_STRING = 43;
-  int INT_LITERAL = 44;
-  int FLOAT_LITERAL = 45;
-  int DEC_FLT = 46;
-  int DEC_DIGITS = 47;
-  int EXPONENT = 48;
-  int FLT_SUFF = 49;
+  int TRUE = 32;
+  int FALSE = 33;
+  int PROPERTY_PATH = 34;
+  int IDENTIFIER = 35;
+  int LETTER = 36;
+  int DIGIT = 37;
+  int ESC = 40;
+  int SINGLE_QUOTED_STRING = 42;
+  int STRING_ESC = 43;
+  int DOUBLE_QUOTED_STRING = 45;
+  int INT_LITERAL = 46;
+  int FLOAT_LITERAL = 47;
+  int DEC_FLT = 48;
+  int DEC_DIGITS = 49;
+  int EXPONENT = 50;
+  int FLT_SUFF = 51;
 
   int DEFAULT = 0;
   int WithinSingleQuoteLiteral = 1;
@@ -77,6 +79,8 @@
     "\"\\n\"",
     "\"\\r\"",
     "<NULL>",
+    "<TRUE>",
+    "<FALSE>",
     "<PROPERTY_PATH>",
     "<IDENTIFIER>",
     "<LETTER>",
@@ -84,10 +88,10 @@
     "\"\\\'\"",
     "\"\\\"\"",
     "<ESC>",
-    "<token of kind 39>",
+    "<token of kind 41>",
     "\"\\\'\"",
     "<STRING_ESC>",
-    "<token of kind 42>",
+    "<token of kind 44>",
     "\"\\\"\"",
     "<INT_LITERAL>",
     "<FLOAT_LITERAL>",

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java Thu Nov  2 13:57:42 2006
@@ -105,122 +105,122 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x604e006L) != 0L)
-         {
-            jjmatchedKind = 32;
-            return 36;
-         }
          if ((active0 & 0x8L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             return 2;
          }
+         if ((active0 & 0x604e006L) != 0L)
+         {
+            jjmatchedKind = 34;
+            return 54;
+         }
          return -1;
       case 1:
          if ((active0 & 0x8002L) != 0L)
-            return 36;
+            return 54;
          if ((active0 & 0x604600cL) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 1;
-            return 36;
+            return 54;
          }
          return -1;
       case 2:
          if ((active0 & 0xcL) != 0L)
-            return 36;
+            return 54;
          if ((active0 & 0x2046000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 2;
-            return 36;
+            return 54;
          }
          return -1;
       case 3:
          if ((active0 & 0x6000L) != 0L)
-            return 36;
+            return 54;
          if ((active0 & 0x40000L) != 0L)
          {
             if (jjmatchedPos != 3)
             {
-               jjmatchedKind = 32;
+               jjmatchedKind = 34;
                jjmatchedPos = 3;
             }
-            return 36;
+            return 54;
          }
          return -1;
       case 4:
          if ((active0 & 0x44000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 4;
-            return 36;
+            return 54;
          }
          return -1;
       case 5:
          if ((active0 & 0x44000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 5;
-            return 36;
+            return 54;
          }
          return -1;
       case 6:
-         if ((active0 & 0x40000L) != 0L)
-            return 36;
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 6;
-            return 36;
+            return 54;
          }
+         if ((active0 & 0x40000L) != 0L)
+            return 54;
          return -1;
       case 7:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 7;
-            return 36;
+            return 54;
          }
          return -1;
       case 8:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 8;
-            return 36;
+            return 54;
          }
          return -1;
       case 9:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 9;
-            return 36;
+            return 54;
          }
          return -1;
       case 10:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 10;
-            return 36;
+            return 54;
          }
          return -1;
       case 11:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 11;
-            return 36;
+            return 54;
          }
          return -1;
       case 12:
          if ((active0 & 0x4000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             jjmatchedPos = 12;
-            return 36;
+            return 54;
          }
          return -1;
       default :
@@ -253,11 +253,11 @@
          jjmatchedKind = 4;
          return jjMoveStringLiteralDfa1_0(0x80L);
       case 34:
-         return jjStopAtPos(0, 37);
+         return jjStopAtPos(0, 39);
       case 36:
          return jjStopAtPos(0, 24);
       case 39:
-         return jjStopAtPos(0, 36);
+         return jjStopAtPos(0, 38);
       case 40:
          return jjStopAtPos(0, 16);
       case 41:
@@ -330,13 +330,13 @@
          return jjMoveStringLiteralDfa2_0(active0, 0x6000L);
       case 110:
          if ((active0 & 0x8000L) != 0L)
-            return jjStartNfaWithStates_0(1, 15, 36);
+            return jjStartNfaWithStates_0(1, 15, 54);
          return jjMoveStringLiteralDfa2_0(active0, 0x4L);
       case 111:
          return jjMoveStringLiteralDfa2_0(active0, 0x8L);
       case 114:
          if ((active0 & 0x2L) != 0L)
-            return jjStartNfaWithStates_0(1, 1, 36);
+            return jjStartNfaWithStates_0(1, 1, 54);
          break;
       default :
          break;
@@ -360,7 +360,7 @@
          break;
       case 100:
          if ((active0 & 0x4L) != 0L)
-            return jjStartNfaWithStates_0(2, 2, 36);
+            return jjStartNfaWithStates_0(2, 2, 54);
          break;
       case 106:
          return jjMoveStringLiteralDfa3_0(active0, 0x2000000L);
@@ -368,7 +368,7 @@
          return jjMoveStringLiteralDfa3_0(active0, 0x6000L);
       case 116:
          if ((active0 & 0x8L) != 0L)
-            return jjStartNfaWithStates_0(2, 3, 36);
+            return jjStartNfaWithStates_0(2, 3, 54);
          return jjMoveStringLiteralDfa3_0(active0, 0x40000L);
       default :
          break;
@@ -457,7 +457,7 @@
    {
       case 110:
          if ((active0 & 0x40000L) != 0L)
-            return jjStartNfaWithStates_0(6, 18, 36);
+            return jjStartNfaWithStates_0(6, 18, 54);
          return jjMoveStringLiteralDfa7_0(active0, 0x4000L);
       default :
          break;
@@ -585,7 +585,7 @@
    {
       case 101:
          if ((active0 & 0x4000L) != 0L)
-            return jjStartNfaWithStates_0(13, 14, 36);
+            return jjStartNfaWithStates_0(13, 14, 54);
          break;
       default :
          break;
@@ -626,7 +626,7 @@
 {
    int[] nextStates;
    int startsAt = 0;
-   jjnewStateCnt = 36;
+   jjnewStateCnt = 54;
    int i = 1;
    jjstateSet[0] = startState;
    int j, kind = 0x7fffffff;
@@ -641,178 +641,178 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
+               case 54:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddStates(0, 5);
-                  else if (curChar == 46)
-                     jjCheckNAdd(12);
-                  if ((0x3fe000000000000L & l) != 0L)
                   {
-                     if (kind > 44)
-                        kind = 44;
-                     jjCheckNAddTwoStates(9, 10);
+                     if (kind > 35)
+                        kind = 35;
+                     jjCheckNAdd(53);
                   }
-                  else if (curChar == 48)
+                  else if (curChar == 46)
+                     jjstateSet[jjnewStateCnt++] = 51;
+                  if ((0x3ff000000000000L & l) != 0L)
                   {
-                     if (kind > 44)
-                        kind = 44;
-                     jjCheckNAddStates(6, 8);
+                     if (kind > 34)
+                        kind = 34;
+                     jjCheckNAddTwoStates(49, 50);
                   }
                   break;
-               case 36:
+               case 2:
                   if ((0x3ff000000000000L & l) != 0L)
                   {
-                     if (kind > 33)
-                        kind = 33;
-                     jjCheckNAdd(35);
+                     if (kind > 35)
+                        kind = 35;
+                     jjCheckNAdd(53);
                   }
                   else if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 33;
+                     jjstateSet[jjnewStateCnt++] = 51;
                   if ((0x3ff000000000000L & l) != 0L)
                   {
-                     if (kind > 32)
-                        kind = 32;
-                     jjCheckNAddTwoStates(31, 32);
+                     if (kind > 34)
+                        kind = 34;
+                     jjCheckNAddTwoStates(49, 50);
                   }
                   break;
-               case 2:
+               case 3:
                   if ((0x3ff000000000000L & l) != 0L)
+                     jjCheckNAddStates(0, 5);
+                  else if (curChar == 46)
+                     jjCheckNAdd(30);
+                  if ((0x3fe000000000000L & l) != 0L)
                   {
-                     if (kind > 33)
-                        kind = 33;
-                     jjCheckNAdd(35);
+                     if (kind > 46)
+                        kind = 46;
+                     jjCheckNAddTwoStates(27, 28);
                   }
-                  else if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 33;
-                  if ((0x3ff000000000000L & l) != 0L)
+                  else if (curChar == 48)
                   {
-                     if (kind > 32)
-                        kind = 32;
-                     jjCheckNAddTwoStates(31, 32);
+                     if (kind > 46)
+                        kind = 46;
+                     jjCheckNAddStates(6, 8);
                   }
                   break;
-               case 8:
+               case 26:
                   if ((0x3fe000000000000L & l) == 0L)
                      break;
-                  if (kind > 44)
-                     kind = 44;
-                  jjCheckNAddTwoStates(9, 10);
+                  if (kind > 46)
+                     kind = 46;
+                  jjCheckNAddTwoStates(27, 28);
                   break;
-               case 9:
+               case 27:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 44)
-                     kind = 44;
-                  jjCheckNAddTwoStates(9, 10);
+                  if (kind > 46)
+                     kind = 46;
+                  jjCheckNAddTwoStates(27, 28);
                   break;
-               case 11:
+               case 29:
                   if (curChar == 46)
-                     jjCheckNAdd(12);
+                     jjCheckNAdd(30);
                   break;
-               case 12:
+               case 30:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 45)
-                     kind = 45;
+                  if (kind > 47)
+                     kind = 47;
                   jjCheckNAddStates(9, 11);
                   break;
-               case 14:
+               case 32:
                   if ((0x280000000000L & l) != 0L)
-                     jjCheckNAdd(15);
+                     jjCheckNAdd(33);
                   break;
-               case 15:
+               case 33:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 45)
-                     kind = 45;
-                  jjCheckNAddTwoStates(15, 16);
+                  if (kind > 47)
+                     kind = 47;
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 17:
+               case 35:
                   if ((0x3ff000000000000L & l) != 0L)
                      jjCheckNAddStates(0, 5);
                   break;
-               case 18:
+               case 36:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(18, 19);
+                     jjCheckNAddTwoStates(36, 37);
                   break;
-               case 19:
+               case 37:
                   if (curChar != 46)
                      break;
-                  if (kind > 45)
-                     kind = 45;
+                  if (kind > 47)
+                     kind = 47;
                   jjCheckNAddStates(12, 14);
                   break;
-               case 20:
+               case 38:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 45)
-                     kind = 45;
+                  if (kind > 47)
+                     kind = 47;
                   jjCheckNAddStates(12, 14);
                   break;
-               case 21:
+               case 39:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(21, 22);
+                     jjCheckNAddTwoStates(39, 40);
                   break;
-               case 23:
+               case 41:
                   if ((0x280000000000L & l) != 0L)
-                     jjCheckNAdd(24);
+                     jjCheckNAdd(42);
                   break;
-               case 24:
+               case 42:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 45)
-                     kind = 45;
-                  jjCheckNAddTwoStates(24, 16);
+                  if (kind > 47)
+                     kind = 47;
+                  jjCheckNAddTwoStates(42, 34);
                   break;
-               case 25:
+               case 43:
                   if ((0x3ff000000000000L & l) != 0L)
-                     jjCheckNAddTwoStates(25, 16);
+                     jjCheckNAddTwoStates(43, 34);
                   break;
-               case 26:
+               case 44:
                   if (curChar != 48)
                      break;
-                  if (kind > 44)
-                     kind = 44;
+                  if (kind > 46)
+                     kind = 46;
                   jjCheckNAddStates(6, 8);
                   break;
-               case 27:
+               case 45:
                   if ((0xff000000000000L & l) == 0L)
                      break;
-                  if (kind > 44)
-                     kind = 44;
-                  jjCheckNAddTwoStates(27, 10);
+                  if (kind > 46)
+                     kind = 46;
+                  jjCheckNAddTwoStates(45, 28);
                   break;
-               case 29:
+               case 47:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 44)
-                     kind = 44;
-                  jjCheckNAddTwoStates(29, 10);
+                  if (kind > 46)
+                     kind = 46;
+                  jjCheckNAddTwoStates(47, 28);
                   break;
-               case 31:
+               case 49:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
-                  jjCheckNAddTwoStates(31, 32);
+                  if (kind > 34)
+                     kind = 34;
+                  jjCheckNAddTwoStates(49, 50);
                   break;
-               case 32:
+               case 50:
                   if (curChar == 46)
-                     jjstateSet[jjnewStateCnt++] = 33;
+                     jjstateSet[jjnewStateCnt++] = 51;
                   break;
-               case 34:
+               case 52:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
-                  jjCheckNAddTwoStates(32, 34);
+                  if (kind > 34)
+                     kind = 34;
+                  jjCheckNAddTwoStates(50, 52);
                   break;
-               case 35:
+               case 53:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 33)
-                     kind = 33;
-                  jjCheckNAdd(35);
+                  if (kind > 35)
+                     kind = 35;
+                  jjCheckNAdd(53);
                   break;
                default : break;
             }
@@ -825,48 +825,56 @@
          {
             switch(jjstateSet[--i])
             {
-               case 3:
-                  if ((0x7fffffe87fffffeL & l) != 0L)
-                  {
-                     if (kind > 32)
-                        kind = 32;
-                     jjCheckNAddStates(15, 17);
-                  }
-                  if (curChar == 78)
-                     jjstateSet[jjnewStateCnt++] = 6;
-                  else if (curChar == 110)
-                     jjstateSet[jjnewStateCnt++] = 2;
-                  break;
-               case 36:
+               case 54:
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
-                     if (kind > 33)
-                        kind = 33;
-                     jjCheckNAdd(35);
+                     if (kind > 35)
+                        kind = 35;
+                     jjCheckNAdd(53);
                   }
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
-                     if (kind > 32)
-                        kind = 32;
-                     jjCheckNAddTwoStates(31, 32);
+                     if (kind > 34)
+                        kind = 34;
+                     jjCheckNAddTwoStates(49, 50);
                   }
                   break;
                case 2:
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
-                     if (kind > 33)
-                        kind = 33;
-                     jjCheckNAdd(35);
+                     if (kind > 35)
+                        kind = 35;
+                     jjCheckNAdd(53);
                   }
                   if ((0x7fffffe87fffffeL & l) != 0L)
                   {
-                     if (kind > 32)
-                        kind = 32;
-                     jjCheckNAddTwoStates(31, 32);
+                     if (kind > 34)
+                        kind = 34;
+                     jjCheckNAddTwoStates(49, 50);
                   }
                   if (curChar == 117)
                      jjstateSet[jjnewStateCnt++] = 1;
                   break;
+               case 3:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 34)
+                        kind = 34;
+                     jjCheckNAddStates(15, 17);
+                  }
+                  if (curChar == 70)
+                     jjstateSet[jjnewStateCnt++] = 24;
+                  else if (curChar == 102)
+                     jjstateSet[jjnewStateCnt++] = 19;
+                  else if (curChar == 84)
+                     jjstateSet[jjnewStateCnt++] = 14;
+                  else if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  else if (curChar == 78)
+                     jjstateSet[jjnewStateCnt++] = 6;
+                  else if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 2;
+                  break;
                case 0:
                   if (curChar == 108 && kind > 31)
                      kind = 31;
@@ -891,61 +899,133 @@
                   if (curChar == 78)
                      jjstateSet[jjnewStateCnt++] = 6;
                   break;
+               case 8:
+                  if (curChar == 101 && kind > 32)
+                     kind = 32;
+                  break;
+               case 9:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 8;
+                  break;
                case 10:
-                  if ((0x110000001100L & l) != 0L && kind > 44)
-                     kind = 44;
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 9;
+                  break;
+               case 11:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  break;
+               case 12:
+                  if (curChar == 69 && kind > 32)
+                     kind = 32;
                   break;
                case 13:
-                  if ((0x2000000020L & l) != 0L)
-                     jjAddStates(18, 19);
+                  if (curChar == 85)
+                     jjstateSet[jjnewStateCnt++] = 12;
+                  break;
+               case 14:
+                  if (curChar == 82)
+                     jjstateSet[jjnewStateCnt++] = 13;
+                  break;
+               case 15:
+                  if (curChar == 84)
+                     jjstateSet[jjnewStateCnt++] = 14;
                   break;
                case 16:
-                  if ((0x5400000054L & l) != 0L && kind > 45)
-                     kind = 45;
+                  if (curChar == 101 && kind > 33)
+                     kind = 33;
+                  break;
+               case 17:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 16;
+                  break;
+               case 18:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 17;
+                  break;
+               case 19:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 18;
+                  break;
+               case 20:
+                  if (curChar == 102)
+                     jjstateSet[jjnewStateCnt++] = 19;
+                  break;
+               case 21:
+                  if (curChar == 69 && kind > 33)
+                     kind = 33;
                   break;
                case 22:
+                  if (curChar == 83)
+                     jjstateSet[jjnewStateCnt++] = 21;
+                  break;
+               case 23:
+                  if (curChar == 76)
+                     jjstateSet[jjnewStateCnt++] = 22;
+                  break;
+               case 24:
+                  if (curChar == 65)
+                     jjstateSet[jjnewStateCnt++] = 23;
+                  break;
+               case 25:
+                  if (curChar == 70)
+                     jjstateSet[jjnewStateCnt++] = 24;
+                  break;
+               case 28:
+                  if ((0x110000001100L & l) != 0L && kind > 46)
+                     kind = 46;
+                  break;
+               case 31:
+                  if ((0x2000000020L & l) != 0L)
+                     jjAddStates(18, 19);
+                  break;
+               case 34:
+                  if ((0x5400000054L & l) != 0L && kind > 47)
+                     kind = 47;
+                  break;
+               case 40:
                   if ((0x2000000020L & l) != 0L)
                      jjAddStates(20, 21);
                   break;
-               case 28:
+               case 46:
                   if ((0x100000001000000L & l) != 0L)
-                     jjCheckNAdd(29);
+                     jjCheckNAdd(47);
                   break;
-               case 29:
+               case 47:
                   if ((0x7e0000007eL & l) == 0L)
                      break;
-                  if (kind > 44)
-                     kind = 44;
-                  jjCheckNAddTwoStates(29, 10);
+                  if (kind > 46)
+                     kind = 46;
+                  jjCheckNAddTwoStates(47, 28);
                   break;
-               case 30:
+               case 48:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 34)
+                     kind = 34;
                   jjCheckNAddStates(15, 17);
                   break;
-               case 31:
+               case 49:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
-                  jjCheckNAddTwoStates(31, 32);
+                  if (kind > 34)
+                     kind = 34;
+                  jjCheckNAddTwoStates(49, 50);
                   break;
-               case 33:
-               case 34:
+               case 51:
+               case 52:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
-                  jjCheckNAddTwoStates(32, 34);
+                  if (kind > 34)
+                     kind = 34;
+                  jjCheckNAddTwoStates(50, 52);
                   break;
-               case 35:
+               case 53:
                   if ((0x7fffffe87fffffeL & l) == 0L)
                      break;
-                  if (kind > 33)
-                     kind = 33;
-                  jjCheckNAdd(35);
+                  if (kind > 35)
+                     kind = 35;
+                  jjCheckNAdd(53);
                   break;
                default : break;
             }
@@ -973,7 +1053,7 @@
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 54 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -1004,7 +1084,7 @@
    switch(curChar)
    {
       case 39:
-         return jjStopAtPos(0, 40);
+         return jjStopAtPos(0, 42);
       default :
          return jjMoveNfa_1(0, 0);
    }
@@ -1035,12 +1115,12 @@
             switch(jjstateSet[--i])
             {
                case 0:
-                  if ((0xffffff7fffffffffL & l) != 0L && kind > 39)
-                     kind = 39;
+                  if ((0xffffff7fffffffffL & l) != 0L && kind > 41)
+                     kind = 41;
                   break;
                case 1:
-                  if ((0x8400000000L & l) != 0L && kind > 38)
-                     kind = 38;
+                  if ((0x8400000000L & l) != 0L && kind > 40)
+                     kind = 40;
                   break;
                case 2:
                   if ((0xf000000000000L & l) != 0L)
@@ -1049,13 +1129,13 @@
                case 3:
                   if ((0xff000000000000L & l) == 0L)
                      break;
-                  if (kind > 38)
-                     kind = 38;
+                  if (kind > 40)
+                     kind = 40;
                   jjstateSet[jjnewStateCnt++] = 4;
                   break;
                case 4:
-                  if ((0xff000000000000L & l) != 0L && kind > 38)
-                     kind = 38;
+                  if ((0xff000000000000L & l) != 0L && kind > 40)
+                     kind = 40;
                   break;
                default : break;
             }
@@ -1071,19 +1151,19 @@
                case 0:
                   if ((0xffffffffefffffffL & l) != 0L)
                   {
-                     if (kind > 39)
-                        kind = 39;
+                     if (kind > 41)
+                        kind = 41;
                   }
                   else if (curChar == 92)
                      jjAddStates(22, 24);
                   break;
                case 1:
-                  if ((0x14404510000000L & l) != 0L && kind > 38)
-                     kind = 38;
+                  if ((0x14404510000000L & l) != 0L && kind > 40)
+                     kind = 40;
                   break;
                case 5:
-                  if ((0xffffffffefffffffL & l) != 0L && kind > 39)
-                     kind = 39;
+                  if ((0xffffffffefffffffL & l) != 0L && kind > 41)
+                     kind = 41;
                   break;
                default : break;
             }
@@ -1101,8 +1181,8 @@
             switch(jjstateSet[--i])
             {
                case 0:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 39)
-                     kind = 39;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 41)
+                     kind = 41;
                   break;
                default : break;
             }
@@ -1146,7 +1226,7 @@
    switch(curChar)
    {
       case 34:
-         return jjStopAtPos(0, 43);
+         return jjStopAtPos(0, 45);
       default :
          return jjMoveNfa_2(0, 0);
    }
@@ -1171,12 +1251,12 @@
             switch(jjstateSet[--i])
             {
                case 0:
-                  if ((0xfffffffbffffffffL & l) != 0L && kind > 42)
-                     kind = 42;
+                  if ((0xfffffffbffffffffL & l) != 0L && kind > 44)
+                     kind = 44;
                   break;
                case 1:
-                  if ((0x8400000000L & l) != 0L && kind > 41)
-                     kind = 41;
+                  if ((0x8400000000L & l) != 0L && kind > 43)
+                     kind = 43;
                   break;
                case 2:
                   if ((0xf000000000000L & l) != 0L)
@@ -1185,13 +1265,13 @@
                case 3:
                   if ((0xff000000000000L & l) == 0L)
                      break;
-                  if (kind > 41)
-                     kind = 41;
+                  if (kind > 43)
+                     kind = 43;
                   jjstateSet[jjnewStateCnt++] = 4;
                   break;
                case 4:
-                  if ((0xff000000000000L & l) != 0L && kind > 41)
-                     kind = 41;
+                  if ((0xff000000000000L & l) != 0L && kind > 43)
+                     kind = 43;
                   break;
                default : break;
             }
@@ -1207,19 +1287,19 @@
                case 0:
                   if ((0xffffffffefffffffL & l) != 0L)
                   {
-                     if (kind > 42)
-                        kind = 42;
+                     if (kind > 44)
+                        kind = 44;
                   }
                   else if (curChar == 92)
                      jjAddStates(22, 24);
                   break;
                case 1:
-                  if ((0x14404510000000L & l) != 0L && kind > 41)
-                     kind = 41;
+                  if ((0x14404510000000L & l) != 0L && kind > 43)
+                     kind = 43;
                   break;
                case 5:
-                  if ((0xffffffffefffffffL & l) != 0L && kind > 42)
-                     kind = 42;
+                  if ((0xffffffffefffffffL & l) != 0L && kind > 44)
+                     kind = 44;
                   break;
                default : break;
             }
@@ -1237,8 +1317,8 @@
             switch(jjstateSet[--i])
             {
                case 0:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 42)
-                     kind = 42;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 44)
+                     kind = 44;
                   break;
                default : break;
             }
@@ -1258,8 +1338,8 @@
    }
 }
 static final int[] jjnextStates = {
-   18, 19, 21, 22, 25, 16, 27, 28, 10, 12, 13, 16, 20, 13, 16, 31, 
-   32, 35, 14, 15, 23, 24, 1, 2, 3, 
+   36, 37, 39, 40, 43, 34, 45, 46, 28, 30, 31, 34, 38, 31, 34, 49, 
+   50, 53, 32, 33, 41, 42, 1, 2, 3, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
 {
@@ -1279,7 +1359,7 @@
 "\154\151\153\145\111\147\156\157\162\145\103\141\163\145", "\151\156", "\50", "\51", "\142\145\164\167\145\145\156", "\54", "\53", "\55", 
 "\52", "\57", "\44", "\157\142\152\72", "\144\142\72", null, null, null, null, null, 
 null, null, null, null, null, null, null, null, null, null, null, null, null, null, 
-null, null, null, null, };
+null, null, null, null, null, null, };
 public static final String[] lexStateNames = {
    "DEFAULT", 
    "WithinSingleQuoteLiteral", 
@@ -1287,32 +1367,31 @@
 };
 public static final int[] jjnewLexState = {
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, -1, 
+   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, 
+   -1, -1, 
 };
 static final long[] jjtoToken = {
-   0x390387ffffffL, 
+   0xe40f87ffffffL, 
 };
 static final long[] jjtoSkip = {
    0x78000000L, 
 };
 static final long[] jjtoMore = {
-   0x6f000000000L, 
+   0x1bc000000000L, 
 };
 protected JavaCharStream input_stream;
-private final int[] jjrounds = new int[36];
-private final int[] jjstateSet = new int[72];
+private final int[] jjrounds = new int[54];
+private final int[] jjstateSet = new int[108];
 StringBuffer image;
 int jjimageLen;
 int lengthOfMatch;
 protected char curChar;
-public ExpressionParserTokenManager(JavaCharStream stream)
-{
+public ExpressionParserTokenManager(JavaCharStream stream){
    if (JavaCharStream.staticFlag)
       throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
    input_stream = stream;
 }
-public ExpressionParserTokenManager(JavaCharStream stream, int lexState)
-{
+public ExpressionParserTokenManager(JavaCharStream stream, int lexState){
    this(stream);
    SwitchTo(lexState);
 }
@@ -1327,7 +1406,7 @@
 {
    int i;
    jjround = 0x80000001;
-   for (i = 36; i-- > 0;)
+   for (i = 54; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 public void ReInit(JavaCharStream stream, int lexState)
@@ -1469,51 +1548,45 @@
    jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
    switch(jjmatchedKind)
    {
-      case 36 :
+      case 38 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
            stringBuffer = new StringBuffer();
          break;
-      case 37 :
+      case 39 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
             stringBuffer = new StringBuffer();
          break;
-      case 38 :
+      case 40 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
           stringBuffer.append( escapeChar() );
          break;
-      case 39 :
+      case 41 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
           stringBuffer.append( image.charAt(image.length()-1) );
          break;
-      case 41 :
+      case 43 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
           stringBuffer.append( escapeChar() );
          break;
-      case 42 :
+      case 44 :
          if (image == null)
-              image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen)));
-         else
-            image.append(input_stream.GetSuffix(jjimageLen));
+            image = new StringBuffer();
+         image.append(input_stream.GetSuffix(jjimageLen));
          jjimageLen = 0;
           stringBuffer.append( image.charAt(image.length()-1) );
          break;
@@ -1525,31 +1598,27 @@
 {
    switch(jjmatchedKind)
    {
-      case 40 :
+      case 42 :
         if (image == null)
-            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
-         else
+            image = new StringBuffer();
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
           literalValue = stringBuffer.toString();
          break;
-      case 43 :
+      case 45 :
         if (image == null)
-            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
-         else
+            image = new StringBuffer();
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
           literalValue = stringBuffer.toString();
          break;
-      case 44 :
+      case 46 :
         if (image == null)
-            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
-         else
+            image = new StringBuffer();
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
           literalValue = makeInt();
          break;
-      case 45 :
+      case 47 :
         if (image == null)
-            image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))));
-         else
+            image = new StringBuffer();
             image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
           literalValue = makeFloat();
          break;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java?view=diff&rev=470538&r1=470537&r2=470538
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java Thu Nov  2 13:57:42 2006
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line. ../cayenne-java/src/cayenne/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java */
+/* Generated By:JJTree: Do not edit this line. ./ExpressionParserTreeConstants.java */
 
 package org.apache.cayenne.exp.parser;
 
@@ -8,30 +8,32 @@
   public int JJTOR = 1;
   public int JJTAND = 2;
   public int JJTNOT = 3;
-  public int JJTEQUAL = 4;
-  public int JJTNOTEQUAL = 5;
-  public int JJTLESSOREQUAL = 6;
-  public int JJTLESS = 7;
-  public int JJTGREATER = 8;
-  public int JJTGREATEROREQUAL = 9;
-  public int JJTLIKE = 10;
-  public int JJTLIKEIGNORECASE = 11;
-  public int JJTIN = 12;
-  public int JJTBETWEEN = 13;
-  public int JJTNOTLIKE = 14;
-  public int JJTNOTLIKEIGNORECASE = 15;
-  public int JJTNOTIN = 16;
-  public int JJTNOTBETWEEN = 17;
-  public int JJTLIST = 18;
-  public int JJTSCALAR = 19;
-  public int JJTADD = 20;
-  public int JJTSUBTRACT = 21;
-  public int JJTMULTIPLY = 22;
-  public int JJTDIVIDE = 23;
-  public int JJTNEGATE = 24;
-  public int JJTNAMEDPARAMETER = 25;
-  public int JJTOBJPATH = 26;
-  public int JJTDBPATH = 27;
+  public int JJTTRUE = 4;
+  public int JJTFALSE = 5;
+  public int JJTEQUAL = 6;
+  public int JJTNOTEQUAL = 7;
+  public int JJTLESSOREQUAL = 8;
+  public int JJTLESS = 9;
+  public int JJTGREATER = 10;
+  public int JJTGREATEROREQUAL = 11;
+  public int JJTLIKE = 12;
+  public int JJTLIKEIGNORECASE = 13;
+  public int JJTIN = 14;
+  public int JJTBETWEEN = 15;
+  public int JJTNOTLIKE = 16;
+  public int JJTNOTLIKEIGNORECASE = 17;
+  public int JJTNOTIN = 18;
+  public int JJTNOTBETWEEN = 19;
+  public int JJTLIST = 20;
+  public int JJTSCALAR = 21;
+  public int JJTADD = 22;
+  public int JJTSUBTRACT = 23;
+  public int JJTMULTIPLY = 24;
+  public int JJTDIVIDE = 25;
+  public int JJTNEGATE = 26;
+  public int JJTNAMEDPARAMETER = 27;
+  public int JJTOBJPATH = 28;
+  public int JJTDBPATH = 29;
 
 
   public String[] jjtNodeName = {
@@ -39,6 +41,8 @@
     "Or",
     "And",
     "Not",
+    "True",
+    "False",
     "Equal",
     "NotEqual",
     "LessOrEqual",