]> git.draconx.ca Git - gob-dx.git/blob - src/parse.c
Release 1.0.12
[gob-dx.git] / src / parse.c
1
2 /*  A Bison parser, made from parse.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define CLASS   257
8 #define FROM    258
9 #define CONST   259
10 #define VOID    260
11 #define STRUCT  261
12 #define UNION   262
13 #define ENUM    263
14 #define THREEDOTS       264
15 #define SIGNED  265
16 #define UNSIGNED        266
17 #define LONG    267
18 #define SHORT   268
19 #define INT     269
20 #define FLOAT   270
21 #define DOUBLE  271
22 #define CHAR    272
23 #define TOKEN   273
24 #define NUMBER  274
25 #define TYPETOKEN       275
26 #define ARRAY_DIM       276
27 #define CCODE   277
28 #define HTCODE  278
29 #define PHCODE  279
30 #define HCODE   280
31 #define ACODE   281
32 #define ATCODE  282
33 #define PUBLIC  283
34 #define PRIVATE 284
35 #define PROTECTED       285
36 #define CLASSWIDE       286
37 #define ARGUMENT        287
38 #define VIRTUAL 288
39 #define SIGNAL  289
40 #define OVERRIDE        290
41
42 #line 21 "parse.y"
43
44
45 #include "config.h"
46 #include <glib.h>
47 #include <stdio.h>
48 #include <stdlib.h>
49 #include <string.h>
50
51 #include "treefuncs.h"
52 #include "main.h"
53 #include "util.h"
54
55 #define _(x) (x)
56         
57 GList *nodes = NULL;
58
59 static GList *class_nodes = NULL;
60 Node *class = NULL;
61
62 static char *chunk_size = NULL;
63 static char *bonobo_x_class = NULL;
64 static GList *typestack = NULL;
65 static GList *funcargs = NULL;
66 static GList *checks = NULL;
67 static int has_self = FALSE;
68 static int vararg = FALSE;
69 static Method *last_added_method = NULL;
70
71 /* destructor and initializer for variables */
72 static char *destructor = NULL;
73 static int destructor_line = 0;
74 static gboolean destructor_simple = TRUE;
75 static char *initializer = NULL;
76 static int initializer_line = 0;
77
78 static char *onerror = NULL;
79 static char *defreturn = NULL;
80
81 static GList *gtktypes = NULL;
82
83 /* this can be a global as we will only do one function at a time
84    anyway */
85 static int the_scope = NO_SCOPE;
86
87 void free(void *ptr);
88 int yylex(void);
89
90 extern int ccode_line;
91 extern int line_no;
92
93 extern char *yytext;
94
95 static void
96 yyerror(char *str)
97 {
98         char *out=NULL;
99         char *p;
100         
101         if(strcmp(yytext,"\n")==0) {
102                 out=g_strconcat("Error: ",str," before newline",NULL);
103         } else if(yytext[0]=='\0') {
104                 out=g_strconcat("Error: ", str, " at end of input", NULL);
105         } else {
106                 char *tmp = g_strdup(yytext);
107                 while((p=strchr(tmp, '\n')))
108                         *p='.';
109
110                 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
111                 g_free(tmp);
112         }
113
114         fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
115         g_free(out);
116         
117         exit(1);
118 }
119
120 static Type *
121 pop_type(void)
122 {
123         Type *type = typestack->data;
124         typestack = g_list_remove(typestack,typestack->data);
125         return type;
126 }
127
128 static void
129 push_variable(char *name, int scope, int line_no, char *postfix)
130 {
131         Node *var;
132         Type *type = pop_type();
133
134         type->postfix = postfix;
135         
136         var = new_variable(scope, type, name, line_no,
137                            destructor, destructor_line,
138                            destructor_simple,
139                            initializer, initializer_line);
140         class_nodes = g_list_append(class_nodes, var);
141 }
142
143 static void
144 push_function(int scope, int method, char *oid, char *id,
145               GString *cbuf, int line_no, int ccode_line,
146               gboolean vararg, GList *flags)
147 {
148         Node *node;
149         Type *type;
150         char *c_cbuf;
151
152         g_assert(scope != CLASS_SCOPE);
153        
154         if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
155                 type = (Type *)new_type(g_strdup("void"), NULL, NULL);
156         } else {
157                 type = pop_type();
158         }
159         
160         /* a complicated and ugly test to figure out if we have
161            the wrong number of types for a signal */
162         if((method == SIGNAL_FIRST_METHOD ||
163             method == SIGNAL_LAST_METHOD) &&
164            g_list_length(gtktypes) != g_list_length(funcargs) &&
165            !(g_list_length(funcargs) == 1 &&
166              g_list_length(gtktypes) == 2 &&
167              strcmp(gtktypes->next->data, "NONE")==0)) {
168                 error_print(GOB_WARN, line_no,
169                             _("The number of GTK arguments and "
170                               "function arguments for a signal "
171                               "don't seem to match"));
172         }
173         if(g_list_length(gtktypes) > 2) {
174                 GList *li;
175                 for(li = gtktypes->next; li; li = li->next) {
176                         if(strcmp(li->data, "NONE")==0) {
177                                 error_print(GOB_ERROR, line_no,
178                                             _("NONE can only appear in an "
179                                               "argument list by itself"));
180                         }
181                 }
182         }
183         if(cbuf) {
184                 char *p;
185                 c_cbuf = p = cbuf->str;
186                 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
187                         p++;
188                 if(!p || !*p)
189                         c_cbuf = NULL;
190         } else
191                 c_cbuf = NULL;
192
193         node = new_method(scope, method, type, oid, gtktypes, flags,
194                           id, funcargs, onerror, defreturn, c_cbuf, line_no,
195                           ccode_line, vararg, method_unique_id++,
196                           FALSE);
197
198         last_added_method = (Method *)node;
199
200         if(cbuf)
201                 g_string_free(cbuf,
202                               /*only free segment if we haven't passed it
203                                 above */
204                               c_cbuf?FALSE:TRUE);
205         gtktypes = NULL;
206         funcargs = NULL;
207
208         onerror = NULL;
209         defreturn = NULL;
210
211         class_nodes = g_list_append(class_nodes, node);
212 }
213
214 static void
215 free_all_global_state(void)
216 {
217         g_free(onerror);
218         onerror = NULL;
219         g_free(defreturn);
220         defreturn = NULL;
221
222         g_free(chunk_size);
223         chunk_size = NULL;
224         
225         g_list_foreach(gtktypes, (GFunc)g_free, NULL);
226         g_list_free(gtktypes);
227         gtktypes = NULL;
228
229         free_node_list(funcargs);
230         funcargs = NULL;
231 }
232
233 static void
234 push_funcarg(char *name, char *postfix)
235 {
236         Node *node;
237         Type *type = pop_type();
238
239         type->postfix = postfix;
240         
241         node = new_funcarg(type, name, checks);
242         checks = NULL;
243         
244         funcargs = g_list_append(funcargs, node);
245 }
246
247 static void
248 push_init_arg(char *name, int is_class)
249 {
250         Node *node;
251         Node *type;
252         char *tn;
253         
254         if(is_class)
255                 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
256         else
257                 tn = g_strdup(((Class *)class)->otype);
258
259         type = new_type(tn, g_strdup("*"), NULL);
260         node = new_funcarg((Type *)type,name,NULL);
261         funcargs = g_list_prepend(funcargs, node);
262 }
263
264 static void
265 push_self(char *id, gboolean constant)
266 {
267         Node *node;
268         Node *type;
269         GList *ch = NULL;
270         type = new_type(g_strdup(((Class *)class)->otype),
271                         g_strdup(constant ? "const *" : "*"), NULL);
272         ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
273         ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
274         node = new_funcarg((Type *)type,id,ch);
275         funcargs = g_list_prepend(funcargs, node);
276 }
277
278 static Variable *
279 find_var_or_die(const char *id, int line)
280 {
281         GList *li;
282
283         for(li = class_nodes; li != NULL; li = li->next) {
284                 Variable *var;
285                 Node *node = li->data;
286                 if(node->type != VARIABLE_NODE)
287                         continue;
288                 var = li->data;
289                 if(strcmp(var->id, id)==0)
290                         return var;
291         }
292
293         error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
294
295         g_assert_not_reached();
296         return NULL;
297 }
298
299 static gboolean
300 set_return_value(char *type, char *val)
301 {
302         if(strcmp(type, "onerror")==0) {
303                 if(!onerror) {
304                         onerror = val;
305                         return TRUE;
306                 } else
307                         return FALSE;
308         } else if(strcmp(type, "defreturn")==0) {
309                 if(!defreturn) {
310                         defreturn = val;
311                         return TRUE;
312                 } else
313                         return FALSE;
314         }
315         return FALSE;
316 }
317
318 static void
319 export_accessors (const char *var_name,
320                   const char *get_cbuf,
321                   int get_lineno,
322                   const char *set_cbuf,
323                   int set_lineno,
324                   Type *type,
325                   const char *gtktype,
326                   int lineno)
327 {       
328         if (type == NULL) {
329                 char *cast = g_strdup (get_cast (gtktype, FALSE));
330                 char *p = strchr (cast, ' ');
331                 if (p != NULL) {
332                         *p = '\0';
333                         p++;
334                 }
335                 /* leak, but we don't really care any more */
336                 type = (Type *)new_type (cast,
337                                          g_strdup (p),
338                                          NULL);
339         }
340
341         if (get_cbuf != NULL) {
342                 char *get_id = g_strdup_printf ("get_%s", var_name);
343                 GString *get_cbuf_copy = g_string_new (get_cbuf);
344                 char *tmp;
345                 Node *node1 = new_type (g_strdup (type->name),
346                                         g_strdup (type->pointer),
347                                         g_strdup (type->postfix));
348                 Node *node3 = new_type (g_strdup (class->class.otype),
349                                         g_strdup ("*"),
350                                         NULL);
351
352                 tmp = g_strdup_printf ("\t%s%s ARG;\n", 
353                                        type->name, 
354                                        type->pointer ? type->pointer : "");
355                 get_cbuf_copy = g_string_prepend (get_cbuf_copy, tmp);
356                 g_free (tmp);
357                 
358                 tmp = g_strdup_printf ("\n\t\treturn ARG;\n");
359                 get_cbuf_copy = g_string_append (get_cbuf_copy, tmp);
360                 g_free (tmp);
361                 
362                 typestack = g_list_prepend (typestack, node1);
363                 typestack = g_list_prepend (typestack, node3);
364                 
365                 push_funcarg ("self", FALSE);
366                 
367                 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
368                                get_id, get_cbuf_copy, get_lineno,
369                                lineno, FALSE, NULL);
370         }
371         
372         if (set_cbuf != NULL) {
373                 char *set_id = g_strdup_printf ("set_%s", var_name);
374                 GString *set_cbuf_copy = g_string_new (set_cbuf);
375                 Node *node1 = new_type (g_strdup (type->name),
376                                         g_strdup (type->pointer),
377                                         g_strdup (type->postfix));
378                 Node *node2 = new_type (g_strdup ("void"),
379                                         NULL,
380                                         NULL);
381                 Node *node3 = new_type (g_strdup (class->class.otype),
382                                         g_strdup ("*"),
383                                         NULL);
384
385                 typestack = g_list_prepend (typestack, node2);
386                 typestack = g_list_prepend (typestack, node1);
387                 typestack = g_list_prepend (typestack, node3);
388                 
389                 push_funcarg ("self", FALSE);
390                 push_funcarg ("ARG", FALSE);
391         
392                 typestack = g_list_prepend (typestack, node2);
393                 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
394                                set_id, set_cbuf_copy, set_lineno,
395                                lineno, FALSE, NULL);
396         }
397 }
398
399
400 #line 379 "parse.y"
401 typedef union {
402         char *id;
403         GString *cbuf;
404         GList *list;
405         int line;
406         int sigtype;
407 } YYSTYPE;
408 #ifndef YYDEBUG
409 #define YYDEBUG 1
410 #endif
411
412 #include <stdio.h>
413
414 #ifndef __cplusplus
415 #ifndef __STDC__
416 #define const
417 #endif
418 #endif
419
420
421
422 #define YYFINAL         274
423 #define YYFLAG          -32768
424 #define YYNTBASE        50
425
426 #define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 89)
427
428 static const char yytranslate[] = {     0,
429      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
431      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
432      2,     2,    48,     2,     2,     2,     2,     2,     2,    39,
433     40,    44,     2,    45,    49,     2,     2,     2,     2,     2,
434      2,     2,     2,     2,     2,     2,     2,     2,    41,    47,
435     42,    46,     2,     2,     2,     2,     2,     2,     2,     2,
436      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
437      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
438      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
439      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441      2,     2,    37,    43,    38,     2,     2,     2,     2,     2,
442      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
443      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
444      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
445      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
446      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
447      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
448      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
449      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
450      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
451      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
452      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
453      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
454      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
455      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
456     17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
457     27,    28,    29,    30,    31,    32,    33,    34,    35,    36
458 };
459
460 #if YYDEBUG != 0
461 static const short yyprhs[] = {     0,
462      0,     4,     7,    10,    12,    14,    16,    18,    20,    22,
463     24,    27,    29,    34,    38,    44,    45,    51,    57,    60,
464     62,    64,    67,    69,    71,    73,    75,    77,    79,    81,
465     84,    88,    91,    95,    98,   101,   103,   105,   106,   112,
466    119,   132,   142,   149,   153,   154,   160,   162,   166,   167,
467    171,   173,   176,   178,   180,   182,   185,   188,   191,   195,
468    199,   202,   205,   208,   210,   213,   215,   218,   220,   222,
469    224,   226,   228,   230,   232,   234,   236,   238,   240,   242,
470    244,   247,   250,   254,   257,   259,   263,   267,   270,   272,
471    277,   281,   283,   286,   288,   299,   311,   321,   331,   340,
472    352,   361,   367,   370,   375,   376,   378,   381,   383,   385,
473    388,   391,   395,   400,   405,   407,   411,   413,   417,   419,
474    422,   426,   433,   441,   444,   446,   448,   451,   454,   458,
475    462,   466,   470,   472,   475
476 };
477
478 static const short yyrhs[] = {    52,
479     53,    52,     0,    53,    52,     0,    52,    53,     0,    53,
480      0,    23,     0,    26,     0,    24,     0,    25,     0,    27,
481      0,    28,     0,    52,    51,     0,    51,     0,    54,    37,
482     56,    38,     0,    54,    37,    38,     0,     3,    21,     4,
483     21,    55,     0,     0,    39,    19,    19,    40,    55,     0,
484     39,    19,    20,    40,    55,     0,    56,    57,     0,    57,
485      0,    79,     0,    19,    79,     0,    62,     0,    63,     0,
486     41,     0,    29,     0,    30,     0,    31,     0,    32,     0,
487     19,    19,     0,    19,    37,    23,     0,    42,    88,     0,
488     42,    37,    23,     0,    59,    60,     0,    60,    59,     0,
489     60,     0,    59,     0,     0,    58,    68,    19,    61,    41,
490      0,    58,    68,    19,    22,    61,    41,     0,    33,    66,
491     65,    19,    64,    19,    37,    23,    19,    37,    23,    41,
492      0,    33,    66,    65,    19,    64,    19,    37,    23,    41,
493      0,    33,    66,    65,    19,    64,    19,     0,    39,    19,
494     40,     0,     0,    19,    39,    19,    68,    40,     0,    19,
495      0,    39,    67,    40,     0,     0,    19,    43,    67,     0,
496     19,     0,    69,    73,     0,    69,     0,    70,     0,    19,
497      0,     5,    19,     0,    19,     5,     0,    72,    19,     0,
498      5,    72,    19,     0,    72,    19,     5,     0,    71,    70,
499      0,    21,    70,     0,     5,    70,     0,    21,     0,    21,
500      5,     0,    71,     0,    71,     5,     0,     6,     0,    18,
501      0,    14,     0,    15,     0,    13,     0,    16,     0,    17,
502      0,    11,     0,    12,     0,     7,     0,     8,     0,     9,
503      0,    44,     0,    44,     5,     0,    44,    73,     0,    44,
504      5,    73,     0,    19,    76,     0,    76,     0,    58,    19,
505     76,     0,    19,    58,    76,     0,    58,    76,     0,    74,
506      0,    19,    39,    77,    40,     0,    77,    45,    19,     0,
507     19,     0,    37,    23,     0,    41,     0,    35,    66,    75,
508     68,    19,    39,    82,    40,    80,    78,     0,    58,    35,
509     66,    74,    68,    19,    39,    82,    40,    80,    78,     0,
510     34,    58,    68,    19,    39,    82,    40,    80,    78,     0,
511     58,    34,    68,    19,    39,    82,    40,    80,    78,     0,
512     34,    68,    19,    39,    82,    40,    80,    78,     0,    36,
513     39,    21,    40,    68,    19,    39,    82,    40,    80,    78,
514      0,    58,    68,    19,    39,    82,    40,    80,    78,     0,
515     19,    39,    19,    40,    78,     0,    19,    81,     0,    19,
516     81,    19,    81,     0,     0,    88,     0,    37,    23,     0,
517      6,     0,    19,     0,    19,     5,     0,     5,    19,     0,
518     19,    45,    83,     0,    19,     5,    45,    83,     0,     5,
519     19,    45,    83,     0,    83,     0,    84,    45,    10,     0,
520     84,     0,    84,    45,    85,     0,    85,     0,    68,    19,
521      0,    68,    19,    22,     0,    68,    19,    39,    19,    86,
522     40,     0,    68,    19,    22,    39,    19,    86,    40,     0,
523     86,    87,     0,    87,     0,    19,     0,    46,    88,     0,
524     47,    88,     0,    46,    42,    88,     0,    47,    42,    88,
525      0,    42,    42,    88,     0,    48,    42,    88,     0,    20,
526      0,    49,    20,     0,    19,     0
527 };
528
529 #endif
530
531 #if YYDEBUG != 0
532 static const short yyrline[] = { 0,
533    397,   398,   399,   400,   403,   409,   415,   421,   427,   433,
534    441,   442,   445,   450,   457,   463,   464,   476,   490,   491,
535    494,   495,   503,   504,   505,   508,   509,   510,   511,   514,
536    527,   543,   547,   555,   556,   557,   558,   559,   565,   568,
537    573,   637,   689,   775,   783,   785,   794,   800,   801,   804,
538    807,   813,   817,   824,   827,   830,   834,   838,   842,   847,
539    855,   859,   864,   868,   871,   875,   878,   883,   884,   885,
540    886,   887,   888,   889,   890,   891,   894,   895,   896,   899,
541    900,   901,   905,   912,   924,   930,   942,   954,   957,   963,
542    968,   971,   976,   977,   981,   997,  1013,  1029,  1045,  1056,
543   1062,  1072,  1095,  1106,  1125,  1131,  1132,  1138,  1139,  1150,
544   1161,  1172,  1182,  1192,  1202,  1205,  1206,  1209,  1210,  1213,
545   1216,  1219,  1227,  1237,  1238,  1241,  1254,  1258,  1262,  1266,
546   1270,  1274,  1280,  1281,  1285
547 };
548 #endif
549
550
551 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
552
553 static const char * const yytname[] = {   "$","error","$undefined.","CLASS",
554 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
555 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","TOKEN","NUMBER","TYPETOKEN","ARRAY_DIM",
556 "CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","PUBLIC","PRIVATE","PROTECTED",
557 "CLASSWIDE","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","'('","')'",
558 "';'","'='","'|'","'*'","','","'>'","'<'","'!'","'-'","prog","ccode","ccodes",
559 "class","classdec","classflags","classcode","thing","scope","destructor","initializer",
560 "varoptions","variable","argument","export","argtype","flags","flaglist","type",
561 "specifier_list","spec_list","specifier","strunionenum","pointer","simplesigtype",
562 "fullsigtype","sigtype","tokenlist","codenocode","method","returnvals","retcode",
563 "funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL
564 };
565 #endif
566
567 static const short yyr1[] = {     0,
568     50,    50,    50,    50,    51,    51,    51,    51,    51,    51,
569     52,    52,    53,    53,    54,    55,    55,    55,    56,    56,
570     57,    57,    57,    57,    57,    58,    58,    58,    58,    59,
571     59,    60,    60,    61,    61,    61,    61,    61,    62,    62,
572     63,    63,    63,    64,    64,    65,    65,    66,    66,    67,
573     67,    68,    68,    69,    69,    69,    69,    69,    69,    69,
574     70,    70,    70,    70,    70,    70,    70,    71,    71,    71,
575     71,    71,    71,    71,    71,    71,    72,    72,    72,    73,
576     73,    73,    73,    74,    74,    75,    75,    75,    75,    76,
577     77,    77,    78,    78,    79,    79,    79,    79,    79,    79,
578     79,    79,    80,    80,    80,    81,    81,    82,    82,    82,
579     82,    82,    82,    82,    82,    83,    83,    84,    84,    85,
580     85,    85,    85,    86,    86,    87,    87,    87,    87,    87,
581     87,    87,    88,    88,    88
582 };
583
584 static const short yyr2[] = {     0,
585      3,     2,     2,     1,     1,     1,     1,     1,     1,     1,
586      2,     1,     4,     3,     5,     0,     5,     5,     2,     1,
587      1,     2,     1,     1,     1,     1,     1,     1,     1,     2,
588      3,     2,     3,     2,     2,     1,     1,     0,     5,     6,
589     12,     9,     6,     3,     0,     5,     1,     3,     0,     3,
590      1,     2,     1,     1,     1,     2,     2,     2,     3,     3,
591      2,     2,     2,     1,     2,     1,     2,     1,     1,     1,
592      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
593      2,     2,     3,     2,     1,     3,     3,     2,     1,     4,
594      3,     1,     2,     1,    10,    11,     9,     9,     8,    11,
595      8,     5,     2,     4,     0,     1,     2,     1,     1,     2,
596      2,     3,     4,     4,     1,     3,     1,     3,     1,     2,
597      3,     6,     7,     2,     1,     1,     2,     2,     3,     3,
598      3,     3,     1,     2,     1
599 };
600
601 static const short yydefact[] = {     0,
602      0,     5,     7,     8,     6,     9,    10,    12,     0,     4,
603      0,     0,    11,     3,     2,     0,     0,     1,     0,    26,
604     27,    28,    29,    49,     0,    49,     0,    14,    25,     0,
605     20,     0,    23,    24,    21,    16,     0,     0,     0,    22,
606      0,     0,     0,    68,    77,    78,    79,    75,    76,    72,
607     70,    71,    73,    74,    69,    55,    64,     0,     0,    53,
608     54,    66,     0,     0,     0,    13,    19,     0,    49,     0,
609      0,    15,     0,     0,    51,     0,    47,     0,     0,    56,
610     63,     0,    57,    65,    62,     0,     0,    80,    52,    67,
611     61,    58,     0,     0,    89,     0,    85,     0,     0,     0,
612     38,     0,     0,     0,     0,    48,     0,    45,    59,     0,
613      0,    81,    82,    60,     0,     0,     0,    84,     0,    88,
614      0,     0,     0,     0,     0,     0,    38,     0,     0,    37,
615     36,     0,     0,     0,     0,    94,   102,    50,     0,     0,
616      0,     0,     0,    68,    55,     0,     0,   115,   117,   119,
617     83,    92,     0,    87,    86,     0,     0,     0,     0,    30,
618      0,     0,     0,   135,   133,     0,     0,    32,    34,    35,
619     39,    16,    16,    93,     0,     0,    43,     0,    56,    57,
620      0,   120,   105,     0,    90,     0,     0,     0,     0,     0,
621     31,    40,   105,    33,   134,    17,    18,    46,    44,     0,
622    105,     0,     0,   112,   121,     0,     0,     0,   116,   118,
623     91,     0,     0,   105,     0,     0,     0,     0,   114,   113,
624      0,     0,     0,   103,   106,    99,   105,     0,     0,     0,
625    101,     0,    42,    97,     0,   126,     0,     0,     0,     0,
626      0,   125,   107,     0,     0,   105,    98,   105,     0,     0,
627      0,     0,   127,     0,   128,     0,   122,   124,   104,    95,
628      0,     0,     0,   123,   131,   129,   130,   132,   100,    96,
629     41,     0,     0,     0
630 };
631
632 static const short yydefgoto[] = {   272,
633      8,     9,    10,    11,    72,    30,    31,    32,   130,   131,
634    132,    33,    34,   141,    78,    42,    76,   146,    60,    61,
635     62,    63,    89,    95,    96,    97,   153,   137,    35,   208,
636    224,   147,   148,   149,   150,   241,   242,   225
637 };
638
639 static const short yypact[] = {   175,
640     34,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   175,   236,
641     47,   104,-32768,   236,   236,   176,    96,   236,   212,-32768,
642 -32768,-32768,-32768,   107,   158,   107,   109,-32768,-32768,   194,
643 -32768,   123,-32768,-32768,-32768,   110,   111,   124,   123,-32768,
644    135,   136,   278,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
645 -32768,-32768,-32768,-32768,-32768,   154,   346,   295,   149,   138,
646 -32768,   360,   161,   162,   163,-32768,-32768,   295,   107,   164,
647    166,-32768,   146,   177,   172,   157,   165,   197,   374,-32768,
648 -32768,   199,-32768,   374,-32768,   200,   181,     2,-32768,   374,
649 -32768,   216,   226,   203,-32768,   295,-32768,   193,   215,   217,
650     57,    74,    37,   198,   135,-32768,   219,   201,-32768,   210,
651    312,   138,-32768,-32768,   211,   220,   233,-32768,    -2,-32768,
652    234,   295,   242,    -2,   295,    -8,    -6,   312,    38,   246,
653    235,   257,   265,   275,   299,-32768,-32768,-32768,   295,   313,
654    320,   312,   329,   309,     5,   334,   314,-32768,   310,-32768,
655 -32768,-32768,   -20,-32768,-32768,   317,   349,   312,   350,-32768,
656    347,   341,   343,-32768,-32768,   361,   373,-32768,-32768,-32768,
657 -32768,   110,   110,-32768,   354,   356,   362,   357,   -18,    81,
658    295,    61,   379,   261,-32768,   381,   312,   363,   364,   366,
659 -32768,-32768,   379,-32768,-32768,-32768,-32768,-32768,-32768,   378,
660    379,   295,   295,-32768,   367,   384,    40,    37,-32768,-32768,
661 -32768,   368,   312,   379,   312,    37,    29,    37,-32768,-32768,
662    388,   114,   386,   391,-32768,-32768,   379,   371,    37,   372,
663 -32768,   376,-32768,-32768,   114,-32768,   375,    46,    62,   377,
664     72,-32768,-32768,    40,    37,   379,-32768,   379,   392,   105,
665     48,    48,-32768,    48,-32768,    48,-32768,-32768,-32768,-32768,
666     37,    37,   380,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
667 -32768,   414,   416,-32768
668 };
669
670 static const short yypgoto[] = {-32768,
671     98,    14,   409,-32768,   -67,-32768,   390,   -13,   291,   293,
672    297,-32768,-32768,-32768,-32768,   -22,   321,   -24,-32768,   -41,
673 -32768,   -40,   -79,   325,-32768,   -63,-32768,  -176,   408,  -175,
674    184,  -123,  -140,-32768,   245,   195,  -227,  -129
675 };
676
677
678 #define YYLAST          430
679
680
681 static const short yytable[] = {   168,
682     59,    81,    82,    64,   163,    39,   112,    70,   113,   180,
683    160,    58,   126,   258,    74,    85,   115,   216,   178,   185,
684     91,  -111,   258,    15,   186,   218,   202,    18,   161,   118,
685    120,   226,   151,    86,   189,   129,   116,    81,   229,   231,
686    204,   234,    81,    99,  -109,    88,   100,   232,    81,   181,
687     94,   245,   247,   154,    12,   155,   164,   165,   164,   165,
688    118,   219,   220,   212,   164,   165,   164,   165,   260,   233,
689    261,   121,   262,   135,   166,   126,   223,   136,   127,   117,
690    164,   165,   205,    16,   269,   270,   167,   252,   167,   228,
691    236,   230,   133,   134,   167,   128,   167,   157,   129,   206,
692    159,    81,    82,   254,   196,   197,    13,    17,   253,   255,
693    167,   257,    13,   237,   175,    13,    36,   238,   239,   240,
694   -110,   265,   266,   236,   267,   203,   268,    43,    44,    45,
695     46,    47,   236,    48,    49,    50,    51,    52,    53,    54,
696     55,    56,    73,    57,   264,    41,   237,    65,    71,    38,
697    238,   239,   240,    75,    77,   237,    68,    69,    83,   238,
698    239,   240,    43,    44,    45,    46,    47,    87,    48,    49,
699     50,    51,    52,    53,    54,    55,    56,     1,    57,    92,
700     93,    88,   101,    98,   102,   103,    20,    21,    22,    23,
701     20,    21,    22,    23,    19,   104,   106,     2,     3,     4,
702      5,     6,     7,   107,    20,    21,    22,    23,    24,    25,
703     26,    27,    19,    28,   105,   108,    29,   109,   110,   111,
704    114,   119,    20,    21,    22,    23,    24,    25,    26,    27,
705     37,    66,   122,   123,    29,   124,   128,   139,   152,   140,
706     20,    21,    22,    23,   115,    25,    26,    27,   142,   116,
707     38,   115,   156,   126,    20,    21,    22,    23,     2,     3,
708      4,     5,     6,     7,   116,    43,    44,    45,    46,    47,
709    209,    48,    49,    50,    51,    52,    53,    54,    55,    56,
710    158,    57,    79,    44,    45,    46,    47,   129,    48,    49,
711     50,    51,    52,    53,    54,    55,    80,   171,    57,    43,
712     44,    45,    46,    47,   172,    48,    49,    50,    51,    52,
713     53,    54,    55,    56,   173,    57,   143,   144,    45,    46,
714     47,   174,    48,    49,    50,    51,    52,    53,    54,    55,
715    145,   176,    57,    79,    44,    45,    46,    47,   177,    48,
716     49,    50,    51,    52,    53,    54,    55,   179,  -108,    57,
717     84,    44,   182,   183,   184,   187,    48,    49,    50,    51,
718     52,    53,    54,    55,    90,    44,    57,   188,   190,   191,
719     48,    49,    50,    51,    52,    53,    54,    55,    79,    44,
720     57,   192,   193,   194,    48,    49,    50,    51,    52,    53,
721     54,    55,   195,   198,    57,   199,   201,   207,   200,   211,
722    217,   213,   222,   214,   215,   221,   235,   227,   243,   244,
723    246,   248,   249,   273,   263,   274,   251,    14,   256,    67,
724    271,   170,   169,   162,   125,   138,    40,   259,   210,   250
725 };
726
727 static const short yycheck[] = {   129,
728     25,    43,    43,    26,   128,    19,     5,    32,    88,     5,
729     19,    25,    19,   241,    39,    57,    19,   193,   142,    40,
730     62,    40,   250,    10,    45,   201,    45,    14,    37,    93,
731     94,   208,   112,    58,   158,    42,    39,    79,   214,   216,
732    181,   218,    84,    68,    40,    44,    69,    19,    90,    45,
733     64,   227,   229,   117,    21,   119,    19,    20,    19,    20,
734    124,   202,   203,   187,    19,    20,    19,    20,   245,    41,
735    246,    96,   248,    37,    37,    19,    37,    41,    22,    93,
736     19,    20,    22,    37,   261,   262,    49,    42,    49,   213,
737     19,   215,    19,    20,    49,    39,    49,   122,    42,    39,
738    125,   143,   143,    42,   172,   173,     9,     4,   238,   239,
739     49,    40,    15,    42,   139,    18,    21,    46,    47,    48,
740     40,   251,   252,    19,   254,    45,   256,     5,     6,     7,
741      8,     9,    19,    11,    12,    13,    14,    15,    16,    17,
742     18,    19,    19,    21,    40,    39,    42,    39,    39,    39,
743     46,    47,    48,    19,    19,    42,    34,    35,     5,    46,
744     47,    48,     5,     6,     7,     8,     9,    19,    11,    12,
745     13,    14,    15,    16,    17,    18,    19,     3,    21,    19,
746     19,    44,    19,    21,    19,    40,    29,    30,    31,    32,
747     29,    30,    31,    32,    19,    19,    40,    23,    24,    25,
748     26,    27,    28,    39,    29,    30,    31,    32,    33,    34,
749     35,    36,    19,    38,    43,    19,    41,    19,    19,    39,
750      5,    19,    29,    30,    31,    32,    33,    34,    35,    36,
751     19,    38,    40,    19,    41,    19,    39,    19,    19,    39,
752     29,    30,    31,    32,    19,    34,    35,    36,    39,    39,
753     39,    19,    19,    19,    29,    30,    31,    32,    23,    24,
754     25,    26,    27,    28,    39,     5,     6,     7,     8,     9,
755     10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
756     39,    21,     5,     6,     7,     8,     9,    42,    11,    12,
757     13,    14,    15,    16,    17,    18,    19,    41,    21,     5,
758      6,     7,     8,     9,    40,    11,    12,    13,    14,    15,
759     16,    17,    18,    19,    40,    21,     5,     6,     7,     8,
760      9,    23,    11,    12,    13,    14,    15,    16,    17,    18,
761     19,    19,    21,     5,     6,     7,     8,     9,    19,    11,
762     12,    13,    14,    15,    16,    17,    18,    19,    40,    21,
763      5,     6,    19,    40,    45,    39,    11,    12,    13,    14,
764     15,    16,    17,    18,     5,     6,    21,    19,    19,    23,
765     11,    12,    13,    14,    15,    16,    17,    18,     5,     6,
766     21,    41,    40,    23,    11,    12,    13,    14,    15,    16,
767     17,    18,    20,    40,    21,    40,    40,    19,    37,    19,
768     23,    39,    19,    40,    39,    39,    19,    40,    23,    19,
769     40,    40,    37,     0,    23,     0,    42,     9,    42,    30,
770     41,   131,   130,   127,   100,   105,    19,   244,   184,   235
771 };
772 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
773 #line 3 "/usr/lib/bison.simple"
774 /* This file comes from bison-1.28.  */
775
776 /* Skeleton output parser for bison,
777    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
778
779    This program is free software; you can redistribute it and/or modify
780    it under the terms of the GNU General Public License as published by
781    the Free Software Foundation; either version 2, or (at your option)
782    any later version.
783
784    This program is distributed in the hope that it will be useful,
785    but WITHOUT ANY WARRANTY; without even the implied warranty of
786    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
787    GNU General Public License for more details.
788
789    You should have received a copy of the GNU General Public License
790    along with this program; if not, write to the Free Software
791    Foundation, Inc., 59 Temple Place - Suite 330,
792    Boston, MA 02111-1307, USA.  */
793
794 /* As a special exception, when this file is copied by Bison into a
795    Bison output file, you may use that output file without restriction.
796    This special exception was added by the Free Software Foundation
797    in version 1.24 of Bison.  */
798
799 /* This is the parser code that is written into each bison parser
800   when the %semantic_parser declaration is not specified in the grammar.
801   It was written by Richard Stallman by simplifying the hairy parser
802   used when %semantic_parser is specified.  */
803
804 #ifndef YYSTACK_USE_ALLOCA
805 #ifdef alloca
806 #define YYSTACK_USE_ALLOCA
807 #else /* alloca not defined */
808 #ifdef __GNUC__
809 #define YYSTACK_USE_ALLOCA
810 #define alloca __builtin_alloca
811 #else /* not GNU C.  */
812 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
813 #define YYSTACK_USE_ALLOCA
814 #include <alloca.h>
815 #else /* not sparc */
816 /* We think this test detects Watcom and Microsoft C.  */
817 /* This used to test MSDOS, but that is a bad idea
818    since that symbol is in the user namespace.  */
819 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
820 #if 0 /* No need for malloc.h, which pollutes the namespace;
821          instead, just don't use alloca.  */
822 #include <malloc.h>
823 #endif
824 #else /* not MSDOS, or __TURBOC__ */
825 #if defined(_AIX)
826 /* I don't know what this was needed for, but it pollutes the namespace.
827    So I turned it off.   rms, 2 May 1997.  */
828 /* #include <malloc.h>  */
829  #pragma alloca
830 #define YYSTACK_USE_ALLOCA
831 #else /* not MSDOS, or __TURBOC__, or _AIX */
832 #if 0
833 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
834                  and on HPUX 10.  Eventually we can turn this on.  */
835 #define YYSTACK_USE_ALLOCA
836 #define alloca __builtin_alloca
837 #endif /* __hpux */
838 #endif
839 #endif /* not _AIX */
840 #endif /* not MSDOS, or __TURBOC__ */
841 #endif /* not sparc */
842 #endif /* not GNU C */
843 #endif /* alloca not defined */
844 #endif /* YYSTACK_USE_ALLOCA not defined */
845
846 #ifdef YYSTACK_USE_ALLOCA
847 #define YYSTACK_ALLOC alloca
848 #else
849 #define YYSTACK_ALLOC malloc
850 #endif
851
852 /* Note: there must be only one dollar sign in this file.
853    It is replaced by the list of actions, each action
854    as one case of the switch.  */
855
856 #define yyerrok         (yyerrstatus = 0)
857 #define yyclearin       (yychar = YYEMPTY)
858 #define YYEMPTY         -2
859 #define YYEOF           0
860 #define YYACCEPT        goto yyacceptlab
861 #define YYABORT         goto yyabortlab
862 #define YYERROR         goto yyerrlab1
863 /* Like YYERROR except do call yyerror.
864    This remains here temporarily to ease the
865    transition to the new meaning of YYERROR, for GCC.
866    Once GCC version 2 has supplanted version 1, this can go.  */
867 #define YYFAIL          goto yyerrlab
868 #define YYRECOVERING()  (!!yyerrstatus)
869 #define YYBACKUP(token, value) \
870 do                                                              \
871   if (yychar == YYEMPTY && yylen == 1)                          \
872     { yychar = (token), yylval = (value);                       \
873       yychar1 = YYTRANSLATE (yychar);                           \
874       YYPOPSTACK;                                               \
875       goto yybackup;                                            \
876     }                                                           \
877   else                                                          \
878     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
879 while (0)
880
881 #define YYTERROR        1
882 #define YYERRCODE       256
883
884 #ifndef YYPURE
885 #define YYLEX           yylex()
886 #endif
887
888 #ifdef YYPURE
889 #ifdef YYLSP_NEEDED
890 #ifdef YYLEX_PARAM
891 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
892 #else
893 #define YYLEX           yylex(&yylval, &yylloc)
894 #endif
895 #else /* not YYLSP_NEEDED */
896 #ifdef YYLEX_PARAM
897 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
898 #else
899 #define YYLEX           yylex(&yylval)
900 #endif
901 #endif /* not YYLSP_NEEDED */
902 #endif
903
904 /* If nonreentrant, generate the variables here */
905
906 #ifndef YYPURE
907
908 int     yychar;                 /*  the lookahead symbol                */
909 YYSTYPE yylval;                 /*  the semantic value of the           */
910                                 /*  lookahead symbol                    */
911
912 #ifdef YYLSP_NEEDED
913 YYLTYPE yylloc;                 /*  location data for the lookahead     */
914                                 /*  symbol                              */
915 #endif
916
917 int yynerrs;                    /*  number of parse errors so far       */
918 #endif  /* not YYPURE */
919
920 #if YYDEBUG != 0
921 int yydebug;                    /*  nonzero means print parse trace     */
922 /* Since this is uninitialized, it does not stop multiple parsers
923    from coexisting.  */
924 #endif
925
926 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
927
928 #ifndef YYINITDEPTH
929 #define YYINITDEPTH 200
930 #endif
931
932 /*  YYMAXDEPTH is the maximum size the stacks can grow to
933     (effective only if the built-in stack extension method is used).  */
934
935 #if YYMAXDEPTH == 0
936 #undef YYMAXDEPTH
937 #endif
938
939 #ifndef YYMAXDEPTH
940 #define YYMAXDEPTH 10000
941 #endif
942 \f
943 /* Define __yy_memcpy.  Note that the size argument
944    should be passed with type unsigned int, because that is what the non-GCC
945    definitions require.  With GCC, __builtin_memcpy takes an arg
946    of type size_t, but it can handle unsigned int.  */
947
948 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
949 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
950 #else                           /* not GNU C or C++ */
951 #ifndef __cplusplus
952
953 /* This is the most reliable way to avoid incompatibilities
954    in available built-in functions on various systems.  */
955 static void
956 __yy_memcpy (to, from, count)
957      char *to;
958      char *from;
959      unsigned int count;
960 {
961   register char *f = from;
962   register char *t = to;
963   register int i = count;
964
965   while (i-- > 0)
966     *t++ = *f++;
967 }
968
969 #else /* __cplusplus */
970
971 /* This is the most reliable way to avoid incompatibilities
972    in available built-in functions on various systems.  */
973 static void
974 __yy_memcpy (char *to, char *from, unsigned int count)
975 {
976   register char *t = to;
977   register char *f = from;
978   register int i = count;
979
980   while (i-- > 0)
981     *t++ = *f++;
982 }
983
984 #endif
985 #endif
986 \f
987 #line 217 "/usr/lib/bison.simple"
988
989 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
990    into yyparse.  The argument should have type void *.
991    It should actually point to an object.
992    Grammar actions can access the variable by casting it
993    to the proper pointer type.  */
994
995 #ifdef YYPARSE_PARAM
996 #ifdef __cplusplus
997 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
998 #define YYPARSE_PARAM_DECL
999 #else /* not __cplusplus */
1000 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1001 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1002 #endif /* not __cplusplus */
1003 #else /* not YYPARSE_PARAM */
1004 #define YYPARSE_PARAM_ARG
1005 #define YYPARSE_PARAM_DECL
1006 #endif /* not YYPARSE_PARAM */
1007
1008 /* Prevent warning if -Wstrict-prototypes.  */
1009 #ifdef __GNUC__
1010 #ifdef YYPARSE_PARAM
1011 int yyparse (void *);
1012 #else
1013 int yyparse (void);
1014 #endif
1015 #endif
1016
1017 int
1018 yyparse(YYPARSE_PARAM_ARG)
1019      YYPARSE_PARAM_DECL
1020 {
1021   register int yystate;
1022   register int yyn;
1023   register short *yyssp;
1024   register YYSTYPE *yyvsp;
1025   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
1026   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
1027
1028   short yyssa[YYINITDEPTH];     /*  the state stack                     */
1029   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
1030
1031   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
1032   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
1033
1034 #ifdef YYLSP_NEEDED
1035   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
1036   YYLTYPE *yyls = yylsa;
1037   YYLTYPE *yylsp;
1038
1039 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
1040 #else
1041 #define YYPOPSTACK   (yyvsp--, yyssp--)
1042 #endif
1043
1044   int yystacksize = YYINITDEPTH;
1045   int yyfree_stacks = 0;
1046
1047 #ifdef YYPURE
1048   int yychar;
1049   YYSTYPE yylval;
1050   int yynerrs;
1051 #ifdef YYLSP_NEEDED
1052   YYLTYPE yylloc;
1053 #endif
1054 #endif
1055
1056   YYSTYPE yyval;                /*  the variable used to return         */
1057                                 /*  semantic values from the action     */
1058                                 /*  routines                            */
1059
1060   int yylen;
1061
1062 #if YYDEBUG != 0
1063   if (yydebug)
1064     fprintf(stderr, "Starting parse\n");
1065 #endif
1066
1067   yystate = 0;
1068   yyerrstatus = 0;
1069   yynerrs = 0;
1070   yychar = YYEMPTY;             /* Cause a token to be read.  */
1071
1072   /* Initialize stack pointers.
1073      Waste one element of value and location stack
1074      so that they stay on the same level as the state stack.
1075      The wasted elements are never initialized.  */
1076
1077   yyssp = yyss - 1;
1078   yyvsp = yyvs;
1079 #ifdef YYLSP_NEEDED
1080   yylsp = yyls;
1081 #endif
1082
1083 /* Push a new state, which is found in  yystate  .  */
1084 /* In all cases, when you get here, the value and location stacks
1085    have just been pushed. so pushing a state here evens the stacks.  */
1086 yynewstate:
1087
1088   *++yyssp = yystate;
1089
1090   if (yyssp >= yyss + yystacksize - 1)
1091     {
1092       /* Give user a chance to reallocate the stack */
1093       /* Use copies of these so that the &'s don't force the real ones into memory. */
1094       YYSTYPE *yyvs1 = yyvs;
1095       short *yyss1 = yyss;
1096 #ifdef YYLSP_NEEDED
1097       YYLTYPE *yyls1 = yyls;
1098 #endif
1099
1100       /* Get the current used size of the three stacks, in elements.  */
1101       int size = yyssp - yyss + 1;
1102
1103 #ifdef yyoverflow
1104       /* Each stack pointer address is followed by the size of
1105          the data in use in that stack, in bytes.  */
1106 #ifdef YYLSP_NEEDED
1107       /* This used to be a conditional around just the two extra args,
1108          but that might be undefined if yyoverflow is a macro.  */
1109       yyoverflow("parser stack overflow",
1110                  &yyss1, size * sizeof (*yyssp),
1111                  &yyvs1, size * sizeof (*yyvsp),
1112                  &yyls1, size * sizeof (*yylsp),
1113                  &yystacksize);
1114 #else
1115       yyoverflow("parser stack overflow",
1116                  &yyss1, size * sizeof (*yyssp),
1117                  &yyvs1, size * sizeof (*yyvsp),
1118                  &yystacksize);
1119 #endif
1120
1121       yyss = yyss1; yyvs = yyvs1;
1122 #ifdef YYLSP_NEEDED
1123       yyls = yyls1;
1124 #endif
1125 #else /* no yyoverflow */
1126       /* Extend the stack our own way.  */
1127       if (yystacksize >= YYMAXDEPTH)
1128         {
1129           yyerror("parser stack overflow");
1130           if (yyfree_stacks)
1131             {
1132               free (yyss);
1133               free (yyvs);
1134 #ifdef YYLSP_NEEDED
1135               free (yyls);
1136 #endif
1137             }
1138           return 2;
1139         }
1140       yystacksize *= 2;
1141       if (yystacksize > YYMAXDEPTH)
1142         yystacksize = YYMAXDEPTH;
1143 #ifndef YYSTACK_USE_ALLOCA
1144       yyfree_stacks = 1;
1145 #endif
1146       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1147       __yy_memcpy ((char *)yyss, (char *)yyss1,
1148                    size * (unsigned int) sizeof (*yyssp));
1149       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1150       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1151                    size * (unsigned int) sizeof (*yyvsp));
1152 #ifdef YYLSP_NEEDED
1153       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1154       __yy_memcpy ((char *)yyls, (char *)yyls1,
1155                    size * (unsigned int) sizeof (*yylsp));
1156 #endif
1157 #endif /* no yyoverflow */
1158
1159       yyssp = yyss + size - 1;
1160       yyvsp = yyvs + size - 1;
1161 #ifdef YYLSP_NEEDED
1162       yylsp = yyls + size - 1;
1163 #endif
1164
1165 #if YYDEBUG != 0
1166       if (yydebug)
1167         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1168 #endif
1169
1170       if (yyssp >= yyss + yystacksize - 1)
1171         YYABORT;
1172     }
1173
1174 #if YYDEBUG != 0
1175   if (yydebug)
1176     fprintf(stderr, "Entering state %d\n", yystate);
1177 #endif
1178
1179   goto yybackup;
1180  yybackup:
1181
1182 /* Do appropriate processing given the current state.  */
1183 /* Read a lookahead token if we need one and don't already have one.  */
1184 /* yyresume: */
1185
1186   /* First try to decide what to do without reference to lookahead token.  */
1187
1188   yyn = yypact[yystate];
1189   if (yyn == YYFLAG)
1190     goto yydefault;
1191
1192   /* Not known => get a lookahead token if don't already have one.  */
1193
1194   /* yychar is either YYEMPTY or YYEOF
1195      or a valid token in external form.  */
1196
1197   if (yychar == YYEMPTY)
1198     {
1199 #if YYDEBUG != 0
1200       if (yydebug)
1201         fprintf(stderr, "Reading a token: ");
1202 #endif
1203       yychar = YYLEX;
1204     }
1205
1206   /* Convert token to internal form (in yychar1) for indexing tables with */
1207
1208   if (yychar <= 0)              /* This means end of input. */
1209     {
1210       yychar1 = 0;
1211       yychar = YYEOF;           /* Don't call YYLEX any more */
1212
1213 #if YYDEBUG != 0
1214       if (yydebug)
1215         fprintf(stderr, "Now at end of input.\n");
1216 #endif
1217     }
1218   else
1219     {
1220       yychar1 = YYTRANSLATE(yychar);
1221
1222 #if YYDEBUG != 0
1223       if (yydebug)
1224         {
1225           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1226           /* Give the individual parser a way to print the precise meaning
1227              of a token, for further debugging info.  */
1228 #ifdef YYPRINT
1229           YYPRINT (stderr, yychar, yylval);
1230 #endif
1231           fprintf (stderr, ")\n");
1232         }
1233 #endif
1234     }
1235
1236   yyn += yychar1;
1237   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1238     goto yydefault;
1239
1240   yyn = yytable[yyn];
1241
1242   /* yyn is what to do for this token type in this state.
1243      Negative => reduce, -yyn is rule number.
1244      Positive => shift, yyn is new state.
1245        New state is final state => don't bother to shift,
1246        just return success.
1247      0, or most negative number => error.  */
1248
1249   if (yyn < 0)
1250     {
1251       if (yyn == YYFLAG)
1252         goto yyerrlab;
1253       yyn = -yyn;
1254       goto yyreduce;
1255     }
1256   else if (yyn == 0)
1257     goto yyerrlab;
1258
1259   if (yyn == YYFINAL)
1260     YYACCEPT;
1261
1262   /* Shift the lookahead token.  */
1263
1264 #if YYDEBUG != 0
1265   if (yydebug)
1266     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1267 #endif
1268
1269   /* Discard the token being shifted unless it is eof.  */
1270   if (yychar != YYEOF)
1271     yychar = YYEMPTY;
1272
1273   *++yyvsp = yylval;
1274 #ifdef YYLSP_NEEDED
1275   *++yylsp = yylloc;
1276 #endif
1277
1278   /* count tokens shifted since error; after three, turn off error status.  */
1279   if (yyerrstatus) yyerrstatus--;
1280
1281   yystate = yyn;
1282   goto yynewstate;
1283
1284 /* Do the default action for the current state.  */
1285 yydefault:
1286
1287   yyn = yydefact[yystate];
1288   if (yyn == 0)
1289     goto yyerrlab;
1290
1291 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
1292 yyreduce:
1293   yylen = yyr2[yyn];
1294   if (yylen > 0)
1295     yyval = yyvsp[1-yylen]; /* implement default value of the action */
1296
1297 #if YYDEBUG != 0
1298   if (yydebug)
1299     {
1300       int i;
1301
1302       fprintf (stderr, "Reducing via rule %d (line %d), ",
1303                yyn, yyrline[yyn]);
1304
1305       /* Print the symbols being reduced, and their result.  */
1306       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1307         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1308       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1309     }
1310 #endif
1311
1312
1313   switch (yyn) {
1314
1315 case 1:
1316 #line 397 "parse.y"
1317 { ; ;
1318     break;}
1319 case 2:
1320 #line 398 "parse.y"
1321 { ; ;
1322     break;}
1323 case 3:
1324 #line 399 "parse.y"
1325 { ; ;
1326     break;}
1327 case 4:
1328 #line 400 "parse.y"
1329 { ; ;
1330     break;}
1331 case 5:
1332 #line 403 "parse.y"
1333 {
1334                         Node *node = new_ccode(C_CCODE,(yyvsp[0].cbuf)->str,
1335                                                ccode_line);
1336                         nodes = g_list_append(nodes,node);
1337                         g_string_free(yyvsp[0].cbuf,FALSE);
1338                                         ;
1339     break;}
1340 case 6:
1341 #line 409 "parse.y"
1342 {
1343                         Node *node = new_ccode(H_CCODE,(yyvsp[0].cbuf)->str,
1344                                                ccode_line);
1345                         nodes = g_list_append(nodes,node);
1346                         g_string_free(yyvsp[0].cbuf,FALSE);
1347                                         ;
1348     break;}
1349 case 7:
1350 #line 415 "parse.y"
1351 {
1352                         Node *node = new_ccode(HT_CCODE,(yyvsp[0].cbuf)->str,
1353                                                ccode_line);
1354                         nodes = g_list_append(nodes,node);
1355                         g_string_free(yyvsp[0].cbuf,FALSE);
1356                                         ;
1357     break;}
1358 case 8:
1359 #line 421 "parse.y"
1360 {
1361                         Node *node = new_ccode(PH_CCODE,(yyvsp[0].cbuf)->str,
1362                                                ccode_line);
1363                         nodes = g_list_append(nodes,node);
1364                         g_string_free(yyvsp[0].cbuf,FALSE);
1365                                         ;
1366     break;}
1367 case 9:
1368 #line 427 "parse.y"
1369 {
1370                         Node *node = new_ccode(A_CCODE,(yyvsp[0].cbuf)->str,
1371                                                ccode_line);
1372                         nodes = g_list_append(nodes,node);
1373                         g_string_free(yyvsp[0].cbuf,FALSE);
1374                                         ;
1375     break;}
1376 case 10:
1377 #line 433 "parse.y"
1378 {
1379                         Node *node = new_ccode(AT_CCODE,(yyvsp[0].cbuf)->str,
1380                                                ccode_line);
1381                         nodes = g_list_append(nodes,node);
1382                         g_string_free(yyvsp[0].cbuf,FALSE);
1383                                         ;
1384     break;}
1385 case 11:
1386 #line 441 "parse.y"
1387 { ; ;
1388     break;}
1389 case 12:
1390 #line 442 "parse.y"
1391 { ; ;
1392     break;}
1393 case 13:
1394 #line 445 "parse.y"
1395 {
1396                         ((Class *)class)->nodes = class_nodes;
1397                         class_nodes = NULL;
1398                         nodes = g_list_append(nodes,class);
1399                                                 ;
1400     break;}
1401 case 14:
1402 #line 450 "parse.y"
1403 {
1404                         ((Class *)class)->nodes = NULL;
1405                         class_nodes = NULL;
1406                         nodes = g_list_append(nodes,class);
1407                                                 ;
1408     break;}
1409 case 15:
1410 #line 457 "parse.y"
1411 {
1412                         class = new_class (yyvsp[-3].id, yyvsp[-1].id,
1413                                            bonobo_x_class, chunk_size, NULL);
1414                                                 ;
1415     break;}
1416 case 17:
1417 #line 464 "parse.y"
1418 {
1419                         if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1420                                 g_free (chunk_size);
1421                                 chunk_size = g_strdup(yyvsp[-2].id);
1422                         } else if(strcmp(yyvsp[-3].id,"BonoboX") == 0) {
1423                                 g_free (bonobo_x_class);
1424                                 bonobo_x_class = g_strdup(yyvsp[-2].id);
1425                         } else {
1426                                 yyerror(_("parse error"));
1427                                 YYERROR;
1428                         }
1429                 ;
1430     break;}
1431 case 18:
1432 #line 476 "parse.y"
1433 {
1434                         if(strcmp(yyvsp[-3].id,"chunks") == 0) {
1435                                 g_free (chunk_size);
1436                                 if(atoi(yyvsp[-2].id) != 0)
1437                                         chunk_size = g_strdup(yyvsp[-2].id);
1438                                 else
1439                                         chunk_size = NULL;
1440                         } else {
1441                                 yyerror(_("parse error"));
1442                                 YYERROR;
1443                         }
1444                 ;
1445     break;}
1446 case 19:
1447 #line 490 "parse.y"
1448 { ; ;
1449     break;}
1450 case 20:
1451 #line 491 "parse.y"
1452 { ; ;
1453     break;}
1454 case 21:
1455 #line 494 "parse.y"
1456 { ; ;
1457     break;}
1458 case 22:
1459 #line 495 "parse.y"
1460 {
1461                         if (strcmp (yyvsp[-1].id, "BonoboX") != 0) {
1462                                 g_free(yyvsp[-1].id);
1463                                 yyerror(_("parse error"));
1464                                 YYERROR;
1465                         }
1466                         last_added_method->bonobo_x_func = TRUE;
1467                                                 ;
1468     break;}
1469 case 23:
1470 #line 503 "parse.y"
1471 { ; ;
1472     break;}
1473 case 24:
1474 #line 504 "parse.y"
1475 { ; ;
1476     break;}
1477 case 25:
1478 #line 505 "parse.y"
1479 { ; ;
1480     break;}
1481 case 26:
1482 #line 508 "parse.y"
1483 { the_scope = PUBLIC_SCOPE; ;
1484     break;}
1485 case 27:
1486 #line 509 "parse.y"
1487 { the_scope = PRIVATE_SCOPE; ;
1488     break;}
1489 case 28:
1490 #line 510 "parse.y"
1491 { the_scope = PROTECTED_SCOPE; ;
1492     break;}
1493 case 29:
1494 #line 511 "parse.y"
1495 { the_scope = CLASS_SCOPE; ;
1496     break;}
1497 case 30:
1498 #line 514 "parse.y"
1499 {
1500                         if(strcmp(yyvsp[-1].id, "destroywith")==0) {
1501                                 g_free(yyvsp[-1].id);
1502                                 destructor = yyvsp[0].id;
1503                                 destructor_line = line_no;
1504                                 destructor_simple = TRUE;
1505                         } else {
1506                                 g_free(yyvsp[-1].id);
1507                                 g_free(yyvsp[0].id);
1508                                 yyerror(_("parse error"));
1509                                 YYERROR;
1510                         }
1511                                 ;
1512     break;}
1513 case 31:
1514 #line 527 "parse.y"
1515 {
1516                         if(strcmp(yyvsp[-2].id, "destroy")==0) {
1517                                 g_free(yyvsp[-2].id);
1518                                 destructor = (yyvsp[0].cbuf)->str;
1519                                 g_string_free(yyvsp[0].cbuf, FALSE);
1520                                 destructor_line = ccode_line;
1521                                 destructor_simple = FALSE;
1522                         } else {
1523                                 g_free(yyvsp[-2].id);
1524                                 g_string_free(yyvsp[0].cbuf, TRUE);
1525                                 yyerror(_("parse error"));
1526                                 YYERROR;
1527                         }
1528                                         ;
1529     break;}
1530 case 32:
1531 #line 543 "parse.y"
1532 {
1533                         initializer = yyvsp[0].id;
1534                         initializer_line = ccode_line;
1535                                 ;
1536     break;}
1537 case 33:
1538 #line 547 "parse.y"
1539 {
1540                         initializer = (yyvsp[0].cbuf)->str;
1541                         initializer_line = ccode_line;
1542                         g_string_free(yyvsp[0].cbuf, FALSE);
1543                                 ;
1544     break;}
1545 case 34:
1546 #line 555 "parse.y"
1547 { ; ;
1548     break;}
1549 case 35:
1550 #line 556 "parse.y"
1551 { ; ;
1552     break;}
1553 case 36:
1554 #line 557 "parse.y"
1555 { destructor = NULL; ;
1556     break;}
1557 case 37:
1558 #line 558 "parse.y"
1559 { initializer = NULL; ;
1560     break;}
1561 case 38:
1562 #line 559 "parse.y"
1563 {
1564                         destructor = NULL;
1565                         initializer = NULL;
1566                                         ;
1567     break;}
1568 case 39:
1569 #line 565 "parse.y"
1570 {
1571                         push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
1572                                                 ;
1573     break;}
1574 case 40:
1575 #line 568 "parse.y"
1576 {
1577                         push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
1578                                                 ;
1579     break;}
1580 case 41:
1581 #line 573 "parse.y"
1582 {
1583                         if(strcmp(yyvsp[-6].id,"get")==0 &&
1584                            strcmp(yyvsp[-3].id,"set")==0) {
1585                                 Node *node;
1586                                 Type *type = pop_type();
1587                                 g_free (yyvsp[-6].id); 
1588                                 g_free (yyvsp[-3].id);
1589                                 node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id,
1590                                                      (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1591                                                      (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1592                                                      yyvsp[-11].line);
1593
1594                                 class_nodes = g_list_append(class_nodes,node);
1595
1596                                 if (yyvsp[-7].id) {
1597                                         export_accessors (yyvsp[-8].id, 
1598                                                           (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1599                                                           (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1600                                                           type,
1601                                                           yyvsp[-9].id,
1602                                                           yyvsp[-11].line);
1603                                         g_free (yyvsp[-7].id);
1604                                 } 
1605
1606                                 g_string_free (yyvsp[-4].cbuf, FALSE);
1607                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1608
1609                         } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1610                                 strcmp(yyvsp[-3].id,"get")==0) {
1611                                 Node *node;
1612                                 Type *type = pop_type();
1613                                 g_free (yyvsp[-6].id); 
1614                                 g_free (yyvsp[-3].id);
1615                                 node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id,
1616                                                      (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1617                                                      (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1618                                                      yyvsp[-11].line);
1619
1620                                 if (yyvsp[-7].id) {
1621                                         export_accessors (yyvsp[-8].id, 
1622                                                           (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1623                                                           (yyvsp[-4].cbuf)->str, yyvsp[-5].line,
1624                                                           type,
1625                                                           yyvsp[-9].id,
1626                                                           yyvsp[-11].line);
1627                                         g_free (yyvsp[-7].id);
1628                                 } 
1629
1630                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1631                                 g_string_free (yyvsp[-4].cbuf, FALSE);
1632                                 class_nodes = g_list_append(class_nodes,node);
1633                         } else {
1634                                 g_free (yyvsp[-9].id); 
1635                                 g_free (yyvsp[-8].id);
1636                                 g_free (yyvsp[-6].id); 
1637                                 g_free (yyvsp[-3].id);
1638                                 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
1639                                 g_list_free (yyvsp[-10].list);
1640                                 g_string_free (yyvsp[-1].cbuf, TRUE);
1641                                 g_string_free (yyvsp[-4].cbuf, TRUE);
1642                                 yyerror (_("parse error"));
1643                                 YYERROR;
1644                         }
1645                                                 ;
1646     break;}
1647 case 42:
1648 #line 637 "parse.y"
1649 {
1650                         if(strcmp(yyvsp[-3].id, "get") == 0) {
1651                                 Node *node;
1652                                 Type *type = pop_type();
1653                                 g_free (yyvsp[-3].id);
1654                                 node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id,
1655                                                      (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1656                                                      NULL, 0, 
1657                                                      yyvsp[-8].line);
1658                                 if (yyvsp[-4].id) {
1659                                         export_accessors (yyvsp[-5].id, 
1660                                                           (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1661                                                           NULL, 0,
1662                                                           type,
1663                                                           yyvsp[-6].id,
1664                                                           yyvsp[-8].line);
1665                                         g_free (yyvsp[-4].id);
1666                                 } 
1667
1668                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1669                                 class_nodes = g_list_append(class_nodes, node);
1670                         } else if(strcmp(yyvsp[-3].id, "set") == 0) {
1671                                 Node *node;
1672                                 Type *type = pop_type();
1673                                 g_free (yyvsp[-3].id);
1674                                 node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id,
1675                                                      NULL, 0, 
1676                                                      (yyvsp[-1].cbuf)->str, yyvsp[-2].line, 
1677                                                      yyvsp[-8].line);
1678                                 if (yyvsp[-4].id) {
1679                                         export_accessors (yyvsp[-5].id, 
1680                                                           NULL, 0,
1681                                                           (yyvsp[-1].cbuf)->str, yyvsp[-2].line,
1682                                                           type,
1683                                                           yyvsp[-6].id,
1684                                                           yyvsp[-8].line);
1685                                         g_free (yyvsp[-4].id);
1686                                 } 
1687
1688                                 g_string_free (yyvsp[-1].cbuf, FALSE);
1689                                 class_nodes = g_list_append (class_nodes, node);
1690                         } else {
1691                                 g_free (yyvsp[-3].id); 
1692                                 g_free (yyvsp[-6].id);
1693                                 g_free (yyvsp[-5].id);
1694                                 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
1695                                 g_list_free (yyvsp[-7].list);
1696                                 g_string_free (yyvsp[-1].cbuf, TRUE);
1697                                 yyerror(_("parse error"));
1698                                 YYERROR;
1699                         }
1700                                                 ;
1701     break;}
1702 case 43:
1703 #line 689 "parse.y"
1704 {
1705                         Node *node;
1706                         char *get, *set = NULL;
1707                         Variable *var;
1708                         Type *type;
1709                         char *root;
1710                         
1711                         if(strcmp(yyvsp[0].id, "link")!=0 &&
1712                            strcmp(yyvsp[0].id, "stringlink")!=0 && 
1713                            strcmp(yyvsp[0].id, "objectlink")!=0) {
1714                                 g_free(yyvsp[0].id); 
1715                                 g_free(yyvsp[-3].id);
1716                                 g_free(yyvsp[-2].id);
1717                                 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
1718                                 g_list_free(yyvsp[-4].list);
1719                                 yyerror(_("parse error"));
1720                                 YYERROR;
1721                         }
1722
1723                         type = pop_type();
1724
1725                         var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
1726                         if(var->scope == PRIVATE_SCOPE)
1727                                 root = "self->_priv";
1728                         else if(var->scope == CLASS_SCOPE) {
1729                                 root = "SELF_GET_CLASS(self)";
1730                                 if(no_self_alias)
1731                                         error_print(GOB_ERROR, yyvsp[-5].line,
1732                                                     _("Self aliases needed when autolinking to a classwide member"));
1733                         } else
1734                                 root = "self";
1735
1736                         if(strcmp(yyvsp[0].id, "link")==0) {
1737                                 set = g_strdup_printf("%s->%s = ARG;",
1738                                                       root, yyvsp[-2].id);
1739                         } else if(strcmp (yyvsp[0].id, "stringlink")==0) {
1740                                 set = g_strdup_printf("g_free(%s->%s); "
1741                                                       "%s->%s = g_strdup(ARG);",
1742                                                       root, yyvsp[-2].id,
1743                                                       root, yyvsp[-2].id);
1744                         } else if(strcmp (yyvsp[0].id, "objectlink")==0) {
1745                                 set = g_strdup_printf(
1746                                   "if (ARG != NULL) "
1747                                    "gtk_object_ref (GTK_OBJECT (ARG)); "
1748                                   "if (%s->%s != NULL) "
1749                                    "gtk_object_unref (GTK_OBJECT (%s->%s)); "
1750                                   "%s->%s = ARG;",
1751                                   root, yyvsp[-2].id,
1752                                   root, yyvsp[-2].id,
1753                                   root, yyvsp[-2].id);
1754                         } else {
1755                                 g_assert_not_reached();
1756                         }
1757
1758                         if (strcmp (yyvsp[0].id, "stringlink")==0) {
1759                                 get = g_strdup_printf("ARG = g_strdup(%s->%s);", root, yyvsp[-2].id);
1760                         } else {
1761                                 /* For everything else, get is just straight assignment */
1762                                 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
1763                         }
1764
1765                         g_free (yyvsp[0].id);
1766
1767
1768                         if(!type)
1769                                 type = copy_type(var->vtype);
1770
1771                         node = new_argument (yyvsp[-3].id, type, yyvsp[-4].list,
1772                                              yyvsp[-2].id, 
1773                                              get, yyvsp[-5].line,
1774                                              set, yyvsp[-5].line, 
1775                                              yyvsp[-5].line);
1776                         if (yyvsp[-1].id) {
1777                                 export_accessors (yyvsp[-2].id, 
1778                                                   get, yyvsp[-5].line,
1779                                                   set, yyvsp[-5].line,
1780                                                   type,
1781                                                   yyvsp[-3].id,
1782                                                   yyvsp[-5].line);
1783                                 g_free (yyvsp[-1].id);
1784                         } 
1785
1786                         class_nodes = g_list_append(class_nodes,node);
1787                                                 ;
1788     break;}
1789 case 44:
1790 #line 775 "parse.y"
1791 {
1792                                                   if (strcmp (yyvsp[-1].id, "export")!=0) {
1793                                                           g_free (yyvsp[-1].id); 
1794                                                           yyerror (_("parse error"));
1795                                                           YYERROR;
1796                                                   }
1797                                                   yyval.id = yyvsp[-1].id;
1798                                                 ;
1799     break;}
1800 case 45:
1801 #line 783 "parse.y"
1802 { yyval.id = NULL; ;
1803     break;}
1804 case 46:
1805 #line 785 "parse.y"
1806 {
1807                         if(strcmp(yyvsp[-2].id,"type")!=0) {
1808                                 g_free(yyvsp[-4].id);
1809                                 g_free(yyvsp[-2].id);
1810                                 yyerror(_("parse error"));
1811                                 YYERROR;
1812                         }
1813                         yyval.id = yyvsp[-4].id;
1814                                                 ;
1815     break;}
1816 case 47:
1817 #line 794 "parse.y"
1818 {
1819                         yyval.id = yyvsp[0].id;
1820                         typestack = g_list_prepend(typestack,NULL);
1821                                                 ;
1822     break;}
1823 case 48:
1824 #line 800 "parse.y"
1825 { yyval.list = yyvsp[-1].list; ;
1826     break;}
1827 case 49:
1828 #line 801 "parse.y"
1829 { yyval.list = NULL; ;
1830     break;}
1831 case 50:
1832 #line 804 "parse.y"
1833 {
1834                         yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1835                                                 ;
1836     break;}
1837 case 51:
1838 #line 807 "parse.y"
1839 {
1840                         yyval.list = g_list_append(NULL,yyvsp[0].id);
1841                                                 ;
1842     break;}
1843 case 52:
1844 #line 813 "parse.y"
1845 {
1846                         Node *node = new_type(yyvsp[-1].id, yyvsp[0].id, NULL);
1847                         typestack = g_list_prepend(typestack,node);
1848                                                         ;
1849     break;}
1850 case 53:
1851 #line 817 "parse.y"
1852 {
1853                         Node *node = new_type(yyvsp[0].id, NULL, NULL);
1854                         typestack = g_list_prepend(typestack,node);
1855                                                         ;
1856     break;}
1857 case 54:
1858 #line 824 "parse.y"
1859 {
1860                         yyval.id = yyvsp[0].id;
1861                                                         ;
1862     break;}
1863 case 55:
1864 #line 827 "parse.y"
1865 {
1866                         yyval.id = yyvsp[0].id;
1867                                                         ;
1868     break;}
1869 case 56:
1870 #line 830 "parse.y"
1871 {
1872                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
1873                         g_free(yyvsp[0].id);
1874                                                         ;
1875     break;}
1876 case 57:
1877 #line 834 "parse.y"
1878 {
1879                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1880                         g_free(yyvsp[-1].id);
1881                                                         ;
1882     break;}
1883 case 58:
1884 #line 838 "parse.y"
1885 {
1886                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1887                         g_free(yyvsp[0].id);
1888                                                         ;
1889     break;}
1890 case 59:
1891 #line 842 "parse.y"
1892 {
1893                         yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
1894                                              yyvsp[0].id, NULL);
1895                         g_free(yyvsp[0].id);
1896                                                         ;
1897     break;}
1898 case 60:
1899 #line 847 "parse.y"
1900 {
1901                         yyval.id = g_strconcat(yyvsp[-2].id, " ",
1902                                              yyvsp[-1].id, " const", NULL);
1903                         g_free(yyvsp[-1].id);
1904                                                         ;
1905     break;}
1906 case 61:
1907 #line 855 "parse.y"
1908 {
1909                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1910                         g_free(yyvsp[0].id);
1911                                                         ;
1912     break;}
1913 case 62:
1914 #line 859 "parse.y"
1915 {
1916                         yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
1917                         g_free(yyvsp[-1].id);
1918                         g_free(yyvsp[0].id);
1919                                                         ;
1920     break;}
1921 case 63:
1922 #line 864 "parse.y"
1923 {
1924                         yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
1925                         g_free(yyvsp[0].id);
1926                                                         ;
1927     break;}
1928 case 64:
1929 #line 868 "parse.y"
1930 {
1931                         yyval.id = yyvsp[0].id;
1932                                                         ;
1933     break;}
1934 case 65:
1935 #line 871 "parse.y"
1936 {
1937                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1938                         g_free(yyvsp[-1].id);
1939                                                         ;
1940     break;}
1941 case 66:
1942 #line 875 "parse.y"
1943 {
1944                         yyval.id = g_strdup(yyvsp[0].id);
1945                                                         ;
1946     break;}
1947 case 67:
1948 #line 878 "parse.y"
1949 {
1950                         yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
1951                                                         ;
1952     break;}
1953 case 68:
1954 #line 883 "parse.y"
1955 { yyval.id = "void"; ;
1956     break;}
1957 case 69:
1958 #line 884 "parse.y"
1959 { yyval.id = "char"; ;
1960     break;}
1961 case 70:
1962 #line 885 "parse.y"
1963 { yyval.id = "short"; ;
1964     break;}
1965 case 71:
1966 #line 886 "parse.y"
1967 { yyval.id = "int"; ;
1968     break;}
1969 case 72:
1970 #line 887 "parse.y"
1971 { yyval.id = "long"; ;
1972     break;}
1973 case 73:
1974 #line 888 "parse.y"
1975 { yyval.id = "float"; ;
1976     break;}
1977 case 74:
1978 #line 889 "parse.y"
1979 { yyval.id = "double"; ;
1980     break;}
1981 case 75:
1982 #line 890 "parse.y"
1983 { yyval.id = "signed"; ;
1984     break;}
1985 case 76:
1986 #line 891 "parse.y"
1987 { yyval.id = "unsigned"; ;
1988     break;}
1989 case 77:
1990 #line 894 "parse.y"
1991 { yyval.id = "struct"; ;
1992     break;}
1993 case 78:
1994 #line 895 "parse.y"
1995 { yyval.id = "union"; ;
1996     break;}
1997 case 79:
1998 #line 896 "parse.y"
1999 { yyval.id = "enum"; ;
2000     break;}
2001 case 80:
2002 #line 899 "parse.y"
2003 { yyval.id = g_strdup("*"); ;
2004     break;}
2005 case 81:
2006 #line 900 "parse.y"
2007 { yyval.id = g_strdup("* const"); ;
2008     break;}
2009 case 82:
2010 #line 901 "parse.y"
2011 {
2012                                 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
2013                                 g_free(yyvsp[0].id);
2014                                         ;
2015     break;}
2016 case 83:
2017 #line 905 "parse.y"
2018 {
2019                                 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
2020                                 g_free(yyvsp[0].id);
2021                                         ;
2022     break;}
2023 case 84:
2024 #line 912 "parse.y"
2025 {
2026                         if(strcmp(yyvsp[-1].id, "first")==0)
2027                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
2028                         else if(strcmp(yyvsp[-1].id, "last")==0)
2029                                 yyval.sigtype = SIGNAL_LAST_METHOD;
2030                         else {
2031                                 yyerror(_("signal must be 'first' or 'last'"));
2032                                 g_free(yyvsp[-1].id);
2033                                 YYERROR;
2034                         }
2035                         g_free(yyvsp[-1].id);
2036                                         ;
2037     break;}
2038 case 85:
2039 #line 924 "parse.y"
2040 {
2041                         yyval.sigtype = SIGNAL_LAST_METHOD;
2042                                         ;
2043     break;}
2044 case 86:
2045 #line 930 "parse.y"
2046 {
2047                         if(strcmp(yyvsp[-1].id,"first")==0)
2048                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
2049                         else if(strcmp(yyvsp[-1].id,"last")==0)
2050                                 yyval.sigtype = SIGNAL_LAST_METHOD;
2051                         else {
2052                                 yyerror(_("signal must be 'first' or 'last'"));
2053                                 g_free(yyvsp[-1].id);
2054                                 YYERROR;
2055                         }
2056                         g_free(yyvsp[-1].id);
2057                                         ;
2058     break;}
2059 case 87:
2060 #line 942 "parse.y"
2061 {
2062                         if(strcmp(yyvsp[-2].id,"first")==0)
2063                                 yyval.sigtype = SIGNAL_FIRST_METHOD;
2064                         else if(strcmp(yyvsp[-2].id,"last")==0)
2065                                 yyval.sigtype = SIGNAL_LAST_METHOD;
2066                         else {
2067                                 yyerror(_("signal must be 'first' or 'last'"));
2068                                 g_free(yyvsp[-2].id);
2069                                 YYERROR;
2070                         }
2071                         g_free(yyvsp[-2].id);
2072                                         ;
2073     break;}
2074 case 88:
2075 #line 954 "parse.y"
2076 {
2077                         yyval.sigtype = SIGNAL_LAST_METHOD;
2078                                         ;
2079     break;}
2080 case 89:
2081 #line 957 "parse.y"
2082 {
2083                         /* the_scope was default thus public */
2084                         the_scope = PUBLIC_SCOPE;
2085                                         ;
2086     break;}
2087 case 90:
2088 #line 963 "parse.y"
2089 {
2090                         gtktypes = g_list_prepend(gtktypes, yyvsp[-3].id);
2091                                                 ;
2092     break;}
2093 case 91:
2094 #line 968 "parse.y"
2095 {
2096                         gtktypes = g_list_append(gtktypes, yyvsp[0].id);
2097                                                 ;
2098     break;}
2099 case 92:
2100 #line 971 "parse.y"
2101
2102                         gtktypes = g_list_append(gtktypes, yyvsp[0].id);
2103                                                 ;
2104     break;}
2105 case 93:
2106 #line 976 "parse.y"
2107 { yyval.cbuf = yyvsp[0].cbuf; ;
2108     break;}
2109 case 94:
2110 #line 977 "parse.y"
2111 { yyval.cbuf = NULL; ;
2112     break;}
2113 case 95:
2114 #line 981 "parse.y"
2115 {
2116                         if(!has_self) {
2117                                 yyerror(_("signal without 'self' as "
2118                                           "first parameter"));
2119                                 free_all_global_state();
2120                                 YYERROR;
2121                         }
2122                         if(the_scope == CLASS_SCOPE) {
2123                                 yyerror(_("a method cannot be of class scope"));
2124                                 free_all_global_state();
2125                                 YYERROR;
2126                         }
2127                         push_function(the_scope, yyvsp[-7].sigtype,NULL,
2128                                       yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
2129                                       ccode_line, vararg, yyvsp[-8].list);
2130                                                                         ;
2131     break;}
2132 case 96:
2133 #line 997 "parse.y"
2134 {
2135                         if(!has_self) {
2136                                 yyerror(_("signal without 'self' as "
2137                                           "first parameter"));
2138                                 free_all_global_state();
2139                                 YYERROR;
2140                         }
2141                         if(the_scope == CLASS_SCOPE) {
2142                                 yyerror(_("a method cannot be of class scope"));
2143                                 free_all_global_state();
2144                                 YYERROR;
2145                         }
2146                         push_function(the_scope, yyvsp[-7].sigtype, NULL,
2147                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
2148                                       ccode_line, vararg, yyvsp[-8].list);
2149                                                                         ;
2150     break;}
2151 case 97:
2152 #line 1013 "parse.y"
2153 {
2154                         if(!has_self) {
2155                                 yyerror(_("virtual method without 'self' as "
2156                                           "first parameter"));
2157                                 free_all_global_state();
2158                                 YYERROR;
2159                         }
2160                         if(the_scope == CLASS_SCOPE) {
2161                                 yyerror(_("a method cannot be of class scope"));
2162                                 free_all_global_state();
2163                                 YYERROR;
2164                         }
2165                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2166                                       yyvsp[0].cbuf, yyvsp[-8].line,
2167                                       ccode_line, vararg, NULL);
2168                                                                         ;
2169     break;}
2170 case 98:
2171 #line 1029 "parse.y"
2172 {
2173                         if(!has_self) {
2174                                 yyerror(_("virtual method without 'self' as "
2175                                           "first parameter"));
2176                                 free_all_global_state();
2177                                 YYERROR;
2178                         }
2179                         if(the_scope == CLASS_SCOPE) {
2180                                 yyerror(_("a method cannot be of class scope"));
2181                                 free_all_global_state();
2182                                 YYERROR;
2183                         }
2184                         push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
2185                                       yyvsp[0].cbuf, yyvsp[-7].line,
2186                                       ccode_line, vararg, NULL);
2187                                                                         ;
2188     break;}
2189 case 99:
2190 #line 1045 "parse.y"
2191 {
2192                         if(!has_self) {
2193                                 yyerror(_("virtual method without 'self' as "
2194                                           "first parameter"));
2195                                 free_all_global_state();
2196                                 YYERROR;
2197                         }
2198                         push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
2199                                       yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
2200                                       ccode_line, vararg, NULL);
2201                                                                         ;
2202     break;}
2203 case 100:
2204 #line 1056 "parse.y"
2205 {
2206                         push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
2207                                       yyvsp[-5].id, yyvsp[0].cbuf,
2208                                       yyvsp[-10].line, ccode_line,
2209                                       vararg, NULL);
2210                                                                         ;
2211     break;}
2212 case 101:
2213 #line 1062 "parse.y"
2214 {
2215                         if(the_scope == CLASS_SCOPE) {
2216                                 yyerror(_("a method cannot be of class scope"));
2217                                 free_all_global_state();
2218                                 YYERROR;
2219                         }
2220                         push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
2221                                       yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
2222                                       vararg, NULL);
2223                                                                 ;
2224     break;}
2225 case 102:
2226 #line 1072 "parse.y"
2227 {
2228                         if(strcmp(yyvsp[-4].id, "init")==0) {
2229                                 push_init_arg(yyvsp[-2].id,FALSE);
2230                                 push_function(NO_SCOPE, INIT_METHOD, NULL,
2231                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2232                                               ccode_line, FALSE, NULL);
2233                         } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
2234                                 push_init_arg(yyvsp[-2].id,TRUE);
2235                                 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
2236                                               yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
2237                                               ccode_line, FALSE, NULL);
2238                         } else {
2239                                 g_free(yyvsp[-4].id);
2240                                 g_free(yyvsp[-2].id);
2241                                 g_string_free(yyvsp[0].cbuf,TRUE);
2242                                 yyerror(_("parse error "
2243                                           "(untyped blocks must be init or "
2244                                           "class_init)"));
2245                                 YYERROR;
2246                         }
2247                                                 ;
2248     break;}
2249 case 103:
2250 #line 1095 "parse.y"
2251 {
2252                         g_free(onerror); onerror = NULL;
2253                         g_free(defreturn); defreturn = NULL;
2254                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2255                                 g_free(yyvsp[-1].id);
2256                                 g_free(yyvsp[0].id);
2257                                 yyerror(_("parse error"));
2258                                 YYERROR;
2259                         }
2260                         g_free(yyvsp[-1].id);
2261                                         ;
2262     break;}
2263 case 104:
2264 #line 1106 "parse.y"
2265 {
2266                         g_free(onerror); onerror = NULL;
2267                         g_free(defreturn); defreturn = NULL;
2268                         if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
2269                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2270                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2271                                 yyerror(_("parse error"));
2272                                 YYERROR;
2273                         }
2274                         if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
2275                                 onerror = defreturn = NULL;
2276                                 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
2277                                 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
2278                                 yyerror(_("parse error"));
2279                                 YYERROR;
2280                         }
2281                         g_free(yyvsp[-3].id);
2282                         g_free(yyvsp[-1].id);
2283                                                 ;
2284     break;}
2285 case 105:
2286 #line 1125 "parse.y"
2287 {
2288                         g_free(onerror); onerror = NULL;
2289                         g_free(defreturn); defreturn = NULL;
2290                                         ;
2291     break;}
2292 case 106:
2293 #line 1131 "parse.y"
2294 { yyval.id = yyvsp[0].id; ;
2295     break;}
2296 case 107:
2297 #line 1132 "parse.y"
2298 {
2299                         yyval.id = (yyvsp[1].cbuf)->str;
2300                         g_string_free(yyvsp[1].cbuf, FALSE);
2301                                         ;
2302     break;}
2303 case 108:
2304 #line 1138 "parse.y"
2305 { vararg = FALSE; has_self = FALSE; ;
2306     break;}
2307 case 109:
2308 #line 1139 "parse.y"
2309 {
2310                         vararg = FALSE;
2311                         has_self = TRUE;
2312                         if(strcmp(yyvsp[0].id,"self")==0)
2313                                 push_self(yyvsp[0].id, FALSE);
2314                         else {
2315                                 g_free(yyvsp[0].id);
2316                                 yyerror(_("parse error"));
2317                                 YYERROR;
2318                         }
2319                                         ;
2320     break;}
2321 case 110:
2322 #line 1150 "parse.y"
2323 {
2324                         vararg = FALSE;
2325                         has_self = TRUE;
2326                         if(strcmp(yyvsp[-1].id,"self")==0)
2327                                 push_self(yyvsp[-1].id, TRUE);
2328                         else {
2329                                 g_free(yyvsp[-1].id);
2330                                 yyerror(_("parse error"));
2331                                 YYERROR;
2332                         }
2333                                         ;
2334     break;}
2335 case 111:
2336 #line 1161 "parse.y"
2337 {
2338                         vararg = FALSE;
2339                         has_self = TRUE;
2340                         if(strcmp(yyvsp[0].id,"self")==0)
2341                                 push_self(yyvsp[0].id, TRUE);
2342                         else {
2343                                 g_free(yyvsp[0].id);
2344                                 yyerror(_("parse error"));
2345                                 YYERROR;
2346                         }
2347                                         ;
2348     break;}
2349 case 112:
2350 #line 1172 "parse.y"
2351 {
2352                         has_self = TRUE;
2353                         if(strcmp(yyvsp[-2].id,"self")==0)
2354                                 push_self(yyvsp[-2].id, FALSE);
2355                         else {
2356                                 g_free(yyvsp[-2].id);
2357                                 yyerror(_("parse error"));
2358                                 YYERROR;
2359                         }
2360                                         ;
2361     break;}
2362 case 113:
2363 #line 1182 "parse.y"
2364 {
2365                         has_self = TRUE;
2366                         if(strcmp(yyvsp[-3].id,"self")==0)
2367                                 push_self(yyvsp[-3].id, TRUE);
2368                         else {
2369                                 g_free(yyvsp[-3].id);
2370                                 yyerror(_("parse error"));
2371                                 YYERROR;
2372                         }
2373                                         ;
2374     break;}
2375 case 114:
2376 #line 1192 "parse.y"
2377 {
2378                         has_self = TRUE;
2379                         if(strcmp(yyvsp[-2].id,"self")==0)
2380                                 push_self(yyvsp[-2].id, TRUE);
2381                         else {
2382                                 g_free(yyvsp[-2].id);
2383                                 yyerror(_("parse error"));
2384                                 YYERROR;
2385                         }
2386                                         ;
2387     break;}
2388 case 115:
2389 #line 1202 "parse.y"
2390 { has_self = FALSE; ;
2391     break;}
2392 case 116:
2393 #line 1205 "parse.y"
2394 { vararg = TRUE; ;
2395     break;}
2396 case 117:
2397 #line 1206 "parse.y"
2398 { vararg = FALSE; ;
2399     break;}
2400 case 118:
2401 #line 1209 "parse.y"
2402 { ; ;
2403     break;}
2404 case 119:
2405 #line 1210 "parse.y"
2406 { ; ;
2407     break;}
2408 case 120:
2409 #line 1213 "parse.y"
2410 {
2411                         push_funcarg(yyvsp[0].id,NULL);
2412                                                                 ;
2413     break;}
2414 case 121:
2415 #line 1216 "parse.y"
2416 {
2417                         push_funcarg(yyvsp[-1].id,yyvsp[0].id);
2418                                                                 ;
2419     break;}
2420 case 122:
2421 #line 1219 "parse.y"
2422 {
2423                         if(strcmp(yyvsp[-2].id,"check")!=0) {
2424                                 yyerror(_("parse error"));
2425                                 YYERROR;
2426                         }
2427                         g_free(yyvsp[-2].id);
2428                         push_funcarg(yyvsp[-4].id,NULL);
2429                                                                 ;
2430     break;}
2431 case 123:
2432 #line 1227 "parse.y"
2433 {
2434                         if(strcmp(yyvsp[-2].id,"check")!=0) {
2435                                 yyerror(_("parse error"));
2436                                 YYERROR;
2437                         }
2438                         g_free(yyvsp[-2].id);
2439                         push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
2440                                                                 ;
2441     break;}
2442 case 124:
2443 #line 1237 "parse.y"
2444 { ; ;
2445     break;}
2446 case 125:
2447 #line 1238 "parse.y"
2448 { ; ;
2449     break;}
2450 case 126:
2451 #line 1241 "parse.y"
2452 {
2453                         if(strcmp(yyvsp[0].id,"type")==0) {
2454                                 Node *node = new_check(TYPE_CHECK,NULL);
2455                                 checks = g_list_append(checks,node);
2456                         } else if(strcmp(yyvsp[0].id,"null")==0) {
2457                                 Node *node = new_check(NULL_CHECK,NULL);
2458                                 checks = g_list_append(checks,node);
2459                         } else {
2460                                 yyerror(_("parse error"));
2461                                 YYERROR;
2462                         }
2463                         g_free(yyvsp[0].id);
2464                                         ;
2465     break;}
2466 case 127:
2467 #line 1254 "parse.y"
2468 {
2469                         Node *node = new_check(GT_CHECK,yyvsp[0].id);
2470                         checks = g_list_append(checks,node);
2471                                         ;
2472     break;}
2473 case 128:
2474 #line 1258 "parse.y"
2475 {
2476                         Node *node = new_check(LT_CHECK,yyvsp[0].id);
2477                         checks = g_list_append(checks,node);
2478                                         ;
2479     break;}
2480 case 129:
2481 #line 1262 "parse.y"
2482 {
2483                         Node *node = new_check(GE_CHECK,yyvsp[0].id);
2484                         checks = g_list_append(checks,node);
2485                                         ;
2486     break;}
2487 case 130:
2488 #line 1266 "parse.y"
2489 {
2490                         Node *node = new_check(LE_CHECK,yyvsp[0].id);
2491                         checks = g_list_append(checks,node);
2492                                         ;
2493     break;}
2494 case 131:
2495 #line 1270 "parse.y"
2496 {
2497                         Node *node = new_check(EQ_CHECK,yyvsp[0].id);
2498                         checks = g_list_append(checks,node);
2499                                         ;
2500     break;}
2501 case 132:
2502 #line 1274 "parse.y"
2503 {
2504                         Node *node = new_check(NE_CHECK,yyvsp[0].id);
2505                         checks = g_list_append(checks,node);
2506                                         ;
2507     break;}
2508 case 133:
2509 #line 1280 "parse.y"
2510 { yyval.id = yyvsp[0].id; ;
2511     break;}
2512 case 134:
2513 #line 1281 "parse.y"
2514 {
2515                         yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
2516                         g_free(yyvsp[0].id);
2517                                         ;
2518     break;}
2519 case 135:
2520 #line 1285 "parse.y"
2521 { yyval.id = yyvsp[0].id; ;
2522     break;}
2523 }
2524    /* the action file gets copied in in place of this dollarsign */
2525 #line 543 "/usr/lib/bison.simple"
2526 \f
2527   yyvsp -= yylen;
2528   yyssp -= yylen;
2529 #ifdef YYLSP_NEEDED
2530   yylsp -= yylen;
2531 #endif
2532
2533 #if YYDEBUG != 0
2534   if (yydebug)
2535     {
2536       short *ssp1 = yyss - 1;
2537       fprintf (stderr, "state stack now");
2538       while (ssp1 != yyssp)
2539         fprintf (stderr, " %d", *++ssp1);
2540       fprintf (stderr, "\n");
2541     }
2542 #endif
2543
2544   *++yyvsp = yyval;
2545
2546 #ifdef YYLSP_NEEDED
2547   yylsp++;
2548   if (yylen == 0)
2549     {
2550       yylsp->first_line = yylloc.first_line;
2551       yylsp->first_column = yylloc.first_column;
2552       yylsp->last_line = (yylsp-1)->last_line;
2553       yylsp->last_column = (yylsp-1)->last_column;
2554       yylsp->text = 0;
2555     }
2556   else
2557     {
2558       yylsp->last_line = (yylsp+yylen-1)->last_line;
2559       yylsp->last_column = (yylsp+yylen-1)->last_column;
2560     }
2561 #endif
2562
2563   /* Now "shift" the result of the reduction.
2564      Determine what state that goes to,
2565      based on the state we popped back to
2566      and the rule number reduced by.  */
2567
2568   yyn = yyr1[yyn];
2569
2570   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2571   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2572     yystate = yytable[yystate];
2573   else
2574     yystate = yydefgoto[yyn - YYNTBASE];
2575
2576   goto yynewstate;
2577
2578 yyerrlab:   /* here on detecting error */
2579
2580   if (! yyerrstatus)
2581     /* If not already recovering from an error, report this error.  */
2582     {
2583       ++yynerrs;
2584
2585 #ifdef YYERROR_VERBOSE
2586       yyn = yypact[yystate];
2587
2588       if (yyn > YYFLAG && yyn < YYLAST)
2589         {
2590           int size = 0;
2591           char *msg;
2592           int x, count;
2593
2594           count = 0;
2595           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
2596           for (x = (yyn < 0 ? -yyn : 0);
2597                x < (sizeof(yytname) / sizeof(char *)); x++)
2598             if (yycheck[x + yyn] == x)
2599               size += strlen(yytname[x]) + 15, count++;
2600           msg = (char *) malloc(size + 15);
2601           if (msg != 0)
2602             {
2603               strcpy(msg, "parse error");
2604
2605               if (count < 5)
2606                 {
2607                   count = 0;
2608                   for (x = (yyn < 0 ? -yyn : 0);
2609                        x < (sizeof(yytname) / sizeof(char *)); x++)
2610                     if (yycheck[x + yyn] == x)
2611                       {
2612                         strcat(msg, count == 0 ? ", expecting `" : " or `");
2613                         strcat(msg, yytname[x]);
2614                         strcat(msg, "'");
2615                         count++;
2616                       }
2617                 }
2618               yyerror(msg);
2619               free(msg);
2620             }
2621           else
2622             yyerror ("parse error; also virtual memory exceeded");
2623         }
2624       else
2625 #endif /* YYERROR_VERBOSE */
2626         yyerror("parse error");
2627     }
2628
2629   goto yyerrlab1;
2630 yyerrlab1:   /* here on error raised explicitly by an action */
2631
2632   if (yyerrstatus == 3)
2633     {
2634       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
2635
2636       /* return failure if at end of input */
2637       if (yychar == YYEOF)
2638         YYABORT;
2639
2640 #if YYDEBUG != 0
2641       if (yydebug)
2642         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2643 #endif
2644
2645       yychar = YYEMPTY;
2646     }
2647
2648   /* Else will try to reuse lookahead token
2649      after shifting the error token.  */
2650
2651   yyerrstatus = 3;              /* Each real token shifted decrements this */
2652
2653   goto yyerrhandle;
2654
2655 yyerrdefault:  /* current state does not do anything special for the error token. */
2656
2657 #if 0
2658   /* This is wrong; only states that explicitly want error tokens
2659      should shift them.  */
2660   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
2661   if (yyn) goto yydefault;
2662 #endif
2663
2664 yyerrpop:   /* pop the current state because it cannot handle the error token */
2665
2666   if (yyssp == yyss) YYABORT;
2667   yyvsp--;
2668   yystate = *--yyssp;
2669 #ifdef YYLSP_NEEDED
2670   yylsp--;
2671 #endif
2672
2673 #if YYDEBUG != 0
2674   if (yydebug)
2675     {
2676       short *ssp1 = yyss - 1;
2677       fprintf (stderr, "Error: state stack now");
2678       while (ssp1 != yyssp)
2679         fprintf (stderr, " %d", *++ssp1);
2680       fprintf (stderr, "\n");
2681     }
2682 #endif
2683
2684 yyerrhandle:
2685
2686   yyn = yypact[yystate];
2687   if (yyn == YYFLAG)
2688     goto yyerrdefault;
2689
2690   yyn += YYTERROR;
2691   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2692     goto yyerrdefault;
2693
2694   yyn = yytable[yyn];
2695   if (yyn < 0)
2696     {
2697       if (yyn == YYFLAG)
2698         goto yyerrpop;
2699       yyn = -yyn;
2700       goto yyreduce;
2701     }
2702   else if (yyn == 0)
2703     goto yyerrpop;
2704
2705   if (yyn == YYFINAL)
2706     YYACCEPT;
2707
2708 #if YYDEBUG != 0
2709   if (yydebug)
2710     fprintf(stderr, "Shifting error token, ");
2711 #endif
2712
2713   *++yyvsp = yylval;
2714 #ifdef YYLSP_NEEDED
2715   *++yylsp = yylloc;
2716 #endif
2717
2718   yystate = yyn;
2719   goto yynewstate;
2720
2721  yyacceptlab:
2722   /* YYACCEPT comes here.  */
2723   if (yyfree_stacks)
2724     {
2725       free (yyss);
2726       free (yyvs);
2727 #ifdef YYLSP_NEEDED
2728       free (yyls);
2729 #endif
2730     }
2731   return 0;
2732
2733  yyabortlab:
2734   /* YYABORT comes here.  */
2735   if (yyfree_stacks)
2736     {
2737       free (yyss);
2738       free (yyvs);
2739 #ifdef YYLSP_NEEDED
2740       free (yyls);
2741 #endif
2742     }
2743   return 1;
2744 }
2745 #line 1288 "parse.y"
2746