|Syntax Error Recovery, Automatic and Otherwise harvard!seismo!sun!rtech!llama!jas (1987-08-18)|
|Date:||Tue, 18 Aug 87 09:42:32 pdt|
|From:||harvard!seismo!sun!rtech!llama!jas (Jim Shankland)|
|Organization:||Relational Technology, Inc.|
I claim (hoping to be provocative :-}) that when a parser encounters
a syntax error, the only sensible thing to do is to "call the liveware"
(i.e., the user) to patch up the token stream before continuing processing.
Remember, the point of error recovery is not to generate correct object
code (or would YOU release a program whose source contained syntax
errors, even if they were correctly patched up by the compiler?); rather,
the point is to allow the compilation run to continue, catching as many
errors as possible, so that the user can fix them all at once. This
approach made a lot of sense when we were lining up at the card reader;
these days, it doesn't.
[We're not lining up at the card reader, true enough, but I often type
"make" and go to lunch; I'd rather come back to see how it did rather
than see it say "Trivial typo on line 2, would you like to fix it?"
Interactive compiling and debugging enviroments have their uses, but
just running the compilation through is often just as useful. -John]
Return to the
Search the comp.compilers archives again.