在哪里可以找到标准的BNF或YACC语法的C ++语言? [英] Where can I find standard BNF or YACC grammar for C++ language?

查看:154
本文介绍了在哪里可以找到标准的BNF或YACC语法的C ++语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力开发一种代码生成器来帮助单元测试遗留的C / C ++混合项目。我没有找到任何种类的独立工具可以从声明中生成存根代码。所以我决定建一个,它不应该那么难。

I'm trying to work on a kind of code generator to help unit-testing an legacy C/C++ blended project. I don't find any kind of independent tool can generate stub code from declaration. So I decide to build one, it shouldn't be that hard.

任何人都可以给我一个标准语法链接,更好地用yacc语言描述。

Please, anybody can point me a standard grammar link, better described by yacc language.

最好的问候,
Kevin

Best Regards, Kevin

推荐答案

对于另一种方法,您可以考虑对现有编译器进行piggy-backing。

For another approach, you could consider piggy-backing on an existing compiler.

GCC-XML 将编译C ++到具有大量有用信息的XML文件中;

GCC-XML will "compile" C++ into XML files with a lot of useful information; it may be enough for your purposes.

不幸的是,GCC-XML只有1/4的维护,让它工作可以...有趣。祝你好运,如果你走这条路线。

Unfortunately, GCC-XML is only 1/4-maintained, and getting it to work can be...interesting. Good luck, if you go this route.

这篇关于在哪里可以找到标准的BNF或YACC语法的C ++语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆