[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / tree.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/tree.h"
5
6 Ttree ttree(t)
7  tree t;
8 {
9         return(t -> tag);
10 }
11
12
13 /************** hmodule ******************/
14
15 tree mkhmodule(PPghname, PPghimplist, PPghexplist, PPghmodlist, PPghmodline)
16  stringId PPghname;
17  list PPghimplist;
18  list PPghexplist;
19  binding PPghmodlist;
20  long PPghmodline;
21 {
22         register struct Shmodule *pp =
23                 (struct Shmodule *) malloc(sizeof(struct Shmodule));
24         pp -> tag = hmodule;
25         pp -> Xghname = PPghname;
26         pp -> Xghimplist = PPghimplist;
27         pp -> Xghexplist = PPghexplist;
28         pp -> Xghmodlist = PPghmodlist;
29         pp -> Xghmodline = PPghmodline;
30         return((tree)pp);
31 }
32
33 stringId *Rghname(t)
34  struct Shmodule *t;
35 {
36 #ifdef UGEN_DEBUG
37         if(t -> tag != hmodule)
38                 fprintf(stderr,"ghname: illegal selection; was %d\n", t -> tag);
39 #endif /* UGEN_DEBUG */
40         return(& t -> Xghname);
41 }
42
43 list *Rghimplist(t)
44  struct Shmodule *t;
45 {
46 #ifdef UGEN_DEBUG
47         if(t -> tag != hmodule)
48                 fprintf(stderr,"ghimplist: illegal selection; was %d\n", t -> tag);
49 #endif /* UGEN_DEBUG */
50         return(& t -> Xghimplist);
51 }
52
53 list *Rghexplist(t)
54  struct Shmodule *t;
55 {
56 #ifdef UGEN_DEBUG
57         if(t -> tag != hmodule)
58                 fprintf(stderr,"ghexplist: illegal selection; was %d\n", t -> tag);
59 #endif /* UGEN_DEBUG */
60         return(& t -> Xghexplist);
61 }
62
63 binding *Rghmodlist(t)
64  struct Shmodule *t;
65 {
66 #ifdef UGEN_DEBUG
67         if(t -> tag != hmodule)
68                 fprintf(stderr,"ghmodlist: illegal selection; was %d\n", t -> tag);
69 #endif /* UGEN_DEBUG */
70         return(& t -> Xghmodlist);
71 }
72
73 long *Rghmodline(t)
74  struct Shmodule *t;
75 {
76 #ifdef UGEN_DEBUG
77         if(t -> tag != hmodule)
78                 fprintf(stderr,"ghmodline: illegal selection; was %d\n", t -> tag);
79 #endif /* UGEN_DEBUG */
80         return(& t -> Xghmodline);
81 }
82
83 /************** ident ******************/
84
85 tree mkident(PPgident)
86  unkId PPgident;
87 {
88         register struct Sident *pp =
89                 (struct Sident *) malloc(sizeof(struct Sident));
90         pp -> tag = ident;
91         pp -> Xgident = PPgident;
92         return((tree)pp);
93 }
94
95 unkId *Rgident(t)
96  struct Sident *t;
97 {
98 #ifdef UGEN_DEBUG
99         if(t -> tag != ident)
100                 fprintf(stderr,"gident: illegal selection; was %d\n", t -> tag);
101 #endif /* UGEN_DEBUG */
102         return(& t -> Xgident);
103 }
104
105 /************** lit ******************/
106
107 tree mklit(PPglit)
108  literal PPglit;
109 {
110         register struct Slit *pp =
111                 (struct Slit *) malloc(sizeof(struct Slit));
112         pp -> tag = lit;
113         pp -> Xglit = PPglit;
114         return((tree)pp);
115 }
116
117 literal *Rglit(t)
118  struct Slit *t;
119 {
120 #ifdef UGEN_DEBUG
121         if(t -> tag != lit)
122                 fprintf(stderr,"glit: illegal selection; was %d\n", t -> tag);
123 #endif /* UGEN_DEBUG */
124         return(& t -> Xglit);
125 }
126
127 /************** tuple ******************/
128
129 tree mktuple(PPgtuplelist)
130  list PPgtuplelist;
131 {
132         register struct Stuple *pp =
133                 (struct Stuple *) malloc(sizeof(struct Stuple));
134         pp -> tag = tuple;
135         pp -> Xgtuplelist = PPgtuplelist;
136         return((tree)pp);
137 }
138
139 list *Rgtuplelist(t)
140  struct Stuple *t;
141 {
142 #ifdef UGEN_DEBUG
143         if(t -> tag != tuple)
144                 fprintf(stderr,"gtuplelist: illegal selection; was %d\n", t -> tag);
145 #endif /* UGEN_DEBUG */
146         return(& t -> Xgtuplelist);
147 }
148
149 /************** ap ******************/
150
151 tree mkap(PPgfun, PPgarg)
152  tree PPgfun;
153  tree PPgarg;
154 {
155         register struct Sap *pp =
156                 (struct Sap *) malloc(sizeof(struct Sap));
157         pp -> tag = ap;
158         pp -> Xgfun = PPgfun;
159         pp -> Xgarg = PPgarg;
160         return((tree)pp);
161 }
162
163 tree *Rgfun(t)
164  struct Sap *t;
165 {
166 #ifdef UGEN_DEBUG
167         if(t -> tag != ap)
168                 fprintf(stderr,"gfun: illegal selection; was %d\n", t -> tag);
169 #endif /* UGEN_DEBUG */
170         return(& t -> Xgfun);
171 }
172
173 tree *Rgarg(t)
174  struct Sap *t;
175 {
176 #ifdef UGEN_DEBUG
177         if(t -> tag != ap)
178                 fprintf(stderr,"garg: illegal selection; was %d\n", t -> tag);
179 #endif /* UGEN_DEBUG */
180         return(& t -> Xgarg);
181 }
182
183 /************** lambda ******************/
184
185 tree mklambda(PPglampats, PPglamexpr, PPglamline)
186  list PPglampats;
187  tree PPglamexpr;
188  long PPglamline;
189 {
190         register struct Slambda *pp =
191                 (struct Slambda *) malloc(sizeof(struct Slambda));
192         pp -> tag = lambda;
193         pp -> Xglampats = PPglampats;
194         pp -> Xglamexpr = PPglamexpr;
195         pp -> Xglamline = PPglamline;
196         return((tree)pp);
197 }
198
199 list *Rglampats(t)
200  struct Slambda *t;
201 {
202 #ifdef UGEN_DEBUG
203         if(t -> tag != lambda)
204                 fprintf(stderr,"glampats: illegal selection; was %d\n", t -> tag);
205 #endif /* UGEN_DEBUG */
206         return(& t -> Xglampats);
207 }
208
209 tree *Rglamexpr(t)
210  struct Slambda *t;
211 {
212 #ifdef UGEN_DEBUG
213         if(t -> tag != lambda)
214                 fprintf(stderr,"glamexpr: illegal selection; was %d\n", t -> tag);
215 #endif /* UGEN_DEBUG */
216         return(& t -> Xglamexpr);
217 }
218
219 long *Rglamline(t)
220  struct Slambda *t;
221 {
222 #ifdef UGEN_DEBUG
223         if(t -> tag != lambda)
224                 fprintf(stderr,"glamline: illegal selection; was %d\n", t -> tag);
225 #endif /* UGEN_DEBUG */
226         return(& t -> Xglamline);
227 }
228
229 /************** let ******************/
230
231 tree mklet(PPgletvdeflist, PPgletvexpr)
232  binding PPgletvdeflist;
233  tree PPgletvexpr;
234 {
235         register struct Slet *pp =
236                 (struct Slet *) malloc(sizeof(struct Slet));
237         pp -> tag = let;
238         pp -> Xgletvdeflist = PPgletvdeflist;
239         pp -> Xgletvexpr = PPgletvexpr;
240         return((tree)pp);
241 }
242
243 binding *Rgletvdeflist(t)
244  struct Slet *t;
245 {
246 #ifdef UGEN_DEBUG
247         if(t -> tag != let)
248                 fprintf(stderr,"gletvdeflist: illegal selection; was %d\n", t -> tag);
249 #endif /* UGEN_DEBUG */
250         return(& t -> Xgletvdeflist);
251 }
252
253 tree *Rgletvexpr(t)
254  struct Slet *t;
255 {
256 #ifdef UGEN_DEBUG
257         if(t -> tag != let)
258                 fprintf(stderr,"gletvexpr: illegal selection; was %d\n", t -> tag);
259 #endif /* UGEN_DEBUG */
260         return(& t -> Xgletvexpr);
261 }
262
263 /************** casee ******************/
264
265 tree mkcasee(PPgcaseexpr, PPgcasebody)
266  tree PPgcaseexpr;
267  list PPgcasebody;
268 {
269         register struct Scasee *pp =
270                 (struct Scasee *) malloc(sizeof(struct Scasee));
271         pp -> tag = casee;
272         pp -> Xgcaseexpr = PPgcaseexpr;
273         pp -> Xgcasebody = PPgcasebody;
274         return((tree)pp);
275 }
276
277 tree *Rgcaseexpr(t)
278  struct Scasee *t;
279 {
280 #ifdef UGEN_DEBUG
281         if(t -> tag != casee)
282                 fprintf(stderr,"gcaseexpr: illegal selection; was %d\n", t -> tag);
283 #endif /* UGEN_DEBUG */
284         return(& t -> Xgcaseexpr);
285 }
286
287 list *Rgcasebody(t)
288  struct Scasee *t;
289 {
290 #ifdef UGEN_DEBUG
291         if(t -> tag != casee)
292                 fprintf(stderr,"gcasebody: illegal selection; was %d\n", t -> tag);
293 #endif /* UGEN_DEBUG */
294         return(& t -> Xgcasebody);
295 }
296
297 /************** ife ******************/
298
299 tree mkife(PPgifpred, PPgifthen, PPgifelse)
300  tree PPgifpred;
301  tree PPgifthen;
302  tree PPgifelse;
303 {
304         register struct Sife *pp =
305                 (struct Sife *) malloc(sizeof(struct Sife));
306         pp -> tag = ife;
307         pp -> Xgifpred = PPgifpred;
308         pp -> Xgifthen = PPgifthen;
309         pp -> Xgifelse = PPgifelse;
310         return((tree)pp);
311 }
312
313 tree *Rgifpred(t)
314  struct Sife *t;
315 {
316 #ifdef UGEN_DEBUG
317         if(t -> tag != ife)
318                 fprintf(stderr,"gifpred: illegal selection; was %d\n", t -> tag);
319 #endif /* UGEN_DEBUG */
320         return(& t -> Xgifpred);
321 }
322
323 tree *Rgifthen(t)
324  struct Sife *t;
325 {
326 #ifdef UGEN_DEBUG
327         if(t -> tag != ife)
328                 fprintf(stderr,"gifthen: illegal selection; was %d\n", t -> tag);
329 #endif /* UGEN_DEBUG */
330         return(& t -> Xgifthen);
331 }
332
333 tree *Rgifelse(t)
334  struct Sife *t;
335 {
336 #ifdef UGEN_DEBUG
337         if(t -> tag != ife)
338                 fprintf(stderr,"gifelse: illegal selection; was %d\n", t -> tag);
339 #endif /* UGEN_DEBUG */
340         return(& t -> Xgifelse);
341 }
342
343 /************** par ******************/
344
345 tree mkpar(PPgpare)
346  tree PPgpare;
347 {
348         register struct Spar *pp =
349                 (struct Spar *) malloc(sizeof(struct Spar));
350         pp -> tag = par;
351         pp -> Xgpare = PPgpare;
352         return((tree)pp);
353 }
354
355 tree *Rgpare(t)
356  struct Spar *t;
357 {
358 #ifdef UGEN_DEBUG
359         if(t -> tag != par)
360                 fprintf(stderr,"gpare: illegal selection; was %d\n", t -> tag);
361 #endif /* UGEN_DEBUG */
362         return(& t -> Xgpare);
363 }
364
365 /************** as ******************/
366
367 tree mkas(PPgasid, PPgase)
368  unkId PPgasid;
369  tree PPgase;
370 {
371         register struct Sas *pp =
372                 (struct Sas *) malloc(sizeof(struct Sas));
373         pp -> tag = as;
374         pp -> Xgasid = PPgasid;
375         pp -> Xgase = PPgase;
376         return((tree)pp);
377 }
378
379 unkId *Rgasid(t)
380  struct Sas *t;
381 {
382 #ifdef UGEN_DEBUG
383         if(t -> tag != as)
384                 fprintf(stderr,"gasid: illegal selection; was %d\n", t -> tag);
385 #endif /* UGEN_DEBUG */
386         return(& t -> Xgasid);
387 }
388
389 tree *Rgase(t)
390  struct Sas *t;
391 {
392 #ifdef UGEN_DEBUG
393         if(t -> tag != as)
394                 fprintf(stderr,"gase: illegal selection; was %d\n", t -> tag);
395 #endif /* UGEN_DEBUG */
396         return(& t -> Xgase);
397 }
398
399 /************** lazyp ******************/
400
401 tree mklazyp(PPglazyp)
402  tree PPglazyp;
403 {
404         register struct Slazyp *pp =
405                 (struct Slazyp *) malloc(sizeof(struct Slazyp));
406         pp -> tag = lazyp;
407         pp -> Xglazyp = PPglazyp;
408         return((tree)pp);
409 }
410
411 tree *Rglazyp(t)
412  struct Slazyp *t;
413 {
414 #ifdef UGEN_DEBUG
415         if(t -> tag != lazyp)
416                 fprintf(stderr,"glazyp: illegal selection; was %d\n", t -> tag);
417 #endif /* UGEN_DEBUG */
418         return(& t -> Xglazyp);
419 }
420
421 /************** plusp ******************/
422
423 tree mkplusp(PPgplusp, PPgplusi)
424  tree PPgplusp;
425  literal PPgplusi;
426 {
427         register struct Splusp *pp =
428                 (struct Splusp *) malloc(sizeof(struct Splusp));
429         pp -> tag = plusp;
430         pp -> Xgplusp = PPgplusp;
431         pp -> Xgplusi = PPgplusi;
432         return((tree)pp);
433 }
434
435 tree *Rgplusp(t)
436  struct Splusp *t;
437 {
438 #ifdef UGEN_DEBUG
439         if(t -> tag != plusp)
440                 fprintf(stderr,"gplusp: illegal selection; was %d\n", t -> tag);
441 #endif /* UGEN_DEBUG */
442         return(& t -> Xgplusp);
443 }
444
445 literal *Rgplusi(t)
446  struct Splusp *t;
447 {
448 #ifdef UGEN_DEBUG
449         if(t -> tag != plusp)
450                 fprintf(stderr,"gplusi: illegal selection; was %d\n", t -> tag);
451 #endif /* UGEN_DEBUG */
452         return(& t -> Xgplusi);
453 }
454
455 /************** wildp ******************/
456
457 tree mkwildp()
458 {
459         register struct Swildp *pp =
460                 (struct Swildp *) malloc(sizeof(struct Swildp));
461         pp -> tag = wildp;
462         return((tree)pp);
463 }
464
465 /************** restr ******************/
466
467 tree mkrestr(PPgrestre, PPgrestrt)
468  tree PPgrestre;
469  ttype PPgrestrt;
470 {
471         register struct Srestr *pp =
472                 (struct Srestr *) malloc(sizeof(struct Srestr));
473         pp -> tag = restr;
474         pp -> Xgrestre = PPgrestre;
475         pp -> Xgrestrt = PPgrestrt;
476         return((tree)pp);
477 }
478
479 tree *Rgrestre(t)
480  struct Srestr *t;
481 {
482 #ifdef UGEN_DEBUG
483         if(t -> tag != restr)
484                 fprintf(stderr,"grestre: illegal selection; was %d\n", t -> tag);
485 #endif /* UGEN_DEBUG */
486         return(& t -> Xgrestre);
487 }
488
489 ttype *Rgrestrt(t)
490  struct Srestr *t;
491 {
492 #ifdef UGEN_DEBUG
493         if(t -> tag != restr)
494                 fprintf(stderr,"grestrt: illegal selection; was %d\n", t -> tag);
495 #endif /* UGEN_DEBUG */
496         return(& t -> Xgrestrt);
497 }
498
499 /************** comprh ******************/
500
501 tree mkcomprh(PPgcexp, PPgcquals)
502  tree PPgcexp;
503  list PPgcquals;
504 {
505         register struct Scomprh *pp =
506                 (struct Scomprh *) malloc(sizeof(struct Scomprh));
507         pp -> tag = comprh;
508         pp -> Xgcexp = PPgcexp;
509         pp -> Xgcquals = PPgcquals;
510         return((tree)pp);
511 }
512
513 tree *Rgcexp(t)
514  struct Scomprh *t;
515 {
516 #ifdef UGEN_DEBUG
517         if(t -> tag != comprh)
518                 fprintf(stderr,"gcexp: illegal selection; was %d\n", t -> tag);
519 #endif /* UGEN_DEBUG */
520         return(& t -> Xgcexp);
521 }
522
523 list *Rgcquals(t)
524  struct Scomprh *t;
525 {
526 #ifdef UGEN_DEBUG
527         if(t -> tag != comprh)
528                 fprintf(stderr,"gcquals: illegal selection; was %d\n", t -> tag);
529 #endif /* UGEN_DEBUG */
530         return(& t -> Xgcquals);
531 }
532
533 /************** qual ******************/
534
535 tree mkqual(PPgqpat, PPgqexp)
536  tree PPgqpat;
537  tree PPgqexp;
538 {
539         register struct Squal *pp =
540                 (struct Squal *) malloc(sizeof(struct Squal));
541         pp -> tag = qual;
542         pp -> Xgqpat = PPgqpat;
543         pp -> Xgqexp = PPgqexp;
544         return((tree)pp);
545 }
546
547 tree *Rgqpat(t)
548  struct Squal *t;
549 {
550 #ifdef UGEN_DEBUG
551         if(t -> tag != qual)
552                 fprintf(stderr,"gqpat: illegal selection; was %d\n", t -> tag);
553 #endif /* UGEN_DEBUG */
554         return(& t -> Xgqpat);
555 }
556
557 tree *Rgqexp(t)
558  struct Squal *t;
559 {
560 #ifdef UGEN_DEBUG
561         if(t -> tag != qual)
562                 fprintf(stderr,"gqexp: illegal selection; was %d\n", t -> tag);
563 #endif /* UGEN_DEBUG */
564         return(& t -> Xgqexp);
565 }
566
567 /************** guard ******************/
568
569 tree mkguard(PPggexp)
570  tree PPggexp;
571 {
572         register struct Sguard *pp =
573                 (struct Sguard *) malloc(sizeof(struct Sguard));
574         pp -> tag = guard;
575         pp -> Xggexp = PPggexp;
576         return((tree)pp);
577 }
578
579 tree *Rggexp(t)
580  struct Sguard *t;
581 {
582 #ifdef UGEN_DEBUG
583         if(t -> tag != guard)
584                 fprintf(stderr,"ggexp: illegal selection; was %d\n", t -> tag);
585 #endif /* UGEN_DEBUG */
586         return(& t -> Xggexp);
587 }
588
589 /************** def ******************/
590
591 tree mkdef(PPggdef)
592  tree PPggdef;
593 {
594         register struct Sdef *pp =
595                 (struct Sdef *) malloc(sizeof(struct Sdef));
596         pp -> tag = def;
597         pp -> Xggdef = PPggdef;
598         return((tree)pp);
599 }
600
601 tree *Rggdef(t)
602  struct Sdef *t;
603 {
604 #ifdef UGEN_DEBUG
605         if(t -> tag != def)
606                 fprintf(stderr,"ggdef: illegal selection; was %d\n", t -> tag);
607 #endif /* UGEN_DEBUG */
608         return(& t -> Xggdef);
609 }
610
611 /************** tinfixop ******************/
612
613 tree mktinfixop(PPgdummy)
614  infixTree PPgdummy;
615 {
616         register struct Stinfixop *pp =
617                 (struct Stinfixop *) malloc(sizeof(struct Stinfixop));
618         pp -> tag = tinfixop;
619         pp -> Xgdummy = PPgdummy;
620         return((tree)pp);
621 }
622
623 infixTree *Rgdummy(t)
624  struct Stinfixop *t;
625 {
626 #ifdef UGEN_DEBUG
627         if(t -> tag != tinfixop)
628                 fprintf(stderr,"gdummy: illegal selection; was %d\n", t -> tag);
629 #endif /* UGEN_DEBUG */
630         return(& t -> Xgdummy);
631 }
632
633 /************** lsection ******************/
634
635 tree mklsection(PPglsexp, PPglsop)
636  tree PPglsexp;
637  unkId PPglsop;
638 {
639         register struct Slsection *pp =
640                 (struct Slsection *) malloc(sizeof(struct Slsection));
641         pp -> tag = lsection;
642         pp -> Xglsexp = PPglsexp;
643         pp -> Xglsop = PPglsop;
644         return((tree)pp);
645 }
646
647 tree *Rglsexp(t)
648  struct Slsection *t;
649 {
650 #ifdef UGEN_DEBUG
651         if(t -> tag != lsection)
652                 fprintf(stderr,"glsexp: illegal selection; was %d\n", t -> tag);
653 #endif /* UGEN_DEBUG */
654         return(& t -> Xglsexp);
655 }
656
657 unkId *Rglsop(t)
658  struct Slsection *t;
659 {
660 #ifdef UGEN_DEBUG
661         if(t -> tag != lsection)
662                 fprintf(stderr,"glsop: illegal selection; was %d\n", t -> tag);
663 #endif /* UGEN_DEBUG */
664         return(& t -> Xglsop);
665 }
666
667 /************** rsection ******************/
668
669 tree mkrsection(PPgrsop, PPgrsexp)
670  unkId PPgrsop;
671  tree PPgrsexp;
672 {
673         register struct Srsection *pp =
674                 (struct Srsection *) malloc(sizeof(struct Srsection));
675         pp -> tag = rsection;
676         pp -> Xgrsop = PPgrsop;
677         pp -> Xgrsexp = PPgrsexp;
678         return((tree)pp);
679 }
680
681 unkId *Rgrsop(t)
682  struct Srsection *t;
683 {
684 #ifdef UGEN_DEBUG
685         if(t -> tag != rsection)
686                 fprintf(stderr,"grsop: illegal selection; was %d\n", t -> tag);
687 #endif /* UGEN_DEBUG */
688         return(& t -> Xgrsop);
689 }
690
691 tree *Rgrsexp(t)
692  struct Srsection *t;
693 {
694 #ifdef UGEN_DEBUG
695         if(t -> tag != rsection)
696                 fprintf(stderr,"grsexp: illegal selection; was %d\n", t -> tag);
697 #endif /* UGEN_DEBUG */
698         return(& t -> Xgrsexp);
699 }
700
701 /************** eenum ******************/
702
703 tree mkeenum(PPgefrom, PPgestep, PPgeto)
704  tree PPgefrom;
705  list PPgestep;
706  list PPgeto;
707 {
708         register struct Seenum *pp =
709                 (struct Seenum *) malloc(sizeof(struct Seenum));
710         pp -> tag = eenum;
711         pp -> Xgefrom = PPgefrom;
712         pp -> Xgestep = PPgestep;
713         pp -> Xgeto = PPgeto;
714         return((tree)pp);
715 }
716
717 tree *Rgefrom(t)
718  struct Seenum *t;
719 {
720 #ifdef UGEN_DEBUG
721         if(t -> tag != eenum)
722                 fprintf(stderr,"gefrom: illegal selection; was %d\n", t -> tag);
723 #endif /* UGEN_DEBUG */
724         return(& t -> Xgefrom);
725 }
726
727 list *Rgestep(t)
728  struct Seenum *t;
729 {
730 #ifdef UGEN_DEBUG
731         if(t -> tag != eenum)
732                 fprintf(stderr,"gestep: illegal selection; was %d\n", t -> tag);
733 #endif /* UGEN_DEBUG */
734         return(& t -> Xgestep);
735 }
736
737 list *Rgeto(t)
738  struct Seenum *t;
739 {
740 #ifdef UGEN_DEBUG
741         if(t -> tag != eenum)
742                 fprintf(stderr,"geto: illegal selection; was %d\n", t -> tag);
743 #endif /* UGEN_DEBUG */
744         return(& t -> Xgeto);
745 }
746
747 /************** llist ******************/
748
749 tree mkllist(PPgllist)
750  list PPgllist;
751 {
752         register struct Sllist *pp =
753                 (struct Sllist *) malloc(sizeof(struct Sllist));
754         pp -> tag = llist;
755         pp -> Xgllist = PPgllist;
756         return((tree)pp);
757 }
758
759 list *Rgllist(t)
760  struct Sllist *t;
761 {
762 #ifdef UGEN_DEBUG
763         if(t -> tag != llist)
764                 fprintf(stderr,"gllist: illegal selection; was %d\n", t -> tag);
765 #endif /* UGEN_DEBUG */
766         return(& t -> Xgllist);
767 }
768
769 /************** ccall ******************/
770
771 tree mkccall(PPgccid, PPgccinfo, PPgccargs)
772  stringId PPgccid;
773  stringId PPgccinfo;
774  list PPgccargs;
775 {
776         register struct Sccall *pp =
777                 (struct Sccall *) malloc(sizeof(struct Sccall));
778         pp -> tag = ccall;
779         pp -> Xgccid = PPgccid;
780         pp -> Xgccinfo = PPgccinfo;
781         pp -> Xgccargs = PPgccargs;
782         return((tree)pp);
783 }
784
785 stringId *Rgccid(t)
786  struct Sccall *t;
787 {
788 #ifdef UGEN_DEBUG
789         if(t -> tag != ccall)
790                 fprintf(stderr,"gccid: illegal selection; was %d\n", t -> tag);
791 #endif /* UGEN_DEBUG */
792         return(& t -> Xgccid);
793 }
794
795 stringId *Rgccinfo(t)
796  struct Sccall *t;
797 {
798 #ifdef UGEN_DEBUG
799         if(t -> tag != ccall)
800                 fprintf(stderr,"gccinfo: illegal selection; was %d\n", t -> tag);
801 #endif /* UGEN_DEBUG */
802         return(& t -> Xgccinfo);
803 }
804
805 list *Rgccargs(t)
806  struct Sccall *t;
807 {
808 #ifdef UGEN_DEBUG
809         if(t -> tag != ccall)
810                 fprintf(stderr,"gccargs: illegal selection; was %d\n", t -> tag);
811 #endif /* UGEN_DEBUG */
812         return(& t -> Xgccargs);
813 }
814
815 /************** scc ******************/
816
817 tree mkscc(PPgsccid, PPgsccexp)
818  hstring PPgsccid;
819  tree PPgsccexp;
820 {
821         register struct Sscc *pp =
822                 (struct Sscc *) malloc(sizeof(struct Sscc));
823         pp -> tag = scc;
824         pp -> Xgsccid = PPgsccid;
825         pp -> Xgsccexp = PPgsccexp;
826         return((tree)pp);
827 }
828
829 hstring *Rgsccid(t)
830  struct Sscc *t;
831 {
832 #ifdef UGEN_DEBUG
833         if(t -> tag != scc)
834                 fprintf(stderr,"gsccid: illegal selection; was %d\n", t -> tag);
835 #endif /* UGEN_DEBUG */
836         return(& t -> Xgsccid);
837 }
838
839 tree *Rgsccexp(t)
840  struct Sscc *t;
841 {
842 #ifdef UGEN_DEBUG
843         if(t -> tag != scc)
844                 fprintf(stderr,"gsccexp: illegal selection; was %d\n", t -> tag);
845 #endif /* UGEN_DEBUG */
846         return(& t -> Xgsccexp);
847 }
848
849 /************** negate ******************/
850
851 tree mknegate(PPgnexp)
852  tree PPgnexp;
853 {
854         register struct Snegate *pp =
855                 (struct Snegate *) malloc(sizeof(struct Snegate));
856         pp -> tag = negate;
857         pp -> Xgnexp = PPgnexp;
858         return((tree)pp);
859 }
860
861 tree *Rgnexp(t)
862  struct Snegate *t;
863 {
864 #ifdef UGEN_DEBUG
865         if(t -> tag != negate)
866                 fprintf(stderr,"gnexp: illegal selection; was %d\n", t -> tag);
867 #endif /* UGEN_DEBUG */
868         return(& t -> Xgnexp);
869 }