2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
56 static GList *class_nodes = NULL;
59 static GList *typestack = NULL;
61 static GList *funcargs = NULL;
62 static GList *checks = NULL;
63 static int has_self = FALSE;
64 static int vararg = FALSE;
66 static GList *gtktypes = NULL;
68 /* this can be a global as we will only do one function at a time
70 static int the_scope = NO_SCOPE;
75 extern int ccode_line;
86 if(strcmp(yytext,"\n")==0) {
87 out=g_strconcat("Error: ",str," before newline",NULL);
88 } else if(yytext[0]=='\0') {
89 out=g_strconcat("Error: ",str," at end of input",NULL);
91 char *tmp = g_strdup(yytext);
92 while((p=strchr(tmp,'\n')))
95 out=g_strconcat("Error: ",str," before '",tmp,"'",NULL);
99 fprintf(stderr,"%s:%d: %s\n",filename,line_no,out);
108 Type *type = typestack->data;
109 typestack = g_list_remove(typestack,typestack->data);
114 push_variable(char *name, int scope, int line_no, char *postfix)
117 Type *type = pop_type();
119 type->postfix = postfix;
121 var = new_variable(scope,type,name,line_no);
122 class_nodes = g_list_append(class_nodes, var);
126 push_function(int scope, int method, char *oid, char *id, char *onerror,
127 GString *cbuf,int line_no, int ccode_line, int vararg)
133 if(method!=INIT_METHOD && method!=CLASS_INIT_METHOD) {
136 type = (Type *)new_type(0,g_strdup("void"),NULL);
139 /* a complicated and ugly test to figure out if we have
140 the wrong number of types for a signal */
141 if((method == SIGNAL_FIRST_METHOD ||
142 method == SIGNAL_LAST_METHOD) &&
143 g_list_length(gtktypes) != g_list_length(funcargs) &&
144 !(g_list_length(funcargs) == 1 &&
145 g_list_length(gtktypes) == 2 &&
146 strcmp(gtktypes->next->data,"NONE")==0)) {
147 print_error(TRUE, _("The number of GTK arguments and "
148 "function arguments for a signal "
149 "don't seem to match"),line_no);
153 c_cbuf = p = cbuf->str;
154 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
161 node = new_method(scope,method,type,oid,gtktypes,id,funcargs,
162 onerror,c_cbuf,line_no,ccode_line,vararg);
166 /*only free segment if we haven't passed it
172 class_nodes = g_list_append(class_nodes, node);
176 push_funcarg(char *name, char *postfix)
179 Type *type = pop_type();
181 type->postfix = postfix;
183 node = new_funcarg(type,name,checks);
186 funcargs = g_list_append(funcargs, node);
190 push_init_arg(char *name, int is_class)
197 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
199 tn = g_strdup(((Class *)class)->otype);
201 type = new_type(1,tn,NULL);
202 node = new_funcarg((Type *)type,name,NULL);
203 funcargs = g_list_prepend(funcargs, node);
212 type = new_type(1,g_strdup(((Class *)class)->otype),NULL);
213 ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
214 ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
215 node = new_funcarg((Type *)type,id,ch);
216 funcargs = g_list_prepend(funcargs, node);
243 #define YYFLAG -32768
246 #define YYTRANSLATE(x) ((unsigned)(x) <= 288 ? yytranslate[x] : 80)
248 static const char yytranslate[] = { 0,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
252 2, 2, 46, 2, 2, 2, 2, 2, 2, 38,
253 39, 41, 2, 42, 47, 2, 2, 2, 2, 2,
254 2, 2, 2, 2, 2, 2, 2, 2, 37, 44,
255 45, 43, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
260 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
261 2, 2, 35, 40, 36, 2, 2, 2, 2, 2,
262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
275 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
276 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
277 27, 28, 29, 30, 31, 32, 33, 34
281 static const short yyprhs[] = { 0,
282 0, 4, 7, 10, 12, 14, 16, 18, 20, 23,
283 25, 30, 34, 39, 42, 45, 48, 50, 52, 54,
284 56, 58, 60, 65, 71, 83, 92, 98, 100, 104,
285 105, 109, 111, 113, 116, 118, 121, 124, 127, 129,
286 132, 135, 137, 139, 141, 143, 146, 148, 150, 153,
287 155, 158, 160, 162, 164, 166, 168, 171, 173, 176,
288 178, 182, 186, 189, 191, 196, 200, 202, 205, 207,
289 217, 228, 238, 248, 257, 269, 278, 284, 287, 291,
290 292, 294, 296, 300, 302, 306, 308, 312, 314, 317,
291 321, 328, 336, 339, 341, 343, 346, 349, 353, 357,
295 static const short yyrhs[] = { 50,
296 51, 50, 0, 51, 50, 0, 50, 51, 0, 51,
297 0, 24, 0, 27, 0, 25, 0, 26, 0, 50,
298 49, 0, 49, 0, 52, 35, 53, 36, 0, 52,
299 35, 36, 0, 3, 22, 4, 22, 0, 53, 71,
300 0, 53, 55, 0, 53, 56, 0, 71, 0, 55,
301 0, 56, 0, 28, 0, 29, 0, 30, 0, 54,
302 60, 20, 37, 0, 54, 60, 20, 23, 37, 0,
303 31, 58, 57, 20, 20, 35, 24, 20, 35, 24,
304 37, 0, 31, 58, 57, 20, 20, 35, 24, 37,
305 0, 20, 38, 20, 60, 39, 0, 20, 0, 38,
306 59, 39, 0, 0, 20, 40, 59, 0, 20, 0,
307 61, 0, 5, 61, 0, 62, 0, 62, 65, 0,
308 12, 63, 0, 11, 63, 0, 63, 0, 12, 18,
309 0, 11, 18, 0, 18, 0, 17, 0, 16, 0,
310 20, 0, 64, 20, 0, 22, 0, 6, 0, 13,
311 15, 0, 13, 0, 14, 15, 0, 14, 0, 15,
312 0, 9, 0, 8, 0, 7, 0, 41, 65, 0,
313 41, 0, 20, 68, 0, 68, 0, 54, 20, 68,
314 0, 20, 54, 68, 0, 54, 68, 0, 66, 0,
315 20, 38, 69, 39, 0, 69, 42, 20, 0, 20,
316 0, 35, 24, 0, 37, 0, 33, 67, 60, 20,
317 38, 73, 39, 72, 70, 0, 54, 33, 66, 60,
318 20, 38, 73, 39, 72, 70, 0, 32, 54, 60,
319 20, 38, 73, 39, 72, 70, 0, 54, 32, 60,
320 20, 38, 73, 39, 72, 70, 0, 32, 60, 20,
321 38, 73, 39, 72, 70, 0, 34, 38, 22, 39,
322 60, 20, 38, 73, 39, 72, 70, 0, 54, 60,
323 20, 38, 73, 39, 72, 70, 0, 20, 38, 20,
324 39, 70, 0, 19, 79, 0, 19, 35, 24, 0,
325 0, 6, 0, 20, 0, 20, 42, 74, 0, 74,
326 0, 75, 42, 10, 0, 75, 0, 75, 42, 76,
327 0, 76, 0, 60, 20, 0, 60, 20, 23, 0,
328 60, 20, 38, 20, 77, 39, 0, 60, 20, 23,
329 38, 20, 77, 39, 0, 77, 78, 0, 78, 0,
330 20, 0, 43, 79, 0, 44, 79, 0, 43, 45,
331 79, 0, 44, 45, 79, 0, 45, 45, 79, 0,
332 46, 45, 79, 0, 21, 0, 47, 21, 0, 20,
339 static const short yyrline[] = { 0,
340 220, 221, 222, 223, 226, 232, 238, 244, 252, 253,
341 256, 261, 268, 273, 274, 275, 276, 277, 278, 281,
342 282, 283, 286, 289, 293, 328, 358, 367, 373, 374,
343 377, 380, 386, 387, 395, 399, 406, 409, 412, 415,
344 418, 421, 424, 427, 430, 433, 437, 440, 445, 448,
345 451, 454, 457, 462, 465, 468, 473, 474, 478, 490,
346 496, 508, 520, 523, 529, 534, 537, 542, 543, 547,
347 557, 567, 577, 587, 597, 603, 608, 629, 630, 634,
348 637, 638, 649, 659, 662, 663, 666, 667, 670, 673,
349 676, 684, 694, 695, 698, 711, 715, 719, 723, 727,
355 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
357 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
358 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
359 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN",
360 "ARRAY_DIM","CCODE","HTCODE","PHCODE","HCODE","PUBLIC","PRIVATE","PROTECTED",
361 "ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","';'","'('","')'","'|'",
362 "'*'","','","'>'","'<'","'='","'!'","'-'","prog","ccode","ccodes","class","classdec",
363 "classcode","scope","variable","argument","argtype","argflags","flaglist","type",
364 "type1","type2","integer","tspecifier","stars","simplesigtype","fullsigtype",
365 "sigtype","tokenlist","codenocode","method","onerror","funcargs","arglist","arglist1",
366 "arg","checklist","check","numtok", NULL
370 static const short yyr1[] = { 0,
371 48, 48, 48, 48, 49, 49, 49, 49, 50, 50,
372 51, 51, 52, 53, 53, 53, 53, 53, 53, 54,
373 54, 54, 55, 55, 56, 56, 57, 57, 58, 58,
374 59, 59, 60, 60, 61, 61, 62, 62, 62, 62,
375 62, 62, 62, 62, 62, 62, 62, 62, 63, 63,
376 63, 63, 63, 64, 64, 64, 65, 65, 66, 66,
377 67, 67, 67, 67, 68, 69, 69, 70, 70, 71,
378 71, 71, 71, 71, 71, 71, 71, 72, 72, 72,
379 73, 73, 73, 73, 74, 74, 75, 75, 76, 76,
380 76, 76, 77, 77, 78, 78, 78, 78, 78, 78,
384 static const short yyr2[] = { 0,
385 3, 2, 2, 1, 1, 1, 1, 1, 2, 1,
386 4, 3, 4, 2, 2, 2, 1, 1, 1, 1,
387 1, 1, 4, 5, 11, 8, 5, 1, 3, 0,
388 3, 1, 1, 2, 1, 2, 2, 2, 1, 2,
389 2, 1, 1, 1, 1, 2, 1, 1, 2, 1,
390 2, 1, 1, 1, 1, 1, 2, 1, 2, 1,
391 3, 3, 2, 1, 4, 3, 1, 2, 1, 9,
392 10, 9, 9, 8, 11, 8, 5, 2, 3, 0,
393 1, 1, 3, 1, 3, 1, 3, 1, 2, 3,
394 6, 7, 2, 1, 1, 2, 2, 3, 3, 3,
398 static const short yydefact[] = { 0,
399 0, 5, 7, 8, 6, 10, 0, 4, 0, 0,
400 9, 3, 2, 0, 0, 1, 0, 20, 21, 22,
401 30, 0, 0, 0, 12, 0, 0, 18, 19, 17,
402 13, 0, 0, 0, 0, 48, 56, 55, 54, 0,
403 0, 50, 52, 53, 44, 43, 42, 45, 47, 0,
404 0, 33, 35, 39, 0, 0, 0, 64, 0, 60,
405 0, 11, 15, 16, 14, 0, 0, 0, 0, 32,
406 0, 28, 0, 34, 41, 38, 40, 37, 49, 51,
407 0, 0, 58, 36, 46, 0, 0, 0, 59, 0,
408 63, 0, 0, 0, 0, 0, 0, 0, 0, 29,
409 0, 0, 0, 0, 57, 67, 0, 62, 61, 0,
410 0, 0, 0, 0, 23, 0, 0, 69, 77, 31,
411 0, 0, 0, 48, 45, 0, 0, 84, 86, 88,
412 65, 0, 0, 0, 0, 0, 24, 0, 68, 0,
413 0, 0, 0, 89, 80, 0, 66, 0, 0, 0,
414 0, 80, 27, 0, 80, 83, 90, 0, 0, 0,
415 85, 87, 80, 0, 80, 0, 0, 0, 26, 0,
416 0, 0, 104, 102, 0, 0, 78, 74, 0, 0,
417 0, 80, 76, 0, 72, 0, 95, 0, 0, 0,
418 0, 0, 94, 79, 103, 70, 80, 73, 0, 0,
419 0, 0, 96, 0, 97, 0, 0, 91, 93, 0,
420 71, 25, 92, 98, 99, 100, 101, 75, 0, 0,
424 static const short yydefgoto[] = { 219,
425 6, 7, 8, 9, 26, 27, 28, 29, 73, 34,
426 71, 126, 52, 53, 54, 55, 84, 58, 59, 60,
427 107, 119, 30, 160, 127, 128, 129, 130, 192, 193,
431 static const short yypact[] = { 21,
432 -12,-32768,-32768,-32768,-32768,-32768, 21, 238, 0, 39,
433 -32768, 238, 238, 202, 41, 238, 84,-32768,-32768,-32768,
434 100, 112, 117, 101,-32768, 217, 53,-32768,-32768,-32768,
435 -32768, 74, 81, 123, 203,-32768,-32768,-32768,-32768, 226,
436 241, 129, 133,-32768,-32768,-32768,-32768,-32768,-32768, 168,
437 130,-32768, 111,-32768, 149, 1, 151,-32768, 168,-32768,
438 156,-32768,-32768,-32768,-32768, 168, 167, 169, 157, 165,
439 174, 188, 187,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
440 208, 191, 111,-32768,-32768, 204, 223, 237,-32768, -6,
441 -32768, 240, 227, 247, -6, 168, 55, 96, 81,-32768,
442 248, 249, 232, 186,-32768,-32768, -30,-32768,-32768, 233,
443 168, 234, 253, 239,-32768, 186, 250,-32768,-32768,-32768,
444 168, 242, 186, 236, 185, 258, 243,-32768, 244,-32768,
445 -32768, 259, 186, 260, 186, 246,-32768, 251,-32768, 252,
446 257, 254, 168, 64, 264, 150,-32768, 255, 261, 256,
447 186, 264,-32768, -4, 264,-32768, 262, 265, 56, 96,
448 -32768,-32768, 264, 186, 264, 263, 96, 266,-32768, 96,
449 267, 52,-32768,-32768, 268, 275,-32768,-32768, 96, 269,
450 96, 264,-32768, 273,-32768, 52,-32768, 35, 63, 270,
451 271, 61,-32768,-32768,-32768,-32768, 264,-32768, 96, 272,
452 70, 6,-32768, 6,-32768, 6, 6,-32768,-32768, 96,
453 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 288, 289,
457 static const short yypgoto[] = {-32768,
458 245, 30, 291,-32768,-32768, -20, 277, 278,-32768,-32768,
459 206, -22, 276,-32768, 71,-32768, 224, 274,-32768, -38,
460 -32768, -159, 280, -148, -110, 170,-32768, 164, 126, -113,
468 static const short yytable[] = { 51,
469 178, 50, 57, 167, 68, 138, 170, 183, 131, 10,
470 185, 132, 142, 86, 179, 168, 181, 89, 91, 196,
471 86, 198, 148, 1, 150, 173, 174, 81, 18, 19,
472 20, 87, 169, 199, 14, 88, 92, 13, 87, 211,
473 166, 16, 15, 94, 2, 3, 4, 5, 210, 108,
474 218, 109, 176, 180, 173, 174, 89, 35, 36, 37,
475 38, 39, 31, 40, 41, 42, 43, 44, 45, 46,
476 47, 187, 48, 113, 49, 173, 174, 114, 209, 202,
477 187, 176, 173, 174, 66, 67, 157, 209, 134, 187,
478 175, 115, 116, 69, 188, 189, 190, 191, 140, 208,
479 70, 158, 176, 188, 189, 190, 191, 204, 213, 176,
480 76, 78, 188, 189, 190, 191, 35, 36, 37, 38,
481 39, 32, 40, 41, 42, 43, 44, 45, 46, 47,
482 117, 48, 118, 49, 203, 205, 56, 33, 61, 18,
483 19, 20, 72, 79, 18, 19, 20, 80, 214, 82,
484 215, 83, 216, 217, 35, 36, 37, 38, 39, 161,
485 40, 41, 42, 43, 44, 45, 46, 47, 85, 48,
486 90, 49, 35, 36, 37, 38, 39, 93, 40, 41,
487 42, 43, 44, 45, 46, 47, 95, 48, 97, 49,
488 35, 124, 37, 38, 39, 98, 40, 41, 42, 43,
489 44, 45, 46, 47, 99, 125, 102, 49, 36, 37,
490 38, 39, 100, 40, 41, 42, 43, 44, 45, 46,
491 47, 17, 48, -82, 49, 101, 143, 103, 104, 18,
492 19, 20, 21, 22, 23, 24, 17, 25, 42, 43,
493 44, 87, 106, 75, 18, 19, 20, 21, 22, 23,
494 24, 11, 62, 42, 43, 44, 86, 11, 77, 110,
495 11, 2, 3, 4, 5, 111, 112, 121, 122, 123,
496 133, 135, 136, 139, -81, 137, 141, 144, 147, 149,
497 154, 145, 159, 151, 172, 146, 186, 220, 221, 152,
498 153, 194, 155, 163, 165, 195, 200, 12, 164, 171,
499 184, 182, 63, 64, 120, 65, 105, 197, 212, 162,
500 74, 201, 156, 0, 206, 207, 0, 0, 0, 0,
501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
506 static const short yycheck[] = { 22,
507 160, 22, 23, 152, 27, 116, 155, 167, 39, 22,
508 170, 42, 123, 20, 163, 20, 165, 56, 57, 179,
509 20, 181, 133, 3, 135, 20, 21, 50, 28, 29,
510 30, 38, 37, 182, 35, 56, 59, 8, 38, 199,
511 151, 12, 4, 66, 24, 25, 26, 27, 197, 88,
512 210, 90, 47, 164, 20, 21, 95, 5, 6, 7,
513 8, 9, 22, 11, 12, 13, 14, 15, 16, 17,
514 18, 20, 20, 96, 22, 20, 21, 23, 192, 45,
515 20, 47, 20, 21, 32, 33, 23, 201, 111, 20,
516 35, 37, 38, 20, 43, 44, 45, 46, 121, 39,
517 20, 38, 47, 43, 44, 45, 46, 45, 39, 47,
518 40, 41, 43, 44, 45, 46, 5, 6, 7, 8,
519 9, 38, 11, 12, 13, 14, 15, 16, 17, 18,
520 35, 20, 37, 22, 188, 189, 20, 38, 38, 28,
521 29, 30, 20, 15, 28, 29, 30, 15, 202, 20,
522 204, 41, 206, 207, 5, 6, 7, 8, 9, 10,
523 11, 12, 13, 14, 15, 16, 17, 18, 20, 20,
524 20, 22, 5, 6, 7, 8, 9, 22, 11, 12,
525 13, 14, 15, 16, 17, 18, 20, 20, 20, 22,
526 5, 6, 7, 8, 9, 39, 11, 12, 13, 14,
527 15, 16, 17, 18, 40, 20, 20, 22, 6, 7,
528 8, 9, 39, 11, 12, 13, 14, 15, 16, 17,
529 18, 20, 20, 39, 22, 38, 42, 20, 38, 28,
530 29, 30, 31, 32, 33, 34, 20, 36, 13, 14,
531 15, 38, 20, 18, 28, 29, 30, 31, 32, 33,
532 34, 7, 36, 13, 14, 15, 20, 13, 18, 20,
533 16, 24, 25, 26, 27, 39, 20, 20, 20, 38,
534 38, 38, 20, 24, 39, 37, 35, 20, 20, 20,
535 24, 39, 19, 38, 20, 42, 20, 0, 0, 39,
536 39, 24, 39, 39, 39, 21, 24, 7, 38, 38,
537 35, 39, 26, 26, 99, 26, 83, 39, 37, 146,
538 35, 186, 143, -1, 45, 45, -1, -1, -1, -1,
539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
540 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
543 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
544 #line 3 "/usr/lib/bison.simple"
545 /* This file comes from bison-1.28. */
547 /* Skeleton output parser for bison,
548 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
550 This program is free software; you can redistribute it and/or modify
551 it under the terms of the GNU General Public License as published by
552 the Free Software Foundation; either version 2, or (at your option)
555 This program is distributed in the hope that it will be useful,
556 but WITHOUT ANY WARRANTY; without even the implied warranty of
557 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
558 GNU General Public License for more details.
560 You should have received a copy of the GNU General Public License
561 along with this program; if not, write to the Free Software
562 Foundation, Inc., 59 Temple Place - Suite 330,
563 Boston, MA 02111-1307, USA. */
565 /* As a special exception, when this file is copied by Bison into a
566 Bison output file, you may use that output file without restriction.
567 This special exception was added by the Free Software Foundation
568 in version 1.24 of Bison. */
570 /* This is the parser code that is written into each bison parser
571 when the %semantic_parser declaration is not specified in the grammar.
572 It was written by Richard Stallman by simplifying the hairy parser
573 used when %semantic_parser is specified. */
575 #ifndef YYSTACK_USE_ALLOCA
577 #define YYSTACK_USE_ALLOCA
578 #else /* alloca not defined */
580 #define YYSTACK_USE_ALLOCA
581 #define alloca __builtin_alloca
582 #else /* not GNU C. */
583 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
584 #define YYSTACK_USE_ALLOCA
586 #else /* not sparc */
587 /* We think this test detects Watcom and Microsoft C. */
588 /* This used to test MSDOS, but that is a bad idea
589 since that symbol is in the user namespace. */
590 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
591 #if 0 /* No need for malloc.h, which pollutes the namespace;
592 instead, just don't use alloca. */
595 #else /* not MSDOS, or __TURBOC__ */
597 /* I don't know what this was needed for, but it pollutes the namespace.
598 So I turned it off. rms, 2 May 1997. */
599 /* #include <malloc.h> */
601 #define YYSTACK_USE_ALLOCA
602 #else /* not MSDOS, or __TURBOC__, or _AIX */
604 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
605 and on HPUX 10. Eventually we can turn this on. */
606 #define YYSTACK_USE_ALLOCA
607 #define alloca __builtin_alloca
610 #endif /* not _AIX */
611 #endif /* not MSDOS, or __TURBOC__ */
612 #endif /* not sparc */
613 #endif /* not GNU C */
614 #endif /* alloca not defined */
615 #endif /* YYSTACK_USE_ALLOCA not defined */
617 #ifdef YYSTACK_USE_ALLOCA
618 #define YYSTACK_ALLOC alloca
620 #define YYSTACK_ALLOC malloc
623 /* Note: there must be only one dollar sign in this file.
624 It is replaced by the list of actions, each action
625 as one case of the switch. */
627 #define yyerrok (yyerrstatus = 0)
628 #define yyclearin (yychar = YYEMPTY)
631 #define YYACCEPT goto yyacceptlab
632 #define YYABORT goto yyabortlab
633 #define YYERROR goto yyerrlab1
634 /* Like YYERROR except do call yyerror.
635 This remains here temporarily to ease the
636 transition to the new meaning of YYERROR, for GCC.
637 Once GCC version 2 has supplanted version 1, this can go. */
638 #define YYFAIL goto yyerrlab
639 #define YYRECOVERING() (!!yyerrstatus)
640 #define YYBACKUP(token, value) \
642 if (yychar == YYEMPTY && yylen == 1) \
643 { yychar = (token), yylval = (value); \
644 yychar1 = YYTRANSLATE (yychar); \
649 { yyerror ("syntax error: cannot back up"); YYERROR; } \
653 #define YYERRCODE 256
656 #define YYLEX yylex()
662 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
664 #define YYLEX yylex(&yylval, &yylloc)
666 #else /* not YYLSP_NEEDED */
668 #define YYLEX yylex(&yylval, YYLEX_PARAM)
670 #define YYLEX yylex(&yylval)
672 #endif /* not YYLSP_NEEDED */
675 /* If nonreentrant, generate the variables here */
679 int yychar; /* the lookahead symbol */
680 YYSTYPE yylval; /* the semantic value of the */
681 /* lookahead symbol */
684 YYLTYPE yylloc; /* location data for the lookahead */
688 int yynerrs; /* number of parse errors so far */
689 #endif /* not YYPURE */
692 int yydebug; /* nonzero means print parse trace */
693 /* Since this is uninitialized, it does not stop multiple parsers
697 /* YYINITDEPTH indicates the initial size of the parser's stacks */
700 #define YYINITDEPTH 200
703 /* YYMAXDEPTH is the maximum size the stacks can grow to
704 (effective only if the built-in stack extension method is used). */
711 #define YYMAXDEPTH 10000
714 /* Define __yy_memcpy. Note that the size argument
715 should be passed with type unsigned int, because that is what the non-GCC
716 definitions require. With GCC, __builtin_memcpy takes an arg
717 of type size_t, but it can handle unsigned int. */
719 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
720 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
721 #else /* not GNU C or C++ */
724 /* This is the most reliable way to avoid incompatibilities
725 in available built-in functions on various systems. */
727 __yy_memcpy (to, from, count)
732 register char *f = from;
733 register char *t = to;
734 register int i = count;
740 #else /* __cplusplus */
742 /* This is the most reliable way to avoid incompatibilities
743 in available built-in functions on various systems. */
745 __yy_memcpy (char *to, char *from, unsigned int count)
747 register char *t = to;
748 register char *f = from;
749 register int i = count;
758 #line 217 "/usr/lib/bison.simple"
760 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
761 into yyparse. The argument should have type void *.
762 It should actually point to an object.
763 Grammar actions can access the variable by casting it
764 to the proper pointer type. */
768 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
769 #define YYPARSE_PARAM_DECL
770 #else /* not __cplusplus */
771 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
772 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
773 #endif /* not __cplusplus */
774 #else /* not YYPARSE_PARAM */
775 #define YYPARSE_PARAM_ARG
776 #define YYPARSE_PARAM_DECL
777 #endif /* not YYPARSE_PARAM */
779 /* Prevent warning if -Wstrict-prototypes. */
782 int yyparse (void *);
789 yyparse(YYPARSE_PARAM_ARG)
792 register int yystate;
794 register short *yyssp;
795 register YYSTYPE *yyvsp;
796 int yyerrstatus; /* number of tokens to shift before error messages enabled */
797 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
799 short yyssa[YYINITDEPTH]; /* the state stack */
800 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
802 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
803 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
806 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
807 YYLTYPE *yyls = yylsa;
810 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
812 #define YYPOPSTACK (yyvsp--, yyssp--)
815 int yystacksize = YYINITDEPTH;
816 int yyfree_stacks = 0;
827 YYSTYPE yyval; /* the variable used to return */
828 /* semantic values from the action */
835 fprintf(stderr, "Starting parse\n");
841 yychar = YYEMPTY; /* Cause a token to be read. */
843 /* Initialize stack pointers.
844 Waste one element of value and location stack
845 so that they stay on the same level as the state stack.
846 The wasted elements are never initialized. */
854 /* Push a new state, which is found in yystate . */
855 /* In all cases, when you get here, the value and location stacks
856 have just been pushed. so pushing a state here evens the stacks. */
861 if (yyssp >= yyss + yystacksize - 1)
863 /* Give user a chance to reallocate the stack */
864 /* Use copies of these so that the &'s don't force the real ones into memory. */
865 YYSTYPE *yyvs1 = yyvs;
868 YYLTYPE *yyls1 = yyls;
871 /* Get the current used size of the three stacks, in elements. */
872 int size = yyssp - yyss + 1;
875 /* Each stack pointer address is followed by the size of
876 the data in use in that stack, in bytes. */
878 /* This used to be a conditional around just the two extra args,
879 but that might be undefined if yyoverflow is a macro. */
880 yyoverflow("parser stack overflow",
881 &yyss1, size * sizeof (*yyssp),
882 &yyvs1, size * sizeof (*yyvsp),
883 &yyls1, size * sizeof (*yylsp),
886 yyoverflow("parser stack overflow",
887 &yyss1, size * sizeof (*yyssp),
888 &yyvs1, size * sizeof (*yyvsp),
892 yyss = yyss1; yyvs = yyvs1;
896 #else /* no yyoverflow */
897 /* Extend the stack our own way. */
898 if (yystacksize >= YYMAXDEPTH)
900 yyerror("parser stack overflow");
912 if (yystacksize > YYMAXDEPTH)
913 yystacksize = YYMAXDEPTH;
914 #ifndef YYSTACK_USE_ALLOCA
917 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
918 __yy_memcpy ((char *)yyss, (char *)yyss1,
919 size * (unsigned int) sizeof (*yyssp));
920 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
921 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
922 size * (unsigned int) sizeof (*yyvsp));
924 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
925 __yy_memcpy ((char *)yyls, (char *)yyls1,
926 size * (unsigned int) sizeof (*yylsp));
928 #endif /* no yyoverflow */
930 yyssp = yyss + size - 1;
931 yyvsp = yyvs + size - 1;
933 yylsp = yyls + size - 1;
938 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
941 if (yyssp >= yyss + yystacksize - 1)
947 fprintf(stderr, "Entering state %d\n", yystate);
953 /* Do appropriate processing given the current state. */
954 /* Read a lookahead token if we need one and don't already have one. */
957 /* First try to decide what to do without reference to lookahead token. */
959 yyn = yypact[yystate];
963 /* Not known => get a lookahead token if don't already have one. */
965 /* yychar is either YYEMPTY or YYEOF
966 or a valid token in external form. */
968 if (yychar == YYEMPTY)
972 fprintf(stderr, "Reading a token: ");
977 /* Convert token to internal form (in yychar1) for indexing tables with */
979 if (yychar <= 0) /* This means end of input. */
982 yychar = YYEOF; /* Don't call YYLEX any more */
986 fprintf(stderr, "Now at end of input.\n");
991 yychar1 = YYTRANSLATE(yychar);
996 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
997 /* Give the individual parser a way to print the precise meaning
998 of a token, for further debugging info. */
1000 YYPRINT (stderr, yychar, yylval);
1002 fprintf (stderr, ")\n");
1008 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1013 /* yyn is what to do for this token type in this state.
1014 Negative => reduce, -yyn is rule number.
1015 Positive => shift, yyn is new state.
1016 New state is final state => don't bother to shift,
1017 just return success.
1018 0, or most negative number => error. */
1033 /* Shift the lookahead token. */
1037 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1040 /* Discard the token being shifted unless it is eof. */
1041 if (yychar != YYEOF)
1049 /* count tokens shifted since error; after three, turn off error status. */
1050 if (yyerrstatus) yyerrstatus--;
1055 /* Do the default action for the current state. */
1058 yyn = yydefact[yystate];
1062 /* Do a reduction. yyn is the number of a rule to reduce with. */
1066 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1073 fprintf (stderr, "Reducing via rule %d (line %d), ",
1076 /* Print the symbols being reduced, and their result. */
1077 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1078 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1079 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1105 Node *node = new_ccode(C_CCODE,(yyvsp[0].cbuf)->str,
1107 nodes = g_list_append(nodes,node);
1108 g_string_free(yyvsp[0].cbuf,FALSE);
1114 Node *node = new_ccode(H_CCODE,(yyvsp[0].cbuf)->str,
1116 nodes = g_list_append(nodes,node);
1117 g_string_free(yyvsp[0].cbuf,FALSE);
1123 Node *node = new_ccode(HT_CCODE,(yyvsp[0].cbuf)->str,
1125 nodes = g_list_append(nodes,node);
1126 g_string_free(yyvsp[0].cbuf,FALSE);
1132 Node *node = new_ccode(PH_CCODE,(yyvsp[0].cbuf)->str,
1134 nodes = g_list_append(nodes,node);
1135 g_string_free(yyvsp[0].cbuf,FALSE);
1149 ((Class *)class)->nodes = class_nodes;
1151 nodes = g_list_append(nodes,class);
1157 ((Class *)class)->nodes = NULL;
1159 nodes = g_list_append(nodes,class);
1165 class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
1194 { the_scope = PUBLIC_SCOPE; ;
1198 { the_scope = PRIVATE_SCOPE; ;
1202 { the_scope = PROTECTED_SCOPE; ;
1207 push_variable(yyvsp[-1].id,the_scope,yyvsp[-3].line,NULL);
1213 push_variable(yyvsp[-2].id,the_scope,yyvsp[-4].line,yyvsp[-1].id);
1219 if(strcmp(yyvsp[-6].id,"get")==0 &&
1220 strcmp(yyvsp[-3].id,"set")==0) {
1222 Type *type = pop_type();
1223 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1224 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1225 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1226 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1228 g_string_free(yyvsp[-4].cbuf,FALSE);
1229 g_string_free(yyvsp[-1].cbuf,FALSE);
1230 class_nodes = g_list_append(class_nodes,node);
1231 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1232 strcmp(yyvsp[-3].id,"get")==0) {
1234 Type *type = pop_type();
1235 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1236 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1237 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1238 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1240 g_string_free(yyvsp[-1].cbuf,FALSE);
1241 g_string_free(yyvsp[-4].cbuf,FALSE);
1242 class_nodes = g_list_append(class_nodes,node);
1244 g_free(yyvsp[-8].id); g_free(yyvsp[-7].id);
1245 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1246 g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL);
1247 g_string_free(yyvsp[-1].cbuf,TRUE);
1248 g_string_free(yyvsp[-4].cbuf,TRUE);
1249 yyerror(_("parse error"));
1257 if(strcmp(yyvsp[-3].id,"get")==0) {
1259 Type *type = pop_type();
1260 g_free(yyvsp[-3].id);
1261 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1262 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1263 NULL,0, yyvsp[-7].line);
1264 g_string_free(yyvsp[-1].cbuf,FALSE);
1265 class_nodes = g_list_append(class_nodes,node);
1266 } else if(strcmp(yyvsp[-3].id,"set")==0) {
1268 Type *type = pop_type();
1269 g_free(yyvsp[-3].id);
1270 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1271 NULL,0,(yyvsp[-1].cbuf)->str,
1272 yyvsp[-2].line, yyvsp[-7].line);
1273 g_string_free(yyvsp[-1].cbuf,FALSE);
1274 class_nodes = g_list_append(class_nodes,node);
1276 g_free(yyvsp[-3].id); g_free(yyvsp[-5].id);
1277 g_free(yyvsp[-4].id);
1278 g_list_foreach(yyvsp[-6].list,(GFunc)g_free,NULL);
1279 g_string_free(yyvsp[-1].cbuf,TRUE);
1280 yyerror(_("parse error"));
1288 if(strcmp(yyvsp[-2].id,"type")!=0) {
1289 g_free(yyvsp[-4].id);
1290 g_free(yyvsp[-2].id);
1291 yyerror(_("parse error"));
1294 yyval.id = yyvsp[-4].id;
1300 yyval.id = yyvsp[0].id;
1301 typestack = g_list_prepend(typestack,NULL);
1306 { yyval.list = yyvsp[-1].list; ;
1310 { yyval.list = NULL; ;
1315 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1321 yyval.list = g_list_append(NULL,yyvsp[0].id);
1331 Type *type = typestack->data;
1332 char *oldname = type->name;
1333 type->name = g_strconcat("const ",oldname,NULL);
1340 Node *node = new_type(0,yyvsp[0].id,NULL);
1341 typestack = g_list_prepend(typestack,node);
1347 Node *node = new_type(stars,yyvsp[-1].id,NULL);
1349 typestack = g_list_prepend(typestack,node);
1355 yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
1361 yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
1367 yyval.id = g_strdup(yyvsp[0].id);
1373 yyval.id = g_strdup("unsigned char");
1379 yyval.id = g_strdup("signed char");
1385 yyval.id = g_strdup("char");
1391 yyval.id = g_strdup("double");
1397 yyval.id = g_strdup("float");
1403 yyval.id = yyvsp[0].id;
1409 yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
1410 g_free(yyvsp[0].id);
1416 yyval.id = yyvsp[0].id;
1422 yyval.id = g_strdup("void");
1428 yyval.id = "long int";
1440 yyval.id = "short int";
1464 yyval.id = "union ";
1470 yyval.id = "struct ";
1484 if(strcmp(yyvsp[-1].id,"first")==0)
1485 yyval.sigtype = SIGNAL_FIRST_METHOD;
1486 else if(strcmp(yyvsp[-1].id,"last")==0)
1487 yyval.sigtype = SIGNAL_LAST_METHOD;
1489 yyerror(_("signal must be 'first' or 'last'"));
1490 g_free(yyvsp[-1].id);
1493 g_free(yyvsp[-1].id);
1499 yyval.sigtype = SIGNAL_LAST_METHOD;
1505 if(strcmp(yyvsp[-1].id,"first")==0)
1506 yyval.sigtype = SIGNAL_FIRST_METHOD;
1507 else if(strcmp(yyvsp[-1].id,"last")==0)
1508 yyval.sigtype = SIGNAL_LAST_METHOD;
1510 yyerror(_("signal must be 'first' or 'last'"));
1511 g_free(yyvsp[-1].id);
1514 g_free(yyvsp[-1].id);
1520 if(strcmp(yyvsp[-2].id,"first")==0)
1521 yyval.sigtype = SIGNAL_FIRST_METHOD;
1522 else if(strcmp(yyvsp[-2].id,"last")==0)
1523 yyval.sigtype = SIGNAL_LAST_METHOD;
1525 yyerror(_("signal must be 'first' or 'last'"));
1526 g_free(yyvsp[-2].id);
1529 g_free(yyvsp[-2].id);
1535 yyval.sigtype = SIGNAL_LAST_METHOD;
1541 /* the_scope was default thus public */
1542 the_scope = PUBLIC_SCOPE;
1548 gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
1554 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1560 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1565 { yyval.cbuf = yyvsp[0].cbuf; ;
1569 { yyval.cbuf = NULL; ;
1575 yyerror(_("signal without 'self' as "
1576 "first parameter"));
1579 push_function(the_scope, yyvsp[-7].sigtype,NULL,
1580 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1588 yyerror(_("signal without 'self' as "
1589 "first parameter"));
1592 push_function(the_scope, yyvsp[-7].sigtype,NULL,
1593 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1601 yyerror(_("virtual method without 'self' as "
1602 "first parameter"));
1605 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1606 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line,
1614 yyerror(_("virtual method without 'self' as "
1615 "first parameter"));
1618 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1619 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,
1627 yyerror(_("virtual method without 'self' as "
1628 "first parameter"));
1631 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
1632 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,
1639 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
1640 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,
1641 yyvsp[-10].line,ccode_line,
1648 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
1649 yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,ccode_line,
1656 if(strcmp(yyvsp[-4].id,"init")==0) {
1657 push_init_arg(yyvsp[-2].id,FALSE);
1658 push_function(NO_SCOPE, INIT_METHOD, NULL,
1659 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1661 } else if(strcmp(yyvsp[-4].id,"class_init")==0) {
1662 push_init_arg(yyvsp[-2].id,TRUE);
1663 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
1664 yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line,
1667 g_free(yyvsp[-4].id);
1668 g_free(yyvsp[-2].id);
1669 g_string_free(yyvsp[-2].cbuf,TRUE);
1670 yyerror(_("parse error"));
1677 { yyval.id = yyvsp[0].id; ;
1682 yyval.id = (yyvsp[0].cbuf)->str;
1683 g_string_free(yyvsp[0].cbuf,FALSE);
1688 { yyval.id = NULL; ;
1692 { vararg = FALSE; has_self = FALSE; ;
1699 if(strcmp(yyvsp[0].id,"self")==0)
1700 push_self(yyvsp[0].id);
1702 g_free(yyvsp[0].id);
1703 yyerror(_("parse error"));
1712 if(strcmp(yyvsp[-2].id,"self")==0)
1713 push_self(yyvsp[-2].id);
1715 g_free(yyvsp[-2].id);
1716 yyerror(_("parse error"));
1723 { has_self = FALSE; ;
1744 push_funcarg(yyvsp[0].id,NULL);
1750 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
1756 if(strcmp(yyvsp[-2].id,"check")!=0) {
1757 yyerror(_("parse error"));
1760 g_free(yyvsp[-2].id);
1761 push_funcarg(yyvsp[-4].id,NULL);
1767 if(strcmp(yyvsp[-2].id,"check")!=0) {
1768 yyerror(_("parse error"));
1771 g_free(yyvsp[-2].id);
1772 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
1786 if(strcmp(yyvsp[0].id,"type")==0) {
1787 Node *node = new_check(TYPE_CHECK,NULL);
1788 checks = g_list_append(checks,node);
1789 } else if(strcmp(yyvsp[0].id,"null")==0) {
1790 Node *node = new_check(NULL_CHECK,NULL);
1791 checks = g_list_append(checks,node);
1793 yyerror(_("parse error"));
1796 g_free(yyvsp[0].id);
1802 Node *node = new_check(GT_CHECK,yyvsp[0].id);
1803 checks = g_list_append(checks,node);
1809 Node *node = new_check(LT_CHECK,yyvsp[0].id);
1810 checks = g_list_append(checks,node);
1816 Node *node = new_check(GE_CHECK,yyvsp[0].id);
1817 checks = g_list_append(checks,node);
1823 Node *node = new_check(LE_CHECK,yyvsp[0].id);
1824 checks = g_list_append(checks,node);
1830 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
1831 checks = g_list_append(checks,node);
1837 Node *node = new_check(NE_CHECK,yyvsp[0].id);
1838 checks = g_list_append(checks,node);
1843 { yyval.id = yyvsp[0].id; ;
1848 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
1849 g_free(yyvsp[0].id);
1854 { yyval.id = yyvsp[0].id; ;
1857 /* the action file gets copied in in place of this dollarsign */
1858 #line 543 "/usr/lib/bison.simple"
1869 short *ssp1 = yyss - 1;
1870 fprintf (stderr, "state stack now");
1871 while (ssp1 != yyssp)
1872 fprintf (stderr, " %d", *++ssp1);
1873 fprintf (stderr, "\n");
1883 yylsp->first_line = yylloc.first_line;
1884 yylsp->first_column = yylloc.first_column;
1885 yylsp->last_line = (yylsp-1)->last_line;
1886 yylsp->last_column = (yylsp-1)->last_column;
1891 yylsp->last_line = (yylsp+yylen-1)->last_line;
1892 yylsp->last_column = (yylsp+yylen-1)->last_column;
1896 /* Now "shift" the result of the reduction.
1897 Determine what state that goes to,
1898 based on the state we popped back to
1899 and the rule number reduced by. */
1903 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1904 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1905 yystate = yytable[yystate];
1907 yystate = yydefgoto[yyn - YYNTBASE];
1911 yyerrlab: /* here on detecting error */
1914 /* If not already recovering from an error, report this error. */
1918 #ifdef YYERROR_VERBOSE
1919 yyn = yypact[yystate];
1921 if (yyn > YYFLAG && yyn < YYLAST)
1928 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1929 for (x = (yyn < 0 ? -yyn : 0);
1930 x < (sizeof(yytname) / sizeof(char *)); x++)
1931 if (yycheck[x + yyn] == x)
1932 size += strlen(yytname[x]) + 15, count++;
1933 msg = (char *) malloc(size + 15);
1936 strcpy(msg, "parse error");
1941 for (x = (yyn < 0 ? -yyn : 0);
1942 x < (sizeof(yytname) / sizeof(char *)); x++)
1943 if (yycheck[x + yyn] == x)
1945 strcat(msg, count == 0 ? ", expecting `" : " or `");
1946 strcat(msg, yytname[x]);
1955 yyerror ("parse error; also virtual memory exceeded");
1958 #endif /* YYERROR_VERBOSE */
1959 yyerror("parse error");
1963 yyerrlab1: /* here on error raised explicitly by an action */
1965 if (yyerrstatus == 3)
1967 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1969 /* return failure if at end of input */
1970 if (yychar == YYEOF)
1975 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1981 /* Else will try to reuse lookahead token
1982 after shifting the error token. */
1984 yyerrstatus = 3; /* Each real token shifted decrements this */
1988 yyerrdefault: /* current state does not do anything special for the error token. */
1991 /* This is wrong; only states that explicitly want error tokens
1992 should shift them. */
1993 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1994 if (yyn) goto yydefault;
1997 yyerrpop: /* pop the current state because it cannot handle the error token */
1999 if (yyssp == yyss) YYABORT;
2009 short *ssp1 = yyss - 1;
2010 fprintf (stderr, "Error: state stack now");
2011 while (ssp1 != yyssp)
2012 fprintf (stderr, " %d", *++ssp1);
2013 fprintf (stderr, "\n");
2019 yyn = yypact[yystate];
2024 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2043 fprintf(stderr, "Shifting error token, ");
2055 /* YYACCEPT comes here. */
2067 /* YYABORT comes here. */