[fpc-devel] Pascal to Javascript - Still being Updated ? / General Conversion

Michael Van Canneyt michael at freepascal.org
Sun Aug 2 09:41:43 CEST 2015



On Sun, 2 Aug 2015, Daniel Gaspary wrote:

> On Sun, Aug 2, 2015 at 4:18 AM, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>>>   How about change to an Abstract Converter Class(interface?) ??
>>
>> What do you mean by this ?
>>
>>>   I am thinking about using the same structure to convert to some text
>>> format.
>>
>> All you will have in common is the fcl-passrc ?
>
> Today the Converter is dedicated to one format only: Javascript.
>
> I was thinking about a base Pascal converter. After that, specific
> converters could be implemented:
>
> TPascalConverter = class
>
> procedure WriteIfStatement(...); virtual;
> procedure WriteWhileStatement(...); virtual;
>
> end;
>
> TPascalToJavascriptConverter = class(TPascalConverter)
>
> procedure WriteIfStatement(...); override;
> end;
>
> TPascalToJSonConverter = class(TPascalConverter)
> procedure WriteIfStatement(...); override;
> end;
>
> Something like that.

Like I said, all that is in common then is fcl-passrc. 
This proposed class will just contain some loops, I'm not sure if that is worth it ?

But if you want to do the ground work (create a superclass for the current converter): 
Be my guest. Make sure the testsuite of the JS converter runs without errors.

Michael.



More information about the fpc-devel mailing list