Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么不使用ANTLR works 1.5生成c头文件?_C_Antlr3_Antlrworks - Fatal编程技术网

为什么不使用ANTLR works 1.5生成c头文件?

为什么不使用ANTLR works 1.5生成c头文件?,c,antlr3,antlrworks,C,Antlr3,Antlrworks,我试图在windows上使用antlrworks 1.5(ANTLR 3.5)从ANTLR.grammar文件生成c代码,但它不生成任何头文件,例如它生成的sample.g: 示例1.tokens 采样器 sampleParser.c 但是没有任何头文件,我不知道为什么 为了举例说明,我现在使用的语法非常简单: grammar sample; options { language = C; } rule1: 'ABC' ; 我还收到如下警告: [12:39:44] warni

我试图在windows上使用antlrworks 1.5(ANTLR 3.5)从ANTLR.grammar文件生成c代码,但它不生成任何头文件,例如它生成的sample.g:
示例1.tokens
采样器
sampleParser.c

但是没有任何头文件,我不知道为什么

为了举例说明,我现在使用的语法非常简单:

grammar sample;

options 
{
language    = C;
}

rule1:
'ABC'   
;
我还收到如下警告:

[12:39:44] warning(24):  template error: context [/outputFile /parser] 1:1 could not pass through undefined attribute filterMode
[12:39:44] warning(24):  template error: context [/outputFile /parser /genericParser /_sub721 /ruleAttributeScopeFuncMacro] 1:4 no such property or can't access: null.attributes
[12:39:44] warning(24):  template error: context [/outputFile /parser /genericParser] 155:5 no such property or can't access: null.apifuncs
[12:39:44] warning(24):  template error: context [/outputFile /parser /genericParser /rule /ruleDeclarations] 4:1 no such property or can't access: null.attributes
[12:39:44] warning(24):  template error: context [/outputFile /parser /genericParser /rule /ruleInitializations] 8:1 no such property or can't access: null.attributes
[12:39:44] warning(24):  template error: context [/outputFile /lexer /lexerRule /ruleDeclarations] 4:1 no such property or can't access: null.attributes
我发现了一篇关于stackoverflow上类似警告的文章:

(这是我发现的唯一一件事,我认为它可能对未生成头文件没有任何作用)

我希望能得到任何帮助,我想从我以前为java编写的SQL语法中生成一些C++项目的AST树,但是我被这个有趣的问题所困扰。 注:

我还查看了所有这些文章:

//起始指南 //关于如何安装ANTLR的指南 (虽然我使用的是AntlWorks,所以我不需要任何其他安装) //CplusTARGET(它不支持AST树,我在stackoverflow上读过它,这就是我现在尝试c目标的原因) //C目标
//目标示例

这可能是AntlWorks 1.5.1(将于下周发布)中已解决的错误的副作用


这可能是AntlWorks 1.5.1(将于下周发布)中已解决的错误的副作用


我在1.5.0中遇到了同样的问题
使用1.5.2解决了这个问题。你可以在这里下载

我在1.5.0中遇到了同样的问题
使用1.5.2解决了这个问题。您可以在这里下载它

您好,感谢您的帮助,我已经尝试在eclipse中使用目标包构建项目,我成功地构建了它,但是当我启动antlrworks-1.5.1-SNAPSHOT.jar时,我立即遇到了一个java异常。我是否可以立即构建项目并使用它?windows是否有其他方法可以从语法生成c文件?我目前正在使用eclipse中的c文件作为运行,正如您所说,问题已经解决了,但是我可以从中构建uber jar吗?如果是,你能给我一些指示吗?我也不能从源代码构建。但是我在这里下载的jar确实解决了头生成问题(无论如何对于cpp):您好,感谢您的帮助,我尝试在eclipse中使用目标包构建项目,我成功地构建了该项目,但是当我启动antlrworks-1.5.1-SNAPSHOT.jar时,我立即遇到了一个java异常。我是否可以立即构建项目并使用它?windows是否有其他方法可以从语法生成c文件?我目前正在使用eclipse中的c文件作为运行,正如您所说,问题已经解决了,但是我可以从中构建uber jar吗?如果是,你能给我一些指示吗?我也不能从源代码构建。但我在这里下载的jar确实解决了头生成问题(无论如何,对于cpp):