Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
默认情况下,使用 ANTLR-3 生成的解析器扩展自 org.antlr.runtime.Parser。我如何让它扩展我的自定义类?
您可以通过使用superClass语法中的选项来做到这一点:
superClass
grammar G; options { superClass = YourCustomClass; } parse : ... ;
这将产生:
public class GParser extends YourCustomClass { // ... }