On Fri, 12 Dec 2003, Giaretta, DL (David) wrote:
> Surely it can be done in a few lines of Perl - Al?
With both projects, that was my attitude to start with (I'm a bit
of a reformed Perl enthusiast), but heavy use of regular expressions
turns out to be a pretty bad tool for doing this sort of parsing -
they work OK for 95% of the input but get really really nasty
when you try to push close to 100%. Could be just my insufficient
mastery of Perl of course, but I'm not the only one - if you've
got a strong stomach take a look at the source code of latex2html...
No doubt some sort of lexer module exists for Perl but if you're
going to use that you're probably not gaining much over lex/yacc
in any case.
--
Mark Taylor Starlink Programmer Physics, Bristol University, UK
[log in to unmask] +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/
|