Skip to content

Delphi multi-target compiler using the LLVM framework.

License

Notifications You must be signed in to change notification settings

miguelzf/multidelphi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiDelphi

MultiDelphi 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.

This project is still in its early stages. 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 MultiDelphi 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 MultiDelphi 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 multi-target compiler using the LLVM framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published