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