C++11 source code generation

社会主义新天地 提交于 2019-12-06 11:48:05

Check out the Clang compiler which uses a library-based architecture to support implementing IDEs and other tools that need to process the AST. Clang fully supports all C++11 features (and some C++1y features)

More information can be found in the Clang documentation. Or in this blog which describes basic source to source transformations using clang::Rewriter.

This is still in a very experimental phase, but in our lab we are developing a tool (Clava), which is based on Clang and uses a Javascript-like language to query and transform a given C/C++ code. It will be made open-source by the end of August 2017.

For instance, the current default example in the demo website reads all classes and structures in the C/C++ code and creates a C++/H pair with HDF5 wrappers for those classes (however, that code generation is a mix between AST and String literals).

(Clava - Online Demo)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!