1988-09-21 11:48:29 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
|
1988-09-29 15:24:02 +00:00
|
|
|
/* To determine the minimum scope of a local variable, all (braced)
|
|
|
|
scopes are numbered consecutively. Next we maintain an array which
|
|
|
|
maps the nesting depth (level) onto the scope number; we record
|
|
|
|
the scope number of the first application of a local variable
|
|
|
|
in its definition. Each further application requires that the
|
|
|
|
level of the variable be at least large enough to comprise both
|
|
|
|
the present scope and that of its first application. That level
|
|
|
|
number is determined by searching the array and is then recorded in
|
|
|
|
the definition (beacuse it is always equal to or smaller than the
|
|
|
|
level already there).
|
|
|
|
|
|
|
|
The array is implemented as a linked list of struct brace.
|
|
|
|
*/
|
|
|
|
|
1988-09-21 11:48:29 +00:00
|
|
|
struct brace {
|
|
|
|
struct brace *next;
|
1988-09-29 15:24:02 +00:00
|
|
|
int br_count;
|
1988-09-21 11:48:29 +00:00
|
|
|
int br_level;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ALLOCDEF "brace" 10 */
|
|
|
|
|