Pascal's display table?

Gu Lin <>
29 Dec 1997 21:07:01 -0500

          From comp.compilers

Related articles
Pascal's display table? (Gu Lin) (1997-12-29)
| List of all articles for this month |

From: Gu Lin <>
Newsgroups: comp.compilers
Date: 29 Dec 1997 21:07:01 -0500
Organization: Compilers Central
Keywords: Pascal, storage, question, comment

Would somebody please give me some hints on the following question?
Thanks much.

A Pascal program's Active Record in the stack.

| R |<----- display[4]
|------------ |
| P |
|------------ |
| S |
|------------ |
| Q |<----- display[3]
|------------ |
| P |<----- display[2]
|------------ |
| Main |<----- display[1]
|------------ |

P,Q,S,R are procedures.

It seems Main calls P, and P calls Q, and Q calls S and S calls P
again, and then P calls R. But I'm confused by the contents in the
display table. What's relationship between these procedures? I mean,
which procedure enclosed which?

Gu Lin
[The display has one entry for each procedure which lexically encloses
the current procedure. The answer depends on how the source code of
the procedures is nested. -John]

Post a followup to this message

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