scope.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* scope structure */
  2. /* $Header$ */
  3. typedef struct scope {
  4. struct scope *sc_static_encl; /* linked list of enclosing scopes */
  5. struct symbol *sc_symbs; /* symbols defined in this scope */
  6. struct symbol *sc_definedby; /* symbol defining this scope */
  7. long sc_start; /* start address of code of this scope */
  8. long sc_bp_opp; /* first breakpoint opportunity */
  9. short sc_proclevel; /* proc level of this scope */
  10. char sc_has_activation_record;
  11. } t_scope, *p_scope;
  12. extern p_scope PervasiveScope, CurrentScope, FileScope;
  13. /* extern init_scope();
  14. Initializes the scope routines.
  15. */
  16. extern init_scope();
  17. /* extern open_scope(struct symbol *name, int has_activation);
  18. Opens a new scope and assigns it to CurrentScope; The new scope is defined
  19. by 'name' and if 'has_activation' is set, it has an activation record.
  20. */
  21. extern open_scope();
  22. /* extern close_scope();
  23. Closes the current scope; CurrentScope becomes the statically enclosing
  24. scope.
  25. */
  26. extern close_scope();
  27. /* extern add_scope_addr(p_scope sc);
  28. Adds scope 'sc' to the list of scopes that have an address at runtime.
  29. */
  30. extern add_scope_addr();
  31. /* extern p_scope get_scope_from_addr(t_addr a);
  32. Returns the scope of the code at address 'a', or 0 if it could not be found.
  33. */
  34. extern p_scope get_scope_from_addr();
  35. /* extern p_scope get_next_scope_from_addr(t_addr a);
  36. Returns the scope following the one of the code at address 'a',
  37. and that has an activation record,
  38. or 0 if it could not be found.
  39. */
  40. extern p_scope get_next_scope_from_addr();
  41. /* extern p_scope base_scope(p_scope sc);
  42. Returns the closest enclosing scope of 'sc' that has an activation record.
  43. */
  44. extern p_scope base_scope();