The classification of constants is carried out by a syntactic rule:
A constant is one possible form of primary_expression (that is the only context in which constant appears in the grammar), and an identifier is another. Because an enumeration constant is an identifier, there would be an ambiguity in the grammar if enumeration_constant appeared in this definition of constant (as it does in the standard): Should the identifier be reduced directly to a primary_expression, or first to an enumeration_constant?
Information about the the declaration of an identifier is needed to distinguish an enumeration constant from a variable identifier in the context represented by constant, and this information is not available to the parser. Since the distinction is irrelevant in determining the structure of the tree anyway, it can simply be ignored.
Eli provides canned descriptions for C constants that implement the definitions found in Section 6.1.3.1, 6.1.3.2, and 6.1.3.4 of the standard:
This specification uses mkidn to guarantee that there is only one copy of any constant in the string table.