bug-bison
[Top][All Lists]
Advanced

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

Re: #defines before C declarations?


From: Akim Demaille
Subject: Re: #defines before C declarations?
Date: 02 Jul 2002 17:02:16 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

>>>>> "Jeffrey" == Jeffrey W Percival <Jeffrey> writes:

>> It just moves the problem, it solves nothing.  Just don't name your
>> tokens `for', `while' or `abort' etc.

Jeffrey> Thanks very much for your response. As I said, changing names
Jeffrey> wouldn't help because bison itself defines "eof", not me.

You see me surprised!

/tmp % cat >foo.y <<EOF                                          nostromo 16:58
heredoc> %%
heredoc> foo: '0';
heredoc> %%
heredoc> EOF
/tmp % /usr/bin/bison foo.y -d                                   nostromo 16:59
/tmp % fgrep -w -i eof foo.tab.c foo.tab.h                       nostromo 16:59
foo.tab.c:  /* Discard the token being shifted unless it is eof.  */
/tmp % /usr/bin/bison --version                                  nostromo 16:59
bison (GNU Bison) 1.35

Copyright 1984, 1986, 1989, 1992, 2000, 2001, 2002
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


There is not EOF.  I have probably missed some parts of your problem.

Jeffrey> The compile isn't failing because of any of the tokens I
Jeffrey> name, it's failing because of a name I have nothing to do
Jeffrey> with.  Does the latest version of bison also put the defines
Jeffrey> ahead of the user's C declarations?

Yes, so that people can output code that depend on the tokens in the
prologue.



reply via email to

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