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