Re: typechecking break-statement

torbenm@app-1.diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
4 Dec 2006 08:29:18 -0500

          From comp.compilers

Related articles
typechecking break-statement e-blade@nonplayercharacter.dk (cp) (2006-12-01)
Re: typechecking break-statement blume@tti-c.org (Matthias Blume) (2006-12-01)
Re: typechecking break-statement e-blade@nonplayercharacter.dk (cp) (2006-12-03)
Re: typechecking break-statement torbenm@app-1.diku.dk (2006-12-04)
| List of all articles for this month |
From: torbenm@app-1.diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=)
Newsgroups: comp.compilers
Date: 4 Dec 2006 08:29:18 -0500
Organization: Department of Computer Science, University of Copenhagen
References: 06-12-014
Keywords: analysis
Posted-Date: 04 Dec 2006 08:29:18 EST

"cp" <e-blade@nonplayercharacter.dk> 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.


Torben



Post a followup to this message

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