[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / impidt.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/impidt.h"
5 Timpidt timpidt(t)
6  impidt t;
7 {
8         return(t -> tag);
9 }
10
11
12 /************** impid ******************/
13
14 impidt mkimpid(PPgimpid, PPgimptype, PPgimpfinfo, PPgivline)
15  id PPgimpid;
16  ttype PPgimptype;
17  finfot PPgimpfinfo;
18  long PPgivline;
19 {
20         register struct Simpid *pp =
21                 (struct Simpid *) malloc(sizeof(struct Simpid));
22         pp -> tag = impid;
23         pp -> Xgimpid = PPgimpid;
24         pp -> Xgimptype = PPgimptype;
25         pp -> Xgimpfinfo = PPgimpfinfo;
26         pp -> Xgivline = PPgivline;
27         return((impidt)pp);
28 }
29
30 id *Rgimpid(t)
31  struct Simpid *t;
32 {
33         if(t -> tag != impid)
34                 fprintf(stderr,"gimpid: illegal selection; was %d\n", t -> tag);
35         return(& t -> Xgimpid);
36 }
37
38 ttype *Rgimptype(t)
39  struct Simpid *t;
40 {
41         if(t -> tag != impid)
42                 fprintf(stderr,"gimptype: illegal selection; was %d\n", t -> tag);
43         return(& t -> Xgimptype);
44 }
45
46 finfot *Rgimpfinfo(t)
47  struct Simpid *t;
48 {
49         if(t -> tag != impid)
50                 fprintf(stderr,"gimpfinfo: illegal selection; was %d\n", t -> tag);
51         return(& t -> Xgimpfinfo);
52 }
53
54 long *Rgivline(t)
55  struct Simpid *t;
56 {
57         if(t -> tag != impid)
58                 fprintf(stderr,"givline: illegal selection; was %d\n", t -> tag);
59         return(& t -> Xgivline);
60 }
61
62 /************** imptype ******************/
63
64 impidt mkimptype(PPgimptypec, PPgimptypet, PPgimptyped, PPgitline)
65  list PPgimptypec;
66  ttype PPgimptypet;
67  list PPgimptyped;
68  long PPgitline;
69 {
70         register struct Simptype *pp =
71                 (struct Simptype *) malloc(sizeof(struct Simptype));
72         pp -> tag = imptype;
73         pp -> Xgimptypec = PPgimptypec;
74         pp -> Xgimptypet = PPgimptypet;
75         pp -> Xgimptyped = PPgimptyped;
76         pp -> Xgitline = PPgitline;
77         return((impidt)pp);
78 }
79
80 list *Rgimptypec(t)
81  struct Simptype *t;
82 {
83         if(t -> tag != imptype)
84                 fprintf(stderr,"gimptypec: illegal selection; was %d\n", t -> tag);
85         return(& t -> Xgimptypec);
86 }
87
88 ttype *Rgimptypet(t)
89  struct Simptype *t;
90 {
91         if(t -> tag != imptype)
92                 fprintf(stderr,"gimptypet: illegal selection; was %d\n", t -> tag);
93         return(& t -> Xgimptypet);
94 }
95
96 list *Rgimptyped(t)
97  struct Simptype *t;
98 {
99         if(t -> tag != imptype)
100                 fprintf(stderr,"gimptyped: illegal selection; was %d\n", t -> tag);
101         return(& t -> Xgimptyped);
102 }
103
104 long *Rgitline(t)
105  struct Simptype *t;
106 {
107         if(t -> tag != imptype)
108                 fprintf(stderr,"gitline: illegal selection; was %d\n", t -> tag);
109         return(& t -> Xgitline);
110 }
111
112 /************** impsyn ******************/
113
114 impidt mkimpsyn(PPgimpsynti, PPgimpsynts, PPgisline)
115  ttype PPgimpsynti;
116  ttype PPgimpsynts;
117  long PPgisline;
118 {
119         register struct Simpsyn *pp =
120                 (struct Simpsyn *) malloc(sizeof(struct Simpsyn));
121         pp -> tag = impsyn;
122         pp -> Xgimpsynti = PPgimpsynti;
123         pp -> Xgimpsynts = PPgimpsynts;
124         pp -> Xgisline = PPgisline;
125         return((impidt)pp);
126 }
127
128 ttype *Rgimpsynti(t)
129  struct Simpsyn *t;
130 {
131         if(t -> tag != impsyn)
132                 fprintf(stderr,"gimpsynti: illegal selection; was %d\n", t -> tag);
133         return(& t -> Xgimpsynti);
134 }
135
136 ttype *Rgimpsynts(t)
137  struct Simpsyn *t;
138 {
139         if(t -> tag != impsyn)
140                 fprintf(stderr,"gimpsynts: illegal selection; was %d\n", t -> tag);
141         return(& t -> Xgimpsynts);
142 }
143
144 long *Rgisline(t)
145  struct Simpsyn *t;
146 {
147         if(t -> tag != impsyn)
148                 fprintf(stderr,"gisline: illegal selection; was %d\n", t -> tag);
149         return(& t -> Xgisline);
150 }
151
152 /************** impeqtype ******************/
153
154 impidt mkimpeqtype(PPgimpeqtype)
155  binding PPgimpeqtype;
156 {
157         register struct Simpeqtype *pp =
158                 (struct Simpeqtype *) malloc(sizeof(struct Simpeqtype));
159         pp -> tag = impeqtype;
160         pp -> Xgimpeqtype = PPgimpeqtype;
161         return((impidt)pp);
162 }
163
164 binding *Rgimpeqtype(t)
165  struct Simpeqtype *t;
166 {
167         if(t -> tag != impeqtype)
168                 fprintf(stderr,"gimpeqtype: illegal selection; was %d\n", t -> tag);
169         return(& t -> Xgimpeqtype);
170 }
171
172 /************** impclass ******************/
173
174 impidt mkimpclass(PPgimpclassc, PPgimpclasst, PPgimpclassw, PPgicline)
175  list PPgimpclassc;
176  ttype PPgimpclasst;
177  list PPgimpclassw;
178  long PPgicline;
179 {
180         register struct Simpclass *pp =
181                 (struct Simpclass *) malloc(sizeof(struct Simpclass));
182         pp -> tag = impclass;
183         pp -> Xgimpclassc = PPgimpclassc;
184         pp -> Xgimpclasst = PPgimpclasst;
185         pp -> Xgimpclassw = PPgimpclassw;
186         pp -> Xgicline = PPgicline;
187         return((impidt)pp);
188 }
189
190 list *Rgimpclassc(t)
191  struct Simpclass *t;
192 {
193         if(t -> tag != impclass)
194                 fprintf(stderr,"gimpclassc: illegal selection; was %d\n", t -> tag);
195         return(& t -> Xgimpclassc);
196 }
197
198 ttype *Rgimpclasst(t)
199  struct Simpclass *t;
200 {
201         if(t -> tag != impclass)
202                 fprintf(stderr,"gimpclasst: illegal selection; was %d\n", t -> tag);
203         return(& t -> Xgimpclasst);
204 }
205
206 list *Rgimpclassw(t)
207  struct Simpclass *t;
208 {
209         if(t -> tag != impclass)
210                 fprintf(stderr,"gimpclassw: illegal selection; was %d\n", t -> tag);
211         return(& t -> Xgimpclassw);
212 }
213
214 long *Rgicline(t)
215  struct Simpclass *t;
216 {
217         if(t -> tag != impclass)
218                 fprintf(stderr,"gicline: illegal selection; was %d\n", t -> tag);
219         return(& t -> Xgicline);
220 }
221
222 /************** impinst ******************/
223
224 impidt mkimpinst(PPgimpinstc, PPgimpinstid, PPgimpinstt, PPgiiline)
225  list PPgimpinstc;
226  id PPgimpinstid;
227  ttype PPgimpinstt;
228  long PPgiiline;
229 {
230         register struct Simpinst *pp =
231                 (struct Simpinst *) malloc(sizeof(struct Simpinst));
232         pp -> tag = impinst;
233         pp -> Xgimpinstc = PPgimpinstc;
234         pp -> Xgimpinstid = PPgimpinstid;
235         pp -> Xgimpinstt = PPgimpinstt;
236         pp -> Xgiiline = PPgiiline;
237         return((impidt)pp);
238 }
239
240 list *Rgimpinstc(t)
241  struct Simpinst *t;
242 {
243         if(t -> tag != impinst)
244                 fprintf(stderr,"gimpinstc: illegal selection; was %d\n", t -> tag);
245         return(& t -> Xgimpinstc);
246 }
247
248 id *Rgimpinstid(t)
249  struct Simpinst *t;
250 {
251         if(t -> tag != impinst)
252                 fprintf(stderr,"gimpinstid: illegal selection; was %d\n", t -> tag);
253         return(& t -> Xgimpinstid);
254 }
255
256 ttype *Rgimpinstt(t)
257  struct Simpinst *t;
258 {
259         if(t -> tag != impinst)
260                 fprintf(stderr,"gimpinstt: illegal selection; was %d\n", t -> tag);
261         return(& t -> Xgimpinstt);
262 }
263
264 long *Rgiiline(t)
265  struct Simpinst *t;
266 {
267         if(t -> tag != impinst)
268                 fprintf(stderr,"giiline: illegal selection; was %d\n", t -> tag);
269         return(& t -> Xgiiline);
270 }
271
272 /************** impmod ******************/
273
274 impidt mkimpmod(PPgimpmodn, PPgimpmodimp, PPgimpmodren, PPgimline)
275  id PPgimpmodn;
276  list PPgimpmodimp;
277  list PPgimpmodren;
278  long PPgimline;
279 {
280         register struct Simpmod *pp =
281                 (struct Simpmod *) malloc(sizeof(struct Simpmod));
282         pp -> tag = impmod;
283         pp -> Xgimpmodn = PPgimpmodn;
284         pp -> Xgimpmodimp = PPgimpmodimp;
285         pp -> Xgimpmodren = PPgimpmodren;
286         pp -> Xgimline = PPgimline;
287         return((impidt)pp);
288 }
289
290 id *Rgimpmodn(t)
291  struct Simpmod *t;
292 {
293         if(t -> tag != impmod)
294                 fprintf(stderr,"gimpmodn: illegal selection; was %d\n", t -> tag);
295         return(& t -> Xgimpmodn);
296 }
297
298 list *Rgimpmodimp(t)
299  struct Simpmod *t;
300 {
301         if(t -> tag != impmod)
302                 fprintf(stderr,"gimpmodimp: illegal selection; was %d\n", t -> tag);
303         return(& t -> Xgimpmodimp);
304 }
305
306 list *Rgimpmodren(t)
307  struct Simpmod *t;
308 {
309         if(t -> tag != impmod)
310                 fprintf(stderr,"gimpmodren: illegal selection; was %d\n", t -> tag);
311         return(& t -> Xgimpmodren);
312 }
313
314 long *Rgimline(t)
315  struct Simpmod *t;
316 {
317         if(t -> tag != impmod)
318                 fprintf(stderr,"gimline: illegal selection; was %d\n", t -> tag);
319         return(& t -> Xgimline);
320 }