gpt4 book ai didi

compilation - 编译语法时出错

转载 作者:行者123 更新时间:2023-12-01 09:57:14 25 4
gpt4 key购买 nike

我有一个语法 P.g,直到最近才悄悄编译。今天,当我在命令提示符下输入时:

java -cp .;../antlr-3.5-complete.jar org.antlr.Tool P.g

(语法在gram文件夹中,antlr-3.5-complete.jar在父文件夹中,提示放在gram文件夹中。)

生成以下错误:

warning(24):  template error: context [/outputFile /parser /genericParser /region__/genericParser__m
embers] 32:3 no such property or can't access: org.antlr.tool.Grammar.indirectDelegates
Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: org.antlr.tool.Gr
ammar.indirectDelegates
at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java
:106)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.lookupMethod(ObjectModelAdaptor.java:99)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:67)
at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1158)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:210)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:635)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:285)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:635)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:285)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:703)
at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:635)
at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:285)
at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
at org.stringtemplate.v4.ST.write(ST.java:415)
at org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1296)
at org.antlr.codegen.Target.genRecognizerFile(Target.java:98)
at org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:459)
at org.antlr.Tool.generateRecognizer(Tool.java:696)
at org.antlr.Tool.process(Tool.java:509)
at org.antlr.Tool.main(Tool.java:98)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.stringtemplate.v4.misc.Misc.invokeMethod(Misc.java:218)
at org.stringtemplate.v4.misc.ObjectModelAdaptor.lookupMethod(ObjectModelAdaptor.java:84)
... 23 more
Caused by: java.lang.NullPointerException
at java.util.Objects.requireNonNull(Unknown Source)
at java.util.ArrayList.removeAll(Unknown Source)
at org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:226)
at org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2722)
... 29 more

我没有改变任何东西。所有这些错误的原因是什么?

非常感谢您

最佳答案

使用Java8会发生这种情况,请尝试切换回7

关于compilation - 编译语法时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23572544/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com