ic.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* I N T E R M E D I A T E C O D E
  7. *
  8. * G L O B A L C O N S T A N T S & V A R I A B L E S
  9. */
  10. /* Data structures for Intermediate Code generation */
  11. typedef struct sym *sym_p;
  12. typedef struct prc *prc_p;
  13. typedef struct num *num_p;
  14. struct sym {
  15. sym_p sy_next; /* link */
  16. char *sy_name; /* name of the symbol */
  17. dblock_p sy_dblock; /* pointer to dblock struct */
  18. };
  19. struct prc {
  20. prc_p pr_next; /* link */
  21. char *pr_name; /* name of the procedure */
  22. proc_p pr_proc; /* pointer tto proc struct */
  23. };
  24. struct num {
  25. num_p n_next; /* link */
  26. unsigned n_number; /* EM repr. e.g. 120 in 'BRA *120' */
  27. lab_id n_labid; /* sequential integer repr. of IC */
  28. };
  29. /* macros used by ic_lib.c and ic_io.c: */
  30. #define ARCHIVE 0
  31. #define NO_ARCHIVE 1
  32. /*
  33. * The next constants are close to sp_cend for fast switches
  34. */
  35. #define INST 256 /* instruction: number in tabval */
  36. #define PSEU 257 /* pseudo: number in tabval */
  37. #define ILBX 258 /* label: number in tabval */
  38. #define DLBX 259 /* symbol: name in string[] */
  39. #define CSTX1 260 /* short constant: stored in tabval */
  40. #define CSTX2 261 /* offset: value in tabval2 */
  41. #define VALX1 262 /* symbol+short: in string[] and tabval */
  42. #define VALX2 263 /* symbol+offset: in string[] and tabval2 */
  43. #define ATEOF 264 /* bumped into end of file */
  44. /* Global variables */
  45. extern dblock_p db;
  46. extern dblock_p hol0_db; /* ABS block */
  47. extern dblock_p ldblock; /* last dblock processed so far */
  48. extern proc_p lproc; /* last proc processed so far */
  49. extern short tabval; /* used by table1, table2 and table3 */
  50. extern offset tabval2;
  51. extern char string[];
  52. extern line_p lastline; /* last line read */
  53. extern int labelcount; /* # labels in current procedure */
  54. extern obj_id lastoid; /* last object identifier used */
  55. extern proc_id lastpid; /* last proc identifier used */
  56. extern lab_id lastlid; /* last label identifier used */
  57. extern dblock_id lastdid; /* last dblock identifier used */
  58. extern byte em_flag[];