]> git.saurik.com Git - wxWidgets.git/blob - src/common/cwy_tab.c
Adjusted filelist.txt and wxUniv.dsp to use generic
[wxWidgets.git] / src / common / cwy_tab.c
1 #ifndef lint
2 static char yysccsid[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90";
3 #endif
4 #define YYBYACC 1
5 #line 2 "parser.y"
6 #include "string.h"
7 #ifdef _MSC_VER
8 #include <io.h>
9 #endif
10 #include "wx/expr.h"
11
12 #ifndef __EXTERN_C__
13 #define __EXTERN_C__ 1
14 #endif
15
16 #if defined(__cplusplus) || defined(__STDC__)
17 #if defined(__cplusplus) && defined(__EXTERN_C__)
18 extern "C" {
19 #endif
20 #endif
21 int yyparse(void);
22 int PROIO_yyparse(void) {
23 return yyparse() ;
24 }
25 int yylex(void);
26 int yylook(void);
27 int yywrap(void);
28 int yyback(int *, int);
29 #if __MSL__ < 0x6000
30 int read( int , char * , int ) ;
31 #else
32 int _read( int , void * , size_t ) ;
33 #define read _read
34 #endif
35 #ifdef __WXMSW__
36 //int fileno( FILE* ) ; This is defined in watcom
37 #else
38 #if __MSL__ < 0x6000
39 int fileno( void* ) ;
40 #endif
41 #endif
42
43 /* You may need to put /DLEX_SCANNER in your makefile
44 * if you're using LEX!
45 Last change: JS 13 Jul 97 6:12 pm
46 */
47 #ifdef LEX_SCANNER
48 /* int yyoutput(int); */
49 void yyoutput(int);
50 #else
51 void yyoutput(int);
52 #endif
53
54 #if defined(__cplusplus) || defined(__STDC__)
55 #if defined(__cplusplus) && defined(__EXTERN_C__)
56 }
57 #endif
58 #endif
59 #line 36 "parser.y"
60 typedef union {
61 char *s;
62 /* struct pexpr *expr; */
63 } YYSTYPE;
64 #line 44 "y_tab.c"
65 #define INTEGER 1
66 #define WORD 2
67 #define STRING 3
68 #define PERIOD 13
69 #define OPEN 4
70 #define CLOSE 5
71 #define COMMA 6
72 #define NEWLINE 7
73 #define ERROR 8
74 #define OPEN_SQUARE 9
75 #define CLOSE_SQUARE 10
76 #define EQUALS 11
77 #define EXP 14
78 #define YYERRCODE 256
79 short yylhs[] = { -1,
80 0, 0, 1, 1, 1, 2, 2, 2, 3, 3,
81 3, 4, 4, 5, 5, 5, 5, 5, 5, 5,
82 };
83 short yylen[] = { 2,
84 0, 2, 2, 2, 2, 4, 2, 3, 0, 1,
85 3, 3, 1, 1, 1, 1, 3, 3, 5, 1,
86 };
87 short yydefred[] = { 1,
88 0, 0, 0, 0, 2, 0, 5, 3, 0, 0,
89 0, 15, 7, 20, 0, 0, 13, 4, 0, 0,
90 0, 0, 8, 0, 6, 0, 18, 0, 12, 11,
91 0, 19,
92 };
93 short yydgoto[] = { 1,
94 5, 14, 15, 16, 17,
95 };
96 short yysindex[] = { 0,
97 -2, 9, 2, 1, 0, 10, 0, 0, 11, -5,
98 17, 0, 0, 0, 14, -1, 0, 0, 33, 38,
99 41, 16, 0, 11, 0, 29, 0, 40, 0, 0,
100 44, 0,
101 };
102 short yyrindex[] = { 0,
103 0, 0, 0, 0, 0, 0, 0, 0, 42, 21,
104 24, 0, 0, 0, 0, 30, 0, 0, 0, 0,
105 0, 0, 0, 31, 0, 27, 0, 24, 0, 0,
106 0, 0,
107 };
108 short yygindex[] = { 0,
109 0, 45, -8, 0, 26,
110 };
111 #define YYTABLESIZE 254
112 short yytable[] = { 3,
113 19, 10, 11, 12, 24, 9, 4, 20, 21, 4,
114 13, 10, 11, 12, 8, 30, 10, 28, 12, 4,
115 9, 7, 18, 23, 4, 16, 16, 22, 14, 14,
116 16, 17, 17, 14, 10, 9, 17, 25, 26, 10,
117 9, 27, 31, 9, 32, 6, 9, 29, 0, 0,
118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
130 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
133 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
134 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
138 0, 0, 0, 2,
139 };
140 short yycheck[] = { 2,
141 9, 1, 2, 3, 6, 4, 9, 13, 14, 9,
142 10, 1, 2, 3, 13, 24, 1, 2, 3, 9,
143 4, 13, 13, 10, 9, 5, 6, 11, 5, 6,
144 10, 5, 6, 10, 5, 5, 10, 5, 1, 10,
145 10, 1, 14, 4, 1, 1, 5, 22, -1, -1,
146 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
147 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
148 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
149 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
150 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
151 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
152 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
153 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
154 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
155 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
157 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
158 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
159 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
160 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
161 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
162 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
163 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
164 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
165 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
166 -1, -1, -1, 256,
167 };
168 #define YYFINAL 1
169 #ifndef YYDEBUG
170 #define YYDEBUG 0
171 #endif
172 #define YYMAXTOKEN 14
173 #if YYDEBUG
174 char *yyname[] = {
175 "end-of-file","INTEGER","WORD","STRING","OPEN","CLOSE","COMMA","NEWLINE",
176 "ERROR","OPEN_SQUARE","CLOSE_SQUARE","EQUALS",0,"PERIOD","EXP",
177 };
178 char *yyrule[] = {
179 "$accept : commands",
180 "commands :",
181 "commands : commands command",
182 "command : WORD PERIOD",
183 "command : expr PERIOD",
184 "command : error PERIOD",
185 "expr : WORD OPEN arglist CLOSE",
186 "expr : OPEN_SQUARE CLOSE_SQUARE",
187 "expr : OPEN_SQUARE arglist CLOSE_SQUARE",
188 "arglist :",
189 "arglist : arg",
190 "arglist : arg COMMA arglist",
191 "arg : WORD EQUALS arg1",
192 "arg : arg1",
193 "arg1 : WORD",
194 "arg1 : STRING",
195 "arg1 : INTEGER",
196 "arg1 : INTEGER PERIOD INTEGER",
197 "arg1 : INTEGER EXP INTEGER",
198 "arg1 : INTEGER PERIOD INTEGER EXP INTEGER",
199 "arg1 : expr",
200 };
201 #endif
202 #define yyclearin (yychar=(-1))
203 #define yyerrok (yyerrflag=0)
204 #ifdef YYSTACKSIZE
205 #ifndef YYMAXDEPTH
206 #define YYMAXDEPTH YYSTACKSIZE
207 #endif
208 #else
209 #ifdef YYMAXDEPTH
210 #define YYSTACKSIZE YYMAXDEPTH
211 #else
212 #define YYSTACKSIZE 600
213 #define YYMAXDEPTH 600
214 #endif
215 #endif
216 int yydebug;
217 int yynerrs;
218 int yyerrflag;
219 int yychar;
220 short *yyssp;
221 YYSTYPE *yyvsp;
222 YYSTYPE yyval;
223 YYSTYPE yylval;
224 short yyss[YYSTACKSIZE];
225 YYSTYPE yyvs[YYSTACKSIZE];
226 #define yystacksize YYSTACKSIZE
227 #line 118 "parser.y"
228
229 #ifdef IDE_INVOKED
230 #include "../common/doslex.c"
231 #else
232 #if (defined(__MWERKS__))
233 #include "../common/cwlex_yy.c"
234 #else
235 #include "../common/lex_yy.c"
236 #endif
237 #endif
238
239 /*
240 void yyerror(s)
241 char *s;
242 {
243 syntax_error(s);
244 }
245 */
246
247 /* Ansi prototype. If this doesn't work for you... uncomment
248 the above instead.
249 */
250
251 void yyerror(char *s)
252 {
253 syntax_error(s);
254 }
255
256 /*
257 * Unfortunately, my DOS version of FLEX
258 * requires yywrap to be #def'ed, whereas
259 * the UNIX flex expects a proper function.
260 */
261
262 /* Not sure if __SC__ is the appropriate thing
263 * to test
264 */
265
266 #ifndef __SC__
267 #ifdef USE_DEFINE
268 #ifndef yywrap
269 #define yywrap() 1
270 #endif
271 #else
272 int yywrap() { return 1; }
273 #endif
274 #endif
275 #line 247 "y_tab.c"
276 #define YYABORT goto yyabort
277 #define YYACCEPT goto yyaccept
278 #define YYERROR goto yyerrlab
279 int
280 yyparse()
281 {
282 register int yym, yyn, yystate;
283 #if YYDEBUG
284 register char *yys;
285 extern char *getenv();
286
287 if (yys = getenv("YYDEBUG"))
288 {
289 yyn = *yys;
290 if (yyn >= '0' && yyn <= '9')
291 yydebug = yyn - '0';
292 }
293 #endif
294
295 yynerrs = 0;
296 yyerrflag = 0;
297 yychar = (-1);
298
299 yyssp = yyss;
300 yyvsp = yyvs;
301 *yyssp = yystate = 0;
302
303 yyloop:
304 if (yyn = yydefred[yystate]) goto yyreduce;
305 if (yychar < 0)
306 {
307 if ((yychar = yylex()) < 0) yychar = 0;
308 #if YYDEBUG
309 if (yydebug)
310 {
311 yys = 0;
312 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
313 if (!yys) yys = "illegal-symbol";
314 printf("yydebug: state %d, reading %d (%s)\n", yystate,
315 yychar, yys);
316 }
317 #endif
318 }
319 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
320 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
321 {
322 #if YYDEBUG
323 if (yydebug)
324 printf("yydebug: state %d, shifting to state %d\n",
325 yystate, yytable[yyn]);
326 #endif
327 if (yyssp >= yyss + yystacksize - 1)
328 {
329 goto yyoverflow;
330 }
331 *++yyssp = yystate = yytable[yyn];
332 *++yyvsp = yylval;
333 yychar = (-1);
334 if (yyerrflag > 0) --yyerrflag;
335 goto yyloop;
336 }
337 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
338 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
339 {
340 yyn = yytable[yyn];
341 goto yyreduce;
342 }
343 if (yyerrflag) goto yyinrecovery;
344 #ifdef lint
345 goto yynewerror;
346 #endif
347 yynewerror:
348 yyerror("syntax error");
349 #ifdef lint
350 goto yyerrlab;
351 #endif
352 yyerrlab:
353 ++yynerrs;
354 yyinrecovery:
355 if (yyerrflag < 3)
356 {
357 yyerrflag = 3;
358 for (;;)
359 {
360 if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
361 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
362 {
363 #if YYDEBUG
364 if (yydebug)
365 printf("yydebug: state %d, error recovery shifting\
366 to state %d\n", *yyssp, yytable[yyn]);
367 #endif
368 if (yyssp >= yyss + yystacksize - 1)
369 {
370 goto yyoverflow;
371 }
372 *++yyssp = yystate = yytable[yyn];
373 *++yyvsp = yylval;
374 goto yyloop;
375 }
376 else
377 {
378 #if YYDEBUG
379 if (yydebug)
380 printf("yydebug: error recovery discarding state %d\n",
381 *yyssp);
382 #endif
383 if (yyssp <= yyss) goto yyabort;
384 --yyssp;
385 --yyvsp;
386 }
387 }
388 }
389 else
390 {
391 if (yychar == 0) goto yyabort;
392 #if YYDEBUG
393 if (yydebug)
394 {
395 yys = 0;
396 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
397 if (!yys) yys = "illegal-symbol";
398 printf("yydebug: state %d, error recovery discards token %d (%s)\n",
399 yystate, yychar, yys);
400 }
401 #endif
402 yychar = (-1);
403 goto yyloop;
404 }
405 yyreduce:
406 #if YYDEBUG
407 if (yydebug)
408 printf("yydebug: state %d, reducing by rule %d (%s)\n",
409 yystate, yyn, yyrule[yyn]);
410 #endif
411 yym = yylen[yyn];
412 yyval = yyvsp[1-yym];
413 switch (yyn)
414 {
415 case 3:
416 #line 68 "parser.y"
417 {process_command(proio_cons(wxmake_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);}
418 break;
419 case 4:
420 #line 70 "parser.y"
421 {process_command(yyvsp[-1].s);}
422 break;
423 case 5:
424 #line 72 "parser.y"
425 {syntax_error("Unrecognized command.");}
426 break;
427 case 6:
428 #line 76 "parser.y"
429 {yyval.s = proio_cons(wxmake_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);}
430 break;
431 case 7:
432 #line 78 "parser.y"
433 {yyval.s = proio_cons(NULL, NULL);}
434 break;
435 case 8:
436 #line 80 "parser.y"
437 {yyval.s = yyvsp[-1].s; }
438 break;
439 case 9:
440 #line 84 "parser.y"
441 {yyval.s = NULL;}
442 break;
443 case 10:
444 #line 86 "parser.y"
445 {yyval.s = proio_cons(yyvsp[0].s, NULL);}
446 break;
447 case 11:
448 #line 89 "parser.y"
449 {yyval.s = proio_cons(yyvsp[-2].s, yyvsp[0].s);}
450 break;
451 case 12:
452 #line 93 "parser.y"
453 {yyval.s = proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL)));
454 free(yyvsp[-2].s); }
455 break;
456 case 13:
457 #line 96 "parser.y"
458 {yyval.s = yyvsp[0].s; }
459 break;
460 case 14:
461 #line 99 "parser.y"
462 {yyval.s = wxmake_word(yyvsp[0].s); free(yyvsp[0].s);}
463 break;
464 case 15:
465 #line 101 "parser.y"
466 {yyval.s = wxmake_string(yyvsp[0].s); free(yyvsp[0].s);}
467 break;
468 case 16:
469 #line 103 "parser.y"
470 {yyval.s = wxmake_integer(yyvsp[0].s); free(yyvsp[0].s);}
471 break;
472 case 17:
473 #line 105 "parser.y"
474 {yyval.s = wxmake_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
475 break;
476 case 18:
477 #line 107 "parser.y"
478 {yyval.s = wxmake_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
479 break;
480 case 19:
481 #line 110 "parser.y"
482 {yyval.s = wxmake_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s);
483 free(yyvsp[0].s); }
484 break;
485 case 20:
486 #line 114 "parser.y"
487 {yyval.s = yyvsp[0].s;}
488 break;
489 #line 461 "y_tab.c"
490 }
491 yyssp -= yym;
492 yystate = *yyssp;
493 yyvsp -= yym;
494 yym = yylhs[yyn];
495 if (yystate == 0 && yym == 0)
496 {
497 #if YYDEBUG
498 if (yydebug)
499 printf("yydebug: after reduction, shifting from state 0 to\
500 state %d\n", YYFINAL);
501 #endif
502 yystate = YYFINAL;
503 *++yyssp = YYFINAL;
504 *++yyvsp = yyval;
505 if (yychar < 0)
506 {
507 if ((yychar = yylex()) < 0) yychar = 0;
508 #if YYDEBUG
509 if (yydebug)
510 {
511 yys = 0;
512 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
513 if (!yys) yys = "illegal-symbol";
514 printf("yydebug: state %d, reading %d (%s)\n",
515 YYFINAL, yychar, yys);
516 }
517 #endif
518 }
519 if (yychar == 0) goto yyaccept;
520 goto yyloop;
521 }
522 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
523 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
524 yystate = yytable[yyn];
525 else
526 yystate = yydgoto[yym];
527 #if YYDEBUG
528 if (yydebug)
529 printf("yydebug: after reduction, shifting from state %d \
530 to state %d\n", *yyssp, yystate);
531 #endif
532 if (yyssp >= yyss + yystacksize - 1)
533 {
534 goto yyoverflow;
535 }
536 *++yyssp = yystate;
537 *++yyvsp = yyval;
538 goto yyloop;
539 yyoverflow:
540 yyerror("yacc stack overflow");
541 yyabort:
542 return (1);
543 yyaccept:
544 return (0);
545 }