antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.12k stars 3.69k forks source link

Code is too large in try statement after xtext generation #3742

Closed sohaibhamioud closed 12 months ago

sohaibhamioud commented 1 year ago

Hi, I am using xtext with a mysql antlr grammar to generate java code. When I use Antlrworks to debug the grammar I get the code too large in try statement error. I tried using sql keywords as rules and as terminals but ended up with a java heap error. I tried to split the grammar but with no success. Should I use keywords as rules or as terminals in the grammar? What should I do with the big set of keywords alternatives to solve this issue (a|b|c|...) ?

kaby76 commented 1 year ago

This repo has nothing to do with the tools and grammars for Antlr3, nor XText. XText generates Antlr3 grammars from XText grammars. And, there is no conversion tool to go from Antlr4 to XText syntax.

sohaibhamioud commented 1 year ago

This repo has nothing to do with the tools and grammars for Antlr3, nor XText. XText generates Antlr3 grammars from XText grammars. And, there is no conversion tool to go from Antlr4 to XText syntax.

Thank you for your reply. I though since xtext is based on antlr and since this issue of java heap and "code is too large in try statement" is related to antlr-based large grammars, the solution would be similar. Thank you anyway.