[project @ 1996-03-22 09:24:22 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / atype.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/atype.h"
5
6 Tatype tatype(t)
7  atype t;
8 {
9         return(t -> tag);
10 }
11
12
13 /************** atc ******************/
14
15 atype mkatc(PPgatcid, PPgatctypel, PPgatcline)
16  unkId PPgatcid;
17  list PPgatctypel;
18  long PPgatcline;
19 {
20         register struct Satc *pp =
21                 (struct Satc *) malloc(sizeof(struct Satc));
22         pp -> tag = atc;
23         pp -> Xgatcid = PPgatcid;
24         pp -> Xgatctypel = PPgatctypel;
25         pp -> Xgatcline = PPgatcline;
26         return((atype)pp);
27 }
28
29 unkId *Rgatcid(t)
30  struct Satc *t;
31 {
32 #ifdef UGEN_DEBUG
33         if(t -> tag != atc)
34                 fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
35 #endif /* UGEN_DEBUG */
36         return(& t -> Xgatcid);
37 }
38
39 list *Rgatctypel(t)
40  struct Satc *t;
41 {
42 #ifdef UGEN_DEBUG
43         if(t -> tag != atc)
44                 fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
45 #endif /* UGEN_DEBUG */
46         return(& t -> Xgatctypel);
47 }
48
49 long *Rgatcline(t)
50  struct Satc *t;
51 {
52 #ifdef UGEN_DEBUG
53         if(t -> tag != atc)
54                 fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
55 #endif /* UGEN_DEBUG */
56         return(& t -> Xgatcline);
57 }