我正在寻找一种方法,包括从ANTLR生成的输出.java文件中的几个附加字符串。是否有可用指令的全面列表?例如,给定的解析器输出如下:
package com.foo.bar; //<-- this can be generated with @header { .... }
//antlr generated
import org.antlr.runtime.*;
...
//<-- is there a way to generate anything here?
public class MyParser {
//<--- or here?
public void f1(){ ... }
}
有没有方法生成出现在导入语句(例如类级注释)之后的字符串,或者可能是方法注释?