bison-patches
[Top][All Lists]
Advanced

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

Re: test suite yylloc and yylval


From: Joel E. Denny
Subject: Re: test suite yylloc and yylval
Date: Tue, 20 Sep 2005 13:13:54 -0400 (EDT)

On Mon, 19 Sep 2005, Paul Eggert wrote:

> "Joel E. Denny" <address@hidden> writes:
>
> > On Sun, 18 Sep 2005, Paul Eggert wrote:
> >
> >> > Some tests declare yylloc and yylval as pointer arguments. It seems
> >> > more logical to name them yyllocp and yylvalp.
> >>
> >> I agree the args should be renamed, but shouldn't tests obey the Bison
> >> name space rules, and avoid all names beginning with yy other than the
> >> ones the documentation specifies?

In the case of yylloc and yylval above, the intention was to declare local
symbols, so your rule makes sense.  That is, when the intention isn't to
access bison symbols, it should be a hard rule not to intrude on bison's
namespace.

Using bison's namespace to access symbols documented as part of the user
interface is obviously reasonable.

It's sometimes necessary to access undocumented/internal symbols. For
example, I submitted a test case that needed to #define YYSTACKEXPANDABLE
0 to guarantee the test case would exhaust memory in the right way.
YYSTACKEXPANDABLE is not a documented symbol. Yes, this means that
internal changes to the code could break the test case one day.  Thus,
this usage should be avoided when possible, but it's not always possible.
(Even in this case, maybe there was a better way to force an unexpandable
stack?)

> > How about llocp and lvalp?
>
> Yes, that sounds fine, thanks.  Quite possibly there are lots of naming
> problems along these lines in the tests...

I see that now.

It seems that our mail server is delivering a lot of mail out of order
these days.  Some mail is lagged by days.  Sorry if my replies are
confusing as a result.

Joel





reply via email to

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