解析C ++源代码 [英] Parsing C++ Source

查看:88
本文介绍了解析C ++源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我有很大的问题,希望有人能帮助我.我现在是我的单身汉,我应该从Visual Studio C ++/CLI工作项目的源文件中读取所有函数声明.我的程序也应该在VS中编写(C#或C ++/CLI)...最好的选择是,如果我可以从源代码中获取整个AST.我已经阅读了很多文章,据我了解,我应该使用"ANTLR","COCO/R"等解析器.因此,我正在寻找的示例说明了如何获取AST或至少在VS中使用"ANTLR"或其他方式进行功能声明的列表.我还发现,可以使用CppCodeProvider解析C ++源代码,但没有找到如何使用它的信息.
等待您的回复.
P.S.对不起,我的英语不好.

hi all.
i have big problem and hope that someone can help me. i''m doing my bachelor now and i should read all function declarations from source files of Visual Studio C++/CLI working project. My program should be made in VS too(C# or C++/CLI)... The best option would be if i could get the whole AST from source. i''ve read a lot of articles and as i understood i should use a parser like "ANTLR", "COCO/R" etc. So what i''m looking for, is an example which explains how can i get AST or at least a list of function declarations in VS using "ANTLR" or smth else. I''ve also found that it may be possible to parse C++ source with CppCodeProvider, but found no information how i can use it.
Waiting for your replies.
P.S. Sorry for my bad English.

推荐答案

Google找到了此信息 [ ^ ],所以我想您可以找到其他的并确定最合适的您的需求.
Google found this information[^] for ANTLR, so I guess you can find the other ones and decide which best suits your needs.


这篇关于解析C ++源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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