[fpc-pascal] PasJS

Michael Van Canneyt michael at freepascal.org
Sat Sep 26 09:35:55 CEST 2009

On Fri, 25 Sep 2009, Jorge Aldo G. de F. Junior wrote:

> Hi !
> Im working on the PasJS translator but im having some problems :
> How to map ObjectPascal object orientation philosophy into JavaScript object orientation philoshopy ?

Do you think there is a choice ? In JS, everything is an object. 
As far as I can see, there is not really much of a choice ? 
You should add the methods, fields and properties to the object's prototype ?

> Im trying a direct Syntax Tree -> Output approach, while outputting (if a debug flag is enabled) comments containning original line of code, original line
> number and original column number as to allow easier debugging.
> I gave up trying to do semantic analisys at the translator because its too hard (its like almost creating a new FPC compiler from scratch, so i believe letting
> the browser debug for us - and having the line numbers to check for mistakes - its the best approach).
> But i need volunteers !

A Pascal -> JS translator is on my todo list, but for that I need to extend the
pparser unit in fcl-passrc to read complete units, not just the interface.


More information about the fpc-pascal mailing list