Compiler for the Oberon language, implemented in C++26, using the LLVM compiler infrastructure for code generation.
Supports:
- The Oberon0 definition in Writh's Compiler Construction (1996, 2017).
- Modules with the IMPORT statement.
REALs,CHARs,SETtypes. (SMALLINT, etc. aliased toINTEGER(i64),LONGREALaliased toREAL(double)).- Nested
PROCEDUREs (with closures in LLVM!). RECORDtypes, with baseRECORDtypes.- Multidimensional
ARRAYtypes. - Open
ARRAYs. POINTER TO...- Oberon-2 statements like:
FOR,LOOP,EXIT,REPEAT,WHILE,CASE,RETURN.
Beyond the Oberon-2 definition:
- UTF-8 source code, identifiers, and
CHARs. STRINGtype which supports UTF-8.
See the AX Oberon-2/07 Language Report_ in the report directory.
To build the compiler:
- C++ 26 compiler - tested with Clang++ 21.1 on macOS.
- LLVM 21.0.0.
- UTFCPP v3.2.1 - support UTF-8 text (https://github.com/nemtrif/utfcpp.git).
- Boehm garbage collection
- ICU4C v78.1 – support UTF-8 text (https://github.com/unicode-org/icu.git).
- CMake 4.0 – build and test the compiler.
To test:
- GoogleTest release-1.17 - test suites (https://github.com/google/googletest.git).
- LLVM lit and FileCheck - regression tests.
To generate the language report – TeX.
The compiler is axcomp, and the wrapper is ax. Use the --help option to list various compilation options.
See the AGENTS.md file for more information about running the compiler, and the layout of the source code
and test directories.
The project is covered by the license in LICENSE. The following are exempt and have the following licenses:
- Some of the test code in xtest, is originally from the oo2c project hosted at Spirit of Oberon (https://github.com/Spirit-of-Oberon/oo2c.git). This is covered by the GNU General Public License v2.0.
- Test code in xtest/parse.ETHZ is from the ProjectOberon2013 hosted at Spirit of Oberon (https://github.com/Spirit-of-Oberon/ProjectOberon.git). Copyright (C)2013 Niklaus Wirth (NW), Juerg Gutknecht (JG), Paul Reed (PR/PDR), as listed in license.txt.