Skip to content
Benjamin Kowarsch edited this page May 11, 2023 · 12 revisions

M2C Modula-2 Compiler & Translator Project

Welcome to the Wiki of the M2C Modula-2 Translator & Compiler Project

Objective

The objective of this project is to develop a highly portable, reliable, readable and maintainable Modula-2 to C translator and via-C compiler that generates authentic and readable C source code.

Purpose

The intended purpose for the M2C compiler is to provide a means:

  • to cross-compile, build and deploy a C hosted compiler for the BSK subset of Modula-2 R10.
  • to develop and bootstrap a self-hosting compiler for the full Modula-2 R10 specification.

Language

M2C shall support the bootstrap kernel subset of the revised Modula-2 language described in "Modula-2 Revision 2010" (Kowarsch and Sutcliffe, July 2020). For details, see the online language specification at the project wiki or download the PDF version. Please note that M2C will support only the foreign function interface to C. The CLR and JVM FFIs also described in the specification are specific to M2Sharp and M2J respectively, and will not be supported by M2C.

The earlier PIM and ISO dialects will not be supported.

Grammar

The grammar of the compiler is in the project repository

https://github.com/m2sf/m2c/blob/master/m2c-grammar.gll

For a graphical representation of the grammar, see Syntax Diagrams.

License

The M2C compiler is licensed under the GNU Lesser General Public License (LGPL) both v.2.1 and v.3.

Prerequisites

The M2C compiler is written in C99 and therefore a C99 compiler is required to build it.

There are no dependencies on any third party libraries.

OS support

M2C will compile and run on any target system supported by the host compiler.

M2C's filesystem and pathname libraries support the following operating systems:

  • AmigaOS
  • DOS, Windows
  • POSIX, Unix
  • VAX/VMS, OpenVMS

For other systems, filesystem access and pathname parsing libraries may have to be adapted.

IDE support

M2C has been integrated with Vim.

Status

This project is under active development (May 2023).

Contact

If you have questions or would like to contribute to the project, get in touch via

+++