]> git.draconx.ca Git - gob-dx.git/blob - src/parse.c
Release 2.0.3
[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 = g_strdup ("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,  1094,  1102,  1107,  1155,  1191,  1207,  1208,
821     1211,  1212,  1215,  1216,  1228,  1229,  1232,  1238,  1244,  1250,
822     1256,  1262,  1268,  1275,  1281,  1287,  1293,  1299,  1305,  1311,
823     1317,  1323,  1329,  1335,  1355,  1364,  1370,  1371,  1374,  1377,
824     1383,  1390,  1399,  1402,  1405,  1409,  1413,  1417,  1422,  1430,
825     1434,  1439,  1443,  1446,  1450,  1453,  1458,  1459,  1460,  1461,
826     1462,  1463,  1464,  1465,  1466,  1469,  1470,  1471,  1474,  1475,
827     1476,  1480,  1487,  1499,  1505,  1517,  1529,  1532,  1538,  1543,
828     1546,  1551,  1552,  1556,  1572,  1588,  1604,  1620,  1631,  1637,
829     1647,  1670,  1681,  1700,  1706,  1707,  1713,  1714,  1725,  1736,
830     1747,  1757,  1767,  1777,  1780,  1781,  1784,  1785,  1788,  1791,
831     1794,  1802,  1812,  1813,  1816,  1833,  1840,  1847,  1854,  1861,
832     1868,  1877,  1886,  1897,  1898,  1901,  1921,  1931,  1940,  1951,
833     1954,  1959,  1968,  1979,  1982,  1988,  1989,  1993,  1994
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                         const 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
2389                         if(strcmp(yyvsp[0].id, "link")==0) {
2390                                 set = g_strdup_printf("%s->%s = ARG;",
2391                                                       root, yyvsp[-2].id);
2392                         } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2393                                 set = g_strdup_printf("g_free (%s->%s); "
2394                                                       "%s->%s = g_strdup (ARG);",
2395                                                       root, yyvsp[-2].id,
2396                                                       root, yyvsp[-2].id);
2397                         } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2398                                 set = g_strdup_printf(
2399                                   "if (ARG != NULL) "
2400                                    "g_object_ref (G_OBJECT (ARG)); "
2401                                   "if (%s->%s != NULL) "
2402                                    "g_object_unref (G_OBJECT (%s->%s)); "
2403                                   "%s->%s = ARG;",
2404                                   root, yyvsp[-2].id,
2405                                   root, yyvsp[-2].id,
2406                                   root, yyvsp[-2].id);
2407                         } else {
2408                                 g_assert_not_reached();
2409                         }
2410
2411                         get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2412   
2413                         g_free (yyvsp[0].id);
2414
2415                         if (type == NULL)
2416                                 type = (Type *)node_copy ((Node *)var->vtype);
2417
2418                         node = node_new (ARGUMENT_NODE,
2419                                          "gtktype:steal", yyvsp[-3].id,
2420                                          "atype:steal", type,
2421                                          "flags:steal", yyvsp[-4].list,
2422                                          "name:steal", yyvsp[-2].id,
2423                                          "get:steal", get,
2424                                          "get_line", yyvsp[-5].line,
2425                                          "set:steal", set,
2426                                          "set_line", yyvsp[-5].line,
2427                                          "line_no", yyvsp[-5].line,
2428                                          NULL);
2429
2430                         if (yyvsp[-1].id != NULL) {
2431                                 Argument *arg = (Argument *)node;
2432                                 export_accessors (arg->name,
2433                                                   arg->get != NULL, arg->get_line,
2434                                                   arg->set != NULL, arg->set_line,
2435                                                   arg->atype,
2436                                                   arg->gtktype,
2437                                                   arg->line_no);
2438                                 g_free (yyvsp[-1].id);
2439                         } 
2440
2441                         class_nodes = g_list_append (class_nodes, node);
2442                                                 }
2443     break;
2444 case 53:
2445 #line 1094 "parse.y"
2446 {
2447                         if (strcmp (yyvsp[-1].id, "export")!=0) {
2448                                 g_free (yyvsp[-1].id); 
2449                                 yyerror (_("parse error"));
2450                                 YYERROR;
2451                         }
2452                         yyval.id = yyvsp[-1].id;
2453                                                 }
2454     break;
2455 case 54:
2456 #line 1102 "parse.y"
2457 {
2458                         yyval.id = NULL;
2459                                                 }
2460     break;
2461 case 55:
2462 #line 1107 "parse.y"
2463 {
2464                         ensure_property ();
2465                         node_set ((Node *)property,
2466                                   "line_no", yyvsp[-10].line,
2467                                   "gtktype:steal", debool (yyvsp[-9].id),
2468                                   "name:steal", yyvsp[-8].id,
2469                                   NULL);
2470                         if (strcmp (yyvsp[-6].id, "get") == 0 &&
2471                             strcmp (yyvsp[-3].id, "set") == 0) {
2472                                 node_set ((Node *)property,
2473                                           "get:steal", (yyvsp[-4].cbuf)->str,
2474                                           "get_line", yyvsp[-5].line,
2475                                           "set:steal", (yyvsp[-1].cbuf)->str,
2476                                           "set_line", yyvsp[-2].line,
2477                                           NULL);
2478                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2479                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2480                                 g_free (yyvsp[-6].id); 
2481                                 g_free (yyvsp[-3].id);
2482                         } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2483                                    strcmp (yyvsp[-3].id, "get") == 0) {
2484                                 node_set ((Node *)property,
2485                                           "get:steal", (yyvsp[-1].cbuf)->str,
2486                                           "get_line", yyvsp[-2].line,
2487                                           "set:steal", (yyvsp[-4].cbuf)->str,
2488                                           "set_line", yyvsp[-5].line,
2489                                           NULL);
2490                                 g_string_free (yyvsp[-4].cbuf, FALSE);
2491                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2492                                 g_free (yyvsp[-6].id); 
2493                                 g_free (yyvsp[-3].id);
2494                         } else {
2495                                 g_string_free (yyvsp[-4].cbuf, TRUE);
2496                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2497                                 g_free (yyvsp[-6].id); 
2498                                 g_free (yyvsp[-3].id);
2499                                 node_free ((Node *)property);
2500                                 property = NULL;
2501                                 yyerror (_("parse error"));
2502                                 YYERROR;
2503                         }
2504                         property_link_and_export ((Node *)property);
2505                         if (property != NULL) {
2506                                 class_nodes = g_list_append (class_nodes,
2507                                                              property);
2508                                 property = NULL;
2509                         }
2510                 }
2511     break;
2512 case 56:
2513 #line 1155 "parse.y"
2514 {
2515                         ensure_property ();
2516                         node_set ((Node *)property,
2517                                   "line_no", yyvsp[-7].line,
2518                                   "gtktype:steal", debool (yyvsp[-6].id),
2519                                   "name:steal", yyvsp[-5].id,
2520                                   NULL);
2521                         if (strcmp (yyvsp[-3].id, "get") == 0) {
2522                                 node_set ((Node *)property,
2523                                           "get:steal", (yyvsp[-1].cbuf)->str,
2524                                           "get_line", yyvsp[-2].line,
2525                                           NULL);
2526                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2527                                 g_free (yyvsp[-3].id); 
2528                         } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2529                                 node_set ((Node *)property,
2530                                           "set:steal", (yyvsp[-1].cbuf)->str,
2531                                           "set_line", yyvsp[-2].line,
2532                                           NULL);
2533                                 g_string_free (yyvsp[-1].cbuf, FALSE);
2534                                 g_free (yyvsp[-3].id); 
2535                         } else {
2536                                 g_string_free (yyvsp[-1].cbuf, TRUE);
2537                                 g_free (yyvsp[-3].id); 
2538                                 node_free ((Node *)property);
2539                                 property = NULL;
2540                                 yyerror (_("parse error"));
2541                                 YYERROR;
2542                         }
2543                         property_link_and_export ((Node *)property);
2544                         if (property != NULL) {
2545                                 class_nodes = g_list_append (class_nodes,
2546                                                              property);
2547                                 property = NULL;
2548                         }
2549                 }
2550     break;
2551 case 57:
2552 #line 1191 "parse.y"
2553 {
2554                         ensure_property ();
2555                         node_set ((Node *)property,
2556                                   "line_no", yyvsp[-4].line,
2557                                   "gtktype:steal", debool (yyvsp[-3].id),
2558                                   "name:steal", yyvsp[-2].id,
2559                                   NULL);
2560                         property_link_and_export ((Node *)property);
2561                         if (property != NULL) {
2562                                 class_nodes = g_list_append (class_nodes,
2563                                                              property);
2564                                 property = NULL;
2565                         }
2566                 }
2567     break;
2568 case 58:
2569 #line 1207 "parse.y"
2570 { ; }
2571     break;
2572 case 59:
2573 #line 1208 "parse.y"
2574 { ; }
2575     break;
2576 case 60:
2577 #line 1211 "parse.y"
2578 { ; }
2579     break;
2580 case 61:
2581 #line 1212 "parse.y"
2582 { ; }
2583     break;
2584 case 62:
2585 #line 1215 "parse.y"
2586 { yyval.id = yyvsp[0].id; }
2587     break;
2588 case 63:
2589 #line 1216 "parse.y"
2590 {
2591                         if (strcmp (yyvsp[-3].id, "_") != 0) {
2592                                 g_free (yyvsp[-3].id);
2593                                 yyerror(_("parse error"));
2594                                 YYERROR;
2595                         }
2596                         g_free (yyvsp[-3].id);
2597                         yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2598                         g_free (yyvsp[-1].id);
2599                 }
2600     break;
2601 case 64:
2602 #line 1228 "parse.y"
2603 { yyval.id = yyvsp[0].id; }
2604     break;
2605 case 65:
2606 #line 1229 "parse.y"
2607 { yyval.id = yyvsp[0].id; }
2608     break;
2609 case 66:
2610 #line 1232 "parse.y"
2611 {
2612                 ensure_property ();
2613                 node_set ((Node *)property,
2614                           "nick:steal", yyvsp[0].id,
2615                           NULL);
2616                   }
2617     break;
2618 case 67:
2619 #line 1238 "parse.y"
2620 {
2621                 ensure_property ();
2622                 node_set ((Node *)property,
2623                           "blurb:steal", yyvsp[0].id,
2624                           NULL);
2625                   }
2626     break;
2627 case 68:
2628 #line 1244 "parse.y"
2629 {
2630                 ensure_property ();
2631                 node_set ((Node *)property,
2632                           "maximum:steal", yyvsp[0].id,
2633                           NULL);
2634                   }
2635     break;
2636 case 69:
2637 #line 1250 "parse.y"
2638 {
2639                 ensure_property ();
2640                 node_set ((Node *)property,
2641                           "minimum:steal", yyvsp[0].id,
2642                           NULL);
2643                   }
2644     break;
2645 case 70:
2646 #line 1256 "parse.y"
2647 {
2648                 ensure_property ();
2649                 node_set ((Node *)property,
2650                           "default_value:steal", yyvsp[0].id,
2651                           NULL);
2652                   }
2653     break;
2654 case 71:
2655 #line 1262 "parse.y"
2656 {
2657                 ensure_property ();
2658                 node_set ((Node *)property,
2659                           "flags:steal", yyvsp[0].list,
2660                           NULL);
2661                   }
2662     break;
2663 case 72:
2664 #line 1268 "parse.y"
2665 {
2666                 Type *type = pop_type ();
2667                 ensure_property ();
2668                 node_set ((Node *)property,
2669                           "ptype:steal", type,
2670                           NULL);
2671                   }
2672     break;
2673 case 73:
2674 #line 1275 "parse.y"
2675 {
2676                 ensure_property ();
2677                 node_set ((Node *)property,
2678                           "extra_gtktype:steal", yyvsp[0].id,
2679                           NULL);
2680                   }
2681     break;
2682 case 74:
2683 #line 1281 "parse.y"
2684 {
2685                 ensure_property ();
2686                 node_set ((Node *)property,
2687                           "extra_gtktype:steal", yyvsp[0].id,
2688                           NULL);
2689                   }
2690     break;
2691 case 75:
2692 #line 1287 "parse.y"
2693 {
2694                 ensure_property ();
2695                 node_set ((Node *)property,
2696                           "extra_gtktype:steal", yyvsp[0].id,
2697                           NULL);
2698                   }
2699     break;
2700 case 76:
2701 #line 1293 "parse.y"
2702 {
2703                 ensure_property ();
2704                 node_set ((Node *)property,
2705                           "extra_gtktype:steal", yyvsp[0].id,
2706                           NULL);
2707                   }
2708     break;
2709 case 77:
2710 #line 1299 "parse.y"
2711 {
2712                 ensure_property ();
2713                 node_set ((Node *)property,
2714                           "extra_gtktype:steal", yyvsp[0].id,
2715                           NULL);
2716                   }
2717     break;
2718 case 78:
2719 #line 1305 "parse.y"
2720 {
2721                 ensure_property ();
2722                 node_set ((Node *)property,
2723                           "extra_gtktype:steal", yyvsp[0].id,
2724                           NULL);
2725                   }
2726     break;
2727 case 79:
2728 #line 1311 "parse.y"
2729 {
2730                 ensure_property ();
2731                 node_set ((Node *)property,
2732                           "extra_gtktype:steal", yyvsp[0].id,
2733                           NULL);
2734                   }
2735     break;
2736 case 80:
2737 #line 1317 "parse.y"
2738 {
2739                 ensure_property ();
2740                 node_set ((Node *)property,
2741                           "extra_gtktype:steal", yyvsp[0].id,
2742                           NULL);
2743                   }
2744     break;
2745 case 81:
2746 #line 1323 "parse.y"
2747 {
2748                 ensure_property ();
2749                 node_set ((Node *)property,
2750                           "extra_gtktype:steal", yyvsp[0].id,
2751                           NULL);
2752                   }
2753     break;
2754 case 82:
2755 #line 1329 "parse.y"
2756 {
2757                 ensure_property ();
2758                 node_set ((Node *)property,
2759                           "extra_gtktype:steal", yyvsp[0].id,
2760                           NULL);
2761                   }
2762     break;
2763 case 83:
2764 #line 1335 "parse.y"
2765 {
2766                 ensure_property ();
2767                 if (strcmp (yyvsp[0].id, "link") == 0) {
2768                         g_free(yyvsp[0].id);
2769                         node_set ((Node *)property,
2770                                   "link", TRUE,
2771                                   NULL);
2772                 } else if (strcmp (yyvsp[0].id, "export") == 0) {
2773                         g_free(yyvsp[0].id);
2774                         node_set ((Node *)property,
2775                                   "export", TRUE,
2776                                   NULL);
2777                 } else {
2778                         g_free(yyvsp[0].id);
2779                         yyerror(_("parse error"));
2780                         YYERROR;
2781                 }
2782                   }
2783     break;
2784 case 84:
2785 #line 1355 "parse.y"
2786 {
2787                         if(strcmp(yyvsp[-2].id,"type")!=0) {
2788                                 g_free(yyvsp[-4].id);
2789                                 g_free(yyvsp[-2].id);
2790                                 yyerror(_("parse error"));
2791                                 YYERROR;
2792                         }
2793                         yyval.id = debool (yyvsp[-4].id);
2794                                                 }
2795     break;
2796 case 85:
2797 #line 1364 "parse.y"
2798 {
2799                         yyval.id = debool (yyvsp[0].id);
2800                         typestack = g_list_prepend(typestack,NULL);
2801                                                 }
2802     break;
2803 case 86:
2804 #line 1370 "parse.y"
2805 { yyval.list = yyvsp[-1].list; }
2806     break;
2807 case 87:
2808 #line 1371 "parse.y"
2809 { yyval.list = NULL; }
2810     break;
2811 case 88:
2812 #line 1374 "parse.y"
2813 {
2814                         yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
2815                                                 }
2816     break;
2817 case 89:
2818 #line 1377 "parse.y"
2819 {
2820                         yyval.list = g_list_append(NULL,yyvsp[0].id);
2821                                                 }
2822     break;
2823 case 90:
2824 #line 1383 "parse.y"
2825 {
2826                         Node *node = node_new (TYPE_NODE, 
2827                                                "name:steal", yyvsp[-1].id,
2828                                                "pointer:steal", yyvsp[0].id,
2829                                                NULL);
2830                         typestack = g_list_prepend(typestack,node);
2831                                                         }
2832     break;
2833 case 91:
2834 #line 1390 "parse.y"
2835 {
2836                         Node *node = node_new (TYPE_NODE, 
2837                                                "name:steal", yyvsp[0].id,
2838                                                NULL);
2839                         typestack = g_list_prepend(typestack,node);
2840                                                         }
2841     break;
2842 case 92:
2843 #line 1399 "parse.y"
2844 {
2845                         yyval.id = yyvsp[0].id;
2846                                                         }
2847     break;
2848 case 93:
2849 #line 1402 "parse.y"
2850 {
2851                         yyval.id = yyvsp[0].id;
2852                                                         }
2853     break;
2854 case 94:
2855 #line 1405 "parse.y"
2856 {
2857                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2858                         g_free(yyvsp[0].id);
2859                                                         }
2860     break;
2861 case 95:
2862 #line 1409 "parse.y"
2863 {
2864                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2865                         g_free(yyvsp[-1].id);
2866                                                         }
2867     break;
2868 case 96:
2869 #line 1413 "parse.y"
2870 {
2871                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2872                         g_free(yyvsp[0].id);
2873                                                         }
2874     break;
2875 case 97:
2876 #line 1417 "parse.y"
2877 {
2878                         yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
2879                                              yyvsp[0].id, NULL);
2880                         g_free(yyvsp[0].id);
2881                                                         }
2882     break;
2883 case 98:
2884 #line 1422 "parse.y"
2885 {
2886                         yyval.id = g_strconcat(yyvsp[-2].id, " ",
2887                                              yyvsp[-1].id, " const", NULL);
2888                         g_free(yyvsp[-1].id);
2889                                                         }
2890     break;
2891 case 99:
2892 #line 1430 "parse.y"
2893 {
2894                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2895                         g_free(yyvsp[0].id);
2896                                                         }
2897     break;
2898 case 100:
2899 #line 1434 "parse.y"
2900 {
2901                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
2902                         g_free(yyvsp[-1].id);
2903                         g_free(yyvsp[0].id);
2904                                                         }
2905     break;
2906 case 101:
2907 #line 1439 "parse.y"
2908 {
2909                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
2910                         g_free(yyvsp[0].id);
2911                                                         }
2912     break;
2913 case 102:
2914 #line 1443 "parse.y"
2915 {
2916                         yyval.id = yyvsp[0].id;
2917                                                         }
2918     break;
2919 case 103:
2920 #line 1446 "parse.y"
2921 {
2922                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2923                         g_free(yyvsp[-1].id);
2924                                                         }
2925     break;
2926 case 104:
2927 #line 1450 "parse.y"
2928 {
2929                         yyval.id = g_strdup(yyvsp[0].id);
2930                                                         }
2931     break;
2932 case 105:
2933 #line 1453 "parse.y"
2934 {
2935                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
2936                                                         }
2937     break;
2938 case 106:
2939 #line 1458 "parse.y"
2940 { yyval.id = "void"; }
2941     break;
2942 case 107:
2943 #line 1459 "parse.y"
2944 { yyval.id = "char"; }
2945     break;
2946 case 108:
2947 #line 1460 "parse.y"
2948 { yyval.id = "short"; }
2949     break;
2950 case 109:
2951 #line 1461 "parse.y"
2952 { yyval.id = "int"; }
2953     break;
2954 case 110:
2955 #line 1462 "parse.y"
2956 { yyval.id = "long"; }
2957     break;
2958 case 111:
2959 #line 1463 "parse.y"
2960 { yyval.id = "float"; }
2961     break;
2962 case 112:
2963 #line 1464 "parse.y"
2964 { yyval.id = "double"; }
2965     break;
2966 case 113:
2967 #line 1465 "parse.y"
2968 { yyval.id = "signed"; }
2969     break;
2970 case 114:
2971 #line 1466 "parse.y"
2972 { yyval.id = "unsigned"; }
2973     break;
2974 case 115:
2975 #line 1469 "parse.y"
2976 { yyval.id = "struct"; }
2977     break;
2978 case 116:
2979 #line 1470 "parse.y"
2980 { yyval.id = "union"; }
2981     break;
2982 case 117:
2983 #line 1471 "parse.y"
2984 { yyval.id = "enum"; }
2985     break;
2986 case 118:
2987 #line 1474 "parse.y"
2988 { yyval.id = g_strdup("*"); }
2989     break;
2990 case 119:
2991 #line 1475 "parse.y"
2992 { yyval.id = g_strdup("* const"); }
2993     break;
2994 case 120:
2995 #line 1476 "parse.y"
2996 {
2997                                 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2998                                 g_free(yyvsp[0].id);
2999                                         }
3000     break;
3001 case 121:
3002 #line 1480 "parse.y"
3003 {
3004                                 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3005                                 g_free(yyvsp[0].id);
3006                                         }
3007     break;
3008 case 122:
3009 #line 1487 "parse.y"
3010 {
3011                         if(strcmp(yyvsp[-1].id, "first")==0)
3012                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3013                         else if(strcmp(yyvsp[-1].id, "last")==0)
3014                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3015                         else {
3016                                 yyerror(_("signal must be 'first' or 'last'"));
3017                                 g_free(yyvsp[-1].id);
3018                                 YYERROR;
3019                         }
3020                         g_free(yyvsp[-1].id);
3021                                         }
3022     break;
3023 case 123:
3024 #line 1499 "parse.y"
3025 {
3026                         yyval.sigtype = SIGNAL_LAST_METHOD;
3027                                         }
3028     break;
3029 case 124:
3030 #line 1505 "parse.y"
3031 {
3032                         if(strcmp(yyvsp[-1].id,"first")==0)
3033                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3034                         else if(strcmp(yyvsp[-1].id,"last")==0)
3035                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3036                         else {
3037                                 yyerror(_("signal must be 'first' or 'last'"));
3038                                 g_free(yyvsp[-1].id);
3039                                 YYERROR;
3040                         }
3041                         g_free(yyvsp[-1].id);
3042                                         }
3043     break;
3044 case 125:
3045 #line 1517 "parse.y"
3046 {
3047                         if(strcmp(yyvsp[-2].id,"first")==0)
3048                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
3049                         else if(strcmp(yyvsp[-2].id,"last")==0)
3050                                 yyval.sigtype = SIGNAL_LAST_METHOD;
3051                         else {
3052                                 yyerror(_("signal must be 'first' or 'last'"));
3053                                 g_free(yyvsp[-2].id);
3054                                 YYERROR;
3055                         }
3056                         g_free(yyvsp[-2].id);
3057                                         }
3058     break;
3059 case 126:
3060 #line 1529 "parse.y"
3061 {
3062                         yyval.sigtype = SIGNAL_LAST_METHOD;
3063                                         }
3064     break;
3065 case 127:
3066 #line 1532 "parse.y"
3067 {
3068                         /* the_scope was default thus public */
3069                         the_scope = PUBLIC_SCOPE;
3070                                         }
3071     break;
3072 case 128:
3073 #line 1538 "parse.y"
3074 {
3075                         gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3076                                                 }
3077     break;
3078 case 129:
3079 #line 1543 "parse.y"
3080 {
3081                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3082                                                 }
3083     break;
3084 case 130:
3085 #line 1546 "parse.y"
3086
3087                         gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3088                                                 }
3089     break;
3090 case 131:
3091 #line 1551 "parse.y"
3092 { yyval.cbuf = yyvsp[0].cbuf; }
3093     break;
3094 case 132:
3095 #line 1552 "parse.y"
3096 { yyval.cbuf = NULL; }
3097     break;
3098 case 133:
3099 #line 1556 "parse.y"
3100 {
3101                         if(!has_self) {
3102                                 yyerror(_("signal without 'self' as "
3103                                           "first parameter"));
3104                                 free_all_global_state();
3105                                 YYERROR;
3106                         }
3107                         if(the_scope == CLASS_SCOPE) {
3108                                 yyerror(_("a method cannot be of class scope"));
3109                                 free_all_global_state();
3110                                 YYERROR;
3111                         }
3112                         push_function(the_scope, yyvsp[-7].sigtype,NULL,
3113                                       yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3114                                       ccode_line, vararg, yyvsp[-8].list);
3115                                                                         }
3116     break;
3117 case 134:
3118 #line 1572 "parse.y"
3119 {
3120                         if(!has_self) {
3121                                 yyerror(_("signal without 'self' as "
3122                                           "first parameter"));
3123                                 free_all_global_state();
3124                                 YYERROR;
3125                         }
3126                         if(the_scope == CLASS_SCOPE) {
3127                                 yyerror(_("a method cannot be of class scope"));
3128                                 free_all_global_state();
3129                                 YYERROR;
3130                         }
3131                         push_function(the_scope, yyvsp[-7].sigtype, NULL,
3132                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3133                                       ccode_line, vararg, yyvsp[-8].list);
3134                                                                         }
3135     break;
3136 case 135:
3137 #line 1588 "parse.y"
3138 {
3139                         if(!has_self) {
3140                                 yyerror(_("virtual method without 'self' as "
3141                                           "first parameter"));
3142                                 free_all_global_state();
3143                                 YYERROR;
3144                         }
3145                         if(the_scope == CLASS_SCOPE) {
3146                                 yyerror(_("a method cannot be of class scope"));
3147                                 free_all_global_state();
3148                                 YYERROR;
3149                         }
3150                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3151                                       yyvsp[0].cbuf, yyvsp[-8].line,
3152                                       ccode_line, vararg, NULL);
3153                                                                         }
3154     break;
3155 case 136:
3156 #line 1604 "parse.y"
3157 {
3158                         if(!has_self) {
3159                                 yyerror(_("virtual method without 'self' as "
3160                                           "first parameter"));
3161                                 free_all_global_state();
3162                                 YYERROR;
3163                         }
3164                         if(the_scope == CLASS_SCOPE) {
3165                                 yyerror(_("a method cannot be of class scope"));
3166                                 free_all_global_state();
3167                                 YYERROR;
3168                         }
3169                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3170                                       yyvsp[0].cbuf, yyvsp[-7].line,
3171                                       ccode_line, vararg, NULL);
3172                                                                         }
3173     break;
3174 case 137:
3175 #line 1620 "parse.y"
3176 {
3177                         if(!has_self) {
3178                                 yyerror(_("virtual method without 'self' as "
3179                                           "first parameter"));
3180                                 free_all_global_state();
3181                                 YYERROR;
3182                         }
3183                         push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3184                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3185                                       ccode_line, vararg, NULL);
3186                                                                         }
3187     break;
3188 case 138:
3189 #line 1631 "parse.y"
3190 {
3191                         push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3192                                       yyvsp[-5].id, yyvsp[0].cbuf,
3193                                       yyvsp[-10].line, ccode_line,
3194                                       vararg, NULL);
3195                                                                         }
3196     break;
3197 case 139:
3198 #line 1637 "parse.y"
3199 {
3200                         if(the_scope == CLASS_SCOPE) {
3201                                 yyerror(_("a method cannot be of class scope"));
3202                                 free_all_global_state();
3203                                 YYERROR;
3204                         }
3205                         push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3206                                       yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3207                                       vararg, NULL);
3208                                                                 }
3209     break;
3210 case 140:
3211 #line 1647 "parse.y"
3212 {
3213                         if(strcmp(yyvsp[-4].id, "init")==0) {
3214                                 push_init_arg(yyvsp[-2].id,FALSE);
3215                                 push_function(NO_SCOPE, INIT_METHOD, NULL,
3216                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3217                                               ccode_line, FALSE, NULL);
3218                         } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3219                                 push_init_arg(yyvsp[-2].id,TRUE);
3220                                 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3221                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3222                                               ccode_line, FALSE, NULL);
3223                         } else {
3224                                 g_free(yyvsp[-4].id);
3225                                 g_free(yyvsp[-2].id);
3226                                 g_string_free(yyvsp[0].cbuf,TRUE);
3227                                 yyerror(_("parse error "
3228                                           "(untyped blocks must be init or "
3229                                           "class_init)"));
3230                                 YYERROR;
3231                         }
3232                                                 }
3233     break;
3234 case 141:
3235 #line 1670 "parse.y"
3236 {
3237                         g_free(onerror); onerror = NULL;
3238                         g_free(defreturn); defreturn = NULL;
3239                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3240                                 g_free(yyvsp[-1].id);
3241                                 g_free(yyvsp[0].id);
3242                                 yyerror(_("parse error"));
3243                                 YYERROR;
3244                         }
3245                         g_free(yyvsp[-1].id);
3246                                         }
3247     break;
3248 case 142:
3249 #line 1681 "parse.y"
3250 {
3251                         g_free(onerror); onerror = NULL;
3252                         g_free(defreturn); defreturn = NULL;
3253                         if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3254                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3255                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3256                                 yyerror(_("parse error"));
3257                                 YYERROR;
3258                         }
3259                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3260                                 onerror = defreturn = NULL;
3261                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3262                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3263                                 yyerror(_("parse error"));
3264                                 YYERROR;
3265                         }
3266                         g_free(yyvsp[-3].id);
3267                         g_free(yyvsp[-1].id);
3268                                                 }
3269     break;
3270 case 143:
3271 #line 1700 "parse.y"
3272 {
3273                         g_free(onerror); onerror = NULL;
3274                         g_free(defreturn); defreturn = NULL;
3275                                         }
3276     break;
3277 case 144:
3278 #line 1706 "parse.y"
3279 { yyval.id = yyvsp[0].id; }
3280     break;
3281 case 145:
3282 #line 1707 "parse.y"
3283 {
3284                         yyval.id = (yyvsp[0].cbuf)->str;
3285                         g_string_free(yyvsp[0].cbuf, FALSE);
3286                                         }
3287     break;
3288 case 146:
3289 #line 1713 "parse.y"
3290 { vararg = FALSE; has_self = FALSE; }
3291     break;
3292 case 147:
3293 #line 1714 "parse.y"
3294 {
3295                         vararg = FALSE;
3296                         has_self = TRUE;
3297                         if(strcmp(yyvsp[0].id,"self")==0)
3298                                 push_self(yyvsp[0].id, FALSE);
3299                         else {
3300                                 g_free(yyvsp[0].id);
3301                                 yyerror(_("parse error"));
3302                                 YYERROR;
3303                         }
3304                                         }
3305     break;
3306 case 148:
3307 #line 1725 "parse.y"
3308 {
3309                         vararg = FALSE;
3310                         has_self = TRUE;
3311                         if(strcmp(yyvsp[-1].id,"self")==0)
3312                                 push_self(yyvsp[-1].id, TRUE);
3313                         else {
3314                                 g_free(yyvsp[-1].id);
3315                                 yyerror(_("parse error"));
3316                                 YYERROR;
3317                         }
3318                                         }
3319     break;
3320 case 149:
3321 #line 1736 "parse.y"
3322 {
3323                         vararg = FALSE;
3324                         has_self = TRUE;
3325                         if(strcmp(yyvsp[0].id,"self")==0)
3326                                 push_self(yyvsp[0].id, TRUE);
3327                         else {
3328                                 g_free(yyvsp[0].id);
3329                                 yyerror(_("parse error"));
3330                                 YYERROR;
3331                         }
3332                                         }
3333     break;
3334 case 150:
3335 #line 1747 "parse.y"
3336 {
3337                         has_self = TRUE;
3338                         if(strcmp(yyvsp[-2].id,"self")==0)
3339                                 push_self(yyvsp[-2].id, FALSE);
3340                         else {
3341                                 g_free(yyvsp[-2].id);
3342                                 yyerror(_("parse error"));
3343                                 YYERROR;
3344                         }
3345                                         }
3346     break;
3347 case 151:
3348 #line 1757 "parse.y"
3349 {
3350                         has_self = TRUE;
3351                         if(strcmp(yyvsp[-3].id,"self")==0)
3352                                 push_self(yyvsp[-3].id, TRUE);
3353                         else {
3354                                 g_free(yyvsp[-3].id);
3355                                 yyerror(_("parse error"));
3356                                 YYERROR;
3357                         }
3358                                         }
3359     break;
3360 case 152:
3361 #line 1767 "parse.y"
3362 {
3363                         has_self = TRUE;
3364                         if(strcmp(yyvsp[-2].id,"self")==0)
3365                                 push_self(yyvsp[-2].id, TRUE);
3366                         else {
3367                                 g_free(yyvsp[-2].id);
3368                                 yyerror(_("parse error"));
3369                                 YYERROR;
3370                         }
3371                                         }
3372     break;
3373 case 153:
3374 #line 1777 "parse.y"
3375 { has_self = FALSE; }
3376     break;
3377 case 154:
3378 #line 1780 "parse.y"
3379 { vararg = TRUE; }
3380     break;
3381 case 155:
3382 #line 1781 "parse.y"
3383 { vararg = FALSE; }
3384     break;
3385 case 156:
3386 #line 1784 "parse.y"
3387 { ; }
3388     break;
3389 case 157:
3390 #line 1785 "parse.y"
3391 { ; }
3392     break;
3393 case 158:
3394 #line 1788 "parse.y"
3395 {
3396                         push_funcarg(yyvsp[0].id,NULL);
3397                                                                 }
3398     break;
3399 case 159:
3400 #line 1791 "parse.y"
3401 {
3402                         push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3403                                                                 }
3404     break;
3405 case 160:
3406 #line 1794 "parse.y"
3407 {
3408                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3409                                 yyerror(_("parse error"));
3410                                 YYERROR;
3411                         }
3412                         g_free(yyvsp[-2].id);
3413                         push_funcarg(yyvsp[-4].id,NULL);
3414                                                                 }
3415     break;
3416 case 161:
3417 #line 1802 "parse.y"
3418 {
3419                         if(strcmp(yyvsp[-2].id,"check")!=0) {
3420                                 yyerror(_("parse error"));
3421                                 YYERROR;
3422                         }
3423                         g_free(yyvsp[-2].id);
3424                         push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3425                                                                 }
3426     break;
3427 case 162:
3428 #line 1812 "parse.y"
3429 { ; }
3430     break;
3431 case 163:
3432 #line 1813 "parse.y"
3433 { ; }
3434     break;
3435 case 164:
3436 #line 1816 "parse.y"
3437 {
3438                         if(strcmp(yyvsp[0].id,"type")==0) {
3439                                 Node *node = node_new (CHECK_NODE,
3440                                                        "chtype", TYPE_CHECK,
3441                                                        NULL);
3442                                 checks = g_list_append(checks,node);
3443                         } else if(strcmp(yyvsp[0].id,"null")==0) {
3444                                 Node *node = node_new (CHECK_NODE,
3445                                                        "chtype", NULL_CHECK,
3446                                                        NULL);
3447                                 checks = g_list_append(checks,node);
3448                         } else {
3449                                 yyerror(_("parse error"));
3450                                 YYERROR;
3451                         }
3452                         g_free(yyvsp[0].id);
3453                                         }
3454     break;
3455 case 165:
3456 #line 1833 "parse.y"
3457 {
3458                         Node *node = node_new (CHECK_NODE,
3459                                                "chtype", GT_CHECK,
3460                                                "number:steal", yyvsp[0].id,
3461                                                NULL);
3462                         checks = g_list_append(checks,node);
3463                                         }
3464     break;
3465 case 166:
3466 #line 1840 "parse.y"
3467 {
3468                         Node *node = node_new (CHECK_NODE,
3469                                                "chtype", LT_CHECK,
3470                                                "number:steal", yyvsp[0].id,
3471                                                NULL);
3472                         checks = g_list_append(checks,node);
3473                                         }
3474     break;
3475 case 167:
3476 #line 1847 "parse.y"
3477 {
3478                         Node *node = node_new (CHECK_NODE,
3479                                                "chtype", GE_CHECK,
3480                                                "number:steal", yyvsp[0].id,
3481                                                NULL);
3482                         checks = g_list_append(checks,node);
3483                                         }
3484     break;
3485 case 168:
3486 #line 1854 "parse.y"
3487 {
3488                         Node *node = node_new (CHECK_NODE,
3489                                                "chtype", LE_CHECK,
3490                                                "number:steal", yyvsp[0].id,
3491                                                NULL);
3492                         checks = g_list_append(checks,node);
3493                                         }
3494     break;
3495 case 169:
3496 #line 1861 "parse.y"
3497 {
3498                         Node *node = node_new (CHECK_NODE,
3499                                                "chtype", EQ_CHECK,
3500                                                "number:steal", yyvsp[0].id,
3501                                                NULL);
3502                         checks = g_list_append(checks,node);
3503                                         }
3504     break;
3505 case 170:
3506 #line 1868 "parse.y"
3507 {
3508                         Node *node = node_new (CHECK_NODE,
3509                                                "chtype", NE_CHECK,
3510                                                "number:steal", yyvsp[0].id,
3511                                                NULL);
3512                         checks = g_list_append(checks,node);
3513                                         }
3514     break;
3515 case 171:
3516 #line 1877 "parse.y"
3517 {
3518                         Node *node = node_new (ENUMDEF_NODE,
3519                                                "etype:steal", yyvsp[-1].id,
3520                                                "prefix:steal", yyvsp[-5].id,
3521                                                "values:steal", enum_vals,
3522                                                NULL);
3523                         enum_vals = NULL;
3524                         nodes = g_list_append (nodes, node);
3525                         }
3526     break;
3527 case 172:
3528 #line 1886 "parse.y"
3529 {
3530                         Node *node = node_new (ENUMDEF_NODE,
3531                                                "etype:steal", yyvsp[-1].id,
3532                                                "prefix:steal", yyvsp[-6].id,
3533                                                "values:steal", enum_vals,
3534                                                NULL);
3535                         enum_vals = NULL;
3536                         nodes = g_list_append (nodes, node);
3537                         }
3538     break;
3539 case 173:
3540 #line 1897 "parse.y"
3541 {;}
3542     break;
3543 case 174:
3544 #line 1898 "parse.y"
3545 {;}
3546     break;
3547 case 175:
3548 #line 1901 "parse.y"
3549 {
3550                         Node *node;
3551                         char *num = yyvsp[0].id;
3552
3553                         /* A float value, that's a bad enum */
3554                         if (num[0] >= '0' &&
3555                             num[0] <= '9' &&
3556                             strchr (num, '.') != NULL) {
3557                                 g_free (yyvsp[-2].id);
3558                                 g_free (num);
3559                                 yyerror(_("parse error (enumerator value not integer constant)"));
3560                                 YYERROR;
3561                         }
3562                        
3563                         node = node_new (ENUMVALUE_NODE,
3564                                          "name:steal", yyvsp[-2].id,
3565                                          "value:steal", num,
3566                                          NULL);
3567                         enum_vals = g_list_append (enum_vals, node);
3568                         }
3569     break;
3570 case 176:
3571 #line 1921 "parse.y"
3572 {
3573                         Node *node;
3574
3575                         node = node_new (ENUMVALUE_NODE,
3576                                          "name:steal", yyvsp[0].id,
3577                                          NULL);
3578                         enum_vals = g_list_append (enum_vals, node);
3579         }
3580     break;
3581 case 177:
3582 #line 1931 "parse.y"
3583 {
3584                         Node *node = node_new (FLAGS_NODE,
3585                                                "ftype:steal", yyvsp[-1].id,
3586                                                "prefix:steal", yyvsp[-5].id,
3587                                                "values:steal", flag_vals,
3588                                                NULL);
3589                         flag_vals = NULL;
3590                         nodes = g_list_append (nodes, node);
3591                         }
3592     break;
3593 case 178:
3594 #line 1940 "parse.y"
3595 {
3596                         Node *node = node_new (FLAGS_NODE,
3597                                                "ftype:steal", yyvsp[-1].id,
3598                                                "prefix:steal", yyvsp[-6].id,
3599                                                "values:steal", flag_vals,
3600                                                NULL);
3601                         flag_vals = NULL;
3602                         nodes = g_list_append (nodes, node);
3603                         }
3604     break;
3605 case 179:
3606 #line 1951 "parse.y"
3607 {
3608                         flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3609                 }
3610     break;
3611 case 180:
3612 #line 1954 "parse.y"
3613 {
3614                         flag_vals = g_list_append (flag_vals, yyvsp[0].id);
3615                 }
3616     break;
3617 case 181:
3618 #line 1959 "parse.y"
3619 {
3620                         Node *node = node_new (ERROR_NODE,
3621                                                "etype:steal", yyvsp[-1].id,
3622                                                "prefix:steal", yyvsp[-5].id,
3623                                                "values:steal", error_vals,
3624                                                NULL);
3625                         error_vals = NULL;
3626                         nodes = g_list_append (nodes, node);
3627                         }
3628     break;
3629 case 182:
3630 #line 1968 "parse.y"
3631 {
3632                         Node *node = node_new (ERROR_NODE,
3633                                                "etype:steal", yyvsp[-1].id,
3634                                                "prefix:steal", yyvsp[-6].id,
3635                                                "values:steal", error_vals,
3636                                                NULL);
3637                         error_vals = NULL;
3638                         nodes = g_list_append (nodes, node);
3639                         }
3640     break;
3641 case 183:
3642 #line 1979 "parse.y"
3643 {
3644                         error_vals = g_list_append (error_vals, yyvsp[0].id);
3645                 }
3646     break;
3647 case 184:
3648 #line 1982 "parse.y"
3649 {
3650                         error_vals = g_list_append (error_vals, yyvsp[0].id);
3651                 }
3652     break;
3653 case 185:
3654 #line 1988 "parse.y"
3655 { yyval.id = yyvsp[0].id; }
3656     break;
3657 case 186:
3658 #line 1989 "parse.y"
3659 {
3660                         yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
3661                         g_free(yyvsp[0].id);
3662                                         }
3663     break;
3664 case 187:
3665 #line 1993 "parse.y"
3666 { yyval.id = yyvsp[0].id; }
3667     break;
3668 case 188:
3669 #line 1994 "parse.y"
3670 { yyval.id = yyvsp[0].id; }
3671     break;
3672 }
3673
3674 #line 705 "/usr/share/bison/bison.simple"
3675
3676 \f
3677   yyvsp -= yylen;
3678   yyssp -= yylen;
3679 #if YYLSP_NEEDED
3680   yylsp -= yylen;
3681 #endif
3682
3683 #if YYDEBUG
3684   if (yydebug)
3685     {
3686       short *yyssp1 = yyss - 1;
3687       YYFPRINTF (stderr, "state stack now");
3688       while (yyssp1 != yyssp)
3689         YYFPRINTF (stderr, " %d", *++yyssp1);
3690       YYFPRINTF (stderr, "\n");
3691     }
3692 #endif
3693
3694   *++yyvsp = yyval;
3695 #if YYLSP_NEEDED
3696   *++yylsp = yyloc;
3697 #endif
3698
3699   /* Now `shift' the result of the reduction.  Determine what state
3700      that goes to, based on the state we popped back to and the rule
3701      number reduced by.  */
3702
3703   yyn = yyr1[yyn];
3704
3705   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3706   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3707     yystate = yytable[yystate];
3708   else
3709     yystate = yydefgoto[yyn - YYNTBASE];
3710
3711   goto yynewstate;
3712
3713
3714 /*------------------------------------.
3715 | yyerrlab -- here on detecting error |
3716 `------------------------------------*/
3717 yyerrlab:
3718   /* If not already recovering from an error, report this error.  */
3719   if (!yyerrstatus)
3720     {
3721       ++yynerrs;
3722
3723 #ifdef YYERROR_VERBOSE
3724       yyn = yypact[yystate];
3725
3726       if (yyn > YYFLAG && yyn < YYLAST)
3727         {
3728           YYSIZE_T yysize = 0;
3729           char *yymsg;
3730           int yyx, yycount;
3731
3732           yycount = 0;
3733           /* Start YYX at -YYN if negative to avoid negative indexes in
3734              YYCHECK.  */
3735           for (yyx = yyn < 0 ? -yyn : 0;
3736                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
3737             if (yycheck[yyx + yyn] == yyx)
3738               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
3739           yysize += yystrlen ("parse error, unexpected ") + 1;
3740           yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
3741           yymsg = (char *) YYSTACK_ALLOC (yysize);
3742           if (yymsg != 0)
3743             {
3744               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
3745               yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
3746
3747               if (yycount < 5)
3748                 {
3749                   yycount = 0;
3750                   for (yyx = yyn < 0 ? -yyn : 0;
3751                        yyx < (int) (sizeof (yytname) / sizeof (char *));
3752                        yyx++)
3753                     if (yycheck[yyx + yyn] == yyx)
3754                       {
3755                         const char *yyq = ! yycount ? ", expecting " : " or ";
3756                         yyp = yystpcpy (yyp, yyq);
3757                         yyp = yystpcpy (yyp, yytname[yyx]);
3758                         yycount++;
3759                       }
3760                 }
3761               yyerror (yymsg);
3762               YYSTACK_FREE (yymsg);
3763             }
3764           else
3765             yyerror ("parse error; also virtual memory exhausted");
3766         }
3767       else
3768 #endif /* defined (YYERROR_VERBOSE) */
3769         yyerror ("parse error");
3770     }
3771   goto yyerrlab1;
3772
3773
3774 /*--------------------------------------------------.
3775 | yyerrlab1 -- error raised explicitly by an action |
3776 `--------------------------------------------------*/
3777 yyerrlab1:
3778   if (yyerrstatus == 3)
3779     {
3780       /* If just tried and failed to reuse lookahead token after an
3781          error, discard it.  */
3782
3783       /* return failure if at end of input */
3784       if (yychar == YYEOF)
3785         YYABORT;
3786       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
3787                   yychar, yytname[yychar1]));
3788       yychar = YYEMPTY;
3789     }
3790
3791   /* Else will try to reuse lookahead token after shifting the error
3792      token.  */
3793
3794   yyerrstatus = 3;              /* Each real token shifted decrements this */
3795
3796   goto yyerrhandle;
3797
3798
3799 /*-------------------------------------------------------------------.
3800 | yyerrdefault -- current state does not do anything special for the |
3801 | error token.                                                       |
3802 `-------------------------------------------------------------------*/
3803 yyerrdefault:
3804 #if 0
3805   /* This is wrong; only states that explicitly want error tokens
3806      should shift them.  */
3807
3808   /* If its default is to accept any token, ok.  Otherwise pop it.  */
3809   yyn = yydefact[yystate];
3810   if (yyn)
3811     goto yydefault;
3812 #endif
3813
3814
3815 /*---------------------------------------------------------------.
3816 | yyerrpop -- pop the current state because it cannot handle the |
3817 | error token                                                    |
3818 `---------------------------------------------------------------*/
3819 yyerrpop:
3820   if (yyssp == yyss)
3821     YYABORT;
3822   yyvsp--;
3823   yystate = *--yyssp;
3824 #if YYLSP_NEEDED
3825   yylsp--;
3826 #endif
3827
3828 #if YYDEBUG
3829   if (yydebug)
3830     {
3831       short *yyssp1 = yyss - 1;
3832       YYFPRINTF (stderr, "Error: state stack now");
3833       while (yyssp1 != yyssp)
3834         YYFPRINTF (stderr, " %d", *++yyssp1);
3835       YYFPRINTF (stderr, "\n");
3836     }
3837 #endif
3838
3839 /*--------------.
3840 | yyerrhandle.  |
3841 `--------------*/
3842 yyerrhandle:
3843   yyn = yypact[yystate];
3844   if (yyn == YYFLAG)
3845     goto yyerrdefault;
3846
3847   yyn += YYTERROR;
3848   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3849     goto yyerrdefault;
3850
3851   yyn = yytable[yyn];
3852   if (yyn < 0)
3853     {
3854       if (yyn == YYFLAG)
3855         goto yyerrpop;
3856       yyn = -yyn;
3857       goto yyreduce;
3858     }
3859   else if (yyn == 0)
3860     goto yyerrpop;
3861
3862   if (yyn == YYFINAL)
3863     YYACCEPT;
3864
3865   YYDPRINTF ((stderr, "Shifting error token, "));
3866
3867   *++yyvsp = yylval;
3868 #if YYLSP_NEEDED
3869   *++yylsp = yylloc;
3870 #endif
3871
3872   yystate = yyn;
3873   goto yynewstate;
3874
3875
3876 /*-------------------------------------.
3877 | yyacceptlab -- YYACCEPT comes here.  |
3878 `-------------------------------------*/
3879 yyacceptlab:
3880   yyresult = 0;
3881   goto yyreturn;
3882
3883 /*-----------------------------------.
3884 | yyabortlab -- YYABORT comes here.  |
3885 `-----------------------------------*/
3886 yyabortlab:
3887   yyresult = 1;
3888   goto yyreturn;
3889
3890 /*---------------------------------------------.
3891 | yyoverflowab -- parser overflow comes here.  |
3892 `---------------------------------------------*/
3893 yyoverflowlab:
3894   yyerror ("parser stack overflow");
3895   yyresult = 2;
3896   /* Fall through.  */
3897
3898 yyreturn:
3899 #ifndef yyoverflow
3900   if (yyss != yyssa)
3901     YYSTACK_FREE (yyss);
3902 #endif
3903   return yyresult;
3904 }
3905 #line 1997 "parse.y"
3906