Since my subtrees were local, my tool wouldn't have to speak
HTTP; it would suffice to just decode filenames in the URLs,
find the documents if they're local, and grep them for
anchors.
Neither MIME nor SGML would have to be involved; the sequence
<a
is rare, and the input routines could be
made stable enough to stomach the occasional false alarm.
The result of my first attempt, written as a quick hack to fill my immediate needs, is anm (a for anchor, nm for nm(1)). Its architecture is typical for the quick hacks I'm writing these days: first it gobbles up all the data it can find, then thinks about it, then prints it annotated with a bit of information that the reader, I hope, will find useful.
If you would like to test anm, you're welcome to a uuencoded, gzip'ed tar-file of the current beta-release, a sample run over this page, or a marked-up version of the anm manual page.
[2010: I can't find the source code for this, either - I guess it went down when kbs.cs.tu-berlin.de was decomissioned.]