2 /* A Bison parser, made from parse.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
58 static GList *class_nodes = NULL;
61 static GList *typestack = NULL;
63 static GList *funcargs = NULL;
64 static GList *checks = NULL;
65 static int has_self = FALSE;
66 static int vararg = FALSE;
68 static GList *gtktypes = NULL;
70 /* this can be a global as we will only do one function at a time
72 static int the_scope = NO_SCOPE;
77 extern int ccode_line;
88 if(strcmp(yytext,"\n")==0) {
89 out=g_strconcat("Error: ",str," before newline",NULL);
90 } else if(yytext[0]=='\0') {
91 out=g_strconcat("Error: ",str," at end of input",NULL);
93 char *tmp = g_strdup(yytext);
94 while((p=strchr(tmp,'\n')))
97 out=g_strconcat("Error: ",str," before '",tmp,"'",NULL);
101 fprintf(stderr,"%s:%d: %s\n",filename,line_no,out);
110 Type *type = typestack->data;
111 typestack = g_list_remove(typestack,typestack->data);
116 push_variable(char *name, int scope, int line_no, char *postfix)
119 Type *type = pop_type();
121 type->postfix = postfix;
123 var = new_variable(scope,type,name,line_no);
124 class_nodes = g_list_append(class_nodes, var);
128 push_function(int scope, int method, char *oid, char *id, char *onerror,
129 GString *cbuf, int line_no, int ccode_line, gboolean vararg,
136 if(method!=INIT_METHOD && method!=CLASS_INIT_METHOD) {
139 type = (Type *)new_type(0,g_strdup("void"),NULL);
142 /* a complicated and ugly test to figure out if we have
143 the wrong number of types for a signal */
144 if((method == SIGNAL_FIRST_METHOD ||
145 method == SIGNAL_LAST_METHOD) &&
146 g_list_length(gtktypes) != g_list_length(funcargs) &&
147 !(g_list_length(funcargs) == 1 &&
148 g_list_length(gtktypes) == 2 &&
149 strcmp(gtktypes->next->data,"NONE")==0)) {
150 print_error(TRUE, _("The number of GTK arguments and "
151 "function arguments for a signal "
152 "don't seem to match"),line_no);
156 c_cbuf = p = cbuf->str;
157 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
164 node = new_method(scope, method, type, oid, gtktypes, flags,
165 id, funcargs, onerror, c_cbuf, line_no,
170 /*only free segment if we haven't passed it
176 class_nodes = g_list_append(class_nodes, node);
180 push_funcarg(char *name, char *postfix)
183 Type *type = pop_type();
185 type->postfix = postfix;
187 node = new_funcarg(type,name,checks);
190 funcargs = g_list_append(funcargs, node);
194 push_init_arg(char *name, int is_class)
201 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
203 tn = g_strdup(((Class *)class)->otype);
205 type = new_type(1,tn,NULL);
206 node = new_funcarg((Type *)type,name,NULL);
207 funcargs = g_list_prepend(funcargs, node);
216 type = new_type(1,g_strdup(((Class *)class)->otype),NULL);
217 ch = g_list_append(ch,new_check(NULL_CHECK,NULL));
218 ch = g_list_append(ch,new_check(TYPE_CHECK,NULL));
219 node = new_funcarg((Type *)type,id,ch);
220 funcargs = g_list_prepend(funcargs, node);
247 #define YYFLAG -32768
250 #define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 82)
252 static const char yytranslate[] = { 0,
253 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
254 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 48, 2, 2, 2, 2, 2, 2, 40,
257 41, 43, 2, 44, 49, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 2, 2, 2, 39, 46,
259 47, 45, 2, 2, 2, 2, 2, 2, 2, 2,
260 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
261 2, 2, 2, 2, 2, 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, 37, 42, 38, 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, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
279 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
280 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
281 27, 28, 29, 30, 31, 32, 33, 34, 35, 36
285 static const short yyprhs[] = { 0,
286 0, 4, 7, 10, 12, 14, 16, 18, 20, 22,
287 24, 27, 29, 34, 38, 43, 46, 49, 52, 54,
288 56, 58, 60, 62, 64, 69, 75, 87, 96, 102,
289 104, 108, 109, 113, 115, 117, 120, 122, 125, 128,
290 131, 133, 136, 139, 141, 143, 145, 147, 150, 152,
291 154, 157, 159, 162, 164, 166, 168, 170, 172, 175,
292 177, 180, 182, 186, 190, 193, 195, 200, 204, 206,
293 209, 211, 222, 234, 244, 254, 263, 275, 284, 290,
294 293, 297, 298, 300, 302, 306, 308, 312, 314, 318,
295 320, 323, 327, 334, 342, 345, 347, 349, 352, 355,
296 359, 363, 367, 371, 373, 376
299 static const short yyrhs[] = { 52,
300 53, 52, 0, 53, 52, 0, 52, 53, 0, 53,
301 0, 24, 0, 27, 0, 25, 0, 26, 0, 28,
302 0, 29, 0, 52, 51, 0, 51, 0, 54, 37,
303 55, 38, 0, 54, 37, 38, 0, 3, 22, 4,
304 22, 0, 55, 73, 0, 55, 57, 0, 55, 58,
305 0, 73, 0, 57, 0, 58, 0, 30, 0, 31,
306 0, 32, 0, 56, 62, 20, 39, 0, 56, 62,
307 20, 23, 39, 0, 33, 60, 59, 20, 20, 37,
308 24, 20, 37, 24, 39, 0, 33, 60, 59, 20,
309 20, 37, 24, 39, 0, 20, 40, 20, 62, 41,
310 0, 20, 0, 40, 61, 41, 0, 0, 20, 42,
311 61, 0, 20, 0, 63, 0, 5, 63, 0, 64,
312 0, 64, 67, 0, 12, 65, 0, 11, 65, 0,
313 65, 0, 12, 18, 0, 11, 18, 0, 18, 0,
314 17, 0, 16, 0, 20, 0, 66, 20, 0, 22,
315 0, 6, 0, 13, 15, 0, 13, 0, 14, 15,
316 0, 14, 0, 15, 0, 9, 0, 8, 0, 7,
317 0, 43, 67, 0, 43, 0, 20, 70, 0, 70,
318 0, 56, 20, 70, 0, 20, 56, 70, 0, 56,
319 70, 0, 68, 0, 20, 40, 71, 41, 0, 71,
320 44, 20, 0, 20, 0, 37, 24, 0, 39, 0,
321 35, 60, 69, 62, 20, 40, 75, 41, 74, 72,
322 0, 56, 35, 60, 68, 62, 20, 40, 75, 41,
323 74, 72, 0, 34, 56, 62, 20, 40, 75, 41,
324 74, 72, 0, 56, 34, 62, 20, 40, 75, 41,
325 74, 72, 0, 34, 62, 20, 40, 75, 41, 74,
326 72, 0, 36, 40, 22, 41, 62, 20, 40, 75,
327 41, 74, 72, 0, 56, 62, 20, 40, 75, 41,
328 74, 72, 0, 20, 40, 20, 41, 72, 0, 19,
329 81, 0, 19, 37, 24, 0, 0, 6, 0, 20,
330 0, 20, 44, 76, 0, 76, 0, 77, 44, 10,
331 0, 77, 0, 77, 44, 78, 0, 78, 0, 62,
332 20, 0, 62, 20, 23, 0, 62, 20, 40, 20,
333 79, 41, 0, 62, 20, 23, 40, 20, 79, 41,
334 0, 79, 80, 0, 80, 0, 20, 0, 45, 81,
335 0, 46, 81, 0, 45, 47, 81, 0, 46, 47,
336 81, 0, 47, 47, 81, 0, 48, 47, 81, 0,
337 21, 0, 49, 21, 0, 20, 0
343 static const short yyrline[] = { 0,
344 222, 223, 224, 225, 228, 234, 240, 246, 252, 258,
345 266, 267, 270, 275, 282, 287, 288, 289, 290, 291,
346 292, 295, 296, 297, 300, 303, 307, 342, 372, 381,
347 387, 388, 391, 394, 400, 401, 409, 413, 420, 423,
348 426, 429, 432, 435, 438, 441, 444, 447, 451, 454,
349 459, 462, 465, 468, 471, 476, 479, 482, 487, 488,
350 492, 504, 510, 522, 534, 537, 543, 548, 551, 556,
351 557, 561, 571, 581, 591, 601, 611, 617, 622, 643,
352 644, 648, 651, 652, 663, 673, 676, 677, 680, 681,
353 684, 687, 690, 698, 708, 709, 712, 725, 729, 733,
354 737, 741, 745, 751, 752, 756
359 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
361 static const char * const yytname[] = { "$","error","$undefined.","CLASS",
362 "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED",
363 "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN",
364 "ARRAY_DIM","CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","PUBLIC","PRIVATE",
365 "PROTECTED","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","';'","'('",
366 "')'","'|'","'*'","','","'>'","'<'","'='","'!'","'-'","prog","ccode","ccodes",
367 "class","classdec","classcode","scope","variable","argument","argtype","flags",
368 "flaglist","type","type1","type2","integer","tspecifier","stars","simplesigtype",
369 "fullsigtype","sigtype","tokenlist","codenocode","method","onerror","funcargs",
370 "arglist","arglist1","arg","checklist","check","numtok", NULL
374 static const short yyr1[] = { 0,
375 50, 50, 50, 50, 51, 51, 51, 51, 51, 51,
376 52, 52, 53, 53, 54, 55, 55, 55, 55, 55,
377 55, 56, 56, 56, 57, 57, 58, 58, 59, 59,
378 60, 60, 61, 61, 62, 62, 63, 63, 64, 64,
379 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
380 65, 65, 65, 65, 65, 66, 66, 66, 67, 67,
381 68, 68, 69, 69, 69, 69, 70, 71, 71, 72,
382 72, 73, 73, 73, 73, 73, 73, 73, 73, 74,
383 74, 74, 75, 75, 75, 75, 76, 76, 77, 77,
384 78, 78, 78, 78, 79, 79, 80, 80, 80, 80,
385 80, 80, 80, 81, 81, 81
388 static const short yyr2[] = { 0,
389 3, 2, 2, 1, 1, 1, 1, 1, 1, 1,
390 2, 1, 4, 3, 4, 2, 2, 2, 1, 1,
391 1, 1, 1, 1, 4, 5, 11, 8, 5, 1,
392 3, 0, 3, 1, 1, 2, 1, 2, 2, 2,
393 1, 2, 2, 1, 1, 1, 1, 2, 1, 1,
394 2, 1, 2, 1, 1, 1, 1, 1, 2, 1,
395 2, 1, 3, 3, 2, 1, 4, 3, 1, 2,
396 1, 10, 11, 9, 9, 8, 11, 8, 5, 2,
397 3, 0, 1, 1, 3, 1, 3, 1, 3, 1,
398 2, 3, 6, 7, 2, 1, 1, 2, 2, 3,
402 static const short yydefact[] = { 0,
403 0, 5, 7, 8, 6, 9, 10, 12, 0, 4,
404 0, 0, 11, 3, 2, 0, 0, 1, 0, 22,
405 23, 24, 32, 0, 32, 0, 14, 0, 0, 20,
406 21, 19, 15, 0, 0, 0, 0, 50, 58, 57,
407 56, 0, 0, 52, 54, 55, 46, 45, 44, 47,
408 49, 0, 0, 35, 37, 41, 0, 0, 0, 13,
409 17, 18, 16, 0, 32, 0, 0, 34, 0, 30,
410 0, 36, 43, 40, 42, 39, 51, 53, 0, 0,
411 60, 38, 48, 0, 0, 66, 0, 62, 0, 0,
412 0, 0, 0, 0, 31, 0, 0, 0, 0, 59,
413 0, 0, 0, 61, 0, 65, 0, 0, 0, 0,
414 0, 0, 25, 0, 0, 71, 79, 33, 0, 0,
415 0, 50, 47, 0, 0, 86, 88, 90, 69, 0,
416 64, 63, 0, 0, 0, 0, 26, 0, 70, 0,
417 0, 0, 0, 91, 82, 0, 67, 0, 0, 0,
418 0, 0, 82, 29, 0, 82, 85, 92, 0, 0,
419 0, 87, 89, 68, 0, 0, 82, 0, 0, 0,
420 28, 0, 0, 0, 106, 104, 0, 0, 80, 76,
421 82, 0, 0, 0, 78, 0, 74, 0, 97, 0,
422 0, 0, 0, 0, 96, 81, 105, 0, 82, 75,
423 82, 0, 0, 0, 98, 0, 99, 0, 0, 93,
424 95, 72, 0, 0, 27, 94, 100, 101, 102, 103,
428 static const short yydefgoto[] = { 223,
429 8, 9, 10, 11, 28, 29, 30, 31, 71, 36,
430 69, 124, 54, 55, 56, 57, 82, 86, 87, 88,
431 130, 117, 32, 161, 125, 126, 127, 128, 194, 195,
435 static const short yypact[] = { 136,
436 4,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 136, 119,
437 32, 10,-32768, 119, 119, 146, 67, 119, 40,-32768,
438 -32768,-32768, 57, 120, 57, 68,-32768, 155, 59,-32768,
439 -32768,-32768,-32768, 78, 95, 96, 242,-32768,-32768,-32768,
440 -32768, 252, 258, 115, 126,-32768,-32768,-32768,-32768,-32768,
441 -32768, 207, 129,-32768, 113,-32768, 137, 70, 151,-32768,
442 -32768,-32768,-32768, 207, 57, 138, 133, 141, 167, 152,
443 190,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 197, 186,
444 113,-32768,-32768, 2, 208,-32768, 207,-32768, 194, 224,
445 226, -19, 131, 95,-32768, 232, 241, 223, 225,-32768,
446 228, 249, 254,-32768, -4,-32768, 255, 207, 237, -4,
447 207, 239,-32768, 225, 256,-32768,-32768,-32768, 207, 244,
448 225, 238, 47, 262, 243,-32768, 245,-32768,-32768, 66,
449 -32768,-32768, 246, 263, 225, 265,-32768, 247,-32768, 250,
450 266, 251, 207, 7, 268, 189,-32768, 273, 225, 257,
451 253, 259, 268,-32768, -1, 268,-32768, 260, 275, -10,
452 131,-32768,-32768,-32768, 261, 225, 268, 225, 131, 264,
453 -32768, 131, 276, 76,-32768,-32768, 274, 282,-32768,-32768,
454 268, 267, 131, 269,-32768, 280,-32768, 76,-32768, 62,
455 65, 270, 271, 58,-32768,-32768,-32768, 131, 268,-32768,
456 268, 272, 72, -8,-32768, -8,-32768, -8, -8,-32768,
457 -32768,-32768, 131, 131,-32768,-32768,-32768,-32768,-32768,-32768,
458 -32768,-32768, 305, 306,-32768
461 static const short yypgoto[] = {-32768,
462 37, 145, 298,-32768,-32768, -23, 281, 284,-32768, -17,
463 219, -24, 277,-32768, 15,-32768, 234, 229,-32768, -60,
464 -32768, -154, 288, -150, -112, 176,-32768, 175, 134, -141,
472 static const short yytable[] = { 53,
473 52, 138, 169, 112, 66, 172, 180, 58, 142, 175,
474 176, 175, 176, 17, 185, 101, 183, 187, 170, 113,
475 114, 101, 151, 104, 106, 12, 177, 79, 200, 158,
476 198, 20, 21, 22, 85, 102, 165, 171, 178, 90,
477 178, 102, 131, 212, 132, 13, 159, 91, 213, 104,
478 214, 13, 211, 182, 13, 184, 74, 76, 221, 222,
479 103, 211, 107, 37, 38, 39, 40, 41, 16, 42,
480 43, 44, 45, 46, 47, 48, 49, 189, 50, 34,
481 51, 175, 176, 134, 175, 176, 136, -84, 33, 84,
482 143, 189, 64, 65, 140, 189, 35, 67, 210, 20,
483 21, 22, 190, 191, 192, 193, 147, 59, 204, 148,
484 178, 206, 216, 178, 68, 70, 190, 191, 192, 193,
485 190, 191, 192, 193, 37, 38, 39, 40, 41, 77,
486 42, 43, 44, 45, 46, 47, 48, 49, 1, 50,
487 78, 51, 2, 3, 4, 5, 6, 7, 80, 20,
488 21, 22, 205, 207, 15, 81, 83, 92, 18, 2,
489 3, 4, 5, 6, 7, 19, 217, 115, 218, 116,
490 219, 220, 89, 93, 19, 20, 21, 22, 23, 24,
491 25, 26, 94, 27, 20, 21, 22, 23, 24, 25,
492 26, 96, 60, 37, 38, 39, 40, 41, 162, 42,
493 43, 44, 45, 46, 47, 48, 49, 95, 50, 97,
494 51, 37, 38, 39, 40, 41, 98, 42, 43, 44,
495 45, 46, 47, 48, 49, 99, 50, 105, 51, 37,
496 122, 39, 40, 41, 108, 42, 43, 44, 45, 46,
497 47, 48, 49, 109, 123, 110, 51, 38, 39, 40,
498 41, 119, 42, 43, 44, 45, 46, 47, 48, 49,
499 120, 50, 121, 51, 44, 45, 46, 102, 129, 73,
500 44, 45, 46, 101, 133, 75, 135, 137, -83, 139,
501 141, 144, 150, 145, 152, 149, 160, 153, 146, 155,
502 154, 156, 164, 167, 174, 188, 166, 196, 168, 173,
503 186, 181, 197, 202, 224, 225, 14, 199, 61, 201,
504 215, 62, 118, 72, 100, 63, 208, 209, 157, 111,
508 static const short yycheck[] = { 24,
509 24, 114, 153, 23, 29, 156, 161, 25, 121, 20,
510 21, 20, 21, 4, 169, 20, 167, 172, 20, 39,
511 40, 20, 135, 84, 85, 22, 37, 52, 183, 23,
512 181, 30, 31, 32, 58, 40, 149, 39, 49, 64,
513 49, 40, 103, 198, 105, 9, 40, 65, 199, 110,
514 201, 15, 194, 166, 18, 168, 42, 43, 213, 214,
515 84, 203, 87, 5, 6, 7, 8, 9, 37, 11,
516 12, 13, 14, 15, 16, 17, 18, 20, 20, 40,
517 22, 20, 21, 108, 20, 21, 111, 41, 22, 20,
518 44, 20, 34, 35, 119, 20, 40, 20, 41, 30,
519 31, 32, 45, 46, 47, 48, 41, 40, 47, 44,
520 49, 47, 41, 49, 20, 20, 45, 46, 47, 48,
521 45, 46, 47, 48, 5, 6, 7, 8, 9, 15,
522 11, 12, 13, 14, 15, 16, 17, 18, 3, 20,
523 15, 22, 24, 25, 26, 27, 28, 29, 20, 30,
524 31, 32, 190, 191, 10, 43, 20, 20, 14, 24,
525 25, 26, 27, 28, 29, 20, 204, 37, 206, 39,
526 208, 209, 22, 41, 20, 30, 31, 32, 33, 34,
527 35, 36, 42, 38, 30, 31, 32, 33, 34, 35,
528 36, 40, 38, 5, 6, 7, 8, 9, 10, 11,
529 12, 13, 14, 15, 16, 17, 18, 41, 20, 20,
530 22, 5, 6, 7, 8, 9, 20, 11, 12, 13,
531 14, 15, 16, 17, 18, 40, 20, 20, 22, 5,
532 6, 7, 8, 9, 41, 11, 12, 13, 14, 15,
533 16, 17, 18, 20, 20, 20, 22, 6, 7, 8,
534 9, 20, 11, 12, 13, 14, 15, 16, 17, 18,
535 20, 20, 40, 22, 13, 14, 15, 40, 20, 18,
536 13, 14, 15, 20, 20, 18, 40, 39, 41, 24,
537 37, 20, 20, 41, 20, 40, 19, 41, 44, 24,
538 41, 41, 20, 41, 20, 20, 40, 24, 40, 40,
539 37, 41, 21, 24, 0, 0, 9, 41, 28, 41,
540 39, 28, 94, 37, 81, 28, 47, 47, 143, 91,
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);
1141 Node *node = new_ccode(A_CCODE,(yyvsp[0].cbuf)->str,
1143 nodes = g_list_append(nodes,node);
1144 g_string_free(yyvsp[0].cbuf,FALSE);
1150 Node *node = new_ccode(AT_CCODE,(yyvsp[0].cbuf)->str,
1152 nodes = g_list_append(nodes,node);
1153 g_string_free(yyvsp[0].cbuf,FALSE);
1167 ((Class *)class)->nodes = class_nodes;
1169 nodes = g_list_append(nodes,class);
1175 ((Class *)class)->nodes = NULL;
1177 nodes = g_list_append(nodes,class);
1183 class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
1212 { the_scope = PUBLIC_SCOPE; ;
1216 { the_scope = PRIVATE_SCOPE; ;
1220 { the_scope = PROTECTED_SCOPE; ;
1225 push_variable(yyvsp[-1].id,the_scope,yyvsp[-3].line,NULL);
1231 push_variable(yyvsp[-2].id,the_scope,yyvsp[-4].line,yyvsp[-1].id);
1237 if(strcmp(yyvsp[-6].id,"get")==0 &&
1238 strcmp(yyvsp[-3].id,"set")==0) {
1240 Type *type = pop_type();
1241 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1242 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1243 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1244 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1246 g_string_free(yyvsp[-4].cbuf,FALSE);
1247 g_string_free(yyvsp[-1].cbuf,FALSE);
1248 class_nodes = g_list_append(class_nodes,node);
1249 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
1250 strcmp(yyvsp[-3].id,"get")==0) {
1252 Type *type = pop_type();
1253 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1254 node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
1255 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1256 (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
1258 g_string_free(yyvsp[-1].cbuf,FALSE);
1259 g_string_free(yyvsp[-4].cbuf,FALSE);
1260 class_nodes = g_list_append(class_nodes,node);
1262 g_free(yyvsp[-8].id); g_free(yyvsp[-7].id);
1263 g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
1264 g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL);
1265 g_string_free(yyvsp[-1].cbuf,TRUE);
1266 g_string_free(yyvsp[-4].cbuf,TRUE);
1267 yyerror(_("parse error"));
1275 if(strcmp(yyvsp[-3].id,"get")==0) {
1277 Type *type = pop_type();
1278 g_free(yyvsp[-3].id);
1279 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1280 (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
1281 NULL,0, yyvsp[-7].line);
1282 g_string_free(yyvsp[-1].cbuf,FALSE);
1283 class_nodes = g_list_append(class_nodes,node);
1284 } else if(strcmp(yyvsp[-3].id,"set")==0) {
1286 Type *type = pop_type();
1287 g_free(yyvsp[-3].id);
1288 node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
1289 NULL,0,(yyvsp[-1].cbuf)->str,
1290 yyvsp[-2].line, yyvsp[-7].line);
1291 g_string_free(yyvsp[-1].cbuf,FALSE);
1292 class_nodes = g_list_append(class_nodes,node);
1294 g_free(yyvsp[-3].id); g_free(yyvsp[-5].id);
1295 g_free(yyvsp[-4].id);
1296 g_list_foreach(yyvsp[-6].list,(GFunc)g_free,NULL);
1297 g_string_free(yyvsp[-1].cbuf,TRUE);
1298 yyerror(_("parse error"));
1306 if(strcmp(yyvsp[-2].id,"type")!=0) {
1307 g_free(yyvsp[-4].id);
1308 g_free(yyvsp[-2].id);
1309 yyerror(_("parse error"));
1312 yyval.id = yyvsp[-4].id;
1318 yyval.id = yyvsp[0].id;
1319 typestack = g_list_prepend(typestack,NULL);
1324 { yyval.list = yyvsp[-1].list; ;
1328 { yyval.list = NULL; ;
1333 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
1339 yyval.list = g_list_append(NULL,yyvsp[0].id);
1349 Type *type = typestack->data;
1350 char *oldname = type->name;
1351 type->name = g_strconcat("const ",oldname,NULL);
1358 Node *node = new_type(0,yyvsp[0].id,NULL);
1359 typestack = g_list_prepend(typestack,node);
1365 Node *node = new_type(stars,yyvsp[-1].id,NULL);
1367 typestack = g_list_prepend(typestack,node);
1373 yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
1379 yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
1385 yyval.id = g_strdup(yyvsp[0].id);
1391 yyval.id = g_strdup("unsigned char");
1397 yyval.id = g_strdup("signed char");
1403 yyval.id = g_strdup("char");
1409 yyval.id = g_strdup("double");
1415 yyval.id = g_strdup("float");
1421 yyval.id = yyvsp[0].id;
1427 yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
1428 g_free(yyvsp[0].id);
1434 yyval.id = yyvsp[0].id;
1440 yyval.id = g_strdup("void");
1446 yyval.id = "long int";
1458 yyval.id = "short int";
1482 yyval.id = "union ";
1488 yyval.id = "struct ";
1502 if(strcmp(yyvsp[-1].id,"first")==0)
1503 yyval.sigtype = SIGNAL_FIRST_METHOD;
1504 else if(strcmp(yyvsp[-1].id,"last")==0)
1505 yyval.sigtype = SIGNAL_LAST_METHOD;
1507 yyerror(_("signal must be 'first' or 'last'"));
1508 g_free(yyvsp[-1].id);
1511 g_free(yyvsp[-1].id);
1517 yyval.sigtype = SIGNAL_LAST_METHOD;
1523 if(strcmp(yyvsp[-1].id,"first")==0)
1524 yyval.sigtype = SIGNAL_FIRST_METHOD;
1525 else if(strcmp(yyvsp[-1].id,"last")==0)
1526 yyval.sigtype = SIGNAL_LAST_METHOD;
1528 yyerror(_("signal must be 'first' or 'last'"));
1529 g_free(yyvsp[-1].id);
1532 g_free(yyvsp[-1].id);
1538 if(strcmp(yyvsp[-2].id,"first")==0)
1539 yyval.sigtype = SIGNAL_FIRST_METHOD;
1540 else if(strcmp(yyvsp[-2].id,"last")==0)
1541 yyval.sigtype = SIGNAL_LAST_METHOD;
1543 yyerror(_("signal must be 'first' or 'last'"));
1544 g_free(yyvsp[-2].id);
1547 g_free(yyvsp[-2].id);
1553 yyval.sigtype = SIGNAL_LAST_METHOD;
1559 /* the_scope was default thus public */
1560 the_scope = PUBLIC_SCOPE;
1566 gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
1572 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1578 gtktypes = g_list_append(gtktypes,yyvsp[0].id);
1583 { yyval.cbuf = yyvsp[0].cbuf; ;
1587 { yyval.cbuf = NULL; ;
1593 yyerror(_("signal without 'self' as "
1594 "first parameter"));
1597 push_function(the_scope, yyvsp[-7].sigtype,NULL,
1598 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-9].line,
1599 ccode_line, vararg, yyvsp[-8].list);
1606 yyerror(_("signal without 'self' as "
1607 "first parameter"));
1610 push_function(the_scope, yyvsp[-7].sigtype, NULL,
1611 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-9].line,
1612 ccode_line, vararg, yyvsp[-8].list);
1619 yyerror(_("virtual method without 'self' as "
1620 "first parameter"));
1623 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1624 yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-8].line,
1625 ccode_line, vararg, NULL);
1632 yyerror(_("virtual method without 'self' as "
1633 "first parameter"));
1636 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
1637 yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line,
1638 ccode_line, vararg, NULL);
1645 yyerror(_("virtual method without 'self' as "
1646 "first parameter"));
1649 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
1650 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line,
1651 ccode_line, vararg, NULL);
1657 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
1658 yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,
1659 yyvsp[-10].line, ccode_line,
1666 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
1667 yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
1674 if(strcmp(yyvsp[-4].id,"init")==0) {
1675 push_init_arg(yyvsp[-2].id,FALSE);
1676 push_function(NO_SCOPE, INIT_METHOD, NULL,
1677 yyvsp[-4].id, NULL, yyvsp[0].cbuf, yyvsp[-3].line,
1678 ccode_line, FALSE, NULL);
1679 } else if(strcmp(yyvsp[-4].id,"class_init")==0) {
1680 push_init_arg(yyvsp[-2].id,TRUE);
1681 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
1682 yyvsp[-4].id, NULL, yyvsp[0].cbuf, yyvsp[-3].line,
1683 ccode_line, FALSE, NULL);
1685 g_free(yyvsp[-4].id);
1686 g_free(yyvsp[-2].id);
1687 g_string_free(yyvsp[-2].cbuf,TRUE);
1688 yyerror(_("parse error"));
1695 { yyval.id = yyvsp[0].id; ;
1700 yyval.id = (yyvsp[0].cbuf)->str;
1701 g_string_free(yyvsp[0].cbuf,FALSE);
1706 { yyval.id = NULL; ;
1710 { vararg = FALSE; has_self = FALSE; ;
1717 if(strcmp(yyvsp[0].id,"self")==0)
1718 push_self(yyvsp[0].id);
1720 g_free(yyvsp[0].id);
1721 yyerror(_("parse error"));
1730 if(strcmp(yyvsp[-2].id,"self")==0)
1731 push_self(yyvsp[-2].id);
1733 g_free(yyvsp[-2].id);
1734 yyerror(_("parse error"));
1741 { has_self = FALSE; ;
1762 push_funcarg(yyvsp[0].id,NULL);
1768 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
1774 if(strcmp(yyvsp[-2].id,"check")!=0) {
1775 yyerror(_("parse error"));
1778 g_free(yyvsp[-2].id);
1779 push_funcarg(yyvsp[-4].id,NULL);
1785 if(strcmp(yyvsp[-2].id,"check")!=0) {
1786 yyerror(_("parse error"));
1789 g_free(yyvsp[-2].id);
1790 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
1804 if(strcmp(yyvsp[0].id,"type")==0) {
1805 Node *node = new_check(TYPE_CHECK,NULL);
1806 checks = g_list_append(checks,node);
1807 } else if(strcmp(yyvsp[0].id,"null")==0) {
1808 Node *node = new_check(NULL_CHECK,NULL);
1809 checks = g_list_append(checks,node);
1811 yyerror(_("parse error"));
1814 g_free(yyvsp[0].id);
1820 Node *node = new_check(GT_CHECK,yyvsp[0].id);
1821 checks = g_list_append(checks,node);
1827 Node *node = new_check(LT_CHECK,yyvsp[0].id);
1828 checks = g_list_append(checks,node);
1834 Node *node = new_check(GE_CHECK,yyvsp[0].id);
1835 checks = g_list_append(checks,node);
1841 Node *node = new_check(LE_CHECK,yyvsp[0].id);
1842 checks = g_list_append(checks,node);
1848 Node *node = new_check(EQ_CHECK,yyvsp[0].id);
1849 checks = g_list_append(checks,node);
1855 Node *node = new_check(NE_CHECK,yyvsp[0].id);
1856 checks = g_list_append(checks,node);
1861 { yyval.id = yyvsp[0].id; ;
1866 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
1867 g_free(yyvsp[0].id);
1872 { yyval.id = yyvsp[0].id; ;
1875 /* the action file gets copied in in place of this dollarsign */
1876 #line 543 "/usr/lib/bison.simple"
1887 short *ssp1 = yyss - 1;
1888 fprintf (stderr, "state stack now");
1889 while (ssp1 != yyssp)
1890 fprintf (stderr, " %d", *++ssp1);
1891 fprintf (stderr, "\n");
1901 yylsp->first_line = yylloc.first_line;
1902 yylsp->first_column = yylloc.first_column;
1903 yylsp->last_line = (yylsp-1)->last_line;
1904 yylsp->last_column = (yylsp-1)->last_column;
1909 yylsp->last_line = (yylsp+yylen-1)->last_line;
1910 yylsp->last_column = (yylsp+yylen-1)->last_column;
1914 /* Now "shift" the result of the reduction.
1915 Determine what state that goes to,
1916 based on the state we popped back to
1917 and the rule number reduced by. */
1921 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1922 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1923 yystate = yytable[yystate];
1925 yystate = yydefgoto[yyn - YYNTBASE];
1929 yyerrlab: /* here on detecting error */
1932 /* If not already recovering from an error, report this error. */
1936 #ifdef YYERROR_VERBOSE
1937 yyn = yypact[yystate];
1939 if (yyn > YYFLAG && yyn < YYLAST)
1946 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1947 for (x = (yyn < 0 ? -yyn : 0);
1948 x < (sizeof(yytname) / sizeof(char *)); x++)
1949 if (yycheck[x + yyn] == x)
1950 size += strlen(yytname[x]) + 15, count++;
1951 msg = (char *) malloc(size + 15);
1954 strcpy(msg, "parse error");
1959 for (x = (yyn < 0 ? -yyn : 0);
1960 x < (sizeof(yytname) / sizeof(char *)); x++)
1961 if (yycheck[x + yyn] == x)
1963 strcat(msg, count == 0 ? ", expecting `" : " or `");
1964 strcat(msg, yytname[x]);
1973 yyerror ("parse error; also virtual memory exceeded");
1976 #endif /* YYERROR_VERBOSE */
1977 yyerror("parse error");
1981 yyerrlab1: /* here on error raised explicitly by an action */
1983 if (yyerrstatus == 3)
1985 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1987 /* return failure if at end of input */
1988 if (yychar == YYEOF)
1993 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1999 /* Else will try to reuse lookahead token
2000 after shifting the error token. */
2002 yyerrstatus = 3; /* Each real token shifted decrements this */
2006 yyerrdefault: /* current state does not do anything special for the error token. */
2009 /* This is wrong; only states that explicitly want error tokens
2010 should shift them. */
2011 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2012 if (yyn) goto yydefault;
2015 yyerrpop: /* pop the current state because it cannot handle the error token */
2017 if (yyssp == yyss) YYABORT;
2027 short *ssp1 = yyss - 1;
2028 fprintf (stderr, "Error: state stack now");
2029 while (ssp1 != yyssp)
2030 fprintf (stderr, " %d", *++ssp1);
2031 fprintf (stderr, "\n");
2037 yyn = yypact[yystate];
2042 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2061 fprintf(stderr, "Shifting error token, ");
2073 /* YYACCEPT comes here. */
2085 /* YYABORT comes here. */