]> git.draconx.ca Git - gob-dx.git/blob - src/parse.c
0146efb007d2356c55f7ecd3190e8914e42676a2
[gob-dx.git] / src / parse.c
1 /* A Bison parser, made by GNU Bison 1.875c.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.  */
20
21 /* As a special exception, when this file is copied by Bison into a
22    Bison output file, you may use that output file without restriction.
23    This special exception was added by the Free Software Foundation
24    in version 1.24 of Bison.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30    infringing on user name space.  This should be done even for local
31    variables, as they might otherwise be expanded by user macros.
32    There are some unavoidable exceptions within include files to
33    define necessary library symbols; they are noted "INFRINGES ON
34    USER NAME SPACE" below.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers.  */
43 #define YYPURE 0
44
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47
48
49
50 /* Tokens.  */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53    /* Put the tokens into the symbol table, so that GDB and other debuggers
54       know about them.  */
55    enum yytokentype {
56      CLASS = 258,
57      FROM = 259,
58      CONST = 260,
59      VOID = 261,
60      STRUCT = 262,
61      UNION = 263,
62      ENUM = 264,
63      THREEDOTS = 265,
64      SIGNED = 266,
65      UNSIGNED = 267,
66      LONG = 268,
67      SHORT = 269,
68      INT = 270,
69      FLOAT = 271,
70      DOUBLE = 272,
71      CHAR = 273,
72      TOKEN = 274,
73      NUMBER = 275,
74      TYPETOKEN = 276,
75      ARRAY_DIM = 277,
76      SINGLE_CHAR = 278,
77      CCODE = 279,
78      HTCODE = 280,
79      PHCODE = 281,
80      HCODE = 282,
81      ACODE = 283,
82      ATCODE = 284,
83      STRING = 285,
84      PUBLIC = 286,
85      PRIVATE = 287,
86      PROTECTED = 288,
87      CLASSWIDE = 289,
88      PROPERTY = 290,
89      ARGUMENT = 291,
90      VIRTUAL = 292,
91      SIGNAL = 293,
92      OVERRIDE = 294,
93      NICK = 295,
94      BLURB = 296,
95      MAXIMUM = 297,
96      MINIMUM = 298,
97      DEFAULT_VALUE = 299,
98      ERROR = 300,
99      FLAGS = 301,
100      TYPE = 302,
101      FLAGS_TYPE = 303,
102      ENUM_TYPE = 304,
103      PARAM_TYPE = 305,
104      BOXED_TYPE = 306,
105      OBJECT_TYPE = 307
106    };
107 #endif
108 #define CLASS 258
109 #define FROM 259
110 #define CONST 260
111 #define VOID 261
112 #define STRUCT 262
113 #define UNION 263
114 #define ENUM 264
115 #define THREEDOTS 265
116 #define SIGNED 266
117 #define UNSIGNED 267
118 #define LONG 268
119 #define SHORT 269
120 #define INT 270
121 #define FLOAT 271
122 #define DOUBLE 272
123 #define CHAR 273
124 #define TOKEN 274
125 #define NUMBER 275
126 #define TYPETOKEN 276
127 #define ARRAY_DIM 277
128 #define SINGLE_CHAR 278
129 #define CCODE 279
130 #define HTCODE 280
131 #define PHCODE 281
132 #define HCODE 282
133 #define ACODE 283
134 #define ATCODE 284
135 #define STRING 285
136 #define PUBLIC 286
137 #define PRIVATE 287
138 #define PROTECTED 288
139 #define CLASSWIDE 289
140 #define PROPERTY 290
141 #define ARGUMENT 291
142 #define VIRTUAL 292
143 #define SIGNAL 293
144 #define OVERRIDE 294
145 #define NICK 295
146 #define BLURB 296
147 #define MAXIMUM 297
148 #define MINIMUM 298
149 #define DEFAULT_VALUE 299
150 #define ERROR 300
151 #define FLAGS 301
152 #define TYPE 302
153 #define FLAGS_TYPE 303
154 #define ENUM_TYPE 304
155 #define PARAM_TYPE 305
156 #define BOXED_TYPE 306
157 #define OBJECT_TYPE 307
158
159
160
161
162 /* Copy the first part of user declarations.  */
163 #line 23 "parse.y"
164
165
166 #include "config.h"
167 #include <glib.h>
168 #include <stdio.h>
169 #include <stdlib.h>
170 #include <string.h>
171
172 #include "treefuncs.h"
173 #include "main.h"
174 #include "util.h"
175
176 /* FIXME: add gettext support */
177 #define _(x) (x)
178         
179 GList *nodes = NULL;
180
181 static GList *class_nodes = NULL;
182 Node *class = NULL;
183 GList *enums = NULL;
184 static GList *enum_vals = NULL;
185 static GList *flag_vals = NULL;
186 static GList *error_vals = NULL;
187
188 static char *chunk_size = NULL;
189 static char *bonobo_object_class = NULL;
190 static int glade_xml = FALSE;
191 static GList *interfaces = NULL;
192 static GList *typestack = NULL;
193 static GList *funcargs = NULL;
194 static GList *checks = NULL;
195 static int has_self = FALSE;
196 static int vararg = FALSE;
197 static Method *last_added_method = NULL;
198
199 /* destructor and initializer for variables */
200 static gboolean destructor_unref = FALSE;
201 static char *destructor = NULL;
202 static int destructor_line = 0;
203 static gboolean destructor_simple = TRUE;
204 static char *initializer = NULL;
205 static int initializer_line = 0;
206 static int glade_widget = FALSE;
207
208 static char *onerror = NULL;
209 static char *defreturn = NULL;
210
211 static GList *gtktypes = NULL;
212
213 static Property *property = NULL;
214
215 /* this can be a global as we will only do one function at a time
216    anyway */
217 static int the_scope = NO_SCOPE;
218
219 void free(void *ptr);
220 int yylex(void);
221
222 extern int ccode_line;
223 extern int line_no;
224 extern gboolean for_cpp;
225
226 extern char *yytext;
227
228 static void
229 yyerror(char *str)
230 {
231         char *out=NULL;
232         char *p;
233         
234         if(strcmp(yytext,"\n")==0) {
235                 out=g_strconcat("Error: ",str," before newline",NULL);
236         } else if(yytext[0]=='\0') {
237                 out=g_strconcat("Error: ", str, " at end of input", NULL);
238         } else {
239                 char *tmp = g_strdup(yytext);
240                 while((p=strchr(tmp, '\n')))
241                         *p='.';
242
243                 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
244                 g_free(tmp);
245         }
246
247         fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
248         g_free(out);
249         
250         exit(1);
251 }
252
253 static Type *
254 pop_type(void)
255 {
256         Type *type = typestack->data;
257         typestack = g_list_remove(typestack,typestack->data);
258         return type;
259 }
260
261 static void
262 push_variable (char *name, int scope, int line_no, char *postfix)
263 {
264         Node *var;
265         Type *type = pop_type ();
266
267         type->postfix = postfix;
268         
269         var = node_new (VARIABLE_NODE,
270                         "scope", scope,
271                         "vtype:steal", type,
272                         "glade_widget", glade_widget,
273                         "id:steal", name,
274                         "line_no", line_no,
275                         "destructor_unref", destructor_unref,
276                         "destructor:steal", destructor,
277                         "destructor_line", destructor_line,
278                         "destructor_simple", destructor_simple,
279                         "initializer:steal", initializer,
280                         "initializer_line", initializer_line,
281                         "initializer_simple", TRUE,
282                         NULL);
283         class_nodes = g_list_append(class_nodes, var);
284         glade_widget = FALSE;
285 }
286
287 static void
288 push_function (int scope, int method, char *oid, char *id,
289                GString *cbuf, int line_no, int ccode_line,
290                gboolean vararg, GList *flags)
291 {
292         Node *node;
293         Type *type;
294         char *c_cbuf;
295
296         g_assert(scope != CLASS_SCOPE);
297        
298         if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
299                 type = (Type *)node_new (TYPE_NODE,
300                                          "name", "void",
301                                          NULL);
302         } else {
303                 type = pop_type();
304         }
305         
306         /* a complicated and ugly test to figure out if we have
307            the wrong number of types for a signal */
308         if((method == SIGNAL_FIRST_METHOD ||
309             method == SIGNAL_LAST_METHOD) &&
310            g_list_length(gtktypes) != g_list_length(funcargs) &&
311            !(g_list_length(funcargs) == 1 &&
312              g_list_length(gtktypes) == 2 &&
313              strcmp(gtktypes->next->data, "NONE")==0)) {
314                 error_print(GOB_WARN, line_no,
315                             _("The number of GTK arguments and "
316                               "function arguments for a signal "
317                               "don't seem to match"));
318         }
319         if(g_list_length(gtktypes) > 2) {
320                 GList *li;
321                 for(li = gtktypes->next; li; li = li->next) {
322                         if(strcmp(li->data, "NONE")==0) {
323                                 error_print(GOB_ERROR, line_no,
324                                             _("NONE can only appear in an "
325                                               "argument list by itself"));
326                         }
327                 }
328         }
329         if(cbuf) {
330                 char *p;
331                 c_cbuf = p = cbuf->str;
332                 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
333                         p++;
334                 if(!p || !*p)
335                         c_cbuf = NULL;
336         } else
337                 c_cbuf = NULL;
338
339         node = node_new (METHOD_NODE,
340                          "scope", scope,
341                          "method", method,
342                          "mtype:steal", type,
343                          "otype:steal", oid,
344                          "gtktypes:steal", gtktypes,
345                          "flags:steal", flags,
346                          "id:steal", id,
347                          "args:steal", funcargs,
348                          "onerror:steal", onerror,
349                          "defreturn:steal", defreturn,
350                          "cbuf:steal", c_cbuf,
351                          "line_no", line_no,
352                          "ccode_line", ccode_line,
353                          "vararg", vararg,
354                          "unique_id", method_unique_id++,
355                          NULL);
356
357         last_added_method = (Method *)node;
358
359         if(cbuf)
360                 g_string_free(cbuf,
361                               /*only free segment if we haven't passed it
362                                 above */
363                               c_cbuf?FALSE:TRUE);
364         gtktypes = NULL;
365         funcargs = NULL;
366
367         onerror = NULL;
368         defreturn = NULL;
369
370         class_nodes = g_list_append(class_nodes, node);
371 }
372
373 static void
374 free_all_global_state(void)
375 {
376         g_free(onerror);
377         onerror = NULL;
378         g_free(defreturn);
379         defreturn = NULL;
380
381         g_free(chunk_size);
382         chunk_size = NULL;
383         
384         g_list_foreach(gtktypes, (GFunc)g_free, NULL);
385         g_list_free(gtktypes);
386         gtktypes = NULL;
387
388         node_list_free (funcargs);
389         funcargs = NULL;
390 }
391
392 static void
393 push_funcarg(char *name, char *postfix)
394 {
395         Node *node;
396         Type *type = pop_type();
397
398         type->postfix = postfix;
399         
400         node = node_new (FUNCARG_NODE,
401                          "atype:steal", type,
402                          "name:steal", name,
403                          "checks:steal", checks,
404                          NULL);
405         checks = NULL;
406         
407         funcargs = g_list_append(funcargs, node);
408 }
409
410 static void
411 push_init_arg(char *name, int is_class)
412 {
413         Node *node;
414         Node *type;
415         char *tn;
416         
417         if(is_class)
418                 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
419         else
420                 tn = g_strdup(((Class *)class)->otype);
421
422         type = node_new (TYPE_NODE,
423                          "name:steal", tn,
424                          "pointer", "*",
425                          NULL);
426         node = node_new (FUNCARG_NODE,
427                          "atype:steal", (Type *)type,
428                          "name:steal", name,
429                          NULL);
430         funcargs = g_list_prepend(funcargs, node);
431 }
432
433 static void
434 push_self(char *id, gboolean constant)
435 {
436         Node *node;
437         Node *type;
438         GList *ch = NULL;
439         type = node_new (TYPE_NODE,
440                          "name", ((Class *)class)->otype,
441                          "pointer", constant ? "const *" : "*",
442                          NULL);
443         ch = g_list_append (ch, node_new (CHECK_NODE,
444                                           "chtype", NULL_CHECK,
445                                           NULL));
446         ch = g_list_append (ch, node_new (CHECK_NODE,
447                                           "chtype", TYPE_CHECK,
448                                           NULL));
449         node = node_new (FUNCARG_NODE,
450                          "atype:steal", (Type *)type,
451                          "name:steal", id,
452                          "checks:steal", ch,
453                          NULL);
454         funcargs = g_list_prepend(funcargs, node);
455 }
456
457 static Variable *
458 find_var_or_die(const char *id, int line)
459 {
460         GList *li;
461
462         for(li = class_nodes; li != NULL; li = li->next) {
463                 Variable *var;
464                 Node *node = li->data;
465                 if(node->type != VARIABLE_NODE)
466                         continue;
467                 var = li->data;
468                 if(strcmp(var->id, id)==0)
469                         return var;
470         }
471
472         error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
473
474         g_assert_not_reached();
475         return NULL;
476 }
477
478 static gboolean
479 set_return_value(char *type, char *val)
480 {
481         if(strcmp(type, "onerror")==0) {
482                 if(!onerror) {
483                         onerror = val;
484                         return TRUE;
485                 } else
486                         return FALSE;
487         } else if(strcmp(type, "defreturn")==0) {
488                 if(!defreturn) {
489                         defreturn = val;
490                         return TRUE;
491                 } else
492                         return FALSE;
493         }
494         return FALSE;
495 }
496
497 static void
498 export_accessors (const char *var_name,
499                   gboolean do_get,
500                   int get_lineno,
501                   gboolean do_set,
502                   int set_lineno,
503                   Type *type,
504                   const char *gtktype,
505                   int lineno)
506 {       
507         Type *the_type;
508
509         if (type != NULL)
510                 the_type = (Type *)node_copy ((Node *)type);
511         else
512                 the_type = get_tree_type (gtktype, TRUE);
513
514         if (the_type == NULL) {
515                 error_print (GOB_ERROR, line_no,
516                              _("Cannot determine type of property or argument"));
517                 return;
518         }
519
520         if (do_get) {
521                 char *get_id = g_strdup_printf ("get_%s", var_name);
522                 GString *get_cbuf = g_string_new (NULL);
523                 Node *node1 = node_new (TYPE_NODE,
524                                         "name", the_type->name,
525                                         "pointer", the_type->pointer,
526                                         "postfix", the_type->postfix,
527                                         NULL);
528                 Node *node3 = node_new (TYPE_NODE,
529                                         "name", class->class.otype,
530                                         "pointer", "*",
531                                         NULL);
532
533                 g_string_sprintf (get_cbuf,
534                                   "\t%s%s val; "
535                                   "g_object_get (G_OBJECT (self), \"%s\", "
536                                   "&val, NULL); "
537                                   "return val;\n",
538                                   the_type->name, 
539                                   the_type->pointer ? the_type->pointer : "",
540                                   var_name);
541                 
542                 typestack = g_list_prepend (typestack, node1);
543                 typestack = g_list_prepend (typestack, node3);
544                 
545                 push_funcarg ("self", FALSE);
546                 
547                 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
548                                get_id, get_cbuf, get_lineno,
549                                lineno, FALSE, NULL);
550         }
551         
552         if (do_set) {
553                 char *set_id = g_strdup_printf ("set_%s", var_name);
554                 GString *set_cbuf = g_string_new (NULL);
555                 Node *node1 = node_new (TYPE_NODE, 
556                                         "name", the_type->name,
557                                         "pointer", the_type->pointer,
558                                         "postfix", the_type->postfix,
559                                         NULL);
560                 Node *node2 = node_new (TYPE_NODE, 
561                                         "name", "void",
562                                         NULL);
563                 Node *node3 = node_new (TYPE_NODE, 
564                                         "name", class->class.otype,
565                                         "pointer", "*",
566                                         NULL);
567
568                 g_string_sprintf (set_cbuf,
569                                   "\tg_object_set (G_OBJECT (self), "
570                                   "\"%s\", val, NULL);\n",
571                                   var_name);
572
573                 typestack = g_list_prepend (typestack, node2);
574                 typestack = g_list_prepend (typestack, node1);
575                 typestack = g_list_prepend (typestack, node3);
576                 
577                 push_funcarg ("self", FALSE);
578                 push_funcarg ("val", FALSE);
579         
580                 typestack = g_list_prepend (typestack, node2);
581                 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
582                                set_id, set_cbuf, set_lineno,
583                                lineno, FALSE, NULL);
584         }
585
586         node_free ((Node *)the_type);
587 }
588
589 static char *
590 get_prop_enum_flag_cast (Property *prop)
591 {
592         char *tmp, *ret;
593         if (prop->extra_gtktype == NULL ||
594         /* HACK!  just in case someone made this
595          * work with 2.0.0 by using the TYPE
596          * macro directly */
597             ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
598               strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
599              strchr (prop->extra_gtktype, ':') == NULL)) {
600                 if (prop->ptype != NULL)
601                         return get_type (prop->ptype, TRUE);
602                 else
603                         return g_strdup ("");
604         }
605         tmp = remove_sep (prop->extra_gtktype);
606         ret = g_strdup_printf ("(%s) ", tmp);
607         g_free (tmp);
608         return ret;
609 }
610
611 static void
612 add_construct_glade (char * file, char * root, char * domain)
613 {
614         Node *var;
615         Type * type;
616         GList * flags = NULL;
617         char * set;
618         
619         type = (Type *)node_new (TYPE_NODE,
620                                  "name", "GladeXML",
621                                  "pointer", "*",
622                                  NULL);
623         initializer = g_strdup_printf("\t{\n"
624                                       "\tGtkWidget * root;\n"
625                                       "\to->_priv->_glade_xml = glade_xml_new(%s, %s, %s);\n"
626                                       "\troot = glade_xml_get_widget(o->_priv->_glade_xml, %s);\n"
627                                       "\tgtk_widget_show(root);\n"
628                                       "\tgtk_container_add(GTK_CONTAINER(o), root);\n"
629                                       "\tglade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLConnectFunc)___glade_xml_connect_foreach, (gpointer)o);\n"
630                                       "}\n", file, root, domain ? domain : "NULL", root);
631         
632         var = node_new (VARIABLE_NODE,
633                         "scope", PRIVATE_SCOPE,
634                         "vtype:steal", type,
635                         "glade_widget", FALSE,
636                         "id:steal", "_glade_xml",
637                         "destructor_unref", FALSE,
638                         "destructor", "g_object_unref", 
639                         "destructor_simple", TRUE,
640                         "initializer", initializer,
641                         "initializer_simple", FALSE,
642                         NULL);
643         class_nodes = g_list_prepend(class_nodes, var);
644 }
645
646 static void
647 property_link_and_export (Node *node)
648 {
649         Property *prop = (Property *)node;
650
651         if (prop->link) {
652                 const char *root;
653                 char *get = NULL, *set = NULL;
654                 Variable *var;
655
656                 if (prop->set != NULL ||
657                     prop->get != NULL) {        
658                         error_print (GOB_ERROR, prop->line_no,
659                                      _("Property linking requested, but "
660                                        "getters and setters exist"));
661                 }
662
663                 var = find_var_or_die (prop->name, prop->line_no);
664                 if(var->scope == PRIVATE_SCOPE) {
665                         root = "self->_priv";
666                 } else if (var->scope == CLASS_SCOPE) {
667                         root = "SELF_GET_CLASS(self)";
668                         if (no_self_alias)
669                                 error_print (GOB_ERROR, prop->line_no,
670                                              _("Self aliases needed when autolinking to a classwide member"));
671                 } else {
672                         root = "self";
673                 }
674
675                 if (strcmp (prop->gtktype, "STRING") == 0) {
676                         set = g_strdup_printf("{ char *old = %s->%s; "
677                                               "%s->%s = g_value_dup_string (VAL); g_free (old); }",
678                                               root, prop->name,
679                                               root, prop->name);
680                         get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
681                                               root, prop->name);
682                 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
683                         char *cast;
684                         if (prop->extra_gtktype != NULL) {
685                                 cast = remove_sep (prop->extra_gtktype);
686                         } else {
687                                 cast = g_strdup ("void");
688                         }
689                         set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
690                                               "%s->%s = (%s *)g_value_dup_object (VAL); "
691                                               "if (___old != NULL) { "
692                                                 "g_object_unref (G_OBJECT (___old)); "
693                                               "} "
694                                               "}",
695                                               root, prop->name,
696                                               root, prop->name,
697                                               cast);
698                         get = g_strdup_printf ("g_value_set_object (VAL, "
699                                                "(gpointer)%s->%s);",
700                                                root, prop->name);
701                         g_free (cast);
702                 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
703                         char *type = make_me_type (prop->extra_gtktype,
704                                                    "G_TYPE_BOXED");
705                         if (prop->extra_gtktype == NULL) {
706                                 error_print (GOB_ERROR, prop->line_no,
707                                              _("Property linking requested for BOXED, but "
708                                                "boxed_type not set"));
709                         }
710                         set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
711                                               "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
712                                               "if (___new != ___old) { "
713                                                 "if (___old != NULL) g_boxed_free (%s, ___old); "
714                                                 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
715                                                 "else %s->%s = NULL;"
716                                               "} "
717                                               "}",
718                                               root, prop->name,
719                                               type,
720                                               root, prop->name,
721                                               type,
722                                               root, prop->name);
723                         get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
724                                               root, prop->name);
725                         g_free (type);
726                 } else {
727                         char *set_func;
728                         char *get_func;
729                         const char *getcast = "";
730                         const char *setcast = "";
731                         char *to_free = NULL;
732                         set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
733                         g_strdown (set_func);
734                         get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
735                         g_strdown (get_func);
736
737                         if (for_cpp) {
738                                 if (strcmp (prop->gtktype, "FLAGS") == 0) {
739                                         setcast = "(guint) ";
740                                         getcast = to_free =
741                                                 get_prop_enum_flag_cast (prop);
742                                 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
743                                         setcast = "(gint) ";
744                                         getcast = to_free =
745                                                 get_prop_enum_flag_cast (prop);
746                                }  else if (strcmp (prop->gtktype, "POINTER") == 0) {
747                                        setcast = "(gpointer) ";
748                                        getcast = g_strdup_printf ("(%s%s) ",
749                                                                   prop->ptype->name,
750                                                                   prop->ptype->pointer ? prop->ptype->pointer : "");
751                                 }
752                         }
753
754                         set = g_strdup_printf("%s->%s = %s%s (VAL);",
755                                               root, prop->name,
756                                               getcast,
757                                               get_func);
758                         get = g_strdup_printf("%s (VAL, %s%s->%s);",
759                                               set_func,
760                                               setcast,  
761                                               root, prop->name);
762
763                         g_free (get_func);
764                         g_free (set_func);
765                         g_free (to_free);
766                 }
767
768                 node_set (node,
769                           "get:steal", get,
770                           "get_line", prop->line_no,
771                           "set:steal", set,
772                           "set_line", prop->line_no,
773                           NULL);
774         }
775
776         if (prop->export) {
777                 export_accessors (prop->name,
778                                   prop->get != NULL, prop->get_line,
779                                   prop->set != NULL,  prop->set_line,
780                                   prop->ptype,
781                                   prop->gtktype,
782                                   prop->line_no);
783         } 
784 }
785
786
787 static char *
788 debool (char *s)
789 {
790         if (strcmp (s, "BOOL") == 0) {
791                 error_print (GOB_WARN, line_no,
792                             _("BOOL type is deprecated, please use BOOLEAN"));
793                 g_free (s);
794                 return g_strdup ("BOOLEAN");
795         } else {
796                 return s;
797         }
798 }
799
800 static void
801 ensure_property (void)
802 {
803         if (property == NULL)
804                 property = (Property *)node_new (PROPERTY_NODE, NULL);
805 }
806
807
808
809 /* Enabling traces.  */
810 #ifndef YYDEBUG
811 # define YYDEBUG 1
812 #endif
813
814 /* Enabling verbose error messages.  */
815 #ifdef YYERROR_VERBOSE
816 # undef YYERROR_VERBOSE
817 # define YYERROR_VERBOSE 1
818 #else
819 # define YYERROR_VERBOSE 0
820 #endif
821
822 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
823 #line 668 "parse.y"
824 typedef union YYSTYPE {
825         char *id;
826         GString *cbuf;
827         GList *list;
828         int line;
829         int sigtype;
830 } YYSTYPE;
831 /* Line 191 of yacc.c.  */
832 #line 833 "parse.c"
833 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
834 # define YYSTYPE_IS_DECLARED 1
835 # define YYSTYPE_IS_TRIVIAL 1
836 #endif
837
838
839
840 /* Copy the second part of user declarations.  */
841
842
843 /* Line 214 of yacc.c.  */
844 #line 845 "parse.c"
845
846 #if ! defined (yyoverflow) || YYERROR_VERBOSE
847
848 # ifndef YYFREE
849 #  define YYFREE free
850 # endif
851 # ifndef YYMALLOC
852 #  define YYMALLOC malloc
853 # endif
854
855 /* The parser invokes alloca or malloc; define the necessary symbols.  */
856
857 # ifdef YYSTACK_USE_ALLOCA
858 #  if YYSTACK_USE_ALLOCA
859 #   define YYSTACK_ALLOC alloca
860 #  endif
861 # else
862 #  if defined (alloca) || defined (_ALLOCA_H)
863 #   define YYSTACK_ALLOC alloca
864 #  else
865 #   ifdef __GNUC__
866 #    define YYSTACK_ALLOC __builtin_alloca
867 #   endif
868 #  endif
869 # endif
870
871 # ifdef YYSTACK_ALLOC
872    /* Pacify GCC's `empty if-body' warning. */
873 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
874 # else
875 #  if defined (__STDC__) || defined (__cplusplus)
876 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
877 #   define YYSIZE_T size_t
878 #  endif
879 #  define YYSTACK_ALLOC YYMALLOC
880 #  define YYSTACK_FREE YYFREE
881 # endif
882 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
883
884
885 #if (! defined (yyoverflow) \
886      && (! defined (__cplusplus) \
887          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
888
889 /* A type that is properly aligned for any stack member.  */
890 union yyalloc
891 {
892   short yyss;
893   YYSTYPE yyvs;
894   };
895
896 /* The size of the maximum gap between one aligned stack and the next.  */
897 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
898
899 /* The size of an array large to enough to hold all stacks, each with
900    N elements.  */
901 # define YYSTACK_BYTES(N) \
902      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
903       + YYSTACK_GAP_MAXIMUM)
904
905 /* Copy COUNT objects from FROM to TO.  The source and destination do
906    not overlap.  */
907 # ifndef YYCOPY
908 #  if defined (__GNUC__) && 1 < __GNUC__
909 #   define YYCOPY(To, From, Count) \
910       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
911 #  else
912 #   define YYCOPY(To, From, Count)              \
913       do                                        \
914         {                                       \
915           register YYSIZE_T yyi;                \
916           for (yyi = 0; yyi < (Count); yyi++)   \
917             (To)[yyi] = (From)[yyi];            \
918         }                                       \
919       while (0)
920 #  endif
921 # endif
922
923 /* Relocate STACK from its old location to the new one.  The
924    local variables YYSIZE and YYSTACKSIZE give the old and new number of
925    elements in the stack, and YYPTR gives the new location of the
926    stack.  Advance YYPTR to a properly aligned location for the next
927    stack.  */
928 # define YYSTACK_RELOCATE(Stack)                                        \
929     do                                                                  \
930       {                                                                 \
931         YYSIZE_T yynewbytes;                                            \
932         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
933         Stack = &yyptr->Stack;                                          \
934         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
935         yyptr += yynewbytes / sizeof (*yyptr);                          \
936       }                                                                 \
937     while (0)
938
939 #endif
940
941 #if defined (__STDC__) || defined (__cplusplus)
942    typedef signed char yysigned_char;
943 #else
944    typedef short yysigned_char;
945 #endif
946
947 /* YYFINAL -- State number of the termination state. */
948 #define YYFINAL  23
949 /* YYLAST -- Last index in YYTABLE.  */
950 #define YYLAST   595
951
952 /* YYNTOKENS -- Number of terminals. */
953 #define YYNTOKENS  66
954 /* YYNNTS -- Number of nonterminals. */
955 #define YYNNTS  53
956 /* YYNRULES -- Number of rules. */
957 #define YYNRULES  194
958 /* YYNRULES -- Number of states. */
959 #define YYNSTATES  412
960
961 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
962 #define YYUNDEFTOK  2
963 #define YYMAXUTOK   307
964
965 #define YYTRANSLATE(YYX)                                                \
966   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
967
968 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
969 static const unsigned char yytranslate[] =
970 {
971        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
972        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
973        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
974        2,     2,     2,    64,     2,     2,     2,     2,     2,     2,
975       55,    56,    61,     2,    59,    65,     2,     2,     2,     2,
976        2,     2,     2,     2,     2,     2,     2,     2,     2,    57,
977       63,    58,    62,     2,     2,     2,     2,     2,     2,     2,
978        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
979        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
980        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
981        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
982        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
983        2,     2,     2,    53,    60,    54,     2,     2,     2,     2,
984        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
985        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
986        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
987        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
988        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
989        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
990        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
991        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
992        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
993        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
994        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
995        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
996        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
997        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
998       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
999       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
1000       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1001       45,    46,    47,    48,    49,    50,    51,    52
1002 };
1003
1004 #if YYDEBUG
1005 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1006    YYRHS.  */
1007 static const unsigned short yyprhs[] =
1008 {
1009        0,     0,     3,     7,    10,    13,    15,    17,    19,    21,
1010       23,    25,    27,    30,    33,    36,    39,    41,    43,    45,
1011       47,    52,    56,    62,    63,    69,    75,    81,    88,    96,
1012      103,   111,   114,   116,   118,   121,   125,   127,   129,   131,
1013      133,   135,   137,   139,   141,   144,   148,   151,   155,   158,
1014      161,   163,   165,   167,   168,   174,   181,   194,   204,   211,
1015      215,   216,   228,   237,   243,   247,   248,   252,   254,   256,
1016      261,   263,   265,   269,   273,   277,   281,   285,   289,   293,
1017      297,   301,   305,   309,   313,   317,   321,   325,   329,   333,
1018      335,   341,   343,   347,   348,   352,   354,   357,   359,   361,
1019      363,   366,   369,   372,   376,   380,   383,   386,   389,   391,
1020      394,   396,   399,   401,   403,   405,   407,   409,   411,   413,
1021      415,   417,   419,   421,   423,   425,   428,   431,   435,   438,
1022      440,   444,   448,   451,   453,   458,   462,   464,   467,   469,
1023      480,   492,   502,   512,   521,   533,   542,   548,   551,   556,
1024      557,   559,   562,   564,   566,   569,   572,   576,   581,   586,
1025      588,   592,   594,   598,   600,   603,   607,   614,   622,   625,
1026      627,   629,   632,   635,   639,   643,   647,   651,   659,   668,
1027      672,   674,   678,   680,   688,   697,   701,   703,   711,   720,
1028      724,   726,   728,   731,   733
1029 };
1030
1031 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1032 static const yysigned_char yyrhs[] =
1033 {
1034       67,     0,    -1,    69,    70,    69,    -1,    70,    69,    -1,
1035       69,    70,    -1,    70,    -1,    24,    -1,    27,    -1,    25,
1036       -1,    26,    -1,    28,    -1,    29,    -1,    69,    68,    -1,
1037       69,   111,    -1,    69,   114,    -1,    69,   116,    -1,    68,
1038       -1,   111,    -1,   114,    -1,   116,    -1,    71,    53,    73,
1039       54,    -1,    71,    53,    54,    -1,     3,    21,     4,    21,
1040       72,    -1,    -1,    55,    19,    19,    56,    72,    -1,    55,
1041       19,    21,    56,    72,    -1,    55,    19,    20,    56,    72,
1042       -1,    55,    19,    30,    30,    56,    72,    -1,    55,    19,
1043       30,    30,    30,    56,    72,    -1,    55,    19,    19,    30,
1044       56,    72,    -1,    55,    19,    19,    30,    30,    56,    72,
1045       -1,    73,    74,    -1,    74,    -1,   102,    -1,    19,   102,
1046       -1,    19,    21,   102,    -1,    79,    -1,    80,    -1,    82,
1047       -1,    57,    -1,    31,    -1,    32,    -1,    33,    -1,    34,
1048       -1,    19,    19,    -1,    19,    53,    24,    -1,    58,   118,
1049       -1,    58,    53,    24,    -1,    76,    77,    -1,    77,    76,
1050       -1,    77,    -1,    76,    -1,    19,    -1,    -1,    75,    91,
1051       19,    78,    57,    -1,    75,    91,    19,    22,    78,    57,
1052       -1,    36,    89,    88,    19,    81,    19,    53,    24,    19,
1053       53,    24,    57,    -1,    36,    89,    88,    19,    81,    19,
1054       53,    24,    57,    -1,    36,    89,    88,    19,    81,    19,
1055       -1,    55,    19,    56,    -1,    -1,    35,    19,    19,    83,
1056       19,    53,    24,    19,    53,    24,    57,    -1,    35,    19,
1057       19,    83,    19,    53,    24,    57,    -1,    35,    19,    19,
1058       83,    57,    -1,    55,    84,    56,    -1,    -1,    84,    59,
1059       87,    -1,    87,    -1,    30,    -1,    19,    55,    30,    56,
1060       -1,   118,    -1,    85,    -1,    40,    58,    85,    -1,    41,
1061       58,    85,    -1,    42,    58,   118,    -1,    43,    58,   118,
1062       -1,    44,    58,    86,    -1,    46,    58,    90,    -1,    47,
1063       58,    91,    -1,    48,    58,    21,    -1,    48,    58,    19,
1064       -1,    49,    58,    21,    -1,    49,    58,    19,    -1,    50,
1065       58,    21,    -1,    50,    58,    19,    -1,    51,    58,    21,
1066       -1,    51,    58,    19,    -1,    52,    58,    21,    -1,    52,
1067       58,    19,    -1,    19,    -1,    19,    55,    19,    91,    56,
1068       -1,    19,    -1,    55,    90,    56,    -1,    -1,    19,    60,
1069       90,    -1,    19,    -1,    92,    96,    -1,    92,    -1,    93,
1070       -1,    19,    -1,     5,    19,    -1,    19,     5,    -1,    95,
1071       19,    -1,     5,    95,    19,    -1,    95,    19,     5,    -1,
1072       94,    93,    -1,    21,    93,    -1,     5,    93,    -1,    21,
1073       -1,    21,     5,    -1,    94,    -1,    94,     5,    -1,     6,
1074       -1,    18,    -1,    14,    -1,    15,    -1,    13,    -1,    16,
1075       -1,    17,    -1,    11,    -1,    12,    -1,     7,    -1,     8,
1076       -1,     9,    -1,    61,    -1,    61,     5,    -1,    61,    96,
1077       -1,    61,     5,    96,    -1,    19,    99,    -1,    99,    -1,
1078       75,    19,    99,    -1,    19,    75,    99,    -1,    75,    99,
1079       -1,    97,    -1,    19,    55,   100,    56,    -1,   100,    59,
1080       19,    -1,    19,    -1,    53,    24,    -1,    57,    -1,    38,
1081       89,    98,    91,    19,    55,   105,    56,   103,   101,    -1,
1082       75,    38,    89,    97,    91,    19,    55,   105,    56,   103,
1083      101,    -1,    37,    75,    91,    19,    55,   105,    56,   103,
1084      101,    -1,    75,    37,    91,    19,    55,   105,    56,   103,
1085      101,    -1,    37,    91,    19,    55,   105,    56,   103,   101,
1086       -1,    39,    55,    21,    56,    91,    19,    55,   105,    56,
1087      103,   101,    -1,    75,    91,    19,    55,   105,    56,   103,
1088      101,    -1,    19,    55,    19,    56,   101,    -1,    19,   104,
1089       -1,    19,   104,    19,   104,    -1,    -1,   118,    -1,    53,
1090       24,    -1,     6,    -1,    19,    -1,    19,     5,    -1,     5,
1091       19,    -1,    19,    59,   106,    -1,    19,     5,    59,   106,
1092       -1,     5,    19,    59,   106,    -1,   106,    -1,   107,    59,
1093       10,    -1,   107,    -1,   107,    59,   108,    -1,   108,    -1,
1094       91,    19,    -1,    91,    19,    22,    -1,    91,    19,    55,
1095       19,   109,    56,    -1,    91,    19,    22,    55,    19,   109,
1096       56,    -1,   109,   110,    -1,   110,    -1,    19,    -1,    62,
1097      118,    -1,    63,   118,    -1,    62,    58,   118,    -1,    63,
1098       58,   118,    -1,    58,    58,   118,    -1,    64,    58,   118,
1099       -1,     9,    19,    53,   112,    54,    21,    57,    -1,     9,
1100       19,    53,   112,    59,    54,    21,    57,    -1,   112,    59,
1101      113,    -1,   113,    -1,    19,    58,   118,    -1,    19,    -1,
1102       46,    19,    53,   115,    54,    21,    57,    -1,    46,    19,
1103       53,   115,    59,    54,    21,    57,    -1,   115,    59,    19,
1104       -1,    19,    -1,    45,    19,    53,   117,    54,    21,    57,
1105       -1,    45,    19,    53,   117,    59,    54,    21,    57,    -1,
1106      117,    59,    19,    -1,    19,    -1,    20,    -1,    65,    20,
1107       -1,    23,    -1,    19,    -1
1108 };
1109
1110 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1111 static const unsigned short yyrline[] =
1112 {
1113        0,   689,   689,   690,   691,   692,   695,   704,   713,   722,
1114      731,   740,   751,   752,   753,   754,   755,   756,   757,   758,
1115      761,   766,   773,   789,   790,   802,   811,   823,   832,   841,
1116      850,   861,   862,   865,   866,   875,   887,   888,   889,   890,
1117      893,   894,   895,   896,   899,   919,   943,   947,   955,   956,
1118      957,   958,   959,   967,   973,   976,   981,  1049,  1103,  1192,
1119     1200,  1205,  1253,  1289,  1305,  1306,  1309,  1310,  1313,  1314,
1120     1326,  1327,  1330,  1336,  1342,  1348,  1354,  1360,  1366,  1373,
1121     1379,  1385,  1391,  1397,  1403,  1409,  1415,  1421,  1427,  1433,
1122     1458,  1467,  1473,  1474,  1477,  1480,  1486,  1493,  1502,  1505,
1123     1508,  1512,  1516,  1520,  1525,  1533,  1537,  1542,  1546,  1549,
1124     1553,  1556,  1561,  1562,  1563,  1564,  1565,  1566,  1567,  1568,
1125     1569,  1572,  1573,  1574,  1577,  1578,  1579,  1583,  1590,  1602,
1126     1608,  1620,  1632,  1635,  1641,  1646,  1649,  1654,  1655,  1659,
1127     1675,  1691,  1707,  1723,  1734,  1740,  1750,  1773,  1784,  1803,
1128     1809,  1810,  1816,  1817,  1828,  1839,  1850,  1860,  1870,  1880,
1129     1883,  1884,  1887,  1888,  1891,  1894,  1897,  1905,  1915,  1916,
1130     1919,  1936,  1943,  1950,  1957,  1964,  1971,  1980,  1989,  2000,
1131     2001,  2004,  2024,  2034,  2043,  2054,  2057,  2062,  2071,  2082,
1132     2085,  2091,  2092,  2096,  2097
1133 };
1134 #endif
1135
1136 #if YYDEBUG || YYERROR_VERBOSE
1137 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1138    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1139 static const char *const yytname[] =
1140 {
1141   "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID",
1142   "STRUCT", "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG",
1143   "SHORT", "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER",
1144   "TYPETOKEN", "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE",
1145   "HCODE", "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
1146   "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
1147   "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR", "FLAGS",
1148   "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
1149   "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
1150   "'*'", "'>'", "'<'", "'!'", "'-'", "$accept", "prog", "ccode", "ccodes",
1151   "class", "classdec", "classflags", "classcode", "thing", "scope",
1152   "destructor", "initializer", "varoptions", "variable", "argument",
1153   "export", "property", "param_spec", "param_spec_list", "string",
1154   "anyval", "param_spec_value", "argtype", "flags", "flaglist", "type",
1155   "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
1156   "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
1157   "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
1158   "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
1159   "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
1160 };
1161 #endif
1162
1163 # ifdef YYPRINT
1164 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1165    token YYLEX-NUM.  */
1166 static const unsigned short yytoknum[] =
1167 {
1168        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
1169      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
1170      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
1171      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
1172      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
1173      305,   306,   307,   123,   125,    40,    41,    59,    61,    44,
1174      124,    42,    62,    60,    33,    45
1175 };
1176 # endif
1177
1178 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1179 static const unsigned char yyr1[] =
1180 {
1181        0,    66,    67,    67,    67,    67,    68,    68,    68,    68,
1182       68,    68,    69,    69,    69,    69,    69,    69,    69,    69,
1183       70,    70,    71,    72,    72,    72,    72,    72,    72,    72,
1184       72,    73,    73,    74,    74,    74,    74,    74,    74,    74,
1185       75,    75,    75,    75,    76,    76,    77,    77,    78,    78,
1186       78,    78,    78,    78,    79,    79,    80,    80,    80,    81,
1187       81,    82,    82,    82,    83,    83,    84,    84,    85,    85,
1188       86,    86,    87,    87,    87,    87,    87,    87,    87,    87,
1189       87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
1190       88,    88,    89,    89,    90,    90,    91,    91,    92,    92,
1191       92,    92,    92,    92,    92,    93,    93,    93,    93,    93,
1192       93,    93,    94,    94,    94,    94,    94,    94,    94,    94,
1193       94,    95,    95,    95,    96,    96,    96,    96,    97,    97,
1194       98,    98,    98,    98,    99,   100,   100,   101,   101,   102,
1195      102,   102,   102,   102,   102,   102,   102,   103,   103,   103,
1196      104,   104,   105,   105,   105,   105,   105,   105,   105,   105,
1197      106,   106,   107,   107,   108,   108,   108,   108,   109,   109,
1198      110,   110,   110,   110,   110,   110,   110,   111,   111,   112,
1199      112,   113,   113,   114,   114,   115,   115,   116,   116,   117,
1200      117,   118,   118,   118,   118
1201 };
1202
1203 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
1204 static const unsigned char yyr2[] =
1205 {
1206        0,     2,     3,     2,     2,     1,     1,     1,     1,     1,
1207        1,     1,     2,     2,     2,     2,     1,     1,     1,     1,
1208        4,     3,     5,     0,     5,     5,     5,     6,     7,     6,
1209        7,     2,     1,     1,     2,     3,     1,     1,     1,     1,
1210        1,     1,     1,     1,     2,     3,     2,     3,     2,     2,
1211        1,     1,     1,     0,     5,     6,    12,     9,     6,     3,
1212        0,    11,     8,     5,     3,     0,     3,     1,     1,     4,
1213        1,     1,     3,     3,     3,     3,     3,     3,     3,     3,
1214        3,     3,     3,     3,     3,     3,     3,     3,     3,     1,
1215        5,     1,     3,     0,     3,     1,     2,     1,     1,     1,
1216        2,     2,     2,     3,     3,     2,     2,     2,     1,     2,
1217        1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
1218        1,     1,     1,     1,     1,     2,     2,     3,     2,     1,
1219        3,     3,     2,     1,     4,     3,     1,     2,     1,    10,
1220       11,     9,     9,     8,    11,     8,     5,     2,     4,     0,
1221        1,     2,     1,     1,     2,     2,     3,     4,     4,     1,
1222        3,     1,     3,     1,     2,     3,     6,     7,     2,     1,
1223        1,     2,     2,     3,     3,     3,     3,     7,     8,     3,
1224        1,     3,     1,     7,     8,     3,     1,     7,     8,     3,
1225        1,     1,     2,     1,     1
1226 };
1227
1228 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1229    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
1230    means the default is an error.  */
1231 static const unsigned char yydefact[] =
1232 {
1233        0,     0,     0,     6,     8,     9,     7,    10,    11,     0,
1234        0,     0,    16,     0,     5,     0,    17,    18,    19,     0,
1235        0,     0,     0,     1,    12,     4,    13,    14,    15,     3,
1236        0,     0,     0,     0,     0,     2,     0,    40,    41,    42,
1237       43,     0,    93,     0,    93,     0,    21,    39,     0,    32,
1238        0,    36,    37,    38,    33,    23,   182,     0,   180,   190,
1239        0,   186,     0,     0,     0,     0,     0,    34,     0,     0,
1240        0,     0,   112,   121,   122,   123,   119,   120,   116,   114,
1241      115,   117,   118,   113,    99,   108,     0,     0,    97,    98,
1242      110,     0,     0,     0,    20,    31,     0,    93,     0,     0,
1243       22,     0,     0,     0,     0,     0,     0,     0,    35,     0,
1244        0,    65,    95,     0,    91,     0,     0,   100,   107,     0,
1245      101,   109,   106,     0,     0,   124,    96,   111,   105,   102,
1246        0,     0,   133,     0,   129,     0,     0,     0,    53,     0,
1247      194,   191,   193,     0,   181,     0,     0,   179,     0,   189,
1248        0,     0,   185,     0,     0,     0,     0,     0,     0,    92,
1249        0,    60,   103,     0,     0,   125,   126,   104,     0,     0,
1250        0,   128,     0,   132,     0,     0,     0,     0,     0,    52,
1251       53,     0,     0,    51,    50,     0,     0,     0,     0,     0,
1252      192,   177,     0,   187,     0,   183,     0,     0,   138,   146,
1253       89,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1254        0,     0,     0,     0,    67,     0,    63,    94,     0,     0,
1255        0,     0,     0,   112,    99,     0,     0,   159,   161,   163,
1256      127,   136,     0,   131,   130,     0,     0,     0,     0,    44,
1257        0,     0,     0,     0,    46,    48,     0,    49,    54,     0,
1258       23,    23,    23,     0,   178,   188,   184,   137,     0,     0,
1259        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1260       64,     0,     0,     0,     0,    58,     0,   100,   101,     0,
1261      164,   149,     0,   134,     0,     0,     0,     0,     0,    45,
1262       55,   149,    47,     0,    23,    24,    26,    25,     0,    23,
1263        0,    68,    72,    73,    74,    75,   194,    71,    76,    70,
1264       77,    78,    80,    79,    82,    81,    84,    83,    86,    85,
1265       88,    87,    66,     0,    90,    59,     0,   149,     0,     0,
1266      156,   165,     0,     0,     0,   160,   162,   135,     0,     0,
1267      149,     0,     0,    23,    29,    23,    27,     0,     0,    62,
1268        0,     0,   158,   157,     0,     0,     0,   147,   150,   143,
1269      149,     0,     0,     0,   145,    30,    28,     0,     0,     0,
1270       57,   141,     0,   170,     0,     0,     0,     0,     0,   169,
1271      151,     0,     0,   149,   142,   149,    69,     0,     0,     0,
1272        0,     0,   171,     0,   172,     0,   166,   168,   148,   139,
1273        0,     0,    61,     0,   167,   175,   173,   174,   176,   144,
1274      140,    56
1275 };
1276
1277 /* YYDEFGOTO[NTERM-NUM]. */
1278 static const short yydefgoto[] =
1279 {
1280       -1,    11,    12,    13,    14,    15,   100,    48,    49,    50,
1281      183,   184,   185,    51,    52,   220,    53,   157,   213,   302,
1282      308,   214,   115,    70,   113,   225,    88,    89,    90,    91,
1283      126,   132,   133,   134,   232,   199,    54,   334,   357,   226,
1284      227,   228,   229,   378,   379,    16,    57,    58,    17,    62,
1285       18,    60,   358
1286 };
1287
1288 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1289    STATE-NUM.  */
1290 #define YYPACT_NINF -326
1291 static const short yypact[] =
1292 {
1293      166,    18,    73,  -326,  -326,  -326,  -326,  -326,  -326,   115,
1294      116,   147,  -326,   166,   210,   121,  -326,  -326,  -326,   148,
1295      127,   128,   135,  -326,  -326,   210,  -326,  -326,  -326,   210,
1296      167,   175,   178,   204,   225,   210,   226,  -326,  -326,  -326,
1297     -326,   230,   195,   330,   195,   199,  -326,  -326,   194,  -326,
1298      296,  -326,  -326,  -326,  -326,   206,   209,   -32,  -326,  -326,
1299      -18,  -326,   156,   217,   321,   261,   296,  -326,   268,   272,
1300      274,   377,  -326,  -326,  -326,  -326,  -326,  -326,  -326,  -326,
1301     -326,  -326,  -326,  -326,   290,   445,   394,   277,   237,  -326,
1302      459,   280,   151,   279,  -326,  -326,   394,   195,   297,   304,
1303     -326,    99,   310,    31,   311,    83,   329,    89,  -326,   300,
1304      338,   325,   327,   341,   349,   395,   473,  -326,  -326,   402,
1305     -326,   473,  -326,   412,   383,     5,  -326,   473,  -326,   443,
1306      251,   433,  -326,   394,  -326,   397,   435,   436,    12,   188,
1307     -326,  -326,  -326,   447,  -326,   424,   448,  -326,   425,  -326,
1308      462,   438,  -326,   471,   163,   413,   278,    11,   272,  -326,
1309      474,   441,  -326,   442,   411,   237,  -326,  -326,   444,   479,
1310      481,  -326,     1,  -326,   482,   394,   449,     1,   394,    76,
1311       19,   411,     9,   450,   483,   446,    84,   451,   453,   475,
1312     -326,  -326,   454,  -326,   455,  -326,   456,   486,  -326,  -326,
1313     -326,   457,   458,   460,   461,   463,   464,   465,   466,   467,
1314      468,   469,   470,   -10,  -326,   476,  -326,  -326,   394,   487,
1315      495,   411,   428,   477,    13,   498,   478,  -326,   472,  -326,
1316     -326,  -326,    51,  -326,  -326,   480,   501,   411,   511,  -326,
1317      508,   484,   488,   512,  -326,  -326,    76,  -326,  -326,    85,
1318      206,   206,   206,    90,  -326,  -326,  -326,  -326,    98,    98,
1319       99,    99,    60,   272,   394,   168,   252,   257,   258,   267,
1320     -326,   278,   513,   489,   490,   485,   491,   158,   184,   394,
1321       66,   520,   360,  -326,   521,   411,   493,   494,   496,  -326,
1322     -326,   520,  -326,   497,   206,  -326,  -326,  -326,   499,   206,
1323      502,  -326,  -326,  -326,  -326,  -326,   502,  -326,  -326,  -326,
1324     -326,  -326,  -326,  -326,  -326,  -326,  -326,  -326,  -326,  -326,
1325     -326,  -326,  -326,    14,  -326,  -326,   518,   520,   394,   394,
1326     -326,   503,   524,    74,   163,  -326,  -326,  -326,   500,   411,
1327      520,   411,   163,   206,  -326,   206,  -326,   519,   506,  -326,
1328       29,   163,  -326,  -326,   533,   104,   530,   541,  -326,  -326,
1329      520,   505,   163,   507,  -326,  -326,  -326,   509,   538,   514,
1330     -326,  -326,   104,  -326,   510,    80,    93,   515,    68,  -326,
1331     -326,    74,   163,   520,  -326,   520,  -326,   517,   540,    86,
1332       99,    99,  -326,    99,  -326,    99,  -326,  -326,  -326,  -326,
1333      163,   163,  -326,   522,  -326,  -326,  -326,  -326,  -326,  -326,
1334     -326,  -326
1335 };
1336
1337 /* YYPGOTO[NTERM-NUM].  */
1338 static const short yypgoto[] =
1339 {
1340     -326,  -326,   142,   227,   553,  -326,  -239,  -326,   523,   -29,
1341      385,   387,   392,  -326,  -326,  -326,  -326,  -326,  -326,     7,
1342     -326,   305,  -326,   -19,  -152,   -42,  -326,   -69,  -326,   -68,
1343     -106,   440,  -326,   -88,  -326,  -325,   -13,  -287,   197,  -176,
1344     -264,  -326,   293,   208,  -136,   143,  -326,   492,   144,  -326,
1345      233,  -326,  -101
1346 };
1347
1348 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
1349    positive, shift that token.  If negative, reduce the rule which
1350    number is the opposite.  If zero, do what YYDEFACT says.
1351    If YYTABLE_NINF, syntax error.  */
1352 #define YYTABLE_NINF -156
1353 static const short yytable[] =
1354 {
1355      144,    87,   118,   119,   342,   242,   217,    66,    98,   359,
1356      165,   295,   296,   297,    86,   330,   122,   364,   278,   166,
1357      168,   128,   102,    67,   110,    92,   371,   103,   140,   141,
1358      215,   179,   142,   348,   180,    66,   104,   384,   179,    19,
1359      351,   105,   171,   173,   123,   276,   270,   118,   369,   271,
1360       56,   108,   118,   362,   136,   344,   169,   399,   118,   230,
1361      346,   287,   243,   131,   352,   353,   125,   181,   216,  -153,
1362      182,   349,   279,   382,   143,   409,   410,   182,   137,   306,
1363      141,   244,   233,   142,   234,   146,   370,   373,   331,   171,
1364      301,   174,    20,   140,   141,   239,   400,   142,   401,   140,
1365      141,   170,   149,   142,   365,   373,   366,   283,   152,   338,
1366      284,   310,   140,   141,   249,   293,   142,   300,   140,   141,
1367      298,   332,   142,   373,   396,   143,   374,   356,   301,   240,
1368      375,   376,   377,   236,    21,    22,   238,   150,   391,   143,
1369      250,   294,   404,   153,   374,   143,   299,    23,   375,   376,
1370      377,   393,    31,   118,   119,    24,    26,    27,   143,   304,
1371      305,   309,   374,   361,   143,   363,   375,   376,   377,     1,
1372      130,    24,    26,    27,    30,     2,   273,    24,    26,    27,
1373       32,    33,    37,    38,    39,    40,    36,   312,    34,   313,
1374        3,     4,     5,     6,     7,     8,    55,    56,    37,    38,
1375       39,    40,    41,    42,    43,    44,    45,   186,   187,   188,
1376      106,     9,    10,    36,  -155,   107,   197,   328,   189,     2,
1377      198,    46,   311,    59,    47,    37,    38,    39,    40,    41,
1378       42,    43,    44,    45,     3,     4,     5,     6,     7,     8,
1379     -154,    29,   397,   329,    61,    63,    28,    64,    94,    68,
1380       69,    47,    35,   397,    93,     9,    10,    37,    38,    39,
1381       40,    99,    28,    43,    44,    45,   303,   101,    28,   307,
1382      168,   314,    65,   315,   392,   394,   316,   318,   317,   319,
1383      109,    65,    37,    38,    39,    40,   320,   111,   321,   405,
1384      406,   112,   407,   114,   408,   120,   124,   200,   125,   129,
1385      135,    71,    72,    73,    74,    75,   169,    76,    77,    78,
1386       79,    80,    81,    82,    83,    84,   138,    85,   201,   202,
1387      203,   204,   205,   139,   206,   207,   208,   209,   210,   211,
1388      212,   145,   148,    96,    97,    71,    72,    73,    74,    75,
1389       63,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1390      151,    85,    37,    38,    39,    40,   154,   155,    43,    44,
1391       45,    37,    38,    39,    40,    71,    72,    73,    74,    75,
1392      335,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1393      156,    85,   116,    72,    73,    74,    75,   158,    76,    77,
1394       78,    79,    80,    81,    82,    83,   117,   159,    85,    71,
1395       72,    73,    74,    75,   160,    76,    77,    78,    79,    80,
1396       81,    82,    83,    84,   161,    85,   222,   223,    73,    74,
1397       75,   162,    76,    77,    78,    79,    80,    81,    82,    83,
1398      224,   163,    85,   116,    72,    73,    74,    75,   164,    76,
1399       77,    78,    79,    80,    81,    82,    83,   277,   167,    85,
1400      121,    72,   172,   175,   176,   177,    76,    77,    78,    79,
1401       80,    81,    82,    83,   127,    72,    85,   190,   181,   192,
1402       76,    77,    78,    79,    80,    81,    82,    83,   116,    72,
1403       85,   191,   193,   194,    76,    77,    78,    79,    80,    81,
1404       82,    83,   196,   218,    85,   195,   219,   221,   231,   169,
1405      168,   235,   246,   248,   237,   253,   274,   251,   182,   252,
1406      257,   254,   255,   256,   275,   258,   259,   280,   260,   261,
1407      286,   262,   263,   264,   265,   266,   267,   268,   269,   272,
1408      288,   282,   289,  -152,   281,   285,   292,   323,   326,   333,
1409      337,   290,   350,   355,   291,   324,   325,   327,   339,   367,
1410      340,   341,   372,   343,   380,   345,   360,   347,   354,   368,
1411      381,   383,   387,   385,   403,   386,    25,   388,   390,   247,
1412      245,    95,   241,   395,   402,   336,   322,   178,   398,   411,
1413      389,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1414        0,     0,     0,     0,     0,   147
1415 };
1416
1417 static const short yycheck[] =
1418 {
1419      101,    43,    71,    71,   291,   181,   158,    36,    50,   334,
1420        5,   250,   251,   252,    43,   279,    85,   342,     5,   125,
1421       19,    90,    54,    36,    66,    44,   351,    59,    19,    20,
1422       19,    19,    23,    19,    22,    64,    54,   362,    19,    21,
1423      327,    59,   130,   131,    86,   221,    56,   116,    19,    59,
1424       19,    64,   121,   340,    96,   294,    55,   382,   127,   165,
1425      299,   237,    53,    92,   328,   329,    61,    55,    57,    56,
1426       58,    57,    59,   360,    65,   400,   401,    58,    97,    19,
1427       20,   182,   170,    23,   172,    54,    57,    19,    22,   177,
1428       30,   133,    19,    19,    20,    19,   383,    23,   385,    19,
1429       20,   130,    19,    23,   343,    19,   345,    56,    19,   285,
1430       59,   263,    19,    20,    30,    30,    23,    19,    19,    20,
1431       30,    55,    23,    19,    56,    65,    58,    53,    30,    53,
1432       62,    63,    64,   175,    19,    19,   178,    54,    58,    65,
1433       56,    56,    56,    54,    58,    65,    56,     0,    62,    63,
1434       64,    58,     4,   222,   222,    13,    13,    13,    65,   260,
1435      261,   262,    58,   339,    65,   341,    62,    63,    64,     3,
1436       19,    29,    29,    29,    53,     9,   218,    35,    35,    35,
1437       53,    53,    31,    32,    33,    34,    19,    19,    53,    21,
1438       24,    25,    26,    27,    28,    29,    21,    19,    31,    32,
1439       33,    34,    35,    36,    37,    38,    39,    19,    20,    21,
1440       54,    45,    46,    19,    56,    59,    53,    59,    30,     9,
1441       57,    54,   264,    19,    57,    31,    32,    33,    34,    35,
1442       36,    37,    38,    39,    24,    25,    26,    27,    28,    29,
1443       56,    14,   378,    59,    19,    19,    13,    21,    54,    19,
1444       55,    57,    25,   389,    55,    45,    46,    31,    32,    33,
1445       34,    55,    29,    37,    38,    39,   259,    58,    35,   262,
1446       19,    19,    55,    21,   375,   376,    19,    19,    21,    21,
1447       19,    55,    31,    32,    33,    34,    19,    19,    21,   390,
1448      391,    19,   393,    19,   395,     5,    19,    19,    61,    19,
1449       21,     5,     6,     7,     8,     9,    55,    11,    12,    13,
1450       14,    15,    16,    17,    18,    19,    19,    21,    40,    41,
1451       42,    43,    44,    19,    46,    47,    48,    49,    50,    51,
1452       52,    21,    21,    37,    38,     5,     6,     7,     8,     9,
1453       19,    11,    12,    13,    14,    15,    16,    17,    18,    19,
1454       21,    21,    31,    32,    33,    34,    56,    19,    37,    38,
1455       39,    31,    32,    33,    34,     5,     6,     7,     8,     9,
1456       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
1457       55,    21,     5,     6,     7,     8,     9,    60,    11,    12,
1458       13,    14,    15,    16,    17,    18,    19,    56,    21,     5,
1459        6,     7,     8,     9,    55,    11,    12,    13,    14,    15,
1460       16,    17,    18,    19,    19,    21,     5,     6,     7,     8,
1461        9,    19,    11,    12,    13,    14,    15,    16,    17,    18,
1462       19,    19,    21,     5,     6,     7,     8,     9,    55,    11,
1463       12,    13,    14,    15,    16,    17,    18,    19,     5,    21,
1464        5,     6,    19,    56,    19,    19,    11,    12,    13,    14,
1465       15,    16,    17,    18,     5,     6,    21,    20,    55,    21,
1466       11,    12,    13,    14,    15,    16,    17,    18,     5,     6,
1467       21,    57,    57,    21,    11,    12,    13,    14,    15,    16,
1468       17,    18,    21,    19,    21,    57,    55,    55,    19,    55,
1469       19,    19,    19,    57,    55,    30,    19,    56,    58,    56,
1470       24,    57,    57,    57,    19,    58,    58,    19,    58,    58,
1471       19,    58,    58,    58,    58,    58,    58,    58,    58,    53,
1472       19,    59,    24,    56,    56,    55,    24,    24,    53,    19,
1473       19,    57,    24,    19,    56,    56,    56,    56,    55,    30,
1474       56,    55,    19,    56,    24,    56,    56,    55,    55,    53,
1475       19,    56,    24,    56,    24,    56,    13,    53,    58,   184,
1476      183,    48,   180,    58,    57,   282,   271,   137,   381,    57,
1477      372,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1478       -1,    -1,    -1,    -1,    -1,   103
1479 };
1480
1481 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1482    symbol of state STATE-NUM.  */
1483 static const unsigned char yystos[] =
1484 {
1485        0,     3,     9,    24,    25,    26,    27,    28,    29,    45,
1486       46,    67,    68,    69,    70,    71,   111,   114,   116,    21,
1487       19,    19,    19,     0,    68,    70,   111,   114,   116,    69,
1488       53,     4,    53,    53,    53,    69,    19,    31,    32,    33,
1489       34,    35,    36,    37,    38,    39,    54,    57,    73,    74,
1490       75,    79,    80,    82,   102,    21,    19,   112,   113,    19,
1491      117,    19,   115,    19,    21,    55,    75,   102,    19,    55,
1492       89,     5,     6,     7,     8,     9,    11,    12,    13,    14,
1493       15,    16,    17,    18,    19,    21,    75,    91,    92,    93,
1494       94,    95,    89,    55,    54,    74,    37,    38,    91,    55,
1495       72,    58,    54,    59,    54,    59,    54,    59,   102,    19,
1496       91,    19,    19,    90,    19,    88,     5,    19,    93,    95,
1497        5,     5,    93,    91,    19,    61,    96,     5,    93,    19,
1498       19,    75,    97,    98,    99,    21,    91,    89,    19,    19,
1499       19,    20,    23,    65,   118,    21,    54,   113,    21,    19,
1500       54,    21,    19,    54,    56,    19,    55,    83,    60,    56,
1501       55,    19,    19,    19,    55,     5,    96,     5,    19,    55,
1502       75,    99,    19,    99,    91,    56,    19,    19,    97,    19,
1503       22,    55,    58,    76,    77,    78,    19,    20,    21,    30,
1504       20,    57,    21,    57,    21,    57,    21,    53,    57,   101,
1505       19,    40,    41,    42,    43,    44,    46,    47,    48,    49,
1506       50,    51,    52,    84,    87,    19,    57,    90,    19,    55,
1507       81,    55,     5,     6,    19,    91,   105,   106,   107,   108,
1508       96,    19,   100,    99,    99,    19,    91,    55,    91,    19,
1509       53,    78,   105,    53,   118,    77,    19,    76,    57,    30,
1510       56,    56,    56,    30,    57,    57,    57,    24,    58,    58,
1511       58,    58,    58,    58,    58,    58,    58,    58,    58,    58,
1512       56,    59,    53,    91,    19,    19,   105,    19,     5,    59,
1513       19,    56,    59,    56,    59,    55,    19,   105,    19,    24,
1514       57,    56,    24,    30,    56,    72,    72,    72,    30,    56,
1515       19,    30,    85,    85,   118,   118,    19,    85,    86,   118,
1516       90,    91,    19,    21,    19,    21,    19,    21,    19,    21,
1517       19,    21,    87,    24,    56,    56,    53,    56,    59,    59,
1518      106,    22,    55,    19,   103,    10,   108,    19,   105,    55,
1519       56,    55,   103,    56,    72,    56,    72,    55,    19,    57,
1520       24,   103,   106,   106,    55,    19,    53,   104,   118,   101,
1521       56,   105,   103,   105,   101,    72,    72,    30,    53,    19,
1522       57,   101,    19,    19,    58,    62,    63,    64,   109,   110,
1523       24,    19,   103,    56,   101,    56,    56,    24,    53,   109,
1524       58,    58,   118,    58,   118,    58,    56,   110,   104,   101,
1525      103,   103,    57,    24,    56,   118,   118,   118,   118,   101,
1526      101,    57
1527 };
1528
1529 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1530 # define YYSIZE_T __SIZE_TYPE__
1531 #endif
1532 #if ! defined (YYSIZE_T) && defined (size_t)
1533 # define YYSIZE_T size_t
1534 #endif
1535 #if ! defined (YYSIZE_T)
1536 # if defined (__STDC__) || defined (__cplusplus)
1537 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1538 #  define YYSIZE_T size_t
1539 # endif
1540 #endif
1541 #if ! defined (YYSIZE_T)
1542 # define YYSIZE_T unsigned int
1543 #endif
1544
1545 #define yyerrok         (yyerrstatus = 0)
1546 #define yyclearin       (yychar = YYEMPTY)
1547 #define YYEMPTY         (-2)
1548 #define YYEOF           0
1549
1550 #define YYACCEPT        goto yyacceptlab
1551 #define YYABORT         goto yyabortlab
1552 #define YYERROR         goto yyerrorlab
1553
1554
1555 /* Like YYERROR except do call yyerror.  This remains here temporarily
1556    to ease the transition to the new meaning of YYERROR, for GCC.
1557    Once GCC version 2 has supplanted version 1, this can go.  */
1558
1559 #define YYFAIL          goto yyerrlab
1560
1561 #define YYRECOVERING()  (!!yyerrstatus)
1562
1563 #define YYBACKUP(Token, Value)                                  \
1564 do                                                              \
1565   if (yychar == YYEMPTY && yylen == 1)                          \
1566     {                                                           \
1567       yychar = (Token);                                         \
1568       yylval = (Value);                                         \
1569       yytoken = YYTRANSLATE (yychar);                           \
1570       YYPOPSTACK;                                               \
1571       goto yybackup;                                            \
1572     }                                                           \
1573   else                                                          \
1574     {                                                           \
1575       yyerror ("syntax error: cannot back up");\
1576       YYERROR;                                                  \
1577     }                                                           \
1578 while (0)
1579
1580 #define YYTERROR        1
1581 #define YYERRCODE       256
1582
1583 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1584    are run).  */
1585
1586 #ifndef YYLLOC_DEFAULT
1587 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
1588    ((Current).first_line   = (Rhs)[1].first_line,       \
1589     (Current).first_column = (Rhs)[1].first_column,     \
1590     (Current).last_line    = (Rhs)[N].last_line,        \
1591     (Current).last_column  = (Rhs)[N].last_column)
1592 #endif
1593
1594 /* YYLEX -- calling `yylex' with the right arguments.  */
1595
1596 #ifdef YYLEX_PARAM
1597 # define YYLEX yylex (YYLEX_PARAM)
1598 #else
1599 # define YYLEX yylex ()
1600 #endif
1601
1602 /* Enable debugging if requested.  */
1603 #if YYDEBUG
1604
1605 # ifndef YYFPRINTF
1606 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1607 #  define YYFPRINTF fprintf
1608 # endif
1609
1610 # define YYDPRINTF(Args)                        \
1611 do {                                            \
1612   if (yydebug)                                  \
1613     YYFPRINTF Args;                             \
1614 } while (0)
1615
1616 # define YYDSYMPRINT(Args)                      \
1617 do {                                            \
1618   if (yydebug)                                  \
1619     yysymprint Args;                            \
1620 } while (0)
1621
1622 # define YYDSYMPRINTF(Title, Token, Value, Location)            \
1623 do {                                                            \
1624   if (yydebug)                                                  \
1625     {                                                           \
1626       YYFPRINTF (stderr, "%s ", Title);                         \
1627       yysymprint (stderr,                                       \
1628                   Token, Value);        \
1629       YYFPRINTF (stderr, "\n");                                 \
1630     }                                                           \
1631 } while (0)
1632
1633 /*------------------------------------------------------------------.
1634 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1635 | TOP (included).                                                   |
1636 `------------------------------------------------------------------*/
1637
1638 #if defined (__STDC__) || defined (__cplusplus)
1639 static void
1640 yy_stack_print (short *bottom, short *top)
1641 #else
1642 static void
1643 yy_stack_print (bottom, top)
1644     short *bottom;
1645     short *top;
1646 #endif
1647 {
1648   YYFPRINTF (stderr, "Stack now");
1649   for (/* Nothing. */; bottom <= top; ++bottom)
1650     YYFPRINTF (stderr, " %d", *bottom);
1651   YYFPRINTF (stderr, "\n");
1652 }
1653
1654 # define YY_STACK_PRINT(Bottom, Top)                            \
1655 do {                                                            \
1656   if (yydebug)                                                  \
1657     yy_stack_print ((Bottom), (Top));                           \
1658 } while (0)
1659
1660
1661 /*------------------------------------------------.
1662 | Report that the YYRULE is going to be reduced.  |
1663 `------------------------------------------------*/
1664
1665 #if defined (__STDC__) || defined (__cplusplus)
1666 static void
1667 yy_reduce_print (int yyrule)
1668 #else
1669 static void
1670 yy_reduce_print (yyrule)
1671     int yyrule;
1672 #endif
1673 {
1674   int yyi;
1675   unsigned int yylno = yyrline[yyrule];
1676   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1677              yyrule - 1, yylno);
1678   /* Print the symbols being reduced, and their result.  */
1679   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1680     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1681   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1682 }
1683
1684 # define YY_REDUCE_PRINT(Rule)          \
1685 do {                                    \
1686   if (yydebug)                          \
1687     yy_reduce_print (Rule);             \
1688 } while (0)
1689
1690 /* Nonzero means print parse trace.  It is left uninitialized so that
1691    multiple parsers can coexist.  */
1692 int yydebug;
1693 #else /* !YYDEBUG */
1694 # define YYDPRINTF(Args)
1695 # define YYDSYMPRINT(Args)
1696 # define YYDSYMPRINTF(Title, Token, Value, Location)
1697 # define YY_STACK_PRINT(Bottom, Top)
1698 # define YY_REDUCE_PRINT(Rule)
1699 #endif /* !YYDEBUG */
1700
1701
1702 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1703 #ifndef YYINITDEPTH
1704 # define YYINITDEPTH 200
1705 #endif
1706
1707 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1708    if the built-in stack extension method is used).
1709
1710    Do not make this value too large; the results are undefined if
1711    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1712    evaluated with infinite-precision integer arithmetic.  */
1713
1714 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1715 # undef YYMAXDEPTH
1716 #endif
1717
1718 #ifndef YYMAXDEPTH
1719 # define YYMAXDEPTH 10000
1720 #endif
1721
1722 \f
1723
1724 #if YYERROR_VERBOSE
1725
1726 # ifndef yystrlen
1727 #  if defined (__GLIBC__) && defined (_STRING_H)
1728 #   define yystrlen strlen
1729 #  else
1730 /* Return the length of YYSTR.  */
1731 static YYSIZE_T
1732 #   if defined (__STDC__) || defined (__cplusplus)
1733 yystrlen (const char *yystr)
1734 #   else
1735 yystrlen (yystr)
1736      const char *yystr;
1737 #   endif
1738 {
1739   register const char *yys = yystr;
1740
1741   while (*yys++ != '\0')
1742     continue;
1743
1744   return yys - yystr - 1;
1745 }
1746 #  endif
1747 # endif
1748
1749 # ifndef yystpcpy
1750 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1751 #   define yystpcpy stpcpy
1752 #  else
1753 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1754    YYDEST.  */
1755 static char *
1756 #   if defined (__STDC__) || defined (__cplusplus)
1757 yystpcpy (char *yydest, const char *yysrc)
1758 #   else
1759 yystpcpy (yydest, yysrc)
1760      char *yydest;
1761      const char *yysrc;
1762 #   endif
1763 {
1764   register char *yyd = yydest;
1765   register const char *yys = yysrc;
1766
1767   while ((*yyd++ = *yys++) != '\0')
1768     continue;
1769
1770   return yyd - 1;
1771 }
1772 #  endif
1773 # endif
1774
1775 #endif /* !YYERROR_VERBOSE */
1776
1777 \f
1778
1779 #if YYDEBUG
1780 /*--------------------------------.
1781 | Print this symbol on YYOUTPUT.  |
1782 `--------------------------------*/
1783
1784 #if defined (__STDC__) || defined (__cplusplus)
1785 static void
1786 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1787 #else
1788 static void
1789 yysymprint (yyoutput, yytype, yyvaluep)
1790     FILE *yyoutput;
1791     int yytype;
1792     YYSTYPE *yyvaluep;
1793 #endif
1794 {
1795   /* Pacify ``unused variable'' warnings.  */
1796   (void) yyvaluep;
1797
1798   if (yytype < YYNTOKENS)
1799     {
1800       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1801 # ifdef YYPRINT
1802       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1803 # endif
1804     }
1805   else
1806     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1807
1808   switch (yytype)
1809     {
1810       default:
1811         break;
1812     }
1813   YYFPRINTF (yyoutput, ")");
1814 }
1815
1816 #endif /* ! YYDEBUG */
1817 /*-----------------------------------------------.
1818 | Release the memory associated to this symbol.  |
1819 `-----------------------------------------------*/
1820
1821 #if defined (__STDC__) || defined (__cplusplus)
1822 static void
1823 yydestruct (int yytype, YYSTYPE *yyvaluep)
1824 #else
1825 static void
1826 yydestruct (yytype, yyvaluep)
1827     int yytype;
1828     YYSTYPE *yyvaluep;
1829 #endif
1830 {
1831   /* Pacify ``unused variable'' warnings.  */
1832   (void) yyvaluep;
1833
1834   switch (yytype)
1835     {
1836
1837       default:
1838         break;
1839     }
1840 }
1841 \f
1842
1843 /* Prevent warnings from -Wmissing-prototypes.  */
1844
1845 #ifdef YYPARSE_PARAM
1846 # if defined (__STDC__) || defined (__cplusplus)
1847 int yyparse (void *YYPARSE_PARAM);
1848 # else
1849 int yyparse ();
1850 # endif
1851 #else /* ! YYPARSE_PARAM */
1852 #if defined (__STDC__) || defined (__cplusplus)
1853 int yyparse (void);
1854 #else
1855 int yyparse ();
1856 #endif
1857 #endif /* ! YYPARSE_PARAM */
1858
1859
1860
1861 /* The lookahead symbol.  */
1862 int yychar;
1863
1864 /* The semantic value of the lookahead symbol.  */
1865 YYSTYPE yylval;
1866
1867 /* Number of syntax errors so far.  */
1868 int yynerrs;
1869
1870
1871
1872 /*----------.
1873 | yyparse.  |
1874 `----------*/
1875
1876 #ifdef YYPARSE_PARAM
1877 # if defined (__STDC__) || defined (__cplusplus)
1878 int yyparse (void *YYPARSE_PARAM)
1879 # else
1880 int yyparse (YYPARSE_PARAM)
1881   void *YYPARSE_PARAM;
1882 # endif
1883 #else /* ! YYPARSE_PARAM */
1884 #if defined (__STDC__) || defined (__cplusplus)
1885 int
1886 yyparse (void)
1887 #else
1888 int
1889 yyparse ()
1890
1891 #endif
1892 #endif
1893 {
1894   
1895   register int yystate;
1896   register int yyn;
1897   int yyresult;
1898   /* Number of tokens to shift before error messages enabled.  */
1899   int yyerrstatus;
1900   /* Lookahead token as an internal (translated) token number.  */
1901   int yytoken = 0;
1902
1903   /* Three stacks and their tools:
1904      `yyss': related to states,
1905      `yyvs': related to semantic values,
1906      `yyls': related to locations.
1907
1908      Refer to the stacks thru separate pointers, to allow yyoverflow
1909      to reallocate them elsewhere.  */
1910
1911   /* The state stack.  */
1912   short yyssa[YYINITDEPTH];
1913   short *yyss = yyssa;
1914   register short *yyssp;
1915
1916   /* The semantic value stack.  */
1917   YYSTYPE yyvsa[YYINITDEPTH];
1918   YYSTYPE *yyvs = yyvsa;
1919   register YYSTYPE *yyvsp;
1920
1921
1922
1923 #define YYPOPSTACK   (yyvsp--, yyssp--)
1924
1925   YYSIZE_T yystacksize = YYINITDEPTH;
1926
1927   /* The variables used to return semantic value and location from the
1928      action routines.  */
1929   YYSTYPE yyval;
1930
1931
1932   /* When reducing, the number of symbols on the RHS of the reduced
1933      rule.  */
1934   int yylen;
1935
1936   YYDPRINTF ((stderr, "Starting parse\n"));
1937
1938   yystate = 0;
1939   yyerrstatus = 0;
1940   yynerrs = 0;
1941   yychar = YYEMPTY;             /* Cause a token to be read.  */
1942
1943   /* Initialize stack pointers.
1944      Waste one element of value and location stack
1945      so that they stay on the same level as the state stack.
1946      The wasted elements are never initialized.  */
1947
1948   yyssp = yyss;
1949   yyvsp = yyvs;
1950
1951   goto yysetstate;
1952
1953 /*------------------------------------------------------------.
1954 | yynewstate -- Push a new state, which is found in yystate.  |
1955 `------------------------------------------------------------*/
1956  yynewstate:
1957   /* In all cases, when you get here, the value and location stacks
1958      have just been pushed. so pushing a state here evens the stacks.
1959      */
1960   yyssp++;
1961
1962  yysetstate:
1963   *yyssp = yystate;
1964
1965   if (yyss + yystacksize - 1 <= yyssp)
1966     {
1967       /* Get the current used size of the three stacks, in elements.  */
1968       YYSIZE_T yysize = yyssp - yyss + 1;
1969
1970 #ifdef yyoverflow
1971       {
1972         /* Give user a chance to reallocate the stack. Use copies of
1973            these so that the &'s don't force the real ones into
1974            memory.  */
1975         YYSTYPE *yyvs1 = yyvs;
1976         short *yyss1 = yyss;
1977
1978
1979         /* Each stack pointer address is followed by the size of the
1980            data in use in that stack, in bytes.  This used to be a
1981            conditional around just the two extra args, but that might
1982            be undefined if yyoverflow is a macro.  */
1983         yyoverflow ("parser stack overflow",
1984                     &yyss1, yysize * sizeof (*yyssp),
1985                     &yyvs1, yysize * sizeof (*yyvsp),
1986
1987                     &yystacksize);
1988
1989         yyss = yyss1;
1990         yyvs = yyvs1;
1991       }
1992 #else /* no yyoverflow */
1993 # ifndef YYSTACK_RELOCATE
1994       goto yyoverflowlab;
1995 # else
1996       /* Extend the stack our own way.  */
1997       if (YYMAXDEPTH <= yystacksize)
1998         goto yyoverflowlab;
1999       yystacksize *= 2;
2000       if (YYMAXDEPTH < yystacksize)
2001         yystacksize = YYMAXDEPTH;
2002
2003       {
2004         short *yyss1 = yyss;
2005         union yyalloc *yyptr =
2006           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2007         if (! yyptr)
2008           goto yyoverflowlab;
2009         YYSTACK_RELOCATE (yyss);
2010         YYSTACK_RELOCATE (yyvs);
2011
2012 #  undef YYSTACK_RELOCATE
2013         if (yyss1 != yyssa)
2014           YYSTACK_FREE (yyss1);
2015       }
2016 # endif
2017 #endif /* no yyoverflow */
2018
2019       yyssp = yyss + yysize - 1;
2020       yyvsp = yyvs + yysize - 1;
2021
2022
2023       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2024                   (unsigned long int) yystacksize));
2025
2026       if (yyss + yystacksize - 1 <= yyssp)
2027         YYABORT;
2028     }
2029
2030   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2031
2032   goto yybackup;
2033
2034 /*-----------.
2035 | yybackup.  |
2036 `-----------*/
2037 yybackup:
2038
2039 /* Do appropriate processing given the current state.  */
2040 /* Read a lookahead token if we need one and don't already have one.  */
2041 /* yyresume: */
2042
2043   /* First try to decide what to do without reference to lookahead token.  */
2044
2045   yyn = yypact[yystate];
2046   if (yyn == YYPACT_NINF)
2047     goto yydefault;
2048
2049   /* Not known => get a lookahead token if don't already have one.  */
2050
2051   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
2052   if (yychar == YYEMPTY)
2053     {
2054       YYDPRINTF ((stderr, "Reading a token: "));
2055       yychar = YYLEX;
2056     }
2057
2058   if (yychar <= YYEOF)
2059     {
2060       yychar = yytoken = YYEOF;
2061       YYDPRINTF ((stderr, "Now at end of input.\n"));
2062     }
2063   else
2064     {
2065       yytoken = YYTRANSLATE (yychar);
2066       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
2067     }
2068
2069   /* If the proper action on seeing token YYTOKEN is to reduce or to
2070      detect an error, take that action.  */
2071   yyn += yytoken;
2072   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2073     goto yydefault;
2074   yyn = yytable[yyn];
2075   if (yyn <= 0)
2076     {
2077       if (yyn == 0 || yyn == YYTABLE_NINF)
2078         goto yyerrlab;
2079       yyn = -yyn;
2080       goto yyreduce;
2081     }
2082
2083   if (yyn == YYFINAL)
2084     YYACCEPT;
2085
2086   /* Shift the lookahead token.  */
2087   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2088
2089   /* Discard the token being shifted unless it is eof.  */
2090   if (yychar != YYEOF)
2091     yychar = YYEMPTY;
2092
2093   *++yyvsp = yylval;
2094
2095
2096   /* Count tokens shifted since error; after three, turn off error
2097      status.  */
2098   if (yyerrstatus)
2099     yyerrstatus--;
2100
2101   yystate = yyn;
2102   goto yynewstate;
2103
2104
2105 /*-----------------------------------------------------------.
2106 | yydefault -- do the default action for the current state.  |
2107 `-----------------------------------------------------------*/
2108 yydefault:
2109   yyn = yydefact[yystate];
2110   if (yyn == 0)
2111     goto yyerrlab;
2112   goto yyreduce;
2113
2114
2115 /*-----------------------------.
2116 | yyreduce -- Do a reduction.  |
2117 `-----------------------------*/
2118 yyreduce:
2119   /* yyn is the number of a rule to reduce with.  */
2120   yylen = yyr2[yyn];
2121
2122   /* If YYLEN is nonzero, implement the default value of the action:
2123      `$$ = $1'.
2124
2125      Otherwise, the following line sets YYVAL to garbage.
2126      This behavior is undocumented and Bison
2127      users should not rely upon it.  Assigning to YYVAL
2128      unconditionally makes the parser a bit smaller, and it avoids a
2129      GCC warning that YYVAL may be used uninitialized.  */
2130   yyval = yyvsp[1-yylen];
2131
2132
2133   YY_REDUCE_PRINT (yyn);
2134   switch (yyn)
2135     {
2136         case 2:
2137 #line 689 "parse.y"
2138     { ; }
2139     break;
2140
2141   case 3:
2142 #line 690 "parse.y"
2143     { ; }
2144     break;
2145
2146   case 4:
2147 #line 691 "parse.y"
2148     { ; }
2149     break;
2150
2151   case 5:
2152 #line 692 "parse.y"
2153     { ; }
2154     break;
2155
2156   case 6:
2157 #line 695 "parse.y"
2158     {
2159                         Node *node = node_new (CCODE_NODE,
2160                                                "cctype", C_CCODE,
2161                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2162                                                "line_no", ccode_line,
2163                                                NULL);
2164                         nodes = g_list_append(nodes,node);
2165                         g_string_free(yyvsp[0].cbuf,FALSE);
2166                                         }
2167     break;
2168
2169   case 7:
2170 #line 704 "parse.y"
2171     {
2172                         Node *node = node_new (CCODE_NODE,
2173                                                "cctype", H_CCODE,
2174                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2175                                                "line_no", ccode_line,
2176                                                NULL);
2177                         nodes = g_list_append(nodes,node);
2178                         g_string_free(yyvsp[0].cbuf,FALSE);
2179                                         }
2180     break;
2181
2182   case 8:
2183 #line 713 "parse.y"
2184     {
2185                         Node *node = node_new (CCODE_NODE,
2186                                                "cctype", HT_CCODE,
2187                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2188                                                "line_no", ccode_line,
2189                                                NULL);
2190                         nodes = g_list_append(nodes,node);
2191                         g_string_free(yyvsp[0].cbuf,FALSE);
2192                                         }
2193     break;
2194
2195   case 9:
2196 #line 722 "parse.y"
2197     {
2198                         Node *node = node_new (CCODE_NODE,
2199                                                "cctype", PH_CCODE,
2200                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2201                                                "line_no", ccode_line,
2202                                                NULL);
2203                         nodes = g_list_append(nodes,node);
2204                         g_string_free(yyvsp[0].cbuf,FALSE);
2205                                         }
2206     break;
2207
2208   case 10:
2209 #line 731 "parse.y"
2210     {
2211                         Node *node = node_new (CCODE_NODE,
2212                                                "cctype", A_CCODE,
2213                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2214                                                "line_no", ccode_line,
2215                                                NULL);
2216                         nodes = g_list_append(nodes,node);
2217                         g_string_free(yyvsp[0].cbuf,FALSE);
2218                                         }
2219     break;
2220
2221   case 11:
2222 #line 740 "parse.y"
2223     {
2224                         Node *node = node_new (CCODE_NODE,
2225                                                "cctype", AT_CCODE,
2226                                                "cbuf:steal", (yyvsp[0].cbuf)->str,
2227                                                "line_no", ccode_line,
2228                                                NULL);
2229                         nodes = g_list_append(nodes,node);
2230                         g_string_free(yyvsp[0].cbuf,FALSE);
2231                                         }
2232     break;
2233
2234   case 12:
2235 #line 751 "parse.y"
2236     { ; }
2237     break;
2238
2239   case 13:
2240 #line 752 "parse.y"
2241     { ; }
2242     break;
2243
2244   case 14:
2245 #line 753 "parse.y"
2246     { ; }
2247     break;
2248
2249   case 15:
2250 #line 754 "parse.y"
2251     { ; }
2252     break;
2253
2254   case 16:
2255 #line 755 "parse.y"
2256     { ; }
2257     break;
2258
2259   case 17:
2260 #line 756 "parse.y"
2261     { ; }
2262     break;
2263
2264   case 18:
2265 #line 757 "parse.y"
2266     { ; }
2267     break;
2268
2269   case 19:
2270 #line 758 "parse.y"
2271     { ; }
2272     break;
2273
2274   case 20:
2275 #line 761 "parse.y"
2276     {
2277                         ((Class *)class)->nodes = class_nodes;
2278                         class_nodes = NULL;
2279                         nodes = g_list_append(nodes,class);
2280                                                 }
2281     break;
2282
2283   case 21:
2284 #line 766 "parse.y"
2285     {
2286                         ((Class *)class)->nodes = NULL;
2287                         class_nodes = NULL;
2288                         nodes = g_list_append(nodes,class);
2289                                                 }
2290     break;
2291
2292   case 22:
2293 #line 773 "parse.y"
2294     {
2295                         class = node_new (CLASS_NODE,
2296                                           "otype:steal", yyvsp[-3].id,
2297                                           "ptype:steal", yyvsp[-1].id,
2298                                           "bonobo_object_class:steal", bonobo_object_class,
2299                                           "glade_xml", glade_xml,
2300                                           "interfaces:steal", interfaces,
2301                                           "chunk_size:steal", chunk_size,
2302                                           NULL);
2303                         bonobo_object_class = NULL;
2304                         glade_xml = FALSE;
2305                         chunk_size = NULL;
2306                         interfaces = NULL;
2307                                                 }
2308     break;
2309
2310   case 24:
2311 #line 790 "parse.y"
2312     {
2313                         if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2314                                 g_free (chunk_size);
2315                                 chunk_size = g_strdup(yyvsp[-2].id);
2316                         } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2317                                 g_free (bonobo_object_class);
2318                                 bonobo_object_class = g_strdup(yyvsp[-2].id);
2319                         } else {
2320                                 yyerror(_("parse error"));
2321                                 YYERROR;
2322                         }
2323                 }
2324     break;
2325
2326   case 25:
2327 #line 802 "parse.y"
2328     {
2329                         if (strcmp (yyvsp[-3].id, "interface") == 0) {
2330                                 interfaces = g_list_append (interfaces,
2331                                                             g_strdup (yyvsp[-2].id));
2332                         } else {
2333                                 yyerror(_("parse error"));
2334                                 YYERROR;
2335                         }
2336                 }
2337     break;
2338
2339   case 26:
2340 #line 811 "parse.y"
2341     {
2342                         if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2343                                 g_free (chunk_size);
2344                                 if(atoi(yyvsp[-2].id) != 0)
2345                                         chunk_size = g_strdup(yyvsp[-2].id);
2346                                 else
2347                                         chunk_size = NULL;
2348                         } else {
2349                                 yyerror(_("parse error"));
2350                                 YYERROR;
2351                         }
2352                 }
2353     break;
2354
2355   case 27:
2356 #line 823 "parse.y"
2357     {
2358                         if (strcmp (yyvsp[-4].id, "GladeXML") == 0) {
2359                                 glade_xml = TRUE;
2360                                 add_construct_glade(yyvsp[-3].id, yyvsp[-2].id, NULL);
2361                         } else {
2362                                 yyerror(_("parse error"));
2363                                 YYERROR;
2364                         }
2365                 }
2366     break;
2367
2368   case 28:
2369 #line 832 "parse.y"
2370     {
2371                         if (strcmp (yyvsp[-5].id, "GladeXML") == 0) {
2372                                 glade_xml = TRUE;
2373                                 add_construct_glade(yyvsp[-4].id, yyvsp[-3].id, yyvsp[-2].id);
2374                         } else {
2375                                 yyerror(_("parse error"));
2376                                 YYERROR;
2377                         }
2378                 }
2379     break;
2380
2381   case 29:
2382 #line 841 "parse.y"
2383     {
2384                         if (strcmp (yyvsp[-4].id, "GladeXML") == 0) {
2385                                 glade_xml = TRUE;
2386                                 add_construct_glade(yyvsp[-3].id, yyvsp[-2].id, NULL);
2387                         } else {
2388                                 yyerror(_("parse error"));
2389                                 YYERROR;
2390                         }
2391                 }
2392     break;
2393
2394   case 30:
2395 #line 850 "parse.y"
2396     {
2397                         if (strcmp (yyvsp[-5].id, "GladeXML") == 0) {
2398                                 glade_xml = TRUE;
2399                                 add_construct_glade(yyvsp[-4].id, yyvsp[-3].id, yyvsp[-2].id);
2400                         } else {
2401                                 yyerror(_("parse error"));
2402                                 YYERROR;
2403                         }
2404                 }
2405     break;
2406
2407   case 31:
2408 #line 861 "parse.y"
2409     { ; }
2410     break;
2411
2412   case 32:
2413 #line 862 "parse.y"
2414     { ; }
2415     break;
2416
2417   case 33:
2418 #line 865 "parse.y"
2419     { ; }
2420     break;
2421
2422   case 34:
2423 #line 866 "parse.y"
2424     {
2425                         if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2426                                 g_free (yyvsp[-1].id);
2427                                 yyerror (_("parse error"));
2428                                 YYERROR;
2429                         }
2430                         g_free (yyvsp[-1].id);
2431                         last_added_method->bonobo_object_func = TRUE;
2432                                                 }
2433     break;
2434
2435   case 35:
2436 #line 875 "parse.y"
2437     {
2438                         if (strcmp (yyvsp[-2].id, "interface") != 0) {
2439                                 g_free (yyvsp[-2].id);
2440                                 g_free (yyvsp[-1].id);
2441                                 yyerror (_("parse error"));
2442                                 YYERROR;
2443                         }
2444                         g_free (yyvsp[-2].id);
2445                         node_set ((Node *)last_added_method,
2446                                   "interface:steal", yyvsp[-1].id,
2447                                   NULL);
2448                                                 }
2449     break;
2450
2451   case 36:
2452 #line 887 "parse.y"
2453     { ; }
2454     break;
2455
2456   case 37:
2457 #line 888 "parse.y"
2458     { ; }
2459     break;
2460
2461   case 38:
2462 #line 889 "parse.y"
2463     { ; }
2464     break;
2465
2466   case 39:
2467 #line 890 "parse.y"
2468     { ; }
2469     break;
2470
2471   case 40:
2472 #line 893 "parse.y"
2473     { the_scope = PUBLIC_SCOPE; }
2474     break;
2475
2476   case 41:
2477 #line 894 "parse.y"
2478     { the_scope = PRIVATE_SCOPE; }
2479     break;
2480
2481   case 42:
2482 #line 895 "parse.y"
2483     { the_scope = PROTECTED_SCOPE; }
2484     break;
2485
2486   case 43:
2487 #line 896 "parse.y"
2488     { the_scope = CLASS_SCOPE; }
2489     break;
2490
2491   case 44:
2492 #line 899 "parse.y"
2493     {
2494                         if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2495                                 g_free (yyvsp[-1].id);
2496                                 destructor_unref = FALSE;
2497                                 destructor = yyvsp[0].id;
2498                                 destructor_line = line_no;
2499                                 destructor_simple = TRUE;
2500                         } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2501                                 g_free (yyvsp[-1].id);
2502                                 destructor_unref = TRUE;
2503                                 destructor = yyvsp[0].id;
2504                                 destructor_line = line_no;
2505                                 destructor_simple = TRUE;
2506                         } else {
2507                                 g_free (yyvsp[-1].id);
2508                                 g_free (yyvsp[0].id);
2509                                 yyerror (_("parse error"));
2510                                 YYERROR;
2511                         }
2512                                 }
2513     break;
2514
2515   case 45:
2516 #line 919 "parse.y"
2517     {
2518                         if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2519                                 g_free(yyvsp[-2].id);
2520                                 destructor_unref = FALSE;
2521                                 destructor = (yyvsp[0].cbuf)->str;
2522                                 g_string_free(yyvsp[0].cbuf, FALSE);
2523                                 destructor_line = ccode_line;
2524                                 destructor_simple = FALSE;
2525                         } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2526                                 g_free (yyvsp[-2].id);
2527                                 destructor_unref = TRUE;
2528                                 destructor = (yyvsp[0].cbuf)->str;
2529                                 g_string_free (yyvsp[0].cbuf, FALSE);
2530                                 destructor_line = ccode_line;
2531                                 destructor_simple = FALSE;
2532                         } else {
2533                                 g_free (yyvsp[-2].id);
2534                                 g_string_free (yyvsp[0].cbuf, TRUE);
2535                                 yyerror (_("parse error"));
2536                                 YYERROR;
2537                         }
2538                                         }
2539     break;
2540
2541   case 46:
2542 #line 943 "parse.y"
2543     {
2544                         initializer = yyvsp[0].id;
2545                         initializer_line = ccode_line;
2546                                 }
2547     break;
2548
2549   case 47:
2550 #line 947 "parse.y"
2551     {
2552                         initializer = (yyvsp[0].cbuf)->str;
2553                         initializer_line = ccode_line;
2554                         g_string_free(yyvsp[0].cbuf, FALSE);
2555                                 }
2556     break;
2557
2558   case 48:
2559 #line 955 "parse.y"
2560     { ; }
2561     break;
2562
2563   case 49:
2564 #line 956 "parse.y"
2565     { ; }
2566     break;
2567
2568   case 50:
2569 #line 957 "parse.y"
2570     { destructor = NULL; }
2571     break;
2572
2573   case 51:
2574 #line 958 "parse.y"
2575     { initializer = NULL; }
2576     break;
2577
2578   case 52:
2579 #line 959 "parse.y"
2580     {
2581                         if (strcmp (yyvsp[0].id, "GladeXML") == 0) {
2582                                 glade_widget = TRUE;
2583                         } else {
2584                                 yyerror(_("parse error"));
2585                                 YYERROR;
2586                         }
2587                                         }
2588     break;
2589
2590   case 53:
2591 #line 967 "parse.y"
2592     {
2593                         destructor = NULL;
2594                         initializer = NULL;
2595                                         }
2596     break;
2597
2598   case 54:
2599 #line 973 "parse.y"
2600     {
2601                         push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2602                                                 }
2603     break;
2604
2605   case 55:
2606 #line 976 "parse.y"
2607     {
2608                         push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2609                                                 }
2610     break;
2611
2612   case 56:
2613 #line 981 "parse.y"
2614     {
2615                         Node *node = NULL;
2616                         if(strcmp(yyvsp[-6].id,"get")==0 &&
2617                            strcmp(yyvsp[-3].id,"set")==0) {
2618                                 Type *type = pop_type();
2619                                 g_free (yyvsp[-6].id); 
2620                                 g_free (yyvsp[-3].id);
2621                                 node = node_new (ARGUMENT_NODE,
2622                                                  "gtktype:steal", yyvsp[-9].id,
2623                                                  "atype:steal", type,
2624                                                  "flags:steal", yyvsp[-10].list,
2625                                                  "name:steal", yyvsp[-8].id,
2626                                                  "get:steal", (yyvsp[-4].cbuf)->str,
2627                                                  "get_line", yyvsp[-5].line,
2628                                                  "set:steal", (yyvsp[-1].cbuf)->str,
2629                                                  "set_line", yyvsp[-2].line,
2630                                                  "line_no", yyvsp[-11].line,
2631                                                  NULL);
2632
2633                                 class_nodes = g_list_append(class_nodes,node);
2634
2635                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2636                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2637
2638                         } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2639                                 strcmp(yyvsp[-3].id,"get")==0) {
2640                                 Type *type = pop_type();
2641                                 g_free (yyvsp[-6].id); 
2642                                 g_free (yyvsp[-3].id);
2643                                 node = node_new (ARGUMENT_NODE,
2644                                                  "gtktype:steal", yyvsp[-9].id,
2645                                                  "atype:steal", type,
2646                                                  "flags:steal", yyvsp[-10].list,
2647                                                  "name:steal", yyvsp[-8].id,
2648                                                  "get:steal", (yyvsp[-1].cbuf)->str,
2649                                                  "get_line", yyvsp[-2].line,
2650                                                  "set:steal", (yyvsp[-4].cbuf)->str,
2651                                                  "set_line", yyvsp[-5].line,
2652                                                  "line_no", yyvsp[-11].line,
2653                                                  NULL);
2654                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2655                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2656                                 class_nodes = g_list_append(class_nodes,node);
2657                         } else {
2658                                 g_free (yyvsp[-9].id); 
2659                                 g_free (yyvsp[-8].id);
2660                                 g_free (yyvsp[-6].id); 
2661                                 g_free (yyvsp[-3].id);
2662                                 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2663                                 g_list_free (yyvsp[-10].list);
2664                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2665                                 g_string_free (yyvsp[-4].cbuf, TRUE);
2666                                 yyerror (_("parse error"));
2667                                 YYERROR;
2668                         }
2669
2670                         if (yyvsp[-7].id != NULL) {
2671                                 Argument *arg = (Argument *)node;
2672                                 export_accessors (arg->name,
2673                                                   arg->get != NULL, arg->get_line,
2674                                                   arg->set != NULL, arg->set_line,
2675                                                   arg->atype,
2676                                                   arg->gtktype,
2677                                                   arg->line_no);
2678                                 g_free (yyvsp[-7].id);
2679                         } 
2680
2681                                                 }
2682     break;
2683
2684   case 57:
2685 #line 1049 "parse.y"
2686     {
2687                         Node *node = NULL;
2688                         if(strcmp(yyvsp[-3].id, "get") == 0) {
2689                                 Type *type = pop_type();
2690                                 g_free (yyvsp[-3].id);
2691                                 node = node_new (ARGUMENT_NODE,
2692                                                  "gtktype:steal", yyvsp[-6].id,
2693                                                  "atype:steal", type,
2694                                                  "flags:steal", yyvsp[-7].list,
2695                                                  "name:steal", yyvsp[-5].id,
2696                                                  "get:steal", (yyvsp[-1].cbuf)->str,
2697                                                  "get_line", yyvsp[-2].line,
2698                                                  "line_no", yyvsp[-8].line,
2699                                                  NULL);
2700
2701                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2702                                 class_nodes = g_list_append(class_nodes, node);
2703                         } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2704                                 Type *type = pop_type();
2705                                 g_free (yyvsp[-3].id);
2706                                 node = node_new (ARGUMENT_NODE,
2707                                                  "gtktype:steal", yyvsp[-6].id,
2708                                                  "atype:steal", type,
2709                                                  "flags:steal", yyvsp[-7].list,
2710                                                  "name:steal", yyvsp[-5].id,
2711                                                  "set:steal", (yyvsp[-1].cbuf)->str,
2712                                                  "set_line", yyvsp[-2].line,
2713                                                  "line_no", yyvsp[-8].line,
2714                                                  NULL);
2715
2716                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2717                                 class_nodes = g_list_append (class_nodes, node);
2718                         } else {
2719                                 g_free (yyvsp[-3].id); 
2720                                 g_free (yyvsp[-6].id);
2721                                 g_free (yyvsp[-5].id);
2722                                 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2723                                 g_list_free (yyvsp[-7].list);
2724                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2725                                 yyerror(_("parse error"));
2726                                 YYERROR;
2727                         }
2728
2729                         if (yyvsp[-4].id != NULL) {
2730                                 Argument *arg = (Argument *)node;
2731                                 export_accessors (arg->name,
2732                                                   arg->get != NULL, arg->get_line,
2733                                                   arg->set != NULL, arg->set_line,
2734                                                   arg->atype,
2735                                                   arg->gtktype,
2736                                                   arg->line_no);
2737                                 g_free (yyvsp[-4].id);
2738                         } 
2739                                                 }
2740     break;
2741
2742   case 58:
2743 #line 1103 "parse.y"
2744     {
2745                         Node *node;
2746                         char *get, *set = NULL;
2747                         Variable *var;
2748                         Type *type;
2749                         const char *root;
2750                         
2751                         if(strcmp(yyvsp[0].id, "link")!=0 &&
2752                            strcmp(yyvsp[0].id, "stringlink")!=0 && 
2753                            strcmp(yyvsp[0].id, "objectlink")!=0) {
2754                                 g_free(yyvsp[0].id); 
2755                                 g_free(yyvsp[-3].id);
2756                                 g_free(yyvsp[-2].id);
2757                                 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2758                                 g_list_free(yyvsp[-4].list);
2759                                 yyerror(_("parse error"));
2760                                 YYERROR;
2761                         }
2762
2763                         type = pop_type();
2764
2765                         var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2766                         if(var->scope == PRIVATE_SCOPE) {
2767                                 root = "self->_priv";
2768                         } else if(var->scope == CLASS_SCOPE) {
2769                                 root = "SELF_GET_CLASS(self)";
2770                                 if(no_self_alias)
2771                                         error_print(GOB_ERROR, yyvsp[-5].line,
2772                                                     _("Self aliases needed when autolinking to a classwide member"));
2773                         } else {
2774                                 root = "self";
2775                         }
2776
2777                         if(strcmp(yyvsp[0].id, "link")==0) {
2778                                 set = g_strdup_printf("%s->%s = ARG;",
2779                                                       root, yyvsp[-2].id);
2780                         } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2781                                 set = g_strdup_printf("g_free (%s->%s); "
2782                                                       "%s->%s = g_strdup (ARG);",
2783                                                       root, yyvsp[-2].id,
2784                                                       root, yyvsp[-2].id);
2785                         } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2786                                 set = g_strdup_printf(
2787                                   "if (ARG != NULL) "
2788                                    "g_object_ref (G_OBJECT (ARG)); "
2789                                   "if (%s->%s != NULL) "
2790                                    "g_object_unref (G_OBJECT (%s->%s)); "
2791                                   "%s->%s = ARG;",
2792                                   root, yyvsp[-2].id,
2793                                   root, yyvsp[-2].id,
2794                                   root, yyvsp[-2].id);
2795                         } else {
2796                                 g_assert_not_reached();
2797                         }
2798
2799                         get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2800   
2801                         g_free (yyvsp[0].id);
2802
2803                         if (type == NULL)
2804                                 type = (Type *)node_copy ((Node *)var->vtype);
2805
2806                         node = node_new (ARGUMENT_NODE,
2807                                          "gtktype:steal", yyvsp[-3].id,
2808                                          "atype:steal", type,
2809                                          "flags:steal", yyvsp[-4].list,
2810                                          "name:steal", yyvsp[-2].id,
2811                                          "get:steal", get,
2812                                          "get_line", yyvsp[-5].line,
2813                                          "set:steal", set,
2814                                          "set_line", yyvsp[-5].line,
2815                                          "line_no", yyvsp[-5].line,
2816                                          NULL);
2817
2818                         if (yyvsp[-1].id != NULL) {
2819                                 Argument *arg = (Argument *)node;
2820                                 export_accessors (arg->name,
2821                                                   arg->get != NULL, arg->get_line,
2822                                                   arg->set != NULL, arg->set_line,
2823                                                   arg->atype,
2824                                                   arg->gtktype,
2825                                                   arg->line_no);
2826                                 g_free (yyvsp[-1].id);
2827                         } 
2828
2829                         class_nodes = g_list_append (class_nodes, node);
2830                                                 }
2831     break;
2832
2833   case 59:
2834 #line 1192 "parse.y"
2835     {
2836                         if (strcmp (yyvsp[-1].id, "export")!=0) {
2837                                 g_free (yyvsp[-1].id); 
2838                                 yyerror (_("parse error"));
2839                                 YYERROR;
2840                         }
2841                         yyval.id = yyvsp[-1].id;
2842                                                 }
2843     break;
2844
2845   case 60:
2846 #line 1200 "parse.y"
2847     {
2848                         yyval.id = NULL;
2849                                                 }
2850     break;
2851
2852   case 61:
2853 #line 1205 "parse.y"
2854     {
2855                         ensure_property ();
2856                         node_set ((Node *)property,
2857                                   "line_no", yyvsp[-10].line,
2858                                   "gtktype:steal", debool (yyvsp[-9].id),
2859                                   "name:steal", yyvsp[-8].id,
2860                                   NULL);
2861                         if (strcmp (yyvsp[-6].id, "get") == 0 &&
2862                             strcmp (yyvsp[-3].id, "set") == 0) {
2863                                 node_set ((Node *)property,
2864                                           "get:steal", (yyvsp[-4].cbuf)->str,
2865                                           "get_line", yyvsp[-5].line,
2866                                           "set:steal", (yyvsp[-1].cbuf)->str,
2867                                           "set_line", yyvsp[-2].line,
2868                                           NULL);
2869                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2870                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2871                                 g_free (yyvsp[-6].id); 
2872                                 g_free (yyvsp[-3].id);
2873                         } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2874                                    strcmp (yyvsp[-3].id, "get") == 0) {
2875                                 node_set ((Node *)property,
2876                                           "get:steal", (yyvsp[-1].cbuf)->str,
2877                                           "get_line", yyvsp[-2].line,
2878                                           "set:steal", (yyvsp[-4].cbuf)->str,
2879                                           "set_line", yyvsp[-5].line,
2880                                           NULL);
2881                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2882                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2883                                 g_free (yyvsp[-6].id); 
2884                                 g_free (yyvsp[-3].id);
2885                         } else {
2886                                 g_string_free (yyvsp[-4].cbuf, TRUE);
2887                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2888                                 g_free (yyvsp[-6].id); 
2889                                 g_free (yyvsp[-3].id);
2890                                 node_free ((Node *)property);
2891                                 property = NULL;
2892                                 yyerror (_("parse error"));
2893                                 YYERROR;
2894                         }
2895                         property_link_and_export ((Node *)property);
2896                         if (property != NULL) {
2897                                 class_nodes = g_list_append (class_nodes,
2898                                                              property);
2899                                 property = NULL;
2900                         }
2901                 }
2902     break;
2903
2904   case 62:
2905 #line 1253 "parse.y"
2906     {
2907                         ensure_property ();
2908                         node_set ((Node *)property,
2909                                   "line_no", yyvsp[-7].line,
2910                                   "gtktype:steal", debool (yyvsp[-6].id),
2911                                   "name:steal", yyvsp[-5].id,
2912                                   NULL);
2913                         if (strcmp (yyvsp[-3].id, "get") == 0) {
2914                                 node_set ((Node *)property,
2915                                           "get:steal", (yyvsp[-1].cbuf)->str,
2916                                           "get_line", yyvsp[-2].line,
2917                                           NULL);
2918                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2919                                 g_free (yyvsp[-3].id); 
2920                         } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2921                                 node_set ((Node *)property,
2922                                           "set:steal", (yyvsp[-1].cbuf)->str,
2923                                           "set_line", yyvsp[-2].line,
2924                                           NULL);
2925                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2926                                 g_free (yyvsp[-3].id); 
2927                         } else {
2928                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2929                                 g_free (yyvsp[-3].id); 
2930                                 node_free ((Node *)property);
2931                                 property = NULL;
2932                                 yyerror (_("parse error"));
2933                                 YYERROR;
2934                         }
2935                         property_link_and_export ((Node *)property);
2936                         if (property != NULL) {
2937                                 class_nodes = g_list_append (class_nodes,
2938                                                              property);
2939                                 property = NULL;
2940                         }
2941                 }
2942     break;
2943
2944   case 63:
2945 #line 1289 "parse.y"
2946     {
2947                         ensure_property ();
2948                         node_set ((Node *)property,
2949                                   "line_no", yyvsp[-4].line,
2950                                   "gtktype:steal", debool (yyvsp[-3].id),
2951                                   "name:steal", yyvsp[-2].id,
2952                                   NULL);
2953                         property_link_and_export ((Node *)property);
2954                         if (property != NULL) {
2955                                 class_nodes = g_list_append (class_nodes,
2956                                                              property);
2957                                 property = NULL;
2958                         }
2959                 }
2960     break;
2961
2962   case 64:
2963 #line 1305 "parse.y"
2964     { ; }
2965     break;
2966
2967   case 65:
2968 #line 1306 "parse.y"
2969     { ; }
2970     break;
2971
2972   case 66:
2973 #line 1309 "parse.y"
2974     { ; }
2975     break;
2976
2977   case 67:
2978 #line 1310 "parse.y"
2979     { ; }
2980     break;
2981
2982   case 68:
2983 #line 1313 "parse.y"
2984     { yyval.id = yyvsp[0].id; }
2985     break;
2986
2987   case 69:
2988 #line 1314 "parse.y"
2989     {
2990                         if (strcmp (yyvsp[-3].id, "_") != 0) {
2991                                 g_free (yyvsp[-3].id);
2992                                 yyerror(_("parse error"));
2993                                 YYERROR;
2994                         }
2995                         g_free (yyvsp[-3].id);
2996                         yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2997                         g_free (yyvsp[-1].id);
2998                 }
2999     break;
3000
3001   case 70:
3002 #line 1326 "parse.y"
3003     { yyval.id = yyvsp[0].id; }
3004     break;
3005
3006   case 71:
3007 #line 1327 "parse.y"
3008     { yyval.id = yyvsp[0].id; }
3009     break;
3010
3011   case 72:
3012 #line 1330 "parse.y"
3013     {
3014                 ensure_property ();
3015                 node_set ((Node *)property,
3016                           "nick:steal", yyvsp[0].id,
3017                           NULL);
3018                   }
3019     break;
3020
3021   case 73:
3022 #line 1336 "parse.y"
3023     {
3024                 ensure_property ();
3025                 node_set ((Node *)property,
3026                           "blurb:steal", yyvsp[0].id,
3027                           NULL);
3028                   }
3029     break;
3030
3031   case 74:
3032 #line 1342 "parse.y"
3033     {
3034                 ensure_property ();
3035                 node_set ((Node *)property,
3036                           "maximum:steal", yyvsp[0].id,
3037                           NULL);
3038                   }
3039     break;
3040
3041   case 75:
3042 #line 1348 "parse.y"
3043     {
3044                 ensure_property ();
3045                 node_set ((Node *)property,
3046                           "minimum:steal", yyvsp[0].id,
3047                           NULL);
3048                   }
3049     break;
3050
3051   case 76:
3052 #line 1354 "parse.y"
3053     {
3054                 ensure_property ();
3055                 node_set ((Node *)property,
3056                           "default_value:steal", yyvsp[0].id,
3057                           NULL);
3058                   }
3059     break;
3060
3061   case 77:
3062 #line 1360 "parse.y"
3063     {
3064                 ensure_property ();
3065                 node_set ((Node *)property,
3066                           "flags:steal", yyvsp[0].list,
3067                           NULL);
3068                   }
3069     break;
3070
3071   case 78:
3072 #line 1366 "parse.y"
3073     {
3074                 Type *type = pop_type ();
3075                 ensure_property ();
3076                 node_set ((Node *)property,
3077                           "ptype:steal", type,
3078                           NULL);
3079                   }
3080     break;
3081
3082   case 79:
3083 #line 1373 "parse.y"
3084     {
3085                 ensure_property ();
3086                 node_set ((Node *)property,
3087                           "extra_gtktype:steal", yyvsp[0].id,
3088                           NULL);
3089                   }
3090     break;
3091
3092   case 80:
3093 #line 1379 "parse.y"
3094     {
3095                 ensure_property ();
3096                 node_set ((Node *)property,
3097                           "extra_gtktype:steal", yyvsp[0].id,
3098                           NULL);
3099                   }
3100     break;
3101
3102   case 81:
3103 #line 1385 "parse.y"
3104     {
3105                 ensure_property ();
3106                 node_set ((Node *)property,
3107                           "extra_gtktype:steal", yyvsp[0].id,
3108                           NULL);
3109                   }
3110     break;
3111
3112   case 82:
3113 #line 1391 "parse.y"
3114     {
3115                 ensure_property ();
3116                 node_set ((Node *)property,
3117                           "extra_gtktype:steal", yyvsp[0].id,
3118                           NULL);
3119                   }
3120     break;
3121
3122   case 83:
3123 #line 1397 "parse.y"
3124     {
3125                 ensure_property ();
3126                 node_set ((Node *)property,
3127                           "extra_gtktype:steal", yyvsp[0].id,
3128                           NULL);
3129                   }
3130     break;
3131
3132   case 84:
3133 #line 1403 "parse.y"
3134     {
3135                 ensure_property ();
3136                 node_set ((Node *)property,
3137                           "extra_gtktype:steal", yyvsp[0].id,
3138                           NULL);
3139                   }
3140     break;
3141
3142   case 85:
3143 #line 1409 "parse.y"
3144     {
3145                 ensure_property ();
3146                 node_set ((Node *)property,
3147                           "extra_gtktype:steal", yyvsp[0].id,
3148                           NULL);
3149                   }
3150     break;
3151
3152   case 86:
3153 #line 1415 "parse.y"
3154     {
3155                 ensure_property ();
3156                 node_set ((Node *)property,
3157                           "extra_gtktype:steal", yyvsp[0].id,
3158                           NULL);
3159                   }
3160     break;
3161
3162   case 87:
3163 #line 1421 "parse.y"
3164     {
3165                 ensure_property ();
3166                 node_set ((Node *)property,
3167                           "extra_gtktype:steal", yyvsp[0].id,
3168                           NULL);
3169                   }
3170     break;
3171
3172   case 88:
3173 #line 1427 "parse.y"
3174     {
3175                 ensure_property ();
3176                 node_set ((Node *)property,
3177                           "extra_gtktype:steal", yyvsp[0].id,
3178                           NULL);
3179                   }
3180     break;
3181
3182   case 89:
3183 #line 1433 "parse.y"
3184     {
3185                 ensure_property ();
3186                 if (strcmp (yyvsp[0].id, "override") == 0) {
3187                         g_free(yyvsp[0].id);
3188                         node_set ((Node *)property,
3189                                   "override", TRUE,
3190                                   NULL);
3191                 } else if (strcmp (yyvsp[0].id, "link") == 0) {
3192                         g_free(yyvsp[0].id);
3193                         node_set ((Node *)property,
3194                                   "link", TRUE,
3195                                   NULL);
3196                 } else if (strcmp (yyvsp[0].id, "export") == 0) {
3197                         g_free(yyvsp[0].id);
3198                         node_set ((Node *)property,
3199                                   "export", TRUE,
3200                                   NULL);
3201                 } else {
3202                         g_free(yyvsp[0].id);
3203                         yyerror(_("parse error"));
3204                         YYERROR;
3205                 }
3206                   }
3207     break;
3208
3209   case 90:
3210 #line 1458 "parse.y"
3211     {
3212                         if(strcmp(yyvsp[-2].id,"type")!=0) {
3213                                 g_free(yyvsp[-4].id);
3214                                 g_free(yyvsp[-2].id);
3215                                 yyerror(_("parse error"));
3216                                 YYERROR;
3217                         }
3218                         yyval.id = debool (yyvsp[-4].id);
3219                                                 }
3220     break;
3221
3222   case 91:
3223 #line 1467 "parse.y"
3224     {
3225                         yyval.id = debool (yyvsp[0].id);
3226                         typestack = g_list_prepend(typestack,NULL);
3227                                                 }
3228     break;
3229
3230   case 92:
3231 #line 1473 "parse.y"
3232     { yyval.list = yyvsp[-1].list; }
3233     break;
3234
3235   case 93:
3236 #line 1474 "parse.y"
3237     { yyval.list = NULL; }
3238     break;
3239
3240   case 94:
3241 #line 1477 "parse.y"
3242     {
3243                         yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
3244                                                 }
3245     break;
3246
3247   case 95:
3248 #line 1480 "parse.y"
3249     {
3250                         yyval.list = g_list_append(NULL,yyvsp[0].id);
3251                                                 }
3252     break;
3253
3254   case 96:
3255 #line 1486 "parse.y"
3256     {
3257                         Node *node = node_new (TYPE_NODE, 
3258                                                "name:steal", yyvsp[-1].id,
3259                                                "pointer:steal", yyvsp[0].id,
3260                                                NULL);
3261                         typestack = g_list_prepend(typestack,node);
3262                                                         }
3263     break;
3264
3265   case 97:
3266 #line 1493 "parse.y"
3267     {
3268                         Node *node = node_new (TYPE_NODE, 
3269                                                "name:steal", yyvsp[0].id,
3270                                                NULL);
3271                         typestack = g_list_prepend(typestack,node);
3272                                                         }
3273     break;
3274
3275   case 98:
3276 #line 1502 "parse.y"
3277     {
3278                         yyval.id = yyvsp[0].id;
3279                                                         }
3280     break;
3281
3282   case 99:
3283 #line 1505 "parse.y"
3284     {
3285                         yyval.id = yyvsp[0].id;
3286                                                         }
3287     break;
3288
3289   case 100:
3290 #line 1508 "parse.y"
3291     {
3292                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3293                         g_free(yyvsp[0].id);
3294                                                         }
3295     break;
3296
3297   case 101:
3298 #line 1512 "parse.y"
3299     {
3300                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3301                         g_free(yyvsp[-1].id);
3302                                                         }
3303     break;
3304
3305   case 102:
3306 #line 1516 "parse.y"
3307     {
3308                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3309                         g_free(yyvsp[0].id);
3310                                                         }
3311     break;
3312
3313   case 103:
3314 #line 1520 "parse.y"
3315     {
3316                         yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
3317                                              yyvsp[0].id, NULL);
3318                         g_free(yyvsp[0].id);
3319                                                         }
3320     break;
3321
3322   case 104:
3323 #line 1525 "parse.y"
3324     {
3325                         yyval.id = g_strconcat(yyvsp[-2].id, " ",
3326                                              yyvsp[-1].id, " const", NULL);
3327                         g_free(yyvsp[-1].id);
3328                                                         }
3329     break;
3330
3331   case 105:
3332 #line 1533 "parse.y"
3333     {
3334                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3335                         g_free(yyvsp[0].id);
3336                                                         }
3337     break;
3338
3339   case 106:
3340 #line 1537 "parse.y"
3341     {
3342                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3343                         g_free(yyvsp[-1].id);
3344                         g_free(yyvsp[0].id);
3345                                                         }
3346     break;
3347
3348   case 107:
3349 #line 1542 "parse.y"
3350     {
3351                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3352                         g_free(yyvsp[0].id);
3353                                                         }
3354     break;
3355
3356   case 108:
3357 #line 1546 "parse.y"
3358     {
3359                         yyval.id = yyvsp[0].id;
3360                                                         }
3361     break;
3362
3363   case 109:
3364 #line 1549 "parse.y"
3365     {
3366                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3367                         g_free(yyvsp[-1].id);
3368                                                         }
3369     break;
3370
3371   case 110:
3372 #line 1553 "parse.y"
3373     {
3374                         yyval.id = g_strdup(yyvsp[0].id);
3375                                                         }
3376     break;
3377
3378   case 111:
3379 #line 1556 "parse.y"
3380     {
3381                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3382                                                         }
3383     break;
3384
3385   case 112:
3386 #line 1561 "parse.y"
3387     { yyval.id = "void"; }
3388     break;
3389
3390   case 113:
3391 #line 1562 "parse.y"
3392     { yyval.id = "char"; }
3393     break;
3394
3395   case 114:
3396 #line 1563 "parse.y"
3397     { yyval.id = "short"; }
3398     break;
3399
3400   case 115:
3401 #line 1564 "parse.y"
3402     { yyval.id = "int"; }
3403     break;
3404
3405   case 116:
3406 #line 1565 "parse.y"
3407     { yyval.id = "long"; }
3408     break;
3409
3410   case 117:
3411 #line 1566 "parse.y"
3412     { yyval.id = "float"; }
3413     break;
3414
3415   case 118:
3416 #line 1567 "parse.y"
3417     { yyval.id = "double"; }
3418     break;
3419
3420   case 119:
3421 #line 1568 "parse.y"
3422     { yyval.id = "signed"; }
3423     break;
3424
3425   case 120:
3426 #line 1569 "parse.y"
3427     { yyval.id = "unsigned"; }
3428     break;
3429
3430   case 121:
3431 #line 1572 "parse.y"
3432     { yyval.id = "struct"; }
3433     break;
3434
3435   case 122:
3436 #line 1573 "parse.y"
3437     { yyval.id = "union"; }
3438     break;
3439
3440   case 123:
3441 #line 1574 "parse.y"
3442     { yyval.id = "enum"; }
3443     break;
3444
3445   case 124:
3446 #line 1577 "parse.y"
3447     { yyval.id = g_strdup("*"); }
3448     break;
3449
3450   case 125:
3451 #line 1578 "parse.y"
3452     { yyval.id = g_strdup("* const"); }
3453     break;
3454
3455   case 126:
3456 #line 1579 "parse.y"
3457     {
3458                                 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
3459                                 g_free(yyvsp[0].id);
3460                                         }
3461     break;
3462
3463   case 127:
3464 #line 1583 "parse.y"
3465     {
3466                                 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3467                                 g_free(yyvsp[0].id);
3468                                         }
3469     break;
3470
3471   case 128:
3472 #line 1590 "parse.y"
3473     {
3474                         if(strcmp(yyvsp[-1].id, "first")==0)
3475                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3476                         else if(strcmp(yyvsp[-1].id, "last")==0)
3477                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3478                         else {
3479                                 yyerror(_("signal must be 'first' or 'last'"));
3480                                 g_free(yyvsp[-1].id);
3481                                 YYERROR;
3482                         }
3483                         g_free(yyvsp[-1].id);
3484                                         }
3485     break;
3486
3487   case 129:
3488 #line 1602 "parse.y"
3489     {
3490                         yyval.sigtype = SIGNAL_LAST_METHOD;
3491                                         }
3492     break;
3493
3494   case 130:
3495 #line 1608 "parse.y"
3496     {
3497                         if(strcmp(yyvsp[-1].id,"first")==0)
3498                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3499                         else if(strcmp(yyvsp[-1].id,"last")==0)
3500                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3501                         else {
3502                                 yyerror(_("signal must be 'first' or 'last'"));
3503                                 g_free(yyvsp[-1].id);
3504                                 YYERROR;
3505                         }
3506                         g_free(yyvsp[-1].id);
3507                                         }
3508     break;
3509
3510   case 131:
3511 #line 1620 "parse.y"
3512     {
3513                         if(strcmp(yyvsp[-2].id,"first")==0)
3514                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3515                         else if(strcmp(yyvsp[-2].id,"last")==0)
3516                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3517                         else {
3518                                 yyerror(_("signal must be 'first' or 'last'"));
3519                                 g_free(yyvsp[-2].id);
3520                                 YYERROR;
3521                         }
3522                         g_free(yyvsp[-2].id);
3523                                         }
3524     break;
3525
3526   case 132:
3527 #line 1632 "parse.y"
3528     {
3529                         yyval.sigtype = SIGNAL_LAST_METHOD;
3530                                         }
3531     break;
3532
3533   case 133:
3534 #line 1635 "parse.y"
3535     {
3536                         /* the_scope was default thus public */
3537                         the_scope = PUBLIC_SCOPE;
3538                                         }
3539     break;
3540
3541   case 134:
3542 #line 1641 "parse.y"
3543     {
3544                         gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3545                                                 }
3546     break;
3547
3548   case 135:
3549 #line 1646 "parse.y"
3550     {
3551                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3552                                                 }
3553     break;
3554
3555   case 136:
3556 #line 1649 "parse.y"
3557     { 
3558                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3559                                                 }
3560     break;
3561
3562   case 137:
3563 #line 1654 "parse.y"
3564     { yyval.cbuf = yyvsp[0].cbuf; }
3565     break;
3566
3567   case 138:
3568 #line 1655 "parse.y"
3569     { yyval.cbuf = NULL; }
3570     break;
3571
3572   case 139:
3573 #line 1659 "parse.y"
3574     {
3575                         if(!has_self) {
3576                                 yyerror(_("signal without 'self' as "
3577                                           "first parameter"));
3578                                 free_all_global_state();
3579                                 YYERROR;
3580                         }
3581                         if(the_scope == CLASS_SCOPE) {
3582                                 yyerror(_("a method cannot be of class scope"));
3583                                 free_all_global_state();
3584                                 YYERROR;
3585                         }
3586                         push_function(the_scope, yyvsp[-7].sigtype,NULL,
3587                                       yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3588                                       ccode_line, vararg, yyvsp[-8].list);
3589                                                                         }
3590     break;
3591
3592   case 140:
3593 #line 1675 "parse.y"
3594     {
3595                         if(!has_self) {
3596                                 yyerror(_("signal without 'self' as "
3597                                           "first parameter"));
3598                                 free_all_global_state();
3599                                 YYERROR;
3600                         }
3601                         if(the_scope == CLASS_SCOPE) {
3602                                 yyerror(_("a method cannot be of class scope"));
3603                                 free_all_global_state();
3604                                 YYERROR;
3605                         }
3606                         push_function(the_scope, yyvsp[-7].sigtype, NULL,
3607                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3608                                       ccode_line, vararg, yyvsp[-8].list);
3609                                                                         }
3610     break;
3611
3612   case 141:
3613 #line 1691 "parse.y"
3614     {
3615                         if(!has_self) {
3616                                 yyerror(_("virtual method without 'self' as "
3617                                           "first parameter"));
3618                                 free_all_global_state();
3619                                 YYERROR;
3620                         }
3621                         if(the_scope == CLASS_SCOPE) {
3622                                 yyerror(_("a method cannot be of class scope"));
3623                                 free_all_global_state();
3624                                 YYERROR;
3625                         }
3626                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3627                                       yyvsp[0].cbuf, yyvsp[-8].line,
3628                                       ccode_line, vararg, NULL);
3629                                                                         }
3630     break;
3631
3632   case 142:
3633 #line 1707 "parse.y"
3634     {
3635                         if(!has_self) {
3636                                 yyerror(_("virtual method without 'self' as "
3637                                           "first parameter"));
3638                                 free_all_global_state();
3639                                 YYERROR;
3640                         }
3641                         if(the_scope == CLASS_SCOPE) {
3642                                 yyerror(_("a method cannot be of class scope"));
3643                                 free_all_global_state();
3644                                 YYERROR;
3645                         }
3646                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3647                                       yyvsp[0].cbuf, yyvsp[-7].line,
3648                                       ccode_line, vararg, NULL);
3649                                                                         }
3650     break;
3651
3652   case 143:
3653 #line 1723 "parse.y"
3654     {
3655                         if(!has_self) {
3656                                 yyerror(_("virtual method without 'self' as "
3657                                           "first parameter"));
3658                                 free_all_global_state();
3659                                 YYERROR;
3660                         }
3661                         push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3662                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3663                                       ccode_line, vararg, NULL);
3664                                                                         }
3665     break;
3666
3667   case 144:
3668 #line 1734 "parse.y"
3669     {
3670                         push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3671                                       yyvsp[-5].id, yyvsp[0].cbuf,
3672                                       yyvsp[-10].line, ccode_line,
3673                                       vararg, NULL);
3674                                                                         }
3675     break;
3676
3677   case 145:
3678 #line 1740 "parse.y"
3679     {
3680                         if(the_scope == CLASS_SCOPE) {
3681                                 yyerror(_("a method cannot be of class scope"));
3682                                 free_all_global_state();
3683                                 YYERROR;
3684                         }
3685                         push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3686                                       yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3687                                       vararg, NULL);
3688                                                                 }
3689     break;
3690
3691   case 146:
3692 #line 1750 "parse.y"
3693     {
3694                         if(strcmp(yyvsp[-4].id, "init")==0) {
3695                                 push_init_arg(yyvsp[-2].id,FALSE);
3696                                 push_function(NO_SCOPE, INIT_METHOD, NULL,
3697                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3698                                               ccode_line, FALSE, NULL);
3699                         } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3700                                 push_init_arg(yyvsp[-2].id,TRUE);
3701                                 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3702                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3703                                               ccode_line, FALSE, NULL);
3704                         } else {
3705                                 g_free(yyvsp[-4].id);
3706                                 g_free(yyvsp[-2].id);
3707                                 g_string_free(yyvsp[0].cbuf,TRUE);
3708                                 yyerror(_("parse error "
3709                                           "(untyped blocks must be init or "
3710                                           "class_init)"));
3711                                 YYERROR;
3712                         }
3713                                                 }
3714     break;
3715
3716   case 147:
3717 #line 1773 "parse.y"
3718     {
3719                         g_free(onerror); onerror = NULL;
3720                         g_free(defreturn); defreturn = NULL;
3721                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3722                                 g_free(yyvsp[-1].id);
3723                                 g_free(yyvsp[0].id);
3724                                 yyerror(_("parse error"));
3725                                 YYERROR;
3726                         }
3727                         g_free(yyvsp[-1].id);
3728                                         }
3729     break;
3730
3731   case 148:
3732 #line 1784 "parse.y"
3733     {
3734                         g_free(onerror); onerror = NULL;
3735                         g_free(defreturn); defreturn = NULL;
3736                         if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3737                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3738                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3739                                 yyerror(_("parse error"));
3740                                 YYERROR;
3741                         }
3742                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3743                                 onerror = defreturn = NULL;
3744                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3745                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3746                                 yyerror(_("parse error"));
3747                                 YYERROR;
3748                         }
3749                         g_free(yyvsp[-3].id);
3750                         g_free(yyvsp[-1].id);
3751                                                 }
3752     break;
3753
3754   case 149:
3755 #line 1803 "parse.y"
3756     {
3757                         g_free(onerror); onerror = NULL;
3758                         g_free(defreturn); defreturn = NULL;
3759                                         }
3760     break;
3761
3762   case 150:
3763 #line 1809 "parse.y"
3764     { yyval.id = yyvsp[0].id; }
3765     break;
3766
3767   case 151:
3768 #line 1810 "parse.y"
3769     {
3770                         yyval.id = (yyvsp[0].cbuf)->str;
3771                         g_string_free(yyvsp[0].cbuf, FALSE);
3772                                         }
3773     break;
3774
3775   case 152:
3776 #line 1816 "parse.y"
3777     { vararg = FALSE; has_self = FALSE; }
3778     break;
3779
3780   case 153:
3781 #line 1817 "parse.y"
3782     {
3783                         vararg = FALSE;
3784                         has_self = TRUE;
3785                         if(strcmp(yyvsp[0].id,"self")==0)
3786                                 push_self(yyvsp[0].id, FALSE);
3787                         else {
3788                                 g_free(yyvsp[0].id);
3789                                 yyerror(_("parse error"));
3790                                 YYERROR;
3791                         }
3792                                         }
3793     break;
3794
3795   case 154:
3796 #line 1828 "parse.y"
3797     {
3798                         vararg = FALSE;
3799                         has_self = TRUE;
3800                         if(strcmp(yyvsp[-1].id,"self")==0)
3801                                 push_self(yyvsp[-1].id, TRUE);
3802                         else {
3803                                 g_free(yyvsp[-1].id);
3804                                 yyerror(_("parse error"));
3805                                 YYERROR;
3806                         }
3807                                         }
3808     break;
3809
3810   case 155:
3811 #line 1839 "parse.y"
3812     {
3813                         vararg = FALSE;
3814                         has_self = TRUE;
3815                         if(strcmp(yyvsp[0].id,"self")==0)
3816                                 push_self(yyvsp[0].id, TRUE);
3817                         else {
3818                                 g_free(yyvsp[0].id);
3819                                 yyerror(_("parse error"));
3820                                 YYERROR;
3821                         }
3822                                         }
3823     break;
3824
3825   case 156:
3826 #line 1850 "parse.y"
3827     {
3828                         has_self = TRUE;
3829                         if(strcmp(yyvsp[-2].id,"self")==0)
3830                                 push_self(yyvsp[-2].id, FALSE);
3831                         else {
3832                                 g_free(yyvsp[-2].id);
3833                                 yyerror(_("parse error"));
3834                                 YYERROR;
3835                         }
3836                                         }
3837     break;
3838
3839   case 157:
3840 #line 1860 "parse.y"
3841     {
3842                         has_self = TRUE;
3843                         if(strcmp(yyvsp[-3].id,"self")==0)
3844                                 push_self(yyvsp[-3].id, TRUE);
3845                         else {
3846                                 g_free(yyvsp[-3].id);
3847                                 yyerror(_("parse error"));
3848                                 YYERROR;
3849                         }
3850                                         }
3851     break;
3852
3853   case 158:
3854 #line 1870 "parse.y"
3855     {
3856                         has_self = TRUE;
3857                         if(strcmp(yyvsp[-2].id,"self")==0)
3858                                 push_self(yyvsp[-2].id, TRUE);
3859                         else {
3860                                 g_free(yyvsp[-2].id);
3861                                 yyerror(_("parse error"));
3862                                 YYERROR;
3863                         }
3864                                         }
3865     break;
3866
3867   case 159:
3868 #line 1880 "parse.y"
3869     { has_self = FALSE; }
3870     break;
3871
3872   case 160:
3873 #line 1883 "parse.y"
3874     { vararg = TRUE; }
3875     break;
3876
3877   case 161:
3878 #line 1884 "parse.y"
3879     { vararg = FALSE; }
3880     break;
3881
3882   case 162:
3883 #line 1887 "parse.y"
3884     { ; }
3885     break;
3886
3887   case 163:
3888 #line 1888 "parse.y"
3889     { ; }
3890     break;
3891
3892   case 164:
3893 #line 1891 "parse.y"
3894     {
3895                         push_funcarg(yyvsp[0].id,NULL);
3896                                                                 }
3897     break;
3898
3899   case 165:
3900 #line 1894 "parse.y"
3901     {
3902                         push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3903                                                                 }
3904     break;
3905
3906   case 166:
3907 #line 1897 "parse.y"
3908     {
3909                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3910                                 yyerror(_("parse error"));
3911                                 YYERROR;
3912                         }
3913                         g_free(yyvsp[-2].id);
3914                         push_funcarg(yyvsp[-4].id,NULL);
3915                                                                 }
3916     break;
3917
3918   case 167:
3919 #line 1905 "parse.y"
3920     {
3921                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3922                                 yyerror(_("parse error"));
3923                                 YYERROR;
3924                         }
3925                         g_free(yyvsp[-2].id);
3926                         push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3927                                                                 }
3928     break;
3929
3930   case 168:
3931 #line 1915 "parse.y"
3932     { ; }
3933     break;
3934
3935   case 169:
3936 #line 1916 "parse.y"
3937     { ; }
3938     break;
3939
3940   case 170:
3941 #line 1919 "parse.y"
3942     {
3943                         if(strcmp(yyvsp[0].id,"type")==0) {
3944                                 Node *node = node_new (CHECK_NODE,
3945                                                        "chtype", TYPE_CHECK,
3946                                                        NULL);
3947                                 checks = g_list_append(checks,node);
3948                         } else if(strcmp(yyvsp[0].id,"null")==0) {
3949                                 Node *node = node_new (CHECK_NODE,
3950                                                        "chtype", NULL_CHECK,
3951                                                        NULL);
3952                                 checks = g_list_append(checks,node);
3953                         } else {
3954                                 yyerror(_("parse error"));
3955                                 YYERROR;
3956                         }
3957                         g_free(yyvsp[0].id);
3958                                         }
3959     break;
3960
3961   case 171:
3962 #line 1936 "parse.y"
3963     {
3964                         Node *node = node_new (CHECK_NODE,
3965                                                "chtype", GT_CHECK,
3966                                                "number:steal", yyvsp[0].id,
3967                                                NULL);
3968                         checks = g_list_append(checks,node);
3969                                         }
3970     break;
3971
3972   case 172:
3973 #line 1943 "parse.y"
3974     {
3975                         Node *node = node_new (CHECK_NODE,
3976                                                "chtype", LT_CHECK,
3977                                                "number:steal", yyvsp[0].id,
3978                                                NULL);
3979                         checks = g_list_append(checks,node);
3980                                         }
3981     break;
3982
3983   case 173:
3984 #line 1950 "parse.y"
3985     {
3986                         Node *node = node_new (CHECK_NODE,
3987                                                "chtype", GE_CHECK,
3988                                                "number:steal", yyvsp[0].id,
3989                                                NULL);
3990                         checks = g_list_append(checks,node);
3991                                         }
3992     break;
3993
3994   case 174:
3995 #line 1957 "parse.y"
3996     {
3997                         Node *node = node_new (CHECK_NODE,
3998                                                "chtype", LE_CHECK,
3999                                                "number:steal", yyvsp[0].id,
4000                                                NULL);
4001                         checks = g_list_append(checks,node);
4002                                         }
4003     break;
4004
4005   case 175:
4006 #line 1964 "parse.y"
4007     {
4008                         Node *node = node_new (CHECK_NODE,
4009                                                "chtype", EQ_CHECK,
4010                                                "number:steal", yyvsp[0].id,
4011                                                NULL);
4012                         checks = g_list_append(checks,node);
4013                                         }
4014     break;
4015
4016   case 176:
4017 #line 1971 "parse.y"
4018     {
4019                         Node *node = node_new (CHECK_NODE,
4020                                                "chtype", NE_CHECK,
4021                                                "number:steal", yyvsp[0].id,
4022                                                NULL);
4023                         checks = g_list_append(checks,node);
4024                                         }
4025     break;
4026
4027   case 177:
4028 #line 1980 "parse.y"
4029     {
4030                         Node *node = node_new (ENUMDEF_NODE,
4031                                                "etype:steal", yyvsp[-1].id,
4032                                                "prefix:steal", yyvsp[-5].id,
4033                                                "values:steal", enum_vals,
4034                                                NULL);
4035                         enum_vals = NULL;
4036                         nodes = g_list_append (nodes, node);
4037                         }
4038     break;
4039
4040   case 178:
4041 #line 1989 "parse.y"
4042     {
4043                         Node *node = node_new (ENUMDEF_NODE,
4044                                                "etype:steal", yyvsp[-1].id,
4045                                                "prefix:steal", yyvsp[-6].id,
4046                                                "values:steal", enum_vals,
4047                                                NULL);
4048                         enum_vals = NULL;
4049                         nodes = g_list_append (nodes, node);
4050                         }
4051     break;
4052
4053   case 179:
4054 #line 2000 "parse.y"
4055     {;}
4056     break;
4057
4058   case 180:
4059 #line 2001 "parse.y"
4060     {;}
4061     break;
4062
4063   case 181:
4064 #line 2004 "parse.y"
4065     {
4066                         Node *node;
4067                         char *num = yyvsp[0].id;
4068
4069                         /* A float value, that's a bad enum */
4070                         if (num[0] >= '0' &&
4071                             num[0] <= '9' &&
4072                             strchr (num, '.') != NULL) {
4073                                 g_free (yyvsp[-2].id);
4074                                 g_free (num);
4075                                 yyerror(_("parse error (enumerator value not integer constant)"));
4076                                 YYERROR;
4077                         }
4078                        
4079                         node = node_new (ENUMVALUE_NODE,
4080                                          "name:steal", yyvsp[-2].id,
4081                                          "value:steal", num,
4082                                          NULL);
4083                         enum_vals = g_list_append (enum_vals, node);
4084                         }
4085     break;
4086
4087   case 182:
4088 #line 2024 "parse.y"
4089     {
4090                         Node *node;
4091
4092                         node = node_new (ENUMVALUE_NODE,
4093                                          "name:steal", yyvsp[0].id,
4094                                          NULL);
4095                         enum_vals = g_list_append (enum_vals, node);
4096         }
4097     break;
4098
4099   case 183:
4100 #line 2034 "parse.y"
4101     {
4102                         Node *node = node_new (FLAGS_NODE,
4103                                                "ftype:steal", yyvsp[-1].id,
4104                                                "prefix:steal", yyvsp[-5].id,
4105                                                "values:steal", flag_vals,
4106                                                NULL);
4107                         flag_vals = NULL;
4108                         nodes = g_list_append (nodes, node);
4109                         }
4110     break;
4111
4112   case 184:
4113 #line 2043 "parse.y"
4114     {
4115                         Node *node = node_new (FLAGS_NODE,
4116                                                "ftype:steal", yyvsp[-1].id,
4117                                                "prefix:steal", yyvsp[-6].id,
4118                                                "values:steal", flag_vals,
4119                                                NULL);
4120                         flag_vals = NULL;
4121                         nodes = g_list_append (nodes, node);
4122                         }
4123     break;
4124
4125   case 185:
4126 #line 2054 "parse.y"
4127     {
4128                         flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4129                 }
4130     break;
4131
4132   case 186:
4133 #line 2057 "parse.y"
4134     {
4135                         flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4136                 }
4137     break;
4138
4139   case 187:
4140 #line 2062 "parse.y"
4141     {
4142                         Node *node = node_new (ERROR_NODE,
4143                                                "etype:steal", yyvsp[-1].id,
4144                                                "prefix:steal", yyvsp[-5].id,
4145                                                "values:steal", error_vals,
4146                                                NULL);
4147                         error_vals = NULL;
4148                         nodes = g_list_append (nodes, node);
4149                         }
4150     break;
4151
4152   case 188:
4153 #line 2071 "parse.y"
4154     {
4155                         Node *node = node_new (ERROR_NODE,
4156                                                "etype:steal", yyvsp[-1].id,
4157                                                "prefix:steal", yyvsp[-6].id,
4158                                                "values:steal", error_vals,
4159                                                NULL);
4160                         error_vals = NULL;
4161                         nodes = g_list_append (nodes, node);
4162                         }
4163     break;
4164
4165   case 189:
4166 #line 2082 "parse.y"
4167     {
4168                         error_vals = g_list_append (error_vals, yyvsp[0].id);
4169                 }
4170     break;
4171
4172   case 190:
4173 #line 2085 "parse.y"
4174     {
4175                         error_vals = g_list_append (error_vals, yyvsp[0].id);
4176                 }
4177     break;
4178
4179   case 191:
4180 #line 2091 "parse.y"
4181     { yyval.id = yyvsp[0].id; }
4182     break;
4183
4184   case 192:
4185 #line 2092 "parse.y"
4186     {
4187                         yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
4188                         g_free(yyvsp[0].id);
4189                                         }
4190     break;
4191
4192   case 193:
4193 #line 2096 "parse.y"
4194     { yyval.id = yyvsp[0].id; }
4195     break;
4196
4197   case 194:
4198 #line 2097 "parse.y"
4199     { yyval.id = yyvsp[0].id; }
4200     break;
4201
4202
4203     }
4204
4205 /* Line 1000 of yacc.c.  */
4206 #line 4207 "parse.c"
4207 \f
4208   yyvsp -= yylen;
4209   yyssp -= yylen;
4210
4211
4212   YY_STACK_PRINT (yyss, yyssp);
4213
4214   *++yyvsp = yyval;
4215
4216
4217   /* Now `shift' the result of the reduction.  Determine what state
4218      that goes to, based on the state we popped back to and the rule
4219      number reduced by.  */
4220
4221   yyn = yyr1[yyn];
4222
4223   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4224   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4225     yystate = yytable[yystate];
4226   else
4227     yystate = yydefgoto[yyn - YYNTOKENS];
4228
4229   goto yynewstate;
4230
4231
4232 /*------------------------------------.
4233 | yyerrlab -- here on detecting error |
4234 `------------------------------------*/
4235 yyerrlab:
4236   /* If not already recovering from an error, report this error.  */
4237   if (!yyerrstatus)
4238     {
4239       ++yynerrs;
4240 #if YYERROR_VERBOSE
4241       yyn = yypact[yystate];
4242
4243       if (YYPACT_NINF < yyn && yyn < YYLAST)
4244         {
4245           YYSIZE_T yysize = 0;
4246           int yytype = YYTRANSLATE (yychar);
4247           const char* yyprefix;
4248           char *yymsg;
4249           int yyx;
4250
4251           /* Start YYX at -YYN if negative to avoid negative indexes in
4252              YYCHECK.  */
4253           int yyxbegin = yyn < 0 ? -yyn : 0;
4254
4255           /* Stay within bounds of both yycheck and yytname.  */
4256           int yychecklim = YYLAST - yyn;
4257           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4258           int yycount = 0;
4259
4260           yyprefix = ", expecting ";
4261           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4262             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4263               {
4264                 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
4265                 yycount += 1;
4266                 if (yycount == 5)
4267                   {
4268                     yysize = 0;
4269                     break;
4270                   }
4271               }
4272           yysize += (sizeof ("syntax error, unexpected ")
4273                      + yystrlen (yytname[yytype]));
4274           yymsg = (char *) YYSTACK_ALLOC (yysize);
4275           if (yymsg != 0)
4276             {
4277               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4278               yyp = yystpcpy (yyp, yytname[yytype]);
4279
4280               if (yycount < 5)
4281                 {
4282                   yyprefix = ", expecting ";
4283                   for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4284                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4285                       {
4286                         yyp = yystpcpy (yyp, yyprefix);
4287                         yyp = yystpcpy (yyp, yytname[yyx]);
4288                         yyprefix = " or ";
4289                       }
4290                 }
4291               yyerror (yymsg);
4292               YYSTACK_FREE (yymsg);
4293             }
4294           else
4295             yyerror ("syntax error; also virtual memory exhausted");
4296         }
4297       else
4298 #endif /* YYERROR_VERBOSE */
4299         yyerror ("syntax error");
4300     }
4301
4302
4303
4304   if (yyerrstatus == 3)
4305     {
4306       /* If just tried and failed to reuse lookahead token after an
4307          error, discard it.  */
4308
4309       if (yychar <= YYEOF)
4310         {
4311           /* If at end of input, pop the error token,
4312              then the rest of the stack, then return failure.  */
4313           if (yychar == YYEOF)
4314              for (;;)
4315                {
4316                  YYPOPSTACK;
4317                  if (yyssp == yyss)
4318                    YYABORT;
4319                  YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4320                  yydestruct (yystos[*yyssp], yyvsp);
4321                }
4322         }
4323       else
4324         {
4325           YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4326           yydestruct (yytoken, &yylval);
4327           yychar = YYEMPTY;
4328
4329         }
4330     }
4331
4332   /* Else will try to reuse lookahead token after shifting the error
4333      token.  */
4334   goto yyerrlab1;
4335
4336
4337 /*---------------------------------------------------.
4338 | yyerrorlab -- error raised explicitly by YYERROR.  |
4339 `---------------------------------------------------*/
4340 yyerrorlab:
4341
4342 #ifdef __GNUC__
4343   /* Pacify GCC when the user code never invokes YYERROR and the label
4344      yyerrorlab therefore never appears in user code.  */
4345   if (0)
4346      goto yyerrorlab;
4347 #endif
4348
4349   yyvsp -= yylen;
4350   yyssp -= yylen;
4351   yystate = *yyssp;
4352   goto yyerrlab1;
4353
4354
4355 /*-------------------------------------------------------------.
4356 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
4357 `-------------------------------------------------------------*/
4358 yyerrlab1:
4359   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
4360
4361   for (;;)
4362     {
4363       yyn = yypact[yystate];
4364       if (yyn != YYPACT_NINF)
4365         {
4366           yyn += YYTERROR;
4367           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4368             {
4369               yyn = yytable[yyn];
4370               if (0 < yyn)
4371                 break;
4372             }
4373         }
4374
4375       /* Pop the current state because it cannot handle the error token.  */
4376       if (yyssp == yyss)
4377         YYABORT;
4378
4379       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4380       yydestruct (yystos[yystate], yyvsp);
4381       YYPOPSTACK;
4382       yystate = *yyssp;
4383       YY_STACK_PRINT (yyss, yyssp);
4384     }
4385
4386   if (yyn == YYFINAL)
4387     YYACCEPT;
4388
4389   YYDPRINTF ((stderr, "Shifting error token, "));
4390
4391   *++yyvsp = yylval;
4392
4393
4394   yystate = yyn;
4395   goto yynewstate;
4396
4397
4398 /*-------------------------------------.
4399 | yyacceptlab -- YYACCEPT comes here.  |
4400 `-------------------------------------*/
4401 yyacceptlab:
4402   yyresult = 0;
4403   goto yyreturn;
4404
4405 /*-----------------------------------.
4406 | yyabortlab -- YYABORT comes here.  |
4407 `-----------------------------------*/
4408 yyabortlab:
4409   yyresult = 1;
4410   goto yyreturn;
4411
4412 #ifndef yyoverflow
4413 /*----------------------------------------------.
4414 | yyoverflowlab -- parser overflow comes here.  |
4415 `----------------------------------------------*/
4416 yyoverflowlab:
4417   yyerror ("parser stack overflow");
4418   yyresult = 2;
4419   /* Fall through.  */
4420 #endif
4421
4422 yyreturn:
4423 #ifndef yyoverflow
4424   if (yyss != yyssa)
4425     YYSTACK_FREE (yyss);
4426 #endif
4427   return yyresult;
4428 }
4429
4430
4431 #line 2100 "parse.y"
4432
4433