svn commit: r835938 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r835938 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj

doogie-3
Author: doogie
Date: Fri Nov 13 17:44:44 2009
New Revision: 835938

URL: http://svn.apache.org/viewvc?rev=835938&view=rev
Log:
Make AND have a higher priority than OR.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj?rev=835938&r1=835937&r2=835938&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/Parser.jj Fri Nov 13 17:44:44 2009
@@ -420,7 +420,7 @@
 private EntityCondition ConditionExpression():
 { EntityCondition ec; }
 {
- ec=AndExpression() { return ec; }
+ ec=OrExpression() { return ec; }
 }
 
 private EntityCondition AndExpression():
@@ -429,8 +429,8 @@
  EntityCondition ec;
 }
 {
- ec=OrExpression() { list.add(ec); }
-        ( <AND> ec=OrExpression() { list.add(ec); } )*
+ ec=BooleanExpression() { list.add(ec); }
+        ( <AND> ec=BooleanExpression() { list.add(ec); } )*
  {
  if (list.size() == 1) return list.get(0);
  return EntityCondition.makeCondition(list, EntityOperator.AND);
@@ -443,8 +443,8 @@
  EntityCondition ec;
 }
 {
- ec=BooleanExpression() { list.add(ec); }
-        ( <OR> ec=BooleanExpression() { list.add(ec); } )*
+ ec=AndExpression() { list.add(ec); }
+        ( <OR> ec=AndExpression() { list.add(ec); } )*
  {
  if (list.size() == 1) return list.get(0);
  return EntityCondition.makeCondition(list, EntityOperator.OR);
@@ -479,7 +479,7 @@
 {
  v1=Expression() op=ComparisonOperator() v2=RightExpression(op)
  { return EntityCondition.makeCondition(v1, op, v2); }
-| <OPEN_PAREN> ec=AndExpression() <CLOSE_PAREN> { return ec; }
+| <OPEN_PAREN> ec=ConditionExpression() <CLOSE_PAREN> { return ec; }
 }
 
 private EntityComparisonOperator ComparisonOperator():