[Lazarus] Using FPC parser/tokenizer for code formatting

Aleksa Todorovic alexione at gmail.com
Mon May 31 14:48:06 CEST 2010


On Mon, May 31, 2010 at 14:15, Adem <listmember at letterboxes.org> wrote:
>
> So, if I understand this right, the code is parsed but instead of producing
> a tree, a more directly usable structure is created.
>
> Now, the question is, can it be made to produce (in parallel with what it
> already does) a tree to be used elsewhere?
>

It probably won't be possible because (as noted by Mattias) compiler
doesn't actually parse false-branch of $IFDEFs, and this cut-off is
done before syntax check during source code preprocessing.

>> No idea, at least I expect a lot of pitfalls.
>>
>
> Pitfalls.. definitely --and probably more than what anyone can guess now.
>
> That's why I'd like someone with the correct skill set to handle it.

Well... "someone with the correct skill" already made suggestion to
better invest time/energy/money in improving another parser (one from
fcl, codetools, ...), and leave compiler's one intact. That is the
best approach, I'd say.


Regards,
Aleksa




More information about the Lazarus mailing list