[Top][All Lists]

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

Re: Bison/flex compatibility revisited

From: Paul Eggert
Subject: Re: Bison/flex compatibility revisited
Date: 25 Feb 2003 00:10:04 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

Bruce Lilly <address@hidden> writes:

> IIRC that happened in bison 1.75b
> with "yyout", and it's in bison 1.875 with "yylineno".
> It's probably best to avoid local variables beginning with yy...

Unfortunately that is an impossible constraint, at least for the
standard Yacc-compatible parser, since POSIX requires that Yacc must
allow user-defined names of any sort _other_ than names beginning with
yy (or YY).  The POSIX spec says:

  Conforming applications shall not use names beginning in yy or YY
  since the yacc parser uses such names.

So, not only is Bison is within its rights to use local variables
beginning with yy, it's _required_ to use yy (or YY).

It is a tricky situation, since POSIX also places constraints on lex
about yy symbols.  Anyway, I've worked around this particular instance
of the problem by renaming yylineno to yylno in the Bison CVS.

reply via email to

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