[antlr-interest] Bug: String constant is too big in Parser generated by ANTLR v4

Sam Harwell sam at tunnelvisionlabs.com
Wed Jan 11 18:39:51 PST 2012


I'm hoping for a command line option to the Tool that emits the serialized
ATN as a binary file instead of encoded as a string literal. The binary file
would then be loaded via the classpath (so including it in the jar with your
compiled parser would work).

By default it's emitted as a string literal, but you have the option to work
around Java limitations provided you have a build system that supports
generated embedded resources.

--
Sam Harwell
Owner, Lead Developer
http://tunnelvisionlabs.com

-----Original Message-----
From: Christian [mailto:chwchw at gmx.de] 
Sent: Wednesday, January 11, 2012 7:22 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Bug: String constant is too big in Parser
generated by ANTLR v4

Hi everybody and especially Terence!

I get the following error message from Eclipse after ANTLR v4 has
generated the parser in Java:

    The type generates a string that requires more than 65535 bytes to
encode in Utf8 format in the constant pool.

I think this is due to your _serializedATN string. Could you dynamically
build it with a StringBuilder perhaps? If you fix it, apply the same
solution to the lexer please.

Regards,
Christian

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list