]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/deprecated/cwy_tab.c
1 /* Copyright: (c) Julian Smart */
2 /* Licence: wxWindows Licence */
5 static char yysccsid
[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90";
14 #include "wx/deprecated/expr.h"
17 #define __EXTERN_C__ 1
20 #if defined(__cplusplus) || defined(__STDC__)
21 #if defined(__cplusplus) && defined(__EXTERN_C__)
26 int PROIO_yyparse(void) {
32 int yyback(int *, int);
34 int read( int , char * , int ) ;
36 int _read( int , void * , size_t ) ;
40 //int fileno( FILE* ) ; This is defined in watcom
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
52 /* int yyoutput(int); */
58 #if defined(__cplusplus) || defined(__STDC__)
59 #if defined(__cplusplus) && defined(__EXTERN_C__)
66 /* struct pexpr *expr; */
79 #define CLOSE_SQUARE 10
84 0, 0, 1, 1, 1, 2, 2, 2, 3, 3,
85 3, 4, 4, 5, 5, 5, 5, 5, 5, 5,
88 0, 2, 2, 2, 2, 4, 2, 3, 0, 1,
89 3, 3, 1, 1, 1, 1, 3, 3, 5, 1,
91 short 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,
97 short yydgoto
[] = { 1,
100 short 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,
106 short 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,
112 short yygindex
[] = { 0,
115 #define YYTABLESIZE 254
116 short 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,
144 short 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,
176 #define YYMAXTOKEN 14
179 "end-of-file","INTEGER","WORD","STRING","OPEN","CLOSE","COMMA","NEWLINE",
180 "ERROR","OPEN_SQUARE","CLOSE_SQUARE","EQUALS",0,"PERIOD","EXP",
183 "$accept : 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",
194 "arglist : arg COMMA arglist",
195 "arg : WORD EQUALS arg1",
200 "arg1 : INTEGER PERIOD INTEGER",
201 "arg1 : INTEGER EXP INTEGER",
202 "arg1 : INTEGER PERIOD INTEGER EXP INTEGER",
206 #define yyclearin (yychar=(-1))
207 #define yyerrok (yyerrflag=0)
210 #define YYMAXDEPTH YYSTACKSIZE
214 #define YYSTACKSIZE YYMAXDEPTH
216 #define YYSTACKSIZE 600
217 #define YYMAXDEPTH 600
228 short yyss
[YYSTACKSIZE
];
229 YYSTYPE yyvs
[YYSTACKSIZE
];
230 #define yystacksize YYSTACKSIZE
236 #if (defined(__MWERKS__))
237 #include "cwlex_yy.c"
251 /* Ansi prototype. If this doesn't work for you... uncomment
255 void yyerror(char *s
)
261 * Unfortunately, my DOS version of FLEX
262 * requires yywrap to be #def'ed, whereas
263 * the UNIX flex expects a proper function.
266 /* Not sure if __SC__ is the appropriate thing
276 int yywrap() { return 1; }
280 #define YYABORT goto yyabort
281 #define YYACCEPT goto yyaccept
282 #define YYERROR goto yyerrlab
286 register int yym
, yyn
, yystate
;
289 extern char *getenv();
291 if (yys
= getenv("YYDEBUG"))
294 if (yyn
>= '0' && yyn
<= '9')
305 *yyssp
= yystate
= 0;
308 if (yyn
= yydefred
[yystate
]) goto yyreduce
;
311 if ((yychar
= yylex()) < 0) yychar
= 0;
316 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
317 if (!yys
) yys
= "illegal-symbol";
318 printf("yydebug: state %d, reading %d (%s)\n", yystate
,
323 if ((yyn
= yysindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
324 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
328 printf("yydebug: state %d, shifting to state %d\n",
329 yystate
, yytable
[yyn
]);
331 if (yyssp
>= yyss
+ yystacksize
- 1)
335 *++yyssp
= yystate
= yytable
[yyn
];
338 if (yyerrflag
> 0) --yyerrflag
;
341 if ((yyn
= yyrindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
342 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
347 if (yyerrflag
) goto yyinrecovery
;
352 yyerror("syntax error");
364 if ((yyn
= yysindex
[*yyssp
]) && (yyn
+= YYERRCODE
) >= 0 &&
365 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == YYERRCODE
)
369 printf("yydebug: state %d, error recovery shifting\
370 to state %d\n", *yyssp
, yytable
[yyn
]);
372 if (yyssp
>= yyss
+ yystacksize
- 1)
376 *++yyssp
= yystate
= yytable
[yyn
];
384 printf("yydebug: error recovery discarding state %d\n",
387 if (yyssp
<= yyss
) goto yyabort
;
395 if (yychar
== 0) goto yyabort
;
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
);
412 printf("yydebug: state %d, reducing by rule %d (%s)\n",
413 yystate
, yyn
, yyrule
[yyn
]);
416 yyval
= yyvsp
[1-yym
];
421 {process_command(proio_cons(wxmake_word(yyvsp
[-1].s
), NULL
)); free(yyvsp
[-1].s
);}
425 {process_command(yyvsp
[-1].s
);}
429 {syntax_error("Unrecognized command.");}
433 {yyval
.s
= proio_cons(wxmake_word(yyvsp
[-3].s
), yyvsp
[-1].s
); free(yyvsp
[-3].s
);}
437 {yyval
.s
= proio_cons(NULL
, NULL
);}
441 {yyval
.s
= yyvsp
[-1].s
; }
449 {yyval
.s
= proio_cons(yyvsp
[0].s
, NULL
);}
453 {yyval
.s
= proio_cons(yyvsp
[-2].s
, yyvsp
[0].s
);}
457 {yyval
.s
= proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp
[-2].s
), proio_cons(yyvsp
[0].s
, NULL
)));
462 {yyval
.s
= yyvsp
[0].s
; }
466 {yyval
.s
= wxmake_word(yyvsp
[0].s
); free(yyvsp
[0].s
);}
470 {yyval
.s
= wxmake_string(yyvsp
[0].s
); free(yyvsp
[0].s
);}
474 {yyval
.s
= wxmake_integer(yyvsp
[0].s
); free(yyvsp
[0].s
);}
478 {yyval
.s
= wxmake_real(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
482 {yyval
.s
= wxmake_exp(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
486 {yyval
.s
= wxmake_exp2(yyvsp
[-4].s
, yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-4].s
); free(yyvsp
[-2].s
);
491 {yyval
.s
= yyvsp
[0].s
;}
499 if (yystate
== 0 && yym
== 0)
503 printf("yydebug: after reduction, shifting from state 0 to\
504 state %d\n", YYFINAL
);
511 if ((yychar
= yylex()) < 0) yychar
= 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
);
523 if (yychar
== 0) goto yyaccept
;
526 if ((yyn
= yygindex
[yym
]) && (yyn
+= yystate
) >= 0 &&
527 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yystate
)
528 yystate
= yytable
[yyn
];
530 yystate
= yydgoto
[yym
];
533 printf("yydebug: after reduction, shifting from state %d \
534 to state %d\n", *yyssp
, yystate
);
536 if (yyssp
>= yyss
+ yystacksize
- 1)
544 yyerror("yacc stack overflow");