Author: porcelli
Date: 2009-04-21 14:19:38 -0400 (Tue, 21 Apr 2009)
New Revision: 16387
Modified:
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQL.g
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQLTreeWalker.g
Log:
hql parser updates:
- member_of an is empty does not generate subqueries anymore (this will be handled by 2nd
phase)
- selectClause is forced to occur
Modified:
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQL.g
===================================================================
---
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQL.g 2009-04-21
17:47:46 UTC (rev 16386)
+++
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQL.g 2009-04-21
18:19:38 UTC (rev 16387)
@@ -35,6 +35,7 @@
NOT_BETWEEN;
NOT_IN;
NOT_LIKE;
+ NOT_MEMBER_OF;
PATH;
PERSISTER_JOIN;
PERSISTER_SPACE;
@@ -776,8 +777,8 @@
( is_key (not_key {isNegated = true;})? (NULL {isNull = true;}|empty_key)
-> {isNull && isNegated}? ^(IS_NOT_NULL[$not_key.start, "is not
null"] $equalityExpression)
-> {isNull && !isNegated}? ^(IS_NULL[$NULL, "is null"]
$equalityExpression)
- -> {!isNull && isNegated}? ^(NOT ^(EXISTS ^(SUB_QUERY ^(QUERY ^(QUERY_SPEC
^(SELECT_FROM ^(FROM $equalityExpression)))))))
- -> ^(EXISTS ^(SUB_QUERY ^(QUERY ^(QUERY_SPEC ^(SELECT_FROM ^(FROM
$equalityExpression))))))
+ -> {!isNull && isNegated}? ^(IS_NOT_EMPTY $equalityExpression)
+ -> ^(IS_EMPTY $equalityExpression)
| ( op=EQUALS | op=NOT_EQUAL ) relationalExpression
-> ^($op $equalityExpression relationalExpression)
)*
@@ -801,8 +802,8 @@
-> {isNegated}? ^(NOT_LIKE[$not_key.start, "not like"]
$relationalExpression concatenation likeEscape?)
-> ^(like_key $relationalExpression concatenation likeEscape?)
| member_of_key path
- -> {isNegated}? ^(NOT_IN[$not_key.start, "not in"] $relationalExpression
^(IN_LIST ^(SUB_QUERY ^(QUERY ^(QUERY_SPEC ^(SELECT_FROM ^(FROM ^(PATH path))))))))
- -> ^(IN[$member_of_key.start, "in"] $relationalExpression ^(IN_LIST
^(SUB_QUERY ^(QUERY ^(QUERY_SPEC ^(SELECT_FROM ^(FROM ^(PATH path))))))))
+ -> {isNegated}? ^(NOT_MEMBER_OF[$not_key.start, "not member of"]
$relationalExpression ^(PATH path))
+ -> ^(member_of_key $relationalExpression ^(PATH path))
)
)?
;
Modified:
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQLTreeWalker.g
===================================================================
---
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQLTreeWalker.g 2009-04-21
17:47:46 UTC (rev 16386)
+++
core/branches/antlr3/src/main/antlr3/org/hibernate/sql/ast/phase/hql/parse/HQLTreeWalker.g 2009-04-21
18:19:38 UTC (rev 16387)
@@ -122,7 +122,7 @@
;
selectFrom
- : ^(SELECT_FROM fromClause selectClause?)
+ : ^(SELECT_FROM fromClause selectClause)
;
fromClause
@@ -131,7 +131,6 @@
persisterSpaces
: ^(PERSISTER_SPACE persisterSpace)
- | ^(PATH identPrimary)
;
persisterSpace
@@ -203,6 +202,10 @@
| ^( NOT_BETWEEN rowValueConstructor betweenList )
| ^( IN rowValueConstructor inPredicateValue )
| ^( NOT_IN rowValueConstructor inPredicateValue )
+ | ^( MEMBER_OF rowValueConstructor rowValueConstructor )
+ | ^( NOT_MEMBER_OF rowValueConstructor rowValueConstructor )
+ | ^( IS_EMPTY rowValueConstructor )
+ | ^( IS_NOT_EMPTY rowValueConstructor )
| rowValueConstructor
;
Show replies by date