[Top][All Lists]

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

Re: RFC: enum instead of #define for tokens

From: Hans Aberg
Subject: Re: RFC: enum instead of #define for tokens
Date: Wed, 3 Apr 2002 00:41:53 +0200

At 16:34 +0200 2002/04/02, Akim Demaille wrote:
>More generally, does anybody see any argument against moving Bison to
>enums instead of #define?
>Does POSIX mandate something?

I think that Paul Eggert said that as for POSIX, #define might be required
(some arguments about name-space pollution). So to be on the safe side,
under C, enums should be an option. (But does not new C99 support const

As for C++, POSIX does not say anything about that (confirmed by a comment
somewhere in the C/C++ newsgroups), so you can do what you like. -- If the
token number type can be changed, it should const, not enum, I think so
that one can accommodate it. (For example, when using Unicode, one wants an
integral type containing at least 2^n, n = 20 - 24, non-negative values. --
There is no guarantee that an int will contain that, even though with
machines it will.)

  Hans Aberg
                  * Email: Hans Aberg <mailto:address@hidden>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>

reply via email to

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