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