本文介绍了正在为C ++获取AST?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我希望获得用于C ++的AST,然后可以与外部程序进行解析。那里有哪些程序可以为C ++生成AST?我不在乎它是以什么语言实现的或输出格式(只要它易于解析)。

I'm looking to get an AST for C++ that I can then parse with an external program. What programs are out there that are good for generating an AST for C++? I don't care what language it is implemented in or the output format (so long as it is readily parseable).

我的总体目标是转换C ++单元测试

My overall goal is to transform a C++ unit test bed to its corresponding C# wrapper test bed.

推荐答案

您可以使用,尤其是解析C ++代码。这是一个非常高质量的手写库,用于词法分析,解析和编译C ++代码,但它也可以生成AST。

You can use clang and especially libclang to parse C++ code. It's a very high quality, hand written library for lexing, parsing and compiling C++ code but it can also generate an AST.

这篇关于正在为C ++获取AST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 08:45