Skip to content

Commit

Permalink
#2178 Add negated compound conditions to the grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
homedirectory committed Feb 26, 2024
1 parent 2b0afc1 commit 18ef7df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This grammar was generated. Timestamp: 2024-02-26T13:31:52.325163479+02:00[Europe/Kyiv]
// This grammar was generated. Timestamp: 2024-02-26T15:43:48.195266260+02:00[Europe/Kyiv]

grammar EQL;

Expand Down Expand Up @@ -38,10 +38,11 @@ where :
;

condition :
predicate
| left=condition AND right=condition
| left=condition OR right=condition
| BEGIN condition END
predicate # PredicateCondition
| left=condition AND right=condition # AndCondition
| left=condition OR right=condition # OrCondition
| BEGIN condition END # CompoundCondition
| NOTBEGIN condition END # NegatedCompoundCondition
;

predicate :
Expand Down Expand Up @@ -435,6 +436,7 @@ AND : 'and' ;
EXISTSALLOF : 'existsAllOf' ;
ANYOFPROPS : 'anyOfProps' ;
SECONDS : 'seconds' ;
NOTBEGIN : 'notBegin' ;
NOTEXISTSALLOF : 'notExistsAllOf' ;
IVAL : 'iVal' ;
ON : 'on' ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public final class CanonicalEqlGrammar {
or(label("left", Condition), and, label("right", Condition)).
or(label("left", Condition), or, label("right", Condition)).
or(begin, Condition, end).
or(notBegin, Condition, end).

specialize(Predicate).
into(UnaryPredicate, ComparisonPredicate, QuantifiedComparisonPredicate, LikePredicate, MembershipPredicate, SingleConditionPredicate).
Expand Down

0 comments on commit 18ef7df

Please sign in to comment.