Skip to content

Commit

Permalink
Add bison grammer rules for is in list predicate
Browse files Browse the repository at this point in the history
Signed-off-by: Kunlin Yu <[email protected]>
  • Loading branch information
kunlinyu committed Dec 27, 2024
1 parent 7ada101 commit 2944361
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/cql2_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ using cql2cpp::NameOp;
%token PLUS MINUS MULT DIV
%token EQ GT LT // = > <
%token AND OR NOT
%token IN
%token <c> LPT RPT COMMA // ( ) ,
%token CASEI ACCENTI
%token SQUOTE DQUOTE
Expand All @@ -81,6 +82,8 @@ using cql2cpp::NameOp;
%type <node> spatialPredicate
%type <node> geomExpression
%type <node> spatialInstance
%type <node> isInListPredicate
%type <node> inList
%type <str> geometryLiteral
%type <str> pointTaggedText
%type <str> linestringTaggedText
Expand Down Expand Up @@ -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}); }
Expand Down

0 comments on commit 2944361

Please sign in to comment.