home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / c / c1h.c < prev    next >
Encoding:
C/C++ Source or Header  |  1975-07-18  |  3.7 KB  |  273 lines

  1. /*
  2.  *    C pass 2 header
  3.  */
  4.  
  5. #define    swsiz    200
  6. #define    ossiz    500
  7.  
  8. struct    tnode {
  9.     int    op;
  10.     int    type;
  11.     int    degree;
  12.     struct    tnode *tr1, *tr2;
  13. };
  14.  
  15. struct    bnode {
  16.     int    bop;
  17.     struct    tnode *btree;
  18.     int    lbl;
  19.     int    cond;
  20. };
  21.  
  22. struct    tname {
  23.     int    nop;
  24.     int    ntype;
  25.     int    elsize;
  26.     char    class;
  27.     char    regno;
  28.     int    offset;
  29.     int    nloc;
  30. };
  31.  
  32. /*
  33.  * for field selections
  34.  */
  35. struct tsel {
  36.     int    op;
  37.     int    type;
  38.     int    degree;
  39.     struct    tnode *tr1;
  40.     char    flen;
  41.     char    bitoffs;
  42. };
  43.  
  44. struct    tconst {
  45.     int    cop;
  46.     int    ctype;
  47.     int    cdeg;
  48.     int    value;
  49. };
  50.  
  51. struct    optab {
  52.     char    tabdeg1;
  53.     char    tabtyp1;
  54.     char    tabdeg2;
  55.     char    tabtyp2;
  56.     char    *tabstring;
  57. };
  58.  
  59. struct    table {
  60.     int    tabop;
  61.     struct    optab *tabp;
  62. };
  63.  
  64. struct    instab {
  65.     int    iop;
  66.     char    *str1;
  67.     char    *str2;
  68. };
  69.  
  70. struct    swtab {
  71.     int    swlab;
  72.     int    swval;
  73. };
  74.  
  75. char    maprel[];
  76. char    notrel[];
  77. int    nreg;
  78. int    isn;
  79. int    namsiz;
  80. int    line;
  81. char    ascbuf[518];
  82. int    nerror;
  83. struct    table    cctab[];
  84. struct    table    efftab[];
  85. struct    table    regtab[];
  86. struct    table    sptab[];
  87. struct    table    lsptab[];
  88. struct    instab    instab[];
  89. struct    instab    branchtab[];
  90. int    opdope[];
  91. char    *opntab[];
  92. int    nstack;
  93. int    nfloat;
  94. int    *spacep;
  95. int    treespace[ossiz];
  96. int    eolflg;
  97. struct tconst czero, cone, fczero;
  98.  
  99. /*
  100.     operators
  101. */
  102. #define    EOF    0
  103. #define    SEMI    1
  104. #define    LBRACE    2
  105. #define    RBRACE    3
  106. #define    LBRACK    4
  107. #define    RBRACK    5
  108. #define    LPARN    6
  109. #define    RPARN    7
  110. #define    COLON    8
  111. #define    COMMA    9
  112. #define    FSEL    10
  113.  
  114. #define    KEYW    19
  115. #define    NAME    20
  116. #define    CON    21
  117. #define    STRING    22
  118. #define    FCON    23
  119. #define    SFCON    24
  120.  
  121. #define    AUTOI    27
  122. #define    AUTOD    28
  123. #define    INCBEF    30
  124. #define    DECBEF    31
  125. #define    INCAFT    32
  126. #define    DECAFT    33
  127. #define    EXCLA    34
  128. #define    AMPER    35
  129. #define    STAR    36
  130. #define    NEG    37
  131. #define    COMPL    38
  132.  
  133. #define    DOT    39
  134. #define    PLUS    40
  135. #define    MINUS    41
  136. #define    TIMES    42
  137. #define    DIVIDE    43
  138. #define    MOD    44
  139. #define    RSHIFT    45
  140. #define    LSHIFT    46
  141. #define    AND    47
  142. #define    NAND    55
  143. #define    OR    48
  144. #define    EXOR    49
  145. #define    ARROW    50
  146. #define    ITOF    51
  147. #define    FTOI    52
  148. #define    LOGAND    53
  149. #define    LOGOR    54
  150. #define    FTOL    56
  151. #define    LTOF    57
  152. #define    ITOL    58
  153. #define    LTOI    59
  154.  
  155. #define    EQUAL    60
  156. #define    NEQUAL    61
  157. #define    LESSEQ    62
  158. #define    LESS    63
  159. #define    GREATEQ    64
  160. #define    GREAT    65
  161. #define    LESSEQP    66
  162. #define    LESSP    67
  163. #define    GREATQP    68
  164. #define    GREATP    69
  165.  
  166. #define    ASPLUS    70
  167. #define    ASMINUS    71
  168. #define    ASTIMES    72
  169. #define    ASDIV    73
  170. #define    ASMOD    74
  171. #define    ASRSH    75
  172. #define    ASLSH    76
  173. #define    ASSAND    77
  174. #define    ASOR    78
  175. #define    ASXOR    79
  176. #define    ASSIGN    80
  177. #define    TAND    81
  178. #define    LTIMES    82
  179. #define    LDIV    83
  180. #define    LMOD    84
  181. #define    ASSNAND    85
  182. #define    LASTIMES 86
  183. #define    LASDIV    87
  184. #define    LASMOD    88
  185.  
  186. #define    QUEST    90
  187. #define    LLSHIFT    91
  188. #define    ASLSHL    92
  189. #define    CALL1    98
  190. #define    CALL2    99
  191. #define    CALL    100
  192. #define    MCALL    101
  193. #define    JUMP    102
  194. #define    CBRANCH    103
  195. #define    INIT    104
  196. #define    SETREG    105
  197. #define    LOAD    106
  198. #define    RFORCE    110
  199.  
  200. /*
  201.  * Intermediate code operators
  202.  */
  203. #define    BRANCH    111
  204. #define    LABEL    112
  205. #define    NLABEL    113
  206. #define    RLABEL    114
  207. #define    BDATA    200
  208. #define    WDATA    201
  209. #define    PROG    202
  210. #define    DATA    203
  211. #define    BSS    204
  212. #define    CSPACE    205
  213. #define    SSPACE    206
  214. #define    SYMDEF    207
  215. #define    SAVE    208
  216. #define    RETRN    209
  217. #define    EVEN    210
  218. #define    PROFIL    212
  219. #define    SWIT    213
  220. #define    EXPR    214
  221. #define    SNAME    215
  222. #define    RNAME    216
  223. #define    ANAME    217
  224. #define    NULL    218
  225.  
  226. /*
  227.  *    types
  228.  */
  229. #define    INT    0
  230. #define    CHAR    1
  231. #define    FLOAT    2
  232. #define    DOUBLE    3
  233. #define    STRUCT    4
  234. #define    RSTRUCT    5
  235. #define    LONG    6
  236.  
  237. #define    TYLEN    2
  238. #define    TYPE    07
  239. #define    XTYPE    (03<<3)
  240. #define    PTR    010
  241. #define    FUNC    020
  242. #define    ARRAY    030
  243.  
  244. /*
  245.     storage    classes
  246. */
  247. #define    KEYWC    1
  248. #define    MOS    10
  249. #define    AUTO    11
  250. #define    EXTERN    12
  251. #define    STATIC    13
  252. #define    REG    14
  253. #define    STRTAG    15
  254. #define    ARG    16
  255. #define    OFFS    20
  256. #define    XOFFS    21
  257. #define    SOFFS    22
  258.  
  259. /*
  260.     Flag    bits
  261. */
  262.  
  263. #define    BINARY    01
  264. #define    LVALUE    02
  265. #define    RELAT    04
  266. #define    ASSGOP    010
  267. #define    LWORD    020
  268. #define    RWORD    040
  269. #define    COMMUTE    0100
  270. #define    RASSOC    0200
  271. #define    LEAF    0400
  272. #define    CNVRT    01000
  273.