[antlr-interest] superClass option for lexer in a combined grammar ?

Braun, Kevin T Kevin.Braun at fnis.com
Fri Aug 24 05:22:52 PDT 2007


Here is what I am doing to solve this; it seems it will work.  When
ANTLR generates the lexer and parser, it (fortunately) just says
"extends Parser" or "extends Lexer", with package qualification (it
imports org.antlr.runtime.*).  In the header I specify my own package
for the generated lexer and parser.  I then extend ANTLR's Lexer and
Parser with classes also called Lexer and Parser, in that same package.
As a result, the generated classes extend my Lexer and Parser classes
instead of ANTLR's.

--------
Oti ohumbel at gmail.com 
Fri Aug 3 02:03:10 PDT 2007
 
Hi,

trying out the superClass option (pages 104, 111/112) from the book.
In a combined grammar the parser gets the specified super class.

Is there a way to specify the lexer superClass, too ?

Thanks,
and best wishes,
Oti.



More information about the antlr-interest mailing list