]>
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__)
24 int yyback(int *, int);
26 int read( int , char * , int ) ;
28 int _read( int , void * , size_t ) ;
39 /* You may need to put /DLEX_SCANNER in your makefile
40 * if you're using LEX!
41 Last change: JS 13 Jul 97 6:12 pm
44 /* int yyoutput(int); */
50 #if defined(__cplusplus) || defined(__STDC__)
51 #if defined(__cplusplus) && defined(__EXTERN_C__)
58 /* struct pexpr *expr; */
71 #define CLOSE_SQUARE 10
76 0, 0, 1, 1, 1, 2, 2, 2, 3, 3,
77 3, 4, 4, 5, 5, 5, 5, 5, 5, 5,
80 0, 2, 2, 2, 2, 4, 2, 3, 0, 1,
81 3, 3, 1, 1, 1, 1, 3, 3, 5, 1,
83 short yydefred
[] = { 1,
84 0, 0, 0, 0, 2, 0, 5, 3, 0, 0,
85 0, 15, 7, 20, 0, 0, 13, 4, 0, 0,
86 0, 0, 8, 0, 6, 0, 18, 0, 12, 11,
89 short yydgoto
[] = { 1,
92 short yysindex
[] = { 0,
93 -2, 9, 2, 1, 0, 10, 0, 0, 11, -5,
94 17, 0, 0, 0, 14, -1, 0, 0, 33, 38,
95 41, 16, 0, 11, 0, 29, 0, 40, 0, 0,
98 short yyrindex
[] = { 0,
99 0, 0, 0, 0, 0, 0, 0, 0, 42, 21,
100 24, 0, 0, 0, 0, 30, 0, 0, 0, 0,
101 0, 0, 0, 31, 0, 27, 0, 24, 0, 0,
104 short yygindex
[] = { 0,
107 #define YYTABLESIZE 254
108 short yytable
[] = { 3,
109 19, 10, 11, 12, 24, 9, 4, 20, 21, 4,
110 13, 10, 11, 12, 8, 30, 10, 28, 12, 4,
111 9, 7, 18, 23, 4, 16, 16, 22, 14, 14,
112 16, 17, 17, 14, 10, 9, 17, 25, 26, 10,
113 9, 27, 31, 9, 32, 6, 9, 29, 0, 0,
114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
117 0, 0, 0, 0, 0, 0, 0, 0, 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,
136 short yycheck
[] = { 2,
137 9, 1, 2, 3, 6, 4, 9, 13, 14, 9,
138 10, 1, 2, 3, 13, 24, 1, 2, 3, 9,
139 4, 13, 13, 10, 9, 5, 6, 11, 5, 6,
140 10, 5, 6, 10, 5, 5, 10, 5, 1, 10,
141 10, 1, 14, 4, 1, 1, 5, 22, -1, -1,
142 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
143 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
144 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
145 -1, -1, -1, -1, -1, -1, -1, -1, -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,
168 #define YYMAXTOKEN 14
171 "end-of-file","INTEGER","WORD","STRING","OPEN","CLOSE","COMMA","NEWLINE",
172 "ERROR","OPEN_SQUARE","CLOSE_SQUARE","EQUALS",0,"PERIOD","EXP",
175 "$accept : commands",
177 "commands : commands command",
178 "command : WORD PERIOD",
179 "command : expr PERIOD",
180 "command : error PERIOD",
181 "expr : WORD OPEN arglist CLOSE",
182 "expr : OPEN_SQUARE CLOSE_SQUARE",
183 "expr : OPEN_SQUARE arglist CLOSE_SQUARE",
186 "arglist : arg COMMA arglist",
187 "arg : WORD EQUALS arg1",
192 "arg1 : INTEGER PERIOD INTEGER",
193 "arg1 : INTEGER EXP INTEGER",
194 "arg1 : INTEGER PERIOD INTEGER EXP INTEGER",
198 #define yyclearin (yychar=(-1))
199 #define yyerrok (yyerrflag=0)
202 #define YYMAXDEPTH YYSTACKSIZE
206 #define YYSTACKSIZE YYMAXDEPTH
208 #define YYSTACKSIZE 600
209 #define YYMAXDEPTH 600
220 short yyss
[YYSTACKSIZE
];
221 YYSTYPE yyvs
[YYSTACKSIZE
];
222 #define yystacksize YYSTACKSIZE
226 #include "../common/doslex.c"
228 #if (defined(__MWERKS__))
229 #include "../common/cwlex_yy.c"
231 #include "../common/lex_yy.c"
243 /* Ansi prototype. If this doesn't work for you... uncomment
247 void yyerror(char *s
)
253 * Unfortunately, my DOS version of FLEX
254 * requires yywrap to be #def'ed, whereas
255 * the UNIX flex expects a proper function.
258 /* Not sure if __SC__ is the appropriate thing
268 int yywrap() { return 1; }
272 #define YYABORT goto yyabort
273 #define YYACCEPT goto yyaccept
274 #define YYERROR goto yyerrlab
278 register int yym
, yyn
, yystate
;
281 extern char *getenv();
283 if (yys
= getenv("YYDEBUG"))
286 if (yyn
>= '0' && yyn
<= '9')
297 *yyssp
= yystate
= 0;
300 if (yyn
= yydefred
[yystate
]) goto yyreduce
;
303 if ((yychar
= yylex()) < 0) yychar
= 0;
308 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
309 if (!yys
) yys
= "illegal-symbol";
310 printf("yydebug: state %d, reading %d (%s)\n", yystate
,
315 if ((yyn
= yysindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
316 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
320 printf("yydebug: state %d, shifting to state %d\n",
321 yystate
, yytable
[yyn
]);
323 if (yyssp
>= yyss
+ yystacksize
- 1)
327 *++yyssp
= yystate
= yytable
[yyn
];
330 if (yyerrflag
> 0) --yyerrflag
;
333 if ((yyn
= yyrindex
[yystate
]) && (yyn
+= yychar
) >= 0 &&
334 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yychar
)
339 if (yyerrflag
) goto yyinrecovery
;
344 yyerror("syntax error");
356 if ((yyn
= yysindex
[*yyssp
]) && (yyn
+= YYERRCODE
) >= 0 &&
357 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == YYERRCODE
)
361 printf("yydebug: state %d, error recovery shifting\
362 to state %d\n", *yyssp
, yytable
[yyn
]);
364 if (yyssp
>= yyss
+ yystacksize
- 1)
368 *++yyssp
= yystate
= yytable
[yyn
];
376 printf("yydebug: error recovery discarding state %d\n",
379 if (yyssp
<= yyss
) goto yyabort
;
387 if (yychar
== 0) goto yyabort
;
392 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
393 if (!yys
) yys
= "illegal-symbol";
394 printf("yydebug: state %d, error recovery discards token %d (%s)\n",
395 yystate
, yychar
, yys
);
404 printf("yydebug: state %d, reducing by rule %d (%s)\n",
405 yystate
, yyn
, yyrule
[yyn
]);
408 yyval
= yyvsp
[1-yym
];
413 {process_command(proio_cons(wxmake_word(yyvsp
[-1].s
), NULL
)); free(yyvsp
[-1].s
);}
417 {process_command(yyvsp
[-1].s
);}
421 {syntax_error("Unrecognized command.");}
425 {yyval
.s
= proio_cons(wxmake_word(yyvsp
[-3].s
), yyvsp
[-1].s
); free(yyvsp
[-3].s
);}
429 {yyval
.s
= proio_cons(NULL
, NULL
);}
433 {yyval
.s
= yyvsp
[-1].s
; }
441 {yyval
.s
= proio_cons(yyvsp
[0].s
, NULL
);}
445 {yyval
.s
= proio_cons(yyvsp
[-2].s
, yyvsp
[0].s
);}
449 {yyval
.s
= proio_cons(wxmake_word("="), proio_cons(wxmake_word(yyvsp
[-2].s
), proio_cons(yyvsp
[0].s
, NULL
)));
454 {yyval
.s
= yyvsp
[0].s
; }
458 {yyval
.s
= wxmake_word(yyvsp
[0].s
); free(yyvsp
[0].s
);}
462 {yyval
.s
= wxmake_string(yyvsp
[0].s
); free(yyvsp
[0].s
);}
466 {yyval
.s
= wxmake_integer(yyvsp
[0].s
); free(yyvsp
[0].s
);}
470 {yyval
.s
= wxmake_real(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
474 {yyval
.s
= wxmake_exp(yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-2].s
); free(yyvsp
[0].s
); }
478 {yyval
.s
= wxmake_exp2(yyvsp
[-4].s
, yyvsp
[-2].s
, yyvsp
[0].s
); free(yyvsp
[-4].s
); free(yyvsp
[-2].s
);
483 {yyval
.s
= yyvsp
[0].s
;}
491 if (yystate
== 0 && yym
== 0)
495 printf("yydebug: after reduction, shifting from state 0 to\
496 state %d\n", YYFINAL
);
503 if ((yychar
= yylex()) < 0) yychar
= 0;
508 if (yychar
<= YYMAXTOKEN
) yys
= yyname
[yychar
];
509 if (!yys
) yys
= "illegal-symbol";
510 printf("yydebug: state %d, reading %d (%s)\n",
511 YYFINAL
, yychar
, yys
);
515 if (yychar
== 0) goto yyaccept
;
518 if ((yyn
= yygindex
[yym
]) && (yyn
+= yystate
) >= 0 &&
519 yyn
<= YYTABLESIZE
&& yycheck
[yyn
] == yystate
)
520 yystate
= yytable
[yyn
];
522 yystate
= yydgoto
[yym
];
525 printf("yydebug: after reduction, shifting from state %d \
526 to state %d\n", *yyssp
, yystate
);
528 if (yyssp
>= yyss
+ yystacksize
- 1)
536 yyerror("yacc stack overflow");