Re: Perl/Sh parser
Dimitri Van Heesch <[email protected]>
| Newsgroups | gmane.text.doxygen.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Nigel,
On 9 jan 2008, at 01:03, Nigel Pearson wrote:
>
> Hi guys. Happy new year!
>
>
> I am one of the MythTV developers, and some
> of us use Doxygen in the project a lot.
> The MythTV source code has C, C++, Obj-C,
> plus a contrib directory with the usual
> assortment of Perl, Shell and Python scripts.
>
> I'm also a Perl hacker from way-back,
> and used to use a simple inhouse tool
> to generate manpages and HTML from custom
> markup in our Perl and Shell scripts.
> (this was in the days before POD)
>
>
> So, I would like to start adding Perl/Sh parsing.
> I am lumping these together because they have
> similar comment parsing requirements,
> and I am hoping that one parser can do both.
> A few questions to help give me direction:
>
>
> 1) How do we feel about adding a parser
> that just summarises a language
> instead of trying to parse every little
> feature that they have crammed in there?
> (e.g. subroutines and markup instead of
> full OO, type matching, blessed modules)
You typically need to be able to parse every little detail in order
to create a summary (and ignore the rest). This is especially true for
scripts and perl,
where there does not need to be any structure (i.e. you can just
start with statements, outside of functions or classes).
>
> 2) I have little idea of where
> to start. The structure of the parsers
> is a little confusing - I can't work out
> how the stuff generated from pyscanner.l
> or fortranscanner.l is called, for example.
> Any relevant doco, discussion or advice?
Look at src/parserintf.h that is the main interface for
implementing new parsers. A parser is registered in initDoxygen, like so
Doxygen::parserManager->registerParser(".f90", new
FortranLanguageScanner);
whenever doxygen find a file with the .f90 extension is will invoke
the methods
of the FortranLanguageScanner to parse the file.
>
> 3) For a project like MythTV, I don't
> want symbols in the scripted stuff to
> be references to the compiled stuff.
> (e.g. if a Perl script has a usage() routine,
> it is in no way related to a C function
> which is also named usage() or _usage() )
> How does the PHP parser deal with this?
You typically do not make a doxygen project containing multiple
languages,
so then this is not an issue.
Regards,
Dimitri
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace