> Le 23 déc. 2018 à 17:13, Akim Demaille <[email protected]> a écrit :
> 
>> Would it help if Bison (internally) generates enum values for the
>> chars used, such as "TOK_46 = '.'" (with some non-conflicting
>> prefix), so token_type would cover all valid values and could be
>> used as the parameter type? (This might also be required for the
>> stricter type-checking of an enum class.)
> 
> Yes, we can do that.  However, I don't think there's a real
> value for it: the user cannot guess the name, she would have
> to read the code, and it's of course fragile, that number can
> change easily.

And now I see that you already know that, since you propose
TOK_46 for '.', whose ascii code is 46.

Sorry for not having understood earlier...

We could mix both approaches: clear names when there is
one, then numbers for the others (e.g. those above 128).

Reply via email to