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