[antlr-interest] ANTLR 277: Minor Functional extension: Allow abstract keyword for Java based Parser & Lexer

Francis ANDRE francis.andre at easynet.fr
Fri Jan 12 01:44:39 PST 2007


Hi Ter & All

I have a grammar that generates more than 50 000 lines of Java and it takes 
around 1 min elapse for producing the Parser & Lexer. I am using some semantic 
predicates and to avoid recompiling the grammar for fixing their code, I am 
using a subclass. But there is no way to define them as abstract and implement 
them properly in a subclass of the Parser.

The traditional bypass is to declared them with an empty body returning false in 
the Parser and overriding the implementation in the derivate class. But that's 
not quite clean and a abstract definition would be much better.

So that's why I am proposing to extend the ANTLR grammar for allowing abstract 
on the definition of the Parser class and allowing empty abstract methods as well.

Rgds

Francis ANDRE


More information about the antlr-interest mailing list