[fpc-pascal] Access to compiler's internal data structures

Kenneth Cochran kenneth.cochran at gmail.com
Sun Sep 2 15:19:40 CEST 2012


My goal is to make it an IDE expert so the CodeTools parser sounds ideal.
Just didn't want to reinvent the wheel. I also wanted to avoid the problem
Delphi has been plagued with for years, that is, CodeInsight flagging code
with syntax errors that the compiler readily accepts because they use
different parsers.
On Sep 1, 2012 3:54 AM, "Bernd" <prof7bit at gmail.com> wrote:

> 2012/8/31 Kenneth Cochran <kenneth.cochran at gmail.com>:
>
> > I'm finding myself in need of a parser for object pascal. I'm wondering
> if
> > fpc exposes any of the output (syntax trees, graphs, etc) from the parser
> > that could be consumed by an external tool?
>
> Depending on what exactly you need and how difficult it is to get a
> syntax tree from the compiler itself there exist at least two more
> parsers that *might* be useful for you: one of them is in the
> CodeTools package in Lazarus and is used for autocomplete,
> refactoring, etc and another totally separate parser is in the Jedi
> code formating package (also part of Lazarus) that is used for
> re-formatting the code of a single unit.
>
> These parsers were written with different goals in mind and for
> different purposes, so they work slightly different and provide
> different output, for example the jedi parser will only parse one unit
> (and is not very closely connected with the IDE and can probably
> easily be ripped out of it and be used in a separate project) while
> the codetools parsers are able to follow used units, include files,
> respect currently active defines, etc. but are deeply integrated into
> the IDE and probably also depending on many parts of he IDE.
>
> If the project you have in mind would be something that helps coding
> or understanding and analyzing existing code it might probably be very
> nice to have it available as a part of the Lazarus IDE (as an
> installable package) and let it extend the CodeTools parsers.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120902/6956e8a9/attachment.html>


More information about the fpc-pascal mailing list