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] : 75)
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 31, 36, 39, 42, 45, 47, 49, 51, 56, 62,
258 67, 73, 85, 94, 98, 99, 103, 105, 107, 110,
259 112, 115, 118, 121, 123, 126, 129, 131, 133, 135,
260 137, 140, 142, 144, 147, 149, 152, 154, 156, 158,
261 160, 162, 165, 167, 168, 170, 174, 178, 181, 184,
262 188, 192, 195, 197, 202, 206, 208, 211, 213, 223,
263 233, 243, 256, 266, 276, 282, 285, 289, 292, 293,
264 295, 297, 301, 303, 307, 309, 313, 315, 318, 322,
265 329, 337, 340, 342, 344, 347, 350, 354, 358, 362,
269 static const short yyrhs[] = { 47,
270 48, 47, 0, 48, 47, 0, 47, 48, 0, 48,
271 0, 47, 24, 0, 47, 25, 0, 24, 0, 25,
272 0, 49, 32, 50, 33, 0, 49, 32, 33, 0,
273 3, 22, 4, 22, 0, 50, 66, 0, 50, 51,
274 0, 50, 52, 0, 66, 0, 51, 0, 52, 0,
275 26, 55, 20, 34, 0, 26, 55, 20, 23, 34,
276 0, 27, 55, 20, 34, 0, 27, 55, 20, 23,
277 34, 0, 28, 53, 20, 20, 20, 32, 24, 20,
278 32, 24, 34, 0, 28, 53, 20, 20, 20, 32,
279 24, 34, 0, 35, 54, 36, 0, 0, 20, 37,
280 54, 0, 20, 0, 56, 0, 5, 56, 0, 57,
281 0, 57, 60, 0, 12, 58, 0, 11, 58, 0,
282 58, 0, 12, 18, 0, 11, 18, 0, 18, 0,
283 17, 0, 16, 0, 20, 0, 59, 20, 0, 22,
284 0, 6, 0, 13, 15, 0, 13, 0, 14, 15,
285 0, 14, 0, 15, 0, 9, 0, 8, 0, 7,
286 0, 38, 60, 0, 38, 0, 0, 26, 0, 27,
287 20, 63, 0, 20, 27, 63, 0, 27, 63, 0,
288 20, 63, 0, 26, 20, 63, 0, 20, 26, 63,
289 0, 26, 63, 0, 63, 0, 20, 35, 64, 36,
290 0, 64, 39, 20, 0, 20, 0, 32, 24, 0,
291 34, 0, 30, 62, 55, 20, 35, 68, 36, 67,
292 65, 0, 29, 27, 55, 20, 35, 68, 36, 67,
293 65, 0, 29, 61, 55, 20, 35, 68, 36, 67,
294 65, 0, 31, 35, 22, 36, 55, 20, 35, 68,
295 36, 67, 32, 24, 0, 26, 55, 20, 35, 68,
296 36, 67, 32, 24, 0, 27, 55, 20, 35, 68,
297 36, 67, 32, 24, 0, 20, 35, 20, 36, 65,
298 0, 19, 74, 0, 19, 32, 24, 0, 40, 41,
299 0, 0, 6, 0, 20, 0, 20, 39, 69, 0,
300 69, 0, 70, 39, 10, 0, 70, 0, 70, 39,
301 71, 0, 71, 0, 55, 20, 0, 55, 20, 23,
302 0, 55, 20, 35, 20, 72, 36, 0, 55, 20,
303 23, 35, 20, 72, 36, 0, 72, 73, 0, 73,
304 0, 20, 0, 42, 74, 0, 43, 74, 0, 42,
305 40, 74, 0, 43, 40, 74, 0, 40, 40, 74,
306 0, 44, 40, 74, 0, 21, 0, 45, 21, 0,
313 static const short yyrline[] = { 0,
314 197, 198, 199, 200, 203, 207, 211, 215, 221, 226,
315 233, 238, 239, 240, 241, 242, 243, 246, 249, 252,
316 255, 259, 288, 314, 315, 318, 321, 327, 328, 336,
317 340, 347, 350, 353, 356, 359, 362, 365, 368, 371,
318 374, 378, 381, 386, 389, 392, 395, 398, 403, 406,
319 409, 414, 415, 418, 419, 422, 434, 446, 449, 461,
320 473, 485, 488, 493, 498, 501, 506, 507, 511, 521,
321 531, 541, 547, 552, 557, 578, 579, 583, 584, 587,
322 588, 599, 609, 612, 613, 616, 617, 620, 623, 626,
323 634, 644, 645, 648, 661, 665, 669, 673, 677, 681,
329 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
331 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
332 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
333 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN",
334 "ARRAY_DIM","CCODE","HCODE","PUBLIC","PRIVATE","ARGUMENT","VIRTUAL","SIGNAL",
335 "OVERRIDE","'{'","'}'","';'","'('","')'","'|'","'*'","','","'='","'1'","'>'",
336 "'<'","'!'","'-'","prog","ccodes","class","classdec","classcode","variable",
337 "argument","argflags","flaglist","type","type1","type2","integer","tspecifier",
338 "stars","optpublic","fullsigtype","sigtype","tokenlist","codenocode","method",
339 "onerror","funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL
343 static const short yyr1[] = { 0,
344 46, 46, 46, 46, 47, 47, 47, 47, 48, 48,
345 49, 50, 50, 50, 50, 50, 50, 51, 51, 51,
346 51, 52, 52, 53, 53, 54, 54, 55, 55, 56,
347 56, 57, 57, 57, 57, 57, 57, 57, 57, 57,
348 57, 57, 57, 58, 58, 58, 58, 58, 59, 59,
349 59, 60, 60, 61, 61, 62, 62, 62, 62, 62,
350 62, 62, 62, 63, 64, 64, 65, 65, 66, 66,
351 66, 66, 66, 66, 66, 67, 67, 67, 67, 68,
352 68, 68, 68, 69, 69, 70, 70, 71, 71, 71,
353 71, 72, 72, 73, 73, 73, 73, 73, 73, 73,
357 static const short yyr2[] = { 0,
358 3, 2, 2, 1, 2, 2, 1, 1, 4, 3,
359 4, 2, 2, 2, 1, 1, 1, 4, 5, 4,
360 5, 11, 8, 3, 0, 3, 1, 1, 2, 1,
361 2, 2, 2, 1, 2, 2, 1, 1, 1, 1,
362 2, 1, 1, 2, 1, 2, 1, 1, 1, 1,
363 1, 2, 1, 0, 1, 3, 3, 2, 2, 3,
364 3, 2, 1, 4, 3, 1, 2, 1, 9, 9,
365 9, 12, 9, 9, 5, 2, 3, 2, 0, 1,
366 1, 3, 1, 3, 1, 3, 1, 2, 3, 6,
367 7, 2, 1, 1, 2, 2, 3, 3, 3, 3,
371 static const short yydefact[] = { 0,
372 0, 7, 8, 0, 4, 0, 0, 5, 6, 3,
373 2, 0, 0, 1, 0, 0, 0, 25, 54, 0,
374 0, 10, 0, 16, 17, 15, 11, 0, 0, 43,
375 51, 50, 49, 0, 0, 45, 47, 48, 39, 38,
376 37, 40, 42, 0, 28, 30, 34, 0, 0, 0,
377 0, 55, 0, 0, 0, 0, 0, 0, 63, 0,
378 9, 13, 14, 12, 0, 29, 36, 33, 35, 32,
379 44, 46, 0, 53, 31, 41, 0, 27, 0, 0,
380 0, 0, 0, 0, 0, 0, 59, 0, 62, 0,
381 58, 0, 0, 0, 0, 18, 0, 52, 0, 20,
382 0, 0, 24, 0, 0, 0, 61, 57, 66, 0,
383 60, 56, 0, 0, 0, 68, 75, 19, 43, 40,
384 0, 0, 83, 85, 87, 21, 0, 26, 0, 0,
385 0, 64, 0, 0, 0, 67, 0, 88, 79, 0,
386 79, 0, 0, 0, 65, 0, 0, 82, 89, 0,
387 0, 0, 0, 84, 86, 0, 0, 79, 79, 79,
388 0, 0, 0, 103, 101, 0, 0, 76, 78, 0,
389 0, 0, 23, 0, 0, 0, 0, 0, 94, 0,
390 0, 0, 0, 0, 93, 77, 102, 73, 74, 0,
391 70, 71, 69, 79, 0, 0, 0, 95, 0, 96,
392 0, 90, 92, 0, 0, 91, 99, 97, 98, 100,
396 static const short yydefgoto[] = { 214,
397 4, 5, 6, 23, 24, 25, 51, 79, 121, 45,
398 46, 47, 48, 75, 54, 58, 59, 110, 117, 26,
399 153, 122, 123, 124, 125, 184, 185, 168
402 static const short yypact[] = { 43,
403 1,-32768,-32768, 56, 28, 39, 72,-32768,-32768, 28,
404 177, 152, 69, 177, 61, 118, 118, 68, 181, 66,
405 84,-32768, 164,-32768,-32768,-32768,-32768, 81, 153,-32768,
406 -32768,-32768,-32768, 185, 191, 106, 113,-32768,-32768,-32768,
407 -32768,-32768,-32768, 117,-32768, 101,-32768, 126, 135, 137,
408 143,-32768, 118, 118, 62, 156, 169, 118,-32768, 174,
409 -32768,-32768,-32768,-32768, 178,-32768,-32768,-32768,-32768,-32768,
410 -32768,-32768, 13, 101,-32768,-32768, 60, 175, 179, 193,
411 196, 197, 183, 199, 199, 200,-32768, 34,-32768, 34,
412 -32768, 201, 186, 26, 189,-32768, 136,-32768, 190,-32768,
413 136, 137,-32768, 205, 192, 194,-32768,-32768,-32768, 51,
414 -32768,-32768, 195, 118, 202,-32768,-32768,-32768, 198, 138,
415 208, 203,-32768, 204,-32768,-32768, 206,-32768, 209, 136,
416 136,-32768, 211, 136, 212,-32768, 118, -19, -6, 100,
417 -6, 213, 210, 214,-32768, 215, 217,-32768, 218, 216,
418 -15, 207, 222,-32768,-32768, 223, -5, -6, -6, -6,
419 136, 220, 35,-32768,-32768, 221, 226,-32768,-32768, 225,
420 232, 227,-32768, 26, 26, 26, 224, 35,-32768, 228,
421 -12, 4, 229, 21,-32768,-32768,-32768,-32768,-32768, 233,
422 -32768,-32768,-32768, -6, 30, 6, 6,-32768, 6,-32768,
423 6,-32768,-32768, 230, 231,-32768,-32768,-32768,-32768,-32768,
424 -32768, 234,-32768, 235, 238,-32768
427 static const short yypgoto[] = {-32768,
428 9, 240,-32768,-32768, 239, 242,-32768, 131, -16, 237,
429 -32768, 176,-32768, 187,-32768,-32768, -45,-32768, 12, 244,
430 -138, -99, 133,-32768, 132, 93, -177, -97
437 static const short yytable[] = { 44,
438 49, 127, 156, 149, 164, 165, 203, 164, 165, 87,
439 89, 91, 151, 11, 172, 150, 166, 203, 14, 174,
440 175, 176, 7, 164, 165, 164, 165, 197, 173, 167,
441 143, 144, 167, 152, 146, 95, 81, 82, 107, 108,
442 179, 92, 111, 199, 112, 1, 96, 97, 167, 179,
443 167, 2, 3, 83, 179, 205, 202, 115, 1, 116,
444 180, 177, 181, 182, 183, 206, 2, 3, 86, 180,
445 12, 181, 182, 183, 180, 13, 181, 182, 183, 8,
446 9, 83, 99, 198, 200, 55, 132, 84, 85, 133,
447 27, 56, 57, 100, 101, 28, 86, 135, 207, 208,
448 65, 209, 50, 210, 29, 30, 31, 32, 33, 154,
449 34, 35, 36, 37, 38, 39, 40, 41, 60, 42,
450 71, 43, 29, 30, 31, 32, 33, 72, 34, 35,
451 36, 37, 38, 39, 40, 41, 73, 42, 74, 43,
452 29, 119, 31, 32, 33, 76, 34, 35, 36, 37,
453 38, 39, 40, 41, 77, 120, 78, 43, 30, 31,
454 32, 33, 80, 34, 35, 36, 37, 38, 39, 40,
455 41, 15, 42, -81, 43, 88, 137, 16, 17, 18,
456 19, 20, 21, 15, 22, 191, 192, 193, 90, 16,
457 17, 18, 19, 20, 21, 93, 61, 36, 37, 38,
458 8, 9, 67, 36, 37, 38, 52, 53, 69, 68,
459 70, 102, 104, 94, 103, 105, 106, 86, 83, 109,
460 113, 114, 118, 126, 129, 136, 130, 138, 131, 134,
461 145, 147, 128, -80, 215, 163, 157, 216, 139, 178,
462 142, 141, 140, 10, 186, 158, 187, 169, 188, 159,
463 160, 161, 162, 170, 171, 189, 204, 213, 190, 194,
464 98, 62, 212, 211, 63, 66, 64, 196, 201, 148,
468 static const short yycheck[] = { 16,
469 17, 101, 141, 23, 20, 21, 184, 20, 21, 55,
470 56, 57, 19, 5, 20, 35, 32, 195, 10, 158,
471 159, 160, 22, 20, 21, 20, 21, 40, 34, 45,
472 130, 131, 45, 40, 134, 23, 53, 54, 84, 85,
473 20, 58, 88, 40, 90, 3, 34, 35, 45, 20,
474 45, 24, 25, 20, 20, 194, 36, 32, 3, 34,
475 40, 161, 42, 43, 44, 36, 24, 25, 35, 40,
476 32, 42, 43, 44, 40, 4, 42, 43, 44, 24,
477 25, 20, 23, 181, 182, 20, 36, 26, 27, 39,
478 22, 26, 27, 34, 35, 35, 35, 114, 196, 197,
479 20, 199, 35, 201, 5, 6, 7, 8, 9, 10,
480 11, 12, 13, 14, 15, 16, 17, 18, 35, 20,
481 15, 22, 5, 6, 7, 8, 9, 15, 11, 12,
482 13, 14, 15, 16, 17, 18, 20, 20, 38, 22,
483 5, 6, 7, 8, 9, 20, 11, 12, 13, 14,
484 15, 16, 17, 18, 20, 20, 20, 22, 6, 7,
485 8, 9, 20, 11, 12, 13, 14, 15, 16, 17,
486 18, 20, 20, 36, 22, 20, 39, 26, 27, 28,
487 29, 30, 31, 20, 33, 174, 175, 176, 20, 26,
488 27, 28, 29, 30, 31, 22, 33, 13, 14, 15,
489 24, 25, 18, 13, 14, 15, 26, 27, 18, 34,
490 35, 37, 20, 36, 36, 20, 20, 35, 20, 20,
491 20, 36, 34, 34, 20, 24, 35, 20, 35, 35,
492 20, 20, 102, 36, 0, 20, 24, 0, 36, 20,
493 32, 36, 39, 4, 24, 36, 21, 41, 24, 36,
494 36, 35, 35, 32, 32, 24, 24, 24, 32, 36,
495 74, 23, 32, 34, 23, 29, 23, 40, 40, 137,
498 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
499 #line 3 "/usr/lib/bison.simple"
500 /* This file comes from bison-1.28. */
502 /* Skeleton output parser for bison,
503 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
505 This program is free software; you can redistribute it and/or modify
506 it under the terms of the GNU General Public License as published by
507 the Free Software Foundation; either version 2, or (at your option)
510 This program is distributed in the hope that it will be useful,
511 but WITHOUT ANY WARRANTY; without even the implied warranty of
512 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
513 GNU General Public License for more details.
515 You should have received a copy of the GNU General Public License
516 along with this program; if not, write to the Free Software
517 Foundation, Inc., 59 Temple Place - Suite 330,
518 Boston, MA 02111-1307, USA. */
520 /* As a special exception, when this file is copied by Bison into a
521 Bison output file, you may use that output file without restriction.
522 This special exception was added by the Free Software Foundation
523 in version 1.24 of Bison. */
525 /* This is the parser code that is written into each bison parser
526 when the %semantic_parser declaration is not specified in the grammar.
527 It was written by Richard Stallman by simplifying the hairy parser
528 used when %semantic_parser is specified. */
530 #ifndef YYSTACK_USE_ALLOCA
532 #define YYSTACK_USE_ALLOCA
533 #else /* alloca not defined */
535 #define YYSTACK_USE_ALLOCA
536 #define alloca __builtin_alloca
537 #else /* not GNU C. */
538 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
539 #define YYSTACK_USE_ALLOCA
541 #else /* not sparc */
542 /* We think this test detects Watcom and Microsoft C. */
543 /* This used to test MSDOS, but that is a bad idea
544 since that symbol is in the user namespace. */
545 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
546 #if 0 /* No need for malloc.h, which pollutes the namespace;
547 instead, just don't use alloca. */
550 #else /* not MSDOS, or __TURBOC__ */
552 /* I don't know what this was needed for, but it pollutes the namespace.
553 So I turned it off. rms, 2 May 1997. */
554 /* #include <malloc.h> */
556 #define YYSTACK_USE_ALLOCA
557 #else /* not MSDOS, or __TURBOC__, or _AIX */
559 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
560 and on HPUX 10. Eventually we can turn this on. */
561 #define YYSTACK_USE_ALLOCA
562 #define alloca __builtin_alloca
565 #endif /* not _AIX */
566 #endif /* not MSDOS, or __TURBOC__ */
567 #endif /* not sparc */
568 #endif /* not GNU C */
569 #endif /* alloca not defined */
570 #endif /* YYSTACK_USE_ALLOCA not defined */
572 #ifdef YYSTACK_USE_ALLOCA
573 #define YYSTACK_ALLOC alloca
575 #define YYSTACK_ALLOC malloc
578 /* Note: there must be only one dollar sign in this file.
579 It is replaced by the list of actions, each action
580 as one case of the switch. */
582 #define yyerrok (yyerrstatus = 0)
583 #define yyclearin (yychar = YYEMPTY)
586 #define YYACCEPT goto yyacceptlab
587 #define YYABORT goto yyabortlab
588 #define YYERROR goto yyerrlab1
589 /* Like YYERROR except do call yyerror.
590 This remains here temporarily to ease the
591 transition to the new meaning of YYERROR, for GCC.
592 Once GCC version 2 has supplanted version 1, this can go. */
593 #define YYFAIL goto yyerrlab
594 #define YYRECOVERING() (!!yyerrstatus)
595 #define YYBACKUP(token, value) \
597 if (yychar == YYEMPTY && yylen == 1) \
598 { yychar = (token), yylval = (value); \
599 yychar1 = YYTRANSLATE (yychar); \
604 { yyerror ("syntax error: cannot back up"); YYERROR; } \
608 #define YYERRCODE 256
611 #define YYLEX yylex()
617 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
619 #define YYLEX yylex(&yylval, &yylloc)
621 #else /* not YYLSP_NEEDED */
623 #define YYLEX yylex(&yylval, YYLEX_PARAM)
625 #define YYLEX yylex(&yylval)
627 #endif /* not YYLSP_NEEDED */
630 /* If nonreentrant, generate the variables here */
634 int yychar; /* the lookahead symbol */
635 YYSTYPE yylval; /* the semantic value of the */
636 /* lookahead symbol */
639 YYLTYPE yylloc; /* location data for the lookahead */
643 int yynerrs; /* number of parse errors so far */
644 #endif /* not YYPURE */
647 int yydebug; /* nonzero means print parse trace */
648 /* Since this is uninitialized, it does not stop multiple parsers
652 /* YYINITDEPTH indicates the initial size of the parser's stacks */
655 #define YYINITDEPTH 200
658 /* YYMAXDEPTH is the maximum size the stacks can grow to
659 (effective only if the built-in stack extension method is used). */
666 #define YYMAXDEPTH 10000
669 /* Define __yy_memcpy. Note that the size argument
670 should be passed with type unsigned int, because that is what the non-GCC
671 definitions require. With GCC, __builtin_memcpy takes an arg
672 of type size_t, but it can handle unsigned int. */
674 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
675 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
676 #else /* not GNU C or C++ */
679 /* This is the most reliable way to avoid incompatibilities
680 in available built-in functions on various systems. */
682 __yy_memcpy (to, from, count)
687 register char *f = from;
688 register char *t = to;
689 register int i = count;
695 #else /* __cplusplus */
697 /* This is the most reliable way to avoid incompatibilities
698 in available built-in functions on various systems. */
700 __yy_memcpy (char *to, char *from, unsigned int count)
702 register char *t = to;
703 register char *f = from;
704 register int i = count;
713 #line 217 "/usr/lib/bison.simple"
715 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
716 into yyparse. The argument should have type void *.
717 It should actually point to an object.
718 Grammar actions can access the variable by casting it
719 to the proper pointer type. */
723 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
724 #define YYPARSE_PARAM_DECL
725 #else /* not __cplusplus */
726 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
727 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
728 #endif /* not __cplusplus */
729 #else /* not YYPARSE_PARAM */
730 #define YYPARSE_PARAM_ARG
731 #define YYPARSE_PARAM_DECL
732 #endif /* not YYPARSE_PARAM */
734 /* Prevent warning if -Wstrict-prototypes. */
737 int yyparse (void *);
744 yyparse(YYPARSE_PARAM_ARG)
747 register int yystate;
749 register short *yyssp;
750 register YYSTYPE *yyvsp;
751 int yyerrstatus; /* number of tokens to shift before error messages enabled */
752 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
754 short yyssa[YYINITDEPTH]; /* the state stack */
755 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
757 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
758 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
761 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
762 YYLTYPE *yyls = yylsa;
765 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
767 #define YYPOPSTACK (yyvsp--, yyssp--)
770 int yystacksize = YYINITDEPTH;
771 int yyfree_stacks = 0;
782 YYSTYPE yyval; /* the variable used to return */
783 /* semantic values from the action */
790 fprintf(stderr, "Starting parse\n");
796 yychar = YYEMPTY; /* Cause a token to be read. */
798 /* Initialize stack pointers.
799 Waste one element of value and location stack
800 so that they stay on the same level as the state stack.
801 The wasted elements are never initialized. */
809 /* Push a new state, which is found in yystate . */
810 /* In all cases, when you get here, the value and location stacks
811 have just been pushed. so pushing a state here evens the stacks. */
816 if (yyssp >= yyss + yystacksize - 1)
818 /* Give user a chance to reallocate the stack */
819 /* Use copies of these so that the &'s don't force the real ones into memory. */
820 YYSTYPE *yyvs1 = yyvs;
823 YYLTYPE *yyls1 = yyls;
826 /* Get the current used size of the three stacks, in elements. */
827 int size = yyssp - yyss + 1;
830 /* Each stack pointer address is followed by the size of
831 the data in use in that stack, in bytes. */
833 /* This used to be a conditional around just the two extra args,
834 but that might be undefined if yyoverflow is a macro. */
835 yyoverflow("parser stack overflow",
836 &yyss1, size * sizeof (*yyssp),
837 &yyvs1, size * sizeof (*yyvsp),
838 &yyls1, size * sizeof (*yylsp),
841 yyoverflow("parser stack overflow",
842 &yyss1, size * sizeof (*yyssp),
843 &yyvs1, size * sizeof (*yyvsp),
847 yyss = yyss1; yyvs = yyvs1;
851 #else /* no yyoverflow */
852 /* Extend the stack our own way. */
853 if (yystacksize >= YYMAXDEPTH)
855 yyerror("parser stack overflow");
867 if (yystacksize > YYMAXDEPTH)
868 yystacksize = YYMAXDEPTH;
869 #ifndef YYSTACK_USE_ALLOCA
872 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
873 __yy_memcpy ((char *)yyss, (char *)yyss1,
874 size * (unsigned int) sizeof (*yyssp));
875 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
876 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
877 size * (unsigned int) sizeof (*yyvsp));
879 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
880 __yy_memcpy ((char *)yyls, (char *)yyls1,
881 size * (unsigned int) sizeof (*yylsp));
883 #endif /* no yyoverflow */
885 yyssp = yyss + size - 1;
886 yyvsp = yyvs + size - 1;
888 yylsp = yyls + size - 1;
893 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
896 if (yyssp >= yyss + yystacksize - 1)
902 fprintf(stderr, "Entering state %d\n", yystate);
908 /* Do appropriate processing given the current state. */
909 /* Read a lookahead token if we need one and don't already have one. */
912 /* First try to decide what to do without reference to lookahead token. */
914 yyn = yypact[yystate];
918 /* Not known => get a lookahead token if don't already have one. */
920 /* yychar is either YYEMPTY or YYEOF
921 or a valid token in external form. */
923 if (yychar == YYEMPTY)
927 fprintf(stderr, "Reading a token: ");
932 /* Convert token to internal form (in yychar1) for indexing tables with */
934 if (yychar <= 0) /* This means end of input. */
937 yychar = YYEOF; /* Don't call YYLEX any more */
941 fprintf(stderr, "Now at end of input.\n");
946 yychar1 = YYTRANSLATE(yychar);
951 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
952 /* Give the individual parser a way to print the precise meaning
953 of a token, for further debugging info. */
955 YYPRINT (stderr, yychar, yylval);
957 fprintf (stderr, ")\n");
963 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
968 /* yyn is what to do for this token type in this state.
969 Negative => reduce, -yyn is rule number.
970 Positive => shift, yyn is new state.
971 New state is final state => don't bother to shift,
973 0, or most negative number => error. */
988 /* Shift the lookahead token. */
992 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
995 /* Discard the token being shifted unless it is eof. */
1004 /* count tokens shifted since error; after three, turn off error status. */
1005 if (yyerrstatus) yyerrstatus--;
1010 /* Do the default action for the current state. */
1013 yyn = yydefact[yystate];
1017 /* Do a reduction. yyn is the number of a rule to reduce with. */
1021 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1028 fprintf (stderr, "Reducing via rule %d (line %d), ",
1031 /* Print the symbols being reduced, and their result. */
1032 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1033 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1034 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1060 Node *node = new_ccode(FALSE,yyvsp[0].cbuf,ccode_line);
1061 nodes = g_list_append(nodes,node);
1067 Node *node = new_ccode(TRUE,yyvsp[0].cbuf,ccode_line);
1068 nodes = g_list_append(nodes,node);
1074 Node *node = new_ccode(FALSE,yyvsp[0].cbuf,ccode_line);
1075 nodes = g_list_append(nodes,node);
1081 Node *node = new_ccode(TRUE,yyvsp[0].cbuf,ccode_line);
1082 nodes = g_list_append(nodes,node);
1088 ((Class *)class)->nodes = class_nodes;
1090 nodes = g_list_append(nodes,class);
1096 ((Class *)class)->nodes = NULL;
1098 nodes = g_list_append(nodes,class);
1104 class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
1134 push_variable(yyvsp[-1].id,PUBLIC_SCOPE,yyvsp[-3].line,NULL);
1140 push_variable(yyvsp[-2].id,PUBLIC_SCOPE,yyvsp[-4].line,yyvsp[-1].id);
1146 push_variable(yyvsp[-1].id,PRIVATE_SCOPE,yyvsp[-3].line,NULL);
1152 push_variable(yyvsp[-2].id,PRIVATE_SCOPE,yyvsp[-4].line,yyvsp[-1].id);
1158 if(strcmp(yyvsp[-6].id,"get")==0 &&
1159 strcmp(yyvsp[-3].id,"set")==0) {
1161 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1162 node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
1163 yyvsp[-4].cbuf,yyvsp[-5].line,
1164 yyvsp[-1].cbuf,yyvsp[-2].line,
1166 class_nodes = g_list_append(class_nodes,node);
1167 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1168 strcmp(yyvsp[-3].id,"get")==0) {
1170 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1171 node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
1172 yyvsp[-1].cbuf,yyvsp[-2].line,
1173 yyvsp[-4].cbuf,yyvsp[-5].line,
1175 class_nodes = g_list_append(class_nodes,node);
1177 g_free(yyvsp[-8].id); g_free(yyvsp[-7].id);
1178 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1179 g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL);
1180 g_string_free(yyvsp[-1].cbuf,TRUE);
1181 g_string_free(yyvsp[-4].cbuf,TRUE);
1182 yyerror(_("parse error"));
1190 if(strcmp(yyvsp[-3].id,"get")==0) {
1192 g_free(yyvsp[-3].id);
1193 node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
1194 yyvsp[-1].cbuf,yyvsp[-2].line,NULL,0,
1196 class_nodes = g_list_append(class_nodes,node);
1197 } else if(strcmp(yyvsp[-3].id,"set")==0) {
1199 g_free(yyvsp[-3].id);
1200 node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
1201 NULL,0,yyvsp[-1].cbuf,yyvsp[-2].line,
1203 class_nodes = g_list_append(class_nodes,node);
1205 g_free(yyvsp[-3].id); g_free(yyvsp[-5].id);
1206 g_free(yyvsp[-4].id);
1207 g_list_foreach(yyvsp[-6].list,(GFunc)g_free,NULL);
1208 g_string_free(yyvsp[-1].cbuf,TRUE);
1209 yyerror(_("parse error"));
1216 { yyval.list = yyvsp[-1].list; ;
1220 { yyval.list = NULL; ;
1225 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1231 yyval.list = g_list_append(NULL,yyvsp[0].id);
1241 Type *type = typestack->data;
1242 char *oldname = type->name;
1243 type->name = g_strconcat("const ",oldname,NULL);
1250 Node *node = new_type(0,yyvsp[0].id,NULL);
1251 typestack = g_list_prepend(typestack,node);
1257 Node *node = new_type(stars,yyvsp[-1].id,NULL);
1259 typestack = g_list_prepend(typestack,node);
1265 yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
1271 yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
1277 yyval.id = g_strdup(yyvsp[0].id);
1283 yyval.id = g_strdup("unsigned char");
1289 yyval.id = g_strdup("signed char");
1295 yyval.id = g_strdup("char");
1301 yyval.id = g_strdup("double");
1307 yyval.id = g_strdup("float");
1313 yyval.id = yyvsp[0].id;
1319 yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
1320 g_free(yyvsp[0].id);
1326 yyval.id = yyvsp[0].id;
1332 yyval.id = g_strdup("void");
1338 yyval.id = "long int";
1350 yyval.id = "short int";
1374 yyval.id = "union ";
1380 yyval.id = "struct ";
1402 if(strcmp(yyvsp[-1].id,"first")==0)
1403 yyval.sigtype = PRIVATE_SIGNAL_FIRST_METHOD;
1404 else if(strcmp(yyvsp[-1].id,"last")==0)
1405 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1407 yyerror(_("signal must be 'first' or 'last'"));
1408 g_free(yyvsp[-1].id);
1411 g_free(yyvsp[-1].id);
1417 if(strcmp(yyvsp[-2].id,"first")==0)
1418 yyval.sigtype = PRIVATE_SIGNAL_FIRST_METHOD;
1419 else if(strcmp(yyvsp[-2].id,"last")==0)
1420 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1422 yyerror(_("signal must be 'first' or 'last'"));
1423 g_free(yyvsp[-2].id);
1426 g_free(yyvsp[-2].id);
1432 yyval.sigtype = PRIVATE_SIGNAL_LAST_METHOD;
1438 if(strcmp(yyvsp[-1].id,"first")==0)
1439 yyval.sigtype = SIGNAL_FIRST_METHOD;
1440 else if(strcmp(yyvsp[-1].id,"last")==0)
1441 yyval.sigtype = SIGNAL_LAST_METHOD;
1443 yyerror(_("signal must be 'first' or 'last'"));
1444 g_free(yyvsp[-1].id);
1447 g_free(yyvsp[-1].id);
1453 if(strcmp(yyvsp[-1].id,"first")==0)
1454 yyval.sigtype = SIGNAL_FIRST_METHOD;
1455 else if(strcmp(yyvsp[-1].id,"last")==0)
1456 yyval.sigtype = SIGNAL_LAST_METHOD;
1458 yyerror(_("signal must be 'first' or 'last'"));
1459 g_free(yyvsp[-1].id);
1462 g_free(yyvsp[-1].id);
1468 if(strcmp(yyvsp[-2].id,"first")==0)
1469 yyval.sigtype = SIGNAL_FIRST_METHOD;
1470 else if(strcmp(yyvsp[-2].id,"last")==0)
1471 yyval.sigtype = SIGNAL_LAST_METHOD;
1473 yyerror(_("signal must be 'first' or 'last'"));
1474 g_free(yyvsp[-2].id);
1477 g_free(yyvsp[-2].id);
1483 yyval.sigtype = SIGNAL_LAST_METHOD;
1489 yyval.sigtype = SIGNAL_LAST_METHOD;
1495 gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
1501 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1507 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1512 { yyval.cbuf=yyvsp[0].cbuf; ;
1516 { yyval.cbuf = NULL; ;
1522 yyerror(_("signal without 'self' as "
1523 "first parameter"));
1526 push_function(yyvsp[-7].sigtype,NULL,
1527 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1535 yyerror(_("virtual method without 'self' as "
1536 "first parameter"));
1539 push_function(PRIVATE_VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1540 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1548 yyerror(_("virtual method without 'self' as "
1549 "first parameter"));
1552 push_function(VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1553 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1560 push_function(OVERRIDE_METHOD, yyvsp[-9].id,
1561 yyvsp[-6].id, yyvsp[-2].id, yyvsp[0].cbuf,
1562 yyvsp[-11].line,yyvsp[-1].line,
1569 push_function(PUBLIC_SCOPE, NULL, yyvsp[-6].id,
1570 yyvsp[-2].id, yyvsp[0].cbuf,yyvsp[-8].line,yyvsp[-1].line,
1577 push_function(PRIVATE_SCOPE, NULL, yyvsp[-6].id,
1578 yyvsp[-2].id, yyvsp[0].cbuf,yyvsp[-8].line,yyvsp[-1].line,
1585 if(strcmp(yyvsp[-4].id,"init")==0) {
1586 push_init_arg(yyvsp[-2].id,FALSE);
1587 push_function(INIT_METHOD, NULL,
1588 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1590 } else if(strcmp(yyvsp[-4].id,"class_init")==0) {
1591 push_init_arg(yyvsp[-2].id,TRUE);
1592 push_function(CLASS_INIT_METHOD, NULL,
1593 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1596 g_free(yyvsp[-4].id);
1597 g_free(yyvsp[-2].id);
1598 g_string_free(yyvsp[-2].cbuf,TRUE);
1599 yyerror(_("parse error"));
1606 { yyval.id = yyvsp[0].id; ;
1611 yyval.id = (yyvsp[0].cbuf)->str;
1612 g_string_free(yyvsp[0].cbuf,FALSE);
1621 { yyval.id = NULL; ;
1625 { vararg = FALSE; has_self = FALSE; ;
1632 if(strcmp(yyvsp[0].id,"self")==0)
1633 push_self(yyvsp[0].id);
1635 g_free(yyvsp[0].id);
1636 yyerror(_("parse error"));
1645 if(strcmp(yyvsp[-2].id,"self")==0)
1646 push_self(yyvsp[-2].id);
1648 g_free(yyvsp[-2].id);
1649 yyerror(_("parse error"));
1656 { has_self = FALSE; ;
1677 push_funcarg(yyvsp[0].id,NULL);
1683 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
1689 if(strcmp(yyvsp[-2].id,"check")!=0) {
1690 yyerror(_("parse error"));
1693 g_free(yyvsp[-2].id);
1694 push_funcarg(yyvsp[-4].id,NULL);
1700 if(strcmp(yyvsp[-2].id,"check")!=0) {
1701 yyerror(_("parse error"));
1704 g_free(yyvsp[-2].id);
1705 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
1719 if(strcmp(yyvsp[0].id,"type")==0) {
1720 Node *node = new_check(TYPE_CHECK,NULL);
1721 checks = g_list_append(checks,node);
1722 } else if(strcmp(yyvsp[0].id,"null")==0) {
1723 Node *node = new_check(NULL_CHECK,NULL);
1724 checks = g_list_append(checks,node);
1726 yyerror(_("parse error"));
1729 g_free(yyvsp[0].id);
1735 Node *node = new_check(GT_CHECK,yyvsp[0].id);
1736 checks = g_list_append(checks,node);
1742 Node *node = new_check(LT_CHECK,yyvsp[0].id);
1743 checks = g_list_append(checks,node);
1749 Node *node = new_check(GE_CHECK,yyvsp[0].id);
1750 checks = g_list_append(checks,node);
1756 Node *node = new_check(LE_CHECK,yyvsp[0].id);
1757 checks = g_list_append(checks,node);
1763 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
1764 checks = g_list_append(checks,node);
1770 Node *node = new_check(NE_CHECK,yyvsp[0].id);
1771 checks = g_list_append(checks,node);
1776 { yyval.id = yyvsp[0].id; ;
1781 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
1782 g_free(yyvsp[0].id);
1787 { yyval.id = yyvsp[0].id; ;
1790 /* the action file gets copied in in place of this dollarsign */
1791 #line 543 "/usr/lib/bison.simple"
1802 short *ssp1 = yyss - 1;
1803 fprintf (stderr, "state stack now");
1804 while (ssp1 != yyssp)
1805 fprintf (stderr, " %d", *++ssp1);
1806 fprintf (stderr, "\n");
1816 yylsp->first_line = yylloc.first_line;
1817 yylsp->first_column = yylloc.first_column;
1818 yylsp->last_line = (yylsp-1)->last_line;
1819 yylsp->last_column = (yylsp-1)->last_column;
1824 yylsp->last_line = (yylsp+yylen-1)->last_line;
1825 yylsp->last_column = (yylsp+yylen-1)->last_column;
1829 /* Now "shift" the result of the reduction.
1830 Determine what state that goes to,
1831 based on the state we popped back to
1832 and the rule number reduced by. */
1836 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1837 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1838 yystate = yytable[yystate];
1840 yystate = yydefgoto[yyn - YYNTBASE];
1844 yyerrlab: /* here on detecting error */
1847 /* If not already recovering from an error, report this error. */
1851 #ifdef YYERROR_VERBOSE
1852 yyn = yypact[yystate];
1854 if (yyn > YYFLAG && yyn < YYLAST)
1861 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1862 for (x = (yyn < 0 ? -yyn : 0);
1863 x < (sizeof(yytname) / sizeof(char *)); x++)
1864 if (yycheck[x + yyn] == x)
1865 size += strlen(yytname[x]) + 15, count++;
1866 msg = (char *) malloc(size + 15);
1869 strcpy(msg, "parse error");
1874 for (x = (yyn < 0 ? -yyn : 0);
1875 x < (sizeof(yytname) / sizeof(char *)); x++)
1876 if (yycheck[x + yyn] == x)
1878 strcat(msg, count == 0 ? ", expecting `" : " or `");
1879 strcat(msg, yytname[x]);
1888 yyerror ("parse error; also virtual memory exceeded");
1891 #endif /* YYERROR_VERBOSE */
1892 yyerror("parse error");
1896 yyerrlab1: /* here on error raised explicitly by an action */
1898 if (yyerrstatus == 3)
1900 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1902 /* return failure if at end of input */
1903 if (yychar == YYEOF)
1908 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1914 /* Else will try to reuse lookahead token
1915 after shifting the error token. */
1917 yyerrstatus = 3; /* Each real token shifted decrements this */
1921 yyerrdefault: /* current state does not do anything special for the error token. */
1924 /* This is wrong; only states that explicitly want error tokens
1925 should shift them. */
1926 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1927 if (yyn) goto yydefault;
1930 yyerrpop: /* pop the current state because it cannot handle the error token */
1932 if (yyssp == yyss) YYABORT;
1942 short *ssp1 = yyss - 1;
1943 fprintf (stderr, "Error: state stack now");
1944 while (ssp1 != yyssp)
1945 fprintf (stderr, " %d", *++ssp1);
1946 fprintf (stderr, "\n");
1952 yyn = yypact[yystate];
1957 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1976 fprintf(stderr, "Shifting error token, ");
1988 /* YYACCEPT comes here. */
2000 /* YYABORT comes here. */