gpt4 book ai didi

c++ - Boost.Spirit 可以在理论上/实践上用于解析 C++(0x)(或任何其他语言)吗?

转载 作者:IT老高 更新时间:2023-10-28 21:57:10 25 4
gpt4 key购买 nike

理论上可以胜任吗?

是否可以实际完成?生成的解析器是否能以足够的性能和输出(例如,LLVM IR 或 GCC 的 gimple)集成到竞争编译器中?

最佳答案

对不起。我和它的作者谈过,他说他不会让它完全解析 C++,但承认他接受它来解析某些结构是模棱两可的。

所以这不再是答案了!!


<罢工>我建议你看看scalpel .从它的主页

Scalpel stands for source code analysis, libre and portable library. This is a C++ library which aims to perform full syntax and semantic analysis of any given C++ program.

还有

What makes me think Scalpel could be accepted into Boost

Scalpel uses itself several Boost libraries: Spirit, Wave, shared_ptr (now in C++0x's STL), Optional, Test, etc.. Actually, it exclusively uses Boost libraries and the C++ standard library, which is required by Boost.

Besides, Boost already provides a Spirit-based C++ source code preprocessing library: Wave. Including a C++ source code analysis library seems to be a natural evolution.

关于c++ - Boost.Spirit 可以在理论上/实践上用于解析 C++(0x)(或任何其他语言)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6063888/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com