import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.tree.*;
public class Test{
public static void main(String[] args) throws Exception{
ANTLRInputStream input = new ANTLRInputStream(System.in);
ArrayInitLexer lexer = new ArrayInitLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
ArrayInitParser parser = new ArrayInitParser(tokens);
ParseTree tree = parser.init();
System.out.println(tree.toStringTree(parser));
}
}
我已经找到官方接口(http://www.antlr.org/api/Java/index.html)了,但还是不知道怎么解决。
发布于 2018-06-05 11:22:53
他们的官方网站ANTLR推荐使用CharsStreams类,因为4.7版的ANTRLInputStream已被弃用。
https://stackoverflow.com/questions/50691510
复制相似问题