desig.H 1.9 KB

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