[comp.lang.c] obscure ANSI question

byron@archone.tamu.edu (Byron Rakitzis) (02/28/91)

I'm starting work on a C compiler implementing mostly-ANSI C, and as
a start I have typed in the grammar from the back of K&R 2. However,
I still have not seen (or found) the justification for making
"enumeration-constant" a terminal symbol in the grammar; what's wrong
with scanning in enumeration constants as normal identifiers?

Thanks,

Byron.

(I have not yet blown the $50+ for the ANSI standard, but it's going
to happen soon. Sigh, you think the ANSI standard was deliberately
convoluted so that people would have to buy this enormous document.)

gwyn@smoke.brl.mil (Doug Gwyn) (03/01/91)

In article <12799@helios.TAMU.EDU> byron@archone.tamu.edu (Byron Rakitzis) writes:
>I still have not seen (or found) the justification for making
>"enumeration-constant" a terminal symbol in the grammar; what's wrong
>with scanning in enumeration constants as normal identifiers?

An enumeration constant IS defined to be an identifier (3.1.3.3).

>(I have not yet blown the $50+ for the ANSI standard, but it's going
>to happen soon. Sigh, you think the ANSI standard was deliberately
>convoluted so that people would have to buy this enormous document.)

The people setting the price are not the ones who prepared the
content of the document.  In fact, the standard is not appreciably
more complex than is required to adequatly specify the language.