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);
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, 1093, 1101, 1106, 1154, 1190, 1206, 1207,
821 1210, 1211, 1214, 1215, 1227, 1228, 1231, 1237, 1243, 1249,
822 1255, 1261, 1267, 1274, 1280, 1286, 1292, 1298, 1304, 1310,
823 1316, 1322, 1328, 1334, 1354, 1363, 1369, 1370, 1373, 1376,
824 1382, 1389, 1398, 1401, 1404, 1408, 1412, 1416, 1421, 1429,
825 1433, 1438, 1442, 1445, 1449, 1452, 1457, 1458, 1459, 1460,
826 1461, 1462, 1463, 1464, 1465, 1468, 1469, 1470, 1473, 1474,
827 1475, 1479, 1486, 1498, 1504, 1516, 1528, 1531, 1537, 1542,
828 1545, 1550, 1551, 1555, 1571, 1587, 1603, 1619, 1630, 1636,
829 1646, 1669, 1680, 1699, 1705, 1706, 1712, 1713, 1724, 1735,
830 1746, 1756, 1766, 1776, 1779, 1780, 1783, 1784, 1787, 1790,
831 1793, 1801, 1811, 1812, 1815, 1832, 1839, 1846, 1853, 1860,
832 1867, 1876, 1885, 1896, 1897, 1900, 1920, 1930, 1939, 1950,
833 1953, 1958, 1967, 1978, 1981, 1987, 1988, 1992, 1993
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"));
2388 if(strcmp(yyvsp[0].id, "link")==0) {
2389 set = g_strdup_printf("%s->%s = ARG;",
2390 root, yyvsp[-2].id);
2391 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2392 set = g_strdup_printf("g_free (%s->%s); "
2393 "%s->%s = g_strdup (ARG);",
2395 root, yyvsp[-2].id);
2396 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2397 set = g_strdup_printf(
2399 "g_object_ref (G_OBJECT (ARG)); "
2400 "if (%s->%s != NULL) "
2401 "g_object_unref (G_OBJECT (%s->%s)); "
2405 root, yyvsp[-2].id);
2407 g_assert_not_reached();
2410 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2412 g_free (yyvsp[0].id);
2415 type = (Type *)node_copy ((Node *)var->vtype);
2417 node = node_new (ARGUMENT_NODE,
2418 "gtktype:steal", yyvsp[-3].id,
2419 "atype:steal", type,
2420 "flags:steal", yyvsp[-4].list,
2421 "name:steal", yyvsp[-2].id,
2423 "get_line", yyvsp[-5].line,
2425 "set_line", yyvsp[-5].line,
2426 "line_no", yyvsp[-5].line,
2429 if (yyvsp[-1].id != NULL) {
2430 Argument *arg = (Argument *)node;
2431 export_accessors (arg->name,
2432 arg->get != NULL, arg->get_line,
2433 arg->set != NULL, arg->set_line,
2437 g_free (yyvsp[-1].id);
2440 class_nodes = g_list_append (class_nodes, node);
2444 #line 1093 "parse.y"
2446 if (strcmp (yyvsp[-1].id, "export")!=0) {
2447 g_free (yyvsp[-1].id);
2448 yyerror (_("parse error"));
2451 yyval.id = yyvsp[-1].id;
2455 #line 1101 "parse.y"
2461 #line 1106 "parse.y"
2464 node_set ((Node *)property,
2465 "line_no", yyvsp[-10].line,
2466 "gtktype:steal", debool (yyvsp[-9].id),
2467 "name:steal", yyvsp[-8].id,
2469 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2470 strcmp (yyvsp[-3].id, "set") == 0) {
2471 node_set ((Node *)property,
2472 "get:steal", (yyvsp[-4].cbuf)->str,
2473 "get_line", yyvsp[-5].line,
2474 "set:steal", (yyvsp[-1].cbuf)->str,
2475 "set_line", yyvsp[-2].line,
2477 g_string_free (yyvsp[-4].cbuf, FALSE);
2478 g_string_free (yyvsp[-1].cbuf, FALSE);
2479 g_free (yyvsp[-6].id);
2480 g_free (yyvsp[-3].id);
2481 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2482 strcmp (yyvsp[-3].id, "get") == 0) {
2483 node_set ((Node *)property,
2484 "get:steal", (yyvsp[-1].cbuf)->str,
2485 "get_line", yyvsp[-2].line,
2486 "set:steal", (yyvsp[-4].cbuf)->str,
2487 "set_line", yyvsp[-5].line,
2489 g_string_free (yyvsp[-4].cbuf, FALSE);
2490 g_string_free (yyvsp[-1].cbuf, FALSE);
2491 g_free (yyvsp[-6].id);
2492 g_free (yyvsp[-3].id);
2494 g_string_free (yyvsp[-4].cbuf, TRUE);
2495 g_string_free (yyvsp[-1].cbuf, TRUE);
2496 g_free (yyvsp[-6].id);
2497 g_free (yyvsp[-3].id);
2498 node_free ((Node *)property);
2500 yyerror (_("parse error"));
2503 property_link_and_export ((Node *)property);
2504 if (property != NULL) {
2505 class_nodes = g_list_append (class_nodes,
2512 #line 1154 "parse.y"
2515 node_set ((Node *)property,
2516 "line_no", yyvsp[-7].line,
2517 "gtktype:steal", debool (yyvsp[-6].id),
2518 "name:steal", yyvsp[-5].id,
2520 if (strcmp (yyvsp[-3].id, "get") == 0) {
2521 node_set ((Node *)property,
2522 "get:steal", (yyvsp[-1].cbuf)->str,
2523 "get_line", yyvsp[-2].line,
2525 g_string_free (yyvsp[-1].cbuf, FALSE);
2526 g_free (yyvsp[-3].id);
2527 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2528 node_set ((Node *)property,
2529 "set:steal", (yyvsp[-1].cbuf)->str,
2530 "set_line", yyvsp[-2].line,
2532 g_string_free (yyvsp[-1].cbuf, FALSE);
2533 g_free (yyvsp[-3].id);
2535 g_string_free (yyvsp[-1].cbuf, TRUE);
2536 g_free (yyvsp[-3].id);
2537 node_free ((Node *)property);
2539 yyerror (_("parse error"));
2542 property_link_and_export ((Node *)property);
2543 if (property != NULL) {
2544 class_nodes = g_list_append (class_nodes,
2551 #line 1190 "parse.y"
2554 node_set ((Node *)property,
2555 "line_no", yyvsp[-4].line,
2556 "gtktype:steal", debool (yyvsp[-3].id),
2557 "name:steal", yyvsp[-2].id,
2559 property_link_and_export ((Node *)property);
2560 if (property != NULL) {
2561 class_nodes = g_list_append (class_nodes,
2568 #line 1206 "parse.y"
2572 #line 1207 "parse.y"
2576 #line 1210 "parse.y"
2580 #line 1211 "parse.y"
2584 #line 1214 "parse.y"
2585 { yyval.id = yyvsp[0].id; }
2588 #line 1215 "parse.y"
2590 if (strcmp (yyvsp[-3].id, "_") != 0) {
2591 g_free (yyvsp[-3].id);
2592 yyerror(_("parse error"));
2595 g_free (yyvsp[-3].id);
2596 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2597 g_free (yyvsp[-1].id);
2601 #line 1227 "parse.y"
2602 { yyval.id = yyvsp[0].id; }
2605 #line 1228 "parse.y"
2606 { yyval.id = yyvsp[0].id; }
2609 #line 1231 "parse.y"
2612 node_set ((Node *)property,
2613 "nick:steal", yyvsp[0].id,
2618 #line 1237 "parse.y"
2621 node_set ((Node *)property,
2622 "blurb:steal", yyvsp[0].id,
2627 #line 1243 "parse.y"
2630 node_set ((Node *)property,
2631 "maximum:steal", yyvsp[0].id,
2636 #line 1249 "parse.y"
2639 node_set ((Node *)property,
2640 "minimum:steal", yyvsp[0].id,
2645 #line 1255 "parse.y"
2648 node_set ((Node *)property,
2649 "default_value:steal", yyvsp[0].id,
2654 #line 1261 "parse.y"
2657 node_set ((Node *)property,
2658 "flags:steal", yyvsp[0].list,
2663 #line 1267 "parse.y"
2665 Type *type = pop_type ();
2667 node_set ((Node *)property,
2668 "ptype:steal", type,
2673 #line 1274 "parse.y"
2676 node_set ((Node *)property,
2677 "extra_gtktype:steal", yyvsp[0].id,
2682 #line 1280 "parse.y"
2685 node_set ((Node *)property,
2686 "extra_gtktype:steal", yyvsp[0].id,
2691 #line 1286 "parse.y"
2694 node_set ((Node *)property,
2695 "extra_gtktype:steal", yyvsp[0].id,
2700 #line 1292 "parse.y"
2703 node_set ((Node *)property,
2704 "extra_gtktype:steal", yyvsp[0].id,
2709 #line 1298 "parse.y"
2712 node_set ((Node *)property,
2713 "extra_gtktype:steal", yyvsp[0].id,
2718 #line 1304 "parse.y"
2721 node_set ((Node *)property,
2722 "extra_gtktype:steal", yyvsp[0].id,
2727 #line 1310 "parse.y"
2730 node_set ((Node *)property,
2731 "extra_gtktype:steal", yyvsp[0].id,
2736 #line 1316 "parse.y"
2739 node_set ((Node *)property,
2740 "extra_gtktype:steal", yyvsp[0].id,
2745 #line 1322 "parse.y"
2748 node_set ((Node *)property,
2749 "extra_gtktype:steal", yyvsp[0].id,
2754 #line 1328 "parse.y"
2757 node_set ((Node *)property,
2758 "extra_gtktype:steal", yyvsp[0].id,
2763 #line 1334 "parse.y"
2766 if (strcmp (yyvsp[0].id, "link") == 0) {
2767 g_free(yyvsp[0].id);
2768 node_set ((Node *)property,
2771 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2772 g_free(yyvsp[0].id);
2773 node_set ((Node *)property,
2777 g_free(yyvsp[0].id);
2778 yyerror(_("parse error"));
2784 #line 1354 "parse.y"
2786 if(strcmp(yyvsp[-2].id,"type")!=0) {
2787 g_free(yyvsp[-4].id);
2788 g_free(yyvsp[-2].id);
2789 yyerror(_("parse error"));
2792 yyval.id = debool (yyvsp[-4].id);
2796 #line 1363 "parse.y"
2798 yyval.id = debool (yyvsp[0].id);
2799 typestack = g_list_prepend(typestack,NULL);
2803 #line 1369 "parse.y"
2804 { yyval.list = yyvsp[-1].list; }
2807 #line 1370 "parse.y"
2808 { yyval.list = NULL; }
2811 #line 1373 "parse.y"
2813 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2817 #line 1376 "parse.y"
2819 yyval.list = g_list_append(NULL,yyvsp[0].id);
2823 #line 1382 "parse.y"
2825 Node *node = node_new (TYPE_NODE,
2826 "name:steal", yyvsp[-1].id,
2827 "pointer:steal", yyvsp[0].id,
2829 typestack = g_list_prepend(typestack,node);
2833 #line 1389 "parse.y"
2835 Node *node = node_new (TYPE_NODE,
2836 "name:steal", yyvsp[0].id,
2838 typestack = g_list_prepend(typestack,node);
2842 #line 1398 "parse.y"
2844 yyval.id = yyvsp[0].id;
2848 #line 1401 "parse.y"
2850 yyval.id = yyvsp[0].id;
2854 #line 1404 "parse.y"
2856 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2857 g_free(yyvsp[0].id);
2861 #line 1408 "parse.y"
2863 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2864 g_free(yyvsp[-1].id);
2868 #line 1412 "parse.y"
2870 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2871 g_free(yyvsp[0].id);
2875 #line 1416 "parse.y"
2877 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2879 g_free(yyvsp[0].id);
2883 #line 1421 "parse.y"
2885 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2886 yyvsp[-1].id, " const", NULL);
2887 g_free(yyvsp[-1].id);
2891 #line 1429 "parse.y"
2893 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2894 g_free(yyvsp[0].id);
2898 #line 1433 "parse.y"
2900 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2901 g_free(yyvsp[-1].id);
2902 g_free(yyvsp[0].id);
2906 #line 1438 "parse.y"
2908 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2909 g_free(yyvsp[0].id);
2913 #line 1442 "parse.y"
2915 yyval.id = yyvsp[0].id;
2919 #line 1445 "parse.y"
2921 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2922 g_free(yyvsp[-1].id);
2926 #line 1449 "parse.y"
2928 yyval.id = g_strdup(yyvsp[0].id);
2932 #line 1452 "parse.y"
2934 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2938 #line 1457 "parse.y"
2939 { yyval.id = "void"; }
2942 #line 1458 "parse.y"
2943 { yyval.id = "char"; }
2946 #line 1459 "parse.y"
2947 { yyval.id = "short"; }
2950 #line 1460 "parse.y"
2951 { yyval.id = "int"; }
2954 #line 1461 "parse.y"
2955 { yyval.id = "long"; }
2958 #line 1462 "parse.y"
2959 { yyval.id = "float"; }
2962 #line 1463 "parse.y"
2963 { yyval.id = "double"; }
2966 #line 1464 "parse.y"
2967 { yyval.id = "signed"; }
2970 #line 1465 "parse.y"
2971 { yyval.id = "unsigned"; }
2974 #line 1468 "parse.y"
2975 { yyval.id = "struct"; }
2978 #line 1469 "parse.y"
2979 { yyval.id = "union"; }
2982 #line 1470 "parse.y"
2983 { yyval.id = "enum"; }
2986 #line 1473 "parse.y"
2987 { yyval.id = g_strdup("*"); }
2990 #line 1474 "parse.y"
2991 { yyval.id = g_strdup("* const"); }
2994 #line 1475 "parse.y"
2996 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2997 g_free(yyvsp[0].id);
3001 #line 1479 "parse.y"
3003 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3004 g_free(yyvsp[0].id);
3008 #line 1486 "parse.y"
3010 if(strcmp(yyvsp[-1].id, "first")==0)
3011 yyval.sigtype = SIGNAL_FIRST_METHOD;
3012 else if(strcmp(yyvsp[-1].id, "last")==0)
3013 yyval.sigtype = SIGNAL_LAST_METHOD;
3015 yyerror(_("signal must be 'first' or 'last'"));
3016 g_free(yyvsp[-1].id);
3019 g_free(yyvsp[-1].id);
3023 #line 1498 "parse.y"
3025 yyval.sigtype = SIGNAL_LAST_METHOD;
3029 #line 1504 "parse.y"
3031 if(strcmp(yyvsp[-1].id,"first")==0)
3032 yyval.sigtype = SIGNAL_FIRST_METHOD;
3033 else if(strcmp(yyvsp[-1].id,"last")==0)
3034 yyval.sigtype = SIGNAL_LAST_METHOD;
3036 yyerror(_("signal must be 'first' or 'last'"));
3037 g_free(yyvsp[-1].id);
3040 g_free(yyvsp[-1].id);
3044 #line 1516 "parse.y"
3046 if(strcmp(yyvsp[-2].id,"first")==0)
3047 yyval.sigtype = SIGNAL_FIRST_METHOD;
3048 else if(strcmp(yyvsp[-2].id,"last")==0)
3049 yyval.sigtype = SIGNAL_LAST_METHOD;
3051 yyerror(_("signal must be 'first' or 'last'"));
3052 g_free(yyvsp[-2].id);
3055 g_free(yyvsp[-2].id);
3059 #line 1528 "parse.y"
3061 yyval.sigtype = SIGNAL_LAST_METHOD;
3065 #line 1531 "parse.y"
3067 /* the_scope was default thus public */
3068 the_scope = PUBLIC_SCOPE;
3072 #line 1537 "parse.y"
3074 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3078 #line 1542 "parse.y"
3080 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3084 #line 1545 "parse.y"
3086 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3090 #line 1550 "parse.y"
3091 { yyval.cbuf = yyvsp[0].cbuf; }
3094 #line 1551 "parse.y"
3095 { yyval.cbuf = NULL; }
3098 #line 1555 "parse.y"
3101 yyerror(_("signal without 'self' as "
3102 "first parameter"));
3103 free_all_global_state();
3106 if(the_scope == CLASS_SCOPE) {
3107 yyerror(_("a method cannot be of class scope"));
3108 free_all_global_state();
3111 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3112 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3113 ccode_line, vararg, yyvsp[-8].list);
3117 #line 1571 "parse.y"
3120 yyerror(_("signal without 'self' as "
3121 "first parameter"));
3122 free_all_global_state();
3125 if(the_scope == CLASS_SCOPE) {
3126 yyerror(_("a method cannot be of class scope"));
3127 free_all_global_state();
3130 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3131 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3132 ccode_line, vararg, yyvsp[-8].list);
3136 #line 1587 "parse.y"
3139 yyerror(_("virtual method without 'self' as "
3140 "first parameter"));
3141 free_all_global_state();
3144 if(the_scope == CLASS_SCOPE) {
3145 yyerror(_("a method cannot be of class scope"));
3146 free_all_global_state();
3149 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3150 yyvsp[0].cbuf, yyvsp[-8].line,
3151 ccode_line, vararg, NULL);
3155 #line 1603 "parse.y"
3158 yyerror(_("virtual method without 'self' as "
3159 "first parameter"));
3160 free_all_global_state();
3163 if(the_scope == CLASS_SCOPE) {
3164 yyerror(_("a method cannot be of class scope"));
3165 free_all_global_state();
3168 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3169 yyvsp[0].cbuf, yyvsp[-7].line,
3170 ccode_line, vararg, NULL);
3174 #line 1619 "parse.y"
3177 yyerror(_("virtual method without 'self' as "
3178 "first parameter"));
3179 free_all_global_state();
3182 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3183 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3184 ccode_line, vararg, NULL);
3188 #line 1630 "parse.y"
3190 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3191 yyvsp[-5].id, yyvsp[0].cbuf,
3192 yyvsp[-10].line, ccode_line,
3197 #line 1636 "parse.y"
3199 if(the_scope == CLASS_SCOPE) {
3200 yyerror(_("a method cannot be of class scope"));
3201 free_all_global_state();
3204 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3205 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3210 #line 1646 "parse.y"
3212 if(strcmp(yyvsp[-4].id, "init")==0) {
3213 push_init_arg(yyvsp[-2].id,FALSE);
3214 push_function(NO_SCOPE, INIT_METHOD, NULL,
3215 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3216 ccode_line, FALSE, NULL);
3217 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3218 push_init_arg(yyvsp[-2].id,TRUE);
3219 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3220 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3221 ccode_line, FALSE, NULL);
3223 g_free(yyvsp[-4].id);
3224 g_free(yyvsp[-2].id);
3225 g_string_free(yyvsp[0].cbuf,TRUE);
3226 yyerror(_("parse error "
3227 "(untyped blocks must be init or "
3234 #line 1669 "parse.y"
3236 g_free(onerror); onerror = NULL;
3237 g_free(defreturn); defreturn = NULL;
3238 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3239 g_free(yyvsp[-1].id);
3240 g_free(yyvsp[0].id);
3241 yyerror(_("parse error"));
3244 g_free(yyvsp[-1].id);
3248 #line 1680 "parse.y"
3250 g_free(onerror); onerror = NULL;
3251 g_free(defreturn); defreturn = NULL;
3252 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3253 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3254 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3255 yyerror(_("parse error"));
3258 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3259 onerror = defreturn = NULL;
3260 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3261 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3262 yyerror(_("parse error"));
3265 g_free(yyvsp[-3].id);
3266 g_free(yyvsp[-1].id);
3270 #line 1699 "parse.y"
3272 g_free(onerror); onerror = NULL;
3273 g_free(defreturn); defreturn = NULL;
3277 #line 1705 "parse.y"
3278 { yyval.id = yyvsp[0].id; }
3281 #line 1706 "parse.y"
3283 yyval.id = (yyvsp[1].cbuf)->str;
3284 g_string_free(yyvsp[1].cbuf, FALSE);
3288 #line 1712 "parse.y"
3289 { vararg = FALSE; has_self = FALSE; }
3292 #line 1713 "parse.y"
3296 if(strcmp(yyvsp[0].id,"self")==0)
3297 push_self(yyvsp[0].id, FALSE);
3299 g_free(yyvsp[0].id);
3300 yyerror(_("parse error"));
3306 #line 1724 "parse.y"
3310 if(strcmp(yyvsp[-1].id,"self")==0)
3311 push_self(yyvsp[-1].id, TRUE);
3313 g_free(yyvsp[-1].id);
3314 yyerror(_("parse error"));
3320 #line 1735 "parse.y"
3324 if(strcmp(yyvsp[0].id,"self")==0)
3325 push_self(yyvsp[0].id, TRUE);
3327 g_free(yyvsp[0].id);
3328 yyerror(_("parse error"));
3334 #line 1746 "parse.y"
3337 if(strcmp(yyvsp[-2].id,"self")==0)
3338 push_self(yyvsp[-2].id, FALSE);
3340 g_free(yyvsp[-2].id);
3341 yyerror(_("parse error"));
3347 #line 1756 "parse.y"
3350 if(strcmp(yyvsp[-3].id,"self")==0)
3351 push_self(yyvsp[-3].id, TRUE);
3353 g_free(yyvsp[-3].id);
3354 yyerror(_("parse error"));
3360 #line 1766 "parse.y"
3363 if(strcmp(yyvsp[-2].id,"self")==0)
3364 push_self(yyvsp[-2].id, TRUE);
3366 g_free(yyvsp[-2].id);
3367 yyerror(_("parse error"));
3373 #line 1776 "parse.y"
3374 { has_self = FALSE; }
3377 #line 1779 "parse.y"
3381 #line 1780 "parse.y"
3385 #line 1783 "parse.y"
3389 #line 1784 "parse.y"
3393 #line 1787 "parse.y"
3395 push_funcarg(yyvsp[0].id,NULL);
3399 #line 1790 "parse.y"
3401 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3405 #line 1793 "parse.y"
3407 if(strcmp(yyvsp[-2].id,"check")!=0) {
3408 yyerror(_("parse error"));
3411 g_free(yyvsp[-2].id);
3412 push_funcarg(yyvsp[-4].id,NULL);
3416 #line 1801 "parse.y"
3418 if(strcmp(yyvsp[-2].id,"check")!=0) {
3419 yyerror(_("parse error"));
3422 g_free(yyvsp[-2].id);
3423 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3427 #line 1811 "parse.y"
3431 #line 1812 "parse.y"
3435 #line 1815 "parse.y"
3437 if(strcmp(yyvsp[0].id,"type")==0) {
3438 Node *node = node_new (CHECK_NODE,
3439 "chtype", TYPE_CHECK,
3441 checks = g_list_append(checks,node);
3442 } else if(strcmp(yyvsp[0].id,"null")==0) {
3443 Node *node = node_new (CHECK_NODE,
3444 "chtype", NULL_CHECK,
3446 checks = g_list_append(checks,node);
3448 yyerror(_("parse error"));
3451 g_free(yyvsp[0].id);
3455 #line 1832 "parse.y"
3457 Node *node = node_new (CHECK_NODE,
3459 "number:steal", yyvsp[0].id,
3461 checks = g_list_append(checks,node);
3465 #line 1839 "parse.y"
3467 Node *node = node_new (CHECK_NODE,
3469 "number:steal", yyvsp[0].id,
3471 checks = g_list_append(checks,node);
3475 #line 1846 "parse.y"
3477 Node *node = node_new (CHECK_NODE,
3479 "number:steal", yyvsp[0].id,
3481 checks = g_list_append(checks,node);
3485 #line 1853 "parse.y"
3487 Node *node = node_new (CHECK_NODE,
3489 "number:steal", yyvsp[0].id,
3491 checks = g_list_append(checks,node);
3495 #line 1860 "parse.y"
3497 Node *node = node_new (CHECK_NODE,
3499 "number:steal", yyvsp[0].id,
3501 checks = g_list_append(checks,node);
3505 #line 1867 "parse.y"
3507 Node *node = node_new (CHECK_NODE,
3509 "number:steal", yyvsp[0].id,
3511 checks = g_list_append(checks,node);
3515 #line 1876 "parse.y"
3517 Node *node = node_new (ENUMDEF_NODE,
3518 "etype:steal", yyvsp[-1].id,
3519 "prefix:steal", yyvsp[-5].id,
3520 "values:steal", enum_vals,
3523 nodes = g_list_append (nodes, node);
3527 #line 1885 "parse.y"
3529 Node *node = node_new (ENUMDEF_NODE,
3530 "etype:steal", yyvsp[-1].id,
3531 "prefix:steal", yyvsp[-6].id,
3532 "values:steal", enum_vals,
3535 nodes = g_list_append (nodes, node);
3539 #line 1896 "parse.y"
3543 #line 1897 "parse.y"
3547 #line 1900 "parse.y"
3550 char *num = yyvsp[0].id;
3552 /* A float value, that's a bad enum */
3553 if (num[0] >= '0' &&
3555 strchr (num, '.') != NULL) {
3556 g_free (yyvsp[-2].id);
3558 yyerror(_("parse error (enumerator value not integer constant)"));
3562 node = node_new (ENUMVALUE_NODE,
3563 "name:steal", yyvsp[-2].id,
3566 enum_vals = g_list_append (enum_vals, node);
3570 #line 1920 "parse.y"
3574 node = node_new (ENUMVALUE_NODE,
3575 "name:steal", yyvsp[0].id,
3577 enum_vals = g_list_append (enum_vals, node);
3581 #line 1930 "parse.y"
3583 Node *node = node_new (FLAGS_NODE,
3584 "ftype:steal", yyvsp[-1].id,
3585 "prefix:steal", yyvsp[-5].id,
3586 "values:steal", flag_vals,
3589 nodes = g_list_append (nodes, node);
3593 #line 1939 "parse.y"
3595 Node *node = node_new (FLAGS_NODE,
3596 "ftype:steal", yyvsp[-1].id,
3597 "prefix:steal", yyvsp[-6].id,
3598 "values:steal", flag_vals,
3601 nodes = g_list_append (nodes, node);
3605 #line 1950 "parse.y"
3607 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3611 #line 1953 "parse.y"
3613 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3617 #line 1958 "parse.y"
3619 Node *node = node_new (ERROR_NODE,
3620 "etype:steal", yyvsp[-1].id,
3621 "prefix:steal", yyvsp[-5].id,
3622 "values:steal", error_vals,
3625 nodes = g_list_append (nodes, node);
3629 #line 1967 "parse.y"
3631 Node *node = node_new (ERROR_NODE,
3632 "etype:steal", yyvsp[-1].id,
3633 "prefix:steal", yyvsp[-6].id,
3634 "values:steal", error_vals,
3637 nodes = g_list_append (nodes, node);
3641 #line 1978 "parse.y"
3643 error_vals = g_list_append (error_vals, yyvsp[0].id);
3647 #line 1981 "parse.y"
3649 error_vals = g_list_append (error_vals, yyvsp[0].id);
3653 #line 1987 "parse.y"
3654 { yyval.id = yyvsp[0].id; }
3657 #line 1988 "parse.y"
3659 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3660 g_free(yyvsp[0].id);
3664 #line 1992 "parse.y"
3665 { yyval.id = yyvsp[0].id; }
3668 #line 1993 "parse.y"
3669 { yyval.id = yyvsp[0].id; }
3673 #line 705 "/usr/share/bison/bison.simple"
3685 short *yyssp1 = yyss - 1;
3686 YYFPRINTF (stderr, "state stack now");
3687 while (yyssp1 != yyssp)
3688 YYFPRINTF (stderr, " %d", *++yyssp1);
3689 YYFPRINTF (stderr, "\n");
3698 /* Now `shift' the result of the reduction. Determine what state
3699 that goes to, based on the state we popped back to and the rule
3700 number reduced by. */
3704 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3705 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3706 yystate = yytable[yystate];
3708 yystate = yydefgoto[yyn - YYNTBASE];
3713 /*------------------------------------.
3714 | yyerrlab -- here on detecting error |
3715 `------------------------------------*/
3717 /* If not already recovering from an error, report this error. */
3722 #ifdef YYERROR_VERBOSE
3723 yyn = yypact[yystate];
3725 if (yyn > YYFLAG && yyn < YYLAST)
3727 YYSIZE_T yysize = 0;
3732 /* Start YYX at -YYN if negative to avoid negative indexes in
3734 for (yyx = yyn < 0 ? -yyn : 0;
3735 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
3736 if (yycheck[yyx + yyn] == yyx)
3737 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
3738 yysize += yystrlen ("parse error, unexpected ") + 1;
3739 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
3740 yymsg = (char *) YYSTACK_ALLOC (yysize);
3743 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
3744 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
3749 for (yyx = yyn < 0 ? -yyn : 0;
3750 yyx < (int) (sizeof (yytname) / sizeof (char *));
3752 if (yycheck[yyx + yyn] == yyx)
3754 const char *yyq = ! yycount ? ", expecting " : " or ";
3755 yyp = yystpcpy (yyp, yyq);
3756 yyp = yystpcpy (yyp, yytname[yyx]);
3761 YYSTACK_FREE (yymsg);
3764 yyerror ("parse error; also virtual memory exhausted");
3767 #endif /* defined (YYERROR_VERBOSE) */
3768 yyerror ("parse error");
3773 /*--------------------------------------------------.
3774 | yyerrlab1 -- error raised explicitly by an action |
3775 `--------------------------------------------------*/
3777 if (yyerrstatus == 3)
3779 /* If just tried and failed to reuse lookahead token after an
3780 error, discard it. */
3782 /* return failure if at end of input */
3783 if (yychar == YYEOF)
3785 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
3786 yychar, yytname[yychar1]));
3790 /* Else will try to reuse lookahead token after shifting the error
3793 yyerrstatus = 3; /* Each real token shifted decrements this */
3798 /*-------------------------------------------------------------------.
3799 | yyerrdefault -- current state does not do anything special for the |
3801 `-------------------------------------------------------------------*/
3804 /* This is wrong; only states that explicitly want error tokens
3805 should shift them. */
3807 /* If its default is to accept any token, ok. Otherwise pop it. */
3808 yyn = yydefact[yystate];
3814 /*---------------------------------------------------------------.
3815 | yyerrpop -- pop the current state because it cannot handle the |
3817 `---------------------------------------------------------------*/
3830 short *yyssp1 = yyss - 1;
3831 YYFPRINTF (stderr, "Error: state stack now");
3832 while (yyssp1 != yyssp)
3833 YYFPRINTF (stderr, " %d", *++yyssp1);
3834 YYFPRINTF (stderr, "\n");
3842 yyn = yypact[yystate];
3847 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3864 YYDPRINTF ((stderr, "Shifting error token, "));
3875 /*-------------------------------------.
3876 | yyacceptlab -- YYACCEPT comes here. |
3877 `-------------------------------------*/
3882 /*-----------------------------------.
3883 | yyabortlab -- YYABORT comes here. |
3884 `-----------------------------------*/
3889 /*---------------------------------------------.
3890 | yyoverflowab -- parser overflow comes here. |
3891 `---------------------------------------------*/
3893 yyerror ("parser stack overflow");
3900 YYSTACK_FREE (yyss);
3904 #line 1996 "parse.y"