Wascal IDE
 
Pas2Php
 
Geep Software
 
Buzz PHP
 
Code Library
 
Contacts
 
Credits
 

PAS2PHP v0.8 - Pascal to PHP Transpiler

Wikipedia: What is a Transpiler?

 About Test Examples Pas2Php Library Downloads 

About Pas2Php

Pas2Php will translate a large subset of Object Pascal to PHP, allowing you to write web applications using Lazarus/FreePascal, and then run the application on a standard HTML/PHP server.

Over the last week, a lot of work has gone into Pas2Php. Most of the major issues are resolved. There are still a number of incompatibilities which are either not fixable, or have simple workarounds. As of v0.5, you should be able to write entire PHP applications in Pascal. The key to coding for Pas2Php is to understand the limitations of PHP. Read the example code provided, and always check the outputted PHP code to understand how this works.

As a guide to what Pas2Php can achieve... this web site is written in Pascal, and then converted to PHP. (The code is in the source package). Pas2Php uses the Pascal Parse Tree Classes (PasTree) which comes with FreePascal, and therefore the parsing limits are defined by this library.

You can download the latest source of Pas2Php from this site which includes an example project. There isn't much documentation, so, if you want to use Pas2Php, you will have to experiment with the code.

Language Feature Status Table

Note: Features that are "Done", may still need testing. This is just a guide to the progress of the conversion.

Feature DetailsStatus
Expressions
Done
Procedures (with Parameters)
Done
Functions (with Parameters)
Done
Support for properties
Done
Case Of/Else
Done
Repeat/Until
Done
For/Do (with Downto)
Done
If/Then/Else
Done
Local/Global Variables & Constants
Done
String Indexing From 1 (Pascal Style)
Done
Variant Array Support
Done
Nested Functions & Procedures
Done
Classes with Variables
Done
Classes with Methods
Done
Support for Objects
Done
Basic PHP Functions
Done
Basic Pascal Functions
Done
Record Support
Done
Var Parameters Support
Done
Use PHP Constants (ie: Not Global Variables)
Done
Support for Packages (Multiple Modules)
Done
Automatic Unit Loading
Done
Basic Enum Support (ie: Index Only)
Done
Inherited Method Calls
Done
Try/Finally/Except Support
Done
Default Argument Values
Done
Function Aliases (Map Compatible Pascal to PHP)
Done
Built in Identifier Name Checking
Pending
With/Do Support (Maybe...not)
Pending
Redundant Code Removal
Pending

Geep Software License

Geep software is designed to be free/easy and fun to use. But, as with all software, please note that this software is provided "AS IS" and without warranty of any kind. (Read Below for more information.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright (C) 2014 Derek John Evans
http://www.wascal.net/

Top Downloads
Wascal IDE v1.0.4
PAS2PHP v0.8
Lazbro v0.4

Geep Software Downloads
Wallpaper Manager
Second Copy

Programming Tools
Wascal IDE
Lazarus IDE
Free Pascal
NSSM - Service Manager

Pascal API's
Indy (Internet Direct)
Jedi Code Format
RemObjects Pascal Script
SynEdit

JavaScript API's
Dynarch Calendar
TinyMCE
CKEditor

Audio/Video Tools
Reaper
ASIO4ALL
Lame MP3 Encoder
FFmpeg