Skip to content

alexkowalenko/axcomp

Repository files navigation

AX compiler

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, SET types. (SMALLINT, etc. aliased to INTEGER (i64), LONGREAL aliased to REAL (double)).
  • Nested PROCEDUREs (with closures in LLVM!).
  • RECORD types, with base RECORD types.
  • Multidimensional ARRAY types.
  • 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.
  • STRING type which supports UTF-8.

See the AX Oberon-2/07 Language Report_ in the report directory.

Dependencies

To build the compiler:

To test:

To generate the language report – TeX.

Usage

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.

Open Source Licensing information

The project is covered by the license in LICENSE. The following are exempt and have the following licenses:

  1. 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.
  2. 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.

Packages

 
 
 

Contributors