bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: enum instead of #define for tokens


From: Akim Demaille
Subject: RFC: enum instead of #define for tokens
Date: 02 Apr 2002 16:34:35 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

Hi,

We are still trying to solve different defects of Bison, and designing
the C++ calling convention.  Amongst the differences between C and
C++, given that we are not bound to backward compatibility, there is
no doubt that we will #define the tokens: they will be const int or
enums.  But it is extremely tempting to move the C parser to enums
too.

Except for extremely bizarre scenarios which I'm able to imagine, but
fail to see the real interest, I see no difference between #define and
enums.  One such scenario would be for instance to have parts of the
scanner compiled only when #ifdef SOME_TOKEN.  Are there people using
such idioms?

More generally, does anybody see any argument against moving Bison to
enums instead of #define?

Does POSIX mandate something?

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]