Fix: Missing postfix_expression DOT keywords in CTF grammar
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Jul 2015 18:46:06 +0000 (14:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Jul 2015 18:50:35 +0000 (14:50 -0400)
This would cause expressions of the form:

uint32_t a[stream.event.header.seq_len]

to fail to parse since two keywords (stream and event) are used in the
path.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/metadata/ctf-parser.y

index 68fde931ebec5457b30ca66ace9822608048ad60..821f0f7469b351cff47707e8be85d7fd3d165b12 100644 (file)
@@ -1251,6 +1251,15 @@ postfix_expression:
                        bt_list_splice(&($1)->tmp_head, &($$)->tmp_head);
                        bt_list_add_tail(&($$)->siblings, &($$)->tmp_head);
                }
                        bt_list_splice(&($1)->tmp_head, &($$)->tmp_head);
                        bt_list_add_tail(&($$)->siblings, &($$)->tmp_head);
                }
+       |       postfix_expression DOT keywords
+               {
+                       $$ = make_node(scanner, NODE_UNARY_EXPRESSION);
+                       $$->u.unary_expression.type = UNARY_STRING;
+                       $$->u.unary_expression.u.string = yylval.s;
+                       $$->u.unary_expression.link = UNARY_DOTLINK;
+                       bt_list_splice(&($1)->tmp_head, &($$)->tmp_head);
+                       bt_list_add_tail(&($$)->siblings, &($$)->tmp_head);
+               }
        |       postfix_expression RARROW IDENTIFIER
                {
                        $$ = make_node(scanner, NODE_UNARY_EXPRESSION);
        |       postfix_expression RARROW IDENTIFIER
                {
                        $$ = make_node(scanner, NODE_UNARY_EXPRESSION);
This page took 0.024787 seconds and 4 git commands to generate.