]> git.draconx.ca Git - gob-dx.git/blob - src/parse.c
Release 1.99.1
[gob-dx.git] / src / parse.c
1
2 /*  A Bison parser, made from parse.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define CLASS   257
8 #define FROM    258
9 #define CONST   259
10 #define VOID    260
11 #define STRUCT  261
12 #define UNION   262
13 #define ENUM    263
14 #define THREEDOTS       264
15 #define SIGNED  265
16 #define UNSIGNED        266
17 #define LONG    267
18 #define SHORT   268
19 #define INT     269
20 #define FLOAT   270
21 #define DOUBLE  271
22 #define CHAR    272
23 #define TOKEN   273
24 #define NUMBER  274
25 #define TYPETOKEN       275
26 #define ARRAY_DIM       276
27 #define SINGLE_CHAR     277
28 #define CCODE   278
29 #define HTCODE  279
30 #define PHCODE  280
31 #define HCODE   281
32 #define ACODE   282
33 #define ATCODE  283
34 #define STRING  284
35 #define PUBLIC  285
36 #define PRIVATE 286
37 #define PROTECTED       287
38 #define CLASSWIDE       288
39 #define PROPERTY        289
40 #define ARGUMENT        290
41 #define VIRTUAL 291
42 #define SIGNAL  292
43 #define OVERRIDE        293
44 #define NICK    294
45 #define BLURB   295
46 #define MAXIMUM 296
47 #define MINIMUM 297
48 #define DEFAULT_VALUE   298
49 #define FLAGS   299
50 #define TYPE    300
51 #define FLAGS_TYPE      301
52 #define ENUM_TYPE       302
53 #define PARAM_TYPE      303
54 #define BOXED_TYPE      304
55 #define OBJECT_TYPE     305
56
57 #line 22 "parse.y"
58
59
60 #include "config.h"
61 #include <glib.h>
62 #include <stdio.h>
63 #include <stdlib.h>
64 #include <string.h>
65
66 #include "treefuncs.h"
67 #include "main.h"
68 #include "util.h"
69
70 #define _(x) (x)
71         
72 GList *nodes = NULL;
73
74 static GList *class_nodes = NULL;
75 Node *class = NULL;
76
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;
85
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;
93
94 static char *onerror = NULL;
95 static char *defreturn = NULL;
96
97 static GList *gtktypes = NULL;
98
99 static Property *property = NULL;
100
101 /* this can be a global as we will only do one function at a time
102    anyway */
103 static int the_scope = NO_SCOPE;
104
105 void free(void *ptr);
106 int yylex(void);
107
108 extern int ccode_line;
109 extern int line_no;
110
111 extern char *yytext;
112
113 static void
114 yyerror(char *str)
115 {
116         char *out=NULL;
117         char *p;
118         
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);
123         } else {
124                 char *tmp = g_strdup(yytext);
125                 while((p=strchr(tmp, '\n')))
126                         *p='.';
127
128                 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
129                 g_free(tmp);
130         }
131
132         fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
133         g_free(out);
134         
135         exit(1);
136 }
137
138 static Type *
139 pop_type(void)
140 {
141         Type *type = typestack->data;
142         typestack = g_list_remove(typestack,typestack->data);
143         return type;
144 }
145
146 static void
147 push_variable (char *name, int scope, int line_no, char *postfix)
148 {
149         Node *var;
150         Type *type = pop_type ();
151
152         type->postfix = postfix;
153         
154         var = node_new (VARIABLE_NODE,
155                         "scope", scope,
156                         "vtype:steal", type,
157                         "id:steal", name,
158                         "line_no", line_no,
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,
165                         NULL);
166         class_nodes = g_list_append(class_nodes, var);
167 }
168
169 static void
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)
173 {
174         Node *node;
175         Type *type;
176         char *c_cbuf;
177
178         g_assert(scope != CLASS_SCOPE);
179        
180         if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
181                 type = (Type *)node_new (TYPE_NODE,
182                                          "name", "void",
183                                          NULL);
184         } else {
185                 type = pop_type();
186         }
187         
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"));
200         }
201         if(g_list_length(gtktypes) > 2) {
202                 GList *li;
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"));
208                         }
209                 }
210         }
211         if(cbuf) {
212                 char *p;
213                 c_cbuf = p = cbuf->str;
214                 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
215                         p++;
216                 if(!p || !*p)
217                         c_cbuf = NULL;
218         } else
219                 c_cbuf = NULL;
220
221         node = node_new (METHOD_NODE,
222                          "scope", scope,
223                          "method", method,
224                          "mtype:steal", type,
225                          "otype:steal", oid,
226                          "gtktypes:steal", gtktypes,
227                          "flags:steal", flags,
228                          "id:steal", id,
229                          "args:steal", funcargs,
230                          "onerror:steal", onerror,
231                          "defreturn:steal", defreturn,
232                          "cbuf:steal", c_cbuf,
233                          "line_no", line_no,
234                          "ccode_line", ccode_line,
235                          "vararg", vararg,
236                          "unique_id", method_unique_id++,
237                          NULL);
238
239         last_added_method = (Method *)node;
240
241         if(cbuf)
242                 g_string_free(cbuf,
243                               /*only free segment if we haven't passed it
244                                 above */
245                               c_cbuf?FALSE:TRUE);
246         gtktypes = NULL;
247         funcargs = NULL;
248
249         onerror = NULL;
250         defreturn = NULL;
251
252         class_nodes = g_list_append(class_nodes, node);
253 }
254
255 static void
256 free_all_global_state(void)
257 {
258         g_free(onerror);
259         onerror = NULL;
260         g_free(defreturn);
261         defreturn = NULL;
262
263         g_free(chunk_size);
264         chunk_size = NULL;
265         
266         g_list_foreach(gtktypes, (GFunc)g_free, NULL);
267         g_list_free(gtktypes);
268         gtktypes = NULL;
269
270         node_list_free (funcargs);
271         funcargs = NULL;
272 }
273
274 static void
275 push_funcarg(char *name, char *postfix)
276 {
277         Node *node;
278         Type *type = pop_type();
279
280         type->postfix = postfix;
281         
282         node = node_new (FUNCARG_NODE,
283                          "atype:steal", type,
284                          "name:steal", name,
285                          "checks:steal", checks,
286                          NULL);
287         checks = NULL;
288         
289         funcargs = g_list_append(funcargs, node);
290 }
291
292 static void
293 push_init_arg(char *name, int is_class)
294 {
295         Node *node;
296         Node *type;
297         char *tn;
298         
299         if(is_class)
300                 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
301         else
302                 tn = g_strdup(((Class *)class)->otype);
303
304         type = node_new (TYPE_NODE,
305                          "name:steal", tn,
306                          "pointer", "*",
307                          NULL);
308         node = node_new (FUNCARG_NODE,
309                          "atype:steal", (Type *)type,
310                          "name:steal", name,
311                          NULL);
312         funcargs = g_list_prepend(funcargs, node);
313 }
314
315 static void
316 push_self(char *id, gboolean constant)
317 {
318         Node *node;
319         Node *type;
320         GList *ch = NULL;
321         type = node_new (TYPE_NODE,
322                          "name", ((Class *)class)->otype,
323                          "pointer", constant ? "const *" : "*",
324                          NULL);
325         ch = g_list_append (ch, node_new (CHECK_NODE,
326                                           "chtype", NULL_CHECK,
327                                           NULL));
328         ch = g_list_append (ch, node_new (CHECK_NODE,
329                                           "chtype", TYPE_CHECK,
330                                           NULL));
331         node = node_new (FUNCARG_NODE,
332                          "atype:steal", (Type *)type,
333                          "name:steal", id,
334                          "checks:steal", ch,
335                          NULL);
336         funcargs = g_list_prepend(funcargs, node);
337 }
338
339 static Variable *
340 find_var_or_die(const char *id, int line)
341 {
342         GList *li;
343
344         for(li = class_nodes; li != NULL; li = li->next) {
345                 Variable *var;
346                 Node *node = li->data;
347                 if(node->type != VARIABLE_NODE)
348                         continue;
349                 var = li->data;
350                 if(strcmp(var->id, id)==0)
351                         return var;
352         }
353
354         error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
355
356         g_assert_not_reached();
357         return NULL;
358 }
359
360 static gboolean
361 set_return_value(char *type, char *val)
362 {
363         if(strcmp(type, "onerror")==0) {
364                 if(!onerror) {
365                         onerror = val;
366                         return TRUE;
367                 } else
368                         return FALSE;
369         } else if(strcmp(type, "defreturn")==0) {
370                 if(!defreturn) {
371                         defreturn = val;
372                         return TRUE;
373                 } else
374                         return FALSE;
375         }
376         return FALSE;
377 }
378
379 static void
380 export_accessors (const char *var_name,
381                   gboolean do_get,
382                   gboolean do_set,
383                   int get_lineno,
384                   int set_lineno,
385                   Type *type,
386                   const char *gtktype,
387                   int lineno)
388 {       
389         Type *the_type;
390
391         if (type != NULL)
392                 the_type = (Type *)node_copy ((Node *)type);
393         else
394                 the_type = get_tree_type (gtktype, TRUE);
395
396         if (the_type == NULL) {
397                 error_print (GOB_ERROR, line_no,
398                              _("Cannot determine type of property or argument"));
399                 return;
400         }
401
402         if (do_get) {
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,
409                                         NULL);
410                 Node *node3 = node_new (TYPE_NODE,
411                                         "name", class->class.otype,
412                                         "pointer", "*",
413                                         NULL);
414
415                 g_string_sprintf (get_cbuf,
416                                   "\t%s%s val; "
417                                   "g_object_get (G_OBJECT (self), \"%s\", "
418                                   "&val, NULL); "
419                                   "return val;\n",
420                                   the_type->name, 
421                                   the_type->pointer ? the_type->pointer : "",
422                                   var_name);
423                 
424                 typestack = g_list_prepend (typestack, node1);
425                 typestack = g_list_prepend (typestack, node3);
426                 
427                 push_funcarg ("self", FALSE);
428                 
429                 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
430                                get_id, get_cbuf, get_lineno,
431                                lineno, FALSE, NULL);
432         }
433         
434         if (do_set) {
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,
441                                         NULL);
442                 Node *node2 = node_new (TYPE_NODE, 
443                                         "name", "void",
444                                         NULL);
445                 Node *node3 = node_new (TYPE_NODE, 
446                                         "name", class->class.otype,
447                                         "pointer", "*",
448                                         NULL);
449
450                 g_string_sprintf (set_cbuf,
451                                   "\tg_object_set (G_OBJECT (self), "
452                                   "\"%s\", val, NULL);\n",
453                                   var_name);
454
455                 typestack = g_list_prepend (typestack, node2);
456                 typestack = g_list_prepend (typestack, node1);
457                 typestack = g_list_prepend (typestack, node3);
458                 
459                 push_funcarg ("self", FALSE);
460                 push_funcarg ("val", FALSE);
461         
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);
466         }
467
468         node_free ((Node *)the_type);
469 }
470
471 static void
472 property_link_and_export (Node *node)
473 {
474         Property *prop = (Property *)node;
475
476         if (prop->link) {
477                 const char *root;
478                 char *get = NULL, *set = NULL;
479                 Variable *var;
480
481                 if (prop->set != NULL ||
482                     prop->get != NULL) {        
483                         error_print (GOB_ERROR, prop->line_no,
484                                      _("Property linking requested, but "
485                                        "getters and setters exist"));
486                 }
487
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)";
493                         if (no_self_alias)
494                                 error_print (GOB_ERROR, prop->line_no,
495                                              _("Self aliases needed when autolinking to a classwide member"));
496                 } else {
497                         root = "self";
498                 }
499
500                 if (strcmp (prop->gtktype, "STRING") == 0) {
501                         set = g_strdup_printf("g_free (%s->%s); "
502                                               "%s->%s = g_value_dup_string (VAL);",
503                                               root, prop->name,
504                                               root, prop->name);
505                         get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
506                                               root, prop->name);
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); "
513                                               "} else { "
514                                                 "%s->%s = NULL; "
515                                               "} "
516                                               "if (___old != NULL) { "
517                                                 "gtk_object_unref (GTK_OBJECT (___old)); "
518                                               "} "
519                                               "}",
520                                               root, prop->name,
521                                               root, prop->name,
522                                               root, prop->name);
523                         get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
524                                               root, prop->name);
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"));
530                         }
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;"
537                                               "} "
538                                               "}",
539                                               root, prop->name,
540                                               prop->extra_gtktype,
541                                               root, prop->name,
542                                               prop->extra_gtktype,
543                                               root, prop->name);
544                         get = g_strdup_printf("g_value_set_object (VAL, %s->%s);",
545                                               root, prop->name);
546                 } else {
547                         char *set_func;
548                         char *get_func;
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);
553
554                         set = g_strdup_printf("%s->%s = %s (VAL);",
555                                               root, prop->name,
556                                               get_func);
557                         get = g_strdup_printf("%s (VAL, %s->%s);",
558                                               set_func,
559                                               root, prop->name);
560
561                         g_free (get_func);
562                         g_free (set_func);
563                 }
564
565                 node_set (node,
566                           "get:steal", get,
567                           "get_line", prop->line_no,
568                           "set:steal", set,
569                           "set_line", prop->line_no,
570                           NULL);
571         }
572
573         if (prop->export) {
574                 export_accessors (prop->name,
575                                   prop->get != NULL, prop->get_line,
576                                   prop->set != NULL,  prop->get_line,
577                                   prop->ptype,
578                                   prop->gtktype,
579                                   prop->line_no);
580         } 
581 }
582
583
584 static char *
585 debool (char *s)
586 {
587         if (strcmp (s, "BOOL") == 0) {
588                 error_print (GOB_WARN, line_no,
589                             _("BOOL type is deprecated, please use BOOLEAN"));
590                 g_free (s);
591                 return g_strdup ("BOOLEAN");
592         } else {
593                 return s;
594         }
595 }
596
597 static void
598 ensure_property (void)
599 {
600         if (property == NULL)
601                 property = (Property *)node_new (PROPERTY_NODE, NULL);
602 }
603
604
605 #line 570 "parse.y"
606 typedef union {
607         char *id;
608         GString *cbuf;
609         GList *list;
610         int line;
611         int sigtype;
612 } YYSTYPE;
613 #ifndef YYDEBUG
614 #define YYDEBUG 1
615 #endif
616
617 #include <stdio.h>
618
619 #ifndef __cplusplus
620 #ifndef __STDC__
621 #define const
622 #endif
623 #endif
624
625
626
627 #define YYFINAL         340
628 #define YYFLAG          -32768
629 #define YYNTBASE        65
630
631 #define YYTRANSLATE(x) ((unsigned)(x) <= 305 ? yytranslate[x] : 110)
632
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,
664     47,    48,    49,    50,    51
665 };
666
667 #if YYDEBUG != 0
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,
685    578
686 };
687
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
747 };
748
749 #endif
750
751 #if YYDEBUG != 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,
769   1774
770 };
771 #endif
772
773
774 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
775
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
790 };
791 #endif
792
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,
810    109
811 };
812
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,
830      1
831 };
832
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
868 };
869
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,
875    173,   304,   305,   286
876 };
877
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
913 };
914
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,
920    275,   202,  -211,  -135
921 };
922
923
924 #define YYLAST          500
925
926
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
978 };
979
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
1031 };
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.  */
1035
1036 /* Skeleton output parser for bison,
1037    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
1038
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)
1042    any later version.
1043
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.
1048
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.  */
1053
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.  */
1058
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.  */
1063
1064 #ifndef YYSTACK_USE_ALLOCA
1065 #ifdef alloca
1066 #define YYSTACK_USE_ALLOCA
1067 #else /* alloca not defined */
1068 #ifdef __GNUC__
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
1074 #include <alloca.h>
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.  */
1082 #include <malloc.h>
1083 #endif
1084 #else /* not MSDOS, or __TURBOC__ */
1085 #if defined(_AIX)
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>  */
1089  #pragma alloca
1090 #define YYSTACK_USE_ALLOCA
1091 #else /* not MSDOS, or __TURBOC__, or _AIX */
1092 #if 0
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
1097 #endif /* __hpux */
1098 #endif
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 */
1105
1106 #ifdef YYSTACK_USE_ALLOCA
1107 #define YYSTACK_ALLOC alloca
1108 #else
1109 #define YYSTACK_ALLOC malloc
1110 #endif
1111
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.  */
1115
1116 #define yyerrok         (yyerrstatus = 0)
1117 #define yyclearin       (yychar = YYEMPTY)
1118 #define YYEMPTY         -2
1119 #define YYEOF           0
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) \
1130 do                                                              \
1131   if (yychar == YYEMPTY && yylen == 1)                          \
1132     { yychar = (token), yylval = (value);                       \
1133       yychar1 = YYTRANSLATE (yychar);                           \
1134       YYPOPSTACK;                                               \
1135       goto yybackup;                                            \
1136     }                                                           \
1137   else                                                          \
1138     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
1139 while (0)
1140
1141 #define YYTERROR        1
1142 #define YYERRCODE       256
1143
1144 #ifndef YYPURE
1145 #define YYLEX           yylex()
1146 #endif
1147
1148 #ifdef YYPURE
1149 #ifdef YYLSP_NEEDED
1150 #ifdef YYLEX_PARAM
1151 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
1152 #else
1153 #define YYLEX           yylex(&yylval, &yylloc)
1154 #endif
1155 #else /* not YYLSP_NEEDED */
1156 #ifdef YYLEX_PARAM
1157 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
1158 #else
1159 #define YYLEX           yylex(&yylval)
1160 #endif
1161 #endif /* not YYLSP_NEEDED */
1162 #endif
1163
1164 /* If nonreentrant, generate the variables here */
1165
1166 #ifndef YYPURE
1167
1168 int     yychar;                 /*  the lookahead symbol                */
1169 YYSTYPE yylval;                 /*  the semantic value of the           */
1170                                 /*  lookahead symbol                    */
1171
1172 #ifdef YYLSP_NEEDED
1173 YYLTYPE yylloc;                 /*  location data for the lookahead     */
1174                                 /*  symbol                              */
1175 #endif
1176
1177 int yynerrs;                    /*  number of parse errors so far       */
1178 #endif  /* not YYPURE */
1179
1180 #if YYDEBUG != 0
1181 int yydebug;                    /*  nonzero means print parse trace     */
1182 /* Since this is uninitialized, it does not stop multiple parsers
1183    from coexisting.  */
1184 #endif
1185
1186 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
1187
1188 #ifndef YYINITDEPTH
1189 #define YYINITDEPTH 200
1190 #endif
1191
1192 /*  YYMAXDEPTH is the maximum size the stacks can grow to
1193     (effective only if the built-in stack extension method is used).  */
1194
1195 #if YYMAXDEPTH == 0
1196 #undef YYMAXDEPTH
1197 #endif
1198
1199 #ifndef YYMAXDEPTH
1200 #define YYMAXDEPTH 10000
1201 #endif
1202 \f
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.  */
1207
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++ */
1211 #ifndef __cplusplus
1212
1213 /* This is the most reliable way to avoid incompatibilities
1214    in available built-in functions on various systems.  */
1215 static void
1216 __yy_memcpy (to, from, count)
1217      char *to;
1218      char *from;
1219      unsigned int count;
1220 {
1221   register char *f = from;
1222   register char *t = to;
1223   register int i = count;
1224
1225   while (i-- > 0)
1226     *t++ = *f++;
1227 }
1228
1229 #else /* __cplusplus */
1230
1231 /* This is the most reliable way to avoid incompatibilities
1232    in available built-in functions on various systems.  */
1233 static void
1234 __yy_memcpy (char *to, char *from, unsigned int count)
1235 {
1236   register char *t = to;
1237   register char *f = from;
1238   register int i = count;
1239
1240   while (i-- > 0)
1241     *t++ = *f++;
1242 }
1243
1244 #endif
1245 #endif
1246 \f
1247 #line 217 "/usr/lib/bison.simple"
1248
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.  */
1254
1255 #ifdef YYPARSE_PARAM
1256 #ifdef __cplusplus
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 */
1267
1268 /* Prevent warning if -Wstrict-prototypes.  */
1269 #ifdef __GNUC__
1270 #ifdef YYPARSE_PARAM
1271 int yyparse (void *);
1272 #else
1273 int yyparse (void);
1274 #endif
1275 #endif
1276
1277 int
1278 yyparse(YYPARSE_PARAM_ARG)
1279      YYPARSE_PARAM_DECL
1280 {
1281   register int yystate;
1282   register int yyn;
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 */
1287
1288   short yyssa[YYINITDEPTH];     /*  the state stack                     */
1289   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
1290
1291   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
1292   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
1293
1294 #ifdef YYLSP_NEEDED
1295   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
1296   YYLTYPE *yyls = yylsa;
1297   YYLTYPE *yylsp;
1298
1299 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
1300 #else
1301 #define YYPOPSTACK   (yyvsp--, yyssp--)
1302 #endif
1303
1304   int yystacksize = YYINITDEPTH;
1305   int yyfree_stacks = 0;
1306
1307 #ifdef YYPURE
1308   int yychar;
1309   YYSTYPE yylval;
1310   int yynerrs;
1311 #ifdef YYLSP_NEEDED
1312   YYLTYPE yylloc;
1313 #endif
1314 #endif
1315
1316   YYSTYPE yyval;                /*  the variable used to return         */
1317                                 /*  semantic values from the action     */
1318                                 /*  routines                            */
1319
1320   int yylen;
1321
1322 #if YYDEBUG != 0
1323   if (yydebug)
1324     fprintf(stderr, "Starting parse\n");
1325 #endif
1326
1327   yystate = 0;
1328   yyerrstatus = 0;
1329   yynerrs = 0;
1330   yychar = YYEMPTY;             /* Cause a token to be read.  */
1331
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.  */
1336
1337   yyssp = yyss - 1;
1338   yyvsp = yyvs;
1339 #ifdef YYLSP_NEEDED
1340   yylsp = yyls;
1341 #endif
1342
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.  */
1346 yynewstate:
1347
1348   *++yyssp = yystate;
1349
1350   if (yyssp >= yyss + yystacksize - 1)
1351     {
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;
1356 #ifdef YYLSP_NEEDED
1357       YYLTYPE *yyls1 = yyls;
1358 #endif
1359
1360       /* Get the current used size of the three stacks, in elements.  */
1361       int size = yyssp - yyss + 1;
1362
1363 #ifdef yyoverflow
1364       /* Each stack pointer address is followed by the size of
1365          the data in use in that stack, in bytes.  */
1366 #ifdef YYLSP_NEEDED
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),
1373                  &yystacksize);
1374 #else
1375       yyoverflow("parser stack overflow",
1376                  &yyss1, size * sizeof (*yyssp),
1377                  &yyvs1, size * sizeof (*yyvsp),
1378                  &yystacksize);
1379 #endif
1380
1381       yyss = yyss1; yyvs = yyvs1;
1382 #ifdef YYLSP_NEEDED
1383       yyls = yyls1;
1384 #endif
1385 #else /* no yyoverflow */
1386       /* Extend the stack our own way.  */
1387       if (yystacksize >= YYMAXDEPTH)
1388         {
1389           yyerror("parser stack overflow");
1390           if (yyfree_stacks)
1391             {
1392               free (yyss);
1393               free (yyvs);
1394 #ifdef YYLSP_NEEDED
1395               free (yyls);
1396 #endif
1397             }
1398           return 2;
1399         }
1400       yystacksize *= 2;
1401       if (yystacksize > YYMAXDEPTH)
1402         yystacksize = YYMAXDEPTH;
1403 #ifndef YYSTACK_USE_ALLOCA
1404       yyfree_stacks = 1;
1405 #endif
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));
1412 #ifdef YYLSP_NEEDED
1413       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1414       __yy_memcpy ((char *)yyls, (char *)yyls1,
1415                    size * (unsigned int) sizeof (*yylsp));
1416 #endif
1417 #endif /* no yyoverflow */
1418
1419       yyssp = yyss + size - 1;
1420       yyvsp = yyvs + size - 1;
1421 #ifdef YYLSP_NEEDED
1422       yylsp = yyls + size - 1;
1423 #endif
1424
1425 #if YYDEBUG != 0
1426       if (yydebug)
1427         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1428 #endif
1429
1430       if (yyssp >= yyss + yystacksize - 1)
1431         YYABORT;
1432     }
1433
1434 #if YYDEBUG != 0
1435   if (yydebug)
1436     fprintf(stderr, "Entering state %d\n", yystate);
1437 #endif
1438
1439   goto yybackup;
1440  yybackup:
1441
1442 /* Do appropriate processing given the current state.  */
1443 /* Read a lookahead token if we need one and don't already have one.  */
1444 /* yyresume: */
1445
1446   /* First try to decide what to do without reference to lookahead token.  */
1447
1448   yyn = yypact[yystate];
1449   if (yyn == YYFLAG)
1450     goto yydefault;
1451
1452   /* Not known => get a lookahead token if don't already have one.  */
1453
1454   /* yychar is either YYEMPTY or YYEOF
1455      or a valid token in external form.  */
1456
1457   if (yychar == YYEMPTY)
1458     {
1459 #if YYDEBUG != 0
1460       if (yydebug)
1461         fprintf(stderr, "Reading a token: ");
1462 #endif
1463       yychar = YYLEX;
1464     }
1465
1466   /* Convert token to internal form (in yychar1) for indexing tables with */
1467
1468   if (yychar <= 0)              /* This means end of input. */
1469     {
1470       yychar1 = 0;
1471       yychar = YYEOF;           /* Don't call YYLEX any more */
1472
1473 #if YYDEBUG != 0
1474       if (yydebug)
1475         fprintf(stderr, "Now at end of input.\n");
1476 #endif
1477     }
1478   else
1479     {
1480       yychar1 = YYTRANSLATE(yychar);
1481
1482 #if YYDEBUG != 0
1483       if (yydebug)
1484         {
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.  */
1488 #ifdef YYPRINT
1489           YYPRINT (stderr, yychar, yylval);
1490 #endif
1491           fprintf (stderr, ")\n");
1492         }
1493 #endif
1494     }
1495
1496   yyn += yychar1;
1497   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1498     goto yydefault;
1499
1500   yyn = yytable[yyn];
1501
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.  */
1508
1509   if (yyn < 0)
1510     {
1511       if (yyn == YYFLAG)
1512         goto yyerrlab;
1513       yyn = -yyn;
1514       goto yyreduce;
1515     }
1516   else if (yyn == 0)
1517     goto yyerrlab;
1518
1519   if (yyn == YYFINAL)
1520     YYACCEPT;
1521
1522   /* Shift the lookahead token.  */
1523
1524 #if YYDEBUG != 0
1525   if (yydebug)
1526     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1527 #endif
1528
1529   /* Discard the token being shifted unless it is eof.  */
1530   if (yychar != YYEOF)
1531     yychar = YYEMPTY;
1532
1533   *++yyvsp = yylval;
1534 #ifdef YYLSP_NEEDED
1535   *++yylsp = yylloc;
1536 #endif
1537
1538   /* count tokens shifted since error; after three, turn off error status.  */
1539   if (yyerrstatus) yyerrstatus--;
1540
1541   yystate = yyn;
1542   goto yynewstate;
1543
1544 /* Do the default action for the current state.  */
1545 yydefault:
1546
1547   yyn = yydefact[yystate];
1548   if (yyn == 0)
1549     goto yyerrlab;
1550
1551 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
1552 yyreduce:
1553   yylen = yyr2[yyn];
1554   if (yylen > 0)
1555     yyval = yyvsp[1-yylen]; /* implement default value of the action */
1556
1557 #if YYDEBUG != 0
1558   if (yydebug)
1559     {
1560       int i;
1561
1562       fprintf (stderr, "Reducing via rule %d (line %d), ",
1563                yyn, yyrline[yyn]);
1564
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]]);
1569     }
1570 #endif
1571
1572
1573   switch (yyn) {
1574
1575 case 1:
1576 #line 591 "parse.y"
1577 { ; ;
1578     break;}
1579 case 2:
1580 #line 592 "parse.y"
1581 { ; ;
1582     break;}
1583 case 3:
1584 #line 593 "parse.y"
1585 { ; ;
1586     break;}
1587 case 4:
1588 #line 594 "parse.y"
1589 { ; ;
1590     break;}
1591 case 5:
1592 #line 597 "parse.y"
1593 {
1594                         Node *node = node_new (CCODE_NODE,
1595                                                "cctype", C_CCODE,
1596                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1597                                                "line_no", ccode_line,
1598                                                NULL);
1599                         nodes = g_list_append(nodes,node);
1600                         g_string_free(yyvsp[0].cbuf,FALSE);
1601                                         ;
1602     break;}
1603 case 6:
1604 #line 606 "parse.y"
1605 {
1606                         Node *node = node_new (CCODE_NODE,
1607                                                "cctype", H_CCODE,
1608                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1609                                                "line_no", ccode_line,
1610                                                NULL);
1611                         nodes = g_list_append(nodes,node);
1612                         g_string_free(yyvsp[0].cbuf,FALSE);
1613                                         ;
1614     break;}
1615 case 7:
1616 #line 615 "parse.y"
1617 {
1618                         Node *node = node_new (CCODE_NODE,
1619                                                "cctype", HT_CCODE,
1620                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1621                                                "line_no", ccode_line,
1622                                                NULL);
1623                         nodes = g_list_append(nodes,node);
1624                         g_string_free(yyvsp[0].cbuf,FALSE);
1625                                         ;
1626     break;}
1627 case 8:
1628 #line 624 "parse.y"
1629 {
1630                         Node *node = node_new (CCODE_NODE,
1631                                                "cctype", PH_CCODE,
1632                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1633                                                "line_no", ccode_line,
1634                                                NULL);
1635                         nodes = g_list_append(nodes,node);
1636                         g_string_free(yyvsp[0].cbuf,FALSE);
1637                                         ;
1638     break;}
1639 case 9:
1640 #line 633 "parse.y"
1641 {
1642                         Node *node = node_new (CCODE_NODE,
1643                                                "cctype", A_CCODE,
1644                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1645                                                "line_no", ccode_line,
1646                                                NULL);
1647                         nodes = g_list_append(nodes,node);
1648                         g_string_free(yyvsp[0].cbuf,FALSE);
1649                                         ;
1650     break;}
1651 case 10:
1652 #line 642 "parse.y"
1653 {
1654                         Node *node = node_new (CCODE_NODE,
1655                                                "cctype", AT_CCODE,
1656                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
1657                                                "line_no", ccode_line,
1658                                                NULL);
1659                         nodes = g_list_append(nodes,node);
1660                         g_string_free(yyvsp[0].cbuf,FALSE);
1661                                         ;
1662     break;}
1663 case 11:
1664 #line 653 "parse.y"
1665 { ; ;
1666     break;}
1667 case 12:
1668 #line 654 "parse.y"
1669 { ; ;
1670     break;}
1671 case 13:
1672 #line 657 "parse.y"
1673 {
1674                         ((Class *)class)->nodes = class_nodes;
1675                         class_nodes = NULL;
1676                         nodes = g_list_append(nodes,class);
1677                                                 ;
1678     break;}
1679 case 14:
1680 #line 662 "parse.y"
1681 {
1682                         ((Class *)class)->nodes = NULL;
1683                         class_nodes = NULL;
1684                         nodes = g_list_append(nodes,class);
1685                                                 ;
1686     break;}
1687 case 15:
1688 #line 669 "parse.y"
1689 {
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,
1695                                           NULL);
1696                                                 ;
1697     break;}
1698 case 17:
1699 #line 680 "parse.y"
1700 {
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);
1707                         } else {
1708                                 yyerror(_("parse error"));
1709                                 YYERROR;
1710                         }
1711                 ;
1712     break;}
1713 case 18:
1714 #line 692 "parse.y"
1715 {
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);
1720                                 else
1721                                         chunk_size = NULL;
1722                         } else {
1723                                 yyerror(_("parse error"));
1724                                 YYERROR;
1725                         }
1726                 ;
1727     break;}
1728 case 19:
1729 #line 706 "parse.y"
1730 { ; ;
1731     break;}
1732 case 20:
1733 #line 707 "parse.y"
1734 { ; ;
1735     break;}
1736 case 21:
1737 #line 710 "parse.y"
1738 { ; ;
1739     break;}
1740 case 22:
1741 #line 711 "parse.y"
1742 {
1743                         if (strcmp (yyvsp[-1].id, "BonoboX") != 0) {
1744                                 g_free(yyvsp[-1].id);
1745                                 yyerror(_("parse error"));
1746                                 YYERROR;
1747                         }
1748                         last_added_method->bonobo_x_func = TRUE;
1749                                                 ;
1750     break;}
1751 case 23:
1752 #line 719 "parse.y"
1753 { ; ;
1754     break;}
1755 case 24:
1756 #line 720 "parse.y"
1757 { ; ;
1758     break;}
1759 case 25:
1760 #line 721 "parse.y"
1761 { ; ;
1762     break;}
1763 case 26:
1764 #line 722 "parse.y"
1765 { ; ;
1766     break;}
1767 case 27:
1768 #line 725 "parse.y"
1769 { the_scope = PUBLIC_SCOPE; ;
1770     break;}
1771 case 28:
1772 #line 726 "parse.y"
1773 { the_scope = PRIVATE_SCOPE; ;
1774     break;}
1775 case 29:
1776 #line 727 "parse.y"
1777 { the_scope = PROTECTED_SCOPE; ;
1778     break;}
1779 case 30:
1780 #line 728 "parse.y"
1781 { the_scope = CLASS_SCOPE; ;
1782     break;}
1783 case 31:
1784 #line 731 "parse.y"
1785 {
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;
1798                         } else {
1799                                 g_free (yyvsp[-1].id);
1800                                 g_free (yyvsp[0].id);
1801                                 yyerror (_("parse error"));
1802                                 YYERROR;
1803                         }
1804                                 ;
1805     break;}
1806 case 32:
1807 #line 751 "parse.y"
1808 {
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;
1823                         } else {
1824                                 g_free (yyvsp[-2].id);
1825                                 g_string_free (yyvsp[0].cbuf, TRUE);
1826                                 yyerror (_("parse error"));
1827                                 YYERROR;
1828                         }
1829                                         ;
1830     break;}
1831 case 33:
1832 #line 775 "parse.y"
1833 {
1834                         initializer = yyvsp[0].id;
1835                         initializer_line = ccode_line;
1836                                 ;
1837     break;}
1838 case 34:
1839 #line 779 "parse.y"
1840 {
1841                         initializer = (yyvsp[0].cbuf)->str;
1842                         initializer_line = ccode_line;
1843                         g_string_free(yyvsp[0].cbuf, FALSE);
1844                                 ;
1845     break;}
1846 case 35:
1847 #line 787 "parse.y"
1848 { ; ;
1849     break;}
1850 case 36:
1851 #line 788 "parse.y"
1852 { ; ;
1853     break;}
1854 case 37:
1855 #line 789 "parse.y"
1856 { destructor = NULL; ;
1857     break;}
1858 case 38:
1859 #line 790 "parse.y"
1860 { initializer = NULL; ;
1861     break;}
1862 case 39:
1863 #line 791 "parse.y"
1864 {
1865                         destructor = NULL;
1866                         initializer = NULL;
1867                                         ;
1868     break;}
1869 case 40:
1870 #line 797 "parse.y"
1871 {
1872                         push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
1873                                                 ;
1874     break;}
1875 case 41:
1876 #line 800 "parse.y"
1877 {
1878                         push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
1879                                                 ;
1880     break;}
1881 case 42:
1882 #line 805 "parse.y"
1883 {
1884                         Node *node = NULL;
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,
1900                                                  NULL);
1901
1902                                 class_nodes = g_list_append(class_nodes,node);
1903
1904                                 g_string_free (yyvsp[-4].cbuf, FALSE);
1905                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1906
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,
1922                                                  NULL);
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);
1926                         } else {
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"));
1936                                 YYERROR;
1937                         }
1938
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,
1944                                                   arg->atype,
1945                                                   arg->gtktype,
1946                                                   arg->line_no);
1947                                 g_free (yyvsp[-7].id);
1948                         } 
1949
1950                                                 ;
1951     break;}
1952 case 43:
1953 #line 873 "parse.y"
1954 {
1955                         Node *node = NULL;
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,
1967                                                  NULL);
1968
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,
1982                                                  NULL);
1983
1984                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1985                                 class_nodes = g_list_append (class_nodes, node);
1986                         } else {
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"));
1994                                 YYERROR;
1995                         }
1996
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,
2002                                                   arg->atype,
2003                                                   arg->gtktype,
2004                                                   arg->line_no);
2005                                 g_free (yyvsp[-4].id);
2006                         } 
2007                                                 ;
2008     break;}
2009 case 44:
2010 #line 927 "parse.y"
2011 {
2012                         Node *node;
2013                         char *get, *set = NULL;
2014                         Variable *var;
2015                         Type *type;
2016                         char *root;
2017                         
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"));
2027                                 YYERROR;
2028                         }
2029
2030                         type = pop_type();
2031
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)";
2037                                 if(no_self_alias)
2038                                         error_print(GOB_ERROR, yyvsp[-5].line,
2039                                                     _("Self aliases needed when autolinking to a classwide member"));
2040                         } else
2041                                 root = "self";
2042
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);",
2049                                                       root, yyvsp[-2].id,
2050                                                       root, yyvsp[-2].id);
2051                         } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2052                                 set = g_strdup_printf(
2053                                   "if (ARG != NULL) "
2054                                    "g_object_ref (G_OBJECT (ARG)); "
2055                                   "if (%s->%s != NULL) "
2056                                    "g_object_unref (G_OBJECT (%s->%s)); "
2057                                   "%s->%s = ARG;",
2058                                   root, yyvsp[-2].id,
2059                                   root, yyvsp[-2].id,
2060                                   root, yyvsp[-2].id);
2061                         } else {
2062                                 g_assert_not_reached();
2063                         }
2064
2065                         get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2066   
2067                         g_free (yyvsp[0].id);
2068
2069                         if (type == NULL)
2070                                 type = (Type *)node_copy ((Node *)var->vtype);
2071
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,
2077                                          "get:steal", get,
2078                                          "get_line", yyvsp[-5].line,
2079                                          "set:steal", set,
2080                                          "set_line", yyvsp[-5].line,
2081                                          "line_no", yyvsp[-5].line,
2082                                          NULL);
2083
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,
2089                                                   arg->atype,
2090                                                   arg->gtktype,
2091                                                   arg->line_no);
2092                                 g_free (yyvsp[-1].id);
2093                         } 
2094
2095                         class_nodes = g_list_append (class_nodes, node);
2096                                                 ;
2097     break;}
2098 case 45:
2099 #line 1015 "parse.y"
2100 {
2101                         if (strcmp (yyvsp[-1].id, "export")!=0) {
2102                                 g_free (yyvsp[-1].id); 
2103                                 yyerror (_("parse error"));
2104                                 YYERROR;
2105                         }
2106                         yyval.id = yyvsp[-1].id;
2107                                                 ;
2108     break;}
2109 case 46:
2110 #line 1023 "parse.y"
2111 {
2112                         yyval.id = NULL;
2113                                                 ;
2114     break;}
2115 case 47:
2116 #line 1028 "parse.y"
2117 {
2118                         ensure_property ();
2119                         node_set ((Node *)property,
2120                                   "line_no", yyvsp[-10].line,
2121                                   "gtktype:steal", debool (yyvsp[-9].id),
2122                                   "name:steal", yyvsp[-8].id,
2123                                   NULL);
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,
2131                                           NULL);
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,
2143                                           NULL);
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);
2148                         } else {
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);
2154                                 property = NULL;
2155                                 yyerror (_("parse error"));
2156                                 YYERROR;
2157                         }
2158                         property_link_and_export ((Node *)property);
2159                         if (property != NULL) {
2160                                 class_nodes = g_list_append (class_nodes,
2161                                                              property);
2162                                 property = NULL;
2163                         }
2164                 ;
2165     break;}
2166 case 48:
2167 #line 1076 "parse.y"
2168 {
2169                         ensure_property ();
2170                         node_set ((Node *)property,
2171                                   "line_no", yyvsp[-7].line,
2172                                   "gtktype:steal", debool (yyvsp[-6].id),
2173                                   "name:steal", yyvsp[-5].id,
2174                                   NULL);
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,
2179                                           NULL);
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,
2186                                           NULL);
2187                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2188                                 g_free (yyvsp[-3].id); 
2189                         } else {
2190                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2191                                 g_free (yyvsp[-3].id); 
2192                                 node_free ((Node *)property);
2193                                 property = NULL;
2194                                 yyerror (_("parse error"));
2195                                 YYERROR;
2196                         }
2197                         property_link_and_export ((Node *)property);
2198                         if (property != NULL) {
2199                                 class_nodes = g_list_append (class_nodes,
2200                                                              property);
2201                                 property = NULL;
2202                         }
2203                 ;
2204     break;}
2205 case 49:
2206 #line 1112 "parse.y"
2207 {
2208                         ensure_property ();
2209                         node_set ((Node *)property,
2210                                   "line_no", yyvsp[-4].line,
2211                                   "gtktype:steal", debool (yyvsp[-3].id),
2212                                   "name:steal", yyvsp[-2].id,
2213                                   NULL);
2214                         property_link_and_export ((Node *)property);
2215                         if (property != NULL) {
2216                                 class_nodes = g_list_append (class_nodes,
2217                                                              property);
2218                                 property = NULL;
2219                         }
2220                 ;
2221     break;}
2222 case 50:
2223 #line 1128 "parse.y"
2224 { ; ;
2225     break;}
2226 case 51:
2227 #line 1129 "parse.y"
2228 { ; ;
2229     break;}
2230 case 52:
2231 #line 1132 "parse.y"
2232 { ; ;
2233     break;}
2234 case 53:
2235 #line 1133 "parse.y"
2236 { ; ;
2237     break;}
2238 case 54:
2239 #line 1136 "parse.y"
2240 { yyval.id = yyvsp[0].id; ;
2241     break;}
2242 case 55:
2243 #line 1137 "parse.y"
2244 {
2245                         if (strcmp (yyvsp[-3].id, "_") != 0) {
2246                                 g_free (yyvsp[-3].id);
2247                                 yyerror(_("parse error"));
2248                                 YYERROR;
2249                         }
2250                         g_free (yyvsp[-3].id);
2251                         yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2252                         g_free (yyvsp[-1].id);
2253                 ;
2254     break;}
2255 case 56:
2256 #line 1149 "parse.y"
2257 { yyval.id = yyvsp[0].id; ;
2258     break;}
2259 case 57:
2260 #line 1150 "parse.y"
2261 { yyval.id = yyvsp[0].id; ;
2262     break;}
2263 case 58:
2264 #line 1153 "parse.y"
2265 {
2266                 ensure_property ();
2267                 node_set ((Node *)property,
2268                           "nick:steal", yyvsp[0].id,
2269                           NULL);
2270                   ;
2271     break;}
2272 case 59:
2273 #line 1159 "parse.y"
2274 {
2275                 ensure_property ();
2276                 node_set ((Node *)property,
2277                           "blurb:steal", yyvsp[0].id,
2278                           NULL);
2279                   ;
2280     break;}
2281 case 60:
2282 #line 1165 "parse.y"
2283 {
2284                 ensure_property ();
2285                 node_set ((Node *)property,
2286                           "maximum:steal", yyvsp[0].id,
2287                           NULL);
2288                   ;
2289     break;}
2290 case 61:
2291 #line 1171 "parse.y"
2292 {
2293                 ensure_property ();
2294                 node_set ((Node *)property,
2295                           "minimum:steal", yyvsp[0].id,
2296                           NULL);
2297                   ;
2298     break;}
2299 case 62:
2300 #line 1177 "parse.y"
2301 {
2302                 ensure_property ();
2303                 node_set ((Node *)property,
2304                           "default_value:steal", yyvsp[0].id,
2305                           NULL);
2306                   ;
2307     break;}
2308 case 63:
2309 #line 1183 "parse.y"
2310 {
2311                 ensure_property ();
2312                 node_set ((Node *)property,
2313                           "flags:steal", yyvsp[0].list,
2314                           NULL);
2315                   ;
2316     break;}
2317 case 64:
2318 #line 1189 "parse.y"
2319 {
2320                 Type *type = pop_type ();
2321                 ensure_property ();
2322                 node_set ((Node *)property,
2323                           "ptype:steal", type,
2324                           NULL);
2325                   ;
2326     break;}
2327 case 65:
2328 #line 1196 "parse.y"
2329 {
2330                 ensure_property ();
2331                 node_set ((Node *)property,
2332                           "extra_gtktype:steal", yyvsp[0].id,
2333                           NULL);
2334                   ;
2335     break;}
2336 case 66:
2337 #line 1202 "parse.y"
2338 {
2339                 ensure_property ();
2340                 node_set ((Node *)property,
2341                           "extra_gtktype:steal", yyvsp[0].id,
2342                           NULL);
2343                   ;
2344     break;}
2345 case 67:
2346 #line 1208 "parse.y"
2347 {
2348                 ensure_property ();
2349                 node_set ((Node *)property,
2350                           "extra_gtktype:steal", yyvsp[0].id,
2351                           NULL);
2352                   ;
2353     break;}
2354 case 68:
2355 #line 1214 "parse.y"
2356 {
2357                 ensure_property ();
2358                 node_set ((Node *)property,
2359                           "extra_gtktype:steal", yyvsp[0].id,
2360                           NULL);
2361                   ;
2362     break;}
2363 case 69:
2364 #line 1220 "parse.y"
2365 {
2366                 ensure_property ();
2367                 node_set ((Node *)property,
2368                           "extra_gtktype:steal", yyvsp[0].id,
2369                           NULL);
2370                   ;
2371     break;}
2372 case 70:
2373 #line 1226 "parse.y"
2374 {
2375                 ensure_property ();
2376                 if (strcmp (yyvsp[0].id, "link") == 0) {
2377                         g_free(yyvsp[0].id);
2378                         node_set ((Node *)property,
2379                                   "link", TRUE,
2380                                   NULL);
2381                 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2382                         g_free(yyvsp[0].id);
2383                         node_set ((Node *)property,
2384                                   "export", TRUE,
2385                                   NULL);
2386                 } else {
2387                         g_free(yyvsp[0].id);
2388                         yyerror(_("parse error"));
2389                         YYERROR;
2390                 }
2391                   ;
2392     break;}
2393 case 71:
2394 #line 1246 "parse.y"
2395 {
2396                         if(strcmp(yyvsp[-2].id,"type")!=0) {
2397                                 g_free(yyvsp[-4].id);
2398                                 g_free(yyvsp[-2].id);
2399                                 yyerror(_("parse error"));
2400                                 YYERROR;
2401                         }
2402                         yyval.id = debool (yyvsp[-4].id);
2403                                                 ;
2404     break;}
2405 case 72:
2406 #line 1255 "parse.y"
2407 {
2408                         yyval.id = debool (yyvsp[0].id);
2409                         typestack = g_list_prepend(typestack,NULL);
2410                                                 ;
2411     break;}
2412 case 73:
2413 #line 1261 "parse.y"
2414 { yyval.list = yyvsp[-1].list; ;
2415     break;}
2416 case 74:
2417 #line 1262 "parse.y"
2418 { yyval.list = NULL; ;
2419     break;}
2420 case 75:
2421 #line 1265 "parse.y"
2422 {
2423                         yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2424                                                 ;
2425     break;}
2426 case 76:
2427 #line 1268 "parse.y"
2428 {
2429                         yyval.list = g_list_append(NULL,yyvsp[0].id);
2430                                                 ;
2431     break;}
2432 case 77:
2433 #line 1274 "parse.y"
2434 {
2435                         Node *node = node_new (TYPE_NODE, 
2436                                                "name:steal", yyvsp[-1].id,
2437                                                "pointer:steal", yyvsp[0].id,
2438                                                NULL);
2439                         typestack = g_list_prepend(typestack,node);
2440                                                         ;
2441     break;}
2442 case 78:
2443 #line 1281 "parse.y"
2444 {
2445                         Node *node = node_new (TYPE_NODE, 
2446                                                "name:steal", yyvsp[0].id,
2447                                                NULL);
2448                         typestack = g_list_prepend(typestack,node);
2449                                                         ;
2450     break;}
2451 case 79:
2452 #line 1290 "parse.y"
2453 {
2454                         yyval.id = yyvsp[0].id;
2455                                                         ;
2456     break;}
2457 case 80:
2458 #line 1293 "parse.y"
2459 {
2460                         yyval.id = yyvsp[0].id;
2461                                                         ;
2462     break;}
2463 case 81:
2464 #line 1296 "parse.y"
2465 {
2466                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2467                         g_free(yyvsp[0].id);
2468                                                         ;
2469     break;}
2470 case 82:
2471 #line 1300 "parse.y"
2472 {
2473                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2474                         g_free(yyvsp[-1].id);
2475                                                         ;
2476     break;}
2477 case 83:
2478 #line 1304 "parse.y"
2479 {
2480                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2481                         g_free(yyvsp[0].id);
2482                                                         ;
2483     break;}
2484 case 84:
2485 #line 1308 "parse.y"
2486 {
2487                         yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2488                                              yyvsp[0].id, NULL);
2489                         g_free(yyvsp[0].id);
2490                                                         ;
2491     break;}
2492 case 85:
2493 #line 1313 "parse.y"
2494 {
2495                         yyval.id = g_strconcat(yyvsp[-2].id, " ",
2496                                              yyvsp[-1].id, " const", NULL);
2497                         g_free(yyvsp[-1].id);
2498                                                         ;
2499     break;}
2500 case 86:
2501 #line 1321 "parse.y"
2502 {
2503                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2504                         g_free(yyvsp[0].id);
2505                                                         ;
2506     break;}
2507 case 87:
2508 #line 1325 "parse.y"
2509 {
2510                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2511                         g_free(yyvsp[-1].id);
2512                         g_free(yyvsp[0].id);
2513                                                         ;
2514     break;}
2515 case 88:
2516 #line 1330 "parse.y"
2517 {
2518                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2519                         g_free(yyvsp[0].id);
2520                                                         ;
2521     break;}
2522 case 89:
2523 #line 1334 "parse.y"
2524 {
2525                         yyval.id = yyvsp[0].id;
2526                                                         ;
2527     break;}
2528 case 90:
2529 #line 1337 "parse.y"
2530 {
2531                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2532                         g_free(yyvsp[-1].id);
2533                                                         ;
2534     break;}
2535 case 91:
2536 #line 1341 "parse.y"
2537 {
2538                         yyval.id = g_strdup(yyvsp[0].id);
2539                                                         ;
2540     break;}
2541 case 92:
2542 #line 1344 "parse.y"
2543 {
2544                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2545                                                         ;
2546     break;}
2547 case 93:
2548 #line 1349 "parse.y"
2549 { yyval.id = "void"; ;
2550     break;}
2551 case 94:
2552 #line 1350 "parse.y"
2553 { yyval.id = "char"; ;
2554     break;}
2555 case 95:
2556 #line 1351 "parse.y"
2557 { yyval.id = "short"; ;
2558     break;}
2559 case 96:
2560 #line 1352 "parse.y"
2561 { yyval.id = "int"; ;
2562     break;}
2563 case 97:
2564 #line 1353 "parse.y"
2565 { yyval.id = "long"; ;
2566     break;}
2567 case 98:
2568 #line 1354 "parse.y"
2569 { yyval.id = "float"; ;
2570     break;}
2571 case 99:
2572 #line 1355 "parse.y"
2573 { yyval.id = "double"; ;
2574     break;}
2575 case 100:
2576 #line 1356 "parse.y"
2577 { yyval.id = "signed"; ;
2578     break;}
2579 case 101:
2580 #line 1357 "parse.y"
2581 { yyval.id = "unsigned"; ;
2582     break;}
2583 case 102:
2584 #line 1360 "parse.y"
2585 { yyval.id = "struct"; ;
2586     break;}
2587 case 103:
2588 #line 1361 "parse.y"
2589 { yyval.id = "union"; ;
2590     break;}
2591 case 104:
2592 #line 1362 "parse.y"
2593 { yyval.id = "enum"; ;
2594     break;}
2595 case 105:
2596 #line 1365 "parse.y"
2597 { yyval.id = g_strdup("*"); ;
2598     break;}
2599 case 106:
2600 #line 1366 "parse.y"
2601 { yyval.id = g_strdup("* const"); ;
2602     break;}
2603 case 107:
2604 #line 1367 "parse.y"
2605 {
2606                                 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2607                                 g_free(yyvsp[0].id);
2608                                         ;
2609     break;}
2610 case 108:
2611 #line 1371 "parse.y"
2612 {
2613                                 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2614                                 g_free(yyvsp[0].id);
2615                                         ;
2616     break;}
2617 case 109:
2618 #line 1378 "parse.y"
2619 {
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;
2624                         else {
2625                                 yyerror(_("signal must be 'first' or 'last'"));
2626                                 g_free(yyvsp[-1].id);
2627                                 YYERROR;
2628                         }
2629                         g_free(yyvsp[-1].id);
2630                                         ;
2631     break;}
2632 case 110:
2633 #line 1390 "parse.y"
2634 {
2635                         yyval.sigtype = SIGNAL_LAST_METHOD;
2636                                         ;
2637     break;}
2638 case 111:
2639 #line 1396 "parse.y"
2640 {
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;
2645                         else {
2646                                 yyerror(_("signal must be 'first' or 'last'"));
2647                                 g_free(yyvsp[-1].id);
2648                                 YYERROR;
2649                         }
2650                         g_free(yyvsp[-1].id);
2651                                         ;
2652     break;}
2653 case 112:
2654 #line 1408 "parse.y"
2655 {
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;
2660                         else {
2661                                 yyerror(_("signal must be 'first' or 'last'"));
2662                                 g_free(yyvsp[-2].id);
2663                                 YYERROR;
2664                         }
2665                         g_free(yyvsp[-2].id);
2666                                         ;
2667     break;}
2668 case 113:
2669 #line 1420 "parse.y"
2670 {
2671                         yyval.sigtype = SIGNAL_LAST_METHOD;
2672                                         ;
2673     break;}
2674 case 114:
2675 #line 1423 "parse.y"
2676 {
2677                         /* the_scope was default thus public */
2678                         the_scope = PUBLIC_SCOPE;
2679                                         ;
2680     break;}
2681 case 115:
2682 #line 1429 "parse.y"
2683 {
2684                         gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
2685                                                 ;
2686     break;}
2687 case 116:
2688 #line 1434 "parse.y"
2689 {
2690                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2691                                                 ;
2692     break;}
2693 case 117:
2694 #line 1437 "parse.y"
2695
2696                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
2697                                                 ;
2698     break;}
2699 case 118:
2700 #line 1442 "parse.y"
2701 { yyval.cbuf = yyvsp[0].cbuf; ;
2702     break;}
2703 case 119:
2704 #line 1443 "parse.y"
2705 { yyval.cbuf = NULL; ;
2706     break;}
2707 case 120:
2708 #line 1447 "parse.y"
2709 {
2710                         if(!has_self) {
2711                                 yyerror(_("signal without 'self' as "
2712                                           "first parameter"));
2713                                 free_all_global_state();
2714                                 YYERROR;
2715                         }
2716                         if(the_scope == CLASS_SCOPE) {
2717                                 yyerror(_("a method cannot be of class scope"));
2718                                 free_all_global_state();
2719                                 YYERROR;
2720                         }
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);
2724                                                                         ;
2725     break;}
2726 case 121:
2727 #line 1463 "parse.y"
2728 {
2729                         if(!has_self) {
2730                                 yyerror(_("signal without 'self' as "
2731                                           "first parameter"));
2732                                 free_all_global_state();
2733                                 YYERROR;
2734                         }
2735                         if(the_scope == CLASS_SCOPE) {
2736                                 yyerror(_("a method cannot be of class scope"));
2737                                 free_all_global_state();
2738                                 YYERROR;
2739                         }
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);
2743                                                                         ;
2744     break;}
2745 case 122:
2746 #line 1479 "parse.y"
2747 {
2748                         if(!has_self) {
2749                                 yyerror(_("virtual method without 'self' as "
2750                                           "first parameter"));
2751                                 free_all_global_state();
2752                                 YYERROR;
2753                         }
2754                         if(the_scope == CLASS_SCOPE) {
2755                                 yyerror(_("a method cannot be of class scope"));
2756                                 free_all_global_state();
2757                                 YYERROR;
2758                         }
2759                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2760                                       yyvsp[0].cbuf, yyvsp[-8].line,
2761                                       ccode_line, vararg, NULL);
2762                                                                         ;
2763     break;}
2764 case 123:
2765 #line 1495 "parse.y"
2766 {
2767                         if(!has_self) {
2768                                 yyerror(_("virtual method without 'self' as "
2769                                           "first parameter"));
2770                                 free_all_global_state();
2771                                 YYERROR;
2772                         }
2773                         if(the_scope == CLASS_SCOPE) {
2774                                 yyerror(_("a method cannot be of class scope"));
2775                                 free_all_global_state();
2776                                 YYERROR;
2777                         }
2778                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2779                                       yyvsp[0].cbuf, yyvsp[-7].line,
2780                                       ccode_line, vararg, NULL);
2781                                                                         ;
2782     break;}
2783 case 124:
2784 #line 1511 "parse.y"
2785 {
2786                         if(!has_self) {
2787                                 yyerror(_("virtual method without 'self' as "
2788                                           "first parameter"));
2789                                 free_all_global_state();
2790                                 YYERROR;
2791                         }
2792                         push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2793                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2794                                       ccode_line, vararg, NULL);
2795                                                                         ;
2796     break;}
2797 case 125:
2798 #line 1522 "parse.y"
2799 {
2800                         push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
2801                                       yyvsp[-5].id, yyvsp[0].cbuf,
2802                                       yyvsp[-10].line, ccode_line,
2803                                       vararg, NULL);
2804                                                                         ;
2805     break;}
2806 case 126:
2807 #line 1528 "parse.y"
2808 {
2809                         if(the_scope == CLASS_SCOPE) {
2810                                 yyerror(_("a method cannot be of class scope"));
2811                                 free_all_global_state();
2812                                 YYERROR;
2813                         }
2814                         push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
2815                                       yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
2816                                       vararg, NULL);
2817                                                                 ;
2818     break;}
2819 case 127:
2820 #line 1538 "parse.y"
2821 {
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);
2832                         } else {
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 "
2838                                           "class_init)"));
2839                                 YYERROR;
2840                         }
2841                                                 ;
2842     break;}
2843 case 128:
2844 #line 1561 "parse.y"
2845 {
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"));
2852                                 YYERROR;
2853                         }
2854                         g_free(yyvsp[-1].id);
2855                                         ;
2856     break;}
2857 case 129:
2858 #line 1572 "parse.y"
2859 {
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"));
2866                                 YYERROR;
2867                         }
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"));
2873                                 YYERROR;
2874                         }
2875                         g_free(yyvsp[-3].id);
2876                         g_free(yyvsp[-1].id);
2877                                                 ;
2878     break;}
2879 case 130:
2880 #line 1591 "parse.y"
2881 {
2882                         g_free(onerror); onerror = NULL;
2883                         g_free(defreturn); defreturn = NULL;
2884                                         ;
2885     break;}
2886 case 131:
2887 #line 1597 "parse.y"
2888 { yyval.id = yyvsp[0].id; ;
2889     break;}
2890 case 132:
2891 #line 1598 "parse.y"
2892 {
2893                         yyval.id = (yyvsp[1].cbuf)->str;
2894                         g_string_free(yyvsp[1].cbuf, FALSE);
2895                                         ;
2896     break;}
2897 case 133:
2898 #line 1604 "parse.y"
2899 { vararg = FALSE; has_self = FALSE; ;
2900     break;}
2901 case 134:
2902 #line 1605 "parse.y"
2903 {
2904                         vararg = FALSE;
2905                         has_self = TRUE;
2906                         if(strcmp(yyvsp[0].id,"self")==0)
2907                                 push_self(yyvsp[0].id, FALSE);
2908                         else {
2909                                 g_free(yyvsp[0].id);
2910                                 yyerror(_("parse error"));
2911                                 YYERROR;
2912                         }
2913                                         ;
2914     break;}
2915 case 135:
2916 #line 1616 "parse.y"
2917 {
2918                         vararg = FALSE;
2919                         has_self = TRUE;
2920                         if(strcmp(yyvsp[-1].id,"self")==0)
2921                                 push_self(yyvsp[-1].id, TRUE);
2922                         else {
2923                                 g_free(yyvsp[-1].id);
2924                                 yyerror(_("parse error"));
2925                                 YYERROR;
2926                         }
2927                                         ;
2928     break;}
2929 case 136:
2930 #line 1627 "parse.y"
2931 {
2932                         vararg = FALSE;
2933                         has_self = TRUE;
2934                         if(strcmp(yyvsp[0].id,"self")==0)
2935                                 push_self(yyvsp[0].id, TRUE);
2936                         else {
2937                                 g_free(yyvsp[0].id);
2938                                 yyerror(_("parse error"));
2939                                 YYERROR;
2940                         }
2941                                         ;
2942     break;}
2943 case 137:
2944 #line 1638 "parse.y"
2945 {
2946                         has_self = TRUE;
2947                         if(strcmp(yyvsp[-2].id,"self")==0)
2948                                 push_self(yyvsp[-2].id, FALSE);
2949                         else {
2950                                 g_free(yyvsp[-2].id);
2951                                 yyerror(_("parse error"));
2952                                 YYERROR;
2953                         }
2954                                         ;
2955     break;}
2956 case 138:
2957 #line 1648 "parse.y"
2958 {
2959                         has_self = TRUE;
2960                         if(strcmp(yyvsp[-3].id,"self")==0)
2961                                 push_self(yyvsp[-3].id, TRUE);
2962                         else {
2963                                 g_free(yyvsp[-3].id);
2964                                 yyerror(_("parse error"));
2965                                 YYERROR;
2966                         }
2967                                         ;
2968     break;}
2969 case 139:
2970 #line 1658 "parse.y"
2971 {
2972                         has_self = TRUE;
2973                         if(strcmp(yyvsp[-2].id,"self")==0)
2974                                 push_self(yyvsp[-2].id, TRUE);
2975                         else {
2976                                 g_free(yyvsp[-2].id);
2977                                 yyerror(_("parse error"));
2978                                 YYERROR;
2979                         }
2980                                         ;
2981     break;}
2982 case 140:
2983 #line 1668 "parse.y"
2984 { has_self = FALSE; ;
2985     break;}
2986 case 141:
2987 #line 1671 "parse.y"
2988 { vararg = TRUE; ;
2989     break;}
2990 case 142:
2991 #line 1672 "parse.y"
2992 { vararg = FALSE; ;
2993     break;}
2994 case 143:
2995 #line 1675 "parse.y"
2996 { ; ;
2997     break;}
2998 case 144:
2999 #line 1676 "parse.y"
3000 { ; ;
3001     break;}
3002 case 145:
3003 #line 1679 "parse.y"
3004 {
3005                         push_funcarg(yyvsp[0].id,NULL);
3006                                                                 ;
3007     break;}
3008 case 146:
3009 #line 1682 "parse.y"
3010 {
3011                         push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3012                                                                 ;
3013     break;}
3014 case 147:
3015 #line 1685 "parse.y"
3016 {
3017                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3018                                 yyerror(_("parse error"));
3019                                 YYERROR;
3020                         }
3021                         g_free(yyvsp[-2].id);
3022                         push_funcarg(yyvsp[-4].id,NULL);
3023                                                                 ;
3024     break;}
3025 case 148:
3026 #line 1693 "parse.y"
3027 {
3028                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3029                                 yyerror(_("parse error"));
3030                                 YYERROR;
3031                         }
3032                         g_free(yyvsp[-2].id);
3033                         push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3034                                                                 ;
3035     break;}
3036 case 149:
3037 #line 1703 "parse.y"
3038 { ; ;
3039     break;}
3040 case 150:
3041 #line 1704 "parse.y"
3042 { ; ;
3043     break;}
3044 case 151:
3045 #line 1707 "parse.y"
3046 {
3047                         if(strcmp(yyvsp[0].id,"type")==0) {
3048                                 Node *node = node_new (CHECK_NODE,
3049                                                        "chtype", TYPE_CHECK,
3050                                                        NULL);
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,
3055                                                        NULL);
3056                                 checks = g_list_append(checks,node);
3057                         } else {
3058                                 yyerror(_("parse error"));
3059                                 YYERROR;
3060                         }
3061                         g_free(yyvsp[0].id);
3062                                         ;
3063     break;}
3064 case 152:
3065 #line 1724 "parse.y"
3066 {
3067                         Node *node = node_new (CHECK_NODE,
3068                                                "chtype", GT_CHECK,
3069                                                "number:steal", yyvsp[0].id,
3070                                                NULL);
3071                         checks = g_list_append(checks,node);
3072                                         ;
3073     break;}
3074 case 153:
3075 #line 1731 "parse.y"
3076 {
3077                         Node *node = node_new (CHECK_NODE,
3078                                                "chtype", LT_CHECK,
3079                                                "number:steal", yyvsp[0].id,
3080                                                NULL);
3081                         checks = g_list_append(checks,node);
3082                                         ;
3083     break;}
3084 case 154:
3085 #line 1738 "parse.y"
3086 {
3087                         Node *node = node_new (CHECK_NODE,
3088                                                "chtype", GE_CHECK,
3089                                                "number:steal", yyvsp[0].id,
3090                                                NULL);
3091                         checks = g_list_append(checks,node);
3092                                         ;
3093     break;}
3094 case 155:
3095 #line 1745 "parse.y"
3096 {
3097                         Node *node = node_new (CHECK_NODE,
3098                                                "chtype", LE_CHECK,
3099                                                "number:steal", yyvsp[0].id,
3100                                                NULL);
3101                         checks = g_list_append(checks,node);
3102                                         ;
3103     break;}
3104 case 156:
3105 #line 1752 "parse.y"
3106 {
3107                         Node *node = node_new (CHECK_NODE,
3108                                                "chtype", EQ_CHECK,
3109                                                "number:steal", yyvsp[0].id,
3110                                                NULL);
3111                         checks = g_list_append(checks,node);
3112                                         ;
3113     break;}
3114 case 157:
3115 #line 1759 "parse.y"
3116 {
3117                         Node *node = node_new (CHECK_NODE,
3118                                                "chtype", NE_CHECK,
3119                                                "number:steal", yyvsp[0].id,
3120                                                NULL);
3121                         checks = g_list_append(checks,node);
3122                                         ;
3123     break;}
3124 case 158:
3125 #line 1768 "parse.y"
3126 { yyval.id = yyvsp[0].id; ;
3127     break;}
3128 case 159:
3129 #line 1769 "parse.y"
3130 {
3131                         yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3132                         g_free(yyvsp[0].id);
3133                                         ;
3134     break;}
3135 case 160:
3136 #line 1773 "parse.y"
3137 { yyval.id = yyvsp[0].id; ;
3138     break;}
3139 case 161:
3140 #line 1774 "parse.y"
3141 { yyval.id = yyvsp[0].id; ;
3142     break;}
3143 }
3144    /* the action file gets copied in in place of this dollarsign */
3145 #line 543 "/usr/lib/bison.simple"
3146 \f
3147   yyvsp -= yylen;
3148   yyssp -= yylen;
3149 #ifdef YYLSP_NEEDED
3150   yylsp -= yylen;
3151 #endif
3152
3153 #if YYDEBUG != 0
3154   if (yydebug)
3155     {
3156       short *ssp1 = yyss - 1;
3157       fprintf (stderr, "state stack now");
3158       while (ssp1 != yyssp)
3159         fprintf (stderr, " %d", *++ssp1);
3160       fprintf (stderr, "\n");
3161     }
3162 #endif
3163
3164   *++yyvsp = yyval;
3165
3166 #ifdef YYLSP_NEEDED
3167   yylsp++;
3168   if (yylen == 0)
3169     {
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;
3174       yylsp->text = 0;
3175     }
3176   else
3177     {
3178       yylsp->last_line = (yylsp+yylen-1)->last_line;
3179       yylsp->last_column = (yylsp+yylen-1)->last_column;
3180     }
3181 #endif
3182
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.  */
3187
3188   yyn = yyr1[yyn];
3189
3190   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3191   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3192     yystate = yytable[yystate];
3193   else
3194     yystate = yydefgoto[yyn - YYNTBASE];
3195
3196   goto yynewstate;
3197
3198 yyerrlab:   /* here on detecting error */
3199
3200   if (! yyerrstatus)
3201     /* If not already recovering from an error, report this error.  */
3202     {
3203       ++yynerrs;
3204
3205 #ifdef YYERROR_VERBOSE
3206       yyn = yypact[yystate];
3207
3208       if (yyn > YYFLAG && yyn < YYLAST)
3209         {
3210           int size = 0;
3211           char *msg;
3212           int x, count;
3213
3214           count = 0;
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);
3221           if (msg != 0)
3222             {
3223               strcpy(msg, "parse error");
3224
3225               if (count < 5)
3226                 {
3227                   count = 0;
3228                   for (x = (yyn < 0 ? -yyn : 0);
3229                        x < (sizeof(yytname) / sizeof(char *)); x++)
3230                     if (yycheck[x + yyn] == x)
3231                       {
3232                         strcat(msg, count == 0 ? ", expecting `" : " or `");
3233                         strcat(msg, yytname[x]);
3234                         strcat(msg, "'");
3235                         count++;
3236                       }
3237                 }
3238               yyerror(msg);
3239               free(msg);
3240             }
3241           else
3242             yyerror ("parse error; also virtual memory exceeded");
3243         }
3244       else
3245 #endif /* YYERROR_VERBOSE */
3246         yyerror("parse error");
3247     }
3248
3249   goto yyerrlab1;
3250 yyerrlab1:   /* here on error raised explicitly by an action */
3251
3252   if (yyerrstatus == 3)
3253     {
3254       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
3255
3256       /* return failure if at end of input */
3257       if (yychar == YYEOF)
3258         YYABORT;
3259
3260 #if YYDEBUG != 0
3261       if (yydebug)
3262         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3263 #endif
3264
3265       yychar = YYEMPTY;
3266     }
3267
3268   /* Else will try to reuse lookahead token
3269      after shifting the error token.  */
3270
3271   yyerrstatus = 3;              /* Each real token shifted decrements this */
3272
3273   goto yyerrhandle;
3274
3275 yyerrdefault:  /* current state does not do anything special for the error token. */
3276
3277 #if 0
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;
3282 #endif
3283
3284 yyerrpop:   /* pop the current state because it cannot handle the error token */
3285
3286   if (yyssp == yyss) YYABORT;
3287   yyvsp--;
3288   yystate = *--yyssp;
3289 #ifdef YYLSP_NEEDED
3290   yylsp--;
3291 #endif
3292
3293 #if YYDEBUG != 0
3294   if (yydebug)
3295     {
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");
3301     }
3302 #endif
3303
3304 yyerrhandle:
3305
3306   yyn = yypact[yystate];
3307   if (yyn == YYFLAG)
3308     goto yyerrdefault;
3309
3310   yyn += YYTERROR;
3311   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3312     goto yyerrdefault;
3313
3314   yyn = yytable[yyn];
3315   if (yyn < 0)
3316     {
3317       if (yyn == YYFLAG)
3318         goto yyerrpop;
3319       yyn = -yyn;
3320       goto yyreduce;
3321     }
3322   else if (yyn == 0)
3323     goto yyerrpop;
3324
3325   if (yyn == YYFINAL)
3326     YYACCEPT;
3327
3328 #if YYDEBUG != 0
3329   if (yydebug)
3330     fprintf(stderr, "Shifting error token, ");
3331 #endif
3332
3333   *++yyvsp = yylval;
3334 #ifdef YYLSP_NEEDED
3335   *++yylsp = yylloc;
3336 #endif
3337
3338   yystate = yyn;
3339   goto yynewstate;
3340
3341  yyacceptlab:
3342   /* YYACCEPT comes here.  */
3343   if (yyfree_stacks)
3344     {
3345       free (yyss);
3346       free (yyvs);
3347 #ifdef YYLSP_NEEDED
3348       free (yyls);
3349 #endif
3350     }
3351   return 0;
3352
3353  yyabortlab:
3354   /* YYABORT comes here.  */
3355   if (yyfree_stacks)
3356     {
3357       free (yyss);
3358       free (yyvs);
3359 #ifdef YYLSP_NEEDED
3360       free (yyls);
3361 #endif
3362     }
3363   return 1;
3364 }
3365 #line 1777 "parse.y"
3366