Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/goyacc: add API to convert between state numbers and strings #12094

Open
mlitvin opened this issue Aug 10, 2015 · 0 comments
Open
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mlitvin
Copy link

mlitvin commented Aug 10, 2015

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).

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 10, 2015
@bradfitz bradfitz modified the milestones: Unreleased, Unplanned Oct 4, 2016
@bradfitz 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 gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants