@@ -2151,32 +2151,34 @@ Expression Condition():
2151
2151
{
2152
2152
Expression result;
2153
2153
Token token;
2154
+ boolean not = false;
2154
2155
}
2155
2156
{
2157
+ [ <K_NOT> { not = true; }]
2156
2158
(LOOKAHEAD(SQLCondition()) result=SQLCondition()
2157
2159
| LOOKAHEAD(RegularCondition()) result=RegularCondition()
2158
2160
| LOOKAHEAD(Function()) result=Function()
2159
- | <K_NOT> result=Column() { result = new NotExpression(result); }
2161
+ /* | <K_NOT> result=Column() { result = new NotExpression(result); } */
2160
2162
| result=Column()
2161
2163
| LOOKAHEAD({ "0".equals(getToken(1).image) || "1".equals(getToken(1).image) }) token=<S_LONG> { result = new LongValue(token.image); }
2162
2164
)
2163
2165
2164
- { return result; }
2166
+ { return not?new NotExpression(result): result; }
2165
2167
}
2166
2168
2167
2169
Expression RegularCondition() #RegularCondition:
2168
2170
{
2169
2171
Expression result = null;
2170
2172
Expression leftExpression;
2171
2173
Expression rightExpression;
2172
- boolean not = false;
2174
+ // boolean not = false;
2173
2175
int oracleJoin=EqualsTo.NO_ORACLE_JOIN;
2174
2176
int oraclePrior=EqualsTo.NO_ORACLE_PRIOR;
2175
2177
boolean binary = false;
2176
2178
}
2177
2179
{
2178
2180
[ LOOKAHEAD(2) <K_PRIOR> { oraclePrior = EqualsTo.ORACLE_PRIOR_START; }]
2179
- [ <K_NOT> { not = true; } ]
2181
+ // [ <K_NOT> { not = true; } ]
2180
2182
leftExpression=ComparisonItem() { result = leftExpression; }
2181
2183
2182
2184
[ "(" "+" ")" { oracleJoin=EqualsTo.ORACLE_JOIN_RIGHT; } ]
@@ -2216,8 +2218,8 @@ Expression RegularCondition() #RegularCondition:
2216
2218
BinaryExpression regCond = (BinaryExpression) result;
2217
2219
regCond.setLeftExpression(leftExpression);
2218
2220
regCond.setRightExpression(rightExpression);
2219
- if (not)
2220
- regCond.setNot();
2221
+ // if (not)
2222
+ // regCond.setNot();
2221
2223
2222
2224
if (oracleJoin>0)
2223
2225
((SupportsOldOracleJoinSyntax)result).setOldOracleJoinSyntax(oracleJoin);
@@ -2300,18 +2302,19 @@ Expression LikeExpression() #LikeExpression:
2300
2302
Expression rightExpression = null;
2301
2303
}
2302
2304
{
2303
- (
2304
- LOOKAHEAD(3) (
2305
+ //(
2306
+ //LOOKAHEAD(3)
2307
+ (
2305
2308
leftExpression=SimpleExpression()
2306
2309
[<K_NOT> { result.setNot(); } ] ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
2307
2310
[<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
2308
2311
)
2309
- |
2312
+ /* |
2310
2313
(
2311
2314
[<K_NOT> { result.setNot(); } ] leftExpression=SimpleExpression() ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
2312
2315
[<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
2313
2316
)
2314
- )
2317
+ )*/
2315
2318
{
2316
2319
result.setLeftExpression(leftExpression);
2317
2320
result.setRightExpression(rightExpression);
@@ -2327,9 +2330,9 @@ Expression IsNullExpression():
2327
2330
}
2328
2331
{
2329
2332
(
2330
- <K_NOT> { result.setNot(true); } leftExpression=SimpleExpression()
2333
+ /* <K_NOT> { result.setNot(true); } leftExpression=SimpleExpression()
2331
2334
( <K_ISNULL> { result.setUseIsNull(true); } | <K_IS> <K_NULL> )
2332
- |
2335
+ | */
2333
2336
leftExpression=SimpleExpression()
2334
2337
(<K_ISNULL> { result.setUseIsNull(true); } | <K_IS> [<K_NOT> { result.setNot(true); } ] <K_NULL> )
2335
2338
)
@@ -2346,7 +2349,8 @@ Expression ExistsExpression():
2346
2349
Expression rightExpression = null;
2347
2350
}
2348
2351
{
2349
- [<K_NOT> { result.setNot(true); } ] <K_EXISTS> rightExpression=SimpleExpression()
2352
+ // [<K_NOT> { result.setNot(true); } ]
2353
+ <K_EXISTS> rightExpression=SimpleExpression()
2350
2354
{
2351
2355
result.setRightExpression(rightExpression);
2352
2356
return result;
0 commit comments