Coder Social home page Coder Social logo

redstar / m2lang Goto Github PK

View Code? Open in Web Editor NEW
64.0 14.0 10.0 1.42 MB

The LLVM-based Modula-2 compiler

License: Other

CMake 4.25% C++ 79.68% Batchfile 0.20% Python 1.22% C 0.16% GAP 6.62% Modula-2 0.91% NASL 6.96%
modula-2 llvm llvm-frontend ast-generator compiler parser-generator

m2lang's Introduction

m2lang - The LLVM-based Modula-2 compiler

Build Status Build Status

Introduction

See this FOSDEM 2019 talk for some details.

Implementation decisions

  • LLVM is only external dependency
  • CMake scripts derived from clang
  • ISO Modula-2 language first
  • Use "declare-before-use" (single-pass) model
  • Goal is target several platforms from the beginning

Current status

  • The lexer is done.
  • The preprocessor (for handling of directives) is is based on the draft technical report "Interfacing Modula-2 to C", Annex B and aims to be compatible to the Macintosh p1 compiler. Parsing of directives is implemented, with mostly no functionality.
  • The parser is based on ISO Modula-2 with generic and OO additions. Some LL(1) conflicts are still left in the grammar, so not every source is parsed correctly.
  • The parser is generated by LLtool. A C++ port of LLtool is now integrated into this project, but not yet enabled.
  • Error recovery in the parser is based on "panic mode", using the follow sets of the current and the active callers.
  • The AST nodes are generated by ASTtool.
  • Error messages are outputted using llvm::SourceMgr for nice presentation.
  • Only a dummy driver exists to see the parser in action.
  • A couple of IR statements is emitted to the console after succesful parsing.

m2lang's People

Contributors

redstar avatar

Stargazers

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

Watchers

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

m2lang's Issues

Turn AST into LLVM IR

Write a minimal code generator to translate the AST after semantic analysis into LLVM IR.

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.