[fpc-devel] Dumping the syntax tree

Vsevolod Alekseyev sevaa at sprynet.com
Thu Oct 23 17:59:39 CEST 2014


On second look, no, the -vp tree is not sufficient. It doesn't have 
datatype definitions, doesn't have interface definitions...

On 10/22/2014 4:44 AM, Nikolay Nikolov wrote:
> On 10/22/2014 12:23 AM, Vsevolod Alekseyev wrote:
>> Hi all,
>>
>> I wonder where in the FPC compilation flow would be a good spot to 
>> dump the parsed syntax tree of a source?
>>
>> Here's why I'm asking. For a while now, I've been struggling to adapt 
>> a bunch of Pascal code to various mobile platforms. It's been 
>> painful. The code itself is pretty conservative feature-wise, almost 
>> K&R C-like (except sets and ansistrings). I wonder if I could slap 
>> together a quick and dirty Pascal-to-C converter just for this 
>> codebase to work, but I'd rather reuse the existing parsing logic.
>>
>> So if anyone could point me at a spot in the FPC source where the 
>> source tree is more or less ready, that's be nice. Thanks in advance.
> The compiler already supports dumping the parse tree when you use the 
> -vp option. But it's more intended for debugging the compiler - I 
> don't know if it'll work for you.
>
> Nikolay
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>




More information about the fpc-devel mailing list