From: | Norman Ramsey <nr@adder.cs.virginia.edu> |
Newsgroups: | comp.compilers |
Date: | 20 Feb 1997 00:14:20 -0500 |
Organization: | University of Virginia |
References: | 97-01-258 97-02-081 97-02-090 |
Keywords: | errors |
Dennis Yelle <dennis@netcom.com> wrote:
>It seems obvious that you cannot produce a compiler that will always
>give a correct second error message, because the compiler cannot know
>what I actually intended in place of the first error.
Um, it may seem obvious, but it's not. The algorithm I described
``taints'' everything that could possibly depend on the first
erroneous construct, and it refuses to issue error messages about
tainted things. That way it can produce reliable error messages about
other parts of your program, which don't depend on the first error.
Now, I've only implemented this technique in a compiler for an oddball
machine-description language, so you might argue that this technique
isn't useful, (e.g., if the whole program quickly becomes tainted),
but don't argue that it's not correct. Your ``halt after one error
message'' strategy is a degenerate case in which a single error taints
the entire program.
Norman
--
Norman Ramsey
http://www.cs.virginia.edu/~nr
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.