2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
27 #define SINGLE_CHAR 277
48 #define DEFAULT_VALUE 298
51 #define FLAGS_TYPE 301
53 #define PARAM_TYPE 303
54 #define BOXED_TYPE 304
55 #define OBJECT_TYPE 305
66 #include "treefuncs.h"
74 static GList *class_nodes = NULL;
77 static char *chunk_size = NULL;
78 static char *bonobo_x_class = NULL;
79 static GList *typestack = NULL;
80 static GList *funcargs = NULL;
81 static GList *checks = NULL;
82 static int has_self = FALSE;
83 static int vararg = FALSE;
84 static Method *last_added_method = NULL;
86 /* destructor and initializer for variables */
87 static gboolean destructor_unref = FALSE;
88 static char *destructor = NULL;
89 static int destructor_line = 0;
90 static gboolean destructor_simple = TRUE;
91 static char *initializer = NULL;
92 static int initializer_line = 0;
94 static char *onerror = NULL;
95 static char *defreturn = NULL;
97 static GList *gtktypes = NULL;
99 static Property *property = NULL;
101 /* this can be a global as we will only do one function at a time
103 static int the_scope = NO_SCOPE;
105 void free(void *ptr);
108 extern int ccode_line;
119 if(strcmp(yytext,"\n")==0) {
120 out=g_strconcat("Error: ",str," before newline",NULL);
121 } else if(yytext[0]=='\0') {
122 out=g_strconcat("Error: ", str, " at end of input", NULL);
124 char *tmp = g_strdup(yytext);
125 while((p=strchr(tmp, '\n')))
128 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
132 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
141 Type *type = typestack->data;
142 typestack = g_list_remove(typestack,typestack->data);
147 push_variable (char *name, int scope, int line_no, char *postfix)
150 Type *type = pop_type ();
152 type->postfix = postfix;
154 var = node_new (VARIABLE_NODE,
159 "destructor_unref", destructor_unref,
160 "destructor:steal", destructor,
161 "destructor_line", destructor_line,
162 "destructor_simple", destructor_simple,
163 "initializer:steal", initializer,
164 "initializer_line", initializer_line,
166 class_nodes = g_list_append(class_nodes, var);
170 push_function (int scope, int method, char *oid, char *id,
171 GString *cbuf, int line_no, int ccode_line,
172 gboolean vararg, GList *flags)
178 g_assert(scope != CLASS_SCOPE);
180 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
181 type = (Type *)node_new (TYPE_NODE,
188 /* a complicated and ugly test to figure out if we have
189 the wrong number of types for a signal */
190 if((method == SIGNAL_FIRST_METHOD ||
191 method == SIGNAL_LAST_METHOD) &&
192 g_list_length(gtktypes) != g_list_length(funcargs) &&
193 !(g_list_length(funcargs) == 1 &&
194 g_list_length(gtktypes) == 2 &&
195 strcmp(gtktypes->next->data, "NONE")==0)) {
196 error_print(GOB_WARN, line_no,
197 _("The number of GTK arguments and "
198 "function arguments for a signal "
199 "don't seem to match"));
201 if(g_list_length(gtktypes) > 2) {
203 for(li = gtktypes->next; li; li = li->next) {
204 if(strcmp(li->data, "NONE")==0) {
205 error_print(GOB_ERROR, line_no,
206 _("NONE can only appear in an "
207 "argument list by itself"));
213 c_cbuf = p = cbuf->str;
214 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
221 node = node_new (METHOD_NODE,
226 "gtktypes:steal", gtktypes,
227 "flags:steal", flags,
229 "args:steal", funcargs,
230 "onerror:steal", onerror,
231 "defreturn:steal", defreturn,
232 "cbuf:steal", c_cbuf,
234 "ccode_line", ccode_line,
236 "unique_id", method_unique_id++,
239 last_added_method = (Method *)node;
243 /*only free segment if we haven't passed it
252 class_nodes = g_list_append(class_nodes, node);
256 free_all_global_state(void)
266 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
267 g_list_free(gtktypes);
270 node_list_free (funcargs);
275 push_funcarg(char *name, char *postfix)
278 Type *type = pop_type();
280 type->postfix = postfix;
282 node = node_new (FUNCARG_NODE,
285 "checks:steal", checks,
289 funcargs = g_list_append(funcargs, node);
293 push_init_arg(char *name, int is_class)
300 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
302 tn = g_strdup(((Class *)class)->otype);
304 type = node_new (TYPE_NODE,
308 node = node_new (FUNCARG_NODE,
309 "atype:steal", (Type *)type,
312 funcargs = g_list_prepend(funcargs, node);
316 push_self(char *id, gboolean constant)
321 type = node_new (TYPE_NODE,
322 "name", ((Class *)class)->otype,
323 "pointer", constant ? "const *" : "*",
325 ch = g_list_append (ch, node_new (CHECK_NODE,
326 "chtype", NULL_CHECK,
328 ch = g_list_append (ch, node_new (CHECK_NODE,
329 "chtype", TYPE_CHECK,
331 node = node_new (FUNCARG_NODE,
332 "atype:steal", (Type *)type,
336 funcargs = g_list_prepend(funcargs, node);
340 find_var_or_die(const char *id, int line)
344 for(li = class_nodes; li != NULL; li = li->next) {
346 Node *node = li->data;
347 if(node->type != VARIABLE_NODE)
350 if(strcmp(var->id, id)==0)
354 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
356 g_assert_not_reached();
361 set_return_value(char *type, char *val)
363 if(strcmp(type, "onerror")==0) {
369 } else if(strcmp(type, "defreturn")==0) {
380 export_accessors (const char *var_name,
392 the_type = (Type *)node_copy ((Node *)type);
394 the_type = get_tree_type (gtktype, TRUE);
396 if (the_type == NULL) {
397 error_print (GOB_ERROR, line_no,
398 _("Cannot determine type of property or argument"));
403 char *get_id = g_strdup_printf ("get_%s", var_name);
404 GString *get_cbuf = g_string_new (NULL);
405 Node *node1 = node_new (TYPE_NODE,
406 "name", the_type->name,
407 "pointer", the_type->pointer,
408 "postfix", the_type->postfix,
410 Node *node3 = node_new (TYPE_NODE,
411 "name", class->class.otype,
415 g_string_sprintf (get_cbuf,
417 "g_object_get (G_OBJECT (self), \"%s\", "
421 the_type->pointer ? the_type->pointer : "",
424 typestack = g_list_prepend (typestack, node1);
425 typestack = g_list_prepend (typestack, node3);
427 push_funcarg ("self", FALSE);
429 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
430 get_id, get_cbuf, get_lineno,
431 lineno, FALSE, NULL);
435 char *set_id = g_strdup_printf ("set_%s", var_name);
436 GString *set_cbuf = g_string_new (NULL);
437 Node *node1 = node_new (TYPE_NODE,
438 "name", the_type->name,
439 "pointer", the_type->pointer,
440 "postfix", the_type->postfix,
442 Node *node2 = node_new (TYPE_NODE,
445 Node *node3 = node_new (TYPE_NODE,
446 "name", class->class.otype,
450 g_string_sprintf (set_cbuf,
451 "\tg_object_set (G_OBJECT (self), "
452 "\"%s\", val, NULL);\n",
455 typestack = g_list_prepend (typestack, node2);
456 typestack = g_list_prepend (typestack, node1);
457 typestack = g_list_prepend (typestack, node3);
459 push_funcarg ("self", FALSE);
460 push_funcarg ("val", FALSE);
462 typestack = g_list_prepend (typestack, node2);
463 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
464 set_id, set_cbuf, set_lineno,
465 lineno, FALSE, NULL);
468 node_free ((Node *)the_type);
472 property_link_and_export (Node *node)
474 Property *prop = (Property *)node;
478 char *get = NULL, *set = NULL;
481 if (prop->set != NULL ||
483 error_print (GOB_ERROR, prop->line_no,
484 _("Property linking requested, but "
485 "getters and setters exist"));
488 var = find_var_or_die (prop->name, prop->line_no);
489 if(var->scope == PRIVATE_SCOPE) {
490 root = "self->_priv";
491 } else if (var->scope == CLASS_SCOPE) {
492 root = "SELF_GET_CLASS(self)";
494 error_print (GOB_ERROR, prop->line_no,
495 _("Self aliases needed when autolinking to a classwide member"));
500 if (strcmp (prop->gtktype, "STRING") == 0) {
501 set = g_strdup_printf("g_free (%s->%s); "
502 "%s->%s = g_value_dup_string (VAL);",
505 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
507 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
508 set = g_strdup_printf("{ GtkObject *___old = (GtkObject *)%s->%s; "
509 "GtkObject *___new = (GtkObject *)gtk_value_get_object (VAL); "
510 "if (___new != NULL) { "
511 "gtk_object_ref (GTK_OBJECT (___new)); "
512 "%s->%s = GTK_OBJECT (___new); "
516 "if (___old != NULL) { "
517 "gtk_object_unref (GTK_OBJECT (___old)); "
523 get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
525 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
526 if (prop->extra_gtktype == NULL) {
527 error_print (GOB_ERROR, prop->line_no,
528 _("Property linking requested for BOXED, but "
529 "boxed_type not set"));
531 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
532 "gpointer ___new = (gpointer)gtk_value_get_boxed (VAL); "
533 "if (___new != ___old) { "
534 "if (___old != NULL) g_boxed_free (%s, ___old); "
535 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
536 "else %s->%s = NULL;"
544 get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
549 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
550 g_strdown (set_func);
551 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
552 g_strdown (get_func);
554 set = g_strdup_printf("%s->%s = %s (VAL);",
557 get = g_strdup_printf("%s (VAL, %s->%s);",
567 "get_line", prop->line_no,
569 "set_line", prop->line_no,
574 export_accessors (prop->name,
575 prop->get != NULL, prop->get_line,
576 prop->set != NULL, prop->get_line,
587 if (strcmp (s, "BOOL") == 0) {
588 error_print (GOB_WARN, line_no,
589 _("BOOL type is deprecated, please use BOOLEAN"));
591 return g_strdup ("BOOLEAN");
598 ensure_property (void)
600 if (property == NULL)
601 property = (Property *)node_new (PROPERTY_NODE, NULL);
628 #define YYFLAG -32768
631 #define YYTRANSLATE(x) ((unsigned)(x) <= 305 ? yytranslate[x] : 110)
633 static const char yytranslate[] = { 0,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 63, 2, 2, 2, 2, 2, 2, 54,
638 55, 60, 2, 58, 64, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 56, 62,
640 57, 61, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 52, 59, 53, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
660 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
661 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
662 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
663 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
668 static const short yyprhs[] = { 0,
669 0, 4, 7, 10, 12, 14, 16, 18, 20, 22,
670 24, 27, 29, 34, 38, 44, 45, 51, 57, 60,
671 62, 64, 67, 69, 71, 73, 75, 77, 79, 81,
672 83, 86, 90, 93, 97, 100, 103, 105, 107, 108,
673 114, 121, 134, 144, 151, 155, 156, 168, 177, 183,
674 187, 188, 192, 194, 196, 201, 203, 205, 209, 213,
675 217, 221, 225, 229, 233, 237, 241, 245, 249, 253,
676 255, 261, 263, 267, 268, 272, 274, 277, 279, 281,
677 283, 286, 289, 292, 296, 300, 303, 306, 309, 311,
678 314, 316, 319, 321, 323, 325, 327, 329, 331, 333,
679 335, 337, 339, 341, 343, 345, 348, 351, 355, 358,
680 360, 364, 368, 371, 373, 378, 382, 384, 387, 389,
681 400, 412, 422, 432, 441, 453, 462, 468, 471, 476,
682 477, 479, 482, 484, 486, 489, 492, 496, 501, 506,
683 508, 512, 514, 518, 520, 523, 527, 534, 542, 545,
684 547, 549, 552, 555, 559, 563, 567, 571, 573, 576,
688 static const short yyrhs[] = { 67,
689 68, 67, 0, 68, 67, 0, 67, 68, 0, 68,
690 0, 24, 0, 27, 0, 25, 0, 26, 0, 28,
691 0, 29, 0, 67, 66, 0, 66, 0, 69, 52,
692 71, 53, 0, 69, 52, 53, 0, 3, 21, 4,
693 21, 70, 0, 0, 54, 19, 19, 55, 70, 0,
694 54, 19, 20, 55, 70, 0, 71, 72, 0, 72,
695 0, 100, 0, 19, 100, 0, 77, 0, 78, 0,
696 80, 0, 56, 0, 31, 0, 32, 0, 33, 0,
697 34, 0, 19, 19, 0, 19, 52, 24, 0, 57,
698 109, 0, 57, 52, 24, 0, 74, 75, 0, 75,
699 74, 0, 75, 0, 74, 0, 0, 73, 89, 19,
700 76, 56, 0, 73, 89, 19, 22, 76, 56, 0,
701 36, 87, 86, 19, 79, 19, 52, 24, 19, 52,
702 24, 56, 0, 36, 87, 86, 19, 79, 19, 52,
703 24, 56, 0, 36, 87, 86, 19, 79, 19, 0,
704 54, 19, 55, 0, 0, 35, 19, 19, 81, 19,
705 52, 24, 19, 52, 24, 56, 0, 35, 19, 19,
706 81, 19, 52, 24, 56, 0, 35, 19, 19, 81,
707 56, 0, 54, 82, 55, 0, 0, 82, 58, 85,
708 0, 85, 0, 30, 0, 19, 54, 30, 55, 0,
709 109, 0, 83, 0, 40, 57, 83, 0, 41, 57,
710 83, 0, 42, 57, 109, 0, 43, 57, 109, 0,
711 44, 57, 84, 0, 45, 57, 88, 0, 46, 57,
712 89, 0, 47, 57, 19, 0, 48, 57, 19, 0,
713 49, 57, 19, 0, 50, 57, 19, 0, 51, 57,
714 19, 0, 19, 0, 19, 54, 19, 89, 55, 0,
715 19, 0, 54, 88, 55, 0, 0, 19, 59, 88,
716 0, 19, 0, 90, 94, 0, 90, 0, 91, 0,
717 19, 0, 5, 19, 0, 19, 5, 0, 93, 19,
718 0, 5, 93, 19, 0, 93, 19, 5, 0, 92,
719 91, 0, 21, 91, 0, 5, 91, 0, 21, 0,
720 21, 5, 0, 92, 0, 92, 5, 0, 6, 0,
721 18, 0, 14, 0, 15, 0, 13, 0, 16, 0,
722 17, 0, 11, 0, 12, 0, 7, 0, 8, 0,
723 9, 0, 60, 0, 60, 5, 0, 60, 94, 0,
724 60, 5, 94, 0, 19, 97, 0, 97, 0, 73,
725 19, 97, 0, 19, 73, 97, 0, 73, 97, 0,
726 95, 0, 19, 54, 98, 55, 0, 98, 58, 19,
727 0, 19, 0, 52, 24, 0, 56, 0, 38, 87,
728 96, 89, 19, 54, 103, 55, 101, 99, 0, 73,
729 38, 87, 95, 89, 19, 54, 103, 55, 101, 99,
730 0, 37, 73, 89, 19, 54, 103, 55, 101, 99,
731 0, 73, 37, 89, 19, 54, 103, 55, 101, 99,
732 0, 37, 89, 19, 54, 103, 55, 101, 99, 0,
733 39, 54, 21, 55, 89, 19, 54, 103, 55, 101,
734 99, 0, 73, 89, 19, 54, 103, 55, 101, 99,
735 0, 19, 54, 19, 55, 99, 0, 19, 102, 0,
736 19, 102, 19, 102, 0, 0, 109, 0, 52, 24,
737 0, 6, 0, 19, 0, 19, 5, 0, 5, 19,
738 0, 19, 58, 104, 0, 19, 5, 58, 104, 0,
739 5, 19, 58, 104, 0, 104, 0, 105, 58, 10,
740 0, 105, 0, 105, 58, 106, 0, 106, 0, 89,
741 19, 0, 89, 19, 22, 0, 89, 19, 54, 19,
742 107, 55, 0, 89, 19, 22, 54, 19, 107, 55,
743 0, 107, 108, 0, 108, 0, 19, 0, 61, 109,
744 0, 62, 109, 0, 61, 57, 109, 0, 62, 57,
745 109, 0, 57, 57, 109, 0, 63, 57, 109, 0,
746 20, 0, 64, 20, 0, 23, 0, 19, 0
752 static const short yyrline[] = { 0,
753 591, 592, 593, 594, 597, 606, 615, 624, 633, 642,
754 653, 654, 657, 662, 669, 679, 680, 692, 706, 707,
755 710, 711, 719, 720, 721, 722, 725, 726, 727, 728,
756 731, 751, 775, 779, 787, 788, 789, 790, 791, 797,
757 800, 805, 873, 927, 1015, 1023, 1028, 1076, 1112, 1128,
758 1129, 1132, 1133, 1136, 1137, 1149, 1150, 1153, 1159, 1165,
759 1171, 1177, 1183, 1189, 1196, 1202, 1208, 1214, 1220, 1226,
760 1246, 1255, 1261, 1262, 1265, 1268, 1274, 1281, 1290, 1293,
761 1296, 1300, 1304, 1308, 1313, 1321, 1325, 1330, 1334, 1337,
762 1341, 1344, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356,
763 1357, 1360, 1361, 1362, 1365, 1366, 1367, 1371, 1378, 1390,
764 1396, 1408, 1420, 1423, 1429, 1434, 1437, 1442, 1443, 1447,
765 1463, 1479, 1495, 1511, 1522, 1528, 1538, 1561, 1572, 1591,
766 1597, 1598, 1604, 1605, 1616, 1627, 1638, 1648, 1658, 1668,
767 1671, 1672, 1675, 1676, 1679, 1682, 1685, 1693, 1703, 1704,
768 1707, 1724, 1731, 1738, 1745, 1752, 1759, 1768, 1769, 1773,
774 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
776 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
777 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
778 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","TOKEN","NUMBER","TYPETOKEN","ARRAY_DIM",
779 "SINGLE_CHAR","CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","STRING","PUBLIC",
780 "PRIVATE","PROTECTED","CLASSWIDE","PROPERTY","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE",
781 "NICK","BLURB","MAXIMUM","MINIMUM","DEFAULT_VALUE","FLAGS","TYPE","FLAGS_TYPE",
782 "ENUM_TYPE","PARAM_TYPE","BOXED_TYPE","OBJECT_TYPE","'{'","'}'","'('","')'",
783 "';'","'='","','","'|'","'*'","'>'","'<'","'!'","'-'","prog","ccode","ccodes",
784 "class","classdec","classflags","classcode","thing","scope","destructor","initializer",
785 "varoptions","variable","argument","export","property","param_spec","param_spec_list",
786 "string","anyval","param_spec_value","argtype","flags","flaglist","type","specifier_list",
787 "spec_list","specifier","strunionenum","pointer","simplesigtype","fullsigtype",
788 "sigtype","tokenlist","codenocode","method","returnvals","retcode","funcargs",
789 "arglist","arglist1","arg","checklist","check","numtok", NULL
793 static const short yyr1[] = { 0,
794 65, 65, 65, 65, 66, 66, 66, 66, 66, 66,
795 67, 67, 68, 68, 69, 70, 70, 70, 71, 71,
796 72, 72, 72, 72, 72, 72, 73, 73, 73, 73,
797 74, 74, 75, 75, 76, 76, 76, 76, 76, 77,
798 77, 78, 78, 78, 79, 79, 80, 80, 80, 81,
799 81, 82, 82, 83, 83, 84, 84, 85, 85, 85,
800 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
801 86, 86, 87, 87, 88, 88, 89, 89, 90, 90,
802 90, 90, 90, 90, 90, 91, 91, 91, 91, 91,
803 91, 91, 92, 92, 92, 92, 92, 92, 92, 92,
804 92, 93, 93, 93, 94, 94, 94, 94, 95, 95,
805 96, 96, 96, 96, 97, 98, 98, 99, 99, 100,
806 100, 100, 100, 100, 100, 100, 100, 101, 101, 101,
807 102, 102, 103, 103, 103, 103, 103, 103, 103, 103,
808 104, 104, 105, 105, 106, 106, 106, 106, 107, 107,
809 108, 108, 108, 108, 108, 108, 108, 109, 109, 109,
813 static const short yyr2[] = { 0,
814 3, 2, 2, 1, 1, 1, 1, 1, 1, 1,
815 2, 1, 4, 3, 5, 0, 5, 5, 2, 1,
816 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
817 2, 3, 2, 3, 2, 2, 1, 1, 0, 5,
818 6, 12, 9, 6, 3, 0, 11, 8, 5, 3,
819 0, 3, 1, 1, 4, 1, 1, 3, 3, 3,
820 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
821 5, 1, 3, 0, 3, 1, 2, 1, 1, 1,
822 2, 2, 2, 3, 3, 2, 2, 2, 1, 2,
823 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
824 1, 1, 1, 1, 1, 2, 2, 3, 2, 1,
825 3, 3, 2, 1, 4, 3, 1, 2, 1, 10,
826 11, 9, 9, 8, 11, 8, 5, 2, 4, 0,
827 1, 2, 1, 1, 2, 2, 3, 4, 4, 1,
828 3, 1, 3, 1, 2, 3, 6, 7, 2, 1,
829 1, 2, 2, 3, 3, 3, 3, 1, 2, 1,
833 static const short yydefact[] = { 0,
834 0, 5, 7, 8, 6, 9, 10, 12, 0, 4,
835 0, 0, 11, 3, 2, 0, 0, 1, 0, 27,
836 28, 29, 30, 0, 74, 0, 74, 0, 14, 26,
837 0, 20, 0, 23, 24, 25, 21, 16, 0, 0,
838 0, 22, 0, 0, 0, 0, 93, 102, 103, 104,
839 100, 101, 97, 95, 96, 98, 99, 94, 80, 89,
840 0, 0, 78, 79, 91, 0, 0, 0, 13, 19,
841 0, 74, 0, 0, 15, 0, 0, 51, 76, 0,
842 72, 0, 0, 81, 88, 0, 82, 90, 87, 0,
843 0, 105, 77, 92, 86, 83, 0, 0, 114, 0,
844 110, 0, 0, 0, 39, 0, 0, 0, 0, 0,
845 0, 73, 0, 46, 84, 0, 0, 106, 107, 85,
846 0, 0, 0, 109, 0, 113, 0, 0, 0, 0,
847 0, 0, 39, 0, 0, 38, 37, 0, 0, 0,
848 0, 119, 127, 70, 0, 0, 0, 0, 0, 0,
849 0, 0, 0, 0, 0, 0, 0, 53, 0, 49,
850 75, 0, 0, 0, 0, 0, 93, 80, 0, 0,
851 140, 142, 144, 108, 117, 0, 112, 111, 0, 0,
852 0, 0, 31, 0, 0, 0, 161, 158, 160, 0,
853 0, 33, 35, 36, 40, 16, 16, 118, 0, 0,
854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
855 50, 0, 0, 0, 0, 44, 0, 81, 82, 0,
856 145, 130, 0, 115, 0, 0, 0, 0, 0, 32,
857 41, 130, 34, 159, 17, 18, 0, 54, 58, 59,
858 60, 61, 161, 57, 62, 56, 63, 64, 65, 66,
859 67, 68, 69, 52, 0, 71, 45, 0, 130, 0,
860 0, 137, 146, 0, 0, 0, 141, 143, 116, 0,
861 0, 130, 0, 0, 0, 0, 48, 0, 0, 139,
862 138, 0, 0, 0, 128, 131, 124, 130, 0, 0,
863 0, 126, 0, 0, 0, 43, 122, 0, 151, 0,
864 0, 0, 0, 0, 150, 132, 0, 0, 130, 123,
865 130, 55, 0, 0, 0, 0, 0, 152, 0, 153,
866 0, 147, 149, 129, 120, 0, 0, 47, 0, 148,
867 156, 154, 155, 157, 125, 121, 42, 0, 0, 0
870 static const short yydefgoto[] = { 338,
871 8, 9, 10, 11, 75, 31, 32, 33, 136, 137,
872 138, 34, 35, 164, 36, 110, 157, 239, 245, 158,
873 82, 45, 80, 169, 63, 64, 65, 66, 93, 99,
874 100, 101, 176, 143, 37, 266, 285, 170, 171, 172,
878 static const short yypact[] = { 144,
879 -7,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 144, 407,
880 -21, 40,-32768, 407, 407, 121, 71, 407, 166,-32768,
881 -32768,-32768,-32768, 78, 45, 266, 45, 54,-32768,-32768,
882 156,-32768, 216,-32768,-32768,-32768,-32768, 92, 94, 97,
883 216,-32768, 157, 159, 160, 313,-32768,-32768,-32768,-32768,
884 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 158, 381,
885 330, 164, 136,-32768, 395, 183, 257, 185,-32768,-32768,
886 330, 45, 200, 207,-32768, 184, 221, 187, 188, 189,
887 192, 223, 409,-32768,-32768, 229,-32768, 409,-32768, 230,
888 197, 1,-32768, 409,-32768, 247, 182, 236,-32768, 330,
889 -32768, 201, 238, 239, 68, 10, 61, 232, 219, 22,
890 159,-32768, 273, 240,-32768, 241, 347, 136,-32768,-32768,
891 242, 274, 297,-32768, -4,-32768, 304, 330, 279, -4,
892 330, 60, -9, 347, 0, 283, 331, 301, 312, 319,
893 360,-32768,-32768,-32768, 332, 333, 334, 346, 348, 361,
894 362, 371, 372, 380, 382, 383, 106,-32768, 336,-32768,
895 -32768, 330, 385, 398, 347, 364, 386, 7, 419, 387,
896 -32768, 388,-32768,-32768,-32768, 107,-32768,-32768, 389, 425,
897 347, 426,-32768, 423, 392, 394,-32768,-32768,-32768, 427,
898 430,-32768,-32768,-32768,-32768, 92, 92,-32768, 13, 13,
899 37, 37, 5, 159, 330, 433, 434, 435, 436, 437,
900 -32768, 219, 438, 402, 403, 408, 404, 152, 153, 330,
901 66, 442, 296,-32768, 444, 347, 410, 411, 413,-32768,
902 -32768, 442,-32768,-32768,-32768,-32768, 414,-32768,-32768,-32768,
903 -32768,-32768, 414,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
904 -32768,-32768,-32768,-32768, 39,-32768,-32768, 441, 442, 330,
905 330,-32768, 415, 451, 19, 61,-32768,-32768,-32768, 416,
906 347, 442, 347, 61, 443, 420,-32768, 53, 61,-32768,
907 -32768, 455, 88, 452, 456,-32768,-32768, 442, 422, 61,
908 424,-32768, 428, 454, 429,-32768,-32768, 88,-32768, 431,
909 57, 62, 432, 72,-32768,-32768, 19, 61, 442,-32768,
910 442,-32768, 439, 458, 81, 37, 37,-32768, 37,-32768,
911 37,-32768,-32768,-32768,-32768, 61, 61,-32768, 440,-32768,
912 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 480, 484,-32768
915 static const short yypgoto[] = {-32768,
916 87, 118, 476,-32768, -66,-32768, 459, -8, 349, 351,
917 358,-32768,-32768,-32768,-32768,-32768,-32768, -85,-32768, 280,
918 -32768, -18, -106, -25,-32768, -43,-32768, -42, -65, 390,
919 -32768, 120,-32768, -253, 474, -225, 190, -132, -150,-32768,
927 static const short yytable[] = { 192,
928 62, 186, 85, 86, 161, 118, 274, 73, 67, 132,
929 41, 219, 287, 12, 121, 77, 89, 61, 187, 188,
930 292, 95, 189, 243, 188, 297, 119, 189, 139, 140,
931 16, 237, 217, 279, 238, 90, 310, 187, 188, 85,
932 159, 189, 238, 17, 85, 103, 290, 135, 228, 122,
933 85, 190, 174, 104, 325, 187, 188, 276, 98, 189,
934 92, -134, 308, 191, 220, 241, 242, 246, 191, 262,
935 284, 295, 335, 336, 127, 187, 188, 160, 183, 189,
936 187, 188, 191, 326, 189, 327, 132, 263, 123, 133,
937 299, 38, 323, 270, 277, 13, 43, 247, 44, 299,
938 191, 13, 180, 323, 13, 182, 299, 68, 296, 280,
939 281, 184, 141, 317, 240, 76, 142, 244, 319, 264,
940 191, 134, 85, 86, 135, 191, 322, 15, 300, 235,
941 236, 18, 301, 302, 303, 330, 214, 300, 289, 19,
942 291, 301, 302, 303, 300, 74, 1, 40, 301, 302,
943 303, 20, 21, 22, 23, 24, 25, 26, 27, 28,
944 211, 224, 87, 212, 225, 318, 320, 2, 3, 4,
945 5, 6, 7, 29, 19, 78, 30, 79, 81, 248,
946 331, 332, 91, 333, 39, 334, 20, 21, 22, 23,
947 24, 25, 26, 27, 28, 92, 20, 21, 22, 23,
948 121, 96, 26, 27, 28, 102, -136, -135, 69, 260,
949 261, 30, 20, 21, 22, 23, 124, 126, 105, 40,
950 46, 47, 48, 49, 50, 106, 51, 52, 53, 54,
951 55, 56, 57, 58, 59, 122, 60, 144, 107, 108,
952 109, 114, 177, 112, 178, 113, 111, 115, 116, 124,
953 117, 120, 71, 72, 125, 128, 129, 130, 145, 146,
954 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
955 46, 47, 48, 49, 50, 97, 51, 52, 53, 54,
956 55, 56, 57, 58, 59, 134, 60, 20, 21, 22,
957 23, 162, 175, 163, 165, 122, 20, 21, 22, 23,
958 46, 47, 48, 49, 50, 267, 51, 52, 53, 54,
959 55, 56, 57, 58, 59, 121, 60, 83, 47, 48,
960 49, 50, 179, 51, 52, 53, 54, 55, 56, 57,
961 58, 84, 181, 60, 46, 47, 48, 49, 50, 135,
962 51, 52, 53, 54, 55, 56, 57, 58, 59, 132,
963 60, 166, 167, 48, 49, 50, 195, 51, 52, 53,
964 54, 55, 56, 57, 58, 168, 196, 60, 83, 47,
965 48, 49, 50, 197, 51, 52, 53, 54, 55, 56,
966 57, 58, 218, 198, 60, 88, 47, 213, 199, 200,
967 201, 51, 52, 53, 54, 55, 56, 57, 58, 94,
968 47, 60, 202, 215, 203, 51, 52, 53, 54, 55,
969 56, 57, 58, 83, 47, 60, 216, 204, 205, 51,
970 52, 53, 54, 55, 56, 57, 58, 206, 207, 60,
971 2, 3, 4, 5, 6, 7, 208, 221, 209, 210,
972 -133, 222, 226, 227, 229, 223, 230, 231, 232, 234,
973 233, 249, 250, 251, 252, 253, 256, 257, 259, 258,
974 265, 255, 269, 271, 278, 272, 273, 275, 282, 283,
975 288, 294, 293, 298, 307, 306, 309, 313, 311, 339,
976 314, 329, 312, 340, 14, 194, 193, 316, 321, 70,
977 185, 254, 42, 131, 328, 337, 324, 268, 0, 315
980 static const short yycheck[] = { 135,
981 26, 134, 46, 46, 111, 5, 232, 33, 27, 19,
982 19, 5, 266, 21, 19, 41, 60, 26, 19, 20,
983 274, 65, 23, 19, 20, 279, 92, 23, 19, 20,
984 52, 19, 165, 259, 30, 61, 290, 19, 20, 83,
985 19, 23, 30, 4, 88, 71, 272, 57, 181, 54,
986 94, 52, 118, 72, 308, 19, 20, 19, 67, 23,
987 60, 55, 288, 64, 58, 201, 202, 203, 64, 220,
988 52, 19, 326, 327, 100, 19, 20, 56, 19, 23,
989 19, 20, 64, 309, 23, 311, 19, 22, 97, 22,
990 19, 21, 304, 226, 56, 9, 19, 204, 54, 19,
991 64, 15, 128, 315, 18, 131, 19, 54, 56, 260,
992 261, 52, 52, 57, 200, 19, 56, 203, 57, 54,
993 64, 54, 166, 166, 57, 64, 55, 10, 57, 196,
994 197, 14, 61, 62, 63, 55, 162, 57, 271, 19,
995 273, 61, 62, 63, 57, 54, 3, 54, 61, 62,
996 63, 31, 32, 33, 34, 35, 36, 37, 38, 39,
997 55, 55, 5, 58, 58, 301, 302, 24, 25, 26,
998 27, 28, 29, 53, 19, 19, 56, 19, 19, 205,
999 316, 317, 19, 319, 19, 321, 31, 32, 33, 34,
1000 35, 36, 37, 38, 39, 60, 31, 32, 33, 34,
1001 19, 19, 37, 38, 39, 21, 55, 55, 53, 58,
1002 58, 56, 31, 32, 33, 34, 97, 98, 19, 54,
1003 5, 6, 7, 8, 9, 19, 11, 12, 13, 14,
1004 15, 16, 17, 18, 19, 54, 21, 19, 55, 19,
1005 54, 19, 123, 55, 125, 54, 59, 19, 19, 130,
1006 54, 5, 37, 38, 19, 55, 19, 19, 40, 41,
1007 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1008 5, 6, 7, 8, 9, 19, 11, 12, 13, 14,
1009 15, 16, 17, 18, 19, 54, 21, 31, 32, 33,
1010 34, 19, 19, 54, 54, 54, 31, 32, 33, 34,
1011 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1012 15, 16, 17, 18, 19, 19, 21, 5, 6, 7,
1013 8, 9, 19, 11, 12, 13, 14, 15, 16, 17,
1014 18, 19, 54, 21, 5, 6, 7, 8, 9, 57,
1015 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
1016 21, 5, 6, 7, 8, 9, 56, 11, 12, 13,
1017 14, 15, 16, 17, 18, 19, 55, 21, 5, 6,
1018 7, 8, 9, 55, 11, 12, 13, 14, 15, 16,
1019 17, 18, 19, 24, 21, 5, 6, 52, 57, 57,
1020 57, 11, 12, 13, 14, 15, 16, 17, 18, 5,
1021 6, 21, 57, 19, 57, 11, 12, 13, 14, 15,
1022 16, 17, 18, 5, 6, 21, 19, 57, 57, 11,
1023 12, 13, 14, 15, 16, 17, 18, 57, 57, 21,
1024 24, 25, 26, 27, 28, 29, 57, 19, 57, 57,
1025 55, 55, 54, 19, 19, 58, 24, 56, 55, 20,
1026 24, 19, 19, 19, 19, 19, 55, 55, 55, 52,
1027 19, 24, 19, 54, 24, 55, 54, 54, 54, 19,
1028 55, 52, 30, 19, 19, 24, 55, 24, 55, 0,
1029 52, 24, 55, 0, 9, 137, 136, 57, 57, 31,
1030 133, 212, 19, 104, 56, 56, 307, 223, -1, 298
1032 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1033 #line 3 "/usr/lib/bison.simple"
1034 /* This file comes from bison-1.28. */
1036 /* Skeleton output parser for bison,
1037 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
1039 This program is free software; you can redistribute it and/or modify
1040 it under the terms of the GNU General Public License as published by
1041 the Free Software Foundation; either version 2, or (at your option)
1044 This program is distributed in the hope that it will be useful,
1045 but WITHOUT ANY WARRANTY; without even the implied warranty of
1046 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1047 GNU General Public License for more details.
1049 You should have received a copy of the GNU General Public License
1050 along with this program; if not, write to the Free Software
1051 Foundation, Inc., 59 Temple Place - Suite 330,
1052 Boston, MA 02111-1307, USA. */
1054 /* As a special exception, when this file is copied by Bison into a
1055 Bison output file, you may use that output file without restriction.
1056 This special exception was added by the Free Software Foundation
1057 in version 1.24 of Bison. */
1059 /* This is the parser code that is written into each bison parser
1060 when the %semantic_parser declaration is not specified in the grammar.
1061 It was written by Richard Stallman by simplifying the hairy parser
1062 used when %semantic_parser is specified. */
1064 #ifndef YYSTACK_USE_ALLOCA
1066 #define YYSTACK_USE_ALLOCA
1067 #else /* alloca not defined */
1069 #define YYSTACK_USE_ALLOCA
1070 #define alloca __builtin_alloca
1071 #else /* not GNU C. */
1072 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
1073 #define YYSTACK_USE_ALLOCA
1075 #else /* not sparc */
1076 /* We think this test detects Watcom and Microsoft C. */
1077 /* This used to test MSDOS, but that is a bad idea
1078 since that symbol is in the user namespace. */
1079 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
1080 #if 0 /* No need for malloc.h, which pollutes the namespace;
1081 instead, just don't use alloca. */
1084 #else /* not MSDOS, or __TURBOC__ */
1086 /* I don't know what this was needed for, but it pollutes the namespace.
1087 So I turned it off. rms, 2 May 1997. */
1088 /* #include <malloc.h> */
1090 #define YYSTACK_USE_ALLOCA
1091 #else /* not MSDOS, or __TURBOC__, or _AIX */
1093 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
1094 and on HPUX 10. Eventually we can turn this on. */
1095 #define YYSTACK_USE_ALLOCA
1096 #define alloca __builtin_alloca
1099 #endif /* not _AIX */
1100 #endif /* not MSDOS, or __TURBOC__ */
1101 #endif /* not sparc */
1102 #endif /* not GNU C */
1103 #endif /* alloca not defined */
1104 #endif /* YYSTACK_USE_ALLOCA not defined */
1106 #ifdef YYSTACK_USE_ALLOCA
1107 #define YYSTACK_ALLOC alloca
1109 #define YYSTACK_ALLOC malloc
1112 /* Note: there must be only one dollar sign in this file.
1113 It is replaced by the list of actions, each action
1114 as one case of the switch. */
1116 #define yyerrok (yyerrstatus = 0)
1117 #define yyclearin (yychar = YYEMPTY)
1120 #define YYACCEPT goto yyacceptlab
1121 #define YYABORT goto yyabortlab
1122 #define YYERROR goto yyerrlab1
1123 /* Like YYERROR except do call yyerror.
1124 This remains here temporarily to ease the
1125 transition to the new meaning of YYERROR, for GCC.
1126 Once GCC version 2 has supplanted version 1, this can go. */
1127 #define YYFAIL goto yyerrlab
1128 #define YYRECOVERING() (!!yyerrstatus)
1129 #define YYBACKUP(token, value) \
1131 if (yychar == YYEMPTY && yylen == 1) \
1132 { yychar = (token), yylval = (value); \
1133 yychar1 = YYTRANSLATE (yychar); \
1138 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1142 #define YYERRCODE 256
1145 #define YYLEX yylex()
1151 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1153 #define YYLEX yylex(&yylval, &yylloc)
1155 #else /* not YYLSP_NEEDED */
1157 #define YYLEX yylex(&yylval, YYLEX_PARAM)
1159 #define YYLEX yylex(&yylval)
1161 #endif /* not YYLSP_NEEDED */
1164 /* If nonreentrant, generate the variables here */
1168 int yychar; /* the lookahead symbol */
1169 YYSTYPE yylval; /* the semantic value of the */
1170 /* lookahead symbol */
1173 YYLTYPE yylloc; /* location data for the lookahead */
1177 int yynerrs; /* number of parse errors so far */
1178 #endif /* not YYPURE */
1181 int yydebug; /* nonzero means print parse trace */
1182 /* Since this is uninitialized, it does not stop multiple parsers
1186 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1189 #define YYINITDEPTH 200
1192 /* YYMAXDEPTH is the maximum size the stacks can grow to
1193 (effective only if the built-in stack extension method is used). */
1200 #define YYMAXDEPTH 10000
1203 /* Define __yy_memcpy. Note that the size argument
1204 should be passed with type unsigned int, because that is what the non-GCC
1205 definitions require. With GCC, __builtin_memcpy takes an arg
1206 of type size_t, but it can handle unsigned int. */
1208 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1209 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1210 #else /* not GNU C or C++ */
1213 /* This is the most reliable way to avoid incompatibilities
1214 in available built-in functions on various systems. */
1216 __yy_memcpy (to, from, count)
1221 register char *f = from;
1222 register char *t = to;
1223 register int i = count;
1229 #else /* __cplusplus */
1231 /* This is the most reliable way to avoid incompatibilities
1232 in available built-in functions on various systems. */
1234 __yy_memcpy (char *to, char *from, unsigned int count)
1236 register char *t = to;
1237 register char *f = from;
1238 register int i = count;
1247 #line 217 "/usr/lib/bison.simple"
1249 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1250 into yyparse. The argument should have type void *.
1251 It should actually point to an object.
1252 Grammar actions can access the variable by casting it
1253 to the proper pointer type. */
1255 #ifdef YYPARSE_PARAM
1257 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1258 #define YYPARSE_PARAM_DECL
1259 #else /* not __cplusplus */
1260 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1261 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1262 #endif /* not __cplusplus */
1263 #else /* not YYPARSE_PARAM */
1264 #define YYPARSE_PARAM_ARG
1265 #define YYPARSE_PARAM_DECL
1266 #endif /* not YYPARSE_PARAM */
1268 /* Prevent warning if -Wstrict-prototypes. */
1270 #ifdef YYPARSE_PARAM
1271 int yyparse (void *);
1278 yyparse(YYPARSE_PARAM_ARG)
1281 register int yystate;
1283 register short *yyssp;
1284 register YYSTYPE *yyvsp;
1285 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1286 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1288 short yyssa[YYINITDEPTH]; /* the state stack */
1289 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1291 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1292 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1295 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1296 YYLTYPE *yyls = yylsa;
1299 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1301 #define YYPOPSTACK (yyvsp--, yyssp--)
1304 int yystacksize = YYINITDEPTH;
1305 int yyfree_stacks = 0;
1316 YYSTYPE yyval; /* the variable used to return */
1317 /* semantic values from the action */
1324 fprintf(stderr, "Starting parse\n");
1330 yychar = YYEMPTY; /* Cause a token to be read. */
1332 /* Initialize stack pointers.
1333 Waste one element of value and location stack
1334 so that they stay on the same level as the state stack.
1335 The wasted elements are never initialized. */
1343 /* Push a new state, which is found in yystate . */
1344 /* In all cases, when you get here, the value and location stacks
1345 have just been pushed. so pushing a state here evens the stacks. */
1350 if (yyssp >= yyss + yystacksize - 1)
1352 /* Give user a chance to reallocate the stack */
1353 /* Use copies of these so that the &'s don't force the real ones into memory. */
1354 YYSTYPE *yyvs1 = yyvs;
1355 short *yyss1 = yyss;
1357 YYLTYPE *yyls1 = yyls;
1360 /* Get the current used size of the three stacks, in elements. */
1361 int size = yyssp - yyss + 1;
1364 /* Each stack pointer address is followed by the size of
1365 the data in use in that stack, in bytes. */
1367 /* This used to be a conditional around just the two extra args,
1368 but that might be undefined if yyoverflow is a macro. */
1369 yyoverflow("parser stack overflow",
1370 &yyss1, size * sizeof (*yyssp),
1371 &yyvs1, size * sizeof (*yyvsp),
1372 &yyls1, size * sizeof (*yylsp),
1375 yyoverflow("parser stack overflow",
1376 &yyss1, size * sizeof (*yyssp),
1377 &yyvs1, size * sizeof (*yyvsp),
1381 yyss = yyss1; yyvs = yyvs1;
1385 #else /* no yyoverflow */
1386 /* Extend the stack our own way. */
1387 if (yystacksize >= YYMAXDEPTH)
1389 yyerror("parser stack overflow");
1401 if (yystacksize > YYMAXDEPTH)
1402 yystacksize = YYMAXDEPTH;
1403 #ifndef YYSTACK_USE_ALLOCA
1406 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1407 __yy_memcpy ((char *)yyss, (char *)yyss1,
1408 size * (unsigned int) sizeof (*yyssp));
1409 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1410 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1411 size * (unsigned int) sizeof (*yyvsp));
1413 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1414 __yy_memcpy ((char *)yyls, (char *)yyls1,
1415 size * (unsigned int) sizeof (*yylsp));
1417 #endif /* no yyoverflow */
1419 yyssp = yyss + size - 1;
1420 yyvsp = yyvs + size - 1;
1422 yylsp = yyls + size - 1;
1427 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1430 if (yyssp >= yyss + yystacksize - 1)
1436 fprintf(stderr, "Entering state %d\n", yystate);
1442 /* Do appropriate processing given the current state. */
1443 /* Read a lookahead token if we need one and don't already have one. */
1446 /* First try to decide what to do without reference to lookahead token. */
1448 yyn = yypact[yystate];
1452 /* Not known => get a lookahead token if don't already have one. */
1454 /* yychar is either YYEMPTY or YYEOF
1455 or a valid token in external form. */
1457 if (yychar == YYEMPTY)
1461 fprintf(stderr, "Reading a token: ");
1466 /* Convert token to internal form (in yychar1) for indexing tables with */
1468 if (yychar <= 0) /* This means end of input. */
1471 yychar = YYEOF; /* Don't call YYLEX any more */
1475 fprintf(stderr, "Now at end of input.\n");
1480 yychar1 = YYTRANSLATE(yychar);
1485 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1486 /* Give the individual parser a way to print the precise meaning
1487 of a token, for further debugging info. */
1489 YYPRINT (stderr, yychar, yylval);
1491 fprintf (stderr, ")\n");
1497 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1502 /* yyn is what to do for this token type in this state.
1503 Negative => reduce, -yyn is rule number.
1504 Positive => shift, yyn is new state.
1505 New state is final state => don't bother to shift,
1506 just return success.
1507 0, or most negative number => error. */
1522 /* Shift the lookahead token. */
1526 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1529 /* Discard the token being shifted unless it is eof. */
1530 if (yychar != YYEOF)
1538 /* count tokens shifted since error; after three, turn off error status. */
1539 if (yyerrstatus) yyerrstatus--;
1544 /* Do the default action for the current state. */
1547 yyn = yydefact[yystate];
1551 /* Do a reduction. yyn is the number of a rule to reduce with. */
1555 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1562 fprintf (stderr, "Reducing via rule %d (line %d), ",
1565 /* Print the symbols being reduced, and their result. */
1566 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1567 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1568 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1594 Node *node = node_new (CCODE_NODE,
1596 "cbuf:steal", (yyvsp[0].cbuf)->str,
1597 "line_no", ccode_line,
1599 nodes = g_list_append(nodes,node);
1600 g_string_free(yyvsp[0].cbuf,FALSE);
1606 Node *node = node_new (CCODE_NODE,
1608 "cbuf:steal", (yyvsp[0].cbuf)->str,
1609 "line_no", ccode_line,
1611 nodes = g_list_append(nodes,node);
1612 g_string_free(yyvsp[0].cbuf,FALSE);
1618 Node *node = node_new (CCODE_NODE,
1620 "cbuf:steal", (yyvsp[0].cbuf)->str,
1621 "line_no", ccode_line,
1623 nodes = g_list_append(nodes,node);
1624 g_string_free(yyvsp[0].cbuf,FALSE);
1630 Node *node = node_new (CCODE_NODE,
1632 "cbuf:steal", (yyvsp[0].cbuf)->str,
1633 "line_no", ccode_line,
1635 nodes = g_list_append(nodes,node);
1636 g_string_free(yyvsp[0].cbuf,FALSE);
1642 Node *node = node_new (CCODE_NODE,
1644 "cbuf:steal", (yyvsp[0].cbuf)->str,
1645 "line_no", ccode_line,
1647 nodes = g_list_append(nodes,node);
1648 g_string_free(yyvsp[0].cbuf,FALSE);
1654 Node *node = node_new (CCODE_NODE,
1656 "cbuf:steal", (yyvsp[0].cbuf)->str,
1657 "line_no", ccode_line,
1659 nodes = g_list_append(nodes,node);
1660 g_string_free(yyvsp[0].cbuf,FALSE);
1674 ((Class *)class)->nodes = class_nodes;
1676 nodes = g_list_append(nodes,class);
1682 ((Class *)class)->nodes = NULL;
1684 nodes = g_list_append(nodes,class);
1690 class = node_new (CLASS_NODE,
1691 "otype:steal", yyvsp[-3].id,
1692 "ptype:steal", yyvsp[-1].id,
1693 "bonobo_x_class:steal", bonobo_x_class,
1694 "chunk_size:steal", chunk_size,
1701 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1702 g_free (chunk_size);
1703 chunk_size = g_strdup(yyvsp[-2].id);
1704 } else if(strcmp(yyvsp[-3].id,"BonoboX") == 0) {
1705 g_free (bonobo_x_class);
1706 bonobo_x_class = g_strdup(yyvsp[-2].id);
1708 yyerror(_("parse error"));
1716 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1717 g_free (chunk_size);
1718 if(atoi(yyvsp[-2].id) != 0)
1719 chunk_size = g_strdup(yyvsp[-2].id);
1723 yyerror(_("parse error"));
1743 if (strcmp (yyvsp[-1].id, "BonoboX") != 0) {
1744 g_free(yyvsp[-1].id);
1745 yyerror(_("parse error"));
1748 last_added_method->bonobo_x_func = TRUE;
1769 { the_scope = PUBLIC_SCOPE; ;
1773 { the_scope = PRIVATE_SCOPE; ;
1777 { the_scope = PROTECTED_SCOPE; ;
1781 { the_scope = CLASS_SCOPE; ;
1786 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
1787 g_free (yyvsp[-1].id);
1788 destructor_unref = FALSE;
1789 destructor = yyvsp[0].id;
1790 destructor_line = line_no;
1791 destructor_simple = TRUE;
1792 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
1793 g_free (yyvsp[-1].id);
1794 destructor_unref = TRUE;
1795 destructor = yyvsp[0].id;
1796 destructor_line = line_no;
1797 destructor_simple = TRUE;
1799 g_free (yyvsp[-1].id);
1800 g_free (yyvsp[0].id);
1801 yyerror (_("parse error"));
1809 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
1810 g_free(yyvsp[-2].id);
1811 destructor_unref = FALSE;
1812 destructor = (yyvsp[0].cbuf)->str;
1813 g_string_free(yyvsp[0].cbuf, FALSE);
1814 destructor_line = ccode_line;
1815 destructor_simple = FALSE;
1816 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
1817 g_free (yyvsp[-2].id);
1818 destructor_unref = TRUE;
1819 destructor = (yyvsp[0].cbuf)->str;
1820 g_string_free (yyvsp[0].cbuf, FALSE);
1821 destructor_line = ccode_line;
1822 destructor_simple = FALSE;
1824 g_free (yyvsp[-2].id);
1825 g_string_free (yyvsp[0].cbuf, TRUE);
1826 yyerror (_("parse error"));
1834 initializer = yyvsp[0].id;
1835 initializer_line = ccode_line;
1841 initializer = (yyvsp[0].cbuf)->str;
1842 initializer_line = ccode_line;
1843 g_string_free(yyvsp[0].cbuf, FALSE);
1856 { destructor = NULL; ;
1860 { initializer = NULL; ;
1872 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
1878 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
1885 if(strcmp(yyvsp[-6].id,"get")==0 &&
1886 strcmp(yyvsp[-3].id,"set")==0) {
1887 Type *type = pop_type();
1888 g_free (yyvsp[-6].id);
1889 g_free (yyvsp[-3].id);
1890 node = node_new (ARGUMENT_NODE,
1891 "gtktype:steal", yyvsp[-9].id,
1892 "atype:steal", type,
1893 "flags:steal", yyvsp[-10].list,
1894 "name:steal", yyvsp[-8].id,
1895 "get:steal", (yyvsp[-4].cbuf)->str,
1896 "get_line", yyvsp[-5].line,
1897 "set:steal", (yyvsp[-1].cbuf)->str,
1898 "set_line", yyvsp[-2].line,
1899 "line_no", yyvsp[-11].line,
1902 class_nodes = g_list_append(class_nodes,node);
1904 g_string_free (yyvsp[-4].cbuf, FALSE);
1905 g_string_free (yyvsp[-1].cbuf, FALSE);
1907 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1908 strcmp(yyvsp[-3].id,"get")==0) {
1909 Type *type = pop_type();
1910 g_free (yyvsp[-6].id);
1911 g_free (yyvsp[-3].id);
1912 node = node_new (ARGUMENT_NODE,
1913 "gtktype:steal", yyvsp[-9].id,
1914 "atype:steal", type,
1915 "flags:steal", yyvsp[-10].list,
1916 "name:steal", yyvsp[-8].id,
1917 "get:steal", (yyvsp[-1].cbuf)->str,
1918 "get_line", yyvsp[-2].line,
1919 "set:steal", (yyvsp[-4].cbuf)->str,
1920 "set_line", yyvsp[-5].line,
1921 "line_no", yyvsp[-11].line,
1923 g_string_free (yyvsp[-1].cbuf, FALSE);
1924 g_string_free (yyvsp[-4].cbuf, FALSE);
1925 class_nodes = g_list_append(class_nodes,node);
1927 g_free (yyvsp[-9].id);
1928 g_free (yyvsp[-8].id);
1929 g_free (yyvsp[-6].id);
1930 g_free (yyvsp[-3].id);
1931 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
1932 g_list_free (yyvsp[-10].list);
1933 g_string_free (yyvsp[-1].cbuf, TRUE);
1934 g_string_free (yyvsp[-4].cbuf, TRUE);
1935 yyerror (_("parse error"));
1939 if (yyvsp[-7].id != NULL) {
1940 Argument *arg = (Argument *)node;
1941 export_accessors (arg->name,
1942 arg->get != NULL, arg->get_line,
1943 arg->set != NULL, arg->set_line,
1947 g_free (yyvsp[-7].id);
1956 if(strcmp(yyvsp[-3].id, "get") == 0) {
1957 Type *type = pop_type();
1958 g_free (yyvsp[-3].id);
1959 node = node_new (ARGUMENT_NODE,
1960 "gtktype:steal", yyvsp[-6].id,
1961 "atype:steal", type,
1962 "flags:steal", yyvsp[-7].list,
1963 "name:steal", yyvsp[-5].id,
1964 "get:steal", (yyvsp[-1].cbuf)->str,
1965 "get_line", yyvsp[-2].line,
1966 "line_no", yyvsp[-8].line,
1969 g_string_free (yyvsp[-1].cbuf, FALSE);
1970 class_nodes = g_list_append(class_nodes, node);
1971 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
1972 Type *type = pop_type();
1973 g_free (yyvsp[-3].id);
1974 node = node_new (ARGUMENT_NODE,
1975 "gtktype:steal", yyvsp[-6].id,
1976 "atype:steal", type,
1977 "flags:steal", yyvsp[-7].list,
1978 "name:steal", yyvsp[-5].id,
1979 "set:steal", (yyvsp[-1].cbuf)->str,
1980 "set_line", yyvsp[-2].line,
1981 "line_no", yyvsp[-8].line,
1984 g_string_free (yyvsp[-1].cbuf, FALSE);
1985 class_nodes = g_list_append (class_nodes, node);
1987 g_free (yyvsp[-3].id);
1988 g_free (yyvsp[-6].id);
1989 g_free (yyvsp[-5].id);
1990 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
1991 g_list_free (yyvsp[-7].list);
1992 g_string_free (yyvsp[-1].cbuf, TRUE);
1993 yyerror(_("parse error"));
1997 if (yyvsp[-4].id != NULL) {
1998 Argument *arg = (Argument *)node;
1999 export_accessors (arg->name,
2000 arg->get != NULL, arg->get_line,
2001 arg->set != NULL, arg->set_line,
2005 g_free (yyvsp[-4].id);
2013 char *get, *set = NULL;
2018 if(strcmp(yyvsp[0].id, "link")!=0 &&
2019 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2020 strcmp(yyvsp[0].id, "objectlink")!=0) {
2021 g_free(yyvsp[0].id);
2022 g_free(yyvsp[-3].id);
2023 g_free(yyvsp[-2].id);
2024 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2025 g_list_free(yyvsp[-4].list);
2026 yyerror(_("parse error"));
2032 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2033 if(var->scope == PRIVATE_SCOPE)
2034 root = "self->_priv";
2035 else if(var->scope == CLASS_SCOPE) {
2036 root = "SELF_GET_CLASS(self)";
2038 error_print(GOB_ERROR, yyvsp[-5].line,
2039 _("Self aliases needed when autolinking to a classwide member"));
2043 if(strcmp(yyvsp[0].id, "link")==0) {
2044 set = g_strdup_printf("%s->%s = ARG;",
2045 root, yyvsp[-2].id);
2046 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2047 set = g_strdup_printf("g_free (%s->%s); "
2048 "%s->%s = g_strdup (ARG);",
2050 root, yyvsp[-2].id);
2051 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2052 set = g_strdup_printf(
2054 "g_object_ref (G_OBJECT (ARG)); "
2055 "if (%s->%s != NULL) "
2056 "g_object_unref (G_OBJECT (%s->%s)); "
2060 root, yyvsp[-2].id);
2062 g_assert_not_reached();
2065 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2067 g_free (yyvsp[0].id);
2070 type = (Type *)node_copy ((Node *)var->vtype);
2072 node = node_new (ARGUMENT_NODE,
2073 "gtktype:steal", yyvsp[-3].id,
2074 "atype:steal", type,
2075 "flags:steal", yyvsp[-4].list,
2076 "name:steal", yyvsp[-2].id,
2078 "get_line", yyvsp[-5].line,
2080 "set_line", yyvsp[-5].line,
2081 "line_no", yyvsp[-5].line,
2084 if (yyvsp[-1].id != NULL) {
2085 Argument *arg = (Argument *)node;
2086 export_accessors (arg->name,
2087 arg->get != NULL, arg->get_line,
2088 arg->set != NULL, arg->set_line,
2092 g_free (yyvsp[-1].id);
2095 class_nodes = g_list_append (class_nodes, node);
2099 #line 1015 "parse.y"
2101 if (strcmp (yyvsp[-1].id, "export")!=0) {
2102 g_free (yyvsp[-1].id);
2103 yyerror (_("parse error"));
2106 yyval.id = yyvsp[-1].id;
2110 #line 1023 "parse.y"
2116 #line 1028 "parse.y"
2119 node_set ((Node *)property,
2120 "line_no", yyvsp[-10].line,
2121 "gtktype:steal", debool (yyvsp[-9].id),
2122 "name:steal", yyvsp[-8].id,
2124 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2125 strcmp (yyvsp[-3].id, "set") == 0) {
2126 node_set ((Node *)property,
2127 "get:steal", (yyvsp[-4].cbuf)->str,
2128 "get_line", yyvsp[-5].line,
2129 "set:steal", (yyvsp[-1].cbuf)->str,
2130 "set_line", yyvsp[-2].line,
2132 g_string_free (yyvsp[-4].cbuf, FALSE);
2133 g_string_free (yyvsp[-1].cbuf, FALSE);
2134 g_free (yyvsp[-6].id);
2135 g_free (yyvsp[-3].id);
2136 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2137 strcmp (yyvsp[-3].id, "get") == 0) {
2138 node_set ((Node *)property,
2139 "get:steal", (yyvsp[-1].cbuf)->str,
2140 "get_line", yyvsp[-2].line,
2141 "set:steal", (yyvsp[-4].cbuf)->str,
2142 "set_line", yyvsp[-5].line,
2144 g_string_free (yyvsp[-4].cbuf, FALSE);
2145 g_string_free (yyvsp[-1].cbuf, FALSE);
2146 g_free (yyvsp[-6].id);
2147 g_free (yyvsp[-3].id);
2149 g_string_free (yyvsp[-4].cbuf, TRUE);
2150 g_string_free (yyvsp[-1].cbuf, TRUE);
2151 g_free (yyvsp[-6].id);
2152 g_free (yyvsp[-3].id);
2153 node_free ((Node *)property);
2155 yyerror (_("parse error"));
2158 property_link_and_export ((Node *)property);
2159 if (property != NULL) {
2160 class_nodes = g_list_append (class_nodes,
2167 #line 1076 "parse.y"
2170 node_set ((Node *)property,
2171 "line_no", yyvsp[-7].line,
2172 "gtktype:steal", debool (yyvsp[-6].id),
2173 "name:steal", yyvsp[-5].id,
2175 if (strcmp (yyvsp[-3].id, "get") == 0) {
2176 node_set ((Node *)property,
2177 "get:steal", (yyvsp[-1].cbuf)->str,
2178 "get_line", yyvsp[-2].line,
2180 g_string_free (yyvsp[-1].cbuf, FALSE);
2181 g_free (yyvsp[-3].id);
2182 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2183 node_set ((Node *)property,
2184 "set:steal", (yyvsp[-1].cbuf)->str,
2185 "set_line", yyvsp[-2].line,
2187 g_string_free (yyvsp[-1].cbuf, FALSE);
2188 g_free (yyvsp[-3].id);
2190 g_string_free (yyvsp[-1].cbuf, TRUE);
2191 g_free (yyvsp[-3].id);
2192 node_free ((Node *)property);
2194 yyerror (_("parse error"));
2197 property_link_and_export ((Node *)property);
2198 if (property != NULL) {
2199 class_nodes = g_list_append (class_nodes,
2206 #line 1112 "parse.y"
2209 node_set ((Node *)property,
2210 "line_no", yyvsp[-4].line,
2211 "gtktype:steal", debool (yyvsp[-3].id),
2212 "name:steal", yyvsp[-2].id,
2214 property_link_and_export ((Node *)property);
2215 if (property != NULL) {
2216 class_nodes = g_list_append (class_nodes,
2223 #line 1128 "parse.y"
2227 #line 1129 "parse.y"
2231 #line 1132 "parse.y"
2235 #line 1133 "parse.y"
2239 #line 1136 "parse.y"
2240 { yyval.id = yyvsp[0].id; ;
2243 #line 1137 "parse.y"
2245 if (strcmp (yyvsp[-3].id, "_") != 0) {
2246 g_free (yyvsp[-3].id);
2247 yyerror(_("parse error"));
2250 g_free (yyvsp[-3].id);
2251 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2252 g_free (yyvsp[-1].id);
2256 #line 1149 "parse.y"
2257 { yyval.id = yyvsp[0].id; ;
2260 #line 1150 "parse.y"
2261 { yyval.id = yyvsp[0].id; ;
2264 #line 1153 "parse.y"
2267 node_set ((Node *)property,
2268 "nick:steal", yyvsp[0].id,
2273 #line 1159 "parse.y"
2276 node_set ((Node *)property,
2277 "blurb:steal", yyvsp[0].id,
2282 #line 1165 "parse.y"
2285 node_set ((Node *)property,
2286 "maximum:steal", yyvsp[0].id,
2291 #line 1171 "parse.y"
2294 node_set ((Node *)property,
2295 "minimum:steal", yyvsp[0].id,
2300 #line 1177 "parse.y"
2303 node_set ((Node *)property,
2304 "default_value:steal", yyvsp[0].id,
2309 #line 1183 "parse.y"
2312 node_set ((Node *)property,
2313 "flags:steal", yyvsp[0].list,
2318 #line 1189 "parse.y"
2320 Type *type = pop_type ();
2322 node_set ((Node *)property,
2323 "ptype:steal", type,
2328 #line 1196 "parse.y"
2331 node_set ((Node *)property,
2332 "extra_gtktype:steal", yyvsp[0].id,
2337 #line 1202 "parse.y"
2340 node_set ((Node *)property,
2341 "extra_gtktype:steal", yyvsp[0].id,
2346 #line 1208 "parse.y"
2349 node_set ((Node *)property,
2350 "extra_gtktype:steal", yyvsp[0].id,
2355 #line 1214 "parse.y"
2358 node_set ((Node *)property,
2359 "extra_gtktype:steal", yyvsp[0].id,
2364 #line 1220 "parse.y"
2367 node_set ((Node *)property,
2368 "extra_gtktype:steal", yyvsp[0].id,
2373 #line 1226 "parse.y"
2376 if (strcmp (yyvsp[0].id, "link") == 0) {
2377 g_free(yyvsp[0].id);
2378 node_set ((Node *)property,
2381 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2382 g_free(yyvsp[0].id);
2383 node_set ((Node *)property,
2387 g_free(yyvsp[0].id);
2388 yyerror(_("parse error"));
2394 #line 1246 "parse.y"
2396 if(strcmp(yyvsp[-2].id,"type")!=0) {
2397 g_free(yyvsp[-4].id);
2398 g_free(yyvsp[-2].id);
2399 yyerror(_("parse error"));
2402 yyval.id = debool (yyvsp[-4].id);
2406 #line 1255 "parse.y"
2408 yyval.id = debool (yyvsp[0].id);
2409 typestack = g_list_prepend(typestack,NULL);
2413 #line 1261 "parse.y"
2414 { yyval.list = yyvsp[-1].list; ;
2417 #line 1262 "parse.y"
2418 { yyval.list = NULL; ;
2421 #line 1265 "parse.y"
2423 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2427 #line 1268 "parse.y"
2429 yyval.list = g_list_append(NULL,yyvsp[0].id);
2433 #line 1274 "parse.y"
2435 Node *node = node_new (TYPE_NODE,
2436 "name:steal", yyvsp[-1].id,
2437 "pointer:steal", yyvsp[0].id,
2439 typestack = g_list_prepend(typestack,node);
2443 #line 1281 "parse.y"
2445 Node *node = node_new (TYPE_NODE,
2446 "name:steal", yyvsp[0].id,
2448 typestack = g_list_prepend(typestack,node);
2452 #line 1290 "parse.y"
2454 yyval.id = yyvsp[0].id;
2458 #line 1293 "parse.y"
2460 yyval.id = yyvsp[0].id;
2464 #line 1296 "parse.y"
2466 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2467 g_free(yyvsp[0].id);
2471 #line 1300 "parse.y"
2473 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2474 g_free(yyvsp[-1].id);
2478 #line 1304 "parse.y"
2480 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2481 g_free(yyvsp[0].id);
2485 #line 1308 "parse.y"
2487 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2489 g_free(yyvsp[0].id);
2493 #line 1313 "parse.y"
2495 yyval.id = g_strconcat(yyvsp[-2].id, " ",
2496 yyvsp[-1].id, " const", NULL);
2497 g_free(yyvsp[-1].id);
2501 #line 1321 "parse.y"
2503 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2504 g_free(yyvsp[0].id);
2508 #line 1325 "parse.y"
2510 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2511 g_free(yyvsp[-1].id);
2512 g_free(yyvsp[0].id);
2516 #line 1330 "parse.y"
2518 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2519 g_free(yyvsp[0].id);
2523 #line 1334 "parse.y"
2525 yyval.id = yyvsp[0].id;
2529 #line 1337 "parse.y"
2531 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2532 g_free(yyvsp[-1].id);
2536 #line 1341 "parse.y"
2538 yyval.id = g_strdup(yyvsp[0].id);
2542 #line 1344 "parse.y"
2544 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2548 #line 1349 "parse.y"
2549 { yyval.id = "void"; ;
2552 #line 1350 "parse.y"
2553 { yyval.id = "char"; ;
2556 #line 1351 "parse.y"
2557 { yyval.id = "short"; ;
2560 #line 1352 "parse.y"
2561 { yyval.id = "int"; ;
2564 #line 1353 "parse.y"
2565 { yyval.id = "long"; ;
2568 #line 1354 "parse.y"
2569 { yyval.id = "float"; ;
2572 #line 1355 "parse.y"
2573 { yyval.id = "double"; ;
2576 #line 1356 "parse.y"
2577 { yyval.id = "signed"; ;
2580 #line 1357 "parse.y"
2581 { yyval.id = "unsigned"; ;
2584 #line 1360 "parse.y"
2585 { yyval.id = "struct"; ;
2588 #line 1361 "parse.y"
2589 { yyval.id = "union"; ;
2592 #line 1362 "parse.y"
2593 { yyval.id = "enum"; ;
2596 #line 1365 "parse.y"
2597 { yyval.id = g_strdup("*"); ;
2600 #line 1366 "parse.y"
2601 { yyval.id = g_strdup("* const"); ;
2604 #line 1367 "parse.y"
2606 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2607 g_free(yyvsp[0].id);
2611 #line 1371 "parse.y"
2613 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2614 g_free(yyvsp[0].id);
2618 #line 1378 "parse.y"
2620 if(strcmp(yyvsp[-1].id, "first")==0)
2621 yyval.sigtype = SIGNAL_FIRST_METHOD;
2622 else if(strcmp(yyvsp[-1].id, "last")==0)
2623 yyval.sigtype = SIGNAL_LAST_METHOD;
2625 yyerror(_("signal must be 'first' or 'last'"));
2626 g_free(yyvsp[-1].id);
2629 g_free(yyvsp[-1].id);
2633 #line 1390 "parse.y"
2635 yyval.sigtype = SIGNAL_LAST_METHOD;
2639 #line 1396 "parse.y"
2641 if(strcmp(yyvsp[-1].id,"first")==0)
2642 yyval.sigtype = SIGNAL_FIRST_METHOD;
2643 else if(strcmp(yyvsp[-1].id,"last")==0)
2644 yyval.sigtype = SIGNAL_LAST_METHOD;
2646 yyerror(_("signal must be 'first' or 'last'"));
2647 g_free(yyvsp[-1].id);
2650 g_free(yyvsp[-1].id);
2654 #line 1408 "parse.y"
2656 if(strcmp(yyvsp[-2].id,"first")==0)
2657 yyval.sigtype = SIGNAL_FIRST_METHOD;
2658 else if(strcmp(yyvsp[-2].id,"last")==0)
2659 yyval.sigtype = SIGNAL_LAST_METHOD;
2661 yyerror(_("signal must be 'first' or 'last'"));
2662 g_free(yyvsp[-2].id);
2665 g_free(yyvsp[-2].id);
2669 #line 1420 "parse.y"
2671 yyval.sigtype = SIGNAL_LAST_METHOD;
2675 #line 1423 "parse.y"
2677 /* the_scope was default thus public */
2678 the_scope = PUBLIC_SCOPE;
2682 #line 1429 "parse.y"
2684 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
2688 #line 1434 "parse.y"
2690 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2694 #line 1437 "parse.y"
2696 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2700 #line 1442 "parse.y"
2701 { yyval.cbuf = yyvsp[0].cbuf; ;
2704 #line 1443 "parse.y"
2705 { yyval.cbuf = NULL; ;
2708 #line 1447 "parse.y"
2711 yyerror(_("signal without 'self' as "
2712 "first parameter"));
2713 free_all_global_state();
2716 if(the_scope == CLASS_SCOPE) {
2717 yyerror(_("a method cannot be of class scope"));
2718 free_all_global_state();
2721 push_function(the_scope, yyvsp[-7].sigtype,NULL,
2722 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
2723 ccode_line, vararg, yyvsp[-8].list);
2727 #line 1463 "parse.y"
2730 yyerror(_("signal without 'self' as "
2731 "first parameter"));
2732 free_all_global_state();
2735 if(the_scope == CLASS_SCOPE) {
2736 yyerror(_("a method cannot be of class scope"));
2737 free_all_global_state();
2740 push_function(the_scope, yyvsp[-7].sigtype, NULL,
2741 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
2742 ccode_line, vararg, yyvsp[-8].list);
2746 #line 1479 "parse.y"
2749 yyerror(_("virtual method without 'self' as "
2750 "first parameter"));
2751 free_all_global_state();
2754 if(the_scope == CLASS_SCOPE) {
2755 yyerror(_("a method cannot be of class scope"));
2756 free_all_global_state();
2759 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2760 yyvsp[0].cbuf, yyvsp[-8].line,
2761 ccode_line, vararg, NULL);
2765 #line 1495 "parse.y"
2768 yyerror(_("virtual method without 'self' as "
2769 "first parameter"));
2770 free_all_global_state();
2773 if(the_scope == CLASS_SCOPE) {
2774 yyerror(_("a method cannot be of class scope"));
2775 free_all_global_state();
2778 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2779 yyvsp[0].cbuf, yyvsp[-7].line,
2780 ccode_line, vararg, NULL);
2784 #line 1511 "parse.y"
2787 yyerror(_("virtual method without 'self' as "
2788 "first parameter"));
2789 free_all_global_state();
2792 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2793 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2794 ccode_line, vararg, NULL);
2798 #line 1522 "parse.y"
2800 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
2801 yyvsp[-5].id, yyvsp[0].cbuf,
2802 yyvsp[-10].line, ccode_line,
2807 #line 1528 "parse.y"
2809 if(the_scope == CLASS_SCOPE) {
2810 yyerror(_("a method cannot be of class scope"));
2811 free_all_global_state();
2814 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
2815 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
2820 #line 1538 "parse.y"
2822 if(strcmp(yyvsp[-4].id, "init")==0) {
2823 push_init_arg(yyvsp[-2].id,FALSE);
2824 push_function(NO_SCOPE, INIT_METHOD, NULL,
2825 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2826 ccode_line, FALSE, NULL);
2827 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
2828 push_init_arg(yyvsp[-2].id,TRUE);
2829 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
2830 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2831 ccode_line, FALSE, NULL);
2833 g_free(yyvsp[-4].id);
2834 g_free(yyvsp[-2].id);
2835 g_string_free(yyvsp[0].cbuf,TRUE);
2836 yyerror(_("parse error "
2837 "(untyped blocks must be init or "
2844 #line 1561 "parse.y"
2846 g_free(onerror); onerror = NULL;
2847 g_free(defreturn); defreturn = NULL;
2848 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2849 g_free(yyvsp[-1].id);
2850 g_free(yyvsp[0].id);
2851 yyerror(_("parse error"));
2854 g_free(yyvsp[-1].id);
2858 #line 1572 "parse.y"
2860 g_free(onerror); onerror = NULL;
2861 g_free(defreturn); defreturn = NULL;
2862 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
2863 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2864 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2865 yyerror(_("parse error"));
2868 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2869 onerror = defreturn = NULL;
2870 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2871 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2872 yyerror(_("parse error"));
2875 g_free(yyvsp[-3].id);
2876 g_free(yyvsp[-1].id);
2880 #line 1591 "parse.y"
2882 g_free(onerror); onerror = NULL;
2883 g_free(defreturn); defreturn = NULL;
2887 #line 1597 "parse.y"
2888 { yyval.id = yyvsp[0].id; ;
2891 #line 1598 "parse.y"
2893 yyval.id = (yyvsp[1].cbuf)->str;
2894 g_string_free(yyvsp[1].cbuf, FALSE);
2898 #line 1604 "parse.y"
2899 { vararg = FALSE; has_self = FALSE; ;
2902 #line 1605 "parse.y"
2906 if(strcmp(yyvsp[0].id,"self")==0)
2907 push_self(yyvsp[0].id, FALSE);
2909 g_free(yyvsp[0].id);
2910 yyerror(_("parse error"));
2916 #line 1616 "parse.y"
2920 if(strcmp(yyvsp[-1].id,"self")==0)
2921 push_self(yyvsp[-1].id, TRUE);
2923 g_free(yyvsp[-1].id);
2924 yyerror(_("parse error"));
2930 #line 1627 "parse.y"
2934 if(strcmp(yyvsp[0].id,"self")==0)
2935 push_self(yyvsp[0].id, TRUE);
2937 g_free(yyvsp[0].id);
2938 yyerror(_("parse error"));
2944 #line 1638 "parse.y"
2947 if(strcmp(yyvsp[-2].id,"self")==0)
2948 push_self(yyvsp[-2].id, FALSE);
2950 g_free(yyvsp[-2].id);
2951 yyerror(_("parse error"));
2957 #line 1648 "parse.y"
2960 if(strcmp(yyvsp[-3].id,"self")==0)
2961 push_self(yyvsp[-3].id, TRUE);
2963 g_free(yyvsp[-3].id);
2964 yyerror(_("parse error"));
2970 #line 1658 "parse.y"
2973 if(strcmp(yyvsp[-2].id,"self")==0)
2974 push_self(yyvsp[-2].id, TRUE);
2976 g_free(yyvsp[-2].id);
2977 yyerror(_("parse error"));
2983 #line 1668 "parse.y"
2984 { has_self = FALSE; ;
2987 #line 1671 "parse.y"
2991 #line 1672 "parse.y"
2995 #line 1675 "parse.y"
2999 #line 1676 "parse.y"
3003 #line 1679 "parse.y"
3005 push_funcarg(yyvsp[0].id,NULL);
3009 #line 1682 "parse.y"
3011 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3015 #line 1685 "parse.y"
3017 if(strcmp(yyvsp[-2].id,"check")!=0) {
3018 yyerror(_("parse error"));
3021 g_free(yyvsp[-2].id);
3022 push_funcarg(yyvsp[-4].id,NULL);
3026 #line 1693 "parse.y"
3028 if(strcmp(yyvsp[-2].id,"check")!=0) {
3029 yyerror(_("parse error"));
3032 g_free(yyvsp[-2].id);
3033 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3037 #line 1703 "parse.y"
3041 #line 1704 "parse.y"
3045 #line 1707 "parse.y"
3047 if(strcmp(yyvsp[0].id,"type")==0) {
3048 Node *node = node_new (CHECK_NODE,
3049 "chtype", TYPE_CHECK,
3051 checks = g_list_append(checks,node);
3052 } else if(strcmp(yyvsp[0].id,"null")==0) {
3053 Node *node = node_new (CHECK_NODE,
3054 "chtype", NULL_CHECK,
3056 checks = g_list_append(checks,node);
3058 yyerror(_("parse error"));
3061 g_free(yyvsp[0].id);
3065 #line 1724 "parse.y"
3067 Node *node = node_new (CHECK_NODE,
3069 "number:steal", yyvsp[0].id,
3071 checks = g_list_append(checks,node);
3075 #line 1731 "parse.y"
3077 Node *node = node_new (CHECK_NODE,
3079 "number:steal", yyvsp[0].id,
3081 checks = g_list_append(checks,node);
3085 #line 1738 "parse.y"
3087 Node *node = node_new (CHECK_NODE,
3089 "number:steal", yyvsp[0].id,
3091 checks = g_list_append(checks,node);
3095 #line 1745 "parse.y"
3097 Node *node = node_new (CHECK_NODE,
3099 "number:steal", yyvsp[0].id,
3101 checks = g_list_append(checks,node);
3105 #line 1752 "parse.y"
3107 Node *node = node_new (CHECK_NODE,
3109 "number:steal", yyvsp[0].id,
3111 checks = g_list_append(checks,node);
3115 #line 1759 "parse.y"
3117 Node *node = node_new (CHECK_NODE,
3119 "number:steal", yyvsp[0].id,
3121 checks = g_list_append(checks,node);
3125 #line 1768 "parse.y"
3126 { yyval.id = yyvsp[0].id; ;
3129 #line 1769 "parse.y"
3131 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3132 g_free(yyvsp[0].id);
3136 #line 1773 "parse.y"
3137 { yyval.id = yyvsp[0].id; ;
3140 #line 1774 "parse.y"
3141 { yyval.id = yyvsp[0].id; ;
3144 /* the action file gets copied in in place of this dollarsign */
3145 #line 543 "/usr/lib/bison.simple"
3156 short *ssp1 = yyss - 1;
3157 fprintf (stderr, "state stack now");
3158 while (ssp1 != yyssp)
3159 fprintf (stderr, " %d", *++ssp1);
3160 fprintf (stderr, "\n");
3170 yylsp->first_line = yylloc.first_line;
3171 yylsp->first_column = yylloc.first_column;
3172 yylsp->last_line = (yylsp-1)->last_line;
3173 yylsp->last_column = (yylsp-1)->last_column;
3178 yylsp->last_line = (yylsp+yylen-1)->last_line;
3179 yylsp->last_column = (yylsp+yylen-1)->last_column;
3183 /* Now "shift" the result of the reduction.
3184 Determine what state that goes to,
3185 based on the state we popped back to
3186 and the rule number reduced by. */
3190 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3191 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3192 yystate = yytable[yystate];
3194 yystate = yydefgoto[yyn - YYNTBASE];
3198 yyerrlab: /* here on detecting error */
3201 /* If not already recovering from an error, report this error. */
3205 #ifdef YYERROR_VERBOSE
3206 yyn = yypact[yystate];
3208 if (yyn > YYFLAG && yyn < YYLAST)
3215 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3216 for (x = (yyn < 0 ? -yyn : 0);
3217 x < (sizeof(yytname) / sizeof(char *)); x++)
3218 if (yycheck[x + yyn] == x)
3219 size += strlen(yytname[x]) + 15, count++;
3220 msg = (char *) malloc(size + 15);
3223 strcpy(msg, "parse error");
3228 for (x = (yyn < 0 ? -yyn : 0);
3229 x < (sizeof(yytname) / sizeof(char *)); x++)
3230 if (yycheck[x + yyn] == x)
3232 strcat(msg, count == 0 ? ", expecting `" : " or `");
3233 strcat(msg, yytname[x]);
3242 yyerror ("parse error; also virtual memory exceeded");
3245 #endif /* YYERROR_VERBOSE */
3246 yyerror("parse error");
3250 yyerrlab1: /* here on error raised explicitly by an action */
3252 if (yyerrstatus == 3)
3254 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3256 /* return failure if at end of input */
3257 if (yychar == YYEOF)
3262 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3268 /* Else will try to reuse lookahead token
3269 after shifting the error token. */
3271 yyerrstatus = 3; /* Each real token shifted decrements this */
3275 yyerrdefault: /* current state does not do anything special for the error token. */
3278 /* This is wrong; only states that explicitly want error tokens
3279 should shift them. */
3280 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3281 if (yyn) goto yydefault;
3284 yyerrpop: /* pop the current state because it cannot handle the error token */
3286 if (yyssp == yyss) YYABORT;
3296 short *ssp1 = yyss - 1;
3297 fprintf (stderr, "Error: state stack now");
3298 while (ssp1 != yyssp)
3299 fprintf (stderr, " %d", *++ssp1);
3300 fprintf (stderr, "\n");
3306 yyn = yypact[yystate];
3311 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3330 fprintf(stderr, "Shifting error token, ");
3342 /* YYACCEPT comes here. */
3354 /* YYABORT comes here. */
3365 #line 1777 "parse.y"