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