X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fparser%2Fgrammar.y;fp=src%2Fparser%2Fgrammar.y;h=339f17ae43432dbcafd9fe6c2d1b5d7aead796c6;hp=801462617755d305739e4ef28ac237dd8ce4d5cd;hb=518059384a38dbf5b4384c77dc859689ce80cc9d;hpb=1426e3fcf927d6321fd2cf8595394f817bb1a0e2 diff --git a/src/parser/grammar.y b/src/parser/grammar.y index 8014626..339f17a 100644 --- a/src/parser/grammar.y +++ b/src/parser/grammar.y @@ -127,6 +127,8 @@ sdb_parser_yyerrorf(YYLTYPE *lval, sdb_parser_yyscan_t scanner, const char *fmt, /* NULL token */ %token NULL_T +%token TRUE FALSE + %token FETCH LIST LOOKUP STORE TIMESERIES %token IDENTIFIER STRING @@ -481,6 +483,34 @@ comparison: CK_OOM($$); } | + expression IS TRUE + { + $$ = sdb_ast_op_create(SDB_AST_ISTRUE, NULL, $1); + CK_OOM($$); + } + | + expression IS NOT TRUE + { + $$ = sdb_ast_op_create(SDB_AST_ISTRUE, NULL, $1); + CK_OOM($$); + $$ = sdb_ast_op_create(SDB_AST_NOT, NULL, $$); + CK_OOM($$); + } + | + expression IS FALSE + { + $$ = sdb_ast_op_create(SDB_AST_ISFALSE, NULL, $1); + CK_OOM($$); + } + | + expression IS NOT FALSE + { + $$ = sdb_ast_op_create(SDB_AST_ISFALSE, NULL, $1); + CK_OOM($$); + $$ = sdb_ast_op_create(SDB_AST_NOT, NULL, $$); + CK_OOM($$); + } + | expression IN expression { $$ = sdb_ast_op_create(SDB_AST_IN, $1, $3);