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