C ++ 11源代码生成 [英] C++11 source code generation

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

问题描述

是否存在某种C ++库,其中包含代表C ++源代码的类?
当然应该能够将源代码输出到流中。
我正在寻找一种支持大多数C ++ 11功能并且还能够生成模板结构的东西。

Is there some sort of library for C++ which contains classes which represents C++ source code? It should of course be able to output the source code to a stream. I'm looking for something which supports most C++11 features and is also capable of generating templated constructions.

当我用google搜索时,我会我没有得到我想要的结果。不过,我敢肯定,有可用的东西。也许我只是使用了错误的术语。

When I google for this, I'm not getting the results I want. I'm sure though, that there is something available. Maybe I'm just using the wrong terms.

推荐答案

查看 Clang 编译器,它使用基于库的体系结构支持实施IDE和其他需要处理AST的工具。 Clang完全支持所有C ++ 11功能(以及某些C ++ 1y功能)

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)

更多信息,请参见 Clang文档。或在此博客中其中描述了使用 clang :: Rewriter

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

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

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