/* A Bison parser, made from parser.y with Bison version GNU Bison version 1.22 */ #define YYBISON 1 /* Identify Bison output. */ #define TOK_ANY 258 #define TOK_ATTRIBUTE 259 #define TOK_BOOLEAN 260 #define TOK_CASE 261 #define TOK_CHAR 262 #define TOK_CONST 263 #define TOK_CONTEXT 264 #define TOK_DEFAULT 265 #define TOK_DOUBLE 266 #define TOK_ENUM 267 #define TOK_EXCEPTION 268 #define TOK_FALSE 269 #define TOK_FIXED 270 #define TOK_FLOAT 271 #define TOK_IN 272 #define TOK_INOUT 273 #define TOK_INTERFACE 274 #define TOK_LONG 275 #define TOK_MODULE 276 #define TOK_NATIVE 277 #define TOK_OBJECT 278 #define TOK_OCTET 279 #define TOK_ONEWAY 280 #define TOK_OP_SCOPE 281 #define TOK_OP_SHL 282 #define TOK_OP_SHR 283 #define TOK_OUT 284 #define TOK_RAISES 285 #define TOK_READONLY 286 #define TOK_SEQUENCE 287 #define TOK_SHORT 288 #define TOK_STRING 289 #define TOK_STRUCT 290 #define TOK_SWITCH 291 #define TOK_TRUE 292 #define TOK_TYPECODE 293 #define TOK_TYPEDEF 294 #define TOK_UNION 295 #define TOK_UNSIGNED 296 #define TOK_VARARGS 297 #define TOK_VOID 298 #define TOK_WCHAR 299 #define TOK_WSTRING 300 #define TOK_FLOATP 301 #define TOK_INTEGER 302 #define TOK_DECLSPEC 303 #define TOK_PROP_KEY 304 #define TOK_PROP_VALUE 305 #define TOK_NATIVE_TYPE 306 #define TOK_IDENT 307 #define TOK_SQSTRING 308 #define TOK_DQSTRING 309 #define TOK_FIXEDP 310 #define TOK_CODEFRAG 311 #define TOK_SRCFILE 312 #line 24 "parser.y" #include #include #include #include #include #include #include #include "rename.h" #include "util.h" #define REF_IDENTS #define do_binop(rv,op,a,b) do { \ if (IDL_binop_chktypes (op, a, b)) \ YYABORT; \ if (!(__IDL_flags & IDLF_NO_EVAL_CONST)) { \ rv = IDL_binop_eval (op, a, b); \ IDL_tree_free (a); \ IDL_tree_free (b); \ if (!rv) YYABORT; \ } else { \ rv = IDL_binop_new (op, a, b); \ } \ } while (0) #define do_unaryop(rv,op,a) do { \ if (IDL_unaryop_chktypes (op, a)) \ YYABORT; \ if (!(__IDL_flags & IDLF_NO_EVAL_CONST)) { \ rv = IDL_unaryop_eval (op, a); \ IDL_tree_free (a); \ if (!rv) YYABORT; \ } else { \ rv = IDL_unaryop_new (op, a); \ } \ } while (0) #define IS_INHIBIT_STATE() \ (__IDL_inhibits > 0 || \ ((__IDL_flags & IDLF_INHIBIT_INCLUDES) && \ (__IDL_flagsi & IDLFP_IN_INCLUDES) ) ) #define assign_declspec(tree,declspec) do { \ IDL_NODE_DECLSPEC (tree) = declspec; \ if ( IS_INHIBIT_STATE() ) { \ IDL_NODE_DECLSPEC (tree) |= \ IDLF_DECLSPEC_EXIST | \ IDLF_DECLSPEC_INHIBIT; \ } \ if ( __IDL_pidl > 0 ) { \ IDL_NODE_DECLSPEC (tree) |= \ IDLF_DECLSPEC_PIDL; \ } \ } while (0) #define assign_props(tree,props) do { \ if (__IDL_flags & IDLF_PROPERTIES) \ IDL_NODE_PROPERTIES (tree) = (props); \ else \ __IDL_free_properties (props); \ } while (0) extern int yylex (void); static IDL_declspec_t IDL_parse_declspec (const char *strspec); static int IDL_binop_chktypes (enum IDL_binop op, IDL_tree a, IDL_tree b); static int IDL_unaryop_chktypes (enum IDL_unaryop op, IDL_tree a); static IDL_tree IDL_binop_eval (enum IDL_binop op, IDL_tree a, IDL_tree b); static IDL_tree IDL_unaryop_eval (enum IDL_unaryop op, IDL_tree a); static IDL_tree list_start (IDL_tree a, gboolean filter_null); static IDL_tree list_chain (IDL_tree a, IDL_tree b, gboolean filter_null); static IDL_tree zlist_chain (IDL_tree a, IDL_tree b, gboolean filter_null); static int do_token_error (IDL_tree p, const char *message, gboolean prev); static void illegal_context_type_error (IDL_tree p, const char *what); static void illegal_type_error (IDL_tree p, const char *message); #line 117 "parser.y" typedef union { IDL_tree tree; struct { IDL_tree tree; gpointer data; } treedata; GHashTable *hash_table; char *str; gboolean boolean; IDL_declspec_t declspec; IDL_longlong_t integer; double floatp; enum IDL_unaryop unaryop; enum IDL_param_attr paramattr; } YYSTYPE; #ifndef YYLTYPE typedef struct yyltype { int timestamp; int first_line; int first_column; int last_line; int last_column; char *text; } yyltype; #define YYLTYPE yyltype #endif #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 397 #define YYFLAG -32768 #define YYNTBASE 79 #define YYTRANSLATE(x) ((unsigned)(x) <= 312 ? yytranslate[x] : 226) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 73, 68, 2, 63, 64, 71, 69, 59, 70, 2, 72, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 58, 75, 65, 76, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 77, 2, 78, 67, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 60, 66, 61, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 1, 3, 4, 6, 8, 11, 13, 14, 16, 18, 19, 21, 24, 27, 30, 33, 36, 38, 40, 42, 44, 47, 48, 56, 58, 60, 62, 63, 64, 77, 83, 84, 87, 89, 93, 95, 96, 99, 102, 105, 108, 111, 114, 116, 118, 121, 125, 127, 129, 131, 135, 136, 143, 146, 148, 150, 152, 154, 156, 158, 160, 162, 163, 165, 166, 168, 169, 170, 180, 181, 182, 196, 198, 200, 202, 204, 206, 208, 210, 213, 217, 220, 222, 225, 229, 232, 235, 241, 244, 251, 252, 255, 256, 258, 261, 262, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 290, 292, 295, 304, 305, 308, 310, 311, 313, 314, 317, 322, 326, 328, 332, 333, 339, 341, 343, 345, 347, 348, 350, 351, 353, 358, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, 387, 391, 393, 397, 399, 403, 405, 409, 413, 415, 419, 423, 425, 429, 433, 437, 440, 442, 444, 446, 448, 450, 452, 456, 458, 460, 462, 464, 466, 468, 469, 477, 479, 481, 484, 488, 490, 494, 496, 499, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 536, 541, 543, 545, 548, 555, 557, 559, 561, 563, 565, 567, 569, 571, 574, 576, 578, 580, 583, 586, 590, 592, 594, 596, 598, 600, 602, 604, 609, 611, 616, 618, 620, 624, 626, 628, 630, 632, 634, 638, 641, 643, 646, 650, 653, 656, 661, 663, 667, 669, 671, 673, 675, 676, 678, 680, 682, 684, 686, 690, 692, 693, 695, 696, 697, 702, 704, 706, 708, 710, 712, 714, 716, 719, 721, 723, 726, 728 }; static const short yyrhs[] = { -1, 81, 0, 0, 81, 0, 86, 0, 81, 86, 0, 58, 0, 0, 58, 0, 59, 0, 0, 163, 0, 99, 82, 0, 121, 82, 0, 123, 82, 0, 91, 82, 0, 88, 82, 0, 221, 0, 222, 0, 85, 0, 83, 0, 212, 21, 0, 0, 87, 204, 89, 60, 80, 61, 205, 0, 204, 0, 23, 0, 38, 0, 0, 0, 212, 213, 19, 90, 92, 205, 94, 93, 60, 96, 61, 205, 0, 212, 213, 19, 90, 205, 0, 0, 62, 95, 0, 163, 0, 95, 84, 163, 0, 97, 0, 0, 97, 98, 0, 99, 82, 0, 123, 82, 0, 134, 82, 0, 127, 82, 0, 121, 82, 0, 221, 0, 83, 0, 212, 100, 0, 213, 39, 102, 0, 108, 0, 111, 0, 161, 0, 213, 22, 194, 0, 0, 213, 22, 194, 63, 101, 51, 0, 103, 192, 0, 104, 0, 105, 0, 168, 0, 169, 0, 163, 0, 108, 0, 111, 0, 161, 0, 0, 202, 0, 0, 203, 0, 0, 0, 213, 35, 109, 107, 60, 110, 166, 61, 205, 0, 0, 0, 213, 40, 112, 107, 36, 63, 114, 64, 60, 113, 115, 61, 205, 0, 174, 0, 183, 0, 185, 0, 161, 0, 163, 0, 116, 0, 117, 0, 116, 117, 0, 119, 118, 82, 0, 103, 193, 0, 120, 0, 119, 120, 0, 6, 150, 62, 0, 10, 62, 0, 212, 122, 0, 8, 149, 202, 65, 150, 0, 212, 124, 0, 13, 203, 60, 125, 61, 205, 0, 0, 125, 167, 0, 0, 31, 0, 212, 128, 0, 0, 213, 126, 4, 129, 130, 196, 0, 132, 0, 43, 0, 170, 0, 105, 0, 168, 0, 190, 0, 191, 0, 172, 0, 163, 0, 131, 0, 0, 25, 0, 212, 135, 0, 213, 133, 136, 203, 140, 205, 145, 146, 0, 0, 137, 132, 0, 43, 0, 0, 42, 0, 0, 59, 42, 0, 63, 141, 139, 64, 0, 63, 138, 64, 0, 142, 0, 141, 84, 142, 0, 0, 213, 144, 143, 130, 194, 0, 17, 0, 29, 0, 18, 0, 130, 0, 0, 147, 0, 0, 148, 0, 30, 63, 95, 64, 0, 9, 63, 210, 64, 0, 174, 0, 183, 0, 186, 0, 184, 0, 185, 0, 171, 0, 190, 0, 191, 0, 173, 0, 163, 0, 151, 0, 152, 0, 151, 66, 152, 0, 153, 0, 152, 67, 153, 0, 154, 0, 153, 68, 154, 0, 155, 0, 154, 28, 155, 0, 154, 27, 155, 0, 156, 0, 155, 69, 156, 0, 155, 70, 156, 0, 157, 0, 156, 71, 157, 0, 156, 72, 157, 0, 156, 73, 157, 0, 158, 159, 0, 159, 0, 70, 0, 69, 0, 74, 0, 163, 0, 160, 0, 63, 150, 64, 0, 215, 0, 216, 0, 217, 0, 218, 0, 219, 0, 220, 0, 0, 213, 12, 162, 106, 60, 165, 61, 0, 164, 0, 207, 0, 26, 209, 0, 164, 26, 201, 0, 202, 0, 165, 84, 202, 0, 167, 0, 166, 167, 0, 103, 192, 82, 0, 171, 0, 174, 0, 183, 0, 184, 0, 185, 0, 186, 0, 187, 0, 188, 0, 189, 0, 170, 0, 190, 0, 191, 0, 172, 0, 32, 75, 104, 59, 211, 76, 0, 32, 75, 104, 76, 0, 16, 0, 11, 0, 20, 11, 0, 15, 75, 211, 59, 215, 76, 0, 15, 0, 175, 0, 179, 0, 176, 0, 177, 0, 178, 0, 33, 0, 20, 0, 20, 20, 0, 180, 0, 181, 0, 182, 0, 41, 33, 0, 41, 20, 0, 41, 20, 20, 0, 7, 0, 44, 0, 5, 0, 24, 0, 3, 0, 23, 0, 38, 0, 34, 75, 211, 76, 0, 34, 0, 45, 75, 211, 76, 0, 45, 0, 193, 0, 192, 84, 193, 0, 194, 0, 195, 0, 202, 0, 197, 0, 194, 0, 196, 84, 194, 0, 202, 198, 0, 199, 0, 198, 199, 0, 77, 211, 78, 0, 77, 78, 0, 49, 50, 0, 200, 59, 49, 50, 0, 49, 0, 200, 59, 49, 0, 52, 0, 206, 0, 206, 0, 208, 0, 0, 201, 0, 201, 0, 201, 0, 201, 0, 216, 0, 210, 84, 216, 0, 150, 0, 0, 48, 0, 0, 0, 77, 214, 200, 78, 0, 47, 0, 223, 0, 225, 0, 55, 0, 46, 0, 37, 0, 14, 0, 212, 56, 0, 57, 0, 224, 0, 223, 224, 0, 54, 0, 53, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 309, 310, 313, 314, 317, 318, 321, 322, 328, 334, 335, 341, 350, 351, 352, 353, 354, 355, 356, 357, 358, 361, 364, 373, 402, 403, 407, 413, 439, 445, 451, 464, 465, 511, 512, 516, 519, 520, 523, 524, 525, 526, 527, 528, 529, 532, 538, 551, 552, 553, 554, 559, 568, 575, 578, 579, 582, 583, 584, 587, 588, 589, 592, 596, 599, 603, 606, 608, 612, 621, 623, 629, 638, 639, 640, 641, 642, 645, 648, 649, 652, 656, 670, 671, 674, 675, 678, 684, 691, 697, 702, 703, 706, 707, 710, 716, 721, 735, 736, 742, 744, 747, 748, 749, 750, 751, 752, 758, 759, 762, 768, 780, 781, 782, 785, 786, 789, 790, 793, 800, 806, 807, 811, 815, 821, 822, 823, 824, 830, 831, 834, 835, 838, 843, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 860, 863, 864, 867, 868, 871, 872, 875, 876, 877, 880, 881, 882, 885, 886, 887, 888, 891, 892, 895, 896, 897, 900, 914, 915, 918, 919, 920, 921, 922, 923, 926, 928, 936, 944, 945, 946, 972, 973, 977, 978, 981, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1007, 1008, 1009, 1010, 1013, 1016, 1021, 1022, 1023, 1026, 1031, 1034, 1035, 1038, 1039, 1040, 1043, 1046, 1049, 1052, 1053, 1054, 1057, 1060, 1063, 1066, 1069, 1072, 1075, 1078, 1081, 1084, 1087, 1090, 1093, 1096, 1099, 1100, 1104, 1105, 1108, 1111, 1114, 1115, 1119, 1134, 1135, 1139, 1140, 1143, 1148, 1154, 1158, 1165, 1168, 1176, 1189, 1206, 1218, 1256, 1274, 1305, 1324, 1325, 1329, 1368, 1369, 1375, 1376, 1385, 1388, 1391, 1394, 1397, 1400, 1403, 1404, 1407, 1413, 1418, 1419, 1427, 1434 }; static const char * const yytname[] = { "$","error","$illegal.","TOK_ANY", "TOK_ATTRIBUTE","TOK_BOOLEAN","TOK_CASE","TOK_CHAR","TOK_CONST","TOK_CONTEXT", "TOK_DEFAULT","TOK_DOUBLE","TOK_ENUM","TOK_EXCEPTION","TOK_FALSE","TOK_FIXED", "TOK_FLOAT","TOK_IN","TOK_INOUT","TOK_INTERFACE","TOK_LONG","TOK_MODULE","TOK_NATIVE", "TOK_OBJECT","TOK_OCTET","TOK_ONEWAY","TOK_OP_SCOPE","TOK_OP_SHL","TOK_OP_SHR", "TOK_OUT","TOK_RAISES","TOK_READONLY","TOK_SEQUENCE","TOK_SHORT","TOK_STRING", "TOK_STRUCT","TOK_SWITCH","TOK_TRUE","TOK_TYPECODE","TOK_TYPEDEF","TOK_UNION", "TOK_UNSIGNED","TOK_VARARGS","TOK_VOID","TOK_WCHAR","TOK_WSTRING","TOK_FLOATP", "TOK_INTEGER","TOK_DECLSPEC","TOK_PROP_KEY","TOK_PROP_VALUE","TOK_NATIVE_TYPE", "TOK_IDENT","TOK_SQSTRING","TOK_DQSTRING","TOK_FIXEDP","TOK_CODEFRAG","TOK_SRCFILE", "';'","','","'{'","'}'","':'","'('","')'","'='","'|'","'^'","'&'","'+'","'-'", "'*'","'/'","'%'","'~'","'<'","'>'","'['","']'","specification","z_definition_list", "definition_list","check_semicolon","useless_semicolon","check_comma","illegal_ident", "definition","module_declspec","module","@1","interface_catch_ident","interface", "@2","@3","z_inheritance","scoped_name_list","interface_body","export_list", "export","type_dcl","type_dcl_def","@4","type_declarator","type_spec","simple_type_spec", "constr_type_spec","z_new_ident_catch","z_new_scope_catch","struct_type","@5", "@6","union_type","@7","@8","switch_type_spec","switch_body","case_stmt_list", "case_stmt","element_spec","case_label_list","case_label","const_dcl","const_dcl_def", "except_dcl","except_dcl_def","member_zlist","is_readonly","attr_dcl","attr_dcl_def", "@9","param_type_spec","op_param_type_spec_illegal","op_param_type_spec","is_oneway", "op_dcl","op_dcl_def","op_type_spec","@10","is_varargs","is_cvarargs","parameter_dcls", "param_dcl_list","param_dcl","@11","param_attribute","is_raises_expr","is_context_expr", "raises_expr","context_expr","const_type","const_exp","or_expr","xor_expr","and_expr", "shift_expr","add_expr","mult_expr","unary_expr","unary_op","primary_expr","literal", "enum_type","@12","scoped_name","ns_scoped_name","enumerator_list","member_list", "member","base_type_spec","template_type_spec","sequence_type","floating_pt_type", "fixed_pt_type","fixed_pt_const_type","integer_type","signed_int","signed_short_int", "signed_long_int","signed_longlong_int","unsigned_int","unsigned_short_int", "unsigned_long_int","unsigned_longlong_int","char_type","wide_char_type","boolean_type", "octet_type","any_type","object_type","typecode_type","string_type","wide_string_type", "declarator_list","declarator","simple_declarator","complex_declarator","simple_declarator_list", "array_declarator","fixed_array_size_list","fixed_array_size","prop_hash","ident", "new_ident","new_scope","new_or_prev_scope","pop_scope","ns_new_ident","ns_prev_ident", "cur_ns_new_or_prev_ident","ns_global_ident","string_lit_list","positive_int_const", "z_declspec","z_props","@13","integer_lit","string_lit","char_lit","fixed_pt_lit", "floating_pt_lit","boolean_lit","codefrag","srcfile","dqstring_cat","dqstring", "sqstring","" }; #endif static const short yyr1[] = { 0, 79, 79, 80, 80, 81, 81, 82, 82, 83, 84, 84, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 89, 88, 90, 90, 90, 92, 93, 91, 91, 94, 94, 95, 95, 96, 97, 97, 98, 98, 98, 98, 98, 98, 98, 99, 100, 100, 100, 100, 100, 101, 100, 102, 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 107, 107, 109, 110, 108, 112, 113, 111, 114, 114, 114, 114, 114, 115, 116, 116, 117, 118, 119, 119, 120, 120, 121, 122, 123, 124, 125, 125, 126, 126, 127, 129, 128, 130, 130, 131, 131, 132, 132, 132, 132, 132, 132, 133, 133, 134, 135, 137, 136, 136, 138, 138, 139, 139, 140, 140, 141, 141, 143, 142, 144, 144, 144, 144, 145, 145, 146, 146, 147, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, 151, 151, 152, 152, 153, 153, 154, 154, 154, 155, 155, 155, 156, 156, 156, 156, 157, 157, 158, 158, 158, 159, 159, 159, 160, 160, 160, 160, 160, 160, 162, 161, 163, 164, 164, 164, 165, 165, 166, 166, 167, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, 170, 170, 171, 171, 171, 172, 173, 174, 174, 175, 175, 175, 176, 177, 178, 179, 179, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 191, 192, 192, 193, 193, 194, 195, 196, 196, 197, 198, 198, 199, 199, 200, 200, 200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 210, 211, 212, 212, 213, 214, 213, 215, 216, 217, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225 }; static const short yyr2[] = { 0, 0, 1, 0, 1, 1, 2, 1, 0, 1, 1, 0, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 0, 7, 1, 1, 1, 0, 0, 12, 5, 0, 2, 1, 3, 1, 0, 2, 2, 2, 2, 2, 2, 1, 1, 2, 3, 1, 1, 1, 3, 0, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 9, 0, 0, 13, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 2, 3, 2, 2, 5, 2, 6, 0, 2, 0, 1, 2, 0, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 8, 0, 2, 1, 0, 1, 0, 2, 4, 3, 1, 3, 0, 5, 1, 1, 1, 1, 0, 1, 0, 1, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 0, 7, 1, 1, 2, 3, 1, 3, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 4, 1, 1, 2, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, 1, 2, 3, 2, 2, 4, 1, 3, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 3, 1, 0, 1, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1 }; static const short yydefact[] = { 261, 0, 262, 249, 274, 9, 261, 21, 20, 5, 0, 8, 8, 8, 8, 8, 12, 178, 255, 179, 263, 18, 19, 257, 180, 6, 256, 23, 252, 7, 17, 16, 13, 14, 15, 0, 0, 0, 22, 273, 264, 46, 48, 49, 87, 89, 50, 0, 0, 181, 223, 221, 203, 206, 202, 213, 224, 212, 229, 0, 222, 231, 0, 144, 140, 143, 135, 207, 209, 210, 211, 208, 215, 216, 217, 136, 138, 139, 137, 141, 142, 254, 0, 251, 0, 176, 0, 0, 67, 263, 70, 261, 204, 214, 0, 219, 218, 0, 0, 250, 91, 247, 0, 63, 26, 27, 253, 25, 51, 236, 65, 225, 0, 226, 0, 227, 47, 0, 55, 56, 60, 61, 62, 59, 57, 58, 196, 187, 199, 188, 189, 190, 191, 192, 193, 194, 195, 197, 198, 0, 65, 0, 261, 272, 271, 270, 266, 278, 277, 269, 0, 165, 164, 166, 260, 145, 146, 148, 150, 152, 155, 158, 0, 163, 168, 167, 0, 170, 171, 172, 173, 174, 175, 267, 275, 268, 220, 0, 0, 263, 245, 0, 265, 0, 64, 253, 31, 52, 0, 66, 0, 0, 54, 232, 234, 235, 237, 236, 0, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 162, 228, 276, 230, 88, 253, 0, 92, 248, 0, 32, 0, 68, 0, 0, 10, 0, 0, 240, 241, 0, 24, 169, 147, 149, 151, 154, 153, 156, 157, 159, 160, 161, 90, 8, 246, 11, 182, 0, 29, 53, 263, 0, 0, 201, 233, 244, 0, 242, 263, 186, 177, 0, 11, 34, 0, 263, 184, 0, 0, 243, 213, 0, 76, 77, 73, 74, 75, 0, 183, 0, 37, 253, 185, 205, 200, 0, 35, 0, 261, 69, 71, 253, 45, 38, 8, 8, 8, 8, 8, 263, 44, 0, 30, 39, 43, 40, 42, 41, 95, 110, 108, 0, 0, 0, 78, 79, 263, 83, 109, 94, 0, 112, 0, 86, 253, 80, 0, 8, 84, 96, 114, 0, 263, 85, 72, 82, 81, 263, 0, 101, 107, 113, 106, 102, 100, 105, 103, 104, 99, 0, 98, 263, 253, 238, 97, 116, 0, 11, 121, 263, 129, 0, 120, 10, 263, 0, 125, 127, 126, 128, 123, 0, 131, 130, 239, 118, 122, 119, 263, 0, 0, 111, 132, 0, 11, 0, 124, 133, 11, 258, 134, 0, 259, 0, 0, 0 }; static const short yydefgoto[] = { 395, 141, 6, 30, 7, 227, 8, 9, 10, 11, 48, 106, 12, 185, 266, 250, 264, 289, 290, 295, 13, 41, 222, 116, 217, 118, 119, 183, 188, 120, 110, 252, 121, 140, 303, 273, 315, 316, 317, 329, 318, 319, 14, 44, 15, 45, 179, 322, 299, 310, 339, 351, 342, 352, 323, 300, 311, 333, 334, 358, 367, 354, 359, 360, 380, 372, 374, 383, 375, 384, 62, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 122, 103, 165, 17, 247, 267, 218, 124, 125, 126, 127, 128, 65, 129, 67, 68, 69, 70, 71, 72, 73, 74, 130, 131, 132, 133, 134, 135, 136, 137, 138, 192, 193, 194, 195, 356, 196, 229, 230, 102, 18, 109, 189, 27, 186, 99, 19, 28, 24, 390, 166, 20, 139, 84, 167, 168, 169, 170, 171, 172, 21, 22, 173, 174, 175 }; static const short yypact[] = { 55, -13,-32768,-32768,-32768,-32768, 88,-32768,-32768,-32768, -13, -31, -31, -31, -31, -31,-32768, 23,-32768,-32768, 27, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, -13, 711, -13,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768, 171, 8,-32768,-32768, -32768,-32768,-32768,-32768, 73,-32768,-32768, 51, 62,-32768, 54, -13,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768, 75,-32768, 11,-32768, 7, -13,-32768, 608,-32768, 264,-32768,-32768, 619, 124,-32768, 619, 97,-32768,-32768, 119, -9, -13,-32768,-32768, 135,-32768, 114,-32768, -13, -32768, 113,-32768, 127,-32768,-32768, -13,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 40, -13, 144, 288,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 619, -32768,-32768,-32768,-32768, 141, 148, 152, 90, 129, 83, -32768, 175,-32768,-32768,-32768, 149,-32768,-32768,-32768,-32768, -32768,-32768, 177,-32768,-32768,-32768, 159, 619, 466,-32768, 185,-32768, 176,-32768,-32768,-32768,-32768, 179,-32768, 619, 676, -21,-32768,-32768,-32768,-32768, 160, 204,-32768, 178, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, -32768,-32768,-32768,-32768,-32768,-32768, -13,-32768, 199, -13, 188, 200,-32768, 193, 15,-32768, -13, 96, 160,-32768, 190,-32768,-32768, 148, 152, 90, 129, 129, 83, 83, -32768,-32768,-32768,-32768, 155,-32768, 117,-32768, 6,-32768, -32768, 608, 208, 619,-32768,-32768,-32768, 180,-32768, 46, -32768,-32768, -13, 158,-32768, 196, 514,-32768, 183, 184, -32768, 241, 202,-32768,-32768,-32768,-32768,-32768, 251,-32768, 6,-32768,-32768,-32768,-32768,-32768, 207,-32768, 203, 76, -32768,-32768,-32768,-32768,-32768, -31, -31, -31, -31, -31, 20,-32768, 122,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768, 169, 619, 211, 209, 122,-32768, 420,-32768,-32768, -32768, 265, 231, 213,-32768,-32768,-32768, -13, -31,-32768, -32768,-32768, -13, 608,-32768,-32768,-32768,-32768, 562, 214, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -13,-32768, 0,-32768,-32768, -21,-32768, 212, 42,-32768, 372, 248, -13,-32768, 237, 215, 216,-32768,-32768,-32768, -32768,-32768, 218, 276,-32768,-32768,-32768,-32768,-32768, 562, 6, 225,-32768,-32768, -13, 99, 177,-32768,-32768, 116, -32768,-32768, 177,-32768, 289, 293,-32768 }; static const short yypgoto[] = {-32768, -32768, 205, 1, 4, -218,-32768, 19,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768, -86,-32768,-32768,-32768, 13, -32768,-32768,-32768, -71, 118, -272,-32768, 164, -14,-32768, -32768, -10,-32768,-32768,-32768,-32768,-32768, -6,-32768,-32768, -3, 29,-32768, 30,-32768,-32768,-32768,-32768,-32768,-32768, -317,-32768, -8,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, -49,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -131,-32768, 123, 126, 115, 28, 17, -23,-32768, 173, -32768, -17,-32768, 5,-32768,-32768,-32768, -196, -269,-32768, -261, 295, -209,-32768, -16,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768, -15, 301, -12, 302,-32768,-32768,-32768, -32, -28, 125, -201, -80,-32768,-32768,-32768,-32768, 112, -32768, -1, -60, -25, 257, -162, -20,-32768,-32768,-32768, -32768, -75, 61, -19,-32768, 100, -288,-32768,-32768,-32768, -32768, 64,-32768,-32768, 182,-32768 }; #define YYLAST 763 static const short yytable[] = { 23, 47, 98, 46, 79, 16, 42, 108, 80, 26, 43, 16, 82, 31, 32, 33, 34, 83, 117, 200, 66, 75, 177, 221, 77, 25, 256, 29, 36, 263, 104, -11, 1, 37, 49, 36, 81, 232, 226, 3, 37, 63, 357, 184, 371, 105, 281, 215, 38, 35, 181, 50, 85, 51, 244, -1, 268, 197, 3, 3, 101, 81, 341, 385, -115, 345, 272, 341, 91, 182, 345, 284, 1, 346, 254, 88, 39, 40, 346, 57, 90, 1, 95, 39, 92, 26, 81, 59, -2, 341, 83, 255, 345, 93, 123, 96, 16, 40, 3, 391, 346, 365, 81, 2, 40, 394, -117, 3, 341, 81, 143, 345, 4, 5, 1, 224, 81, 204, 205, 346, 83, 291, 1, 40, 2, 347, 94, 337, 313, 97, 347, 304, 314, 144, 5, 100, 2, -36, 363, 81, 3, 366, 145, 146, 176, 4, 5, 16, 3, 147, 148, 149, 347, 258, 208, 209, 210, 197, 226, 150, 248, 25, 178, 389, 336, 151, 152, 197, 281, 180, 153, 347, 393, -93, 257, 226, 226, 187, 262, 270, 392, 85, 324, 85, 123, 241, 242, 243, 190, 143, 86, 87, 362, 87, 320, -28, 123, -28, 206, 207, 321, 1, 191, 280, 88, 199, 88, 201, 89, 90, 89, 90, 144, 29, 226, 202, 81, 226, -33, 81, 203, 145, 146, 239, 240, 212, 81, 3, 147, 148, 149, 148, 237, 238, 219, 214, 220, 228, 150, 223, 231, 279, 233, 274, 276, 277, 261, 328, 278, 246, 249, 251, 253, 260, 265, 146, 282, 123, 271, 285, 286, 93, 81, 85, 293, 275, 287, 292, 197, 331, 326, 355, 123, 325, 332, 335, 364, 353, 373, 377, 379, 381, 312, 376, 46, 382, 288, 42, 387, 396, 1, 43, 40, 397, 294, 386, 142, 305, 306, 307, 308, 309, 348, 296, 198, 388, 349, 348, 340, 225, 327, 349, 2, 83, 1, 330, 3, 378, 236, 297, 298, 4, 5, 123, 234, -3, 343, 81, 235, 348, 338, 64, 81, 349, 361, 211, 2, 76, 78, 344, 3, 259, 245, 107, 344, 4, 5, 361, 348, -4, 81, 301, 349, 269, 302, 213, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 344, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 50, 0, 51, 0, 0, 0, 52, 81, 344, 265, 112, 54, 368, 369, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 370, 0, 0, 114, 57, 58, 0, 0, 0, 115, 0, 0, 59, 0, 350, 60, 61, 0, 0, 0, 0, 0, 111, 3, 50, 313, 51, 0, 0, 314, 52, 0, 0, 0, 112, 54, 0, 0, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 40, 0, 0, 114, 57, 58, 0, 0, 0, 115, 0, 0, 59, 0, 0, 60, 61, 0, 0, 0, 111, 0, 50, 3, 51, 0, 0, 0, 52, 0, 0, 0, 112, 54, 0, 0, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 0, 0, 40, 114, 57, 58, 0, 0, 0, 115, 0, 0, 59, 0, 0, 60, 61, 0, 0, 0, 0, 0, 111, 3, 50, 0, 51, 0, 0, 0, 52, 0, 216, 0, 112, 54, 0, 0, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 40, 0, 0, 114, 57, 58, 0, 0, 0, 115, 0, 0, 59, 0, 0, 60, 61, 0, 0, 0, 0, 0, 111, 3, 50, 0, 51, 0, 0, 0, 52, 0, 283, 0, 112, 54, 0, 0, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 40, 0, 0, 114, 57, 58, 0, 0, 0, 115, 0, 0, 59, 0, 350, 60, 61, 0, 0, 0, 111, 0, 50, 3, 51, 0, 0, 0, 52, 0, 0, 0, 112, 54, 0, 0, 0, 55, 0, 0, 113, 56, 143, 1, 0, 0, 0, 0, 40, 114, 57, 58, 0, 0, 1, 115, 0, 0, 59, 0, 0, 60, 61, 0, 0, 144, 0, 0, 0, 3, 0, 0, 0, 0, 145, 146, 0, 0, 0, 0, 3, 147, 148, 149, 0, 0, 0, 0, 111, 0, 50, 150, 51, 0, 40, 0, 52, 151, 152, 0, 112, 54, 153, 0, 0, 55, 0, 0, 113, 56, 0, 1, 0, 0, 0, 0, 0, 114, 57, 58, 0, 0, 0, 115, 0, 50, 59, 51, 0, 60, 61, 52, 0, 0, 0, 53, 54, 3, 0, 0, 55, 0, 0, 0, 56, 0, 1, 0, 0, 0, 0, 0, 0, 57, 58, 0, 0, 0, 0, 0, 0, 59, 0, 0, 60, 61, 0, 0, 0, 0, 0, 0, 3 }; static const short yycheck[] = { 1, 20, 62, 20, 36, 0, 20, 87, 36, 10, 20, 6, 37, 12, 13, 14, 15, 37, 89, 150, 36, 36, 97, 185, 36, 6, 227, 58, 8, 247, 23, 52, 26, 13, 35, 8, 37, 199, 59, 52, 13, 36, 42, 103, 361, 38, 264, 178, 21, 26, 59, 5, 12, 7, 216, 0, 252, 117, 52, 52, 49, 62, 334, 380, 64, 334, 20, 339, 60, 78, 339, 267, 26, 334, 59, 35, 56, 77, 339, 33, 40, 26, 20, 56, 11, 86, 87, 41, 0, 361, 110, 76, 361, 20, 89, 33, 91, 77, 52, 387, 361, 59, 103, 48, 77, 393, 64, 52, 380, 110, 14, 380, 57, 58, 26, 190, 117, 27, 28, 380, 140, 283, 26, 77, 48, 334, 75, 328, 6, 75, 339, 293, 10, 37, 58, 60, 48, 61, 356, 140, 52, 359, 46, 47, 20, 57, 58, 142, 52, 53, 54, 55, 361, 228, 71, 72, 73, 217, 59, 63, 220, 142, 65, 64, 326, 69, 70, 227, 386, 50, 74, 380, 390, 4, 78, 59, 59, 63, 61, 254, 64, 12, 313, 12, 179, 208, 209, 210, 75, 14, 19, 22, 354, 22, 25, 60, 191, 62, 69, 70, 31, 26, 75, 263, 35, 61, 35, 66, 39, 40, 39, 40, 37, 58, 59, 67, 217, 59, 60, 220, 68, 46, 47, 206, 207, 76, 227, 52, 53, 54, 55, 54, 204, 205, 49, 76, 60, 77, 63, 60, 36, 260, 64, 260, 260, 260, 245, 318, 260, 50, 62, 51, 59, 63, 249, 47, 60, 252, 78, 76, 76, 20, 263, 12, 61, 260, 64, 60, 328, 4, 61, 351, 267, 62, 43, 62, 64, 63, 30, 42, 64, 63, 301, 363, 301, 9, 281, 301, 63, 0, 26, 301, 77, 0, 290, 381, 91, 296, 297, 298, 299, 300, 334, 290, 140, 385, 334, 339, 333, 191, 316, 339, 48, 333, 26, 318, 52, 366, 203, 290, 290, 57, 58, 318, 201, 61, 334, 328, 202, 361, 329, 36, 333, 361, 353, 162, 48, 36, 36, 334, 52, 229, 217, 86, 339, 57, 58, 366, 380, 61, 351, 290, 380, 253, 290, 173, -1, -1, -1, -1, -1, -1, 363, -1, -1, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, 5, -1, 7, -1, -1, -1, 11, 385, 380, 381, 15, 16, 17, 18, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, 29, -1, -1, 32, 33, 34, -1, -1, -1, 38, -1, -1, 41, -1, 43, 44, 45, -1, -1, -1, -1, -1, 3, 52, 5, 6, 7, -1, -1, 10, 11, -1, -1, -1, 15, 16, -1, -1, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, 77, -1, -1, 32, 33, 34, -1, -1, -1, 38, -1, -1, 41, -1, -1, 44, 45, -1, -1, -1, 3, -1, 5, 52, 7, -1, -1, -1, 11, -1, -1, -1, 15, 16, -1, -1, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, -1, -1, 77, 32, 33, 34, -1, -1, -1, 38, -1, -1, 41, -1, -1, 44, 45, -1, -1, -1, -1, -1, 3, 52, 5, -1, 7, -1, -1, -1, 11, -1, 61, -1, 15, 16, -1, -1, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, 77, -1, -1, 32, 33, 34, -1, -1, -1, 38, -1, -1, 41, -1, -1, 44, 45, -1, -1, -1, -1, -1, 3, 52, 5, -1, 7, -1, -1, -1, 11, -1, 61, -1, 15, 16, -1, -1, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, 77, -1, -1, 32, 33, 34, -1, -1, -1, 38, -1, -1, 41, -1, 43, 44, 45, -1, -1, -1, 3, -1, 5, 52, 7, -1, -1, -1, 11, -1, -1, -1, 15, 16, -1, -1, -1, 20, -1, -1, 23, 24, 14, 26, -1, -1, -1, -1, 77, 32, 33, 34, -1, -1, 26, 38, -1, -1, 41, -1, -1, 44, 45, -1, -1, 37, -1, -1, -1, 52, -1, -1, -1, -1, 46, 47, -1, -1, -1, -1, 52, 53, 54, 55, -1, -1, -1, -1, 3, -1, 5, 63, 7, -1, 77, -1, 11, 69, 70, -1, 15, 16, 74, -1, -1, 20, -1, -1, 23, 24, -1, 26, -1, -1, -1, -1, -1, 32, 33, 34, -1, -1, -1, 38, -1, 5, 41, 7, -1, 44, 45, 11, -1, -1, -1, 15, 16, 52, -1, -1, 20, -1, -1, -1, 24, -1, 26, -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, -1, -1, -1, -1, 41, -1, -1, 44, 45, -1, -1, -1, -1, -1, -1, 52 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef alloca #ifdef __GNUC__ #define alloca __builtin_alloca #else /* not GNU C. */ #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) #include #else /* not sparc */ #if defined (MSDOS) && !defined (__TURBOC__) #include #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) #include #pragma alloca #else /* not MSDOS, __TURBOC__, or _AIX */ #ifdef __hpux #ifdef __cplusplus extern "C" { void *alloca (unsigned int); }; #else /* not __cplusplus */ void *alloca (); #endif /* not __cplusplus */ #endif /* __hpux */ #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ #endif /* not sparc. */ #endif /* not GNU C. */ #endif /* alloca not defined. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT return(0) #define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #define YYLEX yylex(&yylval, &yylloc) #else #define YYLEX yylex(&yylval) #endif #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ int yyparse (void); #endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_bcopy (from, to, count) char *from; char *to; int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_bcopy (char *from, char *to, int count) { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 184 "bison.simple" int yyparse() { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 309 "parser.y" { yyerror ("Empty file"); YYABORT; ; break;} case 2: #line 310 "parser.y" { __IDL_root = yyvsp[0].tree; ; break;} case 3: #line 313 "parser.y" { yyval.tree = NULL; ; break;} case 5: #line 317 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 6: #line 318 "parser.y" { yyval.tree = list_chain (yyvsp[-1].tree, yyvsp[0].tree, TRUE); ; break;} case 8: #line 322 "parser.y" { if (do_token_error (yyvsp[0].tree, "Missing semicolon after", TRUE)) YYABORT; ; break;} case 9: #line 328 "parser.y" { yyerror ("Dangling semicolon has no effect"); yyval.tree = NULL; ; break;} case 11: #line 335 "parser.y" { if (do_token_error (yyvsp[0].tree, "Missing comma after", TRUE)) YYABORT; ; break;} case 12: #line 341 "parser.y" { if (IDL_NODE_UP (yyvsp[0].tree)) do_token_error (IDL_NODE_UP (yyvsp[0].tree), "Illegal context for", FALSE); else yyerror ("Illegal context for identifier"); YYABORT; ; break;} case 23: #line 365 "parser.y" { if (IDL_NODE_UP (yyvsp[0].tree) != NULL && IDL_NODE_TYPE (IDL_NODE_UP (yyvsp[0].tree)) != IDLN_MODULE) { yyerror ("Module definition conflicts"); do_token_error (IDL_NODE_UP (yyvsp[0].tree), "with", FALSE); YYABORT; } ; break;} case 24: #line 374 "parser.y" { IDL_tree module; if (yyvsp[-2].tree == NULL) { yyerrorv ("Empty module declaration `%s' is not legal IDL", IDL_IDENT (yyvsp[-5].tree).str); module = NULL; } if (__IDL_flags & IDLF_COMBINE_REOPENED_MODULES) { if (IDL_NODE_UP (yyvsp[-5].tree) == NULL) module = IDL_module_new (yyvsp[-5].tree, yyvsp[-2].tree); else { module = IDL_NODE_UP (yyvsp[-5].tree); IDL_MODULE (module).definition_list = IDL_list_concat (IDL_MODULE (module).definition_list, yyvsp[-2].tree); module = NULL; } } else module = IDL_module_new (yyvsp[-5].tree, yyvsp[-2].tree); yyval.tree = module; if (yyval.tree) assign_declspec (yyval.tree, yyvsp[-6].declspec); ; break;} case 26: #line 403 "parser.y" { yyerror ("Interfaces cannot be named `Object'"); YYABORT; ; break;} case 27: #line 407 "parser.y" { yyerror ("Interfaces cannot be named `TypeCode'"); YYABORT; ; break;} case 28: #line 416 "parser.y" { assert (yyvsp[0].tree != NULL); assert (IDL_NODE_TYPE (yyvsp[0].tree) == IDLN_IDENT); assert (IDL_IDENT_TO_NS (yyvsp[0].tree) != NULL); assert (IDL_NODE_TYPE (IDL_IDENT_TO_NS (yyvsp[0].tree)) == IDLN_GENTREE); if (IDL_NODE_UP (yyvsp[0].tree) != NULL && IDL_NODE_TYPE (IDL_NODE_UP (yyvsp[0].tree)) != IDLN_INTERFACE && IDL_NODE_TYPE (IDL_NODE_UP (yyvsp[0].tree)) != IDLN_FORWARD_DCL) { yyerrorl ("Interface definition conflicts", __IDL_prev_token_line - __IDL_cur_token_line); do_token_error (IDL_NODE_UP (yyvsp[0].tree), "with", FALSE); YYABORT; } else if (IDL_NODE_UP (yyvsp[0].tree) != NULL && IDL_NODE_TYPE (IDL_NODE_UP (yyvsp[0].tree)) != IDLN_FORWARD_DCL) { yyerrorv ("Cannot redeclare interface `%s'", IDL_IDENT (yyvsp[0].tree).str); IDL_tree_error (yyvsp[0].tree, "Previous declaration of interface `%s'", IDL_IDENT (yyvsp[0].tree).str); YYABORT; } else if (IDL_NODE_UP (yyvsp[0].tree) != NULL && IDL_NODE_TYPE (IDL_NODE_UP (yyvsp[0].tree)) == IDLN_FORWARD_DCL) __IDL_assign_this_location (yyvsp[0].tree, __IDL_cur_filename, __IDL_cur_line); ; break;} case 29: #line 439 "parser.y" { IDL_GENTREE (IDL_IDENT_TO_NS (yyvsp[-3].tree))._import = yyvsp[0].tree; IDL_ns_push_scope (__IDL_root_ns, IDL_IDENT_TO_NS (yyvsp[-3].tree)); if (IDL_ns_check_for_ambiguous_inheritance (yyvsp[-3].tree, yyvsp[0].tree)) __IDL_is_okay = FALSE; ; break;} case 30: #line 446 "parser.y" { yyval.tree = IDL_interface_new (yyvsp[-8].tree, yyvsp[-5].tree, yyvsp[-2].tree); assign_declspec (yyval.tree, yyvsp[-11].declspec); assign_props (IDL_INTERFACE (yyval.tree).ident, yyvsp[-10].hash_table); ; break;} case 31: #line 455 "parser.y" { if (yyvsp[-3].hash_table) yywarningv (IDL_WARNING1, "Ignoring properties for forward declaration `%s'", IDL_IDENT (yyvsp[-1].tree).str); yyval.tree = IDL_forward_dcl_new (yyvsp[-1].tree); assign_declspec (yyval.tree, yyvsp[-4].declspec); ; break;} case 32: #line 464 "parser.y" { yyval.tree = NULL; ; break;} case 33: #line 465 "parser.y" { GHashTable *table = g_hash_table_new (g_direct_hash, g_direct_equal); gboolean die = FALSE; IDL_tree p = yyvsp[0].tree; assert (IDL_NODE_TYPE (p) == IDLN_LIST); for (; p != NULL && !die; p = IDL_LIST (p).next) { assert (IDL_LIST (p).data != NULL); assert (IDL_NODE_TYPE (IDL_LIST (p).data) == IDLN_IDENT); if (g_hash_table_lookup_extended (table, IDL_LIST (p).data, NULL, NULL)) { char *s = IDL_ns_ident_to_qstring (IDL_LIST (p).data, "::", 0); yyerrorv ("Cannot inherit from interface `%s' more than once", s); g_free (s); die = TRUE; break; } else g_hash_table_insert (table, IDL_LIST (p).data, NULL); if (IDL_NODE_TYPE (IDL_NODE_UP (IDL_LIST (p).data)) == IDLN_FORWARD_DCL) { char *s = IDL_ns_ident_to_qstring (IDL_LIST (p).data, "::", 0); yyerrorv ("Incomplete definition of interface `%s'", s); IDL_tree_error (IDL_LIST (p).data, "Previous forward declaration of `%s'", s); g_free (s); die = TRUE; } else if (IDL_NODE_TYPE (IDL_NODE_UP (IDL_LIST (p).data)) != IDLN_INTERFACE) { char *s = IDL_ns_ident_to_qstring (IDL_LIST (p).data, "::", 0); yyerrorv ("`%s' is not an interface", s); IDL_tree_error (IDL_LIST (p).data, "Previous declaration of `%s'", s); g_free (s); die = TRUE; } } g_hash_table_destroy (table); if (die) YYABORT; yyval.tree = yyvsp[0].tree; ; break;} case 34: #line 511 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 35: #line 513 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 37: #line 519 "parser.y" { yyval.tree = NULL; ; break;} case 38: #line 520 "parser.y" { yyval.tree = zlist_chain (yyvsp[-1].tree, yyvsp[0].tree, TRUE); ; break;} case 46: #line 532 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 47: #line 539 "parser.y" { IDL_tree_node node; IDL_tree p, dcl; yyval.tree = yyvsp[0].tree; node.properties = yyvsp[-2].hash_table; for (p = IDL_TYPE_DCL (yyvsp[0].tree).dcls; p; p = IDL_LIST (p).next) { dcl = IDL_LIST (p).data; IDL_tree_properties_copy (&node, dcl); } __IDL_free_properties (node.properties); ; break;} case 51: #line 555 "parser.y" { yyval.tree = IDL_native_new (yyvsp[0].tree); assign_props (IDL_NATIVE (yyval.tree).ident, yyvsp[-2].hash_table); ; break;} case 52: #line 560 "parser.y" { /* Enable native type scanning */ if (__IDL_pidl > 0) __IDL_flagsi |= IDLFP_NATIVE; else { yyerror ("Native syntax not enabled"); YYABORT; } ; break;} case 53: #line 568 "parser.y" { yyval.tree = IDL_native_new (yyvsp[-3].tree); IDL_NATIVE (yyval.tree).user_type = yyvsp[0].str; assign_props (IDL_NATIVE (yyval.tree).ident, yyvsp[-5].hash_table); ; break;} case 54: #line 575 "parser.y" { yyval.tree = IDL_type_dcl_new (yyvsp[-1].tree, yyvsp[0].tree); ; break;} case 63: #line 592 "parser.y" { yyerrorv ("Missing identifier in %s definition", yyvsp[0].str); YYABORT; ; break;} case 65: #line 599 "parser.y" { yyerrorv ("Missing identifier in %s definition", yyvsp[0].str); YYABORT; ; break;} case 67: #line 607 "parser.y" { yyval.str = "struct"; ; break;} case 68: #line 608 "parser.y" { g_hash_table_insert (__IDL_structunion_ht, yyvsp[-1].tree, yyvsp[-1].tree); yyval.tree = IDL_type_struct_new (yyvsp[-1].tree, NULL); ; break;} case 69: #line 612 "parser.y" { g_hash_table_remove (__IDL_structunion_ht, yyvsp[-5].tree); yyval.tree = yyvsp[-3].tree; __IDL_assign_up_node (yyval.tree, yyvsp[-2].tree); IDL_TYPE_STRUCT (yyval.tree).member_list = yyvsp[-2].tree; assign_props (IDL_TYPE_STRUCT (yyval.tree).ident, yyvsp[-8].hash_table); ; break;} case 70: #line 622 "parser.y" { yyval.str = "union"; ; break;} case 71: #line 625 "parser.y" { g_hash_table_insert (__IDL_structunion_ht, yyvsp[-5].tree, yyvsp[-5].tree); yyval.tree = IDL_type_union_new (yyvsp[-5].tree, yyvsp[-2].tree, NULL); ; break;} case 72: #line 629 "parser.y" { g_hash_table_remove (__IDL_structunion_ht, yyvsp[-9].tree); yyval.tree = yyvsp[-3].tree; __IDL_assign_up_node (yyval.tree, yyvsp[-2].tree); IDL_TYPE_UNION (yyval.tree).switch_body = yyvsp[-2].tree; assign_props (IDL_TYPE_UNION (yyval.tree).ident, yyvsp[-12].hash_table); ; break;} case 79: #line 648 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 80: #line 649 "parser.y" { yyval.tree = list_chain (yyvsp[-1].tree, yyvsp[0].tree, TRUE); ; break;} case 81: #line 653 "parser.y" { yyval.tree = IDL_case_stmt_new (yyvsp[-2].tree, yyvsp[-1].tree); ; break;} case 82: #line 656 "parser.y" { char *s; yyval.tree = IDL_member_new (yyvsp[-1].tree, list_start (yyvsp[0].tree, TRUE)); if (IDL_NODE_TYPE (yyvsp[-1].tree) == IDLN_IDENT && g_hash_table_lookup (__IDL_structunion_ht, yyvsp[-1].tree)) { s = IDL_ns_ident_to_qstring (yyvsp[0].tree, "::", 0); yyerrorv ("Member `%s'", s); do_token_error (IDL_NODE_UP (yyvsp[-1].tree), "recurses", TRUE); g_free (s); } ; break;} case 83: #line 670 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, FALSE); ; break;} case 84: #line 671 "parser.y" { yyval.tree = list_chain (yyvsp[-1].tree, yyvsp[0].tree, FALSE); ; break;} case 85: #line 674 "parser.y" { yyval.tree = yyvsp[-1].tree; ; break;} case 86: #line 675 "parser.y" { yyval.tree = NULL; ; break;} case 87: #line 678 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 88: #line 685 "parser.y" { yyval.tree = IDL_const_dcl_new (yyvsp[-3].tree, yyvsp[-2].tree, yyvsp[0].tree); /* Should probably do some type checking here... */ ; break;} case 89: #line 691 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 90: #line 699 "parser.y" { yyval.tree = IDL_except_dcl_new (yyvsp[-4].tree, yyvsp[-2].tree); ; break;} case 91: #line 702 "parser.y" { yyval.tree = NULL; ; break;} case 92: #line 703 "parser.y" { yyval.tree = zlist_chain (yyvsp[-1].tree, yyvsp[0].tree, TRUE); ; break;} case 93: #line 706 "parser.y" { yyval.boolean = FALSE; ; break;} case 94: #line 707 "parser.y" { yyval.boolean = TRUE; ; break;} case 95: #line 710 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 96: #line 719 "parser.y" { yyval.str = "attribute"; ; break;} case 97: #line 721 "parser.y" { IDL_tree_node node; IDL_tree p, dcl; yyval.tree = IDL_attr_dcl_new (yyvsp[-4].boolean, yyvsp[-1].tree, yyvsp[0].tree); node.properties = yyvsp[-5].hash_table; for (p = yyvsp[0].tree; p; p = IDL_LIST (p).next) { dcl = IDL_LIST (p).data; IDL_tree_properties_copy (&node, dcl); } __IDL_free_properties (node.properties); ; break;} case 99: #line 736 "parser.y" { yyerrorv ("Illegal type `void' for %s", yyvsp[-1].str); yyval.tree = NULL; ; break;} case 107: #line 752 "parser.y" { illegal_context_type_error (yyvsp[0].tree, yyvsp[-1].str); yyval.tree = yyvsp[0].tree; ; break;} case 108: #line 758 "parser.y" { yyval.boolean = FALSE; ; break;} case 109: #line 759 "parser.y" { yyval.boolean = TRUE; ; break;} case 110: #line 762 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 111: #line 773 "parser.y" { yyval.tree = IDL_op_dcl_new (yyvsp[-6].boolean, yyvsp[-5].tree, yyvsp[-4].tree, yyvsp[-3].treedata.tree, yyvsp[-1].tree, yyvsp[0].tree); IDL_OP_DCL (yyval.tree).f_varargs = GPOINTER_TO_INT (yyvsp[-3].treedata.data); assign_props (IDL_OP_DCL (yyval.tree).ident, yyvsp[-7].hash_table); ; break;} case 112: #line 780 "parser.y" { yyval.str = "operation return value"; ; break;} case 113: #line 781 "parser.y" { yyval.tree = yyvsp[0].tree; ; break;} case 114: #line 782 "parser.y" { yyval.tree = NULL; ; break;} case 115: #line 785 "parser.y" { yyval.boolean = FALSE; ; break;} case 116: #line 786 "parser.y" { yyval.boolean = TRUE; ; break;} case 117: #line 789 "parser.y" { yyval.boolean = FALSE; ; break;} case 118: #line 790 "parser.y" { yyval.boolean = TRUE; ; break;} case 119: #line 796 "parser.y" { yyval.treedata.tree = yyvsp[-2].tree; yyval.treedata.data = GINT_TO_POINTER (yyvsp[-1].boolean); ; break;} case 120: #line 800 "parser.y" { yyval.treedata.tree = NULL; yyval.treedata.data = GINT_TO_POINTER (yyvsp[-1].boolean); ; break;} case 121: #line 806 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 122: #line 808 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 123: #line 813 "parser.y" { yyval.str = "parameter"; ; break;} case 124: #line 815 "parser.y" { yyval.tree = IDL_param_dcl_new (yyvsp[-3].paramattr, yyvsp[-1].tree, yyvsp[0].tree); assign_props (IDL_PARAM_DCL (yyval.tree).simple_declarator, yyvsp[-4].hash_table); ; break;} case 125: #line 821 "parser.y" { yyval.paramattr = IDL_PARAM_IN; ; break;} case 126: #line 822 "parser.y" { yyval.paramattr = IDL_PARAM_OUT; ; break;} case 127: #line 823 "parser.y" { yyval.paramattr = IDL_PARAM_INOUT; ; break;} case 128: #line 824 "parser.y" { yyerrorv ("Missing direction attribute (in, out, inout) before parameter"); IDL_tree_free (yyvsp[0].tree); ; break;} case 129: #line 830 "parser.y" { yyval.tree = NULL; ; break;} case 131: #line 834 "parser.y" { yyval.tree = NULL; ; break;} case 133: #line 840 "parser.y" { yyval.tree = yyvsp[-1].tree; ; break;} case 134: #line 845 "parser.y" { yyval.tree = yyvsp[-1].tree; ; break;} case 147: #line 864 "parser.y" { do_binop (yyval.tree, IDL_BINOP_OR, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 149: #line 868 "parser.y" { do_binop (yyval.tree, IDL_BINOP_XOR, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 151: #line 872 "parser.y" { do_binop (yyval.tree, IDL_BINOP_AND, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 153: #line 876 "parser.y" { do_binop (yyval.tree, IDL_BINOP_SHR, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 154: #line 877 "parser.y" { do_binop (yyval.tree, IDL_BINOP_SHL, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 156: #line 881 "parser.y" { do_binop (yyval.tree, IDL_BINOP_ADD, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 157: #line 882 "parser.y" { do_binop (yyval.tree, IDL_BINOP_SUB, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 159: #line 886 "parser.y" { do_binop (yyval.tree, IDL_BINOP_MULT, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 160: #line 887 "parser.y" { do_binop (yyval.tree, IDL_BINOP_DIV, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 161: #line 888 "parser.y" { do_binop (yyval.tree, IDL_BINOP_MOD, yyvsp[-2].tree, yyvsp[0].tree); ; break;} case 162: #line 891 "parser.y" { do_unaryop (yyval.tree, yyvsp[-1].unaryop, yyvsp[0].tree); ; break;} case 164: #line 895 "parser.y" { yyval.unaryop = IDL_UNARYOP_MINUS; ; break;} case 165: #line 896 "parser.y" { yyval.unaryop = IDL_UNARYOP_PLUS; ; break;} case 166: #line 897 "parser.y" { yyval.unaryop = IDL_UNARYOP_COMPLEMENT; ; break;} case 167: #line 900 "parser.y" { IDL_tree p, literal; assert (IDL_NODE_TYPE (yyvsp[0].tree) == IDLN_IDENT); p = IDL_NODE_UP (yyvsp[0].tree); if ((literal = IDL_resolve_const_exp (yyvsp[0].tree, IDLN_ANY))) { ++IDL_NODE_REFS (literal); yyval.tree = literal; IDL_tree_free (yyvsp[0].tree); } else yyval.tree = yyvsp[0].tree; ; break;} case 169: #line 915 "parser.y" { yyval.tree = yyvsp[-1].tree; ; break;} case 176: #line 927 "parser.y" { yyval.str = "enum"; ; break;} case 177: #line 930 "parser.y" { yyval.tree = IDL_type_enum_new (yyvsp[-3].tree, yyvsp[-1].tree); assign_props (IDL_TYPE_ENUM (yyval.tree).ident, yyvsp[-6].hash_table); ; break;} case 178: #line 936 "parser.y" { assert (yyvsp[0].tree != NULL); assert (IDL_NODE_TYPE (yyvsp[0].tree) == IDLN_GENTREE); assert (IDL_NODE_TYPE (IDL_GENTREE (yyvsp[0].tree).data) == IDLN_IDENT); yyval.tree = IDL_GENTREE (yyvsp[0].tree).data; ; break;} case 180: #line 945 "parser.y" { yyval.tree = yyvsp[0].tree; ; break;} case 181: #line 947 "parser.y" { IDL_tree p; assert (IDL_NODE_TYPE (yyvsp[-2].tree) == IDLN_GENTREE); assert (IDL_NODE_TYPE (yyvsp[0].tree) == IDLN_IDENT); #ifdef YYDEBUG if (yydebug) fprintf (stderr, "ns: looking in `%s' for `%s'\n", IDL_IDENT (IDL_GENTREE (yyvsp[-2].tree).data).str, IDL_IDENT(yyvsp[0].tree).str); #endif if ((p = IDL_ns_lookup_this_scope (__IDL_root_ns, yyvsp[-2].tree, yyvsp[0].tree, NULL)) == NULL) { yyerrorv ("`%s' undeclared identifier", IDL_IDENT (yyvsp[0].tree).str); IDL_tree_free (yyvsp[0].tree); YYABORT; } IDL_tree_free (yyvsp[0].tree); #ifdef REF_IDENTS ++IDL_NODE_REFS (IDL_GENTREE (p).data); #endif yyval.tree = p; ; break;} case 182: #line 972 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 183: #line 974 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 184: #line 977 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 185: #line 978 "parser.y" { yyval.tree = list_chain (yyvsp[-1].tree, yyvsp[0].tree, TRUE); ; break;} case 186: #line 982 "parser.y" { char *s; yyval.tree = IDL_member_new (yyvsp[-2].tree, yyvsp[-1].tree); if (IDL_NODE_TYPE (yyvsp[-2].tree) == IDLN_IDENT && g_hash_table_lookup (__IDL_structunion_ht, yyvsp[-2].tree)) { s = IDL_ns_ident_to_qstring (IDL_LIST (yyvsp[-1].tree).data, "::", 0); yyerrorv ("Member `%s'", s); do_token_error (IDL_NODE_UP (yyvsp[-2].tree), "recurses", TRUE); g_free (s); } ; break;} case 200: #line 1015 "parser.y" { yyval.tree = IDL_type_sequence_new (yyvsp[-3].tree, yyvsp[-1].tree); ; break;} case 201: #line 1018 "parser.y" { yyval.tree = IDL_type_sequence_new (yyvsp[-1].tree, NULL); ; break;} case 202: #line 1021 "parser.y" { yyval.tree = IDL_type_float_new (IDL_FLOAT_TYPE_FLOAT); ; break;} case 203: #line 1022 "parser.y" { yyval.tree = IDL_type_float_new (IDL_FLOAT_TYPE_DOUBLE); ; break;} case 204: #line 1023 "parser.y" { yyval.tree = IDL_type_float_new (IDL_FLOAT_TYPE_LONGDOUBLE); ; break;} case 205: #line 1028 "parser.y" { yyval.tree = IDL_type_fixed_new (yyvsp[-3].tree, yyvsp[-1].tree); ; break;} case 206: #line 1031 "parser.y" { yyval.tree = IDL_type_fixed_new (NULL, NULL); ; break;} case 207: #line 1034 "parser.y" { yyval.tree = IDL_type_integer_new (TRUE, yyvsp[0].integer); ; break;} case 208: #line 1035 "parser.y" { yyval.tree = IDL_type_integer_new (FALSE, yyvsp[0].integer); ; break;} case 209: #line 1038 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_SHORT; ; break;} case 210: #line 1039 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_LONG; ; break;} case 211: #line 1040 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_LONGLONG; ; break;} case 215: #line 1052 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_SHORT; ; break;} case 216: #line 1053 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_LONG; ; break;} case 217: #line 1054 "parser.y" { yyval.integer = IDL_INTEGER_TYPE_LONGLONG; ; break;} case 221: #line 1066 "parser.y" { yyval.tree = IDL_type_char_new (); ; break;} case 222: #line 1069 "parser.y" { yyval.tree = IDL_type_wide_char_new (); ; break;} case 223: #line 1072 "parser.y" { yyval.tree = IDL_type_boolean_new (); ; break;} case 224: #line 1075 "parser.y" { yyval.tree = IDL_type_octet_new (); ; break;} case 225: #line 1078 "parser.y" { yyval.tree = IDL_type_any_new (); ; break;} case 226: #line 1081 "parser.y" { yyval.tree = IDL_type_object_new (); ; break;} case 227: #line 1084 "parser.y" { yyval.tree = IDL_type_typecode_new (); ; break;} case 228: #line 1089 "parser.y" { yyval.tree = IDL_type_string_new (yyvsp[-1].tree); ; break;} case 229: #line 1090 "parser.y" { yyval.tree = IDL_type_string_new (NULL); ; break;} case 230: #line 1095 "parser.y" { yyval.tree = IDL_type_wide_string_new (yyvsp[-1].tree); ; break;} case 231: #line 1096 "parser.y" { yyval.tree = IDL_type_wide_string_new (NULL); ; break;} case 232: #line 1099 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 233: #line 1101 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 238: #line 1114 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 239: #line 1116 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 240: #line 1120 "parser.y" { IDL_tree p; int i; yyval.tree = IDL_type_array_new (yyvsp[-1].tree, yyvsp[0].tree); for (i = 1, p = yyvsp[0].tree; p; ++i, p = IDL_LIST (p).next) if (!IDL_LIST (p).data) { char *s = IDL_ns_ident_to_qstring (yyvsp[-1].tree, "::", 0); yyerrorv ("Missing value in dimension %d of array `%s'", i, s); g_free (s); } ; break;} case 241: #line 1134 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, FALSE); ; break;} case 242: #line 1136 "parser.y" { yyval.tree = list_chain (yyvsp[-1].tree, yyvsp[0].tree, FALSE); ; break;} case 243: #line 1139 "parser.y" { yyval.tree = yyvsp[-1].tree; ; break;} case 244: #line 1140 "parser.y" { yyval.tree = NULL; ; break;} case 245: #line 1144 "parser.y" { yyval.hash_table = g_hash_table_new (IDL_strcase_hash, IDL_strcase_equal); g_hash_table_insert (yyval.hash_table, yyvsp[-1].str, yyvsp[0].str); ; break;} case 246: #line 1150 "parser.y" { yyval.hash_table = yyvsp[-3].hash_table; g_hash_table_insert (yyval.hash_table, yyvsp[-1].str, yyvsp[0].str); ; break;} case 247: #line 1154 "parser.y" { yyval.hash_table = g_hash_table_new (IDL_strcase_hash, IDL_strcase_equal); g_hash_table_insert (yyval.hash_table, yyvsp[0].str, g_strdup ("")); ; break;} case 248: #line 1159 "parser.y" { yyval.hash_table = yyvsp[-2].hash_table; g_hash_table_insert (yyval.hash_table, yyvsp[0].str, g_strdup ("")); ; break;} case 249: #line 1165 "parser.y" { yyval.tree = IDL_ident_new (yyvsp[0].str); ; break;} case 250: #line 1168 "parser.y" { assert (yyvsp[0].tree != NULL); assert (IDL_NODE_TYPE (yyvsp[0].tree) == IDLN_GENTREE); assert (IDL_NODE_TYPE (IDL_GENTREE (yyvsp[0].tree).data) == IDLN_IDENT); yyval.tree = IDL_GENTREE (yyvsp[0].tree).data; ; break;} case 251: #line 1176 "parser.y" { IDL_tree old_top = IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data; IDL_ns_push_scope (__IDL_root_ns, yyvsp[0].tree); #ifdef YYDEBUG if (yydebug) fprintf (stderr, "ns: entering new scope `%s' of `%s'\n", IDL_IDENT (IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data).str, IDL_IDENT(old_top).str); #endif assert (IDL_NODE_TYPE (IDL_GENTREE (yyvsp[0].tree).data) == IDLN_IDENT); yyval.tree = IDL_GENTREE (yyvsp[0].tree).data; ; break;} case 252: #line 1189 "parser.y" { IDL_tree old_top = IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data; IDL_ns_push_scope (__IDL_root_ns, yyvsp[0].tree); assert (IDL_NS (__IDL_root_ns).current != NULL); assert (IDL_NODE_TYPE (IDL_NS (__IDL_root_ns).current) == IDLN_GENTREE); assert (IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data != NULL); assert (IDL_NODE_TYPE (IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data) == IDLN_IDENT); #ifdef YYDEBUG if (yydebug) fprintf (stderr,"ns: entering new/prev scope `%s' of `%s'\n", IDL_IDENT (IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data).str, IDL_IDENT(old_top).str); #endif assert (IDL_NODE_TYPE (IDL_GENTREE (yyvsp[0].tree).data) == IDLN_IDENT); yyval.tree = IDL_GENTREE (yyvsp[0].tree).data; ; break;} case 253: #line 1206 "parser.y" { IDL_tree cur_top = IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data; IDL_ns_pop_scope (__IDL_root_ns); #ifdef YYDEBUG if (yydebug) fprintf (stderr, "ns: pop scope from `%s' to `%s'\n", IDL_IDENT(cur_top).str, IDL_IDENT (IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data).str); #endif ; break;} case 254: #line 1218 "parser.y" { IDL_tree p; if ((p = IDL_ns_place_new (__IDL_root_ns, yyvsp[0].tree)) == NULL) { IDL_tree q; int i; p = IDL_ns_lookup_cur_scope (__IDL_root_ns, yyvsp[0].tree, NULL); for (i = 0, q = IDL_GENTREE (p).data; q && (IDL_NODE_TYPE (q) == IDLN_IDENT || IDL_NODE_TYPE (q) == IDLN_LIST) && i < 4; ++i) if (IDL_NODE_UP (q)) q = IDL_NODE_UP (q); if (q) { IDL_tree_error (yyvsp[0].tree, "`%s' conflicts", IDL_IDENT (yyvsp[0].tree).str); do_token_error (q, "with", FALSE); } else yyerrorv ("`%s' duplicate identifier", IDL_IDENT (yyvsp[0].tree).str); IDL_tree_free (yyvsp[0].tree); YYABORT; } assert (IDL_IDENT (yyvsp[0].tree)._ns_ref == p); #ifdef REF_IDENTS ++IDL_NODE_REFS (IDL_GENTREE (p).data); #endif if (__IDL_new_ident_comments != NULL) { assert (IDL_IDENT (yyvsp[0].tree).comments == NULL); IDL_IDENT (yyvsp[0].tree).comments = __IDL_new_ident_comments; __IDL_new_ident_comments = NULL; } yyval.tree = p; ; break;} case 255: #line 1256 "parser.y" { IDL_tree p; if ((p = IDL_ns_resolve_ident (__IDL_root_ns, yyvsp[0].tree)) == NULL) { yyerrorv ("`%s' undeclared identifier", IDL_IDENT (yyvsp[0].tree).str); IDL_tree_free (yyvsp[0].tree); YYABORT; } IDL_tree_free (yyvsp[0].tree); assert (IDL_GENTREE (p).data != NULL); assert (IDL_IDENT (IDL_GENTREE (p).data)._ns_ref == p); #ifdef REF_IDENTS ++IDL_NODE_REFS (IDL_GENTREE (p).data); #endif yyval.tree = p; ; break;} case 256: #line 1275 "parser.y" { IDL_tree p; if ((p = IDL_ns_lookup_cur_scope (__IDL_root_ns, yyvsp[0].tree, NULL)) == NULL) { #ifdef YYDEBUG if (yydebug) fprintf (stderr, "ns: place_new `%s' in `%s'\n", IDL_IDENT(yyvsp[0].tree).str, IDL_IDENT(IDL_GENTREE (IDL_NS (__IDL_root_ns).current).data).str ); #endif p = IDL_ns_place_new (__IDL_root_ns, yyvsp[0].tree); assert (p != NULL); assert (IDL_IDENT (yyvsp[0].tree)._ns_ref == p); if (__IDL_new_ident_comments != NULL) { assert (IDL_IDENT (yyvsp[0].tree).comments == NULL); IDL_IDENT (yyvsp[0].tree).comments = __IDL_new_ident_comments; __IDL_new_ident_comments = NULL; } } else { IDL_tree_free (yyvsp[0].tree); assert (IDL_GENTREE (p).data != NULL); assert (IDL_IDENT (IDL_GENTREE (p).data)._ns_ref == p); } #ifdef REF_IDENTS ++IDL_NODE_REFS (IDL_GENTREE (p).data); #endif yyval.tree = p; ; break;} case 257: #line 1305 "parser.y" { IDL_tree p; if ((p = IDL_ns_lookup_this_scope ( __IDL_root_ns,IDL_NS (__IDL_root_ns).file, yyvsp[0].tree, NULL)) == NULL) { yyerrorv ("`%s' undeclared identifier", IDL_IDENT (yyvsp[0].tree).str); IDL_tree_free (yyvsp[0].tree); YYABORT; } IDL_tree_free (yyvsp[0].tree); assert (IDL_GENTREE (p).data != NULL); assert (IDL_IDENT (IDL_GENTREE (p).data)._ns_ref == p); #ifdef REF_IDENTS ++IDL_NODE_REFS (IDL_GENTREE (p).data); #endif yyval.tree = p; ; break;} case 258: #line 1324 "parser.y" { yyval.tree = list_start (yyvsp[0].tree, TRUE); ; break;} case 259: #line 1326 "parser.y" { yyval.tree = list_chain (yyvsp[-2].tree, yyvsp[0].tree, TRUE); ; break;} case 260: #line 1329 "parser.y" { IDL_tree literal, ident = NULL; IDL_longlong_t value = 0; if ((literal = IDL_resolve_const_exp (yyvsp[0].tree, IDLN_INTEGER))) { assert (IDL_NODE_TYPE (literal) == IDLN_INTEGER); ++IDL_NODE_REFS (literal); value = IDL_INTEGER (literal).value; if ( literal != yyvsp[0].tree ) IDL_tree_free (yyvsp[0].tree); } if (literal && IDL_NODE_UP (literal) && IDL_NODE_TYPE (IDL_NODE_UP (literal)) == IDLN_CONST_DCL) ident = IDL_CONST_DCL (IDL_NODE_UP (literal)).ident; if (literal == NULL) { if (!(__IDL_flags & IDLF_NO_EVAL_CONST)) yyerror ("Could not resolve constant expression"); yyval.tree = yyvsp[0].tree; } else if (value == 0) { yyerror ("Zero array size is illegal"); if (ident) IDL_tree_error (ident, "From constant declared here"); yyval.tree = NULL; } else if (value < 0) { yywarningv (IDL_WARNING1, "Cannot use negative value %" IDL_LL "d, using %" IDL_LL "d", value, -value); if (ident) IDL_tree_warning (ident, IDL_WARNING1, "From constant declared here"); yyval.tree = IDL_integer_new (-value); } else yyval.tree = IDL_integer_new (value); ; break;} case 261: #line 1368 "parser.y" { yyval.declspec = 0; ; break;} case 262: #line 1369 "parser.y" { yyval.declspec = IDL_parse_declspec (yyvsp[0].str); g_free (yyvsp[0].str); ; break;} case 263: #line 1375 "parser.y" { yyval.hash_table = NULL; ; break;} case 264: #line 1376 "parser.y" { /* Enable property scanning */ if (__IDL_flags & IDLF_PROPERTIES) __IDL_flagsi |= IDLFP_PROPERTIES; else { yyerror ("Property syntax not enabled"); YYABORT; } ; break;} case 265: #line 1385 "parser.y" { yyval.hash_table = yyvsp[-1].hash_table; ; break;} case 266: #line 1388 "parser.y" { yyval.tree = IDL_integer_new (yyvsp[0].integer); ; break;} case 267: #line 1391 "parser.y" { yyval.tree = IDL_string_new (yyvsp[0].str); ; break;} case 268: #line 1394 "parser.y" { yyval.tree = IDL_char_new (yyvsp[0].str); ; break;} case 269: #line 1397 "parser.y" { yyval.tree = IDL_fixed_new (yyvsp[0].str); ; break;} case 270: #line 1400 "parser.y" { yyval.tree = IDL_float_new (yyvsp[0].floatp); ; break;} case 271: #line 1403 "parser.y" { yyval.tree = IDL_boolean_new (TRUE); ; break;} case 272: #line 1404 "parser.y" { yyval.tree = IDL_boolean_new (FALSE); ; break;} case 273: #line 1407 "parser.y" { yyval.tree = yyvsp[0].tree; assign_declspec (yyval.tree, yyvsp[-1].declspec); ; break;} case 274: #line 1413 "parser.y" { yyval.tree = yyvsp[0].tree; ; break;} case 276: #line 1419 "parser.y" { char *catstr = g_malloc (strlen (yyvsp[-1].str) + strlen (yyvsp[0].str) + 1); strcpy (catstr, yyvsp[-1].str); g_free (yyvsp[-1].str); strcat (catstr, yyvsp[0].str); g_free (yyvsp[0].str); yyval.str = catstr; ; break;} case 277: #line 1427 "parser.y" { char *s = IDL_do_escapes (yyvsp[0].str); g_free (yyvsp[0].str); yyval.str = s; ; break;} case 278: #line 1434 "parser.y" { char *s = IDL_do_escapes (yyvsp[0].str); g_free (yyvsp[0].str); yyval.str = s; ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 465 "bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; } #line 1441 "parser.y" void __IDL_parser_reset (void) { yyclearin; } static const char *IDL_ns_get_cur_prefix (IDL_ns ns) { IDL_tree p; p = IDL_NS (ns).current; assert (p != NULL); while (p && !IDL_GENTREE (p)._cur_prefix) p = IDL_NODE_UP (p); return p ? IDL_GENTREE (p)._cur_prefix : NULL; } gchar *IDL_ns_ident_make_repo_id (IDL_ns ns, IDL_tree p, const char *p_prefix, int *major, int *minor) { GString *s = g_string_new (NULL); const char *prefix; char *q; assert (p != NULL); if (IDL_NODE_TYPE (p) == IDLN_IDENT) p = IDL_IDENT_TO_NS (p); assert (p != NULL); prefix = p_prefix ? p_prefix : IDL_ns_get_cur_prefix (ns); q = IDL_ns_ident_to_qstring (p, "/", 0); g_string_printf (s, "IDL:%s%s%s:%d.%d", prefix ? prefix : "", prefix && *prefix ? "/" : "", q, major ? *major : 1, minor ? *minor : 0); g_free (q); q = s->str; g_string_free (s, FALSE); return q; } static const char *get_name_token (const char *s, char **tok) { const char *begin = s; int state = 0; if (!s) return NULL; while (g_ascii_isspace (*s)) ++s; while (1) switch (state) { case 0: /* Unknown */ if (*s == ':') state = 1; else if (isalnum ((int)*s) || *s == '_') { begin = s; state = 2; } else return NULL; break; case 1: /* Scope */ if (strncmp (s, "::", 2) == 0) { char *r = g_malloc (3); strcpy (r, "::"); *tok = r; return s + 2; } else /* Invalid */ return NULL; break; case 2: if (isalnum ((int)*s) || *s == '_') ++s; else { char *r = g_malloc (s - begin + 1); strncpy (r, begin, s - begin + 1); r[s - begin] = 0; *tok = r; return s; } break; } } static IDL_tree IDL_ns_pragma_parse_name (IDL_ns ns, const char *s) { IDL_tree p = IDL_NS (ns).current, q; int start = 1; char *tok; /* This is a hack to allow directives for an ident (such * as and interface) to be located within the scope of * that identifier. */ if ( p && (q=IDL_GENTREE(p).data)!=0 && IDL_NODE_TYPE(q)==IDLN_IDENT && strcmp(s,IDL_IDENT(q).str)==0 ) { return p; } while (p && *s && (s = get_name_token (s, &tok))) { if (tok == NULL) return NULL; if (strcmp (tok, "::") == 0) { if (start) { /* Globally scoped */ p = IDL_NS (ns).file; } g_free (tok); } else { IDL_tree ident = IDL_ident_new (tok); p = IDL_ns_lookup_this_scope (__IDL_root_ns, p, ident, NULL); IDL_tree_free (ident); } start = 0; } return p; } void IDL_ns_ID (IDL_ns ns, const char *s) { char name[1024], id[1024]; IDL_tree p, ident; int n; n = sscanf (s, "%1023s \"%1023s\"", name, id); if (n < 2 && __IDL_is_parsing) { yywarning (IDL_WARNING1, "Malformed pragma ID"); return; } if (id[strlen (id) - 1] == '"') id[strlen (id) - 1] = 0; p = IDL_ns_pragma_parse_name (__IDL_root_ns, name); if (!p && __IDL_is_parsing) { yywarningv (IDL_WARNING1, "Unknown identifier `%s' in pragma ID", name); return; } /* We have resolved the identifier, so assign the repo id */ assert (IDL_NODE_TYPE (p) == IDLN_GENTREE); assert (IDL_GENTREE (p).data != NULL); assert (IDL_NODE_TYPE (IDL_GENTREE (p).data) == IDLN_IDENT); ident = IDL_GENTREE (p).data; if (IDL_IDENT_REPO_ID (ident) != NULL) g_free (IDL_IDENT_REPO_ID (ident)); IDL_IDENT_REPO_ID (ident) = g_strdup (id); } void IDL_ns_version (IDL_ns ns, const char *s) { char name[1024]; int n, major, minor; IDL_tree p, ident; n = sscanf (s, "%1023s %u.%u", name, &major, &minor); if (n < 3 && __IDL_is_parsing) { yywarning (IDL_WARNING1, "Malformed pragma version"); return; } p = IDL_ns_pragma_parse_name (__IDL_root_ns, name); if (!p && __IDL_is_parsing) { yywarningv (IDL_WARNING1, "Unknown identifier `%s' in pragma version", name); return; } /* We have resolved the identifier, so assign the repo id */ assert (IDL_NODE_TYPE (p) == IDLN_GENTREE); assert (IDL_GENTREE (p).data != NULL); assert (IDL_NODE_TYPE (IDL_GENTREE (p).data) == IDLN_IDENT); ident = IDL_GENTREE (p).data; if (IDL_IDENT_REPO_ID (ident) != NULL) { char *v = strrchr (IDL_IDENT_REPO_ID (ident), ':'); if (v) { GString *s; *v = 0; s = g_string_new (NULL); g_string_printf (s, "%s:%d.%d", IDL_IDENT_REPO_ID (ident), major, minor); g_free (IDL_IDENT_REPO_ID (ident)); IDL_IDENT_REPO_ID (ident) = s->str; g_string_free (s, FALSE); } else if (__IDL_is_parsing) yywarningv (IDL_WARNING1, "Cannot find RepositoryID OMG IDL version in ID `%s'", IDL_IDENT_REPO_ID (ident)); } else IDL_IDENT_REPO_ID (ident) = IDL_ns_ident_make_repo_id ( __IDL_root_ns, p, NULL, &major, &minor); } int IDL_inhibit_get (void) { g_return_val_if_fail (__IDL_is_parsing, -1); return __IDL_inhibits; } void IDL_inhibit_push (void) { g_return_if_fail (__IDL_is_parsing); ++__IDL_inhibits; } void IDL_inhibit_pop (void) { g_return_if_fail (__IDL_is_parsing); if (--__IDL_inhibits < 0) __IDL_inhibits = 0; } static void IDL_inhibit (IDL_ns ns, const char *s) { if (g_ascii_strcasecmp ("push", s) == 0) IDL_inhibit_push (); else if (g_ascii_strcasecmp ("pop", s) == 0) IDL_inhibit_pop (); } static void IDL_typecodes_as_tok (IDL_ns ns, const char *s) { if (g_ascii_strcasecmp ("push", s) == 0) ++(__IDL_typecodes_as_tok); else if (g_ascii_strcasecmp ("pop", s) == 0) --(__IDL_typecodes_as_tok); } static void IDL_pidl (IDL_ns ns, const char *s) { if (g_ascii_strcasecmp ("push", s) == 0) ++(__IDL_pidl); else if (g_ascii_strcasecmp ("pop", s) == 0) --(__IDL_pidl); } void __IDL_do_pragma (const char *s) { int n; char directive[256]; g_return_if_fail (__IDL_is_parsing); g_return_if_fail (s != NULL); if (sscanf (s, "%255s%n", directive, &n) < 1) return; s += n; while (g_ascii_isspace (*s)) ++s; if (strcmp (directive, "prefix") == 0) IDL_ns_prefix (__IDL_root_ns, s); else if (strcmp (directive, "ID") == 0) IDL_ns_ID (__IDL_root_ns, s); else if (strcmp (directive, "version") == 0) IDL_ns_version (__IDL_root_ns, s); else if (strcmp (directive, "inhibit") == 0) IDL_inhibit (__IDL_root_ns, s); else if (strcmp (directive, "typecodes_as_tok") == 0) IDL_typecodes_as_tok (__IDL_root_ns, s); else if (strcmp (directive, "pidl") == 0) IDL_pidl (__IDL_root_ns, s); } static IDL_declspec_t IDL_parse_declspec (const char *strspec) { IDL_declspec_t flags = IDLF_DECLSPEC_EXIST; if (strspec == NULL) return flags; if (strcmp (strspec, "inhibit") == 0) flags |= IDLF_DECLSPEC_INHIBIT; if (strcmp (strspec, "pidl") == 0) flags |= IDLF_DECLSPEC_PIDL; else if (__IDL_is_parsing) yywarningv (IDL_WARNING1, "Ignoring unknown declspec `%s'", strspec); return flags; } IDL_tree IDL_file_set (const char *filename, int line) { IDL_fileinfo *fi; IDL_tree tree = NULL; g_return_val_if_fail (__IDL_is_parsing, NULL); if (filename) { const char *oldfilename = __IDL_cur_filename; gboolean wasInhibit = IS_INHIBIT_STATE(); gboolean isTop = #ifdef HAVE_CPP_PIPE_STDIN strlen (filename)==0; #else __IDL_tmp_filename && strcmp (filename, __IDL_tmp_filename)==0; #endif if ( isTop ) { filename = __IDL_real_filename; __IDL_flagsi &= ~IDLFP_IN_INCLUDES; } else { __IDL_flagsi |= IDLFP_IN_INCLUDES; } if ((fi=g_hash_table_lookup(__IDL_filename_hash, filename)) ) { __IDL_cur_fileinfo = fi; ++(fi->seenCnt); } else { fi = g_new0 (IDL_fileinfo, 1); fi->name = g_strdup(filename); g_hash_table_insert (__IDL_filename_hash, fi->name, fi); } __IDL_cur_fileinfo = fi; __IDL_cur_filename = fi->name; if ( (__IDL_flags & IDLF_SRCFILES)!=0 && (oldfilename==0 || strcmp(oldfilename,fi->name)!=0) ) { tree = IDL_srcfile_new(fi->name, fi->seenCnt, isTop, wasInhibit); } } if (__IDL_cur_line > 0) __IDL_cur_line = line; return tree; } void IDL_file_get (const char **filename, int *line) { g_return_if_fail (__IDL_is_parsing); if (filename) *filename = __IDL_cur_filename; if (line) *line = __IDL_cur_line; } static int do_token_error (IDL_tree p, const char *message, gboolean prev) { int dienow; char *what = NULL, *who = NULL; assert (p != NULL); dienow = IDL_tree_get_node_info (p, &what, &who); assert (what != NULL); if (who && *who) IDL_tree_error (p, "%s %s `%s'", message, what, who); else IDL_tree_error (p, "%s %s", message, what); return dienow; } static void illegal_context_type_error (IDL_tree p, const char *what) { GString *s = g_string_new (NULL); g_string_printf (s, "Illegal type `%%s' for %s", what); illegal_type_error (p, s->str); g_string_free (s, TRUE); } static void illegal_type_error (IDL_tree p, const char *message) { GString *s; s = IDL_tree_to_IDL_string (p, NULL, IDLF_OUTPUT_NO_NEWLINES); yyerrorv (message, s->str); g_string_free (s, TRUE); } static IDL_tree list_start (IDL_tree a, gboolean filter_null) { IDL_tree p; if (!a && filter_null) return NULL; p = IDL_list_new (a); return p; } static IDL_tree list_chain (IDL_tree a, IDL_tree b, gboolean filter_null) { IDL_tree p; if (filter_null) { if (!b) return a; if (!a) return list_start (b, filter_null); } p = IDL_list_new (b); a = IDL_list_concat (a, p); return a; } static IDL_tree zlist_chain (IDL_tree a, IDL_tree b, gboolean filter_null) { if (a == NULL) return list_start (b, filter_null); else return list_chain (a, b, filter_null); } static int IDL_binop_chktypes (enum IDL_binop op, IDL_tree a, IDL_tree b) { if (IDL_NODE_TYPE (a) != IDLN_BINOP && IDL_NODE_TYPE (b) != IDLN_BINOP && IDL_NODE_TYPE (a) != IDLN_UNARYOP && IDL_NODE_TYPE (b) != IDLN_UNARYOP && IDL_NODE_TYPE (a) != IDL_NODE_TYPE (b)) { yyerror ("Invalid mix of types in constant expression"); return -1; } switch (op) { case IDL_BINOP_MULT: case IDL_BINOP_DIV: case IDL_BINOP_ADD: case IDL_BINOP_SUB: break; case IDL_BINOP_MOD: case IDL_BINOP_SHR: case IDL_BINOP_SHL: case IDL_BINOP_AND: case IDL_BINOP_OR: case IDL_BINOP_XOR: if ((IDL_NODE_TYPE (a) != IDLN_INTEGER || IDL_NODE_TYPE (b) != IDLN_INTEGER) && !(IDL_NODE_TYPE (a) == IDLN_BINOP || IDL_NODE_TYPE (b) == IDLN_BINOP || IDL_NODE_TYPE (a) == IDLN_UNARYOP || IDL_NODE_TYPE (b) == IDLN_UNARYOP)) { yyerror ("Invalid operation on non-integer value"); return -1; } break; } return 0; } static int IDL_unaryop_chktypes (enum IDL_unaryop op, IDL_tree a) { switch (op) { case IDL_UNARYOP_PLUS: case IDL_UNARYOP_MINUS: break; case IDL_UNARYOP_COMPLEMENT: if (IDL_NODE_TYPE (a) != IDLN_INTEGER && !(IDL_NODE_TYPE (a) == IDLN_BINOP || IDL_NODE_TYPE (a) == IDLN_UNARYOP)) { yyerror ("Operand to complement must be integer"); return -1; } break; } return 0; } static IDL_tree IDL_binop_eval_integer (enum IDL_binop op, IDL_tree a, IDL_tree b) { IDL_tree p = NULL; assert (IDL_NODE_TYPE (a) == IDLN_INTEGER); switch (op) { case IDL_BINOP_MULT: p = IDL_integer_new (IDL_INTEGER (a).value * IDL_INTEGER (b).value); break; case IDL_BINOP_DIV: if (IDL_INTEGER (b).value == 0) { yyerror ("Divide by zero in constant expression"); return NULL; } p = IDL_integer_new (IDL_INTEGER (a).value / IDL_INTEGER (b).value); break; case IDL_BINOP_ADD: p = IDL_integer_new (IDL_INTEGER (a).value + IDL_INTEGER (b).value); break; case IDL_BINOP_SUB: p = IDL_integer_new (IDL_INTEGER (a).value - IDL_INTEGER (b).value); break; case IDL_BINOP_MOD: if (IDL_INTEGER (b).value == 0) { yyerror ("Modulo by zero in constant expression"); return NULL; } p = IDL_integer_new (IDL_INTEGER (a).value % IDL_INTEGER (b).value); break; case IDL_BINOP_SHR: p = IDL_integer_new (IDL_INTEGER (a).value >> IDL_INTEGER (b).value); break; case IDL_BINOP_SHL: p = IDL_integer_new (IDL_INTEGER (a).value << IDL_INTEGER (b).value); break; case IDL_BINOP_AND: p = IDL_integer_new (IDL_INTEGER (a).value & IDL_INTEGER (b).value); break; case IDL_BINOP_OR: p = IDL_integer_new (IDL_INTEGER (a).value | IDL_INTEGER (b).value); break; case IDL_BINOP_XOR: p = IDL_integer_new (IDL_INTEGER (a).value ^ IDL_INTEGER (b).value); break; } return p; } static IDL_tree IDL_binop_eval_float (enum IDL_binop op, IDL_tree a, IDL_tree b) { IDL_tree p = NULL; assert (IDL_NODE_TYPE (a) == IDLN_FLOAT); switch (op) { case IDL_BINOP_MULT: p = IDL_float_new (IDL_FLOAT (a).value * IDL_FLOAT (b).value); break; case IDL_BINOP_DIV: if (IDL_FLOAT (b).value == 0.0) { yyerror ("Divide by zero in constant expression"); return NULL; } p = IDL_float_new (IDL_FLOAT (a).value / IDL_FLOAT (b).value); break; case IDL_BINOP_ADD: p = IDL_float_new (IDL_FLOAT (a).value + IDL_FLOAT (b).value); break; case IDL_BINOP_SUB: p = IDL_float_new (IDL_FLOAT (a).value - IDL_FLOAT (b).value); break; default: break; } return p; } static IDL_tree IDL_binop_eval (enum IDL_binop op, IDL_tree a, IDL_tree b) { assert (IDL_NODE_TYPE (a) == IDL_NODE_TYPE (b)); switch (IDL_NODE_TYPE (a)) { case IDLN_INTEGER: return IDL_binop_eval_integer (op, a, b); case IDLN_FLOAT: return IDL_binop_eval_float (op, a, b); default: return NULL; } } static IDL_tree IDL_unaryop_eval_integer (enum IDL_unaryop op, IDL_tree a) { IDL_tree p = NULL; assert (IDL_NODE_TYPE (a) == IDLN_INTEGER); switch (op) { case IDL_UNARYOP_PLUS: p = IDL_integer_new (IDL_INTEGER (a).value); break; case IDL_UNARYOP_MINUS: p = IDL_integer_new (-IDL_INTEGER (a).value); break; case IDL_UNARYOP_COMPLEMENT: p = IDL_integer_new (~IDL_INTEGER (a).value); break; } return p; } static IDL_tree IDL_unaryop_eval_fixed (enum IDL_unaryop op, IDL_tree a) { IDL_tree p = NULL; assert (IDL_NODE_TYPE (a) == IDLN_FIXED); switch (op) { case IDL_UNARYOP_PLUS: p = IDL_fixed_new (IDL_FIXED (a).value); break; default: break; } return p; } static IDL_tree IDL_unaryop_eval_float (enum IDL_unaryop op, IDL_tree a) { IDL_tree p = NULL; assert (IDL_NODE_TYPE (a) == IDLN_FLOAT); switch (op) { case IDL_UNARYOP_PLUS: p = IDL_float_new (IDL_FLOAT (a).value); break; case IDL_UNARYOP_MINUS: p = IDL_float_new (-IDL_FLOAT (a).value); break; default: break; } return p; } static IDL_tree IDL_unaryop_eval (enum IDL_unaryop op, IDL_tree a) { switch (IDL_NODE_TYPE (a)) { case IDLN_INTEGER: return IDL_unaryop_eval_integer (op, a); case IDLN_FIXED: return IDL_unaryop_eval_fixed (op, a); case IDLN_FLOAT: return IDL_unaryop_eval_float (op, a); default: return NULL; } } IDL_tree IDL_resolve_const_exp (IDL_tree p, IDL_tree_type type) { gboolean resolved_value = FALSE, die = FALSE; gboolean wrong_type = FALSE; while (!resolved_value && !die) { if (IDL_NODE_TYPE (p) == IDLN_IDENT) { IDL_tree q = IDL_NODE_UP (p); assert (q != NULL); if (IDL_NODE_UP (q) && IDL_NODE_TYPE (IDL_NODE_UP (q)) == IDLN_TYPE_ENUM) { p = q; die = TRUE; break; } else if (IDL_NODE_TYPE (q) != IDLN_CONST_DCL) { p = q; wrong_type = TRUE; die = TRUE; } else p = IDL_CONST_DCL (q).const_exp; } if (p == NULL || IDL_NODE_TYPE (p) == IDLN_BINOP || IDL_NODE_TYPE (p) == IDLN_UNARYOP) { die = TRUE; continue; } resolved_value = IDL_NODE_IS_LITERAL (p); } if (resolved_value && type != IDLN_ANY && IDL_NODE_TYPE (p) != type) wrong_type = TRUE; if (wrong_type) { yyerror ("Invalid type for constant"); IDL_tree_error (p, "Previous resolved type declaration"); return NULL; } return resolved_value ? p : NULL; } void IDL_queue_new_ident_comment (const char *str) { g_return_if_fail (str != NULL); __IDL_new_ident_comments = g_slist_append (__IDL_new_ident_comments, g_strdup (str)); } /* * Local variables: * mode: C * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: */