-
Notifications
You must be signed in to change notification settings - Fork 77
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
Java Compiler Exception in RascalMPL while parsing #1924
Comments
So I'll let @jurgenvinju diagnose this. But looking at the grammar: https://github.com/Ejehi/rascal-snowflake/blob/main/snowflake/src/grammar/DDL.rsc it's a very verbose and big grammar. Rascal grammars tend to offer ways of making it more compact. Maybe review the options here: https://www.rascal-mpl.org/docs/Rascal/Declarations/SyntaxDefinition/ For inspiration, check out the grammars in this module: https://github.com/usethesource/rascal/tree/main/src/org/rascalmpl/library/lang I'm curious, did you write this impressive grammar by hand, or generate out if an existing specification? |
Ow, and here is a sql "like" language we developed a while back: https://github.com/typhon-project/typhonql/blob/master/typhonql/src/lang/typhonql/DML.rsc That might also give some inspiration how to refactor the grammar a bit. |
Ah.. that's always a bad one. "code too large" is when a class, nested class or method becomes so large that the amount of bytes allowed by the JVM is exceeded. Usually, grammar factoring can remove this problem. If you would inline all the "singleton" rules, like these:
into their parents, that might help. Warning: we might also run into the next limit (this is a very big grammar!) and then we'll have to see what the next step is. |
Thank you for your reply. I generated the grammar out of an existing antlr specification for the snowflake database.
|
Thanks, I'll check this out
|
Thank you for your reply. I will try this👍🏽
|
Thank you @jurgenvinju I have fixed the bug. This was really helpful in resolving the error.
|
I encountered this exception while parsing my grammar in rascal:
I have provided a link to the project below:
https://github.com/Ejehi/rascal-snowflake/blob/main/snowflake/src/grammar/SnowFlake.rsc#L6
Context: VSCode
Rascal Version: 0.34.1
The text was updated successfully, but these errors were encountered: