-
Notifications
You must be signed in to change notification settings - Fork 62
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
grammarinator-generate fails for the PostgreSQL grammar #41
Comments
Hi @mrigger ! While Grammarinator and ANTLR share many design patterns, like the possibility of inlined code and the definition of superclasses, they cannot share the same inlined code or the same superclass. It's true simply because their purposes are different: recognition vs. generation. Furthermore, while ANTLR supports inlined code in multiple languages, Grammarinator only supports Python right now. Regarding the failures in this report, the first two errors are caused by inlined Java parser code in the grammars. On one hand, their purpose is to improve parsing, hence they are useless in our generation scenario. On the other hand, they are written in Java which is not supported by Grammarinator. To avoid these kind of issues, please use the The third error is due to the "missing" PostgreSQLParserBase superclass, which is required by the generated ANTLR parser, but not needed by the generated fuzzer (recognition vs. generation again). To overcome this issue, you should comment out the I hope it helps! Please let me know if you have any further questions. Cheers, |
@mrigger I think we can consider this issue as "fixed". Please feel free to reopen if it still stands. |
Thanks a lot for the detailed explanation! |
While, as described in #40,
grammarinator-process
failed for the SQLite and MySQL grammars, it processed the grammars of PostgreSQL without any issues.However, executing
grammarinator-generate PostgreSQLGenerator.PostgreSQLGenerator -r root -d 5 -o test%d.sql -n 100 --sys-path .
in the directory ofPostgreSQLGenerator.py
resulted in errors.First, I found that grammarinator included a multi-line comment starting with
/*
from the grammar, which is not valid in Python and caused it to fail with an error:After fixing this in the generated code, a follow-up failure with an invalid indent appeared:
By reducing the indent, the failure disappeared, but the next failure appeared which I did not investigate:
The text was updated successfully, but these errors were encountered: