Giter Club home page Giter Club logo

m2sharp's Introduction

M2Sharp โ€” A CLR hosted Modula-2 to C# Translator

Welcome to the M2Sharp Modula-2 to C# Translator and Compiler Project

Objective

The objective of this project is to develop a CLR hosted Modula-2 to C# translator and via-C# compiler that generates CLR executable code.

In translator mode, M2Sharp translates Modula-2 source to C# source files. In compiler mode, M2Sharp compiles Modula-2 source via C# source files to object code or executables using the host system's C# compiler.

Language

M2Sharp supports the bootstrap kernel (BSK) subset of Modula-2 R10 (M2R10).

An online version of the language specification is here:

https://github.com/m2sf/m2bsk/wiki/Language-Specification

The authoritative language specification (PDF) is available for download:

https://github.com/m2sf/PDFs/blob/master/M2BSK%20Language%20Description.pdf

M2C does not support the earlier PIM or ISO dialects.

Grammar

The grammar of M2C's command line interface is in the project repository

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

The grammar of Modula-2 R10 is in the project repository

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

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

Targets

M2Sharp will generate C# sources compileable with any C# compiler.

There are no dependencies on any third party libraries.

OS support

M2Sharp will compile and run on any target system with a CLR execution environment.

Development Languages

  • M2Sharp itself is written in C#.
  • The syntax diagram generator script is written in TCL/TK (not required to build M2Sharp)
  • Build configuration scripts are written in the prevalent shell language of the hosting platform

Project Wiki

For more details please visit the project wiki at the URL: https://github.com/m2sf/m2sharp/wiki

Contact

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

+++

m2sharp's People

Contributors

m2sfpa avatar trijezdci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

m2sharp's Issues

Implementing a tokenset type

A decision is required how to implement a tokenset type for the FIRST and FOLLOW sets.

There are two choices:

(1) generic

In Java there is a generic set of enums called EnumSet. We could implement that in C# an then use it like this ...

public EnumSet<ITerminals.Token> FIRST (Production p);

(2) specific

Alternatively, we could follow the C implementation (m2-tokenset.h) and implement a specific tokenset type in C#. This would then be used like this ...

public TokenSet FIRST (Production p);

Approach #1 is certainly more elegant and also reusable. OTOH, approach #2 is probably less effort because we can derive it from the C version.

OPAQUE type definition

TO DO:

  • - add OPAQUE type definition syntax to EBNF
  • - add capability for explicit OPAQUE type definition
  • - add OPAQUE reserved word to terminal symbols
  • - implement OPAQUE resword recognition in resword recogniser
  • - implement OPAQUE type definition syntax in parser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.