bug-bison
[Top][All Lists]
Advanced

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

Re: symbol_type::token () removed?


From: Akim Demaille
Subject: Re: symbol_type::token () removed?
Date: Tue, 17 Mar 2020 18:11:36 +0100

Hi guys,

You have all been hit by the removal of symbol_type::token (), and I'm not sure 
yet what would be the best option for the future.

We can introduce a %define variable that generates it (and its table) on user's 
request.  But it's going to waste space, unless you use api.token.raw.

For a number of reasons, I think it would make sense to expose the internal 
symbol numbers, so

%token FOO 123

would be defined twice: once a TOK_FOO = 123 (the "external token number"), and 
YY_SYMBOL_FOO = 1 (the "internal symbol number").  (In C++ we can used 
something better looking).

Would that be a good solution for you all?  You would no longer need to convert 
from one number type to the other.

Cheers!


reply via email to

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