expr.oxout.tab.c revision 1.3 1 1.3 christos /* $NetBSD: expr.oxout.tab.c,v 1.3 2018/12/23 15:38:54 christos Exp $ */
2 1.1 christos
3 1.1 christos /* original parser id follows */
4 1.1 christos /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
5 1.1 christos /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
6 1.1 christos
7 1.1 christos #define YYBYACC 1
8 1.1 christos #define YYMAJOR 1
9 1.1 christos #define YYMINOR 9
10 1.1 christos #define YYCHECK "yyyymmdd"
11 1.1 christos
12 1.1 christos #define YYEMPTY (-1)
13 1.1 christos #define yyclearin (yychar = YYEMPTY)
14 1.1 christos #define yyerrok (yyerrflag = 0)
15 1.1 christos #define YYRECOVERING() (yyerrflag != 0)
16 1.1 christos #define YYENOMEM (-2)
17 1.1 christos #define YYEOF 0
18 1.1 christos
19 1.1 christos #ifndef yyparse
20 1.1 christos #define yyparse expr.oxout_parse
21 1.1 christos #endif /* yyparse */
22 1.1 christos
23 1.1 christos #ifndef yylex
24 1.1 christos #define yylex expr.oxout_lex
25 1.1 christos #endif /* yylex */
26 1.1 christos
27 1.1 christos #ifndef yyerror
28 1.1 christos #define yyerror expr.oxout_error
29 1.1 christos #endif /* yyerror */
30 1.1 christos
31 1.1 christos #ifndef yychar
32 1.1 christos #define yychar expr.oxout_char
33 1.1 christos #endif /* yychar */
34 1.1 christos
35 1.1 christos #ifndef yyval
36 1.1 christos #define yyval expr.oxout_val
37 1.1 christos #endif /* yyval */
38 1.1 christos
39 1.1 christos #ifndef yylval
40 1.1 christos #define yylval expr.oxout_lval
41 1.1 christos #endif /* yylval */
42 1.1 christos
43 1.1 christos #ifndef yydebug
44 1.1 christos #define yydebug expr.oxout_debug
45 1.1 christos #endif /* yydebug */
46 1.1 christos
47 1.1 christos #ifndef yynerrs
48 1.1 christos #define yynerrs expr.oxout_nerrs
49 1.1 christos #endif /* yynerrs */
50 1.1 christos
51 1.1 christos #ifndef yyerrflag
52 1.1 christos #define yyerrflag expr.oxout_errflag
53 1.1 christos #endif /* yyerrflag */
54 1.1 christos
55 1.1 christos #ifndef yylhs
56 1.1 christos #define yylhs expr.oxout_lhs
57 1.1 christos #endif /* yylhs */
58 1.1 christos
59 1.1 christos #ifndef yylen
60 1.1 christos #define yylen expr.oxout_len
61 1.1 christos #endif /* yylen */
62 1.1 christos
63 1.1 christos #ifndef yydefred
64 1.1 christos #define yydefred expr.oxout_defred
65 1.1 christos #endif /* yydefred */
66 1.1 christos
67 1.1 christos #ifndef yydgoto
68 1.1 christos #define yydgoto expr.oxout_dgoto
69 1.1 christos #endif /* yydgoto */
70 1.1 christos
71 1.1 christos #ifndef yysindex
72 1.1 christos #define yysindex expr.oxout_sindex
73 1.1 christos #endif /* yysindex */
74 1.1 christos
75 1.1 christos #ifndef yyrindex
76 1.1 christos #define yyrindex expr.oxout_rindex
77 1.1 christos #endif /* yyrindex */
78 1.1 christos
79 1.1 christos #ifndef yygindex
80 1.1 christos #define yygindex expr.oxout_gindex
81 1.1 christos #endif /* yygindex */
82 1.1 christos
83 1.1 christos #ifndef yytable
84 1.1 christos #define yytable expr.oxout_table
85 1.1 christos #endif /* yytable */
86 1.1 christos
87 1.1 christos #ifndef yycheck
88 1.1 christos #define yycheck expr.oxout_check
89 1.1 christos #endif /* yycheck */
90 1.1 christos
91 1.1 christos #ifndef yyname
92 1.1 christos #define yyname expr.oxout_name
93 1.1 christos #endif /* yyname */
94 1.1 christos
95 1.1 christos #ifndef yyrule
96 1.1 christos #define yyrule expr.oxout_rule
97 1.1 christos #endif /* yyrule */
98 1.1 christos #define YYPREFIX "expr.oxout_"
99 1.1 christos
100 1.1 christos #define YYPURE 0
101 1.1 christos
102 1.1 christos #line 5 "expr.oxout.y"
103 1.1 christos #include <stdlib.h>
104 1.1 christos #include <string.h>
105 1.1 christos #line 8 "expr.Y"
106 1.1 christos
107 1.1 christos #include "expr.oxout.h"
108 1.1 christos #include <stdio.h>
109 1.1 christos
110 1.1 christos extern int yylex(void);
111 1.1 christos extern void yyerror(const char *);
112 1.1 christos #line 27 "expr.oxout.y"
113 1.1 christos #include <limits.h>
114 1.1 christos #define yyyR USHRT_MAX
115 1.1 christos #ifdef YYSTYPE
116 1.1 christos #undef YYSTYPE_IS_DECLARED
117 1.1 christos #define YYSTYPE_IS_DECLARED 1
118 1.1 christos #endif
119 1.1 christos #ifndef YYSTYPE_IS_DECLARED
120 1.1 christos #define YYSTYPE_IS_DECLARED 1
121 1.1 christos #line 31 "expr.oxout.y"
122 1.1 christos typedef union {
123 1.1 christos struct yyyOxAttrbs {
124 1.1 christos struct yyyStackItem *yyyOxStackItem;
125 1.1 christos } yyyOxAttrbs;
126 1.1 christos } YYSTYPE;
127 1.1 christos #endif /* !YYSTYPE_IS_DECLARED */
128 1.1 christos #line 38 "expr.oxout.y"
129 1.1 christos #include <stdio.h>
130 1.1 christos #include <stdarg.h>
131 1.1 christos
132 1.1 christos static int yyyYok = 1;
133 1.1 christos
134 1.1 christos extern yyyFT yyyRCIL[];
135 1.1 christos
136 1.1 christos void yyyExecuteRRsection(yyyGNT *rootNode);
137 1.1 christos void yyyYoxInit(void);
138 1.1 christos void yyyDecorate(void);
139 1.1 christos struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */
140 1.1 christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...);
141 1.1 christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...);
142 1.1 christos void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum);
143 1.1 christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode);
144 1.1 christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode);
145 1.1 christos void yyyabort(void);
146 1.1 christos
147 1.1 christos #line 146 "expr.oxout.tab.c"
148 1.1 christos
149 1.1 christos /* compatibility with bison */
150 1.1 christos #ifdef YYPARSE_PARAM
151 1.1 christos /* compatibility with FreeBSD */
152 1.1 christos # ifdef YYPARSE_PARAM_TYPE
153 1.1 christos # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
154 1.1 christos # else
155 1.1 christos # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
156 1.1 christos # endif
157 1.1 christos #else
158 1.1 christos # define YYPARSE_DECL() yyparse(void)
159 1.1 christos #endif
160 1.1 christos
161 1.1 christos /* Parameters sent to lex. */
162 1.1 christos #ifdef YYLEX_PARAM
163 1.1 christos # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
164 1.1 christos # define YYLEX yylex(YYLEX_PARAM)
165 1.1 christos #else
166 1.1 christos # define YYLEX_DECL() yylex(void)
167 1.1 christos # define YYLEX yylex()
168 1.1 christos #endif
169 1.1 christos
170 1.1 christos /* Parameters sent to yyerror. */
171 1.1 christos #ifndef YYERROR_DECL
172 1.1 christos #define YYERROR_DECL() yyerror(const char *s)
173 1.1 christos #endif
174 1.1 christos #ifndef YYERROR_CALL
175 1.1 christos #define YYERROR_CALL(msg) yyerror(msg)
176 1.1 christos #endif
177 1.1 christos
178 1.1 christos extern int YYPARSE_DECL();
179 1.1 christos
180 1.1 christos #define ID 257
181 1.1 christos #define CONST 258
182 1.1 christos #define YYERRCODE 256
183 1.1 christos typedef short YYINT;
184 1.1 christos static const YYINT expr.oxout_lhs[] = { -1,
185 1.1 christos 2, 0, 1, 3, 3, 3, 3, 3, 3, 3,
186 1.1 christos };
187 1.1 christos static const YYINT expr.oxout_len[] = { 2,
188 1.1 christos 0, 2, 1, 3, 3, 3, 3, 3, 1, 1,
189 1.1 christos };
190 1.1 christos static const YYINT expr.oxout_defred[] = { 1,
191 1.1 christos 0, 0, 9, 10, 0, 2, 0, 0, 0, 0,
192 1.1 christos 0, 0, 8, 0, 0, 4, 0,
193 1.1 christos };
194 1.1 christos static const YYINT expr.oxout_dgoto[] = { 1,
195 1.1 christos 6, 2, 7,
196 1.1 christos };
197 1.1 christos static const YYINT expr.oxout_sindex[] = { 0,
198 1.1 christos 0, -40, 0, 0, -40, 0, -18, -24, -40, -40,
199 1.1 christos -40, -40, 0, -37, -37, 0, -39,
200 1.1 christos };
201 1.1 christos static const YYINT expr.oxout_rindex[] = { 0,
202 1.1 christos 0, 0, 0, 0, 0, 0, 6, 0, 0, 0,
203 1.1 christos 0, 0, 0, 2, 8, 0, 1,
204 1.1 christos };
205 1.1 christos static const YYINT expr.oxout_gindex[] = { 0,
206 1.1 christos 0, 0, 4,
207 1.1 christos };
208 1.1 christos #define YYTABLESIZE 218
209 1.1 christos static const YYINT expr.oxout_table[] = { 5,
210 1.1 christos 6, 5, 11, 0, 11, 3, 0, 7, 8, 12,
211 1.1 christos 0, 0, 14, 15, 16, 17, 13, 11, 9, 0,
212 1.1 christos 10, 0, 12, 11, 9, 0, 10, 0, 12, 0,
213 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
214 1.1 christos 0, 6, 5, 6, 5, 6, 5, 6, 7, 0,
215 1.1 christos 7, 0, 7, 0, 0, 0, 0, 0, 0, 0,
216 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
217 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
218 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
219 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
220 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
221 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
222 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
225 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
226 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
227 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
230 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
231 1.1 christos 0, 0, 0, 0, 0, 0, 3, 4,
232 1.1 christos };
233 1.1 christos static const YYINT expr.oxout_check[] = { 40,
234 1.1 christos 0, 0, 42, -1, 42, 0, -1, 0, 5, 47,
235 1.1 christos -1, -1, 9, 10, 11, 12, 41, 42, 43, -1,
236 1.1 christos 45, -1, 47, 42, 43, -1, 45, -1, 47, -1,
237 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
238 1.1 christos -1, 41, 41, 43, 43, 45, 45, 47, 41, -1,
239 1.1 christos 43, -1, 45, -1, -1, -1, -1, -1, -1, -1,
240 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
241 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
242 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
243 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
244 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
245 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
246 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
247 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
248 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
249 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
250 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
251 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
252 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
253 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
254 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
255 1.1 christos -1, -1, -1, -1, -1, -1, 257, 258,
256 1.1 christos };
257 1.1 christos #define YYFINAL 1
258 1.1 christos #ifndef YYDEBUG
259 1.1 christos #define YYDEBUG 0
260 1.1 christos #endif
261 1.1 christos #define YYMAXTOKEN 258
262 1.1 christos #define YYUNDFTOKEN 264
263 1.1 christos #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
264 1.1 christos #if YYDEBUG
265 1.1 christos static const char *const expr.oxout_name[] = {
266 1.1 christos
267 1.1 christos "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
268 1.1 christos 0,0,0,0,0,0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,
269 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
270 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
271 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
272 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
273 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"ID",
274 1.1 christos "CONST",0,0,0,0,0,"illegal-symbol",
275 1.1 christos };
276 1.1 christos static const char *const expr.oxout_rule[] = {
277 1.1 christos "$accept : yyyAugNonterm",
278 1.1 christos "$$1 :",
279 1.1 christos "yyyAugNonterm : $$1 s",
280 1.1 christos "s : expr",
281 1.1 christos "expr : expr '*' expr",
282 1.1 christos "expr : expr '+' expr",
283 1.1 christos "expr : expr '/' expr",
284 1.1 christos "expr : expr '-' expr",
285 1.1 christos "expr : '(' expr ')'",
286 1.1 christos "expr : ID",
287 1.1 christos "expr : CONST",
288 1.1 christos
289 1.1 christos };
290 1.1 christos #endif
291 1.1 christos
292 1.3 christos #if YYDEBUG
293 1.1 christos int yydebug;
294 1.3 christos #endif
295 1.1 christos
296 1.1 christos int yyerrflag;
297 1.1 christos int yychar;
298 1.1 christos YYSTYPE yyval;
299 1.1 christos YYSTYPE yylval;
300 1.3 christos int yynerrs;
301 1.1 christos
302 1.1 christos /* define the initial stack-sizes */
303 1.1 christos #ifdef YYSTACKSIZE
304 1.1 christos #undef YYMAXDEPTH
305 1.1 christos #define YYMAXDEPTH YYSTACKSIZE
306 1.1 christos #else
307 1.1 christos #ifdef YYMAXDEPTH
308 1.1 christos #define YYSTACKSIZE YYMAXDEPTH
309 1.1 christos #else
310 1.1 christos #define YYSTACKSIZE 10000
311 1.1 christos #define YYMAXDEPTH 10000
312 1.1 christos #endif
313 1.1 christos #endif
314 1.1 christos
315 1.1 christos #define YYINITSTACKSIZE 200
316 1.1 christos
317 1.1 christos typedef struct {
318 1.1 christos unsigned stacksize;
319 1.1 christos YYINT *s_base;
320 1.1 christos YYINT *s_mark;
321 1.1 christos YYINT *s_last;
322 1.1 christos YYSTYPE *l_base;
323 1.1 christos YYSTYPE *l_mark;
324 1.1 christos } YYSTACKDATA;
325 1.1 christos /* variables for the parser stack */
326 1.1 christos static YYSTACKDATA yystack;
327 1.1 christos #line 53 "expr.Y"
328 1.1 christos
329 1.1 christos
330 1.1 christos int yyparse(void);
331 1.1 christos
332 1.1 christos int main()
333 1.1 christos {yyparse();
334 1.1 christos }
335 1.1 christos
336 1.1 christos
337 1.1 christos
338 1.1 christos #line 138 "expr.oxout.y"
339 1.1 christos long yyySSALspaceSize = 20000;
340 1.1 christos long yyyRSmaxSize = 1000;
341 1.1 christos long yyyTravStackMaxSize = 2000;
342 1.1 christos
343 1.1 christos struct yyySolvedSAlistCell {yyyWAT attrbNum;
344 1.1 christos long next;
345 1.1 christos };
346 1.1 christos
347 1.1 christos #define yyyLambdaSSAL 0
348 1.1 christos long yyySSALCfreeList = yyyLambdaSSAL;
349 1.1 christos long yyyNewSSALC = 1;
350 1.1 christos
351 1.1 christos struct yyySolvedSAlistCell *yyySSALspace;
352 1.1 christos
353 1.1 christos long yyyNbytesStackStg;
354 1.1 christos
355 1.1 christos
356 1.1 christos
357 1.1 christos yyyFT yyyRCIL[1];
358 1.1 christos
359 1.1 christos short yyyIIIEL[] = {0,
360 1.1 christos 0,2,6,10,14,18,22,24,
361 1.1 christos };
362 1.1 christos
363 1.1 christos long yyyIIEL[] = {
364 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,
365 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0,
366 1.1 christos 1,1,
367 1.1 christos };
368 1.1 christos
369 1.1 christos long yyyIEL[] = {
370 1.1 christos 0,0,0,
371 1.1 christos };
372 1.1 christos
373 1.1 christos yyyFT yyyEntL[1];
374 1.1 christos
375 1.1 christos void yyyfatal(char *msg)
376 1.1 christos {fputs(msg,stderr);exit(-1);}
377 1.1 christos
378 1.1 christos
379 1.1 christos
380 1.1 christos #define yyySSALof 'S'
381 1.1 christos #define yyyRSof 'q'
382 1.1 christos #define yyyTSof 't'
383 1.1 christos
384 1.1 christos
385 1.1 christos
386 1.1 christos void yyyHandleOverflow(char which)
387 1.1 christos {char *msg1,*msg2;
388 1.1 christos long oldSize,newSize;
389 1.1 christos switch(which)
390 1.1 christos {
391 1.1 christos case yyySSALof :
392 1.1 christos msg1 = "SSAL overflow: ";
393 1.1 christos oldSize = yyySSALspaceSize;
394 1.1 christos break;
395 1.1 christos case yyyRSof :
396 1.1 christos msg1 = "ready set overflow: ";
397 1.1 christos oldSize = yyyRSmaxSize;
398 1.1 christos break;
399 1.1 christos case yyyTSof :
400 1.1 christos msg1 = "traversal stack overflow: ";
401 1.1 christos oldSize = yyyTravStackMaxSize;
402 1.1 christos break;
403 1.1 christos default :;
404 1.1 christos }
405 1.1 christos newSize = (3*oldSize)/2;
406 1.1 christos if (newSize < 100) newSize = 100;
407 1.1 christos fputs(msg1,stderr);
408 1.1 christos fprintf(stderr,"size was %ld.\n",oldSize);
409 1.1 christos msg2 = " Have to modify evaluator: -Y%c%ld.\n";
410 1.1 christos fprintf(stderr,msg2,which,newSize);
411 1.1 christos exit(-1);
412 1.1 christos }
413 1.1 christos
414 1.1 christos
415 1.1 christos
416 1.1 christos void yyySignalEnts(yyyGNT *node,long startP,long stopP)
417 1.1 christos {yyyGNT *dumNode;
418 1.1 christos
419 1.1 christos while (startP < stopP)
420 1.1 christos {
421 1.1 christos if (!yyyEntL[startP]) dumNode = node;
422 1.1 christos else dumNode = (node->cL)[yyyEntL[startP]-1];
423 1.1 christos if (!(--((dumNode->refCountList)[yyyEntL[startP+1]]
424 1.1 christos )
425 1.1 christos )
426 1.1 christos )
427 1.1 christos {
428 1.1 christos if (++yyyRSTop == yyyAfterRS)
429 1.1 christos {yyyHandleOverflow(yyyRSof);
430 1.1 christos break;
431 1.1 christos }
432 1.1 christos yyyRSTop->node = dumNode;
433 1.1 christos yyyRSTop->whichSym = yyyEntL[startP];
434 1.1 christos yyyRSTop->wa = yyyEntL[startP+1];
435 1.1 christos }
436 1.1 christos startP += 2;
437 1.1 christos }
438 1.1 christos }
439 1.1 christos
440 1.1 christos
441 1.1 christos
442 1.1 christos
443 1.1 christos
444 1.1 christos
445 1.1 christos void yyySolveAndSignal() {
446 1.1 christos long yyyiDum,*yyypL;
447 1.1 christos int yyyws,yyywa;
448 1.1 christos yyyGNT *yyyRSTopN,*yyyRefN;
449 1.1 christos yyyParent yyyRSTopNp;
450 1.1 christos
451 1.1 christos
452 1.1 christos yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent;
453 1.1 christos yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN;
454 1.1 christos yyywa = yyyRSTop->wa;
455 1.1 christos yyyRSTop--;
456 1.1 christos switch(yyyRefN->prodNum) {
457 1.1 christos case 1: /***yacc rule 1***/
458 1.1 christos switch (yyyws) {
459 1.1 christos }
460 1.1 christos break;
461 1.1 christos case 2: /***yacc rule 2***/
462 1.1 christos switch (yyyws) {
463 1.1 christos }
464 1.1 christos break;
465 1.1 christos case 3: /***yacc rule 3***/
466 1.1 christos switch (yyyws) {
467 1.1 christos }
468 1.1 christos break;
469 1.1 christos case 4: /***yacc rule 4***/
470 1.1 christos switch (yyyws) {
471 1.1 christos }
472 1.1 christos break;
473 1.1 christos case 5: /***yacc rule 5***/
474 1.1 christos switch (yyyws) {
475 1.1 christos }
476 1.1 christos break;
477 1.1 christos case 6: /***yacc rule 6***/
478 1.1 christos switch (yyyws) {
479 1.1 christos }
480 1.1 christos break;
481 1.1 christos case 7: /***yacc rule 7***/
482 1.1 christos switch (yyyws) {
483 1.1 christos case 1: /**/
484 1.1 christos switch (yyywa) {
485 1.1 christos }
486 1.1 christos break;
487 1.1 christos }
488 1.1 christos break;
489 1.1 christos case 8: /***yacc rule 8***/
490 1.1 christos switch (yyyws) {
491 1.1 christos case 1: /**/
492 1.1 christos switch (yyywa) {
493 1.1 christos }
494 1.1 christos break;
495 1.1 christos }
496 1.1 christos break;
497 1.1 christos } /* switch */
498 1.1 christos
499 1.1 christos if (yyyws) /* the just-solved instance was inherited. */
500 1.1 christos {if (yyyRSTopN->prodNum)
501 1.1 christos {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa;
502 1.1 christos yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum],
503 1.1 christos yyyIEL[yyyiDum+1]
504 1.1 christos );
505 1.1 christos }
506 1.1 christos }
507 1.1 christos else /* the just-solved instance was synthesized. */
508 1.1 christos {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */
509 1.1 christos {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] +
510 1.1 christos yyyRSTopN->whichSym
511 1.1 christos ] +
512 1.1 christos yyywa;
513 1.1 christos yyySignalEnts(yyyRSTopNp.noderef,
514 1.1 christos yyyIEL[yyyiDum],
515 1.1 christos yyyIEL[yyyiDum+1]
516 1.1 christos );
517 1.1 christos }
518 1.1 christos else /* node is still on the stack--it has no parent yet. */
519 1.1 christos {yyypL = &(yyyRSTopNp.stackref->solvedSAlist);
520 1.1 christos if (yyySSALCfreeList == yyyLambdaSSAL)
521 1.1 christos {yyySSALspace[yyyNewSSALC].next = *yyypL;
522 1.1 christos if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize)
523 1.1 christos yyyHandleOverflow(yyySSALof);
524 1.1 christos }
525 1.1 christos else
526 1.1 christos {yyyiDum = yyySSALCfreeList;
527 1.1 christos yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next;
528 1.1 christos yyySSALspace[yyyiDum].next = *yyypL;
529 1.1 christos *yyypL = yyyiDum;
530 1.1 christos }
531 1.1 christos yyySSALspace[*yyypL].attrbNum = yyywa;
532 1.1 christos }
533 1.1 christos }
534 1.1 christos
535 1.1 christos } /* yyySolveAndSignal */
536 1.1 christos
537 1.1 christos
538 1.1 christos
539 1.1 christos
540 1.1 christos
541 1.1 christos
542 1.1 christos #define condStg unsigned int conds;
543 1.1 christos #define yyyClearConds {yyyTST->conds = 0;}
544 1.1 christos #define yyySetCond(n) {yyyTST->conds += (1<<(n));}
545 1.1 christos #define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0)
546 1.1 christos
547 1.1 christos
548 1.1 christos
549 1.1 christos struct yyyTravStackItem {yyyGNT *node;
550 1.1 christos char isReady;
551 1.1 christos condStg
552 1.1 christos };
553 1.1 christos
554 1.1 christos
555 1.1 christos
556 1.1 christos void yyyDoTraversals(yyyGNT *rootNode)
557 1.1 christos {struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack;
558 1.1 christos yyyGNT *yyyTSTn,**yyyCLptr2;
559 1.1 christos int yyyi,yyyRL,yyyPass;
560 1.1 christos int i;
561 1.1 christos
562 1.1 christos if (!yyyYok) return;
563 1.1 christos if ((yyyTravStack =
564 1.1 christos ((struct yyyTravStackItem *)
565 1.1 christos calloc((size_t)yyyTravStackMaxSize,
566 1.1 christos (size_t)sizeof(struct yyyTravStackItem)
567 1.1 christos )
568 1.1 christos )
569 1.1 christos )
570 1.1 christos ==
571 1.1 christos (struct yyyTravStackItem *)NULL
572 1.1 christos )
573 1.1 christos {fputs("malloc error in traversal stack allocation\n",stderr);
574 1.1 christos exit(-1);
575 1.1 christos }
576 1.1 christos
577 1.1 christos yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize;
578 1.1 christos yyyTravStack++;
579 1.1 christos
580 1.1 christos
581 1.1 christos for (yyyi=0; yyyi<2; yyyi++) {
582 1.1 christos yyyTST = yyyTravStack;
583 1.1 christos yyyTST->node = rootNode;
584 1.1 christos yyyTST->isReady = 0;
585 1.1 christos yyyClearConds
586 1.1 christos
587 1.1 christos while(yyyTST >= yyyTravStack)
588 1.1 christos {yyyTSTn = yyyTST->node;
589 1.1 christos if (yyyTST->isReady)
590 1.1 christos {yyyPass = 1;
591 1.1 christos goto yyyTravSwitch;
592 1.1 christos yyyTpop:
593 1.1 christos yyyTST--;
594 1.1 christos }
595 1.1 christos else
596 1.1 christos {yyyPass = 0;
597 1.1 christos goto yyyTravSwitch;
598 1.1 christos yyyTpush:
599 1.1 christos yyyTST->isReady = 1;
600 1.1 christos if (yyyTSTn->prodNum)
601 1.1 christos {if (yyyRL)
602 1.1 christos {yyyCLptr2 = yyyTSTn->cL;
603 1.1 christos i = yyyTSTn->cLlen;
604 1.1 christos while (i--)
605 1.1 christos {if (++yyyTST == yyyAfterTravStack)
606 1.1 christos yyyHandleOverflow(yyyTSof);
607 1.1 christos else
608 1.1 christos {yyyTST->node = *yyyCLptr2;
609 1.1 christos yyyTST->isReady = 0;
610 1.1 christos yyyClearConds
611 1.1 christos }
612 1.1 christos yyyCLptr2++;
613 1.1 christos }
614 1.1 christos } /* right to left */
615 1.1 christos else /* left to right */
616 1.1 christos {i = yyyTSTn->cLlen;
617 1.1 christos yyyCLptr2 = yyyTSTn->cL + i;
618 1.1 christos while (i--)
619 1.1 christos {yyyCLptr2--;
620 1.1 christos if (++yyyTST == yyyAfterTravStack)
621 1.1 christos yyyHandleOverflow(yyyTSof);
622 1.1 christos else
623 1.1 christos {yyyTST->node = *yyyCLptr2;
624 1.1 christos yyyTST->isReady = 0;
625 1.1 christos yyyClearConds
626 1.1 christos }
627 1.1 christos }
628 1.1 christos } /* left to right */
629 1.1 christos }
630 1.1 christos } /* else */
631 1.1 christos continue;
632 1.1 christos yyyTravSwitch:
633 1.1 christos switch(yyyTSTn->prodNum) {
634 1.1 christos case 1:
635 1.1 christos switch(yyyi) {
636 1.1 christos case 0:
637 1.1 christos switch(yyyPass) {
638 1.1 christos case 0:
639 1.1 christos yyyRL = 0;yyySetCond(0)
640 1.1 christos
641 1.1 christos if (!
642 1.1 christos #line 24 "expr.Y"
643 1.1 christos (1)
644 1.1 christos #line 444 "expr.oxout.y"
645 1.1 christos ) yyySetCond(1)
646 1.1 christos yyySetCond(2)
647 1.1 christos
648 1.1 christos case 1:
649 1.1 christos
650 1.1 christos if (yyyCond(0) != yyyPass) {
651 1.1 christos #line 24 "expr.Y"
652 1.1 christos
653 1.1 christos #line 453 "expr.oxout.y"
654 1.1 christos }
655 1.1 christos if (yyyCond(1) != yyyPass) {
656 1.1 christos #line 24 "expr.Y"
657 1.1 christos printf("\n");
658 1.1 christos
659 1.1 christos #line 459 "expr.oxout.y"
660 1.1 christos }
661 1.1 christos if (yyyCond(2) != yyyPass) {
662 1.1 christos #line 25 "expr.Y"
663 1.1 christos printf("prefix: ");
664 1.1 christos
665 1.1 christos #line 465 "expr.oxout.y"
666 1.1 christos }
667 1.1 christos break;
668 1.1 christos }
669 1.1 christos break;
670 1.1 christos case 1:
671 1.1 christos switch(yyyPass) {
672 1.1 christos case 0:
673 1.1 christos yyyRL = 0;
674 1.1 christos if (
675 1.1 christos #line 23 "expr.Y"
676 1.1 christos (1)
677 1.1 christos #line 477 "expr.oxout.y"
678 1.1 christos ) yyySetCond(2)
679 1.1 christos
680 1.1 christos case 1:
681 1.1 christos
682 1.1 christos if (yyyCond(0) != yyyPass) {
683 1.1 christos #line 22 "expr.Y"
684 1.1 christos printf("\n");
685 1.1 christos
686 1.1 christos #line 486 "expr.oxout.y"
687 1.1 christos }
688 1.1 christos if (yyyCond(1) != yyyPass) {
689 1.1 christos #line 23 "expr.Y"
690 1.1 christos
691 1.1 christos #line 491 "expr.oxout.y"
692 1.1 christos }
693 1.1 christos if (yyyCond(2) != yyyPass) {
694 1.1 christos #line 23 "expr.Y"
695 1.1 christos printf("postfix: ")/* missing ; */
696 1.1 christos
697 1.1 christos #line 497 "expr.oxout.y"
698 1.1 christos }
699 1.1 christos break;
700 1.1 christos }
701 1.1 christos break;
702 1.1 christos }
703 1.1 christos
704 1.1 christos break;
705 1.1 christos case 2:
706 1.1 christos switch(yyyi) {
707 1.1 christos case 0:
708 1.1 christos switch(yyyPass) {
709 1.1 christos case 0:
710 1.1 christos yyyRL = 0;yyySetCond(0)
711 1.1 christos
712 1.1 christos case 1:
713 1.1 christos
714 1.1 christos if (yyyCond(0) != yyyPass) {
715 1.1 christos #line 29 "expr.Y"
716 1.1 christos printf(" * ");
717 1.1 christos
718 1.1 christos #line 518 "expr.oxout.y"
719 1.1 christos }
720 1.1 christos break;
721 1.1 christos }
722 1.1 christos break;
723 1.1 christos case 1:
724 1.1 christos switch(yyyPass) {
725 1.1 christos case 0:
726 1.1 christos yyyRL = 0;
727 1.1 christos case 1:
728 1.1 christos
729 1.1 christos if (yyyCond(0) != yyyPass) {
730 1.1 christos #line 28 "expr.Y"
731 1.1 christos printf(" * ");
732 1.1 christos
733 1.1 christos #line 533 "expr.oxout.y"
734 1.1 christos }
735 1.1 christos break;
736 1.1 christos }
737 1.1 christos break;
738 1.1 christos }
739 1.1 christos
740 1.1 christos break;
741 1.1 christos case 3:
742 1.1 christos switch(yyyi) {
743 1.1 christos case 0:
744 1.1 christos switch(yyyPass) {
745 1.1 christos case 0:
746 1.1 christos yyyRL = 0;yyySetCond(0)
747 1.1 christos
748 1.1 christos case 1:
749 1.1 christos
750 1.1 christos if (yyyCond(0) != yyyPass) {
751 1.1 christos #line 32 "expr.Y"
752 1.1 christos printf(" + ");
753 1.1 christos
754 1.1 christos #line 554 "expr.oxout.y"
755 1.1 christos }
756 1.1 christos break;
757 1.1 christos }
758 1.1 christos break;
759 1.1 christos case 1:
760 1.1 christos switch(yyyPass) {
761 1.1 christos case 0:
762 1.1 christos yyyRL = 0;
763 1.1 christos case 1:
764 1.1 christos
765 1.1 christos if (yyyCond(0) != yyyPass) {
766 1.1 christos #line 33 "expr.Y"
767 1.1 christos printf(" + ");
768 1.1 christos
769 1.1 christos #line 569 "expr.oxout.y"
770 1.1 christos }
771 1.1 christos break;
772 1.1 christos }
773 1.1 christos break;
774 1.1 christos }
775 1.1 christos
776 1.1 christos break;
777 1.1 christos case 4:
778 1.1 christos switch(yyyi) {
779 1.1 christos case 0:
780 1.1 christos switch(yyyPass) {
781 1.1 christos case 0:
782 1.1 christos yyyRL = 0;yyySetCond(0)
783 1.1 christos
784 1.1 christos case 1:
785 1.1 christos
786 1.1 christos if (yyyCond(0) != yyyPass) {
787 1.1 christos #line 37 "expr.Y"
788 1.1 christos printf(" / ");
789 1.1 christos
790 1.1 christos #line 590 "expr.oxout.y"
791 1.1 christos }
792 1.1 christos break;
793 1.1 christos }
794 1.1 christos break;
795 1.1 christos case 1:
796 1.1 christos switch(yyyPass) {
797 1.1 christos case 0:
798 1.1 christos yyyRL = 0;
799 1.1 christos case 1:
800 1.1 christos
801 1.1 christos if (yyyCond(0) != yyyPass) {
802 1.1 christos #line 36 "expr.Y"
803 1.1 christos printf(" / ");
804 1.1 christos
805 1.1 christos #line 605 "expr.oxout.y"
806 1.1 christos }
807 1.1 christos break;
808 1.1 christos }
809 1.1 christos break;
810 1.1 christos }
811 1.1 christos
812 1.1 christos break;
813 1.1 christos case 5:
814 1.1 christos switch(yyyi) {
815 1.1 christos case 0:
816 1.1 christos switch(yyyPass) {
817 1.1 christos case 0:
818 1.1 christos yyyRL = 0;yyySetCond(0)
819 1.1 christos
820 1.1 christos case 1:
821 1.1 christos
822 1.1 christos if (yyyCond(0) != yyyPass) {
823 1.1 christos #line 41 "expr.Y"
824 1.1 christos printf(" - ");
825 1.1 christos
826 1.1 christos #line 626 "expr.oxout.y"
827 1.1 christos }
828 1.1 christos break;
829 1.1 christos }
830 1.1 christos break;
831 1.1 christos case 1:
832 1.1 christos switch(yyyPass) {
833 1.1 christos case 0:
834 1.1 christos yyyRL = 0;
835 1.1 christos case 1:
836 1.1 christos
837 1.1 christos if (yyyCond(0) != yyyPass) {
838 1.1 christos #line 40 "expr.Y"
839 1.1 christos printf(" - ");
840 1.1 christos
841 1.1 christos #line 641 "expr.oxout.y"
842 1.1 christos }
843 1.1 christos break;
844 1.1 christos }
845 1.1 christos break;
846 1.1 christos }
847 1.1 christos
848 1.1 christos break;
849 1.1 christos case 6:
850 1.1 christos switch(yyyi) {
851 1.1 christos case 0:
852 1.1 christos switch(yyyPass) {
853 1.1 christos case 0:
854 1.1 christos yyyRL = 0;
855 1.1 christos case 1:
856 1.1 christos
857 1.1 christos break;
858 1.1 christos }
859 1.1 christos break;
860 1.1 christos case 1:
861 1.1 christos switch(yyyPass) {
862 1.1 christos case 0:
863 1.1 christos yyyRL = 0;
864 1.1 christos case 1:
865 1.1 christos
866 1.1 christos break;
867 1.1 christos }
868 1.1 christos break;
869 1.1 christos }
870 1.1 christos
871 1.1 christos break;
872 1.1 christos case 7:
873 1.1 christos switch(yyyi) {
874 1.1 christos case 0:
875 1.1 christos switch(yyyPass) {
876 1.1 christos case 0:
877 1.1 christos yyyRL = 0;yyySetCond(0)
878 1.1 christos
879 1.1 christos case 1:
880 1.1 christos
881 1.1 christos if (yyyCond(0) != yyyPass) {
882 1.1 christos #line 46 "expr.Y"
883 1.1 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
884 1.1 christos
885 1.1 christos #line 685 "expr.oxout.y"
886 1.1 christos }
887 1.1 christos break;
888 1.1 christos }
889 1.1 christos break;
890 1.1 christos case 1:
891 1.1 christos switch(yyyPass) {
892 1.1 christos case 0:
893 1.1 christos yyyRL = 0;
894 1.1 christos case 1:
895 1.1 christos
896 1.1 christos if (yyyCond(0) != yyyPass) {
897 1.1 christos #line 45 "expr.Y"
898 1.1 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
899 1.1 christos
900 1.1 christos #line 700 "expr.oxout.y"
901 1.1 christos }
902 1.1 christos break;
903 1.1 christos }
904 1.1 christos break;
905 1.1 christos }
906 1.1 christos
907 1.1 christos break;
908 1.1 christos case 8:
909 1.1 christos switch(yyyi) {
910 1.1 christos case 0:
911 1.1 christos switch(yyyPass) {
912 1.1 christos case 0:
913 1.1 christos yyyRL = 0;yyySetCond(0)
914 1.1 christos
915 1.1 christos case 1:
916 1.1 christos
917 1.1 christos if (yyyCond(0) != yyyPass) {
918 1.1 christos #line 50 "expr.Y"
919 1.1 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
920 1.1 christos
921 1.1 christos #line 721 "expr.oxout.y"
922 1.1 christos }
923 1.1 christos break;
924 1.1 christos }
925 1.1 christos break;
926 1.1 christos case 1:
927 1.1 christos switch(yyyPass) {
928 1.1 christos case 0:
929 1.1 christos yyyRL = 0;
930 1.1 christos case 1:
931 1.1 christos
932 1.1 christos if (yyyCond(0) != yyyPass) {
933 1.1 christos #line 49 "expr.Y"
934 1.1 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
935 1.1 christos
936 1.1 christos #line 736 "expr.oxout.y"
937 1.1 christos }
938 1.1 christos break;
939 1.1 christos }
940 1.1 christos break;
941 1.1 christos }
942 1.1 christos
943 1.1 christos break;
944 1.1 christos } /* switch */
945 1.1 christos if (yyyPass) goto yyyTpop; else goto yyyTpush;
946 1.1 christos } /* while */
947 1.1 christos } /* for */
948 1.1 christos } /* yyyDoTraversals */
949 1.1 christos
950 1.1 christos void yyyExecuteRRsection(yyyGNT *rootNode) {
951 1.1 christos int yyyi;
952 1.1 christos long cycleSum = 0;
953 1.1 christos long nNZrc = 0;
954 1.1 christos
955 1.1 christos if (!yyyYok) return;
956 1.1 christos yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum);
957 1.1 christos if (nNZrc)
958 1.1 christos {
959 1.1 christos fputs("\n\n\n**********\n",stderr);
960 1.1 christos fputs("cycle detected in completed parse tree",stderr);
961 1.1 christos fputs(" after decoration.\n",stderr);
962 1.1 christos #if CYCLE_VERBOSE
963 1.1 christos fprintf(stderr,
964 1.1 christos "number of unsolved attribute instances == %ld.\n",
965 1.1 christos nNZrc
966 1.1 christos );
967 1.1 christos fprintf(stderr,
968 1.1 christos "total number of remaining dependencies == %ld.\n",
969 1.1 christos cycleSum
970 1.1 christos );
971 1.1 christos fputs("average number of remaining dependencies\n",stderr);
972 1.1 christos fprintf(stderr," per unsolved instance == %f.\n",
973 1.1 christos ((float)(cycleSum)/(float)(nNZrc))
974 1.1 christos );
975 1.1 christos #endif
976 1.1 christos fprintf(stderr,
977 1.1 christos "searching parse tree for %ld unsolved instances:\n",
978 1.1 christos nNZrc
979 1.1 christos );
980 1.1 christos yyyUnsolvedInstSearchTravAux(rootNode);
981 1.1 christos }
982 1.1 christos yyyDoTraversals(rootNode);
983 1.1 christos } /* yyyExecuteRRsection */
984 1.1 christos
985 1.1 christos
986 1.1 christos
987 1.1 christos yyyWAT yyyLRCIL[2] = {0,0,
988 1.1 christos };
989 1.1 christos
990 1.1 christos
991 1.1 christos
992 1.1 christos void yyyYoxInit(void)
993 1.1 christos {
994 1.1 christos static int yyyInitDone = 0;
995 1.1 christos if (yyyInitDone) return;
996 1.1 christos
997 1.1 christos if ((yyyRS = (struct yyyRSitem *)
998 1.1 christos calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem))
999 1.1 christos )
1000 1.1 christos ==
1001 1.1 christos ((struct yyyRSitem *) NULL)
1002 1.1 christos )
1003 1.1 christos yyyfatal("malloc error in ox ready set space allocation\n");
1004 1.1 christos yyyRS++;
1005 1.1 christos yyyAfterRS = yyyRS + yyyRSmaxSize;
1006 1.1 christos
1007 1.1 christos
1008 1.1 christos if ((yyySSALspace = (struct yyySolvedSAlistCell *)
1009 1.1 christos calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell))
1010 1.1 christos )
1011 1.1 christos ==
1012 1.1 christos ((struct yyySolvedSAlistCell *) NULL)
1013 1.1 christos )
1014 1.1 christos yyyfatal("malloc error in stack solved list space allocation\n");
1015 1.1 christos yyyInitDone = 1;
1016 1.1 christos
1017 1.1 christos yyyRSTop = yyyRS - 1;
1018 1.1 christos } /* yyyYoxInit */
1019 1.1 christos
1020 1.1 christos
1021 1.1 christos
1022 1.1 christos void yyyDecorate(void)
1023 1.1 christos {
1024 1.1 christos while (yyyRSTop >= yyyRS)
1025 1.1 christos yyySolveAndSignal();
1026 1.1 christos }
1027 1.1 christos
1028 1.1 christos
1029 1.1 christos
1030 1.1 christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...)
1031 1.1 christos {yyyWST i;
1032 1.1 christos yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem;
1033 1.1 christos yyyGNT *gnpDum;
1034 1.1 christos va_list ap;
1035 1.1 christos
1036 1.1 christos *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT));
1037 1.1 christos if (*yyyOxStackItem == (yyySIT *) NULL)
1038 1.1 christos yyyfatal("malloc error in ox yacc semantic stack space allocation\n");
1039 1.1 christos (*yyyOxStackItem)->node =
1040 1.1 christos (yyyGNT *) malloc((size_t)sizeof(yyyGNT));
1041 1.1 christos if ((*yyyOxStackItem)->node == (yyyGNT *) NULL)
1042 1.1 christos yyyfatal("malloc error in ox node space allocation\n");
1043 1.1 christos (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL;
1044 1.1 christos (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem;
1045 1.1 christos (*yyyOxStackItem)->node->parentIsStack = 1;
1046 1.1 christos (*yyyOxStackItem)->node->cLlen = yyyRHSlength;
1047 1.1 christos (*yyyOxStackItem)->node->cL =
1048 1.1 christos (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *));
1049 1.1 christos if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL)
1050 1.1 christos yyyfatal("malloc error in ox child list space allocation\n");
1051 1.1 christos (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs;
1052 1.1 christos (*yyyOxStackItem)->node->refCountList =
1053 1.1 christos (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT));
1054 1.1 christos if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL)
1055 1.1 christos yyyfatal("malloc error in ox reference count list space allocation\n");
1056 1.1 christos (*yyyOxStackItem)->node->prodNum = yyyProdNum;
1057 1.1 christos va_start(ap, yyval_OxAttrbs);
1058 1.1 christos for (i=1;i<=yyyRHSlength;i++)
1059 1.1 christos {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem;
1060 1.1 christos gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node;
1061 1.1 christos gnpDum->whichSym = i;
1062 1.1 christos gnpDum->parent.noderef = (*yyyOxStackItem)->node;
1063 1.1 christos gnpDum->parentIsStack = 0;
1064 1.1 christos }
1065 1.1 christos va_end(ap);
1066 1.1 christos }
1067 1.1 christos
1068 1.1 christos
1069 1.1 christos
1070 1.1 christos #define yyyDECORfREQ 50
1071 1.1 christos
1072 1.1 christos
1073 1.1 christos
1074 1.1 christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...)
1075 1.1 christos {yyyWST i;
1076 1.1 christos yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem;
1077 1.1 christos long SSALptr,SSALptrHead,*cPtrPtr;
1078 1.1 christos long *pL;
1079 1.1 christos yyyGNT *gnpDum;
1080 1.1 christos long iTemp;
1081 1.1 christos long nextP;
1082 1.1 christos static unsigned short intNodeCount = yyyDECORfREQ;
1083 1.1 christos va_list ap;
1084 1.1 christos
1085 1.1 christos nextP = startP;
1086 1.1 christos while (nextP < stopP)
1087 1.1 christos {if (yyyRCIL[nextP] == yyyR)
1088 1.1 christos {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2];
1089 1.1 christos }
1090 1.1 christos else
1091 1.1 christos {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2];
1092 1.1 christos }
1093 1.1 christos nextP += 3;
1094 1.1 christos }
1095 1.1 christos pL = yyyIIEL + yyyIIIEL[yyyProdNum];
1096 1.1 christos va_start(ap, yyval_OxAttrbs);
1097 1.1 christos for (i=1;i<=yyyRHSlength;i++)
1098 1.1 christos {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem;
1099 1.1 christos pL++;
1100 1.1 christos SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist));
1101 1.1 christos if (SSALptr != yyyLambdaSSAL)
1102 1.1 christos {*cPtrPtr = yyyLambdaSSAL;
1103 1.1 christos do
1104 1.1 christos {
1105 1.1 christos iTemp = (*pL+yyySSALspace[SSALptr].attrbNum);
1106 1.1 christos yyySignalEnts(yyyOxStackItem->node,
1107 1.1 christos yyyIEL[iTemp],
1108 1.1 christos yyyIEL[iTemp+1]
1109 1.1 christos );
1110 1.1 christos SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next));
1111 1.1 christos }
1112 1.1 christos while (SSALptr != yyyLambdaSSAL);
1113 1.1 christos *cPtrPtr = yyySSALCfreeList;
1114 1.1 christos yyySSALCfreeList = SSALptrHead;
1115 1.1 christos }
1116 1.1 christos }
1117 1.1 christos va_end(ap);
1118 1.1 christos nextP = startP + 2;
1119 1.1 christos while (nextP < stopP)
1120 1.1 christos {if (!yyyRCIL[nextP])
1121 1.1 christos {if (yyyRCIL[nextP-2] == yyyR)
1122 1.1 christos {pL = &(yyyOxStackItem->solvedSAlist);
1123 1.1 christos if (yyySSALCfreeList == yyyLambdaSSAL)
1124 1.1 christos {yyySSALspace[yyyNewSSALC].next = *pL;
1125 1.1 christos if ((*pL = yyyNewSSALC++) == yyySSALspaceSize)
1126 1.1 christos yyyHandleOverflow(yyySSALof);
1127 1.1 christos }
1128 1.1 christos else
1129 1.1 christos {iTemp = yyySSALCfreeList;
1130 1.1 christos yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next;
1131 1.1 christos yyySSALspace[iTemp].next = *pL;
1132 1.1 christos *pL = iTemp;
1133 1.1 christos }
1134 1.1 christos yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1];
1135 1.1 christos }
1136 1.1 christos else
1137 1.1 christos {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0)
1138 1.1 christos {
1139 1.1 christos iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1];
1140 1.1 christos yyySignalEnts(gnpDum,
1141 1.1 christos yyyIEL[iTemp],
1142 1.1 christos yyyIEL[iTemp+1]
1143 1.1 christos );
1144 1.1 christos }
1145 1.1 christos }
1146 1.1 christos }
1147 1.1 christos nextP += 3;
1148 1.1 christos }
1149 1.1 christos if (!--intNodeCount)
1150 1.1 christos {intNodeCount = yyyDECORfREQ;
1151 1.1 christos yyyDecorate();
1152 1.1 christos }
1153 1.1 christos }
1154 1.1 christos
1155 1.1 christos
1156 1.1 christos
1157 1.1 christos void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval)
1158 1.1 christos {yyyRCT *rcPdum;
1159 1.1 christos yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem;
1160 1.1 christos (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT));
1161 1.1 christos if ((*yyyOxStackItem) == (yyySIT *) NULL)
1162 1.1 christos yyyfatal("malloc error in ox yacc semantic stack space allocation\n");
1163 1.1 christos (*yyyOxStackItem)->node =
1164 1.1 christos (yyyGNT *) malloc((size_t)sizeof(yyyGNT))
1165 1.1 christos ;
1166 1.1 christos if ((*yyyOxStackItem)->node == (yyyGNT *) NULL)
1167 1.1 christos yyyfatal("malloc error in ox node space allocation\n");
1168 1.1 christos (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL;
1169 1.1 christos (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem;
1170 1.1 christos (*yyyOxStackItem)->node->parentIsStack = 1;
1171 1.1 christos (*yyyOxStackItem)->node->cLlen = 0;
1172 1.1 christos (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL;
1173 1.1 christos (*yyyOxStackItem)->node->refCountListLen = nAttrbs;
1174 1.1 christos rcPdum = (*yyyOxStackItem)->node->refCountList =
1175 1.1 christos (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT));
1176 1.1 christos if (rcPdum == (yyyRCT *) NULL)
1177 1.1 christos yyyfatal("malloc error in ox reference count list space allocation\n");
1178 1.1 christos while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0;
1179 1.1 christos (*yyyOxStackItem)->node->prodNum = 0;
1180 1.1 christos (*yyyOxStackItem)->node->whichSym = 0;
1181 1.1 christos }
1182 1.1 christos
1183 1.1 christos
1184 1.1 christos
1185 1.1 christos void yyyabort(void)
1186 1.1 christos {yyyYok = 0;
1187 1.1 christos }
1188 1.1 christos
1189 1.1 christos
1190 1.1 christos
1191 1.1 christos
1192 1.1 christos
1193 1.1 christos #define yyyLastProdNum 8
1194 1.1 christos
1195 1.1 christos
1196 1.1 christos #define yyyNsorts 1
1197 1.1 christos
1198 1.1 christos
1199 1.1 christos int yyyProdsInd[] = {
1200 1.1 christos 0,
1201 1.1 christos 0, 2, 6, 10, 14, 18, 22, 24,
1202 1.1 christos 26,
1203 1.1 christos };
1204 1.1 christos
1205 1.1 christos
1206 1.1 christos int yyyProds[][2] = {
1207 1.1 christos { 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0},
1208 1.1 christos { 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0},
1209 1.1 christos { 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0},
1210 1.1 christos { 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0},
1211 1.1 christos { 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0},
1212 1.1 christos { 567, 1},
1213 1.1 christos };
1214 1.1 christos
1215 1.1 christos
1216 1.1 christos int yyySortsInd[] = {
1217 1.1 christos 0,
1218 1.1 christos 0,
1219 1.1 christos 1,
1220 1.1 christos };
1221 1.1 christos
1222 1.1 christos
1223 1.1 christos int yyySorts[] = {
1224 1.1 christos 413,
1225 1.1 christos };
1226 1.1 christos
1227 1.1 christos
1228 1.1 christos
1229 1.1 christos char *yyyStringTab[] = {
1230 1.1 christos 0,0,0,0,0,
1231 1.1 christos 0,0,0,0,0,
1232 1.1 christos 0,0,0,0,0,
1233 1.1 christos 0,0,0,0,0,
1234 1.1 christos 0,0,0,0,0,
1235 1.1 christos 0,0,0,0,0,
1236 1.1 christos 0,0,0,0,0,
1237 1.1 christos 0,0,0,0,0,
1238 1.1 christos 0,0,0,0,0,
1239 1.1 christos 0,0,0,0,0,
1240 1.1 christos 0,0,0,0,0,
1241 1.1 christos 0,0,0,0,0,
1242 1.1 christos 0,0,0,0,0,
1243 1.1 christos 0,0,0,0,0,
1244 1.1 christos 0,0,0,0,0,
1245 1.1 christos 0,0,0,0,0,
1246 1.1 christos 0,0,0,0,0,
1247 1.1 christos 0,0,0,0,0,
1248 1.1 christos 0,0,0,0,0,
1249 1.1 christos 0,0,0,0,0,
1250 1.1 christos 0,0,0,0,0,
1251 1.1 christos 0,0,0,0,0,
1252 1.1 christos 0,0,0,0,0,
1253 1.1 christos 0,"s",0,0,0,
1254 1.1 christos 0,0,"y",0,0,
1255 1.1 christos 0,0,0,0,0,
1256 1.1 christos 0,0,0,0,0,
1257 1.1 christos 0,0,0,0,0,
1258 1.1 christos 0,0,0,0,0,
1259 1.1 christos 0,0,0,0,0,
1260 1.1 christos 0,0,0,0,0,
1261 1.1 christos 0,0,0,0,0,
1262 1.1 christos 0,0,0,0,0,
1263 1.1 christos 0,0,0,0,0,
1264 1.1 christos 0,0,0,0,0,
1265 1.1 christos 0,0,0,0,0,
1266 1.1 christos 0,0,0,0,0,
1267 1.1 christos 0,0,0,0,0,
1268 1.1 christos 0,0,0,0,0,
1269 1.1 christos 0,0,0,0,0,
1270 1.1 christos 0,0,0,0,0,
1271 1.1 christos 0,0,0,0,0,
1272 1.1 christos 0,0,0,0,0,
1273 1.1 christos 0,0,0,0,0,
1274 1.1 christos 0,0,0,0,0,
1275 1.1 christos 0,0,0,0,0,
1276 1.1 christos 0,0,0,0,0,
1277 1.1 christos 0,0,0,0,0,
1278 1.1 christos 0,0,0,0,0,
1279 1.1 christos 0,0,0,0,0,
1280 1.1 christos 0,0,0,0,0,
1281 1.1 christos 0,0,0,0,0,
1282 1.1 christos 0,0,0,0,0,
1283 1.1 christos 0,0,0,0,0,
1284 1.1 christos 0,0,0,0,0,
1285 1.1 christos 0,0,0,0,0,
1286 1.1 christos 0,0,0,0,0,
1287 1.1 christos 0,0,0,0,0,
1288 1.1 christos 0,0,0,0,0,
1289 1.1 christos 0,0,0,0,0,
1290 1.1 christos 0,0,0,0,0,
1291 1.1 christos 0,0,0,0,0,
1292 1.1 christos 0,0,0,0,0,
1293 1.1 christos 0,0,0,0,0,
1294 1.1 christos 0,0,0,0,0,
1295 1.1 christos 0,"LRpre",0,0,0,
1296 1.1 christos 0,0,0,0,0,
1297 1.1 christos 0,0,0,0,0,
1298 1.1 christos 0,0,0,0,0,
1299 1.1 christos 0,0,0,0,0,
1300 1.1 christos 0,0,0,0,0,
1301 1.1 christos 0,0,0,0,0,
1302 1.1 christos 0,0,0,0,0,
1303 1.1 christos 0,0,0,0,0,
1304 1.1 christos 0,0,0,0,0,
1305 1.1 christos 0,0,0,0,0,
1306 1.1 christos 0,0,0,0,0,
1307 1.1 christos 0,0,0,0,0,
1308 1.1 christos 0,0,0,0,0,
1309 1.1 christos 0,"'('",0,0,0,
1310 1.1 christos 0,0,0,0,"')'",
1311 1.1 christos 0,0,0,0,0,
1312 1.1 christos 0,0,"'*'","lexeme",0,
1313 1.1 christos 0,0,0,0,0,
1314 1.1 christos "'+'",0,0,0,0,
1315 1.1 christos 0,0,0,0,0,
1316 1.1 christos 0,0,0,0,0,
1317 1.1 christos 0,"'-'",0,0,0,
1318 1.1 christos 0,0,0,0,0,
1319 1.1 christos 0,0,0,0,0,
1320 1.1 christos 0,0,"'/'",0,0,
1321 1.1 christos 0,0,0,0,0,
1322 1.1 christos 0,0,"expr",0,0,
1323 1.1 christos 0,0,0,0,0,
1324 1.1 christos 0,0,0,0,0,
1325 1.1 christos 0,"printf",0,0,0,
1326 1.1 christos 0,0,0,0,0,
1327 1.1 christos 0,0,0,0,0,
1328 1.1 christos 0,0,0,0,0,
1329 1.1 christos 0,0,0,0,0,
1330 1.1 christos 0,0,0,0,0,
1331 1.1 christos 0,0,0,0,0,
1332 1.1 christos 0,0,0,0,0,
1333 1.1 christos 0,0,0,0,0,
1334 1.1 christos 0,0,0,0,0,
1335 1.1 christos 0,0,0,0,0,
1336 1.1 christos 0,0,0,0,0,
1337 1.1 christos 0,0,0,0,0,
1338 1.1 christos 0,0,0,0,0,
1339 1.1 christos 0,0,0,0,0,
1340 1.1 christos 0,0,0,0,0,
1341 1.1 christos 0,0,0,0,0,
1342 1.1 christos 0,0,0,0,0,
1343 1.1 christos 0,0,"CONST","LRpost",0,
1344 1.1 christos 0,0,0,0,0,
1345 1.1 christos 0,0,0,0,0,
1346 1.1 christos 0,0,0,0,0,
1347 1.1 christos 0,0,0,0,0,
1348 1.1 christos 0,0,0,0,0,
1349 1.1 christos 0,0,0,0,0,
1350 1.1 christos 0,0,0,0,0,
1351 1.1 christos 0,0,0,0,0,
1352 1.1 christos 0,0,0,0,0,
1353 1.1 christos 0,0,0,0,"ID",
1354 1.1 christos 0,0,0,0,0,
1355 1.1 christos 0,0,0,0,0,
1356 1.1 christos 0,0,0,0,0,
1357 1.1 christos 0,0,0,0,0,
1358 1.1 christos 0,0,0,0,0,
1359 1.1 christos 0,0,0,0,0,
1360 1.1 christos 0,0,0,0,0,
1361 1.1 christos 0,0,0,0,0,
1362 1.1 christos 0,0,0,0,0,
1363 1.1 christos 0,0,0,0,0,
1364 1.1 christos 0,0,0,0,0,
1365 1.1 christos 0,0,0,0,0,
1366 1.1 christos 0,0,0,0,0,
1367 1.1 christos 0,0,0,0,0,
1368 1.1 christos 0,0,0,0,0,
1369 1.1 christos 0,0,0,0,0,
1370 1.1 christos 0,0,0,0,0,
1371 1.1 christos 0,0,0,0,0,
1372 1.1 christos 0,0,0,0,0,
1373 1.1 christos 0,0,0,0,0,
1374 1.1 christos 0,0,0,0,0,
1375 1.1 christos 0,0,0,0,0,
1376 1.1 christos 0,0,0,0,0,
1377 1.1 christos 0,0,0,0,0,
1378 1.1 christos 0,0,0,0,0,
1379 1.1 christos 0,0,0,0,0,
1380 1.1 christos 0,0,0,0,0,
1381 1.1 christos 0,0,0,0,0,
1382 1.1 christos 0,0,0,0,0,
1383 1.1 christos 0,0,0,0,0,
1384 1.1 christos 0,0,0,0,0,
1385 1.1 christos 0,0,0,0,0,
1386 1.1 christos 0,0,0,0,0,
1387 1.1 christos 0,0,0,0,0,
1388 1.1 christos 0,0,0,0,0,
1389 1.1 christos 0,0,0,0,0,
1390 1.1 christos 0,0,0,0,0,
1391 1.1 christos 0,0,0,0,0,
1392 1.1 christos 0,0,0,0,0,
1393 1.1 christos 0,0,0,0,0,
1394 1.1 christos 0,0,0,0,0,
1395 1.1 christos 0,0,0,0,0,
1396 1.1 christos 0,0,0,0,0,
1397 1.1 christos 0,0,0,0,0,
1398 1.1 christos 0,0,0,0,0,
1399 1.1 christos 0,0,0,0,0,
1400 1.1 christos 0,0,0,0,0,
1401 1.1 christos 0,0,0,0,0,
1402 1.1 christos 0,0,0,0,0,
1403 1.1 christos 0,0,0,0,0,
1404 1.1 christos 0,0,0,0,0,
1405 1.1 christos 0,0,0,0,0,
1406 1.1 christos 0,0,0,0,0,
1407 1.1 christos 0,0,0,0,0,
1408 1.1 christos 0,0,0,0,0,
1409 1.1 christos 0,0,0,0,0,
1410 1.1 christos 0,0,0,0,0,
1411 1.1 christos 0,0,0,0,0,
1412 1.1 christos 0,0,0,0,0,
1413 1.1 christos 0,0,0,0,0,
1414 1.1 christos 0,0,0,0,0,
1415 1.1 christos 0,0,0,0,0,
1416 1.1 christos 0,0,0,0,0,
1417 1.1 christos 0,0,0,0,0,
1418 1.1 christos 0,0,0,0,0,
1419 1.1 christos 0,0,0,0,0,
1420 1.1 christos 0,0,0,0,0,
1421 1.1 christos 0,0,0,0,0,
1422 1.1 christos 0,0,0,0,0,
1423 1.1 christos 0,0,0,0,0,
1424 1.1 christos 0,0,0,0,0,
1425 1.1 christos 0,0,0,0,0,
1426 1.1 christos 0,0,0,0,0,
1427 1.1 christos 0,0,0,0,0,
1428 1.1 christos 0,0,0,0,0,
1429 1.1 christos 0,0,0,0,0,
1430 1.1 christos 0,0,0,0,0,
1431 1.1 christos 0,0,0,0,0,
1432 1.1 christos 0,0,0,0,0,
1433 1.1 christos 0,0,0,0,0,
1434 1.1 christos 0,0,0,0,0,
1435 1.1 christos 0,0,0,0,0,
1436 1.1 christos 0,0,0,0,0,
1437 1.1 christos 0,0,0,0,0,
1438 1.1 christos 0,0,0,0,0,
1439 1.1 christos 0,0,0,0,0,
1440 1.1 christos 0,0,0,0,0,
1441 1.1 christos 0,0,0,0,0,
1442 1.1 christos 0,0,0,0,0,
1443 1.1 christos 0,0,0,0,0,
1444 1.1 christos 0,0,0,0,0,
1445 1.1 christos 0,0,0,0,0,
1446 1.1 christos 0,0,0,0,0,
1447 1.1 christos 0,0,0,0,0,
1448 1.1 christos 0,0,0,0,0,
1449 1.1 christos 0,0,0,0,0,
1450 1.1 christos 0,0,0,0,0,
1451 1.1 christos 0,0,0,0,0,
1452 1.1 christos 0,0,0,0,0,
1453 1.1 christos 0,0,0,0,0,
1454 1.1 christos 0,0,0,0,0,
1455 1.1 christos 0,0,0,0,0,
1456 1.1 christos 0,0,0,0,0,
1457 1.1 christos 0,0,0,0,0,
1458 1.1 christos 0,0,0,0,0,
1459 1.1 christos 0,0,0,0,0,
1460 1.1 christos 0,0,0,0,0,
1461 1.1 christos 0,0,0,0,0,
1462 1.1 christos 0,0,0,0,0,
1463 1.1 christos 0,0,0,0,0,
1464 1.1 christos 0,0,0,0,0,
1465 1.1 christos 0,0,0,0,0,
1466 1.1 christos 0,0,0,0,0,
1467 1.1 christos 0,0,0,0,0,
1468 1.1 christos 0,0,0,0,0,
1469 1.1 christos 0,0,0,0,0,
1470 1.1 christos 0,0,0,0,0,
1471 1.1 christos 0,0,0,0,0,
1472 1.1 christos 0,0,0,0,0,
1473 1.1 christos 0,0,0,0,0,
1474 1.1 christos 0,0,0,0,0,
1475 1.1 christos 0,0,0,0,0,
1476 1.1 christos 0,
1477 1.1 christos };
1478 1.1 christos
1479 1.1 christos
1480 1.1 christos
1481 1.1 christos #define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)])
1482 1.1 christos
1483 1.1 christos #define yyyGSoccurStr(prodNum,symPos) \
1484 1.1 christos (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]])
1485 1.1 christos
1486 1.1 christos #define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)])
1487 1.1 christos
1488 1.1 christos #define yyySortOf(prodNum,symPos) \
1489 1.1 christos (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1])
1490 1.1 christos
1491 1.1 christos #define yyyAttrbStr(prodNum,symPos,attrbNum) \
1492 1.1 christos (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \
1493 1.1 christos (attrbNum) \
1494 1.1 christos ] \
1495 1.1 christos ] \
1496 1.1 christos )
1497 1.1 christos
1498 1.1 christos
1499 1.1 christos
1500 1.1 christos void yyyShowProd(int i)
1501 1.1 christos {int j,nSyms;
1502 1.1 christos
1503 1.1 christos nSyms = yyySizeofProd(i);
1504 1.1 christos for (j=0; j<nSyms; j++)
1505 1.1 christos {
1506 1.1 christos fprintf(stderr,"%s",yyyGSoccurStr(i,j));
1507 1.1 christos if (j == 0) fputs(" : ",stderr); else putc(' ',stderr);
1508 1.1 christos }
1509 1.1 christos fputs(";\n",stderr);
1510 1.1 christos }
1511 1.1 christos
1512 1.1 christos
1513 1.1 christos
1514 1.1 christos void yyyShowProds()
1515 1.1 christos {int i; for (i=1; i<=yyyLastProdNum; i++) yyyShowProd(i);}
1516 1.1 christos
1517 1.1 christos
1518 1.1 christos
1519 1.1 christos void yyyShowSymsAndSorts()
1520 1.1 christos {int i;
1521 1.1 christos
1522 1.1 christos for (i=1; i<=yyyLastProdNum; i++)
1523 1.1 christos {int j, nSyms;
1524 1.1 christos
1525 1.1 christos fprintf(stderr,
1526 1.1 christos "\n\n\n---------------------------------- %3.1d\n",i);
1527 1.1 christos /* yyyShowProd(i); */
1528 1.1 christos nSyms = yyySizeofProd(i);
1529 1.1 christos for (j=0; j<nSyms; j++)
1530 1.1 christos {int k, sortSize;
1531 1.1 christos
1532 1.1 christos fprintf(stderr,"%s\n",yyyGSoccurStr(i,j));
1533 1.1 christos sortSize = yyySizeofSort(yyySortOf(i,j));
1534 1.1 christos for (k=0; k<sortSize; k++)
1535 1.1 christos fprintf(stderr," %s\n",yyyAttrbStr(i,j,k));
1536 1.1 christos if (j == 0) fputs("->\n",stderr);
1537 1.1 christos else
1538 1.1 christos putc('\n',stderr);
1539 1.1 christos }
1540 1.1 christos }
1541 1.1 christos }
1542 1.1 christos
1543 1.1 christos
1544 1.1 christos
1545 1.1 christos void yyyCheckNodeInstancesSolved(yyyGNT *np)
1546 1.1 christos {int mysort,sortSize,i,prodNum,symPos,inTerminalNode;
1547 1.1 christos int nUnsolvedInsts = 0;
1548 1.1 christos
1549 1.1 christos if (np->prodNum != 0)
1550 1.1 christos {inTerminalNode = 0;
1551 1.1 christos prodNum = np->prodNum;
1552 1.1 christos symPos = 0;
1553 1.1 christos }
1554 1.1 christos else
1555 1.1 christos {inTerminalNode = 1;
1556 1.1 christos prodNum = np->parent.noderef->prodNum;
1557 1.1 christos symPos = np->whichSym;
1558 1.1 christos }
1559 1.1 christos mysort = yyySortOf(prodNum,symPos);
1560 1.1 christos sortSize = yyySizeofSort(mysort);
1561 1.1 christos for (i=0; i<sortSize; i++)
1562 1.1 christos if ((np->refCountList)[i] != 0) nUnsolvedInsts += 1;
1563 1.1 christos if (nUnsolvedInsts)
1564 1.1 christos {fprintf(stderr,
1565 1.1 christos "\nFound node that has %d unsolved attribute instance(s).\n",
1566 1.1 christos nUnsolvedInsts
1567 1.1 christos );
1568 1.1 christos fprintf(stderr,"Node is labeled \"%s\".\n",
1569 1.1 christos yyyGSoccurStr(prodNum,symPos));
1570 1.1 christos if (inTerminalNode)
1571 1.1 christos {fputs("Node is terminal. Its parent production is:\n ",stderr);
1572 1.1 christos yyyShowProd(prodNum);
1573 1.1 christos }
1574 1.1 christos else
1575 1.1 christos {fputs("Node is nonterminal. ",stderr);
1576 1.1 christos if (!(np->parentIsStack))
1577 1.1 christos {fprintf(stderr,
1578 1.1 christos "Node is %dth child in its parent production:\n ",
1579 1.1 christos np->whichSym
1580 1.1 christos );
1581 1.1 christos yyyShowProd(np->parent.noderef->prodNum);
1582 1.1 christos }
1583 1.1 christos fputs("Node is on left hand side of this production:\n ",stderr);
1584 1.1 christos yyyShowProd(np->prodNum);
1585 1.1 christos }
1586 1.1 christos fputs("The following instances are unsolved:\n",stderr);
1587 1.1 christos for (i=0; i<sortSize; i++)
1588 1.1 christos if ((np->refCountList)[i] != 0)
1589 1.1 christos fprintf(stderr," %-16s still has %1d dependencies.\n",
1590 1.1 christos yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]);
1591 1.1 christos }
1592 1.1 christos }
1593 1.1 christos
1594 1.1 christos
1595 1.1 christos
1596 1.1 christos void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum)
1597 1.1 christos {yyyGNT **yyyCLpdum;
1598 1.1 christos yyyRCT *rcp;
1599 1.1 christos int i;
1600 1.1 christos
1601 1.1 christos /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */
1602 1.1 christos rcp = pNode->refCountList;
1603 1.1 christos i = pNode->refCountListLen;
1604 1.1 christos while (i--)
1605 1.1 christos if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;}
1606 1.1 christos yyyCLpdum = pNode->cL;
1607 1.1 christos i = pNode->cLlen;
1608 1.1 christos while (i--)
1609 1.1 christos {
1610 1.1 christos yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum);
1611 1.1 christos yyyCLpdum++;
1612 1.1 christos }
1613 1.1 christos }
1614 1.1 christos
1615 1.1 christos
1616 1.1 christos
1617 1.1 christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode)
1618 1.1 christos {yyyGNT **yyyCLpdum;
1619 1.1 christos int i;
1620 1.1 christos
1621 1.1 christos yyyCheckNodeInstancesSolved(pNode);
1622 1.1 christos yyyCLpdum = pNode->cL;
1623 1.1 christos i = pNode->cLlen;
1624 1.1 christos while (i--)
1625 1.1 christos {
1626 1.1 christos yyyUnsolvedInstSearchTravAux(*yyyCLpdum);
1627 1.1 christos yyyCLpdum++;
1628 1.1 christos }
1629 1.1 christos }
1630 1.1 christos
1631 1.1 christos
1632 1.1 christos
1633 1.1 christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode)
1634 1.1 christos {yyyGNT **yyyCLpdum;
1635 1.1 christos int i;
1636 1.1 christos
1637 1.1 christos yyyCLpdum = pNode->cL;
1638 1.1 christos i = pNode->cLlen;
1639 1.1 christos while (i--)
1640 1.1 christos {
1641 1.1 christos yyyUnsolvedInstSearchTravAux(*yyyCLpdum);
1642 1.1 christos yyyCLpdum++;
1643 1.1 christos }
1644 1.1 christos }
1645 1.1 christos
1646 1.1 christos
1647 1.1 christos
1648 1.3 christos #line 1647 "expr.oxout.tab.c"
1649 1.1 christos
1650 1.1 christos #if YYDEBUG
1651 1.1 christos #include <stdio.h> /* needed for printf */
1652 1.1 christos #endif
1653 1.1 christos
1654 1.1 christos #include <stdlib.h> /* needed for malloc, etc */
1655 1.1 christos #include <string.h> /* needed for memset */
1656 1.1 christos
1657 1.1 christos /* allocate initial stack or double stack size, up to YYMAXDEPTH */
1658 1.1 christos static int yygrowstack(YYSTACKDATA *data)
1659 1.1 christos {
1660 1.1 christos int i;
1661 1.1 christos unsigned newsize;
1662 1.1 christos YYINT *newss;
1663 1.1 christos YYSTYPE *newvs;
1664 1.1 christos
1665 1.1 christos if ((newsize = data->stacksize) == 0)
1666 1.1 christos newsize = YYINITSTACKSIZE;
1667 1.1 christos else if (newsize >= YYMAXDEPTH)
1668 1.1 christos return YYENOMEM;
1669 1.1 christos else if ((newsize *= 2) > YYMAXDEPTH)
1670 1.1 christos newsize = YYMAXDEPTH;
1671 1.1 christos
1672 1.1 christos i = (int) (data->s_mark - data->s_base);
1673 1.1 christos newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
1674 1.1 christos if (newss == 0)
1675 1.1 christos return YYENOMEM;
1676 1.1 christos
1677 1.1 christos data->s_base = newss;
1678 1.1 christos data->s_mark = newss + i;
1679 1.1 christos
1680 1.1 christos newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
1681 1.1 christos if (newvs == 0)
1682 1.1 christos return YYENOMEM;
1683 1.1 christos
1684 1.1 christos data->l_base = newvs;
1685 1.1 christos data->l_mark = newvs + i;
1686 1.1 christos
1687 1.1 christos data->stacksize = newsize;
1688 1.1 christos data->s_last = data->s_base + newsize - 1;
1689 1.1 christos return 0;
1690 1.1 christos }
1691 1.1 christos
1692 1.1 christos #if YYPURE || defined(YY_NO_LEAKS)
1693 1.1 christos static void yyfreestack(YYSTACKDATA *data)
1694 1.1 christos {
1695 1.1 christos free(data->s_base);
1696 1.1 christos free(data->l_base);
1697 1.1 christos memset(data, 0, sizeof(*data));
1698 1.1 christos }
1699 1.1 christos #else
1700 1.1 christos #define yyfreestack(data) /* nothing */
1701 1.1 christos #endif
1702 1.1 christos
1703 1.1 christos #define YYABORT goto yyabort
1704 1.1 christos #define YYREJECT goto yyabort
1705 1.1 christos #define YYACCEPT goto yyaccept
1706 1.1 christos #define YYERROR goto yyerrlab
1707 1.1 christos
1708 1.1 christos int
1709 1.1 christos YYPARSE_DECL()
1710 1.1 christos {
1711 1.1 christos int yym, yyn, yystate;
1712 1.1 christos #if YYDEBUG
1713 1.1 christos const char *yys;
1714 1.1 christos
1715 1.1 christos if ((yys = getenv("YYDEBUG")) != 0)
1716 1.1 christos {
1717 1.1 christos yyn = *yys;
1718 1.1 christos if (yyn >= '0' && yyn <= '9')
1719 1.1 christos yydebug = yyn - '0';
1720 1.1 christos }
1721 1.1 christos #endif
1722 1.1 christos
1723 1.1 christos yym = 0;
1724 1.1 christos yyn = 0;
1725 1.1 christos yynerrs = 0;
1726 1.1 christos yyerrflag = 0;
1727 1.1 christos yychar = YYEMPTY;
1728 1.1 christos yystate = 0;
1729 1.1 christos
1730 1.1 christos #if YYPURE
1731 1.1 christos memset(&yystack, 0, sizeof(yystack));
1732 1.1 christos #endif
1733 1.1 christos
1734 1.1 christos if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1735 1.1 christos yystack.s_mark = yystack.s_base;
1736 1.1 christos yystack.l_mark = yystack.l_base;
1737 1.1 christos yystate = 0;
1738 1.1 christos *yystack.s_mark = 0;
1739 1.1 christos
1740 1.1 christos yyloop:
1741 1.1 christos if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
1742 1.1 christos if (yychar < 0)
1743 1.1 christos {
1744 1.1 christos yychar = YYLEX;
1745 1.1 christos if (yychar < 0) yychar = YYEOF;
1746 1.1 christos #if YYDEBUG
1747 1.1 christos if (yydebug)
1748 1.1 christos {
1749 1.1 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1750 1.1 christos printf("%sdebug: state %d, reading %d (%s)\n",
1751 1.1 christos YYPREFIX, yystate, yychar, yys);
1752 1.1 christos }
1753 1.1 christos #endif
1754 1.1 christos }
1755 1.1 christos if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1756 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1757 1.1 christos {
1758 1.1 christos #if YYDEBUG
1759 1.1 christos if (yydebug)
1760 1.1 christos printf("%sdebug: state %d, shifting to state %d\n",
1761 1.1 christos YYPREFIX, yystate, yytable[yyn]);
1762 1.1 christos #endif
1763 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1764 1.1 christos yystate = yytable[yyn];
1765 1.1 christos *++yystack.s_mark = yytable[yyn];
1766 1.1 christos *++yystack.l_mark = yylval;
1767 1.1 christos yychar = YYEMPTY;
1768 1.1 christos if (yyerrflag > 0) --yyerrflag;
1769 1.1 christos goto yyloop;
1770 1.1 christos }
1771 1.1 christos if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
1772 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
1773 1.1 christos {
1774 1.1 christos yyn = yytable[yyn];
1775 1.1 christos goto yyreduce;
1776 1.1 christos }
1777 1.1 christos if (yyerrflag != 0) goto yyinrecovery;
1778 1.1 christos
1779 1.1 christos YYERROR_CALL("syntax error");
1780 1.1 christos
1781 1.1 christos goto yyerrlab; /* redundant goto avoids 'unused label' warning */
1782 1.1 christos yyerrlab:
1783 1.1 christos ++yynerrs;
1784 1.1 christos
1785 1.1 christos yyinrecovery:
1786 1.1 christos if (yyerrflag < 3)
1787 1.1 christos {
1788 1.1 christos yyerrflag = 3;
1789 1.1 christos for (;;)
1790 1.1 christos {
1791 1.1 christos if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
1792 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
1793 1.1 christos {
1794 1.1 christos #if YYDEBUG
1795 1.1 christos if (yydebug)
1796 1.1 christos printf("%sdebug: state %d, error recovery shifting\
1797 1.1 christos to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
1798 1.1 christos #endif
1799 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1800 1.1 christos yystate = yytable[yyn];
1801 1.1 christos *++yystack.s_mark = yytable[yyn];
1802 1.1 christos *++yystack.l_mark = yylval;
1803 1.1 christos goto yyloop;
1804 1.1 christos }
1805 1.1 christos else
1806 1.1 christos {
1807 1.1 christos #if YYDEBUG
1808 1.1 christos if (yydebug)
1809 1.1 christos printf("%sdebug: error recovery discarding state %d\n",
1810 1.1 christos YYPREFIX, *yystack.s_mark);
1811 1.1 christos #endif
1812 1.1 christos if (yystack.s_mark <= yystack.s_base) goto yyabort;
1813 1.1 christos --yystack.s_mark;
1814 1.1 christos --yystack.l_mark;
1815 1.1 christos }
1816 1.1 christos }
1817 1.1 christos }
1818 1.1 christos else
1819 1.1 christos {
1820 1.1 christos if (yychar == YYEOF) goto yyabort;
1821 1.1 christos #if YYDEBUG
1822 1.1 christos if (yydebug)
1823 1.1 christos {
1824 1.1 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1825 1.1 christos printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
1826 1.1 christos YYPREFIX, yystate, yychar, yys);
1827 1.1 christos }
1828 1.1 christos #endif
1829 1.1 christos yychar = YYEMPTY;
1830 1.1 christos goto yyloop;
1831 1.1 christos }
1832 1.1 christos
1833 1.1 christos yyreduce:
1834 1.1 christos #if YYDEBUG
1835 1.1 christos if (yydebug)
1836 1.1 christos printf("%sdebug: state %d, reducing by rule %d (%s)\n",
1837 1.1 christos YYPREFIX, yystate, yyn, yyrule[yyn]);
1838 1.1 christos #endif
1839 1.1 christos yym = yylen[yyn];
1840 1.1 christos if (yym > 0)
1841 1.1 christos yyval = yystack.l_mark[1-yym];
1842 1.1 christos else
1843 1.1 christos memset(&yyval, 0, sizeof yyval);
1844 1.1 christos
1845 1.1 christos switch (yyn)
1846 1.1 christos {
1847 1.1 christos case 1:
1848 1.1 christos #line 64 "expr.oxout.y"
1849 1.1 christos {yyyYoxInit();}
1850 1.1 christos break;
1851 1.1 christos case 2:
1852 1.1 christos #line 66 "expr.oxout.y"
1853 1.1 christos {
1854 1.1 christos yyyDecorate(); yyyExecuteRRsection(yystack.l_mark[0].yyyOxAttrbs.yyyOxStackItem->node);
1855 1.1 christos }
1856 1.1 christos break;
1857 1.1 christos case 3:
1858 1.1 christos #line 73 "expr.oxout.y"
1859 1.1 christos {if(yyyYok){
1860 1.1 christos yyyGenIntNode(1,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1861 1.1 christos yyyAdjustINRC(1,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1862 1.1 christos break;
1863 1.1 christos case 4:
1864 1.1 christos #line 80 "expr.oxout.y"
1865 1.1 christos {if(yyyYok){
1866 1.1 christos yyyGenIntNode(2,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1867 1.1 christos yyyAdjustINRC(2,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1868 1.1 christos break;
1869 1.1 christos case 5:
1870 1.1 christos #line 87 "expr.oxout.y"
1871 1.1 christos {if(yyyYok){
1872 1.1 christos yyyGenIntNode(3,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1873 1.1 christos yyyAdjustINRC(3,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1874 1.1 christos break;
1875 1.1 christos case 6:
1876 1.1 christos #line 94 "expr.oxout.y"
1877 1.1 christos {if(yyyYok){
1878 1.1 christos yyyGenIntNode(4,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1879 1.1 christos yyyAdjustINRC(4,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1880 1.1 christos break;
1881 1.1 christos case 7:
1882 1.1 christos #line 101 "expr.oxout.y"
1883 1.1 christos {if(yyyYok){
1884 1.1 christos yyyGenIntNode(5,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1885 1.1 christos yyyAdjustINRC(5,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1886 1.1 christos break;
1887 1.1 christos case 8:
1888 1.1 christos #line 108 "expr.oxout.y"
1889 1.1 christos {if(yyyYok){
1890 1.1 christos yyyGenIntNode(6,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1891 1.1 christos yyyAdjustINRC(6,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1892 1.1 christos break;
1893 1.1 christos case 9:
1894 1.1 christos #line 114 "expr.oxout.y"
1895 1.1 christos {if(yyyYok){
1896 1.1 christos yyyGenIntNode(7,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1897 1.1 christos yyyAdjustINRC(7,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1898 1.1 christos break;
1899 1.1 christos case 10:
1900 1.1 christos #line 121 "expr.oxout.y"
1901 1.1 christos {if(yyyYok){
1902 1.1 christos yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
1903 1.1 christos yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
1904 1.1 christos break;
1905 1.3 christos #line 1904 "expr.oxout.tab.c"
1906 1.1 christos }
1907 1.1 christos yystack.s_mark -= yym;
1908 1.1 christos yystate = *yystack.s_mark;
1909 1.1 christos yystack.l_mark -= yym;
1910 1.1 christos yym = yylhs[yyn];
1911 1.1 christos if (yystate == 0 && yym == 0)
1912 1.1 christos {
1913 1.1 christos #if YYDEBUG
1914 1.1 christos if (yydebug)
1915 1.1 christos printf("%sdebug: after reduction, shifting from state 0 to\
1916 1.1 christos state %d\n", YYPREFIX, YYFINAL);
1917 1.1 christos #endif
1918 1.1 christos yystate = YYFINAL;
1919 1.1 christos *++yystack.s_mark = YYFINAL;
1920 1.1 christos *++yystack.l_mark = yyval;
1921 1.1 christos if (yychar < 0)
1922 1.1 christos {
1923 1.1 christos yychar = YYLEX;
1924 1.1 christos if (yychar < 0) yychar = YYEOF;
1925 1.1 christos #if YYDEBUG
1926 1.1 christos if (yydebug)
1927 1.1 christos {
1928 1.1 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1929 1.1 christos printf("%sdebug: state %d, reading %d (%s)\n",
1930 1.1 christos YYPREFIX, YYFINAL, yychar, yys);
1931 1.1 christos }
1932 1.1 christos #endif
1933 1.1 christos }
1934 1.1 christos if (yychar == YYEOF) goto yyaccept;
1935 1.1 christos goto yyloop;
1936 1.1 christos }
1937 1.1 christos if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
1938 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
1939 1.1 christos yystate = yytable[yyn];
1940 1.1 christos else
1941 1.1 christos yystate = yydgoto[yym];
1942 1.1 christos #if YYDEBUG
1943 1.1 christos if (yydebug)
1944 1.1 christos printf("%sdebug: after reduction, shifting from state %d \
1945 1.1 christos to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
1946 1.1 christos #endif
1947 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1948 1.1 christos *++yystack.s_mark = (YYINT) yystate;
1949 1.1 christos *++yystack.l_mark = yyval;
1950 1.1 christos goto yyloop;
1951 1.1 christos
1952 1.1 christos yyoverflow:
1953 1.1 christos YYERROR_CALL("yacc stack overflow");
1954 1.1 christos
1955 1.1 christos yyabort:
1956 1.1 christos yyfreestack(&yystack);
1957 1.1 christos return (1);
1958 1.1 christos
1959 1.1 christos yyaccept:
1960 1.1 christos yyfreestack(&yystack);
1961 1.1 christos return (0);
1962 1.1 christos }
1963