简体   繁体   English

在 Visual C# Express 2010 中使用 ANTLR 编译时出错

[英]Error when compiling with ANTLR in Visual C# Express 2010

I'm trying to build an application in C# that parses (using ANTLR) a C source file and returns me an AST with all the functions and stuff.我正在尝试在 C# 中构建一个应用程序,该应用程序解析(使用 ANTLR)一个 C 源文件并返回一个包含所有功能和内容的 AST。

I did what was explained here: http://www.antlr.org/wiki/pages/viewpage.action?pageId=557075# But after doing all that when I try and compile I get the following errors: The type or namespace name 'GrammarRuleAttribute' could not be found (are you missing a using directive or an assembly reference?)我做了这里解释的事情: http://www.antlr.org/wiki/pages/viewpage.action?pageId=557075#但是在我尝试编译所有这些之后,我得到以下错误:类型或命名空间名称找不到“GrammarRuleAttribute”(您是否缺少 using 指令或程序集引用?)

I have antlr-3.4 and antlrworks-1.4.3.jar I've used the dll that are in the \antlr-3.4\runtime\CSharp2\dist\DOT-NET-runtime-3.1.3.zip and just noticed now that they are supposed to be for ANTLR 3.1.3 I have antlr-3.4 and antlrworks-1.4.3.jar I've used the dll that are in the \antlr-3.4\runtime\CSharp2\dist\DOT-NET-runtime-3.1.3.zip and just noticed now that它们应该用于 ANTLR 3.1.3

What could cause my problem, I must say I'm a bit lost so many versions什么可能导致我的问题,我必须说我有点迷失了这么多版本

i had the same problem.我有同样的问题。 using the runtime libs provided here and CSharp3 target with antlr 3.4 worked for me.使用此处提供的运行时库和带有 antlr 3.4 的 CSharp3 目标对我有用。 the problem is that the runtime libs comming with antlr-3.4 for CSharp2 target are out of date.问题是用于 CSharp2 目标的 antlr-3.4 的运行时库已过时。 i did not try, but maybe building the runtime libs from source is another option that could help.我没有尝试,但也许从源代码构建运行时库是另一种可能有所帮助的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM