2 /* A Bison parser, made from parser.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define aIDENTIFIER 257
16 #define tAGGREGATABLE 266
18 #define tAPPOBJECT 268
21 #define tASYNCUUID 271
22 #define tAUTOHANDLE 272
25 #define tBROADCAST 275
27 #define tBYTECOUNT 277
35 #define tCOMMSTATUS 285
37 #define tCONTEXTHANDLE 287
38 #define tCONTEXTHANDLENOSERIALIZE 288
39 #define tCONTEXTHANDLESERIALIZE 289
43 #define tDEFAULTVALUE 293
44 #define tDISPINTERFACE 294
51 #define tERRORSTATUST 301
52 #define tEXPLICITHANDLE 302
57 #define tHELPCONTEXT 307
59 #define tHELPSTRING 309
60 #define tHELPSTRINGCONTEXT 310
61 #define tHELPSTRINGDLL 311
65 #define tIDEMPOTENT 315
67 #define tIMPLICITHANDLE 317
69 #define tIMPORTLIB 319
73 #define tINPUTSYNC 323
76 #define tINTERFACE 326
83 #define tNONCREATABLE 333
86 #define tOLEAUTOMATION 336
89 #define tPOINTERDEFAULT 339
90 #define tPROPERTIES 340
93 #define tPROPPUTREF 343
97 #define tRESTRICTED 347
109 #define tSWITCHIS 359
110 #define tSWITCHTYPE 360
111 #define tTRANSMITAS 361
115 #define tUNSIGNED 365
122 #define tWIREMARSHAL 372
123 #define tPOINTERTYPE 373
134 * Copyright 2002 Ove Kaaven
136 * This library is free software; you can redistribute it and/or
137 * modify it under the terms of the GNU Lesser General Public
138 * License as published by the Free Software Foundation; either
139 * version 2.1 of the License, or (at your option) any later version.
141 * This library is distributed in the hope that it will be useful,
142 * but WITHOUT ANY WARRANTY; without even the implied warranty of
143 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
144 * Lesser General Public License for more details.
146 * You should have received a copy of the GNU Lesser General Public
147 * License along with this library; if not, write to the Free Software
148 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
170 /* Berkeley yacc (byacc) doesn't seem to know about these */
171 /* Some *BSD supplied versions do define these though */
173 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
176 # define YYLEX yylex()
179 #elif defined(YYBISON)
180 /* Bison was used for original development */
181 /* #define YYEMPTY -2 */
182 /* #define YYLEX yylex() */
185 /* No yacc we know yet */
186 # if !defined(YYEMPTY) || !defined(YYLEX)
187 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
188 # elif defined(__GNUC__) /* gcc defines the #warning directive */
189 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
190 /* #else we just take a chance that it works... */
194 static attr_t
*make_attr(enum attr_type type
);
195 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
);
196 static attr_t
*make_attrp(enum attr_type type
, void *val
);
197 static expr_t
*make_expr(enum expr_type type
);
198 static expr_t
*make_exprl(enum expr_type type
, long val
);
199 static expr_t
*make_exprs(enum expr_type type
, char *val
);
200 static expr_t
*make_exprt(enum expr_type type
, typeref_t
*tref
, expr_t
*expr
);
201 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
);
202 static expr_t
*make_expr2(enum expr_type type
, expr_t
*exp1
, expr_t
*exp2
);
203 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
);
204 static type_t
*make_type(unsigned char type
, type_t
*ref
);
205 static typeref_t
*make_tref(char *name
, type_t
*ref
);
206 static typeref_t
*uniq_tref(typeref_t
*ref
);
207 static type_t
*type_ref(typeref_t
*ref
);
208 static void set_type(var_t
*v
, typeref_t
*ref
, expr_t
*arr
);
209 static ifref_t
*make_ifref(type_t
*iface
);
210 static var_t
*make_var(char *name
);
211 static func_t
*make_func(var_t
*def
, var_t
*args
);
212 static class_t
*make_class(char *name
);
214 static type_t
*reg_type(type_t
*type
, char *name
, int t
);
215 static type_t
*reg_types(type_t
*type
, var_t
*names
, int t
);
216 static type_t
*find_type(char *name
, int t
);
217 static type_t
*find_type2(char *name
, int t
);
218 static type_t
*get_type(unsigned char type
, char *name
, int t
);
219 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
);
220 static int get_struct_type(var_t
*fields
);
222 static var_t
*reg_const(var_t
*var
);
223 static var_t
*find_const(char *name
, int f
);
229 static type_t std_bool
= { "boolean" };
230 static type_t std_int
= { "int" };
231 static type_t std_int64
= { "__int64" };
232 static type_t std_uhyper
= { "MIDL_uhyper" };
260 #define YYFLAG -32768
263 #define YYTRANSLATE(x) ((unsigned)(x) <= 377 ? yytranslate[x] : 215)
265 static const short yytranslate
[] = { 0,
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, 123, 2, 133,
270 134, 126, 125, 120, 124, 142, 127, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 139, 132, 2,
272 140, 2, 141, 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 137, 2, 138, 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, 135, 122, 136, 128, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
292 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
293 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
294 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
295 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
296 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
297 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
298 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
299 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
300 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
301 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
302 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
303 117, 118, 119, 121, 129, 130, 131
307 static const short yyprhs
[] = { 0,
308 0, 2, 3, 6, 9, 12, 15, 18, 21, 22,
309 25, 28, 31, 34, 37, 38, 42, 45, 47, 50,
310 52, 55, 58, 60, 63, 66, 69, 74, 78, 82,
311 85, 89, 93, 94, 96, 98, 100, 104, 106, 111,
312 115, 122, 128, 129, 133, 137, 139, 143, 148, 149,
313 151, 155, 157, 161, 166, 168, 170, 175, 180, 182,
314 184, 186, 188, 190, 195, 200, 205, 207, 212, 217,
315 222, 224, 226, 231, 236, 241, 246, 251, 253, 258,
316 260, 265, 271, 273, 275, 280, 282, 284, 286, 288,
317 290, 292, 294, 299, 301, 303, 305, 307, 309, 311,
318 313, 318, 320, 322, 327, 332, 337, 342, 344, 346,
319 351, 356, 358, 359, 361, 362, 365, 370, 374, 380,
320 381, 384, 386, 388, 392, 396, 398, 404, 406, 410,
321 411, 413, 415, 417, 419, 425, 429, 433, 437, 441,
322 445, 449, 453, 457, 460, 463, 466, 471, 476, 480,
323 482, 486, 488, 493, 494, 497, 500, 504, 507, 509,
324 514, 522, 523, 525, 526, 528, 530, 532, 534, 536,
325 538, 540, 542, 544, 546, 549, 552, 554, 556, 558,
326 560, 562, 563, 565, 567, 570, 573, 576, 579, 581,
327 583, 586, 589, 592, 597, 598, 601, 604, 607, 610,
328 613, 616, 620, 623, 627, 633, 634, 637, 640, 643,
329 646, 652, 660, 662, 665, 668, 671, 674, 677, 682,
330 685, 688, 690, 692, 696, 698, 702, 704, 706, 712,
331 714, 716, 718, 721, 723, 726, 728, 731, 733, 736,
335 static const short yyrhs
[] = { 144,
336 0, 0, 144, 202, 0, 144, 201, 0, 144, 190,
337 0, 144, 205, 0, 144, 153, 0, 144, 147, 0,
338 0, 145, 202, 0, 145, 201, 0, 145, 190, 0,
339 145, 205, 0, 145, 147, 0, 0, 146, 181, 132,
340 0, 146, 147, 0, 132, 0, 167, 132, 0, 148,
341 0, 171, 132, 0, 177, 132, 0, 150, 0, 210,
342 132, 0, 212, 132, 0, 213, 132, 0, 37, 133,
343 7, 134, 0, 64, 7, 132, 0, 149, 145, 9,
344 0, 74, 3, 0, 161, 151, 135, 0, 152, 145,
345 136, 0, 0, 156, 0, 116, 0, 157, 0, 156,
346 120, 157, 0, 155, 0, 161, 211, 207, 158, 0,
347 211, 207, 158, 0, 161, 211, 207, 133, 154, 134,
348 0, 211, 207, 133, 154, 134, 0, 0, 137, 159,
349 138, 0, 137, 126, 138, 0, 173, 0, 159, 120,
350 174, 0, 159, 138, 137, 174, 0, 0, 161, 0,
351 137, 162, 138, 0, 163, 0, 162, 120, 163, 0,
352 162, 138, 137, 163, 0, 16, 0, 18, 0, 24,
353 133, 184, 134, 0, 26, 133, 175, 134, 0, 33,
354 0, 34, 0, 35, 0, 36, 0, 38, 0, 39,
355 133, 176, 134, 0, 39, 133, 7, 134, 0, 41,
356 133, 7, 134, 0, 43, 0, 44, 133, 7, 134,
357 0, 45, 133, 7, 134, 0, 45, 133, 176, 134,
358 0, 48, 0, 51, 0, 53, 133, 176, 134, 0,
359 54, 133, 7, 134, 0, 55, 133, 7, 134, 0,
360 56, 133, 176, 134, 0, 57, 133, 7, 134, 0,
361 58, 0, 60, 133, 176, 134, 0, 61, 0, 62,
362 133, 184, 134, 0, 63, 133, 52, 3, 134, 0,
363 66, 0, 69, 0, 73, 133, 172, 134, 0, 75,
364 0, 79, 0, 80, 0, 81, 0, 82, 0, 83,
365 0, 84, 0, 85, 133, 209, 134, 0, 87, 0,
366 88, 0, 89, 0, 90, 0, 91, 0, 93, 0,
367 94, 0, 97, 133, 172, 134, 0, 100, 0, 102,
368 0, 105, 133, 174, 134, 0, 106, 133, 211, 134,
369 0, 107, 133, 211, 134, 0, 112, 133, 8, 134,
370 0, 113, 0, 114, 0, 115, 133, 214, 134, 0,
371 118, 133, 211, 134, 0, 209, 0, 0, 101, 0,
372 0, 165, 166, 0, 26, 174, 139, 179, 0, 38,
373 139, 179, 0, 32, 211, 184, 140, 176, 0, 0,
374 169, 120, 0, 169, 0, 170, 0, 169, 120, 170,
375 0, 184, 140, 176, 0, 184, 0, 46, 183, 135,
376 168, 136, 0, 173, 0, 172, 120, 173, 0, 0,
377 174, 0, 5, 0, 6, 0, 3, 0, 174, 141,
378 174, 139, 174, 0, 174, 122, 174, 0, 174, 123,
379 174, 0, 174, 125, 174, 0, 174, 124, 174, 0,
380 174, 126, 174, 0, 174, 127, 174, 0, 174, 10,
381 174, 0, 174, 11, 174, 0, 128, 174, 0, 124,
382 174, 0, 126, 174, 0, 133, 211, 134, 174, 0,
383 98, 133, 211, 134, 0, 133, 174, 134, 0, 176,
384 0, 175, 120, 176, 0, 174, 0, 49, 32, 211,
385 184, 0, 0, 178, 179, 0, 180, 132, 0, 160,
386 213, 132, 0, 161, 132, 0, 132, 0, 160, 211,
387 207, 158, 0, 160, 211, 164, 207, 133, 154, 134,
388 0, 0, 184, 0, 0, 3, 0, 4, 0, 3,
389 0, 4, 0, 60, 0, 94, 0, 115, 0, 22,
390 0, 117, 0, 187, 0, 96, 187, 0, 111, 187,
391 0, 50, 0, 42, 0, 20, 0, 47, 0, 52,
392 0, 0, 70, 0, 70, 0, 99, 186, 0, 95,
393 186, 0, 76, 186, 0, 59, 186, 0, 71, 0,
394 28, 0, 29, 3, 0, 29, 4, 0, 161, 188,
395 0, 189, 135, 191, 136, 0, 0, 191, 192, 0,
396 160, 202, 0, 40, 3, 0, 40, 4, 0, 161,
397 193, 0, 86, 139, 0, 195, 180, 132, 0, 77,
398 139, 0, 196, 181, 132, 0, 194, 135, 195, 196,
399 136, 0, 0, 139, 4, 0, 72, 3, 0, 72,
400 4, 0, 161, 199, 0, 200, 198, 135, 146, 136,
401 0, 200, 139, 3, 135, 150, 146, 136, 0, 197,
402 0, 199, 132, 0, 193, 132, 0, 78, 3, 0,
403 78, 4, 0, 161, 203, 0, 204, 135, 146, 136,
404 0, 126, 207, 0, 32, 206, 0, 184, 0, 206,
405 0, 133, 207, 134, 0, 207, 0, 208, 120, 207,
406 0, 92, 0, 110, 0, 103, 183, 135, 178, 136,
407 0, 116, 0, 4, 0, 185, 0, 32, 211, 0,
408 171, 0, 46, 3, 0, 210, 0, 103, 3, 0,
409 213, 0, 109, 3, 0, 108, 160, 211, 208, 0,
410 109, 183, 135, 178, 136, 0, 109, 183, 104, 133,
411 180, 134, 182, 135, 165, 136, 0, 5, 0, 5,
418 static const short yyrline
[] = { 0,
419 229, 232, 233, 234, 235, 236, 237, 238, 241, 242,
420 243, 244, 245, 246, 249, 250, 251, 254, 255, 256,
421 257, 258, 259, 260, 261, 262, 265, 267, 270, 273,
422 275, 277, 280, 281, 284, 287, 288, 289, 293, 297,
423 300, 306, 313, 314, 315, 318, 319, 320, 323, 324,
424 327, 331, 332, 333, 336, 338, 339, 340, 341, 342,
425 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
426 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
427 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
428 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
429 383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
430 393, 394, 397, 398, 401, 402, 407, 411, 417, 424,
431 425, 426, 429, 430, 436, 441, 447, 455, 456, 469,
432 470, 473, 474, 475, 476, 477, 478, 479, 480, 481,
433 482, 483, 484, 485, 486, 487, 488, 489, 490, 493,
434 494, 497, 503, 508, 509, 514, 515, 516, 517, 520,
435 523, 534, 535, 538, 539, 540, 543, 545, 546, 547,
436 548, 551, 552, 553, 554, 555, 567, 568, 569, 570,
437 571, 574, 575, 578, 579, 580, 581, 582, 583, 584,
438 587, 588, 591, 597, 602, 603, 606, 610, 611, 614,
439 626, 627, 630, 631, 634, 649, 650, 653, 654, 657,
440 665, 673, 680, 683, 685, 688, 689, 692, 697, 703,
441 704, 707, 708, 709, 712, 714, 717, 719, 722, 732,
442 733, 734, 735, 736, 737, 738, 739, 740, 741, 744,
448 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
450 static const char * const yytname
[] = { "$","error","$undefined.","aIDENTIFIER",
451 "aKNOWNTYPE","aNUM","aHEXNUM","aSTRING","aUUID","aEOF","SHL","SHR","tAGGREGATABLE",
452 "tALLOCATE","tAPPOBJECT","tARRAYS","tASYNC","tASYNCUUID","tAUTOHANDLE","tBINDABLE",
453 "tBOOLEAN","tBROADCAST","tBYTE","tBYTECOUNT","tCALLAS","tCALLBACK","tCASE","tCDECL",
454 "tCHAR","tCOCLASS","tCODE","tCOMMSTATUS","tCONST","tCONTEXTHANDLE","tCONTEXTHANDLENOSERIALIZE",
455 "tCONTEXTHANDLESERIALIZE","tCONTROL","tCPPQUOTE","tDEFAULT","tDEFAULTVALUE",
456 "tDISPINTERFACE","tDLLNAME","tDOUBLE","tDUAL","tENDPOINT","tENTRY","tENUM","tERRORSTATUST",
457 "tEXPLICITHANDLE","tEXTERN","tFLOAT","tHANDLE","tHANDLET","tHELPCONTEXT","tHELPFILE",
458 "tHELPSTRING","tHELPSTRINGCONTEXT","tHELPSTRINGDLL","tHIDDEN","tHYPER","tID",
459 "tIDEMPOTENT","tIIDIS","tIMPLICITHANDLE","tIMPORT","tIMPORTLIB","tIN","tINCLUDE",
460 "tINLINE","tINPUTSYNC","tINT","tINT64","tINTERFACE","tLENGTHIS","tLIBRARY","tLOCAL",
461 "tLONG","tMETHODS","tMODULE","tNONCREATABLE","tOBJECT","tODL","tOLEAUTOMATION",
462 "tOPTIONAL","tOUT","tPOINTERDEFAULT","tPROPERTIES","tPROPGET","tPROPPUT","tPROPPUTREF",
463 "tPUBLIC","tREADONLY","tREF","tRESTRICTED","tRETVAL","tSHORT","tSIGNED","tSIZEIS",
464 "tSIZEOF","tSMALL","tSOURCE","tSTDCALL","tSTRING","tSTRUCT","tSWITCH","tSWITCHIS",
465 "tSWITCHTYPE","tTRANSMITAS","tTYPEDEF","tUNION","tUNIQUE","tUNSIGNED","tUUID",
466 "tV1ENUM","tVARARG","tVERSION","tVOID","tWCHAR","tWIREMARSHAL","tPOINTERTYPE",
467 "','","COND","'|'","'&'","'-'","'+'","'*'","'/'","'~'","CAST","PPTR","NEG","';'",
468 "'('","')'","'{'","'}'","'['","']'","':'","'='","'?'","'.'","input","gbl_statements",
469 "imp_statements","int_statements","statement","cppquote","import_start","import",
470 "libraryhdr","library_start","librarydef","m_args","no_args","args","arg","array",
471 "array_list","m_attributes","attributes","attrib_list","attribute","callconv",
472 "cases","case","constdef","enums","enum_list","enum","enumdef","m_exprs","m_expr",
473 "expr","expr_list_const","expr_const","externdef","fields","field","s_field",
474 "funcdef","m_ident","t_ident","ident","base_type","m_int","int_std","coclass",
475 "coclasshdr","coclassdef","coclass_ints","coclass_int","dispinterface","dispinterfacehdr",
476 "dispint_props","dispint_meths","dispinterfacedef","inherit","interface","interfacehdr",
477 "interfacedef","interfacedec","module","modulehdr","moduledef","p_ident","pident",
478 "pident_list","pointer_type","structdef","type","typedef","uniondef","version", NULL
482 static const short yyr1
[] = { 0,
483 143, 144, 144, 144, 144, 144, 144, 144, 145, 145,
484 145, 145, 145, 145, 146, 146, 146, 147, 147, 147,
485 147, 147, 147, 147, 147, 147, 148, 149, 150, 151,
486 152, 153, 154, 154, 155, 156, 156, 156, 157, 157,
487 157, 157, 158, 158, 158, 159, 159, 159, 160, 160,
488 161, 162, 162, 162, 163, 163, 163, 163, 163, 163,
489 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
490 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
491 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
492 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
493 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
494 163, 163, 164, 164, 165, 165, 166, 166, 167, 168,
495 168, 168, 169, 169, 170, 170, 171, 172, 172, 173,
496 173, 174, 174, 174, 174, 174, 174, 174, 174, 174,
497 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
498 175, 176, 177, 178, 178, 179, 179, 179, 179, 180,
499 181, 182, 182, 183, 183, 183, 184, 184, 184, 184,
500 184, 185, 185, 185, 185, 185, 185, 185, 185, 185,
501 185, 186, 186, 187, 187, 187, 187, 187, 187, 187,
502 188, 188, 189, 190, 191, 191, 192, 193, 193, 194,
503 195, 195, 196, 196, 197, 198, 198, 199, 199, 200,
504 201, 201, 201, 202, 202, 203, 203, 204, 205, 206,
505 206, 207, 207, 207, 208, 208, 209, 209, 210, 211,
506 211, 211, 211, 211, 211, 211, 211, 211, 211, 212,
510 static const short yyr2
[] = { 0,
511 1, 0, 2, 2, 2, 2, 2, 2, 0, 2,
512 2, 2, 2, 2, 0, 3, 2, 1, 2, 1,
513 2, 2, 1, 2, 2, 2, 4, 3, 3, 2,
514 3, 3, 0, 1, 1, 1, 3, 1, 4, 3,
515 6, 5, 0, 3, 3, 1, 3, 4, 0, 1,
516 3, 1, 3, 4, 1, 1, 4, 4, 1, 1,
517 1, 1, 1, 4, 4, 4, 1, 4, 4, 4,
518 1, 1, 4, 4, 4, 4, 4, 1, 4, 1,
519 4, 5, 1, 1, 4, 1, 1, 1, 1, 1,
520 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
521 4, 1, 1, 4, 4, 4, 4, 1, 1, 4,
522 4, 1, 0, 1, 0, 2, 4, 3, 5, 0,
523 2, 1, 1, 3, 3, 1, 5, 1, 3, 0,
524 1, 1, 1, 1, 5, 3, 3, 3, 3, 3,
525 3, 3, 3, 2, 2, 2, 4, 4, 3, 1,
526 3, 1, 4, 0, 2, 2, 3, 2, 1, 4,
527 7, 0, 1, 0, 1, 1, 1, 1, 1, 1,
528 1, 1, 1, 1, 2, 2, 1, 1, 1, 1,
529 1, 0, 1, 1, 2, 2, 2, 2, 1, 1,
530 2, 2, 2, 4, 0, 2, 2, 2, 2, 2,
531 2, 3, 2, 3, 5, 0, 2, 2, 2, 2,
532 5, 7, 1, 2, 2, 2, 2, 2, 4, 2,
533 2, 1, 1, 3, 1, 3, 1, 1, 5, 1,
534 1, 1, 2, 1, 2, 1, 2, 1, 2, 4,
538 static const short yydefact
[] = { 2,
539 1, 0, 0, 0, 164, 0, 0, 0, 164, 49,
540 164, 18, 0, 8, 20, 9, 23, 9, 7, 0,
541 0, 0, 0, 0, 5, 0, 0, 213, 0, 206,
542 4, 3, 0, 6, 0, 0, 0, 231, 179, 172,
543 190, 0, 178, 164, 180, 177, 181, 182, 184, 189,
544 182, 182, 0, 182, 164, 164, 0, 230, 173, 234,
545 232, 174, 236, 0, 238, 0, 198, 199, 165, 166,
546 0, 0, 0, 208, 209, 0, 0, 50, 0, 55,
547 56, 0, 0, 59, 60, 61, 62, 63, 0, 0,
548 67, 0, 0, 71, 72, 0, 0, 0, 0, 0,
549 78, 0, 80, 0, 0, 83, 84, 0, 86, 87,
550 88, 89, 90, 91, 92, 0, 94, 95, 96, 97,
551 98, 227, 99, 100, 0, 102, 103, 0, 0, 0,
552 228, 0, 108, 109, 0, 0, 0, 52, 112, 0,
553 0, 0, 0, 0, 0, 193, 200, 210, 218, 19,
554 21, 22, 195, 215, 0, 214, 0, 0, 15, 24,
555 25, 26, 233, 235, 183, 188, 187, 186, 175, 185,
556 237, 239, 176, 167, 168, 169, 170, 171, 0, 0,
557 120, 0, 28, 154, 0, 0, 154, 0, 0, 0,
558 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
559 0, 130, 0, 130, 0, 0, 0, 0, 0, 0,
560 0, 51, 29, 14, 0, 12, 11, 10, 13, 32,
561 191, 192, 30, 216, 217, 31, 49, 0, 49, 0,
562 207, 15, 49, 0, 27, 0, 122, 123, 126, 153,
563 49, 0, 0, 0, 222, 223, 225, 240, 49, 49,
564 0, 134, 132, 133, 0, 0, 0, 0, 0, 152,
565 0, 150, 0, 0, 0, 0, 0, 0, 0, 0,
566 0, 0, 0, 0, 0, 0, 0, 128, 131, 0,
567 0, 0, 0, 0, 0, 243, 0, 0, 53, 0,
568 194, 0, 196, 201, 0, 0, 0, 49, 0, 49,
569 219, 17, 0, 0, 119, 127, 121, 0, 159, 229,
570 0, 50, 155, 0, 221, 220, 0, 0, 0, 241,
571 57, 0, 145, 146, 144, 0, 0, 0, 0, 0,
572 0, 0, 0, 0, 0, 0, 0, 58, 65, 64,
573 66, 68, 69, 70, 73, 74, 75, 76, 77, 79,
574 81, 0, 130, 85, 93, 101, 104, 105, 106, 107,
575 0, 110, 111, 54, 197, 203, 0, 202, 205, 0,
576 15, 211, 113, 16, 124, 125, 238, 158, 156, 224,
577 226, 162, 0, 149, 0, 142, 143, 136, 137, 139,
578 138, 140, 141, 0, 151, 82, 129, 244, 43, 204,
579 49, 114, 0, 157, 0, 163, 148, 147, 0, 130,
580 160, 212, 0, 115, 135, 0, 0, 46, 33, 0,
581 45, 0, 44, 230, 0, 38, 34, 36, 0, 0,
582 0, 0, 242, 116, 47, 0, 161, 0, 0, 43,
583 0, 49, 48, 37, 43, 33, 40, 49, 118, 33,
584 39, 0, 117, 0, 42, 41, 0, 0, 0
587 static const short yydefgoto
[] = { 457,
588 1, 140, 233, 302, 15, 16, 17, 145, 18, 19,
589 425, 426, 427, 428, 411, 417, 303, 78, 137, 138,
590 403, 420, 434, 21, 236, 237, 238, 60, 277, 278,
591 260, 261, 262, 23, 241, 313, 314, 304, 405, 71,
592 245, 61, 166, 62, 146, 24, 216, 227, 293, 26,
593 27, 229, 298, 28, 158, 29, 30, 217, 218, 149,
594 33, 219, 246, 247, 248, 139, 63, 430, 36, 65,
598 static const short yypact
[] = {-32768,
599 609, 598, -98, 138, 144, 22, 30, 172, 144, -61,
600 144,-32768, 791,-32768,-32768,-32768,-32768,-32768,-32768, 35,
601 -49, -42, -32, -14,-32768, -24, -5,-32768, 32, -3,
602 -32768,-32768, 44,-32768, 49, 59, 68,-32768,-32768,-32768,
603 -32768, 598,-32768, 185,-32768,-32768,-32768, 63,-32768,-32768,
604 63, 63, 27, 63, 220, 260, 27,-32768,-32768,-32768,
605 -32768,-32768,-32768, 17,-32768, 176,-32768,-32768,-32768,-32768,
606 69, 598, 74,-32768,-32768, 85, 598,-32768, -73,-32768,
607 -32768, 53, 76,-32768,-32768,-32768,-32768,-32768, 102, 106,
608 -32768, 115, 118,-32768,-32768, 121, 124, 134, 136, 148,
609 -32768, 157,-32768, 158, 159,-32768,-32768, 160,-32768,-32768,
610 -32768,-32768,-32768,-32768,-32768, 161,-32768,-32768,-32768,-32768,
611 -32768,-32768,-32768,-32768, 162,-32768,-32768, 165, 169, 178,
612 -32768, 180,-32768,-32768, 182, 183, -87,-32768,-32768, 505,
613 587, 271, 234, 275, 174,-32768,-32768,-32768,-32768,-32768,
614 -32768,-32768,-32768,-32768, 231,-32768, 280, 186,-32768,-32768,
615 -32768,-32768,-32768, 187,-32768,-32768,-32768,-32768,-32768,-32768,
616 187, -72,-32768,-32768,-32768,-32768,-32768,-32768, 184, 194,
617 17, 17,-32768,-32768, 267, 197,-32768, 17, 389, 329,
618 311, 313, 337, 389, 324, 330, 389, 331, 389, 17,
619 293, 389, -58, 389, 389, 598, 598, 340, 344, 598,
620 791, 213,-32768,-32768, 51,-32768,-32768,-32768,-32768,-32768,
621 -32768,-32768,-32768,-32768,-32768,-32768, 149, 212, -50, 217,
622 -32768,-32768, 634, 389,-32768, 218, 233,-32768, 215,-32768,
623 -20, -6, 267, 267,-32768,-32768,-32768, 236, -61, 129,
624 223,-32768,-32768,-32768, 225, 389, 389, 389, 477, 104,
625 -90,-32768, 226, 232, 239, 240, 242, 244, 246, 247,
626 250, 251, 254, 255, 256, 361, -64,-32768, 104, 257,
627 -62, 71, 262, 264, 265, 237, 269, 274,-32768, 791,
628 -32768, -11,-32768,-32768, 270, 598, 278, 151, 301, 676,
629 -32768,-32768, 598, 281,-32768,-32768, 17, 389,-32768,-32768,
630 598, 283,-32768, 284,-32768,-32768, 294, 267, 295,-32768,
631 -32768, 598, 276, 276, 276, 91, 298, 389, 389, 389,
632 389, 389, 389, 389, 389, 389, 389,-32768,-32768,-32768,
633 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
634 -32768, 299, 389,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
635 407,-32768,-32768,-32768,-32768,-32768, 267,-32768,-32768, 307,
636 -32768,-32768, 341,-32768,-32768,-32768, 312,-32768,-32768,-32768,
637 -32768, 17, 309,-32768, 389, 276, 276, 245, 36, 58,
638 58, 12, 12, 297,-32768,-32768,-32768,-32768, 315,-32768,
639 684,-32768, 267,-32768, 321,-32768,-32768, 276, 389, 483,
640 -32768,-32768, 326,-32768, 104, 54, -71,-32768, 230, -2,
641 -32768, 389, 323, -55, 314,-32768, 347,-32768, 598, 267,
642 389, 334,-32768,-32768, 104, 389,-32768, 355, 267, -45,
643 352, -66, 104,-32768, -27, 230,-32768, -66,-32768, 230,
644 -32768, 335,-32768, 350,-32768,-32768, 446, 468,-32768
647 static const short yypgoto
[] = {-32768,
648 -32768, 467, -222, 18,-32768,-32768, 191,-32768,-32768,-32768,
649 -322,-32768,-32768, 56, -395,-32768, -8, -1,-32768, -186,
650 -32768,-32768,-32768,-32768,-32768,-32768, 188, 5, 292, -336,
651 -163,-32768, -181,-32768, 316, -343, -201, 200,-32768, 29,
652 -63,-32768, 103, 78,-32768,-32768, 499,-32768,-32768, -13,
653 -32768,-32768,-32768,-32768,-32768, -12,-32768, 500, 4,-32768,
654 -32768, 501, 266, -229,-32768, 303, 10, 1,-32768, 3,
662 static const short yytable
[] = { 20,
663 179, 77, 64, 37, 32, 22, 147, 148, 264, 300,
664 35, 268, 269, 316, 317, 272, 397, 274, 14, 174,
665 175, 328, 329, 431, 289, 242, 295, 297, 4, 337,
666 186, -165, 211, 122, 66, 432, 73, 76, 279, 79,
667 279, 282, 163, 338, 447, 328, 329, 319, 422, 451,
668 212, 131, 305, 72, 41, 353, 252, 353, 253, 254,
669 8, 187, -165, 142, -35, 309, 423, 328, 329, 354,
670 13, 356, 182, 418, 4, 13, 176, 185, -35, 142,
671 328, 329, 150, 76, 79, 48, 13, 446, 381, 151,
672 4, 410, 323, 324, 325, 326, 49, 50, 449, 152,
673 328, 329, 51, 364, 453, 450, 8, 154, 143, 410,
674 177, 309, 144, 328, 329, 310, 13, 239, 240, 243,
675 153, 52, 8, 452, 251, 54, 376, 454, 144, 155,
676 169, 178, 165, 433, 173, 157, 275, 399, 215, 215,
677 67, 68, 37, 37, 22, 22, 69, 70, 401, 35,
678 35, 255, 336, 167, 168, 395, 170, 214, 214, 332,
679 333, 334, 335, 156, 386, 387, 388, 389, 390, 391,
680 392, 393, 394, 413, 74, 75, 336, 256, 159, 257,
681 160, 258, 180, 334, 335, 188, 259, 164, 70, 279,
682 161, 421, 330, 331, 332, 333, 334, 335, 336, 162,
683 440, 147, 148, 181, 357, 183, 283, 284, 189, 445,
684 288, 336, 330, 331, 332, 333, 334, 335, 292, 184,
685 296, 408, 171, 70, 384, 330, 331, 332, 333, 334,
686 335, 336, 311, 38, 190, 37, 223, 22, 191, 312,
687 296, 311, 35, 239, 336, 415, 279, 192, 312, 39,
688 193, 40, 324, 194, 328, 329, 195, 41, 435, 327,
689 309, 42, 172, 70, 320, 13, 196, 441, 197, 174,
690 175, 43, 443, 221, 222, 44, 45, 224, 225, 46,
691 198, 47, 230, 231, 291, 13, 369, 13, 48, 199,
692 200, 201, 202, 203, 204, 365, 367, 205, 242, 49,
693 50, 206, 37, 373, 22, 51, 328, 329, 226, 35,
694 207, 367, 208, 377, 209, 210, 228, 265, 406, 266,
695 232, -165, 383, 234, 52, 53, 176, 235, 54, 249,
696 270, 252, 55, 253, 254, 263, 271, 273, 56, 252,
697 57, 253, 254, 267, 276, 424, 59, 285, 286, 290,
698 294, 299, 307, 306, 308, 318, 321, 322, 38, 339,
699 177, 328, 329, 352, 7, 340, 13, 331, 332, 333,
700 334, 335, 341, 342, 39, 343, 40, 344, 361, 345,
701 346, 178, 41, 347, 348, 336, 42, 349, 350, 351,
702 355, 252, 243, 253, 254, 358, 43, 359, 360, 244,
703 44, 45, 362, 37, 46, 22, 47, 363, 366, 368,
704 35, 398, 374, 48, 378, 379, 336, 429, 330, 331,
705 332, 333, 334, 335, 49, 50, 255, 380, 382, 439,
706 51, 385, 396, 311, 255, 409, 429, 336, 400, 311,
707 312, 402, 407, 404, 429, 458, 312, 437, 429, 52,
708 53, 410, 256, 54, 257, 414, 258, 55, 419, 436,
709 256, 259, 257, 56, 258, 57, 438, 459, 455, 259,
710 58, 59, 442, 330, 331, 332, 333, 334, 335, 252,
711 38, 253, 254, 456, 141, 252, 255, 253, 254, 371,
712 448, 13, 336, 444, 375, 281, 39, 370, 40, 25,
713 31, 34, 250, 0, 41, 280, 0, 315, 42, 0,
714 0, 0, 256, 213, 257, 0, 258, 0, 43, 0,
715 0, 259, 44, 45, 0, 0, 46, 0, 47, 0,
716 0, 0, 0, 0, 0, 48, 2, 0, 0, 0,
717 0, 3, 0, 0, 4, 0, 49, 50, 0, 0,
718 5, 0, 51, 6, 0, 0, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
720 0, 52, 53, 0, 255, 54, 8, 0, 0, 55,
721 255, 0, 0, 0, 0, 56, 0, 57, 0, 0,
722 0, 0, 58, 59, 0, 0, 0, 0, 0, 0,
723 256, 38, 257, 0, 258, 0, 256, 9, 416, 259,
724 258, 0, 10, 11, 0, 259, 0, 39, 2, 40,
725 0, 0, 0, 3, 0, 41, 4, 0, 0, 42,
726 0, 0, 5, 0, 0, 6, 12, 0, 0, 43,
727 2, 13, 0, 44, 45, 3, 0, 46, 4, 47,
728 7, 0, 0, 0, 5, 0, 48, 6, 8, 0,
729 0, 0, 0, 0, 0, 2, 0, 49, 50, 0,
730 3, 0, 7, 51, 0, 0, 0, 0, 0, 5,
731 8, 0, 6, 0, 0, 0, 0, 0, 0, 9,
732 0, 0, 52, 53, 10, 11, 54, 7, 0, 0,
733 55, 0, 0, 0, 0, 0, 56, 2, 57, 0,
734 0, 9, 3, 58, 59, 2, 10, 11, 12, 0,
735 3, 5, 220, 13, 6, 0, 0, 0, 0, 5,
736 0, 0, 6, 0, 0, 0, 9, 0, 0, 7,
737 12, 10, 11, 0, 0, 13, 0, 7, 0, 0,
738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
739 0, 0, 0, 0, 0, 12, 0, 0, 0, 301,
740 13, 0, 0, 0, 0, 0, 0, 0, 9, 0,
741 0, 0, 0, 10, 11, 0, 9, 0, 0, 0,
742 0, 10, 11, 0, 0, 0, 0, 0, 0, 0,
743 0, 0, 0, 0, 0, 0, 80, 12, 81, 0,
744 0, 372, 13, 0, 82, 12, 83, 0, 0, 412,
745 13, 0, 0, 84, 85, 86, 87, 0, 88, 89,
746 0, 90, 0, 91, 92, 93, 0, 0, 94, 0,
747 0, 95, 0, 96, 97, 98, 99, 100, 101, 0,
748 102, 103, 104, 105, 0, 0, 106, 0, 0, 107,
749 0, 0, 0, 108, 0, 109, 0, 0, 0, 110,
750 111, 112, 113, 114, 115, 116, 0, 117, 118, 119,
751 120, 121, 122, 123, 124, 0, 0, 125, 0, 0,
752 126, 0, 127, 0, 0, 128, 129, 130, 0, 0,
753 131, 0, 132, 133, 134, 135, 0, 0, 136
756 static const short yycheck
[] = { 1,
757 64, 10, 2, 1, 1, 1, 20, 20, 190, 232,
758 1, 193, 194, 243, 244, 197, 353, 199, 1, 3,
759 4, 10, 11, 26, 211, 32, 77, 229, 40, 120,
760 104, 104, 120, 92, 133, 38, 7, 9, 202, 11,
761 204, 205, 42, 134, 440, 10, 11, 249, 120, 445,
762 138, 110, 234, 32, 28, 120, 3, 120, 5, 6,
763 72, 135, 135, 29, 120, 132, 138, 10, 11, 134,
764 137, 134, 72, 410, 40, 137, 60, 77, 134, 29,
765 10, 11, 132, 55, 56, 59, 137, 133, 318, 132,
766 40, 137, 256, 257, 258, 259, 70, 71, 442, 132,
767 10, 11, 76, 290, 448, 133, 72, 132, 74, 137,
768 94, 132, 78, 10, 11, 136, 137, 181, 182, 126,
769 135, 95, 72, 446, 188, 99, 308, 450, 78, 135,
770 53, 115, 70, 136, 57, 139, 200, 367, 140, 141,
771 3, 4, 140, 141, 140, 141, 3, 4, 371, 140,
772 141, 98, 141, 51, 52, 337, 54, 140, 141, 124,
773 125, 126, 127, 132, 328, 329, 330, 331, 332, 333,
774 334, 335, 336, 403, 3, 4, 141, 124, 135, 126,
775 132, 128, 7, 126, 127, 133, 133, 3, 4, 353,
776 132, 138, 122, 123, 124, 125, 126, 127, 141, 132,
777 430, 215, 215, 135, 134, 132, 206, 207, 133, 439,
778 210, 141, 122, 123, 124, 125, 126, 127, 227, 135,
779 229, 385, 3, 4, 134, 122, 123, 124, 125, 126,
780 127, 141, 241, 4, 133, 233, 3, 233, 133, 241,
781 249, 250, 233, 307, 141, 409, 410, 133, 250, 20,
782 133, 22, 416, 133, 10, 11, 133, 28, 422, 259,
783 132, 32, 3, 4, 136, 137, 133, 431, 133, 3,
784 4, 42, 436, 3, 4, 46, 47, 3, 4, 50,
785 133, 52, 3, 4, 136, 137, 136, 137, 59, 133,
786 133, 133, 133, 133, 133, 292, 296, 133, 32, 70,
787 71, 133, 300, 303, 300, 76, 10, 11, 135, 300,
788 133, 311, 133, 311, 133, 133, 86, 7, 382, 7,
789 135, 135, 322, 140, 95, 96, 60, 134, 99, 133,
790 7, 3, 103, 5, 6, 7, 7, 7, 109, 3,
791 111, 5, 6, 7, 52, 116, 117, 8, 5, 137,
792 139, 135, 120, 136, 140, 120, 134, 133, 4, 134,
793 94, 10, 11, 3, 64, 134, 137, 123, 124, 125,
794 126, 127, 134, 134, 20, 134, 22, 134, 142, 134,
795 134, 115, 28, 134, 134, 141, 32, 134, 134, 134,
796 134, 3, 126, 5, 6, 134, 42, 134, 134, 133,
797 46, 47, 134, 401, 50, 401, 52, 134, 139, 132,
798 401, 5, 132, 59, 132, 132, 141, 419, 122, 123,
799 124, 125, 126, 127, 70, 71, 98, 134, 134, 429,
800 76, 134, 134, 442, 98, 139, 438, 141, 132, 448,
801 442, 101, 134, 132, 446, 0, 448, 134, 450, 95,
802 96, 137, 124, 99, 126, 135, 128, 103, 133, 137,
803 124, 133, 126, 109, 128, 111, 120, 0, 134, 133,
804 116, 117, 139, 122, 123, 124, 125, 126, 127, 3,
805 4, 5, 6, 134, 18, 3, 98, 5, 6, 299,
806 139, 137, 141, 438, 307, 204, 20, 298, 22, 1,
807 1, 1, 187, -1, 28, 203, -1, 242, 32, -1,
808 -1, -1, 124, 9, 126, -1, 128, -1, 42, -1,
809 -1, 133, 46, 47, -1, -1, 50, -1, 52, -1,
810 -1, -1, -1, -1, -1, 59, 32, -1, -1, -1,
811 -1, 37, -1, -1, 40, -1, 70, 71, -1, -1,
812 46, -1, 76, 49, -1, -1, -1, -1, -1, -1,
813 -1, -1, -1, -1, -1, -1, -1, -1, 64, -1,
814 -1, 95, 96, -1, 98, 99, 72, -1, -1, 103,
815 98, -1, -1, -1, -1, 109, -1, 111, -1, -1,
816 -1, -1, 116, 117, -1, -1, -1, -1, -1, -1,
817 124, 4, 126, -1, 128, -1, 124, 103, 126, 133,
818 128, -1, 108, 109, -1, 133, -1, 20, 32, 22,
819 -1, -1, -1, 37, -1, 28, 40, -1, -1, 32,
820 -1, -1, 46, -1, -1, 49, 132, -1, -1, 42,
821 32, 137, -1, 46, 47, 37, -1, 50, 40, 52,
822 64, -1, -1, -1, 46, -1, 59, 49, 72, -1,
823 -1, -1, -1, -1, -1, 32, -1, 70, 71, -1,
824 37, -1, 64, 76, -1, -1, -1, -1, -1, 46,
825 72, -1, 49, -1, -1, -1, -1, -1, -1, 103,
826 -1, -1, 95, 96, 108, 109, 99, 64, -1, -1,
827 103, -1, -1, -1, -1, -1, 109, 32, 111, -1,
828 -1, 103, 37, 116, 117, 32, 108, 109, 132, -1,
829 37, 46, 136, 137, 49, -1, -1, -1, -1, 46,
830 -1, -1, 49, -1, -1, -1, 103, -1, -1, 64,
831 132, 108, 109, -1, -1, 137, -1, 64, -1, -1,
832 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
833 -1, -1, -1, -1, -1, 132, -1, -1, -1, 136,
834 137, -1, -1, -1, -1, -1, -1, -1, 103, -1,
835 -1, -1, -1, 108, 109, -1, 103, -1, -1, -1,
836 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
837 -1, -1, -1, -1, -1, -1, 16, 132, 18, -1,
838 -1, 136, 137, -1, 24, 132, 26, -1, -1, 136,
839 137, -1, -1, 33, 34, 35, 36, -1, 38, 39,
840 -1, 41, -1, 43, 44, 45, -1, -1, 48, -1,
841 -1, 51, -1, 53, 54, 55, 56, 57, 58, -1,
842 60, 61, 62, 63, -1, -1, 66, -1, -1, 69,
843 -1, -1, -1, 73, -1, 75, -1, -1, -1, 79,
844 80, 81, 82, 83, 84, 85, -1, 87, 88, 89,
845 90, 91, 92, 93, 94, -1, -1, 97, -1, -1,
846 100, -1, 102, -1, -1, 105, 106, 107, -1, -1,
847 110, -1, 112, 113, 114, 115, -1, -1, 118
849 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
850 #line 3 "/usr/share/bison.simple"
851 /* This file comes from bison-1.28. */
853 /* Skeleton output parser for bison,
854 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
856 This program is free software; you can redistribute it and/or modify
857 it under the terms of the GNU General Public License as published by
858 the Free Software Foundation; either version 2, or (at your option)
861 This program is distributed in the hope that it will be useful,
862 but WITHOUT ANY WARRANTY; without even the implied warranty of
863 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
864 GNU General Public License for more details.
866 You should have received a copy of the GNU General Public License
867 along with this program; if not, write to the Free Software
868 Foundation, Inc., 59 Temple Place - Suite 330,
869 Boston, MA 02111-1307, USA. */
871 /* As a special exception, when this file is copied by Bison into a
872 Bison output file, you may use that output file without restriction.
873 This special exception was added by the Free Software Foundation
874 in version 1.24 of Bison. */
876 /* This is the parser code that is written into each bison parser
877 when the %semantic_parser declaration is not specified in the grammar.
878 It was written by Richard Stallman by simplifying the hairy parser
879 used when %semantic_parser is specified. */
881 #ifndef YYSTACK_USE_ALLOCA
883 #define YYSTACK_USE_ALLOCA
884 #else /* alloca not defined */
886 #define YYSTACK_USE_ALLOCA
887 #define alloca __builtin_alloca
888 #else /* not GNU C. */
889 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
890 #define YYSTACK_USE_ALLOCA
892 #else /* not sparc */
893 /* We think this test detects Watcom and Microsoft C. */
894 /* This used to test MSDOS, but that is a bad idea
895 since that symbol is in the user namespace. */
896 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
897 #if 0 /* No need for malloc.h, which pollutes the namespace;
898 instead, just don't use alloca. */
901 #else /* not MSDOS, or __TURBOC__ */
903 /* I don't know what this was needed for, but it pollutes the namespace.
904 So I turned it off. rms, 2 May 1997. */
905 /* #include <malloc.h> */
907 #define YYSTACK_USE_ALLOCA
908 #else /* not MSDOS, or __TURBOC__, or _AIX */
910 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
911 and on HPUX 10. Eventually we can turn this on. */
912 #define YYSTACK_USE_ALLOCA
913 #define alloca __builtin_alloca
916 #endif /* not _AIX */
917 #endif /* not MSDOS, or __TURBOC__ */
918 #endif /* not sparc */
919 #endif /* not GNU C */
920 #endif /* alloca not defined */
921 #endif /* YYSTACK_USE_ALLOCA not defined */
923 #ifdef YYSTACK_USE_ALLOCA
924 #define YYSTACK_ALLOC alloca
926 #define YYSTACK_ALLOC malloc
929 /* Note: there must be only one dollar sign in this file.
930 It is replaced by the list of actions, each action
931 as one case of the switch. */
933 #define yyerrok (yyerrstatus = 0)
934 #define yyclearin (yychar = YYEMPTY)
937 #define YYACCEPT goto yyacceptlab
938 #define YYABORT goto yyabortlab
939 #define YYERROR goto yyerrlab1
940 /* Like YYERROR except do call yyerror.
941 This remains here temporarily to ease the
942 transition to the new meaning of YYERROR, for GCC.
943 Once GCC version 2 has supplanted version 1, this can go. */
944 #define YYFAIL goto yyerrlab
945 #define YYRECOVERING() (!!yyerrstatus)
946 #define YYBACKUP(token, value) \
948 if (yychar == YYEMPTY && yylen == 1) \
949 { yychar = (token), yylval = (value); \
950 yychar1 = YYTRANSLATE (yychar); \
955 { yyerror ("syntax error: cannot back up"); YYERROR; } \
959 #define YYERRCODE 256
962 #define YYLEX yylex()
968 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
970 #define YYLEX yylex(&yylval, &yylloc)
972 #else /* not YYLSP_NEEDED */
974 #define YYLEX yylex(&yylval, YYLEX_PARAM)
976 #define YYLEX yylex(&yylval)
978 #endif /* not YYLSP_NEEDED */
981 /* If nonreentrant, generate the variables here */
985 int yychar
; /* the lookahead symbol */
986 YYSTYPE yylval
; /* the semantic value of the */
987 /* lookahead symbol */
990 YYLTYPE yylloc
; /* location data for the lookahead */
994 int yynerrs
; /* number of parse errors so far */
995 #endif /* not YYPURE */
998 int yydebug
; /* nonzero means print parse trace */
999 /* Since this is uninitialized, it does not stop multiple parsers
1003 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1006 #define YYINITDEPTH 200
1009 /* YYMAXDEPTH is the maximum size the stacks can grow to
1010 (effective only if the built-in stack extension method is used). */
1017 #define YYMAXDEPTH 10000
1020 /* Define __yy_memcpy. Note that the size argument
1021 should be passed with type unsigned int, because that is what the non-GCC
1022 definitions require. With GCC, __builtin_memcpy takes an arg
1023 of type size_t, but it can handle unsigned int. */
1025 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1026 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1027 #else /* not GNU C or C++ */
1030 /* This is the most reliable way to avoid incompatibilities
1031 in available built-in functions on various systems. */
1033 __yy_memcpy (to
, from
, count
)
1038 register char *f
= from
;
1039 register char *t
= to
;
1040 register int i
= count
;
1046 #else /* __cplusplus */
1048 /* This is the most reliable way to avoid incompatibilities
1049 in available built-in functions on various systems. */
1051 __yy_memcpy (char *to
, char *from
, unsigned int count
)
1053 register char *t
= to
;
1054 register char *f
= from
;
1055 register int i
= count
;
1064 #line 217 "/usr/share/bison.simple"
1066 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1067 into yyparse. The argument should have type void *.
1068 It should actually point to an object.
1069 Grammar actions can access the variable by casting it
1070 to the proper pointer type. */
1072 #ifdef YYPARSE_PARAM
1074 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1075 #define YYPARSE_PARAM_DECL
1076 #else /* not __cplusplus */
1077 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1078 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1079 #endif /* not __cplusplus */
1080 #else /* not YYPARSE_PARAM */
1081 #define YYPARSE_PARAM_ARG
1082 #define YYPARSE_PARAM_DECL
1083 #endif /* not YYPARSE_PARAM */
1085 /* Prevent warning if -Wstrict-prototypes. */
1087 #ifdef YYPARSE_PARAM
1088 int yyparse (void *);
1095 yyparse(YYPARSE_PARAM_ARG
)
1098 register int yystate
;
1100 register short *yyssp
;
1101 register YYSTYPE
*yyvsp
;
1102 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
1103 int yychar1
= 0; /* lookahead token as an internal (translated) token number */
1105 short yyssa
[YYINITDEPTH
]; /* the state stack */
1106 YYSTYPE yyvsa
[YYINITDEPTH
]; /* the semantic value stack */
1108 short *yyss
= yyssa
; /* refer to the stacks thru separate pointers */
1109 YYSTYPE
*yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
1112 YYLTYPE yylsa
[YYINITDEPTH
]; /* the location stack */
1113 YYLTYPE
*yyls
= yylsa
;
1116 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1118 #define YYPOPSTACK (yyvsp--, yyssp--)
1121 int yystacksize
= YYINITDEPTH
;
1122 int yyfree_stacks
= 0;
1133 YYSTYPE yyval
; /* the variable used to return */
1134 /* semantic values from the action */
1141 fprintf(stderr
, "Starting parse\n");
1147 yychar
= YYEMPTY
; /* Cause a token to be read. */
1149 /* Initialize stack pointers.
1150 Waste one element of value and location stack
1151 so that they stay on the same level as the state stack.
1152 The wasted elements are never initialized. */
1160 /* Push a new state, which is found in yystate . */
1161 /* In all cases, when you get here, the value and location stacks
1162 have just been pushed. so pushing a state here evens the stacks. */
1167 if (yyssp
>= yyss
+ yystacksize
- 1)
1169 /* Give user a chance to reallocate the stack */
1170 /* Use copies of these so that the &'s don't force the real ones into memory. */
1171 YYSTYPE
*yyvs1
= yyvs
;
1172 short *yyss1
= yyss
;
1174 YYLTYPE
*yyls1
= yyls
;
1177 /* Get the current used size of the three stacks, in elements. */
1178 int size
= yyssp
- yyss
+ 1;
1181 /* Each stack pointer address is followed by the size of
1182 the data in use in that stack, in bytes. */
1184 /* This used to be a conditional around just the two extra args,
1185 but that might be undefined if yyoverflow is a macro. */
1186 yyoverflow("parser stack overflow",
1187 &yyss1
, size
* sizeof (*yyssp
),
1188 &yyvs1
, size
* sizeof (*yyvsp
),
1189 &yyls1
, size
* sizeof (*yylsp
),
1192 yyoverflow("parser stack overflow",
1193 &yyss1
, size
* sizeof (*yyssp
),
1194 &yyvs1
, size
* sizeof (*yyvsp
),
1198 yyss
= yyss1
; yyvs
= yyvs1
;
1202 #else /* no yyoverflow */
1203 /* Extend the stack our own way. */
1204 if (yystacksize
>= YYMAXDEPTH
)
1206 yyerror("parser stack overflow");
1218 if (yystacksize
> YYMAXDEPTH
)
1219 yystacksize
= YYMAXDEPTH
;
1220 #ifndef YYSTACK_USE_ALLOCA
1223 yyss
= (short *) YYSTACK_ALLOC (yystacksize
* sizeof (*yyssp
));
1224 __yy_memcpy ((char *)yyss
, (char *)yyss1
,
1225 size
* (unsigned int) sizeof (*yyssp
));
1226 yyvs
= (YYSTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yyvsp
));
1227 __yy_memcpy ((char *)yyvs
, (char *)yyvs1
,
1228 size
* (unsigned int) sizeof (*yyvsp
));
1230 yyls
= (YYLTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yylsp
));
1231 __yy_memcpy ((char *)yyls
, (char *)yyls1
,
1232 size
* (unsigned int) sizeof (*yylsp
));
1234 #endif /* no yyoverflow */
1236 yyssp
= yyss
+ size
- 1;
1237 yyvsp
= yyvs
+ size
- 1;
1239 yylsp
= yyls
+ size
- 1;
1244 fprintf(stderr
, "Stack size increased to %d\n", yystacksize
);
1247 if (yyssp
>= yyss
+ yystacksize
- 1)
1253 fprintf(stderr
, "Entering state %d\n", yystate
);
1259 /* Do appropriate processing given the current state. */
1260 /* Read a lookahead token if we need one and don't already have one. */
1263 /* First try to decide what to do without reference to lookahead token. */
1265 yyn
= yypact
[yystate
];
1269 /* Not known => get a lookahead token if don't already have one. */
1271 /* yychar is either YYEMPTY or YYEOF
1272 or a valid token in external form. */
1274 if (yychar
== YYEMPTY
)
1278 fprintf(stderr
, "Reading a token: ");
1283 /* Convert token to internal form (in yychar1) for indexing tables with */
1285 if (yychar
<= 0) /* This means end of input. */
1288 yychar
= YYEOF
; /* Don't call YYLEX any more */
1292 fprintf(stderr
, "Now at end of input.\n");
1297 yychar1
= YYTRANSLATE(yychar
);
1302 fprintf (stderr
, "Next token is %d (%s", yychar
, yytname
[yychar1
]);
1303 /* Give the individual parser a way to print the precise meaning
1304 of a token, for further debugging info. */
1306 YYPRINT (stderr
, yychar
, yylval
);
1308 fprintf (stderr
, ")\n");
1314 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1319 /* yyn is what to do for this token type in this state.
1320 Negative => reduce, -yyn is rule number.
1321 Positive => shift, yyn is new state.
1322 New state is final state => don't bother to shift,
1323 just return success.
1324 0, or most negative number => error. */
1339 /* Shift the lookahead token. */
1343 fprintf(stderr
, "Shifting token %d (%s), ", yychar
, yytname
[yychar1
]);
1346 /* Discard the token being shifted unless it is eof. */
1347 if (yychar
!= YYEOF
)
1355 /* count tokens shifted since error; after three, turn off error status. */
1356 if (yyerrstatus
) yyerrstatus
--;
1361 /* Do the default action for the current state. */
1364 yyn
= yydefact
[yystate
];
1368 /* Do a reduction. yyn is the number of a rule to reduce with. */
1372 yyval
= yyvsp
[1-yylen
]; /* implement default value of the action */
1379 fprintf (stderr
, "Reducing via rule %d (line %d), ",
1382 /* Print the symbols being reduced, and their result. */
1383 for (i
= yyprhs
[yyn
]; yyrhs
[i
] > 0; i
++)
1384 fprintf (stderr
, "%s ", yytname
[yyrhs
[i
]]);
1385 fprintf (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1393 #line 229 "parser.y"
1394 { write_proxies(yyvsp
[0].ifref
); write_client(yyvsp
[0].ifref
); write_server(yyvsp
[0].ifref
); ;
1397 #line 232 "parser.y"
1398 { yyval
.ifref
= NULL
; ;
1401 #line 233 "parser.y"
1402 { yyval
.ifref
= yyvsp
[-1].ifref
; ;
1405 #line 234 "parser.y"
1406 { yyval
.ifref
= make_ifref(yyvsp
[0].type
); LINK(yyval
.ifref
, yyvsp
[-1].ifref
); ;
1409 #line 235 "parser.y"
1410 { yyval
.ifref
= yyvsp
[-1].ifref
; add_coclass(yyvsp
[0].clas
); ;
1413 #line 236 "parser.y"
1414 { yyval
.ifref
= yyvsp
[-1].ifref
; add_module(yyvsp
[0].type
); ;
1417 #line 237 "parser.y"
1418 { yyval
.ifref
= yyvsp
[-1].ifref
; ;
1421 #line 238 "parser.y"
1422 { yyval
.ifref
= yyvsp
[-1].ifref
; ;
1425 #line 241 "parser.y"
1429 #line 242 "parser.y"
1430 { if (!parse_only
) add_interface(yyvsp
[0].type
); ;
1433 #line 243 "parser.y"
1434 { if (!parse_only
) add_interface(yyvsp
[0].type
); ;
1437 #line 244 "parser.y"
1438 { if (!parse_only
) add_coclass(yyvsp
[0].clas
); ;
1441 #line 245 "parser.y"
1442 { if (!parse_only
) add_module(yyvsp
[0].type
); ;
1445 #line 246 "parser.y"
1449 #line 249 "parser.y"
1450 { yyval
.func
= NULL
; ;
1453 #line 250 "parser.y"
1454 { yyval
.func
= yyvsp
[-1].func
; LINK(yyval
.func
, yyvsp
[-2].func
); ;
1457 #line 251 "parser.y"
1458 { yyval
.func
= yyvsp
[-1].func
; ;
1461 #line 254 "parser.y"
1465 #line 255 "parser.y"
1466 { if (!parse_only
&& do_header
) { write_constdef(yyvsp
[-1].var
); } ;
1469 #line 256 "parser.y"
1473 #line 257 "parser.y"
1474 { if (!parse_only
&& do_header
) { write_type(header
, yyvsp
[-1].type
, NULL
, NULL
); fprintf(header
, ";\n\n"); } ;
1477 #line 258 "parser.y"
1478 { if (!parse_only
&& do_header
) { write_externdef(yyvsp
[-1].var
); } ;
1481 #line 259 "parser.y"
1485 #line 260 "parser.y"
1486 { if (!parse_only
&& do_header
) { write_type(header
, yyvsp
[-1].type
, NULL
, NULL
); fprintf(header
, ";\n\n"); } ;
1489 #line 261 "parser.y"
1493 #line 262 "parser.y"
1494 { if (!parse_only
&& do_header
) { write_type(header
, yyvsp
[-1].type
, NULL
, NULL
); fprintf(header
, ";\n\n"); } ;
1497 #line 265 "parser.y"
1498 { if (!parse_only
&& do_header
) fprintf(header
, "%s\n", yyvsp
[-1].str
); ;
1501 #line 267 "parser.y"
1502 { assert(yychar
== YYEMPTY
);
1503 if (!do_import(yyvsp
[-1].str
)) yychar
= aEOF
; ;
1506 #line 270 "parser.y"
1510 #line 273 "parser.y"
1511 { yyval
.str
= yyvsp
[0].str
; ;
1514 #line 275 "parser.y"
1515 { start_typelib(yyvsp
[-1].str
, yyvsp
[-2].attr
); ;
1518 #line 277 "parser.y"
1522 #line 280 "parser.y"
1523 { yyval
.var
= NULL
; ;
1526 #line 284 "parser.y"
1527 { yyval
.var
= NULL
; ;
1530 #line 288 "parser.y"
1531 { LINK(yyvsp
[0].var
, yyvsp
[-2].var
); yyval
.var
= yyvsp
[0].var
; ;
1534 #line 293 "parser.y"
1535 { yyval
.var
= yyvsp
[-1].var
;
1536 set_type(yyval
.var
, yyvsp
[-2].tref
, yyvsp
[0].expr
);
1537 yyval
.var
->attrs
= yyvsp
[-3].attr
;
1541 #line 297 "parser.y"
1542 { yyval
.var
= yyvsp
[-1].var
;
1543 set_type(yyval
.var
, yyvsp
[-2].tref
, yyvsp
[0].expr
);
1547 #line 300 "parser.y"
1548 { yyval
.var
= yyvsp
[-3].var
;
1549 yyval
.var
->ptr_level
--;
1550 set_type(yyval
.var
, yyvsp
[-4].tref
, NULL
);
1551 yyval
.var
->attrs
= yyvsp
[-5].attr
;
1552 yyval
.var
->args
= yyvsp
[-1].var
;
1556 #line 306 "parser.y"
1557 { yyval
.var
= yyvsp
[-3].var
;
1558 yyval
.var
->ptr_level
--;
1559 set_type(yyval
.var
, yyvsp
[-4].tref
, NULL
);
1560 yyval
.var
->args
= yyvsp
[-1].var
;
1564 #line 313 "parser.y"
1565 { yyval
.expr
= NULL
; ;
1568 #line 314 "parser.y"
1569 { yyval
.expr
= yyvsp
[-1].expr
; ;
1572 #line 315 "parser.y"
1573 { yyval
.expr
= make_expr(EXPR_VOID
); ;
1576 #line 319 "parser.y"
1577 { LINK(yyvsp
[0].expr
, yyvsp
[-2].expr
); yyval
.expr
= yyvsp
[0].expr
; ;
1580 #line 320 "parser.y"
1581 { LINK(yyvsp
[0].expr
, yyvsp
[-3].expr
); yyval
.expr
= yyvsp
[0].expr
; ;
1584 #line 323 "parser.y"
1585 { yyval
.attr
= NULL
; ;
1588 #line 328 "parser.y"
1589 { yyval
.attr
= yyvsp
[-1].attr
; ;
1592 #line 332 "parser.y"
1593 { LINK(yyvsp
[0].attr
, yyvsp
[-2].attr
); yyval
.attr
= yyvsp
[0].attr
; ;
1596 #line 333 "parser.y"
1597 { LINK(yyvsp
[0].attr
, yyvsp
[-3].attr
); yyval
.attr
= yyvsp
[0].attr
; ;
1600 #line 337 "parser.y"
1601 { yyval
.attr
= make_attr(ATTR_ASYNC
); ;
1604 #line 338 "parser.y"
1605 { yyval
.attr
= make_attr(ATTR_AUTO_HANDLE
); ;
1608 #line 339 "parser.y"
1609 { yyval
.attr
= make_attrp(ATTR_CALLAS
, yyvsp
[-1].var
); ;
1612 #line 340 "parser.y"
1613 { yyval
.attr
= make_attrp(ATTR_CASE
, yyvsp
[-1].expr
); ;
1616 #line 341 "parser.y"
1617 { yyval
.attr
= make_attrv(ATTR_CONTEXTHANDLE
, 0); ;
1620 #line 342 "parser.y"
1621 { yyval
.attr
= make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;
1624 #line 343 "parser.y"
1625 { yyval
.attr
= make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;
1628 #line 344 "parser.y"
1629 { yyval
.attr
= make_attr(ATTR_CONTROL
); ;
1632 #line 345 "parser.y"
1633 { yyval
.attr
= make_attr(ATTR_DEFAULT
); ;
1636 #line 346 "parser.y"
1637 { yyval
.attr
= make_attrp(ATTR_DEFAULTVALUE_EXPR
, yyvsp
[-1].expr
); ;
1640 #line 347 "parser.y"
1641 { yyval
.attr
= make_attrp(ATTR_DEFAULTVALUE_STRING
, yyvsp
[-1].str
); ;
1644 #line 348 "parser.y"
1645 { yyval
.attr
= make_attrp(ATTR_DLLNAME
, yyvsp
[-1].str
); ;
1648 #line 349 "parser.y"
1649 { yyval
.attr
= make_attr(ATTR_DUAL
); ;
1652 #line 350 "parser.y"
1653 { yyval
.attr
= make_attrp(ATTR_ENDPOINT
, yyvsp
[-1].str
); ;
1656 #line 351 "parser.y"
1657 { yyval
.attr
= make_attrp(ATTR_ENTRY_STRING
, yyvsp
[-1].str
); ;
1660 #line 352 "parser.y"
1661 { yyval
.attr
= make_attrp(ATTR_ENTRY_ORDINAL
, yyvsp
[-1].expr
); ;
1664 #line 353 "parser.y"
1665 { yyval
.attr
= make_attr(ATTR_EXPLICIT_HANDLE
); ;
1668 #line 354 "parser.y"
1669 { yyval
.attr
= make_attr(ATTR_HANDLE
); ;
1672 #line 355 "parser.y"
1673 { yyval
.attr
= make_attrp(ATTR_HELPCONTEXT
, yyvsp
[-1].expr
); ;
1676 #line 356 "parser.y"
1677 { yyval
.attr
= make_attrp(ATTR_HELPFILE
, yyvsp
[-1].str
); ;
1680 #line 357 "parser.y"
1681 { yyval
.attr
= make_attrp(ATTR_HELPSTRING
, yyvsp
[-1].str
); ;
1684 #line 358 "parser.y"
1685 { yyval
.attr
= make_attrp(ATTR_HELPSTRINGCONTEXT
, yyvsp
[-1].expr
); ;
1688 #line 359 "parser.y"
1689 { yyval
.attr
= make_attrp(ATTR_HELPSTRINGDLL
, yyvsp
[-1].str
); ;
1692 #line 360 "parser.y"
1693 { yyval
.attr
= make_attr(ATTR_HIDDEN
); ;
1696 #line 361 "parser.y"
1697 { yyval
.attr
= make_attrp(ATTR_ID
, yyvsp
[-1].expr
); ;
1700 #line 362 "parser.y"
1701 { yyval
.attr
= make_attr(ATTR_IDEMPOTENT
); ;
1704 #line 363 "parser.y"
1705 { yyval
.attr
= make_attrp(ATTR_IIDIS
, yyvsp
[-1].var
); ;
1708 #line 364 "parser.y"
1709 { yyval
.attr
= make_attrp(ATTR_IMPLICIT_HANDLE
, yyvsp
[-1].str
); ;
1712 #line 365 "parser.y"
1713 { yyval
.attr
= make_attr(ATTR_IN
); ;
1716 #line 366 "parser.y"
1717 { yyval
.attr
= make_attr(ATTR_INPUTSYNC
); ;
1720 #line 367 "parser.y"
1721 { yyval
.attr
= make_attrp(ATTR_LENGTHIS
, yyvsp
[-1].expr
); ;
1724 #line 368 "parser.y"
1725 { yyval
.attr
= make_attr(ATTR_LOCAL
); ;
1728 #line 369 "parser.y"
1729 { yyval
.attr
= make_attr(ATTR_NONCREATABLE
); ;
1732 #line 370 "parser.y"
1733 { yyval
.attr
= make_attr(ATTR_OBJECT
); ;
1736 #line 371 "parser.y"
1737 { yyval
.attr
= make_attr(ATTR_ODL
); ;
1740 #line 372 "parser.y"
1741 { yyval
.attr
= make_attr(ATTR_OLEAUTOMATION
); ;
1744 #line 373 "parser.y"
1745 { yyval
.attr
= make_attr(ATTR_OPTIONAL
); ;
1748 #line 374 "parser.y"
1749 { yyval
.attr
= make_attr(ATTR_OUT
); ;
1752 #line 375 "parser.y"
1753 { yyval
.attr
= make_attrv(ATTR_POINTERDEFAULT
, yyvsp
[-1].num
); ;
1756 #line 376 "parser.y"
1757 { yyval
.attr
= make_attr(ATTR_PROPGET
); ;
1760 #line 377 "parser.y"
1761 { yyval
.attr
= make_attr(ATTR_PROPPUT
); ;
1764 #line 378 "parser.y"
1765 { yyval
.attr
= make_attr(ATTR_PROPPUTREF
); ;
1768 #line 379 "parser.y"
1769 { yyval
.attr
= make_attr(ATTR_PUBLIC
); ;
1772 #line 380 "parser.y"
1773 { yyval
.attr
= make_attr(ATTR_READONLY
); ;
1776 #line 381 "parser.y"
1777 { yyval
.attr
= make_attr(ATTR_RESTRICTED
); ;
1780 #line 382 "parser.y"
1781 { yyval
.attr
= make_attr(ATTR_RETVAL
); ;
1784 #line 383 "parser.y"
1785 { yyval
.attr
= make_attrp(ATTR_SIZEIS
, yyvsp
[-1].expr
); ;
1788 #line 384 "parser.y"
1789 { yyval
.attr
= make_attr(ATTR_SOURCE
); ;
1792 #line 385 "parser.y"
1793 { yyval
.attr
= make_attr(ATTR_STRING
); ;
1796 #line 386 "parser.y"
1797 { yyval
.attr
= make_attrp(ATTR_SWITCHIS
, yyvsp
[-1].expr
); ;
1800 #line 387 "parser.y"
1801 { yyval
.attr
= make_attrp(ATTR_SWITCHTYPE
, type_ref(yyvsp
[-1].tref
)); ;
1804 #line 388 "parser.y"
1805 { yyval
.attr
= make_attrp(ATTR_TRANSMITAS
, type_ref(yyvsp
[-1].tref
)); ;
1808 #line 389 "parser.y"
1809 { yyval
.attr
= make_attrp(ATTR_UUID
, yyvsp
[-1].uuid
); ;
1812 #line 390 "parser.y"
1813 { yyval
.attr
= make_attr(ATTR_V1ENUM
); ;
1816 #line 391 "parser.y"
1817 { yyval
.attr
= make_attr(ATTR_VARARG
); ;
1820 #line 392 "parser.y"
1821 { yyval
.attr
= make_attrv(ATTR_VERSION
, yyvsp
[-1].num
); ;
1824 #line 393 "parser.y"
1825 { yyval
.attr
= make_attrp(ATTR_WIREMARSHAL
, type_ref(yyvsp
[-1].tref
)); ;
1828 #line 394 "parser.y"
1829 { yyval
.attr
= make_attrv(ATTR_POINTERTYPE
, yyvsp
[0].num
); ;
1832 #line 401 "parser.y"
1833 { yyval
.var
= NULL
; ;
1836 #line 402 "parser.y"
1837 { if (yyvsp
[0].var
) { LINK(yyvsp
[0].var
, yyvsp
[-1].var
); yyval
.var
= yyvsp
[0].var
; }
1838 else { yyval
.var
= yyvsp
[-1].var
; }
1842 #line 407 "parser.y"
1843 { attr_t
*a
= make_attrp(ATTR_CASE
, yyvsp
[-2].expr
);
1844 yyval
.var
= yyvsp
[0].var
; if (!yyval
.var
) yyval
.var
= make_var(NULL
);
1845 LINK(a
, yyval
.var
->attrs
); yyval
.var
->attrs
= a
;
1849 #line 411 "parser.y"
1850 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
1851 yyval
.var
= yyvsp
[0].var
; if (!yyval
.var
) yyval
.var
= make_var(NULL
);
1852 LINK(a
, yyval
.var
->attrs
); yyval
.var
->attrs
= a
;
1856 #line 417 "parser.y"
1857 { yyval
.var
= reg_const(yyvsp
[-2].var
);
1858 set_type(yyval
.var
, yyvsp
[-3].tref
, NULL
);
1859 yyval
.var
->eval
= yyvsp
[0].expr
;
1860 yyval
.var
->lval
= yyvsp
[0].expr
->cval
;
1864 #line 424 "parser.y"
1865 { yyval
.var
= NULL
; ;
1868 #line 425 "parser.y"
1869 { yyval
.var
= yyvsp
[-1].var
; ;
1872 #line 430 "parser.y"
1873 { LINK(yyvsp
[0].var
, yyvsp
[-2].var
); yyval
.var
= yyvsp
[0].var
;
1874 if (yyvsp
[-2].var
&& !yyvsp
[0].var
->eval
)
1875 yyvsp
[0].var
->lval
= yyvsp
[-2].var
->lval
+ 1;
1879 #line 436 "parser.y"
1880 { yyval
.var
= reg_const(yyvsp
[-2].var
);
1881 yyval
.var
->eval
= yyvsp
[0].expr
;
1882 yyval
.var
->lval
= yyvsp
[0].expr
->cval
;
1883 yyval
.var
->type
= make_type(RPC_FC_LONG
, &std_int
);
1887 #line 441 "parser.y"
1888 { yyval
.var
= reg_const(yyvsp
[0].var
);
1889 yyval
.var
->lval
= 0; /* default for first enum entry */
1890 yyval
.var
->type
= make_type(RPC_FC_LONG
, &std_int
);
1894 #line 447 "parser.y"
1895 { yyval
.type
= get_typev(RPC_FC_ENUM16
, yyvsp
[-3].var
, tsENUM
);
1896 yyval
.type
->fields
= yyvsp
[-1].var
;
1897 yyval
.type
->defined
= TRUE
;
1899 add_enum(yyval
.type
);
1903 #line 456 "parser.y"
1904 { LINK(yyvsp
[0].expr
, yyvsp
[-2].expr
); yyval
.expr
= yyvsp
[0].expr
; ;
1907 #line 469 "parser.y"
1908 { yyval
.expr
= make_expr(EXPR_VOID
); ;
1911 #line 473 "parser.y"
1912 { yyval
.expr
= make_exprl(EXPR_NUM
, yyvsp
[0].num
); ;
1915 #line 474 "parser.y"
1916 { yyval
.expr
= make_exprl(EXPR_HEXNUM
, yyvsp
[0].num
); ;
1919 #line 475 "parser.y"
1920 { yyval
.expr
= make_exprs(EXPR_IDENTIFIER
, yyvsp
[0].str
); ;
1923 #line 476 "parser.y"
1924 { yyval
.expr
= make_expr3(EXPR_COND
, yyvsp
[-4].expr
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1927 #line 477 "parser.y"
1928 { yyval
.expr
= make_expr2(EXPR_OR
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1931 #line 478 "parser.y"
1932 { yyval
.expr
= make_expr2(EXPR_AND
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1935 #line 479 "parser.y"
1936 { yyval
.expr
= make_expr2(EXPR_ADD
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1939 #line 480 "parser.y"
1940 { yyval
.expr
= make_expr2(EXPR_SUB
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1943 #line 481 "parser.y"
1944 { yyval
.expr
= make_expr2(EXPR_MUL
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1947 #line 482 "parser.y"
1948 { yyval
.expr
= make_expr2(EXPR_DIV
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1951 #line 483 "parser.y"
1952 { yyval
.expr
= make_expr2(EXPR_SHL
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1955 #line 484 "parser.y"
1956 { yyval
.expr
= make_expr2(EXPR_SHR
, yyvsp
[-2].expr
, yyvsp
[0].expr
); ;
1959 #line 485 "parser.y"
1960 { yyval
.expr
= make_expr1(EXPR_NOT
, yyvsp
[0].expr
); ;
1963 #line 486 "parser.y"
1964 { yyval
.expr
= make_expr1(EXPR_NEG
, yyvsp
[0].expr
); ;
1967 #line 487 "parser.y"
1968 { yyval
.expr
= make_expr1(EXPR_PPTR
, yyvsp
[0].expr
); ;
1971 #line 488 "parser.y"
1972 { yyval
.expr
= make_exprt(EXPR_CAST
, yyvsp
[-2].tref
, yyvsp
[0].expr
); ;
1975 #line 489 "parser.y"
1976 { yyval
.expr
= make_exprt(EXPR_SIZEOF
, yyvsp
[-1].tref
, NULL
); ;
1979 #line 490 "parser.y"
1980 { yyval
.expr
= yyvsp
[-1].expr
; ;
1983 #line 494 "parser.y"
1984 { LINK(yyvsp
[0].expr
, yyvsp
[-2].expr
); yyval
.expr
= yyvsp
[0].expr
; ;
1987 #line 497 "parser.y"
1988 { yyval
.expr
= yyvsp
[0].expr
;
1989 if (!yyval
.expr
->is_const
)
1990 yyerror("expression is not constant\n");
1994 #line 503 "parser.y"
1995 { yyval
.var
= yyvsp
[0].var
;
1996 set_type(yyval
.var
, yyvsp
[-1].tref
, NULL
);
2000 #line 508 "parser.y"
2001 { yyval
.var
= NULL
; ;
2004 #line 509 "parser.y"
2005 { if (yyvsp
[0].var
) { LINK(yyvsp
[0].var
, yyvsp
[-1].var
); yyval
.var
= yyvsp
[0].var
; }
2006 else { yyval
.var
= yyvsp
[-1].var
; }
2010 #line 514 "parser.y"
2011 { yyval
.var
= yyvsp
[-1].var
; ;
2014 #line 515 "parser.y"
2015 { yyval
.var
= make_var(NULL
); yyval
.var
->type
= yyvsp
[-1].type
; yyval
.var
->attrs
= yyvsp
[-2].attr
; ;
2018 #line 516 "parser.y"
2019 { yyval
.var
= make_var(NULL
); yyval
.var
->attrs
= yyvsp
[-1].attr
; ;
2022 #line 517 "parser.y"
2023 { yyval
.var
= NULL
; ;
2026 #line 520 "parser.y"
2027 { yyval
.var
= yyvsp
[-1].var
; set_type(yyval
.var
, yyvsp
[-2].tref
, yyvsp
[0].expr
); yyval
.var
->attrs
= yyvsp
[-3].attr
; ;
2030 #line 525 "parser.y"
2031 { set_type(yyvsp
[-3].var
, yyvsp
[-5].tref
, NULL
);
2032 yyvsp
[-3].var
->attrs
= yyvsp
[-6].attr
;
2033 yyval
.func
= make_func(yyvsp
[-3].var
, yyvsp
[-1].var
);
2034 if (is_attr(yyvsp
[-3].var
->attrs
, ATTR_IN
)) {
2035 yyerror("Inapplicable attribute");
2040 #line 534 "parser.y"
2041 { yyval
.var
= NULL
; ;
2044 #line 538 "parser.y"
2045 { yyval
.var
= NULL
; ;
2048 #line 539 "parser.y"
2049 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2052 #line 540 "parser.y"
2053 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2056 #line 543 "parser.y"
2057 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2060 #line 545 "parser.y"
2061 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2064 #line 546 "parser.y"
2065 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2068 #line 547 "parser.y"
2069 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2072 #line 548 "parser.y"
2073 { yyval
.var
= make_var(yyvsp
[0].str
); ;
2076 #line 551 "parser.y"
2077 { yyval
.type
= make_type(RPC_FC_BYTE
, NULL
); ;
2080 #line 552 "parser.y"
2081 { yyval
.type
= make_type(RPC_FC_WCHAR
, NULL
); ;
2084 #line 554 "parser.y"
2085 { yyval
.type
= yyvsp
[0].type
; yyval
.type
->sign
= 1; ;
2088 #line 555 "parser.y"
2089 { yyval
.type
= yyvsp
[0].type
; yyval
.type
->sign
= -1;
2090 switch (yyval
.type
->type
) {
2091 case RPC_FC_CHAR
: break;
2092 case RPC_FC_SMALL
: yyval
.type
->type
= RPC_FC_USMALL
; break;
2093 case RPC_FC_SHORT
: yyval
.type
->type
= RPC_FC_USHORT
; break;
2094 case RPC_FC_LONG
: yyval
.type
->type
= RPC_FC_ULONG
; break;
2096 if (!yyval
.type
->ref
) { yyval
.type
->ref
= &std_uhyper
; yyval
.type
->sign
= 0; }
2103 #line 567 "parser.y"
2104 { yyval
.type
= make_type(RPC_FC_FLOAT
, NULL
); ;
2107 #line 568 "parser.y"
2108 { yyval
.type
= make_type(RPC_FC_DOUBLE
, NULL
); ;
2111 #line 569 "parser.y"
2112 { yyval
.type
= make_type(RPC_FC_SMALL
, &std_bool
); ;
2115 #line 570 "parser.y"
2116 { yyval
.type
= make_type(RPC_FC_ERROR_STATUS_T
, NULL
); ;
2119 #line 571 "parser.y"
2120 { yyval
.type
= make_type(RPC_FC_IGNORE
, NULL
); ;
2123 #line 578 "parser.y"
2124 { yyval
.type
= make_type(RPC_FC_LONG
, &std_int
); ;
2127 #line 579 "parser.y"
2128 { yyval
.type
= make_type(RPC_FC_SMALL
, NULL
); ;
2131 #line 580 "parser.y"
2132 { yyval
.type
= make_type(RPC_FC_SHORT
, NULL
); ;
2135 #line 581 "parser.y"
2136 { yyval
.type
= make_type(RPC_FC_LONG
, NULL
); ;
2139 #line 582 "parser.y"
2140 { yyval
.type
= make_type(RPC_FC_HYPER
, NULL
); ;
2143 #line 583 "parser.y"
2144 { yyval
.type
= make_type(RPC_FC_HYPER
, &std_int64
); ;
2147 #line 584 "parser.y"
2148 { yyval
.type
= make_type(RPC_FC_CHAR
, NULL
); ;
2151 #line 587 "parser.y"
2152 { yyval
.clas
= make_class(yyvsp
[0].str
); ;
2155 #line 588 "parser.y"
2156 { yyval
.clas
= make_class(yyvsp
[0].str
); ;
2159 #line 591 "parser.y"
2160 { yyval
.clas
= yyvsp
[0].clas
;
2161 yyval
.clas
->attrs
= yyvsp
[-1].attr
;
2162 if (!parse_only
&& do_header
) write_coclass(yyval
.clas
);
2166 #line 597 "parser.y"
2167 { yyval
.clas
= yyvsp
[-3].clas
;
2168 yyval
.clas
->ifaces
= yyvsp
[-1].ifref
;
2172 #line 602 "parser.y"
2173 { yyval
.ifref
= NULL
; ;
2176 #line 603 "parser.y"
2177 { LINK(yyvsp
[0].ifref
, yyvsp
[-1].ifref
); yyval
.ifref
= yyvsp
[0].ifref
; ;
2180 #line 607 "parser.y"
2181 { yyval
.ifref
= make_ifref(yyvsp
[0].type
); yyval
.ifref
->attrs
= yyvsp
[-1].attr
; ;
2184 #line 610 "parser.y"
2185 { yyval
.type
= get_type(0, yyvsp
[0].str
, 0); ;
2188 #line 611 "parser.y"
2189 { yyval
.type
= get_type(0, yyvsp
[0].str
, 0); ;
2192 #line 614 "parser.y"
2193 { yyval
.type
= yyvsp
[0].type
;
2194 if (yyval
.type
->defined
) yyerror("multiple definition error\n");
2195 yyval
.type
->attrs
= yyvsp
[-1].attr
;
2196 yyval
.type
->attrs
= make_attr(ATTR_DISPINTERFACE
);
2197 LINK(yyval
.type
->attrs
, yyvsp
[-1].attr
);
2198 yyval
.type
->ref
= find_type("IDispatch", 0);
2199 if (!yyval
.type
->ref
) yyerror("IDispatch is undefined\n");
2200 yyval
.type
->defined
= TRUE
;
2201 if (!parse_only
&& do_header
) write_forward(yyval
.type
);
2205 #line 626 "parser.y"
2206 { yyval
.var
= NULL
; ;
2209 #line 627 "parser.y"
2210 { LINK(yyvsp
[-1].var
, yyvsp
[-2].var
); yyval
.var
= yyvsp
[-1].var
; ;
2213 #line 630 "parser.y"
2214 { yyval
.func
= NULL
; ;
2217 #line 631 "parser.y"
2218 { LINK(yyvsp
[-1].func
, yyvsp
[-2].func
); yyval
.func
= yyvsp
[-1].func
; ;
2221 #line 637 "parser.y"
2222 { yyval
.type
= yyvsp
[-4].type
;
2223 yyval
.type
->fields
= yyvsp
[-2].var
;
2224 yyval
.type
->funcs
= yyvsp
[-1].func
;
2225 if (!parse_only
&& do_header
) write_dispinterface(yyval
.type
);
2229 #line 649 "parser.y"
2230 { yyval
.type
= NULL
; ;
2233 #line 650 "parser.y"
2234 { yyval
.type
= find_type2(yyvsp
[0].str
, 0); ;
2237 #line 653 "parser.y"
2238 { yyval
.type
= get_type(RPC_FC_IP
, yyvsp
[0].str
, 0); ;
2241 #line 654 "parser.y"
2242 { yyval
.type
= get_type(RPC_FC_IP
, yyvsp
[0].str
, 0); ;
2245 #line 657 "parser.y"
2246 { yyval
.type
= yyvsp
[0].type
;
2247 if (yyval
.type
->defined
) yyerror("multiple definition error\n");
2248 yyval
.type
->attrs
= yyvsp
[-1].attr
;
2249 yyval
.type
->defined
= TRUE
;
2250 if (!parse_only
&& do_header
) write_forward(yyval
.type
);
2254 #line 666 "parser.y"
2255 { yyval
.type
= yyvsp
[-4].type
;
2256 yyval
.type
->ref
= yyvsp
[-3].type
;
2257 yyval
.type
->funcs
= yyvsp
[-1].func
;
2258 if (!parse_only
&& do_header
) write_interface(yyval
.type
);
2262 #line 674 "parser.y"
2263 { yyval
.type
= yyvsp
[-6].type
;
2264 yyval
.type
->ref
= find_type2(yyvsp
[-4].str
, 0);
2265 if (!yyval
.type
->ref
) yyerror("base class %s not found in import\n", yyvsp
[-4].str
);
2266 yyval
.type
->funcs
= yyvsp
[-1].func
;
2267 if (!parse_only
&& do_header
) write_interface(yyval
.type
);
2271 #line 680 "parser.y"
2272 { yyval
.type
= yyvsp
[0].type
; ;
2275 #line 684 "parser.y"
2276 { yyval
.type
= yyvsp
[-1].type
; if (!parse_only
&& do_header
) write_forward(yyval
.type
); ;
2279 #line 685 "parser.y"
2280 { yyval
.type
= yyvsp
[-1].type
; if (!parse_only
&& do_header
) write_forward(yyval
.type
); ;
2283 #line 688 "parser.y"
2284 { yyval
.type
= make_type(0, NULL
); yyval
.type
->name
= yyvsp
[0].str
; ;
2287 #line 689 "parser.y"
2288 { yyval
.type
= make_type(0, NULL
); yyval
.type
->name
= yyvsp
[0].str
; ;
2291 #line 692 "parser.y"
2292 { yyval
.type
= yyvsp
[0].type
;
2293 yyval
.type
->attrs
= yyvsp
[-1].attr
;
2297 #line 697 "parser.y"
2298 { yyval
.type
= yyvsp
[-3].type
;
2299 yyval
.type
->funcs
= yyvsp
[-1].func
;
2300 /* FIXME: if (!parse_only && do_header) write_module($$); */
2304 #line 703 "parser.y"
2305 { yyval
.var
= yyvsp
[0].var
; yyval
.var
->ptr_level
++; ;
2308 #line 704 "parser.y"
2309 { yyval
.var
= yyvsp
[0].var
; /* FIXME */ ;
2312 #line 709 "parser.y"
2313 { yyval
.var
= yyvsp
[-1].var
; ;
2316 #line 714 "parser.y"
2317 { LINK(yyvsp
[0].var
, yyvsp
[-2].var
); yyval
.var
= yyvsp
[0].var
; ;
2320 #line 718 "parser.y"
2321 { yyval
.num
= RPC_FC_RP
; ;
2324 #line 719 "parser.y"
2325 { yyval
.num
= RPC_FC_UP
; ;
2328 #line 722 "parser.y"
2329 { yyval
.type
= get_typev(RPC_FC_STRUCT
, yyvsp
[-3].var
, tsSTRUCT
);
2330 /* overwrite RPC_FC_STRUCT with a more exact type */
2331 yyval
.type
->type
= get_struct_type( yyvsp
[-1].var
);
2332 yyval
.type
->fields
= yyvsp
[-1].var
;
2333 yyval
.type
->defined
= TRUE
;
2335 add_struct(yyval
.type
);
2339 #line 732 "parser.y"
2340 { yyval
.tref
= make_tref(NULL
, make_type(0, NULL
)); ;
2343 #line 733 "parser.y"
2344 { yyval
.tref
= make_tref(yyvsp
[0].str
, find_type(yyvsp
[0].str
, 0)); ;
2347 #line 734 "parser.y"
2348 { yyval
.tref
= make_tref(NULL
, yyvsp
[0].type
); ;
2351 #line 735 "parser.y"
2352 { yyval
.tref
= uniq_tref(yyvsp
[0].tref
); yyval
.tref
->ref
->is_const
= TRUE
; ;
2355 #line 736 "parser.y"
2356 { yyval
.tref
= make_tref(NULL
, yyvsp
[0].type
); ;
2359 #line 737 "parser.y"
2360 { yyval
.tref
= make_tref(NULL
, find_type2(yyvsp
[0].str
, tsENUM
)); ;
2363 #line 738 "parser.y"
2364 { yyval
.tref
= make_tref(NULL
, yyvsp
[0].type
); ;
2367 #line 739 "parser.y"
2368 { yyval
.tref
= make_tref(NULL
, get_type(RPC_FC_STRUCT
, yyvsp
[0].str
, tsSTRUCT
)); ;
2371 #line 740 "parser.y"
2372 { yyval
.tref
= make_tref(NULL
, yyvsp
[0].type
); ;
2375 #line 741 "parser.y"
2376 { yyval
.tref
= make_tref(NULL
, find_type2(yyvsp
[0].str
, tsUNION
)); ;
2379 #line 744 "parser.y"
2380 { typeref_t
*tref
= uniq_tref(yyvsp
[-1].tref
);
2381 yyvsp
[0].var
->tname
= tref
->name
;
2383 yyval
.type
= type_ref(tref
);
2384 yyval
.type
->attrs
= yyvsp
[-2].attr
;
2385 if (!parse_only
&& do_header
) write_typedef(yyval
.type
, yyvsp
[0].var
);
2386 if (in_typelib
&& yyval
.type
->attrs
)
2387 add_typedef(yyval
.type
, yyvsp
[0].var
);
2388 reg_types(yyval
.type
, yyvsp
[0].var
, 0);
2392 #line 756 "parser.y"
2393 { yyval
.type
= get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, yyvsp
[-3].var
, tsUNION
);
2394 yyval
.type
->fields
= yyvsp
[-1].var
;
2395 yyval
.type
->defined
= TRUE
;
2399 #line 762 "parser.y"
2400 { var_t
*u
= yyvsp
[-3].var
;
2401 yyval
.type
= get_typev(RPC_FC_ENCAPSULATED_UNION
, yyvsp
[-8].var
, tsUNION
);
2402 if (!u
) u
= make_var("tagged_union");
2403 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
2404 u
->type
->fields
= yyvsp
[-1].var
;
2405 u
->type
->defined
= TRUE
;
2406 LINK(u
, yyvsp
[-5].var
); yyval
.type
->fields
= u
;
2407 yyval
.type
->defined
= TRUE
;
2411 #line 774 "parser.y"
2412 { yyval
.num
= MAKELONG(yyvsp
[0].num
, 0); ;
2415 #line 775 "parser.y"
2416 { yyval
.num
= MAKELONG(yyvsp
[-2].num
, yyvsp
[0].num
); ;
2419 /* the action file gets copied in in place of this dollarsign */
2420 #line 543 "/usr/share/bison.simple"
2431 short *ssp1
= yyss
- 1;
2432 fprintf (stderr
, "state stack now");
2433 while (ssp1
!= yyssp
)
2434 fprintf (stderr
, " %d", *++ssp1
);
2435 fprintf (stderr
, "\n");
2445 yylsp
->first_line
= yylloc
.first_line
;
2446 yylsp
->first_column
= yylloc
.first_column
;
2447 yylsp
->last_line
= (yylsp
-1)->last_line
;
2448 yylsp
->last_column
= (yylsp
-1)->last_column
;
2453 yylsp
->last_line
= (yylsp
+yylen
-1)->last_line
;
2454 yylsp
->last_column
= (yylsp
+yylen
-1)->last_column
;
2458 /* Now "shift" the result of the reduction.
2459 Determine what state that goes to,
2460 based on the state we popped back to
2461 and the rule number reduced by. */
2465 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
2466 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2467 yystate
= yytable
[yystate
];
2469 yystate
= yydefgoto
[yyn
- YYNTBASE
];
2473 yyerrlab
: /* here on detecting error */
2476 /* If not already recovering from an error, report this error. */
2480 #ifdef YYERROR_VERBOSE
2481 yyn
= yypact
[yystate
];
2483 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
2490 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2491 for (x
= (yyn
< 0 ? -yyn
: 0);
2492 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
2493 if (yycheck
[x
+ yyn
] == x
)
2494 size
+= strlen(yytname
[x
]) + 15, count
++;
2495 msg
= (char *) malloc(size
+ 15);
2498 strcpy(msg
, "parse error");
2503 for (x
= (yyn
< 0 ? -yyn
: 0);
2504 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
2505 if (yycheck
[x
+ yyn
] == x
)
2507 strcat(msg
, count
== 0 ? ", expecting `" : " or `");
2508 strcat(msg
, yytname
[x
]);
2517 yyerror ("parse error; also virtual memory exceeded");
2520 #endif /* YYERROR_VERBOSE */
2521 yyerror("parse error");
2525 yyerrlab1
: /* here on error raised explicitly by an action */
2527 if (yyerrstatus
== 3)
2529 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2531 /* return failure if at end of input */
2532 if (yychar
== YYEOF
)
2537 fprintf(stderr
, "Discarding token %d (%s).\n", yychar
, yytname
[yychar1
]);
2543 /* Else will try to reuse lookahead token
2544 after shifting the error token. */
2546 yyerrstatus
= 3; /* Each real token shifted decrements this */
2550 yyerrdefault
: /* current state does not do anything special for the error token. */
2553 /* This is wrong; only states that explicitly want error tokens
2554 should shift them. */
2555 yyn
= yydefact
[yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2556 if (yyn
) goto yydefault
;
2559 yyerrpop
: /* pop the current state because it cannot handle the error token */
2561 if (yyssp
== yyss
) YYABORT
;
2571 short *ssp1
= yyss
- 1;
2572 fprintf (stderr
, "Error: state stack now");
2573 while (ssp1
!= yyssp
)
2574 fprintf (stderr
, " %d", *++ssp1
);
2575 fprintf (stderr
, "\n");
2581 yyn
= yypact
[yystate
];
2586 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
2605 fprintf(stderr
, "Shifting error token, ");
2617 /* YYACCEPT comes here. */
2629 /* YYABORT comes here. */
2640 #line 778 "parser.y"
2643 static attr_t
*make_attr(enum attr_type type
)
2645 attr_t
*a
= xmalloc(sizeof(attr_t
));
2652 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
2654 attr_t
*a
= xmalloc(sizeof(attr_t
));
2661 static attr_t
*make_attrp(enum attr_type type
, void *val
)
2663 attr_t
*a
= xmalloc(sizeof(attr_t
));
2670 static expr_t
*make_expr(enum expr_type type
)
2672 expr_t
*e
= xmalloc(sizeof(expr_t
));
2676 e
->is_const
= FALSE
;
2681 static expr_t
*make_exprl(enum expr_type type
, long val
)
2683 expr_t
*e
= xmalloc(sizeof(expr_t
));
2687 e
->is_const
= FALSE
;
2689 /* check for numeric constant */
2690 if (type
== EXPR_NUM
|| type
== EXPR_HEXNUM
) {
2697 static expr_t
*make_exprs(enum expr_type type
, char *val
)
2700 e
= xmalloc(sizeof(expr_t
));
2704 e
->is_const
= FALSE
;
2706 /* check for predefined constants */
2707 if (type
== EXPR_IDENTIFIER
) {
2708 var_t
*c
= find_const(val
, 0);
2710 e
->u
.sval
= c
->name
;
2719 static expr_t
*make_exprt(enum expr_type type
, typeref_t
*tref
, expr_t
*expr
)
2722 e
= xmalloc(sizeof(expr_t
));
2726 e
->is_const
= FALSE
;
2728 /* check for cast of constant expression */
2729 if (type
== EXPR_CAST
&& expr
->is_const
) {
2731 e
->cval
= expr
->cval
;
2736 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
)
2739 e
= xmalloc(sizeof(expr_t
));
2743 e
->is_const
= FALSE
;
2745 /* check for compile-time optimization */
2746 if (expr
->is_const
) {
2750 e
->cval
= -expr
->cval
;
2753 e
->cval
= ~expr
->cval
;
2756 e
->is_const
= FALSE
;
2763 static expr_t
*make_expr2(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
)
2766 e
= xmalloc(sizeof(expr_t
));
2770 e
->is_const
= FALSE
;
2772 /* check for compile-time optimization */
2773 if (expr1
->is_const
&& expr2
->is_const
) {
2777 e
->cval
= expr1
->cval
+ expr2
->cval
;
2780 e
->cval
= expr1
->cval
- expr2
->cval
;
2783 e
->cval
= expr1
->cval
* expr2
->cval
;
2786 e
->cval
= expr1
->cval
/ expr2
->cval
;
2789 e
->cval
= expr1
->cval
| expr2
->cval
;
2792 e
->cval
= expr1
->cval
& expr2
->cval
;
2795 e
->cval
= expr1
->cval
<< expr2
->cval
;
2798 e
->cval
= expr1
->cval
>> expr2
->cval
;
2801 e
->is_const
= FALSE
;
2808 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
)
2811 e
= xmalloc(sizeof(expr_t
));
2816 e
->is_const
= FALSE
;
2818 /* check for compile-time optimization */
2819 if (expr1
->is_const
&& expr2
->is_const
&& expr3
->is_const
) {
2823 e
->cval
= expr1
->cval
? expr2
->cval
: expr3
->cval
;
2826 e
->is_const
= FALSE
;
2833 static type_t
*make_type(unsigned char type
, type_t
*ref
)
2835 type_t
*t
= xmalloc(sizeof(type_t
));
2843 t
->ignore
= parse_only
;
2844 t
->is_const
= FALSE
;
2848 t
->typelib_idx
= -1;
2853 static typeref_t
*make_tref(char *name
, type_t
*ref
)
2855 typeref_t
*t
= xmalloc(sizeof(typeref_t
));
2858 t
->uniq
= ref
? 0 : 1;
2862 static typeref_t
*uniq_tref(typeref_t
*ref
)
2866 if (t
->uniq
) return t
;
2867 tp
= make_type(0, t
->ref
);
2875 static type_t
*type_ref(typeref_t
*ref
)
2877 type_t
*t
= ref
->ref
;
2878 if (ref
->name
) free(ref
->name
);
2883 static void set_type(var_t
*v
, typeref_t
*ref
, expr_t
*arr
)
2886 v
->tname
= ref
->name
;
2892 static ifref_t
*make_ifref(type_t
*iface
)
2894 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
2901 static var_t
*make_var(char *name
)
2903 var_t
*v
= xmalloc(sizeof(var_t
));
2916 static func_t
*make_func(var_t
*def
, var_t
*args
)
2918 func_t
*f
= xmalloc(sizeof(func_t
));
2921 f
->ignore
= parse_only
;
2927 static class_t
*make_class(char *name
)
2929 class_t
*c
= xmalloc(sizeof(class_t
));
2939 static int hash_ident(const char *name
)
2941 const char *p
= name
;
2943 /* a simple sum hash is probably good enough */
2948 return sum
& (HASHMAX
-1);
2951 /***** type repository *****/
2960 struct rtype
*type_hash
[HASHMAX
];
2962 static type_t
*reg_type(type_t
*type
, char *name
, int t
)
2967 yyerror("registering named type without name\n");
2970 hash
= hash_ident(name
);
2971 nt
= xmalloc(sizeof(struct rtype
));
2975 nt
->next
= type_hash
[hash
];
2976 type_hash
[hash
] = nt
;
2980 /* determine pointer type from attrs */
2981 static unsigned char get_pointer_type( type_t
*type
)
2984 if (is_attr( type
->attrs
, ATTR_STRING
))
2987 while( t
->type
== 0 && t
->ref
)
2992 return RPC_FC_C_CSTRING
;
2994 return RPC_FC_C_WSTRING
;
2997 t
= get_attrv( type
->attrs
, ATTR_POINTERTYPE
);
3002 static type_t
*reg_types(type_t
*type
, var_t
*names
, int t
)
3008 var_t
*next
= NEXT_LINK(names
);
3011 int cptr
= names
->ptr_level
;
3013 while (cptr
> ptrc
) {
3014 int t
= get_pointer_type( cur
);
3015 cur
= ptr
= make_type(t
, cur
);
3019 while (cptr
< ptrc
) {
3024 reg_type(cur
, names
->name
, t
);
3032 static type_t
*find_type(char *name
, int t
)
3034 struct rtype
*cur
= type_hash
[hash_ident(name
)];
3035 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
3038 yyerror("type %s not found\n", name
);
3044 static type_t
*find_type2(char *name
, int t
)
3046 type_t
*tp
= find_type(name
, t
);
3051 int is_type(const char *name
)
3053 struct rtype
*cur
= type_hash
[hash_ident(name
)];
3054 while (cur
&& (cur
->t
|| strcmp(cur
->name
, name
)))
3056 if (cur
) return TRUE
;
3060 static type_t
*get_type(unsigned char type
, char *name
, int t
)
3062 struct rtype
*cur
= NULL
;
3065 cur
= type_hash
[hash_ident(name
)];
3066 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
3073 tp
= make_type(type
, NULL
);
3075 if (!name
) return tp
;
3076 return reg_type(tp
, name
, t
);
3079 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
3086 return get_type(type
, sname
, t
);
3089 static int get_struct_type(var_t
*field
)
3091 int has_pointer
= 0;
3092 int has_conformant_array
= 0;
3093 int has_conformant_string
= 0;
3097 type_t
*t
= field
->type
;
3099 /* get the base type */
3100 while( (t
->type
== 0) && t
->ref
)
3106 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
3107 * Simple types don't effect the type of struct.
3108 * A struct containing a simple struct is still a simple struct.
3109 * So long as we can block copy the data, we return RPC_FC_STRUCT.
3111 case 0: /* void pointer */
3121 case RPC_FC_INT3264
:
3122 case RPC_FC_UINT3264
:
3136 has_conformant_array
= 1;
3138 case RPC_FC_C_CSTRING
:
3139 case RPC_FC_C_WSTRING
:
3140 has_conformant_string
= 1;
3144 * Propagate member attributes
3145 * a struct should be at least as complex as its member
3147 case RPC_FC_CVSTRUCT
:
3148 has_conformant_string
= 1;
3152 case RPC_FC_CPSTRUCT
:
3153 has_conformant_array
= 1;
3157 case RPC_FC_CSTRUCT
:
3158 has_conformant_array
= 1;
3161 case RPC_FC_PSTRUCT
:
3166 fprintf(stderr
,"Unknown struct member %s with type (0x%02x)\n",
3167 field
->name
, t
->type
);
3168 /* fallthru - treat it as complex */
3170 /* as soon as we see one of these these members, it's bogus... */
3172 case RPC_FC_ENCAPSULATED_UNION
:
3173 case RPC_FC_NON_ENCAPSULATED_UNION
:
3174 case RPC_FC_TRANSMIT_AS
:
3175 case RPC_FC_REPRESENT_AS
:
3177 case RPC_FC_EMBEDDED_COMPLEX
:
3178 case RPC_FC_BOGUS_STRUCT
:
3179 return RPC_FC_BOGUS_STRUCT
;
3181 field
= NEXT_LINK(field
);
3184 if( has_conformant_string
&& has_pointer
)
3185 return RPC_FC_CVSTRUCT
;
3186 if( has_conformant_array
&& has_pointer
)
3187 return RPC_FC_CPSTRUCT
;
3188 if( has_conformant_array
)
3189 return RPC_FC_CSTRUCT
;
3191 return RPC_FC_PSTRUCT
;
3192 return RPC_FC_STRUCT
;
3195 /***** constant repository *****/
3200 struct rconst
*next
;
3203 struct rconst
*const_hash
[HASHMAX
];
3205 static var_t
*reg_const(var_t
*var
)
3210 yyerror("registering constant without name\n");
3213 hash
= hash_ident(var
->name
);
3214 nc
= xmalloc(sizeof(struct rconst
));
3215 nc
->name
= var
->name
;
3217 nc
->next
= const_hash
[hash
];
3218 const_hash
[hash
] = nc
;
3222 static var_t
*find_const(char *name
, int f
)
3224 struct rconst
*cur
= const_hash
[hash_ident(name
)];
3225 while (cur
&& strcmp(cur
->name
, name
))
3228 if (f
) yyerror("constant %s not found\n", name
);