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