Skip to content

C-Core-Compiler Docs

A documentation hub for a staged, explainable C subset compiler built in Python.

This site is designed for two kinds of readers:

  • people who want to use the compiler and run examples quickly
  • people who want to study how the compiler is structured internally

Start In English

Follow the English reading path if you want architecture, implementation, CLI, and examples explained stage by stage.

Open English docs

从中文开始

如果你想用中文阅读项目原理、CLI、示例和仓库结构,可以从这里进入。

打开中文文档

What You Can Read Here

Compiler Architecture

Understand the full pipeline from source code to executable, including why this project currently uses two backend paths.

Stage-by-Stage Internals

Follow the compiler as it moves through lexing, parsing, semantic analysis, IR lowering, optimization, and backend generation.

Practical Debugging

Use the CLI as a structured inspection tool, not just as a launcher. Learn which flag maps to which compiler layer.

Example Programs

Read the sample programs as a learning set for language boundaries, control flow, recursion, arrays, strings, and pointers.

  1. Open the English or Chinese home page
  2. Read the compiler overview
  3. Follow lexing, parsing, semantics, and IR in order
  4. Use the CLI guides to inspect intermediate outputs
  5. Use the examples guide to compare the int subset path and the AST backend path
  1. Start with Getting Started or 快速开始
  2. Run hello.c
  3. Run a _stdout example
  4. Inspect --emit-c to see the generated backend code
  5. Return to the architecture pages when you want to understand why it works