In <200009071338(_dot_)JAA18339(_at_)astro(_dot_)cs(_dot_)utk(_dot_)edu> Keith
Moore <moore(_at_)cs(_dot_)utk(_dot_)edu> writes:
my opinion is that if you have to deal with comments at all, it's much
better to allow comments between any two lexemes, rather than to
invent complicated rules that say where the comments can and cannot go.
then you can write a generalized lexical analyzer that removes comments.
Well that is essentially what has always been done with mail. But you need
to define exactly what constitutes a lexeme.
But DRUMS now do it with a complicated grammar, the intention of which is
to match the effect of the "between lexemes" rule - which it more or less
does. The grammar is ugly, but that is pretty much inevitable given the
properties of grammars.
But either way results in what I quoted:
[CFWS] ; [CFWS] token [CFWS] = [CFWS] token-or-quoted-string [CFWS]
since tokens and quoted strings are surely lexemes. Unless anybody thinks
otherwise (I agree it allows far too much, but that is what the rules seem
to imply).
--
Charles H. Lindsey ---------At Home, doing my own thing------------------------
Email: chl(_at_)clw(_dot_)cs(_dot_)man(_dot_)ac(_dot_)uk Web:
http://www.cs.man.ac.uk/~chl
Voice/Fax: +44 161 437 4506 Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5