Re: language design implications for variant records in a pascal-like language

Martin Ward <martin@gkc.org.uk>
Wed, 12 Jan 2011 12:31:39 +0000

          From comp.compilers

Related articles
[31 earlier articles]
Re: language design implications for variant records in a pascal-like DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-01-08)
Re: language design implications for variant records in a pascal-like robin51@dodo.com.au (robin) (2011-01-10)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-10)
Re: language design implications for variant records in a pascal-like haberg-news@telia.com (Hans Aberg) (2011-01-10)
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-10)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-12)
Re: language design implications for variant records in a pascal-like martin@gkc.org.uk (Martin Ward) (2011-01-12)
Re: language design implications for variant records in a pascal-like DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-01-12)
Re: language design implications for variant records in a pascal-like mcr@wildcard.demon.co.uk (Martin Rodgers) (2011-01-12)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-13)
Re: language design implications for variant records in a pascal-like gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-01-13)
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-13)
Re: language design implications for variant records in a pascal-like noitalmost@cox.net (noitalmost) (2011-01-13)
[18 later articles]
| List of all articles for this month |
From: Martin Ward <martin@gkc.org.uk>
Newsgroups: comp.compilers
Date: Wed, 12 Jan 2011 12:31:39 +0000
Organization: Compilers Central
References: 11-01-025 11-01-033
Keywords: history
Posted-Date: 13 Jan 2011 00:10:23 EST

On Monday 10 Jan 2011 at 18:23, compilers@is-not-my.name wrote:
> Because industry listened to academics, and they shouldn't have,
> ever. ...
> Remember the good old days when there was no conditional loop? Either
> you checked a condition and did a GO TO or you didn't have a
> loop. Life was good and simple. And yes, I still prefer my source code
> in all caps.


Suppose you are reading some code from the "good old days"
and you encounter a GO TO. Is there a loop or not?
First, you need to find the label that is the target of the GO TO:
if it is before the GO TO, then you have a loop, right?
Well, not necessarily. Only if there exists a control flow
path from the label back to the GO TO. Similarly, a forward GO TO
might still be a loop if there is a path back to the GO TO
from the label.


Suppose you have found out that there *is* a loop involved.
Now you want to know which statements are in the loop body
and which are not. To do that you need to construct the control
flow graph, find the dominator tree, the loop header nodes,
find all the nodes dominated by the loop header...
But that involves listening to those pesky academics!


--
Martin


STRL Reader in Software Engineering and Royal Society Industry Fellow
martin@gkc.org.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
Mirrors: http://www.gkc.org.uk and http://www.gkc.org.uk/gkc
[Hey, it wasn't all academics. Some of it was IBM. But I take your
point. -John]



Post a followup to this message

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