1 /* A Bison parser, made from parse.y
4 #define YYBISON 1 /* Identify Bison output. */
13 # define THREEDOTS 264
24 # define TYPETOKEN 275
25 # define ARRAY_DIM 276
26 # define SINGLE_CHAR 277
36 # define PROTECTED 287
37 # define CLASSWIDE 288
47 # define DEFAULT_VALUE 298
51 # define FLAGS_TYPE 302
52 # define ENUM_TYPE 303
53 # define PARAM_TYPE 304
54 # define BOXED_TYPE 305
55 # define OBJECT_TYPE 306
66 #include "treefuncs.h"
70 /* FIXME: add gettext support */
75 static GList *class_nodes = NULL;
78 static GList *enum_vals = NULL;
79 static GList *flag_vals = NULL;
80 static GList *error_vals = NULL;
82 static char *chunk_size = NULL;
83 static char *bonobo_object_class = NULL;
84 static GList *interfaces = NULL;
85 static GList *typestack = NULL;
86 static GList *funcargs = NULL;
87 static GList *checks = NULL;
88 static int has_self = FALSE;
89 static int vararg = FALSE;
90 static Method *last_added_method = NULL;
92 /* destructor and initializer for variables */
93 static gboolean destructor_unref = FALSE;
94 static char *destructor = NULL;
95 static int destructor_line = 0;
96 static gboolean destructor_simple = TRUE;
97 static char *initializer = NULL;
98 static int initializer_line = 0;
100 static char *onerror = NULL;
101 static char *defreturn = NULL;
103 static GList *gtktypes = NULL;
105 static Property *property = NULL;
107 /* this can be a global as we will only do one function at a time
109 static int the_scope = NO_SCOPE;
111 void free(void *ptr);
114 extern int ccode_line;
125 if(strcmp(yytext,"\n")==0) {
126 out=g_strconcat("Error: ",str," before newline",NULL);
127 } else if(yytext[0]=='\0') {
128 out=g_strconcat("Error: ", str, " at end of input", NULL);
130 char *tmp = g_strdup(yytext);
131 while((p=strchr(tmp, '\n')))
134 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
138 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
147 Type *type = typestack->data;
148 typestack = g_list_remove(typestack,typestack->data);
153 push_variable (char *name, int scope, int line_no, char *postfix)
156 Type *type = pop_type ();
158 type->postfix = postfix;
160 var = node_new (VARIABLE_NODE,
165 "destructor_unref", destructor_unref,
166 "destructor:steal", destructor,
167 "destructor_line", destructor_line,
168 "destructor_simple", destructor_simple,
169 "initializer:steal", initializer,
170 "initializer_line", initializer_line,
172 class_nodes = g_list_append(class_nodes, var);
176 push_function (int scope, int method, char *oid, char *id,
177 GString *cbuf, int line_no, int ccode_line,
178 gboolean vararg, GList *flags)
184 g_assert(scope != CLASS_SCOPE);
186 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
187 type = (Type *)node_new (TYPE_NODE,
194 /* a complicated and ugly test to figure out if we have
195 the wrong number of types for a signal */
196 if((method == SIGNAL_FIRST_METHOD ||
197 method == SIGNAL_LAST_METHOD) &&
198 g_list_length(gtktypes) != g_list_length(funcargs) &&
199 !(g_list_length(funcargs) == 1 &&
200 g_list_length(gtktypes) == 2 &&
201 strcmp(gtktypes->next->data, "NONE")==0)) {
202 error_print(GOB_WARN, line_no,
203 _("The number of GTK arguments and "
204 "function arguments for a signal "
205 "don't seem to match"));
207 if(g_list_length(gtktypes) > 2) {
209 for(li = gtktypes->next; li; li = li->next) {
210 if(strcmp(li->data, "NONE")==0) {
211 error_print(GOB_ERROR, line_no,
212 _("NONE can only appear in an "
213 "argument list by itself"));
219 c_cbuf = p = cbuf->str;
220 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
227 node = node_new (METHOD_NODE,
232 "gtktypes:steal", gtktypes,
233 "flags:steal", flags,
235 "args:steal", funcargs,
236 "onerror:steal", onerror,
237 "defreturn:steal", defreturn,
238 "cbuf:steal", c_cbuf,
240 "ccode_line", ccode_line,
242 "unique_id", method_unique_id++,
245 last_added_method = (Method *)node;
249 /*only free segment if we haven't passed it
258 class_nodes = g_list_append(class_nodes, node);
262 free_all_global_state(void)
272 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
273 g_list_free(gtktypes);
276 node_list_free (funcargs);
281 push_funcarg(char *name, char *postfix)
284 Type *type = pop_type();
286 type->postfix = postfix;
288 node = node_new (FUNCARG_NODE,
291 "checks:steal", checks,
295 funcargs = g_list_append(funcargs, node);
299 push_init_arg(char *name, int is_class)
306 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
308 tn = g_strdup(((Class *)class)->otype);
310 type = node_new (TYPE_NODE,
314 node = node_new (FUNCARG_NODE,
315 "atype:steal", (Type *)type,
318 funcargs = g_list_prepend(funcargs, node);
322 push_self(char *id, gboolean constant)
327 type = node_new (TYPE_NODE,
328 "name", ((Class *)class)->otype,
329 "pointer", constant ? "const *" : "*",
331 ch = g_list_append (ch, node_new (CHECK_NODE,
332 "chtype", NULL_CHECK,
334 ch = g_list_append (ch, node_new (CHECK_NODE,
335 "chtype", TYPE_CHECK,
337 node = node_new (FUNCARG_NODE,
338 "atype:steal", (Type *)type,
342 funcargs = g_list_prepend(funcargs, node);
346 find_var_or_die(const char *id, int line)
350 for(li = class_nodes; li != NULL; li = li->next) {
352 Node *node = li->data;
353 if(node->type != VARIABLE_NODE)
356 if(strcmp(var->id, id)==0)
360 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
362 g_assert_not_reached();
367 set_return_value(char *type, char *val)
369 if(strcmp(type, "onerror")==0) {
375 } else if(strcmp(type, "defreturn")==0) {
386 export_accessors (const char *var_name,
398 the_type = (Type *)node_copy ((Node *)type);
400 the_type = get_tree_type (gtktype, TRUE);
402 if (the_type == NULL) {
403 error_print (GOB_ERROR, line_no,
404 _("Cannot determine type of property or argument"));
409 char *get_id = g_strdup_printf ("get_%s", var_name);
410 GString *get_cbuf = g_string_new (NULL);
411 Node *node1 = node_new (TYPE_NODE,
412 "name", the_type->name,
413 "pointer", the_type->pointer,
414 "postfix", the_type->postfix,
416 Node *node3 = node_new (TYPE_NODE,
417 "name", class->class.otype,
421 g_string_sprintf (get_cbuf,
423 "g_object_get (G_OBJECT (self), \"%s\", "
427 the_type->pointer ? the_type->pointer : "",
430 typestack = g_list_prepend (typestack, node1);
431 typestack = g_list_prepend (typestack, node3);
433 push_funcarg ("self", FALSE);
435 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
436 get_id, get_cbuf, get_lineno,
437 lineno, FALSE, NULL);
441 char *set_id = g_strdup_printf ("set_%s", var_name);
442 GString *set_cbuf = g_string_new (NULL);
443 Node *node1 = node_new (TYPE_NODE,
444 "name", the_type->name,
445 "pointer", the_type->pointer,
446 "postfix", the_type->postfix,
448 Node *node2 = node_new (TYPE_NODE,
451 Node *node3 = node_new (TYPE_NODE,
452 "name", class->class.otype,
456 g_string_sprintf (set_cbuf,
457 "\tg_object_set (G_OBJECT (self), "
458 "\"%s\", val, NULL);\n",
461 typestack = g_list_prepend (typestack, node2);
462 typestack = g_list_prepend (typestack, node1);
463 typestack = g_list_prepend (typestack, node3);
465 push_funcarg ("self", FALSE);
466 push_funcarg ("val", FALSE);
468 typestack = g_list_prepend (typestack, node2);
469 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
470 set_id, set_cbuf, set_lineno,
471 lineno, FALSE, NULL);
474 node_free ((Node *)the_type);
478 get_prop_enum_flag_cast (Property *prop)
481 if (prop->extra_gtktype == NULL ||
482 /* HACK! just in case someone made this
483 * work with 2.0.0 by using the TYPE
485 ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
486 strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
487 strchr (prop->extra_gtktype, ':') == NULL)) {
488 if (prop->ptype != NULL)
489 return get_type (prop->ptype, TRUE);
491 return g_strdup ("");
493 tmp = remove_sep (prop->extra_gtktype);
494 ret = g_strdup_printf ("(%s) ", tmp);
500 property_link_and_export (Node *node)
502 Property *prop = (Property *)node;
506 char *get = NULL, *set = NULL;
509 if (prop->set != NULL ||
511 error_print (GOB_ERROR, prop->line_no,
512 _("Property linking requested, but "
513 "getters and setters exist"));
516 var = find_var_or_die (prop->name, prop->line_no);
517 if(var->scope == PRIVATE_SCOPE) {
518 root = "self->_priv";
519 } else if (var->scope == CLASS_SCOPE) {
520 root = "SELF_GET_CLASS(self)";
522 error_print (GOB_ERROR, prop->line_no,
523 _("Self aliases needed when autolinking to a classwide member"));
528 if (strcmp (prop->gtktype, "STRING") == 0) {
529 set = g_strdup_printf("{ char *old = %s->%s; "
530 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
533 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
535 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
537 if (prop->extra_gtktype != NULL) {
538 cast = remove_sep (prop->extra_gtktype);
540 cast = g_strdup ("void");
542 set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
543 "%s->%s = (%s *)g_value_dup_object (VAL); "
544 "if (___old != NULL) { "
545 "g_object_unref (G_OBJECT (___old)); "
551 get = g_strdup_printf ("g_value_set_object (VAL, "
552 "(gpointer)%s->%s);",
555 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
556 if (prop->extra_gtktype == NULL) {
557 error_print (GOB_ERROR, prop->line_no,
558 _("Property linking requested for BOXED, but "
559 "boxed_type not set"));
561 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
562 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
563 "if (___new != ___old) { "
564 "if (___old != NULL) g_boxed_free (%s, ___old); "
565 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
566 "else %s->%s = NULL;"
574 get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
579 const char *getcast = "";
580 const char *setcast = "";
581 char *to_free = NULL;
582 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
583 g_strdown (set_func);
584 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
585 g_strdown (get_func);
587 if (strcmp (prop->gtktype, "FLAGS") == 0) {
588 setcast = "(guint) ";
590 get_prop_enum_flag_cast (prop);
591 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
594 get_prop_enum_flag_cast (prop);
597 set = g_strdup_printf("%s->%s = %s%s (VAL);",
601 get = g_strdup_printf("%s (VAL, %s%s->%s);",
613 "get_line", prop->line_no,
615 "set_line", prop->line_no,
620 export_accessors (prop->name,
621 prop->get != NULL, prop->get_line,
622 prop->set != NULL, prop->set_line,
633 if (strcmp (s, "BOOL") == 0) {
634 error_print (GOB_WARN, line_no,
635 _("BOOL type is deprecated, please use BOOLEAN"));
637 return g_strdup ("BOOLEAN");
644 ensure_property (void)
646 if (property == NULL)
647 property = (Property *)node_new (PROPERTY_NODE, NULL);
660 # define YYSTYPE yystype
661 # define YYSTYPE_IS_TRIVIAL 1
670 #define YYFLAG -32768
673 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
674 #define YYTRANSLATE(x) ((unsigned)(x) <= 306 ? yytranslate[x] : 118)
676 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
677 static const char yytranslate[] =
679 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
682 2, 2, 2, 64, 2, 2, 2, 2, 2, 2,
683 55, 56, 61, 2, 59, 65, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 57,
685 63, 58, 62, 2, 2, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
687 2, 2, 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, 53, 60, 54, 2, 2, 2, 2,
692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
693 2, 2, 2, 2, 2, 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, 1, 3, 4, 5,
705 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
706 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
707 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
708 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
709 46, 47, 48, 49, 50, 51, 52
713 static const short yyprhs[] =
715 0, 0, 4, 7, 10, 12, 14, 16, 18, 20,
716 22, 24, 27, 30, 33, 36, 38, 40, 42, 44,
717 49, 53, 59, 60, 66, 72, 78, 81, 83, 85,
718 88, 92, 94, 96, 98, 100, 102, 104, 106, 108,
719 111, 115, 118, 122, 125, 128, 130, 132, 133, 139,
720 146, 159, 169, 176, 180, 181, 193, 202, 208, 212,
721 213, 217, 219, 221, 226, 228, 230, 234, 238, 242,
722 246, 250, 254, 258, 262, 266, 270, 274, 278, 282,
723 286, 290, 294, 298, 300, 306, 308, 312, 313, 317,
724 319, 322, 324, 326, 328, 331, 334, 337, 341, 345,
725 348, 351, 354, 356, 359, 361, 364, 366, 368, 370,
726 372, 374, 376, 378, 380, 382, 384, 386, 388, 390,
727 393, 396, 400, 403, 405, 409, 413, 416, 418, 423,
728 427, 429, 432, 434, 445, 457, 467, 477, 486, 498,
729 507, 513, 516, 521, 522, 524, 527, 529, 531, 534,
730 537, 541, 546, 551, 553, 557, 559, 563, 565, 568,
731 572, 579, 587, 590, 592, 594, 597, 600, 604, 608,
732 612, 616, 624, 633, 637, 639, 643, 645, 653, 662,
733 666, 668, 676, 685, 689, 691, 693, 696, 698
735 static const short yyrhs[] =
737 68, 69, 68, 0, 69, 68, 0, 68, 69, 0,
738 69, 0, 24, 0, 27, 0, 25, 0, 26, 0,
739 28, 0, 29, 0, 68, 67, 0, 68, 110, 0,
740 68, 113, 0, 68, 115, 0, 67, 0, 110, 0,
741 113, 0, 115, 0, 70, 53, 72, 54, 0, 70,
742 53, 54, 0, 3, 21, 4, 21, 71, 0, 0,
743 55, 19, 19, 56, 71, 0, 55, 19, 21, 56,
744 71, 0, 55, 19, 20, 56, 71, 0, 72, 73,
745 0, 73, 0, 101, 0, 19, 101, 0, 19, 21,
746 101, 0, 78, 0, 79, 0, 81, 0, 57, 0,
747 31, 0, 32, 0, 33, 0, 34, 0, 19, 19,
748 0, 19, 53, 24, 0, 58, 117, 0, 58, 53,
749 24, 0, 75, 76, 0, 76, 75, 0, 76, 0,
750 75, 0, 0, 74, 90, 19, 77, 57, 0, 74,
751 90, 19, 22, 77, 57, 0, 36, 88, 87, 19,
752 80, 19, 53, 24, 19, 53, 24, 57, 0, 36,
753 88, 87, 19, 80, 19, 53, 24, 57, 0, 36,
754 88, 87, 19, 80, 19, 0, 55, 19, 56, 0,
755 0, 35, 19, 19, 82, 19, 53, 24, 19, 53,
756 24, 57, 0, 35, 19, 19, 82, 19, 53, 24,
757 57, 0, 35, 19, 19, 82, 57, 0, 55, 83,
758 56, 0, 0, 83, 59, 86, 0, 86, 0, 30,
759 0, 19, 55, 30, 56, 0, 117, 0, 84, 0,
760 40, 58, 84, 0, 41, 58, 84, 0, 42, 58,
761 117, 0, 43, 58, 117, 0, 44, 58, 85, 0,
762 46, 58, 89, 0, 47, 58, 90, 0, 48, 58,
763 21, 0, 48, 58, 19, 0, 49, 58, 21, 0,
764 49, 58, 19, 0, 50, 58, 21, 0, 50, 58,
765 19, 0, 51, 58, 21, 0, 51, 58, 19, 0,
766 52, 58, 21, 0, 52, 58, 19, 0, 19, 0,
767 19, 55, 19, 90, 56, 0, 19, 0, 55, 89,
768 56, 0, 0, 19, 60, 89, 0, 19, 0, 91,
769 95, 0, 91, 0, 92, 0, 19, 0, 5, 19,
770 0, 19, 5, 0, 94, 19, 0, 5, 94, 19,
771 0, 94, 19, 5, 0, 93, 92, 0, 21, 92,
772 0, 5, 92, 0, 21, 0, 21, 5, 0, 93,
773 0, 93, 5, 0, 6, 0, 18, 0, 14, 0,
774 15, 0, 13, 0, 16, 0, 17, 0, 11, 0,
775 12, 0, 7, 0, 8, 0, 9, 0, 61, 0,
776 61, 5, 0, 61, 95, 0, 61, 5, 95, 0,
777 19, 98, 0, 98, 0, 74, 19, 98, 0, 19,
778 74, 98, 0, 74, 98, 0, 96, 0, 19, 55,
779 99, 56, 0, 99, 59, 19, 0, 19, 0, 53,
780 24, 0, 57, 0, 38, 88, 97, 90, 19, 55,
781 104, 56, 102, 100, 0, 74, 38, 88, 96, 90,
782 19, 55, 104, 56, 102, 100, 0, 37, 74, 90,
783 19, 55, 104, 56, 102, 100, 0, 74, 37, 90,
784 19, 55, 104, 56, 102, 100, 0, 37, 90, 19,
785 55, 104, 56, 102, 100, 0, 39, 55, 21, 56,
786 90, 19, 55, 104, 56, 102, 100, 0, 74, 90,
787 19, 55, 104, 56, 102, 100, 0, 19, 55, 19,
788 56, 100, 0, 19, 103, 0, 19, 103, 19, 103,
789 0, 0, 117, 0, 53, 24, 0, 6, 0, 19,
790 0, 19, 5, 0, 5, 19, 0, 19, 59, 105,
791 0, 19, 5, 59, 105, 0, 5, 19, 59, 105,
792 0, 105, 0, 106, 59, 10, 0, 106, 0, 106,
793 59, 107, 0, 107, 0, 90, 19, 0, 90, 19,
794 22, 0, 90, 19, 55, 19, 108, 56, 0, 90,
795 19, 22, 55, 19, 108, 56, 0, 108, 109, 0,
796 109, 0, 19, 0, 62, 117, 0, 63, 117, 0,
797 62, 58, 117, 0, 63, 58, 117, 0, 58, 58,
798 117, 0, 64, 58, 117, 0, 9, 19, 53, 111,
799 54, 21, 57, 0, 9, 19, 53, 111, 59, 54,
800 21, 57, 0, 111, 59, 112, 0, 112, 0, 19,
801 58, 117, 0, 19, 0, 46, 19, 53, 114, 54,
802 21, 57, 0, 46, 19, 53, 114, 59, 54, 21,
803 57, 0, 114, 59, 19, 0, 19, 0, 45, 19,
804 53, 116, 54, 21, 57, 0, 45, 19, 53, 116,
805 59, 54, 21, 57, 0, 116, 59, 19, 0, 19,
806 0, 20, 0, 65, 20, 0, 23, 0, 19, 0
812 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
813 static const short yyrline[] =
815 0, 637, 638, 639, 640, 643, 652, 661, 670, 679,
816 688, 699, 700, 701, 702, 703, 704, 705, 706, 709,
817 714, 721, 735, 736, 748, 757, 771, 772, 775, 776,
818 785, 797, 798, 799, 800, 803, 804, 805, 806, 809,
819 829, 853, 857, 865, 866, 867, 868, 869, 875, 878,
820 883, 951, 1005, 1094, 1102, 1107, 1155, 1191, 1207, 1208,
821 1211, 1212, 1215, 1216, 1228, 1229, 1232, 1238, 1244, 1250,
822 1256, 1262, 1268, 1275, 1281, 1287, 1293, 1299, 1305, 1311,
823 1317, 1323, 1329, 1335, 1355, 1364, 1370, 1371, 1374, 1377,
824 1383, 1390, 1399, 1402, 1405, 1409, 1413, 1417, 1422, 1430,
825 1434, 1439, 1443, 1446, 1450, 1453, 1458, 1459, 1460, 1461,
826 1462, 1463, 1464, 1465, 1466, 1469, 1470, 1471, 1474, 1475,
827 1476, 1480, 1487, 1499, 1505, 1517, 1529, 1532, 1538, 1543,
828 1546, 1551, 1552, 1556, 1572, 1588, 1604, 1620, 1631, 1637,
829 1647, 1670, 1681, 1700, 1706, 1707, 1713, 1714, 1725, 1736,
830 1747, 1757, 1767, 1777, 1780, 1781, 1784, 1785, 1788, 1791,
831 1794, 1802, 1812, 1813, 1816, 1833, 1840, 1847, 1854, 1861,
832 1868, 1877, 1886, 1897, 1898, 1901, 1921, 1931, 1940, 1951,
833 1954, 1959, 1968, 1979, 1982, 1988, 1989, 1993, 1994
838 #if (YYDEBUG) || defined YYERROR_VERBOSE
840 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
841 static const char *const yytname[] =
843 "$", "error", "$undefined.", "CLASS", "FROM", "CONST", "VOID", "STRUCT",
844 "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG", "SHORT",
845 "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER", "TYPETOKEN",
846 "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE", "HCODE",
847 "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
848 "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
849 "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR",
850 "FLAGS", "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
851 "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
852 "'*'", "'>'", "'<'", "'!'", "'-'", "prog", "ccode", "ccodes", "class",
853 "classdec", "classflags", "classcode", "thing", "scope", "destructor",
854 "initializer", "varoptions", "variable", "argument", "export",
855 "property", "param_spec", "param_spec_list", "string", "anyval",
856 "param_spec_value", "argtype", "flags", "flaglist", "type",
857 "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
858 "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
859 "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
860 "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
861 "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
865 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
866 static const short yyr1[] =
868 0, 66, 66, 66, 66, 67, 67, 67, 67, 67,
869 67, 68, 68, 68, 68, 68, 68, 68, 68, 69,
870 69, 70, 71, 71, 71, 71, 72, 72, 73, 73,
871 73, 73, 73, 73, 73, 74, 74, 74, 74, 75,
872 75, 76, 76, 77, 77, 77, 77, 77, 78, 78,
873 79, 79, 79, 80, 80, 81, 81, 81, 82, 82,
874 83, 83, 84, 84, 85, 85, 86, 86, 86, 86,
875 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
876 86, 86, 86, 86, 87, 87, 88, 88, 89, 89,
877 90, 90, 91, 91, 91, 91, 91, 91, 91, 92,
878 92, 92, 92, 92, 92, 92, 93, 93, 93, 93,
879 93, 93, 93, 93, 93, 94, 94, 94, 95, 95,
880 95, 95, 96, 96, 97, 97, 97, 97, 98, 99,
881 99, 100, 100, 101, 101, 101, 101, 101, 101, 101,
882 101, 102, 102, 102, 103, 103, 104, 104, 104, 104,
883 104, 104, 104, 104, 105, 105, 106, 106, 107, 107,
884 107, 107, 108, 108, 109, 109, 109, 109, 109, 109,
885 109, 110, 110, 111, 111, 112, 112, 113, 113, 114,
886 114, 115, 115, 116, 116, 117, 117, 117, 117
889 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
890 static const short yyr2[] =
892 0, 3, 2, 2, 1, 1, 1, 1, 1, 1,
893 1, 2, 2, 2, 2, 1, 1, 1, 1, 4,
894 3, 5, 0, 5, 5, 5, 2, 1, 1, 2,
895 3, 1, 1, 1, 1, 1, 1, 1, 1, 2,
896 3, 2, 3, 2, 2, 1, 1, 0, 5, 6,
897 12, 9, 6, 3, 0, 11, 8, 5, 3, 0,
898 3, 1, 1, 4, 1, 1, 3, 3, 3, 3,
899 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
900 3, 3, 3, 1, 5, 1, 3, 0, 3, 1,
901 2, 1, 1, 1, 2, 2, 2, 3, 3, 2,
902 2, 2, 1, 2, 1, 2, 1, 1, 1, 1,
903 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
904 2, 3, 2, 1, 3, 3, 2, 1, 4, 3,
905 1, 2, 1, 10, 11, 9, 9, 8, 11, 8,
906 5, 2, 4, 0, 1, 2, 1, 1, 2, 2,
907 3, 4, 4, 1, 3, 1, 3, 1, 2, 3,
908 6, 7, 2, 1, 1, 2, 2, 3, 3, 3,
909 3, 7, 8, 3, 1, 3, 1, 7, 8, 3,
910 1, 7, 8, 3, 1, 1, 2, 1, 1
913 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
914 doesn't specify something else to do. Zero means the default is an
916 static const short yydefact[] =
918 0, 0, 0, 5, 7, 8, 6, 9, 10, 0,
919 0, 15, 0, 4, 0, 16, 17, 18, 0, 0,
920 0, 0, 11, 3, 12, 13, 14, 2, 0, 0,
921 0, 0, 0, 1, 0, 35, 36, 37, 38, 0,
922 87, 0, 87, 0, 20, 34, 0, 27, 0, 31,
923 32, 33, 28, 22, 176, 0, 174, 184, 0, 180,
924 0, 0, 0, 0, 0, 29, 0, 0, 0, 0,
925 106, 115, 116, 117, 113, 114, 110, 108, 109, 111,
926 112, 107, 93, 102, 0, 0, 91, 92, 104, 0,
927 0, 0, 19, 26, 0, 87, 0, 0, 21, 0,
928 0, 0, 0, 0, 0, 0, 30, 0, 0, 59,
929 89, 0, 85, 0, 0, 94, 101, 0, 95, 103,
930 100, 0, 0, 118, 90, 105, 99, 96, 0, 0,
931 127, 0, 123, 0, 0, 0, 47, 0, 188, 185,
932 187, 0, 175, 0, 0, 173, 0, 183, 0, 0,
933 179, 0, 0, 0, 0, 0, 0, 86, 0, 54,
934 97, 0, 0, 119, 120, 98, 0, 0, 0, 122,
935 0, 126, 0, 0, 0, 0, 0, 0, 47, 0,
936 0, 46, 45, 0, 0, 0, 0, 186, 171, 0,
937 181, 0, 177, 0, 0, 132, 140, 83, 0, 0,
938 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
939 0, 61, 0, 57, 88, 0, 0, 0, 0, 0,
940 106, 93, 0, 0, 153, 155, 157, 121, 130, 0,
941 125, 124, 0, 0, 0, 0, 39, 0, 0, 0,
942 0, 41, 43, 44, 48, 22, 22, 22, 172, 182,
943 178, 131, 0, 0, 0, 0, 0, 0, 0, 0,
944 0, 0, 0, 0, 58, 0, 0, 0, 0, 52,
945 0, 94, 95, 0, 158, 143, 0, 128, 0, 0,
946 0, 0, 0, 40, 49, 143, 42, 23, 25, 24,
947 0, 62, 66, 67, 68, 69, 188, 65, 70, 64,
948 71, 72, 74, 73, 76, 75, 78, 77, 80, 79,
949 82, 81, 60, 0, 84, 53, 0, 143, 0, 0,
950 150, 159, 0, 0, 0, 154, 156, 129, 0, 0,
951 143, 0, 0, 0, 0, 56, 0, 0, 152, 151,
952 0, 0, 0, 141, 144, 137, 143, 0, 0, 0,
953 139, 0, 0, 0, 51, 135, 0, 164, 0, 0,
954 0, 0, 0, 163, 145, 0, 0, 143, 136, 143,
955 63, 0, 0, 0, 0, 0, 165, 0, 166, 0,
956 160, 162, 142, 133, 0, 0, 55, 0, 161, 169,
957 167, 168, 170, 138, 134, 50, 0, 0, 0
960 static const short yydefgoto[] =
962 396, 11, 12, 13, 14, 98, 46, 47, 48, 181,
963 182, 183, 49, 50, 217, 51, 155, 210, 292, 298,
964 211, 113, 68, 111, 222, 86, 87, 88, 89, 124,
965 130, 131, 132, 229, 196, 52, 324, 343, 223, 224,
966 225, 226, 362, 363, 15, 55, 56, 16, 60, 17,
970 static const short yypact[] =
972 137, 16, 24,-32768,-32768,-32768,-32768,-32768,-32768, 45,
973 99,-32768, 137, 170, 72,-32768,-32768,-32768, 106, 73,
974 81, 98,-32768, 170,-32768,-32768,-32768, 170, 154, 111,
975 151, 183, 186, 170, 215,-32768,-32768,-32768,-32768, 187,
976 158, 310, 158, 182,-32768,-32768, 188,-32768, 276,-32768,
977 -32768,-32768,-32768, 195, 210, 69,-32768,-32768, 113,-32768,
978 115, 214, 301, 190, 276,-32768, 248, 252, 254, 357,
979 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
980 -32768,-32768, 269, 425, 374, 267, 235,-32768, 439, 284,
981 444, 290,-32768,-32768, 374, 158, 293, 311,-32768, 74,
982 315, 76, 316, 84, 339, 90,-32768, 321, 348, 329,
983 334, 345, 356, 399, 453,-32768,-32768, 409,-32768, 453,
984 -32768, 413, 378, 2,-32768, 453,-32768, 429, 224, 416,
985 -32768, 374,-32768, 392, 428, 430, 126, 220,-32768,-32768,
986 -32768, 441,-32768, 405, 451,-32768, 422,-32768, 452, 423,
987 -32768, 460, -32, 427, 258, 21, 252,-32768, 464, 431,
988 -32768, 432, 391, 235,-32768,-32768, 433, 465, 466,-32768,
989 -6,-32768, 470, 374, 435, -6, 374, 26, 0, 391,
990 7, 434, 472, 436, 438, 440, 442,-32768,-32768, 443,
991 -32768, 445,-32768, 446, 471,-32768,-32768,-32768, 447, 448,
992 449, 450, 454, 455, 456, 457, 458, 459, 461, 462,
993 91,-32768, 468,-32768,-32768, 374, 478, 480, 391, 408,
994 467, 6, 482, 469,-32768, 463,-32768,-32768,-32768, 112,
995 -32768,-32768, 473, 485, 391, 490,-32768, 486, 474, 476,
996 487,-32768,-32768,-32768,-32768, 195, 195, 195,-32768,-32768,
997 -32768,-32768, 1, 1, 74, 74, 9, 252, 374, 139,
998 157, 191, 209, 212,-32768, 258, 494, 477, 479, 481,
999 483, 121, 144, 374, 94, 505, 340,-32768, 507, 391,
1000 475, 484, 488,-32768,-32768, 505,-32768,-32768,-32768,-32768,
1001 489,-32768,-32768,-32768,-32768,-32768, 489,-32768,-32768,-32768,
1002 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
1003 -32768,-32768,-32768, 47,-32768,-32768, 503, 505, 374, 374,
1004 -32768, 491, 510, 27, -32,-32768,-32768,-32768, 492, 391,
1005 505, 391, -32, 506, 496,-32768, 54, -32,-32768,-32768,
1006 518, 57, 514, 522,-32768,-32768, 505, 495, -32, 497,
1007 -32768, 498, 521, 499,-32768,-32768, 57,-32768, 500, 64,
1008 66, 501, 50,-32768,-32768, 27, -32, 505,-32768, 505,
1009 -32768, 493, 523, 79, 74, 74,-32768, 74,-32768, 74,
1010 -32768,-32768,-32768,-32768, -32, -32,-32768, 504,-32768,-32768,
1011 -32768,-32768,-32768,-32768,-32768,-32768, 542, 555,-32768
1014 static const short yypgoto[] =
1016 -32768, 202, 104, 544,-32768, 17,-32768, 511, -29, 380,
1017 379, 385,-32768,-32768,-32768,-32768,-32768,-32768, -52,-32768,
1018 299,-32768, -27, -152, -40,-32768, -66,-32768, -60, -107,
1019 437,-32768, -93,-32768, -314, -20, -279, 200, -177, -218,
1020 -32768, 291, 213, -266, 205,-32768, 502, 232,-32768, 239,
1028 static const short yytable[] =
1030 142, 85, 239, 116, 214, 64, 332, 163, 96, 117,
1031 345, 272, 84, 166, 65, 90, 164, 120, 350, 177,
1032 290, 194, 126, 355, 108, 195, 138, 139, 296, 139,
1033 140, 291, 140, 64, 368, 169, 171, 18, 337, 291,
1034 212, 270, 106, 19, 121, 236, 138, 139, 116, 167,
1035 140, 348, 383, 116, 134, 320, 227, 281, 180, 116,
1036 240, 129, -147, 123, 20, 273, 334, 366, 135, 357,
1037 393, 394, 141, 353, 141, 230, 357, 231, 213, 237,
1038 342, 241, 169, 138, 139, 138, 139, 140, 384, 140,
1039 385, 172, 141, 138, 139, 54, 381, 140, 357, 168,
1040 338, 339, 328, 147, 335, 300, 380, 381, 358, 150,
1041 29, 354, 359, 360, 361, 358, 321, 27, 21, 359,
1042 360, 361, 375, 100, 377, 28, 30, 33, 101, 141,
1043 144, 141, 53, 233, 31, 388, 235, 358, 148, 141,
1044 1, 359, 360, 361, 151, 177, 2, 264, 178, 322,
1045 265, 32, 347, 116, 349, 294, 295, 299, 302, 117,
1046 303, 3, 4, 5, 6, 7, 8, 102, 277, 104,
1047 54, 278, 103, 34, 105, 267, 304, -149, 305, 2,
1048 318, 179, 9, 10, 180, 35, 36, 37, 38, 39,
1049 40, 41, 42, 43, 3, 4, 5, 6, 7, 8,
1050 -148, 293, 57, 319, 297, 59, 66, 34, 44, 107,
1051 306, 45, 307, 67, 22, 9, 10, 24, 301, 35,
1052 36, 37, 38, 39, 40, 41, 42, 43, 308, 22,
1053 309, 310, 24, 311, 61, 22, 62, 91, 24, 184,
1054 185, 186, 92, 166, 25, 45, 35, 36, 37, 38,
1055 97, 26, 41, 42, 43, 35, 36, 37, 38, 25,
1056 376, 378, 287, 288, 289, 25, 26, 109, 99, 63,
1057 63, 110, 26, 112, 118, 389, 390, 197, 391, 167,
1058 392, 69, 70, 71, 72, 73, 122, 74, 75, 76,
1059 77, 78, 79, 80, 81, 82, 123, 83, 198, 199,
1060 200, 201, 202, 127, 203, 204, 205, 206, 207, 208,
1061 209, 133, 136, 94, 95, 69, 70, 71, 72, 73,
1062 61, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1063 137, 83, 35, 36, 37, 38, 143, 146, 41, 42,
1064 43, 35, 36, 37, 38, 69, 70, 71, 72, 73,
1065 325, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1066 149, 83, 114, 70, 71, 72, 73, 153, 74, 75,
1067 76, 77, 78, 79, 80, 81, 115, 152, 83, 69,
1068 70, 71, 72, 73, 154, 74, 75, 76, 77, 78,
1069 79, 80, 81, 82, 156, 83, 219, 220, 71, 72,
1070 73, 157, 74, 75, 76, 77, 78, 79, 80, 81,
1071 221, 158, 83, 114, 70, 71, 72, 73, 159, 74,
1072 75, 76, 77, 78, 79, 80, 81, 271, 160, 83,
1073 119, 70, 161, 162, 165, 170, 74, 75, 76, 77,
1074 78, 79, 80, 81, 125, 70, 83, 174, 173, 175,
1075 74, 75, 76, 77, 78, 79, 80, 81, 114, 70,
1076 83, 187, 188, 128, 74, 75, 76, 77, 78, 79,
1077 80, 81, 189, 191, 83, 35, 36, 37, 38, 190,
1078 192, 193, 179, 215, 228, 166, 216, 218, 167, 232,
1079 234, 177, 180, 244, 245, 251, 246, 268, 247, 269,
1080 248, 274, 249, 250, 280, 252, 253, 254, 255, 282,
1081 283, 286, 256, 257, 258, 259, 260, 261, 313, 262,
1082 263, 266, 276, -146, 323, 275, 327, 336, 279, 341,
1083 329, 284, 285, 314, 316, 315, 351, 356, 364, 317,
1084 330, 365, 397, 331, 333, 371, 340, 387, 346, 352,
1085 386, 367, 372, 369, 370, 398, 23, 93, 374, 379,
1086 242, 395, 243, 238, 312, 382, 0, 326, 0, 373,
1087 0, 0, 176, 0, 0, 0, 0, 0, 0, 0,
1088 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1093 static const short yycheck[] =
1095 99, 41, 179, 69, 156, 34, 285, 5, 48, 69,
1096 324, 5, 41, 19, 34, 42, 123, 83, 332, 19,
1097 19, 53, 88, 337, 64, 57, 19, 20, 19, 20,
1098 23, 30, 23, 62, 348, 128, 129, 21, 317, 30,
1099 19, 218, 62, 19, 84, 19, 19, 20, 114, 55,
1100 23, 330, 366, 119, 94, 273, 163, 234, 58, 125,
1101 53, 90, 56, 61, 19, 59, 19, 346, 95, 19,
1102 384, 385, 65, 19, 65, 168, 19, 170, 57, 53,
1103 53, 180, 175, 19, 20, 19, 20, 23, 367, 23,
1104 369, 131, 65, 19, 20, 19, 362, 23, 19, 128,
1105 318, 319, 279, 19, 57, 257, 56, 373, 58, 19,
1106 4, 57, 62, 63, 64, 58, 22, 13, 19, 62,
1107 63, 64, 58, 54, 58, 53, 53, 23, 59, 65,
1108 54, 65, 21, 173, 53, 56, 176, 58, 54, 65,
1109 3, 62, 63, 64, 54, 19, 9, 56, 22, 55,
1110 59, 53, 329, 219, 331, 254, 255, 256, 19, 219,
1111 21, 24, 25, 26, 27, 28, 29, 54, 56, 54,
1112 19, 59, 59, 19, 59, 215, 19, 56, 21, 9,
1113 59, 55, 45, 46, 58, 31, 32, 33, 34, 35,
1114 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
1115 56, 253, 19, 59, 256, 19, 19, 19, 54, 19,
1116 19, 57, 21, 55, 12, 45, 46, 12, 258, 31,
1117 32, 33, 34, 35, 36, 37, 38, 39, 19, 27,
1118 21, 19, 27, 21, 19, 33, 21, 55, 33, 19,
1119 20, 21, 54, 19, 12, 57, 31, 32, 33, 34,
1120 55, 12, 37, 38, 39, 31, 32, 33, 34, 27,
1121 359, 360, 245, 246, 247, 33, 27, 19, 58, 55,
1122 55, 19, 33, 19, 5, 374, 375, 19, 377, 55,
1123 379, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1124 14, 15, 16, 17, 18, 19, 61, 21, 40, 41,
1125 42, 43, 44, 19, 46, 47, 48, 49, 50, 51,
1126 52, 21, 19, 37, 38, 5, 6, 7, 8, 9,
1127 19, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1128 19, 21, 31, 32, 33, 34, 21, 21, 37, 38,
1129 39, 31, 32, 33, 34, 5, 6, 7, 8, 9,
1130 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1131 21, 21, 5, 6, 7, 8, 9, 19, 11, 12,
1132 13, 14, 15, 16, 17, 18, 19, 56, 21, 5,
1133 6, 7, 8, 9, 55, 11, 12, 13, 14, 15,
1134 16, 17, 18, 19, 60, 21, 5, 6, 7, 8,
1135 9, 56, 11, 12, 13, 14, 15, 16, 17, 18,
1136 19, 55, 21, 5, 6, 7, 8, 9, 19, 11,
1137 12, 13, 14, 15, 16, 17, 18, 19, 19, 21,
1138 5, 6, 19, 55, 5, 19, 11, 12, 13, 14,
1139 15, 16, 17, 18, 5, 6, 21, 19, 56, 19,
1140 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
1141 21, 20, 57, 19, 11, 12, 13, 14, 15, 16,
1142 17, 18, 21, 21, 21, 31, 32, 33, 34, 57,
1143 57, 21, 55, 19, 19, 19, 55, 55, 55, 19,
1144 55, 19, 58, 57, 56, 24, 56, 19, 56, 19,
1145 57, 19, 57, 57, 19, 58, 58, 58, 58, 19,
1146 24, 24, 58, 58, 58, 58, 58, 58, 24, 58,
1147 58, 53, 59, 56, 19, 56, 19, 24, 55, 19,
1148 55, 57, 56, 56, 53, 56, 30, 19, 24, 56,
1149 56, 19, 0, 55, 55, 24, 55, 24, 56, 53,
1150 57, 56, 53, 56, 56, 0, 12, 46, 58, 58,
1151 181, 57, 182, 178, 265, 365, -1, 276, -1, 356,
1152 -1, -1, 135, -1, -1, -1, -1, -1, -1, -1,
1153 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1154 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1157 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1158 #line 3 "/usr/share/bison/bison.simple"
1160 /* Skeleton output parser for bison,
1162 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
1165 This program is free software; you can redistribute it and/or modify
1166 it under the terms of the GNU General Public License as published by
1167 the Free Software Foundation; either version 2, or (at your option)
1170 This program is distributed in the hope that it will be useful,
1171 but WITHOUT ANY WARRANTY; without even the implied warranty of
1172 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1173 GNU General Public License for more details.
1175 You should have received a copy of the GNU General Public License
1176 along with this program; if not, write to the Free Software
1177 Foundation, Inc., 59 Temple Place - Suite 330,
1178 Boston, MA 02111-1307, USA. */
1180 /* As a special exception, when this file is copied by Bison into a
1181 Bison output file, you may use that output file without restriction.
1182 This special exception was added by the Free Software Foundation
1183 in version 1.24 of Bison. */
1185 /* This is the parser code that is written into each bison parser when
1186 the %semantic_parser declaration is not specified in the grammar.
1187 It was written by Richard Stallman by simplifying the hairy parser
1188 used when %semantic_parser is specified. */
1190 /* All symbols defined below should begin with yy or YY, to avoid
1191 infringing on user name space. This should be done even for local
1192 variables, as they might otherwise be expanded by user macros.
1193 There are some unavoidable exceptions within include files to
1194 define necessary library symbols; they are noted "INFRINGES ON
1195 USER NAME SPACE" below. */
1197 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
1199 /* The parser invokes alloca or malloc; define the necessary symbols. */
1201 # if YYSTACK_USE_ALLOCA
1202 # define YYSTACK_ALLOC alloca
1204 # ifndef YYSTACK_USE_ALLOCA
1205 # if defined (alloca) || defined (_ALLOCA_H)
1206 # define YYSTACK_ALLOC alloca
1209 # define YYSTACK_ALLOC __builtin_alloca
1215 # ifdef YYSTACK_ALLOC
1216 /* Pacify GCC's `empty if-body' warning. */
1217 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1219 # if defined (__STDC__) || defined (__cplusplus)
1220 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1221 # define YYSIZE_T size_t
1223 # define YYSTACK_ALLOC malloc
1224 # define YYSTACK_FREE free
1226 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
1229 #if (! defined (yyoverflow) \
1230 && (! defined (__cplusplus) \
1231 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1233 /* A type that is properly aligned for any stack member. */
1243 /* The size of the maximum gap between one aligned stack and the next. */
1244 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
1246 /* The size of an array large to enough to hold all stacks, each with
1249 # define YYSTACK_BYTES(N) \
1250 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
1251 + 2 * YYSTACK_GAP_MAX)
1253 # define YYSTACK_BYTES(N) \
1254 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
1258 /* Copy COUNT objects from FROM to TO. The source and destination do
1262 # define YYCOPY(To, From, Count) \
1263 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1265 # define YYCOPY(To, From, Count) \
1268 register YYSIZE_T yyi; \
1269 for (yyi = 0; yyi < (Count); yyi++) \
1270 (To)[yyi] = (From)[yyi]; \
1276 /* Relocate STACK from its old location to the new one. The
1277 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1278 elements in the stack, and YYPTR gives the new location of the
1279 stack. Advance YYPTR to a properly aligned location for the next
1281 # define YYSTACK_RELOCATE(Stack) \
1284 YYSIZE_T yynewbytes; \
1285 YYCOPY (&yyptr->Stack, Stack, yysize); \
1286 Stack = &yyptr->Stack; \
1287 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
1288 yyptr += yynewbytes / sizeof (*yyptr); \
1295 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1296 # define YYSIZE_T __SIZE_TYPE__
1298 #if ! defined (YYSIZE_T) && defined (size_t)
1299 # define YYSIZE_T size_t
1301 #if ! defined (YYSIZE_T)
1302 # if defined (__STDC__) || defined (__cplusplus)
1303 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1304 # define YYSIZE_T size_t
1307 #if ! defined (YYSIZE_T)
1308 # define YYSIZE_T unsigned int
1311 #define yyerrok (yyerrstatus = 0)
1312 #define yyclearin (yychar = YYEMPTY)
1315 #define YYACCEPT goto yyacceptlab
1316 #define YYABORT goto yyabortlab
1317 #define YYERROR goto yyerrlab1
1318 /* Like YYERROR except do call yyerror. This remains here temporarily
1319 to ease the transition to the new meaning of YYERROR, for GCC.
1320 Once GCC version 2 has supplanted version 1, this can go. */
1321 #define YYFAIL goto yyerrlab
1322 #define YYRECOVERING() (!!yyerrstatus)
1323 #define YYBACKUP(Token, Value) \
1325 if (yychar == YYEMPTY && yylen == 1) \
1329 yychar1 = YYTRANSLATE (yychar); \
1335 yyerror ("syntax error: cannot back up"); \
1341 #define YYERRCODE 256
1344 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1347 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
1348 first token. By default, to implement support for ranges, extend
1349 its range to the last symbol. */
1351 #ifndef YYLLOC_DEFAULT
1352 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1353 Current.last_line = Rhs[N].last_line; \
1354 Current.last_column = Rhs[N].last_column;
1358 /* YYLEX -- calling `yylex' with the right arguments. */
1363 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1365 # define YYLEX yylex (&yylval, &yylloc)
1367 # else /* !YYLSP_NEEDED */
1369 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1371 # define YYLEX yylex (&yylval)
1373 # endif /* !YYLSP_NEEDED */
1375 # define YYLEX yylex ()
1376 #endif /* !YYPURE */
1379 /* Enable debugging if requested. */
1383 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1384 # define YYFPRINTF fprintf
1387 # define YYDPRINTF(Args) \
1392 /* Nonzero means print parse trace. It is left uninitialized so that
1393 multiple parsers can coexist. */
1395 #else /* !YYDEBUG */
1396 # define YYDPRINTF(Args)
1397 #endif /* !YYDEBUG */
1399 /* YYINITDEPTH -- initial size of the parser's stacks. */
1401 # define YYINITDEPTH 200
1404 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1405 if the built-in stack extension method is used).
1407 Do not make this value too large; the results are undefined if
1408 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1409 evaluated with infinite-precision integer arithmetic. */
1416 # define YYMAXDEPTH 10000
1419 #ifdef YYERROR_VERBOSE
1422 # if defined (__GLIBC__) && defined (_STRING_H)
1423 # define yystrlen strlen
1425 /* Return the length of YYSTR. */
1427 # if defined (__STDC__) || defined (__cplusplus)
1428 yystrlen (const char *yystr)
1434 register const char *yys = yystr;
1436 while (*yys++ != '\0')
1439 return yys - yystr - 1;
1445 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1446 # define yystpcpy stpcpy
1448 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1451 # if defined (__STDC__) || defined (__cplusplus)
1452 yystpcpy (char *yydest, const char *yysrc)
1454 yystpcpy (yydest, yysrc)
1459 register char *yyd = yydest;
1460 register const char *yys = yysrc;
1462 while ((*yyd++ = *yys++) != '\0')
1471 #line 315 "/usr/share/bison/bison.simple"
1474 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1475 into yyparse. The argument should have type void *.
1476 It should actually point to an object.
1477 Grammar actions can access the variable by casting it
1478 to the proper pointer type. */
1480 #ifdef YYPARSE_PARAM
1481 # if defined (__STDC__) || defined (__cplusplus)
1482 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1483 # define YYPARSE_PARAM_DECL
1485 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
1486 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1488 #else /* !YYPARSE_PARAM */
1489 # define YYPARSE_PARAM_ARG
1490 # define YYPARSE_PARAM_DECL
1491 #endif /* !YYPARSE_PARAM */
1493 /* Prevent warning if -Wstrict-prototypes. */
1495 # ifdef YYPARSE_PARAM
1496 int yyparse (void *);
1502 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
1503 variables are global, or local to YYPARSE. */
1505 #define YY_DECL_NON_LSP_VARIABLES \
1506 /* The lookahead symbol. */ \
1509 /* The semantic value of the lookahead symbol. */ \
1512 /* Number of parse errors so far. */ \
1516 # define YY_DECL_VARIABLES \
1517 YY_DECL_NON_LSP_VARIABLES \
1519 /* Location data for the lookahead symbol. */ \
1522 # define YY_DECL_VARIABLES \
1523 YY_DECL_NON_LSP_VARIABLES
1527 /* If nonreentrant, generate the variables here. */
1531 #endif /* !YYPURE */
1534 yyparse (YYPARSE_PARAM_ARG)
1537 /* If reentrant, generate the variables here. */
1540 #endif /* !YYPURE */
1542 register int yystate;
1545 /* Number of tokens to shift before error messages enabled. */
1547 /* Lookahead token as an internal (translated) token number. */
1550 /* Three stacks and their tools:
1551 `yyss': related to states,
1552 `yyvs': related to semantic values,
1553 `yyls': related to locations.
1555 Refer to the stacks thru separate pointers, to allow yyoverflow
1556 to reallocate them elsewhere. */
1558 /* The state stack. */
1559 short yyssa[YYINITDEPTH];
1560 short *yyss = yyssa;
1561 register short *yyssp;
1563 /* The semantic value stack. */
1564 YYSTYPE yyvsa[YYINITDEPTH];
1565 YYSTYPE *yyvs = yyvsa;
1566 register YYSTYPE *yyvsp;
1569 /* The location stack. */
1570 YYLTYPE yylsa[YYINITDEPTH];
1571 YYLTYPE *yyls = yylsa;
1576 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1578 # define YYPOPSTACK (yyvsp--, yyssp--)
1581 YYSIZE_T yystacksize = YYINITDEPTH;
1584 /* The variables used to return semantic value and location from the
1591 /* When reducing, the number of symbols on the RHS of the reduced
1595 YYDPRINTF ((stderr, "Starting parse\n"));
1600 yychar = YYEMPTY; /* Cause a token to be read. */
1602 /* Initialize stack pointers.
1603 Waste one element of value and location stack
1604 so that they stay on the same level as the state stack.
1605 The wasted elements are never initialized. */
1614 /*------------------------------------------------------------.
1615 | yynewstate -- Push a new state, which is found in yystate. |
1616 `------------------------------------------------------------*/
1618 /* In all cases, when you get here, the value and location stacks
1619 have just been pushed. so pushing a state here evens the stacks.
1626 if (yyssp >= yyss + yystacksize - 1)
1628 /* Get the current used size of the three stacks, in elements. */
1629 YYSIZE_T yysize = yyssp - yyss + 1;
1633 /* Give user a chance to reallocate the stack. Use copies of
1634 these so that the &'s don't force the real ones into
1636 YYSTYPE *yyvs1 = yyvs;
1637 short *yyss1 = yyss;
1639 /* Each stack pointer address is followed by the size of the
1640 data in use in that stack, in bytes. */
1642 YYLTYPE *yyls1 = yyls;
1643 /* This used to be a conditional around just the two extra args,
1644 but that might be undefined if yyoverflow is a macro. */
1645 yyoverflow ("parser stack overflow",
1646 &yyss1, yysize * sizeof (*yyssp),
1647 &yyvs1, yysize * sizeof (*yyvsp),
1648 &yyls1, yysize * sizeof (*yylsp),
1652 yyoverflow ("parser stack overflow",
1653 &yyss1, yysize * sizeof (*yyssp),
1654 &yyvs1, yysize * sizeof (*yyvsp),
1660 #else /* no yyoverflow */
1661 # ifndef YYSTACK_RELOCATE
1664 /* Extend the stack our own way. */
1665 if (yystacksize >= YYMAXDEPTH)
1668 if (yystacksize > YYMAXDEPTH)
1669 yystacksize = YYMAXDEPTH;
1672 short *yyss1 = yyss;
1673 union yyalloc *yyptr =
1674 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1677 YYSTACK_RELOCATE (yyss);
1678 YYSTACK_RELOCATE (yyvs);
1680 YYSTACK_RELOCATE (yyls);
1682 # undef YYSTACK_RELOCATE
1684 YYSTACK_FREE (yyss1);
1687 #endif /* no yyoverflow */
1689 yyssp = yyss + yysize - 1;
1690 yyvsp = yyvs + yysize - 1;
1692 yylsp = yyls + yysize - 1;
1695 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1696 (unsigned long int) yystacksize));
1698 if (yyssp >= yyss + yystacksize - 1)
1702 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1712 /* Do appropriate processing given the current state. */
1713 /* Read a lookahead token if we need one and don't already have one. */
1716 /* First try to decide what to do without reference to lookahead token. */
1718 yyn = yypact[yystate];
1722 /* Not known => get a lookahead token if don't already have one. */
1724 /* yychar is either YYEMPTY or YYEOF
1725 or a valid token in external form. */
1727 if (yychar == YYEMPTY)
1729 YYDPRINTF ((stderr, "Reading a token: "));
1733 /* Convert token to internal form (in yychar1) for indexing tables with */
1735 if (yychar <= 0) /* This means end of input. */
1738 yychar = YYEOF; /* Don't call YYLEX any more */
1740 YYDPRINTF ((stderr, "Now at end of input.\n"));
1744 yychar1 = YYTRANSLATE (yychar);
1747 /* We have to keep this `#if YYDEBUG', since we use variables
1748 which are defined only if `YYDEBUG' is set. */
1751 YYFPRINTF (stderr, "Next token is %d (%s",
1752 yychar, yytname[yychar1]);
1753 /* Give the individual parser a way to print the precise
1754 meaning of a token, for further debugging info. */
1756 YYPRINT (stderr, yychar, yylval);
1758 YYFPRINTF (stderr, ")\n");
1764 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1769 /* yyn is what to do for this token type in this state.
1770 Negative => reduce, -yyn is rule number.
1771 Positive => shift, yyn is new state.
1772 New state is final state => don't bother to shift,
1773 just return success.
1774 0, or most negative number => error. */
1789 /* Shift the lookahead token. */
1790 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1791 yychar, yytname[yychar1]));
1793 /* Discard the token being shifted unless it is eof. */
1794 if (yychar != YYEOF)
1802 /* Count tokens shifted since error; after three, turn off error
1811 /*-----------------------------------------------------------.
1812 | yydefault -- do the default action for the current state. |
1813 `-----------------------------------------------------------*/
1815 yyn = yydefact[yystate];
1821 /*-----------------------------.
1822 | yyreduce -- Do a reduction. |
1823 `-----------------------------*/
1825 /* yyn is the number of a rule to reduce with. */
1828 /* If YYLEN is nonzero, implement the default value of the action:
1831 Otherwise, the following line sets YYVAL to the semantic value of
1832 the lookahead token. This behavior is undocumented and Bison
1833 users should not rely upon it. Assigning to YYVAL
1834 unconditionally makes the parser a bit smaller, and it avoids a
1835 GCC warning that YYVAL may be used uninitialized. */
1836 yyval = yyvsp[1-yylen];
1839 /* Similarly for the default location. Let the user run additional
1840 commands if for instance locations are ranges. */
1841 yyloc = yylsp[1-yylen];
1842 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1846 /* We have to keep this `#if YYDEBUG', since we use variables which
1847 are defined only if `YYDEBUG' is set. */
1852 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1855 /* Print the symbols being reduced, and their result. */
1856 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1857 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1858 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1883 Node *node = node_new (CCODE_NODE,
1885 "cbuf:steal", (yyvsp[0].cbuf)->str,
1886 "line_no", ccode_line,
1888 nodes = g_list_append(nodes,node);
1889 g_string_free(yyvsp[0].cbuf,FALSE);
1895 Node *node = node_new (CCODE_NODE,
1897 "cbuf:steal", (yyvsp[0].cbuf)->str,
1898 "line_no", ccode_line,
1900 nodes = g_list_append(nodes,node);
1901 g_string_free(yyvsp[0].cbuf,FALSE);
1907 Node *node = node_new (CCODE_NODE,
1909 "cbuf:steal", (yyvsp[0].cbuf)->str,
1910 "line_no", ccode_line,
1912 nodes = g_list_append(nodes,node);
1913 g_string_free(yyvsp[0].cbuf,FALSE);
1919 Node *node = node_new (CCODE_NODE,
1921 "cbuf:steal", (yyvsp[0].cbuf)->str,
1922 "line_no", ccode_line,
1924 nodes = g_list_append(nodes,node);
1925 g_string_free(yyvsp[0].cbuf,FALSE);
1931 Node *node = node_new (CCODE_NODE,
1933 "cbuf:steal", (yyvsp[0].cbuf)->str,
1934 "line_no", ccode_line,
1936 nodes = g_list_append(nodes,node);
1937 g_string_free(yyvsp[0].cbuf,FALSE);
1943 Node *node = node_new (CCODE_NODE,
1945 "cbuf:steal", (yyvsp[0].cbuf)->str,
1946 "line_no", ccode_line,
1948 nodes = g_list_append(nodes,node);
1949 g_string_free(yyvsp[0].cbuf,FALSE);
1987 ((Class *)class)->nodes = class_nodes;
1989 nodes = g_list_append(nodes,class);
1995 ((Class *)class)->nodes = NULL;
1997 nodes = g_list_append(nodes,class);
2003 class = node_new (CLASS_NODE,
2004 "otype:steal", yyvsp[-3].id,
2005 "ptype:steal", yyvsp[-1].id,
2006 "bonobo_object_class:steal", bonobo_object_class,
2007 "interfaces:steal", interfaces,
2008 "chunk_size:steal", chunk_size,
2010 bonobo_object_class = NULL;
2018 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2019 g_free (chunk_size);
2020 chunk_size = g_strdup(yyvsp[-2].id);
2021 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2022 g_free (bonobo_object_class);
2023 bonobo_object_class = g_strdup(yyvsp[-2].id);
2025 yyerror(_("parse error"));
2033 if (strcmp (yyvsp[-3].id, "interface") == 0) {
2034 interfaces = g_list_append (interfaces,
2035 g_strdup (yyvsp[-2].id));
2037 yyerror(_("parse error"));
2045 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2046 g_free (chunk_size);
2047 if(atoi(yyvsp[-2].id) != 0)
2048 chunk_size = g_strdup(yyvsp[-2].id);
2052 yyerror(_("parse error"));
2072 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2073 g_free (yyvsp[-1].id);
2074 yyerror (_("parse error"));
2077 g_free (yyvsp[-1].id);
2078 last_added_method->bonobo_object_func = TRUE;
2084 if (strcmp (yyvsp[-2].id, "interface") != 0) {
2085 g_free (yyvsp[-2].id);
2086 g_free (yyvsp[-1].id);
2087 yyerror (_("parse error"));
2090 g_free (yyvsp[-2].id);
2091 node_set ((Node *)last_added_method,
2092 "interface:steal", yyvsp[-1].id,
2114 { the_scope = PUBLIC_SCOPE; }
2118 { the_scope = PRIVATE_SCOPE; }
2122 { the_scope = PROTECTED_SCOPE; }
2126 { the_scope = CLASS_SCOPE; }
2131 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2132 g_free (yyvsp[-1].id);
2133 destructor_unref = FALSE;
2134 destructor = yyvsp[0].id;
2135 destructor_line = line_no;
2136 destructor_simple = TRUE;
2137 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2138 g_free (yyvsp[-1].id);
2139 destructor_unref = TRUE;
2140 destructor = yyvsp[0].id;
2141 destructor_line = line_no;
2142 destructor_simple = TRUE;
2144 g_free (yyvsp[-1].id);
2145 g_free (yyvsp[0].id);
2146 yyerror (_("parse error"));
2154 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2155 g_free(yyvsp[-2].id);
2156 destructor_unref = FALSE;
2157 destructor = (yyvsp[0].cbuf)->str;
2158 g_string_free(yyvsp[0].cbuf, FALSE);
2159 destructor_line = ccode_line;
2160 destructor_simple = FALSE;
2161 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2162 g_free (yyvsp[-2].id);
2163 destructor_unref = TRUE;
2164 destructor = (yyvsp[0].cbuf)->str;
2165 g_string_free (yyvsp[0].cbuf, FALSE);
2166 destructor_line = ccode_line;
2167 destructor_simple = FALSE;
2169 g_free (yyvsp[-2].id);
2170 g_string_free (yyvsp[0].cbuf, TRUE);
2171 yyerror (_("parse error"));
2179 initializer = yyvsp[0].id;
2180 initializer_line = ccode_line;
2186 initializer = (yyvsp[0].cbuf)->str;
2187 initializer_line = ccode_line;
2188 g_string_free(yyvsp[0].cbuf, FALSE);
2201 { destructor = NULL; }
2205 { initializer = NULL; }
2217 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2223 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2230 if(strcmp(yyvsp[-6].id,"get")==0 &&
2231 strcmp(yyvsp[-3].id,"set")==0) {
2232 Type *type = pop_type();
2233 g_free (yyvsp[-6].id);
2234 g_free (yyvsp[-3].id);
2235 node = node_new (ARGUMENT_NODE,
2236 "gtktype:steal", yyvsp[-9].id,
2237 "atype:steal", type,
2238 "flags:steal", yyvsp[-10].list,
2239 "name:steal", yyvsp[-8].id,
2240 "get:steal", (yyvsp[-4].cbuf)->str,
2241 "get_line", yyvsp[-5].line,
2242 "set:steal", (yyvsp[-1].cbuf)->str,
2243 "set_line", yyvsp[-2].line,
2244 "line_no", yyvsp[-11].line,
2247 class_nodes = g_list_append(class_nodes,node);
2249 g_string_free (yyvsp[-4].cbuf, FALSE);
2250 g_string_free (yyvsp[-1].cbuf, FALSE);
2252 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2253 strcmp(yyvsp[-3].id,"get")==0) {
2254 Type *type = pop_type();
2255 g_free (yyvsp[-6].id);
2256 g_free (yyvsp[-3].id);
2257 node = node_new (ARGUMENT_NODE,
2258 "gtktype:steal", yyvsp[-9].id,
2259 "atype:steal", type,
2260 "flags:steal", yyvsp[-10].list,
2261 "name:steal", yyvsp[-8].id,
2262 "get:steal", (yyvsp[-1].cbuf)->str,
2263 "get_line", yyvsp[-2].line,
2264 "set:steal", (yyvsp[-4].cbuf)->str,
2265 "set_line", yyvsp[-5].line,
2266 "line_no", yyvsp[-11].line,
2268 g_string_free (yyvsp[-1].cbuf, FALSE);
2269 g_string_free (yyvsp[-4].cbuf, FALSE);
2270 class_nodes = g_list_append(class_nodes,node);
2272 g_free (yyvsp[-9].id);
2273 g_free (yyvsp[-8].id);
2274 g_free (yyvsp[-6].id);
2275 g_free (yyvsp[-3].id);
2276 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2277 g_list_free (yyvsp[-10].list);
2278 g_string_free (yyvsp[-1].cbuf, TRUE);
2279 g_string_free (yyvsp[-4].cbuf, TRUE);
2280 yyerror (_("parse error"));
2284 if (yyvsp[-7].id != NULL) {
2285 Argument *arg = (Argument *)node;
2286 export_accessors (arg->name,
2287 arg->get != NULL, arg->get_line,
2288 arg->set != NULL, arg->set_line,
2292 g_free (yyvsp[-7].id);
2301 if(strcmp(yyvsp[-3].id, "get") == 0) {
2302 Type *type = pop_type();
2303 g_free (yyvsp[-3].id);
2304 node = node_new (ARGUMENT_NODE,
2305 "gtktype:steal", yyvsp[-6].id,
2306 "atype:steal", type,
2307 "flags:steal", yyvsp[-7].list,
2308 "name:steal", yyvsp[-5].id,
2309 "get:steal", (yyvsp[-1].cbuf)->str,
2310 "get_line", yyvsp[-2].line,
2311 "line_no", yyvsp[-8].line,
2314 g_string_free (yyvsp[-1].cbuf, FALSE);
2315 class_nodes = g_list_append(class_nodes, node);
2316 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2317 Type *type = pop_type();
2318 g_free (yyvsp[-3].id);
2319 node = node_new (ARGUMENT_NODE,
2320 "gtktype:steal", yyvsp[-6].id,
2321 "atype:steal", type,
2322 "flags:steal", yyvsp[-7].list,
2323 "name:steal", yyvsp[-5].id,
2324 "set:steal", (yyvsp[-1].cbuf)->str,
2325 "set_line", yyvsp[-2].line,
2326 "line_no", yyvsp[-8].line,
2329 g_string_free (yyvsp[-1].cbuf, FALSE);
2330 class_nodes = g_list_append (class_nodes, node);
2332 g_free (yyvsp[-3].id);
2333 g_free (yyvsp[-6].id);
2334 g_free (yyvsp[-5].id);
2335 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2336 g_list_free (yyvsp[-7].list);
2337 g_string_free (yyvsp[-1].cbuf, TRUE);
2338 yyerror(_("parse error"));
2342 if (yyvsp[-4].id != NULL) {
2343 Argument *arg = (Argument *)node;
2344 export_accessors (arg->name,
2345 arg->get != NULL, arg->get_line,
2346 arg->set != NULL, arg->set_line,
2350 g_free (yyvsp[-4].id);
2355 #line 1005 "parse.y"
2358 char *get, *set = NULL;
2363 if(strcmp(yyvsp[0].id, "link")!=0 &&
2364 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2365 strcmp(yyvsp[0].id, "objectlink")!=0) {
2366 g_free(yyvsp[0].id);
2367 g_free(yyvsp[-3].id);
2368 g_free(yyvsp[-2].id);
2369 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2370 g_list_free(yyvsp[-4].list);
2371 yyerror(_("parse error"));
2377 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2378 if(var->scope == PRIVATE_SCOPE) {
2379 root = "self->_priv";
2380 } else if(var->scope == CLASS_SCOPE) {
2381 root = "SELF_GET_CLASS(self)";
2383 error_print(GOB_ERROR, yyvsp[-5].line,
2384 _("Self aliases needed when autolinking to a classwide member"));
2389 if(strcmp(yyvsp[0].id, "link")==0) {
2390 set = g_strdup_printf("%s->%s = ARG;",
2391 root, yyvsp[-2].id);
2392 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2393 set = g_strdup_printf("g_free (%s->%s); "
2394 "%s->%s = g_strdup (ARG);",
2396 root, yyvsp[-2].id);
2397 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2398 set = g_strdup_printf(
2400 "g_object_ref (G_OBJECT (ARG)); "
2401 "if (%s->%s != NULL) "
2402 "g_object_unref (G_OBJECT (%s->%s)); "
2406 root, yyvsp[-2].id);
2408 g_assert_not_reached();
2411 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2413 g_free (yyvsp[0].id);
2416 type = (Type *)node_copy ((Node *)var->vtype);
2418 node = node_new (ARGUMENT_NODE,
2419 "gtktype:steal", yyvsp[-3].id,
2420 "atype:steal", type,
2421 "flags:steal", yyvsp[-4].list,
2422 "name:steal", yyvsp[-2].id,
2424 "get_line", yyvsp[-5].line,
2426 "set_line", yyvsp[-5].line,
2427 "line_no", yyvsp[-5].line,
2430 if (yyvsp[-1].id != NULL) {
2431 Argument *arg = (Argument *)node;
2432 export_accessors (arg->name,
2433 arg->get != NULL, arg->get_line,
2434 arg->set != NULL, arg->set_line,
2438 g_free (yyvsp[-1].id);
2441 class_nodes = g_list_append (class_nodes, node);
2445 #line 1094 "parse.y"
2447 if (strcmp (yyvsp[-1].id, "export")!=0) {
2448 g_free (yyvsp[-1].id);
2449 yyerror (_("parse error"));
2452 yyval.id = yyvsp[-1].id;
2456 #line 1102 "parse.y"
2462 #line 1107 "parse.y"
2465 node_set ((Node *)property,
2466 "line_no", yyvsp[-10].line,
2467 "gtktype:steal", debool (yyvsp[-9].id),
2468 "name:steal", yyvsp[-8].id,
2470 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2471 strcmp (yyvsp[-3].id, "set") == 0) {
2472 node_set ((Node *)property,
2473 "get:steal", (yyvsp[-4].cbuf)->str,
2474 "get_line", yyvsp[-5].line,
2475 "set:steal", (yyvsp[-1].cbuf)->str,
2476 "set_line", yyvsp[-2].line,
2478 g_string_free (yyvsp[-4].cbuf, FALSE);
2479 g_string_free (yyvsp[-1].cbuf, FALSE);
2480 g_free (yyvsp[-6].id);
2481 g_free (yyvsp[-3].id);
2482 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2483 strcmp (yyvsp[-3].id, "get") == 0) {
2484 node_set ((Node *)property,
2485 "get:steal", (yyvsp[-1].cbuf)->str,
2486 "get_line", yyvsp[-2].line,
2487 "set:steal", (yyvsp[-4].cbuf)->str,
2488 "set_line", yyvsp[-5].line,
2490 g_string_free (yyvsp[-4].cbuf, FALSE);
2491 g_string_free (yyvsp[-1].cbuf, FALSE);
2492 g_free (yyvsp[-6].id);
2493 g_free (yyvsp[-3].id);
2495 g_string_free (yyvsp[-4].cbuf, TRUE);
2496 g_string_free (yyvsp[-1].cbuf, TRUE);
2497 g_free (yyvsp[-6].id);
2498 g_free (yyvsp[-3].id);
2499 node_free ((Node *)property);
2501 yyerror (_("parse error"));
2504 property_link_and_export ((Node *)property);
2505 if (property != NULL) {
2506 class_nodes = g_list_append (class_nodes,
2513 #line 1155 "parse.y"
2516 node_set ((Node *)property,
2517 "line_no", yyvsp[-7].line,
2518 "gtktype:steal", debool (yyvsp[-6].id),
2519 "name:steal", yyvsp[-5].id,
2521 if (strcmp (yyvsp[-3].id, "get") == 0) {
2522 node_set ((Node *)property,
2523 "get:steal", (yyvsp[-1].cbuf)->str,
2524 "get_line", yyvsp[-2].line,
2526 g_string_free (yyvsp[-1].cbuf, FALSE);
2527 g_free (yyvsp[-3].id);
2528 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2529 node_set ((Node *)property,
2530 "set:steal", (yyvsp[-1].cbuf)->str,
2531 "set_line", yyvsp[-2].line,
2533 g_string_free (yyvsp[-1].cbuf, FALSE);
2534 g_free (yyvsp[-3].id);
2536 g_string_free (yyvsp[-1].cbuf, TRUE);
2537 g_free (yyvsp[-3].id);
2538 node_free ((Node *)property);
2540 yyerror (_("parse error"));
2543 property_link_and_export ((Node *)property);
2544 if (property != NULL) {
2545 class_nodes = g_list_append (class_nodes,
2552 #line 1191 "parse.y"
2555 node_set ((Node *)property,
2556 "line_no", yyvsp[-4].line,
2557 "gtktype:steal", debool (yyvsp[-3].id),
2558 "name:steal", yyvsp[-2].id,
2560 property_link_and_export ((Node *)property);
2561 if (property != NULL) {
2562 class_nodes = g_list_append (class_nodes,
2569 #line 1207 "parse.y"
2573 #line 1208 "parse.y"
2577 #line 1211 "parse.y"
2581 #line 1212 "parse.y"
2585 #line 1215 "parse.y"
2586 { yyval.id = yyvsp[0].id; }
2589 #line 1216 "parse.y"
2591 if (strcmp (yyvsp[-3].id, "_") != 0) {
2592 g_free (yyvsp[-3].id);
2593 yyerror(_("parse error"));
2596 g_free (yyvsp[-3].id);
2597 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2598 g_free (yyvsp[-1].id);
2602 #line 1228 "parse.y"
2603 { yyval.id = yyvsp[0].id; }
2606 #line 1229 "parse.y"
2607 { yyval.id = yyvsp[0].id; }
2610 #line 1232 "parse.y"
2613 node_set ((Node *)property,
2614 "nick:steal", yyvsp[0].id,
2619 #line 1238 "parse.y"
2622 node_set ((Node *)property,
2623 "blurb:steal", yyvsp[0].id,
2628 #line 1244 "parse.y"
2631 node_set ((Node *)property,
2632 "maximum:steal", yyvsp[0].id,
2637 #line 1250 "parse.y"
2640 node_set ((Node *)property,
2641 "minimum:steal", yyvsp[0].id,
2646 #line 1256 "parse.y"
2649 node_set ((Node *)property,
2650 "default_value:steal", yyvsp[0].id,
2655 #line 1262 "parse.y"
2658 node_set ((Node *)property,
2659 "flags:steal", yyvsp[0].list,
2664 #line 1268 "parse.y"
2666 Type *type = pop_type ();
2668 node_set ((Node *)property,
2669 "ptype:steal", type,
2674 #line 1275 "parse.y"
2677 node_set ((Node *)property,
2678 "extra_gtktype:steal", yyvsp[0].id,
2683 #line 1281 "parse.y"
2686 node_set ((Node *)property,
2687 "extra_gtktype:steal", yyvsp[0].id,
2692 #line 1287 "parse.y"
2695 node_set ((Node *)property,
2696 "extra_gtktype:steal", yyvsp[0].id,
2701 #line 1293 "parse.y"
2704 node_set ((Node *)property,
2705 "extra_gtktype:steal", yyvsp[0].id,
2710 #line 1299 "parse.y"
2713 node_set ((Node *)property,
2714 "extra_gtktype:steal", yyvsp[0].id,
2719 #line 1305 "parse.y"
2722 node_set ((Node *)property,
2723 "extra_gtktype:steal", yyvsp[0].id,
2728 #line 1311 "parse.y"
2731 node_set ((Node *)property,
2732 "extra_gtktype:steal", yyvsp[0].id,
2737 #line 1317 "parse.y"
2740 node_set ((Node *)property,
2741 "extra_gtktype:steal", yyvsp[0].id,
2746 #line 1323 "parse.y"
2749 node_set ((Node *)property,
2750 "extra_gtktype:steal", yyvsp[0].id,
2755 #line 1329 "parse.y"
2758 node_set ((Node *)property,
2759 "extra_gtktype:steal", yyvsp[0].id,
2764 #line 1335 "parse.y"
2767 if (strcmp (yyvsp[0].id, "link") == 0) {
2768 g_free(yyvsp[0].id);
2769 node_set ((Node *)property,
2772 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2773 g_free(yyvsp[0].id);
2774 node_set ((Node *)property,
2778 g_free(yyvsp[0].id);
2779 yyerror(_("parse error"));
2785 #line 1355 "parse.y"
2787 if(strcmp(yyvsp[-2].id,"type")!=0) {
2788 g_free(yyvsp[-4].id);
2789 g_free(yyvsp[-2].id);
2790 yyerror(_("parse error"));
2793 yyval.id = debool (yyvsp[-4].id);
2797 #line 1364 "parse.y"
2799 yyval.id = debool (yyvsp[0].id);
2800 typestack = g_list_prepend(typestack,NULL);
2804 #line 1370 "parse.y"
2805 { yyval.list = yyvsp[-1].list; }
2808 #line 1371 "parse.y"
2809 { yyval.list = NULL; }
2812 #line 1374 "parse.y"
2814 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2818 #line 1377 "parse.y"
2820 yyval.list = g_list_append(NULL,yyvsp[0].id);
2824 #line 1383 "parse.y"
2826 Node *node = node_new (TYPE_NODE,
2827 "name:steal", yyvsp[-1].id,
2828 "pointer:steal", yyvsp[0].id,
2830 typestack = g_list_prepend(typestack,node);
2834 #line 1390 "parse.y"
2836 Node *node = node_new (TYPE_NODE,
2837 "name:steal", yyvsp[0].id,
2839 typestack = g_list_prepend(typestack,node);
2843 #line 1399 "parse.y"
2845 yyval.id = yyvsp[0].id;
2849 #line 1402 "parse.y"
2851 yyval.id = yyvsp[0].id;
2855 #line 1405 "parse.y"
2857 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2858 g_free(yyvsp[0].id);
2862 #line 1409 "parse.y"
2864 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2865 g_free(yyvsp[-1].id);
2869 #line 1413 "parse.y"
2871 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2872 g_free(yyvsp[0].id);
2876 #line 1417 "parse.y"
2878 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2880 g_free(yyvsp[0].id);
2884 #line 1422 "parse.y"
2886 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2887 yyvsp[-1].id, " const", NULL);
2888 g_free(yyvsp[-1].id);
2892 #line 1430 "parse.y"
2894 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2895 g_free(yyvsp[0].id);
2899 #line 1434 "parse.y"
2901 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2902 g_free(yyvsp[-1].id);
2903 g_free(yyvsp[0].id);
2907 #line 1439 "parse.y"
2909 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2910 g_free(yyvsp[0].id);
2914 #line 1443 "parse.y"
2916 yyval.id = yyvsp[0].id;
2920 #line 1446 "parse.y"
2922 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2923 g_free(yyvsp[-1].id);
2927 #line 1450 "parse.y"
2929 yyval.id = g_strdup(yyvsp[0].id);
2933 #line 1453 "parse.y"
2935 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2939 #line 1458 "parse.y"
2940 { yyval.id = "void"; }
2943 #line 1459 "parse.y"
2944 { yyval.id = "char"; }
2947 #line 1460 "parse.y"
2948 { yyval.id = "short"; }
2951 #line 1461 "parse.y"
2952 { yyval.id = "int"; }
2955 #line 1462 "parse.y"
2956 { yyval.id = "long"; }
2959 #line 1463 "parse.y"
2960 { yyval.id = "float"; }
2963 #line 1464 "parse.y"
2964 { yyval.id = "double"; }
2967 #line 1465 "parse.y"
2968 { yyval.id = "signed"; }
2971 #line 1466 "parse.y"
2972 { yyval.id = "unsigned"; }
2975 #line 1469 "parse.y"
2976 { yyval.id = "struct"; }
2979 #line 1470 "parse.y"
2980 { yyval.id = "union"; }
2983 #line 1471 "parse.y"
2984 { yyval.id = "enum"; }
2987 #line 1474 "parse.y"
2988 { yyval.id = g_strdup("*"); }
2991 #line 1475 "parse.y"
2992 { yyval.id = g_strdup("* const"); }
2995 #line 1476 "parse.y"
2997 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2998 g_free(yyvsp[0].id);
3002 #line 1480 "parse.y"
3004 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3005 g_free(yyvsp[0].id);
3009 #line 1487 "parse.y"
3011 if(strcmp(yyvsp[-1].id, "first")==0)
3012 yyval.sigtype = SIGNAL_FIRST_METHOD;
3013 else if(strcmp(yyvsp[-1].id, "last")==0)
3014 yyval.sigtype = SIGNAL_LAST_METHOD;
3016 yyerror(_("signal must be 'first' or 'last'"));
3017 g_free(yyvsp[-1].id);
3020 g_free(yyvsp[-1].id);
3024 #line 1499 "parse.y"
3026 yyval.sigtype = SIGNAL_LAST_METHOD;
3030 #line 1505 "parse.y"
3032 if(strcmp(yyvsp[-1].id,"first")==0)
3033 yyval.sigtype = SIGNAL_FIRST_METHOD;
3034 else if(strcmp(yyvsp[-1].id,"last")==0)
3035 yyval.sigtype = SIGNAL_LAST_METHOD;
3037 yyerror(_("signal must be 'first' or 'last'"));
3038 g_free(yyvsp[-1].id);
3041 g_free(yyvsp[-1].id);
3045 #line 1517 "parse.y"
3047 if(strcmp(yyvsp[-2].id,"first")==0)
3048 yyval.sigtype = SIGNAL_FIRST_METHOD;
3049 else if(strcmp(yyvsp[-2].id,"last")==0)
3050 yyval.sigtype = SIGNAL_LAST_METHOD;
3052 yyerror(_("signal must be 'first' or 'last'"));
3053 g_free(yyvsp[-2].id);
3056 g_free(yyvsp[-2].id);
3060 #line 1529 "parse.y"
3062 yyval.sigtype = SIGNAL_LAST_METHOD;
3066 #line 1532 "parse.y"
3068 /* the_scope was default thus public */
3069 the_scope = PUBLIC_SCOPE;
3073 #line 1538 "parse.y"
3075 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3079 #line 1543 "parse.y"
3081 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3085 #line 1546 "parse.y"
3087 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3091 #line 1551 "parse.y"
3092 { yyval.cbuf = yyvsp[0].cbuf; }
3095 #line 1552 "parse.y"
3096 { yyval.cbuf = NULL; }
3099 #line 1556 "parse.y"
3102 yyerror(_("signal without 'self' as "
3103 "first parameter"));
3104 free_all_global_state();
3107 if(the_scope == CLASS_SCOPE) {
3108 yyerror(_("a method cannot be of class scope"));
3109 free_all_global_state();
3112 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3113 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3114 ccode_line, vararg, yyvsp[-8].list);
3118 #line 1572 "parse.y"
3121 yyerror(_("signal without 'self' as "
3122 "first parameter"));
3123 free_all_global_state();
3126 if(the_scope == CLASS_SCOPE) {
3127 yyerror(_("a method cannot be of class scope"));
3128 free_all_global_state();
3131 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3132 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3133 ccode_line, vararg, yyvsp[-8].list);
3137 #line 1588 "parse.y"
3140 yyerror(_("virtual method without 'self' as "
3141 "first parameter"));
3142 free_all_global_state();
3145 if(the_scope == CLASS_SCOPE) {
3146 yyerror(_("a method cannot be of class scope"));
3147 free_all_global_state();
3150 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3151 yyvsp[0].cbuf, yyvsp[-8].line,
3152 ccode_line, vararg, NULL);
3156 #line 1604 "parse.y"
3159 yyerror(_("virtual method without 'self' as "
3160 "first parameter"));
3161 free_all_global_state();
3164 if(the_scope == CLASS_SCOPE) {
3165 yyerror(_("a method cannot be of class scope"));
3166 free_all_global_state();
3169 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3170 yyvsp[0].cbuf, yyvsp[-7].line,
3171 ccode_line, vararg, NULL);
3175 #line 1620 "parse.y"
3178 yyerror(_("virtual method without 'self' as "
3179 "first parameter"));
3180 free_all_global_state();
3183 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3184 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3185 ccode_line, vararg, NULL);
3189 #line 1631 "parse.y"
3191 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3192 yyvsp[-5].id, yyvsp[0].cbuf,
3193 yyvsp[-10].line, ccode_line,
3198 #line 1637 "parse.y"
3200 if(the_scope == CLASS_SCOPE) {
3201 yyerror(_("a method cannot be of class scope"));
3202 free_all_global_state();
3205 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3206 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3211 #line 1647 "parse.y"
3213 if(strcmp(yyvsp[-4].id, "init")==0) {
3214 push_init_arg(yyvsp[-2].id,FALSE);
3215 push_function(NO_SCOPE, INIT_METHOD, NULL,
3216 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3217 ccode_line, FALSE, NULL);
3218 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3219 push_init_arg(yyvsp[-2].id,TRUE);
3220 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3221 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3222 ccode_line, FALSE, NULL);
3224 g_free(yyvsp[-4].id);
3225 g_free(yyvsp[-2].id);
3226 g_string_free(yyvsp[0].cbuf,TRUE);
3227 yyerror(_("parse error "
3228 "(untyped blocks must be init or "
3235 #line 1670 "parse.y"
3237 g_free(onerror); onerror = NULL;
3238 g_free(defreturn); defreturn = NULL;
3239 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3240 g_free(yyvsp[-1].id);
3241 g_free(yyvsp[0].id);
3242 yyerror(_("parse error"));
3245 g_free(yyvsp[-1].id);
3249 #line 1681 "parse.y"
3251 g_free(onerror); onerror = NULL;
3252 g_free(defreturn); defreturn = NULL;
3253 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3254 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3255 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3256 yyerror(_("parse error"));
3259 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3260 onerror = defreturn = NULL;
3261 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3262 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3263 yyerror(_("parse error"));
3266 g_free(yyvsp[-3].id);
3267 g_free(yyvsp[-1].id);
3271 #line 1700 "parse.y"
3273 g_free(onerror); onerror = NULL;
3274 g_free(defreturn); defreturn = NULL;
3278 #line 1706 "parse.y"
3279 { yyval.id = yyvsp[0].id; }
3282 #line 1707 "parse.y"
3284 yyval.id = (yyvsp[0].cbuf)->str;
3285 g_string_free(yyvsp[0].cbuf, FALSE);
3289 #line 1713 "parse.y"
3290 { vararg = FALSE; has_self = FALSE; }
3293 #line 1714 "parse.y"
3297 if(strcmp(yyvsp[0].id,"self")==0)
3298 push_self(yyvsp[0].id, FALSE);
3300 g_free(yyvsp[0].id);
3301 yyerror(_("parse error"));
3307 #line 1725 "parse.y"
3311 if(strcmp(yyvsp[-1].id,"self")==0)
3312 push_self(yyvsp[-1].id, TRUE);
3314 g_free(yyvsp[-1].id);
3315 yyerror(_("parse error"));
3321 #line 1736 "parse.y"
3325 if(strcmp(yyvsp[0].id,"self")==0)
3326 push_self(yyvsp[0].id, TRUE);
3328 g_free(yyvsp[0].id);
3329 yyerror(_("parse error"));
3335 #line 1747 "parse.y"
3338 if(strcmp(yyvsp[-2].id,"self")==0)
3339 push_self(yyvsp[-2].id, FALSE);
3341 g_free(yyvsp[-2].id);
3342 yyerror(_("parse error"));
3348 #line 1757 "parse.y"
3351 if(strcmp(yyvsp[-3].id,"self")==0)
3352 push_self(yyvsp[-3].id, TRUE);
3354 g_free(yyvsp[-3].id);
3355 yyerror(_("parse error"));
3361 #line 1767 "parse.y"
3364 if(strcmp(yyvsp[-2].id,"self")==0)
3365 push_self(yyvsp[-2].id, TRUE);
3367 g_free(yyvsp[-2].id);
3368 yyerror(_("parse error"));
3374 #line 1777 "parse.y"
3375 { has_self = FALSE; }
3378 #line 1780 "parse.y"
3382 #line 1781 "parse.y"
3386 #line 1784 "parse.y"
3390 #line 1785 "parse.y"
3394 #line 1788 "parse.y"
3396 push_funcarg(yyvsp[0].id,NULL);
3400 #line 1791 "parse.y"
3402 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3406 #line 1794 "parse.y"
3408 if(strcmp(yyvsp[-2].id,"check")!=0) {
3409 yyerror(_("parse error"));
3412 g_free(yyvsp[-2].id);
3413 push_funcarg(yyvsp[-4].id,NULL);
3417 #line 1802 "parse.y"
3419 if(strcmp(yyvsp[-2].id,"check")!=0) {
3420 yyerror(_("parse error"));
3423 g_free(yyvsp[-2].id);
3424 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3428 #line 1812 "parse.y"
3432 #line 1813 "parse.y"
3436 #line 1816 "parse.y"
3438 if(strcmp(yyvsp[0].id,"type")==0) {
3439 Node *node = node_new (CHECK_NODE,
3440 "chtype", TYPE_CHECK,
3442 checks = g_list_append(checks,node);
3443 } else if(strcmp(yyvsp[0].id,"null")==0) {
3444 Node *node = node_new (CHECK_NODE,
3445 "chtype", NULL_CHECK,
3447 checks = g_list_append(checks,node);
3449 yyerror(_("parse error"));
3452 g_free(yyvsp[0].id);
3456 #line 1833 "parse.y"
3458 Node *node = node_new (CHECK_NODE,
3460 "number:steal", yyvsp[0].id,
3462 checks = g_list_append(checks,node);
3466 #line 1840 "parse.y"
3468 Node *node = node_new (CHECK_NODE,
3470 "number:steal", yyvsp[0].id,
3472 checks = g_list_append(checks,node);
3476 #line 1847 "parse.y"
3478 Node *node = node_new (CHECK_NODE,
3480 "number:steal", yyvsp[0].id,
3482 checks = g_list_append(checks,node);
3486 #line 1854 "parse.y"
3488 Node *node = node_new (CHECK_NODE,
3490 "number:steal", yyvsp[0].id,
3492 checks = g_list_append(checks,node);
3496 #line 1861 "parse.y"
3498 Node *node = node_new (CHECK_NODE,
3500 "number:steal", yyvsp[0].id,
3502 checks = g_list_append(checks,node);
3506 #line 1868 "parse.y"
3508 Node *node = node_new (CHECK_NODE,
3510 "number:steal", yyvsp[0].id,
3512 checks = g_list_append(checks,node);
3516 #line 1877 "parse.y"
3518 Node *node = node_new (ENUMDEF_NODE,
3519 "etype:steal", yyvsp[-1].id,
3520 "prefix:steal", yyvsp[-5].id,
3521 "values:steal", enum_vals,
3524 nodes = g_list_append (nodes, node);
3528 #line 1886 "parse.y"
3530 Node *node = node_new (ENUMDEF_NODE,
3531 "etype:steal", yyvsp[-1].id,
3532 "prefix:steal", yyvsp[-6].id,
3533 "values:steal", enum_vals,
3536 nodes = g_list_append (nodes, node);
3540 #line 1897 "parse.y"
3544 #line 1898 "parse.y"
3548 #line 1901 "parse.y"
3551 char *num = yyvsp[0].id;
3553 /* A float value, that's a bad enum */
3554 if (num[0] >= '0' &&
3556 strchr (num, '.') != NULL) {
3557 g_free (yyvsp[-2].id);
3559 yyerror(_("parse error (enumerator value not integer constant)"));
3563 node = node_new (ENUMVALUE_NODE,
3564 "name:steal", yyvsp[-2].id,
3567 enum_vals = g_list_append (enum_vals, node);
3571 #line 1921 "parse.y"
3575 node = node_new (ENUMVALUE_NODE,
3576 "name:steal", yyvsp[0].id,
3578 enum_vals = g_list_append (enum_vals, node);
3582 #line 1931 "parse.y"
3584 Node *node = node_new (FLAGS_NODE,
3585 "ftype:steal", yyvsp[-1].id,
3586 "prefix:steal", yyvsp[-5].id,
3587 "values:steal", flag_vals,
3590 nodes = g_list_append (nodes, node);
3594 #line 1940 "parse.y"
3596 Node *node = node_new (FLAGS_NODE,
3597 "ftype:steal", yyvsp[-1].id,
3598 "prefix:steal", yyvsp[-6].id,
3599 "values:steal", flag_vals,
3602 nodes = g_list_append (nodes, node);
3606 #line 1951 "parse.y"
3608 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3612 #line 1954 "parse.y"
3614 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3618 #line 1959 "parse.y"
3620 Node *node = node_new (ERROR_NODE,
3621 "etype:steal", yyvsp[-1].id,
3622 "prefix:steal", yyvsp[-5].id,
3623 "values:steal", error_vals,
3626 nodes = g_list_append (nodes, node);
3630 #line 1968 "parse.y"
3632 Node *node = node_new (ERROR_NODE,
3633 "etype:steal", yyvsp[-1].id,
3634 "prefix:steal", yyvsp[-6].id,
3635 "values:steal", error_vals,
3638 nodes = g_list_append (nodes, node);
3642 #line 1979 "parse.y"
3644 error_vals = g_list_append (error_vals, yyvsp[0].id);
3648 #line 1982 "parse.y"
3650 error_vals = g_list_append (error_vals, yyvsp[0].id);
3654 #line 1988 "parse.y"
3655 { yyval.id = yyvsp[0].id; }
3658 #line 1989 "parse.y"
3660 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3661 g_free(yyvsp[0].id);
3665 #line 1993 "parse.y"
3666 { yyval.id = yyvsp[0].id; }
3669 #line 1994 "parse.y"
3670 { yyval.id = yyvsp[0].id; }
3674 #line 705 "/usr/share/bison/bison.simple"
3686 short *yyssp1 = yyss - 1;
3687 YYFPRINTF (stderr, "state stack now");
3688 while (yyssp1 != yyssp)
3689 YYFPRINTF (stderr, " %d", *++yyssp1);
3690 YYFPRINTF (stderr, "\n");
3699 /* Now `shift' the result of the reduction. Determine what state
3700 that goes to, based on the state we popped back to and the rule
3701 number reduced by. */
3705 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3706 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3707 yystate = yytable[yystate];
3709 yystate = yydefgoto[yyn - YYNTBASE];
3714 /*------------------------------------.
3715 | yyerrlab -- here on detecting error |
3716 `------------------------------------*/
3718 /* If not already recovering from an error, report this error. */
3723 #ifdef YYERROR_VERBOSE
3724 yyn = yypact[yystate];
3726 if (yyn > YYFLAG && yyn < YYLAST)
3728 YYSIZE_T yysize = 0;
3733 /* Start YYX at -YYN if negative to avoid negative indexes in
3735 for (yyx = yyn < 0 ? -yyn : 0;
3736 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
3737 if (yycheck[yyx + yyn] == yyx)
3738 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
3739 yysize += yystrlen ("parse error, unexpected ") + 1;
3740 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
3741 yymsg = (char *) YYSTACK_ALLOC (yysize);
3744 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
3745 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
3750 for (yyx = yyn < 0 ? -yyn : 0;
3751 yyx < (int) (sizeof (yytname) / sizeof (char *));
3753 if (yycheck[yyx + yyn] == yyx)
3755 const char *yyq = ! yycount ? ", expecting " : " or ";
3756 yyp = yystpcpy (yyp, yyq);
3757 yyp = yystpcpy (yyp, yytname[yyx]);
3762 YYSTACK_FREE (yymsg);
3765 yyerror ("parse error; also virtual memory exhausted");
3768 #endif /* defined (YYERROR_VERBOSE) */
3769 yyerror ("parse error");
3774 /*--------------------------------------------------.
3775 | yyerrlab1 -- error raised explicitly by an action |
3776 `--------------------------------------------------*/
3778 if (yyerrstatus == 3)
3780 /* If just tried and failed to reuse lookahead token after an
3781 error, discard it. */
3783 /* return failure if at end of input */
3784 if (yychar == YYEOF)
3786 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
3787 yychar, yytname[yychar1]));
3791 /* Else will try to reuse lookahead token after shifting the error
3794 yyerrstatus = 3; /* Each real token shifted decrements this */
3799 /*-------------------------------------------------------------------.
3800 | yyerrdefault -- current state does not do anything special for the |
3802 `-------------------------------------------------------------------*/
3805 /* This is wrong; only states that explicitly want error tokens
3806 should shift them. */
3808 /* If its default is to accept any token, ok. Otherwise pop it. */
3809 yyn = yydefact[yystate];
3815 /*---------------------------------------------------------------.
3816 | yyerrpop -- pop the current state because it cannot handle the |
3818 `---------------------------------------------------------------*/
3831 short *yyssp1 = yyss - 1;
3832 YYFPRINTF (stderr, "Error: state stack now");
3833 while (yyssp1 != yyssp)
3834 YYFPRINTF (stderr, " %d", *++yyssp1);
3835 YYFPRINTF (stderr, "\n");
3843 yyn = yypact[yystate];
3848 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3865 YYDPRINTF ((stderr, "Shifting error token, "));
3876 /*-------------------------------------.
3877 | yyacceptlab -- YYACCEPT comes here. |
3878 `-------------------------------------*/
3883 /*-----------------------------------.
3884 | yyabortlab -- YYABORT comes here. |
3885 `-----------------------------------*/
3890 /*---------------------------------------------.
3891 | yyoverflowab -- parser overflow comes here. |
3892 `---------------------------------------------*/
3894 yyerror ("parser stack overflow");
3901 YYSTACK_FREE (yyss);
3905 #line 1997 "parse.y"