compiler README

The project's README from github.com/edgcpp/compiler. As one markdown file: README.md.

EDG Compiler Project

Welcome to the open source EDG C/C++ compiler project!

About

The EDG C/C++ front end is the primary focus of this repository. The EDG front end is known for: its excellent parsing compatibility and bug emulation, to make sure source that compiles with Clang, GCC, and MSVC compiles with EDG; extensive documentation, to assist with development and modification; and extreme configurability, to allow it to be derived for use into a large number of C/C++ oriented products.

The compiler project also includes: a C-generating back end, which can be used to generate C code for C++ programs; a C++-generating back end, which is useful for source-to-source transformation applications; a prelinker, which handles automatic template instantiation; a minimal runtime support library (but not any "real" libraries, e.g., for stream I/O); utilities to write the intermediate language to a file, read it back in, and display it in human-readable form; a name demangler; and a collection of purpose built development tools.

Documentation

See the documentation on: https://edgcpp.org/doc/.

[!NOTE]

If you would like to build a local copy of the documentation see the documentation build guide.

Building & Contributing

To get started, it's recommended for most people to clone the repository using a partial clone (this keeps a full copy of the git history while only downloading the most recent version of each file, git can implicitly fetch older versions as needed):

git clone --filter=blob:none [email protected]:edgcpp/compiler.git

If you are looking to build the front end from source and use it, please see the build instructions.

If you are looking to make changes to the front end, please see the contribution guide and the development guide for quickly getting setup.

Tips, Tricks, & Tutorials

To further aid humans and AI agents in product development there is additional documentation for tips, tricks, and tutorials that can be found in the development annex.

compiler (edgcpp/compiler)

Searching Database…

这是什么?这是开源的 EDG C/C++ 编译器前端项目:一个面向 C 和 C++ 的解析器和语义分析器,以能匹配 Clang、GCC 和 MSVC 的解析行为(包括它们的怪癖)而闻名,方便厂商把它嵌入自己的工具中。
它是能生成机器码的完整编译器,还是只是一个前端?它主要是一个前端(词法分析器/解析器/语义分析器),而不是能生成机器码的编译器。它自带的后端会把源码重新生成为 C 或 C++ 源码,用于源码到源码的场景,而不是生成本地二进制文件。
这个前端到底面向谁?构建自己编译器、IDE、静态分析器或源码到源码工具的公司和开发者,因为 EDG 的设计目标是高度可配置、可派生成多种不同的 C/C++ 相关产品,而不是作为一个成品独立编译器来使用。
除了解析功能,前端还自带哪些额外工具?它还包含一个处理模板自动实例化的预链接器(prelinker)、用于转储/读取/显示中间语言的实用工具、一个名字反修饰器(demangler),以及一个小型运行时支持库(不含完整的标准库实现)。
为什么匹配 Clang/GCC/MSVC 的解析行为在这里如此重要?因为 EDG 是要被嵌入其他厂商的编译器和工具中的,已经能在主流编译器下编译的代码必须原封不动地也能在 EDG 下编译,甚至包括为兼容而复现它们的解析缺陷。
Creator
edgcpp
Size
194.8 MB
Stars
936
Updated
CommitOct 16
Age
25d
Commits · 90 Days