是否有Python Clang包装在pygccxml的静脉包裹GCC-XML? [英] Is there Python Clang wrapper in the vein of pygccxml which wraps GCC-XML?

查看:164
本文介绍了是否有Python Clang包装在pygccxml的静脉包裹GCC-XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很久以来,我一直在使用pygccxml来解析和内省我的C ++源代码:它帮助我在我们的构建过程中做一些聪明的代码生成。

For a long time now I've been using pygccxml to parse and introspect my C++ source code: it helps me to do some clever code-generation during our build process.

最近,我阅读了很多关于LLVM堆栈的好处,特别是LLVM Clang解析器带给C ++编译的好处。我现在想知道是否有任何Python接口Clang,使我可以使用它作为一些现有的代码生成任务的基础?

Recently I've read a lot about the benefits of the LLVM stack, and especially the benefits that the LLVM Clang parser brings to C++ compilation. I am now wondering if there is any Python interface to Clang such that I could use it as the basis for some of my existing code generation tasks?

推荐答案

进一步挖掘之后,我发现在 LLVM 2.7 release 可能会有一些有用的开始:

After further digging I found that in the LLVM 2.7 release there could be the beginings of something useful:


在LLVM 2.7时间框架中,Clang团队进行了许多改进....

In the LLVM 2.7 time-frame, the Clang team has made many improvements....

CIndex API和Python绑定:Clang现在包括C API作为CIndex库的一部分。虽然我们在将来对API进行了一些更改,但它旨在稳定并已设计为供外部项目使用。有关更多详细信息,请参阅Clang doxygen CIndex文档。 CIndex API还包括一组初步的Python绑定。

CIndex API and Python bindings: Clang now includes a C API as part of the CIndex library. Although we make make some changes to the API in the future, it is intended to be stable and has been designed for use by external projects. See the Clang doxygen CIndex documentation for more details. The CIndex API also includings an preliminary set of Python bindings.

我不知道这在实践中是多么有用,像它可以是基于LLVM构建一个pygccxml等效的基础,但它本身不是这样的库。

I'm not sure how useful this is in practice, certainly it looks like it could be the foundation for building a pygccxml equivalent based on LLVM but it is not in itself such a library.

这篇关于是否有Python Clang包装在pygccxml的静脉包裹GCC-XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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