]>
git.saurik.com Git - wxWidgets.git/blob - src/common/cwy_tab.c
2 static char yysccsid
[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90";
13 #define __EXTERN_C__ 1
16 #if defined(__cplusplus) || defined(__STDC__)
17 #if defined(__cplusplus) && defined(__EXTERN_C__)
22 int PROIO_yyparse(void) {
28 int yyback(int *, int);
30 int read( int , char * , int ) ;
33 int _read( int , void * , size_t ) ;
38 //int fileno( FILE* ) ; This is defined in watcom
45 /* You may need to put /DLEX_SCANNER in your makefile
46 * if you're using LEX!
47 Last change: JS 13 Jul 97 6:12 pm
50 /* int yyoutput(int); */
56 #if defined(__cplusplus) || defined(__STDC__)
57 #if defined(__cplusplus) && defined(__EXTERN_C__)
64 /* struct pexpr *expr; */
77 #define CLOSE_SQUARE 10
82 0, 0, 1, 1, 1, 2, 2, 2, 3, 3,
83 3, 4, 4, 5, 5, 5, 5, 5, 5, 5,
86 0, 2, 2, 2, 2, 4, 2, 3, 0, 1,
87 3, 3, 1, 1, 1, 1, 3, 3, 5, 1,
89 short yydefred
[] = { 1,
90 0, 0, 0, 0, 2, 0, 5, 3, 0, 0,
91 0, 15, 7, 20, 0, 0, 13, 4, 0, 0,
92 0, 0, 8, 0, 6, 0, 18, 0, 12, 11,
95 short yydgoto
[] = { 1,
98 short yysindex
[] = { 0,
99 -2, 9, 2, 1, 0, 10, 0, 0, 11, -5,
100 17, 0, 0, 0, 14, -1, 0, 0, 33, 38,
101 41, 16, 0, 11, 0, 29, 0, 40, 0, 0,
104 short yyrindex
[] = { 0,
105 0, 0, 0, 0, 0, 0, 0, 0, 42, 21,
106 24, 0, 0, 0, 0, 30, 0, 0, 0, 0,
107 0, 0, 0, 31, 0, 27, 0, 24, 0, 0,
110 short yygindex
[] = { 0,
113 #define YYTABLESIZE 254
114 short yytable
[] = { 3,
115 19, 10, 11, 12, 24, 9, 4, 20, 21, 4,
116 13, 10, 11, 12, 8, 30, 10, 28, 12, 4,
117 9, 7, 18, 23, 4, 16, 16, 22, 14, 14,
118 16, 17, 17, 14, 10, 9, 17, 25, 26, 10,
119 9, 27, 31, 9, 32, 6, 9, 29, 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, 0, 0, 0, 0, 0, 0, 0,
139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
142 short yycheck
[] = { 2,
143 9, 1, 2, 3, 6, 4, 9, 13, 14, 9,
144 10, 1, 2, 3, 13, 24, 1, 2, 3, 9,
145 4, 13, 13, 10, 9, 5, 6, 11, 5, 6,
146 10, 5, 6, 10, 5, 5, 10, 5, 1, 10,
147 10, 1, 14, 4, 1, 1, 5, 22, -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, -1, -1, -1, -1, -1, -1, -1,
167 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
174 #define YYMAXTOKEN 14
177 "end-of-file","INTEGER","WORD","STRING","OPEN","CLOSE","COMMA","NEWLINE",
178 "ERROR","OPEN_SQUARE","CLOSE_SQUARE","EQUALS",0,"PERIOD","EXP",
181 "$accept : commands",
183 "commands : commands command",
184 "command : WORD PERIOD",
185 "command : expr PERIOD",
186 "command : error PERIOD",
187 "expr : WORD OPEN arglist CLOSE",
188 "expr : OPEN_SQUARE CLOSE_SQUARE",
189 "expr : OPEN_SQUARE arglist CLOSE_SQUARE",
192 "arglist : arg COMMA arglist",
193 "arg : WORD EQUALS arg1",
198 "arg1 : INTEGER PERIOD INTEGER",
199 "arg1 : INTEGER EXP INTEGER",
200 "arg1 : INTEGER PERIOD INTEGER EXP INTEGER",
204 #define yyclearin (yychar=(-1))
205 #define yyerrok (yyerrflag=0)
208 #define YYMAXDEPTH YYSTACKSIZE
212 #define YYSTACKSIZE YYMAXDEPTH
214 #define YYSTACKSIZE 600
215 #define YYMAXDEPTH 600
226 short yyss
[YYSTACKSIZE
];
227 YYSTYPE yyvs
[YYSTACKSIZE
];
228 #define yystacksize YYSTACKSIZE
232 #include "../common/doslex.c"
234 #if (defined(__MWERKS__))
235 #include "../common/cwlex_yy.c"
237 #include "../common/lex_yy.c"
249 /* Ansi prototype. If this doesn't work for you... uncomment
253 void yyerror(char *s
)
259 * Unfortunately, my DOS version of FLEX
260 * requires yywrap to be #def'ed, whereas
261 * the UNIX flex expects a proper function.
264 /* Not sure if __SC__ is the appropriate thing
274 int yywrap() { return 1; }
278 #define YYABORT goto yyabort
279 #define YYACCEPT goto yyaccept
280 #define YYERROR goto yyerrlab
284 register int yym
, yyn
, yystate
;
287 extern char *getenv();
289 if (yys
= getenv("YYDEBUG"))
292 if (yyn
>= '0' && yyn
<= '9')
303 *yyssp
= yystate
= 0;
306 if (yyn
= yydefred
[yystate
]) goto yyreduce
;
309 if ((yychar
= yylex()) < 0) yychar
= 0;
314 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
315 if (!yys
) yys
= "illegal-symbol";
316 printf("yydebug: state %d, reading %d (%s)\n", yystate
,
321 if ((yyn
= yysindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
322 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
326 printf("yydebug: state %d, shifting to state %d\n",
327 yystate
, yytable
[yyn
]);
329 if (yyssp
>= yyss
+ yystacksize
- 1)
333 *++yyssp
= yystate
= yytable
[yyn
];
336 if (yyerrflag
> 0) --yyerrflag
;
339 if ((yyn
= yyrindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
340 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
345 if (yyerrflag
) goto yyinrecovery
;
350 yyerror("syntax error");
362 if ((yyn
= yysindex
[*yyssp
]) && (yyn
+= YYERRCODE
) >= 0 &&
363 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == YYERRCODE
)
367 printf("yydebug: state %d, error recovery shifting\
368 to state %d\n", *yyssp
, yytable
[yyn
]);
370 if (yyssp
>= yyss
+ yystacksize
- 1)
374 *++yyssp
= yystate
= yytable
[yyn
];
382 printf("yydebug: error recovery discarding state %d\n",
385 if (yyssp
<= yyss
) goto yyabort
;
393 if (yychar
== 0) goto yyabort
;
398 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
399 if (!yys
) yys
= "illegal-symbol";
400 printf("yydebug: state %d, error recovery discards token %d (%s)\n",
401 yystate
, yychar
, yys
);
410 printf("yydebug: state %d, reducing by rule %d (%s)\n",
411 yystate
, yyn
, yyrule
[yyn
]);
414 yyval
= yyvsp
[1-yym
];
419 {process_command(proio_cons(wxmake_word(yyvsp
[-1].s
), NULL
)); free(yyvsp
[-1].s
);}
423 {process_command(yyvsp
[-1].s
);}
427 {syntax_error("Unrecognized command.");}
431 {yyval
.s
= proio_cons(wxmake_word(yyvsp
[-3].s
), yyvsp
[-1].s
); free(yyvsp
[-3].s
);}
435 {yyval
.s
= proio_cons(NULL
, NULL
);}
439 {yyval
.s
= yyvsp
[-1].s
; }
447 {yyval
.s
= proio_cons(yyvsp
[0].s
, NULL
);}
451 {yyval
.s
= proio_cons(yyvsp
[-2].s
, yyvsp
[0].s
);}
455 {yyval
.s
= proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp
[-2].s
), proio_cons(yyvsp
[0].s
, NULL
)));
460 {yyval
.s
= yyvsp
[0].s
; }
464 {yyval
.s
= wxmake_word(yyvsp
[0].s
); free(yyvsp
[0].s
);}
468 {yyval
.s
= wxmake_string(yyvsp
[0].s
); free(yyvsp
[0].s
);}
472 {yyval
.s
= wxmake_integer(yyvsp
[0].s
); free(yyvsp
[0].s
);}
476 {yyval
.s
= wxmake_real(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
480 {yyval
.s
= wxmake_exp(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
484 {yyval
.s
= wxmake_exp2(yyvsp
[-4].s
, yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-4].s
); free(yyvsp
[-2].s
);
489 {yyval
.s
= yyvsp
[0].s
;}
497 if (yystate
== 0 && yym
== 0)
501 printf("yydebug: after reduction, shifting from state 0 to\
502 state %d\n", YYFINAL
);
509 if ((yychar
= yylex()) < 0) yychar
= 0;
514 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
515 if (!yys
) yys
= "illegal-symbol";
516 printf("yydebug: state %d, reading %d (%s)\n",
517 YYFINAL
, yychar
, yys
);
521 if (yychar
== 0) goto yyaccept
;
524 if ((yyn
= yygindex
[yym
]) && (yyn
+= yystate
) >= 0 &&
525 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yystate
)
526 yystate
= yytable
[yyn
];
528 yystate
= yydgoto
[yym
];
531 printf("yydebug: after reduction, shifting from state %d \
532 to state %d\n", *yyssp
, yystate
);
534 if (yyssp
>= yyss
+ yystacksize
- 1)
542 yyerror("yacc stack overflow");