Skip to content
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

Serialized ATN data element 810567 element 11 out of range 0..65535 #3338

Closed
ccrfrog opened this issue Nov 3, 2021 · 2 comments
Closed

Serialized ATN data element 810567 element 11 out of range 0..65535 #3338

ccrfrog opened this issue Nov 3, 2021 · 2 comments

Comments

@ccrfrog
Copy link

ccrfrog commented Nov 3, 2021

I have a .g4 file in which one of the syntax rules has more than 80,000 alternatives,
when I run antlr4 -Dlanguage=Go -visitor
below exception occured

Exception in thread "main" java.lang.UnsupportedOperationException: Serialized ATN data element 810567 element 11 out of range 0..65535
        at org.antlr.v4.runtime.atn.ATNSerializer.serialize(ATNSerializer.java:361)
        at org.antlr.v4.runtime.atn.ATNSerializer.getSerialized(ATNSerializer.java:601)
        at org.antlr.v4.Tool.generateInterpreterData(Tool.java:745)
        at org.antlr.v4.Tool.processNonCombinedGrammar(Tool.java:400)
        at org.antlr.v4.Tool.process(Tool.java:361)
        at org.antlr.v4.Tool.processGrammarsOnCommandLine(Tool.java:328)
        at org.antlr.v4.Tool.main(Tool.java:172)
@KvanTTT
Copy link
Member

KvanTTT commented Jan 10, 2022

Out of curiosity: where do you need such a big number of alternatives?

KvanTTT added a commit to KvanTTT/antlr4 that referenced this issue Jan 15, 2022
Refactor ATN serializer and deserializer, use ATNDataWriter, ATNDataReader

Remove excess data cloning in deserializer

fixes antlr#1863, fixes antlr#2732, fixes antlr#3338
KvanTTT added a commit to KvanTTT/antlr4 that referenced this issue Jan 16, 2022
Refactor ATN serializer and deserializer, use ATNDataWriter, ATNDataReader

Remove excess data cloning in deserializer

fixes antlr#1863, fixes antlr#2732, fixes antlr#3338
KvanTTT added a commit to KvanTTT/antlr4 that referenced this issue Jan 17, 2022
Refactor ATN serializer and deserializer, use ATNDataWriter, ATNDataReader

Remove excess data cloning in deserializer

fixes antlr#1863, fixes antlr#2732, fixes antlr#3338
KvanTTT added a commit to KvanTTT/antlr4 that referenced this issue Feb 20, 2022
@parrt parrt added this to the 4.10 milestone Mar 26, 2022
@parrt
Copy link
Member

parrt commented Mar 26, 2022

Fixed by #3591

@parrt parrt closed this as completed Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants