2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
51 #include "treefuncs.h"
59 static GList *class_nodes = NULL;
62 static char *chunk_size = NULL;
63 static char *bonobo_x_class = NULL;
64 static GList *typestack = NULL;
65 static GList *funcargs = NULL;
66 static GList *checks = NULL;
67 static int has_self = FALSE;
68 static int vararg = FALSE;
69 static Method *last_added_method = NULL;
71 /* destructor and initializer for variables */
72 static char *destructor = NULL;
73 static int destructor_line = 0;
74 static gboolean destructor_simple = TRUE;
75 static char *initializer = NULL;
76 static int initializer_line = 0;
78 static char *onerror = NULL;
79 static char *defreturn = NULL;
81 static GList *gtktypes = NULL;
83 /* this can be a global as we will only do one function at a time
85 static int the_scope = NO_SCOPE;
90 extern int ccode_line;
101 if(strcmp(yytext,"\n")==0) {
102 out=g_strconcat("Error: ",str," before newline",NULL);
103 } else if(yytext[0]=='\0') {
104 out=g_strconcat("Error: ", str, " at end of input", NULL);
106 char *tmp = g_strdup(yytext);
107 while((p=strchr(tmp, '\n')))
110 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
114 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
123 Type *type = typestack->data;
124 typestack = g_list_remove(typestack,typestack->data);
129 push_variable(char *name, int scope, int line_no, char *postfix)
132 Type *type = pop_type();
134 type->postfix = postfix;
136 var = new_variable(scope, type, name, line_no,
137 destructor, destructor_line,
139 initializer, initializer_line);
140 class_nodes = g_list_append(class_nodes, var);
144 push_function(int scope, int method, char *oid, char *id,
145 GString *cbuf, int line_no, int ccode_line,
146 gboolean vararg, GList *flags)
152 g_assert(scope != CLASS_SCOPE);
154 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
155 type = (Type *)new_type(g_strdup("void"), NULL, NULL);
160 /* a complicated and ugly test to figure out if we have
161 the wrong number of types for a signal */
162 if((method == SIGNAL_FIRST_METHOD ||
163 method == SIGNAL_LAST_METHOD) &&
164 g_list_length(gtktypes) != g_list_length(funcargs) &&
165 !(g_list_length(funcargs) == 1 &&
166 g_list_length(gtktypes) == 2 &&
167 strcmp(gtktypes->next->data, "NONE")==0)) {
168 error_print(GOB_WARN, line_no,
169 _("The number of GTK arguments and "
170 "function arguments for a signal "
171 "don't seem to match"));
173 if(g_list_length(gtktypes) > 2) {
175 for(li = gtktypes->next; li; li = li->next) {
176 if(strcmp(li->data, "NONE")==0) {
177 error_print(GOB_ERROR, line_no,
178 _("NONE can only appear in an "
179 "argument list by itself"));
185 c_cbuf = p = cbuf->str;
186 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
193 node = new_method(scope, method, type, oid, gtktypes, flags,
194 id, funcargs, onerror, defreturn, c_cbuf, line_no,
195 ccode_line, vararg, method_unique_id++,
198 last_added_method = (Method *)node;
202 /*only free segment if we haven't passed it
211 class_nodes = g_list_append(class_nodes, node);
215 free_all_global_state(void)
225 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
226 g_list_free(gtktypes);
229 free_node_list(funcargs);
234 push_funcarg(char *name, char *postfix)
237 Type *type = pop_type();
239 type->postfix = postfix;
241 node = new_funcarg(type, name, checks);
244 funcargs = g_list_append(funcargs, node);
248 push_init_arg(char *name, int is_class)
255 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
257 tn = g_strdup(((Class *)class)->otype);
259 type = new_type(tn, g_strdup("*"), NULL);
260 node = new_funcarg((Type *)type,name,NULL);
261 funcargs = g_list_prepend(funcargs, node);
265 push_self(char *id, gboolean constant)
270 type = new_type(g_strdup(((Class *)class)->otype),
271 g_strdup(constant ? "const *" : "*"), NULL);
272 ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
273 ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
274 node = new_funcarg((Type *)type,id,ch);
275 funcargs = g_list_prepend(funcargs, node);
279 find_var_or_die(const char *id, int line)
283 for(li = class_nodes; li != NULL; li = li->next) {
285 Node *node = li->data;
286 if(node->type != VARIABLE_NODE)
289 if(strcmp(var->id, id)==0)
293 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
295 g_assert_not_reached();
300 set_return_value(char *type, char *val)
302 if(strcmp(type, "onerror")==0) {
308 } else if(strcmp(type, "defreturn")==0) {
319 export_accessors (const char *var_name,
320 const char *get_cbuf,
322 const char *set_cbuf,
329 char *cast = g_strdup (get_cast (gtktype, FALSE));
330 char *p = strchr (cast, ' ');
335 /* leak, but we don't really care any more */
336 type = (Type *)new_type (cast,
341 if (get_cbuf != NULL) {
342 char *get_id = g_strdup_printf ("get_%s", var_name);
343 GString *get_cbuf_copy = g_string_new (get_cbuf);
345 Node *node1 = new_type (g_strdup (type->name),
346 g_strdup (type->pointer),
347 g_strdup (type->postfix));
348 Node *node3 = new_type (g_strdup (class->class.otype),
352 tmp = g_strdup_printf ("\t%s%s ARG;\n",
354 type->pointer ? type->pointer : "");
355 get_cbuf_copy = g_string_prepend (get_cbuf_copy, tmp);
358 tmp = g_strdup_printf ("\n\t\treturn ARG;\n");
359 get_cbuf_copy = g_string_append (get_cbuf_copy, tmp);
362 typestack = g_list_prepend (typestack, node1);
363 typestack = g_list_prepend (typestack, node3);
365 push_funcarg ("self", FALSE);
367 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
368 get_id, get_cbuf_copy, get_lineno,
369 lineno, FALSE, NULL);
372 if (set_cbuf != NULL) {
373 char *set_id = g_strdup_printf ("set_%s", var_name);
374 GString *set_cbuf_copy = g_string_new (set_cbuf);
375 Node *node1 = new_type (g_strdup (type->name),
376 g_strdup (type->pointer),
377 g_strdup (type->postfix));
378 Node *node2 = new_type (g_strdup ("void"),
381 Node *node3 = new_type (g_strdup (class->class.otype),
385 typestack = g_list_prepend (typestack, node2);
386 typestack = g_list_prepend (typestack, node1);
387 typestack = g_list_prepend (typestack, node3);
389 push_funcarg ("self", FALSE);
390 push_funcarg ("ARG", FALSE);
392 typestack = g_list_prepend (typestack, node2);
393 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
394 set_id, set_cbuf_copy, set_lineno,
395 lineno, FALSE, NULL);
423 #define YYFLAG -32768
426 #define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 89)
428 static const char yytranslate[] = { 0,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 48, 2, 2, 2, 2, 2, 2, 39,
433 40, 44, 2, 45, 49, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 41, 47,
435 42, 46, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 37, 43, 38, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
455 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
456 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
457 27, 28, 29, 30, 31, 32, 33, 34, 35, 36
461 static const short yyprhs[] = { 0,
462 0, 4, 7, 10, 12, 14, 16, 18, 20, 22,
463 24, 27, 29, 34, 38, 44, 45, 51, 57, 60,
464 62, 64, 67, 69, 71, 73, 75, 77, 79, 81,
465 84, 88, 91, 95, 98, 101, 103, 105, 106, 112,
466 119, 132, 142, 149, 153, 154, 160, 162, 166, 167,
467 171, 173, 176, 178, 180, 182, 185, 188, 191, 195,
468 199, 202, 205, 208, 210, 213, 215, 218, 220, 222,
469 224, 226, 228, 230, 232, 234, 236, 238, 240, 242,
470 244, 247, 250, 254, 257, 259, 263, 267, 270, 272,
471 277, 281, 283, 286, 288, 299, 311, 321, 331, 340,
472 352, 361, 367, 370, 375, 376, 378, 381, 383, 385,
473 388, 391, 395, 400, 405, 407, 411, 413, 417, 419,
474 422, 426, 433, 441, 444, 446, 448, 451, 454, 458,
475 462, 466, 470, 472, 475
478 static const short yyrhs[] = { 52,
479 53, 52, 0, 53, 52, 0, 52, 53, 0, 53,
480 0, 23, 0, 26, 0, 24, 0, 25, 0, 27,
481 0, 28, 0, 52, 51, 0, 51, 0, 54, 37,
482 56, 38, 0, 54, 37, 38, 0, 3, 21, 4,
483 21, 55, 0, 0, 39, 19, 19, 40, 55, 0,
484 39, 19, 20, 40, 55, 0, 56, 57, 0, 57,
485 0, 79, 0, 19, 79, 0, 62, 0, 63, 0,
486 41, 0, 29, 0, 30, 0, 31, 0, 32, 0,
487 19, 19, 0, 19, 37, 23, 0, 42, 88, 0,
488 42, 37, 23, 0, 59, 60, 0, 60, 59, 0,
489 60, 0, 59, 0, 0, 58, 68, 19, 61, 41,
490 0, 58, 68, 19, 22, 61, 41, 0, 33, 66,
491 65, 19, 64, 19, 37, 23, 19, 37, 23, 41,
492 0, 33, 66, 65, 19, 64, 19, 37, 23, 41,
493 0, 33, 66, 65, 19, 64, 19, 0, 39, 19,
494 40, 0, 0, 19, 39, 19, 68, 40, 0, 19,
495 0, 39, 67, 40, 0, 0, 19, 43, 67, 0,
496 19, 0, 69, 73, 0, 69, 0, 70, 0, 19,
497 0, 5, 19, 0, 19, 5, 0, 72, 19, 0,
498 5, 72, 19, 0, 72, 19, 5, 0, 71, 70,
499 0, 21, 70, 0, 5, 70, 0, 21, 0, 21,
500 5, 0, 71, 0, 71, 5, 0, 6, 0, 18,
501 0, 14, 0, 15, 0, 13, 0, 16, 0, 17,
502 0, 11, 0, 12, 0, 7, 0, 8, 0, 9,
503 0, 44, 0, 44, 5, 0, 44, 73, 0, 44,
504 5, 73, 0, 19, 76, 0, 76, 0, 58, 19,
505 76, 0, 19, 58, 76, 0, 58, 76, 0, 74,
506 0, 19, 39, 77, 40, 0, 77, 45, 19, 0,
507 19, 0, 37, 23, 0, 41, 0, 35, 66, 75,
508 68, 19, 39, 82, 40, 80, 78, 0, 58, 35,
509 66, 74, 68, 19, 39, 82, 40, 80, 78, 0,
510 34, 58, 68, 19, 39, 82, 40, 80, 78, 0,
511 58, 34, 68, 19, 39, 82, 40, 80, 78, 0,
512 34, 68, 19, 39, 82, 40, 80, 78, 0, 36,
513 39, 21, 40, 68, 19, 39, 82, 40, 80, 78,
514 0, 58, 68, 19, 39, 82, 40, 80, 78, 0,
515 19, 39, 19, 40, 78, 0, 19, 81, 0, 19,
516 81, 19, 81, 0, 0, 88, 0, 37, 23, 0,
517 6, 0, 19, 0, 19, 5, 0, 5, 19, 0,
518 19, 45, 83, 0, 19, 5, 45, 83, 0, 5,
519 19, 45, 83, 0, 83, 0, 84, 45, 10, 0,
520 84, 0, 84, 45, 85, 0, 85, 0, 68, 19,
521 0, 68, 19, 22, 0, 68, 19, 39, 19, 86,
522 40, 0, 68, 19, 22, 39, 19, 86, 40, 0,
523 86, 87, 0, 87, 0, 19, 0, 46, 88, 0,
524 47, 88, 0, 46, 42, 88, 0, 47, 42, 88,
525 0, 42, 42, 88, 0, 48, 42, 88, 0, 20,
532 static const short yyrline[] = { 0,
533 397, 398, 399, 400, 403, 409, 415, 421, 427, 433,
534 441, 442, 445, 450, 457, 463, 464, 476, 490, 491,
535 494, 495, 503, 504, 505, 508, 509, 510, 511, 514,
536 527, 543, 547, 555, 556, 557, 558, 559, 565, 568,
537 573, 637, 689, 775, 783, 785, 794, 800, 801, 804,
538 807, 813, 817, 824, 827, 830, 834, 838, 842, 847,
539 855, 859, 864, 868, 871, 875, 878, 883, 884, 885,
540 886, 887, 888, 889, 890, 891, 894, 895, 896, 899,
541 900, 901, 905, 912, 924, 930, 942, 954, 957, 963,
542 968, 971, 976, 977, 981, 997, 1013, 1029, 1045, 1056,
543 1062, 1072, 1095, 1106, 1125, 1131, 1132, 1138, 1139, 1150,
544 1161, 1172, 1182, 1192, 1202, 1205, 1206, 1209, 1210, 1213,
545 1216, 1219, 1227, 1237, 1238, 1241, 1254, 1258, 1262, 1266,
546 1270, 1274, 1280, 1281, 1285
551 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
553 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
554 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
555 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","TOKEN","NUMBER","TYPETOKEN","ARRAY_DIM",
556 "CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","PUBLIC","PRIVATE","PROTECTED",
557 "CLASSWIDE","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","'('","')'",
558 "';'","'='","'|'","'*'","','","'>'","'<'","'!'","'-'","prog","ccode","ccodes",
559 "class","classdec","classflags","classcode","thing","scope","destructor","initializer",
560 "varoptions","variable","argument","export","argtype","flags","flaglist","type",
561 "specifier_list","spec_list","specifier","strunionenum","pointer","simplesigtype",
562 "fullsigtype","sigtype","tokenlist","codenocode","method","returnvals","retcode",
563 "funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL
567 static const short yyr1[] = { 0,
568 50, 50, 50, 50, 51, 51, 51, 51, 51, 51,
569 52, 52, 53, 53, 54, 55, 55, 55, 56, 56,
570 57, 57, 57, 57, 57, 58, 58, 58, 58, 59,
571 59, 60, 60, 61, 61, 61, 61, 61, 62, 62,
572 63, 63, 63, 64, 64, 65, 65, 66, 66, 67,
573 67, 68, 68, 69, 69, 69, 69, 69, 69, 69,
574 70, 70, 70, 70, 70, 70, 70, 71, 71, 71,
575 71, 71, 71, 71, 71, 71, 72, 72, 72, 73,
576 73, 73, 73, 74, 74, 75, 75, 75, 75, 76,
577 77, 77, 78, 78, 79, 79, 79, 79, 79, 79,
578 79, 79, 80, 80, 80, 81, 81, 82, 82, 82,
579 82, 82, 82, 82, 82, 83, 83, 84, 84, 85,
580 85, 85, 85, 86, 86, 87, 87, 87, 87, 87,
584 static const short yyr2[] = { 0,
585 3, 2, 2, 1, 1, 1, 1, 1, 1, 1,
586 2, 1, 4, 3, 5, 0, 5, 5, 2, 1,
587 1, 2, 1, 1, 1, 1, 1, 1, 1, 2,
588 3, 2, 3, 2, 2, 1, 1, 0, 5, 6,
589 12, 9, 6, 3, 0, 5, 1, 3, 0, 3,
590 1, 2, 1, 1, 1, 2, 2, 2, 3, 3,
591 2, 2, 2, 1, 2, 1, 2, 1, 1, 1,
592 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
593 2, 2, 3, 2, 1, 3, 3, 2, 1, 4,
594 3, 1, 2, 1, 10, 11, 9, 9, 8, 11,
595 8, 5, 2, 4, 0, 1, 2, 1, 1, 2,
596 2, 3, 4, 4, 1, 3, 1, 3, 1, 2,
597 3, 6, 7, 2, 1, 1, 2, 2, 3, 3,
601 static const short yydefact[] = { 0,
602 0, 5, 7, 8, 6, 9, 10, 12, 0, 4,
603 0, 0, 11, 3, 2, 0, 0, 1, 0, 26,
604 27, 28, 29, 49, 0, 49, 0, 14, 25, 0,
605 20, 0, 23, 24, 21, 16, 0, 0, 0, 22,
606 0, 0, 0, 68, 77, 78, 79, 75, 76, 72,
607 70, 71, 73, 74, 69, 55, 64, 0, 0, 53,
608 54, 66, 0, 0, 0, 13, 19, 0, 49, 0,
609 0, 15, 0, 0, 51, 0, 47, 0, 0, 56,
610 63, 0, 57, 65, 62, 0, 0, 80, 52, 67,
611 61, 58, 0, 0, 89, 0, 85, 0, 0, 0,
612 38, 0, 0, 0, 0, 48, 0, 45, 59, 0,
613 0, 81, 82, 60, 0, 0, 0, 84, 0, 88,
614 0, 0, 0, 0, 0, 0, 38, 0, 0, 37,
615 36, 0, 0, 0, 0, 94, 102, 50, 0, 0,
616 0, 0, 0, 68, 55, 0, 0, 115, 117, 119,
617 83, 92, 0, 87, 86, 0, 0, 0, 0, 30,
618 0, 0, 0, 135, 133, 0, 0, 32, 34, 35,
619 39, 16, 16, 93, 0, 0, 43, 0, 56, 57,
620 0, 120, 105, 0, 90, 0, 0, 0, 0, 0,
621 31, 40, 105, 33, 134, 17, 18, 46, 44, 0,
622 105, 0, 0, 112, 121, 0, 0, 0, 116, 118,
623 91, 0, 0, 105, 0, 0, 0, 0, 114, 113,
624 0, 0, 0, 103, 106, 99, 105, 0, 0, 0,
625 101, 0, 42, 97, 0, 126, 0, 0, 0, 0,
626 0, 125, 107, 0, 0, 105, 98, 105, 0, 0,
627 0, 0, 127, 0, 128, 0, 122, 124, 104, 95,
628 0, 0, 0, 123, 131, 129, 130, 132, 100, 96,
632 static const short yydefgoto[] = { 272,
633 8, 9, 10, 11, 72, 30, 31, 32, 130, 131,
634 132, 33, 34, 141, 78, 42, 76, 146, 60, 61,
635 62, 63, 89, 95, 96, 97, 153, 137, 35, 208,
636 224, 147, 148, 149, 150, 241, 242, 225
639 static const short yypact[] = { 175,
640 34,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 175, 236,
641 47, 104,-32768, 236, 236, 176, 96, 236, 212,-32768,
642 -32768,-32768,-32768, 107, 158, 107, 109,-32768,-32768, 194,
643 -32768, 123,-32768,-32768,-32768, 110, 111, 124, 123,-32768,
644 135, 136, 278,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
645 -32768,-32768,-32768,-32768,-32768, 154, 346, 295, 149, 138,
646 -32768, 360, 161, 162, 163,-32768,-32768, 295, 107, 164,
647 166,-32768, 146, 177, 172, 157, 165, 197, 374,-32768,
648 -32768, 199,-32768, 374,-32768, 200, 181, 2,-32768, 374,
649 -32768, 216, 226, 203,-32768, 295,-32768, 193, 215, 217,
650 57, 74, 37, 198, 135,-32768, 219, 201,-32768, 210,
651 312, 138,-32768,-32768, 211, 220, 233,-32768, -2,-32768,
652 234, 295, 242, -2, 295, -8, -6, 312, 38, 246,
653 235, 257, 265, 275, 299,-32768,-32768,-32768, 295, 313,
654 320, 312, 329, 309, 5, 334, 314,-32768, 310,-32768,
655 -32768,-32768, -20,-32768,-32768, 317, 349, 312, 350,-32768,
656 347, 341, 343,-32768,-32768, 361, 373,-32768,-32768,-32768,
657 -32768, 110, 110,-32768, 354, 356, 362, 357, -18, 81,
658 295, 61, 379, 261,-32768, 381, 312, 363, 364, 366,
659 -32768,-32768, 379,-32768,-32768,-32768,-32768,-32768,-32768, 378,
660 379, 295, 295,-32768, 367, 384, 40, 37,-32768,-32768,
661 -32768, 368, 312, 379, 312, 37, 29, 37,-32768,-32768,
662 388, 114, 386, 391,-32768,-32768, 379, 371, 37, 372,
663 -32768, 376,-32768,-32768, 114,-32768, 375, 46, 62, 377,
664 72,-32768,-32768, 40, 37, 379,-32768, 379, 392, 105,
665 48, 48,-32768, 48,-32768, 48,-32768,-32768,-32768,-32768,
666 37, 37, 380,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
667 -32768, 414, 416,-32768
670 static const short yypgoto[] = {-32768,
671 98, 14, 409,-32768, -67,-32768, 390, -13, 291, 293,
672 297,-32768,-32768,-32768,-32768, -22, 321, -24,-32768, -41,
673 -32768, -40, -79, 325,-32768, -63,-32768, -176, 408, -175,
674 184, -123, -140,-32768, 245, 195, -227, -129
681 static const short yytable[] = { 168,
682 59, 81, 82, 64, 163, 39, 112, 70, 113, 180,
683 160, 58, 126, 258, 74, 85, 115, 216, 178, 185,
684 91, -111, 258, 15, 186, 218, 202, 18, 161, 118,
685 120, 226, 151, 86, 189, 129, 116, 81, 229, 231,
686 204, 234, 81, 99, -109, 88, 100, 232, 81, 181,
687 94, 245, 247, 154, 12, 155, 164, 165, 164, 165,
688 118, 219, 220, 212, 164, 165, 164, 165, 260, 233,
689 261, 121, 262, 135, 166, 126, 223, 136, 127, 117,
690 164, 165, 205, 16, 269, 270, 167, 252, 167, 228,
691 236, 230, 133, 134, 167, 128, 167, 157, 129, 206,
692 159, 81, 82, 254, 196, 197, 13, 17, 253, 255,
693 167, 257, 13, 237, 175, 13, 36, 238, 239, 240,
694 -110, 265, 266, 236, 267, 203, 268, 43, 44, 45,
695 46, 47, 236, 48, 49, 50, 51, 52, 53, 54,
696 55, 56, 73, 57, 264, 41, 237, 65, 71, 38,
697 238, 239, 240, 75, 77, 237, 68, 69, 83, 238,
698 239, 240, 43, 44, 45, 46, 47, 87, 48, 49,
699 50, 51, 52, 53, 54, 55, 56, 1, 57, 92,
700 93, 88, 101, 98, 102, 103, 20, 21, 22, 23,
701 20, 21, 22, 23, 19, 104, 106, 2, 3, 4,
702 5, 6, 7, 107, 20, 21, 22, 23, 24, 25,
703 26, 27, 19, 28, 105, 108, 29, 109, 110, 111,
704 114, 119, 20, 21, 22, 23, 24, 25, 26, 27,
705 37, 66, 122, 123, 29, 124, 128, 139, 152, 140,
706 20, 21, 22, 23, 115, 25, 26, 27, 142, 116,
707 38, 115, 156, 126, 20, 21, 22, 23, 2, 3,
708 4, 5, 6, 7, 116, 43, 44, 45, 46, 47,
709 209, 48, 49, 50, 51, 52, 53, 54, 55, 56,
710 158, 57, 79, 44, 45, 46, 47, 129, 48, 49,
711 50, 51, 52, 53, 54, 55, 80, 171, 57, 43,
712 44, 45, 46, 47, 172, 48, 49, 50, 51, 52,
713 53, 54, 55, 56, 173, 57, 143, 144, 45, 46,
714 47, 174, 48, 49, 50, 51, 52, 53, 54, 55,
715 145, 176, 57, 79, 44, 45, 46, 47, 177, 48,
716 49, 50, 51, 52, 53, 54, 55, 179, -108, 57,
717 84, 44, 182, 183, 184, 187, 48, 49, 50, 51,
718 52, 53, 54, 55, 90, 44, 57, 188, 190, 191,
719 48, 49, 50, 51, 52, 53, 54, 55, 79, 44,
720 57, 192, 193, 194, 48, 49, 50, 51, 52, 53,
721 54, 55, 195, 198, 57, 199, 201, 207, 200, 211,
722 217, 213, 222, 214, 215, 221, 235, 227, 243, 244,
723 246, 248, 249, 273, 263, 274, 251, 14, 256, 67,
724 271, 170, 169, 162, 125, 138, 40, 259, 210, 250
727 static const short yycheck[] = { 129,
728 25, 43, 43, 26, 128, 19, 5, 32, 88, 5,
729 19, 25, 19, 241, 39, 57, 19, 193, 142, 40,
730 62, 40, 250, 10, 45, 201, 45, 14, 37, 93,
731 94, 208, 112, 58, 158, 42, 39, 79, 214, 216,
732 181, 218, 84, 68, 40, 44, 69, 19, 90, 45,
733 64, 227, 229, 117, 21, 119, 19, 20, 19, 20,
734 124, 202, 203, 187, 19, 20, 19, 20, 245, 41,
735 246, 96, 248, 37, 37, 19, 37, 41, 22, 93,
736 19, 20, 22, 37, 261, 262, 49, 42, 49, 213,
737 19, 215, 19, 20, 49, 39, 49, 122, 42, 39,
738 125, 143, 143, 42, 172, 173, 9, 4, 238, 239,
739 49, 40, 15, 42, 139, 18, 21, 46, 47, 48,
740 40, 251, 252, 19, 254, 45, 256, 5, 6, 7,
741 8, 9, 19, 11, 12, 13, 14, 15, 16, 17,
742 18, 19, 19, 21, 40, 39, 42, 39, 39, 39,
743 46, 47, 48, 19, 19, 42, 34, 35, 5, 46,
744 47, 48, 5, 6, 7, 8, 9, 19, 11, 12,
745 13, 14, 15, 16, 17, 18, 19, 3, 21, 19,
746 19, 44, 19, 21, 19, 40, 29, 30, 31, 32,
747 29, 30, 31, 32, 19, 19, 40, 23, 24, 25,
748 26, 27, 28, 39, 29, 30, 31, 32, 33, 34,
749 35, 36, 19, 38, 43, 19, 41, 19, 19, 39,
750 5, 19, 29, 30, 31, 32, 33, 34, 35, 36,
751 19, 38, 40, 19, 41, 19, 39, 19, 19, 39,
752 29, 30, 31, 32, 19, 34, 35, 36, 39, 39,
753 39, 19, 19, 19, 29, 30, 31, 32, 23, 24,
754 25, 26, 27, 28, 39, 5, 6, 7, 8, 9,
755 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
756 39, 21, 5, 6, 7, 8, 9, 42, 11, 12,
757 13, 14, 15, 16, 17, 18, 19, 41, 21, 5,
758 6, 7, 8, 9, 40, 11, 12, 13, 14, 15,
759 16, 17, 18, 19, 40, 21, 5, 6, 7, 8,
760 9, 23, 11, 12, 13, 14, 15, 16, 17, 18,
761 19, 19, 21, 5, 6, 7, 8, 9, 19, 11,
762 12, 13, 14, 15, 16, 17, 18, 19, 40, 21,
763 5, 6, 19, 40, 45, 39, 11, 12, 13, 14,
764 15, 16, 17, 18, 5, 6, 21, 19, 19, 23,
765 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
766 21, 41, 40, 23, 11, 12, 13, 14, 15, 16,
767 17, 18, 20, 40, 21, 40, 40, 19, 37, 19,
768 23, 39, 19, 40, 39, 39, 19, 40, 23, 19,
769 40, 40, 37, 0, 23, 0, 42, 9, 42, 30,
770 41, 131, 130, 127, 100, 105, 19, 244, 184, 235
772 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
773 #line 3 "/usr/lib/bison.simple"
774 /* This file comes from bison-1.28. */
776 /* Skeleton output parser for bison,
777 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
779 This program is free software; you can redistribute it and/or modify
780 it under the terms of the GNU General Public License as published by
781 the Free Software Foundation; either version 2, or (at your option)
784 This program is distributed in the hope that it will be useful,
785 but WITHOUT ANY WARRANTY; without even the implied warranty of
786 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
787 GNU General Public License for more details.
789 You should have received a copy of the GNU General Public License
790 along with this program; if not, write to the Free Software
791 Foundation, Inc., 59 Temple Place - Suite 330,
792 Boston, MA 02111-1307, USA. */
794 /* As a special exception, when this file is copied by Bison into a
795 Bison output file, you may use that output file without restriction.
796 This special exception was added by the Free Software Foundation
797 in version 1.24 of Bison. */
799 /* This is the parser code that is written into each bison parser
800 when the %semantic_parser declaration is not specified in the grammar.
801 It was written by Richard Stallman by simplifying the hairy parser
802 used when %semantic_parser is specified. */
804 #ifndef YYSTACK_USE_ALLOCA
806 #define YYSTACK_USE_ALLOCA
807 #else /* alloca not defined */
809 #define YYSTACK_USE_ALLOCA
810 #define alloca __builtin_alloca
811 #else /* not GNU C. */
812 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
813 #define YYSTACK_USE_ALLOCA
815 #else /* not sparc */
816 /* We think this test detects Watcom and Microsoft C. */
817 /* This used to test MSDOS, but that is a bad idea
818 since that symbol is in the user namespace. */
819 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
820 #if 0 /* No need for malloc.h, which pollutes the namespace;
821 instead, just don't use alloca. */
824 #else /* not MSDOS, or __TURBOC__ */
826 /* I don't know what this was needed for, but it pollutes the namespace.
827 So I turned it off. rms, 2 May 1997. */
828 /* #include <malloc.h> */
830 #define YYSTACK_USE_ALLOCA
831 #else /* not MSDOS, or __TURBOC__, or _AIX */
833 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
834 and on HPUX 10. Eventually we can turn this on. */
835 #define YYSTACK_USE_ALLOCA
836 #define alloca __builtin_alloca
839 #endif /* not _AIX */
840 #endif /* not MSDOS, or __TURBOC__ */
841 #endif /* not sparc */
842 #endif /* not GNU C */
843 #endif /* alloca not defined */
844 #endif /* YYSTACK_USE_ALLOCA not defined */
846 #ifdef YYSTACK_USE_ALLOCA
847 #define YYSTACK_ALLOC alloca
849 #define YYSTACK_ALLOC malloc
852 /* Note: there must be only one dollar sign in this file.
853 It is replaced by the list of actions, each action
854 as one case of the switch. */
856 #define yyerrok (yyerrstatus = 0)
857 #define yyclearin (yychar = YYEMPTY)
860 #define YYACCEPT goto yyacceptlab
861 #define YYABORT goto yyabortlab
862 #define YYERROR goto yyerrlab1
863 /* Like YYERROR except do call yyerror.
864 This remains here temporarily to ease the
865 transition to the new meaning of YYERROR, for GCC.
866 Once GCC version 2 has supplanted version 1, this can go. */
867 #define YYFAIL goto yyerrlab
868 #define YYRECOVERING() (!!yyerrstatus)
869 #define YYBACKUP(token, value) \
871 if (yychar == YYEMPTY && yylen == 1) \
872 { yychar = (token), yylval = (value); \
873 yychar1 = YYTRANSLATE (yychar); \
878 { yyerror ("syntax error: cannot back up"); YYERROR; } \
882 #define YYERRCODE 256
885 #define YYLEX yylex()
891 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
893 #define YYLEX yylex(&yylval, &yylloc)
895 #else /* not YYLSP_NEEDED */
897 #define YYLEX yylex(&yylval, YYLEX_PARAM)
899 #define YYLEX yylex(&yylval)
901 #endif /* not YYLSP_NEEDED */
904 /* If nonreentrant, generate the variables here */
908 int yychar; /* the lookahead symbol */
909 YYSTYPE yylval; /* the semantic value of the */
910 /* lookahead symbol */
913 YYLTYPE yylloc; /* location data for the lookahead */
917 int yynerrs; /* number of parse errors so far */
918 #endif /* not YYPURE */
921 int yydebug; /* nonzero means print parse trace */
922 /* Since this is uninitialized, it does not stop multiple parsers
926 /* YYINITDEPTH indicates the initial size of the parser's stacks */
929 #define YYINITDEPTH 200
932 /* YYMAXDEPTH is the maximum size the stacks can grow to
933 (effective only if the built-in stack extension method is used). */
940 #define YYMAXDEPTH 10000
943 /* Define __yy_memcpy. Note that the size argument
944 should be passed with type unsigned int, because that is what the non-GCC
945 definitions require. With GCC, __builtin_memcpy takes an arg
946 of type size_t, but it can handle unsigned int. */
948 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
949 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
950 #else /* not GNU C or C++ */
953 /* This is the most reliable way to avoid incompatibilities
954 in available built-in functions on various systems. */
956 __yy_memcpy (to, from, count)
961 register char *f = from;
962 register char *t = to;
963 register int i = count;
969 #else /* __cplusplus */
971 /* This is the most reliable way to avoid incompatibilities
972 in available built-in functions on various systems. */
974 __yy_memcpy (char *to, char *from, unsigned int count)
976 register char *t = to;
977 register char *f = from;
978 register int i = count;
987 #line 217 "/usr/lib/bison.simple"
989 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
990 into yyparse. The argument should have type void *.
991 It should actually point to an object.
992 Grammar actions can access the variable by casting it
993 to the proper pointer type. */
997 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
998 #define YYPARSE_PARAM_DECL
999 #else /* not __cplusplus */
1000 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1001 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1002 #endif /* not __cplusplus */
1003 #else /* not YYPARSE_PARAM */
1004 #define YYPARSE_PARAM_ARG
1005 #define YYPARSE_PARAM_DECL
1006 #endif /* not YYPARSE_PARAM */
1008 /* Prevent warning if -Wstrict-prototypes. */
1010 #ifdef YYPARSE_PARAM
1011 int yyparse (void *);
1018 yyparse(YYPARSE_PARAM_ARG)
1021 register int yystate;
1023 register short *yyssp;
1024 register YYSTYPE *yyvsp;
1025 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1026 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1028 short yyssa[YYINITDEPTH]; /* the state stack */
1029 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1031 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1032 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1035 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1036 YYLTYPE *yyls = yylsa;
1039 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1041 #define YYPOPSTACK (yyvsp--, yyssp--)
1044 int yystacksize = YYINITDEPTH;
1045 int yyfree_stacks = 0;
1056 YYSTYPE yyval; /* the variable used to return */
1057 /* semantic values from the action */
1064 fprintf(stderr, "Starting parse\n");
1070 yychar = YYEMPTY; /* Cause a token to be read. */
1072 /* Initialize stack pointers.
1073 Waste one element of value and location stack
1074 so that they stay on the same level as the state stack.
1075 The wasted elements are never initialized. */
1083 /* Push a new state, which is found in yystate . */
1084 /* In all cases, when you get here, the value and location stacks
1085 have just been pushed. so pushing a state here evens the stacks. */
1090 if (yyssp >= yyss + yystacksize - 1)
1092 /* Give user a chance to reallocate the stack */
1093 /* Use copies of these so that the &'s don't force the real ones into memory. */
1094 YYSTYPE *yyvs1 = yyvs;
1095 short *yyss1 = yyss;
1097 YYLTYPE *yyls1 = yyls;
1100 /* Get the current used size of the three stacks, in elements. */
1101 int size = yyssp - yyss + 1;
1104 /* Each stack pointer address is followed by the size of
1105 the data in use in that stack, in bytes. */
1107 /* This used to be a conditional around just the two extra args,
1108 but that might be undefined if yyoverflow is a macro. */
1109 yyoverflow("parser stack overflow",
1110 &yyss1, size * sizeof (*yyssp),
1111 &yyvs1, size * sizeof (*yyvsp),
1112 &yyls1, size * sizeof (*yylsp),
1115 yyoverflow("parser stack overflow",
1116 &yyss1, size * sizeof (*yyssp),
1117 &yyvs1, size * sizeof (*yyvsp),
1121 yyss = yyss1; yyvs = yyvs1;
1125 #else /* no yyoverflow */
1126 /* Extend the stack our own way. */
1127 if (yystacksize >= YYMAXDEPTH)
1129 yyerror("parser stack overflow");
1141 if (yystacksize > YYMAXDEPTH)
1142 yystacksize = YYMAXDEPTH;
1143 #ifndef YYSTACK_USE_ALLOCA
1146 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1147 __yy_memcpy ((char *)yyss, (char *)yyss1,
1148 size * (unsigned int) sizeof (*yyssp));
1149 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1150 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1151 size * (unsigned int) sizeof (*yyvsp));
1153 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1154 __yy_memcpy ((char *)yyls, (char *)yyls1,
1155 size * (unsigned int) sizeof (*yylsp));
1157 #endif /* no yyoverflow */
1159 yyssp = yyss + size - 1;
1160 yyvsp = yyvs + size - 1;
1162 yylsp = yyls + size - 1;
1167 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1170 if (yyssp >= yyss + yystacksize - 1)
1176 fprintf(stderr, "Entering state %d\n", yystate);
1182 /* Do appropriate processing given the current state. */
1183 /* Read a lookahead token if we need one and don't already have one. */
1186 /* First try to decide what to do without reference to lookahead token. */
1188 yyn = yypact[yystate];
1192 /* Not known => get a lookahead token if don't already have one. */
1194 /* yychar is either YYEMPTY or YYEOF
1195 or a valid token in external form. */
1197 if (yychar == YYEMPTY)
1201 fprintf(stderr, "Reading a token: ");
1206 /* Convert token to internal form (in yychar1) for indexing tables with */
1208 if (yychar <= 0) /* This means end of input. */
1211 yychar = YYEOF; /* Don't call YYLEX any more */
1215 fprintf(stderr, "Now at end of input.\n");
1220 yychar1 = YYTRANSLATE(yychar);
1225 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1226 /* Give the individual parser a way to print the precise meaning
1227 of a token, for further debugging info. */
1229 YYPRINT (stderr, yychar, yylval);
1231 fprintf (stderr, ")\n");
1237 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1242 /* yyn is what to do for this token type in this state.
1243 Negative => reduce, -yyn is rule number.
1244 Positive => shift, yyn is new state.
1245 New state is final state => don't bother to shift,
1246 just return success.
1247 0, or most negative number => error. */
1262 /* Shift the lookahead token. */
1266 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1269 /* Discard the token being shifted unless it is eof. */
1270 if (yychar != YYEOF)
1278 /* count tokens shifted since error; after three, turn off error status. */
1279 if (yyerrstatus) yyerrstatus--;
1284 /* Do the default action for the current state. */
1287 yyn = yydefact[yystate];
1291 /* Do a reduction. yyn is the number of a rule to reduce with. */
1295 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1302 fprintf (stderr, "Reducing via rule %d (line %d), ",
1305 /* Print the symbols being reduced, and their result. */
1306 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1307 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1308 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1334 Node *node = new_ccode(C_CCODE,(yyvsp[0].cbuf)->str,
1336 nodes = g_list_append(nodes,node);
1337 g_string_free(yyvsp[0].cbuf,FALSE);
1343 Node *node = new_ccode(H_CCODE,(yyvsp[0].cbuf)->str,
1345 nodes = g_list_append(nodes,node);
1346 g_string_free(yyvsp[0].cbuf,FALSE);
1352 Node *node = new_ccode(HT_CCODE,(yyvsp[0].cbuf)->str,
1354 nodes = g_list_append(nodes,node);
1355 g_string_free(yyvsp[0].cbuf,FALSE);
1361 Node *node = new_ccode(PH_CCODE,(yyvsp[0].cbuf)->str,
1363 nodes = g_list_append(nodes,node);
1364 g_string_free(yyvsp[0].cbuf,FALSE);
1370 Node *node = new_ccode(A_CCODE,(yyvsp[0].cbuf)->str,
1372 nodes = g_list_append(nodes,node);
1373 g_string_free(yyvsp[0].cbuf,FALSE);
1379 Node *node = new_ccode(AT_CCODE,(yyvsp[0].cbuf)->str,
1381 nodes = g_list_append(nodes,node);
1382 g_string_free(yyvsp[0].cbuf,FALSE);
1396 ((Class *)class)->nodes = class_nodes;
1398 nodes = g_list_append(nodes,class);
1404 ((Class *)class)->nodes = NULL;
1406 nodes = g_list_append(nodes,class);
1412 class = new_class (yyvsp[-3].id, yyvsp[-1].id,
1413 bonobo_x_class, chunk_size, NULL);
1419 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1420 g_free (chunk_size);
1421 chunk_size = g_strdup(yyvsp[-2].id);
1422 } else if(strcmp(yyvsp[-3].id,"BonoboX") == 0) {
1423 g_free (bonobo_x_class);
1424 bonobo_x_class = g_strdup(yyvsp[-2].id);
1426 yyerror(_("parse error"));
1434 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1435 g_free (chunk_size);
1436 if(atoi(yyvsp[-2].id) != 0)
1437 chunk_size = g_strdup(yyvsp[-2].id);
1441 yyerror(_("parse error"));
1461 if (strcmp (yyvsp[-1].id, "BonoboX") != 0) {
1462 g_free(yyvsp[-1].id);
1463 yyerror(_("parse error"));
1466 last_added_method->bonobo_x_func = TRUE;
1483 { the_scope = PUBLIC_SCOPE; ;
1487 { the_scope = PRIVATE_SCOPE; ;
1491 { the_scope = PROTECTED_SCOPE; ;
1495 { the_scope = CLASS_SCOPE; ;
1500 if(strcmp(yyvsp[-1].id, "destroywith")==0) {
1501 g_free(yyvsp[-1].id);
1502 destructor = yyvsp[0].id;
1503 destructor_line = line_no;
1504 destructor_simple = TRUE;
1506 g_free(yyvsp[-1].id);
1507 g_free(yyvsp[0].id);
1508 yyerror(_("parse error"));
1516 if(strcmp(yyvsp[-2].id, "destroy")==0) {
1517 g_free(yyvsp[-2].id);
1518 destructor = (yyvsp[0].cbuf)->str;
1519 g_string_free(yyvsp[0].cbuf, FALSE);
1520 destructor_line = ccode_line;
1521 destructor_simple = FALSE;
1523 g_free(yyvsp[-2].id);
1524 g_string_free(yyvsp[0].cbuf, TRUE);
1525 yyerror(_("parse error"));
1533 initializer = yyvsp[0].id;
1534 initializer_line = ccode_line;
1540 initializer = (yyvsp[0].cbuf)->str;
1541 initializer_line = ccode_line;
1542 g_string_free(yyvsp[0].cbuf, FALSE);
1555 { destructor = NULL; ;
1559 { initializer = NULL; ;
1571 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
1577 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
1583 if(strcmp(yyvsp[-6].id,"get")==0 &&
1584 strcmp(yyvsp[-3].id,"set")==0) {
1586 Type *type = pop_type();
1587 g_free (yyvsp[-6].id);
1588 g_free (yyvsp[-3].id);
1589 node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id,
1590 (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1591 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1594 class_nodes = g_list_append(class_nodes,node);
1597 export_accessors (yyvsp[-8].id,
1598 (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1599 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1603 g_free (yyvsp[-7].id);
1606 g_string_free (yyvsp[-4].cbuf, FALSE);
1607 g_string_free (yyvsp[-1].cbuf, FALSE);
1609 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1610 strcmp(yyvsp[-3].id,"get")==0) {
1612 Type *type = pop_type();
1613 g_free (yyvsp[-6].id);
1614 g_free (yyvsp[-3].id);
1615 node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id,
1616 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1617 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1621 export_accessors (yyvsp[-8].id,
1622 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1623 (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1627 g_free (yyvsp[-7].id);
1630 g_string_free (yyvsp[-1].cbuf, FALSE);
1631 g_string_free (yyvsp[-4].cbuf, FALSE);
1632 class_nodes = g_list_append(class_nodes,node);
1634 g_free (yyvsp[-9].id);
1635 g_free (yyvsp[-8].id);
1636 g_free (yyvsp[-6].id);
1637 g_free (yyvsp[-3].id);
1638 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
1639 g_list_free (yyvsp[-10].list);
1640 g_string_free (yyvsp[-1].cbuf, TRUE);
1641 g_string_free (yyvsp[-4].cbuf, TRUE);
1642 yyerror (_("parse error"));
1650 if(strcmp(yyvsp[-3].id, "get") == 0) {
1652 Type *type = pop_type();
1653 g_free (yyvsp[-3].id);
1654 node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id,
1655 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1659 export_accessors (yyvsp[-5].id,
1660 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1665 g_free (yyvsp[-4].id);
1668 g_string_free (yyvsp[-1].cbuf, FALSE);
1669 class_nodes = g_list_append(class_nodes, node);
1670 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
1672 Type *type = pop_type();
1673 g_free (yyvsp[-3].id);
1674 node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id,
1676 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1679 export_accessors (yyvsp[-5].id,
1681 (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1685 g_free (yyvsp[-4].id);
1688 g_string_free (yyvsp[-1].cbuf, FALSE);
1689 class_nodes = g_list_append (class_nodes, node);
1691 g_free (yyvsp[-3].id);
1692 g_free (yyvsp[-6].id);
1693 g_free (yyvsp[-5].id);
1694 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
1695 g_list_free (yyvsp[-7].list);
1696 g_string_free (yyvsp[-1].cbuf, TRUE);
1697 yyerror(_("parse error"));
1706 char *get, *set = NULL;
1711 if(strcmp(yyvsp[0].id, "link")!=0 &&
1712 strcmp(yyvsp[0].id, "stringlink")!=0 &&
1713 strcmp(yyvsp[0].id, "objectlink")!=0) {
1714 g_free(yyvsp[0].id);
1715 g_free(yyvsp[-3].id);
1716 g_free(yyvsp[-2].id);
1717 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
1718 g_list_free(yyvsp[-4].list);
1719 yyerror(_("parse error"));
1725 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
1726 if(var->scope == PRIVATE_SCOPE)
1727 root = "self->_priv";
1728 else if(var->scope == CLASS_SCOPE) {
1729 root = "SELF_GET_CLASS(self)";
1731 error_print(GOB_ERROR, yyvsp[-5].line,
1732 _("Self aliases needed when autolinking to a classwide member"));
1736 if(strcmp(yyvsp[0].id, "link")==0) {
1737 set = g_strdup_printf("%s->%s = ARG;",
1738 root, yyvsp[-2].id);
1739 } else if(strcmp (yyvsp[0].id, "stringlink")==0) {
1740 set = g_strdup_printf("g_free(%s->%s); "
1741 "%s->%s = g_strdup(ARG);",
1743 root, yyvsp[-2].id);
1744 } else if(strcmp (yyvsp[0].id, "objectlink")==0) {
1745 set = g_strdup_printf(
1747 "gtk_object_ref (GTK_OBJECT (ARG)); "
1748 "if (%s->%s != NULL) "
1749 "gtk_object_unref (GTK_OBJECT (%s->%s)); "
1753 root, yyvsp[-2].id);
1755 g_assert_not_reached();
1758 if (strcmp (yyvsp[0].id, "stringlink")==0) {
1759 get = g_strdup_printf("ARG = g_strdup(%s->%s);", root, yyvsp[-2].id);
1761 /* For everything else, get is just straight assignment */
1762 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
1765 g_free (yyvsp[0].id);
1769 type = copy_type(var->vtype);
1771 node = new_argument (yyvsp[-3].id, type, yyvsp[-4].list,
1773 get, yyvsp[-5].line,
1774 set, yyvsp[-5].line,
1777 export_accessors (yyvsp[-2].id,
1778 get, yyvsp[-5].line,
1779 set, yyvsp[-5].line,
1783 g_free (yyvsp[-1].id);
1786 class_nodes = g_list_append(class_nodes,node);
1792 if (strcmp (yyvsp[-1].id, "export")!=0) {
1793 g_free (yyvsp[-1].id);
1794 yyerror (_("parse error"));
1797 yyval.id = yyvsp[-1].id;
1802 { yyval.id = NULL; ;
1807 if(strcmp(yyvsp[-2].id,"type")!=0) {
1808 g_free(yyvsp[-4].id);
1809 g_free(yyvsp[-2].id);
1810 yyerror(_("parse error"));
1813 yyval.id = yyvsp[-4].id;
1819 yyval.id = yyvsp[0].id;
1820 typestack = g_list_prepend(typestack,NULL);
1825 { yyval.list = yyvsp[-1].list; ;
1829 { yyval.list = NULL; ;
1834 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1840 yyval.list = g_list_append(NULL,yyvsp[0].id);
1846 Node *node = new_type(yyvsp[-1].id, yyvsp[0].id, NULL);
1847 typestack = g_list_prepend(typestack,node);
1853 Node *node = new_type(yyvsp[0].id, NULL, NULL);
1854 typestack = g_list_prepend(typestack,node);
1860 yyval.id = yyvsp[0].id;
1866 yyval.id = yyvsp[0].id;
1872 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
1873 g_free(yyvsp[0].id);
1879 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1880 g_free(yyvsp[-1].id);
1886 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1887 g_free(yyvsp[0].id);
1893 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
1895 g_free(yyvsp[0].id);
1901 yyval.id = g_strconcat(yyvsp[-2].id, " ",
1902 yyvsp[-1].id, " const", NULL);
1903 g_free(yyvsp[-1].id);
1909 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1910 g_free(yyvsp[0].id);
1916 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1917 g_free(yyvsp[-1].id);
1918 g_free(yyvsp[0].id);
1924 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
1925 g_free(yyvsp[0].id);
1931 yyval.id = yyvsp[0].id;
1937 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1938 g_free(yyvsp[-1].id);
1944 yyval.id = g_strdup(yyvsp[0].id);
1950 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1955 { yyval.id = "void"; ;
1959 { yyval.id = "char"; ;
1963 { yyval.id = "short"; ;
1967 { yyval.id = "int"; ;
1971 { yyval.id = "long"; ;
1975 { yyval.id = "float"; ;
1979 { yyval.id = "double"; ;
1983 { yyval.id = "signed"; ;
1987 { yyval.id = "unsigned"; ;
1991 { yyval.id = "struct"; ;
1995 { yyval.id = "union"; ;
1999 { yyval.id = "enum"; ;
2003 { yyval.id = g_strdup("*"); ;
2007 { yyval.id = g_strdup("* const"); ;
2012 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2013 g_free(yyvsp[0].id);
2019 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2020 g_free(yyvsp[0].id);
2026 if(strcmp(yyvsp[-1].id, "first")==0)
2027 yyval.sigtype = SIGNAL_FIRST_METHOD;
2028 else if(strcmp(yyvsp[-1].id, "last")==0)
2029 yyval.sigtype = SIGNAL_LAST_METHOD;
2031 yyerror(_("signal must be 'first' or 'last'"));
2032 g_free(yyvsp[-1].id);
2035 g_free(yyvsp[-1].id);
2041 yyval.sigtype = SIGNAL_LAST_METHOD;
2047 if(strcmp(yyvsp[-1].id,"first")==0)
2048 yyval.sigtype = SIGNAL_FIRST_METHOD;
2049 else if(strcmp(yyvsp[-1].id,"last")==0)
2050 yyval.sigtype = SIGNAL_LAST_METHOD;
2052 yyerror(_("signal must be 'first' or 'last'"));
2053 g_free(yyvsp[-1].id);
2056 g_free(yyvsp[-1].id);
2062 if(strcmp(yyvsp[-2].id,"first")==0)
2063 yyval.sigtype = SIGNAL_FIRST_METHOD;
2064 else if(strcmp(yyvsp[-2].id,"last")==0)
2065 yyval.sigtype = SIGNAL_LAST_METHOD;
2067 yyerror(_("signal must be 'first' or 'last'"));
2068 g_free(yyvsp[-2].id);
2071 g_free(yyvsp[-2].id);
2077 yyval.sigtype = SIGNAL_LAST_METHOD;
2083 /* the_scope was default thus public */
2084 the_scope = PUBLIC_SCOPE;
2090 gtktypes = g_list_prepend(gtktypes, yyvsp[-3].id);
2096 gtktypes = g_list_append(gtktypes, yyvsp[0].id);
2102 gtktypes = g_list_append(gtktypes, yyvsp[0].id);
2107 { yyval.cbuf = yyvsp[0].cbuf; ;
2111 { yyval.cbuf = NULL; ;
2117 yyerror(_("signal without 'self' as "
2118 "first parameter"));
2119 free_all_global_state();
2122 if(the_scope == CLASS_SCOPE) {
2123 yyerror(_("a method cannot be of class scope"));
2124 free_all_global_state();
2127 push_function(the_scope, yyvsp[-7].sigtype,NULL,
2128 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
2129 ccode_line, vararg, yyvsp[-8].list);
2136 yyerror(_("signal without 'self' as "
2137 "first parameter"));
2138 free_all_global_state();
2141 if(the_scope == CLASS_SCOPE) {
2142 yyerror(_("a method cannot be of class scope"));
2143 free_all_global_state();
2146 push_function(the_scope, yyvsp[-7].sigtype, NULL,
2147 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
2148 ccode_line, vararg, yyvsp[-8].list);
2152 #line 1013 "parse.y"
2155 yyerror(_("virtual method without 'self' as "
2156 "first parameter"));
2157 free_all_global_state();
2160 if(the_scope == CLASS_SCOPE) {
2161 yyerror(_("a method cannot be of class scope"));
2162 free_all_global_state();
2165 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2166 yyvsp[0].cbuf, yyvsp[-8].line,
2167 ccode_line, vararg, NULL);
2171 #line 1029 "parse.y"
2174 yyerror(_("virtual method without 'self' as "
2175 "first parameter"));
2176 free_all_global_state();
2179 if(the_scope == CLASS_SCOPE) {
2180 yyerror(_("a method cannot be of class scope"));
2181 free_all_global_state();
2184 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2185 yyvsp[0].cbuf, yyvsp[-7].line,
2186 ccode_line, vararg, NULL);
2190 #line 1045 "parse.y"
2193 yyerror(_("virtual method without 'self' as "
2194 "first parameter"));
2195 free_all_global_state();
2198 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2199 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2200 ccode_line, vararg, NULL);
2204 #line 1056 "parse.y"
2206 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
2207 yyvsp[-5].id, yyvsp[0].cbuf,
2208 yyvsp[-10].line, ccode_line,
2213 #line 1062 "parse.y"
2215 if(the_scope == CLASS_SCOPE) {
2216 yyerror(_("a method cannot be of class scope"));
2217 free_all_global_state();
2220 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
2221 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
2226 #line 1072 "parse.y"
2228 if(strcmp(yyvsp[-4].id, "init")==0) {
2229 push_init_arg(yyvsp[-2].id,FALSE);
2230 push_function(NO_SCOPE, INIT_METHOD, NULL,
2231 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2232 ccode_line, FALSE, NULL);
2233 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
2234 push_init_arg(yyvsp[-2].id,TRUE);
2235 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
2236 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2237 ccode_line, FALSE, NULL);
2239 g_free(yyvsp[-4].id);
2240 g_free(yyvsp[-2].id);
2241 g_string_free(yyvsp[0].cbuf,TRUE);
2242 yyerror(_("parse error "
2243 "(untyped blocks must be init or "
2250 #line 1095 "parse.y"
2252 g_free(onerror); onerror = NULL;
2253 g_free(defreturn); defreturn = NULL;
2254 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2255 g_free(yyvsp[-1].id);
2256 g_free(yyvsp[0].id);
2257 yyerror(_("parse error"));
2260 g_free(yyvsp[-1].id);
2264 #line 1106 "parse.y"
2266 g_free(onerror); onerror = NULL;
2267 g_free(defreturn); defreturn = NULL;
2268 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
2269 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2270 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2271 yyerror(_("parse error"));
2274 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2275 onerror = defreturn = NULL;
2276 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2277 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2278 yyerror(_("parse error"));
2281 g_free(yyvsp[-3].id);
2282 g_free(yyvsp[-1].id);
2286 #line 1125 "parse.y"
2288 g_free(onerror); onerror = NULL;
2289 g_free(defreturn); defreturn = NULL;
2293 #line 1131 "parse.y"
2294 { yyval.id = yyvsp[0].id; ;
2297 #line 1132 "parse.y"
2299 yyval.id = (yyvsp[1].cbuf)->str;
2300 g_string_free(yyvsp[1].cbuf, FALSE);
2304 #line 1138 "parse.y"
2305 { vararg = FALSE; has_self = FALSE; ;
2308 #line 1139 "parse.y"
2312 if(strcmp(yyvsp[0].id,"self")==0)
2313 push_self(yyvsp[0].id, FALSE);
2315 g_free(yyvsp[0].id);
2316 yyerror(_("parse error"));
2322 #line 1150 "parse.y"
2326 if(strcmp(yyvsp[-1].id,"self")==0)
2327 push_self(yyvsp[-1].id, TRUE);
2329 g_free(yyvsp[-1].id);
2330 yyerror(_("parse error"));
2336 #line 1161 "parse.y"
2340 if(strcmp(yyvsp[0].id,"self")==0)
2341 push_self(yyvsp[0].id, TRUE);
2343 g_free(yyvsp[0].id);
2344 yyerror(_("parse error"));
2350 #line 1172 "parse.y"
2353 if(strcmp(yyvsp[-2].id,"self")==0)
2354 push_self(yyvsp[-2].id, FALSE);
2356 g_free(yyvsp[-2].id);
2357 yyerror(_("parse error"));
2363 #line 1182 "parse.y"
2366 if(strcmp(yyvsp[-3].id,"self")==0)
2367 push_self(yyvsp[-3].id, TRUE);
2369 g_free(yyvsp[-3].id);
2370 yyerror(_("parse error"));
2376 #line 1192 "parse.y"
2379 if(strcmp(yyvsp[-2].id,"self")==0)
2380 push_self(yyvsp[-2].id, TRUE);
2382 g_free(yyvsp[-2].id);
2383 yyerror(_("parse error"));
2389 #line 1202 "parse.y"
2390 { has_self = FALSE; ;
2393 #line 1205 "parse.y"
2397 #line 1206 "parse.y"
2401 #line 1209 "parse.y"
2405 #line 1210 "parse.y"
2409 #line 1213 "parse.y"
2411 push_funcarg(yyvsp[0].id,NULL);
2415 #line 1216 "parse.y"
2417 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
2421 #line 1219 "parse.y"
2423 if(strcmp(yyvsp[-2].id,"check")!=0) {
2424 yyerror(_("parse error"));
2427 g_free(yyvsp[-2].id);
2428 push_funcarg(yyvsp[-4].id,NULL);
2432 #line 1227 "parse.y"
2434 if(strcmp(yyvsp[-2].id,"check")!=0) {
2435 yyerror(_("parse error"));
2438 g_free(yyvsp[-2].id);
2439 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
2443 #line 1237 "parse.y"
2447 #line 1238 "parse.y"
2451 #line 1241 "parse.y"
2453 if(strcmp(yyvsp[0].id,"type")==0) {
2454 Node *node = new_check(TYPE_CHECK,NULL);
2455 checks = g_list_append(checks,node);
2456 } else if(strcmp(yyvsp[0].id,"null")==0) {
2457 Node *node = new_check(NULL_CHECK,NULL);
2458 checks = g_list_append(checks,node);
2460 yyerror(_("parse error"));
2463 g_free(yyvsp[0].id);
2467 #line 1254 "parse.y"
2469 Node *node = new_check(GT_CHECK,yyvsp[0].id);
2470 checks = g_list_append(checks,node);
2474 #line 1258 "parse.y"
2476 Node *node = new_check(LT_CHECK,yyvsp[0].id);
2477 checks = g_list_append(checks,node);
2481 #line 1262 "parse.y"
2483 Node *node = new_check(GE_CHECK,yyvsp[0].id);
2484 checks = g_list_append(checks,node);
2488 #line 1266 "parse.y"
2490 Node *node = new_check(LE_CHECK,yyvsp[0].id);
2491 checks = g_list_append(checks,node);
2495 #line 1270 "parse.y"
2497 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
2498 checks = g_list_append(checks,node);
2502 #line 1274 "parse.y"
2504 Node *node = new_check(NE_CHECK,yyvsp[0].id);
2505 checks = g_list_append(checks,node);
2509 #line 1280 "parse.y"
2510 { yyval.id = yyvsp[0].id; ;
2513 #line 1281 "parse.y"
2515 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
2516 g_free(yyvsp[0].id);
2520 #line 1285 "parse.y"
2521 { yyval.id = yyvsp[0].id; ;
2524 /* the action file gets copied in in place of this dollarsign */
2525 #line 543 "/usr/lib/bison.simple"
2536 short *ssp1 = yyss - 1;
2537 fprintf (stderr, "state stack now");
2538 while (ssp1 != yyssp)
2539 fprintf (stderr, " %d", *++ssp1);
2540 fprintf (stderr, "\n");
2550 yylsp->first_line = yylloc.first_line;
2551 yylsp->first_column = yylloc.first_column;
2552 yylsp->last_line = (yylsp-1)->last_line;
2553 yylsp->last_column = (yylsp-1)->last_column;
2558 yylsp->last_line = (yylsp+yylen-1)->last_line;
2559 yylsp->last_column = (yylsp+yylen-1)->last_column;
2563 /* Now "shift" the result of the reduction.
2564 Determine what state that goes to,
2565 based on the state we popped back to
2566 and the rule number reduced by. */
2570 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2571 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2572 yystate = yytable[yystate];
2574 yystate = yydefgoto[yyn - YYNTBASE];
2578 yyerrlab: /* here on detecting error */
2581 /* If not already recovering from an error, report this error. */
2585 #ifdef YYERROR_VERBOSE
2586 yyn = yypact[yystate];
2588 if (yyn > YYFLAG && yyn < YYLAST)
2595 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2596 for (x = (yyn < 0 ? -yyn : 0);
2597 x < (sizeof(yytname) / sizeof(char *)); x++)
2598 if (yycheck[x + yyn] == x)
2599 size += strlen(yytname[x]) + 15, count++;
2600 msg = (char *) malloc(size + 15);
2603 strcpy(msg, "parse error");
2608 for (x = (yyn < 0 ? -yyn : 0);
2609 x < (sizeof(yytname) / sizeof(char *)); x++)
2610 if (yycheck[x + yyn] == x)
2612 strcat(msg, count == 0 ? ", expecting `" : " or `");
2613 strcat(msg, yytname[x]);
2622 yyerror ("parse error; also virtual memory exceeded");
2625 #endif /* YYERROR_VERBOSE */
2626 yyerror("parse error");
2630 yyerrlab1: /* here on error raised explicitly by an action */
2632 if (yyerrstatus == 3)
2634 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2636 /* return failure if at end of input */
2637 if (yychar == YYEOF)
2642 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2648 /* Else will try to reuse lookahead token
2649 after shifting the error token. */
2651 yyerrstatus = 3; /* Each real token shifted decrements this */
2655 yyerrdefault: /* current state does not do anything special for the error token. */
2658 /* This is wrong; only states that explicitly want error tokens
2659 should shift them. */
2660 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2661 if (yyn) goto yydefault;
2664 yyerrpop: /* pop the current state because it cannot handle the error token */
2666 if (yyssp == yyss) YYABORT;
2676 short *ssp1 = yyss - 1;
2677 fprintf (stderr, "Error: state stack now");
2678 while (ssp1 != yyssp)
2679 fprintf (stderr, " %d", *++ssp1);
2680 fprintf (stderr, "\n");
2686 yyn = yypact[yystate];
2691 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2710 fprintf(stderr, "Shifting error token, ");
2722 /* YYACCEPT comes here. */
2734 /* YYABORT comes here. */
2745 #line 1288 "parse.y"