[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / entidt.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/entidt.h"
5
6 Tentidt tentidt(t)
7  entidt t;
8 {
9         return(t -> tag);
10 }
11
12
13 /************** entid ******************/
14
15 entidt mkentid(PPgentid)
16  stringId PPgentid;
17 {
18         register struct Sentid *pp =
19                 (struct Sentid *) malloc(sizeof(struct Sentid));
20         pp -> tag = entid;
21         pp -> Xgentid = PPgentid;
22         return((entidt)pp);
23 }
24
25 stringId *Rgentid(t)
26  struct Sentid *t;
27 {
28 #ifdef UGEN_DEBUG
29         if(t -> tag != entid)
30                 fprintf(stderr,"gentid: illegal selection; was %d\n", t -> tag);
31 #endif /* UGEN_DEBUG */
32         return(& t -> Xgentid);
33 }
34
35 /************** enttype ******************/
36
37 entidt mkenttype(PPgitentid)
38  stringId PPgitentid;
39 {
40         register struct Senttype *pp =
41                 (struct Senttype *) malloc(sizeof(struct Senttype));
42         pp -> tag = enttype;
43         pp -> Xgitentid = PPgitentid;
44         return((entidt)pp);
45 }
46
47 stringId *Rgitentid(t)
48  struct Senttype *t;
49 {
50 #ifdef UGEN_DEBUG
51         if(t -> tag != enttype)
52                 fprintf(stderr,"gitentid: illegal selection; was %d\n", t -> tag);
53 #endif /* UGEN_DEBUG */
54         return(& t -> Xgitentid);
55 }
56
57 /************** enttypeall ******************/
58
59 entidt mkenttypeall(PPgatentid)
60  stringId PPgatentid;
61 {
62         register struct Senttypeall *pp =
63                 (struct Senttypeall *) malloc(sizeof(struct Senttypeall));
64         pp -> tag = enttypeall;
65         pp -> Xgatentid = PPgatentid;
66         return((entidt)pp);
67 }
68
69 stringId *Rgatentid(t)
70  struct Senttypeall *t;
71 {
72 #ifdef UGEN_DEBUG
73         if(t -> tag != enttypeall)
74                 fprintf(stderr,"gatentid: illegal selection; was %d\n", t -> tag);
75 #endif /* UGEN_DEBUG */
76         return(& t -> Xgatentid);
77 }
78
79 /************** enttypecons ******************/
80
81 entidt mkenttypecons(PPgctentid, PPgctentcons)
82  stringId PPgctentid;
83  list PPgctentcons;
84 {
85         register struct Senttypecons *pp =
86                 (struct Senttypecons *) malloc(sizeof(struct Senttypecons));
87         pp -> tag = enttypecons;
88         pp -> Xgctentid = PPgctentid;
89         pp -> Xgctentcons = PPgctentcons;
90         return((entidt)pp);
91 }
92
93 stringId *Rgctentid(t)
94  struct Senttypecons *t;
95 {
96 #ifdef UGEN_DEBUG
97         if(t -> tag != enttypecons)
98                 fprintf(stderr,"gctentid: illegal selection; was %d\n", t -> tag);
99 #endif /* UGEN_DEBUG */
100         return(& t -> Xgctentid);
101 }
102
103 list *Rgctentcons(t)
104  struct Senttypecons *t;
105 {
106 #ifdef UGEN_DEBUG
107         if(t -> tag != enttypecons)
108                 fprintf(stderr,"gctentcons: illegal selection; was %d\n", t -> tag);
109 #endif /* UGEN_DEBUG */
110         return(& t -> Xgctentcons);
111 }
112
113 /************** entclass ******************/
114
115 entidt mkentclass(PPgcentid, PPgcentops)
116  stringId PPgcentid;
117  list PPgcentops;
118 {
119         register struct Sentclass *pp =
120                 (struct Sentclass *) malloc(sizeof(struct Sentclass));
121         pp -> tag = entclass;
122         pp -> Xgcentid = PPgcentid;
123         pp -> Xgcentops = PPgcentops;
124         return((entidt)pp);
125 }
126
127 stringId *Rgcentid(t)
128  struct Sentclass *t;
129 {
130 #ifdef UGEN_DEBUG
131         if(t -> tag != entclass)
132                 fprintf(stderr,"gcentid: illegal selection; was %d\n", t -> tag);
133 #endif /* UGEN_DEBUG */
134         return(& t -> Xgcentid);
135 }
136
137 list *Rgcentops(t)
138  struct Sentclass *t;
139 {
140 #ifdef UGEN_DEBUG
141         if(t -> tag != entclass)
142                 fprintf(stderr,"gcentops: illegal selection; was %d\n", t -> tag);
143 #endif /* UGEN_DEBUG */
144         return(& t -> Xgcentops);
145 }
146
147 /************** entmod ******************/
148
149 entidt mkentmod(PPgmentid)
150  stringId PPgmentid;
151 {
152         register struct Sentmod *pp =
153                 (struct Sentmod *) malloc(sizeof(struct Sentmod));
154         pp -> tag = entmod;
155         pp -> Xgmentid = PPgmentid;
156         return((entidt)pp);
157 }
158
159 stringId *Rgmentid(t)
160  struct Sentmod *t;
161 {
162 #ifdef UGEN_DEBUG
163         if(t -> tag != entmod)
164                 fprintf(stderr,"gmentid: illegal selection; was %d\n", t -> tag);
165 #endif /* UGEN_DEBUG */
166         return(& t -> Xgmentid);
167 }