You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have an API to convert between state numbers (as defined by the external "lexer" constant) and their string representation.
There is an internal function that sort of do it - yyTokname but there is a magical offset between what the yacc internal code call state number, and the defined constant. And the magical constant differ between 1.4 and 1.5. For the other direction one have to go the yyToknames table itself, again with (a slightly different) magic offset that differ between version.
So the request is for simple API to do this conversion (an alternative is to give some type to the constant and then we can use the stringer tool).
The text was updated successfully, but these errors were encountered:
bradfitz
changed the title
cmd/yacc: Add API to convert between state numbers and strings
x/tools/cmd/goyacc: add API to convert between state numbers and strings
Oct 4, 2016
gopherbot
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
Sep 12, 2019
I'd like to have an API to convert between state numbers (as defined by the external "lexer" constant) and their string representation.
There is an internal function that sort of do it - yyTokname but there is a magical offset between what the yacc internal code call state number, and the defined constant. And the magical constant differ between 1.4 and 1.5. For the other direction one have to go the yyToknames table itself, again with (a slightly different) magic offset that differ between version.
So the request is for simple API to do this conversion (an alternative is to give some type to the constant and then we can use the stringer tool).
The text was updated successfully, but these errors were encountered: