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