[Lazarus] Using FPC parser/tokenizer for code formatting

Florian Klaempfl florian at freepascal.org
Fri May 28 20:50:15 CEST 2010


Adem schrieb:
> 
>>> But, I am hoping to modify the FPC parser/tokenizer so that instead
>>> of it deciding whether to stop, it should do a callback and let the
>>> caller decide whether it should stop.
>>>
>>> Is this likely to be unworthy of the effort?
>> No, but it is hard to do in a meaningful way.
> Could you (or someone else) point me to the source files of FPC
> parser/tokenizer please.
> 
> I can guess that it won't be easy; but if it can be done, I think it
> should be.

It might be possible but the fpc scanner/parser are rather interwinded
with other parts of the compiler, just to name an example: pmodules.pas
parses units and programs but controls also code generation and handles
symtables etc. for them.

> 
> It is the only way the code formatter can keep up with new features of FPC.

FPC isn't moving that fast nowadays regarding syntax so keeping up
shouldn't be that hard.




More information about the Lazarus mailing list