diff --git a/libasn1fix/asn1fix.c b/libasn1fix/asn1fix.c index 24ba7c8d..05118682 100644 --- a/libasn1fix/asn1fix.c +++ b/libasn1fix/asn1fix.c @@ -490,6 +490,9 @@ asn1f_check_duplicate(arg_t *arg) { assert(tmparg.expr->Identifier); assert(arg->expr->Identifier); + if(arg->expr->spec_index != -1) + continue; + if(tmparg.expr == arg->expr) break; if(strcmp(tmparg.expr->Identifier, diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c index bbd7cf4d..4c87afcd 100644 --- a/libasn1fix/asn1fix_param.c +++ b/libasn1fix/asn1fix_param.c @@ -18,11 +18,9 @@ asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_ps resolver_arg_t rarg; /* resolver argument */ asn1p_expr_t *exc; /* expr clone */ asn1p_expr_t *rpc; /* rhs_pspecs clone */ - asn1p_expr_t *target; void *p; struct asn1p_pspec_s *pspec; int npspecs; - int i; assert(rhs_pspecs); assert(expr->lhs_params); @@ -70,24 +68,6 @@ asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_ps pspec->my_clone = exc; exc->spec_index = npspecs; - /* Update LHS->RHS specialization in target */ - target = TQ_FIRST(&rpc->members); - for(i = 0; i < exc->lhs_params->params_count; - i++, target = TQ_NEXT(target, next)) { - if(!target) { target = (void *)0xdeadbeef; break; } - - assert(exc->lhs_params->params[i].into_expr == 0); - exc->lhs_params->params[i].into_expr = target; - } - if(target) { - asn1p_expr_free(exc); - asn1p_expr_free(rpc); - FATAL("Parameterization of %s failed: " - "parameters number mismatch", expr->Identifier); - errno = EPERM; - return NULL; - } - DEBUG("Forked new parameterization for %s", expr->Identifier); /* Commit */ diff --git a/libasn1parser/asn1p_expr.c b/libasn1parser/asn1p_expr.c index 266f2d76..b1cce695 100644 --- a/libasn1parser/asn1p_expr.c +++ b/libasn1parser/asn1p_expr.c @@ -75,8 +75,22 @@ asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*r } else { clone->constraints = tmpct; } + assert(expr->combined_constraints == 0); + } + /* Merge defaults */ + CLCOPY(marker.flags); + CLVRCLONE(marker.default_value, + asn1p_value_clone_with_resolver); + if(clone->tag.tag_class == TC_NOCLASS) { + CLCOPY(tag); + } else if(expr->tag.tag_class != TC_NOCLASS) { + fprintf(stderr, "asn1c does not support " + "nested tagging in parameterization, " + "necessary at line %d\n", + expr->_lineno); + asn1p_expr_free(clone); + return NULL; } - assert(expr->combined_constraints == 0); return clone; } else if(errno != ESRCH) { return NULL; /* Hard error */ @@ -107,7 +121,7 @@ asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*r CLVRCLONE(combined_constraints, asn1p_constraint_clone_with_resolver); CLCLONE(lhs_params, asn1p_paramlist_clone); CLVRCLONE(value, asn1p_value_clone_with_resolver); - CLCLONE(marker.default_value, asn1p_value_clone); + CLVRCLONE(marker.default_value, asn1p_value_clone_with_resolver); CLCLONE(with_syntax, asn1p_wsyntx_clone); /* diff --git a/libasn1parser/asn1p_param.c b/libasn1parser/asn1p_param.c index 3dc511bb..a48faed2 100644 --- a/libasn1parser/asn1p_param.c +++ b/libasn1parser/asn1p_param.c @@ -62,7 +62,8 @@ asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) { pl->params = p; pl->params_size = newsize; memset(&pl->params[pl->params_count], 0, - sizeof(pl->params[0])); + (newsize - pl->params_size) + * sizeof(pl->params[0])); } else { return -1; } @@ -104,7 +105,6 @@ asn1p_paramlist_clone(asn1p_paramlist_t *pl) { newpl = NULL; break; } - newpl->params[i].into_expr = pl->params[i].into_expr; } } diff --git a/libasn1parser/asn1p_param.h b/libasn1parser/asn1p_param.h index 141c82ba..93db90d9 100644 --- a/libasn1parser/asn1p_param.h +++ b/libasn1parser/asn1p_param.h @@ -11,8 +11,6 @@ typedef struct asn1p_paramlist_s { /* Translated from */ asn1p_ref_t *governor; char *argument; - /* Translated into */ - struct asn1p_expr_s *into_expr; } *params; int params_count; int params_size; diff --git a/libasn1parser/asn1p_y.c b/libasn1parser/asn1p_y.c index 31598c8e..33d56f91 100644 --- a/libasn1parser/asn1p_y.c +++ b/libasn1parser/asn1p_y.c @@ -223,11 +223,11 @@ typedef union { -#define YYFINAL 442 +#define YYFINAL 443 #define YYFLAG -32768 #define YYNTBASE 120 -#define YYTRANSLATE(x) ((unsigned)(x) <= 358 ? yytranslate[x] : 226) +#define YYTRANSLATE(x) ((unsigned)(x) <= 358 ? yytranslate[x] : 227) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -275,148 +275,149 @@ static const short yyprhs[] = { 0, 57, 60, 63, 64, 66, 68, 71, 73, 75, 77, 79, 81, 82, 86, 88, 92, 95, 97, 100, 101, 103, 108, 110, 114, 116, 120, 122, 126, 130, 133, - 135, 139, 141, 145, 147, 148, 155, 157, 159, 163, - 167, 174, 176, 180, 182, 186, 190, 194, 196, 200, - 202, 204, 205, 207, 209, 213, 217, 220, 224, 226, - 228, 232, 235, 237, 239, 245, 246, 248, 250, 254, - 257, 262, 266, 270, 274, 278, 282, 283, 285, 286, - 293, 295, 298, 300, 302, 304, 308, 310, 314, 318, - 322, 323, 326, 328, 333, 338, 343, 350, 357, 359, + 135, 139, 141, 145, 147, 148, 155, 157, 159, 164, + 168, 172, 179, 181, 185, 187, 191, 195, 199, 201, + 205, 207, 209, 211, 212, 214, 216, 220, 224, 227, + 231, 233, 235, 239, 242, 244, 246, 252, 253, 255, + 257, 261, 264, 269, 273, 277, 281, 285, 289, 290, + 292, 293, 300, 302, 305, 307, 309, 311, 315, 317, + 321, 325, 329, 330, 333, 335, 340, 345, 350, 357, 364, 366, 371, 375, 377, 381, 385, 389, 391, 395, 397, 401, 403, 405, 407, 409, 413, 417, 419, 424, - 428, 429, 433, 435, 437, 439, 441, 443, 445, 447, - 449, 451, 455, 457, 459, 461, 463, 466, 468, 470, - 472, 474, 477, 480, 482, 484, 487, 490, 492, 494, - 496, 498, 500, 503, 505, 508, 510, 512, 514, 516, + 426, 428, 432, 433, 437, 439, 441, 443, 445, 447, + 449, 451, 453, 457, 459, 461, 463, 465, 468, 470, + 472, 474, 476, 479, 482, 484, 486, 489, 492, 494, + 496, 498, 500, 502, 505, 507, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, - 538, 540, 542, 544, 546, 547, 549, 551, 556, 560, - 565, 567, 571, 577, 579, 583, 587, 591, 595, 600, - 604, 606, 608, 612, 616, 620, 624, 626, 628, 629, - 635, 637, 640, 643, 647, 649, 651, 653, 655, 657, - 659, 661, 663, 667, 673, 675, 679, 681, 685, 686, - 688, 690, 692, 694, 696, 698, 702, 707, 709, 713, - 716, 720, 722, 726, 727, 729, 731, 734, 737, 741, - 743, 747, 749, 754, 759, 761, 763, 765, 767, 768, - 770, 773, 778, 779, 781, 783, 785, 786, 788, 790, - 792, 794, 796, 797, 799 + 538, 540, 542, 544, 546, 548, 549, 551, 553, 558, + 562, 567, 569, 573, 579, 581, 585, 589, 593, 597, + 602, 606, 608, 610, 614, 618, 622, 626, 628, 630, + 631, 637, 639, 642, 645, 649, 651, 653, 655, 657, + 659, 661, 663, 665, 669, 675, 677, 681, 683, 687, + 688, 690, 692, 694, 696, 698, 700, 704, 709, 711, + 715, 718, 722, 724, 728, 729, 731, 733, 736, 739, + 743, 745, 749, 751, 756, 761, 763, 765, 767, 769, + 770, 772, 775, 780, 781, 783, 785, 787, 788, 790, + 792, 794, 796, 798, 799, 801 }; static const short yyrhs[] = { 121, - 0, 122, 0, 121, 122, 0, 222, 123, 38, 127, + 0, 122, 0, 121, 122, 0, 223, 123, 38, 127, 3, 25, 130, 43, 0, 0, 124, 0, 107, 125, 108, 0, 107, 108, 0, 126, 0, 125, 126, 0, - 225, 0, 225, 109, 10, 110, 0, 10, 0, 0, + 226, 0, 226, 109, 10, 110, 0, 10, 0, 0, 128, 0, 129, 0, 128, 129, 0, 45, 88, 0, 56, 88, 0, 24, 88, 0, 47, 57, 0, 15, 61, 0, 0, 131, 0, 132, 0, 131, 132, 0, 134, 0, 140, 0, 146, 0, 176, 0, 143, 0, - 0, 42, 15, 133, 0, 185, 0, 58, 135, 111, + 0, 42, 15, 133, 0, 186, 0, 58, 135, 111, 0, 58, 50, 0, 137, 0, 135, 137, 0, 0, - 124, 0, 138, 50, 222, 136, 0, 139, 0, 138, - 112, 139, 0, 222, 0, 222, 107, 108, 0, 225, + 124, 0, 138, 50, 223, 136, 0, 139, 0, 138, + 112, 139, 0, 223, 0, 223, 107, 108, 0, 226, 0, 46, 141, 111, 0, 46, 21, 111, 0, 46, - 111, 0, 142, 0, 141, 112, 142, 0, 222, 0, - 222, 107, 108, 0, 225, 0, 0, 222, 145, 3, - 107, 144, 181, 0, 170, 0, 182, 0, 222, 3, - 166, 0, 222, 3, 156, 0, 222, 107, 147, 108, - 3, 166, 0, 148, 0, 147, 112, 148, 0, 222, - 0, 222, 113, 225, 0, 222, 113, 222, 0, 182, - 113, 225, 0, 150, 0, 149, 112, 150, 0, 166, - 0, 225, 0, 0, 152, 0, 153, 0, 152, 112, - 153, 0, 225, 166, 211, 0, 166, 211, 0, 34, - 72, 166, 0, 165, 0, 155, 0, 154, 112, 155, - 0, 225, 166, 0, 165, 0, 166, 0, 32, 107, - 158, 108, 160, 0, 0, 92, 0, 159, 0, 158, - 112, 159, 0, 16, 211, 0, 17, 166, 157, 211, - 0, 17, 174, 211, 0, 17, 175, 211, 0, 16, - 174, 211, 0, 16, 166, 211, 0, 16, 175, 211, - 0, 0, 161, 0, 0, 99, 86, 107, 162, 163, - 108, 0, 164, 0, 163, 164, 0, 4, 0, 18, - 0, 173, 0, 114, 163, 115, 0, 106, 0, 106, - 116, 179, 0, 106, 116, 216, 0, 217, 168, 189, - 0, 0, 167, 169, 0, 184, 0, 31, 107, 154, - 108, 0, 82, 107, 151, 108, 0, 83, 107, 151, - 108, 0, 82, 189, 72, 224, 217, 168, 0, 83, - 189, 72, 224, 217, 168, 0, 22, 0, 22, 39, - 29, 225, 0, 170, 0, 170, 107, 149, 108, 0, - 60, 72, 170, 0, 14, 0, 14, 117, 222, 0, - 223, 117, 222, 0, 14, 117, 225, 0, 223, 0, - 223, 117, 171, 0, 172, 0, 171, 117, 172, 0, + 111, 0, 142, 0, 141, 112, 142, 0, 223, 0, + 223, 107, 108, 0, 226, 0, 0, 223, 145, 3, + 107, 144, 182, 0, 185, 0, 170, 0, 170, 107, + 149, 108, 0, 223, 3, 166, 0, 223, 3, 156, + 0, 223, 107, 147, 108, 3, 166, 0, 148, 0, + 147, 112, 148, 0, 223, 0, 223, 113, 226, 0, + 223, 113, 223, 0, 183, 113, 226, 0, 150, 0, + 149, 112, 150, 0, 166, 0, 179, 0, 226, 0, + 0, 152, 0, 153, 0, 152, 112, 153, 0, 226, + 166, 212, 0, 166, 212, 0, 34, 72, 166, 0, + 165, 0, 155, 0, 154, 112, 155, 0, 226, 166, + 0, 165, 0, 166, 0, 32, 107, 158, 108, 160, + 0, 0, 92, 0, 159, 0, 158, 112, 159, 0, + 16, 212, 0, 17, 166, 157, 212, 0, 17, 174, + 212, 0, 17, 175, 212, 0, 16, 174, 212, 0, + 16, 166, 212, 0, 16, 175, 212, 0, 0, 161, + 0, 0, 99, 86, 107, 162, 163, 108, 0, 164, + 0, 163, 164, 0, 4, 0, 18, 0, 173, 0, + 114, 163, 115, 0, 106, 0, 106, 116, 180, 0, + 106, 116, 217, 0, 218, 168, 190, 0, 0, 167, + 169, 0, 145, 0, 31, 107, 154, 108, 0, 82, + 107, 151, 108, 0, 83, 107, 151, 108, 0, 82, + 190, 72, 225, 218, 168, 0, 83, 190, 72, 225, + 218, 168, 0, 22, 0, 22, 39, 29, 226, 0, + 60, 72, 170, 0, 14, 0, 14, 117, 223, 0, + 224, 117, 223, 0, 14, 117, 226, 0, 224, 0, + 224, 117, 171, 0, 172, 0, 171, 117, 172, 0, 173, 0, 16, 0, 17, 0, 16, 0, 174, 117, - 16, 0, 174, 117, 17, 0, 15, 0, 225, 145, - 3, 177, 0, 225, 113, 177, 0, 0, 107, 178, - 181, 0, 67, 0, 49, 0, 90, 0, 6, 0, - 8, 0, 180, 0, 216, 0, 179, 0, 225, 0, - 222, 117, 225, 0, 7, 0, 11, 0, 12, 0, - 5, 0, 181, 5, 0, 28, 0, 67, 0, 80, - 0, 183, 0, 71, 85, 0, 69, 55, 0, 81, - 0, 48, 0, 40, 75, 0, 30, 85, 0, 95, - 0, 51, 0, 185, 0, 62, 0, 44, 0, 26, - 85, 0, 182, 0, 183, 213, 0, 27, 0, 52, - 0, 53, 0, 54, 0, 63, 0, 68, 0, 78, - 0, 87, 0, 89, 0, 94, 0, 96, 0, 97, - 0, 98, 0, 70, 0, 103, 0, 104, 0, 101, - 0, 102, 0, 100, 0, 0, 190, 0, 191, 0, - 84, 109, 192, 110, 0, 109, 192, 110, 0, 191, - 109, 192, 110, 0, 193, 0, 193, 112, 106, 0, - 193, 112, 106, 112, 193, 0, 194, 0, 21, 100, - 194, 0, 193, 186, 194, 0, 193, 187, 194, 0, - 194, 188, 194, 0, 197, 109, 192, 110, 0, 109, - 192, 110, 0, 198, 0, 199, 0, 198, 196, 198, - 0, 65, 196, 198, 0, 198, 196, 64, 0, 65, - 196, 64, 0, 205, 0, 200, 0, 0, 35, 29, - 107, 195, 181, 0, 105, 0, 105, 118, 0, 118, - 105, 0, 118, 105, 118, 0, 84, 0, 50, 0, - 49, 0, 90, 0, 216, 0, 180, 0, 225, 0, - 222, 0, 99, 33, 191, 0, 99, 34, 107, 201, - 108, 0, 202, 0, 201, 112, 202, 0, 106, 0, - 225, 189, 203, 0, 0, 204, 0, 77, 0, 19, - 0, 73, 0, 206, 0, 207, 0, 107, 222, 108, - 0, 206, 107, 208, 108, 0, 209, 0, 208, 112, - 209, 0, 119, 210, 0, 119, 117, 210, 0, 225, - 0, 210, 117, 225, 0, 0, 212, 0, 73, 0, - 37, 177, 0, 107, 108, 0, 107, 214, 108, 0, - 215, 0, 214, 112, 215, 0, 225, 0, 225, 109, - 216, 110, 0, 225, 109, 179, 110, 0, 216, 0, - 106, 0, 10, 0, 13, 0, 0, 218, 0, 219, - 221, 0, 114, 220, 10, 115, 0, 0, 93, 0, - 23, 0, 79, 0, 0, 56, 0, 45, 0, 14, - 0, 15, 0, 15, 0, 0, 225, 0, 9, 0 + 16, 0, 174, 117, 17, 0, 15, 0, 226, 145, + 3, 177, 0, 179, 0, 180, 0, 226, 113, 177, + 0, 0, 107, 178, 182, 0, 67, 0, 49, 0, + 90, 0, 6, 0, 8, 0, 181, 0, 217, 0, + 226, 0, 223, 117, 226, 0, 7, 0, 11, 0, + 12, 0, 5, 0, 182, 5, 0, 28, 0, 67, + 0, 80, 0, 184, 0, 71, 85, 0, 69, 55, + 0, 81, 0, 48, 0, 40, 75, 0, 30, 85, + 0, 95, 0, 51, 0, 186, 0, 62, 0, 44, + 0, 26, 85, 0, 183, 0, 184, 214, 0, 27, + 0, 52, 0, 53, 0, 54, 0, 63, 0, 68, + 0, 78, 0, 87, 0, 89, 0, 94, 0, 96, + 0, 97, 0, 98, 0, 70, 0, 103, 0, 104, + 0, 101, 0, 102, 0, 100, 0, 0, 191, 0, + 192, 0, 84, 109, 193, 110, 0, 109, 193, 110, + 0, 192, 109, 193, 110, 0, 194, 0, 194, 112, + 106, 0, 194, 112, 106, 112, 194, 0, 195, 0, + 21, 100, 195, 0, 194, 187, 195, 0, 194, 188, + 195, 0, 195, 189, 195, 0, 198, 109, 193, 110, + 0, 109, 193, 110, 0, 199, 0, 200, 0, 199, + 197, 199, 0, 65, 197, 199, 0, 199, 197, 64, + 0, 65, 197, 64, 0, 206, 0, 201, 0, 0, + 35, 29, 107, 196, 182, 0, 105, 0, 105, 118, + 0, 118, 105, 0, 118, 105, 118, 0, 84, 0, + 50, 0, 49, 0, 90, 0, 217, 0, 181, 0, + 226, 0, 223, 0, 99, 33, 192, 0, 99, 34, + 107, 202, 108, 0, 203, 0, 202, 112, 203, 0, + 106, 0, 226, 190, 204, 0, 0, 205, 0, 77, + 0, 19, 0, 73, 0, 207, 0, 208, 0, 107, + 223, 108, 0, 207, 107, 209, 108, 0, 210, 0, + 209, 112, 210, 0, 119, 211, 0, 119, 117, 211, + 0, 226, 0, 211, 117, 226, 0, 0, 213, 0, + 73, 0, 37, 177, 0, 107, 108, 0, 107, 215, + 108, 0, 216, 0, 215, 112, 216, 0, 226, 0, + 226, 109, 217, 110, 0, 226, 109, 180, 110, 0, + 217, 0, 106, 0, 10, 0, 13, 0, 0, 219, + 0, 220, 222, 0, 114, 221, 10, 115, 0, 0, + 93, 0, 23, 0, 79, 0, 0, 56, 0, 45, + 0, 14, 0, 15, 0, 15, 0, 0, 226, 0, + 9, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, - 321, 327, 333, 349, 374, 376, 379, 383, 388, 395, - 403, 408, 412, 421, 423, 431, 435, 443, 447, 450, - 453, 457, 477, 479, 487, 491, 523, 527, 536, 543, - 556, 563, 565, 577, 589, 600, 605, 611, 617, 619, - 622, 633, 639, 645, 652, 658, 666, 670, 673, 680, - 686, 692, 699, 705, 714, 716, 725, 733, 747, 757, - 773, 781, 791, 801, 806, 813, 820, 830, 836, 842, - 846, 873, 875, 877, 883, 889, 897, 903, 910, 915, - 921, 927, 933, 936, 942, 952, 954, 957, 965, 972, - 985, 996, 1006, 1017, 1027, 1038, 1049, 1051, 1056, 1060, - 1065, 1070, 1076, 1081, 1084, 1088, 1093, 1102, 1111, 1122, - 1144, 1151, 1170, 1174, 1180, 1186, 1192, 1202, 1212, 1218, - 1239, 1249, 1257, 1271, 1280, 1290, 1300, 1310, 1318, 1339, + 322, 328, 334, 350, 375, 377, 380, 384, 389, 396, + 404, 409, 413, 422, 424, 432, 436, 444, 448, 451, + 454, 458, 478, 480, 488, 492, 524, 528, 537, 544, + 557, 564, 566, 578, 590, 601, 606, 612, 618, 620, + 623, 634, 640, 646, 653, 659, 667, 671, 674, 681, + 687, 693, 700, 706, 715, 717, 726, 740, 750, 766, + 776, 792, 800, 810, 820, 825, 832, 839, 849, 855, + 861, 865, 873, 900, 902, 904, 910, 916, 924, 930, + 937, 942, 948, 954, 960, 963, 969, 979, 981, 984, + 992, 999, 1012, 1023, 1033, 1044, 1054, 1065, 1076, 1078, + 1083, 1087, 1092, 1097, 1103, 1108, 1111, 1115, 1120, 1129, + 1138, 1149, 1171, 1178, 1197, 1201, 1207, 1213, 1219, 1229, + 1239, 1245, 1257, 1271, 1280, 1290, 1300, 1310, 1318, 1339, 1348, 1357, 1359, 1366, 1373, 1379, 1383, 1389, 1409, 1419, - 1427, 1427, 1432, 1437, 1442, 1447, 1451, 1455, 1458, 1461, - 1466, 1478, 1495, 1500, 1505, 1538, 1548, 1562, 1564, 1565, - 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, - 1581, 1583, 1584, 1587, 1594, 1606, 1608, 1612, 1616, 1617, - 1618, 1619, 1620, 1624, 1625, 1626, 1627, 1631, 1632, 1639, - 1639, 1640, 1640, 1641, 1643, 1645, 1650, 1654, 1663, 1667, - 1672, 1676, 1682, 1692, 1696, 1699, 1702, 1705, 1710, 1719, - 1727, 1733, 1739, 1746, 1754, 1762, 1771, 1774, 1777, 1778, - 1788, 1790, 1791, 1792, 1795, 1799, 1804, 1810, 1815, 1818, - 1821, 1834, 1848, 1852, 1857, 1861, 1866, 1873, 1886, 1888, - 1891, 1895, 1898, 1903, 1907, 1915, 1930, 1936, 1943, 1956, - 1968, 1983, 1987, 2004, 2009, 2012, 2017, 2039, 2044, 2049, - 2055, 2061, 2069, 2077, 2085, 2092, 2102, 2107, 2137, 2139, - 2142, 2149, 2155, 2157, 2158, 2159, 2162, 2164, 2165, 2168, - 2173, 2180, 2187, 2189, 2194 + 1421, 1422, 1429, 1429, 1434, 1441, 1447, 1452, 1456, 1460, + 1463, 1468, 1480, 1497, 1502, 1507, 1540, 1550, 1564, 1566, + 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, + 1577, 1583, 1585, 1586, 1589, 1596, 1608, 1610, 1614, 1618, + 1619, 1620, 1621, 1622, 1626, 1627, 1628, 1629, 1633, 1634, + 1641, 1641, 1642, 1642, 1643, 1645, 1647, 1652, 1656, 1665, + 1669, 1674, 1678, 1684, 1694, 1698, 1701, 1704, 1707, 1712, + 1721, 1729, 1735, 1741, 1748, 1756, 1764, 1773, 1776, 1779, + 1780, 1790, 1792, 1793, 1794, 1797, 1801, 1806, 1812, 1817, + 1820, 1823, 1836, 1850, 1854, 1859, 1863, 1868, 1875, 1888, + 1890, 1893, 1897, 1900, 1905, 1909, 1917, 1932, 1938, 1945, + 1958, 1970, 1985, 1989, 2006, 2011, 2014, 2019, 2041, 2046, + 2051, 2057, 2063, 2071, 2079, 2087, 2094, 2104, 2109, 2139, + 2141, 2144, 2151, 2157, 2159, 2160, 2161, 2164, 2166, 2167, + 2170, 2175, 2182, 2189, 2191, 2196 }; #endif @@ -450,18 +451,18 @@ static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ", "ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition", "ImportsBundleSet","AssignedIdentifier","ImportsBundle","ImportsList","ImportsElement", "ExportsDefinition","ExportsBody","ExportsElement","ValueSetDefinition","@2", -"DefinedTypeRef","DataTypeReference","ParameterArgumentList","ParameterArgumentName", +"DefinedType","DataTypeReference","ParameterArgumentList","ParameterArgumentName", "Specializations","Specialization","optComponentTypeLists","ComponentTypeLists", "ComponentType","AlternativeTypeLists","AlternativeType","ObjectClass","optUnique", "FieldSpec","ClassField","optWithSyntax","WithSyntax","@3","WithSyntaxList", "WithSyntaxToken","ExtensionAndException","Type","NSTD_IndirectMarker","TypeDeclaration", "TypeDeclarationSet","ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement", "PrimitiveFieldReference","FieldName","DefinedObjectClass","ValueDefinition", -"Value","@4","DefinedValue","RestrictedCharacterStringValue","Opaque","BasicTypeId", -"BasicTypeId_UniverationCompatible","BasicType","BasicString","Union","Intersection", -"Except","optConstraints","Constraints","SetOfConstraints","ElementSetSpecs", -"ElementSetSpec","ConstraintSubtypeElement","@5","ConstraintRangeSpec","ConstraintSpec", -"SingleValue","ContainedSubtype","InnerTypeConstraint","WithComponentsList", +"Value","@4","SimpleValue","DefinedValue","RestrictedCharacterStringValue","Opaque", +"BasicTypeId","BasicTypeId_UniverationCompatible","BasicType","BasicString", +"Union","Intersection","Except","optConstraints","Constraints","SetOfConstraints", +"ElementSetSpecs","ElementSetSpec","ConstraintSubtypeElement","@5","ConstraintRangeSpec", +"ConstraintSpec","SingleValue","ContainedSubtype","InnerTypeConstraint","WithComponentsList", "WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint", "SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement", "ComponentIdList","optMarker","Marker","UniverationDefinition","UniverationList", @@ -476,30 +477,30 @@ static const short yyr1[] = { 0, 129, 129, 130, 130, 131, 131, 132, 132, 132, 132, 132, 133, 132, 132, 134, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 139, 140, 140, 140, 141, - 141, 142, 142, 142, 144, 143, 145, 145, 146, 146, - 146, 147, 147, 148, 148, 148, 148, 149, 149, 150, - 150, 151, 151, 152, 152, 153, 153, 153, 153, 154, - 154, 155, 155, 155, 156, 157, 157, 158, 158, 159, - 159, 159, 159, 159, 159, 159, 160, 160, 162, 161, - 163, 163, 164, 164, 164, 164, 165, 165, 165, 166, - 167, 168, 169, 169, 169, 169, 169, 169, 169, 169, + 141, 142, 142, 142, 144, 143, 145, 145, 145, 146, + 146, 146, 147, 147, 148, 148, 148, 148, 149, 149, + 150, 150, 150, 151, 151, 152, 152, 153, 153, 153, + 153, 154, 154, 155, 155, 155, 156, 157, 157, 158, + 158, 159, 159, 159, 159, 159, 159, 159, 160, 160, + 162, 161, 163, 163, 164, 164, 164, 164, 165, 165, + 165, 166, 167, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 170, 170, 171, 171, 172, 173, 173, 174, 174, 174, 175, 176, 177, - 178, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 179, 179, 180, 180, 180, 181, 181, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 183, 183, 183, 184, 184, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, - 186, 187, 187, 188, 189, 189, 190, 190, 191, 191, - 192, 192, 192, 193, 193, 193, 193, 193, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 195, 194, - 196, 196, 196, 196, 197, 197, 198, 198, 198, 198, - 198, 199, 200, 200, 201, 201, 202, 202, 203, 203, - 204, 204, 204, 205, 205, 206, 207, 208, 208, 209, - 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, - 214, 215, 215, 215, 215, 215, 216, 216, 217, 217, - 218, 219, 220, 220, 220, 220, 221, 221, 221, 222, - 222, 223, 224, 224, 225 + 177, 177, 178, 177, 177, 179, 179, 179, 179, 179, + 179, 180, 180, 181, 181, 181, 182, 182, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 185, 185, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 187, 187, 188, 188, 189, 190, 190, 191, 191, 192, + 192, 193, 193, 193, 194, 194, 194, 194, 194, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 196, + 195, 197, 197, 197, 197, 198, 198, 199, 199, 199, + 199, 199, 200, 201, 201, 202, 202, 203, 203, 204, + 204, 205, 205, 205, 206, 206, 207, 208, 209, 209, + 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, + 215, 215, 216, 216, 216, 216, 216, 217, 217, 218, + 218, 219, 220, 221, 221, 221, 221, 222, 222, 222, + 223, 223, 224, 225, 225, 226 }; static const short yyr2[] = { 0, @@ -508,307 +509,297 @@ static const short yyr2[] = { 0, 2, 2, 0, 1, 1, 2, 1, 1, 1, 1, 1, 0, 3, 1, 3, 2, 1, 2, 0, 1, 4, 1, 3, 1, 3, 1, 3, 3, 2, 1, - 3, 1, 3, 1, 0, 6, 1, 1, 3, 3, - 6, 1, 3, 1, 3, 3, 3, 1, 3, 1, - 1, 0, 1, 1, 3, 3, 2, 3, 1, 1, - 3, 2, 1, 1, 5, 0, 1, 1, 3, 2, - 4, 3, 3, 3, 3, 3, 0, 1, 0, 6, - 1, 2, 1, 1, 1, 3, 1, 3, 3, 3, - 0, 2, 1, 4, 4, 4, 6, 6, 1, 4, + 3, 1, 3, 1, 0, 6, 1, 1, 4, 3, + 3, 6, 1, 3, 1, 3, 3, 3, 1, 3, + 1, 1, 1, 0, 1, 1, 3, 3, 2, 3, + 1, 1, 3, 2, 1, 1, 5, 0, 1, 1, + 3, 2, 4, 3, 3, 3, 3, 3, 0, 1, + 0, 6, 1, 2, 1, 1, 1, 3, 1, 3, + 3, 3, 0, 2, 1, 4, 4, 4, 6, 6, 1, 4, 3, 1, 3, 3, 3, 1, 3, 1, - 3, 1, 1, 1, 1, 3, 3, 1, 4, 3, - 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, - 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 3, 3, 1, 4, 1, + 1, 3, 0, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, + 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, + 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 1, 4, 3, 4, - 1, 3, 5, 1, 3, 3, 3, 3, 4, 3, - 1, 1, 3, 3, 3, 3, 1, 1, 0, 5, - 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 5, 1, 3, 1, 3, 0, 1, - 1, 1, 1, 1, 1, 3, 4, 1, 3, 2, - 3, 1, 3, 0, 1, 1, 2, 2, 3, 1, - 3, 1, 4, 4, 1, 1, 1, 1, 0, 1, - 2, 4, 0, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 0, 1, 1 + 1, 1, 1, 1, 1, 0, 1, 1, 4, 3, + 4, 1, 3, 5, 1, 3, 3, 3, 3, 4, + 3, 1, 1, 3, 3, 3, 3, 1, 1, 0, + 5, 1, 2, 2, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 5, 1, 3, 1, 3, 0, + 1, 1, 1, 1, 1, 1, 3, 4, 1, 3, + 2, 3, 1, 3, 0, 1, 1, 2, 2, 3, + 1, 3, 1, 4, 4, 1, 1, 1, 1, 0, + 1, 2, 4, 0, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 0, 1, 1 }; static const short yydefact[] = { 0, - 280, 281, 1, 2, 5, 3, 0, 0, 6, 285, + 281, 282, 1, 2, 5, 3, 0, 0, 6, 286, 13, 8, 0, 9, 11, 14, 7, 10, 0, 0, 0, 0, 0, 0, 0, 15, 16, 0, 22, 20, - 18, 21, 19, 0, 17, 12, 23, 176, 0, 0, - 177, 178, 179, 0, 180, 181, 189, 182, 183, 184, - 185, 186, 187, 188, 0, 24, 25, 27, 28, 31, + 18, 21, 19, 0, 17, 12, 23, 177, 0, 0, + 178, 179, 180, 0, 181, 182, 190, 183, 184, 185, + 186, 187, 188, 189, 0, 24, 25, 27, 28, 31, 29, 30, 34, 0, 0, 32, 0, 49, 0, 50, 52, 54, 36, 0, 37, 0, 42, 44, 46, 4, - 26, 269, 124, 282, 0, 158, 0, 0, 172, 165, - 169, 171, 159, 0, 0, 160, 164, 168, 0, 0, - 57, 58, 161, 170, 128, 0, 33, 48, 47, 0, - 0, 35, 38, 0, 0, 0, 0, 273, 60, 59, - 111, 270, 277, 0, 173, 167, 166, 163, 162, 0, - 62, 0, 64, 0, 0, 0, 51, 53, 39, 43, - 45, 0, 275, 276, 274, 0, 0, 195, 279, 278, - 271, 125, 127, 0, 0, 0, 0, 55, 133, 134, - 129, 130, 132, 126, 146, 153, 147, 267, 154, 155, - 268, 144, 143, 145, 141, 139, 150, 148, 149, 0, - 151, 40, 41, 269, 269, 0, 88, 0, 119, 0, - 0, 195, 195, 112, 121, 174, 161, 113, 0, 0, - 110, 196, 197, 269, 63, 67, 66, 65, 0, 0, - 0, 0, 0, 138, 135, 0, 256, 254, 254, 254, - 90, 255, 86, 254, 254, 97, 0, 272, 0, 269, - 0, 269, 0, 269, 0, 269, 0, 175, 0, 0, - 0, 227, 226, 0, 225, 228, 0, 0, 0, 230, - 0, 201, 204, 0, 211, 212, 218, 217, 244, 245, - 229, 232, 231, 0, 61, 156, 56, 131, 142, 152, - 140, 257, 95, 0, 94, 96, 87, 254, 92, 93, - 0, 85, 98, 89, 0, 107, 0, 80, 83, 84, - 269, 123, 0, 0, 73, 74, 79, 254, 269, 283, - 0, 283, 0, 68, 70, 71, 266, 258, 0, 260, - 265, 262, 0, 0, 0, 221, 0, 0, 0, 0, - 0, 0, 199, 192, 193, 190, 191, 0, 0, 0, - 194, 0, 0, 0, 0, 0, 157, 136, 137, 91, - 0, 120, 0, 114, 269, 82, 269, 115, 269, 77, - 254, 269, 284, 116, 269, 122, 269, 259, 0, 0, - 198, 205, 219, 222, 223, 216, 214, 233, 0, 246, - 210, 202, 206, 207, 208, 0, 215, 213, 0, 0, - 248, 200, 99, 108, 109, 151, 81, 78, 75, 76, - 111, 111, 69, 261, 0, 0, 0, 224, 237, 0, - 235, 195, 0, 209, 0, 250, 252, 247, 0, 0, - 117, 118, 264, 263, 220, 234, 0, 239, 203, 251, - 0, 249, 103, 104, 0, 0, 101, 105, 236, 242, - 243, 241, 238, 240, 253, 0, 100, 102, 106, 0, - 0, 0 + 26, 270, 124, 283, 0, 159, 0, 0, 173, 166, + 170, 172, 160, 0, 0, 161, 165, 169, 0, 0, + 58, 175, 162, 57, 171, 128, 0, 33, 48, 47, + 0, 0, 35, 38, 0, 0, 0, 0, 274, 61, + 60, 113, 271, 278, 0, 174, 168, 167, 164, 163, + 0, 63, 0, 162, 65, 0, 270, 0, 176, 0, + 0, 51, 53, 39, 43, 45, 0, 276, 277, 275, + 0, 0, 196, 280, 279, 272, 125, 127, 0, 0, + 0, 0, 55, 148, 154, 149, 268, 155, 156, 269, + 146, 147, 0, 69, 71, 72, 150, 151, 73, 267, + 259, 0, 261, 266, 263, 133, 134, 129, 130, 132, + 126, 145, 143, 139, 140, 141, 0, 152, 40, 41, + 270, 270, 0, 90, 0, 121, 0, 0, 196, 196, + 115, 114, 0, 0, 112, 197, 198, 270, 64, 68, + 67, 66, 0, 59, 270, 260, 0, 0, 0, 0, + 0, 0, 138, 135, 0, 257, 255, 255, 255, 92, + 256, 88, 255, 255, 99, 0, 273, 0, 270, 0, + 270, 0, 270, 0, 0, 0, 0, 228, 227, 0, + 226, 229, 0, 0, 0, 231, 0, 202, 205, 0, + 212, 213, 219, 218, 245, 246, 230, 233, 232, 0, + 62, 157, 56, 70, 262, 0, 0, 152, 131, 144, + 153, 142, 258, 97, 0, 96, 98, 89, 255, 94, + 95, 0, 87, 100, 91, 0, 109, 0, 82, 85, + 86, 270, 123, 0, 0, 75, 76, 81, 255, 270, + 284, 0, 284, 0, 0, 0, 222, 0, 0, 0, + 0, 0, 0, 200, 193, 194, 191, 192, 0, 0, + 0, 195, 0, 0, 0, 0, 0, 158, 265, 264, + 136, 137, 93, 0, 122, 0, 116, 270, 84, 270, + 117, 270, 79, 255, 270, 285, 118, 270, 199, 206, + 220, 223, 224, 217, 215, 234, 0, 247, 211, 203, + 207, 208, 209, 0, 216, 214, 0, 0, 249, 201, + 101, 110, 111, 83, 80, 77, 78, 113, 113, 0, + 225, 238, 0, 236, 196, 0, 210, 0, 251, 253, + 248, 0, 0, 119, 120, 221, 235, 0, 240, 204, + 252, 0, 250, 105, 106, 0, 0, 103, 107, 237, + 243, 244, 242, 239, 241, 254, 0, 102, 104, 108, + 0, 0, 0 }; -static const short yydefgoto[] = { 440, +static const short yydefgoto[] = { 441, 3, 4, 8, 9, 13, 14, 25, 26, 27, 55, - 56, 57, 107, 58, 74, 183, 75, 76, 77, 59, - 69, 70, 60, 209, 100, 61, 130, 131, 303, 304, - 294, 295, 296, 287, 288, 119, 278, 186, 187, 282, - 283, 410, 426, 427, 297, 298, 147, 148, 194, 101, - 161, 162, 428, 219, 220, 62, 176, 211, 177, 250, - 267, 102, 103, 198, 104, 329, 330, 332, 201, 202, - 203, 251, 252, 253, 397, 318, 254, 255, 256, 257, - 400, 401, 433, 434, 258, 259, 260, 380, 381, 406, - 221, 222, 238, 309, 310, 261, 121, 122, 123, 146, - 151, 262, 105, 352, 263 + 56, 57, 108, 58, 74, 200, 75, 76, 77, 59, + 69, 70, 60, 223, 100, 61, 131, 132, 173, 174, + 315, 316, 317, 308, 309, 120, 299, 203, 204, 303, + 304, 413, 427, 428, 318, 319, 152, 153, 212, 101, + 188, 189, 429, 238, 239, 62, 194, 230, 195, 196, + 266, 283, 102, 103, 104, 105, 340, 341, 343, 215, + 216, 217, 267, 268, 269, 400, 329, 270, 271, 272, + 273, 403, 404, 434, 435, 274, 275, 276, 388, 389, + 409, 240, 241, 139, 182, 183, 277, 122, 123, 124, + 151, 156, 278, 106, 365, 279 }; -static const short yypact[] = { 25, --32768,-32768, 25,-32768, -76,-32768, 18, 97,-32768,-32768, --32768,-32768, 34,-32768, -30, 139,-32768,-32768, 62, 82, - 73, 100, 128, 102, 195, 139,-32768, 109,-32768,-32768, --32768,-32768,-32768, 199,-32768,-32768, 429,-32768, 229, 49, --32768,-32768,-32768, 207,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 219, 429,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 353, 582,-32768, 158,-32768, -6,-32768, - 172,-32768,-32768, 67,-32768, -32,-32768, 175,-32768,-32768, --32768, -15, 183,-32768, 217,-32768, 223, 240,-32768,-32768, --32768,-32768,-32768, 261, 241,-32768,-32768,-32768, 658, 315, --32768,-32768,-32768,-32768, 210, 325,-32768,-32768,-32768, 233, - 221,-32768,-32768, 25, 233, 222, 224, 48,-32768,-32768, --32768,-32768, 148, 233,-32768,-32768,-32768,-32768,-32768, -34, --32768, 220, 226, 225, 282, 455,-32768,-32768, -76,-32768, --32768, 191,-32768,-32768,-32768, 324, 506, -48,-32768,-32768, --32768,-32768,-32768, 332, 658, 328, 233,-32768,-32768,-32768, - 230,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 231, - 227,-32768,-32768, 75, 37, 45,-32768, 234, 302, 239, - 279, 129, 134,-32768, 247,-32768, 248,-32768, 254, 161, --32768,-32768, 256, 243,-32768,-32768,-32768,-32768, 359, 218, - 359, 328, 455,-32768,-32768, 455,-32768, -5, 22, -5, --32768,-32768, 277, 22, -5, 267, 191,-32768, 341, 41, - 238, 26, 299, 26, 301, 16, 56,-32768, 161, 276, - 345,-32768,-32768, 76,-32768,-32768, 258, 25, 161,-32768, - 268, 163, 285, 273, 76,-32768,-32768,-32768, 270,-32768, --32768,-32768,-32768, 161,-32768,-32768, 381,-32768, 381,-32768, --32768,-32768,-32768, 255,-32768,-32768,-32768, -5,-32768,-32768, - 303,-32768,-32768,-32768, 328, 271, 138,-32768,-32768,-32768, - 243,-32768, 316, 283, 278,-32768,-32768, -5, 243, 328, - 284, 328, 151,-32768,-32768,-32768,-32768,-32768, 165,-32768, --32768, 286, 289, 310, 295, 290, 291, 190, 304, 296, - 317, 308,-32768,-32768,-32768,-32768,-32768, 305, 310, 310, --32768, 310, 161, 294, 293, 318,-32768,-32768,-32768,-32768, - 319,-32768, 274,-32768, 41,-32768, 243,-32768, 17,-32768, - -5, 243,-32768,-32768, 243,-32768, 16,-32768, 74, 274, --32768,-32768,-32768,-32768, 309,-32768,-32768, 256, 15,-32768, --32768, 320,-32768,-32768,-32768, 326,-32768,-32768, 7, 173, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 327, 329, 359,-32768,-32768, 182, --32768, -48, 161,-32768, 328, 312,-32768,-32768, 293, 38, --32768,-32768,-32768,-32768, 381,-32768, 15, 160, 208, 312, - 328,-32768,-32768,-32768, 38, 30,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 5,-32768,-32768,-32768, 430, - 435,-32768 +static const short yypact[] = { 58, +-32768,-32768, 58,-32768, -52,-32768, 11, 63,-32768,-32768, +-32768,-32768, 19,-32768, -13, 193,-32768,-32768, 105, 92, + 20, 71, 108, 107, 197, 193,-32768, 101,-32768,-32768, +-32768,-32768,-32768, 212,-32768,-32768, 415,-32768, 230, 45, +-32768,-32768,-32768, 182,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 210, 415,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 240, 568,-32768, 152,-32768, 139,-32768, + 162,-32768,-32768, 47,-32768, -34,-32768, 164,-32768,-32768, +-32768, 37, 157,-32768, 204,-32768, 211, 226,-32768,-32768, +-32768,-32768,-32768, 251, 227,-32768,-32768,-32768, 644, 314, + 217,-32768, 235,-32768,-32768, 202, 330,-32768,-32768,-32768, + 200, 232,-32768,-32768, 58, 200, 253, 241, 134,-32768, +-32768,-32768,-32768, 36, 200,-32768,-32768,-32768,-32768,-32768, + 95,-32768, 256,-32768, 260, 272, 76, 61,-32768, 367, + 174,-32768,-32768, -52,-32768,-32768, 288,-32768,-32768,-32768, + 375, 492, 90,-32768,-32768,-32768,-32768,-32768, 384, 644, + 381, 200,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 122,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 140,-32768,-32768, 289,-32768,-32768, 282,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 283, 293,-32768,-32768, + 98, 32, 178,-32768, 292, 373, 306, 344, 188, 216, +-32768,-32768, 305, 353,-32768,-32768, 316, 309,-32768,-32768, +-32768,-32768, 421,-32768, 76,-32768, 67, 395, 315, 421, + 381, 174,-32768,-32768, 174,-32768, 21, 99, 21,-32768, +-32768, 335, 99, 21, 329, 288,-32768, 404, 33, 268, + 56, 362, 56, 363, 353, 336, 409,-32768,-32768, 74, +-32768,-32768, 319, 58, 353,-32768, 331, 274, 339, 337, + 74,-32768,-32768,-32768, 333,-32768,-32768,-32768,-32768, 353, +-32768,-32768, 439,-32768,-32768, 338, 340,-32768,-32768, 439, +-32768,-32768,-32768,-32768, 342,-32768,-32768,-32768, 21,-32768, +-32768, 359,-32768,-32768,-32768, 381, 343, 214,-32768,-32768, +-32768, 309,-32768, 377, 345, 346,-32768,-32768, 21, 309, + 381, 347, 381, 341, 382, 349, 352, 358, 249, 355, + 364, 357, 365,-32768,-32768,-32768,-32768,-32768, 348, 382, + 382,-32768, 382, 353, 266, 360, 366,-32768,-32768,-32768, +-32768,-32768,-32768, 370,-32768, 395,-32768, 33,-32768, 309, +-32768, 34,-32768, 21, 309,-32768,-32768, 309,-32768,-32768, +-32768,-32768, 356,-32768,-32768, 316, 31,-32768,-32768, 368, +-32768,-32768,-32768, 372,-32768,-32768, 5, 233,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 421, +-32768,-32768, 242,-32768, 90, 353,-32768, 381, 369,-32768, +-32768, 360, 18,-32768,-32768, 439,-32768, 31, 158, 318, + 369, 381,-32768,-32768,-32768, 18, 35,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 9,-32768,-32768,-32768, + 484, 487,-32768 }; static const short yypgoto[] = {-32768, --32768, 438,-32768, 306,-32768, 433,-32768,-32768, 426,-32768, --32768, 397,-32768,-32768,-32768,-32768, 380,-32768, 340,-32768, --32768, 347,-32768,-32768, 393,-32768,-32768, 321,-32768, 115, - 244,-32768, 110,-32768, 132,-32768,-32768,-32768, 246,-32768, --32768,-32768, 54, -329, -223, -71,-32768, -78,-32768, -137, --32768, 264, -106, 300, 311,-32768, -115,-32768, -215, -124, - -206, -37, 333,-32768, 40,-32768,-32768,-32768, -190,-32768, - 167, -72, 81, -74,-32768, 235,-32768, -232,-32768,-32768, --32768, 71,-32768,-32768,-32768,-32768,-32768,-32768, 80, 86, - -205,-32768,-32768,-32768, 135, -128, -186,-32768,-32768,-32768, --32768, 1,-32768, 193, -7 +-32768, 485,-32768, 350,-32768, 477,-32768,-32768, 466,-32768, +-32768, 440,-32768,-32768,-32768,-32768, 423,-32768, 379,-32768, +-32768, 387,-32768,-32768, -19,-32768,-32768, 361,-32768, 275, + 246,-32768, 141,-32768, 143,-32768,-32768,-32768, 259,-32768, +-32768,-32768, 82, -277, -237, -73,-32768, -27,-32768, 265, +-32768, 281, -109, 322, 323,-32768, -30,-32768, -122, -218, + -31, -225, -67, -49,-32768, 7,-32768,-32768,-32768, -207, +-32768, 186, -87, 111, 3,-32768, 255,-32768, -238,-32768, +-32768,-32768, 109,-32768,-32768,-32768,-32768,-32768,-32768, 116, + 121, -220,-32768,-32768,-32768, 303, -130, -146,-32768,-32768, +-32768,-32768, 1,-32768, 208, -7 }; -#define YYLAST 756 +#define YYLAST 742 static const short yytable[] = { 15, - 5, 233, 235, 5, 269, 15, 289, 179, 423, 195, - 120, 178, 273, 275, 276, 10, 117, 114, 279, 280, - 159, 160, 424, 10, 10, 10, 10, 11, 163, 65, - 7, 216, 72, 423, 10, 199, 79, 64, 1, 2, - 71, 423, 10, 11, 78, 159, 160, 424, 65, 10, - 293, 214, 215, 159, 160, 424, 64, 10, 216, 293, - 200, 132, 1, 2, 10, 168, 79, 217, 171, 67, - 143, 28, 340, 154, 78, 10, 63, 155, 19, 115, - 1, 2, 10, 168, 179, 367, 171, 179, 178, 214, - 215, 178, 350, 292, 217, 63, 438, 271, 118, 133, - 272, 378, 72, 163, 109, 110, 438, 79, 311, 196, - 71, 216, 218, 223, 139, 78, 153, 132, 425, 439, - 399, 289, 286, 405, 152, 12, 144, 384, 181, 118, - 118, 286, 265, -72, 16, 164, 180, 437, 274, 118, - 145, 17, 29, 425, 395, 390, 286, 217, 206, 208, - 118, 425, 226, 20, 118, 133, 227, 207, 290, 68, - 30, 307, 21, 308, 305, 391, 313, 166, 392, 10, - 168, 169, 170, 171, 1, 2, 322, 112, 430, 307, - 316, 240, -254, 22, 32, 23, -254, 31, 118, 33, - 415, 336, 149, 317, 24, 241, 166, 34, 10, 168, - 169, 170, 171, 150, 270, 181, 184, 185, 181, 242, - 243, 418, 199, 180, 385, 10, 180, 199, 36, 346, - 1, 2, 291, 37, 299, 244, 299, 351, 306, 312, - 311, 396, 431, 159, 160, 232, 432, 200, 242, 362, - 234, 10, 200, 66, 245, 344, 1, 2, 321, 345, - 246, 83, 84, 366, 373, 374, 73, 375, 356, 247, - 376, 80, 357, 324, 325, 326, 327, 248, 108, 249, - 338, 339, 358, 290, 328, 388, 359, 342, 111, 246, - 408, 116, 10, 168, 409, 305, 171, 1, 2, 416, - 319, 320, 353, 417, 353, 1, 2, 159, 160, 124, - 166, 125, 10, 168, 169, 170, 171, 126, 324, 325, - 326, 327, 411, 412, 127, 128, 166, 134, 10, 168, - 169, 170, 171, 1, 2, 129, 135, 136, 138, 141, - 142, 158, 156, 188, 204, 386, 10, 291, 157, 213, - 229, 299, 242, 180, 241, 230, 210, 212, 228, 306, - 231, 312, 386, 236, 237, 82, 118, 377, 242, 243, - 180, 402, 239, 266, 264, 281, 83, 84, 277, 285, - 300, 407, 302, 315, 244, 314, 335, 323, 85, 38, - 86, 333, 87, 246, 331, 337, 343, 347, 341, 349, - 348, 354, 88, 245, 360, 365, 89, 407, 361, 246, - 90, 363, 369, 91, 41, 42, 43, 364, 247, 402, - 372, 379, 200, 435, 92, 45, 248, 371, 249, 93, - 46, 94, 47, 95, 370, 383, 398, 382, 421, 441, - 48, 403, 96, 97, 442, 404, 413, 10, 414, 49, - 6, 50, 1, 2, 182, 18, 51, 98, 52, 53, - 54, 35, 81, 113, 140, 38, 137, 106, 389, 99, - 165, 166, 167, 10, 168, 169, 170, 171, 1, 2, - 39, 393, 284, 268, 40, 205, 387, 301, 436, 197, - 41, 42, 43, 419, 224, 368, 44, 429, 422, 334, - 420, 45, 0, 394, 355, 225, 46, 0, 47, 0, - 0, 0, 0, 172, 0, 0, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 49, 0, 50, 0, 83, - 84, 173, 51, 0, 52, 53, 54, 189, 0, 0, - 0, 85, 38, 86, 0, 87, 190, 0, 0, 0, - 0, 0, 0, 0, 174, 88, 0, 0, 0, 89, - 0, 0, 0, 90, 0, 0, 91, 41, 42, 43, - 0, 175, 0, 0, 0, 191, 0, 92, 45, 0, - 0, 0, 93, 46, 94, 47, 95, 0, 0, 0, - 0, 0, 0, 48, 0, 96, 97, 192, 193, 0, - 0, 0, 49, 0, 50, 83, 84, 0, 0, 51, - 98, 52, 53, 54, 0, 0, 0, 85, 38, 86, - 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 88, 0, 0, 0, 89, 0, 0, 0, 90, + 5, 252, 254, 5, 290, 15, 178, 184, 121, 286, + 178, 310, 424, 10, 176, 115, 294, 296, 297, 10, + 11, 424, 300, 301, 186, 187, 425, 10, 11, 65, + 190, 133, 72, 186, 187, 425, 79, 64, 424, 10, + 71, 10, 10, 63, 78, 107, 233, 234, 65, 134, + 186, 187, 425, 10, 7, 10, 64, 235, 1, 2, + 1, 2, 63, 175, 10, 67, 79, 314, 118, 10, + 167, 1, 2, 170, 78, 10, 167, 116, 353, 170, + 154, 164, 165, 166, 10, 167, 168, 169, 170, 314, + 375, 155, 133, 236, 178, 19, 184, 287, 363, 135, + 16, 178, 176, 72, 178, 177, 386, 30, 79, 177, + 134, 71, 233, 234, 28, 144, 78, 158, 12, 190, + 310, 408, 426, 440, 171, 157, 17, 237, 242, 179, + 185, 426, 211, 198, 235, 235, 402, 392, 307, 307, + 191, 197, 438, 397, 281, 119, 119, 119, 426, 439, + 119, 175, 29, 220, 222, 68, 148, 113, 31, 439, + 135, 307, 221, -74, 32, 172, 180, 324, 181, 119, + 236, 236, 180, 213, 416, 311, 431, 333, 327, 164, + 165, 166, 10, 167, 168, 169, 170, 1, 2, 119, + 10, 328, 347, 177, 33, 1, 2, 419, 214, 34, + 177, 292, 159, 177, 293, -255, 160, 20, 10, -255, + 36, 119, 149, 1, 2, 295, 21, 179, 398, 185, + 288, 399, 171, 291, 198, 393, 150, 198, 197, 224, + 432, 73, 197, 225, 433, 197, 37, 22, 359, 23, + 192, 312, 82, 320, 66, 320, 364, 226, 24, 110, + 111, 227, 80, 83, 84, 165, 384, 10, 167, 168, + 169, 170, 109, 172, 332, 85, 38, 86, 112, 87, + 117, 213, 165, 125, 10, 167, 168, 169, 170, 88, + 193, 83, 84, 89, 311, 245, 395, 90, 126, 246, + 91, 41, 42, 43, 251, 127, 214, 258, 355, 213, + 128, 92, 45, 201, 202, 129, 93, 46, 94, 47, + 95, 130, 374, 366, 258, 366, 136, 48, 140, 96, + 97, 357, 253, 137, 214, 358, 49, 370, 50, 385, + 186, 187, 141, 51, 98, 52, 53, 54, 262, 143, + 411, 138, 381, 382, 412, 383, 99, 147, 288, 417, + 312, 330, 331, 418, 320, 262, 197, 351, 352, 165, + 146, 10, 167, 168, 169, 170, 1, 2, 161, 405, + 414, 415, 162, 256, 335, 336, 337, 338, 163, 410, + 1, 2, 186, 187, 205, 339, 218, 257, 165, 10, + 10, 167, 168, 169, 170, 1, 2, 228, 229, 231, + 410, 258, 259, 10, 167, 232, 247, 170, 1, 2, + 405, 248, 249, 255, 436, 250, 257, 260, 335, 336, + 337, 338, 119, 10, 280, 282, 298, 302, 1, 2, + 258, 259, 306, 321, 323, 325, 261, 326, 342, 346, + 334, 38, 262, 348, 354, 344, 260, 349, 360, 350, + 369, 263, 361, 380, 367, 371, 39, 362, 356, 264, + 40, 265, 373, 214, 378, 261, 41, 42, 43, 372, + 377, 262, 44, 401, 379, 390, 391, 45, 387, 406, + 263, 407, 46, 442, 47, 422, 443, 6, 264, 18, + 265, 35, 48, 199, 145, 81, 114, 142, 322, 284, + 394, 49, 396, 50, 305, 83, 84, 437, 51, 289, + 52, 53, 54, 206, 313, 376, 420, 85, 38, 86, + 219, 87, 207, 243, 244, 345, 430, 423, 421, 285, + 368, 88, 0, 0, 0, 89, 0, 0, 0, 90, 0, 0, 91, 41, 42, 43, 0, 0, 0, 0, - 0, 0, 0, 92, 45, 0, 0, 0, 93, 46, + 0, 208, 0, 92, 45, 0, 0, 0, 93, 46, 94, 47, 95, 0, 0, 0, 0, 0, 0, 48, - 0, 96, 97, 0, 0, 0, 0, 0, 49, 0, - 50, 1, 2, 0, 0, 51, 98, 52, 53, 54, + 0, 96, 97, 209, 210, 0, 0, 0, 49, 0, + 50, 83, 84, 0, 0, 51, 98, 52, 53, 54, 0, 0, 0, 85, 38, 86, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 90, 0, 0, 91, 41, 42, 43, 0, 0, 0, 0, 0, 0, 0, 92, 45, 0, 0, 0, 93, 46, 94, 47, 95, 0, 0, 0, 0, 0, 0, 48, 0, 96, 97, 0, - 0, 0, 0, 0, 49, 0, 50, 0, 0, 0, - 0, 51, 98, 52, 53, 54 + 0, 0, 0, 0, 49, 0, 50, 1, 2, 0, + 0, 51, 98, 52, 53, 54, 0, 0, 0, 85, + 38, 86, 0, 87, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, + 0, 90, 0, 0, 91, 41, 42, 43, 0, 0, + 0, 0, 0, 0, 0, 92, 45, 0, 0, 0, + 93, 46, 94, 47, 95, 0, 0, 0, 0, 0, + 0, 48, 0, 96, 97, 0, 0, 0, 0, 0, + 49, 0, 50, 0, 0, 0, 0, 51, 98, 52, + 53, 54 }; static const short yycheck[] = { 7, - 0, 192, 193, 3, 211, 13, 230, 136, 4, 147, - 82, 136, 218, 219, 220, 9, 32, 50, 224, 225, - 16, 17, 18, 9, 9, 9, 9, 10, 135, 37, - 107, 37, 40, 4, 9, 84, 44, 37, 14, 15, - 40, 4, 9, 10, 44, 16, 17, 18, 56, 9, - 34, 15, 16, 16, 17, 18, 56, 9, 37, 34, - 109, 99, 14, 15, 9, 10, 74, 73, 13, 21, - 23, 10, 278, 108, 74, 9, 37, 112, 109, 112, - 14, 15, 9, 10, 213, 318, 13, 216, 213, 15, - 16, 216, 298, 231, 73, 56, 426, 213, 114, 99, - 216, 334, 110, 210, 111, 112, 436, 115, 237, 147, - 110, 37, 184, 185, 114, 115, 124, 155, 114, 115, - 106, 345, 106, 117, 124, 108, 79, 343, 136, 114, - 114, 106, 204, 108, 38, 135, 136, 108, 117, 114, - 93, 108, 61, 114, 360, 351, 106, 73, 156, 157, - 114, 114, 108, 15, 114, 155, 112, 157, 230, 111, - 88, 106, 24, 108, 236, 352, 239, 7, 355, 9, - 10, 11, 12, 13, 14, 15, 249, 111, 19, 106, - 105, 21, 108, 45, 57, 47, 112, 88, 114, 88, - 397, 264, 45, 118, 56, 35, 7, 3, 9, 10, - 11, 12, 13, 56, 212, 213, 16, 17, 216, 49, - 50, 402, 84, 213, 343, 9, 216, 84, 110, 291, - 14, 15, 230, 25, 232, 65, 234, 299, 236, 237, - 359, 360, 73, 16, 17, 107, 77, 109, 49, 314, - 107, 9, 109, 15, 84, 108, 14, 15, 248, 112, - 90, 14, 15, 64, 329, 330, 50, 332, 108, 99, - 333, 43, 112, 101, 102, 103, 104, 107, 111, 109, - 16, 17, 108, 345, 112, 347, 112, 285, 107, 90, - 108, 107, 9, 10, 112, 357, 13, 14, 15, 108, - 33, 34, 300, 112, 302, 14, 15, 16, 17, 117, - 7, 85, 9, 10, 11, 12, 13, 85, 101, 102, - 103, 104, 391, 392, 75, 55, 7, 3, 9, 10, - 11, 12, 13, 14, 15, 85, 117, 3, 108, 108, - 107, 107, 113, 10, 3, 343, 9, 345, 113, 113, - 39, 349, 49, 343, 35, 107, 117, 117, 115, 357, - 72, 359, 360, 107, 107, 3, 114, 64, 49, 50, - 360, 369, 109, 5, 109, 99, 14, 15, 92, 29, - 72, 379, 72, 29, 65, 100, 107, 110, 26, 27, - 28, 109, 30, 90, 100, 5, 116, 72, 86, 112, - 108, 108, 40, 84, 109, 105, 44, 405, 110, 90, - 48, 107, 107, 51, 52, 53, 54, 118, 99, 417, - 106, 119, 109, 421, 62, 63, 107, 110, 109, 67, - 68, 69, 70, 71, 108, 107, 118, 110, 117, 0, - 78, 112, 80, 81, 0, 110, 110, 9, 110, 87, - 3, 89, 14, 15, 139, 13, 94, 95, 96, 97, - 98, 26, 56, 74, 115, 27, 110, 65, 349, 107, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 42, 357, 227, 210, 46, 155, 345, 234, 425, 147, - 52, 53, 54, 403, 185, 319, 58, 417, 409, 255, - 405, 63, -1, 359, 302, 185, 68, -1, 70, -1, - -1, -1, -1, 49, -1, -1, 78, -1, -1, -1, - -1, -1, -1, -1, -1, 87, -1, 89, -1, 14, - 15, 67, 94, -1, 96, 97, 98, 22, -1, -1, - -1, 26, 27, 28, -1, 30, 31, -1, -1, -1, - -1, -1, -1, -1, 90, 40, -1, -1, -1, 44, - -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, - -1, 107, -1, -1, -1, 60, -1, 62, 63, -1, - -1, -1, 67, 68, 69, 70, 71, -1, -1, -1, - -1, -1, -1, 78, -1, 80, 81, 82, 83, -1, - -1, -1, 87, -1, 89, 14, 15, -1, -1, 94, - 95, 96, 97, 98, -1, -1, -1, 26, 27, 28, - -1, 30, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 40, -1, -1, -1, 44, -1, -1, -1, 48, + 0, 209, 210, 3, 230, 13, 137, 138, 82, 228, + 141, 249, 4, 9, 137, 50, 237, 238, 239, 9, + 10, 4, 243, 244, 16, 17, 18, 9, 10, 37, + 140, 99, 40, 16, 17, 18, 44, 37, 4, 9, + 40, 9, 9, 37, 44, 65, 15, 16, 56, 99, + 16, 17, 18, 9, 107, 9, 56, 37, 14, 15, + 14, 15, 56, 137, 9, 21, 74, 34, 32, 9, + 10, 14, 15, 13, 74, 9, 10, 112, 299, 13, + 45, 6, 7, 8, 9, 10, 11, 12, 13, 34, + 329, 56, 160, 73, 225, 109, 227, 228, 319, 99, + 38, 232, 225, 111, 235, 137, 345, 88, 116, 141, + 160, 111, 15, 16, 10, 115, 116, 125, 108, 229, + 358, 117, 114, 115, 49, 125, 108, 201, 202, 137, + 138, 114, 152, 141, 37, 37, 106, 356, 106, 106, + 140, 141, 108, 364, 218, 114, 114, 114, 114, 427, + 114, 225, 61, 161, 162, 111, 23, 111, 88, 437, + 160, 106, 162, 108, 57, 90, 106, 255, 108, 114, + 73, 73, 106, 84, 400, 249, 19, 265, 105, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 114, + 9, 118, 280, 225, 88, 14, 15, 405, 109, 3, + 232, 232, 108, 235, 235, 108, 112, 15, 9, 112, + 110, 114, 79, 14, 15, 117, 24, 225, 365, 227, + 228, 368, 49, 231, 232, 356, 93, 235, 228, 108, + 73, 50, 232, 112, 77, 235, 25, 45, 312, 47, + 67, 249, 3, 251, 15, 253, 320, 108, 56, 111, + 112, 112, 43, 14, 15, 7, 344, 9, 10, 11, + 12, 13, 111, 90, 264, 26, 27, 28, 107, 30, + 107, 84, 7, 117, 9, 10, 11, 12, 13, 40, + 107, 14, 15, 44, 358, 108, 360, 48, 85, 112, + 51, 52, 53, 54, 107, 85, 109, 49, 306, 84, + 75, 62, 63, 16, 17, 55, 67, 68, 69, 70, + 71, 85, 64, 321, 49, 323, 3, 78, 117, 80, + 81, 108, 107, 107, 109, 112, 87, 325, 89, 64, + 16, 17, 3, 94, 95, 96, 97, 98, 90, 108, + 108, 107, 340, 341, 112, 343, 107, 107, 356, 108, + 358, 33, 34, 112, 362, 90, 356, 16, 17, 7, + 108, 9, 10, 11, 12, 13, 14, 15, 113, 377, + 398, 399, 113, 21, 101, 102, 103, 104, 107, 387, + 14, 15, 16, 17, 10, 112, 3, 35, 7, 9, + 9, 10, 11, 12, 13, 14, 15, 109, 117, 117, + 408, 49, 50, 9, 10, 113, 115, 13, 14, 15, + 418, 39, 107, 109, 422, 72, 35, 65, 101, 102, + 103, 104, 114, 9, 109, 5, 92, 99, 14, 15, + 49, 50, 29, 72, 72, 100, 84, 29, 100, 107, + 110, 27, 90, 5, 86, 109, 65, 110, 72, 110, + 110, 99, 108, 106, 108, 107, 42, 112, 116, 107, + 46, 109, 105, 109, 108, 84, 52, 53, 54, 118, + 107, 90, 58, 118, 110, 110, 107, 63, 119, 112, + 99, 110, 68, 0, 70, 117, 0, 3, 107, 13, + 109, 26, 78, 144, 116, 56, 74, 111, 253, 225, + 358, 87, 362, 89, 246, 14, 15, 426, 94, 229, + 96, 97, 98, 22, 250, 330, 406, 26, 27, 28, + 160, 30, 31, 202, 202, 271, 418, 412, 408, 227, + 323, 40, -1, -1, -1, 44, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, -1, -1, -1, -1, - -1, -1, -1, 62, 63, -1, -1, -1, 67, 68, + -1, 60, -1, 62, 63, -1, -1, -1, 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, -1, 78, - -1, 80, 81, -1, -1, -1, -1, -1, 87, -1, + -1, 80, 81, 82, 83, -1, -1, -1, 87, -1, 89, 14, 15, -1, -1, 94, 95, 96, 97, 98, -1, -1, -1, 26, 27, 28, -1, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, @@ -816,8 +807,16 @@ static const short yycheck[] = { 7, 53, 54, -1, -1, -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, -1, 78, -1, 80, 81, -1, - -1, -1, -1, -1, 87, -1, 89, -1, -1, -1, - -1, 94, 95, 96, 97, 98 + -1, -1, -1, -1, 87, -1, 89, 14, 15, -1, + -1, 94, 95, 96, 97, 98, -1, -1, -1, 26, + 27, 28, -1, 30, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 40, -1, -1, -1, 44, -1, -1, + -1, 48, -1, -1, 51, 52, 53, 54, -1, -1, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + 67, 68, 69, 70, 71, -1, -1, -1, -1, -1, + -1, 78, -1, 80, 81, -1, -1, -1, -1, -1, + 87, -1, 89, -1, -1, -1, -1, 94, 95, 96, + 97, 98 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/bison.simple" @@ -1363,13 +1362,13 @@ yyreduce: switch (yyn) { case 1: -#line 322 "asn1p_y.y" +#line 323 "asn1p_y.y" { *(void **)param = yyvsp[0].a_grammar; ; break;} case 2: -#line 328 "asn1p_y.y" +#line 329 "asn1p_y.y" { yyval.a_grammar = asn1p_new(); checkmem(yyval.a_grammar); @@ -1377,14 +1376,14 @@ case 2: ; break;} case 3: -#line 333 "asn1p_y.y" +#line 334 "asn1p_y.y" { yyval.a_grammar = yyvsp[-1].a_grammar; TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); ; break;} case 4: -#line 354 "asn1p_y.y" +#line 355 "asn1p_y.y" { if(yyvsp[-1].a_module) { @@ -1401,27 +1400,27 @@ case 4: ; break;} case 5: -#line 375 "asn1p_y.y" +#line 376 "asn1p_y.y" { yyval.a_oid = 0; ; break;} case 6: -#line 376 "asn1p_y.y" +#line 377 "asn1p_y.y" { yyval.a_oid = yyvsp[0].a_oid; ; break;} case 7: -#line 380 "asn1p_y.y" +#line 381 "asn1p_y.y" { yyval.a_oid = yyvsp[-1].a_oid; ; break;} case 8: -#line 383 "asn1p_y.y" +#line 384 "asn1p_y.y" { yyval.a_oid = 0; ; break;} case 9: -#line 389 "asn1p_y.y" +#line 390 "asn1p_y.y" { yyval.a_oid = asn1p_oid_new(); asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); @@ -1430,7 +1429,7 @@ case 9: ; break;} case 10: -#line 395 "asn1p_y.y" +#line 396 "asn1p_y.y" { yyval.a_oid = yyvsp[-1].a_oid; asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); @@ -1439,74 +1438,74 @@ case 10: ; break;} case 11: -#line 404 "asn1p_y.y" +#line 405 "asn1p_y.y" { /* iso */ yyval.a_oid_arc.name = yyvsp[0].tv_str; yyval.a_oid_arc.number = -1; ; break;} case 12: -#line 408 "asn1p_y.y" +#line 409 "asn1p_y.y" { /* iso(1) */ yyval.a_oid_arc.name = yyvsp[-3].tv_str; yyval.a_oid_arc.number = yyvsp[-1].a_int; ; break;} case 13: -#line 412 "asn1p_y.y" +#line 413 "asn1p_y.y" { /* 1 */ yyval.a_oid_arc.name = 0; yyval.a_oid_arc.number = yyvsp[0].a_int; ; break;} case 14: -#line 422 "asn1p_y.y" +#line 423 "asn1p_y.y" { yyval.a_module_flags = MSF_NOFLAGS; ; break;} case 15: -#line 423 "asn1p_y.y" +#line 424 "asn1p_y.y" { yyval.a_module_flags = yyvsp[0].a_module_flags; ; break;} case 16: -#line 432 "asn1p_y.y" +#line 433 "asn1p_y.y" { yyval.a_module_flags = yyvsp[0].a_module_flags; ; break;} case 17: -#line 435 "asn1p_y.y" +#line 436 "asn1p_y.y" { yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags; ; break;} case 18: -#line 444 "asn1p_y.y" +#line 445 "asn1p_y.y" { yyval.a_module_flags = MSF_EXPLICIT_TAGS; ; break;} case 19: -#line 447 "asn1p_y.y" +#line 448 "asn1p_y.y" { yyval.a_module_flags = MSF_IMPLICIT_TAGS; ; break;} case 20: -#line 450 "asn1p_y.y" +#line 451 "asn1p_y.y" { yyval.a_module_flags = MSF_AUTOMATIC_TAGS; ; break;} case 21: -#line 453 "asn1p_y.y" +#line 454 "asn1p_y.y" { yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED; ; break;} case 22: -#line 457 "asn1p_y.y" +#line 458 "asn1p_y.y" { /* X.680Amd1 specifies TAG and XER */ if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) { @@ -1524,23 +1523,23 @@ case 22: ; break;} case 23: -#line 478 "asn1p_y.y" +#line 479 "asn1p_y.y" { yyval.a_module = 0; ; break;} case 24: -#line 479 "asn1p_y.y" +#line 480 "asn1p_y.y" { yyval.a_module = yyvsp[0].a_module; ; break;} case 25: -#line 488 "asn1p_y.y" +#line 489 "asn1p_y.y" { yyval.a_module = yyvsp[0].a_module; ; break;} case 26: -#line 491 "asn1p_y.y" +#line 492 "asn1p_y.y" { yyval.a_module = yyvsp[-1].a_module; @@ -1570,13 +1569,13 @@ case 26: ; break;} case 27: -#line 524 "asn1p_y.y" +#line 525 "asn1p_y.y" { yyval.a_module = yyvsp[0].a_module; ; break;} case 28: -#line 527 "asn1p_y.y" +#line 528 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); @@ -1588,7 +1587,7 @@ case 28: ; break;} case 29: -#line 536 "asn1p_y.y" +#line 537 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); @@ -1598,7 +1597,7 @@ case 29: ; break;} case 30: -#line 543 "asn1p_y.y" +#line 544 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); @@ -1608,7 +1607,7 @@ case 30: ; break;} case 31: -#line 556 "asn1p_y.y" +#line 557 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); @@ -1618,11 +1617,11 @@ case 31: ; break;} case 32: -#line 564 "asn1p_y.y" +#line 565 "asn1p_y.y" { asn1p_lexer_hack_push_encoding_control(); ; break;} case 33: -#line 565 "asn1p_y.y" +#line 566 "asn1p_y.y" { fprintf(stderr, "WARNING: ENCODING-CONTROL %s " @@ -1633,7 +1632,7 @@ case 33: ; break;} case 34: -#line 577 "asn1p_y.y" +#line 578 "asn1p_y.y" { return yyerror( "Attempt to redefine a standard basic string type, " @@ -1641,7 +1640,7 @@ case 34: ; break;} case 35: -#line 590 "asn1p_y.y" +#line 591 "asn1p_y.y" { if(!saved_aid && 0) return yyerror("Unterminated IMPORTS FROM, " @@ -1651,13 +1650,13 @@ case 35: ; break;} case 36: -#line 600 "asn1p_y.y" +#line 601 "asn1p_y.y" { return yyerror("Empty IMPORTS list"); ; break;} case 37: -#line 606 "asn1p_y.y" +#line 607 "asn1p_y.y" { yyval.a_module = asn1p_module_new(); checkmem(yyval.a_module); @@ -1665,22 +1664,22 @@ case 37: ; break;} case 38: -#line 611 "asn1p_y.y" +#line 612 "asn1p_y.y" { yyval.a_module = yyvsp[-1].a_module; TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); ; break;} case 39: -#line 618 "asn1p_y.y" +#line 619 "asn1p_y.y" { memset(&yyval.a_aid, 0, sizeof(yyval.a_aid)); ; break;} case 40: -#line 619 "asn1p_y.y" +#line 620 "asn1p_y.y" { yyval.a_aid.oid = yyvsp[0].a_oid; ; break;} case 41: -#line 623 "asn1p_y.y" +#line 624 "asn1p_y.y" { yyval.a_xports = yyvsp[-3].a_xports; yyval.a_xports->fromModuleName = yyvsp[-1].tv_str; @@ -1691,7 +1690,7 @@ case 41: ; break;} case 42: -#line 634 "asn1p_y.y" +#line 635 "asn1p_y.y" { yyval.a_xports = asn1p_xports_new(); checkmem(yyval.a_xports); @@ -1699,14 +1698,14 @@ case 42: ; break;} case 43: -#line 639 "asn1p_y.y" +#line 640 "asn1p_y.y" { yyval.a_xports = yyvsp[-2].a_xports; TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); ; break;} case 44: -#line 646 "asn1p_y.y" +#line 647 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1715,7 +1714,7 @@ case 44: ; break;} case 45: -#line 652 "asn1p_y.y" +#line 653 "asn1p_y.y" { /* Completely equivalent to above */ yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1724,7 +1723,7 @@ case 45: ; break;} case 46: -#line 658 "asn1p_y.y" +#line 659 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1733,19 +1732,19 @@ case 46: ; break;} case 47: -#line 667 "asn1p_y.y" +#line 668 "asn1p_y.y" { yyval.a_xports = yyvsp[-1].a_xports; ; break;} case 48: -#line 670 "asn1p_y.y" +#line 671 "asn1p_y.y" { yyval.a_xports = 0; ; break;} case 49: -#line 673 "asn1p_y.y" +#line 674 "asn1p_y.y" { /* Empty EXPORTS clause effectively prohibits export. */ yyval.a_xports = asn1p_xports_new(); @@ -1753,7 +1752,7 @@ case 49: ; break;} case 50: -#line 681 "asn1p_y.y" +#line 682 "asn1p_y.y" { yyval.a_xports = asn1p_xports_new(); assert(yyval.a_xports); @@ -1761,14 +1760,14 @@ case 50: ; break;} case 51: -#line 686 "asn1p_y.y" +#line 687 "asn1p_y.y" { yyval.a_xports = yyvsp[-2].a_xports; TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); ; break;} case 52: -#line 693 "asn1p_y.y" +#line 694 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1777,7 +1776,7 @@ case 52: ; break;} case 53: -#line 699 "asn1p_y.y" +#line 700 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1786,7 +1785,7 @@ case 53: ; break;} case 54: -#line 705 "asn1p_y.y" +#line 706 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1795,11 +1794,11 @@ case 54: ; break;} case 55: -#line 716 "asn1p_y.y" +#line 717 "asn1p_y.y" { asn1p_lexer_hack_push_opaque_state(); ; break;} case 56: -#line 716 "asn1p_y.y" +#line 717 "asn1p_y.y" { yyval.a_expr = yyvsp[-4].a_expr; assert(yyval.a_expr->Identifier == 0); @@ -1809,7 +1808,13 @@ case 56: ; break;} case 57: -#line 726 "asn1p_y.y" +#line 727 "asn1p_y.y" +{ + yyval.a_expr = yyvsp[0].a_expr; + ; + break;} +case 58: +#line 740 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -1818,17 +1823,19 @@ case 57: yyval.a_expr->meta_type = AMT_TYPEREF; ; break;} -case 58: -#line 733 "asn1p_y.y" +case 59: +#line 750 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); - yyval.a_expr->expr_type = yyvsp[0].a_type; - yyval.a_expr->meta_type = AMT_TYPE; + yyval.a_expr->reference = yyvsp[-3].a_ref; + yyval.a_expr->rhs_pspecs = yyvsp[-1].a_expr; + yyval.a_expr->expr_type = A1TC_REFERENCE; + yyval.a_expr->meta_type = AMT_TYPEREF; ; break;} -case 59: -#line 751 "asn1p_y.y" +case 60: +#line 770 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-2].tv_str; @@ -1836,8 +1843,8 @@ case 59: assert(yyval.a_expr->meta_type); ; break;} -case 60: -#line 757 "asn1p_y.y" +case 61: +#line 776 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->Identifier = yyvsp[-2].tv_str; @@ -1845,8 +1852,8 @@ case 60: assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); ; break;} -case 61: -#line 773 "asn1p_y.y" +case 62: +#line 792 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; assert(yyval.a_expr->Identifier == 0); @@ -1854,8 +1861,8 @@ case 61: yyval.a_expr->lhs_params = yyvsp[-3].a_plist; ; break;} -case 62: -#line 782 "asn1p_y.y" +case 63: +#line 801 "asn1p_y.y" { int ret; yyval.a_plist = asn1p_paramlist_new(yylineno); @@ -1866,8 +1873,8 @@ case 62: if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); ; break;} -case 63: -#line 791 "asn1p_y.y" +case 64: +#line 810 "asn1p_y.y" { int ret; yyval.a_plist = yyvsp[-2].a_plist; @@ -1877,25 +1884,15 @@ case 63: if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); ; break;} -case 64: -#line 802 "asn1p_y.y" +case 65: +#line 821 "asn1p_y.y" { yyval.a_parg.governor = NULL; yyval.a_parg.argument = yyvsp[0].tv_str; ; break;} -case 65: -#line 806 "asn1p_y.y" -{ - int ret; - yyval.a_parg.governor = asn1p_ref_new(yylineno); - ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0); - checkmem(ret == 0); - yyval.a_parg.argument = yyvsp[0].tv_str; - ; - break;} case 66: -#line 813 "asn1p_y.y" +#line 825 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); @@ -1905,7 +1902,17 @@ case 66: ; break;} case 67: -#line 820 "asn1p_y.y" +#line 832 "asn1p_y.y" +{ + int ret; + yyval.a_parg.governor = asn1p_ref_new(yylineno); + ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0); + checkmem(ret == 0); + yyval.a_parg.argument = yyvsp[0].tv_str; + ; + break;} +case 68: +#line 839 "asn1p_y.y" { int ret; yyval.a_parg.governor = asn1p_ref_new(yylineno); @@ -1915,29 +1922,40 @@ case 67: yyval.a_parg.argument = yyvsp[0].tv_str; ; break;} -case 68: -#line 831 "asn1p_y.y" +case 69: +#line 850 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 69: -#line 836 "asn1p_y.y" +case 70: +#line 855 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 70: -#line 843 "asn1p_y.y" +case 71: +#line 862 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; ; break;} -case 71: -#line 846 "asn1p_y.y" +case 72: +#line 865 "asn1p_y.y" +{ + yyval.a_expr = asn1p_expr_new(yylineno); + checkmem(yyval.a_expr); + yyval.a_expr->Identifier = "?"; + yyval.a_expr->expr_type = A1TC_REFERENCE; + yyval.a_expr->meta_type = AMT_VALUE; + yyval.a_expr->value = yyvsp[0].a_value; + ; + break;} +case 73: +#line 873 "asn1p_y.y" { asn1p_ref_t *ref; yyval.a_expr = asn1p_expr_new(yylineno); @@ -1950,31 +1968,31 @@ case 71: yyval.a_expr->value = asn1p_value_fromref(ref, 0); ; break;} -case 72: -#line 874 "asn1p_y.y" +case 74: +#line 901 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); ; break;} -case 73: -#line 875 "asn1p_y.y" +case 75: +#line 902 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; ; break;} -case 74: -#line 878 "asn1p_y.y" +case 76: +#line 905 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 75: -#line 883 "asn1p_y.y" +case 77: +#line 910 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 76: -#line 890 "asn1p_y.y" +case 78: +#line 917 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->Identifier == 0); @@ -1983,8 +2001,8 @@ case 76: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 77: -#line 897 "asn1p_y.y" +case 79: +#line 924 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags; @@ -1992,8 +2010,8 @@ case 77: _fixup_anonymous_identifier(yyval.a_expr); ; break;} -case 78: -#line 903 "asn1p_y.y" +case 80: +#line 930 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2002,50 +2020,50 @@ case 78: asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 79: -#line 910 "asn1p_y.y" +case 81: +#line 937 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; ; break;} -case 80: -#line 916 "asn1p_y.y" +case 82: +#line 943 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 81: -#line 921 "asn1p_y.y" +case 83: +#line 948 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 82: -#line 928 "asn1p_y.y" +case 84: +#line 955 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; assert(yyval.a_expr->Identifier == 0); yyval.a_expr->Identifier = yyvsp[-1].tv_str; ; break;} -case 83: -#line 933 "asn1p_y.y" +case 85: +#line 960 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; ; break;} -case 84: -#line 936 "asn1p_y.y" +case 86: +#line 963 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; _fixup_anonymous_identifier(yyval.a_expr); ; break;} -case 85: -#line 943 "asn1p_y.y" +case 87: +#line 970 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; checkmem(yyval.a_expr); @@ -2054,16 +2072,16 @@ case 85: assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); ; break;} -case 86: -#line 953 "asn1p_y.y" +case 88: +#line 980 "asn1p_y.y" { yyval.a_int = 0; ; break;} -case 87: -#line 954 "asn1p_y.y" +case 89: +#line 981 "asn1p_y.y" { yyval.a_int = 1; ; break;} -case 88: -#line 958 "asn1p_y.y" +case 90: +#line 985 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2072,15 +2090,15 @@ case 88: asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 89: -#line 965 "asn1p_y.y" +case 91: +#line 992 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 90: -#line 975 "asn1p_y.y" +case 92: +#line 1002 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2090,8 +2108,8 @@ case 90: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 91: -#line 985 "asn1p_y.y" +case 93: +#line 1012 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); yyval.a_expr->Identifier = yyvsp[-3].tv_str; @@ -2102,8 +2120,8 @@ case 91: asn1p_expr_add(yyval.a_expr, yyvsp[-2].a_expr); ; break;} -case 92: -#line 996 "asn1p_y.y" +case 94: +#line 1023 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); yyval.a_expr->Identifier = yyvsp[-2].tv_str; @@ -2113,8 +2131,8 @@ case 92: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 93: -#line 1006 "asn1p_y.y" +case 95: +#line 1033 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2125,8 +2143,8 @@ case 93: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 94: -#line 1017 "asn1p_y.y" +case 96: +#line 1044 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); yyval.a_expr->Identifier = yyvsp[-2].tv_str; @@ -2136,8 +2154,8 @@ case 94: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 95: -#line 1027 "asn1p_y.y" +case 97: +#line 1054 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2148,8 +2166,8 @@ case 95: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 96: -#line 1038 "asn1p_y.y" +case 98: +#line 1065 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2160,103 +2178,103 @@ case 96: yyval.a_expr->marker = yyvsp[0].a_marker; ; break;} -case 97: -#line 1050 "asn1p_y.y" +case 99: +#line 1077 "asn1p_y.y" { yyval.a_wsynt = 0; ; break;} -case 98: -#line 1051 "asn1p_y.y" +case 100: +#line 1078 "asn1p_y.y" { yyval.a_wsynt = yyvsp[0].a_wsynt; ; break;} -case 99: -#line 1058 "asn1p_y.y" +case 101: +#line 1085 "asn1p_y.y" { asn1p_lexer_hack_enable_with_syntax(); ; break;} -case 100: -#line 1060 "asn1p_y.y" +case 102: +#line 1087 "asn1p_y.y" { yyval.a_wsynt = yyvsp[-1].a_wsynt; ; break;} -case 101: -#line 1066 "asn1p_y.y" +case 103: +#line 1093 "asn1p_y.y" { yyval.a_wsynt = asn1p_wsyntx_new(); TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); ; break;} -case 102: -#line 1070 "asn1p_y.y" +case 104: +#line 1097 "asn1p_y.y" { yyval.a_wsynt = yyvsp[-1].a_wsynt; TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); ; break;} -case 103: -#line 1077 "asn1p_y.y" +case 105: +#line 1104 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); yyval.a_wchunk->type = WC_WHITESPACE; ; break;} -case 104: -#line 1081 "asn1p_y.y" +case 106: +#line 1108 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_str, strlen(yyvsp[0].tv_str), 0); ; break;} -case 105: -#line 1084 "asn1p_y.y" +case 107: +#line 1111 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].a_refcomp.name, strlen(yyvsp[0].a_refcomp.name), 0); yyval.a_wchunk->type = WC_FIELD; ; break;} -case 106: -#line 1088 "asn1p_y.y" +case 108: +#line 1115 "asn1p_y.y" { yyval.a_wchunk = asn1p_wsyntx_chunk_fromsyntax(yyvsp[-1].a_wsynt); ; break;} -case 107: -#line 1094 "asn1p_y.y" -{ - yyval.a_expr = asn1p_expr_new(yylineno); - checkmem(yyval.a_expr); - yyval.a_expr->Identifier = strdup("..."); - checkmem(yyval.a_expr->Identifier); - yyval.a_expr->expr_type = A1TC_EXTENSIBLE; - yyval.a_expr->meta_type = AMT_TYPE; - ; - break;} -case 108: -#line 1102 "asn1p_y.y" -{ - yyval.a_expr = asn1p_expr_new(yylineno); - checkmem(yyval.a_expr); - yyval.a_expr->Identifier = strdup("..."); - checkmem(yyval.a_expr->Identifier); - yyval.a_expr->value = yyvsp[0].a_value; - yyval.a_expr->expr_type = A1TC_EXTENSIBLE; - yyval.a_expr->meta_type = AMT_TYPE; - ; - break;} case 109: -#line 1111 "asn1p_y.y" +#line 1121 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); yyval.a_expr->Identifier = strdup("..."); - yyval.a_expr->value = yyvsp[0].a_value; checkmem(yyval.a_expr->Identifier); yyval.a_expr->expr_type = A1TC_EXTENSIBLE; yyval.a_expr->meta_type = AMT_TYPE; ; break;} case 110: -#line 1123 "asn1p_y.y" +#line 1129 "asn1p_y.y" +{ + yyval.a_expr = asn1p_expr_new(yylineno); + checkmem(yyval.a_expr); + yyval.a_expr->Identifier = strdup("..."); + checkmem(yyval.a_expr->Identifier); + yyval.a_expr->value = yyvsp[0].a_value; + yyval.a_expr->expr_type = A1TC_EXTENSIBLE; + yyval.a_expr->meta_type = AMT_TYPE; + ; + break;} +case 111: +#line 1138 "asn1p_y.y" +{ + yyval.a_expr = asn1p_expr_new(yylineno); + checkmem(yyval.a_expr); + yyval.a_expr->Identifier = strdup("..."); + yyval.a_expr->value = yyvsp[0].a_value; + checkmem(yyval.a_expr->Identifier); + yyval.a_expr->expr_type = A1TC_EXTENSIBLE; + yyval.a_expr->meta_type = AMT_TYPE; + ; + break;} +case 112: +#line 1150 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; yyval.a_expr->tag = yyvsp[-2].a_tag; @@ -2277,15 +2295,15 @@ case 110: } ; break;} -case 111: -#line 1145 "asn1p_y.y" +case 113: +#line 1172 "asn1p_y.y" { yyval.a_int = asn1p_as_pointer ? EM_INDIRECT : 0; asn1p_as_pointer = 0; ; break;} -case 112: -#line 1152 "asn1p_y.y" +case 114: +#line 1179 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; yyval.a_expr->marker.flags |= yyvsp[-1].a_int; @@ -2303,14 +2321,14 @@ case 112: } ; break;} -case 113: -#line 1171 "asn1p_y.y" +case 115: +#line 1198 "asn1p_y.y" { yyval.a_expr = yyvsp[0].a_expr; ; break;} -case 114: -#line 1174 "asn1p_y.y" +case 116: +#line 1201 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); @@ -2318,8 +2336,8 @@ case 114: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 115: -#line 1180 "asn1p_y.y" +case 117: +#line 1207 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); @@ -2327,8 +2345,8 @@ case 115: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 116: -#line 1186 "asn1p_y.y" +case 118: +#line 1213 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; assert(yyval.a_expr->expr_type == A1TC_INVALID); @@ -2336,8 +2354,8 @@ case 116: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 117: -#line 1192 "asn1p_y.y" +case 119: +#line 1219 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2349,8 +2367,8 @@ case 117: asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 118: -#line 1202 "asn1p_y.y" +case 120: +#line 1229 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2362,8 +2380,8 @@ case 118: asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 119: -#line 1212 "asn1p_y.y" +case 121: +#line 1239 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2371,8 +2389,8 @@ case 119: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 120: -#line 1218 "asn1p_y.y" +case 122: +#line 1245 "asn1p_y.y" { int ret; yyval.a_expr = asn1p_expr_new(yylineno); @@ -2385,27 +2403,6 @@ case 120: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 121: -#line 1239 "asn1p_y.y" -{ - yyval.a_expr = asn1p_expr_new(yylineno); - checkmem(yyval.a_expr); - yyval.a_expr->reference = yyvsp[0].a_ref; - yyval.a_expr->expr_type = A1TC_REFERENCE; - yyval.a_expr->meta_type = AMT_TYPEREF; - ; - break;} -case 122: -#line 1249 "asn1p_y.y" -{ - yyval.a_expr = asn1p_expr_new(yylineno); - checkmem(yyval.a_expr); - yyval.a_expr->reference = yyvsp[-3].a_ref; - yyval.a_expr->rhs_pspecs = yyvsp[-1].a_expr; - yyval.a_expr->expr_type = A1TC_REFERENCE; - yyval.a_expr->meta_type = AMT_TYPEREF; - ; - break;} case 123: #line 1257 "asn1p_y.y" { @@ -2572,8 +2569,8 @@ case 139: yyval.a_expr->value = yyvsp[0].a_value; ; break;} -case 140: -#line 1420 "asn1p_y.y" +case 142: +#line 1422 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); @@ -2582,76 +2579,70 @@ case 140: yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value; ; break;} -case 141: -#line 1427 "asn1p_y.y" +case 143: +#line 1429 "asn1p_y.y" { asn1p_lexer_hack_push_opaque_state(); ; break;} -case 142: -#line 1427 "asn1p_y.y" +case 144: +#line 1429 "asn1p_y.y" { yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); checkmem(yyval.a_value); yyval.a_value->type = ATV_UNPARSED; ; break;} -case 143: -#line 1432 "asn1p_y.y" +case 145: +#line 1434 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_NULL; ; break;} -case 144: -#line 1437 "asn1p_y.y" +case 146: +#line 1442 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_FALSE; ; break;} -case 145: -#line 1442 "asn1p_y.y" +case 147: +#line 1447 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_TRUE; ; break;} -case 146: -#line 1447 "asn1p_y.y" +case 148: +#line 1452 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B'); checkmem(yyval.a_value); ; break;} -case 147: -#line 1451 "asn1p_y.y" +case 149: +#line 1456 "asn1p_y.y" { yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H'); checkmem(yyval.a_value); ; break;} -case 148: -#line 1455 "asn1p_y.y" +case 150: +#line 1460 "asn1p_y.y" { yyval.a_value = yyval.a_value; ; break;} -case 149: -#line 1458 "asn1p_y.y" -{ - yyval.a_value = yyvsp[0].a_value; - ; - break;} -case 150: -#line 1461 "asn1p_y.y" -{ - yyval.a_value = yyvsp[0].a_value; - ; - break;} case 151: -#line 1467 "asn1p_y.y" +#line 1463 "asn1p_y.y" +{ + yyval.a_value = yyvsp[0].a_value; + ; + break;} +case 152: +#line 1469 "asn1p_y.y" { asn1p_ref_t *ref; int ret; @@ -2664,8 +2655,8 @@ case 151: free(yyvsp[0].tv_str); ; break;} -case 152: -#line 1478 "asn1p_y.y" +case 153: +#line 1480 "asn1p_y.y" { asn1p_ref_t *ref; int ret; @@ -2681,31 +2672,31 @@ case 152: free(yyvsp[0].tv_str); ; break;} -case 153: -#line 1496 "asn1p_y.y" +case 154: +#line 1498 "asn1p_y.y" { yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); checkmem(yyval.a_value); ; break;} -case 154: -#line 1500 "asn1p_y.y" +case 155: +#line 1502 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); yyval.a_value->type = ATV_TUPLE; ; break;} -case 155: -#line 1505 "asn1p_y.y" +case 156: +#line 1507 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); yyval.a_value->type = ATV_QUADRUPLE; ; break;} -case 156: -#line 1539 "asn1p_y.y" +case 157: +#line 1541 "asn1p_y.y" { yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 1; yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1); @@ -2716,8 +2707,8 @@ case 156: free(yyvsp[0].tv_opaque.buf); ; break;} -case 157: -#line 1548 "asn1p_y.y" +case 158: +#line 1550 "asn1p_y.y" { int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len; char *p = malloc(newsize + 1); @@ -2731,72 +2722,72 @@ case 157: yyval.tv_opaque.len = newsize; ; break;} -case 158: -#line 1563 "asn1p_y.y" +case 159: +#line 1565 "asn1p_y.y" { yyval.a_type = ASN_BASIC_BOOLEAN; ; break;} -case 159: -#line 1564 "asn1p_y.y" +case 160: +#line 1566 "asn1p_y.y" { yyval.a_type = ASN_BASIC_NULL; ; break;} -case 160: -#line 1565 "asn1p_y.y" +case 161: +#line 1567 "asn1p_y.y" { yyval.a_type = ASN_BASIC_REAL; ; break;} -case 161: -#line 1566 "asn1p_y.y" -{ yyval.a_type = yyvsp[0].a_type; ; - break;} case 162: -#line 1567 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_OCTET_STRING; ; +#line 1568 "asn1p_y.y" +{ yyval.a_type = yyvsp[0].a_type; ; break;} case 163: -#line 1568 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ; +#line 1569 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_OCTET_STRING; ; break;} case 164: -#line 1569 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ; +#line 1570 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ; break;} case 165: -#line 1570 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_EXTERNAL; ; +#line 1571 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ; break;} case 166: -#line 1571 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ; +#line 1572 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_EXTERNAL; ; break;} case 167: -#line 1572 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ; +#line 1573 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ; break;} case 168: -#line 1573 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_UTCTime; ; +#line 1574 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ; break;} case 169: -#line 1574 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_GeneralizedTime; ; +#line 1575 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_UTCTime; ; break;} case 170: -#line 1575 "asn1p_y.y" -{ yyval.a_type = yyvsp[0].a_type; ; +#line 1576 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_GeneralizedTime; ; break;} case 171: -#line 1582 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_INTEGER; ; +#line 1577 "asn1p_y.y" +{ yyval.a_type = yyvsp[0].a_type; ; break;} case 172: -#line 1583 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_ENUMERATED; ; +#line 1584 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_INTEGER; ; break;} case 173: -#line 1584 "asn1p_y.y" -{ yyval.a_type = ASN_BASIC_BIT_STRING; ; +#line 1585 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_ENUMERATED; ; break;} case 174: -#line 1588 "asn1p_y.y" +#line 1586 "asn1p_y.y" +{ yyval.a_type = ASN_BASIC_BIT_STRING; ; + break;} +case 175: +#line 1590 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -2804,8 +2795,8 @@ case 174: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 175: -#line 1594 "asn1p_y.y" +case 176: +#line 1596 "asn1p_y.y" { if(yyvsp[0].a_expr) { yyval.a_expr = yyvsp[0].a_expr; @@ -2817,92 +2808,92 @@ case 175: yyval.a_expr->meta_type = AMT_TYPE; ; break;} -case 176: -#line 1607 "asn1p_y.y" +case 177: +#line 1609 "asn1p_y.y" { yyval.a_type = ASN_STRING_BMPString; ; break;} -case 177: -#line 1608 "asn1p_y.y" +case 178: +#line 1610 "asn1p_y.y" { yyval.a_type = ASN_STRING_GeneralString; fprintf(stderr, "WARNING: GeneralString is not fully supported\n"); ; break;} -case 178: -#line 1612 "asn1p_y.y" +case 179: +#line 1614 "asn1p_y.y" { yyval.a_type = ASN_STRING_GraphicString; fprintf(stderr, "WARNING: GraphicString is not fully supported\n"); ; break;} -case 179: -#line 1616 "asn1p_y.y" +case 180: +#line 1618 "asn1p_y.y" { yyval.a_type = ASN_STRING_IA5String; ; break;} -case 180: -#line 1617 "asn1p_y.y" +case 181: +#line 1619 "asn1p_y.y" { yyval.a_type = ASN_STRING_ISO646String; ; break;} -case 181: -#line 1618 "asn1p_y.y" +case 182: +#line 1620 "asn1p_y.y" { yyval.a_type = ASN_STRING_NumericString; ; break;} -case 182: -#line 1619 "asn1p_y.y" +case 183: +#line 1621 "asn1p_y.y" { yyval.a_type = ASN_STRING_PrintableString; ; break;} -case 183: -#line 1620 "asn1p_y.y" +case 184: +#line 1622 "asn1p_y.y" { yyval.a_type = ASN_STRING_T61String; fprintf(stderr, "WARNING: T61String is not fully supported\n"); ; break;} -case 184: -#line 1624 "asn1p_y.y" +case 185: +#line 1626 "asn1p_y.y" { yyval.a_type = ASN_STRING_TeletexString; ; break;} -case 185: -#line 1625 "asn1p_y.y" +case 186: +#line 1627 "asn1p_y.y" { yyval.a_type = ASN_STRING_UniversalString; ; break;} -case 186: -#line 1626 "asn1p_y.y" +case 187: +#line 1628 "asn1p_y.y" { yyval.a_type = ASN_STRING_UTF8String; ; break;} -case 187: -#line 1627 "asn1p_y.y" +case 188: +#line 1629 "asn1p_y.y" { yyval.a_type = ASN_STRING_VideotexString; fprintf(stderr, "WARNING: VideotexString is not fully supported\n"); ; break;} -case 188: -#line 1631 "asn1p_y.y" +case 189: +#line 1633 "asn1p_y.y" { yyval.a_type = ASN_STRING_VisibleString; ; break;} -case 189: -#line 1632 "asn1p_y.y" +case 190: +#line 1634 "asn1p_y.y" { yyval.a_type = ASN_STRING_ObjectDescriptor; ; break;} -case 195: -#line 1644 "asn1p_y.y" +case 196: +#line 1646 "asn1p_y.y" { yyval.a_constr = 0; ; break;} -case 196: -#line 1645 "asn1p_y.y" +case 197: +#line 1647 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} -case 197: -#line 1651 "asn1p_y.y" +case 198: +#line 1653 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0); ; break;} -case 198: -#line 1654 "asn1p_y.y" +case 199: +#line 1656 "asn1p_y.y" { /* * This is a special case, for compatibility purposes. @@ -2911,26 +2902,26 @@ case 198: CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0); ; break;} -case 199: -#line 1664 "asn1p_y.y" +case 200: +#line 1666 "asn1p_y.y" { yyval.a_constr = yyvsp[-1].a_constr; ; break;} -case 200: -#line 1667 "asn1p_y.y" +case 201: +#line 1669 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr); ; break;} -case 201: -#line 1673 "asn1p_y.y" +case 202: +#line 1675 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} -case 202: -#line 1676 "asn1p_y.y" +case 203: +#line 1678 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); @@ -2938,8 +2929,8 @@ case 202: CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); ; break;} -case 203: -#line 1682 "asn1p_y.y" +case 204: +#line 1684 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); @@ -2949,38 +2940,38 @@ case 203: CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr); ; break;} -case 204: -#line 1693 "asn1p_y.y" +case 205: +#line 1695 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} -case 205: -#line 1696 "asn1p_y.y" +case 206: +#line 1698 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_AEX, yyvsp[0].a_constr, 0); ; break;} -case 206: -#line 1699 "asn1p_y.y" +case 207: +#line 1701 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr); ; break;} -case 207: -#line 1702 "asn1p_y.y" +case 208: +#line 1704 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr); ; break;} -case 208: -#line 1705 "asn1p_y.y" +case 209: +#line 1707 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr); ; break;} -case 209: -#line 1711 "asn1p_y.y" +case 210: +#line 1713 "asn1p_y.y" { int ret; yyval.a_constr = asn1p_constraint_new(yylineno); @@ -2990,8 +2981,8 @@ case 209: checkmem(ret == 0); ; break;} -case 210: -#line 1719 "asn1p_y.y" +case 211: +#line 1721 "asn1p_y.y" { int ret; yyval.a_constr = asn1p_constraint_new(yylineno); @@ -3001,8 +2992,8 @@ case 210: checkmem(ret == 0); ; break;} -case 211: -#line 1727 "asn1p_y.y" +case 212: +#line 1729 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3010,8 +3001,8 @@ case 211: yyval.a_constr->value = yyvsp[0].a_value; ; break;} -case 212: -#line 1733 "asn1p_y.y" +case 213: +#line 1735 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3019,8 +3010,8 @@ case 212: yyval.a_constr->containedSubtype = yyvsp[0].a_value; ; break;} -case 213: -#line 1739 "asn1p_y.y" +case 214: +#line 1741 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3029,19 +3020,19 @@ case 213: yyval.a_constr->range_stop = yyvsp[0].a_value; ; break;} -case 214: -#line 1746 "asn1p_y.y" -{ - yyval.a_constr = asn1p_constraint_new(yylineno); - checkmem(yyval.a_constr); - yyval.a_constr->type = yyvsp[-1].a_ctype; - yyval.a_constr->range_start = asn1p_value_fromint(-123); - yyval.a_constr->range_stop = yyvsp[0].a_value; - yyval.a_constr->range_start->type = ATV_MIN; - ; - break;} case 215: -#line 1754 "asn1p_y.y" +#line 1748 "asn1p_y.y" +{ + yyval.a_constr = asn1p_constraint_new(yylineno); + checkmem(yyval.a_constr); + yyval.a_constr->type = yyvsp[-1].a_ctype; + yyval.a_constr->range_start = asn1p_value_fromint(-123); + yyval.a_constr->range_stop = yyvsp[0].a_value; + yyval.a_constr->range_start->type = ATV_MIN; + ; + break;} +case 216: +#line 1756 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3051,36 +3042,36 @@ case 215: yyval.a_constr->range_stop->type = ATV_MAX; ; break;} -case 216: -#line 1762 "asn1p_y.y" -{ - yyval.a_constr = asn1p_constraint_new(yylineno); - checkmem(yyval.a_constr); - yyval.a_constr->type = yyvsp[-1].a_ctype; - yyval.a_constr->range_start = asn1p_value_fromint(-123); - yyval.a_constr->range_stop = asn1p_value_fromint(321); - yyval.a_constr->range_start->type = ATV_MIN; - yyval.a_constr->range_stop->type = ATV_MAX; - ; - break;} case 217: -#line 1771 "asn1p_y.y" +#line 1764 "asn1p_y.y" { - yyval.a_constr = yyvsp[0].a_constr; + yyval.a_constr = asn1p_constraint_new(yylineno); + checkmem(yyval.a_constr); + yyval.a_constr->type = yyvsp[-1].a_ctype; + yyval.a_constr->range_start = asn1p_value_fromint(-123); + yyval.a_constr->range_stop = asn1p_value_fromint(321); + yyval.a_constr->range_start->type = ATV_MIN; + yyval.a_constr->range_stop->type = ATV_MAX; ; break;} case 218: -#line 1774 "asn1p_y.y" +#line 1773 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} case 219: -#line 1778 "asn1p_y.y" -{ asn1p_lexer_hack_push_opaque_state(); ; +#line 1776 "asn1p_y.y" +{ + yyval.a_constr = yyvsp[0].a_constr; + ; break;} case 220: -#line 1778 "asn1p_y.y" +#line 1780 "asn1p_y.y" +{ asn1p_lexer_hack_push_opaque_state(); ; + break;} +case 221: +#line 1780 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3090,64 +3081,64 @@ case 220: yyval.a_constr->value->type = ATV_UNPARSED; ; break;} -case 221: -#line 1789 "asn1p_y.y" +case 222: +#line 1791 "asn1p_y.y" { yyval.a_ctype = ACT_EL_RANGE; ; break;} -case 222: -#line 1790 "asn1p_y.y" +case 223: +#line 1792 "asn1p_y.y" { yyval.a_ctype = ACT_EL_RLRANGE; ; break;} -case 223: -#line 1791 "asn1p_y.y" +case 224: +#line 1793 "asn1p_y.y" { yyval.a_ctype = ACT_EL_LLRANGE; ; break;} -case 224: -#line 1792 "asn1p_y.y" +case 225: +#line 1794 "asn1p_y.y" { yyval.a_ctype = ACT_EL_ULRANGE; ; break;} -case 225: -#line 1796 "asn1p_y.y" +case 226: +#line 1798 "asn1p_y.y" { yyval.a_ctype = ACT_CT_SIZE; ; break;} -case 226: -#line 1799 "asn1p_y.y" +case 227: +#line 1801 "asn1p_y.y" { yyval.a_ctype = ACT_CT_FROM; ; break;} -case 227: -#line 1805 "asn1p_y.y" +case 228: +#line 1807 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(0); checkmem(yyval.a_value); yyval.a_value->type = ATV_FALSE; ; break;} -case 228: -#line 1810 "asn1p_y.y" +case 229: +#line 1812 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(1); checkmem(yyval.a_value); yyval.a_value->type = ATV_TRUE; ; break;} -case 229: -#line 1815 "asn1p_y.y" -{ - yyval.a_value = yyvsp[0].a_value; - ; - break;} case 230: -#line 1818 "asn1p_y.y" +#line 1817 "asn1p_y.y" { yyval.a_value = yyvsp[0].a_value; ; break;} case 231: -#line 1821 "asn1p_y.y" +#line 1820 "asn1p_y.y" +{ + yyval.a_value = yyvsp[0].a_value; + ; + break;} +case 232: +#line 1823 "asn1p_y.y" { asn1p_ref_t *ref; int ret; @@ -3160,8 +3151,8 @@ case 231: free(yyvsp[0].tv_str); ; break;} -case 232: -#line 1835 "asn1p_y.y" +case 233: +#line 1837 "asn1p_y.y" { asn1p_ref_t *ref; int ret; @@ -3174,32 +3165,32 @@ case 232: free(yyvsp[0].tv_str); ; break;} -case 233: -#line 1849 "asn1p_y.y" +case 234: +#line 1851 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMP, yyvsp[0].a_constr, 0); ; break;} -case 234: -#line 1852 "asn1p_y.y" +case 235: +#line 1854 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0); ; break;} -case 235: -#line 1858 "asn1p_y.y" +case 236: +#line 1860 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} -case 236: -#line 1861 "asn1p_y.y" +case 237: +#line 1863 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr); ; break;} -case 237: -#line 1867 "asn1p_y.y" +case 238: +#line 1869 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3207,8 +3198,8 @@ case 237: yyval.a_constr->value = asn1p_value_frombuf("...", 3, 0); ; break;} -case 238: -#line 1873 "asn1p_y.y" +case 239: +#line 1875 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3218,46 +3209,46 @@ case 238: if(yyvsp[-1].a_constr) asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); ; break;} -case 239: -#line 1887 "asn1p_y.y" +case 240: +#line 1889 "asn1p_y.y" { yyval.a_pres = ACPRES_DEFAULT; ; break;} -case 240: -#line 1888 "asn1p_y.y" +case 241: +#line 1890 "asn1p_y.y" { yyval.a_pres = yyvsp[0].a_pres; ; break;} -case 241: -#line 1892 "asn1p_y.y" +case 242: +#line 1894 "asn1p_y.y" { yyval.a_pres = ACPRES_PRESENT; ; break;} -case 242: -#line 1895 "asn1p_y.y" +case 243: +#line 1897 "asn1p_y.y" { yyval.a_pres = ACPRES_ABSENT; ; break;} -case 243: -#line 1898 "asn1p_y.y" +case 244: +#line 1900 "asn1p_y.y" { yyval.a_pres = ACPRES_OPTIONAL; ; break;} -case 244: -#line 1904 "asn1p_y.y" -{ - yyval.a_constr = yyvsp[0].a_constr; - ; - break;} case 245: -#line 1907 "asn1p_y.y" +#line 1906 "asn1p_y.y" { yyval.a_constr = yyvsp[0].a_constr; ; break;} case 246: -#line 1916 "asn1p_y.y" +#line 1909 "asn1p_y.y" +{ + yyval.a_constr = yyvsp[0].a_constr; + ; + break;} +case 247: +#line 1918 "asn1p_y.y" { asn1p_ref_t *ref = asn1p_ref_new(yylineno); asn1p_constraint_t *ct; @@ -3271,14 +3262,14 @@ case 246: CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0); ; break;} -case 247: -#line 1931 "asn1p_y.y" +case 248: +#line 1933 "asn1p_y.y" { CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr); ; break;} -case 248: -#line 1937 "asn1p_y.y" +case 249: +#line 1939 "asn1p_y.y" { yyval.a_constr = asn1p_constraint_new(yylineno); checkmem(yyval.a_constr); @@ -3286,8 +3277,8 @@ case 248: yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); ; break;} -case 249: -#line 1943 "asn1p_y.y" +case 250: +#line 1945 "asn1p_y.y" { asn1p_constraint_t *ct; ct = asn1p_constraint_new(yylineno); @@ -3297,8 +3288,8 @@ case 249: CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); ; break;} -case 250: -#line 1957 "asn1p_y.y" +case 251: +#line 1959 "asn1p_y.y" { char *p = malloc(strlen(yyvsp[0].tv_str) + 2); int ret; @@ -3311,8 +3302,8 @@ case 250: free(yyvsp[0].tv_str); ; break;} -case 251: -#line 1968 "asn1p_y.y" +case 252: +#line 1970 "asn1p_y.y" { char *p = malloc(strlen(yyvsp[0].tv_str) + 3); int ret; @@ -3326,14 +3317,14 @@ case 251: free(yyvsp[0].tv_str); ; break;} -case 252: -#line 1984 "asn1p_y.y" +case 253: +#line 1986 "asn1p_y.y" { yyval.tv_str = yyvsp[0].tv_str; ; break;} -case 253: -#line 1987 "asn1p_y.y" +case 254: +#line 1989 "asn1p_y.y" { int l1 = strlen(yyvsp[-2].tv_str); int l3 = strlen(yyvsp[0].tv_str); @@ -3344,61 +3335,61 @@ case 253: yyval.tv_str[l1 + 1 + l3] = '\0'; ; break;} -case 254: -#line 2005 "asn1p_y.y" +case 255: +#line 2007 "asn1p_y.y" { yyval.a_marker.flags = EM_NOMARK; yyval.a_marker.default_value = 0; ; break;} -case 255: -#line 2009 "asn1p_y.y" +case 256: +#line 2011 "asn1p_y.y" { yyval.a_marker = yyvsp[0].a_marker; ; break;} -case 256: -#line 2013 "asn1p_y.y" +case 257: +#line 2015 "asn1p_y.y" { yyval.a_marker.flags = EM_OPTIONAL | EM_INDIRECT; yyval.a_marker.default_value = 0; ; break;} -case 257: -#line 2017 "asn1p_y.y" +case 258: +#line 2019 "asn1p_y.y" { yyval.a_marker.flags = EM_DEFAULT; yyval.a_marker.default_value = yyvsp[0].a_value; ; break;} -case 258: -#line 2040 "asn1p_y.y" +case 259: +#line 2042 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); ; break;} -case 259: -#line 2044 "asn1p_y.y" +case 260: +#line 2046 "asn1p_y.y" { yyval.a_expr = yyvsp[-1].a_expr; ; break;} -case 260: -#line 2050 "asn1p_y.y" +case 261: +#line 2052 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 261: -#line 2055 "asn1p_y.y" +case 262: +#line 2057 "asn1p_y.y" { yyval.a_expr = yyvsp[-2].a_expr; asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); ; break;} -case 262: -#line 2062 "asn1p_y.y" +case 263: +#line 2064 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -3407,19 +3398,8 @@ case 262: yyval.a_expr->Identifier = yyvsp[0].tv_str; ; break;} -case 263: -#line 2069 "asn1p_y.y" -{ - yyval.a_expr = asn1p_expr_new(yylineno); - checkmem(yyval.a_expr); - yyval.a_expr->expr_type = A1TC_UNIVERVAL; - yyval.a_expr->meta_type = AMT_VALUE; - yyval.a_expr->Identifier = yyvsp[-3].tv_str; - yyval.a_expr->value = yyvsp[-1].a_value; - ; - break;} case 264: -#line 2077 "asn1p_y.y" +#line 2071 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -3430,7 +3410,18 @@ case 264: ; break;} case 265: -#line 2085 "asn1p_y.y" +#line 2079 "asn1p_y.y" +{ + yyval.a_expr = asn1p_expr_new(yylineno); + checkmem(yyval.a_expr); + yyval.a_expr->expr_type = A1TC_UNIVERVAL; + yyval.a_expr->meta_type = AMT_VALUE; + yyval.a_expr->Identifier = yyvsp[-3].tv_str; + yyval.a_expr->value = yyvsp[-1].a_value; + ; + break;} +case 266: +#line 2087 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -3439,8 +3430,8 @@ case 265: yyval.a_expr->value = yyvsp[0].a_value; ; break;} -case 266: -#line 2092 "asn1p_y.y" +case 267: +#line 2094 "asn1p_y.y" { yyval.a_expr = asn1p_expr_new(yylineno); checkmem(yyval.a_expr); @@ -3450,103 +3441,103 @@ case 266: yyval.a_expr->meta_type = AMT_VALUE; ; break;} -case 267: -#line 2103 "asn1p_y.y" -{ - yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); - checkmem(yyval.a_value); - ; - break;} case 268: -#line 2107 "asn1p_y.y" +#line 2105 "asn1p_y.y" { yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); checkmem(yyval.a_value); ; break;} case 269: -#line 2138 "asn1p_y.y" -{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ; +#line 2109 "asn1p_y.y" +{ + yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); + checkmem(yyval.a_value); + ; break;} case 270: -#line 2139 "asn1p_y.y" -{ yyval.a_tag = yyvsp[0].a_tag; ; +#line 2140 "asn1p_y.y" +{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ; break;} case 271: -#line 2143 "asn1p_y.y" +#line 2141 "asn1p_y.y" +{ yyval.a_tag = yyvsp[0].a_tag; ; + break;} +case 272: +#line 2145 "asn1p_y.y" { yyval.a_tag = yyvsp[-1].a_tag; yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode; ; break;} -case 272: -#line 2150 "asn1p_y.y" +case 273: +#line 2152 "asn1p_y.y" { yyval.a_tag = yyvsp[-2].a_tag; yyval.a_tag.tag_value = yyvsp[-1].a_int; ; break;} -case 273: -#line 2156 "asn1p_y.y" +case 274: +#line 2158 "asn1p_y.y" { yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; ; break;} -case 274: -#line 2157 "asn1p_y.y" +case 275: +#line 2159 "asn1p_y.y" { yyval.a_tag.tag_class = TC_UNIVERSAL; ; break;} -case 275: -#line 2158 "asn1p_y.y" +case 276: +#line 2160 "asn1p_y.y" { yyval.a_tag.tag_class = TC_APPLICATION; ; break;} -case 276: -#line 2159 "asn1p_y.y" +case 277: +#line 2161 "asn1p_y.y" { yyval.a_tag.tag_class = TC_PRIVATE; ; break;} -case 277: -#line 2163 "asn1p_y.y" +case 278: +#line 2165 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_DEFAULT; ; break;} -case 278: -#line 2164 "asn1p_y.y" +case 279: +#line 2166 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_IMPLICIT; ; break;} -case 279: -#line 2165 "asn1p_y.y" +case 280: +#line 2167 "asn1p_y.y" { yyval.a_tag.tag_mode = TM_EXPLICIT; ; break;} -case 280: -#line 2169 "asn1p_y.y" -{ - checkmem(yyvsp[0].tv_str); - yyval.tv_str = yyvsp[0].tv_str; - ; - break;} case 281: -#line 2173 "asn1p_y.y" +#line 2171 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; ; break;} case 282: -#line 2181 "asn1p_y.y" +#line 2175 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; ; break;} case 283: -#line 2188 "asn1p_y.y" -{ yyval.tv_str = 0; ; +#line 2183 "asn1p_y.y" +{ + checkmem(yyvsp[0].tv_str); + yyval.tv_str = yyvsp[0].tv_str; + ; break;} case 284: -#line 2189 "asn1p_y.y" +#line 2190 "asn1p_y.y" +{ yyval.tv_str = 0; ; + break;} +case 285: +#line 2191 "asn1p_y.y" { yyval.tv_str = yyvsp[0].tv_str; ; break;} -case 285: -#line 2195 "asn1p_y.y" +case 286: +#line 2197 "asn1p_y.y" { checkmem(yyvsp[0].tv_str); yyval.tv_str = yyvsp[0].tv_str; @@ -3774,7 +3765,7 @@ yyerrhandle: } return 1; } -#line 2201 "asn1p_y.y" +#line 2203 "asn1p_y.y" diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y index e119f172..e009d067 100644 --- a/libasn1parser/asn1p_y.y +++ b/libasn1parser/asn1p_y.y @@ -250,10 +250,11 @@ static void _fixup_anonymous_identifier(asn1p_expr_t *expr); %type ObjectClass %type Type %type DataTypeReference /* Type1 ::= Type2 */ -%type DefinedTypeRef +%type DefinedType %type ValueSetDefinition /* Val INTEGER ::= {1|2} */ %type ValueDefinition /* val INTEGER ::= 1*/ %type Value +%type SimpleValue %type DefinedValue %type SignedNumber %type optComponentTypeLists @@ -712,7 +713,7 @@ ExportsElement: ValueSetDefinition: - TypeRefName DefinedTypeRef TOK_PPEQ + TypeRefName DefinedType TOK_PPEQ '{' { asn1p_lexer_hack_push_opaque_state(); } Opaque /* '}' */ { $$ = $2; assert($$->Identifier == 0); @@ -722,19 +723,37 @@ ValueSetDefinition: } ; -DefinedTypeRef: - ComplexTypeReference { +DefinedType: + BasicType { + $$ = $1; + } + /* + * A DefinedType reference. + * "CLASS1.&id.&id2" + * or + * "Module.Type" + * or + * "Module.identifier" + * or + * "Type" + */ + | ComplexTypeReference { $$ = asn1p_expr_new(yylineno); checkmem($$); $$->reference = $1; $$->expr_type = A1TC_REFERENCE; $$->meta_type = AMT_TYPEREF; } - | BasicTypeId { + /* + * A parametrized assignment. + */ + | ComplexTypeReference '{' Specializations '}' { $$ = asn1p_expr_new(yylineno); checkmem($$); - $$->expr_type = $1; - $$->meta_type = AMT_TYPE; + $$->reference = $1; + $$->rhs_pspecs = $3; + $$->expr_type = A1TC_REFERENCE; + $$->meta_type = AMT_TYPEREF; } ; @@ -843,6 +862,14 @@ Specialization: Type { $$ = $1; } + | SimpleValue { + $$ = asn1p_expr_new(yylineno); + checkmem($$); + $$->Identifier = "?"; + $$->expr_type = A1TC_REFERENCE; + $$->meta_type = AMT_VALUE; + $$->value = $1; + } | Identifier { asn1p_ref_t *ref; $$ = asn1p_expr_new(yylineno); @@ -1168,7 +1195,7 @@ TypeDeclaration: ; TypeDeclarationSet: - BasicType { + DefinedType { $$ = $1; } | TOK_CHOICE '{' AlternativeTypeLists '}' { @@ -1226,34 +1253,7 @@ TypeDeclarationSet: $$->expr_type = ASN_TYPE_ANY; $$->meta_type = AMT_TYPE; } - /* - * A DefinedType reference. - * "CLASS1.&id.&id2" - * or - * "Module.Type" - * or - * "Module.identifier" - * or - * "Type" - */ - | ComplexTypeReference { - $$ = asn1p_expr_new(yylineno); - checkmem($$); - $$->reference = $1; - $$->expr_type = A1TC_REFERENCE; - $$->meta_type = AMT_TYPEREF; - } - /* - * A parametrized assignment. - */ - | ComplexTypeReference '{' Specializations '}' { - $$ = asn1p_expr_new(yylineno); - checkmem($$); - $$->reference = $1; - $$->rhs_pspecs = $3; - $$->expr_type = A1TC_REFERENCE; - $$->meta_type = AMT_TYPEREF; - } + | TOK_INSTANCE TOK_OF ComplexTypeReference { $$ = asn1p_expr_new(yylineno); checkmem($$); @@ -1407,7 +1407,7 @@ DefinedObjectClass: * === EOF === */ ValueDefinition: - Identifier DefinedTypeRef TOK_PPEQ Value { + Identifier DefinedType TOK_PPEQ Value { $$ = $2; assert($$->Identifier == NULL); $$->Identifier = $1; @@ -1417,7 +1417,9 @@ ValueDefinition: ; Value: - Identifier ':' Value { + SimpleValue + | DefinedValue + | Identifier ':' Value { $$ = asn1p_value_fromint(0); checkmem($$); $$->type = ATV_CHOICE_IDENTIFIER; @@ -1434,7 +1436,10 @@ Value: checkmem($$); $$->type = ATV_NULL; } - | TOK_FALSE { + ; + +SimpleValue: + TOK_FALSE { $$ = asn1p_value_fromint(0); checkmem($$); $$->type = ATV_FALSE; @@ -1458,9 +1463,6 @@ Value: | SignedNumber { $$ = $1; } - | DefinedValue { - $$ = $1; - } ; DefinedValue: diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c index df3a93f2..13784860 100644 --- a/libasn1print/asn1print.c +++ b/libasn1print/asn1print.c @@ -668,6 +668,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri printf("{"); TQ_FOR(se, &(tc->rhs_pspecs->members), next) { asn1print_expr(asn, mod, se, flags, level + 1); + if(TQ_NEXT(se, next)) printf(", "); } printf("}"); } diff --git a/tests/106-param-constr-OK.asn1 b/tests/106-param-constr-OK.asn1 index 196b3d7d..7dd8c4bf 100644 --- a/tests/106-param-constr-OK.asn1 +++ b/tests/106-param-constr-OK.asn1 @@ -11,10 +11,12 @@ ModuleParametrizationWithConstraints DEFINITIONS ::= BEGIN - Narrow {Type} ::= SEQUENCE { - narrower Type (2..5) + Narrow {Type, INTEGER:value} ::= SEQUENCE { + narrow1 Type (1..5) DEFAULT value, + narrow2 [0] Type (2..5), + narrow3 [1] Type (3..5) OPTIONAL } - NarrowInteger ::= Narrow {INTEGER (0..10)} + NarrowInteger ::= Narrow {INTEGER (0..10), 3} END diff --git a/tests/106-param-constr-OK.asn1.-P b/tests/106-param-constr-OK.asn1.-P index 49046200..db115163 100644 --- a/tests/106-param-constr-OK.asn1.-P +++ b/tests/106-param-constr-OK.asn1.-P @@ -6,21 +6,48 @@ /*** <<< TYPE-DECLS [Narrow] >>> ***/ -typedef struct Narrow_16P0 { - long narrower; +typedef struct Narrow_15P0 { + long *narrow1 /* DEFAULT 3 */; + long narrow2; + long *narrow3 /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; -} Narrow_16P0_t; +} Narrow_15P0_t; /*** <<< FUNC-DECLS [Narrow] >>> ***/ -extern asn_TYPE_descriptor_t asn_DEF_Narrow_16P0; +extern asn_TYPE_descriptor_t asn_DEF_Narrow_15P0; /*** <<< CODE [Narrow] >>> ***/ static int -memb_narrower_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, +memb_narrow1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + long value; + + if(!sptr) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 1 && value <= 5)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_ERRLOG(app_errlog, app_key, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static int +memb_narrow2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *app_errlog, void *app_key) { long value; @@ -44,36 +71,93 @@ memb_narrower_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } +static int +memb_narrow3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_consume_bytes_f *app_errlog, void *app_key) { + long value; + + if(!sptr) { + _ASN_ERRLOG(app_errlog, app_key, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 3 && value <= 5)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_ERRLOG(app_errlog, app_key, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + /*** <<< STAT-DEFS [Narrow] >>> ***/ -static asn_TYPE_member_t asn_MBR_Narrow_16P0_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct Narrow_16P0, narrower), +static int asn_DFL_2_set_3(void **sptr) { + long *st = *sptr; + + if(!st) { + st = (*sptr = CALLOC(1, sizeof(*st))); + if(!st) return -1; + } + + /* Install default value 3 */ + *st = 3; + return 0; +} +static asn_TYPE_member_t asn_MBR_Narrow_15P0_1[] = { + { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow1), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_NativeInteger, - .memb_constraints = memb_narrower_constraint_1, + .memb_constraints = memb_narrow1_constraint_1, + .per_constraints = 0, /* PER is not compiled, use -gen-PER */ + .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ + .name = "narrow1" + }, + { ATF_NOFLAGS, 0, offsetof(struct Narrow_15P0, narrow2), + .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + .tag_mode = +1, /* EXPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .memb_constraints = memb_narrow2_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, - .name = "narrower" + .name = "narrow2" + }, + { ATF_POINTER, 1, offsetof(struct Narrow_15P0, narrow3), + .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + .tag_mode = +1, /* EXPLICIT tag at current level */ + .type = &asn_DEF_NativeInteger, + .memb_constraints = memb_narrow3_constraint_1, + .per_constraints = 0, /* PER is not compiled, use -gen-PER */ + .default_value = 0, + .name = "narrow3" }, }; -static ber_tlv_tag_t asn_DEF_Narrow_16P0_tags_1[] = { +static ber_tlv_tag_t asn_DEF_Narrow_15P0_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; -static asn_TYPE_tag2member_t asn_MAP_Narrow_16P0_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* narrower at 18 */ +static asn_TYPE_tag2member_t asn_MAP_Narrow_15P0_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* narrow1 at 20 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* narrow2 at 20 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* narrow3 at 20 */ }; -static asn_SEQUENCE_specifics_t asn_SPC_Narrow_16P0_specs_1 = { - sizeof(struct Narrow_16P0), - offsetof(struct Narrow_16P0, _asn_ctx), - asn_MAP_Narrow_16P0_tag2el_1, - 1, /* Count of tags in the map */ +static asn_SEQUENCE_specifics_t asn_SPC_Narrow_15P0_specs_1 = { + sizeof(struct Narrow_15P0), + offsetof(struct Narrow_15P0, _asn_ctx), + asn_MAP_Narrow_15P0_tag2el_1, + 3, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; -asn_TYPE_descriptor_t asn_DEF_Narrow_16P0 = { +asn_TYPE_descriptor_t asn_DEF_Narrow_15P0 = { "Narrow", "Narrow", SEQUENCE_free, @@ -85,16 +169,16 @@ asn_TYPE_descriptor_t asn_DEF_Narrow_16P0 = { SEQUENCE_encode_xer, 0, /* No PER decoder, -gen-PER to enable */ 0, /* Use generic outmost tag fetcher */ - asn_DEF_Narrow_16P0_tags_1, - sizeof(asn_DEF_Narrow_16P0_tags_1) - /sizeof(asn_DEF_Narrow_16P0_tags_1[0]), /* 1 */ - asn_DEF_Narrow_16P0_tags_1, /* Same as above */ - sizeof(asn_DEF_Narrow_16P0_tags_1) - /sizeof(asn_DEF_Narrow_16P0_tags_1[0]), /* 1 */ + asn_DEF_Narrow_15P0_tags_1, + sizeof(asn_DEF_Narrow_15P0_tags_1) + /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */ + asn_DEF_Narrow_15P0_tags_1, /* Same as above */ + sizeof(asn_DEF_Narrow_15P0_tags_1) + /sizeof(asn_DEF_Narrow_15P0_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ - asn_MBR_Narrow_16P0_1, - 1, /* Elements count */ - &asn_SPC_Narrow_16P0_specs_1 /* Additional specs */ + asn_MBR_Narrow_15P0_1, + 3, /* Elements count */ + &asn_SPC_Narrow_15P0_specs_1 /* Additional specs */ }; @@ -104,7 +188,7 @@ asn_TYPE_descriptor_t asn_DEF_Narrow_16P0 = { /*** <<< TYPE-DECLS [NarrowInteger] >>> ***/ -typedef Narrow_16P0_t NarrowInteger_t; +typedef Narrow_15P0_t NarrowInteger_t; /*** <<< FUNC-DECLS [NarrowInteger] >>> ***/ @@ -123,28 +207,28 @@ int NarrowInteger_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *app_errlog, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_Narrow_16P0.check_constraints; + td->check_constraints = asn_DEF_Narrow_15P0.check_constraints; return td->check_constraints(td, sptr, app_errlog, app_key); } /* - * This type is implemented using Narrow_16P0, + * This type is implemented using Narrow_15P0, * so here we adjust the DEF accordingly. */ static void NarrowInteger_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_Narrow_16P0.free_struct; - td->print_struct = asn_DEF_Narrow_16P0.print_struct; - td->ber_decoder = asn_DEF_Narrow_16P0.ber_decoder; - td->der_encoder = asn_DEF_Narrow_16P0.der_encoder; - td->xer_decoder = asn_DEF_Narrow_16P0.xer_decoder; - td->xer_encoder = asn_DEF_Narrow_16P0.xer_encoder; - td->uper_decoder = asn_DEF_Narrow_16P0.uper_decoder; + td->free_struct = asn_DEF_Narrow_15P0.free_struct; + td->print_struct = asn_DEF_Narrow_15P0.print_struct; + td->ber_decoder = asn_DEF_Narrow_15P0.ber_decoder; + td->der_encoder = asn_DEF_Narrow_15P0.der_encoder; + td->xer_decoder = asn_DEF_Narrow_15P0.xer_decoder; + td->xer_encoder = asn_DEF_Narrow_15P0.xer_encoder; + td->uper_decoder = asn_DEF_Narrow_15P0.uper_decoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_Narrow_16P0.per_constraints; - td->elements = asn_DEF_Narrow_16P0.elements; - td->elements_count = asn_DEF_Narrow_16P0.elements_count; - td->specifics = asn_DEF_Narrow_16P0.specifics; + td->per_constraints = asn_DEF_Narrow_15P0.per_constraints; + td->elements = asn_DEF_Narrow_15P0.elements; + td->elements_count = asn_DEF_Narrow_15P0.elements_count; + td->specifics = asn_DEF_Narrow_15P0.specifics; } void diff --git a/tests/107-param-constr-2-OK.asn1 b/tests/107-param-constr-2-OK.asn1 new file mode 100644 index 00000000..40aefab9 --- /dev/null +++ b/tests/107-param-constr-2-OK.asn1 @@ -0,0 +1,18 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .107 + +ModuleParametrizationWithConstraints2 + { iso org(3) dod(6) internet (1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 107 } + DEFINITIONS ::= +BEGIN + + Narrow {Type} ::= Type (2..5) + + NarrowInteger ::= Narrow {INTEGER} + +END diff --git a/tests/84-param-tags-OK.asn1.-P b/tests/84-param-tags-OK.asn1.-P index 8e48c258..d3a61c67 100644 --- a/tests/84-param-tags-OK.asn1.-P +++ b/tests/84-param-tags-OK.asn1.-P @@ -8,13 +8,13 @@ /*** <<< TYPE-DECLS [TestType] >>> ***/ typedef struct TestType_16P0 { - long common; + long common /* DEFAULT 0 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } TestType_16P0_t; typedef struct TestType_16P1 { - BOOLEAN_t common; + BOOLEAN_t common /* DEFAULT 0 */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; @@ -55,14 +55,26 @@ memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, /*** <<< STAT-DEFS [TestType] >>> ***/ +static int asn_DFL_2_set_0(void **sptr) { + long *st = *sptr; + + if(!st) { + st = (*sptr = CALLOC(1, sizeof(*st))); + if(!st) return -1; + } + + /* Install default value 0 */ + *st = 0; + return 0; +} static asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct TestType_16P0, common), + { ATF_NOFLAGS, 1, offsetof(struct TestType_16P0, common), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_NativeInteger, .memb_constraints = memb_common_constraint_1, .per_constraints = 0, /* PER is not compiled, use -gen-PER */ - .default_value = 0, + .default_value = asn_DFL_2_set_0, /* DEFAULT 0 */ .name = "common" }, }; @@ -105,14 +117,26 @@ asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = { &asn_SPC_TestType_16P0_specs_1 /* Additional specs */ }; +static int asn_DFL_4_set_0(void **sptr) { + BOOLEAN_t *st = *sptr; + + if(!st) { + st = (*sptr = CALLOC(1, sizeof(*st))); + if(!st) return -1; + } + + /* Install default value 0 */ + *st = 0; + return 0; +} static asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct TestType_16P1, common), + { ATF_NOFLAGS, 1, offsetof(struct TestType_16P1, common), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ - .default_value = 0, + .default_value = asn_DFL_4_set_0, /* DEFAULT 0 */ .name = "common" }, };