[antlr-interest] [v3] parser rules are final
Sven Efftinge
sven at efftinge.de
Fri Jun 8 01:22:56 PDT 2007
Hi,
I just updated to the latest version of V3 (have used a beta before)
Unfortunately I found that the generated parser rules are flagged as
final now.
I have a subclass which overwrites each rule and adds Location
information to my custom AST elements. Something like this:
public final Expression listLiteral() throws RecognitionException {
updateLocation(listLiteral());
}
public <T extends AstElement> T updateLocation(T ele) {
//doing stuff with input.LT(1) and input.LT(-1)
return T;
}
1st question:
Is there a better way to do that generically? (without thirdparty AOP
stuff)
2nd Question:
Is there a way to say Antlr not to add the final keyword?
thanks,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070608/18926e87/attachment.html
More information about the antlr-interest
mailing list