@@ -2151,32 +2151,34 @@ Expression Condition():
21512151{
21522152 Expression result;
21532153 Token token;
2154+ boolean not = false;
21542155}
21552156{
2157+ [ <K_NOT> { not = true; }]
21562158 (LOOKAHEAD(SQLCondition()) result=SQLCondition()
21572159 | LOOKAHEAD(RegularCondition()) result=RegularCondition()
21582160 | LOOKAHEAD(Function()) result=Function()
2159- | <K_NOT> result=Column() { result = new NotExpression(result); }
2161+ /* | <K_NOT> result=Column() { result = new NotExpression(result); } */
21602162 | result=Column()
21612163 | LOOKAHEAD({ "0".equals(getToken(1).image) || "1".equals(getToken(1).image) }) token=<S_LONG> { result = new LongValue(token.image); }
21622164 )
21632165
2164- { return result; }
2166+ { return not?new NotExpression(result): result; }
21652167}
21662168
21672169Expression RegularCondition() #RegularCondition:
21682170{
21692171 Expression result = null;
21702172 Expression leftExpression;
21712173 Expression rightExpression;
2172- boolean not = false;
2174+ // boolean not = false;
21732175 int oracleJoin=EqualsTo.NO_ORACLE_JOIN;
21742176 int oraclePrior=EqualsTo.NO_ORACLE_PRIOR;
21752177 boolean binary = false;
21762178}
21772179{
21782180 [ LOOKAHEAD(2) <K_PRIOR> { oraclePrior = EqualsTo.ORACLE_PRIOR_START; }]
2179- [ <K_NOT> { not = true; } ]
2181+ // [ <K_NOT> { not = true; } ]
21802182 leftExpression=ComparisonItem() { result = leftExpression; }
21812183
21822184 [ "(" "+" ")" { oracleJoin=EqualsTo.ORACLE_JOIN_RIGHT; } ]
@@ -2216,8 +2218,8 @@ Expression RegularCondition() #RegularCondition:
22162218 BinaryExpression regCond = (BinaryExpression) result;
22172219 regCond.setLeftExpression(leftExpression);
22182220 regCond.setRightExpression(rightExpression);
2219- if (not)
2220- regCond.setNot();
2221+ // if (not)
2222+ // regCond.setNot();
22212223
22222224 if (oracleJoin>0)
22232225 ((SupportsOldOracleJoinSyntax)result).setOldOracleJoinSyntax(oracleJoin);
@@ -2300,18 +2302,19 @@ Expression LikeExpression() #LikeExpression:
23002302 Expression rightExpression = null;
23012303}
23022304{
2303- (
2304- LOOKAHEAD(3) (
2305+ //(
2306+ //LOOKAHEAD(3)
2307+ (
23052308 leftExpression=SimpleExpression()
23062309 [<K_NOT> { result.setNot(); } ] ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
23072310 [<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
23082311 )
2309- |
2312+ /* |
23102313 (
23112314 [<K_NOT> { result.setNot(); } ] leftExpression=SimpleExpression() ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
23122315 [<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
23132316 )
2314- )
2317+ )*/
23152318 {
23162319 result.setLeftExpression(leftExpression);
23172320 result.setRightExpression(rightExpression);
@@ -2327,9 +2330,9 @@ Expression IsNullExpression():
23272330}
23282331{
23292332 (
2330- <K_NOT> { result.setNot(true); } leftExpression=SimpleExpression()
2333+ /* <K_NOT> { result.setNot(true); } leftExpression=SimpleExpression()
23312334 ( <K_ISNULL> { result.setUseIsNull(true); } | <K_IS> <K_NULL> )
2332- |
2335+ | */
23332336 leftExpression=SimpleExpression()
23342337 (<K_ISNULL> { result.setUseIsNull(true); } | <K_IS> [<K_NOT> { result.setNot(true); } ] <K_NULL> )
23352338 )
@@ -2346,7 +2349,8 @@ Expression ExistsExpression():
23462349 Expression rightExpression = null;
23472350}
23482351{
2349- [<K_NOT> { result.setNot(true); } ] <K_EXISTS> rightExpression=SimpleExpression()
2352+ // [<K_NOT> { result.setNot(true); } ]
2353+ <K_EXISTS> rightExpression=SimpleExpression()
23502354 {
23512355 result.setRightExpression(rightExpression);
23522356 return result;
0 commit comments