Compiler for the Oberon-0 language and progressing towards implementing Oberon-2, implemented in C++17, using the LLVM compiler infrastructure for code generation.
Supports at the moment:
- The Oberon0 definition in Writh's Compiler Construction (1996, 2017).
- Modules with the IMPORT statement.
- REALs, CHARs, SET types. (SMALLINT, etc. aliased to INTEGER (i64), LONGREAL aliased to REAL (double)).
- Nested PROCEDUREs (with closures in LLVM!).
- RECORD types, with base RECORD.
- Multidimensional ARRAY types.
- Open ARRAYs.
- POINTER TO ...
- Oberon-2 statements FOR, LOOP, EXIT, REPEAT, CASE, RETURN.
Beyond the Oberon-2 definition:
- UTF-8 source code, identifiers, and CHARs.
- STRING type which supports UTF-8.
See the AX Oberon-2/07 Language Report in the report directory.
To build the compiler:
- C++ 23 compiler - tested with Clang++ 17.0.
- LLVM 17.0.0.
- UTFCPP v3.2.1 - support UTF-8 text (https://github.com/nemtrif/utfcpp.git).
- Boehm garbage collection
- CMake - build and test the compiler.
To test:
- GoogleTest release-1.13.0 - test suites (https://github.com/google/googletest.git).
- Python 3.7 - to run the xtext test suite.
To generate the language report - TeX.
How to run the compiler is explained in the AX Oberon-2/07 Language Report.
Limitations are listed in the AX Oberon-2/07 Language Report.
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.