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 char *type = make_me_type (prop->extra_gtktype,
558 if (prop->extra_gtktype == NULL) {
559 error_print (GOB_ERROR, prop->line_no,
560 _("Property linking requested for BOXED, but "
561 "boxed_type not set"));
563 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
564 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
565 "if (___new != ___old) { "
566 "if (___old != NULL) g_boxed_free (%s, ___old); "
567 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
568 "else %s->%s = NULL;"
576 get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
582 const char *getcast = "";
583 const char *setcast = "";
584 char *to_free = NULL;
585 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
586 g_strdown (set_func);
587 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
588 g_strdown (get_func);
590 if (strcmp (prop->gtktype, "FLAGS") == 0) {
591 setcast = "(guint) ";
593 get_prop_enum_flag_cast (prop);
594 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
597 get_prop_enum_flag_cast (prop);
600 set = g_strdup_printf("%s->%s = %s%s (VAL);",
604 get = g_strdup_printf("%s (VAL, %s%s->%s);",
616 "get_line", prop->line_no,
618 "set_line", prop->line_no,
623 export_accessors (prop->name,
624 prop->get != NULL, prop->get_line,
625 prop->set != NULL, prop->set_line,
636 if (strcmp (s, "BOOL") == 0) {
637 error_print (GOB_WARN, line_no,
638 _("BOOL type is deprecated, please use BOOLEAN"));
640 return g_strdup ("BOOLEAN");
647 ensure_property (void)
649 if (property == NULL)
650 property = (Property *)node_new (PROPERTY_NODE, NULL);
663 # define YYSTYPE yystype
664 # define YYSTYPE_IS_TRIVIAL 1
673 #define YYFLAG -32768
676 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
677 #define YYTRANSLATE(x) ((unsigned)(x) <= 306 ? yytranslate[x] : 118)
679 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
680 static const char yytranslate[] =
682 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
685 2, 2, 2, 64, 2, 2, 2, 2, 2, 2,
686 55, 56, 61, 2, 59, 65, 2, 2, 2, 2,
687 2, 2, 2, 2, 2, 2, 2, 2, 2, 57,
688 63, 58, 62, 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, 2, 2, 2, 2, 2, 2, 2, 2,
694 2, 2, 2, 53, 60, 54, 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, 2, 2, 2, 2, 2,
707 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
708 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
709 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
710 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
711 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
712 46, 47, 48, 49, 50, 51, 52
716 static const short yyprhs[] =
718 0, 0, 4, 7, 10, 12, 14, 16, 18, 20,
719 22, 24, 27, 30, 33, 36, 38, 40, 42, 44,
720 49, 53, 59, 60, 66, 72, 78, 81, 83, 85,
721 88, 92, 94, 96, 98, 100, 102, 104, 106, 108,
722 111, 115, 118, 122, 125, 128, 130, 132, 133, 139,
723 146, 159, 169, 176, 180, 181, 193, 202, 208, 212,
724 213, 217, 219, 221, 226, 228, 230, 234, 238, 242,
725 246, 250, 254, 258, 262, 266, 270, 274, 278, 282,
726 286, 290, 294, 298, 300, 306, 308, 312, 313, 317,
727 319, 322, 324, 326, 328, 331, 334, 337, 341, 345,
728 348, 351, 354, 356, 359, 361, 364, 366, 368, 370,
729 372, 374, 376, 378, 380, 382, 384, 386, 388, 390,
730 393, 396, 400, 403, 405, 409, 413, 416, 418, 423,
731 427, 429, 432, 434, 445, 457, 467, 477, 486, 498,
732 507, 513, 516, 521, 522, 524, 527, 529, 531, 534,
733 537, 541, 546, 551, 553, 557, 559, 563, 565, 568,
734 572, 579, 587, 590, 592, 594, 597, 600, 604, 608,
735 612, 616, 624, 633, 637, 639, 643, 645, 653, 662,
736 666, 668, 676, 685, 689, 691, 693, 696, 698
738 static const short yyrhs[] =
740 68, 69, 68, 0, 69, 68, 0, 68, 69, 0,
741 69, 0, 24, 0, 27, 0, 25, 0, 26, 0,
742 28, 0, 29, 0, 68, 67, 0, 68, 110, 0,
743 68, 113, 0, 68, 115, 0, 67, 0, 110, 0,
744 113, 0, 115, 0, 70, 53, 72, 54, 0, 70,
745 53, 54, 0, 3, 21, 4, 21, 71, 0, 0,
746 55, 19, 19, 56, 71, 0, 55, 19, 21, 56,
747 71, 0, 55, 19, 20, 56, 71, 0, 72, 73,
748 0, 73, 0, 101, 0, 19, 101, 0, 19, 21,
749 101, 0, 78, 0, 79, 0, 81, 0, 57, 0,
750 31, 0, 32, 0, 33, 0, 34, 0, 19, 19,
751 0, 19, 53, 24, 0, 58, 117, 0, 58, 53,
752 24, 0, 75, 76, 0, 76, 75, 0, 76, 0,
753 75, 0, 0, 74, 90, 19, 77, 57, 0, 74,
754 90, 19, 22, 77, 57, 0, 36, 88, 87, 19,
755 80, 19, 53, 24, 19, 53, 24, 57, 0, 36,
756 88, 87, 19, 80, 19, 53, 24, 57, 0, 36,
757 88, 87, 19, 80, 19, 0, 55, 19, 56, 0,
758 0, 35, 19, 19, 82, 19, 53, 24, 19, 53,
759 24, 57, 0, 35, 19, 19, 82, 19, 53, 24,
760 57, 0, 35, 19, 19, 82, 57, 0, 55, 83,
761 56, 0, 0, 83, 59, 86, 0, 86, 0, 30,
762 0, 19, 55, 30, 56, 0, 117, 0, 84, 0,
763 40, 58, 84, 0, 41, 58, 84, 0, 42, 58,
764 117, 0, 43, 58, 117, 0, 44, 58, 85, 0,
765 46, 58, 89, 0, 47, 58, 90, 0, 48, 58,
766 21, 0, 48, 58, 19, 0, 49, 58, 21, 0,
767 49, 58, 19, 0, 50, 58, 21, 0, 50, 58,
768 19, 0, 51, 58, 21, 0, 51, 58, 19, 0,
769 52, 58, 21, 0, 52, 58, 19, 0, 19, 0,
770 19, 55, 19, 90, 56, 0, 19, 0, 55, 89,
771 56, 0, 0, 19, 60, 89, 0, 19, 0, 91,
772 95, 0, 91, 0, 92, 0, 19, 0, 5, 19,
773 0, 19, 5, 0, 94, 19, 0, 5, 94, 19,
774 0, 94, 19, 5, 0, 93, 92, 0, 21, 92,
775 0, 5, 92, 0, 21, 0, 21, 5, 0, 93,
776 0, 93, 5, 0, 6, 0, 18, 0, 14, 0,
777 15, 0, 13, 0, 16, 0, 17, 0, 11, 0,
778 12, 0, 7, 0, 8, 0, 9, 0, 61, 0,
779 61, 5, 0, 61, 95, 0, 61, 5, 95, 0,
780 19, 98, 0, 98, 0, 74, 19, 98, 0, 19,
781 74, 98, 0, 74, 98, 0, 96, 0, 19, 55,
782 99, 56, 0, 99, 59, 19, 0, 19, 0, 53,
783 24, 0, 57, 0, 38, 88, 97, 90, 19, 55,
784 104, 56, 102, 100, 0, 74, 38, 88, 96, 90,
785 19, 55, 104, 56, 102, 100, 0, 37, 74, 90,
786 19, 55, 104, 56, 102, 100, 0, 74, 37, 90,
787 19, 55, 104, 56, 102, 100, 0, 37, 90, 19,
788 55, 104, 56, 102, 100, 0, 39, 55, 21, 56,
789 90, 19, 55, 104, 56, 102, 100, 0, 74, 90,
790 19, 55, 104, 56, 102, 100, 0, 19, 55, 19,
791 56, 100, 0, 19, 103, 0, 19, 103, 19, 103,
792 0, 0, 117, 0, 53, 24, 0, 6, 0, 19,
793 0, 19, 5, 0, 5, 19, 0, 19, 59, 105,
794 0, 19, 5, 59, 105, 0, 5, 19, 59, 105,
795 0, 105, 0, 106, 59, 10, 0, 106, 0, 106,
796 59, 107, 0, 107, 0, 90, 19, 0, 90, 19,
797 22, 0, 90, 19, 55, 19, 108, 56, 0, 90,
798 19, 22, 55, 19, 108, 56, 0, 108, 109, 0,
799 109, 0, 19, 0, 62, 117, 0, 63, 117, 0,
800 62, 58, 117, 0, 63, 58, 117, 0, 58, 58,
801 117, 0, 64, 58, 117, 0, 9, 19, 53, 111,
802 54, 21, 57, 0, 9, 19, 53, 111, 59, 54,
803 21, 57, 0, 111, 59, 112, 0, 112, 0, 19,
804 58, 117, 0, 19, 0, 46, 19, 53, 114, 54,
805 21, 57, 0, 46, 19, 53, 114, 59, 54, 21,
806 57, 0, 114, 59, 19, 0, 19, 0, 45, 19,
807 53, 116, 54, 21, 57, 0, 45, 19, 53, 116,
808 59, 54, 21, 57, 0, 116, 59, 19, 0, 19,
809 0, 20, 0, 65, 20, 0, 23, 0, 19, 0
815 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
816 static const short yyrline[] =
818 0, 640, 641, 642, 643, 646, 655, 664, 673, 682,
819 691, 702, 703, 704, 705, 706, 707, 708, 709, 712,
820 717, 724, 738, 739, 751, 760, 774, 775, 778, 779,
821 788, 800, 801, 802, 803, 806, 807, 808, 809, 812,
822 832, 856, 860, 868, 869, 870, 871, 872, 878, 881,
823 886, 954, 1008, 1097, 1105, 1110, 1158, 1194, 1210, 1211,
824 1214, 1215, 1218, 1219, 1231, 1232, 1235, 1241, 1247, 1253,
825 1259, 1265, 1271, 1278, 1284, 1290, 1296, 1302, 1308, 1314,
826 1320, 1326, 1332, 1338, 1358, 1367, 1373, 1374, 1377, 1380,
827 1386, 1393, 1402, 1405, 1408, 1412, 1416, 1420, 1425, 1433,
828 1437, 1442, 1446, 1449, 1453, 1456, 1461, 1462, 1463, 1464,
829 1465, 1466, 1467, 1468, 1469, 1472, 1473, 1474, 1477, 1478,
830 1479, 1483, 1490, 1502, 1508, 1520, 1532, 1535, 1541, 1546,
831 1549, 1554, 1555, 1559, 1575, 1591, 1607, 1623, 1634, 1640,
832 1650, 1673, 1684, 1703, 1709, 1710, 1716, 1717, 1728, 1739,
833 1750, 1760, 1770, 1780, 1783, 1784, 1787, 1788, 1791, 1794,
834 1797, 1805, 1815, 1816, 1819, 1836, 1843, 1850, 1857, 1864,
835 1871, 1880, 1889, 1900, 1901, 1904, 1924, 1934, 1943, 1954,
836 1957, 1962, 1971, 1982, 1985, 1991, 1992, 1996, 1997
841 #if (YYDEBUG) || defined YYERROR_VERBOSE
843 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
844 static const char *const yytname[] =
846 "$", "error", "$undefined.", "CLASS", "FROM", "CONST", "VOID", "STRUCT",
847 "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG", "SHORT",
848 "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER", "TYPETOKEN",
849 "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE", "HCODE",
850 "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
851 "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
852 "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR",
853 "FLAGS", "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
854 "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
855 "'*'", "'>'", "'<'", "'!'", "'-'", "prog", "ccode", "ccodes", "class",
856 "classdec", "classflags", "classcode", "thing", "scope", "destructor",
857 "initializer", "varoptions", "variable", "argument", "export",
858 "property", "param_spec", "param_spec_list", "string", "anyval",
859 "param_spec_value", "argtype", "flags", "flaglist", "type",
860 "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
861 "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
862 "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
863 "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
864 "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
868 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
869 static const short yyr1[] =
871 0, 66, 66, 66, 66, 67, 67, 67, 67, 67,
872 67, 68, 68, 68, 68, 68, 68, 68, 68, 69,
873 69, 70, 71, 71, 71, 71, 72, 72, 73, 73,
874 73, 73, 73, 73, 73, 74, 74, 74, 74, 75,
875 75, 76, 76, 77, 77, 77, 77, 77, 78, 78,
876 79, 79, 79, 80, 80, 81, 81, 81, 82, 82,
877 83, 83, 84, 84, 85, 85, 86, 86, 86, 86,
878 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
879 86, 86, 86, 86, 87, 87, 88, 88, 89, 89,
880 90, 90, 91, 91, 91, 91, 91, 91, 91, 92,
881 92, 92, 92, 92, 92, 92, 93, 93, 93, 93,
882 93, 93, 93, 93, 93, 94, 94, 94, 95, 95,
883 95, 95, 96, 96, 97, 97, 97, 97, 98, 99,
884 99, 100, 100, 101, 101, 101, 101, 101, 101, 101,
885 101, 102, 102, 102, 103, 103, 104, 104, 104, 104,
886 104, 104, 104, 104, 105, 105, 106, 106, 107, 107,
887 107, 107, 108, 108, 109, 109, 109, 109, 109, 109,
888 109, 110, 110, 111, 111, 112, 112, 113, 113, 114,
889 114, 115, 115, 116, 116, 117, 117, 117, 117
892 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
893 static const short yyr2[] =
895 0, 3, 2, 2, 1, 1, 1, 1, 1, 1,
896 1, 2, 2, 2, 2, 1, 1, 1, 1, 4,
897 3, 5, 0, 5, 5, 5, 2, 1, 1, 2,
898 3, 1, 1, 1, 1, 1, 1, 1, 1, 2,
899 3, 2, 3, 2, 2, 1, 1, 0, 5, 6,
900 12, 9, 6, 3, 0, 11, 8, 5, 3, 0,
901 3, 1, 1, 4, 1, 1, 3, 3, 3, 3,
902 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
903 3, 3, 3, 1, 5, 1, 3, 0, 3, 1,
904 2, 1, 1, 1, 2, 2, 2, 3, 3, 2,
905 2, 2, 1, 2, 1, 2, 1, 1, 1, 1,
906 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
907 2, 3, 2, 1, 3, 3, 2, 1, 4, 3,
908 1, 2, 1, 10, 11, 9, 9, 8, 11, 8,
909 5, 2, 4, 0, 1, 2, 1, 1, 2, 2,
910 3, 4, 4, 1, 3, 1, 3, 1, 2, 3,
911 6, 7, 2, 1, 1, 2, 2, 3, 3, 3,
912 3, 7, 8, 3, 1, 3, 1, 7, 8, 3,
913 1, 7, 8, 3, 1, 1, 2, 1, 1
916 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
917 doesn't specify something else to do. Zero means the default is an
919 static const short yydefact[] =
921 0, 0, 0, 5, 7, 8, 6, 9, 10, 0,
922 0, 15, 0, 4, 0, 16, 17, 18, 0, 0,
923 0, 0, 11, 3, 12, 13, 14, 2, 0, 0,
924 0, 0, 0, 1, 0, 35, 36, 37, 38, 0,
925 87, 0, 87, 0, 20, 34, 0, 27, 0, 31,
926 32, 33, 28, 22, 176, 0, 174, 184, 0, 180,
927 0, 0, 0, 0, 0, 29, 0, 0, 0, 0,
928 106, 115, 116, 117, 113, 114, 110, 108, 109, 111,
929 112, 107, 93, 102, 0, 0, 91, 92, 104, 0,
930 0, 0, 19, 26, 0, 87, 0, 0, 21, 0,
931 0, 0, 0, 0, 0, 0, 30, 0, 0, 59,
932 89, 0, 85, 0, 0, 94, 101, 0, 95, 103,
933 100, 0, 0, 118, 90, 105, 99, 96, 0, 0,
934 127, 0, 123, 0, 0, 0, 47, 0, 188, 185,
935 187, 0, 175, 0, 0, 173, 0, 183, 0, 0,
936 179, 0, 0, 0, 0, 0, 0, 86, 0, 54,
937 97, 0, 0, 119, 120, 98, 0, 0, 0, 122,
938 0, 126, 0, 0, 0, 0, 0, 0, 47, 0,
939 0, 46, 45, 0, 0, 0, 0, 186, 171, 0,
940 181, 0, 177, 0, 0, 132, 140, 83, 0, 0,
941 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
942 0, 61, 0, 57, 88, 0, 0, 0, 0, 0,
943 106, 93, 0, 0, 153, 155, 157, 121, 130, 0,
944 125, 124, 0, 0, 0, 0, 39, 0, 0, 0,
945 0, 41, 43, 44, 48, 22, 22, 22, 172, 182,
946 178, 131, 0, 0, 0, 0, 0, 0, 0, 0,
947 0, 0, 0, 0, 58, 0, 0, 0, 0, 52,
948 0, 94, 95, 0, 158, 143, 0, 128, 0, 0,
949 0, 0, 0, 40, 49, 143, 42, 23, 25, 24,
950 0, 62, 66, 67, 68, 69, 188, 65, 70, 64,
951 71, 72, 74, 73, 76, 75, 78, 77, 80, 79,
952 82, 81, 60, 0, 84, 53, 0, 143, 0, 0,
953 150, 159, 0, 0, 0, 154, 156, 129, 0, 0,
954 143, 0, 0, 0, 0, 56, 0, 0, 152, 151,
955 0, 0, 0, 141, 144, 137, 143, 0, 0, 0,
956 139, 0, 0, 0, 51, 135, 0, 164, 0, 0,
957 0, 0, 0, 163, 145, 0, 0, 143, 136, 143,
958 63, 0, 0, 0, 0, 0, 165, 0, 166, 0,
959 160, 162, 142, 133, 0, 0, 55, 0, 161, 169,
960 167, 168, 170, 138, 134, 50, 0, 0, 0
963 static const short yydefgoto[] =
965 396, 11, 12, 13, 14, 98, 46, 47, 48, 181,
966 182, 183, 49, 50, 217, 51, 155, 210, 292, 298,
967 211, 113, 68, 111, 222, 86, 87, 88, 89, 124,
968 130, 131, 132, 229, 196, 52, 324, 343, 223, 224,
969 225, 226, 362, 363, 15, 55, 56, 16, 60, 17,
973 static const short yypact[] =
975 137, 16, 24,-32768,-32768,-32768,-32768,-32768,-32768, 45,
976 99,-32768, 137, 170, 72,-32768,-32768,-32768, 106, 73,
977 81, 98,-32768, 170,-32768,-32768,-32768, 170, 154, 111,
978 151, 183, 186, 170, 215,-32768,-32768,-32768,-32768, 187,
979 158, 310, 158, 182,-32768,-32768, 188,-32768, 276,-32768,
980 -32768,-32768,-32768, 195, 210, 69,-32768,-32768, 113,-32768,
981 115, 214, 301, 190, 276,-32768, 248, 252, 254, 357,
982 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
983 -32768,-32768, 269, 425, 374, 267, 235,-32768, 439, 284,
984 444, 290,-32768,-32768, 374, 158, 293, 311,-32768, 74,
985 315, 76, 316, 84, 339, 90,-32768, 321, 348, 329,
986 334, 345, 356, 399, 453,-32768,-32768, 409,-32768, 453,
987 -32768, 413, 378, 2,-32768, 453,-32768, 429, 224, 416,
988 -32768, 374,-32768, 392, 428, 430, 126, 220,-32768,-32768,
989 -32768, 441,-32768, 405, 451,-32768, 422,-32768, 452, 423,
990 -32768, 460, -32, 427, 258, 21, 252,-32768, 464, 431,
991 -32768, 432, 391, 235,-32768,-32768, 433, 465, 466,-32768,
992 -6,-32768, 470, 374, 435, -6, 374, 26, 0, 391,
993 7, 434, 472, 436, 438, 440, 442,-32768,-32768, 443,
994 -32768, 445,-32768, 446, 471,-32768,-32768,-32768, 447, 448,
995 449, 450, 454, 455, 456, 457, 458, 459, 461, 462,
996 91,-32768, 468,-32768,-32768, 374, 478, 480, 391, 408,
997 467, 6, 482, 469,-32768, 463,-32768,-32768,-32768, 112,
998 -32768,-32768, 473, 485, 391, 490,-32768, 486, 474, 476,
999 487,-32768,-32768,-32768,-32768, 195, 195, 195,-32768,-32768,
1000 -32768,-32768, 1, 1, 74, 74, 9, 252, 374, 139,
1001 157, 191, 209, 212,-32768, 258, 494, 477, 479, 481,
1002 483, 121, 144, 374, 94, 505, 340,-32768, 507, 391,
1003 475, 484, 488,-32768,-32768, 505,-32768,-32768,-32768,-32768,
1004 489,-32768,-32768,-32768,-32768,-32768, 489,-32768,-32768,-32768,
1005 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
1006 -32768,-32768,-32768, 47,-32768,-32768, 503, 505, 374, 374,
1007 -32768, 491, 510, 27, -32,-32768,-32768,-32768, 492, 391,
1008 505, 391, -32, 506, 496,-32768, 54, -32,-32768,-32768,
1009 518, 57, 514, 522,-32768,-32768, 505, 495, -32, 497,
1010 -32768, 498, 521, 499,-32768,-32768, 57,-32768, 500, 64,
1011 66, 501, 50,-32768,-32768, 27, -32, 505,-32768, 505,
1012 -32768, 493, 523, 79, 74, 74,-32768, 74,-32768, 74,
1013 -32768,-32768,-32768,-32768, -32, -32,-32768, 504,-32768,-32768,
1014 -32768,-32768,-32768,-32768,-32768,-32768, 542, 555,-32768
1017 static const short yypgoto[] =
1019 -32768, 202, 104, 544,-32768, 17,-32768, 511, -29, 380,
1020 379, 385,-32768,-32768,-32768,-32768,-32768,-32768, -52,-32768,
1021 299,-32768, -27, -152, -40,-32768, -66,-32768, -60, -107,
1022 437,-32768, -93,-32768, -314, -20, -279, 200, -177, -218,
1023 -32768, 291, 213, -266, 205,-32768, 502, 232,-32768, 239,
1031 static const short yytable[] =
1033 142, 85, 239, 116, 214, 64, 332, 163, 96, 117,
1034 345, 272, 84, 166, 65, 90, 164, 120, 350, 177,
1035 290, 194, 126, 355, 108, 195, 138, 139, 296, 139,
1036 140, 291, 140, 64, 368, 169, 171, 18, 337, 291,
1037 212, 270, 106, 19, 121, 236, 138, 139, 116, 167,
1038 140, 348, 383, 116, 134, 320, 227, 281, 180, 116,
1039 240, 129, -147, 123, 20, 273, 334, 366, 135, 357,
1040 393, 394, 141, 353, 141, 230, 357, 231, 213, 237,
1041 342, 241, 169, 138, 139, 138, 139, 140, 384, 140,
1042 385, 172, 141, 138, 139, 54, 381, 140, 357, 168,
1043 338, 339, 328, 147, 335, 300, 380, 381, 358, 150,
1044 29, 354, 359, 360, 361, 358, 321, 27, 21, 359,
1045 360, 361, 375, 100, 377, 28, 30, 33, 101, 141,
1046 144, 141, 53, 233, 31, 388, 235, 358, 148, 141,
1047 1, 359, 360, 361, 151, 177, 2, 264, 178, 322,
1048 265, 32, 347, 116, 349, 294, 295, 299, 302, 117,
1049 303, 3, 4, 5, 6, 7, 8, 102, 277, 104,
1050 54, 278, 103, 34, 105, 267, 304, -149, 305, 2,
1051 318, 179, 9, 10, 180, 35, 36, 37, 38, 39,
1052 40, 41, 42, 43, 3, 4, 5, 6, 7, 8,
1053 -148, 293, 57, 319, 297, 59, 66, 34, 44, 107,
1054 306, 45, 307, 67, 22, 9, 10, 24, 301, 35,
1055 36, 37, 38, 39, 40, 41, 42, 43, 308, 22,
1056 309, 310, 24, 311, 61, 22, 62, 91, 24, 184,
1057 185, 186, 92, 166, 25, 45, 35, 36, 37, 38,
1058 97, 26, 41, 42, 43, 35, 36, 37, 38, 25,
1059 376, 378, 287, 288, 289, 25, 26, 109, 99, 63,
1060 63, 110, 26, 112, 118, 389, 390, 197, 391, 167,
1061 392, 69, 70, 71, 72, 73, 122, 74, 75, 76,
1062 77, 78, 79, 80, 81, 82, 123, 83, 198, 199,
1063 200, 201, 202, 127, 203, 204, 205, 206, 207, 208,
1064 209, 133, 136, 94, 95, 69, 70, 71, 72, 73,
1065 61, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1066 137, 83, 35, 36, 37, 38, 143, 146, 41, 42,
1067 43, 35, 36, 37, 38, 69, 70, 71, 72, 73,
1068 325, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1069 149, 83, 114, 70, 71, 72, 73, 153, 74, 75,
1070 76, 77, 78, 79, 80, 81, 115, 152, 83, 69,
1071 70, 71, 72, 73, 154, 74, 75, 76, 77, 78,
1072 79, 80, 81, 82, 156, 83, 219, 220, 71, 72,
1073 73, 157, 74, 75, 76, 77, 78, 79, 80, 81,
1074 221, 158, 83, 114, 70, 71, 72, 73, 159, 74,
1075 75, 76, 77, 78, 79, 80, 81, 271, 160, 83,
1076 119, 70, 161, 162, 165, 170, 74, 75, 76, 77,
1077 78, 79, 80, 81, 125, 70, 83, 174, 173, 175,
1078 74, 75, 76, 77, 78, 79, 80, 81, 114, 70,
1079 83, 187, 188, 128, 74, 75, 76, 77, 78, 79,
1080 80, 81, 189, 191, 83, 35, 36, 37, 38, 190,
1081 192, 193, 179, 215, 228, 166, 216, 218, 167, 232,
1082 234, 177, 180, 244, 245, 251, 246, 268, 247, 269,
1083 248, 274, 249, 250, 280, 252, 253, 254, 255, 282,
1084 283, 286, 256, 257, 258, 259, 260, 261, 313, 262,
1085 263, 266, 276, -146, 323, 275, 327, 336, 279, 341,
1086 329, 284, 285, 314, 316, 315, 351, 356, 364, 317,
1087 330, 365, 397, 331, 333, 371, 340, 387, 346, 352,
1088 386, 367, 372, 369, 370, 398, 23, 93, 374, 379,
1089 242, 395, 243, 238, 312, 382, 0, 326, 0, 373,
1090 0, 0, 176, 0, 0, 0, 0, 0, 0, 0,
1091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1092 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1096 static const short yycheck[] =
1098 99, 41, 179, 69, 156, 34, 285, 5, 48, 69,
1099 324, 5, 41, 19, 34, 42, 123, 83, 332, 19,
1100 19, 53, 88, 337, 64, 57, 19, 20, 19, 20,
1101 23, 30, 23, 62, 348, 128, 129, 21, 317, 30,
1102 19, 218, 62, 19, 84, 19, 19, 20, 114, 55,
1103 23, 330, 366, 119, 94, 273, 163, 234, 58, 125,
1104 53, 90, 56, 61, 19, 59, 19, 346, 95, 19,
1105 384, 385, 65, 19, 65, 168, 19, 170, 57, 53,
1106 53, 180, 175, 19, 20, 19, 20, 23, 367, 23,
1107 369, 131, 65, 19, 20, 19, 362, 23, 19, 128,
1108 318, 319, 279, 19, 57, 257, 56, 373, 58, 19,
1109 4, 57, 62, 63, 64, 58, 22, 13, 19, 62,
1110 63, 64, 58, 54, 58, 53, 53, 23, 59, 65,
1111 54, 65, 21, 173, 53, 56, 176, 58, 54, 65,
1112 3, 62, 63, 64, 54, 19, 9, 56, 22, 55,
1113 59, 53, 329, 219, 331, 254, 255, 256, 19, 219,
1114 21, 24, 25, 26, 27, 28, 29, 54, 56, 54,
1115 19, 59, 59, 19, 59, 215, 19, 56, 21, 9,
1116 59, 55, 45, 46, 58, 31, 32, 33, 34, 35,
1117 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
1118 56, 253, 19, 59, 256, 19, 19, 19, 54, 19,
1119 19, 57, 21, 55, 12, 45, 46, 12, 258, 31,
1120 32, 33, 34, 35, 36, 37, 38, 39, 19, 27,
1121 21, 19, 27, 21, 19, 33, 21, 55, 33, 19,
1122 20, 21, 54, 19, 12, 57, 31, 32, 33, 34,
1123 55, 12, 37, 38, 39, 31, 32, 33, 34, 27,
1124 359, 360, 245, 246, 247, 33, 27, 19, 58, 55,
1125 55, 19, 33, 19, 5, 374, 375, 19, 377, 55,
1126 379, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1127 14, 15, 16, 17, 18, 19, 61, 21, 40, 41,
1128 42, 43, 44, 19, 46, 47, 48, 49, 50, 51,
1129 52, 21, 19, 37, 38, 5, 6, 7, 8, 9,
1130 19, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1131 19, 21, 31, 32, 33, 34, 21, 21, 37, 38,
1132 39, 31, 32, 33, 34, 5, 6, 7, 8, 9,
1133 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1134 21, 21, 5, 6, 7, 8, 9, 19, 11, 12,
1135 13, 14, 15, 16, 17, 18, 19, 56, 21, 5,
1136 6, 7, 8, 9, 55, 11, 12, 13, 14, 15,
1137 16, 17, 18, 19, 60, 21, 5, 6, 7, 8,
1138 9, 56, 11, 12, 13, 14, 15, 16, 17, 18,
1139 19, 55, 21, 5, 6, 7, 8, 9, 19, 11,
1140 12, 13, 14, 15, 16, 17, 18, 19, 19, 21,
1141 5, 6, 19, 55, 5, 19, 11, 12, 13, 14,
1142 15, 16, 17, 18, 5, 6, 21, 19, 56, 19,
1143 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
1144 21, 20, 57, 19, 11, 12, 13, 14, 15, 16,
1145 17, 18, 21, 21, 21, 31, 32, 33, 34, 57,
1146 57, 21, 55, 19, 19, 19, 55, 55, 55, 19,
1147 55, 19, 58, 57, 56, 24, 56, 19, 56, 19,
1148 57, 19, 57, 57, 19, 58, 58, 58, 58, 19,
1149 24, 24, 58, 58, 58, 58, 58, 58, 24, 58,
1150 58, 53, 59, 56, 19, 56, 19, 24, 55, 19,
1151 55, 57, 56, 56, 53, 56, 30, 19, 24, 56,
1152 56, 19, 0, 55, 55, 24, 55, 24, 56, 53,
1153 57, 56, 53, 56, 56, 0, 12, 46, 58, 58,
1154 181, 57, 182, 178, 265, 365, -1, 276, -1, 356,
1155 -1, -1, 135, -1, -1, -1, -1, -1, -1, -1,
1156 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1157 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1160 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1161 #line 3 "/usr/share/bison/bison.simple"
1163 /* Skeleton output parser for bison,
1165 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
1168 This program is free software; you can redistribute it and/or modify
1169 it under the terms of the GNU General Public License as published by
1170 the Free Software Foundation; either version 2, or (at your option)
1173 This program is distributed in the hope that it will be useful,
1174 but WITHOUT ANY WARRANTY; without even the implied warranty of
1175 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1176 GNU General Public License for more details.
1178 You should have received a copy of the GNU General Public License
1179 along with this program; if not, write to the Free Software
1180 Foundation, Inc., 59 Temple Place - Suite 330,
1181 Boston, MA 02111-1307, USA. */
1183 /* As a special exception, when this file is copied by Bison into a
1184 Bison output file, you may use that output file without restriction.
1185 This special exception was added by the Free Software Foundation
1186 in version 1.24 of Bison. */
1188 /* This is the parser code that is written into each bison parser when
1189 the %semantic_parser declaration is not specified in the grammar.
1190 It was written by Richard Stallman by simplifying the hairy parser
1191 used when %semantic_parser is specified. */
1193 /* All symbols defined below should begin with yy or YY, to avoid
1194 infringing on user name space. This should be done even for local
1195 variables, as they might otherwise be expanded by user macros.
1196 There are some unavoidable exceptions within include files to
1197 define necessary library symbols; they are noted "INFRINGES ON
1198 USER NAME SPACE" below. */
1200 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
1202 /* The parser invokes alloca or malloc; define the necessary symbols. */
1204 # if YYSTACK_USE_ALLOCA
1205 # define YYSTACK_ALLOC alloca
1207 # ifndef YYSTACK_USE_ALLOCA
1208 # if defined (alloca) || defined (_ALLOCA_H)
1209 # define YYSTACK_ALLOC alloca
1212 # define YYSTACK_ALLOC __builtin_alloca
1218 # ifdef YYSTACK_ALLOC
1219 /* Pacify GCC's `empty if-body' warning. */
1220 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1222 # if defined (__STDC__) || defined (__cplusplus)
1223 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1224 # define YYSIZE_T size_t
1226 # define YYSTACK_ALLOC malloc
1227 # define YYSTACK_FREE free
1229 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
1232 #if (! defined (yyoverflow) \
1233 && (! defined (__cplusplus) \
1234 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1236 /* A type that is properly aligned for any stack member. */
1246 /* The size of the maximum gap between one aligned stack and the next. */
1247 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
1249 /* The size of an array large to enough to hold all stacks, each with
1252 # define YYSTACK_BYTES(N) \
1253 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
1254 + 2 * YYSTACK_GAP_MAX)
1256 # define YYSTACK_BYTES(N) \
1257 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
1261 /* Copy COUNT objects from FROM to TO. The source and destination do
1265 # define YYCOPY(To, From, Count) \
1266 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1268 # define YYCOPY(To, From, Count) \
1271 register YYSIZE_T yyi; \
1272 for (yyi = 0; yyi < (Count); yyi++) \
1273 (To)[yyi] = (From)[yyi]; \
1279 /* Relocate STACK from its old location to the new one. The
1280 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1281 elements in the stack, and YYPTR gives the new location of the
1282 stack. Advance YYPTR to a properly aligned location for the next
1284 # define YYSTACK_RELOCATE(Stack) \
1287 YYSIZE_T yynewbytes; \
1288 YYCOPY (&yyptr->Stack, Stack, yysize); \
1289 Stack = &yyptr->Stack; \
1290 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
1291 yyptr += yynewbytes / sizeof (*yyptr); \
1298 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1299 # define YYSIZE_T __SIZE_TYPE__
1301 #if ! defined (YYSIZE_T) && defined (size_t)
1302 # define YYSIZE_T size_t
1304 #if ! defined (YYSIZE_T)
1305 # if defined (__STDC__) || defined (__cplusplus)
1306 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1307 # define YYSIZE_T size_t
1310 #if ! defined (YYSIZE_T)
1311 # define YYSIZE_T unsigned int
1314 #define yyerrok (yyerrstatus = 0)
1315 #define yyclearin (yychar = YYEMPTY)
1318 #define YYACCEPT goto yyacceptlab
1319 #define YYABORT goto yyabortlab
1320 #define YYERROR goto yyerrlab1
1321 /* Like YYERROR except do call yyerror. This remains here temporarily
1322 to ease the transition to the new meaning of YYERROR, for GCC.
1323 Once GCC version 2 has supplanted version 1, this can go. */
1324 #define YYFAIL goto yyerrlab
1325 #define YYRECOVERING() (!!yyerrstatus)
1326 #define YYBACKUP(Token, Value) \
1328 if (yychar == YYEMPTY && yylen == 1) \
1332 yychar1 = YYTRANSLATE (yychar); \
1338 yyerror ("syntax error: cannot back up"); \
1344 #define YYERRCODE 256
1347 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1350 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
1351 first token. By default, to implement support for ranges, extend
1352 its range to the last symbol. */
1354 #ifndef YYLLOC_DEFAULT
1355 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1356 Current.last_line = Rhs[N].last_line; \
1357 Current.last_column = Rhs[N].last_column;
1361 /* YYLEX -- calling `yylex' with the right arguments. */
1366 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1368 # define YYLEX yylex (&yylval, &yylloc)
1370 # else /* !YYLSP_NEEDED */
1372 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1374 # define YYLEX yylex (&yylval)
1376 # endif /* !YYLSP_NEEDED */
1378 # define YYLEX yylex ()
1379 #endif /* !YYPURE */
1382 /* Enable debugging if requested. */
1386 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1387 # define YYFPRINTF fprintf
1390 # define YYDPRINTF(Args) \
1395 /* Nonzero means print parse trace. It is left uninitialized so that
1396 multiple parsers can coexist. */
1398 #else /* !YYDEBUG */
1399 # define YYDPRINTF(Args)
1400 #endif /* !YYDEBUG */
1402 /* YYINITDEPTH -- initial size of the parser's stacks. */
1404 # define YYINITDEPTH 200
1407 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1408 if the built-in stack extension method is used).
1410 Do not make this value too large; the results are undefined if
1411 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1412 evaluated with infinite-precision integer arithmetic. */
1419 # define YYMAXDEPTH 10000
1422 #ifdef YYERROR_VERBOSE
1425 # if defined (__GLIBC__) && defined (_STRING_H)
1426 # define yystrlen strlen
1428 /* Return the length of YYSTR. */
1430 # if defined (__STDC__) || defined (__cplusplus)
1431 yystrlen (const char *yystr)
1437 register const char *yys = yystr;
1439 while (*yys++ != '\0')
1442 return yys - yystr - 1;
1448 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1449 # define yystpcpy stpcpy
1451 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1454 # if defined (__STDC__) || defined (__cplusplus)
1455 yystpcpy (char *yydest, const char *yysrc)
1457 yystpcpy (yydest, yysrc)
1462 register char *yyd = yydest;
1463 register const char *yys = yysrc;
1465 while ((*yyd++ = *yys++) != '\0')
1474 #line 315 "/usr/share/bison/bison.simple"
1477 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1478 into yyparse. The argument should have type void *.
1479 It should actually point to an object.
1480 Grammar actions can access the variable by casting it
1481 to the proper pointer type. */
1483 #ifdef YYPARSE_PARAM
1484 # if defined (__STDC__) || defined (__cplusplus)
1485 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1486 # define YYPARSE_PARAM_DECL
1488 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
1489 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1491 #else /* !YYPARSE_PARAM */
1492 # define YYPARSE_PARAM_ARG
1493 # define YYPARSE_PARAM_DECL
1494 #endif /* !YYPARSE_PARAM */
1496 /* Prevent warning if -Wstrict-prototypes. */
1498 # ifdef YYPARSE_PARAM
1499 int yyparse (void *);
1505 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
1506 variables are global, or local to YYPARSE. */
1508 #define YY_DECL_NON_LSP_VARIABLES \
1509 /* The lookahead symbol. */ \
1512 /* The semantic value of the lookahead symbol. */ \
1515 /* Number of parse errors so far. */ \
1519 # define YY_DECL_VARIABLES \
1520 YY_DECL_NON_LSP_VARIABLES \
1522 /* Location data for the lookahead symbol. */ \
1525 # define YY_DECL_VARIABLES \
1526 YY_DECL_NON_LSP_VARIABLES
1530 /* If nonreentrant, generate the variables here. */
1534 #endif /* !YYPURE */
1537 yyparse (YYPARSE_PARAM_ARG)
1540 /* If reentrant, generate the variables here. */
1543 #endif /* !YYPURE */
1545 register int yystate;
1548 /* Number of tokens to shift before error messages enabled. */
1550 /* Lookahead token as an internal (translated) token number. */
1553 /* Three stacks and their tools:
1554 `yyss': related to states,
1555 `yyvs': related to semantic values,
1556 `yyls': related to locations.
1558 Refer to the stacks thru separate pointers, to allow yyoverflow
1559 to reallocate them elsewhere. */
1561 /* The state stack. */
1562 short yyssa[YYINITDEPTH];
1563 short *yyss = yyssa;
1564 register short *yyssp;
1566 /* The semantic value stack. */
1567 YYSTYPE yyvsa[YYINITDEPTH];
1568 YYSTYPE *yyvs = yyvsa;
1569 register YYSTYPE *yyvsp;
1572 /* The location stack. */
1573 YYLTYPE yylsa[YYINITDEPTH];
1574 YYLTYPE *yyls = yylsa;
1579 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1581 # define YYPOPSTACK (yyvsp--, yyssp--)
1584 YYSIZE_T yystacksize = YYINITDEPTH;
1587 /* The variables used to return semantic value and location from the
1594 /* When reducing, the number of symbols on the RHS of the reduced
1598 YYDPRINTF ((stderr, "Starting parse\n"));
1603 yychar = YYEMPTY; /* Cause a token to be read. */
1605 /* Initialize stack pointers.
1606 Waste one element of value and location stack
1607 so that they stay on the same level as the state stack.
1608 The wasted elements are never initialized. */
1617 /*------------------------------------------------------------.
1618 | yynewstate -- Push a new state, which is found in yystate. |
1619 `------------------------------------------------------------*/
1621 /* In all cases, when you get here, the value and location stacks
1622 have just been pushed. so pushing a state here evens the stacks.
1629 if (yyssp >= yyss + yystacksize - 1)
1631 /* Get the current used size of the three stacks, in elements. */
1632 YYSIZE_T yysize = yyssp - yyss + 1;
1636 /* Give user a chance to reallocate the stack. Use copies of
1637 these so that the &'s don't force the real ones into
1639 YYSTYPE *yyvs1 = yyvs;
1640 short *yyss1 = yyss;
1642 /* Each stack pointer address is followed by the size of the
1643 data in use in that stack, in bytes. */
1645 YYLTYPE *yyls1 = yyls;
1646 /* This used to be a conditional around just the two extra args,
1647 but that might be undefined if yyoverflow is a macro. */
1648 yyoverflow ("parser stack overflow",
1649 &yyss1, yysize * sizeof (*yyssp),
1650 &yyvs1, yysize * sizeof (*yyvsp),
1651 &yyls1, yysize * sizeof (*yylsp),
1655 yyoverflow ("parser stack overflow",
1656 &yyss1, yysize * sizeof (*yyssp),
1657 &yyvs1, yysize * sizeof (*yyvsp),
1663 #else /* no yyoverflow */
1664 # ifndef YYSTACK_RELOCATE
1667 /* Extend the stack our own way. */
1668 if (yystacksize >= YYMAXDEPTH)
1671 if (yystacksize > YYMAXDEPTH)
1672 yystacksize = YYMAXDEPTH;
1675 short *yyss1 = yyss;
1676 union yyalloc *yyptr =
1677 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1680 YYSTACK_RELOCATE (yyss);
1681 YYSTACK_RELOCATE (yyvs);
1683 YYSTACK_RELOCATE (yyls);
1685 # undef YYSTACK_RELOCATE
1687 YYSTACK_FREE (yyss1);
1690 #endif /* no yyoverflow */
1692 yyssp = yyss + yysize - 1;
1693 yyvsp = yyvs + yysize - 1;
1695 yylsp = yyls + yysize - 1;
1698 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1699 (unsigned long int) yystacksize));
1701 if (yyssp >= yyss + yystacksize - 1)
1705 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1715 /* Do appropriate processing given the current state. */
1716 /* Read a lookahead token if we need one and don't already have one. */
1719 /* First try to decide what to do without reference to lookahead token. */
1721 yyn = yypact[yystate];
1725 /* Not known => get a lookahead token if don't already have one. */
1727 /* yychar is either YYEMPTY or YYEOF
1728 or a valid token in external form. */
1730 if (yychar == YYEMPTY)
1732 YYDPRINTF ((stderr, "Reading a token: "));
1736 /* Convert token to internal form (in yychar1) for indexing tables with */
1738 if (yychar <= 0) /* This means end of input. */
1741 yychar = YYEOF; /* Don't call YYLEX any more */
1743 YYDPRINTF ((stderr, "Now at end of input.\n"));
1747 yychar1 = YYTRANSLATE (yychar);
1750 /* We have to keep this `#if YYDEBUG', since we use variables
1751 which are defined only if `YYDEBUG' is set. */
1754 YYFPRINTF (stderr, "Next token is %d (%s",
1755 yychar, yytname[yychar1]);
1756 /* Give the individual parser a way to print the precise
1757 meaning of a token, for further debugging info. */
1759 YYPRINT (stderr, yychar, yylval);
1761 YYFPRINTF (stderr, ")\n");
1767 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1772 /* yyn is what to do for this token type in this state.
1773 Negative => reduce, -yyn is rule number.
1774 Positive => shift, yyn is new state.
1775 New state is final state => don't bother to shift,
1776 just return success.
1777 0, or most negative number => error. */
1792 /* Shift the lookahead token. */
1793 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1794 yychar, yytname[yychar1]));
1796 /* Discard the token being shifted unless it is eof. */
1797 if (yychar != YYEOF)
1805 /* Count tokens shifted since error; after three, turn off error
1814 /*-----------------------------------------------------------.
1815 | yydefault -- do the default action for the current state. |
1816 `-----------------------------------------------------------*/
1818 yyn = yydefact[yystate];
1824 /*-----------------------------.
1825 | yyreduce -- Do a reduction. |
1826 `-----------------------------*/
1828 /* yyn is the number of a rule to reduce with. */
1831 /* If YYLEN is nonzero, implement the default value of the action:
1834 Otherwise, the following line sets YYVAL to the semantic value of
1835 the lookahead token. This behavior is undocumented and Bison
1836 users should not rely upon it. Assigning to YYVAL
1837 unconditionally makes the parser a bit smaller, and it avoids a
1838 GCC warning that YYVAL may be used uninitialized. */
1839 yyval = yyvsp[1-yylen];
1842 /* Similarly for the default location. Let the user run additional
1843 commands if for instance locations are ranges. */
1844 yyloc = yylsp[1-yylen];
1845 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1849 /* We have to keep this `#if YYDEBUG', since we use variables which
1850 are defined only if `YYDEBUG' is set. */
1855 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1858 /* Print the symbols being reduced, and their result. */
1859 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1860 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1861 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1886 Node *node = node_new (CCODE_NODE,
1888 "cbuf:steal", (yyvsp[0].cbuf)->str,
1889 "line_no", ccode_line,
1891 nodes = g_list_append(nodes,node);
1892 g_string_free(yyvsp[0].cbuf,FALSE);
1898 Node *node = node_new (CCODE_NODE,
1900 "cbuf:steal", (yyvsp[0].cbuf)->str,
1901 "line_no", ccode_line,
1903 nodes = g_list_append(nodes,node);
1904 g_string_free(yyvsp[0].cbuf,FALSE);
1910 Node *node = node_new (CCODE_NODE,
1912 "cbuf:steal", (yyvsp[0].cbuf)->str,
1913 "line_no", ccode_line,
1915 nodes = g_list_append(nodes,node);
1916 g_string_free(yyvsp[0].cbuf,FALSE);
1922 Node *node = node_new (CCODE_NODE,
1924 "cbuf:steal", (yyvsp[0].cbuf)->str,
1925 "line_no", ccode_line,
1927 nodes = g_list_append(nodes,node);
1928 g_string_free(yyvsp[0].cbuf,FALSE);
1934 Node *node = node_new (CCODE_NODE,
1936 "cbuf:steal", (yyvsp[0].cbuf)->str,
1937 "line_no", ccode_line,
1939 nodes = g_list_append(nodes,node);
1940 g_string_free(yyvsp[0].cbuf,FALSE);
1946 Node *node = node_new (CCODE_NODE,
1948 "cbuf:steal", (yyvsp[0].cbuf)->str,
1949 "line_no", ccode_line,
1951 nodes = g_list_append(nodes,node);
1952 g_string_free(yyvsp[0].cbuf,FALSE);
1990 ((Class *)class)->nodes = class_nodes;
1992 nodes = g_list_append(nodes,class);
1998 ((Class *)class)->nodes = NULL;
2000 nodes = g_list_append(nodes,class);
2006 class = node_new (CLASS_NODE,
2007 "otype:steal", yyvsp[-3].id,
2008 "ptype:steal", yyvsp[-1].id,
2009 "bonobo_object_class:steal", bonobo_object_class,
2010 "interfaces:steal", interfaces,
2011 "chunk_size:steal", chunk_size,
2013 bonobo_object_class = NULL;
2021 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2022 g_free (chunk_size);
2023 chunk_size = g_strdup(yyvsp[-2].id);
2024 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2025 g_free (bonobo_object_class);
2026 bonobo_object_class = g_strdup(yyvsp[-2].id);
2028 yyerror(_("parse error"));
2036 if (strcmp (yyvsp[-3].id, "interface") == 0) {
2037 interfaces = g_list_append (interfaces,
2038 g_strdup (yyvsp[-2].id));
2040 yyerror(_("parse error"));
2048 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2049 g_free (chunk_size);
2050 if(atoi(yyvsp[-2].id) != 0)
2051 chunk_size = g_strdup(yyvsp[-2].id);
2055 yyerror(_("parse error"));
2075 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2076 g_free (yyvsp[-1].id);
2077 yyerror (_("parse error"));
2080 g_free (yyvsp[-1].id);
2081 last_added_method->bonobo_object_func = TRUE;
2087 if (strcmp (yyvsp[-2].id, "interface") != 0) {
2088 g_free (yyvsp[-2].id);
2089 g_free (yyvsp[-1].id);
2090 yyerror (_("parse error"));
2093 g_free (yyvsp[-2].id);
2094 node_set ((Node *)last_added_method,
2095 "interface:steal", yyvsp[-1].id,
2117 { the_scope = PUBLIC_SCOPE; }
2121 { the_scope = PRIVATE_SCOPE; }
2125 { the_scope = PROTECTED_SCOPE; }
2129 { the_scope = CLASS_SCOPE; }
2134 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2135 g_free (yyvsp[-1].id);
2136 destructor_unref = FALSE;
2137 destructor = yyvsp[0].id;
2138 destructor_line = line_no;
2139 destructor_simple = TRUE;
2140 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2141 g_free (yyvsp[-1].id);
2142 destructor_unref = TRUE;
2143 destructor = yyvsp[0].id;
2144 destructor_line = line_no;
2145 destructor_simple = TRUE;
2147 g_free (yyvsp[-1].id);
2148 g_free (yyvsp[0].id);
2149 yyerror (_("parse error"));
2157 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2158 g_free(yyvsp[-2].id);
2159 destructor_unref = FALSE;
2160 destructor = (yyvsp[0].cbuf)->str;
2161 g_string_free(yyvsp[0].cbuf, FALSE);
2162 destructor_line = ccode_line;
2163 destructor_simple = FALSE;
2164 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2165 g_free (yyvsp[-2].id);
2166 destructor_unref = TRUE;
2167 destructor = (yyvsp[0].cbuf)->str;
2168 g_string_free (yyvsp[0].cbuf, FALSE);
2169 destructor_line = ccode_line;
2170 destructor_simple = FALSE;
2172 g_free (yyvsp[-2].id);
2173 g_string_free (yyvsp[0].cbuf, TRUE);
2174 yyerror (_("parse error"));
2182 initializer = yyvsp[0].id;
2183 initializer_line = ccode_line;
2189 initializer = (yyvsp[0].cbuf)->str;
2190 initializer_line = ccode_line;
2191 g_string_free(yyvsp[0].cbuf, FALSE);
2204 { destructor = NULL; }
2208 { initializer = NULL; }
2220 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2226 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2233 if(strcmp(yyvsp[-6].id,"get")==0 &&
2234 strcmp(yyvsp[-3].id,"set")==0) {
2235 Type *type = pop_type();
2236 g_free (yyvsp[-6].id);
2237 g_free (yyvsp[-3].id);
2238 node = node_new (ARGUMENT_NODE,
2239 "gtktype:steal", yyvsp[-9].id,
2240 "atype:steal", type,
2241 "flags:steal", yyvsp[-10].list,
2242 "name:steal", yyvsp[-8].id,
2243 "get:steal", (yyvsp[-4].cbuf)->str,
2244 "get_line", yyvsp[-5].line,
2245 "set:steal", (yyvsp[-1].cbuf)->str,
2246 "set_line", yyvsp[-2].line,
2247 "line_no", yyvsp[-11].line,
2250 class_nodes = g_list_append(class_nodes,node);
2252 g_string_free (yyvsp[-4].cbuf, FALSE);
2253 g_string_free (yyvsp[-1].cbuf, FALSE);
2255 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2256 strcmp(yyvsp[-3].id,"get")==0) {
2257 Type *type = pop_type();
2258 g_free (yyvsp[-6].id);
2259 g_free (yyvsp[-3].id);
2260 node = node_new (ARGUMENT_NODE,
2261 "gtktype:steal", yyvsp[-9].id,
2262 "atype:steal", type,
2263 "flags:steal", yyvsp[-10].list,
2264 "name:steal", yyvsp[-8].id,
2265 "get:steal", (yyvsp[-1].cbuf)->str,
2266 "get_line", yyvsp[-2].line,
2267 "set:steal", (yyvsp[-4].cbuf)->str,
2268 "set_line", yyvsp[-5].line,
2269 "line_no", yyvsp[-11].line,
2271 g_string_free (yyvsp[-1].cbuf, FALSE);
2272 g_string_free (yyvsp[-4].cbuf, FALSE);
2273 class_nodes = g_list_append(class_nodes,node);
2275 g_free (yyvsp[-9].id);
2276 g_free (yyvsp[-8].id);
2277 g_free (yyvsp[-6].id);
2278 g_free (yyvsp[-3].id);
2279 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2280 g_list_free (yyvsp[-10].list);
2281 g_string_free (yyvsp[-1].cbuf, TRUE);
2282 g_string_free (yyvsp[-4].cbuf, TRUE);
2283 yyerror (_("parse error"));
2287 if (yyvsp[-7].id != NULL) {
2288 Argument *arg = (Argument *)node;
2289 export_accessors (arg->name,
2290 arg->get != NULL, arg->get_line,
2291 arg->set != NULL, arg->set_line,
2295 g_free (yyvsp[-7].id);
2304 if(strcmp(yyvsp[-3].id, "get") == 0) {
2305 Type *type = pop_type();
2306 g_free (yyvsp[-3].id);
2307 node = node_new (ARGUMENT_NODE,
2308 "gtktype:steal", yyvsp[-6].id,
2309 "atype:steal", type,
2310 "flags:steal", yyvsp[-7].list,
2311 "name:steal", yyvsp[-5].id,
2312 "get:steal", (yyvsp[-1].cbuf)->str,
2313 "get_line", yyvsp[-2].line,
2314 "line_no", yyvsp[-8].line,
2317 g_string_free (yyvsp[-1].cbuf, FALSE);
2318 class_nodes = g_list_append(class_nodes, node);
2319 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2320 Type *type = pop_type();
2321 g_free (yyvsp[-3].id);
2322 node = node_new (ARGUMENT_NODE,
2323 "gtktype:steal", yyvsp[-6].id,
2324 "atype:steal", type,
2325 "flags:steal", yyvsp[-7].list,
2326 "name:steal", yyvsp[-5].id,
2327 "set:steal", (yyvsp[-1].cbuf)->str,
2328 "set_line", yyvsp[-2].line,
2329 "line_no", yyvsp[-8].line,
2332 g_string_free (yyvsp[-1].cbuf, FALSE);
2333 class_nodes = g_list_append (class_nodes, node);
2335 g_free (yyvsp[-3].id);
2336 g_free (yyvsp[-6].id);
2337 g_free (yyvsp[-5].id);
2338 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2339 g_list_free (yyvsp[-7].list);
2340 g_string_free (yyvsp[-1].cbuf, TRUE);
2341 yyerror(_("parse error"));
2345 if (yyvsp[-4].id != NULL) {
2346 Argument *arg = (Argument *)node;
2347 export_accessors (arg->name,
2348 arg->get != NULL, arg->get_line,
2349 arg->set != NULL, arg->set_line,
2353 g_free (yyvsp[-4].id);
2358 #line 1008 "parse.y"
2361 char *get, *set = NULL;
2366 if(strcmp(yyvsp[0].id, "link")!=0 &&
2367 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2368 strcmp(yyvsp[0].id, "objectlink")!=0) {
2369 g_free(yyvsp[0].id);
2370 g_free(yyvsp[-3].id);
2371 g_free(yyvsp[-2].id);
2372 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2373 g_list_free(yyvsp[-4].list);
2374 yyerror(_("parse error"));
2380 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2381 if(var->scope == PRIVATE_SCOPE) {
2382 root = "self->_priv";
2383 } else if(var->scope == CLASS_SCOPE) {
2384 root = "SELF_GET_CLASS(self)";
2386 error_print(GOB_ERROR, yyvsp[-5].line,
2387 _("Self aliases needed when autolinking to a classwide member"));
2392 if(strcmp(yyvsp[0].id, "link")==0) {
2393 set = g_strdup_printf("%s->%s = ARG;",
2394 root, yyvsp[-2].id);
2395 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2396 set = g_strdup_printf("g_free (%s->%s); "
2397 "%s->%s = g_strdup (ARG);",
2399 root, yyvsp[-2].id);
2400 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2401 set = g_strdup_printf(
2403 "g_object_ref (G_OBJECT (ARG)); "
2404 "if (%s->%s != NULL) "
2405 "g_object_unref (G_OBJECT (%s->%s)); "
2409 root, yyvsp[-2].id);
2411 g_assert_not_reached();
2414 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2416 g_free (yyvsp[0].id);
2419 type = (Type *)node_copy ((Node *)var->vtype);
2421 node = node_new (ARGUMENT_NODE,
2422 "gtktype:steal", yyvsp[-3].id,
2423 "atype:steal", type,
2424 "flags:steal", yyvsp[-4].list,
2425 "name:steal", yyvsp[-2].id,
2427 "get_line", yyvsp[-5].line,
2429 "set_line", yyvsp[-5].line,
2430 "line_no", yyvsp[-5].line,
2433 if (yyvsp[-1].id != NULL) {
2434 Argument *arg = (Argument *)node;
2435 export_accessors (arg->name,
2436 arg->get != NULL, arg->get_line,
2437 arg->set != NULL, arg->set_line,
2441 g_free (yyvsp[-1].id);
2444 class_nodes = g_list_append (class_nodes, node);
2448 #line 1097 "parse.y"
2450 if (strcmp (yyvsp[-1].id, "export")!=0) {
2451 g_free (yyvsp[-1].id);
2452 yyerror (_("parse error"));
2455 yyval.id = yyvsp[-1].id;
2459 #line 1105 "parse.y"
2465 #line 1110 "parse.y"
2468 node_set ((Node *)property,
2469 "line_no", yyvsp[-10].line,
2470 "gtktype:steal", debool (yyvsp[-9].id),
2471 "name:steal", yyvsp[-8].id,
2473 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2474 strcmp (yyvsp[-3].id, "set") == 0) {
2475 node_set ((Node *)property,
2476 "get:steal", (yyvsp[-4].cbuf)->str,
2477 "get_line", yyvsp[-5].line,
2478 "set:steal", (yyvsp[-1].cbuf)->str,
2479 "set_line", yyvsp[-2].line,
2481 g_string_free (yyvsp[-4].cbuf, FALSE);
2482 g_string_free (yyvsp[-1].cbuf, FALSE);
2483 g_free (yyvsp[-6].id);
2484 g_free (yyvsp[-3].id);
2485 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2486 strcmp (yyvsp[-3].id, "get") == 0) {
2487 node_set ((Node *)property,
2488 "get:steal", (yyvsp[-1].cbuf)->str,
2489 "get_line", yyvsp[-2].line,
2490 "set:steal", (yyvsp[-4].cbuf)->str,
2491 "set_line", yyvsp[-5].line,
2493 g_string_free (yyvsp[-4].cbuf, FALSE);
2494 g_string_free (yyvsp[-1].cbuf, FALSE);
2495 g_free (yyvsp[-6].id);
2496 g_free (yyvsp[-3].id);
2498 g_string_free (yyvsp[-4].cbuf, TRUE);
2499 g_string_free (yyvsp[-1].cbuf, TRUE);
2500 g_free (yyvsp[-6].id);
2501 g_free (yyvsp[-3].id);
2502 node_free ((Node *)property);
2504 yyerror (_("parse error"));
2507 property_link_and_export ((Node *)property);
2508 if (property != NULL) {
2509 class_nodes = g_list_append (class_nodes,
2516 #line 1158 "parse.y"
2519 node_set ((Node *)property,
2520 "line_no", yyvsp[-7].line,
2521 "gtktype:steal", debool (yyvsp[-6].id),
2522 "name:steal", yyvsp[-5].id,
2524 if (strcmp (yyvsp[-3].id, "get") == 0) {
2525 node_set ((Node *)property,
2526 "get:steal", (yyvsp[-1].cbuf)->str,
2527 "get_line", yyvsp[-2].line,
2529 g_string_free (yyvsp[-1].cbuf, FALSE);
2530 g_free (yyvsp[-3].id);
2531 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2532 node_set ((Node *)property,
2533 "set:steal", (yyvsp[-1].cbuf)->str,
2534 "set_line", yyvsp[-2].line,
2536 g_string_free (yyvsp[-1].cbuf, FALSE);
2537 g_free (yyvsp[-3].id);
2539 g_string_free (yyvsp[-1].cbuf, TRUE);
2540 g_free (yyvsp[-3].id);
2541 node_free ((Node *)property);
2543 yyerror (_("parse error"));
2546 property_link_and_export ((Node *)property);
2547 if (property != NULL) {
2548 class_nodes = g_list_append (class_nodes,
2555 #line 1194 "parse.y"
2558 node_set ((Node *)property,
2559 "line_no", yyvsp[-4].line,
2560 "gtktype:steal", debool (yyvsp[-3].id),
2561 "name:steal", yyvsp[-2].id,
2563 property_link_and_export ((Node *)property);
2564 if (property != NULL) {
2565 class_nodes = g_list_append (class_nodes,
2572 #line 1210 "parse.y"
2576 #line 1211 "parse.y"
2580 #line 1214 "parse.y"
2584 #line 1215 "parse.y"
2588 #line 1218 "parse.y"
2589 { yyval.id = yyvsp[0].id; }
2592 #line 1219 "parse.y"
2594 if (strcmp (yyvsp[-3].id, "_") != 0) {
2595 g_free (yyvsp[-3].id);
2596 yyerror(_("parse error"));
2599 g_free (yyvsp[-3].id);
2600 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2601 g_free (yyvsp[-1].id);
2605 #line 1231 "parse.y"
2606 { yyval.id = yyvsp[0].id; }
2609 #line 1232 "parse.y"
2610 { yyval.id = yyvsp[0].id; }
2613 #line 1235 "parse.y"
2616 node_set ((Node *)property,
2617 "nick:steal", yyvsp[0].id,
2622 #line 1241 "parse.y"
2625 node_set ((Node *)property,
2626 "blurb:steal", yyvsp[0].id,
2631 #line 1247 "parse.y"
2634 node_set ((Node *)property,
2635 "maximum:steal", yyvsp[0].id,
2640 #line 1253 "parse.y"
2643 node_set ((Node *)property,
2644 "minimum:steal", yyvsp[0].id,
2649 #line 1259 "parse.y"
2652 node_set ((Node *)property,
2653 "default_value:steal", yyvsp[0].id,
2658 #line 1265 "parse.y"
2661 node_set ((Node *)property,
2662 "flags:steal", yyvsp[0].list,
2667 #line 1271 "parse.y"
2669 Type *type = pop_type ();
2671 node_set ((Node *)property,
2672 "ptype:steal", type,
2677 #line 1278 "parse.y"
2680 node_set ((Node *)property,
2681 "extra_gtktype:steal", yyvsp[0].id,
2686 #line 1284 "parse.y"
2689 node_set ((Node *)property,
2690 "extra_gtktype:steal", yyvsp[0].id,
2695 #line 1290 "parse.y"
2698 node_set ((Node *)property,
2699 "extra_gtktype:steal", yyvsp[0].id,
2704 #line 1296 "parse.y"
2707 node_set ((Node *)property,
2708 "extra_gtktype:steal", yyvsp[0].id,
2713 #line 1302 "parse.y"
2716 node_set ((Node *)property,
2717 "extra_gtktype:steal", yyvsp[0].id,
2722 #line 1308 "parse.y"
2725 node_set ((Node *)property,
2726 "extra_gtktype:steal", yyvsp[0].id,
2731 #line 1314 "parse.y"
2734 node_set ((Node *)property,
2735 "extra_gtktype:steal", yyvsp[0].id,
2740 #line 1320 "parse.y"
2743 node_set ((Node *)property,
2744 "extra_gtktype:steal", yyvsp[0].id,
2749 #line 1326 "parse.y"
2752 node_set ((Node *)property,
2753 "extra_gtktype:steal", yyvsp[0].id,
2758 #line 1332 "parse.y"
2761 node_set ((Node *)property,
2762 "extra_gtktype:steal", yyvsp[0].id,
2767 #line 1338 "parse.y"
2770 if (strcmp (yyvsp[0].id, "link") == 0) {
2771 g_free(yyvsp[0].id);
2772 node_set ((Node *)property,
2775 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2776 g_free(yyvsp[0].id);
2777 node_set ((Node *)property,
2781 g_free(yyvsp[0].id);
2782 yyerror(_("parse error"));
2788 #line 1358 "parse.y"
2790 if(strcmp(yyvsp[-2].id,"type")!=0) {
2791 g_free(yyvsp[-4].id);
2792 g_free(yyvsp[-2].id);
2793 yyerror(_("parse error"));
2796 yyval.id = debool (yyvsp[-4].id);
2800 #line 1367 "parse.y"
2802 yyval.id = debool (yyvsp[0].id);
2803 typestack = g_list_prepend(typestack,NULL);
2807 #line 1373 "parse.y"
2808 { yyval.list = yyvsp[-1].list; }
2811 #line 1374 "parse.y"
2812 { yyval.list = NULL; }
2815 #line 1377 "parse.y"
2817 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2821 #line 1380 "parse.y"
2823 yyval.list = g_list_append(NULL,yyvsp[0].id);
2827 #line 1386 "parse.y"
2829 Node *node = node_new (TYPE_NODE,
2830 "name:steal", yyvsp[-1].id,
2831 "pointer:steal", yyvsp[0].id,
2833 typestack = g_list_prepend(typestack,node);
2837 #line 1393 "parse.y"
2839 Node *node = node_new (TYPE_NODE,
2840 "name:steal", yyvsp[0].id,
2842 typestack = g_list_prepend(typestack,node);
2846 #line 1402 "parse.y"
2848 yyval.id = yyvsp[0].id;
2852 #line 1405 "parse.y"
2854 yyval.id = yyvsp[0].id;
2858 #line 1408 "parse.y"
2860 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2861 g_free(yyvsp[0].id);
2865 #line 1412 "parse.y"
2867 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2868 g_free(yyvsp[-1].id);
2872 #line 1416 "parse.y"
2874 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2875 g_free(yyvsp[0].id);
2879 #line 1420 "parse.y"
2881 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2883 g_free(yyvsp[0].id);
2887 #line 1425 "parse.y"
2889 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2890 yyvsp[-1].id, " const", NULL);
2891 g_free(yyvsp[-1].id);
2895 #line 1433 "parse.y"
2897 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2898 g_free(yyvsp[0].id);
2902 #line 1437 "parse.y"
2904 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2905 g_free(yyvsp[-1].id);
2906 g_free(yyvsp[0].id);
2910 #line 1442 "parse.y"
2912 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2913 g_free(yyvsp[0].id);
2917 #line 1446 "parse.y"
2919 yyval.id = yyvsp[0].id;
2923 #line 1449 "parse.y"
2925 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2926 g_free(yyvsp[-1].id);
2930 #line 1453 "parse.y"
2932 yyval.id = g_strdup(yyvsp[0].id);
2936 #line 1456 "parse.y"
2938 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2942 #line 1461 "parse.y"
2943 { yyval.id = "void"; }
2946 #line 1462 "parse.y"
2947 { yyval.id = "char"; }
2950 #line 1463 "parse.y"
2951 { yyval.id = "short"; }
2954 #line 1464 "parse.y"
2955 { yyval.id = "int"; }
2958 #line 1465 "parse.y"
2959 { yyval.id = "long"; }
2962 #line 1466 "parse.y"
2963 { yyval.id = "float"; }
2966 #line 1467 "parse.y"
2967 { yyval.id = "double"; }
2970 #line 1468 "parse.y"
2971 { yyval.id = "signed"; }
2974 #line 1469 "parse.y"
2975 { yyval.id = "unsigned"; }
2978 #line 1472 "parse.y"
2979 { yyval.id = "struct"; }
2982 #line 1473 "parse.y"
2983 { yyval.id = "union"; }
2986 #line 1474 "parse.y"
2987 { yyval.id = "enum"; }
2990 #line 1477 "parse.y"
2991 { yyval.id = g_strdup("*"); }
2994 #line 1478 "parse.y"
2995 { yyval.id = g_strdup("* const"); }
2998 #line 1479 "parse.y"
3000 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
3001 g_free(yyvsp[0].id);
3005 #line 1483 "parse.y"
3007 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3008 g_free(yyvsp[0].id);
3012 #line 1490 "parse.y"
3014 if(strcmp(yyvsp[-1].id, "first")==0)
3015 yyval.sigtype = SIGNAL_FIRST_METHOD;
3016 else if(strcmp(yyvsp[-1].id, "last")==0)
3017 yyval.sigtype = SIGNAL_LAST_METHOD;
3019 yyerror(_("signal must be 'first' or 'last'"));
3020 g_free(yyvsp[-1].id);
3023 g_free(yyvsp[-1].id);
3027 #line 1502 "parse.y"
3029 yyval.sigtype = SIGNAL_LAST_METHOD;
3033 #line 1508 "parse.y"
3035 if(strcmp(yyvsp[-1].id,"first")==0)
3036 yyval.sigtype = SIGNAL_FIRST_METHOD;
3037 else if(strcmp(yyvsp[-1].id,"last")==0)
3038 yyval.sigtype = SIGNAL_LAST_METHOD;
3040 yyerror(_("signal must be 'first' or 'last'"));
3041 g_free(yyvsp[-1].id);
3044 g_free(yyvsp[-1].id);
3048 #line 1520 "parse.y"
3050 if(strcmp(yyvsp[-2].id,"first")==0)
3051 yyval.sigtype = SIGNAL_FIRST_METHOD;
3052 else if(strcmp(yyvsp[-2].id,"last")==0)
3053 yyval.sigtype = SIGNAL_LAST_METHOD;
3055 yyerror(_("signal must be 'first' or 'last'"));
3056 g_free(yyvsp[-2].id);
3059 g_free(yyvsp[-2].id);
3063 #line 1532 "parse.y"
3065 yyval.sigtype = SIGNAL_LAST_METHOD;
3069 #line 1535 "parse.y"
3071 /* the_scope was default thus public */
3072 the_scope = PUBLIC_SCOPE;
3076 #line 1541 "parse.y"
3078 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3082 #line 1546 "parse.y"
3084 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3088 #line 1549 "parse.y"
3090 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3094 #line 1554 "parse.y"
3095 { yyval.cbuf = yyvsp[0].cbuf; }
3098 #line 1555 "parse.y"
3099 { yyval.cbuf = NULL; }
3102 #line 1559 "parse.y"
3105 yyerror(_("signal without 'self' as "
3106 "first parameter"));
3107 free_all_global_state();
3110 if(the_scope == CLASS_SCOPE) {
3111 yyerror(_("a method cannot be of class scope"));
3112 free_all_global_state();
3115 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3116 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3117 ccode_line, vararg, yyvsp[-8].list);
3121 #line 1575 "parse.y"
3124 yyerror(_("signal without 'self' as "
3125 "first parameter"));
3126 free_all_global_state();
3129 if(the_scope == CLASS_SCOPE) {
3130 yyerror(_("a method cannot be of class scope"));
3131 free_all_global_state();
3134 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3135 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3136 ccode_line, vararg, yyvsp[-8].list);
3140 #line 1591 "parse.y"
3143 yyerror(_("virtual method without 'self' as "
3144 "first parameter"));
3145 free_all_global_state();
3148 if(the_scope == CLASS_SCOPE) {
3149 yyerror(_("a method cannot be of class scope"));
3150 free_all_global_state();
3153 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3154 yyvsp[0].cbuf, yyvsp[-8].line,
3155 ccode_line, vararg, NULL);
3159 #line 1607 "parse.y"
3162 yyerror(_("virtual method without 'self' as "
3163 "first parameter"));
3164 free_all_global_state();
3167 if(the_scope == CLASS_SCOPE) {
3168 yyerror(_("a method cannot be of class scope"));
3169 free_all_global_state();
3172 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3173 yyvsp[0].cbuf, yyvsp[-7].line,
3174 ccode_line, vararg, NULL);
3178 #line 1623 "parse.y"
3181 yyerror(_("virtual method without 'self' as "
3182 "first parameter"));
3183 free_all_global_state();
3186 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3187 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3188 ccode_line, vararg, NULL);
3192 #line 1634 "parse.y"
3194 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3195 yyvsp[-5].id, yyvsp[0].cbuf,
3196 yyvsp[-10].line, ccode_line,
3201 #line 1640 "parse.y"
3203 if(the_scope == CLASS_SCOPE) {
3204 yyerror(_("a method cannot be of class scope"));
3205 free_all_global_state();
3208 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3209 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3214 #line 1650 "parse.y"
3216 if(strcmp(yyvsp[-4].id, "init")==0) {
3217 push_init_arg(yyvsp[-2].id,FALSE);
3218 push_function(NO_SCOPE, INIT_METHOD, NULL,
3219 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3220 ccode_line, FALSE, NULL);
3221 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3222 push_init_arg(yyvsp[-2].id,TRUE);
3223 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3224 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3225 ccode_line, FALSE, NULL);
3227 g_free(yyvsp[-4].id);
3228 g_free(yyvsp[-2].id);
3229 g_string_free(yyvsp[0].cbuf,TRUE);
3230 yyerror(_("parse error "
3231 "(untyped blocks must be init or "
3238 #line 1673 "parse.y"
3240 g_free(onerror); onerror = NULL;
3241 g_free(defreturn); defreturn = NULL;
3242 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3243 g_free(yyvsp[-1].id);
3244 g_free(yyvsp[0].id);
3245 yyerror(_("parse error"));
3248 g_free(yyvsp[-1].id);
3252 #line 1684 "parse.y"
3254 g_free(onerror); onerror = NULL;
3255 g_free(defreturn); defreturn = NULL;
3256 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3257 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3258 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3259 yyerror(_("parse error"));
3262 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3263 onerror = defreturn = NULL;
3264 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3265 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3266 yyerror(_("parse error"));
3269 g_free(yyvsp[-3].id);
3270 g_free(yyvsp[-1].id);
3274 #line 1703 "parse.y"
3276 g_free(onerror); onerror = NULL;
3277 g_free(defreturn); defreturn = NULL;
3281 #line 1709 "parse.y"
3282 { yyval.id = yyvsp[0].id; }
3285 #line 1710 "parse.y"
3287 yyval.id = (yyvsp[0].cbuf)->str;
3288 g_string_free(yyvsp[0].cbuf, FALSE);
3292 #line 1716 "parse.y"
3293 { vararg = FALSE; has_self = FALSE; }
3296 #line 1717 "parse.y"
3300 if(strcmp(yyvsp[0].id,"self")==0)
3301 push_self(yyvsp[0].id, FALSE);
3303 g_free(yyvsp[0].id);
3304 yyerror(_("parse error"));
3310 #line 1728 "parse.y"
3314 if(strcmp(yyvsp[-1].id,"self")==0)
3315 push_self(yyvsp[-1].id, TRUE);
3317 g_free(yyvsp[-1].id);
3318 yyerror(_("parse error"));
3324 #line 1739 "parse.y"
3328 if(strcmp(yyvsp[0].id,"self")==0)
3329 push_self(yyvsp[0].id, TRUE);
3331 g_free(yyvsp[0].id);
3332 yyerror(_("parse error"));
3338 #line 1750 "parse.y"
3341 if(strcmp(yyvsp[-2].id,"self")==0)
3342 push_self(yyvsp[-2].id, FALSE);
3344 g_free(yyvsp[-2].id);
3345 yyerror(_("parse error"));
3351 #line 1760 "parse.y"
3354 if(strcmp(yyvsp[-3].id,"self")==0)
3355 push_self(yyvsp[-3].id, TRUE);
3357 g_free(yyvsp[-3].id);
3358 yyerror(_("parse error"));
3364 #line 1770 "parse.y"
3367 if(strcmp(yyvsp[-2].id,"self")==0)
3368 push_self(yyvsp[-2].id, TRUE);
3370 g_free(yyvsp[-2].id);
3371 yyerror(_("parse error"));
3377 #line 1780 "parse.y"
3378 { has_self = FALSE; }
3381 #line 1783 "parse.y"
3385 #line 1784 "parse.y"
3389 #line 1787 "parse.y"
3393 #line 1788 "parse.y"
3397 #line 1791 "parse.y"
3399 push_funcarg(yyvsp[0].id,NULL);
3403 #line 1794 "parse.y"
3405 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3409 #line 1797 "parse.y"
3411 if(strcmp(yyvsp[-2].id,"check")!=0) {
3412 yyerror(_("parse error"));
3415 g_free(yyvsp[-2].id);
3416 push_funcarg(yyvsp[-4].id,NULL);
3420 #line 1805 "parse.y"
3422 if(strcmp(yyvsp[-2].id,"check")!=0) {
3423 yyerror(_("parse error"));
3426 g_free(yyvsp[-2].id);
3427 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3431 #line 1815 "parse.y"
3435 #line 1816 "parse.y"
3439 #line 1819 "parse.y"
3441 if(strcmp(yyvsp[0].id,"type")==0) {
3442 Node *node = node_new (CHECK_NODE,
3443 "chtype", TYPE_CHECK,
3445 checks = g_list_append(checks,node);
3446 } else if(strcmp(yyvsp[0].id,"null")==0) {
3447 Node *node = node_new (CHECK_NODE,
3448 "chtype", NULL_CHECK,
3450 checks = g_list_append(checks,node);
3452 yyerror(_("parse error"));
3455 g_free(yyvsp[0].id);
3459 #line 1836 "parse.y"
3461 Node *node = node_new (CHECK_NODE,
3463 "number:steal", yyvsp[0].id,
3465 checks = g_list_append(checks,node);
3469 #line 1843 "parse.y"
3471 Node *node = node_new (CHECK_NODE,
3473 "number:steal", yyvsp[0].id,
3475 checks = g_list_append(checks,node);
3479 #line 1850 "parse.y"
3481 Node *node = node_new (CHECK_NODE,
3483 "number:steal", yyvsp[0].id,
3485 checks = g_list_append(checks,node);
3489 #line 1857 "parse.y"
3491 Node *node = node_new (CHECK_NODE,
3493 "number:steal", yyvsp[0].id,
3495 checks = g_list_append(checks,node);
3499 #line 1864 "parse.y"
3501 Node *node = node_new (CHECK_NODE,
3503 "number:steal", yyvsp[0].id,
3505 checks = g_list_append(checks,node);
3509 #line 1871 "parse.y"
3511 Node *node = node_new (CHECK_NODE,
3513 "number:steal", yyvsp[0].id,
3515 checks = g_list_append(checks,node);
3519 #line 1880 "parse.y"
3521 Node *node = node_new (ENUMDEF_NODE,
3522 "etype:steal", yyvsp[-1].id,
3523 "prefix:steal", yyvsp[-5].id,
3524 "values:steal", enum_vals,
3527 nodes = g_list_append (nodes, node);
3531 #line 1889 "parse.y"
3533 Node *node = node_new (ENUMDEF_NODE,
3534 "etype:steal", yyvsp[-1].id,
3535 "prefix:steal", yyvsp[-6].id,
3536 "values:steal", enum_vals,
3539 nodes = g_list_append (nodes, node);
3543 #line 1900 "parse.y"
3547 #line 1901 "parse.y"
3551 #line 1904 "parse.y"
3554 char *num = yyvsp[0].id;
3556 /* A float value, that's a bad enum */
3557 if (num[0] >= '0' &&
3559 strchr (num, '.') != NULL) {
3560 g_free (yyvsp[-2].id);
3562 yyerror(_("parse error (enumerator value not integer constant)"));
3566 node = node_new (ENUMVALUE_NODE,
3567 "name:steal", yyvsp[-2].id,
3570 enum_vals = g_list_append (enum_vals, node);
3574 #line 1924 "parse.y"
3578 node = node_new (ENUMVALUE_NODE,
3579 "name:steal", yyvsp[0].id,
3581 enum_vals = g_list_append (enum_vals, node);
3585 #line 1934 "parse.y"
3587 Node *node = node_new (FLAGS_NODE,
3588 "ftype:steal", yyvsp[-1].id,
3589 "prefix:steal", yyvsp[-5].id,
3590 "values:steal", flag_vals,
3593 nodes = g_list_append (nodes, node);
3597 #line 1943 "parse.y"
3599 Node *node = node_new (FLAGS_NODE,
3600 "ftype:steal", yyvsp[-1].id,
3601 "prefix:steal", yyvsp[-6].id,
3602 "values:steal", flag_vals,
3605 nodes = g_list_append (nodes, node);
3609 #line 1954 "parse.y"
3611 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3615 #line 1957 "parse.y"
3617 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3621 #line 1962 "parse.y"
3623 Node *node = node_new (ERROR_NODE,
3624 "etype:steal", yyvsp[-1].id,
3625 "prefix:steal", yyvsp[-5].id,
3626 "values:steal", error_vals,
3629 nodes = g_list_append (nodes, node);
3633 #line 1971 "parse.y"
3635 Node *node = node_new (ERROR_NODE,
3636 "etype:steal", yyvsp[-1].id,
3637 "prefix:steal", yyvsp[-6].id,
3638 "values:steal", error_vals,
3641 nodes = g_list_append (nodes, node);
3645 #line 1982 "parse.y"
3647 error_vals = g_list_append (error_vals, yyvsp[0].id);
3651 #line 1985 "parse.y"
3653 error_vals = g_list_append (error_vals, yyvsp[0].id);
3657 #line 1991 "parse.y"
3658 { yyval.id = yyvsp[0].id; }
3661 #line 1992 "parse.y"
3663 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3664 g_free(yyvsp[0].id);
3668 #line 1996 "parse.y"
3669 { yyval.id = yyvsp[0].id; }
3672 #line 1997 "parse.y"
3673 { yyval.id = yyvsp[0].id; }
3677 #line 705 "/usr/share/bison/bison.simple"
3689 short *yyssp1 = yyss - 1;
3690 YYFPRINTF (stderr, "state stack now");
3691 while (yyssp1 != yyssp)
3692 YYFPRINTF (stderr, " %d", *++yyssp1);
3693 YYFPRINTF (stderr, "\n");
3702 /* Now `shift' the result of the reduction. Determine what state
3703 that goes to, based on the state we popped back to and the rule
3704 number reduced by. */
3708 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3709 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3710 yystate = yytable[yystate];
3712 yystate = yydefgoto[yyn - YYNTBASE];
3717 /*------------------------------------.
3718 | yyerrlab -- here on detecting error |
3719 `------------------------------------*/
3721 /* If not already recovering from an error, report this error. */
3726 #ifdef YYERROR_VERBOSE
3727 yyn = yypact[yystate];
3729 if (yyn > YYFLAG && yyn < YYLAST)
3731 YYSIZE_T yysize = 0;
3736 /* Start YYX at -YYN if negative to avoid negative indexes in
3738 for (yyx = yyn < 0 ? -yyn : 0;
3739 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
3740 if (yycheck[yyx + yyn] == yyx)
3741 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
3742 yysize += yystrlen ("parse error, unexpected ") + 1;
3743 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
3744 yymsg = (char *) YYSTACK_ALLOC (yysize);
3747 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
3748 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
3753 for (yyx = yyn < 0 ? -yyn : 0;
3754 yyx < (int) (sizeof (yytname) / sizeof (char *));
3756 if (yycheck[yyx + yyn] == yyx)
3758 const char *yyq = ! yycount ? ", expecting " : " or ";
3759 yyp = yystpcpy (yyp, yyq);
3760 yyp = yystpcpy (yyp, yytname[yyx]);
3765 YYSTACK_FREE (yymsg);
3768 yyerror ("parse error; also virtual memory exhausted");
3771 #endif /* defined (YYERROR_VERBOSE) */
3772 yyerror ("parse error");
3777 /*--------------------------------------------------.
3778 | yyerrlab1 -- error raised explicitly by an action |
3779 `--------------------------------------------------*/
3781 if (yyerrstatus == 3)
3783 /* If just tried and failed to reuse lookahead token after an
3784 error, discard it. */
3786 /* return failure if at end of input */
3787 if (yychar == YYEOF)
3789 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
3790 yychar, yytname[yychar1]));
3794 /* Else will try to reuse lookahead token after shifting the error
3797 yyerrstatus = 3; /* Each real token shifted decrements this */
3802 /*-------------------------------------------------------------------.
3803 | yyerrdefault -- current state does not do anything special for the |
3805 `-------------------------------------------------------------------*/
3808 /* This is wrong; only states that explicitly want error tokens
3809 should shift them. */
3811 /* If its default is to accept any token, ok. Otherwise pop it. */
3812 yyn = yydefact[yystate];
3818 /*---------------------------------------------------------------.
3819 | yyerrpop -- pop the current state because it cannot handle the |
3821 `---------------------------------------------------------------*/
3834 short *yyssp1 = yyss - 1;
3835 YYFPRINTF (stderr, "Error: state stack now");
3836 while (yyssp1 != yyssp)
3837 YYFPRINTF (stderr, " %d", *++yyssp1);
3838 YYFPRINTF (stderr, "\n");
3846 yyn = yypact[yystate];
3851 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3868 YYDPRINTF ((stderr, "Shifting error token, "));
3879 /*-------------------------------------.
3880 | yyacceptlab -- YYACCEPT comes here. |
3881 `-------------------------------------*/
3886 /*-----------------------------------.
3887 | yyabortlab -- YYABORT comes here. |
3888 `-----------------------------------*/
3893 /*---------------------------------------------.
3894 | yyoverflowab -- parser overflow comes here. |
3895 `---------------------------------------------*/
3897 yyerror ("parser stack overflow");
3904 YYSTACK_FREE (yyss);
3908 #line 2000 "parse.y"