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