Read comments via fcl-passrc

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Read comments via fcl-passrc

Michael Fuchs-5
Hi,

while working with fcl-passrc I search for a possibility to get the
comments of a source file in the parsed tree.

I found TPasTreeContainer.NeedComments but it does nothing.

Am I missing something or is this not a feature of fcl-passrc?


thanks
Michael
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Read comments via fcl-passrc

Mattias Gaertner
On Mon, 23 Apr 2018 12:24:26 +0200
Michael Fuchs <[hidden email]> wrote:

> Hi,
>
> while working with fcl-passrc I search for a possibility to get the
> comments of a source file in the parsed tree.
>
> I found TPasTreeContainer.NeedComments but it does nothing.

Set that to true. Then create the parser.
Read Parser.SavedComments on every CreateElement.

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Read comments via fcl-passrc

Michael Fuchs-5
Am 23.04.2018 um 12:43 schrieb Mattias Gaertner:
>> I found TPasTreeContainer.NeedComments but it does nothing.
>
> Set that to true. Then create the parser.

Ok, so I can not use the function ParseSource from unit PParser anymore
and have to write my own one?

> Read Parser.SavedComments on every CreateElement.

Can I save the comments in the DocComment property of every element or
is this used somewhere else?


thanks
Michael
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Read comments via fcl-passrc

Michael Van Canneyt


On Mon, 23 Apr 2018, Michael Fuchs wrote:

> Am 23.04.2018 um 12:43 schrieb Mattias Gaertner:
>>> I found TPasTreeContainer.NeedComments but it does nothing.
>>
>> Set that to true. Then create the parser.
>
> Ok, so I can not use the function ParseSource from unit PParser anymore
> and have to write my own one?
>
>> Read Parser.SavedComments on every CreateElement.
>
> Can I save the comments in the DocComment property of every element or
> is this used somewhere else?

It's normally not used; The idea is to use this in a pasdoc->fpdoc
converter.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Read comments via fcl-passrc

Michalis Kamburelis-3
Michael Van Canneyt <[hidden email]> wrote:


On Mon, 23 Apr 2018, Michael Fuchs wrote:

> Am 23.04.2018 um 12:43 schrieb Mattias Gaertner:
>>> I found TPasTreeContainer.NeedComments but it does nothing.
>>
>> Set that to true. Then create the parser.
>
> Ok, so I can not use the function ParseSource from unit PParser anymore
> and have to write my own one?
>
>> Read Parser.SavedComments on every CreateElement.
>
> Can I save the comments in the DocComment property of every element or
> is this used somewhere else?

It's normally not used; The idea is to use this in a pasdoc->fpdoc
converter.

Or the PasDoc inplementation itself :) I want to one day migrate PasDoc code to just use fcl-passrc parser. Currently PasDoc uses custom parser, that reads only interface.

Thanks for making this available.

Regards,
Michalis

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Read comments via fcl-passrc

Michael Fuchs-5
In reply to this post by Michael Van Canneyt
Am 23.04.2018 um 13:39 schrieb Michael Van Canneyt:
>> Can I save the comments in the DocComment property of every element or
>> is this used somewhere else?
>
> It's normally not used; The idea is to use this in a pasdoc->fpdoc
> converter.

Great, then I will capture it for my project.

Thanks.
Michael
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal