Replies: 3 comments 4 replies
-
Have you tried to upgrade ANTLR to the latest version? Antlr 4.5.3 is very old. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Also, what grammar are you using? Stack overflow is as much a problem with the grammar as the version of Antlr. For example, whether the grammar use kleene closure operators versus recusion? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I suspect increasing the stack size is the only clean option. Recursion is key to Antlr’s parsing algorithm, and what you’re experiencing is not an Antlr bug, rather a deployment bug.I suspect your grammar has a rule like: … IN LPAR literal (COMMA literal)* RPARA dirty workaround worth trying could be to create a _10_literals rule as follows:_10_literals :literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA literal COMMA;and change the enclosing rule as follows:… IN LPAR ( _10_literals* literal (COMMA literal)* RPARThis would divide the recursion depth by 10 and could solve your problem.Envoyé de mon iPhoneLe 4 nov. 2022 à 10:41, Manohar Golla ***@***.***> a écrit :
yes, I tried upgrading to 4.7.3 and facing the same issue. After 4.7.3, I'm facing issues with grammar which I'm trying to fix. But from releasenotes, I couldn't find anything related to this.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Antlr4 fails to parse large nested queries like
employee where city in ('a',b', 'c'...) or team in ('aa', 'bb', 'cc'...)'
when the size of in clause list is > 500. From other forums and discussions, a solution is to increase the thread stack size but that's not an option for me in production. Is this fixed in the latest versions of antlr4 or any alternate solution?Atlr4 version: 4.5.3
StackTrace
Beta Was this translation helpful? Give feedback.
All reactions