next up previous
Next: Declarators Up: Declarations Previous: Struct and union specifiers

Enumeration specifiers

According to Section 6.5.2.3 of the standard, there is no forward use of an enumerator tag similar to the ones discussed in Section 2.4.1. The reason is that enumerations do not involve any requirement for cyclic definitions. It is always possible to simply declare an enumeration before it is used. This means that enumerations involve only the TagDef andTagUse contexts.

AST nodes[12]:

RULE: enum_specifier  ::=    'enum' TagDef '{' enumerator_list '}'        END;
RULE: enum_specifier  ::=    'enum'        '{' enumerator_list '}'        END;
RULE: enum_specifier  ::=    'enum' TagUse                                END;

RULE: enumerator_list LISTOF enumerator                                   END;
RULE: enumerator      ::=    enumeration_constant                         END;
RULE: enumerator      ::=    enumeration_constant '=' constant_expression END;
RULE: enumeration_constant
                      ::=    identifier                                   END;
This macro is defined in definitions 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, and 18.
This macro is invoked in definition 1.



2008-08-30