Remove enum < integer_constant > from grammar
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Apr 2011 18:46:00 +0000 (14:46 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Apr 2011 18:46:00 +0000 (14:46 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-parser.y
formats/ctf/metadata/ctf-visitor-semantic-validator.c

index cdcfdcdbb818630ccadec1c3990318db8b73ab61..66e37923c9315dd482c577912f3f62a75fa5431a 100644 (file)
@@ -1537,7 +1537,7 @@ enum_type_specifier:
                        $$->u._enum.has_body = 1;
                        _cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
+       |       LT declaration_specifiers GT LBRAC enumerator_list RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1551,7 +1551,7 @@ enum_type_specifier:
                        $$->u._enum.enum_id = $1->s;
                        _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       IDENTIFIER LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
+       |       IDENTIFIER LT declaration_specifiers GT LBRAC enumerator_list RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1566,7 +1566,7 @@ enum_type_specifier:
                        $$->u._enum.enum_id = $1->s;
                        _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       ID_TYPE LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
+       |       ID_TYPE LT declaration_specifiers GT LBRAC enumerator_list RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1580,7 +1580,7 @@ enum_type_specifier:
                        $$->u._enum.has_body = 1;
                        _cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+       |       LT declaration_specifiers GT LBRAC enumerator_list COMMA RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1594,7 +1594,7 @@ enum_type_specifier:
                        $$->u._enum.enum_id = $1->s;
                        _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       IDENTIFIER LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+       |       IDENTIFIER LT declaration_specifiers GT LBRAC enumerator_list COMMA RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1608,7 +1608,7 @@ enum_type_specifier:
                        $$->u._enum.has_body = 0;
                        $$->u._enum.enum_id = $1->s;
                }
-       |       IDENTIFIER LT declaration_specifiers_or_integer_constant GT
+       |       IDENTIFIER LT declaration_specifiers GT
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 0;
@@ -1622,7 +1622,7 @@ enum_type_specifier:
                        $$->u._enum.enum_id = $1->s;
                        _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
                }
-       |       ID_TYPE LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+       |       ID_TYPE LT declaration_specifiers GT LBRAC enumerator_list COMMA RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
@@ -1636,7 +1636,7 @@ enum_type_specifier:
                        $$->u._enum.has_body = 0;
                        $$->u._enum.enum_id = $1->s;
                }
-       |       ID_TYPE LT declaration_specifiers_or_integer_constant GT
+       |       ID_TYPE LT declaration_specifiers GT
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 0;
index 6f46bfbdf5df6d342cef56ad3bb6892fd813619d..8decc19ef64a7fd5b6b6f808183766704c1d883d 100644 (file)
@@ -65,10 +65,8 @@ int ctf_visitor_unary_expression(FILE *fd, int depth, struct ctf_node *node)
                /* Right child of a ctf expression can be any type of unary exp. */
                break;                  /* OK */
        case NODE_TYPE_DECLARATOR:
-       case NODE_ENUM:
                /*
-                * We are the length of a type declarator or the size of an enum
-                * container. We can only be a numeric constant.
+                * We are the length of a type declarator.
                 */
                switch (node->u.unary_expression.type) {
                case UNARY_SIGNED_CONSTANT:
@@ -104,6 +102,7 @@ int ctf_visitor_unary_expression(FILE *fd, int depth, struct ctf_node *node)
        case NODE_FLOATING_POINT:
        case NODE_INTEGER:
        case NODE_STRING:
+       case NODE_ENUM:
        case NODE_STRUCT_OR_VARIANT_DECLARATION:
        case NODE_VARIANT:
        case NODE_STRUCT:
This page took 0.02632 seconds and 4 git commands to generate.