[antlr-interest] Huge tables in C lexers

Jim Idle jimi at temporal-wave.com
Fri Nov 9 22:40:35 PST 2012


Please see ANTLR.markmail.org. The issue is with your grammar. The
Ctarget lays out static tables that the compiler can then use directly
in memory structures loaded from the executable target. So you see the
full data set. Java creates compressed strings which must first be
created at start up time and then decompressed to generate the same
tables as C.

Review your grammar by looking at which of the tables are so big and
correlating these with your rules. You should be able to see the
issue.

Jim
(At the 200th time of answering this one ;)

On Nov 10, 2012, at 2:39, Borneq <a.moderacja at gmail.com> wrote:

> I compile sample lexer from http://www.antlr.org/wiki/display/ANTLR3/Parsing+XML
> Java target lexer has 33.8 K, C#: 35.9 K, but if I write in XMLLexer.g :
> options {
>    language=C;
> }
> XMLLexer.c has 1219 K (!)
> main size are tables in file.
> <XMLLexer.g>
>
> 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