By default, a parser generated using ANTLR-3 extends from org.antlr.runtime.Parser. How do I have it extend my custom class instead?
+1
A:
You can do that by using the superClass
option in your grammar:
grammar G;
options {
superClass = YourCustomClass;
}
parse
: ...
;
which will generate:
public class GParser extends YourCustomClass {
// ...
}
Bart Kiers
2010-04-16 17:01:07
Perfect, thanks!
etheros
2010-04-16 17:15:00
You're welcome etheros.
Bart Kiers
2010-04-16 17:20:24