Pristine Ack-5.5
[Ack-5.5.git] / util / grind / scope.h
1 /* $Id: scope.h,v 1.5 1994/06/24 11:01:12 ceriel Exp $ */
2
3 /* scope structure */
4
5 typedef struct scope {
6   struct scope  *sc_static_encl;        /* linked list of enclosing scopes */
7   struct symbol *sc_symbs;              /* symbols defined in this scope */
8   struct symbol *sc_definedby;          /* symbol defining this scope */
9   long          sc_start;               /* start address of code of this scope */
10   long          sc_bp_opp;              /* first breakpoint opportunity */
11   int           sc_bp_lineno;           /* linenumber belonging to this bp. */
12   short         sc_proclevel;           /* proc level of this scope */
13   char          sc_has_activation_record;
14 } t_scope, *p_scope;
15
16 extern p_scope PervasiveScope, CurrentScope, FileScope;
17
18 /* extern       init_scope();
19    Initializes the scope routines.
20 */
21 extern  init_scope();
22
23 /* extern       open_scope(struct symbol *name, int has_activation);
24    Opens a new scope and assigns it to CurrentScope; The new scope is defined
25    by 'name' and if 'has_activation' is set, it has an activation record.
26 */
27 extern  open_scope();
28
29 /* extern       close_scope();
30    Closes the current scope; CurrentScope becomes the statically enclosing
31    scope.
32 */
33 extern  close_scope();
34
35 /* extern       add_scope_addr(p_scope sc);
36    Adds scope 'sc' to the list of scopes that have an address at runtime.
37 */
38 extern  add_scope_addr();
39
40 /* extern p_scope       get_scope_from_addr(t_addr a);
41    Returns the scope of the code at address 'a', or 0 if it could not be found.
42 */
43 extern p_scope  get_scope_from_addr();
44
45 /* extern p_scope       get_next_scope_from_addr(t_addr a);
46    Returns the scope following the one of the code at address 'a',
47    and that has an activation record,
48    or 0 if it could not be found.
49 */
50 extern p_scope  get_next_scope_from_addr();
51
52 /* extern p_scope       base_scope(p_scope sc);
53    Returns the closest enclosing scope of 'sc' that has an activation record.
54 */
55 extern p_scope  base_scope();
56
57 /* extern int   scope_encloses(p_scope scope, from_scope);
58    Returns 1 if scope encloses from from_scope, 0 otherwise.
59 */
60 extern int      scope_encloses();