4 #include "yaccParser/ttype.h"
13 /************** tname ******************/
15 ttype mktname(PPgtypeid, PPgtypel)
19 register struct Stname *pp =
20 (struct Stname *) malloc(sizeof(struct Stname));
22 pp -> Xgtypeid = PPgtypeid;
23 pp -> Xgtypel = PPgtypel;
32 fprintf(stderr,"gtypeid: illegal selection; was %d\n", t -> tag);
33 #endif /* UGEN_DEBUG */
34 return(& t -> Xgtypeid);
42 fprintf(stderr,"gtypel: illegal selection; was %d\n", t -> tag);
43 #endif /* UGEN_DEBUG */
44 return(& t -> Xgtypel);
47 /************** namedtvar ******************/
49 ttype mknamedtvar(PPgnamedtvar)
52 register struct Snamedtvar *pp =
53 (struct Snamedtvar *) malloc(sizeof(struct Snamedtvar));
54 pp -> tag = namedtvar;
55 pp -> Xgnamedtvar = PPgnamedtvar;
63 if(t -> tag != namedtvar)
64 fprintf(stderr,"gnamedtvar: illegal selection; was %d\n", t -> tag);
65 #endif /* UGEN_DEBUG */
66 return(& t -> Xgnamedtvar);
69 /************** tllist ******************/
71 ttype mktllist(PPgtlist)
74 register struct Stllist *pp =
75 (struct Stllist *) malloc(sizeof(struct Stllist));
77 pp -> Xgtlist = PPgtlist;
85 if(t -> tag != tllist)
86 fprintf(stderr,"gtlist: illegal selection; was %d\n", t -> tag);
87 #endif /* UGEN_DEBUG */
88 return(& t -> Xgtlist);
91 /************** ttuple ******************/
93 ttype mkttuple(PPgttuple)
96 register struct Sttuple *pp =
97 (struct Sttuple *) malloc(sizeof(struct Sttuple));
99 pp -> Xgttuple = PPgttuple;
107 if(t -> tag != ttuple)
108 fprintf(stderr,"gttuple: illegal selection; was %d\n", t -> tag);
109 #endif /* UGEN_DEBUG */
110 return(& t -> Xgttuple);
113 /************** tfun ******************/
115 ttype mktfun(PPgtfun, PPgtarg)
119 register struct Stfun *pp =
120 (struct Stfun *) malloc(sizeof(struct Stfun));
122 pp -> Xgtfun = PPgtfun;
123 pp -> Xgtarg = PPgtarg;
132 fprintf(stderr,"gtfun: illegal selection; was %d\n", t -> tag);
133 #endif /* UGEN_DEBUG */
134 return(& t -> Xgtfun);
142 fprintf(stderr,"gtarg: illegal selection; was %d\n", t -> tag);
143 #endif /* UGEN_DEBUG */
144 return(& t -> Xgtarg);
147 /************** context ******************/
149 ttype mkcontext(PPgtcontextl, PPgtcontextt)
153 register struct Scontext *pp =
154 (struct Scontext *) malloc(sizeof(struct Scontext));
156 pp -> Xgtcontextl = PPgtcontextl;
157 pp -> Xgtcontextt = PPgtcontextt;
165 if(t -> tag != context)
166 fprintf(stderr,"gtcontextl: illegal selection; was %d\n", t -> tag);
167 #endif /* UGEN_DEBUG */
168 return(& t -> Xgtcontextl);
171 ttype *Rgtcontextt(t)
175 if(t -> tag != context)
176 fprintf(stderr,"gtcontextt: illegal selection; was %d\n", t -> tag);
177 #endif /* UGEN_DEBUG */
178 return(& t -> Xgtcontextt);
181 /************** unidict ******************/
183 ttype mkunidict(PPgunidict_clas, PPgunidict_ty)
184 unkId PPgunidict_clas;
187 register struct Sunidict *pp =
188 (struct Sunidict *) malloc(sizeof(struct Sunidict));
190 pp -> Xgunidict_clas = PPgunidict_clas;
191 pp -> Xgunidict_ty = PPgunidict_ty;
195 unkId *Rgunidict_clas(t)
199 if(t -> tag != unidict)
200 fprintf(stderr,"gunidict_clas: illegal selection; was %d\n", t -> tag);
201 #endif /* UGEN_DEBUG */
202 return(& t -> Xgunidict_clas);
205 ttype *Rgunidict_ty(t)
209 if(t -> tag != unidict)
210 fprintf(stderr,"gunidict_ty: illegal selection; was %d\n", t -> tag);
211 #endif /* UGEN_DEBUG */
212 return(& t -> Xgunidict_ty);
215 /************** unityvartemplate ******************/
217 ttype mkunityvartemplate(PPgunityvartemplate)
218 unkId PPgunityvartemplate;
220 register struct Sunityvartemplate *pp =
221 (struct Sunityvartemplate *) malloc(sizeof(struct Sunityvartemplate));
222 pp -> tag = unityvartemplate;
223 pp -> Xgunityvartemplate = PPgunityvartemplate;
227 unkId *Rgunityvartemplate(t)
228 struct Sunityvartemplate *t;
231 if(t -> tag != unityvartemplate)
232 fprintf(stderr,"gunityvartemplate: illegal selection; was %d\n", t -> tag);
233 #endif /* UGEN_DEBUG */
234 return(& t -> Xgunityvartemplate);
237 /************** uniforall ******************/
239 ttype mkuniforall(PPguniforall_tv, PPguniforall_ty)
240 list PPguniforall_tv;
241 ttype PPguniforall_ty;
243 register struct Suniforall *pp =
244 (struct Suniforall *) malloc(sizeof(struct Suniforall));
245 pp -> tag = uniforall;
246 pp -> Xguniforall_tv = PPguniforall_tv;
247 pp -> Xguniforall_ty = PPguniforall_ty;
251 list *Rguniforall_tv(t)
252 struct Suniforall *t;
255 if(t -> tag != uniforall)
256 fprintf(stderr,"guniforall_tv: illegal selection; was %d\n", t -> tag);
257 #endif /* UGEN_DEBUG */
258 return(& t -> Xguniforall_tv);
261 ttype *Rguniforall_ty(t)
262 struct Suniforall *t;
265 if(t -> tag != uniforall)
266 fprintf(stderr,"guniforall_ty: illegal selection; was %d\n", t -> tag);
267 #endif /* UGEN_DEBUG */
268 return(& t -> Xguniforall_ty);
271 /************** ty_maybe_nothing ******************/
273 ttype mkty_maybe_nothing()
275 register struct Sty_maybe_nothing *pp =
276 (struct Sty_maybe_nothing *) malloc(sizeof(struct Sty_maybe_nothing));
277 pp -> tag = ty_maybe_nothing;
281 /************** ty_maybe_just ******************/
283 ttype mkty_maybe_just(PPgty_maybe)
286 register struct Sty_maybe_just *pp =
287 (struct Sty_maybe_just *) malloc(sizeof(struct Sty_maybe_just));
288 pp -> tag = ty_maybe_just;
289 pp -> Xgty_maybe = PPgty_maybe;
294 struct Sty_maybe_just *t;
297 if(t -> tag != ty_maybe_just)
298 fprintf(stderr,"gty_maybe: illegal selection; was %d\n", t -> tag);
299 #endif /* UGEN_DEBUG */
300 return(& t -> Xgty_maybe);