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