4 #include "yaccParser/literal.h"
13 /************** integer ******************/
15 literal mkinteger(PPginteger)
18 register struct Sinteger *pp =
19 (struct Sinteger *) malloc(sizeof(struct Sinteger));
21 pp -> Xginteger = PPginteger;
25 stringId *Rginteger(t)
29 if(t -> tag != integer)
30 fprintf(stderr,"ginteger: illegal selection; was %d\n", t -> tag);
31 #endif /* UGEN_DEBUG */
32 return(& t -> Xginteger);
35 /************** intprim ******************/
37 literal mkintprim(PPgintprim)
40 register struct Sintprim *pp =
41 (struct Sintprim *) malloc(sizeof(struct Sintprim));
43 pp -> Xgintprim = PPgintprim;
47 stringId *Rgintprim(t)
51 if(t -> tag != intprim)
52 fprintf(stderr,"gintprim: illegal selection; was %d\n", t -> tag);
53 #endif /* UGEN_DEBUG */
54 return(& t -> Xgintprim);
57 /************** floatr ******************/
59 literal mkfloatr(PPgfloatr)
62 register struct Sfloatr *pp =
63 (struct Sfloatr *) malloc(sizeof(struct Sfloatr));
65 pp -> Xgfloatr = PPgfloatr;
73 if(t -> tag != floatr)
74 fprintf(stderr,"gfloatr: illegal selection; was %d\n", t -> tag);
75 #endif /* UGEN_DEBUG */
76 return(& t -> Xgfloatr);
79 /************** doubleprim ******************/
81 literal mkdoubleprim(PPgdoubleprim)
82 stringId PPgdoubleprim;
84 register struct Sdoubleprim *pp =
85 (struct Sdoubleprim *) malloc(sizeof(struct Sdoubleprim));
86 pp -> tag = doubleprim;
87 pp -> Xgdoubleprim = PPgdoubleprim;
91 stringId *Rgdoubleprim(t)
92 struct Sdoubleprim *t;
95 if(t -> tag != doubleprim)
96 fprintf(stderr,"gdoubleprim: illegal selection; was %d\n", t -> tag);
97 #endif /* UGEN_DEBUG */
98 return(& t -> Xgdoubleprim);
101 /************** floatprim ******************/
103 literal mkfloatprim(PPgfloatprim)
104 stringId PPgfloatprim;
106 register struct Sfloatprim *pp =
107 (struct Sfloatprim *) malloc(sizeof(struct Sfloatprim));
108 pp -> tag = floatprim;
109 pp -> Xgfloatprim = PPgfloatprim;
113 stringId *Rgfloatprim(t)
114 struct Sfloatprim *t;
117 if(t -> tag != floatprim)
118 fprintf(stderr,"gfloatprim: illegal selection; was %d\n", t -> tag);
119 #endif /* UGEN_DEBUG */
120 return(& t -> Xgfloatprim);
123 /************** charr ******************/
125 literal mkcharr(PPgchar)
128 register struct Scharr *pp =
129 (struct Scharr *) malloc(sizeof(struct Scharr));
131 pp -> Xgchar = PPgchar;
139 if(t -> tag != charr)
140 fprintf(stderr,"gchar: illegal selection; was %d\n", t -> tag);
141 #endif /* UGEN_DEBUG */
142 return(& t -> Xgchar);
145 /************** charprim ******************/
147 literal mkcharprim(PPgcharprim)
150 register struct Scharprim *pp =
151 (struct Scharprim *) malloc(sizeof(struct Scharprim));
152 pp -> tag = charprim;
153 pp -> Xgcharprim = PPgcharprim;
157 hstring *Rgcharprim(t)
161 if(t -> tag != charprim)
162 fprintf(stderr,"gcharprim: illegal selection; was %d\n", t -> tag);
163 #endif /* UGEN_DEBUG */
164 return(& t -> Xgcharprim);
167 /************** string ******************/
169 literal mkstring(PPgstring)
172 register struct Sstring *pp =
173 (struct Sstring *) malloc(sizeof(struct Sstring));
175 pp -> Xgstring = PPgstring;
183 if(t -> tag != string)
184 fprintf(stderr,"gstring: illegal selection; was %d\n", t -> tag);
185 #endif /* UGEN_DEBUG */
186 return(& t -> Xgstring);
189 /************** stringprim ******************/
191 literal mkstringprim(PPgstringprim)
192 hstring PPgstringprim;
194 register struct Sstringprim *pp =
195 (struct Sstringprim *) malloc(sizeof(struct Sstringprim));
196 pp -> tag = stringprim;
197 pp -> Xgstringprim = PPgstringprim;
201 hstring *Rgstringprim(t)
202 struct Sstringprim *t;
205 if(t -> tag != stringprim)
206 fprintf(stderr,"gstringprim: illegal selection; was %d\n", t -> tag);
207 #endif /* UGEN_DEBUG */
208 return(& t -> Xgstringprim);
211 /************** clitlit ******************/
213 literal mkclitlit(PPgclitlit, PPgclitlit_kind)
215 stringId PPgclitlit_kind;
217 register struct Sclitlit *pp =
218 (struct Sclitlit *) malloc(sizeof(struct Sclitlit));
220 pp -> Xgclitlit = PPgclitlit;
221 pp -> Xgclitlit_kind = PPgclitlit_kind;
225 stringId *Rgclitlit(t)
229 if(t -> tag != clitlit)
230 fprintf(stderr,"gclitlit: illegal selection; was %d\n", t -> tag);
231 #endif /* UGEN_DEBUG */
232 return(& t -> Xgclitlit);
235 stringId *Rgclitlit_kind(t)
239 if(t -> tag != clitlit)
240 fprintf(stderr,"gclitlit_kind: illegal selection; was %d\n", t -> tag);
241 #endif /* UGEN_DEBUG */
242 return(& t -> Xgclitlit_kind);
245 /************** norepi ******************/
247 literal mknorepi(PPgnorepi)
250 register struct Snorepi *pp =
251 (struct Snorepi *) malloc(sizeof(struct Snorepi));
253 pp -> Xgnorepi = PPgnorepi;
257 stringId *Rgnorepi(t)
261 if(t -> tag != norepi)
262 fprintf(stderr,"gnorepi: illegal selection; was %d\n", t -> tag);
263 #endif /* UGEN_DEBUG */
264 return(& t -> Xgnorepi);
267 /************** norepr ******************/
269 literal mknorepr(PPgnorepr_n, PPgnorepr_d)
270 stringId PPgnorepr_n;
271 stringId PPgnorepr_d;
273 register struct Snorepr *pp =
274 (struct Snorepr *) malloc(sizeof(struct Snorepr));
276 pp -> Xgnorepr_n = PPgnorepr_n;
277 pp -> Xgnorepr_d = PPgnorepr_d;
281 stringId *Rgnorepr_n(t)
285 if(t -> tag != norepr)
286 fprintf(stderr,"gnorepr_n: illegal selection; was %d\n", t -> tag);
287 #endif /* UGEN_DEBUG */
288 return(& t -> Xgnorepr_n);
291 stringId *Rgnorepr_d(t)
295 if(t -> tag != norepr)
296 fprintf(stderr,"gnorepr_d: illegal selection; was %d\n", t -> tag);
297 #endif /* UGEN_DEBUG */
298 return(& t -> Xgnorepr_d);
301 /************** noreps ******************/
303 literal mknoreps(PPgnoreps)
306 register struct Snoreps *pp =
307 (struct Snoreps *) malloc(sizeof(struct Snoreps));
309 pp -> Xgnoreps = PPgnoreps;
317 if(t -> tag != noreps)
318 fprintf(stderr,"gnoreps: illegal selection; was %d\n", t -> tag);
319 #endif /* UGEN_DEBUG */
320 return(& t -> Xgnoreps);