ack/lang/m2/comp/scope.h

25 lines
680 B
C
Raw Normal View History

1986-03-26 15:11:02 +00:00
/* S C O P E M E C H A N I S M */
/* $Header$ */
#define OPENSCOPE 0 /* Indicating an open scope */
#define CLOSEDSCOPE 1 /* Indicating a closed scope (module) */
struct scope {
struct scope *next;
1986-03-27 17:37:41 +00:00
struct forwards *sc_forw;
1986-03-29 01:04:49 +00:00
struct def *sc_def; /* list of definitions in this scope */
1986-03-26 15:11:02 +00:00
int sc_scope; /* The scope number. Scope number 0 indicates
both the pervasive scope and the end of a
visibility range
*/
};
extern struct scope
1986-04-03 00:44:39 +00:00
*CurrentScope,
*GlobalScope;
1986-03-26 15:11:02 +00:00
#define nextvisible(x) ((x)->sc_scope ? (x)->next : (struct scope *) 0)
1986-03-26 17:53:13 +00:00
#define scopeclosed(x) ((x)->next->sc_scope == 0)
1986-03-29 01:04:49 +00:00
#define enclosing(x) (scopeclosed(x) ? (x)->next->next : (x)->next)