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

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

mlitvin opened this issue Aug 10, 2015 · 0 comments
Labels
Milestone

Comments

@mlitvin
Copy link

@mlitvin 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 added this to the Unreleased milestone Oct 4, 2016
@bradfitz bradfitz removed this from the Unplanned milestone 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants