|
|
1.1 root 1: #define INTERDATA 2
2: #define GCOS 3
3: #define PDP11 4
4: #define IBM 5
5: #define CMACH 6
6: #define VAX 7
7:
8: #define DMR 2
9: #define PCC 3
10:
11: #ifndef FAMILY
12: FAMILY NOT DEFINED !!!
13: Family = FAMILY
14: #endif
15:
16: #ifndef HERE
17: HERE NOT DEFINED !!!!
18: Here = HERE
19: #endif
20:
21: #define M(x) (1<<x)
22: #define ALLOC(x) (struct x *) ckalloc(sizeof(struct x))
23: #define ALLOCN(n,x) (struct x *) ckalloc(n*sizeof(struct x))
24: typedef int *ptr;
25: typedef FILE *FILEP;
26: typedef short flag;
27: typedef long int ftnint;
28: #define LOCAL static
29:
30: #define NO 0
31: #define YES 1
32:
33:
34:
35: /* block tag values */
36:
37: #define TNAME 1
38: #define TCONST 2
39: #define TEXPR 3
40: #define TADDR 4
41: #define TPRIM 5
42: #define TLIST 6
43: #define TIMPLDO 7
44: #define TERROR 8
45:
46:
47: /* parser states */
48:
49: #define OUTSIDE 0
50: #define INSIDE 1
51: #define INDCL 2
52: #define INDATA 3
53: #define INEXEC 4
54:
55: /* procedure classes */
56:
57: #define PROCMAIN 1
58: #define PROCBLOCK 2
59: #define PROCSUBR 3
60: #define PROCFUNCT 4
61:
62:
63: /* storage classes */
64:
65: #define STGUNKNOWN 0
66: #define STGARG 1
67: #define STGAUTO 2
68: #define STGBSS 3
69: #define STGINIT 4
70: #define STGCONST 5
71: #define STGEXT 6
72: #define STGINTR 7
73: #define STGSTFUNCT 8
74: #define STGCOMMON 9
75: #define STGEQUIV 10
76: #define STGREG 11
77: #define STGLENG 12
78:
79: /* name classes */
80:
81: #define CLUNKNOWN 0
82: #define CLPARAM 1
83: #define CLVAR 2
84: #define CLENTRY 3
85: #define CLMAIN 4
86: #define CLBLOCK 5
87: #define CLPROC 6
88:
89:
90: /* vproclass values */
91:
92: #define PUNKNOWN 0
93: #define PEXTERNAL 1
94: #define PINTRINSIC 2
95: #define PSTFUNCT 3
96: #define PTHISPROC 4
97:
98: /* control stack codes */
99:
100: #define CTLDO 1
101: #define CTLIF 2
102: #define CTLELSE 3
103:
104:
105: /* operators */
106:
107: #define OPPLUS 1
108: #define OPMINUS 2
109: #define OPSTAR 3
110: #define OPSLASH 4
111: #define OPPOWER 5
112: #define OPNEG 6
113: #define OPOR 7
114: #define OPAND 8
115: #define OPEQV 9
116: #define OPNEQV 10
117: #define OPNOT 11
118: #define OPCONCAT 12
119: #define OPLT 13
120: #define OPEQ 14
121: #define OPGT 15
122: #define OPLE 16
123: #define OPNE 17
124: #define OPGE 18
125: #define OPCALL 19
126: #define OPCCALL 20
127: #define OPASSIGN 21
128: #define OPPLUSEQ 22
129: #define OPSTAREQ 23
130: #define OPCONV 24
131: #define OPLSHIFT 25
132: #define OPMOD 26
133: #define OPCOMMA 27
134: #define OPQUEST 28
135: #define OPCOLON 29
136: #define OPABS 30
137: #define OPMIN 31
138: #define OPMAX 32
139: #define OPADDR 33
140: #define OPINDIRECT 34
141: #define OPBITOR 35
142: #define OPBITAND 36
143: #define OPBITXOR 37
144: #define OPBITNOT 38
145: #define OPRSHIFT 39
146:
147:
148: /* memory regions */
149:
150: #define REGARG 1
151: #define REGAUTO 2
152: #define REGBSS 3
153: #define REGINIT 4
154: #define REGCONST 5
155: #define REGEXT 6
156: #define REGPROG 7
157:
158: /* label type codes */
159:
160: #define LABUNKNOWN 0
161: #define LABEXEC 1
162: #define LABFORMAT 2
163: #define LABOTHER 3
164:
165:
166: /* INTRINSIC function codes*/
167:
168: #define INTREND 0
169: #define INTRCONV 1
170: #define INTRMIN 2
171: #define INTRMAX 3
172: #define INTRGEN 4
173: #define INTRSPEC 5
174: #define INTRBOOL 6
175: #define INTRCNST 7
176:
177:
178: /* I/O statement codes */
179:
180: #define IOSTDIN ICON(5)
181: #define IOSTDOUT ICON(6)
182:
183: #define IOSBAD (-1)
184: #define IOSPOSITIONAL 0
185: #define IOSUNIT 1
186: #define IOSFMT 2
187:
188: #define IOINQUIRE 1
189: #define IOOPEN 2
190: #define IOCLOSE 3
191: #define IOREWIND 4
192: #define IOBACKSPACE 5
193: #define IOENDFILE 6
194: #define IOREAD 7
195: #define IOWRITE 8
196:
197:
198: /* type masks */
199:
200: #define MSKLOGICAL M(TYLOGICAL)
201: #define MSKADDR M(TYADDR)
202: #define MSKCHAR M(TYCHAR)
203: #define MSKINT M(TYSHORT)|M(TYLONG)
204: #define MSKREAL M(TYREAL)|M(TYDREAL)
205: #define MSKCOMPLEX M(TYCOMPLEX)|M(TYDCOMPLEX)
206:
207: /* miscellaneous macros */
208:
209: #define ONEOF(x,y) (M(x) & (y))
210: #define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX)
211: #define ISREAL(z) ONEOF(z, MSKREAL)
212: #define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX)
213: #define ISICON(z) (z->headblock.tag==TCONST && ISINT(z->headblock.vtype))
214: #define ISCHAR(z) (z->headblock.vtype==TYCHAR)
215: #define ISINT(z) ONEOF(z, MSKINT)
216: #define ISCONST(z) (z->headblock.tag==TCONST)
217: #define ISERROR(z) (z->headblock.tag==TERROR)
218: #define ISPLUSOP(z) (z->headblock.tag==TEXPR && z->exprblock.opcode==OPPLUS)
219: #define ISSTAROP(z) (z->headblock.tag==TEXPR && z->exprblock.opcode==OPSTAR)
220: #define ISONE(z) (ISICON(z) && z->constblock.const.ci==1)
221: #define INT(z) ONEOF(z, MSKINT|MSKCHAR)
222: #define ICON(z) mkintcon( (ftnint)(z) )
223: #define CHCON(z) mkstrcon(strlen(z), z)
224:
225: #if HERE == PDP11
226: /* not enough space in compiler for checks */
227: # define NO66(s)
228: # define NOEXT(s)
229: #else
230: # define NO66(s) if(no66flag) err66(s)
231: # define NOEXT(s) if(noextflag) errext(s)
232: #endif
233:
234: /* round a up to a multiple of b */
235: #define roundup(a,b) ( b * ( (a+b-1)/b) )
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.