|
|
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: #define ALLEXPR (expptr) ckalloc( sizeof(union Expression) )
25: typedef int *ptr;
26: typedef char *charptr;
27: typedef FILE *FILEP;
28: typedef short flag;
29: typedef char field; /* actually need only 4 bits */
30: typedef long int ftnint;
31: #define LOCAL static
32:
33: #define NO 0
34: #define YES 1
35:
36: #define CNULL (char *) 0
37: #define PNULL (ptr) 0
38: #define CHNULL (chainp) 0
39: #define ENULL (expptr) 0
40:
41:
42:
43: /* block tag values */
44:
45: #define TNAME 1
46: #define TCONST 2
47: #define TEXPR 3
48: #define TADDR 4
49: #define TTEMP 5
50: #define TPRIM 6
51: #define TLIST 7
52: #define TIMPLDO 8
53: #define TERROR 9
54:
55:
56: /* parser states */
57:
58: #define OUTSIDE 0
59: #define INSIDE 1
60: #define INDCL 2
61: #define INDATA 3
62: #define INEXEC 4
63:
64: /* procedure classes */
65:
66: #define PROCMAIN 1
67: #define PROCBLOCK 2
68: #define PROCSUBR 3
69: #define PROCFUNCT 4
70:
71:
72: /* storage classes -- vstg values */
73:
74: #define STGUNKNOWN 0
75: #define STGARG 1
76: #define STGAUTO 2
77: #define STGBSS 3
78: #define STGINIT 4
79: #define STGCONST 5
80: #define STGEXT 6
81: #define STGINTR 7
82: #define STGSTFUNCT 8
83: #define STGCOMMON 9
84: #define STGEQUIV 10
85: #define STGREG 11
86: #define STGLENG 12
87: #define STGNULL 13
88: #define STGPREG 14
89:
90: /* name classes -- vclass values */
91:
92: #define CLUNKNOWN 0
93: #define CLPARAM 1
94: #define CLVAR 2
95: #define CLENTRY 3
96: #define CLMAIN 4
97: #define CLBLOCK 5
98: #define CLPROC 6
99: #define CLNAMELIST 7
100:
101:
102: /* vprocclass values */
103:
104: #define PUNKNOWN 0
105: #define PEXTERNAL 1
106: #define PINTRINSIC 2
107: #define PSTFUNCT 3
108: #define PTHISPROC 4
109:
110: /* control stack codes */
111:
112: #define CTLDO 1
113: #define CTLIF 2
114: #define CTLELSE 3
115:
116:
117: /* operators -- see also arrays 'ops' and 'ops2' in put.c */
118:
119: #define OPPLUS 1
120: #define OPMINUS 2
121: #define OPSTAR 3
122: #define OPSLASH 4
123: #define OPPOWER 5
124: #define OPNEG 6
125: #define OPOR 7
126: #define OPAND 8
127: #define OPEQV 9
128: #define OPNEQV 10
129: #define OPNOT 11
130: #define OPCONCAT 12
131: #define OPLT 13
132: #define OPEQ 14
133: #define OPGT 15
134: #define OPLE 16
135: #define OPNE 17
136: #define OPGE 18
137: #define OPCALL 19
138: #define OPCCALL 20
139: #define OPASSIGN 21
140: #define OPPLUSEQ 22
141: #define OPSTAREQ 23
142: #define OPCONV 24
143: #define OPLSHIFT 25
144: #define OPMOD 26
145: #define OPCOMMA 27
146: #define OPQUEST 28
147: #define OPCOLON 29
148: #define OPABS 30
149: #define OPMIN 31
150: #define OPMAX 32
151: #define OPADDR 33
152: #define OPINDIRECT 34
153: #define OPBITOR 35
154: #define OPBITAND 36
155: #define OPBITXOR 37
156: #define OPBITNOT 38
157: #define OPRSHIFT 39
158: #define OPPAREN 40
159: #define OPUNARYPLUS 41
160:
161:
162: /* label type codes */
163:
164: #define LABUNKNOWN 0
165: #define LABEXEC 1
166: #define LABFORMAT 2
167: #define LABOTHER 3
168:
169:
170: /* INTRINSIC function codes*/
171:
172: #define INTREND 0
173: #define INTRCONV 1
174: #define INTRMIN 2
175: #define INTRMAX 3
176: #define INTRGEN 4
177: #define INTRSPEC 5
178: #define INTRBOOL 6
179: #define INTRCNST 7
180:
181:
182: /* I/O statement codes */
183:
184: #define IOSTDIN ICON(5)
185: #define IOSTDOUT ICON(6)
186: #define IOSTDERR ICON(0)
187:
188: #define IOSBAD (-1)
189: #define IOSPOSITIONAL 0
190: #define IOSUNIT 1
191: #define IOSFMT 2
192:
193: #define IOINQUIRE 1
194: #define IOOPEN 2
195: #define IOCLOSE 3
196: #define IOREWIND 4
197: #define IOBACKSPACE 5
198: #define IOENDFILE 6
199: #define IOREAD 7
200: #define IOWRITE 8
201:
202:
203: /* type masks */
204:
205: #define MSKLOGICAL M(TYLOGICAL)
206: #define MSKADDR M(TYADDR)
207: #define MSKCHAR M(TYCHAR)
208: #define MSKINT M(TYSHORT)|M(TYLONG)
209: #define MSKREAL M(TYREAL)|M(TYDREAL)
210: #define MSKCOMPLEX M(TYCOMPLEX)|M(TYDCOMPLEX)
211: #define MSKSTATIC (M(STGINIT)|M(STGBSS)|M(STGCOMMON)|M(STGEQUIV)|M(STGCONST))
212:
213: /* miscellaneous macros */
214:
215: #define ONEOF(x,y) (M(x) & (y))
216: #define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX)
217: #define ISREAL(z) ONEOF(z, MSKREAL)
218: #define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX)
219: #define ISICON(z) (z->tag==TCONST && ISINT(z->constblock.vtype))
220: #define ISCHAR(z) (z->headblock.vtype==TYCHAR)
221: #define ISINT(z) ONEOF(z, MSKINT)
222: #define ISCONST(z) (z->tag==TCONST)
223: #define ISERROR(z) (z->tag==TERROR)
224: #define ISPLUSOP(z) (z->tag==TEXPR && z->exprblock.opcode==OPPLUS)
225: #define ISSTAROP(z) (z->tag==TEXPR && z->exprblock.opcode==OPSTAR)
226: #define ISONE(z) (ISICON(z) && z->constblock.const.ci==1)
227: #define INT(z) ONEOF(z, MSKINT|MSKCHAR)
228: #define ICON(z) mkintcon( (ftnint)(z) )
229:
230: #define NO66(s) if(no66flag) err66(s)
231: #define NOEXT(s) if(noextflag) errext(s)
232:
233: /* round a up to a multiple of b */
234: #define roundup(a,b) ( b * ( (a+b-1)/b) )
235:
236:
237: /* optimization buffer slot types */
238:
239: #define SKNULL 0
240: #define SKIFN 1
241: #define SKGOTO 2
242: #define SKLABEL 3
243: #define SKEQ 4
244: #define SKCALL 5
245: #define SKCMGOTO 6
246: #define SKSTOP 7
247: #define SKDOHEAD 8
248: #define SKENDDO 9
249: #define SKARIF 10
250: #define SKRETURN 11
251: #define SKASGOTO 12
252: #define SKPAUSE 13
253: #define SKASSIGN 14
254: #define SKIOIFN 15
255: #define SKFRTEMP 16
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.