/* A Bison parser, made from yparser.y by GNU bison 1.30. */ #define YYBISON 1 /* Identify Bison output. */ # define UNSIGNED 257 # define TRIGGERTYPE 258 # define ENUM 259 # define LOOKUP 260 # define LIST 261 # define REFERENCE 262 # define CALCULATED 263 # define TRIGGER 264 # define UNIQUE 265 # define INDEX 266 # define SINGLETON 267 # define CTYPE 268 # define MODULE 269 # define CLASS 270 # define EXTEND 271 # define PUBLIC 272 # define PROTECTED 273 # define PRIVATE 274 # define FINAL 275 # define ABSTRACT 276 # define NOT 277 # define NUL 278 # define READONLY 279 # define ORDER 280 # define BY 281 # define DESC 282 # define SYMBOL 283 # define DATATYPE 284 # define STRING 285 # define INTEGER 286 # define DOUBLE 287 #line 2 "yparser.y" #include #include #include #include "config.h" #include "gcdparser.h" #include "classdata.h" /* use the more useful verbose error messages */ #define YYERROR_VERBOSE 1 #define YYDEBUG 1 /* defaults to everything public */ unsigned long int current_access = ODL_ACCESS_PUBLIC; /* from lparser.l */ #include "lparser.h" /* error checking function prototypes */ void dtype_unsigned_check( gboolean isunsigned , const char *datatype ); /* int indent = 0; void doindent (void) { int i; for( i=0 ; i #define YYFINAL 247 #define YYFLAG -32768 #define YYNTBASE 48 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 287 ? yytranslate[x] : 116) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ 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, 2, 2, 2, 39, 40, 41, 2, 38, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 34, 35, 44, 46, 45, 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, 42, 2, 43, 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, 36, 2, 37, 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, 2, 1, 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 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 19, 21, 23, 25, 27, 28, 30, 32, 34, 35, 38, 39, 42, 44, 49, 51, 53, 55, 57, 60, 62, 66, 70, 74, 78, 83, 93, 94, 108, 109, 123, 134, 140, 142, 146, 147, 150, 152, 156, 158, 161, 165, 169, 172, 175, 179, 182, 185, 188, 191, 194, 197, 200, 203, 206, 211, 215, 217, 221, 224, 227, 229, 232, 236, 241, 242, 246, 250, 256, 260, 266, 267, 270, 273, 276, 279, 282, 284, 287, 288, 290, 296, 298, 302, 307, 315, 316, 318, 322, 324, 328, 331, 336, 340, 343, 345, 347, 351, 353, 355, 359, 364, 369, 376, 383, 390, 391, 392, 393, 395 }; static const short yyrhs[] = { -1, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 59, 72, 0, 0, 61, 0, 18, 0, 20, 0, 19, 0, 0, 21, 0, 22, 0, 13, 0, 0, 11, 49, 0, 0, 3, 49, 0, 29, 0, 65, 34, 34, 29, 0, 65, 0, 29, 0, 29, 0, 29, 0, 29, 51, 0, 29, 0, 60, 73, 35, 0, 60, 74, 35, 0, 60, 78, 35, 0, 60, 76, 35, 0, 60, 5, 79, 35, 0, 15, 68, 53, 36, 49, 59, 37, 54, 49, 0, 0, 62, 16, 50, 69, 75, 57, 81, 36, 49, 83, 37, 58, 49, 0, 0, 62, 14, 50, 69, 77, 57, 81, 36, 49, 83, 37, 58, 49, 0, 17, 50, 66, 55, 36, 49, 83, 37, 56, 49, 0, 67, 36, 80, 37, 49, 0, 29, 0, 80, 38, 29, 0, 0, 34, 82, 0, 66, 0, 82, 38, 66, 0, 84, 0, 83, 84, 0, 61, 34, 49, 0, 85, 35, 49, 0, 60, 74, 0, 60, 76, 0, 63, 12, 86, 0, 88, 95, 0, 88, 97, 0, 6, 109, 0, 7, 110, 0, 8, 111, 0, 9, 112, 0, 10, 113, 0, 25, 96, 0, 5, 79, 0, 26, 49, 27, 115, 0, 39, 87, 40, 0, 71, 0, 87, 38, 71, 0, 64, 30, 0, 5, 65, 0, 65, 0, 65, 41, 0, 65, 42, 43, 0, 65, 42, 32, 43, 0, 0, 44, 32, 45, 0, 44, 33, 45, 0, 44, 32, 38, 32, 45, 0, 44, 31, 45, 0, 44, 32, 38, 31, 45, 0, 0, 46, 31, 0, 46, 32, 0, 46, 33, 0, 46, 29, 0, 23, 24, 0, 91, 0, 92, 91, 0, 0, 92, 0, 70, 89, 90, 93, 52, 0, 94, 0, 95, 38, 94, 0, 70, 52, 34, 71, 0, 70, 52, 39, 49, 98, 40, 50, 0, 0, 100, 0, 88, 29, 49, 0, 99, 0, 100, 38, 99, 0, 29, 47, 0, 101, 39, 104, 40, 0, 39, 104, 40, 0, 101, 71, 0, 71, 0, 65, 0, 103, 38, 65, 0, 103, 0, 103, 0, 108, 47, 65, 0, 65, 39, 105, 40, 0, 65, 39, 105, 40, 0, 70, 52, 34, 106, 46, 102, 0, 70, 52, 34, 108, 46, 102, 0, 70, 52, 34, 107, 46, 102, 0, 0, 0, 0, 28, 0, 29, 49, 114, 50, 0 }; #endif #if YYDEBUG != 0 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 89, 90, 93, 96, 99, 102, 106, 126, 139, 156, 178, 213, 256, 257, 260, 261, 263, 264, 265, 268, 269, 270, 271, 274, 275, 278, 279, 282, 283, 286, 289, 292, 304, 309, 312, 315, 316, 317, 318, 319, 322, 325, 325, 328, 328, 331, 334, 358, 359, 362, 363, 366, 367, 370, 371, 390, 391, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 409, 416, 417, 420, 421, 422, 423, 424, 425, 428, 429, 430, 431, 432, 433, 436, 437, 438, 439, 440, 443, 446, 447, 450, 451, 455, 471, 472, 475, 478, 493, 494, 497, 503, 504, 507, 510, 511, 512, 513, 516, 517, 520, 523, 526, 532, 545, 558, 587, 622, 652, 655, 658, 659, 662 }; #endif #if YYDEBUG != 0 || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "UNSIGNED", "TRIGGERTYPE", "ENUM", "LOOKUP", "LIST", "REFERENCE", "CALCULATED", "TRIGGER", "UNIQUE", "INDEX", "SINGLETON", "CTYPE", "MODULE", "CLASS", "EXTEND", "PUBLIC", "PROTECTED", "PRIVATE", "FINAL", "ABSTRACT", "NOT", "NUL", "READONLY", "ORDER", "BY", "DESC", "SYMBOL", "DATATYPE", "STRING", "INTEGER", "DOUBLE", "':'", "';'", "'{'", "'}'", "','", "'('", "')'", "'*'", "'['", "']'", "'<'", "'>'", "'='", "'.'", "file", "dt_on", "dt_off", "fp_on", "fp_off", "push_module", "pop_module", "find_class", "unfind_class", "push_class", "pop_class", "unit_list", "opt_access", "access", "opt_class_type", "opt_unique", "opt_unsigned", "qualified_name", "existing_class_name", "new_container_name", "new_module_name", "new_class_name", "new_field_name", "existing_field_name", "unit", "module", "class", "@1", "type", "@2", "extend", "enum", "enum_body", "opt_parent_list", "parent_list", "class_body", "class_body_item", "body_item", "index", "index_item_list", "datatype", "opt_format", "opt_default", "property", "properties", "opt_properties", "new_field", "new_field_list", "readonly", "method", "opt_argument_list", "argument", "argument_list", "this", "search_fields", "field_list", "this_field_list", "source_field_list", "lookup_data_source", "reference_data_source", "list_data_source", "lookup", "list", "reference", "calculated", "trigger", "optdesc", "orderby", NULL }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 64, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 72, 72, 72, 72, 73, 75, 74, 77, 76, 78, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 87, 87, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 91, 92, 92, 93, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 102, 102, 103, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 0, 2, 1, 4, 1, 1, 1, 1, 2, 1, 3, 3, 3, 3, 4, 9, 0, 13, 0, 13, 10, 5, 1, 3, 0, 2, 1, 3, 1, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 3, 1, 3, 2, 2, 1, 2, 3, 4, 0, 3, 3, 5, 3, 5, 0, 2, 2, 2, 2, 2, 1, 2, 0, 1, 5, 1, 3, 4, 7, 0, 1, 3, 1, 3, 2, 4, 3, 2, 1, 1, 3, 1, 1, 3, 4, 4, 6, 6, 6, 0, 0, 0, 1, 4 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 15, 17, 19, 18, 15, 20, 16, 13, 14, 0, 23, 0, 4, 21, 22, 0, 0, 0, 0, 0, 31, 0, 0, 32, 7, 0, 4, 4, 36, 37, 39, 38, 0, 40, 0, 28, 30, 9, 0, 0, 48, 0, 3, 0, 0, 33, 44, 42, 3, 0, 15, 0, 3, 11, 11, 47, 49, 15, 29, 15, 50, 50, 8, 3, 0, 0, 0, 0, 121, 122, 3, 0, 3, 20, 16, 0, 0, 76, 15, 54, 0, 0, 0, 0, 0, 3, 27, 28, 75, 69, 5, 6, 63, 6, 64, 6, 65, 66, 67, 25, 6, 68, 0, 58, 59, 3, 0, 74, 77, 0, 10, 55, 3, 80, 97, 61, 62, 52, 51, 3, 3, 41, 34, 0, 0, 0, 0, 0, 56, 0, 60, 0, 78, 3, 57, 0, 0, 86, 0, 0, 15, 15, 0, 0, 0, 0, 3, 70, 35, 72, 0, 79, 46, 0, 0, 0, 3, 0, 94, 80, 98, 53, 15, 15, 0, 0, 0, 0, 0, 0, 99, 123, 0, 71, 84, 0, 81, 82, 26, 90, 87, 88, 89, 0, 92, 95, 6, 12, 12, 0, 0, 0, 0, 0, 0, 124, 4, 73, 0, 0, 0, 0, 0, 104, 102, 91, 93, 96, 3, 3, 111, 114, 0, 35, 0, 110, 0, 118, 115, 119, 0, 120, 125, 85, 83, 3, 4, 26, 45, 43, 0, 117, 106, 113, 0, 0, 109, 116, 103, 100, 105, 112, 108, 0, 107, 0, 0, 0 }; static const short yydefgoto[] = { 245, 50, 25, 122, 123, 34, 85, 44, 133, 60, 208, 4, 73, 74, 15, 75, 76, 77, 37, 21, 24, 46, 91, 215, 7, 16, 17, 54, 18, 53, 19, 22, 41, 83, 118, 78, 79, 80, 130, 150, 81, 137, 158, 184, 185, 186, 114, 115, 101, 116, 202, 203, 204, 216, 217, 211, 234, 212, 165, 169, 166, 92, 94, 96, 97, 98, 196, 147 }; static const short yypact[] = { 28,-32768,-32768,-32768, 31, 89,-32768,-32768,-32768, -17, -32768, 7,-32768,-32768,-32768, 79, 5, 42, 70, 80, -32768, 27, 81,-32768,-32768, 92,-32768,-32768,-32768,-32768, -32768,-32768, 102,-32768, 105,-32768, 110,-32768, 116, 116, -32768, 50,-32768, 114, 119,-32768,-32768,-32768,-32768, 123, 120, 124,-32768,-32768,-32768,-32768,-32768, 34,-32768, 242, 122, 122,-32768,-32768, 128, 129, 129, 129,-32768,-32768, -32768, 129,-32768, 21, 125, 148, 133, 40, 117,-32768, 130, 129, 92, 131, 134,-32768,-32768, 135, 110,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, 142,-32768,-32768,-32768, 137,-32768,-32768, 12, -32768,-32768,-32768, 36,-32768, 136,-32768,-32768, 149,-32768, -32768,-32768,-32768, 139, 154, 156, 157, 166,-32768, 167, -32768, 155,-32768,-32768,-32768, 118, 158, 160, 129, 92, 242, 242, 92, 92, 92, 167,-32768,-32768,-32768,-32768, 58,-32768,-32768, 162, 24, 163,-32768, 101, 178, 165, -32768,-32768, 174, 209, 45, 176, 177, 179, 51, 180, -32768, 185, 167,-32768,-32768, 76,-32768,-32768, 30,-32768, -32768,-32768,-32768, 199,-32768, 178,-32768,-32768,-32768, 92, -2, 92, -2, 92, -2,-32768,-32768,-32768, 186, 187, 92, 201, 193,-32768, 198,-32768,-32768,-32768,-32768,-32768, 110, 202, 197, 194, 92,-32768, 39,-32768, 110,-32768, 203,-32768,-32768,-32768,-32768,-32768,-32768, 16,-32768,-32768, 92,-32768,-32768, 202, 204, 92,-32768,-32768,-32768,-32768, -32768, 110,-32768, 215,-32768, 256, 257,-32768 }; static const short yypgoto[] = { -32768, -47, -24,-32768, -89,-32768,-32768,-32768,-32768, 188, 71, 208, 10, 26,-32768,-32768,-32768, -25, -73,-32768, -32768, 224, -49, -116, 4,-32768, 191,-32768, 192,-32768, -32768, 205,-32768, 212,-32768, -28, -71,-32768,-32768,-32768, -163,-32768,-32768, 85,-32768,-32768, 138,-32768,-32768,-32768, -32768, 47,-32768,-32768, -91, -194, 43, 73,-32768,-32768, 132,-32768,-32768,-32768,-32768,-32768,-32768,-32768 }; #define YYLAST 278 static const short yytable[] = { 36, 55, 38, 39, 124, 59, 125, 111, 8, 117, 5, 126, 20, 149, 5, 201, 86, 93, 95, 63, 233, 200, 100, 99, 136, 102, 6, 213, -1, 170, 6, -2, 113, 63, 10, 200, 23, 214, 121, 88, 28, 233, 13, 14, 131, 35, 1, 2, 3, 1, 2, 3, 1, 2, 3, 132, 197, 36, 128, 35, 5, 8, 175, 32, 201, 134, 161, 5, 148, 176, -101, 62, 140, 141, 43, -6, 6, 29, 235, 43, 135, 108, 109, 6, 189, 43, 152, 48, 49, 159, 193, 111, 111, 26, 9, 27, 172, 207, 173, 171, 236, 219, 10, 221, 11, 30, 12, 198, 199, 178, 13, 14, 162, 163, 36, 31, 33, 164, 164, 168, 63, 35, 64, 65, 66, 67, 68, 69, 70, -24, 179, 40, 180, 181, 182, 1, 2, 3, 1, 2, 3, 42, 71, 72, 43, 45, 35, -26, 51, 153, 154, 155, 56, 58, 110, 52, 82, 87, 90, 105, 106, 228, 229, 107, 210, 112, 218, 119, 210, 127, 120, -31, 222, 142, 138, 88, 129, 63, 238, 64, 65, 66, 67, 68, 69, 70, -24, 139, 143, 210, 144, 145, 1, 2, 3, 146, 148, 156, 151, 71, 72, 183, 239, 35, -26, 241, 157, 174, 177, 135, 210, 187, 63, 195, 64, 65, 66, 67, 68, 69, 70, -24, 190, 205, 191, 192, 194, 1, 2, 3, 225, 223, 224, 226, 71, 72, 227, 231, 35, -26, 230, 232, 61, 237, 242, 63, 188, 64, 65, 66, 67, 68, 69, 70, -24, 244, 246, 247, 57, 209, 1, 2, 3, 47, 103, 104, 220, 71, 72, 89, 206, 35, -26, 84, 240, 167, 160, 0, 243 }; static const short yycheck[] = { 25, 48, 26, 27, 93, 52, 95, 78, 4, 82, 0, 100, 29, 129, 4, 178, 63, 66, 67, 3, 214, 5, 71, 70, 113, 72, 0, 29, 0, 145, 4, 0, 81, 3, 13, 5, 29, 39, 85, 64, 35, 235, 21, 22, 32, 29, 18, 19, 20, 18, 19, 20, 18, 19, 20, 43, 172, 82, 105, 29, 50, 57, 38, 36, 227, 112, 139, 57, 29, 45, 40, 37, 119, 120, 34, 39, 50, 35, 39, 34, 44, 41, 42, 57, 39, 34, 133, 37, 38, 138, 39, 162, 163, 14, 5, 16, 38, 186, 40, 146, 216, 192, 13, 194, 15, 35, 17, 31, 32, 156, 21, 22, 140, 141, 139, 35, 35, 142, 143, 144, 3, 29, 5, 6, 7, 8, 9, 10, 11, 12, 29, 29, 31, 32, 33, 18, 19, 20, 18, 19, 20, 36, 25, 26, 34, 29, 29, 30, 34, 31, 32, 33, 29, 29, 37, 36, 34, 29, 29, 34, 12, 208, 209, 30, 189, 35, 191, 36, 193, 27, 36, 36, 196, 34, 38, 200, 39, 3, 225, 5, 6, 7, 8, 9, 10, 11, 12, 38, 34, 214, 34, 34, 18, 19, 20, 29, 29, 39, 43, 25, 26, 23, 226, 29, 30, 230, 46, 45, 45, 44, 235, 37, 3, 28, 5, 6, 7, 8, 9, 10, 11, 12, 46, 24, 47, 46, 46, 18, 19, 20, 29, 45, 45, 40, 25, 26, 38, 40, 29, 30, 38, 47, 54, 40, 40, 3, 37, 5, 6, 7, 8, 9, 10, 11, 12, 40, 0, 0, 50, 188, 18, 19, 20, 39, 73, 73, 193, 25, 26, 64, 185, 29, 30, 61, 227, 143, 138, -1, 235 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc. 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* 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. */ #ifndef YYSTACK_USE_ALLOCA # ifdef alloca # define YYSTACK_USE_ALLOCA 1 # else /* alloca not defined */ # ifdef __GNUC__ # define YYSTACK_USE_ALLOCA 1 # define alloca __builtin_alloca # else /* not GNU C. */ # if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) # define YYSTACK_USE_ALLOCA 1 # include # else /* not sparc */ /* We think this test detects Watcom and Microsoft C. */ /* This used to test MSDOS, but that is a bad idea since that symbol is in the user namespace. */ # if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) # if 0 /* No need for malloc.h, which pollutes the namespace; instead, just don't use alloca. */ # include # endif # else /* not MSDOS, or __TURBOC__ */ # if defined(_AIX) /* I don't know what this was needed for, but it pollutes the namespace. So I turned it off. rms, 2 May 1997. */ /* #include */ #pragma alloca # define YYSTACK_USE_ALLOCA 1 # else /* not MSDOS, or __TURBOC__, or _AIX */ # if 0 /* address@hidden says this works for HPUX 9.05 and up, and on HPUX 10. Eventually we can turn this on. */ # ifdef __hpux # define YYSTACK_USE_ALLOCA 1 # define alloca __builtin_alloca # endif /* __hpux */ # endif # endif /* not _AIX */ # endif /* not MSDOS, or __TURBOC__ */ # endif /* not sparc */ # endif /* not GNU C */ # endif /* alloca not defined */ #endif /* YYSTACK_USE_ALLOCA not defined */ #ifndef YYSTACK_USE_ALLOCA # define YYSTACK_USE_ALLOCA 0 #endif #if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca #else # define YYSTACK_ALLOC malloc #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #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 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # define YYDPRINTF(Args) \ do { \ if (yydebug) \ fprintf Args; \ } while (0) /* Nonzero means print parse trace. [The following comment makes no sense to me. Could someone clarify it? --akim] Since this is uninitialized, it does not stop multiple parsers from coexisting. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- 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 /* Define __yy_memcpy. Note that the size argument should be passed with type unsigned int, because that is what the non-GCC definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ # define __yy_memcpy(To, From, Count) __builtin_memcpy (To, From, Count) #else /* not GNU C or C++ */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void # ifndef __cplusplus __yy_memcpy (to, from, count) char *to; const char *from; unsigned int count; # else /* __cplusplus */ __yy_memcpy (char *to, const char *from, unsigned int count) # endif { register const char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #line 216 "/usr/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # ifdef __cplusplus # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else /* !__cplusplus */ # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif /* !__cplusplus */ #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define _YY_DECL_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ _YY_DECL_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ _YY_DECL_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yysv': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; int yyfree_stacks = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; # if YYLSP_NEEDED YYLTYPE yyloc; # endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); 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; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *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; #if 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. */ # if 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; # if YYLSP_NEEDED yyls = yyls1; # endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror ("parser stack overflow"); if (yyfree_stacks) { free (yyss); free (yyvs); # if YYLSP_NEEDED free (yyls); # endif } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; # if !YYSTACK_USE_ALLOCA yyfree_stacks = 1; # endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * (unsigned int) sizeof (*yyvsp)); # if YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, size * (unsigned int) sizeof (*yylsp)); # endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #if YYLSP_NEEDED yylsp = yyls + size - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %d\n", yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | 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) { YYDPRINTF ((stderr, "Reading a token: ")); 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 */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ 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. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ 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 89 "yparser.y" { yywarn("File is empty"); ; break;} case 3: #line 93 "yparser.y" { expecting_datatype=1; /*printf("on\n");*/ ; break;} case 4: #line 96 "yparser.y" { expecting_datatype=0; /*printf("off\n");*/ ; break;} case 5: #line 99 "yparser.y" { expecting_fieldprop=1; /* printf("fld prop on\n"); */ ; break;} case 6: #line 102 "yparser.y" { expecting_fieldprop=0; /* printf("fld prop off\n");*/ ; break;} case 7: #line 106 "yparser.y" { if( current_pass == 1 ) { odl_module *newone = odl_new_module(yyvsp[-2].uint,yyvsp[0].string); newone->filename = g_strdup( yyget_current_filename() ); odl_container_insert_container( yycurrent_container , (odl_container *)newone ); newone->base.parent = (odl_base *)yycurrent_container; newone->base.access = current_access; yycurrent_container = newone; /* doindent(); printf( "push module\n" ); indent+=4; */ } else { yycurrent_container = (odl_container *) odl_find_in_container( (odl_base *)yycurrent_container, yyvsp[0].string); } ; break;} case 8: #line 126 "yparser.y" { if( current_pass == 1 ) { /* printf( "pop_module:\n"); */ yycurrent_container = (odl_container *) odl_container_get_parent(yycurrent_container); /* indent-=4; doindent(); printf( "pop module\n" ); */ } else { yycurrent_container = (odl_container *)yycurrent_container->base.parent; } ; break;} case 9: #line 139 "yparser.y" { odl_class * found_class = NULL; found_class = odl_find_class ( yycurrenttree, yyvsp[0].string, NULL); /* TODO fix extend must use fully qualified name */ /* odl_make_fullname_base( yycurrent_container, $0)); */ if ( found_class != NULL) { beforefind = yycurrent_container; yycurrent_container = found_class; } else { yyerror("Could not find class."); } ; break;} case 10: #line 156 "yparser.y" { if( current_pass == 1 ) { odl_class *c = NULL; c = (odl_class *) yycurrent_container; /* add stuff to class */ if (yyvsp[-1].list) { if (c->contents) { c->contents = g_list_concat (c->contents, yyvsp[-1].list); } else { c->contents = yyvsp[-1].list; } } } yycurrent_container = beforefind; ; break;} case 11: #line 178 "yparser.y" { if( current_pass == 1 ) { odl_class *newone = NULL; char * fullname = NULL; odl_class *check_class = NULL; /* printf( "push_class name: %s\n", $-0); */ newone = odl_new_class(yyvsp[-4].uint, yyvsp[0].string, is_a_type); g_assert( newone ); newone->base.parent = (odl_base *)yycurrent_container; newone->base.access = current_access; newone->filename = g_strdup( yyget_current_filename() ); /* try to find a class with the same name */ fullname = odl_make_fullname_base( (odl_base*) newone ); g_message (fullname); check_class = odl_find_class(yycurrenttree, fullname, NULL); if (check_class != NULL) { yyerror( "Duplicate class name found." ); } /* continue with creating class */ odl_container_insert_container( yycurrent_container , (odl_container *)newone ); yycurrent_container = newone; /* doindent(); printf( "push class\n" ); indent += 4; */ } else { yycurrent_container = (odl_container *) odl_find_in_container( (odl_base *)yycurrent_container, yyvsp[0].string); } ; break;} case 12: #line 213 "yparser.y" { /* GList *l; */ odl_class *c = NULL; if (current_pass == 1) { /* odl_container * tmp; tmp = (odl_container *) yycurrent_container; printf( "pop_class current name: %s\n", tmp->base.name); */ c = (odl_class *) yycurrent_container; yycurrent_container = (odl_container *) odl_container_get_parent (yycurrent_container); /* tmp = (odl_container *) yycurrent_container; printf( "pop_class new name: %s\n", tmp->base.fullname); */ /* indent-=4; doindent(); printf( "pop class\n" ); */ /* add all the class's info to yycurrent_container */ /* add fields in the class (any subclasses already added) */ if (yyvsp[-1].list) { if (c->contents) { c->contents = g_list_concat (c->contents, yyvsp[-1].list); } else { c->contents = yyvsp[-1].list; } } /* add parents */ c->parents = yyvsp[-4].list; } else { /* current_pass == 2 */ odl_standardise_parents ((odl_class *) yycurrent_container); yycurrent_container = (odl_container *) yycurrent_container->base.parent; } ; break;} case 15: #line 260 "yparser.y" { yyval.uint = ODL_ACCESS_DEFAULT; current_access = ODL_ACCESS_DEFAULT; ; break;} case 16: #line 261 "yparser.y" { yyval.uint = yyvsp[0].uint; current_access = yyvsp[0].uint; ; break;} case 17: #line 263 "yparser.y" { yyval.uint = ODL_ACCESS_PUBLIC; current_access = yyval.uint; ; break;} case 18: #line 264 "yparser.y" { yyval.uint = ODL_ACCESS_PRIVATE; current_access = yyval.uint; ; break;} case 19: #line 265 "yparser.y" { yyval.uint = ODL_ACCESS_PROTECTED; current_access = yyval.uint; ; break;} case 20: #line 268 "yparser.y" { yyval.uint = ODL_CLASSTYPE_NORMAL; ; break;} case 21: #line 269 "yparser.y" { yyval.uint = ODL_CLASSTYPE_FINAL; ; break;} case 22: #line 270 "yparser.y" { yyval.uint = ODL_CLASSTYPE_ABSTRACT; ; break;} case 23: #line 271 "yparser.y" { yyval.uint = ODL_CLASSTYPE_SINGLETON; ; break;} case 24: #line 274 "yparser.y" { yyval.bool_value = FALSE; ; break;} case 25: #line 275 "yparser.y" { yyval.bool_value = TRUE; ; break;} case 26: #line 278 "yparser.y" { yyval.bool_value = FALSE; ; break;} case 27: #line 279 "yparser.y" { yyval.bool_value = TRUE; ; break;} case 28: #line 282 "yparser.y" { yyval.string = yyvsp[0].string; ; break;} case 29: #line 283 "yparser.y" { yyval.string = g_strdup_printf("%s::%s",yyvsp[-3].string,yyvsp[0].string); g_free(yyvsp[-3].string); g_free(yyvsp[0].string); ; break;} case 30: #line 286 "yparser.y" { yyval.string = yyvsp[0].string; ; break;} case 31: #line 289 "yparser.y" { yyval.string = yyvsp[0].string; /*printf("[ (%s)\n",$1);*/ ; break;} case 32: #line 292 "yparser.y" { odl_module * wanted = NULL; wanted = odl_find_module( yycurrenttree, yyvsp[0].string, 0); /* printf("Looking for Module: %s, %p\n", $1, wanted); */ yyval.string = yyvsp[0].string; if ((wanted != NULL) && (current_pass == 1)) { yyerror("Duplicate module name."); } ; break;} case 33: #line 304 "yparser.y" { /*printf("[ (%s)\n",$1);*/ yyval.string = yyvsp[0].string; ; break;} case 34: #line 309 "yparser.y" { yyval.string = yyvsp[-1].string; ; break;} case 35: #line 312 "yparser.y" { yyval.string = yyvsp[0].string; ; break;} case 36: #line 315 "yparser.y" {; break;} case 37: #line 316 "yparser.y" {; break;} case 38: #line 317 "yparser.y" {; break;} case 39: #line 318 "yparser.y" {; break;} case 40: #line 319 "yparser.y" {; break;} case 42: #line 325 "yparser.y" { is_a_type = FALSE; ; break;} case 43: #line 325 "yparser.y" {; break;} case 44: #line 328 "yparser.y" { is_a_type = TRUE; ; break;} case 45: #line 328 "yparser.y" {; break;} case 46: #line 331 "yparser.y" {; break;} case 47: #line 334 "yparser.y" { if( current_pass == 1 ) { odl_item *e = odl_new_enum( current_access , yyvsp[-4].string ); if( e ) { GList *l; e->base.parent = (odl_base *)yycurrent_container; l = yyvsp[-2].list; while( l ) { odl_enum_add_element( e , l->data ); l = g_list_next( l ); } yycurrent_container->contents = g_list_append( yycurrent_container->contents, e ); } } odl_namelist_free( yyvsp[-2].list ); ; break;} case 48: #line 358 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 49: #line 359 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].string); ; break;} case 50: #line 362 "yparser.y" { yyval.list = NULL; ; break;} case 51: #line 363 "yparser.y" { yyval.list = yyvsp[0].list; ; break;} case 52: #line 366 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 53: #line 367 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].string); ; break;} case 54: #line 370 "yparser.y" { yyval.list = yyvsp[0].list; ; break;} case 55: #line 371 "yparser.y" { /* if 2 lists, concat them, otherwise pass both on otherwise an empty class */ if( yyvsp[-1].list && yyvsp[0].list ) { yyval.list = g_list_concat(yyvsp[-1].list,yyvsp[0].list); } else if( yyvsp[-1].list != NULL ) { yyval.list = yyvsp[-1].list; } else if( yyvsp[0].list != NULL ) { yyval.list = yyvsp[0].list; } else { yyval.list = yyvsp[-1].list; } ; break;} case 56: #line 390 "yparser.y" { current_access = yyvsp[-2].uint; yyval.list = NULL; ; break;} case 57: #line 391 "yparser.y" { yyval.list = yyvsp[-2].list; ; break;} case 58: #line 394 "yparser.y" { yyval.list = NULL; /* already handled */ ; break;} case 59: #line 395 "yparser.y" { yyval.list = NULL; /* already handled */ ; break;} case 60: #line 396 "yparser.y" { yyval.list = NULL; /* already handled */ ; break;} case 61: #line 397 "yparser.y" { yyval.list = odl_reprocess_fields(yyvsp[-1].datatype,yyvsp[0].list); ; break;} case 62: #line 398 "yparser.y" { yyval.list = g_list_append(NULL,set_method_datatype(yyvsp[-1].datatype,yyvsp[0].item)); ; break;} case 63: #line 399 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].item); ; break;} case 64: #line 400 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].item); ; break;} case 65: #line 401 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].item); ; break;} case 66: #line 402 "yparser.y" { yyval.list = NULL; /* TODO */ ; break;} case 67: #line 403 "yparser.y" { yyval.list = NULL; /* TODO */ ; break;} case 68: #line 404 "yparser.y" { yyval.list = NULL; /* TODO */ ; break;} case 69: #line 405 "yparser.y" { yyval.list = NULL; /* already handled */ ; break;} case 70: #line 406 "yparser.y" { yyval.list = NULL; /* already handled */ ; break;} case 71: #line 409 "yparser.y" { if(current_pass == 2) odl_make_index(yycurrent_container,yyvsp[-4].bool_value,yyvsp[-1].list); else odl_namelist_free(yyvsp[-1].list); ; break;} case 72: #line 416 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 73: #line 417 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].string); ; break;} case 74: #line 420 "yparser.y" { yyval.datatype = alloc_odl_datatype(yyvsp[-1].bool_value,yyvsp[0].string,-1,odl_datatype_id(yyvsp[0].string)); ; break;} case 75: #line 421 "yparser.y" { yyval.datatype = alloc_odl_datatype(FALSE,yyvsp[0].string,-1,DT_enum); ; break;} case 76: #line 422 "yparser.y" { yyval.datatype = alloc_odl_datatype(FALSE,yyvsp[0].string,-1,DT_type); ; break;} case 77: #line 423 "yparser.y" { yyval.datatype = alloc_odl_datatype(FALSE,yyvsp[-1].string,-1,DT_class); ; break;} case 78: #line 424 "yparser.y" { yyval.datatype = alloc_odl_datatype(FALSE,yyvsp[-2].string,0,DT_class); ; break;} case 79: #line 425 "yparser.y" { yyval.datatype = alloc_odl_datatype(FALSE,yyvsp[-3].string,yyvsp[-1].integer,DT_class); yyerror("Bounded lists are not yet supported."); ; break;} case 80: #line 428 "yparser.y" { yyval.string = NULL; ; break;} case 81: #line 429 "yparser.y" { yyval.string = g_strdup_printf("%ld",yyvsp[-1].integer); ; break;} case 82: #line 430 "yparser.y" { yyval.string = g_strdup_printf("%f",yyvsp[-1].floating); ; break;} case 83: #line 431 "yparser.y" { yyval.string = g_strdup_printf("%ld,%ld",yyvsp[-3].integer,yyvsp[-1].integer); ; break;} case 84: #line 432 "yparser.y" { yyval.string = yyvsp[-1].string; ; break;} case 85: #line 433 "yparser.y" { yyval.string = g_strdup_printf("%ld,%s",yyvsp[-3].integer,yyvsp[-1].string); g_free(yyvsp[-1].string); ; break;} case 86: #line 436 "yparser.y" { yyval.string = NULL; ; break;} case 87: #line 437 "yparser.y" { yyval.string = yyvsp[0].string; ; break;} case 88: #line 438 "yparser.y" { yyval.string = g_strdup_printf("%ld",yyvsp[0].integer); ; break;} case 89: #line 439 "yparser.y" { yyval.string = g_strdup_printf("%f",yyvsp[0].floating); ; break;} case 90: #line 440 "yparser.y" { yyval.string = yyvsp[0].string; ; break;} case 91: #line 443 "yparser.y" { yyval.uint = ODL_PROP_NOTNULL; ; break;} case 92: #line 446 "yparser.y" { yyval.uint = yyvsp[0].uint; ; break;} case 93: #line 447 "yparser.y" { yyval.uint = yyvsp[-1].uint | yyvsp[0].uint; ; break;} case 94: #line 450 "yparser.y" { yyval.uint = ODL_PROP_NONE; ; break;} case 95: #line 451 "yparser.y" { yyval.uint = yyvsp[0].uint; ; break;} case 96: #line 455 "yparser.y" { yyval.item = alloc_odl_item(); if( yyval.item ) { yyval.item->base.parent = (odl_base *)yycurrent_container; yyval.item->base.access = current_access; yyval.item->base.name = yyvsp[-4].string; yyval.item->base.type = IT_field; yyval.item->fieldtype = FT_basic; yyval.item->format = yyvsp[-3].string; yyval.item->defaultval = yyvsp[-2].string; yyval.item->properties = yyvsp[-1].uint; } ; break;} case 97: #line 471 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].item); ; break;} case 98: #line 472 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].item); ; break;} case 99: #line 475 "yparser.y" {; break;} case 100: #line 478 "yparser.y" { odl_item *i = alloc_odl_item(); if( i ) { i->base.parent = (odl_base *)yycurrent_container; i->base.type = IT_field; i->base.name = yyvsp[-6].string; i->base.access = current_access; i->fieldtype = FT_method; i->arguments = yyvsp[-2].list; } yyval.item = i; ; break;} case 101: #line 493 "yparser.y" { yyval.list = NULL; ; break;} case 102: #line 494 "yparser.y" { yyval.list = yyvsp[0].list; ; break;} case 103: #line 497 "yparser.y" { yyval.argument = alloc_odl_argument(); yyval.argument->name = yyvsp[-1].string; yyval.argument->datatype = yyvsp[-2].datatype->dt; ; break;} case 104: #line 503 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].argument); ; break;} case 105: #line 504 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].argument); ; break;} case 106: #line 507 "yparser.y" { ; break;} case 107: #line 510 "yparser.y" { yyval.list = yyvsp[-1].list; ; break;} case 108: #line 511 "yparser.y" { yyval.list = yyvsp[-1].list; ; break;} case 109: #line 512 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 110: #line 513 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 111: #line 516 "yparser.y" { yyval.list = g_list_append(NULL,yyvsp[0].string); ; break;} case 112: #line 517 "yparser.y" { yyval.list = g_list_append(yyvsp[-2].list,yyvsp[0].string); ; break;} case 113: #line 520 "yparser.y" { yyval.list = yyvsp[0].list; /* fields in THIS object */ ; break;} case 114: #line 523 "yparser.y" { yyval.list = yyvsp[0].list; /* fields in class to load */ ; break;} case 115: #line 526 "yparser.y" { yyval.datasource = yyvsp[-2].datasource; yyval.datasource->field = yyvsp[0].string; ; break;} case 116: #line 532 "yparser.y" { _odl_datasource *d = alloc_odl_datasource(); if( d ) { d->classname = yyvsp[-3].string; d->fields = yyvsp[-1].list; d->field = NULL; } else yyerror( "Out of memory." ); yyval.datasource = d; ; break;} case 117: #line 545 "yparser.y" { _odl_datasource *d = alloc_odl_datasource(); if( d ) { d->classname = yyvsp[-3].string; d->fields = yyvsp[-1].list; d->field = NULL; } else yyerror( "Out of memory." ); yyval.datasource = d; ; break;} case 118: #line 558 "yparser.y" { odl_item *i = alloc_odl_item(); g_assert( i != NULL); if( i ) { i->base.parent = (odl_base *)yycurrent_container; i->base.type = IT_field; i->base.name = yyvsp[-5].string; i->base.access = current_access; i->fieldtype = FT_lookup; i->source_fields = yyvsp[-2].datasource->fields; i->this_fields = yyvsp[0].list; i->sourceclass = yyvsp[-2].datasource->classname; i->sourcefield = yyvsp[-2].datasource->field; yyvsp[-2].datasource->classname = NULL; yyvsp[-2].datasource->fields = NULL; yyvsp[-2].datasource->field = NULL; free_odl_datasource(yyvsp[-2].datasource); yyval.item = i; } else { yyerror("Out of memory."); yyval.item = NULL; } ; break;} case 119: #line 587 "yparser.y" { odl_item *i = NULL; if( current_pass == 1 ) { i = alloc_odl_item(); g_assert( i != NULL); } if( i ) { i->base.parent = (odl_base *)yycurrent_container; i->base.type = IT_field; i->base.name = yyvsp[-5].string; i->base.access = current_access; i->fieldtype = FT_list; i->source_fields = yyvsp[-2].datasource->fields; i->this_fields = yyvsp[0].list; i->sourceclass = yyvsp[-2].datasource->classname; i->datatype = DT_class; i->datatypeclass = g_strdup( i->sourceclass ); yyvsp[-2].datasource->classname = NULL; yyvsp[-2].datasource->fields = NULL; free_odl_datasource(yyvsp[-2].datasource); yyval.item = i; } else if( current_pass == 1 ) { yyerror("Out of memory."); yyval.item = NULL; } ; break;} case 120: #line 622 "yparser.y" { odl_item *i = NULL; if( current_pass == 1 ) i = alloc_odl_item(); if( i ) { i->base.parent = (odl_base *)yycurrent_container; i->base.type = IT_field; i->base.name = yyvsp[-5].string; i->base.access = current_access; i->fieldtype = FT_reference; i->source_fields = yyvsp[-2].datasource->fields; i->this_fields = yyvsp[0].list; i->sourceclass = yyvsp[-2].datasource->classname; i->datatype = DT_class; i->datatypeclass = g_strdup( i->sourceclass ); yyvsp[-2].datasource->classname = NULL; yyvsp[-2].datasource->fields = NULL; free_odl_datasource(yyvsp[-2].datasource); yyval.item = i; } else if( current_pass == 1 ) { yyerror("Out of memory."); yyval.item = NULL; } ; break;} case 123: #line 658 "yparser.y" { yyval.boolean = FALSE; ; break;} case 124: #line 659 "yparser.y" { yyval.boolean = TRUE; ; break;} case 125: #line 662 "yparser.y" { if( yycurrent_container->orderby ) g_free( yycurrent_container->orderby ); yycurrent_container->orderby = yyvsp[-3].string; yycurrent_container->desc = yyvsp[-1].boolean; ; break;} } #line 610 "/usr/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #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 | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++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 < (int) (sizeof (yytname) / sizeof (char *)); x++) if (yycheck[x + yyn] == x) size += strlen (yytname[x]) + 15, count++; size += strlen ("parse error, unexpected `") + 1; size += strlen (yytname[YYTRANSLATE (yychar)]); msg = (char *) malloc (size); if (msg != 0) { strcpy (msg, "parse error, unexpected `"); strcat (msg, yytname[YYTRANSLATE (yychar)]); strcat (msg, "'"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (int) (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 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: 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; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); 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. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ 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; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: if (yyfree_stacks) { free (yyss); free (yyvs); #if YYLSP_NEEDED free (yyls); #endif } return 0; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: if (yyfree_stacks) { free (yyss); free (yyvs); #if YYLSP_NEEDED free (yyls); #endif } return 1; } #line 667 "yparser.y"