bug-bison
[Top][All Lists]
Advanced

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

Re: bison 2.0a token quoting change


From: Hans Aberg
Subject: Re: bison 2.0a token quoting change
Date: Mon, 18 Jul 2005 14:12:55 +0200


On 18 Jul 2005, at 03:18, Anthony Heading wrote:

I have an application which no longer builds with bison 2.0a, as a result of the change mentioned in the NEWS file: "When generating verbose diagnostics, Bison-generated C parsers no longer quote the literal strings associated with tokens."

The reason is that I was making use the contents of the 'yytname' array to prime a lexer: specifically, enumerating the literal string
tokens in the grammar by looking for quoted strings in 'yytname' and
putting these into a lexer table with the corresponding element of 'yytoknum'.

I'd like to find some way of fixing this code to work with bison
going forward.  Are there any suggestions on an alternative way
to implement the same functionality?

One possibility might be to have bison output a table of token aliases in addition to the name and value tables? I'd be willing to try creating a patch for that if there were agreement that it's an acceptable feature.

I think you might be able to output such a table, by looking into the skeleton file, the part that generates the "yytname" array. Then you make a new table, with another name, with the quotes put in. Then use this modified skeleton file instead.

  Hans Aberg






reply via email to

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