Re: what parser generator?

ralph@inputplus.demon.co.uk (Ralph Corderoy)
9 Jan 2001 23:24:54 -0500

          From comp.compilers

Related articles
what parser generator? Drum.Sefex@btinternet.com (Paul Drummond) (2000-12-18)
Re: what parser generator? broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2000-12-18)
Re: what parser generator? idbaxter@semdesigns.com (Ira D. Baxter) (2000-12-19)
Re: what parser generator? mike@dimmick.demon.co.uk (Mike Dimmick) (2000-12-19)
Re: what parser generator? Drum.Sefex@btinternet.com (Paul Drummond) (2000-12-20)
Re: what parser generator? idbaxter@semdesigns.com (Ira D. Baxter) (2000-12-21)
Re: what parser generator? ralph@inputplus.demon.co.uk (2001-01-09)
| List of all articles for this month |
From: ralph@inputplus.demon.co.uk (Ralph Corderoy)
Newsgroups: comp.compilers
Date: 9 Jan 2001 23:24:54 -0500
Organization: InputPlus Ltd.
References: 00-12-079
Keywords: parse
Posted-Date: 09 Jan 2001 23:24:54 EST

Hi,


Sorry if this post is a little late but no one seems to have suggested
it so far.


> I am writing a C++ DocTool for my 3yr uni project and I have been
> looking at different generators.


Does that mean you're only interested in comments that match a certain
style? For example


        /* DOC:
          * blah blah, line above dropped from output.
          */


and don't care about other comments?


Is so, how about a two pass approach following the `do something
simple well' approach.


Pull the DOC comments, not all comments, out of the source file noting
where each occurs. The line number may be sufficient.


Then have a second parse that scans the preprocessed source, i.e. no
comments or macros, and identifies the location and length of each
function, or whatever it is you're interested in.


Then simply tie each DOC comment with the following function assuming
that's the convention.


You'll have to take note of the #line statements that occur in the
preprocessed output so your idea of the current line number is based on
the unpreprocessed text, not the preprocessed text.


Hope this helps; trying to combine the two seems messy.




Ralph Corderoy.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.