Syntax Error Recovery, Automatic and Otherwise

harvard!seismo!sun!rtech!llama!jas (Jim Shankland)
Tue, 18 Aug 87 09:42:32 pdt

          From comp.compilers

Related articles
Syntax Error Recovery, Automatic and Otherwise harvard!seismo!sun!rtech!llama!jas (1987-08-18)
| List of all articles for this month |

Date: Tue, 18 Aug 87 09:42:32 pdt
From: harvard!seismo!sun!rtech!llama!jas (Jim Shankland)
Newsgroups: comp.compilers
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.


Comments?
[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]


--
Jim Shankland
  ..!ihnp4!cpsc6a!\
                                    rtech!jas
..!ucbvax!mtxinu!/


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.