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

时间:2009-05-11 17:55:49

标签: java nant antlr

我需要构建CSLARP V1示例,该示例附带ANTLR v 2.7.7。

命令:
d:\小样\ ANTLR \例子\ CSHARP \ csharp_v1>恶性

我得到以下输出:

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 http://nant.sourceforge.net

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

[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"

BUILD FAILED - 0 non-fatal error(s), 11 warning(s)

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

Total time: 0.2 seconds.

我没有为其他版本正常工作。

我不是一个java家伙......任何帮助都会有所帮助。

亲切的问候,

1 个答案:

答案 0 :(得分:1)

查看make文件csharp_v1.build。

第10行改为:

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

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