From 29443611a1e6db414a06f0b7669a6425fd0eb6aa Mon Sep 17 00:00:00 2001 From: Kunlin Yu Date: Fri, 27 Dec 2024 17:17:01 +0800 Subject: [PATCH] Add bison grammer rules for is in list predicate Signed-off-by: Kunlin Yu --- src/cql2_parser.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cql2_parser.y b/src/cql2_parser.y index 92dbaa9..6b90a1b 100644 --- a/src/cql2_parser.y +++ b/src/cql2_parser.y @@ -56,6 +56,7 @@ using cql2cpp::NameOp; %token PLUS MINUS MULT DIV %token EQ GT LT // = > < %token AND OR NOT +%token IN %token LPT RPT COMMA // ( ) , %token CASEI ACCENTI %token SQUOTE DQUOTE @@ -81,6 +82,8 @@ using cql2cpp::NameOp; %type spatialPredicate %type geomExpression %type spatialInstance +%type isInListPredicate +%type inList %type geometryLiteral %type pointTaggedText %type linestringTaggedText @@ -126,6 +129,15 @@ predicate: comparisonPredicate: binaryComparisonPredicate + | isInListPredicate + +isInListPredicate: + scalarExpression IN LPT inList RPT // TODO + | scalarExpression NOT IN LPT inList RPT // TODO + +inList: + scalarExpression // TODO + | scalarExpression COMMA inList // TODO append binaryComparisonPredicate: scalarExpression EQ scalarExpression { $$ = new AstNode(BinCompPred, cql2cpp::Equal, {$1, $3}); }