CDS_INIT_LIST_HEAD(&node->u.enumerator.values);
break;
case NODE_ENUM:
+ CDS_INIT_LIST_HEAD(&node->u._enum.container_type);
CDS_INIT_LIST_HEAD(&node->u._enum.enumerator_list);
break;
case NODE_STRUCT_OR_VARIANT_DECLARATION:
break;
case NODE_TYPE_DECLARATOR:
parent->u.type_declarator.type = TYPEDEC_NESTED;
- parent->u.type_declarator.u.nested.length = node;
+ CDS_INIT_LIST_HEAD(&parent->u.type_declarator.u.nested.length);
+ _cds_list_splice_tail(&node->tmp_head, &parent->u.type_declarator.u.nested.length);
break;
case NODE_ENUM:
- parent->u._enum.container_type = node;
+ _cds_list_splice_tail(&node->tmp_head, &parent->u._enum.container_type);
break;
case NODE_STRUCT_OR_VARIANT_DECLARATION:
_cds_list_splice_tail(&node->tmp_head, &parent->u.struct_or_variant_declaration.declaration_specifier);
%type <n> type_specifier
%type <n> struct_type_specifier
%type <n> variant_type_specifier
-%type <n> type_specifier_or_integer_constant
+%type <n> declaration_specifiers_or_integer_constant
%type <n> enum_type_specifier
%type <n> struct_or_variant_declaration_list
%type <n> struct_or_variant_declaration
{ pop_scope(scanner); }
;
-type_specifier_or_integer_constant:
+declaration_specifiers_or_integer_constant:
declaration_specifiers
{ $$ = $1; }
| DECIMAL_CONSTANT
$$->u._enum.has_body = 1;
_cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | LT type_specifier_or_integer_constant GT LBRAC enumerator_list RBRAC
+ | LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
- $$->u._enum.container_type = $2;
+ _cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
}
| IDENTIFIER LBRAC enumerator_list RBRAC
$$->u._enum.enum_id = $1->s;
_cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | IDENTIFIER LT type_specifier_or_integer_constant GT LBRAC enumerator_list RBRAC
+ | IDENTIFIER LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($6)->tmp_head, &($$)->u._enum.enumerator_list);
}
| ID_TYPE LBRAC enumerator_list RBRAC
$$->u._enum.enum_id = $1->s;
_cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | ID_TYPE LT type_specifier_or_integer_constant GT LBRAC enumerator_list RBRAC
+ | ID_TYPE LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($6)->tmp_head, &($$)->u._enum.enumerator_list);
}
| LBRAC enumerator_list COMMA RBRAC
$$->u._enum.has_body = 1;
_cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | LT type_specifier_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+ | LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
- $$->u._enum.container_type = $2;
+ _cds_list_splice_tail(&($2)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
}
| IDENTIFIER LBRAC enumerator_list COMMA RBRAC
$$->u._enum.enum_id = $1->s;
_cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | IDENTIFIER LT type_specifier_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+ | IDENTIFIER LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($6)->tmp_head, &($$)->u._enum.enumerator_list);
}
| IDENTIFIER
$$->u._enum.has_body = 0;
$$->u._enum.enum_id = $1->s;
}
- | IDENTIFIER LT type_specifier_or_integer_constant GT
+ | IDENTIFIER LT declaration_specifiers_or_integer_constant GT
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 0;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
}
| ID_TYPE LBRAC enumerator_list COMMA RBRAC
{
$$->u._enum.enum_id = $1->s;
_cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.enumerator_list);
}
- | ID_TYPE LT type_specifier_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
+ | ID_TYPE LT declaration_specifiers_or_integer_constant GT LBRAC enumerator_list COMMA RBRAC
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 1;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
_cds_list_splice_tail(&($6)->tmp_head, &($$)->u._enum.enumerator_list);
}
| ID_TYPE
$$->u._enum.has_body = 0;
$$->u._enum.enum_id = $1->s;
}
- | ID_TYPE LT type_specifier_or_integer_constant GT
+ | ID_TYPE LT declaration_specifiers_or_integer_constant GT
{
$$ = make_node(scanner, NODE_ENUM);
$$->u._enum.has_body = 0;
$$->u._enum.enum_id = $1->s;
- $$->u._enum.container_type = $3;
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u._enum.container_type);
}
;
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $2;
}
- | direct_abstract_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
+ | direct_abstract_declarator LSBRAC declaration_specifiers_or_integer_constant RSBRAC
{
$$ = make_node(scanner, NODE_TYPE_DECLARATOR);
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $1;
- $$->u.type_declarator.u.nested.length = $3;
+ CDS_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
}
| direct_abstract_declarator LSBRAC RSBRAC
{
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $2;
}
- | direct_alias_abstract_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
+ | direct_alias_abstract_declarator LSBRAC declaration_specifiers_or_integer_constant RSBRAC
{
$$ = make_node(scanner, NODE_TYPE_DECLARATOR);
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $1;
- $$->u.type_declarator.u.nested.length = $3;
+ CDS_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
}
| direct_alias_abstract_declarator LSBRAC RSBRAC
{
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $2;
}
- | direct_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
+ | direct_declarator LSBRAC declaration_specifiers_or_integer_constant RSBRAC
{
$$ = make_node(scanner, NODE_TYPE_DECLARATOR);
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $1;
- $$->u.type_declarator.u.nested.length = $3;
+ CDS_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
}
;
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $2;
}
- | direct_type_declarator LSBRAC type_specifier_or_integer_constant RSBRAC
+ | direct_type_declarator LSBRAC declaration_specifiers_or_integer_constant RSBRAC
{
$$ = make_node(scanner, NODE_TYPE_DECLARATOR);
$$->u.type_declarator.type = TYPEDEC_NESTED;
$$->u.type_declarator.u.nested.type_declarator = $1;
- $$->u.type_declarator.u.nested.length = $3;
+ CDS_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
+ _cds_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
}
;