2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
8 /* S C O P E M E C H A N I S M */
10 /* $Id: scope.h,v 1.22 1994/06/24 12:42:37 ceriel Exp $ */
12 #define OPENSCOPE 0 /* Indicating an open scope */
13 #define CLOSEDSCOPE 1 /* Indicating a closed scope (module) */
15 #define SC_CHKFORW 1 /* Check for forward definitions when closing
18 #define SC_CHKPROC 2 /* Check for forward procedure definitions
21 #define SC_REVERSE 4 /* Reverse list of definitions, to get it
22 back into original order
26 /* struct scope *next; */
27 char *sc_name; /* name of this scope */
28 struct def *sc_def; /* list of definitions in this scope */
29 arith sc_off; /* offsets of variables in this scope */
30 char sc_scopeclosed; /* flag indicating closed or open scope */
31 char sc_defmodule; /* flag set is this scope is from a separate
34 int sc_level; /* level of this scope */
35 struct def *sc_definedby; /* The def structure defining this scope */
36 struct node *sc_end; /* node to remember line number of end of scope */
40 struct scopelist *sc_next;
41 struct scope *sc_scope;
42 struct scopelist *sc_encl;
46 typedef struct scope t_scope;
47 typedef struct scopelist t_scopelist;
55 #define CurrentScope (CurrVis->sc_scope)
56 #define GlobalScope (GlobalVis->sc_scope)
57 #define enclosing(x) ((x)->sc_encl)
58 #define scopeclosed(x) ((x)->sc_scopeclosed)
59 #define nextvisible(x) ((x)->sc_next) /* use with scopelists */
61 t_scope *open_and_close_scope();