>> I'm interested in building a troff parser to extract information from >> manpages (e.g. what do the flags mean when we say `rm -rf *`?). > > That's a hard problem. You may want to look at Eric Raymond's > doclifter. http://www.catb.org/esr/doclifter/
Eric, If the pages are in mdoc(7) (which you indicated), just use libmandoc(3) (http://mdocml.bsd.lv) to parse the file and extract flags (`Fl') in the SYNOPSIS and correlate them to their explanation in the DESCRIPTION's `Bl -tag' list. Not difficult at all. Best, Kristaps