Skip to content

Delphi (ObjectPascal) multi-target compiler using the LLVM framework.

License

Notifications You must be signed in to change notification settings

Level0r0s/multipascal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiPascal

MultiPascal is a Delphi (ObjectPascal) multi-target compiler using the LLVM framework. It is an attempt at a working Delphi7 compiler, in particular one capable of compiling to Flash (ActionScript 3). The original goal was to target the ActionScript Virtual Machine (AVM), in order to port some large Delphi projects such as the TERRA graphical engine and the Minimon 3D game to the web. Other future targets will include x86 and Javascript/asm.js+WebGL (probably using emscripten). Another interestig target would be Haxe.

MultiPascal was started in January 2014 and it's still in its early stages. As of Abril 2014, the Delphi front-end is mostly done, with the C++ back-end supporting most of Delphi features and an initial prototype of the LLVM IR back-end.

Planned stages of the project:

  • a Delphi front-end for LLVM

    Initially we thought of using the Dgrok recursive-descent (LL(k)) parser. However, looking at the work required to convert the simple lexical-oriented Parse Tree that Dgrok produces to a robust complete AST, we decided to create our own shift-reduce parser.
    So MultiPascal ended up with a complete new shift-reduce (LALR) parser created with the C# ports of the Jay Yacc-based parser generator (CSJay) and the JFlex lexer generator (CSFlex).
    Currently MultiPascal is built on top of LLVM 3.2, the same version used in FlaCC/Crossbridge.

  • a C++ back-end

  • AS3 (Flash) back-end

    We meant to emulate the manual memory management of Delphi through the Flash domain memory component, which was introduced in AS3 to support the FlaCC/Crossbridge C++ compiler. Some documentation on manual memory management in Flash can be found here

  • ABC (AS3 bytecode) back-end, based on the AVM2 target developed in FlaCC/Crossbridge

References:

About

Delphi (ObjectPascal) multi-target compiler using the LLVM framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 63.4%
  • Pascal 22.2%
  • Yacc 9.9%
  • Lex 4.1%
  • Makefile 0.2%
  • Shell 0.1%
  • Ruby 0.1%