You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2012/10/31 20:02:02 UTC
svn commit: r1404300 [2/2] - in
/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src:
main/java/org/apache/cayenne/access/trans/
main/java/org/apache/cayenne/exp/ main/java/org/apache/cayenne/exp/parser/
main/jjtree/org/apache/cayenne/exp/parse...
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java Wed Oct 31 19:02:01 2012
@@ -109,21 +109,21 @@ private final int jjStopStringLiteralDfa
switch (pos)
{
case 0:
- if ((active0 & 0xe04e006L) != 0L)
- {
- jjmatchedKind = 35;
- return 56;
- }
if ((active0 & 0x8L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
return 2;
}
+ if ((active0 & 0x38004e006L) != 0L)
+ {
+ jjmatchedKind = 41;
+ return 56;
+ }
return -1;
case 1:
- if ((active0 & 0xe04600cL) != 0L)
+ if ((active0 & 0x38004600cL) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 1;
return 56;
}
@@ -131,9 +131,9 @@ private final int jjStopStringLiteralDfa
return 56;
return -1;
case 2:
- if ((active0 & 0xa046000L) != 0L)
+ if ((active0 & 0x280046000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 2;
return 56;
}
@@ -141,11 +141,11 @@ private final int jjStopStringLiteralDfa
return 56;
return -1;
case 3:
- if ((active0 & 0x8040000L) != 0L)
+ if ((active0 & 0x200040000L) != 0L)
{
if (jjmatchedPos != 3)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 3;
}
return 56;
@@ -156,7 +156,7 @@ private final int jjStopStringLiteralDfa
case 4:
if ((active0 & 0x44000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 4;
return 56;
}
@@ -164,7 +164,7 @@ private final int jjStopStringLiteralDfa
case 5:
if ((active0 & 0x44000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 5;
return 56;
}
@@ -172,7 +172,7 @@ private final int jjStopStringLiteralDfa
case 6:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 6;
return 56;
}
@@ -182,7 +182,7 @@ private final int jjStopStringLiteralDfa
case 7:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 7;
return 56;
}
@@ -190,7 +190,7 @@ private final int jjStopStringLiteralDfa
case 8:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 8;
return 56;
}
@@ -198,7 +198,7 @@ private final int jjStopStringLiteralDfa
case 9:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 9;
return 56;
}
@@ -206,7 +206,7 @@ private final int jjStopStringLiteralDfa
case 10:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 10;
return 56;
}
@@ -214,7 +214,7 @@ private final int jjStopStringLiteralDfa
case 11:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 11;
return 56;
}
@@ -222,7 +222,7 @@ private final int jjStopStringLiteralDfa
case 12:
if ((active0 & 0x4000L) != 0L)
{
- jjmatchedKind = 35;
+ jjmatchedKind = 41;
jjmatchedPos = 12;
return 56;
}
@@ -249,42 +249,46 @@ private int jjMoveStringLiteralDfa0_0()
jjmatchedKind = 4;
return jjMoveStringLiteralDfa1_0(0x80L);
case 34:
- return jjStopAtPos(0, 40);
+ return jjStopAtPos(0, 46);
case 36:
- return jjStopAtPos(0, 24);
+ return jjStopAtPos(0, 30);
+ case 38:
+ return jjStopAtPos(0, 22);
case 39:
- return jjStopAtPos(0, 39);
+ return jjStopAtPos(0, 45);
case 40:
return jjStopAtPos(0, 16);
case 41:
return jjStopAtPos(0, 17);
case 42:
- return jjStopAtPos(0, 22);
+ return jjStopAtPos(0, 27);
case 43:
- return jjStopAtPos(0, 20);
+ return jjStopAtPos(0, 25);
case 44:
return jjStopAtPos(0, 19);
case 45:
- return jjStopAtPos(0, 21);
+ return jjStopAtPos(0, 26);
case 47:
- return jjStopAtPos(0, 23);
+ return jjStopAtPos(0, 28);
case 60:
jjmatchedKind = 10;
- return jjMoveStringLiteralDfa1_0(0x300L);
+ return jjMoveStringLiteralDfa1_0(0x800300L);
case 61:
jjmatchedKind = 5;
return jjMoveStringLiteralDfa1_0(0x40L);
case 62:
jjmatchedKind = 11;
- return jjMoveStringLiteralDfa1_0(0x1000L);
+ return jjMoveStringLiteralDfa1_0(0x1001000L);
+ case 94:
+ return jjStopAtPos(0, 21);
case 97:
return jjMoveStringLiteralDfa1_0(0x4L);
case 98:
return jjMoveStringLiteralDfa1_0(0x40000L);
case 100:
- return jjMoveStringLiteralDfa1_0(0x4000000L);
+ return jjMoveStringLiteralDfa1_0(0x100000000L);
case 101:
- return jjMoveStringLiteralDfa1_0(0x8000000L);
+ return jjMoveStringLiteralDfa1_0(0x200000000L);
case 105:
return jjMoveStringLiteralDfa1_0(0x8000L);
case 108:
@@ -292,7 +296,11 @@ private int jjMoveStringLiteralDfa0_0()
case 110:
return jjMoveStringLiteralDfa1_0(0x8L);
case 111:
- return jjMoveStringLiteralDfa1_0(0x2000002L);
+ return jjMoveStringLiteralDfa1_0(0x80000002L);
+ case 124:
+ return jjStopAtPos(0, 20);
+ case 126:
+ return jjStopAtPos(0, 29);
default :
return jjMoveNfa_0(3, 0);
}
@@ -306,6 +314,10 @@ private int jjMoveStringLiteralDfa1_0(lo
}
switch(curChar)
{
+ case 60:
+ if ((active0 & 0x800000L) != 0L)
+ return jjStopAtPos(1, 23);
+ break;
case 61:
if ((active0 & 0x40L) != 0L)
return jjStopAtPos(1, 6);
@@ -319,9 +331,11 @@ private int jjMoveStringLiteralDfa1_0(lo
case 62:
if ((active0 & 0x100L) != 0L)
return jjStopAtPos(1, 8);
+ else if ((active0 & 0x1000000L) != 0L)
+ return jjStopAtPos(1, 24);
break;
case 98:
- return jjMoveStringLiteralDfa2_0(active0, 0x6000000L);
+ return jjMoveStringLiteralDfa2_0(active0, 0x180000000L);
case 101:
return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
case 105:
@@ -329,7 +343,7 @@ private int jjMoveStringLiteralDfa1_0(lo
case 110:
if ((active0 & 0x8000L) != 0L)
return jjStartNfaWithStates_0(1, 15, 56);
- return jjMoveStringLiteralDfa2_0(active0, 0x8000004L);
+ return jjMoveStringLiteralDfa2_0(active0, 0x200000004L);
case 111:
return jjMoveStringLiteralDfa2_0(active0, 0x8L);
case 114:
@@ -353,15 +367,15 @@ private int jjMoveStringLiteralDfa2_0(lo
switch(curChar)
{
case 58:
- if ((active0 & 0x4000000L) != 0L)
- return jjStopAtPos(2, 26);
+ if ((active0 & 0x100000000L) != 0L)
+ return jjStopAtPos(2, 32);
break;
case 100:
if ((active0 & 0x4L) != 0L)
return jjStartNfaWithStates_0(2, 2, 56);
break;
case 106:
- return jjMoveStringLiteralDfa3_0(active0, 0x2000000L);
+ return jjMoveStringLiteralDfa3_0(active0, 0x80000000L);
case 107:
return jjMoveStringLiteralDfa3_0(active0, 0x6000L);
case 116:
@@ -369,7 +383,7 @@ private int jjMoveStringLiteralDfa2_0(lo
return jjStartNfaWithStates_0(2, 3, 56);
return jjMoveStringLiteralDfa3_0(active0, 0x40000L);
case 117:
- return jjMoveStringLiteralDfa3_0(active0, 0x8000000L);
+ return jjMoveStringLiteralDfa3_0(active0, 0x200000000L);
default :
break;
}
@@ -387,8 +401,8 @@ private int jjMoveStringLiteralDfa3_0(lo
switch(curChar)
{
case 58:
- if ((active0 & 0x2000000L) != 0L)
- return jjStopAtPos(3, 25);
+ if ((active0 & 0x80000000L) != 0L)
+ return jjStopAtPos(3, 31);
break;
case 101:
if ((active0 & 0x2000L) != 0L)
@@ -398,7 +412,7 @@ private int jjMoveStringLiteralDfa3_0(lo
}
return jjMoveStringLiteralDfa4_0(active0, 0x4000L);
case 109:
- return jjMoveStringLiteralDfa4_0(active0, 0x8000000L);
+ return jjMoveStringLiteralDfa4_0(active0, 0x200000000L);
case 119:
return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
default :
@@ -418,8 +432,8 @@ private int jjMoveStringLiteralDfa4_0(lo
switch(curChar)
{
case 58:
- if ((active0 & 0x8000000L) != 0L)
- return jjStopAtPos(4, 27);
+ if ((active0 & 0x200000000L) != 0L)
+ return jjStopAtPos(4, 33);
break;
case 73:
return jjMoveStringLiteralDfa5_0(active0, 0x4000L);
@@ -627,27 +641,27 @@ private int jjMoveNfa_0(int startState,
case 56:
if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
}
else if (curChar == 43)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
}
else if (curChar == 46)
jjstateSet[jjnewStateCnt++] = 52;
if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
}
else if (curChar == 43)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAdd(51);
}
break;
@@ -658,56 +672,56 @@ private int jjMoveNfa_0(int startState,
jjCheckNAdd(30);
if ((0x3fe000000000000L & l) != 0L)
{
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(27, 28);
}
else if (curChar == 48)
{
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddStates(9, 11);
}
break;
case 2:
if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
}
else if (curChar == 43)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
}
else if (curChar == 46)
jjstateSet[jjnewStateCnt++] = 52;
if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
}
else if (curChar == 43)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAdd(51);
}
break;
case 26:
if ((0x3fe000000000000L & l) == 0L)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(27, 28);
break;
case 27:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(27, 28);
break;
case 29:
@@ -717,8 +731,8 @@ private int jjMoveNfa_0(int startState,
case 30:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 48)
- kind = 48;
+ if (kind > 54)
+ kind = 54;
jjCheckNAddStates(12, 14);
break;
case 32:
@@ -728,8 +742,8 @@ private int jjMoveNfa_0(int startState,
case 33:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 48)
- kind = 48;
+ if (kind > 54)
+ kind = 54;
jjCheckNAddTwoStates(33, 34);
break;
case 35:
@@ -743,15 +757,15 @@ private int jjMoveNfa_0(int startState,
case 37:
if (curChar != 46)
break;
- if (kind > 48)
- kind = 48;
+ if (kind > 54)
+ kind = 54;
jjCheckNAddStates(15, 17);
break;
case 38:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 48)
- kind = 48;
+ if (kind > 54)
+ kind = 54;
jjCheckNAddStates(15, 17);
break;
case 39:
@@ -765,8 +779,8 @@ private int jjMoveNfa_0(int startState,
case 42:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 48)
- kind = 48;
+ if (kind > 54)
+ kind = 54;
jjCheckNAddTwoStates(42, 34);
break;
case 43:
@@ -776,36 +790,36 @@ private int jjMoveNfa_0(int startState,
case 44:
if (curChar != 48)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddStates(9, 11);
break;
case 45:
if ((0xff000000000000L & l) == 0L)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(45, 28);
break;
case 47:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(47, 28);
break;
case 49:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
break;
case 50:
if (curChar != 43)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAdd(51);
break;
case 51:
@@ -815,20 +829,20 @@ private int jjMoveNfa_0(int startState,
case 53:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(18, 20);
break;
case 54:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
break;
case 55:
- if (curChar == 43 && kind > 36)
- kind = 36;
+ if (curChar == 43 && kind > 42)
+ kind = 42;
break;
default : break;
}
@@ -844,22 +858,22 @@ private int jjMoveNfa_0(int startState,
case 56:
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
}
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
}
break;
case 3:
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(21, 25);
}
if (curChar == 70)
@@ -878,30 +892,30 @@ private int jjMoveNfa_0(int startState,
case 2:
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
}
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
}
if (curChar == 117)
jjstateSet[jjnewStateCnt++] = 1;
break;
case 0:
- if (curChar == 108 && kind > 32)
- kind = 32;
+ if (curChar == 108 && kind > 38)
+ kind = 38;
break;
case 1:
if (curChar == 108)
jjstateSet[jjnewStateCnt++] = 0;
break;
case 4:
- if (curChar == 76 && kind > 32)
- kind = 32;
+ if (curChar == 76 && kind > 38)
+ kind = 38;
break;
case 5:
if (curChar == 76)
@@ -916,8 +930,8 @@ private int jjMoveNfa_0(int startState,
jjstateSet[jjnewStateCnt++] = 6;
break;
case 8:
- if (curChar == 101 && kind > 33)
- kind = 33;
+ if (curChar == 101 && kind > 39)
+ kind = 39;
break;
case 9:
if (curChar == 117)
@@ -932,8 +946,8 @@ private int jjMoveNfa_0(int startState,
jjstateSet[jjnewStateCnt++] = 10;
break;
case 12:
- if (curChar == 69 && kind > 33)
- kind = 33;
+ if (curChar == 69 && kind > 39)
+ kind = 39;
break;
case 13:
if (curChar == 85)
@@ -948,8 +962,8 @@ private int jjMoveNfa_0(int startState,
jjstateSet[jjnewStateCnt++] = 14;
break;
case 16:
- if (curChar == 101 && kind > 34)
- kind = 34;
+ if (curChar == 101 && kind > 40)
+ kind = 40;
break;
case 17:
if (curChar == 115)
@@ -968,8 +982,8 @@ private int jjMoveNfa_0(int startState,
jjstateSet[jjnewStateCnt++] = 19;
break;
case 21:
- if (curChar == 69 && kind > 34)
- kind = 34;
+ if (curChar == 69 && kind > 40)
+ kind = 40;
break;
case 22:
if (curChar == 83)
@@ -988,16 +1002,16 @@ private int jjMoveNfa_0(int startState,
jjstateSet[jjnewStateCnt++] = 24;
break;
case 28:
- if ((0x110000001100L & l) != 0L && kind > 47)
- kind = 47;
+ if ((0x110000001100L & l) != 0L && kind > 53)
+ kind = 53;
break;
case 31:
if ((0x2000000020L & l) != 0L)
jjAddStates(26, 27);
break;
case 34:
- if ((0x5400000054L & l) != 0L && kind > 48)
- kind = 48;
+ if ((0x5400000054L & l) != 0L && kind > 54)
+ kind = 54;
break;
case 40:
if ((0x2000000020L & l) != 0L)
@@ -1010,37 +1024,37 @@ private int jjMoveNfa_0(int startState,
case 47:
if ((0x7e0000007eL & l) == 0L)
break;
- if (kind > 47)
- kind = 47;
+ if (kind > 53)
+ kind = 53;
jjCheckNAddTwoStates(47, 28);
break;
case 48:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(21, 25);
break;
case 49:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(0, 2);
break;
case 52:
case 53:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 35)
- kind = 35;
+ if (kind > 41)
+ kind = 41;
jjCheckNAddStates(18, 20);
break;
case 54:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 36)
- kind = 36;
+ if (kind > 42)
+ kind = 42;
jjCheckNAddTwoStates(54, 55);
break;
default : break;
@@ -1092,7 +1106,7 @@ private int jjMoveStringLiteralDfa0_1()
switch(curChar)
{
case 39:
- return jjStopAtPos(0, 43);
+ return jjStopAtPos(0, 49);
default :
return jjMoveNfa_1(0, 0);
}
@@ -1122,12 +1136,12 @@ private int jjMoveNfa_1(int startState,
switch(jjstateSet[--i])
{
case 0:
- if ((0xffffff7fffffffffL & l) != 0L && kind > 42)
- kind = 42;
+ if ((0xffffff7fffffffffL & l) != 0L && kind > 48)
+ kind = 48;
break;
case 1:
- if ((0x8400000000L & l) != 0L && kind > 41)
- kind = 41;
+ if ((0x8400000000L & l) != 0L && kind > 47)
+ kind = 47;
break;
case 2:
if ((0xf000000000000L & l) != 0L)
@@ -1136,13 +1150,13 @@ private int jjMoveNfa_1(int startState,
case 3:
if ((0xff000000000000L & l) == 0L)
break;
- if (kind > 41)
- kind = 41;
+ if (kind > 47)
+ kind = 47;
jjstateSet[jjnewStateCnt++] = 4;
break;
case 4:
- if ((0xff000000000000L & l) != 0L && kind > 41)
- kind = 41;
+ if ((0xff000000000000L & l) != 0L && kind > 47)
+ kind = 47;
break;
default : break;
}
@@ -1158,19 +1172,19 @@ private int jjMoveNfa_1(int startState,
case 0:
if ((0xffffffffefffffffL & l) != 0L)
{
- if (kind > 42)
- kind = 42;
+ if (kind > 48)
+ kind = 48;
}
else if (curChar == 92)
jjAddStates(30, 32);
break;
case 1:
- if ((0x14404510000000L & l) != 0L && kind > 41)
- kind = 41;
+ if ((0x14404510000000L & l) != 0L && kind > 47)
+ kind = 47;
break;
case 5:
- if ((0xffffffffefffffffL & l) != 0L && kind > 42)
- kind = 42;
+ if ((0xffffffffefffffffL & l) != 0L && kind > 48)
+ kind = 48;
break;
default : break;
}
@@ -1188,8 +1202,8 @@ private int jjMoveNfa_1(int startState,
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 > 48)
+ kind = 48;
break;
default : break;
}
@@ -1225,7 +1239,7 @@ private int jjMoveStringLiteralDfa0_2()
switch(curChar)
{
case 34:
- return jjStopAtPos(0, 46);
+ return jjStopAtPos(0, 52);
default :
return jjMoveNfa_2(0, 0);
}
@@ -1249,12 +1263,12 @@ private int jjMoveNfa_2(int startState,
switch(jjstateSet[--i])
{
case 0:
- if ((0xfffffffbffffffffL & l) != 0L && kind > 45)
- kind = 45;
+ if ((0xfffffffbffffffffL & l) != 0L && kind > 51)
+ kind = 51;
break;
case 1:
- if ((0x8400000000L & l) != 0L && kind > 44)
- kind = 44;
+ if ((0x8400000000L & l) != 0L && kind > 50)
+ kind = 50;
break;
case 2:
if ((0xf000000000000L & l) != 0L)
@@ -1263,13 +1277,13 @@ private int jjMoveNfa_2(int startState,
case 3:
if ((0xff000000000000L & l) == 0L)
break;
- if (kind > 44)
- kind = 44;
+ if (kind > 50)
+ kind = 50;
jjstateSet[jjnewStateCnt++] = 4;
break;
case 4:
- if ((0xff000000000000L & l) != 0L && kind > 44)
- kind = 44;
+ if ((0xff000000000000L & l) != 0L && kind > 50)
+ kind = 50;
break;
default : break;
}
@@ -1285,19 +1299,19 @@ private int jjMoveNfa_2(int startState,
case 0:
if ((0xffffffffefffffffL & l) != 0L)
{
- if (kind > 45)
- kind = 45;
+ if (kind > 51)
+ kind = 51;
}
else if (curChar == 92)
jjAddStates(30, 32);
break;
case 1:
- if ((0x14404510000000L & l) != 0L && kind > 44)
- kind = 44;
+ if ((0x14404510000000L & l) != 0L && kind > 50)
+ kind = 50;
break;
case 5:
- if ((0xffffffffefffffffL & l) != 0L && kind > 45)
- kind = 45;
+ if ((0xffffffffefffffffL & l) != 0L && kind > 51)
+ kind = 51;
break;
default : break;
}
@@ -1315,8 +1329,8 @@ private int jjMoveNfa_2(int startState,
switch(jjstateSet[--i])
{
case 0:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 45)
- kind = 45;
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 51)
+ kind = 51;
break;
default : break;
}
@@ -1357,10 +1371,11 @@ private static final boolean jjCanMove_0
public static final String[] jjstrLiteralImages = {
"", "\157\162", "\141\156\144", "\156\157\164", "\41", "\75", "\75\75",
"\41\75", "\74\76", "\74\75", "\74", "\76", "\76\75", "\154\151\153\145",
-"\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", "\145\156\165\155\72", null,
+"\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", "\174",
+"\136", "\46", "\74\74", "\76\76", "\53", "\55", "\52", "\57", "\176", "\44",
+"\157\142\152\72", "\144\142\72", "\145\156\165\155\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, null, null, };
+null, null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
@@ -1372,17 +1387,17 @@ public static final String[] lexStateNam
/** Lex State array. */
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, -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, -1, -1, -1, -1, -1, -1, 1, 2, -1, -1, 0,
+ -1, -1, 0, -1, -1, -1, -1, -1, -1,
};
static final long[] jjtoToken = {
- 0x1c81f0fffffffL,
+ 0x7207c3ffffffffL,
};
static final long[] jjtoSkip = {
- 0xf0000000L,
+ 0x3c00000000L,
};
static final long[] jjtoMore = {
- 0x378000000000L,
+ 0xde00000000000L,
};
protected JavaCharStream input_stream;
private final int[] jjrounds = new int[56];
@@ -1574,32 +1589,32 @@ void MoreLexicalActions()
jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
switch(jjmatchedKind)
{
- case 39 :
+ case 45 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer = new StringBuffer();
break;
- case 40 :
+ case 46 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer = new StringBuffer();
break;
- case 41 :
+ case 47 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer.append( escapeChar() );
break;
- case 42 :
+ case 48 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer.append( image.charAt(image.length()-1) );
break;
- case 44 :
+ case 50 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer.append( escapeChar() );
break;
- case 45 :
+ case 51 :
image.append(input_stream.GetSuffix(jjimageLen));
jjimageLen = 0;
stringBuffer.append( image.charAt(image.length()-1) );
@@ -1612,19 +1627,19 @@ void TokenLexicalActions(Token matchedTo
{
switch(jjmatchedKind)
{
- case 43 :
+ case 49 :
image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
literalValue = stringBuffer.toString();
break;
- case 46 :
+ case 52 :
image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
literalValue = stringBuffer.toString();
break;
- case 47 :
+ case 53 :
image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
literalValue = makeInt();
break;
- case 48 :
+ case 54 :
image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
literalValue = makeFloat();
break;
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java Wed Oct 31 19:02:01 2012
@@ -25,14 +25,20 @@ public interface ExpressionParserTreeCon
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 int JJTBITWISEOR = 22;
+ public int JJTBITWISEXOR = 23;
+ public int JJTBITWISEAND = 24;
+ public int JJTBITWISELEFTSHIFT = 25;
+ public int JJTBITWISERIGHTSHIFT = 26;
+ public int JJTADD = 27;
+ public int JJTSUBTRACT = 28;
+ public int JJTMULTIPLY = 29;
+ public int JJTDIVIDE = 30;
+ public int JJTBITWISENOT = 31;
+ public int JJTNEGATE = 32;
+ public int JJTNAMEDPARAMETER = 33;
+ public int JJTOBJPATH = 34;
+ public int JJTDBPATH = 35;
public String[] jjtNodeName = {
@@ -58,14 +64,20 @@ public interface ExpressionParserTreeCon
"NotBetween",
"List",
"Scalar",
+ "BitwiseOr",
+ "BitwiseXor",
+ "BitwiseAnd",
+ "BitwiseLeftShift",
+ "BitwiseRightShift",
"Add",
"Subtract",
"Multiply",
"Divide",
+ "BitwiseNot",
"Negate",
"NamedParameter",
"ObjPath",
"DbPath",
};
}
-/* JavaCC - OriginalChecksum=238d7dc8bb4d7ce029d1935e3afc53f0 (do not edit this line) */
+/* JavaCC - OriginalChecksum=c9c4fb7fe11d6ed9456e027ce61531d5 (do not edit this line) */
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ParseException.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ParseException.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ParseException.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ParseException.java Wed Oct 31 19:02:01 2012
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */
/*****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
@@ -34,24 +34,24 @@ package org.apache.cayenne.exp.parser;
public class ParseException extends Exception {
/**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields "currentToken",
- * "expectedTokenSequences", and "tokenImage" set. The boolean
- * flag "specialConstructor" is also set to true to indicate that
- * this constructor was used to create this object.
- * This constructor calls its super class with the empty string
- * to force the "toString" method of parent class "Throwable" to
- * print the error message in the form:
- * ParseException: <result of getMessage>
+ * "expectedTokenSequences", and "tokenImage" set.
*/
public ParseException(Token currentTokenVal,
int[][] expectedTokenSequencesVal,
String[] tokenImageVal
)
{
- super("");
- specialConstructor = true;
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
currentToken = currentTokenVal;
expectedTokenSequences = expectedTokenSequencesVal;
tokenImage = tokenImageVal;
@@ -69,21 +69,13 @@ public class ParseException extends Exce
public ParseException() {
super();
- specialConstructor = false;
}
/** Constructor with message. */
public ParseException(String message) {
super(message);
- specialConstructor = false;
}
- /**
- * This variable determines which constructor was used to create
- * this object and thereby affects the semantics of the
- * "getMessage" method (see below).
- */
- protected boolean specialConstructor;
/**
* This is the last token that has been consumed successfully. If
@@ -107,19 +99,16 @@ public class ParseException extends Exce
public String[] tokenImage;
/**
- * This method has the standard behavior when this object has been
- * created using the standard constructors. Otherwise, it uses
- * "currentToken" and "expectedTokenSequences" to generate a parse
+ * It uses "currentToken" and "expectedTokenSequences" to generate a parse
* error message and returns it. If this object has been created
* due to a parse error, and you do not catch it (it gets thrown
- * from the parser), then this method is called during the printing
- * of the final stack trace, and hence the correct error message
+ * from the parser) the correct error message
* gets displayed.
*/
- public String getMessage() {
- if (!specialConstructor) {
- return super.getMessage();
- }
+ private static String initialise(Token currentToken,
+ int[][] expectedTokenSequences,
+ String[] tokenImage) {
+ String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
@@ -169,7 +158,7 @@ public class ParseException extends Exce
* when these raw version cannot be used as part of an ASCII
* string literal.
*/
- protected String add_escapes(String str) {
+ static String add_escapes(String str) {
StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
@@ -215,4 +204,4 @@ public class ParseException extends Exce
}
}
-/* JavaCC - OriginalChecksum=c6f8613aa87c07cd91fb5132b17e64f5 (do not edit this line) */
+/* JavaCC - OriginalChecksum=eb8dac072dfd4dad1a11088427fd2da3 (do not edit this line) */
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/Token.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/Token.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/Token.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/Token.java Wed Oct 31 19:02:01 2012
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null */
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -26,7 +26,14 @@ package org.apache.cayenne.exp.parser;
* Describes the input token stream.
*/
-public class Token {
+public class Token implements java.io.Serializable {
+
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
/**
* An integer that describes the kind of this token. This numbering
@@ -95,7 +102,7 @@ public class Token {
*/
public Token(int kind)
{
- this(kind, null);
+ this(kind, null);
}
/**
@@ -103,8 +110,8 @@ public class Token {
*/
public Token(int kind, String image)
{
- this.kind = kind;
- this.image = image;
+ this.kind = kind;
+ this.image = image;
}
/**
@@ -112,7 +119,7 @@ public class Token {
*/
public String toString()
{
- return image;
+ return image;
}
/**
@@ -129,16 +136,16 @@ public class Token {
*/
public static Token newToken(int ofKind, String image)
{
- switch(ofKind)
- {
- default : return new Token(ofKind, image);
- }
+ switch(ofKind)
+ {
+ default : return new Token(ofKind, image);
+ }
}
public static Token newToken(int ofKind)
{
- return newToken(ofKind, null);
+ return newToken(ofKind, null);
}
}
-/* JavaCC - OriginalChecksum=ebb0e6a43dc99078909a54c2d8576e5c (do not edit this line) */
+/* JavaCC - OriginalChecksum=3de15e0554bc896ce6de475b2c832b06 (do not edit this line) */
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/TokenMgrError.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/TokenMgrError.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/TokenMgrError.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/TokenMgrError.java Wed Oct 31 19:02:01 2012
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* JavaCCOptions: */
/*****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
@@ -26,135 +26,142 @@ package org.apache.cayenne.exp.parser;
public class TokenMgrError extends Error
{
- /*
- * Ordinals for various reasons why an Error of this type can be thrown.
- */
-
- /**
- * Lexical error occurred.
- */
- static final int LEXICAL_ERROR = 0;
-
- /**
- * An attempt was made to create a second instance of a static token manager.
- */
- static final int STATIC_LEXER_ERROR = 1;
-
- /**
- * Tried to change to an invalid lexical state.
- */
- static final int INVALID_LEXICAL_STATE = 2;
-
- /**
- * Detected (and bailed out of) an infinite loop in the token manager.
- */
- static final int LOOP_DETECTED = 3;
-
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
-
- /**
- * Replaces unprintable characters by their escaped (or unicode escaped)
- * equivalents in the given string
- */
- protected static final String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i))
- {
- case 0 :
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u" + s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- continue;
- }
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occurred.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt was made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their escaped (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
}
- return retval.toString();
- }
-
- /**
- * Returns a detailed message for the Error when it is thrown by the
- * token manager to indicate a lexical error.
- * Parameters :
- * EOFSeen : indicates if EOF caused the lexical error
- * curLexState : lexical state in which this error occurred
- * errorLine : line number when the error occurred
- * errorColumn : column number when the error occurred
- * errorAfter : prefix that was seen before this error occurred
- * curchar : the offending character
- * Note: You can customize the lexical error message by modifying this method.
- */
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
- }
-
- /**
- * You can also modify the body of this method to customize your error messages.
- * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
- * of end-users concern, so you can return something like :
- *
- * "Internal Error : Please file a bug report .... "
- *
- * from this method for such cases in the release version of your parser.
- */
- public String getMessage() {
- return super.getMessage();
- }
-
- /*
- * Constructors of various flavors follow.
- */
-
- /** No arg constructor. */
- public TokenMgrError() {
- }
-
- /** Constructor with message and reason. */
- public TokenMgrError(String message, int reason) {
- super(message);
- errorCode = reason;
- }
-
- /** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
- }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexical error
+ * curLexState : lexical state in which this error occurred
+ * errorLine : line number when the error occurred
+ * errorColumn : column number when the error occurred
+ * errorAfter : prefix that was seen before this error occurred
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ /** No arg constructor. */
+ public TokenMgrError() {
+ }
+
+ /** Constructor with message and reason. */
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ /** Full Constructor. */
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
}
-/* JavaCC - OriginalChecksum=f7b35cca6e817fe714bc4e5b112f57aa (do not edit this line) */
+/* JavaCC - OriginalChecksum=347e14790694eecc248c9f72c50d0b1d (do not edit this line) */
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt Wed Oct 31 19:02:01 2012
@@ -164,7 +164,7 @@ void scalarConditionExpression() : {}
void scalarExpression() : {}
{
- scalarConditionExpression()
+ scalarConditionExpression()
|
<TRUE> { jjtThis.setValue(true); } #Scalar(0)
|
@@ -190,31 +190,77 @@ void scalarConstExpression() : {}
void scalarNumericExpression() : {}
{
- multiplySubtractExp()
- (
- "+" multiplySubtractExp() #Add(2)
- |
- "-" multiplySubtractExp() #Subtract(2)
- )*
+ bitwiseOr()
+}
+
+void bitwiseOr() : {}
+{
+ bitwiseXor()
+ (
+ "|" bitwiseXor() #BitwiseOr(2)
+ )*
+}
+
+void bitwiseXor() : {}
+{
+ bitwiseAnd()
+ (
+ "^" bitwiseAnd() #BitwiseXor(2)
+ )*
+}
+
+void bitwiseAnd() : {}
+{
+ bitwiseShift()
+ (
+ "&" bitwiseShift() #BitwiseAnd(2)
+ )*
+}
+
+void bitwiseShift(): {}
+{
+ arithmeticExp()
+ (
+ "<<" arithmeticExp() #BitwiseLeftShift(2)
+ |
+ ">>" arithmeticExp() #BitwiseRightShift(2)
+ )*
+}
+
+
+void arithmeticExp() : {}
+{
+ multiplySubtractExp()
+ (
+ "+" multiplySubtractExp() #Add(2)
+ |
+ "-" multiplySubtractExp() #Subtract(2)
+ )*
}
void multiplySubtractExp() : {}
{
- numericTerm()
- (
- "*" numericTerm() #Multiply(2)
- |
- "/" numericTerm() #Divide(2)
- )*
+ numericTermExt()
+ (
+ "*" numericTermExt() #Multiply(2)
+ |
+ "/" numericTermExt() #Divide(2)
+ )*
}
+void numericTermExt() : {}
+{
numericTerm()
+ |
+ "~" numericTerm() #BitwiseNot(1)
+}
void numericTerm() : {}
{
- ( "+" )? numericPrimary ()
- |
- "-" numericPrimary() #Negate(1)
+ ( "+" )? numericPrimary ()
+ |
+ "-" numericTerm() #Negate(1)
}
+
void numericPrimary() : {}
{
// technically we shouldn't make a condition a child of scalar expression
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/exp/ExpressionTest.java Wed Oct 31 19:02:01 2012
@@ -359,5 +359,144 @@ public class ExpressionTest extends Serv
assertEquals(exp.getType(), Expression.OR);
assertEquals(4, ((SimpleNode)exp).jjtGetNumChildren());
}
-
+
+ // bitwise operations test
+ public void testBitwiseNegate() {
+ Expression exp = Expression.fromString("~7");
+
+ assertEquals(Expression.BITWISE_NOT, exp.getType());
+ assertEquals(1, ((SimpleNode) exp).jjtGetNumChildren());
+ assertEquals(new Long(-8), exp.evaluate(new Object())); // ~7 = -8 in digital world
+ }
+
+ public void testBitwiseAnd() {
+ Expression exp = Expression.fromString("1 & 0");
+
+ assertEquals(Expression.BITWISE_AND, exp.getType());
+ assertEquals(2, ((SimpleNode) exp).jjtGetNumChildren());
+ assertEquals(new Long(0), exp.evaluate(new Object()));
+ }
+
+ public void testBitwiseOr() {
+ Expression exp = Expression.fromString("1 | 0");
+
+ assertEquals(Expression.BITWISE_OR, exp.getType());
+ assertEquals(2, ((SimpleNode) exp).jjtGetNumChildren());
+ assertEquals(new Long(1), exp.evaluate(new Object()));
+ }
+
+ public void testBitwiseXor() {
+ Expression exp = Expression.fromString("1 ^ 0");
+
+ assertEquals(Expression.BITWISE_XOR, exp.getType());
+ assertEquals(2, ((SimpleNode) exp).jjtGetNumChildren());
+ assertEquals(new Long(1), exp.evaluate(new Object()));
+ }
+
+ public void testBitwiseLeftShift() {
+ Expression exp = Expression.fromString("7 << 2");
+
+ assertEquals(Expression.BITWISE_LEFT_SHIFT, exp.getType());
+ assertEquals(2, ((SimpleNode) exp).jjtGetNumChildren());
+ assertEquals(new Long(28), exp.evaluate(new Object()));
+ }
+
+ public void testBitwiseRightShift() {
+ Expression exp = Expression.fromString("7 >> 2");
+
+ assertEquals(Expression.BITWISE_RIGHT_SHIFT, exp.getType());
+ assertEquals(2, ((SimpleNode) exp).jjtGetNumChildren());
+
+ assertEquals(new Long(1), exp.evaluate(new Object()));
+ }
+
+ /**
+ * (a | b) | c = a | (b | c)
+ */
+ public void testBitwiseAssociativity() {
+ Expression e1 = Expression.fromString("(3010 | 2012) | 4095");
+ Expression e2 = Expression.fromString("3010 | (2012 | 4095)");
+
+ assertEquals(e1.evaluate(new Object()), e2.evaluate(new Object()));
+ }
+
+ /**
+ * a | b = b | a
+ */
+ public void testBitwiseCommutativity() {
+ Expression e1 = Expression.fromString("3010 | 4095");
+ Expression e2 = Expression.fromString("4095 | 3010");
+
+ assertEquals(e1.evaluate(new Object()), e2.evaluate(new Object()));
+ }
+
+ /**
+ * a | (a & b) = a
+ */
+ public void testBitwiseAbsorption() {
+ Expression e1 = Expression.fromString("2012 | (2012 & 3010)");
+ Expression e2 = Expression.fromString("2012L"); // scalar becomes Long object
+
+ assertEquals(e1.evaluate(new Object()), e2.evaluate(new Object()));
+ }
+
+ /**
+ * a | (b & c) = (a | b) & (a | c)
+ */
+ public void testBitwiseDistributivity() {
+ Expression e1 = Expression.fromString("4095 | (7777 & 8888)");
+ Expression e2 = Expression.fromString("(4095 | 7777) & (4095 | 8888)");
+
+ assertEquals(e1.evaluate(new Object()), e2.evaluate(new Object()));
+ }
+
+ /**
+ * a | ~a = 1
+ * But in Java computed result is -1 because of JVM represents negative numbers as positive ones: ~2 = -3;
+ * For instance, there are only 4 bits and that is why -3 means '1101' and 3 means '0011' because of '1101' + '0011' = (1)'0000' what is zero; but the same time '1101' is 13.
+ */
+ public void testBitwiseComplements() {
+ Expression e1 = Expression.fromString("5555 | ~5555");
+ Expression e2 = Expression.fromString("9999 & ~9999");
+
+ assertEquals(new Long(-1), e1.evaluate(new Object())); // ~0 = -1 that is the way how robots kill humans what means x | ~x = 1 in boolean algebra against java digital bitwise operations logics
+ assertEquals(new Long(0), e2.evaluate(new Object()));
+ }
+
+ /**
+ * Huntington equation n(n(x) + y) + n(n(x) + n(y)) = x where is 'n' is negotation (may be any other unary operation) and '+' is disjunction (OR operation, i.e. '|' bitwise operation).
+ */
+ public void testBitwiseHuntingtonEquation() {
+ Expression theHuntingEquation = Expression.fromString("~(~3748 | 4095) | ~(~3748 | ~4095)");
+
+ assertEquals(new Long(3748), theHuntingEquation.evaluate(new Object()));
+ }
+
+ /**
+ * Robbins equation n(n(x + y) + n(x + n(y))) = x where is 'n' is negotation and '+' is disjunction (OR operation, i.e. '|' bitwise operation).
+ * Every Robbins algebra is a Boolean algebra according to automated reasoning program EQP.
+ */
+ public void testBitwiseRobbinsEquation() {
+ Expression theRobbinsEquation = Expression.fromString("~(~(5111 | 4095) | ~(5111 | ~4095))");
+
+ assertEquals(new Long(5111), theRobbinsEquation.evaluate(new Object()) );
+ }
+
+ /**
+ * Bitwise and math operations are ruled by precedence.
+ */
+ public void testBitwisePrecedence() {
+ Expression e1 = Expression.fromString("1 << 1 & 2"); // 1 << 1 = 2 and after that 2 & 2 = 2;
+ Expression e2 = Expression.fromString("0 | 1 & ~(3 | ~3)"); // by java math precedence that means 0 | (1 & (~(3 | (~3))))
+ Expression e3 = Expression.fromString("3 | ~(-3) + 2"); // JVM ~(-3) = 2 and then 2 + 2 is 4 what bitwise is 100, then 011 | 100 = 111 what means 3 + 4 = 7
+ Expression e4 = Expression.fromString("2 * 2 | 2"); // (2 * 2) | 2 = 4 | 2 = '100' | '10' = '110' = 6
+ Expression e5 = Expression.fromString("6 / 2 & 3"); // (6 / 2) & 3 = 3 & 3 = 3
+
+ assertEquals(new Long(2), e1.evaluate(new Object()));
+ assertEquals(new Long(0), e2.evaluate(new Object()));
+ assertEquals(new Long(7), e3.evaluate(new Object()));
+ assertEquals(new Long(6), e4.evaluate(new Object()));
+ assertEquals(new Long(3), e5.evaluate(new Object()));
+ }
+ // bitwise
}
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/SelectQueryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/SelectQueryTest.java?rev=1404300&r1=1404299&r2=1404300&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/SelectQueryTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/SelectQueryTest.java Wed Oct 31 19:02:01 2012
@@ -36,6 +36,7 @@ import org.apache.cayenne.exp.parser.AST
import org.apache.cayenne.exp.parser.ASTBitwiseXor;
import org.apache.cayenne.exp.parser.ASTEqual;
import org.apache.cayenne.exp.parser.ASTGreater;
+import org.apache.cayenne.exp.parser.ASTNegate;
import org.apache.cayenne.exp.parser.ASTObjPath;
import org.apache.cayenne.exp.parser.ASTScalar;
import org.apache.cayenne.map.DbEntity;
@@ -54,6 +55,7 @@ import org.apache.cayenne.testdo.testmap
import org.apache.cayenne.unit.UnitDbAdapter;
import org.apache.cayenne.unit.di.server.ServerCase;
import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.apache.velocity.runtime.parser.node.ASTObjectArray;
@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
public class SelectQueryTest extends ServerCase {
@@ -474,8 +476,8 @@ public class SelectQueryTest extends Ser
createNumericsDataSet();
// to simplify result checking, do double NOT
- Expression left = new ASTBitwiseOr(new ASTObjPath(
- ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+ Expression left = new ASTBitwiseOr(new Object[] {new ASTObjPath(
+ ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1)});
Expression right = new ASTScalar(1);
Expression equal = new ASTEqual();
equal.setOperand(0, left);
@@ -497,8 +499,8 @@ public class SelectQueryTest extends Ser
createNumericsDataSet();
// to simplify result checking, do double NOT
- Expression left = new ASTBitwiseAnd(new ASTObjPath(
- ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+ Expression left = new ASTBitwiseAnd(new Object[] {new ASTObjPath(
+ ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1)});
Expression right = new ASTScalar(0);
Expression equal = new ASTEqual();
equal.setOperand(0, left);
@@ -520,8 +522,8 @@ public class SelectQueryTest extends Ser
createNumericsDataSet();
// to simplify result checking, do double NOT
- Expression left = new ASTBitwiseXor(new ASTObjPath(
- ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1));
+ Expression left = new ASTBitwiseXor(new Object[] {new ASTObjPath(
+ ReturnTypesMap1.INTEGER_COLUMN_PROPERTY), new ASTScalar(1)});
Expression right = new ASTScalar(5);
Expression equal = new ASTEqual();
equal.setOperand(0, left);