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

Christian chwchw at gmx.de
Thu Jan 12 05:34:28 PST 2012


It's a combined grammar of the complete Spec C# v4. The parser's string
constant extends to 2000 LOC, the lexer's to 1000 LOC. Moreover, it
would be great if you could extract the constant into another class so
that loading and displaying the parser file with an editor (e.g.
Eclipse) does not take so long.

Am 12.01.2012 02:31, schrieb Terence Parr:
> thanks…wondering if this would come up.  Wow. big grammar?
> Ter
> On Jan 11, 2012, at 5:22 PM, Christian wrote:
>
>> 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