|typechecking break-statement firstname.lastname@example.org (cp) (2006-12-01)|
|Re: typechecking break-statement email@example.com (Matthias Blume) (2006-12-01)|
|Re: typechecking break-statement firstname.lastname@example.org (cp) (2006-12-03)|
|Re: typechecking break-statement email@example.com (2006-12-04)|
|Date:||4 Dec 2006 08:29:18 -0500|
|Organization:||Department of Computer Science, University of Copenhagen|
"cp" <firstname.lastname@example.org> writes:
> I was wondering if anyone could give me any pointers (not C pointers)
> on how to typecheck for the occurence of a break-statement outside a
> loop. I'm using the imperative side of SML/Moscow ML language.
You could ask your lecturer (i.e., me). As Matthias pointed out,
having an inherited attribute that tells you if you are inside a loop
will do the trick. Or you can postpone the check until code
generation, where you need an attribute to tell you where to go.
Using a special value (such as NONE) tells you that you aren't in a
loop, so you must make the error message instead of generating code.
Return to the
Search the comp.compilers archives again.