[antlr-interest] Size of parser

Erik Kratochvil discontinuum at gmail.com
Mon Feb 11 05:14:30 PST 2008


Hi.

I have a parser grammar that has 2KSLOC and 300+ rules and about 20
predicates. I use these options:

options {
  output = AST;
  ASTLabelType = CommonTree;
  tokenVocab = GLex; // vocabulary from lexer
  k = 2;
}

For this grammar, ANTLR 3.0.1 generates a parser that has 2.8MB (over
60KSLOC). I wonder, how big parsers do you have? Is there anything I
can do to reduce the size of the final parser (like reducing the
number of predicates or rewriting some rules)? Or is it just that
ANTLR does not generate optimized code?

Thank you for sharing your ideas.

-- 
Erik Kratochvíl


More information about the antlr-interest mailing list