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