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