scope.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* $Id$ */
  2. /* scope structure */
  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. int sc_bp_lineno; /* linenumber belonging to this bp. */
  10. short sc_proclevel; /* proc level of this scope */
  11. char sc_has_activation_record;
  12. } t_scope, *p_scope;
  13. extern p_scope PervasiveScope, CurrentScope, FileScope;
  14. /* extern init_scope();
  15. Initializes the scope routines.
  16. */
  17. extern init_scope();
  18. /* extern open_scope(struct symbol *name, int has_activation);
  19. Opens a new scope and assigns it to CurrentScope; The new scope is defined
  20. by 'name' and if 'has_activation' is set, it has an activation record.
  21. */
  22. extern open_scope();
  23. /* extern close_scope();
  24. Closes the current scope; CurrentScope becomes the statically enclosing
  25. scope.
  26. */
  27. extern close_scope();
  28. /* extern add_scope_addr(p_scope sc);
  29. Adds scope 'sc' to the list of scopes that have an address at runtime.
  30. */
  31. extern add_scope_addr();
  32. /* extern p_scope get_scope_from_addr(t_addr a);
  33. Returns the scope of the code at address 'a', or 0 if it could not be found.
  34. */
  35. extern p_scope get_scope_from_addr();
  36. /* extern p_scope get_next_scope_from_addr(t_addr a);
  37. Returns the scope following the one of the code at address 'a',
  38. and that has an activation record,
  39. or 0 if it could not be found.
  40. */
  41. extern p_scope get_next_scope_from_addr();
  42. /* extern p_scope base_scope(p_scope sc);
  43. Returns the closest enclosing scope of 'sc' that has an activation record.
  44. */
  45. extern p_scope base_scope();
  46. /* extern int scope_encloses(p_scope scope, from_scope);
  47. Returns 1 if scope encloses from from_scope, 0 otherwise.
  48. */
  49. extern int scope_encloses();