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