--Alex van den Bogaerdt <alex(_at_)ergens(_dot_)op(_dot_)het(_dot_)net> wrote:
On Thu, Jul 07, 2005 at 11:09:08PM +0200, Frank Ellermann wrote:
Matching is AFAIK left to right, but you tried right to left.
No I didn't. Please read my previous posts on this subject.
I did a "best match". "all" _is_ valid so "*" is the invalid
part so it is an invalid qualifier.
This is one of those things that is quite clear to a human, but hard for a
machine to get right. As wayne pointed out, it's easy to write a program
that says whether something is valid or not. It's much harder to write one
that fixes up invalid text in a minimal but creative way to get a valid one.
Most parsers work from left to right, meaning that they will get stuck at
the * and not proceed on to "all" (or more accurately, by the time it gets
past the * the only possible outcome is a modifier, and encountering a
space and no = blows that up).
Probably the easiest thing to do is to improve the error message so that it
covers all cases, like "Expected qualifier, mechanism or modifier, but
found *all" but even that doesn't tell much.
IMHO an invalid <term>, not necessarily a bad <directive>, it
could be also a bad <modifier>.
Whatever. The point is: it is not necessarily a bad mechanism.
The error message for "*all" suggests a bad mechanism which
could indicate to the unwary that "*" is valid and "all" is not.
Totally right. "*all" is not a modifier, mechanism, or qualifier. The
most a push-down machine will be able to tell you is where it was in the
string when the error occurred, and what might possibly have come next.
But for the error message to be intelligent (for example, detecting that
*all is one character different from ~all) is an exercise for someone with
more experience in artificial intelligence than I currently have :)
Greg Connor <gconnor(_at_)nekodojo(_dot_)org>