Pipeline

Aburi follows a traditional compiler frontend pipeline and lowers typed source programs to LLVM IR. A custom backend is planned soon.

Driver Setup

main.cpp parses command-line arguments, chooses compilation mode, configures language and target options, routes input files, and decides whether to invoke the linker.

Preprocessing

preprocessor.h and preprocessor.cpp handle include resolution, conditional compilation, macro expansion, and token production. The

Parsing and Semantic Analysis (Collect)

The parser consumes tokens and builds a Clang-like AST using recursive descent. C++ ambiguity handling relies on tentative parsing where needed.

The collect/ subsystem performs semantic checks, type resolution, scoping, lookup, overload work, and AST construction support. The ast/ layer owns node definitions, clone helpers, side tables, and shared type/symbol support.

In the early days of Aburi, there was no dedicated semantic analysis module. Later editions used a seperate 'Sema' module after parsing was complete. As C++ is a very context-dependent language, I made the choice to move to the Collect architecture which is now in use today.

Constant Evaluation

constexpr/ evaluates compile-time expressions used by array sizes, enum values, _Static_assert, and related language features.

Right now the evaluator will tree-walk the AST to evaluate if needed. Using a bytecode system for faster performance is on the roadmap.

LLVM Lowering

ast2llvm/ translates the semantic AST into LLVM IR. abi/ handles ABI policy, layout, mangling, vtables, exception lowering, and target-specific details.

Backend and Linking

After IR generation, Aburi uses LLVM optimization and emission machinery to produce assembly or objects. Full compilation can then invoke the system linker to produce an executable.