Filter: add floating point support
[lttng-tools.git] / src / lib / lttng-ctl / filter-parser.y
index 30c208ab15ccaf6095527df50d7cee012ae4896b..d6f00a095e35f934019145a28dcd94ebe2cdd21d 100644 (file)
@@ -287,7 +287,7 @@ void filter_parser_ctx_free(struct filter_parser_ctx *parser_ctx)
 %start translation_unit
 %token CHARACTER_CONSTANT_START SQUOTE STRING_LITERAL_START DQUOTE
 %token ESCSEQ CHAR_STRING_TOKEN
-%token DECIMAL_CONSTANT OCTAL_CONSTANT HEXADECIMAL_CONSTANT
+%token DECIMAL_CONSTANT OCTAL_CONSTANT HEXADECIMAL_CONSTANT FLOAT_CONSTANT
 %token LSBRAC RSBRAC LPAREN RPAREN LBRAC RBRAC RARROW
 %token STAR PLUS MINUS
 %token MOD_OP DIV_OP RIGHT_OP LEFT_OP
@@ -390,6 +390,13 @@ primary_expression
                        sscanf(yylval.gs->s, "0x%" PRIx64,
                               &$$->u.expression.u.constant);
                }
+       |       FLOAT_CONSTANT
+               {
+                       $$ = make_node(parser_ctx, NODE_EXPRESSION);
+                       $$->u.expression.type = AST_EXP_FLOAT_CONSTANT;
+                       sscanf(yylval.gs->s, "%lg",
+                              &$$->u.expression.u.float_constant);
+               }
        |       STRING_LITERAL_START DQUOTE
                {
                        $$ = make_node(parser_ctx, NODE_EXPRESSION);
This page took 0.031499 seconds and 4 git commands to generate.