2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
50 extern char *filename;
54 static GList *class_nodes = NULL;
57 static GList *typestack = NULL;
59 static GList *funcargs = NULL;
60 static GList *checks = NULL;
61 static int has_self = FALSE;
62 static int vararg = FALSE;
64 static GList *gtktypes = NULL;
69 extern int ccode_line;
80 if(strcmp(yytext,"\n")==0) {
81 out=g_strconcat("Error: ",str," before newline",NULL);
82 } else if(yytext[0]=='\0') {
83 out=g_strconcat("Error: ",str," at end of input",NULL);
85 char *tmp = g_strdup(yytext);
86 while((p=strchr(tmp,'\n')))
89 out=g_strconcat("Error: ",str," before '",tmp,"'",NULL);
93 fprintf(stderr,"%s:%d: %s\n",filename,line_no,out);
100 push_variable(char *name, int scope, int line_no, char *postfix)
103 Type *type = typestack->data;
104 typestack = g_list_remove(typestack,typestack->data);
106 type->postfix = postfix;
108 var = new_variable(scope,type,name,line_no);
109 class_nodes = g_list_append(class_nodes, var);
113 push_function(int scope, char *oid, char *id, char *onerror,
114 GString *cbuf,int line_no, int ccode_line, int vararg)
119 if(scope!=INIT_METHOD && scope!=CLASS_INIT_METHOD) {
120 type = typestack->data;
121 typestack = g_list_remove(typestack,typestack->data);
123 type = (Type *)new_type(0,g_strdup("void"),NULL);
126 /* a complicated and ugly test to figure out if we have
127 the wrong number of types for a signal */
128 if((scope == SIGNAL_FIRST_METHOD ||
129 scope == SIGNAL_LAST_METHOD ||
130 scope == PRIVATE_SIGNAL_FIRST_METHOD ||
131 scope == PRIVATE_SIGNAL_LAST_METHOD) &&
132 g_list_length(gtktypes) != g_list_length(funcargs) &&
133 !(g_list_length(funcargs) == 1 &&
134 g_list_length(gtktypes) == 2 &&
135 strcmp(gtktypes->next->data,"NONE")==0)) {
136 print_error(TRUE, _("The number of GTK arguments and "
137 "function arguments for a signal "
138 "don't seem to match"),line_no);
140 node = new_method(scope,type,oid,gtktypes,id,funcargs,
141 onerror,cbuf,line_no,ccode_line,vararg);
145 class_nodes = g_list_append(class_nodes, node);
149 push_funcarg(char *name, char *postfix)
152 Type *type = typestack->data;
153 typestack = g_list_remove(typestack,typestack->data);
155 type->postfix = postfix;
157 node = new_funcarg(type,name,checks);
160 funcargs = g_list_append(funcargs, node);
164 push_init_arg(char *name, int is_class)
171 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
173 tn = g_strdup(((Class *)class)->otype);
175 type = new_type(1,tn,NULL);
176 node = new_funcarg((Type *)type,name,NULL);
177 funcargs = g_list_prepend(funcargs, node);
186 type = new_type(1,g_strdup(((Class *)class)->otype),NULL);
187 ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
188 ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
189 node = new_funcarg((Type *)type,id,ch);
190 funcargs = g_list_prepend(funcargs, node);
217 #define YYFLAG -32768
220 #define YYTRANSLATE(x) ((unsigned)(x) <= 285 ? yytranslate[x] : 74)
222 static const char yytranslate[] = { 0,
223 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
224 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 44, 2, 2, 2, 2, 2, 2, 35,
227 36, 38, 2, 39, 45, 2, 2, 2, 41, 2,
228 2, 2, 2, 2, 2, 2, 2, 2, 34, 43,
229 40, 42, 2, 2, 2, 2, 2, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
231 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
234 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
235 2, 2, 32, 37, 33, 2, 2, 2, 2, 2,
236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
242 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
243 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
245 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
249 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
250 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
255 static const short yyprhs[] = { 0,
256 0, 4, 7, 10, 12, 15, 18, 20, 22, 27,
257 32, 35, 38, 41, 43, 45, 47, 52, 58, 63,
258 69, 81, 90, 94, 95, 99, 101, 103, 106, 108,
259 111, 114, 117, 119, 122, 125, 127, 129, 131, 133,
260 136, 138, 140, 143, 145, 148, 150, 152, 154, 156,
261 158, 161, 163, 167, 171, 174, 177, 179, 184, 188,
262 190, 193, 195, 205, 215, 224, 237, 247, 257, 263,
263 266, 270, 273, 274, 276, 278, 282, 284, 288, 290,
264 294, 296, 299, 303, 310, 318, 321, 323, 325, 328,
265 331, 335, 339, 343, 347, 349, 352
268 static const short yyrhs[] = { 47,
269 48, 47, 0, 48, 47, 0, 47, 48, 0, 48,
270 0, 47, 24, 0, 47, 25, 0, 24, 0, 25,
271 0, 49, 32, 50, 33, 0, 3, 22, 4, 22,
272 0, 50, 65, 0, 50, 51, 0, 50, 52, 0,
273 65, 0, 51, 0, 52, 0, 26, 55, 20, 34,
274 0, 26, 55, 20, 23, 34, 0, 27, 55, 20,
275 34, 0, 27, 55, 20, 23, 34, 0, 28, 53,
276 20, 20, 20, 32, 24, 20, 32, 24, 34, 0,
277 28, 53, 20, 20, 20, 32, 24, 34, 0, 35,
278 54, 36, 0, 0, 20, 37, 54, 0, 20, 0,
279 56, 0, 5, 56, 0, 57, 0, 57, 60, 0,
280 12, 58, 0, 11, 58, 0, 58, 0, 12, 18,
281 0, 11, 18, 0, 18, 0, 17, 0, 16, 0,
282 20, 0, 59, 20, 0, 22, 0, 6, 0, 13,
283 15, 0, 13, 0, 14, 15, 0, 14, 0, 15,
284 0, 9, 0, 8, 0, 7, 0, 38, 60, 0,
285 38, 0, 27, 20, 62, 0, 20, 27, 62, 0,
286 27, 62, 0, 20, 62, 0, 62, 0, 20, 35,
287 63, 36, 0, 63, 39, 20, 0, 20, 0, 32,
288 24, 0, 34, 0, 30, 61, 55, 20, 35, 67,
289 36, 66, 64, 0, 29, 27, 55, 20, 35, 67,
290 36, 66, 64, 0, 29, 55, 20, 35, 67, 36,
291 66, 64, 0, 31, 35, 22, 36, 55, 20, 35,
292 67, 36, 66, 32, 24, 0, 26, 55, 20, 35,
293 67, 36, 66, 32, 24, 0, 27, 55, 20, 35,
294 67, 36, 66, 32, 24, 0, 20, 35, 20, 36,
295 64, 0, 19, 73, 0, 19, 32, 24, 0, 40,
296 41, 0, 0, 6, 0, 20, 0, 20, 39, 68,
297 0, 68, 0, 69, 39, 10, 0, 69, 0, 69,
298 39, 70, 0, 70, 0, 55, 20, 0, 55, 20,
299 23, 0, 55, 20, 35, 20, 71, 36, 0, 55,
300 20, 23, 35, 20, 71, 36, 0, 71, 72, 0,
301 72, 0, 20, 0, 42, 73, 0, 43, 73, 0,
302 42, 40, 73, 0, 43, 40, 73, 0, 40, 40,
303 73, 0, 44, 40, 73, 0, 21, 0, 45, 21,
310 static const short yyrline[] = { 0,
311 197, 198, 199, 200, 203, 207, 211, 215, 221, 228,
312 233, 234, 235, 236, 237, 238, 241, 244, 247, 250,
313 254, 283, 309, 310, 313, 316, 322, 323, 331, 335,
314 342, 345, 348, 351, 354, 357, 360, 363, 366, 369,
315 373, 376, 381, 384, 387, 390, 393, 398, 401, 404,
316 409, 410, 413, 425, 437, 440, 452, 457, 462, 465,
317 470, 471, 475, 485, 495, 505, 511, 516, 521, 542,
318 543, 547, 548, 551, 552, 563, 573, 576, 577, 580,
319 581, 584, 587, 590, 598, 608, 609, 612, 625, 629,
320 633, 637, 641, 645, 651, 652, 656
325 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
327 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
328 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
329 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN",
330 "ARRAY_DIM","CCODE","HCODE","PUBLIC","PRIVATE","ARGUMENT","VIRTUAL","SIGNAL",
331 "OVERRIDE","'{'","'}'","';'","'('","')'","'|'","'*'","','","'='","'1'","'>'",
332 "'<'","'!'","'-'","prog","ccodes","class","classdec","classcode","variable",
333 "argument","argflags","flaglist","type","type1","type2","integer","tspecifier",
334 "stars","fullsigtype","sigtype","tokenlist","codenocode","method","onerror",
335 "funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL
339 static const short yyr1[] = { 0,
340 46, 46, 46, 46, 47, 47, 47, 47, 48, 49,
341 50, 50, 50, 50, 50, 50, 51, 51, 51, 51,
342 52, 52, 53, 53, 54, 54, 55, 55, 56, 56,
343 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
344 57, 57, 58, 58, 58, 58, 58, 59, 59, 59,
345 60, 60, 61, 61, 61, 61, 61, 62, 63, 63,
346 64, 64, 65, 65, 65, 65, 65, 65, 65, 66,
347 66, 66, 66, 67, 67, 67, 67, 68, 68, 69,
348 69, 70, 70, 70, 70, 71, 71, 72, 72, 72,
349 72, 72, 72, 72, 73, 73, 73
352 static const short yyr2[] = { 0,
353 3, 2, 2, 1, 2, 2, 1, 1, 4, 4,
354 2, 2, 2, 1, 1, 1, 4, 5, 4, 5,
355 11, 8, 3, 0, 3, 1, 1, 2, 1, 2,
356 2, 2, 1, 2, 2, 1, 1, 1, 1, 2,
357 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
358 2, 1, 3, 3, 2, 2, 1, 4, 3, 1,
359 2, 1, 9, 9, 8, 12, 9, 9, 5, 2,
360 3, 2, 0, 1, 1, 3, 1, 3, 1, 3,
361 1, 2, 3, 6, 7, 2, 1, 1, 2, 2,
365 static const short yydefact[] = { 0,
366 0, 7, 8, 0, 4, 0, 0, 5, 6, 3,
367 2, 0, 0, 1, 0, 0, 0, 24, 0, 0,
368 0, 0, 15, 16, 14, 10, 0, 0, 42, 50,
369 49, 48, 0, 0, 44, 46, 47, 38, 37, 36,
370 39, 41, 0, 27, 29, 33, 0, 0, 0, 0,
371 0, 0, 0, 0, 0, 57, 0, 9, 12, 13,
372 11, 0, 28, 35, 32, 34, 31, 43, 45, 0,
373 52, 30, 40, 0, 26, 0, 0, 0, 0, 0,
374 0, 0, 56, 0, 55, 0, 0, 0, 0, 17,
375 0, 51, 0, 19, 0, 0, 23, 0, 0, 0,
376 54, 60, 0, 53, 0, 0, 0, 62, 69, 18,
377 42, 39, 0, 0, 77, 79, 81, 20, 0, 25,
378 0, 0, 0, 58, 0, 0, 0, 61, 0, 82,
379 73, 0, 73, 0, 0, 73, 59, 0, 0, 76,
380 83, 0, 0, 0, 0, 78, 80, 0, 0, 73,
381 0, 73, 0, 0, 0, 97, 95, 0, 0, 70,
382 72, 0, 0, 0, 22, 0, 65, 0, 0, 0,
383 88, 0, 0, 0, 0, 0, 87, 71, 96, 67,
384 68, 0, 64, 63, 73, 0, 0, 0, 89, 0,
385 90, 0, 84, 86, 0, 0, 85, 93, 91, 92,
386 94, 21, 0, 66, 0, 0, 0
389 static const short yydefgoto[] = { 205,
390 4, 5, 6, 22, 23, 24, 50, 76, 113, 44,
391 45, 46, 47, 72, 55, 56, 103, 109, 25, 145,
392 114, 115, 116, 117, 176, 177, 160
395 static const short yypact[] = { 3,
396 47,-32768,-32768, 70, 169, 94, 75,-32768,-32768, 169,
397 182, 171, 79, 182, 100, 125, 125, 109, 69, 77,
398 111, 159,-32768,-32768,-32768,-32768, 108, 160,-32768,-32768,
399 -32768,-32768, 190, 196, 138, 147,-32768,-32768,-32768,-32768,
400 -32768,-32768, 144,-32768, 132,-32768, 163, 193, 197, 198,
401 125, 199, 32, 200, 125,-32768, 194,-32768,-32768,-32768,
402 -32768, 145,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 65,
403 132,-32768,-32768, 161, 184, 186, 203, 204, 191, 192,
404 205, 208,-32768, 26,-32768, 209, 195, 76, 201,-32768,
405 143,-32768, 202,-32768, 143, 197,-32768, 210, 206, 143,
406 -32768,-32768, 66,-32768, 207, 125, 213,-32768,-32768,-32768,
407 211, 176, 212, 214,-32768, 215,-32768,-32768, 216,-32768,
408 217, 143, 219,-32768, 218, 143, 220,-32768, 125, 21,
409 -6, 107, -6, 221, 222, -6,-32768, 223, 225,-32768,
410 226, 224, -9, 227, 230,-32768,-32768, 231, 29, -6,
411 76, -6, 143, 228, 28,-32768,-32768, 229, 235,-32768,
412 -32768, 233, 240, 234,-32768, 76,-32768, 76, 236, 28,
413 -32768, 237, -2, 5, 238, 11,-32768,-32768,-32768,-32768,
414 -32768, 241,-32768,-32768, -6, 22, -4, -4,-32768, -4,
415 -32768, -4,-32768,-32768, 239, 242,-32768,-32768,-32768,-32768,
416 -32768,-32768, 243,-32768, 246, 251,-32768
419 static const short yypgoto[] = {-32768,
420 93, 265,-32768,-32768, 248, 249,-32768, 137, -16, 247,
421 -32768, -13,-32768, 168,-32768, -44,-32768, -136, 254, -128,
422 -93, 105,-32768, 148, 73, -172, -81
429 static const short yytable[] = { 43,
430 48, 119, 52, 194, 148, 1, 123, 151, 83, 85,
431 156, 157, 143, 194, 167, 156, 157, 156, 157, 65,
432 67, 166, 158, 168, 156, 157, 2, 3, 135, 183,
433 171, 184, 138, 144, 78, 159, 101, 188, 86, 104,
434 159, 171, 159, 141, 190, 80, 193, 171, 164, 159,
435 172, 80, 173, 174, 175, 142, 196, 197, 81, 169,
436 82, 172, 165, 173, 174, 175, 82, 172, 7, 173,
437 174, 175, 1, 28, 29, 30, 31, 32, 13, 33,
438 34, 35, 36, 37, 38, 39, 40, 89, 41, 127,
439 42, 189, 191, 8, 9, 51, 53, 11, 90, 91,
440 26, 124, 14, 54, 125, 198, 199, 107, 200, 108,
441 201, 28, 29, 30, 31, 32, 146, 33, 34, 35,
442 36, 37, 38, 39, 40, 12, 41, 62, 42, 28,
443 29, 30, 31, 32, 27, 33, 34, 35, 36, 37,
444 38, 39, 40, 49, 41, 57, 42, 28, 111, 30,
445 31, 32, 68, 33, 34, 35, 36, 37, 38, 39,
446 40, 69, 112, 70, 42, 29, 30, 31, 32, 71,
447 33, 34, 35, 36, 37, 38, 39, 40, 15, 41,
448 88, 42, 73, 93, 16, 17, 18, 19, 20, 21,
449 15, 58, 2, 3, 94, 95, 16, 17, 18, 19,
450 20, 21, 35, 36, 37, 8, 9, 64, 35, 36,
451 37, -75, 74, 66, 129, 87, 75, 77, 79, 84,
452 96, 97, 98, 99, 80, 100, 82, 102, 105, 121,
453 106, 130, 120, 140, 110, 118, 128, 137, 92, 139,
454 122, 126, 186, 155, 149, 206, -74, 170, 134, 131,
455 207, 133, 178, 132, 136, 179, 180, 150, 152, 153,
456 154, 162, 163, 181, 195, 182, 204, 161, 10, 59,
457 60, 185, 202, 203, 63, 61, 187, 192, 0, 147
460 static const short yycheck[] = { 16,
461 17, 95, 19, 176, 133, 3, 100, 136, 53, 54,
462 20, 21, 19, 186, 151, 20, 21, 20, 21, 33,
463 34, 150, 32, 152, 20, 21, 24, 25, 122, 166,
464 20, 168, 126, 40, 51, 45, 81, 40, 55, 84,
465 45, 20, 45, 23, 40, 20, 36, 20, 20, 45,
466 40, 20, 42, 43, 44, 35, 185, 36, 27, 153,
467 35, 40, 34, 42, 43, 44, 35, 40, 22, 42,
468 43, 44, 3, 5, 6, 7, 8, 9, 4, 11,
469 12, 13, 14, 15, 16, 17, 18, 23, 20, 106,
470 22, 173, 174, 24, 25, 27, 20, 5, 34, 35,
471 22, 36, 10, 27, 39, 187, 188, 32, 190, 34,
472 192, 5, 6, 7, 8, 9, 10, 11, 12, 13,
473 14, 15, 16, 17, 18, 32, 20, 20, 22, 5,
474 6, 7, 8, 9, 35, 11, 12, 13, 14, 15,
475 16, 17, 18, 35, 20, 35, 22, 5, 6, 7,
476 8, 9, 15, 11, 12, 13, 14, 15, 16, 17,
477 18, 15, 20, 20, 22, 6, 7, 8, 9, 38,
478 11, 12, 13, 14, 15, 16, 17, 18, 20, 20,
479 36, 22, 20, 23, 26, 27, 28, 29, 30, 31,
480 20, 33, 24, 25, 34, 35, 26, 27, 28, 29,
481 30, 31, 13, 14, 15, 24, 25, 18, 13, 14,
482 15, 36, 20, 18, 39, 22, 20, 20, 20, 20,
483 37, 36, 20, 20, 20, 35, 35, 20, 20, 20,
484 36, 20, 96, 129, 34, 34, 24, 20, 71, 20,
485 35, 35, 170, 20, 24, 0, 36, 20, 32, 36,
486 0, 36, 24, 39, 36, 21, 24, 36, 36, 35,
487 35, 32, 32, 24, 24, 32, 24, 41, 4, 22,
488 22, 36, 34, 32, 28, 22, 40, 40, -1, 132
490 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
491 #line 3 "/usr/lib/bison.simple"
492 /* This file comes from bison-1.28. */
494 /* Skeleton output parser for bison,
495 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
497 This program is free software; you can redistribute it and/or modify
498 it under the terms of the GNU General Public License as published by
499 the Free Software Foundation; either version 2, or (at your option)
502 This program is distributed in the hope that it will be useful,
503 but WITHOUT ANY WARRANTY; without even the implied warranty of
504 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
505 GNU General Public License for more details.
507 You should have received a copy of the GNU General Public License
508 along with this program; if not, write to the Free Software
509 Foundation, Inc., 59 Temple Place - Suite 330,
510 Boston, MA 02111-1307, USA. */
512 /* As a special exception, when this file is copied by Bison into a
513 Bison output file, you may use that output file without restriction.
514 This special exception was added by the Free Software Foundation
515 in version 1.24 of Bison. */
517 /* This is the parser code that is written into each bison parser
518 when the %semantic_parser declaration is not specified in the grammar.
519 It was written by Richard Stallman by simplifying the hairy parser
520 used when %semantic_parser is specified. */
522 #ifndef YYSTACK_USE_ALLOCA
524 #define YYSTACK_USE_ALLOCA
525 #else /* alloca not defined */
527 #define YYSTACK_USE_ALLOCA
528 #define alloca __builtin_alloca
529 #else /* not GNU C. */
530 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
531 #define YYSTACK_USE_ALLOCA
533 #else /* not sparc */
534 /* We think this test detects Watcom and Microsoft C. */
535 /* This used to test MSDOS, but that is a bad idea
536 since that symbol is in the user namespace. */
537 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
538 #if 0 /* No need for malloc.h, which pollutes the namespace;
539 instead, just don't use alloca. */
542 #else /* not MSDOS, or __TURBOC__ */
544 /* I don't know what this was needed for, but it pollutes the namespace.
545 So I turned it off. rms, 2 May 1997. */
546 /* #include <malloc.h> */
548 #define YYSTACK_USE_ALLOCA
549 #else /* not MSDOS, or __TURBOC__, or _AIX */
551 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
552 and on HPUX 10. Eventually we can turn this on. */
553 #define YYSTACK_USE_ALLOCA
554 #define alloca __builtin_alloca
557 #endif /* not _AIX */
558 #endif /* not MSDOS, or __TURBOC__ */
559 #endif /* not sparc */
560 #endif /* not GNU C */
561 #endif /* alloca not defined */
562 #endif /* YYSTACK_USE_ALLOCA not defined */
564 #ifdef YYSTACK_USE_ALLOCA
565 #define YYSTACK_ALLOC alloca
567 #define YYSTACK_ALLOC malloc
570 /* Note: there must be only one dollar sign in this file.
571 It is replaced by the list of actions, each action
572 as one case of the switch. */
574 #define yyerrok (yyerrstatus = 0)
575 #define yyclearin (yychar = YYEMPTY)
578 #define YYACCEPT goto yyacceptlab
579 #define YYABORT goto yyabortlab
580 #define YYERROR goto yyerrlab1
581 /* Like YYERROR except do call yyerror.
582 This remains here temporarily to ease the
583 transition to the new meaning of YYERROR, for GCC.
584 Once GCC version 2 has supplanted version 1, this can go. */
585 #define YYFAIL goto yyerrlab
586 #define YYRECOVERING() (!!yyerrstatus)
587 #define YYBACKUP(token, value) \
589 if (yychar == YYEMPTY && yylen == 1) \
590 { yychar = (token), yylval = (value); \
591 yychar1 = YYTRANSLATE (yychar); \
596 { yyerror ("syntax error: cannot back up"); YYERROR; } \
600 #define YYERRCODE 256
603 #define YYLEX yylex()
609 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
611 #define YYLEX yylex(&yylval, &yylloc)
613 #else /* not YYLSP_NEEDED */
615 #define YYLEX yylex(&yylval, YYLEX_PARAM)
617 #define YYLEX yylex(&yylval)
619 #endif /* not YYLSP_NEEDED */
622 /* If nonreentrant, generate the variables here */
626 int yychar; /* the lookahead symbol */
627 YYSTYPE yylval; /* the semantic value of the */
628 /* lookahead symbol */
631 YYLTYPE yylloc; /* location data for the lookahead */
635 int yynerrs; /* number of parse errors so far */
636 #endif /* not YYPURE */
639 int yydebug; /* nonzero means print parse trace */
640 /* Since this is uninitialized, it does not stop multiple parsers
644 /* YYINITDEPTH indicates the initial size of the parser's stacks */
647 #define YYINITDEPTH 200
650 /* YYMAXDEPTH is the maximum size the stacks can grow to
651 (effective only if the built-in stack extension method is used). */
658 #define YYMAXDEPTH 10000
661 /* Define __yy_memcpy. Note that the size argument
662 should be passed with type unsigned int, because that is what the non-GCC
663 definitions require. With GCC, __builtin_memcpy takes an arg
664 of type size_t, but it can handle unsigned int. */
666 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
667 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
668 #else /* not GNU C or C++ */
671 /* This is the most reliable way to avoid incompatibilities
672 in available built-in functions on various systems. */
674 __yy_memcpy (to, from, count)
679 register char *f = from;
680 register char *t = to;
681 register int i = count;
687 #else /* __cplusplus */
689 /* This is the most reliable way to avoid incompatibilities
690 in available built-in functions on various systems. */
692 __yy_memcpy (char *to, char *from, unsigned int count)
694 register char *t = to;
695 register char *f = from;
696 register int i = count;
705 #line 217 "/usr/lib/bison.simple"
707 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
708 into yyparse. The argument should have type void *.
709 It should actually point to an object.
710 Grammar actions can access the variable by casting it
711 to the proper pointer type. */
715 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
716 #define YYPARSE_PARAM_DECL
717 #else /* not __cplusplus */
718 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
719 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
720 #endif /* not __cplusplus */
721 #else /* not YYPARSE_PARAM */
722 #define YYPARSE_PARAM_ARG
723 #define YYPARSE_PARAM_DECL
724 #endif /* not YYPARSE_PARAM */
726 /* Prevent warning if -Wstrict-prototypes. */
729 int yyparse (void *);
736 yyparse(YYPARSE_PARAM_ARG)
739 register int yystate;
741 register short *yyssp;
742 register YYSTYPE *yyvsp;
743 int yyerrstatus; /* number of tokens to shift before error messages enabled */
744 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
746 short yyssa[YYINITDEPTH]; /* the state stack */
747 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
749 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
750 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
753 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
754 YYLTYPE *yyls = yylsa;
757 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
759 #define YYPOPSTACK (yyvsp--, yyssp--)
762 int yystacksize = YYINITDEPTH;
763 int yyfree_stacks = 0;
774 YYSTYPE yyval; /* the variable used to return */
775 /* semantic values from the action */
782 fprintf(stderr, "Starting parse\n");
788 yychar = YYEMPTY; /* Cause a token to be read. */
790 /* Initialize stack pointers.
791 Waste one element of value and location stack
792 so that they stay on the same level as the state stack.
793 The wasted elements are never initialized. */
801 /* Push a new state, which is found in yystate . */
802 /* In all cases, when you get here, the value and location stacks
803 have just been pushed. so pushing a state here evens the stacks. */
808 if (yyssp >= yyss + yystacksize - 1)
810 /* Give user a chance to reallocate the stack */
811 /* Use copies of these so that the &'s don't force the real ones into memory. */
812 YYSTYPE *yyvs1 = yyvs;
815 YYLTYPE *yyls1 = yyls;
818 /* Get the current used size of the three stacks, in elements. */
819 int size = yyssp - yyss + 1;
822 /* Each stack pointer address is followed by the size of
823 the data in use in that stack, in bytes. */
825 /* This used to be a conditional around just the two extra args,
826 but that might be undefined if yyoverflow is a macro. */
827 yyoverflow("parser stack overflow",
828 &yyss1, size * sizeof (*yyssp),
829 &yyvs1, size * sizeof (*yyvsp),
830 &yyls1, size * sizeof (*yylsp),
833 yyoverflow("parser stack overflow",
834 &yyss1, size * sizeof (*yyssp),
835 &yyvs1, size * sizeof (*yyvsp),
839 yyss = yyss1; yyvs = yyvs1;
843 #else /* no yyoverflow */
844 /* Extend the stack our own way. */
845 if (yystacksize >= YYMAXDEPTH)
847 yyerror("parser stack overflow");
859 if (yystacksize > YYMAXDEPTH)
860 yystacksize = YYMAXDEPTH;
861 #ifndef YYSTACK_USE_ALLOCA
864 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
865 __yy_memcpy ((char *)yyss, (char *)yyss1,
866 size * (unsigned int) sizeof (*yyssp));
867 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
868 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
869 size * (unsigned int) sizeof (*yyvsp));
871 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
872 __yy_memcpy ((char *)yyls, (char *)yyls1,
873 size * (unsigned int) sizeof (*yylsp));
875 #endif /* no yyoverflow */
877 yyssp = yyss + size - 1;
878 yyvsp = yyvs + size - 1;
880 yylsp = yyls + size - 1;
885 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
888 if (yyssp >= yyss + yystacksize - 1)
894 fprintf(stderr, "Entering state %d\n", yystate);
900 /* Do appropriate processing given the current state. */
901 /* Read a lookahead token if we need one and don't already have one. */
904 /* First try to decide what to do without reference to lookahead token. */
906 yyn = yypact[yystate];
910 /* Not known => get a lookahead token if don't already have one. */
912 /* yychar is either YYEMPTY or YYEOF
913 or a valid token in external form. */
915 if (yychar == YYEMPTY)
919 fprintf(stderr, "Reading a token: ");
924 /* Convert token to internal form (in yychar1) for indexing tables with */
926 if (yychar <= 0) /* This means end of input. */
929 yychar = YYEOF; /* Don't call YYLEX any more */
933 fprintf(stderr, "Now at end of input.\n");
938 yychar1 = YYTRANSLATE(yychar);
943 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
944 /* Give the individual parser a way to print the precise meaning
945 of a token, for further debugging info. */
947 YYPRINT (stderr, yychar, yylval);
949 fprintf (stderr, ")\n");
955 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
960 /* yyn is what to do for this token type in this state.
961 Negative => reduce, -yyn is rule number.
962 Positive => shift, yyn is new state.
963 New state is final state => don't bother to shift,
965 0, or most negative number => error. */
980 /* Shift the lookahead token. */
984 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
987 /* Discard the token being shifted unless it is eof. */
996 /* count tokens shifted since error; after three, turn off error status. */
997 if (yyerrstatus) yyerrstatus--;
1002 /* Do the default action for the current state. */
1005 yyn = yydefact[yystate];
1009 /* Do a reduction. yyn is the number of a rule to reduce with. */
1013 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1020 fprintf (stderr, "Reducing via rule %d (line %d), ",
1023 /* Print the symbols being reduced, and their result. */
1024 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1025 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1026 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1052 Node *node = new_ccode(FALSE,yyvsp[0].cbuf,ccode_line);
1053 nodes = g_list_append(nodes,node);
1059 Node *node = new_ccode(TRUE,yyvsp[0].cbuf,ccode_line);
1060 nodes = g_list_append(nodes,node);
1066 Node *node = new_ccode(FALSE,yyvsp[0].cbuf,ccode_line);
1067 nodes = g_list_append(nodes,node);
1073 Node *node = new_ccode(TRUE,yyvsp[0].cbuf,ccode_line);
1074 nodes = g_list_append(nodes,node);
1080 ((Class *)class)->nodes = class_nodes;
1082 nodes = g_list_append(nodes,class);
1088 class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
1118 push_variable(yyvsp[-1].id,PUBLIC_SCOPE,yyvsp[-3].line,NULL);
1124 push_variable(yyvsp[-2].id,PUBLIC_SCOPE,yyvsp[-4].line,yyvsp[-1].id);
1130 push_variable(yyvsp[-1].id,PRIVATE_SCOPE,yyvsp[-3].line,NULL);
1136 push_variable(yyvsp[-2].id,PRIVATE_SCOPE,yyvsp[-4].line,yyvsp[-1].id);
1142 if(strcmp(yyvsp[-6].id,"get")==0 &&
1143 strcmp(yyvsp[-3].id,"set")==0) {
1145 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1146 node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
1147 yyvsp[-4].cbuf,yyvsp[-5].line,
1148 yyvsp[-1].cbuf,yyvsp[-2].line,
1150 class_nodes = g_list_append(class_nodes,node);
1151 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1152 strcmp(yyvsp[-3].id,"get")==0) {
1154 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1155 node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
1156 yyvsp[-1].cbuf,yyvsp[-2].line,
1157 yyvsp[-4].cbuf,yyvsp[-5].line,
1159 class_nodes = g_list_append(class_nodes,node);
1161 g_free(yyvsp[-8].id); g_free(yyvsp[-7].id);
1162 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1163 g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL);
1164 g_string_free(yyvsp[-1].cbuf,TRUE);
1165 g_string_free(yyvsp[-4].cbuf,TRUE);
1166 yyerror(_("parse error"));
1174 if(strcmp(yyvsp[-3].id,"get")==0) {
1176 g_free(yyvsp[-3].id);
1177 node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
1178 yyvsp[-1].cbuf,yyvsp[-2].line,NULL,0,
1180 class_nodes = g_list_append(class_nodes,node);
1181 } else if(strcmp(yyvsp[-3].id,"set")==0) {
1183 g_free(yyvsp[-3].id);
1184 node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
1185 NULL,0,yyvsp[-1].cbuf,yyvsp[-2].line,
1187 class_nodes = g_list_append(class_nodes,node);
1189 g_free(yyvsp[-3].id); g_free(yyvsp[-5].id);
1190 g_free(yyvsp[-4].id);
1191 g_list_foreach(yyvsp[-6].list,(GFunc)g_free,NULL);
1192 g_string_free(yyvsp[-1].cbuf,TRUE);
1193 yyerror(_("parse error"));
1200 { yyval.list = yyvsp[-1].list; ;
1204 { yyval.list = NULL; ;
1209 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1215 yyval.list = g_list_append(NULL,yyvsp[0].id);
1225 Type *type = typestack->data;
1226 char *oldname = type->name;
1227 type->name = g_strconcat("const ",oldname,NULL);
1234 Node *node = new_type(0,yyvsp[0].id,NULL);
1235 typestack = g_list_prepend(typestack,node);
1241 Node *node = new_type(stars,yyvsp[-1].id,NULL);
1243 typestack = g_list_prepend(typestack,node);
1249 yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
1255 yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
1261 yyval.id = g_strdup(yyvsp[0].id);
1267 yyval.id = g_strdup("unsigned char");
1273 yyval.id = g_strdup("signed char");
1279 yyval.id = g_strdup("char");
1285 yyval.id = g_strdup("double");
1291 yyval.id = g_strdup("float");
1297 yyval.id = yyvsp[0].id;
1303 yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
1304 g_free(yyvsp[0].id);
1310 yyval.id = yyvsp[0].id;
1316 yyval.id = g_strdup("void");
1322 yyval.id = "long int";
1334 yyval.id = "short int";
1358 yyval.id = "union ";
1364 yyval.id = "struct ";
1378 if(strcmp(yyvsp[-1].id,"first")==0)
1379 yyval.sigtype = PRIVATE_SIGNAL_FIRST_METHOD;
1380 else if(strcmp(yyvsp[-1].id,"last")==0)
1381 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1383 yyerror(_("signal must be 'first' or 'last'"));
1384 g_free(yyvsp[-1].id);
1387 g_free(yyvsp[-1].id);
1393 if(strcmp(yyvsp[-2].id,"first")==0)
1394 yyval.sigtype = PRIVATE_SIGNAL_FIRST_METHOD;
1395 else if(strcmp(yyvsp[-2].id,"last")==0)
1396 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1398 yyerror(_("signal must be 'first' or 'last'"));
1399 g_free(yyvsp[-2].id);
1402 g_free(yyvsp[-2].id);
1408 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1414 if(strcmp(yyvsp[-1].id,"first")==0)
1415 yyval.sigtype = SIGNAL_FIRST_METHOD;
1416 else if(strcmp(yyvsp[-1].id,"last")==0)
1417 yyval.sigtype = SIGNAL_LAST_METHOD;
1419 yyerror(_("signal must be 'first' or 'last'"));
1420 g_free(yyvsp[-1].id);
1423 g_free(yyvsp[-1].id);
1429 yyval.sigtype = SIGNAL_LAST_METHOD;
1435 gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
1441 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1447 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1452 { yyval.cbuf=yyvsp[0].cbuf; ;
1456 { yyval.cbuf = NULL; ;
1462 yyerror(_("signal without 'self' as "
1463 "first parameter"));
1466 push_function(yyvsp[-7].sigtype,NULL,
1467 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1475 yyerror(_("virtual method without 'self' as "
1476 "first parameter"));
1479 push_function(PRIVATE_VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1480 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1488 yyerror(_("virtual method without 'self' as "
1489 "first parameter"));
1492 push_function(VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1493 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,
1500 push_function(OVERRIDE_METHOD, yyvsp[-9].id,
1501 yyvsp[-6].id, yyvsp[-2].id, yyvsp[0].cbuf,
1502 yyvsp[-11].line,yyvsp[-1].line,
1509 push_function(PUBLIC_SCOPE, NULL, yyvsp[-6].id,
1510 yyvsp[-2].id, yyvsp[0].cbuf,yyvsp[-8].line,yyvsp[-1].line,
1517 push_function(PRIVATE_SCOPE, NULL, yyvsp[-6].id,
1518 yyvsp[-2].id, yyvsp[0].cbuf,yyvsp[-8].line,yyvsp[-1].line,
1525 if(strcmp(yyvsp[-4].id,"init")==0) {
1526 push_init_arg(yyvsp[-2].id,FALSE);
1527 push_function(INIT_METHOD, NULL,
1528 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1530 } else if(strcmp(yyvsp[-4].id,"class_init")==0) {
1531 push_init_arg(yyvsp[-2].id,TRUE);
1532 push_function(CLASS_INIT_METHOD, NULL,
1533 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1536 g_free(yyvsp[-4].id);
1537 g_free(yyvsp[-2].id);
1538 g_string_free(yyvsp[-2].cbuf,TRUE);
1539 yyerror(_("parse error"));
1546 { yyval.id = yyvsp[0].id; ;
1551 yyval.id = (yyvsp[0].cbuf)->str;
1552 g_string_free(yyvsp[0].cbuf,FALSE);
1561 { yyval.id = NULL; ;
1565 { vararg = FALSE; has_self = FALSE; ;
1572 if(strcmp(yyvsp[0].id,"self")==0)
1573 push_self(yyvsp[0].id);
1575 g_free(yyvsp[0].id);
1576 yyerror(_("parse error"));
1585 if(strcmp(yyvsp[-2].id,"self")==0)
1586 push_self(yyvsp[-2].id);
1588 g_free(yyvsp[-2].id);
1589 yyerror(_("parse error"));
1596 { has_self = FALSE; ;
1617 push_funcarg(yyvsp[0].id,NULL);
1623 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
1629 if(strcmp(yyvsp[-2].id,"check")!=0) {
1630 yyerror(_("parse error"));
1633 g_free(yyvsp[-2].id);
1634 push_funcarg(yyvsp[-4].id,NULL);
1640 if(strcmp(yyvsp[-2].id,"check")!=0) {
1641 yyerror(_("parse error"));
1644 g_free(yyvsp[-2].id);
1645 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
1659 if(strcmp(yyvsp[0].id,"type")==0) {
1660 Node *node = new_check(TYPE_CHECK,NULL);
1661 checks = g_list_append(checks,node);
1662 } else if(strcmp(yyvsp[0].id,"null")==0) {
1663 Node *node = new_check(NULL_CHECK,NULL);
1664 checks = g_list_append(checks,node);
1666 yyerror(_("parse error"));
1669 g_free(yyvsp[0].id);
1675 Node *node = new_check(GT_CHECK,yyvsp[0].id);
1676 checks = g_list_append(checks,node);
1682 Node *node = new_check(LT_CHECK,yyvsp[0].id);
1683 checks = g_list_append(checks,node);
1689 Node *node = new_check(GE_CHECK,yyvsp[0].id);
1690 checks = g_list_append(checks,node);
1696 Node *node = new_check(LE_CHECK,yyvsp[0].id);
1697 checks = g_list_append(checks,node);
1703 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
1704 checks = g_list_append(checks,node);
1710 Node *node = new_check(NE_CHECK,yyvsp[0].id);
1711 checks = g_list_append(checks,node);
1716 { yyval.id = yyvsp[0].id; ;
1721 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
1722 g_free(yyvsp[0].id);
1727 { yyval.id = yyvsp[0].id; ;
1730 /* the action file gets copied in in place of this dollarsign */
1731 #line 543 "/usr/lib/bison.simple"
1742 short *ssp1 = yyss - 1;
1743 fprintf (stderr, "state stack now");
1744 while (ssp1 != yyssp)
1745 fprintf (stderr, " %d", *++ssp1);
1746 fprintf (stderr, "\n");
1756 yylsp->first_line = yylloc.first_line;
1757 yylsp->first_column = yylloc.first_column;
1758 yylsp->last_line = (yylsp-1)->last_line;
1759 yylsp->last_column = (yylsp-1)->last_column;
1764 yylsp->last_line = (yylsp+yylen-1)->last_line;
1765 yylsp->last_column = (yylsp+yylen-1)->last_column;
1769 /* Now "shift" the result of the reduction.
1770 Determine what state that goes to,
1771 based on the state we popped back to
1772 and the rule number reduced by. */
1776 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1777 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1778 yystate = yytable[yystate];
1780 yystate = yydefgoto[yyn - YYNTBASE];
1784 yyerrlab: /* here on detecting error */
1787 /* If not already recovering from an error, report this error. */
1791 #ifdef YYERROR_VERBOSE
1792 yyn = yypact[yystate];
1794 if (yyn > YYFLAG && yyn < YYLAST)
1801 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1802 for (x = (yyn < 0 ? -yyn : 0);
1803 x < (sizeof(yytname) / sizeof(char *)); x++)
1804 if (yycheck[x + yyn] == x)
1805 size += strlen(yytname[x]) + 15, count++;
1806 msg = (char *) malloc(size + 15);
1809 strcpy(msg, "parse error");
1814 for (x = (yyn < 0 ? -yyn : 0);
1815 x < (sizeof(yytname) / sizeof(char *)); x++)
1816 if (yycheck[x + yyn] == x)
1818 strcat(msg, count == 0 ? ", expecting `" : " or `");
1819 strcat(msg, yytname[x]);
1828 yyerror ("parse error; also virtual memory exceeded");
1831 #endif /* YYERROR_VERBOSE */
1832 yyerror("parse error");
1836 yyerrlab1: /* here on error raised explicitly by an action */
1838 if (yyerrstatus == 3)
1840 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1842 /* return failure if at end of input */
1843 if (yychar == YYEOF)
1848 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1854 /* Else will try to reuse lookahead token
1855 after shifting the error token. */
1857 yyerrstatus = 3; /* Each real token shifted decrements this */
1861 yyerrdefault: /* current state does not do anything special for the error token. */
1864 /* This is wrong; only states that explicitly want error tokens
1865 should shift them. */
1866 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1867 if (yyn) goto yydefault;
1870 yyerrpop: /* pop the current state because it cannot handle the error token */
1872 if (yyssp == yyss) YYABORT;
1882 short *ssp1 = yyss - 1;
1883 fprintf (stderr, "Error: state stack now");
1884 while (ssp1 != yyssp)
1885 fprintf (stderr, " %d", *++ssp1);
1886 fprintf (stderr, "\n");
1892 yyn = yypact[yystate];
1897 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1916 fprintf(stderr, "Shifting error token, ");
1928 /* YYACCEPT comes here. */
1940 /* YYABORT comes here. */