帮助您添加libclang python绑定中缺少的功能
cymbal的Python项目详细描述
概述
cymbal使添加libclang python绑定中缺少的功能变得容易
clanglibclang python绑定使用ctypes调用存在的函数 在libclang动态库中。在某些情况下,只有c函数的一个子集 是可用的,因为特定于平台或版本的python绑定忽略了 功能。cymbal简化了将这些方法动态添加到 类型和游标。
用法
导入cymbal,monkeypatch任何必需的函数,添加适当的cTypes 必要时注释。
importclang.cindexfromclang.cindeximport*importcymbalfromctypesimport*# add functions omitted from the pip installable clang packages on OSXcymbal.monkeypatch_type('get_template_argument_type','clang_Type_getTemplateArgumentAsType',[Type,c_uint],Type)cymbal.monkeypatch_type('get_num_template_arguments','clang_Type_getNumTemplateArguments',[Type],c_int)
要求
唯一的要求是libclang和libclang的python绑定。
贡献
如果你在使用钹时遇到问题,log them on GitHub。如果你 想要贡献代码,请fork the code和submit a pull request。
许可
这个项目建立在llvm团队和伊利诺伊大学的工作基础上。 在乌尔巴纳香榭丽舍,但不属于任何一个集团。