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