2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
51 extern char *filename;
55 static GList *class_nodes = NULL;
58 static GList *typestack = NULL;
60 static GList *funcargs = NULL;
61 static GList *checks = NULL;
62 static int has_self = FALSE;
63 static int vararg = FALSE;
65 static GList *gtktypes = NULL;
67 /* this can be a global as we will only do one function at a time
69 static int the_scope = NO_SCOPE;
74 extern int ccode_line;
85 if(strcmp(yytext,"\n")==0) {
86 out=g_strconcat("Error: ",str," before newline",NULL);
87 } else if(yytext[0]=='\0') {
88 out=g_strconcat("Error: ",str," at end of input",NULL);
90 char *tmp = g_strdup(yytext);
91 while((p=strchr(tmp,'\n')))
94 out=g_strconcat("Error: ",str," before '",tmp,"'",NULL);
98 fprintf(stderr,"%s:%d: %s\n",filename,line_no,out);
107 Type *type = typestack->data;
108 typestack = g_list_remove(typestack,typestack->data);
113 push_variable(char *name, int scope, int line_no, char *postfix)
116 Type *type = pop_type();
118 type->postfix = postfix;
120 var = new_variable(scope,type,name,line_no);
121 class_nodes = g_list_append(class_nodes, var);
125 push_function(int scope, int method, char *oid, char *id, char *onerror,
126 GString *cbuf,int line_no, int ccode_line, int vararg)
132 if(method!=INIT_METHOD && method!=CLASS_INIT_METHOD) {
135 type = (Type *)new_type(0,g_strdup("void"),NULL);
138 /* a complicated and ugly test to figure out if we have
139 the wrong number of types for a signal */
140 if((method == SIGNAL_FIRST_METHOD ||
141 method == SIGNAL_LAST_METHOD) &&
142 g_list_length(gtktypes) != g_list_length(funcargs) &&
143 !(g_list_length(funcargs) == 1 &&
144 g_list_length(gtktypes) == 2 &&
145 strcmp(gtktypes->next->data,"NONE")==0)) {
146 print_error(TRUE, _("The number of GTK arguments and "
147 "function arguments for a signal "
148 "don't seem to match"),line_no);
152 c_cbuf = p = cbuf->str;
153 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
160 node = new_method(scope,method,type,oid,gtktypes,id,funcargs,
161 onerror,c_cbuf,line_no,ccode_line,vararg);
165 /*only free segment if we haven't passed it
171 class_nodes = g_list_append(class_nodes, node);
175 push_funcarg(char *name, char *postfix)
178 Type *type = pop_type();
180 type->postfix = postfix;
182 node = new_funcarg(type,name,checks);
185 funcargs = g_list_append(funcargs, node);
189 push_init_arg(char *name, int is_class)
196 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
198 tn = g_strdup(((Class *)class)->otype);
200 type = new_type(1,tn,NULL);
201 node = new_funcarg((Type *)type,name,NULL);
202 funcargs = g_list_prepend(funcargs, node);
211 type = new_type(1,g_strdup(((Class *)class)->otype),NULL);
212 ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
213 ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
214 node = new_funcarg((Type *)type,id,ch);
215 funcargs = g_list_prepend(funcargs, node);
242 #define YYFLAG -32768
245 #define YYTRANSLATE(x) ((unsigned)(x) <= 286 ? yytranslate[x] : 77)
247 static const char yytranslate[] = { 0,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 44, 2, 2, 2, 2, 2, 2, 36,
252 37, 39, 2, 40, 45, 2, 2, 2, 2, 2,
253 2, 2, 2, 2, 2, 2, 2, 2, 35, 42,
254 43, 41, 2, 2, 2, 2, 2, 2, 2, 2,
255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
260 2, 2, 33, 38, 34, 2, 2, 2, 2, 2,
261 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
274 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
275 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
276 27, 28, 29, 30, 31, 32
280 static const short yyprhs[] = { 0,
281 0, 4, 7, 10, 12, 15, 18, 20, 22, 27,
282 31, 36, 39, 42, 45, 47, 49, 51, 53, 55,
283 57, 62, 68, 80, 89, 95, 97, 101, 102, 106,
284 108, 110, 113, 115, 118, 121, 124, 126, 129, 132,
285 134, 136, 138, 140, 143, 145, 147, 150, 152, 155,
286 157, 159, 161, 163, 165, 168, 170, 173, 175, 179,
287 183, 186, 188, 193, 197, 199, 202, 204, 214, 225,
288 235, 245, 254, 266, 275, 281, 284, 288, 289, 291,
289 293, 297, 299, 303, 305, 309, 311, 314, 318, 325,
290 333, 336, 338, 340, 343, 346, 350, 354, 358, 362,
294 static const short yyrhs[] = { 47,
295 48, 47, 0, 48, 47, 0, 47, 48, 0, 48,
296 0, 47, 24, 0, 47, 25, 0, 24, 0, 25,
297 0, 49, 33, 50, 34, 0, 49, 33, 34, 0,
298 3, 22, 4, 22, 0, 50, 68, 0, 50, 52,
299 0, 50, 53, 0, 68, 0, 52, 0, 53, 0,
300 26, 0, 27, 0, 28, 0, 51, 57, 20, 35,
301 0, 51, 57, 20, 23, 35, 0, 29, 55, 54,
302 20, 20, 33, 24, 20, 33, 24, 35, 0, 29,
303 55, 54, 20, 20, 33, 24, 35, 0, 20, 36,
304 20, 57, 37, 0, 20, 0, 36, 56, 37, 0,
305 0, 20, 38, 56, 0, 20, 0, 58, 0, 5,
306 58, 0, 59, 0, 59, 62, 0, 12, 60, 0,
307 11, 60, 0, 60, 0, 12, 18, 0, 11, 18,
308 0, 18, 0, 17, 0, 16, 0, 20, 0, 61,
309 20, 0, 22, 0, 6, 0, 13, 15, 0, 13,
310 0, 14, 15, 0, 14, 0, 15, 0, 9, 0,
311 8, 0, 7, 0, 39, 62, 0, 39, 0, 20,
312 65, 0, 65, 0, 51, 20, 65, 0, 20, 51,
313 65, 0, 51, 65, 0, 63, 0, 20, 36, 66,
314 37, 0, 66, 40, 20, 0, 20, 0, 33, 24,
315 0, 35, 0, 31, 64, 57, 20, 36, 70, 37,
316 69, 67, 0, 51, 31, 63, 57, 20, 36, 70,
317 37, 69, 67, 0, 30, 51, 57, 20, 36, 70,
318 37, 69, 67, 0, 51, 30, 57, 20, 36, 70,
319 37, 69, 67, 0, 30, 57, 20, 36, 70, 37,
320 69, 67, 0, 32, 36, 22, 37, 57, 20, 36,
321 70, 37, 69, 67, 0, 51, 57, 20, 36, 70,
322 37, 69, 67, 0, 20, 36, 20, 37, 67, 0,
323 19, 76, 0, 19, 33, 24, 0, 0, 6, 0,
324 20, 0, 20, 40, 71, 0, 71, 0, 72, 40,
325 10, 0, 72, 0, 72, 40, 73, 0, 73, 0,
326 57, 20, 0, 57, 20, 23, 0, 57, 20, 36,
327 20, 74, 37, 0, 57, 20, 23, 36, 20, 74,
328 37, 0, 74, 75, 0, 75, 0, 20, 0, 41,
329 76, 0, 42, 76, 0, 41, 43, 76, 0, 42,
330 43, 76, 0, 43, 43, 76, 0, 44, 43, 76,
331 0, 21, 0, 45, 21, 0, 20, 0
337 static const short yyrline[] = { 0,
338 221, 222, 223, 224, 227, 233, 238, 244, 251, 256,
339 263, 268, 269, 270, 271, 272, 273, 276, 277, 278,
340 281, 284, 288, 323, 353, 362, 368, 369, 372, 375,
341 381, 382, 390, 394, 401, 404, 407, 410, 413, 416,
342 419, 422, 425, 428, 432, 435, 440, 443, 446, 449,
343 452, 457, 460, 463, 468, 469, 473, 485, 491, 503,
344 515, 518, 524, 529, 532, 537, 538, 542, 552, 562,
345 572, 582, 592, 598, 603, 624, 625, 629, 632, 633,
346 644, 654, 657, 658, 661, 662, 665, 668, 671, 679,
347 689, 690, 693, 706, 710, 714, 718, 722, 726, 732,
353 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
355 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
356 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
357 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN",
358 "ARRAY_DIM","CCODE","HCODE","PUBLIC","PRIVATE","PROTECTED","ARGUMENT","VIRTUAL",
359 "SIGNAL","OVERRIDE","'{'","'}'","';'","'('","')'","'|'","'*'","','","'>'","'<'",
360 "'='","'!'","'-'","prog","ccodes","class","classdec","classcode","scope","variable",
361 "argument","argtype","argflags","flaglist","type","type1","type2","integer",
362 "tspecifier","stars","simplesigtype","fullsigtype","sigtype","tokenlist","codenocode",
363 "method","onerror","funcargs","arglist","arglist1","arg","checklist","check",
368 static const short yyr1[] = { 0,
369 46, 46, 46, 46, 47, 47, 47, 47, 48, 48,
370 49, 50, 50, 50, 50, 50, 50, 51, 51, 51,
371 52, 52, 53, 53, 54, 54, 55, 55, 56, 56,
372 57, 57, 58, 58, 59, 59, 59, 59, 59, 59,
373 59, 59, 59, 59, 59, 59, 60, 60, 60, 60,
374 60, 61, 61, 61, 62, 62, 63, 63, 64, 64,
375 64, 64, 65, 66, 66, 67, 67, 68, 68, 68,
376 68, 68, 68, 68, 68, 69, 69, 69, 70, 70,
377 70, 70, 71, 71, 72, 72, 73, 73, 73, 73,
378 74, 74, 75, 75, 75, 75, 75, 75, 75, 76,
382 static const short yyr2[] = { 0,
383 3, 2, 2, 1, 2, 2, 1, 1, 4, 3,
384 4, 2, 2, 2, 1, 1, 1, 1, 1, 1,
385 4, 5, 11, 8, 5, 1, 3, 0, 3, 1,
386 1, 2, 1, 2, 2, 2, 1, 2, 2, 1,
387 1, 1, 1, 2, 1, 1, 2, 1, 2, 1,
388 1, 1, 1, 1, 2, 1, 2, 1, 3, 3,
389 2, 1, 4, 3, 1, 2, 1, 9, 10, 9,
390 9, 8, 11, 8, 5, 2, 3, 0, 1, 1,
391 3, 1, 3, 1, 3, 1, 2, 3, 6, 7,
392 2, 1, 1, 2, 2, 3, 3, 3, 3, 1,
396 static const short yydefact[] = { 0,
397 0, 7, 8, 0, 4, 0, 0, 5, 6, 3,
398 2, 0, 0, 1, 0, 18, 19, 20, 28, 0,
399 0, 0, 10, 0, 0, 16, 17, 15, 11, 0,
400 0, 0, 0, 46, 54, 53, 52, 0, 0, 48,
401 50, 51, 42, 41, 40, 43, 45, 0, 0, 31,
402 33, 37, 0, 0, 0, 62, 0, 58, 0, 9,
403 13, 14, 12, 0, 0, 0, 0, 30, 0, 26,
404 0, 32, 39, 36, 38, 35, 47, 49, 0, 0,
405 56, 34, 44, 0, 0, 0, 57, 0, 61, 0,
406 0, 0, 0, 0, 0, 0, 0, 27, 0, 0,
407 0, 0, 55, 65, 0, 60, 59, 0, 0, 0,
408 0, 0, 21, 0, 0, 67, 75, 29, 0, 0,
409 0, 46, 43, 0, 0, 82, 84, 86, 63, 0,
410 0, 0, 0, 0, 22, 0, 66, 0, 0, 0,
411 0, 87, 78, 0, 64, 0, 0, 0, 0, 78,
412 25, 0, 78, 81, 88, 0, 0, 0, 83, 85,
413 78, 0, 78, 0, 0, 0, 24, 0, 0, 0,
414 102, 100, 0, 0, 76, 72, 0, 0, 0, 78,
415 74, 0, 70, 0, 93, 0, 0, 0, 0, 0,
416 92, 77, 101, 68, 78, 71, 0, 0, 0, 0,
417 94, 0, 95, 0, 0, 89, 91, 0, 69, 23,
418 90, 96, 97, 98, 99, 73, 0, 0, 0
421 static const short yydefgoto[] = { 217,
422 4, 5, 6, 24, 25, 26, 27, 71, 32, 69,
423 124, 50, 51, 52, 53, 82, 56, 57, 58, 105,
424 117, 28, 158, 125, 126, 127, 128, 190, 191, 175
427 static const short yypact[] = { 69,
428 -13,-32768,-32768, 73, 89, -19, 17,-32768,-32768, 89,
429 125, 216, 11, 125, 6,-32768,-32768,-32768, 46, 115,
430 120, 50,-32768, 229, 53,-32768,-32768,-32768,-32768, 68,
431 76, 81, 206,-32768,-32768,-32768,-32768, 251, 257, 92,
432 110,-32768,-32768,-32768,-32768,-32768,-32768, 171, 131,-32768,
433 114,-32768, 135, 205, 152,-32768, 171,-32768, 159,-32768,
434 -32768,-32768,-32768, 171, 154, 170, 155, 161, 173, 172,
435 196,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 207, 193,
436 114,-32768,-32768, 194, 214, 215,-32768, -10,-32768, 217,
437 201, 219, -10, 171, 56, 101, 76,-32768, 220, 231,
438 218, 189,-32768,-32768, -5,-32768,-32768, 226, 171, 232,
439 233, 238,-32768, 189, 228,-32768,-32768,-32768, 171, 234,
440 189, 237, 16, 256, 240,-32768, 239,-32768,-32768, 258,
441 189, 260, 189, 245,-32768, 246,-32768, 247, 261, 249,
442 171, -7, 263, 153,-32768, 250, 252, 253, 189, 263,
443 -32768, -8, 263,-32768, 255, 269, 10, 101,-32768,-32768,
444 263, 189, 263, 259, 101, 262,-32768, 101, 272, 4,
445 -32768,-32768, 270, 276,-32768,-32768, 101, 264, 101, 263,
446 -32768, 274,-32768, 4,-32768, 57, 60, 265, 266, 67,
447 -32768,-32768,-32768,-32768, 263,-32768, 101, 267, 75, 18,
448 -32768, 18,-32768, 18, 18,-32768,-32768, 101,-32768,-32768,
449 -32768,-32768,-32768,-32768,-32768,-32768, 293, 299,-32768
452 static const short yypgoto[] = {-32768,
453 80, 296,-32768,-32768, -18, 279, 280,-32768,-32768, 208,
454 -20, 273,-32768, 106,-32768, 230, 242,-32768, -36,-32768,
455 -157, 286, -146, -108, 174,-32768, 168, 129, -84, -48
462 static const short yytable[] = { 49,
463 176, 48, 55, 165, 66, 136, 168, 181, 7, 84,
464 183, 166, 140, 12, 177, 155, 179, 87, 89, 194,
465 13, 196, 146, 185, 148, 85, 167, 79, 156, 171,
466 172, 129, 29, 197, 130, 86, 90, 171, 172, 209,
467 164, 30, 173, 92, 186, 187, 188, 189, 208, 106,
468 216, 107, -80, 178, 174, 141, 87, 33, 34, 35,
469 36, 37, 174, 38, 39, 40, 41, 42, 43, 44,
470 45, 1, 46, 111, 47, 1, 171, 172, 112, 171,
471 172, 31, 64, 65, 11, 59, 185, 67, 132, 14,
472 113, 114, 2, 3, 185, 68, 8, 9, 138, 200,
473 70, 174, 202, 206, 174, 207, 77, 186, 187, 188,
474 189, 211, 2, 3, 207, 186, 187, 188, 189, 33,
475 34, 35, 36, 37, 78, 38, 39, 40, 41, 42,
476 43, 44, 45, 115, 46, 116, 47, 201, 203, 54,
477 16, 17, 18, 74, 76, 16, 17, 18, 8, 9,
478 80, 212, 81, 213, 83, 214, 215, 33, 34, 35,
479 36, 37, 159, 38, 39, 40, 41, 42, 43, 44,
480 45, 88, 46, 93, 47, 33, 34, 35, 36, 37,
481 91, 38, 39, 40, 41, 42, 43, 44, 45, 95,
482 46, 96, 47, 33, 122, 35, 36, 37, 97, 38,
483 39, 40, 41, 42, 43, 44, 45, 99, 123, 98,
484 47, 34, 35, 36, 37, 100, 38, 39, 40, 41,
485 42, 43, 44, 45, 84, 46, 101, 47, 102, 85,
486 16, 17, 18, 104, 84, 15, 108, 109, 110, 119,
487 85, 16, 17, 18, 19, 20, 21, 22, 15, 23,
488 120, 137, 134, 121, 16, 17, 18, 19, 20, 21,
489 22, 131, 60, 40, 41, 42, 139, 133, 73, 40,
490 41, 42, 135, -79, 75, 142, 143, 145, 144, 147,
491 149, 157, 150, 151, 152, 153, 161, 162, 170, 163,
492 169, 184, 218, 192, 182, 180, 193, 198, 219, 10,
493 195, 210, 61, 62, 118, 72, 94, 204, 205, 63,
494 103, 160, 199, 0, 154
497 static const short yycheck[] = { 20,
498 158, 20, 21, 150, 25, 114, 153, 165, 22, 20,
499 168, 20, 121, 33, 161, 23, 163, 54, 55, 177,
500 4, 179, 131, 20, 133, 36, 35, 48, 36, 20,
501 21, 37, 22, 180, 40, 54, 57, 20, 21, 197,
502 149, 36, 33, 64, 41, 42, 43, 44, 195, 86,
503 208, 88, 37, 162, 45, 40, 93, 5, 6, 7,
504 8, 9, 45, 11, 12, 13, 14, 15, 16, 17,
505 18, 3, 20, 94, 22, 3, 20, 21, 23, 20,
506 21, 36, 30, 31, 5, 36, 20, 20, 109, 10,
507 35, 36, 24, 25, 20, 20, 24, 25, 119, 43,
508 20, 45, 43, 37, 45, 190, 15, 41, 42, 43,
509 44, 37, 24, 25, 199, 41, 42, 43, 44, 5,
510 6, 7, 8, 9, 15, 11, 12, 13, 14, 15,
511 16, 17, 18, 33, 20, 35, 22, 186, 187, 20,
512 26, 27, 28, 38, 39, 26, 27, 28, 24, 25,
513 20, 200, 39, 202, 20, 204, 205, 5, 6, 7,
514 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
515 18, 20, 20, 20, 22, 5, 6, 7, 8, 9,
516 22, 11, 12, 13, 14, 15, 16, 17, 18, 20,
517 20, 37, 22, 5, 6, 7, 8, 9, 38, 11,
518 12, 13, 14, 15, 16, 17, 18, 36, 20, 37,
519 22, 6, 7, 8, 9, 20, 11, 12, 13, 14,
520 15, 16, 17, 18, 20, 20, 20, 22, 36, 36,
521 26, 27, 28, 20, 20, 20, 20, 37, 20, 20,
522 36, 26, 27, 28, 29, 30, 31, 32, 20, 34,
523 20, 24, 20, 36, 26, 27, 28, 29, 30, 31,
524 32, 36, 34, 13, 14, 15, 33, 36, 18, 13,
525 14, 15, 35, 37, 18, 20, 37, 20, 40, 20,
526 36, 19, 37, 37, 24, 37, 37, 36, 20, 37,
527 36, 20, 0, 24, 33, 37, 21, 24, 0, 4,
528 37, 35, 24, 24, 97, 33, 65, 43, 43, 24,
529 81, 144, 184, -1, 141
531 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
532 #line 3 "/usr/lib/bison.simple"
533 /* This file comes from bison-1.28. */
535 /* Skeleton output parser for bison,
536 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
538 This program is free software; you can redistribute it and/or modify
539 it under the terms of the GNU General Public License as published by
540 the Free Software Foundation; either version 2, or (at your option)
543 This program is distributed in the hope that it will be useful,
544 but WITHOUT ANY WARRANTY; without even the implied warranty of
545 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
546 GNU General Public License for more details.
548 You should have received a copy of the GNU General Public License
549 along with this program; if not, write to the Free Software
550 Foundation, Inc., 59 Temple Place - Suite 330,
551 Boston, MA 02111-1307, USA. */
553 /* As a special exception, when this file is copied by Bison into a
554 Bison output file, you may use that output file without restriction.
555 This special exception was added by the Free Software Foundation
556 in version 1.24 of Bison. */
558 /* This is the parser code that is written into each bison parser
559 when the %semantic_parser declaration is not specified in the grammar.
560 It was written by Richard Stallman by simplifying the hairy parser
561 used when %semantic_parser is specified. */
563 #ifndef YYSTACK_USE_ALLOCA
565 #define YYSTACK_USE_ALLOCA
566 #else /* alloca not defined */
568 #define YYSTACK_USE_ALLOCA
569 #define alloca __builtin_alloca
570 #else /* not GNU C. */
571 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
572 #define YYSTACK_USE_ALLOCA
574 #else /* not sparc */
575 /* We think this test detects Watcom and Microsoft C. */
576 /* This used to test MSDOS, but that is a bad idea
577 since that symbol is in the user namespace. */
578 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
579 #if 0 /* No need for malloc.h, which pollutes the namespace;
580 instead, just don't use alloca. */
583 #else /* not MSDOS, or __TURBOC__ */
585 /* I don't know what this was needed for, but it pollutes the namespace.
586 So I turned it off. rms, 2 May 1997. */
587 /* #include <malloc.h> */
589 #define YYSTACK_USE_ALLOCA
590 #else /* not MSDOS, or __TURBOC__, or _AIX */
592 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
593 and on HPUX 10. Eventually we can turn this on. */
594 #define YYSTACK_USE_ALLOCA
595 #define alloca __builtin_alloca
598 #endif /* not _AIX */
599 #endif /* not MSDOS, or __TURBOC__ */
600 #endif /* not sparc */
601 #endif /* not GNU C */
602 #endif /* alloca not defined */
603 #endif /* YYSTACK_USE_ALLOCA not defined */
605 #ifdef YYSTACK_USE_ALLOCA
606 #define YYSTACK_ALLOC alloca
608 #define YYSTACK_ALLOC malloc
611 /* Note: there must be only one dollar sign in this file.
612 It is replaced by the list of actions, each action
613 as one case of the switch. */
615 #define yyerrok (yyerrstatus = 0)
616 #define yyclearin (yychar = YYEMPTY)
619 #define YYACCEPT goto yyacceptlab
620 #define YYABORT goto yyabortlab
621 #define YYERROR goto yyerrlab1
622 /* Like YYERROR except do call yyerror.
623 This remains here temporarily to ease the
624 transition to the new meaning of YYERROR, for GCC.
625 Once GCC version 2 has supplanted version 1, this can go. */
626 #define YYFAIL goto yyerrlab
627 #define YYRECOVERING() (!!yyerrstatus)
628 #define YYBACKUP(token, value) \
630 if (yychar == YYEMPTY && yylen == 1) \
631 { yychar = (token), yylval = (value); \
632 yychar1 = YYTRANSLATE (yychar); \
637 { yyerror ("syntax error: cannot back up"); YYERROR; } \
641 #define YYERRCODE 256
644 #define YYLEX yylex()
650 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
652 #define YYLEX yylex(&yylval, &yylloc)
654 #else /* not YYLSP_NEEDED */
656 #define YYLEX yylex(&yylval, YYLEX_PARAM)
658 #define YYLEX yylex(&yylval)
660 #endif /* not YYLSP_NEEDED */
663 /* If nonreentrant, generate the variables here */
667 int yychar; /* the lookahead symbol */
668 YYSTYPE yylval; /* the semantic value of the */
669 /* lookahead symbol */
672 YYLTYPE yylloc; /* location data for the lookahead */
676 int yynerrs; /* number of parse errors so far */
677 #endif /* not YYPURE */
680 int yydebug; /* nonzero means print parse trace */
681 /* Since this is uninitialized, it does not stop multiple parsers
685 /* YYINITDEPTH indicates the initial size of the parser's stacks */
688 #define YYINITDEPTH 200
691 /* YYMAXDEPTH is the maximum size the stacks can grow to
692 (effective only if the built-in stack extension method is used). */
699 #define YYMAXDEPTH 10000
702 /* Define __yy_memcpy. Note that the size argument
703 should be passed with type unsigned int, because that is what the non-GCC
704 definitions require. With GCC, __builtin_memcpy takes an arg
705 of type size_t, but it can handle unsigned int. */
707 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
708 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
709 #else /* not GNU C or C++ */
712 /* This is the most reliable way to avoid incompatibilities
713 in available built-in functions on various systems. */
715 __yy_memcpy (to, from, count)
720 register char *f = from;
721 register char *t = to;
722 register int i = count;
728 #else /* __cplusplus */
730 /* This is the most reliable way to avoid incompatibilities
731 in available built-in functions on various systems. */
733 __yy_memcpy (char *to, char *from, unsigned int count)
735 register char *t = to;
736 register char *f = from;
737 register int i = count;
746 #line 217 "/usr/lib/bison.simple"
748 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
749 into yyparse. The argument should have type void *.
750 It should actually point to an object.
751 Grammar actions can access the variable by casting it
752 to the proper pointer type. */
756 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
757 #define YYPARSE_PARAM_DECL
758 #else /* not __cplusplus */
759 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
760 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
761 #endif /* not __cplusplus */
762 #else /* not YYPARSE_PARAM */
763 #define YYPARSE_PARAM_ARG
764 #define YYPARSE_PARAM_DECL
765 #endif /* not YYPARSE_PARAM */
767 /* Prevent warning if -Wstrict-prototypes. */
770 int yyparse (void *);
777 yyparse(YYPARSE_PARAM_ARG)
780 register int yystate;
782 register short *yyssp;
783 register YYSTYPE *yyvsp;
784 int yyerrstatus; /* number of tokens to shift before error messages enabled */
785 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
787 short yyssa[YYINITDEPTH]; /* the state stack */
788 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
790 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
791 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
794 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
795 YYLTYPE *yyls = yylsa;
798 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
800 #define YYPOPSTACK (yyvsp--, yyssp--)
803 int yystacksize = YYINITDEPTH;
804 int yyfree_stacks = 0;
815 YYSTYPE yyval; /* the variable used to return */
816 /* semantic values from the action */
823 fprintf(stderr, "Starting parse\n");
829 yychar = YYEMPTY; /* Cause a token to be read. */
831 /* Initialize stack pointers.
832 Waste one element of value and location stack
833 so that they stay on the same level as the state stack.
834 The wasted elements are never initialized. */
842 /* Push a new state, which is found in yystate . */
843 /* In all cases, when you get here, the value and location stacks
844 have just been pushed. so pushing a state here evens the stacks. */
849 if (yyssp >= yyss + yystacksize - 1)
851 /* Give user a chance to reallocate the stack */
852 /* Use copies of these so that the &'s don't force the real ones into memory. */
853 YYSTYPE *yyvs1 = yyvs;
856 YYLTYPE *yyls1 = yyls;
859 /* Get the current used size of the three stacks, in elements. */
860 int size = yyssp - yyss + 1;
863 /* Each stack pointer address is followed by the size of
864 the data in use in that stack, in bytes. */
866 /* This used to be a conditional around just the two extra args,
867 but that might be undefined if yyoverflow is a macro. */
868 yyoverflow("parser stack overflow",
869 &yyss1, size * sizeof (*yyssp),
870 &yyvs1, size * sizeof (*yyvsp),
871 &yyls1, size * sizeof (*yylsp),
874 yyoverflow("parser stack overflow",
875 &yyss1, size * sizeof (*yyssp),
876 &yyvs1, size * sizeof (*yyvsp),
880 yyss = yyss1; yyvs = yyvs1;
884 #else /* no yyoverflow */
885 /* Extend the stack our own way. */
886 if (yystacksize >= YYMAXDEPTH)
888 yyerror("parser stack overflow");
900 if (yystacksize > YYMAXDEPTH)
901 yystacksize = YYMAXDEPTH;
902 #ifndef YYSTACK_USE_ALLOCA
905 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
906 __yy_memcpy ((char *)yyss, (char *)yyss1,
907 size * (unsigned int) sizeof (*yyssp));
908 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
909 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
910 size * (unsigned int) sizeof (*yyvsp));
912 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
913 __yy_memcpy ((char *)yyls, (char *)yyls1,
914 size * (unsigned int) sizeof (*yylsp));
916 #endif /* no yyoverflow */
918 yyssp = yyss + size - 1;
919 yyvsp = yyvs + size - 1;
921 yylsp = yyls + size - 1;
926 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
929 if (yyssp >= yyss + yystacksize - 1)
935 fprintf(stderr, "Entering state %d\n", yystate);
941 /* Do appropriate processing given the current state. */
942 /* Read a lookahead token if we need one and don't already have one. */
945 /* First try to decide what to do without reference to lookahead token. */
947 yyn = yypact[yystate];
951 /* Not known => get a lookahead token if don't already have one. */
953 /* yychar is either YYEMPTY or YYEOF
954 or a valid token in external form. */
956 if (yychar == YYEMPTY)
960 fprintf(stderr, "Reading a token: ");
965 /* Convert token to internal form (in yychar1) for indexing tables with */
967 if (yychar <= 0) /* This means end of input. */
970 yychar = YYEOF; /* Don't call YYLEX any more */
974 fprintf(stderr, "Now at end of input.\n");
979 yychar1 = YYTRANSLATE(yychar);
984 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
985 /* Give the individual parser a way to print the precise meaning
986 of a token, for further debugging info. */
988 YYPRINT (stderr, yychar, yylval);
990 fprintf (stderr, ")\n");
996 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1001 /* yyn is what to do for this token type in this state.
1002 Negative => reduce, -yyn is rule number.
1003 Positive => shift, yyn is new state.
1004 New state is final state => don't bother to shift,
1005 just return success.
1006 0, or most negative number => error. */
1021 /* Shift the lookahead token. */
1025 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1028 /* Discard the token being shifted unless it is eof. */
1029 if (yychar != YYEOF)
1037 /* count tokens shifted since error; after three, turn off error status. */
1038 if (yyerrstatus) yyerrstatus--;
1043 /* Do the default action for the current state. */
1046 yyn = yydefact[yystate];
1050 /* Do a reduction. yyn is the number of a rule to reduce with. */
1054 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1061 fprintf (stderr, "Reducing via rule %d (line %d), ",
1064 /* Print the symbols being reduced, and their result. */
1065 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1066 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1067 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1093 Node *node = new_ccode(FALSE,(yyvsp[0].cbuf)->str,
1095 nodes = g_list_append(nodes,node);
1096 g_string_free(yyvsp[0].cbuf,FALSE);
1102 Node *node = new_ccode(TRUE,(yyvsp[0].cbuf)->str,ccode_line);
1103 nodes = g_list_append(nodes,node);
1104 g_string_free(yyvsp[0].cbuf,FALSE);
1110 Node *node = new_ccode(FALSE,(yyvsp[0].cbuf)->str,
1112 nodes = g_list_append(nodes,node);
1113 g_string_free(yyvsp[0].cbuf,FALSE);
1119 Node *node = new_ccode(TRUE,(yyvsp[0].cbuf)->str,ccode_line);
1120 nodes = g_list_append(nodes,node);
1121 g_string_free(yyvsp[0].cbuf,FALSE);
1127 ((Class *)class)->nodes = class_nodes;
1129 nodes = g_list_append(nodes,class);
1135 ((Class *)class)->nodes = NULL;
1137 nodes = g_list_append(nodes,class);
1143 class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
1172 { the_scope = PUBLIC_SCOPE; ;
1176 { the_scope = PRIVATE_SCOPE; ;
1180 { the_scope = PROTECTED_SCOPE; ;
1185 push_variable(yyvsp[-1].id,the_scope,yyvsp[-3].line,NULL);
1191 push_variable(yyvsp[-2].id,the_scope,yyvsp[-4].line,yyvsp[-1].id);
1197 if(strcmp(yyvsp[-6].id,"get")==0 &&
1198 strcmp(yyvsp[-3].id,"set")==0) {
1200 Type *type = pop_type();
1201 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1202 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1203 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1204 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1206 g_string_free(yyvsp[-4].cbuf,FALSE);
1207 g_string_free(yyvsp[-1].cbuf,FALSE);
1208 class_nodes = g_list_append(class_nodes,node);
1209 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1210 strcmp(yyvsp[-3].id,"get")==0) {
1212 Type *type = pop_type();
1213 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1214 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1215 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1216 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1218 g_string_free(yyvsp[-1].cbuf,FALSE);
1219 g_string_free(yyvsp[-4].cbuf,FALSE);
1220 class_nodes = g_list_append(class_nodes,node);
1222 g_free(yyvsp[-8].id); g_free(yyvsp[-7].id);
1223 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1224 g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL);
1225 g_string_free(yyvsp[-1].cbuf,TRUE);
1226 g_string_free(yyvsp[-4].cbuf,TRUE);
1227 yyerror(_("parse error"));
1235 if(strcmp(yyvsp[-3].id,"get")==0) {
1237 Type *type = pop_type();
1238 g_free(yyvsp[-3].id);
1239 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1240 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1241 NULL,0, yyvsp[-7].line);
1242 g_string_free(yyvsp[-1].cbuf,FALSE);
1243 class_nodes = g_list_append(class_nodes,node);
1244 } else if(strcmp(yyvsp[-3].id,"set")==0) {
1246 Type *type = pop_type();
1247 g_free(yyvsp[-3].id);
1248 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1249 NULL,0,(yyvsp[-1].cbuf)->str,
1250 yyvsp[-2].line, yyvsp[-7].line);
1251 g_string_free(yyvsp[-1].cbuf,FALSE);
1252 class_nodes = g_list_append(class_nodes,node);
1254 g_free(yyvsp[-3].id); g_free(yyvsp[-5].id);
1255 g_free(yyvsp[-4].id);
1256 g_list_foreach(yyvsp[-6].list,(GFunc)g_free,NULL);
1257 g_string_free(yyvsp[-1].cbuf,TRUE);
1258 yyerror(_("parse error"));
1266 if(strcmp(yyvsp[-2].id,"type")!=0) {
1267 g_free(yyvsp[-4].id);
1268 g_free(yyvsp[-2].id);
1269 yyerror(_("parse error"));
1272 yyval.id = yyvsp[-4].id;
1278 yyval.id = yyvsp[0].id;
1279 typestack = g_list_prepend(typestack,NULL);
1284 { yyval.list = yyvsp[-1].list; ;
1288 { yyval.list = NULL; ;
1293 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1299 yyval.list = g_list_append(NULL,yyvsp[0].id);
1309 Type *type = typestack->data;
1310 char *oldname = type->name;
1311 type->name = g_strconcat("const ",oldname,NULL);
1318 Node *node = new_type(0,yyvsp[0].id,NULL);
1319 typestack = g_list_prepend(typestack,node);
1325 Node *node = new_type(stars,yyvsp[-1].id,NULL);
1327 typestack = g_list_prepend(typestack,node);
1333 yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
1339 yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
1345 yyval.id = g_strdup(yyvsp[0].id);
1351 yyval.id = g_strdup("unsigned char");
1357 yyval.id = g_strdup("signed char");
1363 yyval.id = g_strdup("char");
1369 yyval.id = g_strdup("double");
1375 yyval.id = g_strdup("float");
1381 yyval.id = yyvsp[0].id;
1387 yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
1388 g_free(yyvsp[0].id);
1394 yyval.id = yyvsp[0].id;
1400 yyval.id = g_strdup("void");
1406 yyval.id = "long int";
1418 yyval.id = "short int";
1442 yyval.id = "union ";
1448 yyval.id = "struct ";
1462 if(strcmp(yyvsp[-1].id,"first")==0)
1463 yyval.sigtype = SIGNAL_FIRST_METHOD;
1464 else if(strcmp(yyvsp[-1].id,"last")==0)
1465 yyval.sigtype = SIGNAL_LAST_METHOD;
1467 yyerror(_("signal must be 'first' or 'last'"));
1468 g_free(yyvsp[-1].id);
1471 g_free(yyvsp[-1].id);
1477 yyval.sigtype = SIGNAL_LAST_METHOD;
1483 if(strcmp(yyvsp[-1].id,"first")==0)
1484 yyval.sigtype = SIGNAL_FIRST_METHOD;
1485 else if(strcmp(yyvsp[-1].id,"last")==0)
1486 yyval.sigtype = SIGNAL_LAST_METHOD;
1488 yyerror(_("signal must be 'first' or 'last'"));
1489 g_free(yyvsp[-1].id);
1492 g_free(yyvsp[-1].id);
1498 if(strcmp(yyvsp[-2].id,"first")==0)
1499 yyval.sigtype = SIGNAL_FIRST_METHOD;
1500 else if(strcmp(yyvsp[-2].id,"last")==0)
1501 yyval.sigtype = SIGNAL_LAST_METHOD;
1503 yyerror(_("signal must be 'first' or 'last'"));
1504 g_free(yyvsp[-2].id);
1507 g_free(yyvsp[-2].id);
1513 yyval.sigtype = SIGNAL_LAST_METHOD;
1519 /* the_scope was default thus public */
1520 the_scope = PUBLIC_SCOPE;
1526 gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
1532 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1538 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1543 { yyval.cbuf = yyvsp[0].cbuf; ;
1547 { yyval.cbuf = NULL; ;
1553 yyerror(_("signal without 'self' as "
1554 "first parameter"));
1557 push_function(the_scope, yyvsp[-7].sigtype,NULL,
1558 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1566 yyerror(_("signal without 'self' as "
1567 "first parameter"));
1570 push_function(the_scope, yyvsp[-7].sigtype,NULL,
1571 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1579 yyerror(_("virtual method without 'self' as "
1580 "first parameter"));
1583 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1584 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1592 yyerror(_("virtual method without 'self' as "
1593 "first parameter"));
1596 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1597 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,
1605 yyerror(_("virtual method without 'self' as "
1606 "first parameter"));
1609 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
1610 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,
1617 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
1618 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,
1619 yyvsp[-10].line,ccode_line,
1626 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
1627 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,ccode_line,
1634 if(strcmp(yyvsp[-4].id,"init")==0) {
1635 push_init_arg(yyvsp[-2].id,FALSE);
1636 push_function(NO_SCOPE, INIT_METHOD, NULL,
1637 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1639 } else if(strcmp(yyvsp[-4].id,"class_init")==0) {
1640 push_init_arg(yyvsp[-2].id,TRUE);
1641 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
1642 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1645 g_free(yyvsp[-4].id);
1646 g_free(yyvsp[-2].id);
1647 g_string_free(yyvsp[-2].cbuf,TRUE);
1648 yyerror(_("parse error"));
1655 { yyval.id = yyvsp[0].id; ;
1660 yyval.id = (yyvsp[0].cbuf)->str;
1661 g_string_free(yyvsp[0].cbuf,FALSE);
1666 { yyval.id = NULL; ;
1670 { vararg = FALSE; has_self = FALSE; ;
1677 if(strcmp(yyvsp[0].id,"self")==0)
1678 push_self(yyvsp[0].id);
1680 g_free(yyvsp[0].id);
1681 yyerror(_("parse error"));
1690 if(strcmp(yyvsp[-2].id,"self")==0)
1691 push_self(yyvsp[-2].id);
1693 g_free(yyvsp[-2].id);
1694 yyerror(_("parse error"));
1701 { has_self = FALSE; ;
1722 push_funcarg(yyvsp[0].id,NULL);
1728 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
1734 if(strcmp(yyvsp[-2].id,"check")!=0) {
1735 yyerror(_("parse error"));
1738 g_free(yyvsp[-2].id);
1739 push_funcarg(yyvsp[-4].id,NULL);
1745 if(strcmp(yyvsp[-2].id,"check")!=0) {
1746 yyerror(_("parse error"));
1749 g_free(yyvsp[-2].id);
1750 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
1764 if(strcmp(yyvsp[0].id,"type")==0) {
1765 Node *node = new_check(TYPE_CHECK,NULL);
1766 checks = g_list_append(checks,node);
1767 } else if(strcmp(yyvsp[0].id,"null")==0) {
1768 Node *node = new_check(NULL_CHECK,NULL);
1769 checks = g_list_append(checks,node);
1771 yyerror(_("parse error"));
1774 g_free(yyvsp[0].id);
1780 Node *node = new_check(GT_CHECK,yyvsp[0].id);
1781 checks = g_list_append(checks,node);
1787 Node *node = new_check(LT_CHECK,yyvsp[0].id);
1788 checks = g_list_append(checks,node);
1794 Node *node = new_check(GE_CHECK,yyvsp[0].id);
1795 checks = g_list_append(checks,node);
1801 Node *node = new_check(LE_CHECK,yyvsp[0].id);
1802 checks = g_list_append(checks,node);
1808 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
1809 checks = g_list_append(checks,node);
1815 Node *node = new_check(NE_CHECK,yyvsp[0].id);
1816 checks = g_list_append(checks,node);
1821 { yyval.id = yyvsp[0].id; ;
1826 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
1827 g_free(yyvsp[0].id);
1832 { yyval.id = yyvsp[0].id; ;
1835 /* the action file gets copied in in place of this dollarsign */
1836 #line 543 "/usr/lib/bison.simple"
1847 short *ssp1 = yyss - 1;
1848 fprintf (stderr, "state stack now");
1849 while (ssp1 != yyssp)
1850 fprintf (stderr, " %d", *++ssp1);
1851 fprintf (stderr, "\n");
1861 yylsp->first_line = yylloc.first_line;
1862 yylsp->first_column = yylloc.first_column;
1863 yylsp->last_line = (yylsp-1)->last_line;
1864 yylsp->last_column = (yylsp-1)->last_column;
1869 yylsp->last_line = (yylsp+yylen-1)->last_line;
1870 yylsp->last_column = (yylsp+yylen-1)->last_column;
1874 /* Now "shift" the result of the reduction.
1875 Determine what state that goes to,
1876 based on the state we popped back to
1877 and the rule number reduced by. */
1881 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1882 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1883 yystate = yytable[yystate];
1885 yystate = yydefgoto[yyn - YYNTBASE];
1889 yyerrlab: /* here on detecting error */
1892 /* If not already recovering from an error, report this error. */
1896 #ifdef YYERROR_VERBOSE
1897 yyn = yypact[yystate];
1899 if (yyn > YYFLAG && yyn < YYLAST)
1906 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1907 for (x = (yyn < 0 ? -yyn : 0);
1908 x < (sizeof(yytname) / sizeof(char *)); x++)
1909 if (yycheck[x + yyn] == x)
1910 size += strlen(yytname[x]) + 15, count++;
1911 msg = (char *) malloc(size + 15);
1914 strcpy(msg, "parse error");
1919 for (x = (yyn < 0 ? -yyn : 0);
1920 x < (sizeof(yytname) / sizeof(char *)); x++)
1921 if (yycheck[x + yyn] == x)
1923 strcat(msg, count == 0 ? ", expecting `" : " or `");
1924 strcat(msg, yytname[x]);
1933 yyerror ("parse error; also virtual memory exceeded");
1936 #endif /* YYERROR_VERBOSE */
1937 yyerror("parse error");
1941 yyerrlab1: /* here on error raised explicitly by an action */
1943 if (yyerrstatus == 3)
1945 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1947 /* return failure if at end of input */
1948 if (yychar == YYEOF)
1953 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1959 /* Else will try to reuse lookahead token
1960 after shifting the error token. */
1962 yyerrstatus = 3; /* Each real token shifted decrements this */
1966 yyerrdefault: /* current state does not do anything special for the error token. */
1969 /* This is wrong; only states that explicitly want error tokens
1970 should shift them. */
1971 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1972 if (yyn) goto yydefault;
1975 yyerrpop: /* pop the current state because it cannot handle the error token */
1977 if (yyssp == yyss) YYABORT;
1987 short *ssp1 = yyss - 1;
1988 fprintf (stderr, "Error: state stack now");
1989 while (ssp1 != yyssp)
1990 fprintf (stderr, " %d", *++ssp1);
1991 fprintf (stderr, "\n");
1997 yyn = yypact[yystate];
2002 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2021 fprintf(stderr, "Shifting error token, ");
2033 /* YYACCEPT comes here. */
2045 /* YYABORT comes here. */