2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
27 #define SINGLE_CHAR 277
48 #define DEFAULT_VALUE 298
52 #define FLAGS_TYPE 302
54 #define PARAM_TYPE 304
55 #define BOXED_TYPE 305
56 #define OBJECT_TYPE 306
67 #include "treefuncs.h"
71 /* FIXME: add gettext support */
76 static GList *class_nodes = NULL;
79 static GList *enum_vals = NULL;
80 static GList *flag_vals = NULL;
81 static GList *error_vals = NULL;
83 static char *chunk_size = NULL;
84 static char *bonobo_object_class = NULL;
85 static GList *interfaces = NULL;
86 static GList *typestack = NULL;
87 static GList *funcargs = NULL;
88 static GList *checks = NULL;
89 static int has_self = FALSE;
90 static int vararg = FALSE;
91 static Method *last_added_method = NULL;
93 /* destructor and initializer for variables */
94 static gboolean destructor_unref = FALSE;
95 static char *destructor = NULL;
96 static int destructor_line = 0;
97 static gboolean destructor_simple = TRUE;
98 static char *initializer = NULL;
99 static int initializer_line = 0;
101 static char *onerror = NULL;
102 static char *defreturn = NULL;
104 static GList *gtktypes = NULL;
106 static Property *property = NULL;
108 /* this can be a global as we will only do one function at a time
110 static int the_scope = NO_SCOPE;
112 void free(void *ptr);
115 extern int ccode_line;
126 if(strcmp(yytext,"\n")==0) {
127 out=g_strconcat("Error: ",str," before newline",NULL);
128 } else if(yytext[0]=='\0') {
129 out=g_strconcat("Error: ", str, " at end of input", NULL);
131 char *tmp = g_strdup(yytext);
132 while((p=strchr(tmp, '\n')))
135 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
139 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
148 Type *type = typestack->data;
149 typestack = g_list_remove(typestack,typestack->data);
154 push_variable (char *name, int scope, int line_no, char *postfix)
157 Type *type = pop_type ();
159 type->postfix = postfix;
161 var = node_new (VARIABLE_NODE,
166 "destructor_unref", destructor_unref,
167 "destructor:steal", destructor,
168 "destructor_line", destructor_line,
169 "destructor_simple", destructor_simple,
170 "initializer:steal", initializer,
171 "initializer_line", initializer_line,
173 class_nodes = g_list_append(class_nodes, var);
177 push_function (int scope, int method, char *oid, char *id,
178 GString *cbuf, int line_no, int ccode_line,
179 gboolean vararg, GList *flags)
185 g_assert(scope != CLASS_SCOPE);
187 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
188 type = (Type *)node_new (TYPE_NODE,
195 /* a complicated and ugly test to figure out if we have
196 the wrong number of types for a signal */
197 if((method == SIGNAL_FIRST_METHOD ||
198 method == SIGNAL_LAST_METHOD) &&
199 g_list_length(gtktypes) != g_list_length(funcargs) &&
200 !(g_list_length(funcargs) == 1 &&
201 g_list_length(gtktypes) == 2 &&
202 strcmp(gtktypes->next->data, "NONE")==0)) {
203 error_print(GOB_WARN, line_no,
204 _("The number of GTK arguments and "
205 "function arguments for a signal "
206 "don't seem to match"));
208 if(g_list_length(gtktypes) > 2) {
210 for(li = gtktypes->next; li; li = li->next) {
211 if(strcmp(li->data, "NONE")==0) {
212 error_print(GOB_ERROR, line_no,
213 _("NONE can only appear in an "
214 "argument list by itself"));
220 c_cbuf = p = cbuf->str;
221 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
228 node = node_new (METHOD_NODE,
233 "gtktypes:steal", gtktypes,
234 "flags:steal", flags,
236 "args:steal", funcargs,
237 "onerror:steal", onerror,
238 "defreturn:steal", defreturn,
239 "cbuf:steal", c_cbuf,
241 "ccode_line", ccode_line,
243 "unique_id", method_unique_id++,
246 last_added_method = (Method *)node;
250 /*only free segment if we haven't passed it
259 class_nodes = g_list_append(class_nodes, node);
263 free_all_global_state(void)
273 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
274 g_list_free(gtktypes);
277 node_list_free (funcargs);
282 push_funcarg(char *name, char *postfix)
285 Type *type = pop_type();
287 type->postfix = postfix;
289 node = node_new (FUNCARG_NODE,
292 "checks:steal", checks,
296 funcargs = g_list_append(funcargs, node);
300 push_init_arg(char *name, int is_class)
307 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
309 tn = g_strdup(((Class *)class)->otype);
311 type = node_new (TYPE_NODE,
315 node = node_new (FUNCARG_NODE,
316 "atype:steal", (Type *)type,
319 funcargs = g_list_prepend(funcargs, node);
323 push_self(char *id, gboolean constant)
328 type = node_new (TYPE_NODE,
329 "name", ((Class *)class)->otype,
330 "pointer", constant ? "const *" : "*",
332 ch = g_list_append (ch, node_new (CHECK_NODE,
333 "chtype", NULL_CHECK,
335 ch = g_list_append (ch, node_new (CHECK_NODE,
336 "chtype", TYPE_CHECK,
338 node = node_new (FUNCARG_NODE,
339 "atype:steal", (Type *)type,
343 funcargs = g_list_prepend(funcargs, node);
347 find_var_or_die(const char *id, int line)
351 for(li = class_nodes; li != NULL; li = li->next) {
353 Node *node = li->data;
354 if(node->type != VARIABLE_NODE)
357 if(strcmp(var->id, id)==0)
361 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
363 g_assert_not_reached();
368 set_return_value(char *type, char *val)
370 if(strcmp(type, "onerror")==0) {
376 } else if(strcmp(type, "defreturn")==0) {
387 export_accessors (const char *var_name,
399 the_type = (Type *)node_copy ((Node *)type);
401 the_type = get_tree_type (gtktype, TRUE);
403 if (the_type == NULL) {
404 error_print (GOB_ERROR, line_no,
405 _("Cannot determine type of property or argument"));
410 char *get_id = g_strdup_printf ("get_%s", var_name);
411 GString *get_cbuf = g_string_new (NULL);
412 Node *node1 = node_new (TYPE_NODE,
413 "name", the_type->name,
414 "pointer", the_type->pointer,
415 "postfix", the_type->postfix,
417 Node *node3 = node_new (TYPE_NODE,
418 "name", class->class.otype,
422 g_string_sprintf (get_cbuf,
424 "g_object_get (G_OBJECT (self), \"%s\", "
428 the_type->pointer ? the_type->pointer : "",
431 typestack = g_list_prepend (typestack, node1);
432 typestack = g_list_prepend (typestack, node3);
434 push_funcarg ("self", FALSE);
436 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
437 get_id, get_cbuf, get_lineno,
438 lineno, FALSE, NULL);
442 char *set_id = g_strdup_printf ("set_%s", var_name);
443 GString *set_cbuf = g_string_new (NULL);
444 Node *node1 = node_new (TYPE_NODE,
445 "name", the_type->name,
446 "pointer", the_type->pointer,
447 "postfix", the_type->postfix,
449 Node *node2 = node_new (TYPE_NODE,
452 Node *node3 = node_new (TYPE_NODE,
453 "name", class->class.otype,
457 g_string_sprintf (set_cbuf,
458 "\tg_object_set (G_OBJECT (self), "
459 "\"%s\", val, NULL);\n",
462 typestack = g_list_prepend (typestack, node2);
463 typestack = g_list_prepend (typestack, node1);
464 typestack = g_list_prepend (typestack, node3);
466 push_funcarg ("self", FALSE);
467 push_funcarg ("val", FALSE);
469 typestack = g_list_prepend (typestack, node2);
470 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
471 set_id, set_cbuf, set_lineno,
472 lineno, FALSE, NULL);
475 node_free ((Node *)the_type);
479 property_link_and_export (Node *node)
481 Property *prop = (Property *)node;
485 char *get = NULL, *set = NULL;
488 if (prop->set != NULL ||
490 error_print (GOB_ERROR, prop->line_no,
491 _("Property linking requested, but "
492 "getters and setters exist"));
495 var = find_var_or_die (prop->name, prop->line_no);
496 if(var->scope == PRIVATE_SCOPE) {
497 root = "self->_priv";
498 } else if (var->scope == CLASS_SCOPE) {
499 root = "SELF_GET_CLASS(self)";
501 error_print (GOB_ERROR, prop->line_no,
502 _("Self aliases needed when autolinking to a classwide member"));
507 if (strcmp (prop->gtktype, "STRING") == 0) {
508 set = g_strdup_printf("{ char *old = %s->%s; "
509 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
512 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
514 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
515 set = g_strdup_printf("{ GtkObject *___old = (GtkObject *)%s->%s; "
516 "GtkObject *___new = (GtkObject *)gtk_value_get_object (VAL); "
517 "if (___new != NULL) { "
518 "gtk_object_ref (GTK_OBJECT (___new)); "
519 "%s->%s = GTK_OBJECT (___new); "
523 "if (___old != NULL) { "
524 "gtk_object_unref (GTK_OBJECT (___old)); "
530 get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
532 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
533 if (prop->extra_gtktype == NULL) {
534 error_print (GOB_ERROR, prop->line_no,
535 _("Property linking requested for BOXED, but "
536 "boxed_type not set"));
538 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
539 "gpointer ___new = (gpointer)gtk_value_get_boxed (VAL); "
540 "if (___new != ___old) { "
541 "if (___old != NULL) g_boxed_free (%s, ___old); "
542 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
543 "else %s->%s = NULL;"
551 get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
556 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
557 g_strdown (set_func);
558 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
559 g_strdown (get_func);
561 set = g_strdup_printf("%s->%s = %s (VAL);",
564 get = g_strdup_printf("%s (VAL, %s->%s);",
574 "get_line", prop->line_no,
576 "set_line", prop->line_no,
581 export_accessors (prop->name,
582 prop->get != NULL, prop->get_line,
583 prop->set != NULL, prop->set_line,
594 if (strcmp (s, "BOOL") == 0) {
595 error_print (GOB_WARN, line_no,
596 _("BOOL type is deprecated, please use BOOLEAN"));
598 return g_strdup ("BOOLEAN");
605 ensure_property (void)
607 if (property == NULL)
608 property = (Property *)node_new (PROPERTY_NODE, NULL);
635 #define YYFLAG -32768
638 #define YYTRANSLATE(x) ((unsigned)(x) <= 306 ? yytranslate[x] : 118)
640 static const char yytranslate[] = { 0,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 64, 2, 2, 2, 2, 2, 2, 55,
645 56, 61, 2, 59, 65, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 57, 63,
647 58, 62, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 53, 60, 54, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
664 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
665 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
667 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
668 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
669 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
670 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
671 47, 48, 49, 50, 51, 52
675 static const short yyprhs[] = { 0,
676 0, 4, 7, 10, 12, 14, 16, 18, 20, 22,
677 24, 27, 30, 33, 36, 38, 40, 42, 44, 49,
678 53, 59, 60, 66, 72, 78, 81, 83, 85, 88,
679 92, 94, 96, 98, 100, 102, 104, 106, 108, 111,
680 115, 118, 122, 125, 128, 130, 132, 133, 139, 146,
681 159, 169, 176, 180, 181, 193, 202, 208, 212, 213,
682 217, 219, 221, 226, 228, 230, 234, 238, 242, 246,
683 250, 254, 258, 262, 266, 270, 274, 278, 280, 286,
684 288, 292, 293, 297, 299, 302, 304, 306, 308, 311,
685 314, 317, 321, 325, 328, 331, 334, 336, 339, 341,
686 344, 346, 348, 350, 352, 354, 356, 358, 360, 362,
687 364, 366, 368, 370, 373, 376, 380, 383, 385, 389,
688 393, 396, 398, 403, 407, 409, 412, 414, 425, 437,
689 447, 457, 466, 478, 487, 493, 496, 501, 502, 504,
690 507, 509, 511, 514, 517, 521, 526, 531, 533, 537,
691 539, 543, 545, 548, 552, 559, 567, 570, 572, 574,
692 577, 580, 584, 588, 592, 596, 604, 613, 617, 619,
693 623, 625, 633, 642, 646, 648, 656, 665, 669, 671,
697 static const short yyrhs[] = { 68,
698 69, 68, 0, 69, 68, 0, 68, 69, 0, 69,
699 0, 24, 0, 27, 0, 25, 0, 26, 0, 28,
700 0, 29, 0, 68, 67, 0, 68, 110, 0, 68,
701 113, 0, 68, 115, 0, 67, 0, 110, 0, 113,
702 0, 115, 0, 70, 53, 72, 54, 0, 70, 53,
703 54, 0, 3, 21, 4, 21, 71, 0, 0, 55,
704 19, 19, 56, 71, 0, 55, 19, 21, 56, 71,
705 0, 55, 19, 20, 56, 71, 0, 72, 73, 0,
706 73, 0, 101, 0, 19, 101, 0, 19, 21, 101,
707 0, 78, 0, 79, 0, 81, 0, 57, 0, 31,
708 0, 32, 0, 33, 0, 34, 0, 19, 19, 0,
709 19, 53, 24, 0, 58, 117, 0, 58, 53, 24,
710 0, 75, 76, 0, 76, 75, 0, 76, 0, 75,
711 0, 0, 74, 90, 19, 77, 57, 0, 74, 90,
712 19, 22, 77, 57, 0, 36, 88, 87, 19, 80,
713 19, 53, 24, 19, 53, 24, 57, 0, 36, 88,
714 87, 19, 80, 19, 53, 24, 57, 0, 36, 88,
715 87, 19, 80, 19, 0, 55, 19, 56, 0, 0,
716 35, 19, 19, 82, 19, 53, 24, 19, 53, 24,
717 57, 0, 35, 19, 19, 82, 19, 53, 24, 57,
718 0, 35, 19, 19, 82, 57, 0, 55, 83, 56,
719 0, 0, 83, 59, 86, 0, 86, 0, 30, 0,
720 19, 55, 30, 56, 0, 117, 0, 84, 0, 40,
721 58, 84, 0, 41, 58, 84, 0, 42, 58, 117,
722 0, 43, 58, 117, 0, 44, 58, 85, 0, 46,
723 58, 89, 0, 47, 58, 90, 0, 48, 58, 19,
724 0, 49, 58, 19, 0, 50, 58, 19, 0, 51,
725 58, 19, 0, 52, 58, 19, 0, 19, 0, 19,
726 55, 19, 90, 56, 0, 19, 0, 55, 89, 56,
727 0, 0, 19, 60, 89, 0, 19, 0, 91, 95,
728 0, 91, 0, 92, 0, 19, 0, 5, 19, 0,
729 19, 5, 0, 94, 19, 0, 5, 94, 19, 0,
730 94, 19, 5, 0, 93, 92, 0, 21, 92, 0,
731 5, 92, 0, 21, 0, 21, 5, 0, 93, 0,
732 93, 5, 0, 6, 0, 18, 0, 14, 0, 15,
733 0, 13, 0, 16, 0, 17, 0, 11, 0, 12,
734 0, 7, 0, 8, 0, 9, 0, 61, 0, 61,
735 5, 0, 61, 95, 0, 61, 5, 95, 0, 19,
736 98, 0, 98, 0, 74, 19, 98, 0, 19, 74,
737 98, 0, 74, 98, 0, 96, 0, 19, 55, 99,
738 56, 0, 99, 59, 19, 0, 19, 0, 53, 24,
739 0, 57, 0, 38, 88, 97, 90, 19, 55, 104,
740 56, 102, 100, 0, 74, 38, 88, 96, 90, 19,
741 55, 104, 56, 102, 100, 0, 37, 74, 90, 19,
742 55, 104, 56, 102, 100, 0, 74, 37, 90, 19,
743 55, 104, 56, 102, 100, 0, 37, 90, 19, 55,
744 104, 56, 102, 100, 0, 39, 55, 21, 56, 90,
745 19, 55, 104, 56, 102, 100, 0, 74, 90, 19,
746 55, 104, 56, 102, 100, 0, 19, 55, 19, 56,
747 100, 0, 19, 103, 0, 19, 103, 19, 103, 0,
748 0, 117, 0, 53, 24, 0, 6, 0, 19, 0,
749 19, 5, 0, 5, 19, 0, 19, 59, 105, 0,
750 19, 5, 59, 105, 0, 5, 19, 59, 105, 0,
751 105, 0, 106, 59, 10, 0, 106, 0, 106, 59,
752 107, 0, 107, 0, 90, 19, 0, 90, 19, 22,
753 0, 90, 19, 55, 19, 108, 56, 0, 90, 19,
754 22, 55, 19, 108, 56, 0, 108, 109, 0, 109,
755 0, 19, 0, 62, 117, 0, 63, 117, 0, 62,
756 58, 117, 0, 63, 58, 117, 0, 58, 58, 117,
757 0, 64, 58, 117, 0, 9, 19, 53, 111, 54,
758 21, 57, 0, 9, 19, 53, 111, 59, 54, 21,
759 57, 0, 111, 59, 112, 0, 112, 0, 19, 58,
760 117, 0, 19, 0, 46, 19, 53, 114, 54, 21,
761 57, 0, 46, 19, 53, 114, 59, 54, 21, 57,
762 0, 114, 59, 19, 0, 19, 0, 45, 19, 53,
763 116, 54, 21, 57, 0, 45, 19, 53, 116, 59,
764 54, 21, 57, 0, 116, 59, 19, 0, 19, 0,
765 20, 0, 65, 20, 0, 23, 0, 19, 0
771 static const short yyrline[] = { 0,
772 597, 598, 599, 600, 603, 612, 621, 630, 639, 648,
773 659, 660, 661, 662, 663, 664, 665, 666, 669, 674,
774 681, 695, 696, 708, 717, 731, 732, 735, 736, 745,
775 757, 758, 759, 760, 763, 764, 765, 766, 769, 789,
776 813, 817, 825, 826, 827, 828, 829, 835, 838, 843,
777 911, 965, 1053, 1061, 1066, 1114, 1150, 1166, 1167, 1170,
778 1171, 1174, 1175, 1187, 1188, 1191, 1197, 1203, 1209, 1215,
779 1221, 1227, 1234, 1240, 1246, 1252, 1258, 1264, 1284, 1293,
780 1299, 1300, 1303, 1306, 1312, 1319, 1328, 1331, 1334, 1338,
781 1342, 1346, 1351, 1359, 1363, 1368, 1372, 1375, 1379, 1382,
782 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1398,
783 1399, 1400, 1403, 1404, 1405, 1409, 1416, 1428, 1434, 1446,
784 1458, 1461, 1467, 1472, 1475, 1480, 1481, 1485, 1501, 1517,
785 1533, 1549, 1560, 1566, 1576, 1599, 1610, 1629, 1635, 1636,
786 1642, 1643, 1654, 1665, 1676, 1686, 1696, 1706, 1709, 1710,
787 1713, 1714, 1717, 1720, 1723, 1731, 1741, 1742, 1745, 1762,
788 1769, 1776, 1783, 1790, 1797, 1806, 1815, 1826, 1827, 1830,
789 1850, 1860, 1869, 1880, 1883, 1888, 1897, 1908, 1911, 1917,
795 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
797 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
798 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
799 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","TOKEN","NUMBER","TYPETOKEN","ARRAY_DIM",
800 "SINGLE_CHAR","CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","STRING","PUBLIC",
801 "PRIVATE","PROTECTED","CLASSWIDE","PROPERTY","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE",
802 "NICK","BLURB","MAXIMUM","MINIMUM","DEFAULT_VALUE","ERROR","FLAGS","TYPE","FLAGS_TYPE",
803 "ENUM_TYPE","PARAM_TYPE","BOXED_TYPE","OBJECT_TYPE","'{'","'}'","'('","')'",
804 "';'","'='","','","'|'","'*'","'>'","'<'","'!'","'-'","prog","ccode","ccodes",
805 "class","classdec","classflags","classcode","thing","scope","destructor","initializer",
806 "varoptions","variable","argument","export","property","param_spec","param_spec_list",
807 "string","anyval","param_spec_value","argtype","flags","flaglist","type","specifier_list",
808 "spec_list","specifier","strunionenum","pointer","simplesigtype","fullsigtype",
809 "sigtype","tokenlist","codenocode","method","returnvals","retcode","funcargs",
810 "arglist","arglist1","arg","checklist","check","enumcode","enumvals","enumval",
811 "flagcode","flagvals","errorcode","errorvals","numtok", NULL
815 static const short yyr1[] = { 0,
816 66, 66, 66, 66, 67, 67, 67, 67, 67, 67,
817 68, 68, 68, 68, 68, 68, 68, 68, 69, 69,
818 70, 71, 71, 71, 71, 72, 72, 73, 73, 73,
819 73, 73, 73, 73, 74, 74, 74, 74, 75, 75,
820 76, 76, 77, 77, 77, 77, 77, 78, 78, 79,
821 79, 79, 80, 80, 81, 81, 81, 82, 82, 83,
822 83, 84, 84, 85, 85, 86, 86, 86, 86, 86,
823 86, 86, 86, 86, 86, 86, 86, 86, 87, 87,
824 88, 88, 89, 89, 90, 90, 91, 91, 91, 91,
825 91, 91, 91, 92, 92, 92, 92, 92, 92, 92,
826 93, 93, 93, 93, 93, 93, 93, 93, 93, 94,
827 94, 94, 95, 95, 95, 95, 96, 96, 97, 97,
828 97, 97, 98, 99, 99, 100, 100, 101, 101, 101,
829 101, 101, 101, 101, 101, 102, 102, 102, 103, 103,
830 104, 104, 104, 104, 104, 104, 104, 104, 105, 105,
831 106, 106, 107, 107, 107, 107, 108, 108, 109, 109,
832 109, 109, 109, 109, 109, 110, 110, 111, 111, 112,
833 112, 113, 113, 114, 114, 115, 115, 116, 116, 117,
837 static const short yyr2[] = { 0,
838 3, 2, 2, 1, 1, 1, 1, 1, 1, 1,
839 2, 2, 2, 2, 1, 1, 1, 1, 4, 3,
840 5, 0, 5, 5, 5, 2, 1, 1, 2, 3,
841 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
842 2, 3, 2, 2, 1, 1, 0, 5, 6, 12,
843 9, 6, 3, 0, 11, 8, 5, 3, 0, 3,
844 1, 1, 4, 1, 1, 3, 3, 3, 3, 3,
845 3, 3, 3, 3, 3, 3, 3, 1, 5, 1,
846 3, 0, 3, 1, 2, 1, 1, 1, 2, 2,
847 2, 3, 3, 2, 2, 2, 1, 2, 1, 2,
848 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
849 1, 1, 1, 2, 2, 3, 2, 1, 3, 3,
850 2, 1, 4, 3, 1, 2, 1, 10, 11, 9,
851 9, 8, 11, 8, 5, 2, 4, 0, 1, 2,
852 1, 1, 2, 2, 3, 4, 4, 1, 3, 1,
853 3, 1, 2, 3, 6, 7, 2, 1, 1, 2,
854 2, 3, 3, 3, 3, 7, 8, 3, 1, 3,
855 1, 7, 8, 3, 1, 7, 8, 3, 1, 1,
859 static const short yydefact[] = { 0,
860 0, 0, 5, 7, 8, 6, 9, 10, 0, 0,
861 15, 0, 4, 0, 16, 17, 18, 0, 0, 0,
862 0, 11, 3, 12, 13, 14, 2, 0, 0, 0,
863 0, 0, 1, 0, 35, 36, 37, 38, 0, 82,
864 0, 82, 0, 20, 34, 0, 27, 0, 31, 32,
865 33, 28, 22, 171, 0, 169, 179, 0, 175, 0,
866 0, 0, 0, 0, 29, 0, 0, 0, 0, 101,
867 110, 111, 112, 108, 109, 105, 103, 104, 106, 107,
868 102, 88, 97, 0, 0, 86, 87, 99, 0, 0,
869 0, 19, 26, 0, 82, 0, 0, 21, 0, 0,
870 0, 0, 0, 0, 0, 30, 0, 0, 59, 84,
871 0, 80, 0, 0, 89, 96, 0, 90, 98, 95,
872 0, 0, 113, 85, 100, 94, 91, 0, 0, 122,
873 0, 118, 0, 0, 0, 47, 0, 183, 180, 182,
874 0, 170, 0, 0, 168, 0, 178, 0, 0, 174,
875 0, 0, 0, 0, 0, 0, 81, 0, 54, 92,
876 0, 0, 114, 115, 93, 0, 0, 0, 117, 0,
877 121, 0, 0, 0, 0, 0, 0, 47, 0, 0,
878 46, 45, 0, 0, 0, 0, 181, 166, 0, 176,
879 0, 172, 0, 0, 127, 135, 78, 0, 0, 0,
880 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
881 61, 0, 57, 83, 0, 0, 0, 0, 0, 101,
882 88, 0, 0, 148, 150, 152, 116, 125, 0, 120,
883 119, 0, 0, 0, 0, 39, 0, 0, 0, 0,
884 41, 43, 44, 48, 22, 22, 22, 167, 177, 173,
885 126, 0, 0, 0, 0, 0, 0, 0, 0, 0,
886 0, 0, 0, 58, 0, 0, 0, 0, 52, 0,
887 89, 90, 0, 153, 138, 0, 123, 0, 0, 0,
888 0, 0, 40, 49, 138, 42, 23, 25, 24, 0,
889 62, 66, 67, 68, 69, 183, 65, 70, 64, 71,
890 72, 73, 74, 75, 76, 77, 60, 0, 79, 53,
891 0, 138, 0, 0, 145, 154, 0, 0, 0, 149,
892 151, 124, 0, 0, 138, 0, 0, 0, 0, 56,
893 0, 0, 147, 146, 0, 0, 0, 136, 139, 132,
894 138, 0, 0, 0, 134, 0, 0, 0, 51, 130,
895 0, 159, 0, 0, 0, 0, 0, 158, 140, 0,
896 0, 138, 131, 138, 63, 0, 0, 0, 0, 0,
897 160, 0, 161, 0, 155, 157, 137, 128, 0, 0,
898 55, 0, 156, 164, 162, 163, 165, 133, 129, 50,
902 static const short yydefgoto[] = { 391,
903 11, 12, 13, 14, 98, 46, 47, 48, 181, 182,
904 183, 49, 50, 217, 51, 155, 210, 292, 298, 211,
905 113, 68, 111, 222, 86, 87, 88, 89, 124, 130,
906 131, 132, 229, 196, 52, 319, 338, 223, 224, 225,
907 226, 357, 358, 15, 55, 56, 16, 60, 17, 58,
911 static const short yypact[] = { 168,
912 18, 21,-32768,-32768,-32768,-32768,-32768,-32768, 41, 89,
913 -32768, 168, 213, 56,-32768,-32768,-32768, 138, 77, 109,
914 110,-32768, 213,-32768,-32768,-32768, 213, 167, 123, 153,
915 155, 189, 213, 230,-32768,-32768,-32768,-32768, 190, 156,
916 309, 156, 161,-32768,-32768, 196,-32768, 275,-32768,-32768,
917 -32768,-32768, 162, 165, -17,-32768,-32768, -13,-32768, 91,
918 164, 300, 201, 275,-32768, 206, 207, 217, 356,-32768,
919 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
920 -32768, 247, 424, 373, 235, 199,-32768, 438, 238, 443,
921 244,-32768,-32768, 373, 156, 253, 255,-32768, 6, 245,
922 -1, 256, 26, 258, 73,-32768, 222, 276, 274, 242,
923 254, 280, 292, 452,-32768,-32768, 317,-32768, 452,-32768,
924 340, 311, 2,-32768, 452,-32768, 371, 157, 364,-32768,
925 373,-32768, 337, 381, 391, 88, 224,-32768,-32768,-32768,
926 397,-32768, 370, 410,-32768, 375,-32768, 412, 377,-32768,
927 425, -34, 392, 257, -7, 207,-32768, 429, 405,-32768,
928 406, 390, 199,-32768,-32768, 416, 453, 459,-32768, 14,
929 -32768, 460, 373, 426, 14, 373, 13, 9, 390, 59,
930 422, 463, 427, 430, 431, 432,-32768,-32768, 428,-32768,
931 433,-32768, 434, 465,-32768,-32768,-32768, 435, 436, 437,
932 439, 440, 441, 442, 444, 445, 446, 447, 448, 122,
933 -32768, 454,-32768,-32768, 373, 464, 473, 390, 407, 455,
934 5, 477, 456,-32768, 449,-32768,-32768,-32768, 124,-32768,
935 -32768, 458, 482, 390, 490,-32768, 486, 457, 461, 491,
936 -32768,-32768,-32768,-32768, 162, 162, 162,-32768,-32768,-32768,
937 -32768, 84, 84, 6, 6, 64, 207, 373, 497, 499,
938 500, 501, 502,-32768, 257, 498, 467, 468, 472, 470,
939 126, 128, 373, 63, 508, 339,-32768, 509, 390, 474,
940 475, 478,-32768,-32768, 508,-32768,-32768,-32768,-32768, 479,
941 -32768,-32768,-32768,-32768,-32768, 479,-32768,-32768,-32768,-32768,
942 -32768,-32768,-32768,-32768,-32768,-32768,-32768, -2,-32768,-32768,
943 506, 508, 373, 373,-32768, 480, 513, 70, -34,-32768,
944 -32768,-32768, 481, 390, 508, 390, -34, 510, 483,-32768,
945 16, -34,-32768,-32768, 519, 106, 515, 522,-32768,-32768,
946 508, 487, -34, 488,-32768, 489, 518, 493,-32768,-32768,
947 106,-32768, 492, 76, 82, 494, 57,-32768,-32768, 70,
948 -34, 508,-32768, 508,-32768, 496, 523, 103, 6, 6,
949 -32768, 6,-32768, 6,-32768,-32768,-32768,-32768, -34, -34,
950 -32768, 503,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
954 static const short yypgoto[] = {-32768,
955 99, 125, 539,-32768, 1,-32768, 511, -28, 372, 374,
956 378,-32768,-32768,-32768,-32768,-32768,-32768, -46,-32768, 293,
957 -32768, -27, -151, -40,-32768, -67,-32768, -66, -112, 450,
958 -32768, -98,-32768, -305, -14, -276, 202, -175, -216,-32768,
959 283, 210, -240, 104,-32768, 462, 127,-32768, 146,-32768,
967 static const short yytable[] = { 142,
968 85, 116, 117, 239, 214, 64, 163, 96, 327, 272,
969 164, 212, 84, 340, 90, 120, 329, 54, 194, 65,
970 126, 345, 195, 108, 138, 139, 350, 177, 140, 169,
971 171, 236, 166, 64, 348, 332, 100, 363, 18, 19,
972 102, 101, 270, 121, 147, 103, 116, 106, 343, 213,
973 227, 116, 144, 134, 330, 378, 315, 116, 281, 20,
974 -142, 129, 123, 273, 361, 237, 180, 135, 167, 230,
975 141, 231, 349, 388, 389, 352, 169, 138, 139, 148,
976 241, 140, 296, 139, 316, 379, 140, 380, 138, 139,
977 172, 150, 140, 291, 138, 139, 333, 334, 140, 168,
978 138, 139, 290, 323, 140, 300, 177, 21, 28, 178,
979 22, 240, 375, 291, 353, 24, 376, 317, 354, 355,
980 356, 352, 337, 141, 352, 22, 151, 376, 141, 30,
981 24, 22, 233, 370, 141, 235, 24, 27, 25, 372,
982 141, 29, 179, 53, 104, 180, 141, 33, 342, 105,
983 344, 116, 117, 25, 294, 295, 299, 26, 383, 25,
984 353, 31, 32, 353, 354, 355, 356, 354, 355, 356,
985 1, 54, 26, 57, 267, 166, 2, 264, 26, 277,
986 265, -144, 278, -143, 313, 34, 314, 35, 36, 37,
987 38, 3, 4, 5, 6, 7, 8, 35, 36, 37,
988 38, 39, 40, 41, 42, 43, 293, 59, 66, 297,
989 67, 167, 9, 10, 34, 91, 97, 301, 63, 107,
990 44, 2, 99, 45, 109, 110, 35, 36, 37, 38,
991 39, 40, 41, 42, 43, 112, 3, 4, 5, 6,
992 7, 8, 184, 185, 186, 287, 288, 289, 61, 92,
993 62, 118, 45, 122, 371, 373, 127, 9, 10, 123,
994 35, 36, 37, 38, 133, 143, 41, 42, 43, 384,
995 385, 136, 386, 137, 387, 197, 146, 152, 149, 69,
996 70, 71, 72, 73, 63, 74, 75, 76, 77, 78,
997 79, 80, 81, 82, 153, 83, 198, 199, 200, 201,
998 202, 156, 203, 204, 205, 206, 207, 208, 209, 157,
999 159, 94, 95, 69, 70, 71, 72, 73, 61, 74,
1000 75, 76, 77, 78, 79, 80, 81, 82, 154, 83,
1001 35, 36, 37, 38, 158, 160, 41, 42, 43, 35,
1002 36, 37, 38, 69, 70, 71, 72, 73, 320, 74,
1003 75, 76, 77, 78, 79, 80, 81, 82, 161, 83,
1004 114, 70, 71, 72, 73, 162, 74, 75, 76, 77,
1005 78, 79, 80, 81, 115, 165, 83, 69, 70, 71,
1006 72, 73, 170, 74, 75, 76, 77, 78, 79, 80,
1007 81, 82, 173, 83, 219, 220, 71, 72, 73, 174,
1008 74, 75, 76, 77, 78, 79, 80, 81, 221, 175,
1009 83, 114, 70, 71, 72, 73, 187, 74, 75, 76,
1010 77, 78, 79, 80, 81, 271, 188, 83, 119, 70,
1011 189, 190, 191, 192, 74, 75, 76, 77, 78, 79,
1012 80, 81, 125, 70, 83, 193, 179, 215, 74, 75,
1013 76, 77, 78, 79, 80, 81, 114, 70, 83, 216,
1014 218, 128, 74, 75, 76, 77, 78, 79, 80, 81,
1015 167, 228, 83, 35, 36, 37, 38, 166, 232, 180,
1016 234, 177, 268, 244, 248, 245, 246, 247, 251, 249,
1017 250, 269, 252, 253, 254, 274, 255, 256, 257, 258,
1018 280, 259, 260, 261, 262, 263, 266, 276, 282, 283,
1019 -141, 275, 279, 284, 286, 302, 285, 303, 304, 305,
1020 306, 308, 309, 310, 311, 312, 318, 322, 324, 331,
1021 325, 336, 326, 328, 335, 347, 341, 351, 359, 346,
1022 360, 366, 362, 364, 365, 367, 382, 392, 393, 369,
1023 23, 374, 381, 243, 242, 238, 93, 307, 321, 390,
1024 368, 377, 145, 0, 0, 0, 0, 0, 0, 0,
1025 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1029 static const short yycheck[] = { 99,
1030 41, 69, 69, 179, 156, 34, 5, 48, 285, 5,
1031 123, 19, 41, 319, 42, 83, 19, 19, 53, 34,
1032 88, 327, 57, 64, 19, 20, 332, 19, 23, 128,
1033 129, 19, 19, 62, 19, 312, 54, 343, 21, 19,
1034 54, 59, 218, 84, 19, 59, 114, 62, 325, 57,
1035 163, 119, 54, 94, 57, 361, 273, 125, 234, 19,
1036 56, 90, 61, 59, 341, 53, 58, 95, 55, 168,
1037 65, 170, 57, 379, 380, 19, 175, 19, 20, 54,
1038 180, 23, 19, 20, 22, 362, 23, 364, 19, 20,
1039 131, 19, 23, 30, 19, 20, 313, 314, 23, 128,
1040 19, 20, 19, 279, 23, 257, 19, 19, 53, 22,
1041 12, 53, 56, 30, 58, 12, 357, 55, 62, 63,
1042 64, 19, 53, 65, 19, 27, 54, 368, 65, 53,
1043 27, 33, 173, 58, 65, 176, 33, 13, 12, 58,
1044 65, 4, 55, 21, 54, 58, 65, 23, 324, 59,
1045 326, 219, 219, 27, 254, 255, 256, 12, 56, 33,
1046 58, 53, 53, 58, 62, 63, 64, 62, 63, 64,
1047 3, 19, 27, 19, 215, 19, 9, 56, 33, 56,
1048 59, 56, 59, 56, 59, 19, 59, 31, 32, 33,
1049 34, 24, 25, 26, 27, 28, 29, 31, 32, 33,
1050 34, 35, 36, 37, 38, 39, 253, 19, 19, 256,
1051 55, 55, 45, 46, 19, 55, 55, 258, 55, 19,
1052 54, 9, 58, 57, 19, 19, 31, 32, 33, 34,
1053 35, 36, 37, 38, 39, 19, 24, 25, 26, 27,
1054 28, 29, 19, 20, 21, 245, 246, 247, 19, 54,
1055 21, 5, 57, 19, 354, 355, 19, 45, 46, 61,
1056 31, 32, 33, 34, 21, 21, 37, 38, 39, 369,
1057 370, 19, 372, 19, 374, 19, 21, 56, 21, 5,
1058 6, 7, 8, 9, 55, 11, 12, 13, 14, 15,
1059 16, 17, 18, 19, 19, 21, 40, 41, 42, 43,
1060 44, 60, 46, 47, 48, 49, 50, 51, 52, 56,
1061 19, 37, 38, 5, 6, 7, 8, 9, 19, 11,
1062 12, 13, 14, 15, 16, 17, 18, 19, 55, 21,
1063 31, 32, 33, 34, 55, 19, 37, 38, 39, 31,
1064 32, 33, 34, 5, 6, 7, 8, 9, 10, 11,
1065 12, 13, 14, 15, 16, 17, 18, 19, 19, 21,
1066 5, 6, 7, 8, 9, 55, 11, 12, 13, 14,
1067 15, 16, 17, 18, 19, 5, 21, 5, 6, 7,
1068 8, 9, 19, 11, 12, 13, 14, 15, 16, 17,
1069 18, 19, 56, 21, 5, 6, 7, 8, 9, 19,
1070 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
1071 21, 5, 6, 7, 8, 9, 20, 11, 12, 13,
1072 14, 15, 16, 17, 18, 19, 57, 21, 5, 6,
1073 21, 57, 21, 57, 11, 12, 13, 14, 15, 16,
1074 17, 18, 5, 6, 21, 21, 55, 19, 11, 12,
1075 13, 14, 15, 16, 17, 18, 5, 6, 21, 55,
1076 55, 19, 11, 12, 13, 14, 15, 16, 17, 18,
1077 55, 19, 21, 31, 32, 33, 34, 19, 19, 58,
1078 55, 19, 19, 57, 57, 56, 56, 56, 24, 57,
1079 57, 19, 58, 58, 58, 19, 58, 58, 58, 58,
1080 19, 58, 58, 58, 58, 58, 53, 59, 19, 24,
1081 56, 56, 55, 57, 24, 19, 56, 19, 19, 19,
1082 19, 24, 56, 56, 53, 56, 19, 19, 55, 24,
1083 56, 19, 55, 55, 55, 53, 56, 19, 24, 30,
1084 19, 24, 56, 56, 56, 53, 24, 0, 0, 58,
1085 12, 58, 57, 182, 181, 178, 46, 265, 276, 57,
1086 351, 360, 101, -1, -1, -1, -1, -1, -1, -1,
1087 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1090 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1091 #line 3 "/usr/lib/bison.simple"
1092 /* This file comes from bison-1.28. */
1094 /* Skeleton output parser for bison,
1095 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
1097 This program is free software; you can redistribute it and/or modify
1098 it under the terms of the GNU General Public License as published by
1099 the Free Software Foundation; either version 2, or (at your option)
1102 This program is distributed in the hope that it will be useful,
1103 but WITHOUT ANY WARRANTY; without even the implied warranty of
1104 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1105 GNU General Public License for more details.
1107 You should have received a copy of the GNU General Public License
1108 along with this program; if not, write to the Free Software
1109 Foundation, Inc., 59 Temple Place - Suite 330,
1110 Boston, MA 02111-1307, USA. */
1112 /* As a special exception, when this file is copied by Bison into a
1113 Bison output file, you may use that output file without restriction.
1114 This special exception was added by the Free Software Foundation
1115 in version 1.24 of Bison. */
1117 /* This is the parser code that is written into each bison parser
1118 when the %semantic_parser declaration is not specified in the grammar.
1119 It was written by Richard Stallman by simplifying the hairy parser
1120 used when %semantic_parser is specified. */
1122 #ifndef YYSTACK_USE_ALLOCA
1124 #define YYSTACK_USE_ALLOCA
1125 #else /* alloca not defined */
1127 #define YYSTACK_USE_ALLOCA
1128 #define alloca __builtin_alloca
1129 #else /* not GNU C. */
1130 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
1131 #define YYSTACK_USE_ALLOCA
1133 #else /* not sparc */
1134 /* We think this test detects Watcom and Microsoft C. */
1135 /* This used to test MSDOS, but that is a bad idea
1136 since that symbol is in the user namespace. */
1137 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
1138 #if 0 /* No need for malloc.h, which pollutes the namespace;
1139 instead, just don't use alloca. */
1142 #else /* not MSDOS, or __TURBOC__ */
1144 /* I don't know what this was needed for, but it pollutes the namespace.
1145 So I turned it off. rms, 2 May 1997. */
1146 /* #include <malloc.h> */
1148 #define YYSTACK_USE_ALLOCA
1149 #else /* not MSDOS, or __TURBOC__, or _AIX */
1151 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
1152 and on HPUX 10. Eventually we can turn this on. */
1153 #define YYSTACK_USE_ALLOCA
1154 #define alloca __builtin_alloca
1157 #endif /* not _AIX */
1158 #endif /* not MSDOS, or __TURBOC__ */
1159 #endif /* not sparc */
1160 #endif /* not GNU C */
1161 #endif /* alloca not defined */
1162 #endif /* YYSTACK_USE_ALLOCA not defined */
1164 #ifdef YYSTACK_USE_ALLOCA
1165 #define YYSTACK_ALLOC alloca
1167 #define YYSTACK_ALLOC malloc
1170 /* Note: there must be only one dollar sign in this file.
1171 It is replaced by the list of actions, each action
1172 as one case of the switch. */
1174 #define yyerrok (yyerrstatus = 0)
1175 #define yyclearin (yychar = YYEMPTY)
1178 #define YYACCEPT goto yyacceptlab
1179 #define YYABORT goto yyabortlab
1180 #define YYERROR goto yyerrlab1
1181 /* Like YYERROR except do call yyerror.
1182 This remains here temporarily to ease the
1183 transition to the new meaning of YYERROR, for GCC.
1184 Once GCC version 2 has supplanted version 1, this can go. */
1185 #define YYFAIL goto yyerrlab
1186 #define YYRECOVERING() (!!yyerrstatus)
1187 #define YYBACKUP(token, value) \
1189 if (yychar == YYEMPTY && yylen == 1) \
1190 { yychar = (token), yylval = (value); \
1191 yychar1 = YYTRANSLATE (yychar); \
1196 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1200 #define YYERRCODE 256
1203 #define YYLEX yylex()
1209 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1211 #define YYLEX yylex(&yylval, &yylloc)
1213 #else /* not YYLSP_NEEDED */
1215 #define YYLEX yylex(&yylval, YYLEX_PARAM)
1217 #define YYLEX yylex(&yylval)
1219 #endif /* not YYLSP_NEEDED */
1222 /* If nonreentrant, generate the variables here */
1226 int yychar; /* the lookahead symbol */
1227 YYSTYPE yylval; /* the semantic value of the */
1228 /* lookahead symbol */
1231 YYLTYPE yylloc; /* location data for the lookahead */
1235 int yynerrs; /* number of parse errors so far */
1236 #endif /* not YYPURE */
1239 int yydebug; /* nonzero means print parse trace */
1240 /* Since this is uninitialized, it does not stop multiple parsers
1244 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1247 #define YYINITDEPTH 200
1250 /* YYMAXDEPTH is the maximum size the stacks can grow to
1251 (effective only if the built-in stack extension method is used). */
1258 #define YYMAXDEPTH 10000
1261 /* Define __yy_memcpy. Note that the size argument
1262 should be passed with type unsigned int, because that is what the non-GCC
1263 definitions require. With GCC, __builtin_memcpy takes an arg
1264 of type size_t, but it can handle unsigned int. */
1266 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1267 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1268 #else /* not GNU C or C++ */
1271 /* This is the most reliable way to avoid incompatibilities
1272 in available built-in functions on various systems. */
1274 __yy_memcpy (to, from, count)
1279 register char *f = from;
1280 register char *t = to;
1281 register int i = count;
1287 #else /* __cplusplus */
1289 /* This is the most reliable way to avoid incompatibilities
1290 in available built-in functions on various systems. */
1292 __yy_memcpy (char *to, char *from, unsigned int count)
1294 register char *t = to;
1295 register char *f = from;
1296 register int i = count;
1305 #line 217 "/usr/lib/bison.simple"
1307 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1308 into yyparse. The argument should have type void *.
1309 It should actually point to an object.
1310 Grammar actions can access the variable by casting it
1311 to the proper pointer type. */
1313 #ifdef YYPARSE_PARAM
1315 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1316 #define YYPARSE_PARAM_DECL
1317 #else /* not __cplusplus */
1318 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1319 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1320 #endif /* not __cplusplus */
1321 #else /* not YYPARSE_PARAM */
1322 #define YYPARSE_PARAM_ARG
1323 #define YYPARSE_PARAM_DECL
1324 #endif /* not YYPARSE_PARAM */
1326 /* Prevent warning if -Wstrict-prototypes. */
1328 #ifdef YYPARSE_PARAM
1329 int yyparse (void *);
1336 yyparse(YYPARSE_PARAM_ARG)
1339 register int yystate;
1341 register short *yyssp;
1342 register YYSTYPE *yyvsp;
1343 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1344 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1346 short yyssa[YYINITDEPTH]; /* the state stack */
1347 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1349 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1350 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1353 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1354 YYLTYPE *yyls = yylsa;
1357 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1359 #define YYPOPSTACK (yyvsp--, yyssp--)
1362 int yystacksize = YYINITDEPTH;
1363 int yyfree_stacks = 0;
1374 YYSTYPE yyval; /* the variable used to return */
1375 /* semantic values from the action */
1382 fprintf(stderr, "Starting parse\n");
1388 yychar = YYEMPTY; /* Cause a token to be read. */
1390 /* Initialize stack pointers.
1391 Waste one element of value and location stack
1392 so that they stay on the same level as the state stack.
1393 The wasted elements are never initialized. */
1401 /* Push a new state, which is found in yystate . */
1402 /* In all cases, when you get here, the value and location stacks
1403 have just been pushed. so pushing a state here evens the stacks. */
1408 if (yyssp >= yyss + yystacksize - 1)
1410 /* Give user a chance to reallocate the stack */
1411 /* Use copies of these so that the &'s don't force the real ones into memory. */
1412 YYSTYPE *yyvs1 = yyvs;
1413 short *yyss1 = yyss;
1415 YYLTYPE *yyls1 = yyls;
1418 /* Get the current used size of the three stacks, in elements. */
1419 int size = yyssp - yyss + 1;
1422 /* Each stack pointer address is followed by the size of
1423 the data in use in that stack, in bytes. */
1425 /* This used to be a conditional around just the two extra args,
1426 but that might be undefined if yyoverflow is a macro. */
1427 yyoverflow("parser stack overflow",
1428 &yyss1, size * sizeof (*yyssp),
1429 &yyvs1, size * sizeof (*yyvsp),
1430 &yyls1, size * sizeof (*yylsp),
1433 yyoverflow("parser stack overflow",
1434 &yyss1, size * sizeof (*yyssp),
1435 &yyvs1, size * sizeof (*yyvsp),
1439 yyss = yyss1; yyvs = yyvs1;
1443 #else /* no yyoverflow */
1444 /* Extend the stack our own way. */
1445 if (yystacksize >= YYMAXDEPTH)
1447 yyerror("parser stack overflow");
1459 if (yystacksize > YYMAXDEPTH)
1460 yystacksize = YYMAXDEPTH;
1461 #ifndef YYSTACK_USE_ALLOCA
1464 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1465 __yy_memcpy ((char *)yyss, (char *)yyss1,
1466 size * (unsigned int) sizeof (*yyssp));
1467 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1468 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1469 size * (unsigned int) sizeof (*yyvsp));
1471 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1472 __yy_memcpy ((char *)yyls, (char *)yyls1,
1473 size * (unsigned int) sizeof (*yylsp));
1475 #endif /* no yyoverflow */
1477 yyssp = yyss + size - 1;
1478 yyvsp = yyvs + size - 1;
1480 yylsp = yyls + size - 1;
1485 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1488 if (yyssp >= yyss + yystacksize - 1)
1494 fprintf(stderr, "Entering state %d\n", yystate);
1500 /* Do appropriate processing given the current state. */
1501 /* Read a lookahead token if we need one and don't already have one. */
1504 /* First try to decide what to do without reference to lookahead token. */
1506 yyn = yypact[yystate];
1510 /* Not known => get a lookahead token if don't already have one. */
1512 /* yychar is either YYEMPTY or YYEOF
1513 or a valid token in external form. */
1515 if (yychar == YYEMPTY)
1519 fprintf(stderr, "Reading a token: ");
1524 /* Convert token to internal form (in yychar1) for indexing tables with */
1526 if (yychar <= 0) /* This means end of input. */
1529 yychar = YYEOF; /* Don't call YYLEX any more */
1533 fprintf(stderr, "Now at end of input.\n");
1538 yychar1 = YYTRANSLATE(yychar);
1543 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1544 /* Give the individual parser a way to print the precise meaning
1545 of a token, for further debugging info. */
1547 YYPRINT (stderr, yychar, yylval);
1549 fprintf (stderr, ")\n");
1555 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1560 /* yyn is what to do for this token type in this state.
1561 Negative => reduce, -yyn is rule number.
1562 Positive => shift, yyn is new state.
1563 New state is final state => don't bother to shift,
1564 just return success.
1565 0, or most negative number => error. */
1580 /* Shift the lookahead token. */
1584 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1587 /* Discard the token being shifted unless it is eof. */
1588 if (yychar != YYEOF)
1596 /* count tokens shifted since error; after three, turn off error status. */
1597 if (yyerrstatus) yyerrstatus--;
1602 /* Do the default action for the current state. */
1605 yyn = yydefact[yystate];
1609 /* Do a reduction. yyn is the number of a rule to reduce with. */
1613 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1620 fprintf (stderr, "Reducing via rule %d (line %d), ",
1623 /* Print the symbols being reduced, and their result. */
1624 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1625 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1626 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1652 Node *node = node_new (CCODE_NODE,
1654 "cbuf:steal", (yyvsp[0].cbuf)->str,
1655 "line_no", ccode_line,
1657 nodes = g_list_append(nodes,node);
1658 g_string_free(yyvsp[0].cbuf,FALSE);
1664 Node *node = node_new (CCODE_NODE,
1666 "cbuf:steal", (yyvsp[0].cbuf)->str,
1667 "line_no", ccode_line,
1669 nodes = g_list_append(nodes,node);
1670 g_string_free(yyvsp[0].cbuf,FALSE);
1676 Node *node = node_new (CCODE_NODE,
1678 "cbuf:steal", (yyvsp[0].cbuf)->str,
1679 "line_no", ccode_line,
1681 nodes = g_list_append(nodes,node);
1682 g_string_free(yyvsp[0].cbuf,FALSE);
1688 Node *node = node_new (CCODE_NODE,
1690 "cbuf:steal", (yyvsp[0].cbuf)->str,
1691 "line_no", ccode_line,
1693 nodes = g_list_append(nodes,node);
1694 g_string_free(yyvsp[0].cbuf,FALSE);
1700 Node *node = node_new (CCODE_NODE,
1702 "cbuf:steal", (yyvsp[0].cbuf)->str,
1703 "line_no", ccode_line,
1705 nodes = g_list_append(nodes,node);
1706 g_string_free(yyvsp[0].cbuf,FALSE);
1712 Node *node = node_new (CCODE_NODE,
1714 "cbuf:steal", (yyvsp[0].cbuf)->str,
1715 "line_no", ccode_line,
1717 nodes = g_list_append(nodes,node);
1718 g_string_free(yyvsp[0].cbuf,FALSE);
1756 ((Class *)class)->nodes = class_nodes;
1758 nodes = g_list_append(nodes,class);
1764 ((Class *)class)->nodes = NULL;
1766 nodes = g_list_append(nodes,class);
1772 class = node_new (CLASS_NODE,
1773 "otype:steal", yyvsp[-3].id,
1774 "ptype:steal", yyvsp[-1].id,
1775 "bonobo_object_class:steal", bonobo_object_class,
1776 "interfaces:steal", interfaces,
1777 "chunk_size:steal", chunk_size,
1779 bonobo_object_class = NULL;
1787 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1788 g_free (chunk_size);
1789 chunk_size = g_strdup(yyvsp[-2].id);
1790 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
1791 g_free (bonobo_object_class);
1792 bonobo_object_class = g_strdup(yyvsp[-2].id);
1794 yyerror(_("parse error"));
1802 if (strcmp (yyvsp[-3].id, "interface") == 0) {
1803 interfaces = g_list_append (interfaces,
1804 g_strdup (yyvsp[-2].id));
1806 yyerror(_("parse error"));
1814 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1815 g_free (chunk_size);
1816 if(atoi(yyvsp[-2].id) != 0)
1817 chunk_size = g_strdup(yyvsp[-2].id);
1821 yyerror(_("parse error"));
1841 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
1842 g_free (yyvsp[-1].id);
1843 yyerror (_("parse error"));
1846 g_free (yyvsp[-1].id);
1847 last_added_method->bonobo_object_func = TRUE;
1853 if (strcmp (yyvsp[-2].id, "interface") != 0) {
1854 g_free (yyvsp[-2].id);
1855 g_free (yyvsp[-1].id);
1856 yyerror (_("parse error"));
1859 g_free (yyvsp[-2].id);
1860 node_set ((Node *)last_added_method,
1861 "interface:steal", yyvsp[-1].id,
1883 { the_scope = PUBLIC_SCOPE; ;
1887 { the_scope = PRIVATE_SCOPE; ;
1891 { the_scope = PROTECTED_SCOPE; ;
1895 { the_scope = CLASS_SCOPE; ;
1900 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
1901 g_free (yyvsp[-1].id);
1902 destructor_unref = FALSE;
1903 destructor = yyvsp[0].id;
1904 destructor_line = line_no;
1905 destructor_simple = TRUE;
1906 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
1907 g_free (yyvsp[-1].id);
1908 destructor_unref = TRUE;
1909 destructor = yyvsp[0].id;
1910 destructor_line = line_no;
1911 destructor_simple = TRUE;
1913 g_free (yyvsp[-1].id);
1914 g_free (yyvsp[0].id);
1915 yyerror (_("parse error"));
1923 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
1924 g_free(yyvsp[-2].id);
1925 destructor_unref = FALSE;
1926 destructor = (yyvsp[0].cbuf)->str;
1927 g_string_free(yyvsp[0].cbuf, FALSE);
1928 destructor_line = ccode_line;
1929 destructor_simple = FALSE;
1930 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
1931 g_free (yyvsp[-2].id);
1932 destructor_unref = TRUE;
1933 destructor = (yyvsp[0].cbuf)->str;
1934 g_string_free (yyvsp[0].cbuf, FALSE);
1935 destructor_line = ccode_line;
1936 destructor_simple = FALSE;
1938 g_free (yyvsp[-2].id);
1939 g_string_free (yyvsp[0].cbuf, TRUE);
1940 yyerror (_("parse error"));
1948 initializer = yyvsp[0].id;
1949 initializer_line = ccode_line;
1955 initializer = (yyvsp[0].cbuf)->str;
1956 initializer_line = ccode_line;
1957 g_string_free(yyvsp[0].cbuf, FALSE);
1970 { destructor = NULL; ;
1974 { initializer = NULL; ;
1986 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
1992 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
1999 if(strcmp(yyvsp[-6].id,"get")==0 &&
2000 strcmp(yyvsp[-3].id,"set")==0) {
2001 Type *type = pop_type();
2002 g_free (yyvsp[-6].id);
2003 g_free (yyvsp[-3].id);
2004 node = node_new (ARGUMENT_NODE,
2005 "gtktype:steal", yyvsp[-9].id,
2006 "atype:steal", type,
2007 "flags:steal", yyvsp[-10].list,
2008 "name:steal", yyvsp[-8].id,
2009 "get:steal", (yyvsp[-4].cbuf)->str,
2010 "get_line", yyvsp[-5].line,
2011 "set:steal", (yyvsp[-1].cbuf)->str,
2012 "set_line", yyvsp[-2].line,
2013 "line_no", yyvsp[-11].line,
2016 class_nodes = g_list_append(class_nodes,node);
2018 g_string_free (yyvsp[-4].cbuf, FALSE);
2019 g_string_free (yyvsp[-1].cbuf, FALSE);
2021 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2022 strcmp(yyvsp[-3].id,"get")==0) {
2023 Type *type = pop_type();
2024 g_free (yyvsp[-6].id);
2025 g_free (yyvsp[-3].id);
2026 node = node_new (ARGUMENT_NODE,
2027 "gtktype:steal", yyvsp[-9].id,
2028 "atype:steal", type,
2029 "flags:steal", yyvsp[-10].list,
2030 "name:steal", yyvsp[-8].id,
2031 "get:steal", (yyvsp[-1].cbuf)->str,
2032 "get_line", yyvsp[-2].line,
2033 "set:steal", (yyvsp[-4].cbuf)->str,
2034 "set_line", yyvsp[-5].line,
2035 "line_no", yyvsp[-11].line,
2037 g_string_free (yyvsp[-1].cbuf, FALSE);
2038 g_string_free (yyvsp[-4].cbuf, FALSE);
2039 class_nodes = g_list_append(class_nodes,node);
2041 g_free (yyvsp[-9].id);
2042 g_free (yyvsp[-8].id);
2043 g_free (yyvsp[-6].id);
2044 g_free (yyvsp[-3].id);
2045 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2046 g_list_free (yyvsp[-10].list);
2047 g_string_free (yyvsp[-1].cbuf, TRUE);
2048 g_string_free (yyvsp[-4].cbuf, TRUE);
2049 yyerror (_("parse error"));
2053 if (yyvsp[-7].id != NULL) {
2054 Argument *arg = (Argument *)node;
2055 export_accessors (arg->name,
2056 arg->get != NULL, arg->get_line,
2057 arg->set != NULL, arg->set_line,
2061 g_free (yyvsp[-7].id);
2070 if(strcmp(yyvsp[-3].id, "get") == 0) {
2071 Type *type = pop_type();
2072 g_free (yyvsp[-3].id);
2073 node = node_new (ARGUMENT_NODE,
2074 "gtktype:steal", yyvsp[-6].id,
2075 "atype:steal", type,
2076 "flags:steal", yyvsp[-7].list,
2077 "name:steal", yyvsp[-5].id,
2078 "get:steal", (yyvsp[-1].cbuf)->str,
2079 "get_line", yyvsp[-2].line,
2080 "line_no", yyvsp[-8].line,
2083 g_string_free (yyvsp[-1].cbuf, FALSE);
2084 class_nodes = g_list_append(class_nodes, node);
2085 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2086 Type *type = pop_type();
2087 g_free (yyvsp[-3].id);
2088 node = node_new (ARGUMENT_NODE,
2089 "gtktype:steal", yyvsp[-6].id,
2090 "atype:steal", type,
2091 "flags:steal", yyvsp[-7].list,
2092 "name:steal", yyvsp[-5].id,
2093 "set:steal", (yyvsp[-1].cbuf)->str,
2094 "set_line", yyvsp[-2].line,
2095 "line_no", yyvsp[-8].line,
2098 g_string_free (yyvsp[-1].cbuf, FALSE);
2099 class_nodes = g_list_append (class_nodes, node);
2101 g_free (yyvsp[-3].id);
2102 g_free (yyvsp[-6].id);
2103 g_free (yyvsp[-5].id);
2104 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2105 g_list_free (yyvsp[-7].list);
2106 g_string_free (yyvsp[-1].cbuf, TRUE);
2107 yyerror(_("parse error"));
2111 if (yyvsp[-4].id != NULL) {
2112 Argument *arg = (Argument *)node;
2113 export_accessors (arg->name,
2114 arg->get != NULL, arg->get_line,
2115 arg->set != NULL, arg->set_line,
2119 g_free (yyvsp[-4].id);
2127 char *get, *set = NULL;
2132 if(strcmp(yyvsp[0].id, "link")!=0 &&
2133 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2134 strcmp(yyvsp[0].id, "objectlink")!=0) {
2135 g_free(yyvsp[0].id);
2136 g_free(yyvsp[-3].id);
2137 g_free(yyvsp[-2].id);
2138 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2139 g_list_free(yyvsp[-4].list);
2140 yyerror(_("parse error"));
2146 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2147 if(var->scope == PRIVATE_SCOPE)
2148 root = "self->_priv";
2149 else if(var->scope == CLASS_SCOPE) {
2150 root = "SELF_GET_CLASS(self)";
2152 error_print(GOB_ERROR, yyvsp[-5].line,
2153 _("Self aliases needed when autolinking to a classwide member"));
2157 if(strcmp(yyvsp[0].id, "link")==0) {
2158 set = g_strdup_printf("%s->%s = ARG;",
2159 root, yyvsp[-2].id);
2160 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2161 set = g_strdup_printf("g_free (%s->%s); "
2162 "%s->%s = g_strdup (ARG);",
2164 root, yyvsp[-2].id);
2165 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2166 set = g_strdup_printf(
2168 "g_object_ref (G_OBJECT (ARG)); "
2169 "if (%s->%s != NULL) "
2170 "g_object_unref (G_OBJECT (%s->%s)); "
2174 root, yyvsp[-2].id);
2176 g_assert_not_reached();
2179 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2181 g_free (yyvsp[0].id);
2184 type = (Type *)node_copy ((Node *)var->vtype);
2186 node = node_new (ARGUMENT_NODE,
2187 "gtktype:steal", yyvsp[-3].id,
2188 "atype:steal", type,
2189 "flags:steal", yyvsp[-4].list,
2190 "name:steal", yyvsp[-2].id,
2192 "get_line", yyvsp[-5].line,
2194 "set_line", yyvsp[-5].line,
2195 "line_no", yyvsp[-5].line,
2198 if (yyvsp[-1].id != NULL) {
2199 Argument *arg = (Argument *)node;
2200 export_accessors (arg->name,
2201 arg->get != NULL, arg->get_line,
2202 arg->set != NULL, arg->set_line,
2206 g_free (yyvsp[-1].id);
2209 class_nodes = g_list_append (class_nodes, node);
2213 #line 1053 "parse.y"
2215 if (strcmp (yyvsp[-1].id, "export")!=0) {
2216 g_free (yyvsp[-1].id);
2217 yyerror (_("parse error"));
2220 yyval.id = yyvsp[-1].id;
2224 #line 1061 "parse.y"
2230 #line 1066 "parse.y"
2233 node_set ((Node *)property,
2234 "line_no", yyvsp[-10].line,
2235 "gtktype:steal", debool (yyvsp[-9].id),
2236 "name:steal", yyvsp[-8].id,
2238 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2239 strcmp (yyvsp[-3].id, "set") == 0) {
2240 node_set ((Node *)property,
2241 "get:steal", (yyvsp[-4].cbuf)->str,
2242 "get_line", yyvsp[-5].line,
2243 "set:steal", (yyvsp[-1].cbuf)->str,
2244 "set_line", yyvsp[-2].line,
2246 g_string_free (yyvsp[-4].cbuf, FALSE);
2247 g_string_free (yyvsp[-1].cbuf, FALSE);
2248 g_free (yyvsp[-6].id);
2249 g_free (yyvsp[-3].id);
2250 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2251 strcmp (yyvsp[-3].id, "get") == 0) {
2252 node_set ((Node *)property,
2253 "get:steal", (yyvsp[-1].cbuf)->str,
2254 "get_line", yyvsp[-2].line,
2255 "set:steal", (yyvsp[-4].cbuf)->str,
2256 "set_line", yyvsp[-5].line,
2258 g_string_free (yyvsp[-4].cbuf, FALSE);
2259 g_string_free (yyvsp[-1].cbuf, FALSE);
2260 g_free (yyvsp[-6].id);
2261 g_free (yyvsp[-3].id);
2263 g_string_free (yyvsp[-4].cbuf, TRUE);
2264 g_string_free (yyvsp[-1].cbuf, TRUE);
2265 g_free (yyvsp[-6].id);
2266 g_free (yyvsp[-3].id);
2267 node_free ((Node *)property);
2269 yyerror (_("parse error"));
2272 property_link_and_export ((Node *)property);
2273 if (property != NULL) {
2274 class_nodes = g_list_append (class_nodes,
2281 #line 1114 "parse.y"
2284 node_set ((Node *)property,
2285 "line_no", yyvsp[-7].line,
2286 "gtktype:steal", debool (yyvsp[-6].id),
2287 "name:steal", yyvsp[-5].id,
2289 if (strcmp (yyvsp[-3].id, "get") == 0) {
2290 node_set ((Node *)property,
2291 "get:steal", (yyvsp[-1].cbuf)->str,
2292 "get_line", yyvsp[-2].line,
2294 g_string_free (yyvsp[-1].cbuf, FALSE);
2295 g_free (yyvsp[-3].id);
2296 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2297 node_set ((Node *)property,
2298 "set:steal", (yyvsp[-1].cbuf)->str,
2299 "set_line", yyvsp[-2].line,
2301 g_string_free (yyvsp[-1].cbuf, FALSE);
2302 g_free (yyvsp[-3].id);
2304 g_string_free (yyvsp[-1].cbuf, TRUE);
2305 g_free (yyvsp[-3].id);
2306 node_free ((Node *)property);
2308 yyerror (_("parse error"));
2311 property_link_and_export ((Node *)property);
2312 if (property != NULL) {
2313 class_nodes = g_list_append (class_nodes,
2320 #line 1150 "parse.y"
2323 node_set ((Node *)property,
2324 "line_no", yyvsp[-4].line,
2325 "gtktype:steal", debool (yyvsp[-3].id),
2326 "name:steal", yyvsp[-2].id,
2328 property_link_and_export ((Node *)property);
2329 if (property != NULL) {
2330 class_nodes = g_list_append (class_nodes,
2337 #line 1166 "parse.y"
2341 #line 1167 "parse.y"
2345 #line 1170 "parse.y"
2349 #line 1171 "parse.y"
2353 #line 1174 "parse.y"
2354 { yyval.id = yyvsp[0].id; ;
2357 #line 1175 "parse.y"
2359 if (strcmp (yyvsp[-3].id, "_") != 0) {
2360 g_free (yyvsp[-3].id);
2361 yyerror(_("parse error"));
2364 g_free (yyvsp[-3].id);
2365 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2366 g_free (yyvsp[-1].id);
2370 #line 1187 "parse.y"
2371 { yyval.id = yyvsp[0].id; ;
2374 #line 1188 "parse.y"
2375 { yyval.id = yyvsp[0].id; ;
2378 #line 1191 "parse.y"
2381 node_set ((Node *)property,
2382 "nick:steal", yyvsp[0].id,
2387 #line 1197 "parse.y"
2390 node_set ((Node *)property,
2391 "blurb:steal", yyvsp[0].id,
2396 #line 1203 "parse.y"
2399 node_set ((Node *)property,
2400 "maximum:steal", yyvsp[0].id,
2405 #line 1209 "parse.y"
2408 node_set ((Node *)property,
2409 "minimum:steal", yyvsp[0].id,
2414 #line 1215 "parse.y"
2417 node_set ((Node *)property,
2418 "default_value:steal", yyvsp[0].id,
2423 #line 1221 "parse.y"
2426 node_set ((Node *)property,
2427 "flags:steal", yyvsp[0].list,
2432 #line 1227 "parse.y"
2434 Type *type = pop_type ();
2436 node_set ((Node *)property,
2437 "ptype:steal", type,
2442 #line 1234 "parse.y"
2445 node_set ((Node *)property,
2446 "extra_gtktype:steal", yyvsp[0].id,
2451 #line 1240 "parse.y"
2454 node_set ((Node *)property,
2455 "extra_gtktype:steal", yyvsp[0].id,
2460 #line 1246 "parse.y"
2463 node_set ((Node *)property,
2464 "extra_gtktype:steal", yyvsp[0].id,
2469 #line 1252 "parse.y"
2472 node_set ((Node *)property,
2473 "extra_gtktype:steal", yyvsp[0].id,
2478 #line 1258 "parse.y"
2481 node_set ((Node *)property,
2482 "extra_gtktype:steal", yyvsp[0].id,
2487 #line 1264 "parse.y"
2490 if (strcmp (yyvsp[0].id, "link") == 0) {
2491 g_free(yyvsp[0].id);
2492 node_set ((Node *)property,
2495 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2496 g_free(yyvsp[0].id);
2497 node_set ((Node *)property,
2501 g_free(yyvsp[0].id);
2502 yyerror(_("parse error"));
2508 #line 1284 "parse.y"
2510 if(strcmp(yyvsp[-2].id,"type")!=0) {
2511 g_free(yyvsp[-4].id);
2512 g_free(yyvsp[-2].id);
2513 yyerror(_("parse error"));
2516 yyval.id = debool (yyvsp[-4].id);
2520 #line 1293 "parse.y"
2522 yyval.id = debool (yyvsp[0].id);
2523 typestack = g_list_prepend(typestack,NULL);
2527 #line 1299 "parse.y"
2528 { yyval.list = yyvsp[-1].list; ;
2531 #line 1300 "parse.y"
2532 { yyval.list = NULL; ;
2535 #line 1303 "parse.y"
2537 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2541 #line 1306 "parse.y"
2543 yyval.list = g_list_append(NULL,yyvsp[0].id);
2547 #line 1312 "parse.y"
2549 Node *node = node_new (TYPE_NODE,
2550 "name:steal", yyvsp[-1].id,
2551 "pointer:steal", yyvsp[0].id,
2553 typestack = g_list_prepend(typestack,node);
2557 #line 1319 "parse.y"
2559 Node *node = node_new (TYPE_NODE,
2560 "name:steal", yyvsp[0].id,
2562 typestack = g_list_prepend(typestack,node);
2566 #line 1328 "parse.y"
2568 yyval.id = yyvsp[0].id;
2572 #line 1331 "parse.y"
2574 yyval.id = yyvsp[0].id;
2578 #line 1334 "parse.y"
2580 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2581 g_free(yyvsp[0].id);
2585 #line 1338 "parse.y"
2587 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2588 g_free(yyvsp[-1].id);
2592 #line 1342 "parse.y"
2594 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2595 g_free(yyvsp[0].id);
2599 #line 1346 "parse.y"
2601 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2603 g_free(yyvsp[0].id);
2607 #line 1351 "parse.y"
2609 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2610 yyvsp[-1].id, " const", NULL);
2611 g_free(yyvsp[-1].id);
2615 #line 1359 "parse.y"
2617 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2618 g_free(yyvsp[0].id);
2622 #line 1363 "parse.y"
2624 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2625 g_free(yyvsp[-1].id);
2626 g_free(yyvsp[0].id);
2630 #line 1368 "parse.y"
2632 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2633 g_free(yyvsp[0].id);
2637 #line 1372 "parse.y"
2639 yyval.id = yyvsp[0].id;
2643 #line 1375 "parse.y"
2645 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2646 g_free(yyvsp[-1].id);
2650 #line 1379 "parse.y"
2652 yyval.id = g_strdup(yyvsp[0].id);
2656 #line 1382 "parse.y"
2658 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2662 #line 1387 "parse.y"
2663 { yyval.id = "void"; ;
2666 #line 1388 "parse.y"
2667 { yyval.id = "char"; ;
2670 #line 1389 "parse.y"
2671 { yyval.id = "short"; ;
2674 #line 1390 "parse.y"
2675 { yyval.id = "int"; ;
2678 #line 1391 "parse.y"
2679 { yyval.id = "long"; ;
2682 #line 1392 "parse.y"
2683 { yyval.id = "float"; ;
2686 #line 1393 "parse.y"
2687 { yyval.id = "double"; ;
2690 #line 1394 "parse.y"
2691 { yyval.id = "signed"; ;
2694 #line 1395 "parse.y"
2695 { yyval.id = "unsigned"; ;
2698 #line 1398 "parse.y"
2699 { yyval.id = "struct"; ;
2702 #line 1399 "parse.y"
2703 { yyval.id = "union"; ;
2706 #line 1400 "parse.y"
2707 { yyval.id = "enum"; ;
2710 #line 1403 "parse.y"
2711 { yyval.id = g_strdup("*"); ;
2714 #line 1404 "parse.y"
2715 { yyval.id = g_strdup("* const"); ;
2718 #line 1405 "parse.y"
2720 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2721 g_free(yyvsp[0].id);
2725 #line 1409 "parse.y"
2727 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2728 g_free(yyvsp[0].id);
2732 #line 1416 "parse.y"
2734 if(strcmp(yyvsp[-1].id, "first")==0)
2735 yyval.sigtype = SIGNAL_FIRST_METHOD;
2736 else if(strcmp(yyvsp[-1].id, "last")==0)
2737 yyval.sigtype = SIGNAL_LAST_METHOD;
2739 yyerror(_("signal must be 'first' or 'last'"));
2740 g_free(yyvsp[-1].id);
2743 g_free(yyvsp[-1].id);
2747 #line 1428 "parse.y"
2749 yyval.sigtype = SIGNAL_LAST_METHOD;
2753 #line 1434 "parse.y"
2755 if(strcmp(yyvsp[-1].id,"first")==0)
2756 yyval.sigtype = SIGNAL_FIRST_METHOD;
2757 else if(strcmp(yyvsp[-1].id,"last")==0)
2758 yyval.sigtype = SIGNAL_LAST_METHOD;
2760 yyerror(_("signal must be 'first' or 'last'"));
2761 g_free(yyvsp[-1].id);
2764 g_free(yyvsp[-1].id);
2768 #line 1446 "parse.y"
2770 if(strcmp(yyvsp[-2].id,"first")==0)
2771 yyval.sigtype = SIGNAL_FIRST_METHOD;
2772 else if(strcmp(yyvsp[-2].id,"last")==0)
2773 yyval.sigtype = SIGNAL_LAST_METHOD;
2775 yyerror(_("signal must be 'first' or 'last'"));
2776 g_free(yyvsp[-2].id);
2779 g_free(yyvsp[-2].id);
2783 #line 1458 "parse.y"
2785 yyval.sigtype = SIGNAL_LAST_METHOD;
2789 #line 1461 "parse.y"
2791 /* the_scope was default thus public */
2792 the_scope = PUBLIC_SCOPE;
2796 #line 1467 "parse.y"
2798 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
2802 #line 1472 "parse.y"
2804 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2808 #line 1475 "parse.y"
2810 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2814 #line 1480 "parse.y"
2815 { yyval.cbuf = yyvsp[0].cbuf; ;
2818 #line 1481 "parse.y"
2819 { yyval.cbuf = NULL; ;
2822 #line 1485 "parse.y"
2825 yyerror(_("signal without 'self' as "
2826 "first parameter"));
2827 free_all_global_state();
2830 if(the_scope == CLASS_SCOPE) {
2831 yyerror(_("a method cannot be of class scope"));
2832 free_all_global_state();
2835 push_function(the_scope, yyvsp[-7].sigtype,NULL,
2836 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
2837 ccode_line, vararg, yyvsp[-8].list);
2841 #line 1501 "parse.y"
2844 yyerror(_("signal without 'self' as "
2845 "first parameter"));
2846 free_all_global_state();
2849 if(the_scope == CLASS_SCOPE) {
2850 yyerror(_("a method cannot be of class scope"));
2851 free_all_global_state();
2854 push_function(the_scope, yyvsp[-7].sigtype, NULL,
2855 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
2856 ccode_line, vararg, yyvsp[-8].list);
2860 #line 1517 "parse.y"
2863 yyerror(_("virtual method without 'self' as "
2864 "first parameter"));
2865 free_all_global_state();
2868 if(the_scope == CLASS_SCOPE) {
2869 yyerror(_("a method cannot be of class scope"));
2870 free_all_global_state();
2873 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2874 yyvsp[0].cbuf, yyvsp[-8].line,
2875 ccode_line, vararg, NULL);
2879 #line 1533 "parse.y"
2882 yyerror(_("virtual method without 'self' as "
2883 "first parameter"));
2884 free_all_global_state();
2887 if(the_scope == CLASS_SCOPE) {
2888 yyerror(_("a method cannot be of class scope"));
2889 free_all_global_state();
2892 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2893 yyvsp[0].cbuf, yyvsp[-7].line,
2894 ccode_line, vararg, NULL);
2898 #line 1549 "parse.y"
2901 yyerror(_("virtual method without 'self' as "
2902 "first parameter"));
2903 free_all_global_state();
2906 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2907 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2908 ccode_line, vararg, NULL);
2912 #line 1560 "parse.y"
2914 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
2915 yyvsp[-5].id, yyvsp[0].cbuf,
2916 yyvsp[-10].line, ccode_line,
2921 #line 1566 "parse.y"
2923 if(the_scope == CLASS_SCOPE) {
2924 yyerror(_("a method cannot be of class scope"));
2925 free_all_global_state();
2928 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
2929 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
2934 #line 1576 "parse.y"
2936 if(strcmp(yyvsp[-4].id, "init")==0) {
2937 push_init_arg(yyvsp[-2].id,FALSE);
2938 push_function(NO_SCOPE, INIT_METHOD, NULL,
2939 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2940 ccode_line, FALSE, NULL);
2941 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
2942 push_init_arg(yyvsp[-2].id,TRUE);
2943 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
2944 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2945 ccode_line, FALSE, NULL);
2947 g_free(yyvsp[-4].id);
2948 g_free(yyvsp[-2].id);
2949 g_string_free(yyvsp[0].cbuf,TRUE);
2950 yyerror(_("parse error "
2951 "(untyped blocks must be init or "
2958 #line 1599 "parse.y"
2960 g_free(onerror); onerror = NULL;
2961 g_free(defreturn); defreturn = NULL;
2962 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2963 g_free(yyvsp[-1].id);
2964 g_free(yyvsp[0].id);
2965 yyerror(_("parse error"));
2968 g_free(yyvsp[-1].id);
2972 #line 1610 "parse.y"
2974 g_free(onerror); onerror = NULL;
2975 g_free(defreturn); defreturn = NULL;
2976 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
2977 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2978 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2979 yyerror(_("parse error"));
2982 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2983 onerror = defreturn = NULL;
2984 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2985 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2986 yyerror(_("parse error"));
2989 g_free(yyvsp[-3].id);
2990 g_free(yyvsp[-1].id);
2994 #line 1629 "parse.y"
2996 g_free(onerror); onerror = NULL;
2997 g_free(defreturn); defreturn = NULL;
3001 #line 1635 "parse.y"
3002 { yyval.id = yyvsp[0].id; ;
3005 #line 1636 "parse.y"
3007 yyval.id = (yyvsp[1].cbuf)->str;
3008 g_string_free(yyvsp[1].cbuf, FALSE);
3012 #line 1642 "parse.y"
3013 { vararg = FALSE; has_self = FALSE; ;
3016 #line 1643 "parse.y"
3020 if(strcmp(yyvsp[0].id,"self")==0)
3021 push_self(yyvsp[0].id, FALSE);
3023 g_free(yyvsp[0].id);
3024 yyerror(_("parse error"));
3030 #line 1654 "parse.y"
3034 if(strcmp(yyvsp[-1].id,"self")==0)
3035 push_self(yyvsp[-1].id, TRUE);
3037 g_free(yyvsp[-1].id);
3038 yyerror(_("parse error"));
3044 #line 1665 "parse.y"
3048 if(strcmp(yyvsp[0].id,"self")==0)
3049 push_self(yyvsp[0].id, TRUE);
3051 g_free(yyvsp[0].id);
3052 yyerror(_("parse error"));
3058 #line 1676 "parse.y"
3061 if(strcmp(yyvsp[-2].id,"self")==0)
3062 push_self(yyvsp[-2].id, FALSE);
3064 g_free(yyvsp[-2].id);
3065 yyerror(_("parse error"));
3071 #line 1686 "parse.y"
3074 if(strcmp(yyvsp[-3].id,"self")==0)
3075 push_self(yyvsp[-3].id, TRUE);
3077 g_free(yyvsp[-3].id);
3078 yyerror(_("parse error"));
3084 #line 1696 "parse.y"
3087 if(strcmp(yyvsp[-2].id,"self")==0)
3088 push_self(yyvsp[-2].id, TRUE);
3090 g_free(yyvsp[-2].id);
3091 yyerror(_("parse error"));
3097 #line 1706 "parse.y"
3098 { has_self = FALSE; ;
3101 #line 1709 "parse.y"
3105 #line 1710 "parse.y"
3109 #line 1713 "parse.y"
3113 #line 1714 "parse.y"
3117 #line 1717 "parse.y"
3119 push_funcarg(yyvsp[0].id,NULL);
3123 #line 1720 "parse.y"
3125 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3129 #line 1723 "parse.y"
3131 if(strcmp(yyvsp[-2].id,"check")!=0) {
3132 yyerror(_("parse error"));
3135 g_free(yyvsp[-2].id);
3136 push_funcarg(yyvsp[-4].id,NULL);
3140 #line 1731 "parse.y"
3142 if(strcmp(yyvsp[-2].id,"check")!=0) {
3143 yyerror(_("parse error"));
3146 g_free(yyvsp[-2].id);
3147 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3151 #line 1741 "parse.y"
3155 #line 1742 "parse.y"
3159 #line 1745 "parse.y"
3161 if(strcmp(yyvsp[0].id,"type")==0) {
3162 Node *node = node_new (CHECK_NODE,
3163 "chtype", TYPE_CHECK,
3165 checks = g_list_append(checks,node);
3166 } else if(strcmp(yyvsp[0].id,"null")==0) {
3167 Node *node = node_new (CHECK_NODE,
3168 "chtype", NULL_CHECK,
3170 checks = g_list_append(checks,node);
3172 yyerror(_("parse error"));
3175 g_free(yyvsp[0].id);
3179 #line 1762 "parse.y"
3181 Node *node = node_new (CHECK_NODE,
3183 "number:steal", yyvsp[0].id,
3185 checks = g_list_append(checks,node);
3189 #line 1769 "parse.y"
3191 Node *node = node_new (CHECK_NODE,
3193 "number:steal", yyvsp[0].id,
3195 checks = g_list_append(checks,node);
3199 #line 1776 "parse.y"
3201 Node *node = node_new (CHECK_NODE,
3203 "number:steal", yyvsp[0].id,
3205 checks = g_list_append(checks,node);
3209 #line 1783 "parse.y"
3211 Node *node = node_new (CHECK_NODE,
3213 "number:steal", yyvsp[0].id,
3215 checks = g_list_append(checks,node);
3219 #line 1790 "parse.y"
3221 Node *node = node_new (CHECK_NODE,
3223 "number:steal", yyvsp[0].id,
3225 checks = g_list_append(checks,node);
3229 #line 1797 "parse.y"
3231 Node *node = node_new (CHECK_NODE,
3233 "number:steal", yyvsp[0].id,
3235 checks = g_list_append(checks,node);
3239 #line 1806 "parse.y"
3241 Node *node = node_new (ENUMDEF_NODE,
3242 "etype:steal", yyvsp[-1].id,
3243 "prefix:steal", yyvsp[-5].id,
3244 "values:steal", enum_vals,
3247 nodes = g_list_append (nodes, node);
3251 #line 1815 "parse.y"
3253 Node *node = node_new (ENUMDEF_NODE,
3254 "etype:steal", yyvsp[-1].id,
3255 "prefix:steal", yyvsp[-6].id,
3256 "values:steal", enum_vals,
3259 nodes = g_list_append (nodes, node);
3263 #line 1826 "parse.y"
3267 #line 1827 "parse.y"
3271 #line 1830 "parse.y"
3274 char *num = yyvsp[0].id;
3276 /* A float value, that's a bad enum */
3277 if (num[0] >= '0' &&
3279 strchr (num, '.') != NULL) {
3280 g_free (yyvsp[-2].id);
3282 yyerror(_("parse error (enumerator value not integer constant)"));
3286 node = node_new (ENUMVALUE_NODE,
3287 "name:steal", yyvsp[-2].id,
3290 enum_vals = g_list_append (enum_vals, node);
3294 #line 1850 "parse.y"
3298 node = node_new (ENUMVALUE_NODE,
3299 "name:steal", yyvsp[0].id,
3301 enum_vals = g_list_append (enum_vals, node);
3305 #line 1860 "parse.y"
3307 Node *node = node_new (FLAGS_NODE,
3308 "ftype:steal", yyvsp[-1].id,
3309 "prefix:steal", yyvsp[-5].id,
3310 "values:steal", flag_vals,
3313 nodes = g_list_append (nodes, node);
3317 #line 1869 "parse.y"
3319 Node *node = node_new (FLAGS_NODE,
3320 "ftype:steal", yyvsp[-1].id,
3321 "prefix:steal", yyvsp[-6].id,
3322 "values:steal", flag_vals,
3325 nodes = g_list_append (nodes, node);
3329 #line 1880 "parse.y"
3331 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3335 #line 1883 "parse.y"
3337 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3341 #line 1888 "parse.y"
3343 Node *node = node_new (ERROR_NODE,
3344 "etype:steal", yyvsp[-1].id,
3345 "prefix:steal", yyvsp[-5].id,
3346 "values:steal", error_vals,
3349 nodes = g_list_append (nodes, node);
3353 #line 1897 "parse.y"
3355 Node *node = node_new (ERROR_NODE,
3356 "etype:steal", yyvsp[-1].id,
3357 "prefix:steal", yyvsp[-6].id,
3358 "values:steal", error_vals,
3361 nodes = g_list_append (nodes, node);
3365 #line 1908 "parse.y"
3367 error_vals = g_list_append (error_vals, yyvsp[0].id);
3371 #line 1911 "parse.y"
3373 error_vals = g_list_append (error_vals, yyvsp[0].id);
3377 #line 1917 "parse.y"
3378 { yyval.id = yyvsp[0].id; ;
3381 #line 1918 "parse.y"
3383 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3384 g_free(yyvsp[0].id);
3388 #line 1922 "parse.y"
3389 { yyval.id = yyvsp[0].id; ;
3392 #line 1923 "parse.y"
3393 { yyval.id = yyvsp[0].id; ;
3396 /* the action file gets copied in in place of this dollarsign */
3397 #line 543 "/usr/lib/bison.simple"
3408 short *ssp1 = yyss - 1;
3409 fprintf (stderr, "state stack now");
3410 while (ssp1 != yyssp)
3411 fprintf (stderr, " %d", *++ssp1);
3412 fprintf (stderr, "\n");
3422 yylsp->first_line = yylloc.first_line;
3423 yylsp->first_column = yylloc.first_column;
3424 yylsp->last_line = (yylsp-1)->last_line;
3425 yylsp->last_column = (yylsp-1)->last_column;
3430 yylsp->last_line = (yylsp+yylen-1)->last_line;
3431 yylsp->last_column = (yylsp+yylen-1)->last_column;
3435 /* Now "shift" the result of the reduction.
3436 Determine what state that goes to,
3437 based on the state we popped back to
3438 and the rule number reduced by. */
3442 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3443 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3444 yystate = yytable[yystate];
3446 yystate = yydefgoto[yyn - YYNTBASE];
3450 yyerrlab: /* here on detecting error */
3453 /* If not already recovering from an error, report this error. */
3457 #ifdef YYERROR_VERBOSE
3458 yyn = yypact[yystate];
3460 if (yyn > YYFLAG && yyn < YYLAST)
3467 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3468 for (x = (yyn < 0 ? -yyn : 0);
3469 x < (sizeof(yytname) / sizeof(char *)); x++)
3470 if (yycheck[x + yyn] == x)
3471 size += strlen(yytname[x]) + 15, count++;
3472 msg = (char *) malloc(size + 15);
3475 strcpy(msg, "parse error");
3480 for (x = (yyn < 0 ? -yyn : 0);
3481 x < (sizeof(yytname) / sizeof(char *)); x++)
3482 if (yycheck[x + yyn] == x)
3484 strcat(msg, count == 0 ? ", expecting `" : " or `");
3485 strcat(msg, yytname[x]);
3494 yyerror ("parse error; also virtual memory exceeded");
3497 #endif /* YYERROR_VERBOSE */
3498 yyerror("parse error");
3502 yyerrlab1: /* here on error raised explicitly by an action */
3504 if (yyerrstatus == 3)
3506 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3508 /* return failure if at end of input */
3509 if (yychar == YYEOF)
3514 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3520 /* Else will try to reuse lookahead token
3521 after shifting the error token. */
3523 yyerrstatus = 3; /* Each real token shifted decrements this */
3527 yyerrdefault: /* current state does not do anything special for the error token. */
3530 /* This is wrong; only states that explicitly want error tokens
3531 should shift them. */
3532 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3533 if (yyn) goto yydefault;
3536 yyerrpop: /* pop the current state because it cannot handle the error token */
3538 if (yyssp == yyss) YYABORT;
3548 short *ssp1 = yyss - 1;
3549 fprintf (stderr, "Error: state stack now");
3550 while (ssp1 != yyssp)
3551 fprintf (stderr, " %d", *++ssp1);
3552 fprintf (stderr, "\n");
3558 yyn = yypact[yystate];
3563 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3582 fprintf(stderr, "Shifting error token, ");
3594 /* YYACCEPT comes here. */
3606 /* YYABORT comes here. */
3617 #line 1926 "parse.y"