-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add script to detect and clean up non-idiomatic grammars. #4
Comments
Bison/Yacc does not have the equivalent of an optional element, i.e., there is no After converting a Bison grammar to Antlr, it would be best to convert the non-idiomatic usages to idiomatic Antlr. There should be scripts to rewrite empty alternatives into rules that use the So far the scripts are:
|
After clean up of non-idiomatic empty productions, I wrote a trnullable app to determine if a parser rule is nullable. It works on a pure grammar AST visitor analysis, which contrasts with the ATN method used in the Antlr4 Tool (checkEpsilonClosure). This is fine because they are dual solutions to the same problem. (Note, there was a paper that noted the same observation that you don't need to construct ATNs ever.) |
See antlr/grammars-v4#4291 (comment)
The text was updated successfully, but these errors were encountered: