gpt4 book ai didi

java - 需要在 ANTLR 2.7 中构建 C# 示例的帮助

转载 作者:太空宇宙 更新时间:2023-11-04 09:00:17 25 4
gpt4 key购买 nike

我需要构建 ANTLR v 2.7.7 附带的 CSHARP V1 示例。

命令:
D:\Comp\antlr\examples\csharp\csharp_v1>nant

我得到以下输出:



<p>D:\Comp\antlr\examples\csharp\csharp_v1>D:\Comp\nant\bin\nant
NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006)
Copyright (C) 2001-2006 Gerry Shaw
<a href="http://nant.sourceforge.net" rel="noreferrer noopener nofollow">http://nant.sourceforge.net</a></p>

<p>Buildfile: file:///D:/Comp/antlr/examples/csharp/csharp_v1/csharp_v1.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: test</p>

<p>[tstamp] Monday, May 11, 2009 11:21:20 PM.
[echo] Building project: 'CSharp v1 Grammar Sample for ANTLR' generate:
[exec] java.lang.NoClassDefFoundError: antlr/Tool
[exec] Caused by: java.lang.ClassNotFoundException: antlr.Tool
[exec] at java.net.URLClassLoader$1.run(Unknown Source)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at java.net.URLClassLoader.findClass(Unknown Source)
[exec] at java.lang.ClassLoader.loadClass(Unknown Source)
[exec] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[exec] at java.lang.ClassLoader.loadClass(Unknown Source)
[exec] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[exec] Could not find the main class: antlr.Tool. Program will exit.
[exec] Exception in thread "main"</p>

<p>BUILD FAILED - 0 non-fatal error(s), 11 warning(s)</p>

<p>D:\Comp\antlr\examples\csharp\csharp_v1\csharp_v1.build(52,10):
External Program Failed: java.exe (return code was 1)</p>

<p>Total time: 0.2 seconds.</p>

我的 nANT 可以在其他版本中正常工作。

我不是java人...任何帮助都会有帮助。

亲切的问候,

最佳答案

查看 make 文件 csharp_v1.build。

在第 10 行将其更改为:

<property name="antlr.dir" value="..\..\.."/>

<property name="antlr.dir" value="..\..\..\antlr.jar"/>

关于java - 需要在 ANTLR 2.7 中构建 C# 示例的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/849255/

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