-
Notifications
You must be signed in to change notification settings - Fork 69
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
Emit tables for better diagnostics #138
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The parsers we generate already have some tables for auto-generation of diagnostics
We should extend this to allow better diagnosis of error recovery situations.
Currently for a grammar like this:
The parse will generate states something like this:
etc and we emit tables that contain this kind of information:
State --> ProdIdx list ( 300 --> [1; 2], 301 --> [1,2], ....)
ProdIdx --> NonTerm (1 --> nonterm1, 2 --> nonterm1, ...)
For diagnostics we really want textual representations of the states and productions, e.g. tables for:
ProdIdx --> text
State --> text
etc.
This information should probably just always be emitted by default - the slight increase in size is of no great concern in modern situations
The text was updated successfully, but these errors were encountered: