desig.H 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  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".
  4. *
  5. * Author: Ceriel J.H. Jacobs
  6. */
  7. /* D E S I G N A T O R D E S C R I P T I O N S */
  8. /* $Id$ */
  9. /* Generating code for designators is not particularly easy, especially if
  10. you don't know wether you want the address or the value.
  11. The next structure is used to generate code for designators.
  12. It contains information on how to find the designator, after generation
  13. of the code that is common to both address and value computations.
  14. */
  15. struct desig {
  16. short dsg_kind;
  17. #define DSG_INIT 0 /* don't know anything yet */
  18. #define DSG_LOADED 1 /* designator loaded on top of the stack */
  19. #define DSG_PLOADED 2 /* designator accessible through pointer on
  20. stack, possibly with an offset
  21. */
  22. #define DSG_FIXED 3 /* designator directly accessible */
  23. #define DSG_PFIXED 4 /* designator accessible through directly
  24. accessible pointer
  25. */
  26. #define DSG_INDEXED 5 /* designator accessible through array
  27. operation. Address of array descriptor on
  28. top of the stack, index beneath that, and
  29. base address beneath that
  30. */
  31. arith dsg_offset; /* contains an offset for PLOADED,
  32. or for FIXED or PFIXED it contains an
  33. offset from dsg_name, if it exists,
  34. or from the current Local Base
  35. */
  36. char *dsg_name; /* name of global variable, used for
  37. FIXED and PFIXED
  38. */
  39. struct def *dsg_def; /* def structure associated with this
  40. designator, or 0
  41. */
  42. };
  43. typedef struct desig t_desig;
  44. /* The next structure describes the designator in a with-statement.
  45. We have a linked list of them, as with-statements may be nested.
  46. */
  47. struct withdesig {
  48. struct withdesig *w_next;
  49. int w_flags; /* D_USED|D_DEFINED */
  50. struct scope *w_scope; /* scope in which fields of this record
  51. reside
  52. */
  53. t_desig w_desig; /* a desig structure for this particular
  54. designator
  55. */
  56. };
  57. extern struct withdesig *WithDesigs;
  58. #define NO_LABEL ((label) 0)