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 get_prop_enum_flag_cast (Property *prop)
482 if (prop->extra_gtktype == NULL ||
483 /* HACK! just in case someone made this
484 * work with 2.0.0 by using the TYPE
486 ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
487 strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
488 strchr (prop->extra_gtktype, ':') == NULL)) {
489 if (prop->ptype != NULL)
490 return get_type (prop->ptype, TRUE);
492 return g_strdup ("");
494 tmp = remove_sep (prop->extra_gtktype);
495 ret = g_strdup_printf ("(%s) ", tmp);
501 property_link_and_export (Node *node)
503 Property *prop = (Property *)node;
507 char *get = NULL, *set = NULL;
510 if (prop->set != NULL ||
512 error_print (GOB_ERROR, prop->line_no,
513 _("Property linking requested, but "
514 "getters and setters exist"));
517 var = find_var_or_die (prop->name, prop->line_no);
518 if(var->scope == PRIVATE_SCOPE) {
519 root = "self->_priv";
520 } else if (var->scope == CLASS_SCOPE) {
521 root = "SELF_GET_CLASS(self)";
523 error_print (GOB_ERROR, prop->line_no,
524 _("Self aliases needed when autolinking to a classwide member"));
529 if (strcmp (prop->gtktype, "STRING") == 0) {
530 set = g_strdup_printf("{ char *old = %s->%s; "
531 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
534 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
536 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
538 if (prop->extra_gtktype != NULL) {
539 cast = remove_sep (prop->extra_gtktype);
543 set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
544 "%s->%s = (%s *)g_value_dup_object (VAL); "
545 "if (___old != NULL) { "
546 "g_object_unref (G_OBJECT (___old)); "
552 get = g_strdup_printf ("g_value_set_object (VAL, "
553 "(gpointer)%s->%s);",
556 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
557 if (prop->extra_gtktype == NULL) {
558 error_print (GOB_ERROR, prop->line_no,
559 _("Property linking requested for BOXED, but "
560 "boxed_type not set"));
562 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
563 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
564 "if (___new != ___old) { "
565 "if (___old != NULL) g_boxed_free (%s, ___old); "
566 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
567 "else %s->%s = NULL;"
575 get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
580 const char *getcast = "";
581 const char *setcast = "";
582 char *to_free = NULL;
583 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
584 g_strdown (set_func);
585 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
586 g_strdown (get_func);
588 if (strcmp (prop->gtktype, "FLAGS") == 0) {
589 setcast = "(guint) ";
591 get_prop_enum_flag_cast (prop);
592 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
595 get_prop_enum_flag_cast (prop);
598 set = g_strdup_printf("%s->%s = %s%s (VAL);",
602 get = g_strdup_printf("%s (VAL, %s%s->%s);",
614 "get_line", prop->line_no,
616 "set_line", prop->line_no,
621 export_accessors (prop->name,
622 prop->get != NULL, prop->get_line,
623 prop->set != NULL, prop->set_line,
634 if (strcmp (s, "BOOL") == 0) {
635 error_print (GOB_WARN, line_no,
636 _("BOOL type is deprecated, please use BOOLEAN"));
638 return g_strdup ("BOOLEAN");
645 ensure_property (void)
647 if (property == NULL)
648 property = (Property *)node_new (PROPERTY_NODE, NULL);
675 #define YYFLAG -32768
678 #define YYTRANSLATE(x) ((unsigned)(x) <= 306 ? yytranslate[x] : 118)
680 static const char yytranslate[] = { 0,
681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 64, 2, 2, 2, 2, 2, 2, 55,
685 56, 61, 2, 59, 65, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 57, 63,
687 58, 62, 2, 2, 2, 2, 2, 2, 2, 2,
688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
693 2, 2, 53, 60, 54, 2, 2, 2, 2, 2,
694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
704 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
707 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
708 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
709 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
710 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
711 47, 48, 49, 50, 51, 52
715 static const short yyprhs[] = { 0,
716 0, 4, 7, 10, 12, 14, 16, 18, 20, 22,
717 24, 27, 30, 33, 36, 38, 40, 42, 44, 49,
718 53, 59, 60, 66, 72, 78, 81, 83, 85, 88,
719 92, 94, 96, 98, 100, 102, 104, 106, 108, 111,
720 115, 118, 122, 125, 128, 130, 132, 133, 139, 146,
721 159, 169, 176, 180, 181, 193, 202, 208, 212, 213,
722 217, 219, 221, 226, 228, 230, 234, 238, 242, 246,
723 250, 254, 258, 262, 266, 270, 274, 278, 282, 286,
724 290, 294, 298, 300, 306, 308, 312, 313, 317, 319,
725 322, 324, 326, 328, 331, 334, 337, 341, 345, 348,
726 351, 354, 356, 359, 361, 364, 366, 368, 370, 372,
727 374, 376, 378, 380, 382, 384, 386, 388, 390, 393,
728 396, 400, 403, 405, 409, 413, 416, 418, 423, 427,
729 429, 432, 434, 445, 457, 467, 477, 486, 498, 507,
730 513, 516, 521, 522, 524, 527, 529, 531, 534, 537,
731 541, 546, 551, 553, 557, 559, 563, 565, 568, 572,
732 579, 587, 590, 592, 594, 597, 600, 604, 608, 612,
733 616, 624, 633, 637, 639, 643, 645, 653, 662, 666,
734 668, 676, 685, 689, 691, 693, 696, 698
737 static const short yyrhs[] = { 68,
738 69, 68, 0, 69, 68, 0, 68, 69, 0, 69,
739 0, 24, 0, 27, 0, 25, 0, 26, 0, 28,
740 0, 29, 0, 68, 67, 0, 68, 110, 0, 68,
741 113, 0, 68, 115, 0, 67, 0, 110, 0, 113,
742 0, 115, 0, 70, 53, 72, 54, 0, 70, 53,
743 54, 0, 3, 21, 4, 21, 71, 0, 0, 55,
744 19, 19, 56, 71, 0, 55, 19, 21, 56, 71,
745 0, 55, 19, 20, 56, 71, 0, 72, 73, 0,
746 73, 0, 101, 0, 19, 101, 0, 19, 21, 101,
747 0, 78, 0, 79, 0, 81, 0, 57, 0, 31,
748 0, 32, 0, 33, 0, 34, 0, 19, 19, 0,
749 19, 53, 24, 0, 58, 117, 0, 58, 53, 24,
750 0, 75, 76, 0, 76, 75, 0, 76, 0, 75,
751 0, 0, 74, 90, 19, 77, 57, 0, 74, 90,
752 19, 22, 77, 57, 0, 36, 88, 87, 19, 80,
753 19, 53, 24, 19, 53, 24, 57, 0, 36, 88,
754 87, 19, 80, 19, 53, 24, 57, 0, 36, 88,
755 87, 19, 80, 19, 0, 55, 19, 56, 0, 0,
756 35, 19, 19, 82, 19, 53, 24, 19, 53, 24,
757 57, 0, 35, 19, 19, 82, 19, 53, 24, 57,
758 0, 35, 19, 19, 82, 57, 0, 55, 83, 56,
759 0, 0, 83, 59, 86, 0, 86, 0, 30, 0,
760 19, 55, 30, 56, 0, 117, 0, 84, 0, 40,
761 58, 84, 0, 41, 58, 84, 0, 42, 58, 117,
762 0, 43, 58, 117, 0, 44, 58, 85, 0, 46,
763 58, 89, 0, 47, 58, 90, 0, 48, 58, 21,
764 0, 48, 58, 19, 0, 49, 58, 21, 0, 49,
765 58, 19, 0, 50, 58, 21, 0, 50, 58, 19,
766 0, 51, 58, 21, 0, 51, 58, 19, 0, 52,
767 58, 21, 0, 52, 58, 19, 0, 19, 0, 19,
768 55, 19, 90, 56, 0, 19, 0, 55, 89, 56,
769 0, 0, 19, 60, 89, 0, 19, 0, 91, 95,
770 0, 91, 0, 92, 0, 19, 0, 5, 19, 0,
771 19, 5, 0, 94, 19, 0, 5, 94, 19, 0,
772 94, 19, 5, 0, 93, 92, 0, 21, 92, 0,
773 5, 92, 0, 21, 0, 21, 5, 0, 93, 0,
774 93, 5, 0, 6, 0, 18, 0, 14, 0, 15,
775 0, 13, 0, 16, 0, 17, 0, 11, 0, 12,
776 0, 7, 0, 8, 0, 9, 0, 61, 0, 61,
777 5, 0, 61, 95, 0, 61, 5, 95, 0, 19,
778 98, 0, 98, 0, 74, 19, 98, 0, 19, 74,
779 98, 0, 74, 98, 0, 96, 0, 19, 55, 99,
780 56, 0, 99, 59, 19, 0, 19, 0, 53, 24,
781 0, 57, 0, 38, 88, 97, 90, 19, 55, 104,
782 56, 102, 100, 0, 74, 38, 88, 96, 90, 19,
783 55, 104, 56, 102, 100, 0, 37, 74, 90, 19,
784 55, 104, 56, 102, 100, 0, 74, 37, 90, 19,
785 55, 104, 56, 102, 100, 0, 37, 90, 19, 55,
786 104, 56, 102, 100, 0, 39, 55, 21, 56, 90,
787 19, 55, 104, 56, 102, 100, 0, 74, 90, 19,
788 55, 104, 56, 102, 100, 0, 19, 55, 19, 56,
789 100, 0, 19, 103, 0, 19, 103, 19, 103, 0,
790 0, 117, 0, 53, 24, 0, 6, 0, 19, 0,
791 19, 5, 0, 5, 19, 0, 19, 59, 105, 0,
792 19, 5, 59, 105, 0, 5, 19, 59, 105, 0,
793 105, 0, 106, 59, 10, 0, 106, 0, 106, 59,
794 107, 0, 107, 0, 90, 19, 0, 90, 19, 22,
795 0, 90, 19, 55, 19, 108, 56, 0, 90, 19,
796 22, 55, 19, 108, 56, 0, 108, 109, 0, 109,
797 0, 19, 0, 62, 117, 0, 63, 117, 0, 62,
798 58, 117, 0, 63, 58, 117, 0, 58, 58, 117,
799 0, 64, 58, 117, 0, 9, 19, 53, 111, 54,
800 21, 57, 0, 9, 19, 53, 111, 59, 54, 21,
801 57, 0, 111, 59, 112, 0, 112, 0, 19, 58,
802 117, 0, 19, 0, 46, 19, 53, 114, 54, 21,
803 57, 0, 46, 19, 53, 114, 59, 54, 21, 57,
804 0, 114, 59, 19, 0, 19, 0, 45, 19, 53,
805 116, 54, 21, 57, 0, 45, 19, 53, 116, 59,
806 54, 21, 57, 0, 116, 59, 19, 0, 19, 0,
807 20, 0, 65, 20, 0, 23, 0, 19, 0
813 static const short yyrline[] = { 0,
814 637, 638, 639, 640, 643, 652, 661, 670, 679, 688,
815 699, 700, 701, 702, 703, 704, 705, 706, 709, 714,
816 721, 735, 736, 748, 757, 771, 772, 775, 776, 785,
817 797, 798, 799, 800, 803, 804, 805, 806, 809, 829,
818 853, 857, 865, 866, 867, 868, 869, 875, 878, 883,
819 951, 1005, 1093, 1101, 1106, 1154, 1190, 1206, 1207, 1210,
820 1211, 1214, 1215, 1227, 1228, 1231, 1237, 1243, 1249, 1255,
821 1261, 1267, 1274, 1280, 1286, 1292, 1298, 1304, 1310, 1316,
822 1322, 1328, 1334, 1354, 1363, 1369, 1370, 1373, 1376, 1382,
823 1389, 1398, 1401, 1404, 1408, 1412, 1416, 1421, 1429, 1433,
824 1438, 1442, 1445, 1449, 1452, 1457, 1458, 1459, 1460, 1461,
825 1462, 1463, 1464, 1465, 1468, 1469, 1470, 1473, 1474, 1475,
826 1479, 1486, 1498, 1504, 1516, 1528, 1531, 1537, 1542, 1545,
827 1550, 1551, 1555, 1571, 1587, 1603, 1619, 1630, 1636, 1646,
828 1669, 1680, 1699, 1705, 1706, 1712, 1713, 1724, 1735, 1746,
829 1756, 1766, 1776, 1779, 1780, 1783, 1784, 1787, 1790, 1793,
830 1801, 1811, 1812, 1815, 1832, 1839, 1846, 1853, 1860, 1867,
831 1876, 1885, 1896, 1897, 1900, 1920, 1930, 1939, 1950, 1953,
832 1958, 1967, 1978, 1981, 1987, 1988, 1992, 1993
837 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
839 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
840 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
841 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","TOKEN","NUMBER","TYPETOKEN","ARRAY_DIM",
842 "SINGLE_CHAR","CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","STRING","PUBLIC",
843 "PRIVATE","PROTECTED","CLASSWIDE","PROPERTY","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE",
844 "NICK","BLURB","MAXIMUM","MINIMUM","DEFAULT_VALUE","ERROR","FLAGS","TYPE","FLAGS_TYPE",
845 "ENUM_TYPE","PARAM_TYPE","BOXED_TYPE","OBJECT_TYPE","'{'","'}'","'('","')'",
846 "';'","'='","','","'|'","'*'","'>'","'<'","'!'","'-'","prog","ccode","ccodes",
847 "class","classdec","classflags","classcode","thing","scope","destructor","initializer",
848 "varoptions","variable","argument","export","property","param_spec","param_spec_list",
849 "string","anyval","param_spec_value","argtype","flags","flaglist","type","specifier_list",
850 "spec_list","specifier","strunionenum","pointer","simplesigtype","fullsigtype",
851 "sigtype","tokenlist","codenocode","method","returnvals","retcode","funcargs",
852 "arglist","arglist1","arg","checklist","check","enumcode","enumvals","enumval",
853 "flagcode","flagvals","errorcode","errorvals","numtok", NULL
857 static const short yyr1[] = { 0,
858 66, 66, 66, 66, 67, 67, 67, 67, 67, 67,
859 68, 68, 68, 68, 68, 68, 68, 68, 69, 69,
860 70, 71, 71, 71, 71, 72, 72, 73, 73, 73,
861 73, 73, 73, 73, 74, 74, 74, 74, 75, 75,
862 76, 76, 77, 77, 77, 77, 77, 78, 78, 79,
863 79, 79, 80, 80, 81, 81, 81, 82, 82, 83,
864 83, 84, 84, 85, 85, 86, 86, 86, 86, 86,
865 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
866 86, 86, 86, 87, 87, 88, 88, 89, 89, 90,
867 90, 91, 91, 91, 91, 91, 91, 91, 92, 92,
868 92, 92, 92, 92, 92, 93, 93, 93, 93, 93,
869 93, 93, 93, 93, 94, 94, 94, 95, 95, 95,
870 95, 96, 96, 97, 97, 97, 97, 98, 99, 99,
871 100, 100, 101, 101, 101, 101, 101, 101, 101, 101,
872 102, 102, 102, 103, 103, 104, 104, 104, 104, 104,
873 104, 104, 104, 105, 105, 106, 106, 107, 107, 107,
874 107, 108, 108, 109, 109, 109, 109, 109, 109, 109,
875 110, 110, 111, 111, 112, 112, 113, 113, 114, 114,
876 115, 115, 116, 116, 117, 117, 117, 117
879 static const short yyr2[] = { 0,
880 3, 2, 2, 1, 1, 1, 1, 1, 1, 1,
881 2, 2, 2, 2, 1, 1, 1, 1, 4, 3,
882 5, 0, 5, 5, 5, 2, 1, 1, 2, 3,
883 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
884 2, 3, 2, 2, 1, 1, 0, 5, 6, 12,
885 9, 6, 3, 0, 11, 8, 5, 3, 0, 3,
886 1, 1, 4, 1, 1, 3, 3, 3, 3, 3,
887 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
888 3, 3, 1, 5, 1, 3, 0, 3, 1, 2,
889 1, 1, 1, 2, 2, 2, 3, 3, 2, 2,
890 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
891 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
892 3, 2, 1, 3, 3, 2, 1, 4, 3, 1,
893 2, 1, 10, 11, 9, 9, 8, 11, 8, 5,
894 2, 4, 0, 1, 2, 1, 1, 2, 2, 3,
895 4, 4, 1, 3, 1, 3, 1, 2, 3, 6,
896 7, 2, 1, 1, 2, 2, 3, 3, 3, 3,
897 7, 8, 3, 1, 3, 1, 7, 8, 3, 1,
898 7, 8, 3, 1, 1, 2, 1, 1
901 static const short yydefact[] = { 0,
902 0, 0, 5, 7, 8, 6, 9, 10, 0, 0,
903 15, 0, 4, 0, 16, 17, 18, 0, 0, 0,
904 0, 11, 3, 12, 13, 14, 2, 0, 0, 0,
905 0, 0, 1, 0, 35, 36, 37, 38, 0, 87,
906 0, 87, 0, 20, 34, 0, 27, 0, 31, 32,
907 33, 28, 22, 176, 0, 174, 184, 0, 180, 0,
908 0, 0, 0, 0, 29, 0, 0, 0, 0, 106,
909 115, 116, 117, 113, 114, 110, 108, 109, 111, 112,
910 107, 93, 102, 0, 0, 91, 92, 104, 0, 0,
911 0, 19, 26, 0, 87, 0, 0, 21, 0, 0,
912 0, 0, 0, 0, 0, 30, 0, 0, 59, 89,
913 0, 85, 0, 0, 94, 101, 0, 95, 103, 100,
914 0, 0, 118, 90, 105, 99, 96, 0, 0, 127,
915 0, 123, 0, 0, 0, 47, 0, 188, 185, 187,
916 0, 175, 0, 0, 173, 0, 183, 0, 0, 179,
917 0, 0, 0, 0, 0, 0, 86, 0, 54, 97,
918 0, 0, 119, 120, 98, 0, 0, 0, 122, 0,
919 126, 0, 0, 0, 0, 0, 0, 47, 0, 0,
920 46, 45, 0, 0, 0, 0, 186, 171, 0, 181,
921 0, 177, 0, 0, 132, 140, 83, 0, 0, 0,
922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
923 61, 0, 57, 88, 0, 0, 0, 0, 0, 106,
924 93, 0, 0, 153, 155, 157, 121, 130, 0, 125,
925 124, 0, 0, 0, 0, 39, 0, 0, 0, 0,
926 41, 43, 44, 48, 22, 22, 22, 172, 182, 178,
927 131, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928 0, 0, 0, 58, 0, 0, 0, 0, 52, 0,
929 94, 95, 0, 158, 143, 0, 128, 0, 0, 0,
930 0, 0, 40, 49, 143, 42, 23, 25, 24, 0,
931 62, 66, 67, 68, 69, 188, 65, 70, 64, 71,
932 72, 74, 73, 76, 75, 78, 77, 80, 79, 82,
933 81, 60, 0, 84, 53, 0, 143, 0, 0, 150,
934 159, 0, 0, 0, 154, 156, 129, 0, 0, 143,
935 0, 0, 0, 0, 56, 0, 0, 152, 151, 0,
936 0, 0, 141, 144, 137, 143, 0, 0, 0, 139,
937 0, 0, 0, 51, 135, 0, 164, 0, 0, 0,
938 0, 0, 163, 145, 0, 0, 143, 136, 143, 63,
939 0, 0, 0, 0, 0, 165, 0, 166, 0, 160,
940 162, 142, 133, 0, 0, 55, 0, 161, 169, 167,
941 168, 170, 138, 134, 50, 0, 0, 0
944 static const short yydefgoto[] = { 396,
945 11, 12, 13, 14, 98, 46, 47, 48, 181, 182,
946 183, 49, 50, 217, 51, 155, 210, 292, 298, 211,
947 113, 68, 111, 222, 86, 87, 88, 89, 124, 130,
948 131, 132, 229, 196, 52, 324, 343, 223, 224, 225,
949 226, 362, 363, 15, 55, 56, 16, 60, 17, 58,
953 static const short yypact[] = { 137,
954 16, 24,-32768,-32768,-32768,-32768,-32768,-32768, 45, 99,
955 -32768, 137, 170, 72,-32768,-32768,-32768, 106, 73, 81,
956 98,-32768, 170,-32768,-32768,-32768, 170, 154, 111, 151,
957 183, 186, 170, 215,-32768,-32768,-32768,-32768, 187, 158,
958 310, 158, 182,-32768,-32768, 188,-32768, 276,-32768,-32768,
959 -32768,-32768, 195, 210, 69,-32768,-32768, 113,-32768, 115,
960 214, 301, 190, 276,-32768, 248, 252, 254, 357,-32768,
961 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
962 -32768, 269, 425, 374, 267, 235,-32768, 439, 284, 444,
963 290,-32768,-32768, 374, 158, 293, 311,-32768, 74, 315,
964 76, 316, 84, 339, 90,-32768, 321, 348, 329, 334,
965 345, 356, 399, 453,-32768,-32768, 409,-32768, 453,-32768,
966 413, 378, 2,-32768, 453,-32768, 429, 224, 416,-32768,
967 374,-32768, 392, 428, 430, 126, 220,-32768,-32768,-32768,
968 441,-32768, 405, 451,-32768, 422,-32768, 452, 423,-32768,
969 460, -32, 427, 258, 21, 252,-32768, 464, 431,-32768,
970 432, 391, 235,-32768,-32768, 433, 465, 466,-32768, -6,
971 -32768, 470, 374, 435, -6, 374, 26, 0, 391, 7,
972 434, 472, 436, 438, 440, 442,-32768,-32768, 443,-32768,
973 445,-32768, 446, 471,-32768,-32768,-32768, 447, 448, 449,
974 450, 454, 455, 456, 457, 458, 459, 461, 462, 91,
975 -32768, 468,-32768,-32768, 374, 478, 480, 391, 408, 467,
976 6, 482, 469,-32768, 463,-32768,-32768,-32768, 112,-32768,
977 -32768, 473, 485, 391, 490,-32768, 486, 474, 476, 487,
978 -32768,-32768,-32768,-32768, 195, 195, 195,-32768,-32768,-32768,
979 -32768, 1, 1, 74, 74, 9, 252, 374, 139, 157,
980 191, 209, 212,-32768, 258, 494, 477, 479, 481, 483,
981 121, 144, 374, 94, 505, 340,-32768, 507, 391, 475,
982 484, 488,-32768,-32768, 505,-32768,-32768,-32768,-32768, 489,
983 -32768,-32768,-32768,-32768,-32768, 489,-32768,-32768,-32768,-32768,
984 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
985 -32768,-32768, 47,-32768,-32768, 503, 505, 374, 374,-32768,
986 491, 510, 27, -32,-32768,-32768,-32768, 492, 391, 505,
987 391, -32, 506, 496,-32768, 54, -32,-32768,-32768, 518,
988 57, 514, 522,-32768,-32768, 505, 495, -32, 497,-32768,
989 498, 521, 499,-32768,-32768, 57,-32768, 500, 64, 66,
990 501, 50,-32768,-32768, 27, -32, 505,-32768, 505,-32768,
991 493, 523, 79, 74, 74,-32768, 74,-32768, 74,-32768,
992 -32768,-32768,-32768, -32, -32,-32768, 504,-32768,-32768,-32768,
993 -32768,-32768,-32768,-32768,-32768, 542, 555,-32768
996 static const short yypgoto[] = {-32768,
997 202, 104, 544,-32768, 17,-32768, 511, -29, 380, 379,
998 385,-32768,-32768,-32768,-32768,-32768,-32768, -52,-32768, 299,
999 -32768, -27, -152, -40,-32768, -66,-32768, -60, -107, 437,
1000 -32768, -93,-32768, -314, -20, -279, 200, -177, -218,-32768,
1001 291, 213, -266, 205,-32768, 502, 232,-32768, 239,-32768,
1009 static const short yytable[] = { 142,
1010 85, 239, 116, 214, 64, 332, 163, 96, 117, 345,
1011 272, 84, 166, 65, 90, 164, 120, 350, 177, 290,
1012 194, 126, 355, 108, 195, 138, 139, 296, 139, 140,
1013 291, 140, 64, 368, 169, 171, 18, 337, 291, 212,
1014 270, 106, 19, 121, 236, 138, 139, 116, 167, 140,
1015 348, 383, 116, 134, 320, 227, 281, 180, 116, 240,
1016 129, -147, 123, 20, 273, 334, 366, 135, 357, 393,
1017 394, 141, 353, 141, 230, 357, 231, 213, 237, 342,
1018 241, 169, 138, 139, 138, 139, 140, 384, 140, 385,
1019 172, 141, 138, 139, 54, 381, 140, 357, 168, 338,
1020 339, 328, 147, 335, 300, 380, 381, 358, 150, 29,
1021 354, 359, 360, 361, 358, 321, 27, 21, 359, 360,
1022 361, 375, 100, 377, 28, 30, 33, 101, 141, 144,
1023 141, 53, 233, 31, 388, 235, 358, 148, 141, 1,
1024 359, 360, 361, 151, 177, 2, 264, 178, 322, 265,
1025 32, 347, 116, 349, 294, 295, 299, 302, 117, 303,
1026 3, 4, 5, 6, 7, 8, 102, 277, 104, 54,
1027 278, 103, 34, 105, 267, 304, -149, 305, 2, 318,
1028 179, 9, 10, 180, 35, 36, 37, 38, 39, 40,
1029 41, 42, 43, 3, 4, 5, 6, 7, 8, -148,
1030 293, 57, 319, 297, 59, 66, 34, 44, 107, 306,
1031 45, 307, 67, 22, 9, 10, 24, 301, 35, 36,
1032 37, 38, 39, 40, 41, 42, 43, 308, 22, 309,
1033 310, 24, 311, 61, 22, 62, 91, 24, 184, 185,
1034 186, 92, 166, 25, 45, 35, 36, 37, 38, 97,
1035 26, 41, 42, 43, 35, 36, 37, 38, 25, 376,
1036 378, 287, 288, 289, 25, 26, 109, 99, 63, 63,
1037 110, 26, 112, 118, 389, 390, 197, 391, 167, 392,
1038 69, 70, 71, 72, 73, 122, 74, 75, 76, 77,
1039 78, 79, 80, 81, 82, 123, 83, 198, 199, 200,
1040 201, 202, 127, 203, 204, 205, 206, 207, 208, 209,
1041 133, 136, 94, 95, 69, 70, 71, 72, 73, 61,
1042 74, 75, 76, 77, 78, 79, 80, 81, 82, 137,
1043 83, 35, 36, 37, 38, 143, 146, 41, 42, 43,
1044 35, 36, 37, 38, 69, 70, 71, 72, 73, 325,
1045 74, 75, 76, 77, 78, 79, 80, 81, 82, 149,
1046 83, 114, 70, 71, 72, 73, 153, 74, 75, 76,
1047 77, 78, 79, 80, 81, 115, 152, 83, 69, 70,
1048 71, 72, 73, 154, 74, 75, 76, 77, 78, 79,
1049 80, 81, 82, 156, 83, 219, 220, 71, 72, 73,
1050 157, 74, 75, 76, 77, 78, 79, 80, 81, 221,
1051 158, 83, 114, 70, 71, 72, 73, 159, 74, 75,
1052 76, 77, 78, 79, 80, 81, 271, 160, 83, 119,
1053 70, 161, 162, 165, 170, 74, 75, 76, 77, 78,
1054 79, 80, 81, 125, 70, 83, 174, 173, 175, 74,
1055 75, 76, 77, 78, 79, 80, 81, 114, 70, 83,
1056 187, 188, 128, 74, 75, 76, 77, 78, 79, 80,
1057 81, 189, 191, 83, 35, 36, 37, 38, 190, 192,
1058 193, 179, 215, 228, 166, 216, 218, 167, 232, 234,
1059 177, 180, 244, 245, 251, 246, 268, 247, 269, 248,
1060 274, 249, 250, 280, 252, 253, 254, 255, 282, 283,
1061 286, 256, 257, 258, 259, 260, 261, 313, 262, 263,
1062 266, 276, -146, 323, 275, 327, 336, 279, 341, 329,
1063 284, 285, 314, 316, 315, 351, 356, 364, 317, 330,
1064 365, 397, 331, 333, 371, 340, 387, 346, 352, 386,
1065 367, 372, 369, 370, 398, 23, 93, 374, 379, 242,
1066 395, 243, 238, 312, 382, 0, 326, 0, 373, 0,
1067 0, 176, 0, 0, 0, 0, 0, 0, 0, 0,
1068 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1069 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1073 static const short yycheck[] = { 99,
1074 41, 179, 69, 156, 34, 285, 5, 48, 69, 324,
1075 5, 41, 19, 34, 42, 123, 83, 332, 19, 19,
1076 53, 88, 337, 64, 57, 19, 20, 19, 20, 23,
1077 30, 23, 62, 348, 128, 129, 21, 317, 30, 19,
1078 218, 62, 19, 84, 19, 19, 20, 114, 55, 23,
1079 330, 366, 119, 94, 273, 163, 234, 58, 125, 53,
1080 90, 56, 61, 19, 59, 19, 346, 95, 19, 384,
1081 385, 65, 19, 65, 168, 19, 170, 57, 53, 53,
1082 180, 175, 19, 20, 19, 20, 23, 367, 23, 369,
1083 131, 65, 19, 20, 19, 362, 23, 19, 128, 318,
1084 319, 279, 19, 57, 257, 56, 373, 58, 19, 4,
1085 57, 62, 63, 64, 58, 22, 13, 19, 62, 63,
1086 64, 58, 54, 58, 53, 53, 23, 59, 65, 54,
1087 65, 21, 173, 53, 56, 176, 58, 54, 65, 3,
1088 62, 63, 64, 54, 19, 9, 56, 22, 55, 59,
1089 53, 329, 219, 331, 254, 255, 256, 19, 219, 21,
1090 24, 25, 26, 27, 28, 29, 54, 56, 54, 19,
1091 59, 59, 19, 59, 215, 19, 56, 21, 9, 59,
1092 55, 45, 46, 58, 31, 32, 33, 34, 35, 36,
1093 37, 38, 39, 24, 25, 26, 27, 28, 29, 56,
1094 253, 19, 59, 256, 19, 19, 19, 54, 19, 19,
1095 57, 21, 55, 12, 45, 46, 12, 258, 31, 32,
1096 33, 34, 35, 36, 37, 38, 39, 19, 27, 21,
1097 19, 27, 21, 19, 33, 21, 55, 33, 19, 20,
1098 21, 54, 19, 12, 57, 31, 32, 33, 34, 55,
1099 12, 37, 38, 39, 31, 32, 33, 34, 27, 359,
1100 360, 245, 246, 247, 33, 27, 19, 58, 55, 55,
1101 19, 33, 19, 5, 374, 375, 19, 377, 55, 379,
1102 5, 6, 7, 8, 9, 19, 11, 12, 13, 14,
1103 15, 16, 17, 18, 19, 61, 21, 40, 41, 42,
1104 43, 44, 19, 46, 47, 48, 49, 50, 51, 52,
1105 21, 19, 37, 38, 5, 6, 7, 8, 9, 19,
1106 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
1107 21, 31, 32, 33, 34, 21, 21, 37, 38, 39,
1108 31, 32, 33, 34, 5, 6, 7, 8, 9, 10,
1109 11, 12, 13, 14, 15, 16, 17, 18, 19, 21,
1110 21, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1111 14, 15, 16, 17, 18, 19, 56, 21, 5, 6,
1112 7, 8, 9, 55, 11, 12, 13, 14, 15, 16,
1113 17, 18, 19, 60, 21, 5, 6, 7, 8, 9,
1114 56, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1115 55, 21, 5, 6, 7, 8, 9, 19, 11, 12,
1116 13, 14, 15, 16, 17, 18, 19, 19, 21, 5,
1117 6, 19, 55, 5, 19, 11, 12, 13, 14, 15,
1118 16, 17, 18, 5, 6, 21, 19, 56, 19, 11,
1119 12, 13, 14, 15, 16, 17, 18, 5, 6, 21,
1120 20, 57, 19, 11, 12, 13, 14, 15, 16, 17,
1121 18, 21, 21, 21, 31, 32, 33, 34, 57, 57,
1122 21, 55, 19, 19, 19, 55, 55, 55, 19, 55,
1123 19, 58, 57, 56, 24, 56, 19, 56, 19, 57,
1124 19, 57, 57, 19, 58, 58, 58, 58, 19, 24,
1125 24, 58, 58, 58, 58, 58, 58, 24, 58, 58,
1126 53, 59, 56, 19, 56, 19, 24, 55, 19, 55,
1127 57, 56, 56, 53, 56, 30, 19, 24, 56, 56,
1128 19, 0, 55, 55, 24, 55, 24, 56, 53, 57,
1129 56, 53, 56, 56, 0, 12, 46, 58, 58, 181,
1130 57, 182, 178, 265, 365, -1, 276, -1, 356, -1,
1131 -1, 135, -1, -1, -1, -1, -1, -1, -1, -1,
1132 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1133 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1136 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1137 #line 3 "/usr/lib/bison.simple"
1138 /* This file comes from bison-1.28. */
1140 /* Skeleton output parser for bison,
1141 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
1143 This program is free software; you can redistribute it and/or modify
1144 it under the terms of the GNU General Public License as published by
1145 the Free Software Foundation; either version 2, or (at your option)
1148 This program is distributed in the hope that it will be useful,
1149 but WITHOUT ANY WARRANTY; without even the implied warranty of
1150 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1151 GNU General Public License for more details.
1153 You should have received a copy of the GNU General Public License
1154 along with this program; if not, write to the Free Software
1155 Foundation, Inc., 59 Temple Place - Suite 330,
1156 Boston, MA 02111-1307, USA. */
1158 /* As a special exception, when this file is copied by Bison into a
1159 Bison output file, you may use that output file without restriction.
1160 This special exception was added by the Free Software Foundation
1161 in version 1.24 of Bison. */
1163 /* This is the parser code that is written into each bison parser
1164 when the %semantic_parser declaration is not specified in the grammar.
1165 It was written by Richard Stallman by simplifying the hairy parser
1166 used when %semantic_parser is specified. */
1168 #ifndef YYSTACK_USE_ALLOCA
1170 #define YYSTACK_USE_ALLOCA
1171 #else /* alloca not defined */
1173 #define YYSTACK_USE_ALLOCA
1174 #define alloca __builtin_alloca
1175 #else /* not GNU C. */
1176 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
1177 #define YYSTACK_USE_ALLOCA
1179 #else /* not sparc */
1180 /* We think this test detects Watcom and Microsoft C. */
1181 /* This used to test MSDOS, but that is a bad idea
1182 since that symbol is in the user namespace. */
1183 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
1184 #if 0 /* No need for malloc.h, which pollutes the namespace;
1185 instead, just don't use alloca. */
1188 #else /* not MSDOS, or __TURBOC__ */
1190 /* I don't know what this was needed for, but it pollutes the namespace.
1191 So I turned it off. rms, 2 May 1997. */
1192 /* #include <malloc.h> */
1194 #define YYSTACK_USE_ALLOCA
1195 #else /* not MSDOS, or __TURBOC__, or _AIX */
1197 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
1198 and on HPUX 10. Eventually we can turn this on. */
1199 #define YYSTACK_USE_ALLOCA
1200 #define alloca __builtin_alloca
1203 #endif /* not _AIX */
1204 #endif /* not MSDOS, or __TURBOC__ */
1205 #endif /* not sparc */
1206 #endif /* not GNU C */
1207 #endif /* alloca not defined */
1208 #endif /* YYSTACK_USE_ALLOCA not defined */
1210 #ifdef YYSTACK_USE_ALLOCA
1211 #define YYSTACK_ALLOC alloca
1213 #define YYSTACK_ALLOC malloc
1216 /* Note: there must be only one dollar sign in this file.
1217 It is replaced by the list of actions, each action
1218 as one case of the switch. */
1220 #define yyerrok (yyerrstatus = 0)
1221 #define yyclearin (yychar = YYEMPTY)
1224 #define YYACCEPT goto yyacceptlab
1225 #define YYABORT goto yyabortlab
1226 #define YYERROR goto yyerrlab1
1227 /* Like YYERROR except do call yyerror.
1228 This remains here temporarily to ease the
1229 transition to the new meaning of YYERROR, for GCC.
1230 Once GCC version 2 has supplanted version 1, this can go. */
1231 #define YYFAIL goto yyerrlab
1232 #define YYRECOVERING() (!!yyerrstatus)
1233 #define YYBACKUP(token, value) \
1235 if (yychar == YYEMPTY && yylen == 1) \
1236 { yychar = (token), yylval = (value); \
1237 yychar1 = YYTRANSLATE (yychar); \
1242 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1246 #define YYERRCODE 256
1249 #define YYLEX yylex()
1255 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1257 #define YYLEX yylex(&yylval, &yylloc)
1259 #else /* not YYLSP_NEEDED */
1261 #define YYLEX yylex(&yylval, YYLEX_PARAM)
1263 #define YYLEX yylex(&yylval)
1265 #endif /* not YYLSP_NEEDED */
1268 /* If nonreentrant, generate the variables here */
1272 int yychar; /* the lookahead symbol */
1273 YYSTYPE yylval; /* the semantic value of the */
1274 /* lookahead symbol */
1277 YYLTYPE yylloc; /* location data for the lookahead */
1281 int yynerrs; /* number of parse errors so far */
1282 #endif /* not YYPURE */
1285 int yydebug; /* nonzero means print parse trace */
1286 /* Since this is uninitialized, it does not stop multiple parsers
1290 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1293 #define YYINITDEPTH 200
1296 /* YYMAXDEPTH is the maximum size the stacks can grow to
1297 (effective only if the built-in stack extension method is used). */
1304 #define YYMAXDEPTH 10000
1307 /* Define __yy_memcpy. Note that the size argument
1308 should be passed with type unsigned int, because that is what the non-GCC
1309 definitions require. With GCC, __builtin_memcpy takes an arg
1310 of type size_t, but it can handle unsigned int. */
1312 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1313 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1314 #else /* not GNU C or C++ */
1317 /* This is the most reliable way to avoid incompatibilities
1318 in available built-in functions on various systems. */
1320 __yy_memcpy (to, from, count)
1325 register char *f = from;
1326 register char *t = to;
1327 register int i = count;
1333 #else /* __cplusplus */
1335 /* This is the most reliable way to avoid incompatibilities
1336 in available built-in functions on various systems. */
1338 __yy_memcpy (char *to, char *from, unsigned int count)
1340 register char *t = to;
1341 register char *f = from;
1342 register int i = count;
1351 #line 217 "/usr/lib/bison.simple"
1353 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1354 into yyparse. The argument should have type void *.
1355 It should actually point to an object.
1356 Grammar actions can access the variable by casting it
1357 to the proper pointer type. */
1359 #ifdef YYPARSE_PARAM
1361 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1362 #define YYPARSE_PARAM_DECL
1363 #else /* not __cplusplus */
1364 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1365 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1366 #endif /* not __cplusplus */
1367 #else /* not YYPARSE_PARAM */
1368 #define YYPARSE_PARAM_ARG
1369 #define YYPARSE_PARAM_DECL
1370 #endif /* not YYPARSE_PARAM */
1372 /* Prevent warning if -Wstrict-prototypes. */
1374 #ifdef YYPARSE_PARAM
1375 int yyparse (void *);
1382 yyparse(YYPARSE_PARAM_ARG)
1385 register int yystate;
1387 register short *yyssp;
1388 register YYSTYPE *yyvsp;
1389 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1390 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1392 short yyssa[YYINITDEPTH]; /* the state stack */
1393 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1395 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1396 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1399 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1400 YYLTYPE *yyls = yylsa;
1403 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1405 #define YYPOPSTACK (yyvsp--, yyssp--)
1408 int yystacksize = YYINITDEPTH;
1409 int yyfree_stacks = 0;
1420 YYSTYPE yyval; /* the variable used to return */
1421 /* semantic values from the action */
1428 fprintf(stderr, "Starting parse\n");
1434 yychar = YYEMPTY; /* Cause a token to be read. */
1436 /* Initialize stack pointers.
1437 Waste one element of value and location stack
1438 so that they stay on the same level as the state stack.
1439 The wasted elements are never initialized. */
1447 /* Push a new state, which is found in yystate . */
1448 /* In all cases, when you get here, the value and location stacks
1449 have just been pushed. so pushing a state here evens the stacks. */
1454 if (yyssp >= yyss + yystacksize - 1)
1456 /* Give user a chance to reallocate the stack */
1457 /* Use copies of these so that the &'s don't force the real ones into memory. */
1458 YYSTYPE *yyvs1 = yyvs;
1459 short *yyss1 = yyss;
1461 YYLTYPE *yyls1 = yyls;
1464 /* Get the current used size of the three stacks, in elements. */
1465 int size = yyssp - yyss + 1;
1468 /* Each stack pointer address is followed by the size of
1469 the data in use in that stack, in bytes. */
1471 /* This used to be a conditional around just the two extra args,
1472 but that might be undefined if yyoverflow is a macro. */
1473 yyoverflow("parser stack overflow",
1474 &yyss1, size * sizeof (*yyssp),
1475 &yyvs1, size * sizeof (*yyvsp),
1476 &yyls1, size * sizeof (*yylsp),
1479 yyoverflow("parser stack overflow",
1480 &yyss1, size * sizeof (*yyssp),
1481 &yyvs1, size * sizeof (*yyvsp),
1485 yyss = yyss1; yyvs = yyvs1;
1489 #else /* no yyoverflow */
1490 /* Extend the stack our own way. */
1491 if (yystacksize >= YYMAXDEPTH)
1493 yyerror("parser stack overflow");
1505 if (yystacksize > YYMAXDEPTH)
1506 yystacksize = YYMAXDEPTH;
1507 #ifndef YYSTACK_USE_ALLOCA
1510 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1511 __yy_memcpy ((char *)yyss, (char *)yyss1,
1512 size * (unsigned int) sizeof (*yyssp));
1513 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1514 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1515 size * (unsigned int) sizeof (*yyvsp));
1517 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1518 __yy_memcpy ((char *)yyls, (char *)yyls1,
1519 size * (unsigned int) sizeof (*yylsp));
1521 #endif /* no yyoverflow */
1523 yyssp = yyss + size - 1;
1524 yyvsp = yyvs + size - 1;
1526 yylsp = yyls + size - 1;
1531 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1534 if (yyssp >= yyss + yystacksize - 1)
1540 fprintf(stderr, "Entering state %d\n", yystate);
1546 /* Do appropriate processing given the current state. */
1547 /* Read a lookahead token if we need one and don't already have one. */
1550 /* First try to decide what to do without reference to lookahead token. */
1552 yyn = yypact[yystate];
1556 /* Not known => get a lookahead token if don't already have one. */
1558 /* yychar is either YYEMPTY or YYEOF
1559 or a valid token in external form. */
1561 if (yychar == YYEMPTY)
1565 fprintf(stderr, "Reading a token: ");
1570 /* Convert token to internal form (in yychar1) for indexing tables with */
1572 if (yychar <= 0) /* This means end of input. */
1575 yychar = YYEOF; /* Don't call YYLEX any more */
1579 fprintf(stderr, "Now at end of input.\n");
1584 yychar1 = YYTRANSLATE(yychar);
1589 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1590 /* Give the individual parser a way to print the precise meaning
1591 of a token, for further debugging info. */
1593 YYPRINT (stderr, yychar, yylval);
1595 fprintf (stderr, ")\n");
1601 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1606 /* yyn is what to do for this token type in this state.
1607 Negative => reduce, -yyn is rule number.
1608 Positive => shift, yyn is new state.
1609 New state is final state => don't bother to shift,
1610 just return success.
1611 0, or most negative number => error. */
1626 /* Shift the lookahead token. */
1630 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1633 /* Discard the token being shifted unless it is eof. */
1634 if (yychar != YYEOF)
1642 /* count tokens shifted since error; after three, turn off error status. */
1643 if (yyerrstatus) yyerrstatus--;
1648 /* Do the default action for the current state. */
1651 yyn = yydefact[yystate];
1655 /* Do a reduction. yyn is the number of a rule to reduce with. */
1659 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1666 fprintf (stderr, "Reducing via rule %d (line %d), ",
1669 /* Print the symbols being reduced, and their result. */
1670 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1671 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1672 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1698 Node *node = node_new (CCODE_NODE,
1700 "cbuf:steal", (yyvsp[0].cbuf)->str,
1701 "line_no", ccode_line,
1703 nodes = g_list_append(nodes,node);
1704 g_string_free(yyvsp[0].cbuf,FALSE);
1710 Node *node = node_new (CCODE_NODE,
1712 "cbuf:steal", (yyvsp[0].cbuf)->str,
1713 "line_no", ccode_line,
1715 nodes = g_list_append(nodes,node);
1716 g_string_free(yyvsp[0].cbuf,FALSE);
1722 Node *node = node_new (CCODE_NODE,
1724 "cbuf:steal", (yyvsp[0].cbuf)->str,
1725 "line_no", ccode_line,
1727 nodes = g_list_append(nodes,node);
1728 g_string_free(yyvsp[0].cbuf,FALSE);
1734 Node *node = node_new (CCODE_NODE,
1736 "cbuf:steal", (yyvsp[0].cbuf)->str,
1737 "line_no", ccode_line,
1739 nodes = g_list_append(nodes,node);
1740 g_string_free(yyvsp[0].cbuf,FALSE);
1746 Node *node = node_new (CCODE_NODE,
1748 "cbuf:steal", (yyvsp[0].cbuf)->str,
1749 "line_no", ccode_line,
1751 nodes = g_list_append(nodes,node);
1752 g_string_free(yyvsp[0].cbuf,FALSE);
1758 Node *node = node_new (CCODE_NODE,
1760 "cbuf:steal", (yyvsp[0].cbuf)->str,
1761 "line_no", ccode_line,
1763 nodes = g_list_append(nodes,node);
1764 g_string_free(yyvsp[0].cbuf,FALSE);
1802 ((Class *)class)->nodes = class_nodes;
1804 nodes = g_list_append(nodes,class);
1810 ((Class *)class)->nodes = NULL;
1812 nodes = g_list_append(nodes,class);
1818 class = node_new (CLASS_NODE,
1819 "otype:steal", yyvsp[-3].id,
1820 "ptype:steal", yyvsp[-1].id,
1821 "bonobo_object_class:steal", bonobo_object_class,
1822 "interfaces:steal", interfaces,
1823 "chunk_size:steal", chunk_size,
1825 bonobo_object_class = NULL;
1833 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1834 g_free (chunk_size);
1835 chunk_size = g_strdup(yyvsp[-2].id);
1836 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
1837 g_free (bonobo_object_class);
1838 bonobo_object_class = g_strdup(yyvsp[-2].id);
1840 yyerror(_("parse error"));
1848 if (strcmp (yyvsp[-3].id, "interface") == 0) {
1849 interfaces = g_list_append (interfaces,
1850 g_strdup (yyvsp[-2].id));
1852 yyerror(_("parse error"));
1860 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1861 g_free (chunk_size);
1862 if(atoi(yyvsp[-2].id) != 0)
1863 chunk_size = g_strdup(yyvsp[-2].id);
1867 yyerror(_("parse error"));
1887 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
1888 g_free (yyvsp[-1].id);
1889 yyerror (_("parse error"));
1892 g_free (yyvsp[-1].id);
1893 last_added_method->bonobo_object_func = TRUE;
1899 if (strcmp (yyvsp[-2].id, "interface") != 0) {
1900 g_free (yyvsp[-2].id);
1901 g_free (yyvsp[-1].id);
1902 yyerror (_("parse error"));
1905 g_free (yyvsp[-2].id);
1906 node_set ((Node *)last_added_method,
1907 "interface:steal", yyvsp[-1].id,
1929 { the_scope = PUBLIC_SCOPE; ;
1933 { the_scope = PRIVATE_SCOPE; ;
1937 { the_scope = PROTECTED_SCOPE; ;
1941 { the_scope = CLASS_SCOPE; ;
1946 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
1947 g_free (yyvsp[-1].id);
1948 destructor_unref = FALSE;
1949 destructor = yyvsp[0].id;
1950 destructor_line = line_no;
1951 destructor_simple = TRUE;
1952 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
1953 g_free (yyvsp[-1].id);
1954 destructor_unref = TRUE;
1955 destructor = yyvsp[0].id;
1956 destructor_line = line_no;
1957 destructor_simple = TRUE;
1959 g_free (yyvsp[-1].id);
1960 g_free (yyvsp[0].id);
1961 yyerror (_("parse error"));
1969 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
1970 g_free(yyvsp[-2].id);
1971 destructor_unref = FALSE;
1972 destructor = (yyvsp[0].cbuf)->str;
1973 g_string_free(yyvsp[0].cbuf, FALSE);
1974 destructor_line = ccode_line;
1975 destructor_simple = FALSE;
1976 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
1977 g_free (yyvsp[-2].id);
1978 destructor_unref = TRUE;
1979 destructor = (yyvsp[0].cbuf)->str;
1980 g_string_free (yyvsp[0].cbuf, FALSE);
1981 destructor_line = ccode_line;
1982 destructor_simple = FALSE;
1984 g_free (yyvsp[-2].id);
1985 g_string_free (yyvsp[0].cbuf, TRUE);
1986 yyerror (_("parse error"));
1994 initializer = yyvsp[0].id;
1995 initializer_line = ccode_line;
2001 initializer = (yyvsp[0].cbuf)->str;
2002 initializer_line = ccode_line;
2003 g_string_free(yyvsp[0].cbuf, FALSE);
2016 { destructor = NULL; ;
2020 { initializer = NULL; ;
2032 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2038 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2045 if(strcmp(yyvsp[-6].id,"get")==0 &&
2046 strcmp(yyvsp[-3].id,"set")==0) {
2047 Type *type = pop_type();
2048 g_free (yyvsp[-6].id);
2049 g_free (yyvsp[-3].id);
2050 node = node_new (ARGUMENT_NODE,
2051 "gtktype:steal", yyvsp[-9].id,
2052 "atype:steal", type,
2053 "flags:steal", yyvsp[-10].list,
2054 "name:steal", yyvsp[-8].id,
2055 "get:steal", (yyvsp[-4].cbuf)->str,
2056 "get_line", yyvsp[-5].line,
2057 "set:steal", (yyvsp[-1].cbuf)->str,
2058 "set_line", yyvsp[-2].line,
2059 "line_no", yyvsp[-11].line,
2062 class_nodes = g_list_append(class_nodes,node);
2064 g_string_free (yyvsp[-4].cbuf, FALSE);
2065 g_string_free (yyvsp[-1].cbuf, FALSE);
2067 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2068 strcmp(yyvsp[-3].id,"get")==0) {
2069 Type *type = pop_type();
2070 g_free (yyvsp[-6].id);
2071 g_free (yyvsp[-3].id);
2072 node = node_new (ARGUMENT_NODE,
2073 "gtktype:steal", yyvsp[-9].id,
2074 "atype:steal", type,
2075 "flags:steal", yyvsp[-10].list,
2076 "name:steal", yyvsp[-8].id,
2077 "get:steal", (yyvsp[-1].cbuf)->str,
2078 "get_line", yyvsp[-2].line,
2079 "set:steal", (yyvsp[-4].cbuf)->str,
2080 "set_line", yyvsp[-5].line,
2081 "line_no", yyvsp[-11].line,
2083 g_string_free (yyvsp[-1].cbuf, FALSE);
2084 g_string_free (yyvsp[-4].cbuf, FALSE);
2085 class_nodes = g_list_append(class_nodes,node);
2087 g_free (yyvsp[-9].id);
2088 g_free (yyvsp[-8].id);
2089 g_free (yyvsp[-6].id);
2090 g_free (yyvsp[-3].id);
2091 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2092 g_list_free (yyvsp[-10].list);
2093 g_string_free (yyvsp[-1].cbuf, TRUE);
2094 g_string_free (yyvsp[-4].cbuf, TRUE);
2095 yyerror (_("parse error"));
2099 if (yyvsp[-7].id != NULL) {
2100 Argument *arg = (Argument *)node;
2101 export_accessors (arg->name,
2102 arg->get != NULL, arg->get_line,
2103 arg->set != NULL, arg->set_line,
2107 g_free (yyvsp[-7].id);
2116 if(strcmp(yyvsp[-3].id, "get") == 0) {
2117 Type *type = pop_type();
2118 g_free (yyvsp[-3].id);
2119 node = node_new (ARGUMENT_NODE,
2120 "gtktype:steal", yyvsp[-6].id,
2121 "atype:steal", type,
2122 "flags:steal", yyvsp[-7].list,
2123 "name:steal", yyvsp[-5].id,
2124 "get:steal", (yyvsp[-1].cbuf)->str,
2125 "get_line", yyvsp[-2].line,
2126 "line_no", yyvsp[-8].line,
2129 g_string_free (yyvsp[-1].cbuf, FALSE);
2130 class_nodes = g_list_append(class_nodes, node);
2131 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2132 Type *type = pop_type();
2133 g_free (yyvsp[-3].id);
2134 node = node_new (ARGUMENT_NODE,
2135 "gtktype:steal", yyvsp[-6].id,
2136 "atype:steal", type,
2137 "flags:steal", yyvsp[-7].list,
2138 "name:steal", yyvsp[-5].id,
2139 "set:steal", (yyvsp[-1].cbuf)->str,
2140 "set_line", yyvsp[-2].line,
2141 "line_no", yyvsp[-8].line,
2144 g_string_free (yyvsp[-1].cbuf, FALSE);
2145 class_nodes = g_list_append (class_nodes, node);
2147 g_free (yyvsp[-3].id);
2148 g_free (yyvsp[-6].id);
2149 g_free (yyvsp[-5].id);
2150 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2151 g_list_free (yyvsp[-7].list);
2152 g_string_free (yyvsp[-1].cbuf, TRUE);
2153 yyerror(_("parse error"));
2157 if (yyvsp[-4].id != NULL) {
2158 Argument *arg = (Argument *)node;
2159 export_accessors (arg->name,
2160 arg->get != NULL, arg->get_line,
2161 arg->set != NULL, arg->set_line,
2165 g_free (yyvsp[-4].id);
2170 #line 1005 "parse.y"
2173 char *get, *set = NULL;
2178 if(strcmp(yyvsp[0].id, "link")!=0 &&
2179 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2180 strcmp(yyvsp[0].id, "objectlink")!=0) {
2181 g_free(yyvsp[0].id);
2182 g_free(yyvsp[-3].id);
2183 g_free(yyvsp[-2].id);
2184 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2185 g_list_free(yyvsp[-4].list);
2186 yyerror(_("parse error"));
2192 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2193 if(var->scope == PRIVATE_SCOPE)
2194 root = "self->_priv";
2195 else if(var->scope == CLASS_SCOPE) {
2196 root = "SELF_GET_CLASS(self)";
2198 error_print(GOB_ERROR, yyvsp[-5].line,
2199 _("Self aliases needed when autolinking to a classwide member"));
2203 if(strcmp(yyvsp[0].id, "link")==0) {
2204 set = g_strdup_printf("%s->%s = ARG;",
2205 root, yyvsp[-2].id);
2206 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2207 set = g_strdup_printf("g_free (%s->%s); "
2208 "%s->%s = g_strdup (ARG);",
2210 root, yyvsp[-2].id);
2211 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2212 set = g_strdup_printf(
2214 "g_object_ref (G_OBJECT (ARG)); "
2215 "if (%s->%s != NULL) "
2216 "g_object_unref (G_OBJECT (%s->%s)); "
2220 root, yyvsp[-2].id);
2222 g_assert_not_reached();
2225 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2227 g_free (yyvsp[0].id);
2230 type = (Type *)node_copy ((Node *)var->vtype);
2232 node = node_new (ARGUMENT_NODE,
2233 "gtktype:steal", yyvsp[-3].id,
2234 "atype:steal", type,
2235 "flags:steal", yyvsp[-4].list,
2236 "name:steal", yyvsp[-2].id,
2238 "get_line", yyvsp[-5].line,
2240 "set_line", yyvsp[-5].line,
2241 "line_no", yyvsp[-5].line,
2244 if (yyvsp[-1].id != NULL) {
2245 Argument *arg = (Argument *)node;
2246 export_accessors (arg->name,
2247 arg->get != NULL, arg->get_line,
2248 arg->set != NULL, arg->set_line,
2252 g_free (yyvsp[-1].id);
2255 class_nodes = g_list_append (class_nodes, node);
2259 #line 1093 "parse.y"
2261 if (strcmp (yyvsp[-1].id, "export")!=0) {
2262 g_free (yyvsp[-1].id);
2263 yyerror (_("parse error"));
2266 yyval.id = yyvsp[-1].id;
2270 #line 1101 "parse.y"
2276 #line 1106 "parse.y"
2279 node_set ((Node *)property,
2280 "line_no", yyvsp[-10].line,
2281 "gtktype:steal", debool (yyvsp[-9].id),
2282 "name:steal", yyvsp[-8].id,
2284 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2285 strcmp (yyvsp[-3].id, "set") == 0) {
2286 node_set ((Node *)property,
2287 "get:steal", (yyvsp[-4].cbuf)->str,
2288 "get_line", yyvsp[-5].line,
2289 "set:steal", (yyvsp[-1].cbuf)->str,
2290 "set_line", yyvsp[-2].line,
2292 g_string_free (yyvsp[-4].cbuf, FALSE);
2293 g_string_free (yyvsp[-1].cbuf, FALSE);
2294 g_free (yyvsp[-6].id);
2295 g_free (yyvsp[-3].id);
2296 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2297 strcmp (yyvsp[-3].id, "get") == 0) {
2298 node_set ((Node *)property,
2299 "get:steal", (yyvsp[-1].cbuf)->str,
2300 "get_line", yyvsp[-2].line,
2301 "set:steal", (yyvsp[-4].cbuf)->str,
2302 "set_line", yyvsp[-5].line,
2304 g_string_free (yyvsp[-4].cbuf, FALSE);
2305 g_string_free (yyvsp[-1].cbuf, FALSE);
2306 g_free (yyvsp[-6].id);
2307 g_free (yyvsp[-3].id);
2309 g_string_free (yyvsp[-4].cbuf, TRUE);
2310 g_string_free (yyvsp[-1].cbuf, TRUE);
2311 g_free (yyvsp[-6].id);
2312 g_free (yyvsp[-3].id);
2313 node_free ((Node *)property);
2315 yyerror (_("parse error"));
2318 property_link_and_export ((Node *)property);
2319 if (property != NULL) {
2320 class_nodes = g_list_append (class_nodes,
2327 #line 1154 "parse.y"
2330 node_set ((Node *)property,
2331 "line_no", yyvsp[-7].line,
2332 "gtktype:steal", debool (yyvsp[-6].id),
2333 "name:steal", yyvsp[-5].id,
2335 if (strcmp (yyvsp[-3].id, "get") == 0) {
2336 node_set ((Node *)property,
2337 "get:steal", (yyvsp[-1].cbuf)->str,
2338 "get_line", yyvsp[-2].line,
2340 g_string_free (yyvsp[-1].cbuf, FALSE);
2341 g_free (yyvsp[-3].id);
2342 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2343 node_set ((Node *)property,
2344 "set:steal", (yyvsp[-1].cbuf)->str,
2345 "set_line", yyvsp[-2].line,
2347 g_string_free (yyvsp[-1].cbuf, FALSE);
2348 g_free (yyvsp[-3].id);
2350 g_string_free (yyvsp[-1].cbuf, TRUE);
2351 g_free (yyvsp[-3].id);
2352 node_free ((Node *)property);
2354 yyerror (_("parse error"));
2357 property_link_and_export ((Node *)property);
2358 if (property != NULL) {
2359 class_nodes = g_list_append (class_nodes,
2366 #line 1190 "parse.y"
2369 node_set ((Node *)property,
2370 "line_no", yyvsp[-4].line,
2371 "gtktype:steal", debool (yyvsp[-3].id),
2372 "name:steal", yyvsp[-2].id,
2374 property_link_and_export ((Node *)property);
2375 if (property != NULL) {
2376 class_nodes = g_list_append (class_nodes,
2383 #line 1206 "parse.y"
2387 #line 1207 "parse.y"
2391 #line 1210 "parse.y"
2395 #line 1211 "parse.y"
2399 #line 1214 "parse.y"
2400 { yyval.id = yyvsp[0].id; ;
2403 #line 1215 "parse.y"
2405 if (strcmp (yyvsp[-3].id, "_") != 0) {
2406 g_free (yyvsp[-3].id);
2407 yyerror(_("parse error"));
2410 g_free (yyvsp[-3].id);
2411 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2412 g_free (yyvsp[-1].id);
2416 #line 1227 "parse.y"
2417 { yyval.id = yyvsp[0].id; ;
2420 #line 1228 "parse.y"
2421 { yyval.id = yyvsp[0].id; ;
2424 #line 1231 "parse.y"
2427 node_set ((Node *)property,
2428 "nick:steal", yyvsp[0].id,
2433 #line 1237 "parse.y"
2436 node_set ((Node *)property,
2437 "blurb:steal", yyvsp[0].id,
2442 #line 1243 "parse.y"
2445 node_set ((Node *)property,
2446 "maximum:steal", yyvsp[0].id,
2451 #line 1249 "parse.y"
2454 node_set ((Node *)property,
2455 "minimum:steal", yyvsp[0].id,
2460 #line 1255 "parse.y"
2463 node_set ((Node *)property,
2464 "default_value:steal", yyvsp[0].id,
2469 #line 1261 "parse.y"
2472 node_set ((Node *)property,
2473 "flags:steal", yyvsp[0].list,
2478 #line 1267 "parse.y"
2480 Type *type = pop_type ();
2482 node_set ((Node *)property,
2483 "ptype:steal", type,
2488 #line 1274 "parse.y"
2491 node_set ((Node *)property,
2492 "extra_gtktype:steal", yyvsp[0].id,
2497 #line 1280 "parse.y"
2500 node_set ((Node *)property,
2501 "extra_gtktype:steal", yyvsp[0].id,
2506 #line 1286 "parse.y"
2509 node_set ((Node *)property,
2510 "extra_gtktype:steal", yyvsp[0].id,
2515 #line 1292 "parse.y"
2518 node_set ((Node *)property,
2519 "extra_gtktype:steal", yyvsp[0].id,
2524 #line 1298 "parse.y"
2527 node_set ((Node *)property,
2528 "extra_gtktype:steal", yyvsp[0].id,
2533 #line 1304 "parse.y"
2536 node_set ((Node *)property,
2537 "extra_gtktype:steal", yyvsp[0].id,
2542 #line 1310 "parse.y"
2545 node_set ((Node *)property,
2546 "extra_gtktype:steal", yyvsp[0].id,
2551 #line 1316 "parse.y"
2554 node_set ((Node *)property,
2555 "extra_gtktype:steal", yyvsp[0].id,
2560 #line 1322 "parse.y"
2563 node_set ((Node *)property,
2564 "extra_gtktype:steal", yyvsp[0].id,
2569 #line 1328 "parse.y"
2572 node_set ((Node *)property,
2573 "extra_gtktype:steal", yyvsp[0].id,
2578 #line 1334 "parse.y"
2581 if (strcmp (yyvsp[0].id, "link") == 0) {
2582 g_free(yyvsp[0].id);
2583 node_set ((Node *)property,
2586 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2587 g_free(yyvsp[0].id);
2588 node_set ((Node *)property,
2592 g_free(yyvsp[0].id);
2593 yyerror(_("parse error"));
2599 #line 1354 "parse.y"
2601 if(strcmp(yyvsp[-2].id,"type")!=0) {
2602 g_free(yyvsp[-4].id);
2603 g_free(yyvsp[-2].id);
2604 yyerror(_("parse error"));
2607 yyval.id = debool (yyvsp[-4].id);
2611 #line 1363 "parse.y"
2613 yyval.id = debool (yyvsp[0].id);
2614 typestack = g_list_prepend(typestack,NULL);
2618 #line 1369 "parse.y"
2619 { yyval.list = yyvsp[-1].list; ;
2622 #line 1370 "parse.y"
2623 { yyval.list = NULL; ;
2626 #line 1373 "parse.y"
2628 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2632 #line 1376 "parse.y"
2634 yyval.list = g_list_append(NULL,yyvsp[0].id);
2638 #line 1382 "parse.y"
2640 Node *node = node_new (TYPE_NODE,
2641 "name:steal", yyvsp[-1].id,
2642 "pointer:steal", yyvsp[0].id,
2644 typestack = g_list_prepend(typestack,node);
2648 #line 1389 "parse.y"
2650 Node *node = node_new (TYPE_NODE,
2651 "name:steal", yyvsp[0].id,
2653 typestack = g_list_prepend(typestack,node);
2657 #line 1398 "parse.y"
2659 yyval.id = yyvsp[0].id;
2663 #line 1401 "parse.y"
2665 yyval.id = yyvsp[0].id;
2669 #line 1404 "parse.y"
2671 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2672 g_free(yyvsp[0].id);
2676 #line 1408 "parse.y"
2678 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2679 g_free(yyvsp[-1].id);
2683 #line 1412 "parse.y"
2685 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2686 g_free(yyvsp[0].id);
2690 #line 1416 "parse.y"
2692 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2694 g_free(yyvsp[0].id);
2698 #line 1421 "parse.y"
2700 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2701 yyvsp[-1].id, " const", NULL);
2702 g_free(yyvsp[-1].id);
2706 #line 1429 "parse.y"
2708 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2709 g_free(yyvsp[0].id);
2713 #line 1433 "parse.y"
2715 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2716 g_free(yyvsp[-1].id);
2717 g_free(yyvsp[0].id);
2721 #line 1438 "parse.y"
2723 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2724 g_free(yyvsp[0].id);
2728 #line 1442 "parse.y"
2730 yyval.id = yyvsp[0].id;
2734 #line 1445 "parse.y"
2736 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2737 g_free(yyvsp[-1].id);
2741 #line 1449 "parse.y"
2743 yyval.id = g_strdup(yyvsp[0].id);
2747 #line 1452 "parse.y"
2749 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2753 #line 1457 "parse.y"
2754 { yyval.id = "void"; ;
2757 #line 1458 "parse.y"
2758 { yyval.id = "char"; ;
2761 #line 1459 "parse.y"
2762 { yyval.id = "short"; ;
2765 #line 1460 "parse.y"
2766 { yyval.id = "int"; ;
2769 #line 1461 "parse.y"
2770 { yyval.id = "long"; ;
2773 #line 1462 "parse.y"
2774 { yyval.id = "float"; ;
2777 #line 1463 "parse.y"
2778 { yyval.id = "double"; ;
2781 #line 1464 "parse.y"
2782 { yyval.id = "signed"; ;
2785 #line 1465 "parse.y"
2786 { yyval.id = "unsigned"; ;
2789 #line 1468 "parse.y"
2790 { yyval.id = "struct"; ;
2793 #line 1469 "parse.y"
2794 { yyval.id = "union"; ;
2797 #line 1470 "parse.y"
2798 { yyval.id = "enum"; ;
2801 #line 1473 "parse.y"
2802 { yyval.id = g_strdup("*"); ;
2805 #line 1474 "parse.y"
2806 { yyval.id = g_strdup("* const"); ;
2809 #line 1475 "parse.y"
2811 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2812 g_free(yyvsp[0].id);
2816 #line 1479 "parse.y"
2818 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2819 g_free(yyvsp[0].id);
2823 #line 1486 "parse.y"
2825 if(strcmp(yyvsp[-1].id, "first")==0)
2826 yyval.sigtype = SIGNAL_FIRST_METHOD;
2827 else if(strcmp(yyvsp[-1].id, "last")==0)
2828 yyval.sigtype = SIGNAL_LAST_METHOD;
2830 yyerror(_("signal must be 'first' or 'last'"));
2831 g_free(yyvsp[-1].id);
2834 g_free(yyvsp[-1].id);
2838 #line 1498 "parse.y"
2840 yyval.sigtype = SIGNAL_LAST_METHOD;
2844 #line 1504 "parse.y"
2846 if(strcmp(yyvsp[-1].id,"first")==0)
2847 yyval.sigtype = SIGNAL_FIRST_METHOD;
2848 else if(strcmp(yyvsp[-1].id,"last")==0)
2849 yyval.sigtype = SIGNAL_LAST_METHOD;
2851 yyerror(_("signal must be 'first' or 'last'"));
2852 g_free(yyvsp[-1].id);
2855 g_free(yyvsp[-1].id);
2859 #line 1516 "parse.y"
2861 if(strcmp(yyvsp[-2].id,"first")==0)
2862 yyval.sigtype = SIGNAL_FIRST_METHOD;
2863 else if(strcmp(yyvsp[-2].id,"last")==0)
2864 yyval.sigtype = SIGNAL_LAST_METHOD;
2866 yyerror(_("signal must be 'first' or 'last'"));
2867 g_free(yyvsp[-2].id);
2870 g_free(yyvsp[-2].id);
2874 #line 1528 "parse.y"
2876 yyval.sigtype = SIGNAL_LAST_METHOD;
2880 #line 1531 "parse.y"
2882 /* the_scope was default thus public */
2883 the_scope = PUBLIC_SCOPE;
2887 #line 1537 "parse.y"
2889 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
2893 #line 1542 "parse.y"
2895 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2899 #line 1545 "parse.y"
2901 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2905 #line 1550 "parse.y"
2906 { yyval.cbuf = yyvsp[0].cbuf; ;
2909 #line 1551 "parse.y"
2910 { yyval.cbuf = NULL; ;
2913 #line 1555 "parse.y"
2916 yyerror(_("signal without 'self' as "
2917 "first parameter"));
2918 free_all_global_state();
2921 if(the_scope == CLASS_SCOPE) {
2922 yyerror(_("a method cannot be of class scope"));
2923 free_all_global_state();
2926 push_function(the_scope, yyvsp[-7].sigtype,NULL,
2927 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
2928 ccode_line, vararg, yyvsp[-8].list);
2932 #line 1571 "parse.y"
2935 yyerror(_("signal without 'self' as "
2936 "first parameter"));
2937 free_all_global_state();
2940 if(the_scope == CLASS_SCOPE) {
2941 yyerror(_("a method cannot be of class scope"));
2942 free_all_global_state();
2945 push_function(the_scope, yyvsp[-7].sigtype, NULL,
2946 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
2947 ccode_line, vararg, yyvsp[-8].list);
2951 #line 1587 "parse.y"
2954 yyerror(_("virtual method without 'self' as "
2955 "first parameter"));
2956 free_all_global_state();
2959 if(the_scope == CLASS_SCOPE) {
2960 yyerror(_("a method cannot be of class scope"));
2961 free_all_global_state();
2964 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2965 yyvsp[0].cbuf, yyvsp[-8].line,
2966 ccode_line, vararg, NULL);
2970 #line 1603 "parse.y"
2973 yyerror(_("virtual method without 'self' as "
2974 "first parameter"));
2975 free_all_global_state();
2978 if(the_scope == CLASS_SCOPE) {
2979 yyerror(_("a method cannot be of class scope"));
2980 free_all_global_state();
2983 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2984 yyvsp[0].cbuf, yyvsp[-7].line,
2985 ccode_line, vararg, NULL);
2989 #line 1619 "parse.y"
2992 yyerror(_("virtual method without 'self' as "
2993 "first parameter"));
2994 free_all_global_state();
2997 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2998 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2999 ccode_line, vararg, NULL);
3003 #line 1630 "parse.y"
3005 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3006 yyvsp[-5].id, yyvsp[0].cbuf,
3007 yyvsp[-10].line, ccode_line,
3012 #line 1636 "parse.y"
3014 if(the_scope == CLASS_SCOPE) {
3015 yyerror(_("a method cannot be of class scope"));
3016 free_all_global_state();
3019 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3020 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3025 #line 1646 "parse.y"
3027 if(strcmp(yyvsp[-4].id, "init")==0) {
3028 push_init_arg(yyvsp[-2].id,FALSE);
3029 push_function(NO_SCOPE, INIT_METHOD, NULL,
3030 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3031 ccode_line, FALSE, NULL);
3032 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3033 push_init_arg(yyvsp[-2].id,TRUE);
3034 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3035 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3036 ccode_line, FALSE, NULL);
3038 g_free(yyvsp[-4].id);
3039 g_free(yyvsp[-2].id);
3040 g_string_free(yyvsp[0].cbuf,TRUE);
3041 yyerror(_("parse error "
3042 "(untyped blocks must be init or "
3049 #line 1669 "parse.y"
3051 g_free(onerror); onerror = NULL;
3052 g_free(defreturn); defreturn = NULL;
3053 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3054 g_free(yyvsp[-1].id);
3055 g_free(yyvsp[0].id);
3056 yyerror(_("parse error"));
3059 g_free(yyvsp[-1].id);
3063 #line 1680 "parse.y"
3065 g_free(onerror); onerror = NULL;
3066 g_free(defreturn); defreturn = NULL;
3067 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3068 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3069 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3070 yyerror(_("parse error"));
3073 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3074 onerror = defreturn = NULL;
3075 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3076 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3077 yyerror(_("parse error"));
3080 g_free(yyvsp[-3].id);
3081 g_free(yyvsp[-1].id);
3085 #line 1699 "parse.y"
3087 g_free(onerror); onerror = NULL;
3088 g_free(defreturn); defreturn = NULL;
3092 #line 1705 "parse.y"
3093 { yyval.id = yyvsp[0].id; ;
3096 #line 1706 "parse.y"
3098 yyval.id = (yyvsp[1].cbuf)->str;
3099 g_string_free(yyvsp[1].cbuf, FALSE);
3103 #line 1712 "parse.y"
3104 { vararg = FALSE; has_self = FALSE; ;
3107 #line 1713 "parse.y"
3111 if(strcmp(yyvsp[0].id,"self")==0)
3112 push_self(yyvsp[0].id, FALSE);
3114 g_free(yyvsp[0].id);
3115 yyerror(_("parse error"));
3121 #line 1724 "parse.y"
3125 if(strcmp(yyvsp[-1].id,"self")==0)
3126 push_self(yyvsp[-1].id, TRUE);
3128 g_free(yyvsp[-1].id);
3129 yyerror(_("parse error"));
3135 #line 1735 "parse.y"
3139 if(strcmp(yyvsp[0].id,"self")==0)
3140 push_self(yyvsp[0].id, TRUE);
3142 g_free(yyvsp[0].id);
3143 yyerror(_("parse error"));
3149 #line 1746 "parse.y"
3152 if(strcmp(yyvsp[-2].id,"self")==0)
3153 push_self(yyvsp[-2].id, FALSE);
3155 g_free(yyvsp[-2].id);
3156 yyerror(_("parse error"));
3162 #line 1756 "parse.y"
3165 if(strcmp(yyvsp[-3].id,"self")==0)
3166 push_self(yyvsp[-3].id, TRUE);
3168 g_free(yyvsp[-3].id);
3169 yyerror(_("parse error"));
3175 #line 1766 "parse.y"
3178 if(strcmp(yyvsp[-2].id,"self")==0)
3179 push_self(yyvsp[-2].id, TRUE);
3181 g_free(yyvsp[-2].id);
3182 yyerror(_("parse error"));
3188 #line 1776 "parse.y"
3189 { has_self = FALSE; ;
3192 #line 1779 "parse.y"
3196 #line 1780 "parse.y"
3200 #line 1783 "parse.y"
3204 #line 1784 "parse.y"
3208 #line 1787 "parse.y"
3210 push_funcarg(yyvsp[0].id,NULL);
3214 #line 1790 "parse.y"
3216 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3220 #line 1793 "parse.y"
3222 if(strcmp(yyvsp[-2].id,"check")!=0) {
3223 yyerror(_("parse error"));
3226 g_free(yyvsp[-2].id);
3227 push_funcarg(yyvsp[-4].id,NULL);
3231 #line 1801 "parse.y"
3233 if(strcmp(yyvsp[-2].id,"check")!=0) {
3234 yyerror(_("parse error"));
3237 g_free(yyvsp[-2].id);
3238 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3242 #line 1811 "parse.y"
3246 #line 1812 "parse.y"
3250 #line 1815 "parse.y"
3252 if(strcmp(yyvsp[0].id,"type")==0) {
3253 Node *node = node_new (CHECK_NODE,
3254 "chtype", TYPE_CHECK,
3256 checks = g_list_append(checks,node);
3257 } else if(strcmp(yyvsp[0].id,"null")==0) {
3258 Node *node = node_new (CHECK_NODE,
3259 "chtype", NULL_CHECK,
3261 checks = g_list_append(checks,node);
3263 yyerror(_("parse error"));
3266 g_free(yyvsp[0].id);
3270 #line 1832 "parse.y"
3272 Node *node = node_new (CHECK_NODE,
3274 "number:steal", yyvsp[0].id,
3276 checks = g_list_append(checks,node);
3280 #line 1839 "parse.y"
3282 Node *node = node_new (CHECK_NODE,
3284 "number:steal", yyvsp[0].id,
3286 checks = g_list_append(checks,node);
3290 #line 1846 "parse.y"
3292 Node *node = node_new (CHECK_NODE,
3294 "number:steal", yyvsp[0].id,
3296 checks = g_list_append(checks,node);
3300 #line 1853 "parse.y"
3302 Node *node = node_new (CHECK_NODE,
3304 "number:steal", yyvsp[0].id,
3306 checks = g_list_append(checks,node);
3310 #line 1860 "parse.y"
3312 Node *node = node_new (CHECK_NODE,
3314 "number:steal", yyvsp[0].id,
3316 checks = g_list_append(checks,node);
3320 #line 1867 "parse.y"
3322 Node *node = node_new (CHECK_NODE,
3324 "number:steal", yyvsp[0].id,
3326 checks = g_list_append(checks,node);
3330 #line 1876 "parse.y"
3332 Node *node = node_new (ENUMDEF_NODE,
3333 "etype:steal", yyvsp[-1].id,
3334 "prefix:steal", yyvsp[-5].id,
3335 "values:steal", enum_vals,
3338 nodes = g_list_append (nodes, node);
3342 #line 1885 "parse.y"
3344 Node *node = node_new (ENUMDEF_NODE,
3345 "etype:steal", yyvsp[-1].id,
3346 "prefix:steal", yyvsp[-6].id,
3347 "values:steal", enum_vals,
3350 nodes = g_list_append (nodes, node);
3354 #line 1896 "parse.y"
3358 #line 1897 "parse.y"
3362 #line 1900 "parse.y"
3365 char *num = yyvsp[0].id;
3367 /* A float value, that's a bad enum */
3368 if (num[0] >= '0' &&
3370 strchr (num, '.') != NULL) {
3371 g_free (yyvsp[-2].id);
3373 yyerror(_("parse error (enumerator value not integer constant)"));
3377 node = node_new (ENUMVALUE_NODE,
3378 "name:steal", yyvsp[-2].id,
3381 enum_vals = g_list_append (enum_vals, node);
3385 #line 1920 "parse.y"
3389 node = node_new (ENUMVALUE_NODE,
3390 "name:steal", yyvsp[0].id,
3392 enum_vals = g_list_append (enum_vals, node);
3396 #line 1930 "parse.y"
3398 Node *node = node_new (FLAGS_NODE,
3399 "ftype:steal", yyvsp[-1].id,
3400 "prefix:steal", yyvsp[-5].id,
3401 "values:steal", flag_vals,
3404 nodes = g_list_append (nodes, node);
3408 #line 1939 "parse.y"
3410 Node *node = node_new (FLAGS_NODE,
3411 "ftype:steal", yyvsp[-1].id,
3412 "prefix:steal", yyvsp[-6].id,
3413 "values:steal", flag_vals,
3416 nodes = g_list_append (nodes, node);
3420 #line 1950 "parse.y"
3422 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3426 #line 1953 "parse.y"
3428 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3432 #line 1958 "parse.y"
3434 Node *node = node_new (ERROR_NODE,
3435 "etype:steal", yyvsp[-1].id,
3436 "prefix:steal", yyvsp[-5].id,
3437 "values:steal", error_vals,
3440 nodes = g_list_append (nodes, node);
3444 #line 1967 "parse.y"
3446 Node *node = node_new (ERROR_NODE,
3447 "etype:steal", yyvsp[-1].id,
3448 "prefix:steal", yyvsp[-6].id,
3449 "values:steal", error_vals,
3452 nodes = g_list_append (nodes, node);
3456 #line 1978 "parse.y"
3458 error_vals = g_list_append (error_vals, yyvsp[0].id);
3462 #line 1981 "parse.y"
3464 error_vals = g_list_append (error_vals, yyvsp[0].id);
3468 #line 1987 "parse.y"
3469 { yyval.id = yyvsp[0].id; ;
3472 #line 1988 "parse.y"
3474 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3475 g_free(yyvsp[0].id);
3479 #line 1992 "parse.y"
3480 { yyval.id = yyvsp[0].id; ;
3483 #line 1993 "parse.y"
3484 { yyval.id = yyvsp[0].id; ;
3487 /* the action file gets copied in in place of this dollarsign */
3488 #line 543 "/usr/lib/bison.simple"
3499 short *ssp1 = yyss - 1;
3500 fprintf (stderr, "state stack now");
3501 while (ssp1 != yyssp)
3502 fprintf (stderr, " %d", *++ssp1);
3503 fprintf (stderr, "\n");
3513 yylsp->first_line = yylloc.first_line;
3514 yylsp->first_column = yylloc.first_column;
3515 yylsp->last_line = (yylsp-1)->last_line;
3516 yylsp->last_column = (yylsp-1)->last_column;
3521 yylsp->last_line = (yylsp+yylen-1)->last_line;
3522 yylsp->last_column = (yylsp+yylen-1)->last_column;
3526 /* Now "shift" the result of the reduction.
3527 Determine what state that goes to,
3528 based on the state we popped back to
3529 and the rule number reduced by. */
3533 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3534 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3535 yystate = yytable[yystate];
3537 yystate = yydefgoto[yyn - YYNTBASE];
3541 yyerrlab: /* here on detecting error */
3544 /* If not already recovering from an error, report this error. */
3548 #ifdef YYERROR_VERBOSE
3549 yyn = yypact[yystate];
3551 if (yyn > YYFLAG && yyn < YYLAST)
3558 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3559 for (x = (yyn < 0 ? -yyn : 0);
3560 x < (sizeof(yytname) / sizeof(char *)); x++)
3561 if (yycheck[x + yyn] == x)
3562 size += strlen(yytname[x]) + 15, count++;
3563 msg = (char *) malloc(size + 15);
3566 strcpy(msg, "parse error");
3571 for (x = (yyn < 0 ? -yyn : 0);
3572 x < (sizeof(yytname) / sizeof(char *)); x++)
3573 if (yycheck[x + yyn] == x)
3575 strcat(msg, count == 0 ? ", expecting `" : " or `");
3576 strcat(msg, yytname[x]);
3585 yyerror ("parse error; also virtual memory exceeded");
3588 #endif /* YYERROR_VERBOSE */
3589 yyerror("parse error");
3593 yyerrlab1: /* here on error raised explicitly by an action */
3595 if (yyerrstatus == 3)
3597 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3599 /* return failure if at end of input */
3600 if (yychar == YYEOF)
3605 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3611 /* Else will try to reuse lookahead token
3612 after shifting the error token. */
3614 yyerrstatus = 3; /* Each real token shifted decrements this */
3618 yyerrdefault: /* current state does not do anything special for the error token. */
3621 /* This is wrong; only states that explicitly want error tokens
3622 should shift them. */
3623 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3624 if (yyn) goto yydefault;
3627 yyerrpop: /* pop the current state because it cannot handle the error token */
3629 if (yyssp == yyss) YYABORT;
3639 short *ssp1 = yyss - 1;
3640 fprintf (stderr, "Error: state stack now");
3641 while (ssp1 != yyssp)
3642 fprintf (stderr, " %d", *++ssp1);
3643 fprintf (stderr, "\n");
3649 yyn = yypact[yystate];
3654 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3673 fprintf(stderr, "Shifting error token, ");
3685 /* YYACCEPT comes here. */
3697 /* YYABORT comes here. */
3708 #line 1996 "parse.y"