| |
| /* A Bison parser, made from asn1p_y.y |
| by GNU Bison version 1.28 */ |
| |
| #define YYBISON 1 /* Identify Bison output. */ |
| |
| #define yyparse asn1p_parse |
| #define yylex asn1p_lex |
| #define yyerror asn1p_error |
| #define yylval asn1p_lval |
| #define yychar asn1p_char |
| #define yydebug asn1p_debug |
| #define yynerrs asn1p_nerrs |
| #define TOK_PPEQ 257 |
| #define TOK_opaque 258 |
| #define TOK_bstring 259 |
| #define TOK_cstring 260 |
| #define TOK_hstring 261 |
| #define TOK_identifier 262 |
| #define TOK_number 263 |
| #define TOK_tuple 264 |
| #define TOK_quadruple 265 |
| #define TOK_number_negative 266 |
| #define TOK_typereference 267 |
| #define TOK_capitalreference 268 |
| #define TOK_typefieldreference 269 |
| #define TOK_valuefieldreference 270 |
| #define TOK_ABSENT 271 |
| #define TOK_ABSTRACT_SYNTAX 272 |
| #define TOK_ALL 273 |
| #define TOK_ANY 274 |
| #define TOK_APPLICATION 275 |
| #define TOK_AUTOMATIC 276 |
| #define TOK_BEGIN 277 |
| #define TOK_BIT 278 |
| #define TOK_BMPString 279 |
| #define TOK_BOOLEAN 280 |
| #define TOK_BY 281 |
| #define TOK_CHARACTER 282 |
| #define TOK_CHOICE 283 |
| #define TOK_CLASS 284 |
| #define TOK_COMPONENT 285 |
| #define TOK_COMPONENTS 286 |
| #define TOK_CONSTRAINED 287 |
| #define TOK_CONTAINING 288 |
| #define TOK_DEFAULT 289 |
| #define TOK_DEFINITIONS 290 |
| #define TOK_DEFINED 291 |
| #define TOK_EMBEDDED 292 |
| #define TOK_ENCODED 293 |
| #define TOK_ENCODING_CONTROL 294 |
| #define TOK_END 295 |
| #define TOK_ENUMERATED 296 |
| #define TOK_EXPLICIT 297 |
| #define TOK_EXPORTS 298 |
| #define TOK_EXTENSIBILITY 299 |
| #define TOK_EXTERNAL 300 |
| #define TOK_FALSE 301 |
| #define TOK_FROM 302 |
| #define TOK_GeneralizedTime 303 |
| #define TOK_GeneralString 304 |
| #define TOK_GraphicString 305 |
| #define TOK_IA5String 306 |
| #define TOK_IDENTIFIER 307 |
| #define TOK_IMPLICIT 308 |
| #define TOK_IMPLIED 309 |
| #define TOK_IMPORTS 310 |
| #define TOK_INCLUDES 311 |
| #define TOK_INSTANCE 312 |
| #define TOK_INSTRUCTIONS 313 |
| #define TOK_INTEGER 314 |
| #define TOK_ISO646String 315 |
| #define TOK_MAX 316 |
| #define TOK_MIN 317 |
| #define TOK_MINUS_INFINITY 318 |
| #define TOK_NULL 319 |
| #define TOK_NumericString 320 |
| #define TOK_OBJECT 321 |
| #define TOK_ObjectDescriptor 322 |
| #define TOK_OCTET 323 |
| #define TOK_OF 324 |
| #define TOK_OPTIONAL 325 |
| #define TOK_PATTERN 326 |
| #define TOK_PDV 327 |
| #define TOK_PLUS_INFINITY 328 |
| #define TOK_PRESENT 329 |
| #define TOK_PrintableString 330 |
| #define TOK_PRIVATE 331 |
| #define TOK_REAL 332 |
| #define TOK_RELATIVE_OID 333 |
| #define TOK_SEQUENCE 334 |
| #define TOK_SET 335 |
| #define TOK_SIZE 336 |
| #define TOK_STRING 337 |
| #define TOK_SYNTAX 338 |
| #define TOK_T61String 339 |
| #define TOK_TAGS 340 |
| #define TOK_TeletexString 341 |
| #define TOK_TRUE 342 |
| #define TOK_TYPE_IDENTIFIER 343 |
| #define TOK_UNIQUE 344 |
| #define TOK_UNIVERSAL 345 |
| #define TOK_UniversalString 346 |
| #define TOK_UTCTime 347 |
| #define TOK_UTF8String 348 |
| #define TOK_VideotexString 349 |
| #define TOK_VisibleString 350 |
| #define TOK_WITH 351 |
| #define TOK_EXCEPT 352 |
| #define TOK_INTERSECTION 353 |
| #define TOK_UNION 354 |
| #define TOK_TwoDots 355 |
| #define TOK_ThreeDots 356 |
| |
| #line 1 "asn1p_y.y" |
| |
| |
| #include <stdlib.h> |
| #include <stdio.h> |
| #include <string.h> |
| #include <errno.h> |
| #include <assert.h> |
| |
| #include "asn1parser.h" |
| |
| #define YYPARSE_PARAM param |
| #define YYPARSE_PARAM_TYPE void ** |
| #define YYERROR_VERBOSE |
| |
| int yylex(void); |
| int yyerror(const char *msg); |
| #ifdef YYBYACC |
| int yyparse(void **param); /* byacc does not produce a prototype */ |
| #endif |
| void asn1p_lexer_hack_push_opaque_state(void); |
| void asn1p_lexer_hack_enable_with_syntax(void); |
| void asn1p_lexer_hack_push_encoding_control(void); |
| #define yylineno asn1p_lineno |
| extern int asn1p_lineno; |
| |
| /* |
| * Process directives as <ASN1C:RepresentAsPointer> |
| */ |
| extern int asn1p_as_pointer; |
| |
| /* |
| * This temporary variable is used to solve the shortcomings of 1-lookahead |
| * parser. |
| */ |
| static struct AssignedIdentifier *saved_aid; |
| |
| static asn1p_value_t *_convert_bitstring2binary(char *str, int base); |
| static void _fixup_anonymous_identifier(asn1p_expr_t *expr); |
| |
| #define checkmem(ptr) do { \ |
| if(!(ptr)) \ |
| return yyerror("Memory failure"); \ |
| } while(0) |
| |
| #define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \ |
| if(arg1->type != constr_type) { \ |
| int __ret; \ |
| root = asn1p_constraint_new(yylineno); \ |
| checkmem(root); \ |
| root->type = constr_type; \ |
| __ret = asn1p_constraint_insert(root, \ |
| arg1); \ |
| checkmem(__ret == 0); \ |
| } else { \ |
| root = arg1; \ |
| } \ |
| if(arg2) { \ |
| int __ret \ |
| = asn1p_constraint_insert(root, arg2); \ |
| checkmem(__ret == 0); \ |
| } \ |
| } while(0) |
| |
| |
| #line 72 "asn1p_y.y" |
| typedef union { |
| asn1p_t *a_grammar; |
| asn1p_module_flags_e a_module_flags; |
| asn1p_module_t *a_module; |
| asn1p_expr_type_e a_type; /* ASN.1 Type */ |
| asn1p_expr_t *a_expr; /* Constructed collection */ |
| asn1p_constraint_t *a_constr; /* Constraint */ |
| enum asn1p_constraint_type_e a_ctype;/* Constraint type */ |
| asn1p_xports_t *a_xports; /* IMports/EXports */ |
| struct AssignedIdentifier a_aid; /* Assigned Identifier */ |
| asn1p_oid_t *a_oid; /* Object Identifier */ |
| asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ |
| struct asn1p_type_tag_s a_tag; /* A tag */ |
| asn1p_ref_t *a_ref; /* Reference to custom type */ |
| asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ |
| asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ |
| struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ |
| asn1p_value_t *a_value; /* Number, DefinedValue, etc */ |
| struct asn1p_param_s a_parg; /* A parameter argument */ |
| asn1p_paramlist_t *a_plist; /* A pargs list */ |
| struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ |
| enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ |
| asn1c_integer_t a_int; |
| char *tv_str; |
| struct { |
| char *buf; |
| int len; |
| } tv_opaque; |
| struct { |
| char *name; |
| struct asn1p_type_tag_s tag; |
| } tv_nametag; |
| } YYSTYPE; |
| #include <stdio.h> |
| |
| #ifndef __cplusplus |
| #ifndef __STDC__ |
| #define const |
| #endif |
| #endif |
| |
| |
| |
| #define YYFINAL 442 |
| #define YYFLAG -32768 |
| #define YYNTBASE 118 |
| |
| #define YYTRANSLATE(x) ((unsigned)(x) <= 356 ? yytranslate[x] : 225) |
| |
| static const char yytranslate[] = { 0, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 112, 2, 2, 2, 2, 2, 2, 107, |
| 108, 2, 2, 110, 2, 113, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 111, 109, 114, |
| 2, 2, 2, 115, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 116, 2, 117, 99, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 105, 101, 106, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, |
| 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
| 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, |
| 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, |
| 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, |
| 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, |
| 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, |
| 97, 98, 100, 102, 103, 104 |
| }; |
| |
| #if YYDEBUG != 0 |
| static const short yyprhs[] = { 0, |
| 0, 2, 4, 7, 16, 17, 19, 23, 26, 28, |
| 31, 33, 38, 40, 41, 43, 45, 48, 51, 54, |
| 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, 312, 316, 317, |
| 320, 322, 327, 332, 337, 344, 351, 353, 358, 363, |
| 365, 369, 371, 375, 379, 383, 385, 389, 391, 395, |
| 397, 399, 401, 403, 405, 409, 413, 415, 420, 424, |
| 425, 429, 431, 433, 435, 437, 439, 441, 443, 445, |
| 447, 451, 453, 455, 457, 459, 462, 464, 466, 468, |
| 470, 473, 476, 478, 480, 483, 486, 488, 490, 492, |
| 494, 496, 499, 501, 504, 506, 508, 510, 512, 514, |
| 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, |
| 536, 538, 540, 542, 543, 545, 547, 552, 556, 561, |
| 563, 567, 573, 575, 579, 583, 587, 591, 596, 600, |
| 602, 604, 608, 612, 616, 620, 622, 624, 625, 631, |
| 633, 636, 639, 643, 645, 647, 649, 651, 653, 655, |
| 657, 659, 663, 669, 671, 675, 677, 681, 682, 684, |
| 686, 688, 690, 692, 694, 698, 703, 705, 709, 712, |
| 716, 718, 722, 723, 725, 727, 730, 733, 737, 739, |
| 743, 745, 750, 755, 757, 759, 761, 763, 764, 766, |
| 769, 774, 775, 777, 779, 781, 782, 784, 786, 788, |
| 790, 792, 793, 795 |
| }; |
| |
| static const short yyrhs[] = { 119, |
| 0, 120, 0, 119, 120, 0, 221, 121, 36, 125, |
| 3, 23, 128, 41, 0, 0, 122, 0, 105, 123, |
| 106, 0, 105, 106, 0, 124, 0, 123, 124, 0, |
| 224, 0, 224, 107, 9, 108, 0, 9, 0, 0, |
| 126, 0, 127, 0, 126, 127, 0, 43, 86, 0, |
| 54, 86, 0, 22, 86, 0, 45, 55, 0, 14, |
| 59, 0, 0, 129, 0, 130, 0, 129, 130, 0, |
| 132, 0, 138, 0, 144, 0, 175, 0, 141, 0, |
| 0, 40, 14, 131, 0, 184, 0, 56, 133, 109, |
| 0, 56, 48, 0, 135, 0, 133, 135, 0, 0, |
| 122, 0, 136, 48, 221, 134, 0, 137, 0, 136, |
| 110, 137, 0, 221, 0, 221, 105, 106, 0, 224, |
| 0, 44, 139, 109, 0, 44, 19, 109, 0, 44, |
| 109, 0, 140, 0, 139, 110, 140, 0, 221, 0, |
| 221, 105, 106, 0, 224, 0, 0, 221, 143, 3, |
| 105, 142, 180, 0, 168, 0, 181, 0, 221, 3, |
| 164, 0, 221, 3, 154, 0, 221, 105, 145, 106, |
| 3, 164, 0, 146, 0, 145, 110, 146, 0, 221, |
| 0, 221, 111, 224, 0, 221, 111, 221, 0, 181, |
| 111, 224, 0, 148, 0, 147, 110, 148, 0, 164, |
| 0, 224, 0, 0, 150, 0, 151, 0, 150, 110, |
| 151, 0, 224, 164, 210, 0, 164, 210, 0, 32, |
| 70, 164, 0, 163, 0, 153, 0, 152, 110, 153, |
| 0, 224, 164, 0, 163, 0, 164, 0, 30, 105, |
| 156, 106, 158, 0, 0, 90, 0, 157, 0, 156, |
| 110, 157, 0, 15, 210, 0, 16, 164, 155, 210, |
| 0, 16, 173, 210, 0, 16, 174, 210, 0, 15, |
| 173, 210, 0, 15, 164, 210, 0, 15, 174, 210, |
| 0, 0, 159, 0, 0, 97, 84, 105, 160, 161, |
| 106, 0, 162, 0, 161, 162, 0, 4, 0, 171, |
| 0, 104, 0, 104, 112, 178, 0, 104, 112, 215, |
| 0, 216, 166, 188, 0, 0, 165, 167, 0, 183, |
| 0, 29, 105, 152, 106, 0, 80, 105, 149, 106, |
| 0, 81, 105, 149, 106, 0, 80, 188, 70, 223, |
| 216, 166, 0, 81, 188, 70, 223, 216, 166, 0, |
| 20, 0, 20, 37, 27, 224, 0, 221, 105, 147, |
| 106, 0, 168, 0, 58, 70, 168, 0, 13, 0, |
| 13, 113, 221, 0, 222, 113, 221, 0, 13, 113, |
| 224, 0, 222, 0, 222, 113, 169, 0, 170, 0, |
| 169, 113, 170, 0, 172, 0, 172, 0, 15, 0, |
| 16, 0, 15, 0, 173, 113, 15, 0, 173, 113, |
| 16, 0, 14, 0, 224, 143, 3, 176, 0, 224, |
| 111, 176, 0, 0, 105, 177, 180, 0, 65, 0, |
| 47, 0, 88, 0, 5, 0, 7, 0, 179, 0, |
| 215, 0, 178, 0, 224, 0, 221, 113, 224, 0, |
| 6, 0, 10, 0, 11, 0, 4, 0, 180, 4, |
| 0, 26, 0, 65, 0, 78, 0, 182, 0, 69, |
| 83, 0, 67, 53, 0, 79, 0, 46, 0, 38, |
| 73, 0, 28, 83, 0, 93, 0, 49, 0, 184, |
| 0, 60, 0, 42, 0, 24, 83, 0, 181, 0, |
| 182, 212, 0, 25, 0, 50, 0, 51, 0, 52, |
| 0, 61, 0, 66, 0, 76, 0, 85, 0, 87, |
| 0, 92, 0, 94, 0, 95, 0, 96, 0, 68, |
| 0, 101, 0, 102, 0, 99, 0, 100, 0, 98, |
| 0, 0, 189, 0, 190, 0, 82, 107, 191, 108, |
| 0, 107, 191, 108, 0, 190, 107, 191, 108, 0, |
| 192, 0, 192, 110, 104, 0, 192, 110, 104, 110, |
| 192, 0, 193, 0, 19, 98, 193, 0, 192, 185, |
| 193, 0, 192, 186, 193, 0, 193, 187, 193, 0, |
| 196, 107, 191, 108, 0, 107, 191, 108, 0, 197, |
| 0, 198, 0, 197, 195, 197, 0, 63, 195, 197, |
| 0, 197, 195, 62, 0, 63, 195, 62, 0, 204, |
| 0, 199, 0, 0, 33, 27, 105, 194, 180, 0, |
| 103, 0, 103, 114, 0, 114, 103, 0, 114, 103, |
| 114, 0, 82, 0, 48, 0, 47, 0, 88, 0, |
| 215, 0, 179, 0, 224, 0, 221, 0, 97, 31, |
| 190, 0, 97, 32, 105, 200, 106, 0, 201, 0, |
| 200, 110, 201, 0, 104, 0, 224, 188, 202, 0, |
| 0, 203, 0, 75, 0, 17, 0, 71, 0, 205, |
| 0, 206, 0, 105, 221, 106, 0, 205, 105, 207, |
| 106, 0, 208, 0, 207, 110, 208, 0, 115, 209, |
| 0, 115, 113, 209, 0, 224, 0, 209, 113, 224, |
| 0, 0, 211, 0, 71, 0, 35, 176, 0, 105, |
| 106, 0, 105, 213, 106, 0, 214, 0, 213, 110, |
| 214, 0, 224, 0, 224, 107, 215, 108, 0, 224, |
| 107, 178, 108, 0, 215, 0, 104, 0, 9, 0, |
| 12, 0, 0, 217, 0, 218, 220, 0, 116, 219, |
| 9, 117, 0, 0, 91, 0, 21, 0, 77, 0, |
| 0, 54, 0, 43, 0, 13, 0, 14, 0, 14, |
| 0, 0, 224, 0, 8, 0 |
| }; |
| |
| #endif |
| |
| #if YYDEBUG != 0 |
| static const short yyrline[] = { 0, |
| 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, 734, 748, 758, |
| 774, 783, 793, 803, 808, 815, 822, 832, 838, 844, |
| 848, 871, 873, 875, 881, 887, 895, 901, 908, 913, |
| 919, 925, 931, 934, 940, 950, 952, 955, 963, 970, |
| 983, 994, 1004, 1015, 1025, 1036, 1047, 1049, 1054, 1058, |
| 1063, 1068, 1074, 1078, 1089, 1098, 1107, 1118, 1140, 1147, |
| 1166, 1170, 1176, 1182, 1188, 1198, 1208, 1214, 1228, 1252, |
| 1259, 1273, 1282, 1292, 1302, 1312, 1320, 1341, 1350, 1359, |
| 1360, 1362, 1369, 1376, 1382, 1386, 1392, 1412, 1422, 1430, |
| 1430, 1435, 1440, 1445, 1450, 1454, 1458, 1461, 1464, 1469, |
| 1481, 1498, 1503, 1508, 1541, 1551, 1565, 1567, 1568, 1569, |
| 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1584, |
| 1586, 1587, 1590, 1597, 1609, 1611, 1615, 1619, 1620, 1621, |
| 1622, 1623, 1627, 1628, 1629, 1630, 1634, 1635, 1642, 1642, |
| 1643, 1643, 1644, 1646, 1648, 1653, 1657, 1666, 1670, 1675, |
| 1679, 1685, 1695, 1699, 1702, 1705, 1708, 1713, 1722, 1730, |
| 1736, 1742, 1749, 1757, 1765, 1774, 1777, 1780, 1781, 1791, |
| 1793, 1794, 1795, 1798, 1802, 1807, 1813, 1818, 1821, 1824, |
| 1837, 1851, 1855, 1860, 1864, 1869, 1876, 1889, 1891, 1894, |
| 1898, 1901, 1906, 1910, 1918, 1933, 1939, 1946, 1959, 1971, |
| 1986, 1990, 2007, 2012, 2015, 2020, 2042, 2047, 2052, 2058, |
| 2064, 2072, 2080, 2088, 2095, 2105, 2110, 2140, 2142, 2145, |
| 2152, 2158, 2160, 2161, 2162, 2165, 2167, 2168, 2171, 2176, |
| 2183, 2190, 2192, 2197 |
| }; |
| #endif |
| |
| |
| #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) |
| |
| static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ", |
| "TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number", |
| "TOK_tuple","TOK_quadruple","TOK_number_negative","TOK_typereference","TOK_capitalreference", |
| "TOK_typefieldreference","TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX", |
| "TOK_ALL","TOK_ANY","TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT", |
| "TOK_BMPString","TOK_BOOLEAN","TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS", |
| "TOK_COMPONENT","TOK_COMPONENTS","TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT", |
| "TOK_DEFINITIONS","TOK_DEFINED","TOK_EMBEDDED","TOK_ENCODED","TOK_ENCODING_CONTROL", |
| "TOK_END","TOK_ENUMERATED","TOK_EXPLICIT","TOK_EXPORTS","TOK_EXTENSIBILITY", |
| "TOK_EXTERNAL","TOK_FALSE","TOK_FROM","TOK_GeneralizedTime","TOK_GeneralString", |
| "TOK_GraphicString","TOK_IA5String","TOK_IDENTIFIER","TOK_IMPLICIT","TOK_IMPLIED", |
| "TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE","TOK_INSTRUCTIONS","TOK_INTEGER", |
| "TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY","TOK_NULL","TOK_NumericString", |
| "TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET","TOK_OF","TOK_OPTIONAL","TOK_PATTERN", |
| "TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT","TOK_PrintableString","TOK_PRIVATE", |
| "TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE","TOK_SET","TOK_SIZE","TOK_STRING", |
| "TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString","TOK_TRUE","TOK_TYPE_IDENTIFIER", |
| "TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString","TOK_UTCTime","TOK_UTF8String", |
| "TOK_VideotexString","TOK_VisibleString","TOK_WITH","TOK_EXCEPT","'^'","TOK_INTERSECTION", |
| "'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots","'{'","'}'","'('","')'","';'", |
| "','","':'","'!'","'.'","'<'","'@'","'['","']'","ParsedGrammar","ModuleList", |
| "ModuleSpecification","optObjectIdentifier","ObjectIdentifier","ObjectIdentifierBody", |
| "ObjectIdentifierElement","optModuleSpecificationFlags","ModuleSpecificationFlags", |
| "ModuleSpecificationFlag","optModuleSpecificationBody","ModuleSpecificationBody", |
| "ModuleSpecificationElement","@1","ImportsDefinition","ImportsBundleSet","AssignedIdentifier", |
| "ImportsBundle","ImportsList","ImportsElement","ExportsDefinition","ExportsBody", |
| "ExportsElement","ValueSetDefinition","@2","DefinedTypeRef","DataTypeReference", |
| "ParameterArgumentList","ParameterArgumentName","ActualParameterList","ActualParameter", |
| "optComponentTypeLists","ComponentTypeLists","ComponentType","AlternativeTypeLists", |
| "AlternativeType","ObjectClass","optUnique","FieldSpec","ClassField","optWithSyntax", |
| "WithSyntax","@3","WithSyntaxFormat","WithSyntaxFormatToken","ExtensionAndException", |
| "Type","NSTD_IndirectMarker","TypeDeclaration","TypeDeclarationSet","ComplexTypeReference", |
| "ComplexTypeReferenceAmpList","ComplexTypeReferenceElement","ClassFieldIdentifier", |
| "ClassFieldName","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", |
| "WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint", |
| "SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement", |
| "ComponentIdList","optMarker","Marker","UniverationDefinition","UniverationList", |
| "UniverationElement","SignedNumber","optTag","Tag","TagTypeValue","TagClass", |
| "TagPlicit","TypeRefName","ObjectClassReference","optIdentifier","Identifier", NULL |
| }; |
| #endif |
| |
| static const short yyr1[] = { 0, |
| 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, |
| 124, 124, 124, 125, 125, 126, 126, 127, 127, 127, |
| 127, 127, 128, 128, 129, 129, 130, 130, 130, 130, |
| 130, 131, 130, 130, 132, 132, 133, 133, 134, 134, |
| 135, 136, 136, 137, 137, 137, 138, 138, 138, 139, |
| 139, 140, 140, 140, 142, 141, 143, 143, 144, 144, |
| 144, 145, 145, 146, 146, 146, 146, 147, 147, 148, |
| 148, 149, 149, 150, 150, 151, 151, 151, 151, 152, |
| 152, 153, 153, 153, 154, 155, 155, 156, 156, 157, |
| 157, 157, 157, 157, 157, 157, 158, 158, 160, 159, |
| 161, 161, 162, 162, 163, 163, 163, 164, 165, 166, |
| 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, |
| 167, 168, 168, 168, 168, 168, 168, 169, 169, 170, |
| 171, 172, 172, 173, 173, 173, 174, 175, 176, 177, |
| 176, 176, 176, 176, 176, 176, 176, 176, 176, 178, |
| 178, 179, 179, 179, 180, 180, 181, 181, 181, 181, |
| 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, |
| 182, 182, 183, 183, 184, 184, 184, 184, 184, 184, |
| 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, |
| 186, 186, 187, 188, 188, 189, 189, 190, 190, 191, |
| 191, 191, 192, 192, 192, 192, 192, 193, 193, 193, |
| 193, 193, 193, 193, 193, 193, 193, 194, 193, 195, |
| 195, 195, 195, 196, 196, 197, 197, 197, 197, 197, |
| 198, 199, 199, 200, 200, 201, 201, 202, 202, 203, |
| 203, 203, 204, 204, 205, 206, 207, 207, 208, 208, |
| 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, |
| 214, 214, 214, 214, 214, 215, 215, 216, 216, 217, |
| 218, 219, 219, 219, 219, 220, 220, 220, 221, 221, |
| 222, 223, 223, 224 |
| }; |
| |
| static const short yyr2[] = { 0, |
| 1, 1, 2, 8, 0, 1, 3, 2, 1, 2, |
| 1, 4, 1, 0, 1, 1, 2, 2, 2, 2, |
| 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, 3, 3, 0, 2, |
| 1, 4, 4, 4, 6, 6, 1, 4, 4, 1, |
| 3, 1, 3, 3, 3, 1, 3, 1, 3, 1, |
| 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, 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 |
| }; |
| |
| static const short yydefact[] = { 0, |
| 279, 280, 1, 2, 5, 3, 0, 0, 6, 284, |
| 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, 175, 0, 0, |
| 176, 177, 178, 0, 179, 180, 188, 181, 182, 183, |
| 184, 185, 186, 187, 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, 268, 122, 281, 0, 157, 0, 0, 171, 164, |
| 168, 170, 158, 0, 0, 159, 163, 167, 0, 0, |
| 57, 58, 160, 169, 126, 0, 33, 48, 47, 0, |
| 0, 35, 38, 0, 0, 0, 0, 272, 60, 59, |
| 109, 269, 276, 0, 172, 166, 165, 162, 161, 0, |
| 62, 0, 64, 0, 0, 0, 51, 53, 39, 43, |
| 45, 0, 274, 275, 273, 0, 0, 194, 278, 277, |
| 270, 123, 125, 0, 0, 0, 0, 55, 132, 133, |
| 127, 128, 130, 124, 145, 152, 146, 266, 153, 154, |
| 267, 143, 142, 144, 140, 138, 149, 147, 148, 0, |
| 150, 40, 41, 268, 268, 0, 88, 0, 122, 281, |
| 117, 0, 0, 194, 194, 110, 120, 173, 160, 111, |
| 0, 0, 0, 108, 195, 196, 268, 63, 67, 66, |
| 65, 0, 0, 0, 0, 0, 137, 134, 0, 255, |
| 253, 253, 253, 90, 254, 86, 253, 253, 97, 0, |
| 271, 0, 268, 0, 268, 0, 268, 0, 0, 174, |
| 268, 0, 0, 0, 226, 225, 0, 224, 227, 0, |
| 0, 0, 229, 0, 200, 203, 0, 210, 211, 217, |
| 216, 243, 244, 228, 231, 230, 0, 61, 155, 56, |
| 129, 141, 151, 139, 256, 95, 0, 94, 96, 87, |
| 253, 92, 93, 0, 85, 98, 89, 0, 105, 0, |
| 80, 83, 84, 268, 121, 0, 0, 73, 74, 79, |
| 253, 268, 282, 0, 282, 265, 257, 0, 259, 264, |
| 261, 0, 68, 70, 71, 0, 0, 0, 220, 0, |
| 0, 0, 0, 0, 0, 198, 191, 192, 189, 190, |
| 0, 0, 0, 193, 0, 0, 0, 0, 0, 156, |
| 135, 136, 91, 0, 118, 0, 112, 268, 82, 268, |
| 113, 268, 77, 253, 268, 283, 114, 268, 258, 0, |
| 0, 119, 268, 197, 204, 218, 221, 222, 215, 213, |
| 232, 0, 245, 209, 201, 205, 206, 207, 0, 214, |
| 212, 0, 0, 247, 199, 99, 106, 107, 150, 81, |
| 78, 75, 76, 109, 109, 260, 0, 0, 69, 0, |
| 223, 236, 0, 234, 194, 0, 208, 0, 249, 251, |
| 246, 0, 0, 115, 116, 263, 262, 219, 233, 0, |
| 238, 202, 250, 0, 248, 103, 0, 101, 104, 131, |
| 235, 241, 242, 240, 237, 239, 252, 100, 102, 0, |
| 0, 0 |
| }; |
| |
| static const short yydefgoto[] = { 440, |
| 3, 4, 8, 9, 13, 14, 25, 26, 27, 55, |
| 56, 57, 107, 58, 74, 183, 75, 76, 77, 59, |
| 69, 70, 60, 212, 100, 61, 130, 131, 312, 313, |
| 297, 298, 299, 290, 291, 119, 281, 186, 187, 285, |
| 286, 413, 427, 428, 300, 301, 147, 148, 196, 101, |
| 161, 162, 429, 163, 222, 223, 62, 176, 214, 177, |
| 253, 270, 102, 103, 200, 104, 332, 333, 335, 204, |
| 205, 206, 254, 255, 256, 400, 321, 257, 258, 259, |
| 260, 403, 404, 435, 436, 261, 262, 263, 383, 384, |
| 409, 224, 225, 240, 308, 309, 264, 121, 122, 123, |
| 146, 151, 265, 105, 355, 266 |
| }; |
| |
| static const short yypact[] = { 258, |
| -32768,-32768, 258,-32768, -19,-32768, 51, 103,-32768,-32768, |
| -32768,-32768, 69,-32768, 39, 87,-32768,-32768, 143, 114, |
| 73, 105, 212, 183, 277, 87,-32768, 174,-32768,-32768, |
| -32768,-32768,-32768, 262,-32768,-32768, 429,-32768, 279, 42, |
| -32768,-32768,-32768, 211,-32768,-32768,-32768,-32768,-32768,-32768, |
| -32768,-32768,-32768,-32768, 254, 429,-32768,-32768,-32768,-32768, |
| -32768,-32768,-32768, 354, 581,-32768, 188,-32768, 167,-32768, |
| 213,-32768,-32768, 38,-32768, -28,-32768, 219,-32768,-32768, |
| -32768, -9, 216,-32768, 251,-32768, 252, 264,-32768,-32768, |
| -32768,-32768,-32768, 289, 260,-32768,-32768,-32768, 656, 341, |
| -32768,-32768,-32768,-32768, 233, 345,-32768,-32768,-32768, 247, |
| 243,-32768,-32768, 258, 247, 244, 246, 4,-32768,-32768, |
| -32768,-32768, 59, 247,-32768,-32768,-32768,-32768,-32768, -22, |
| -32768, 241, 248, 250, 301, 158,-32768,-32768, -19,-32768, |
| -32768, 276,-32768,-32768,-32768, 349, 506, -54,-32768,-32768, |
| -32768,-32768,-32768, 357, 656, 353, 247,-32768,-32768,-32768, |
| 256,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 257, |
| 253,-32768,-32768, 28, 12, 97,-32768, 255, -73, 266, |
| 326, 268, 304, 106, 122,-32768,-32768,-32768, 271,-32768, |
| 272, 274, 168,-32768,-32768, 280, 267,-32768,-32768,-32768, |
| -32768, 380, 290, 380, 353, 158,-32768,-32768, 158,-32768, |
| 62, 27, 62,-32768,-32768, 296, 27, 62, 288, 276, |
| -32768, 361, 8, 298, 15, 319, 15, 320, 56,-32768, |
| 7, 168, 293, 366,-32768,-32768, 135,-32768,-32768, 299, |
| 258, 168,-32768, 286, 200, 297, 291, 135,-32768,-32768, |
| -32768, 292,-32768,-32768,-32768,-32768, 168,-32768,-32768, 395, |
| -32768, 395,-32768,-32768,-32768,-32768, 311,-32768,-32768,-32768, |
| 62,-32768,-32768, 318,-32768,-32768,-32768, 353, 300, 100, |
| -32768,-32768,-32768, 267,-32768, 337, 302, 306,-32768,-32768, |
| 62, 267, 353, 303, 353,-32768,-32768, 141,-32768,-32768, |
| 317, 147,-32768,-32768,-32768, 310, 231, 305, 312, 308, |
| 186, 321, 322, 323, 327,-32768,-32768,-32768,-32768,-32768, |
| 330, 231, 231,-32768, 231, 168, 278, 316, 328,-32768, |
| -32768,-32768,-32768, 333,-32768, 295,-32768, 8,-32768, 267, |
| -32768, 2,-32768, 62, 267,-32768,-32768, 267,-32768, 81, |
| 295,-32768, 7,-32768,-32768,-32768,-32768, 331,-32768,-32768, |
| 280, 31,-32768,-32768, 315,-32768,-32768,-32768, 332,-32768, |
| -32768, 9, 148,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| -32768,-32768,-32768,-32768,-32768,-32768, 336, 343,-32768, 380, |
| -32768,-32768, 156,-32768, -54, 168,-32768, 353, 339,-32768, |
| -32768, 316, 139,-32768,-32768,-32768,-32768, 395,-32768, 31, |
| 5, 221, 339, 353,-32768,-32768, 20,-32768,-32768,-32768, |
| -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 453, |
| 455,-32768 |
| }; |
| |
| static const short yypgoto[] = {-32768, |
| -32768, 454,-32768, 324,-32768, 443,-32768,-32768, 432,-32768, |
| -32768, 404,-32768,-32768,-32768,-32768, 387,-32768, 347,-32768, |
| -32768, 355,-32768,-32768, 399,-32768,-32768, 313,-32768, 104, |
| 229,-32768, 118,-32768, 123,-32768,-32768,-32768, 242,-32768, |
| -32768,-32768,-32768, 47, -228, -80,-32768, -62,-32768, -138, |
| -32768, 263,-32768, -344, 307, 309,-32768, -145,-32768, -317, |
| -26, -211, -68, 335,-32768, 29,-32768,-32768,-32768, -187, |
| -32768, 153, -194, 71, -133,-32768, 220,-32768, -267,-32768, |
| -32768,-32768, 63,-32768,-32768,-32768,-32768,-32768,-32768, 72, |
| 78, -209,-32768,-32768,-32768, 127, -125, -172,-32768,-32768, |
| -32768,-32768, 1,-32768, 184, -7 |
| }; |
| |
| |
| #define YYLAST 752 |
| |
| |
| static const short yytable[] = { 15, |
| 5, 120, 272, 5, 292, 15, 236, 238, 197, 10, |
| 179, 276, 278, 279, 10, 10, 10, 282, 283, 114, |
| 117, 432, 10, 426, 143, 217, 218, 202, 387, 65, |
| 132, -279, 72, 296, 159, 160, 79, 64, 10, 124, |
| 71, 217, 218, 397, 78, 10, 296, 316, 65, 10, |
| 1, 2, 203, 370, 1, 2, 64, 325, 10, 11, |
| 67, 219, 219, 10, 168, 63, 79, 171, 430, 381, |
| 274, 343, 339, 275, 78, 433, 10, 11, 198, 434, |
| 144, 115, 430, 154, 63, 7, 132, 155, 10, 168, |
| 179, 353, 171, 179, 145, 295, 219, 220, 220, 133, |
| 20, 149, 72, 221, 226, 289, 118, 79, 21, 178, |
| 71, 289, 150, 310, 139, 78, 153, 118, 289, 292, |
| -72, 408, 118, 118, 152, 438, 268, 118, 181, 22, |
| 118, 23, 220, -253, 402, 164, 180, -253, 16, 277, |
| 24, 379, 426, 118, 393, 19, 112, 201, 209, 211, |
| 68, 28, 293, 159, 160, 133, 12, 210, 30, 306, |
| 314, 307, 165, 166, 167, 10, 168, 169, 170, 171, |
| 1, 2, 29, 166, 17, 10, 168, 169, 170, 171, |
| 1, 2, 394, 365, 306, 395, 243, 202, 418, 178, |
| 31, 166, 178, 10, 168, 169, 170, 171, 376, 377, |
| 244, 378, 229, 202, 172, 347, 230, 273, 181, 348, |
| 235, 181, 203, 349, 245, 246, 180, 421, 10, 180, |
| 388, 354, 173, 1, 2, 294, 237, 302, 203, 302, |
| 247, 311, 245, 315, 310, 398, 166, 319, 10, 168, |
| 169, 170, 171, 1, 2, 174, 359, 369, 320, 248, |
| 360, 324, 362, 411, 10, 249, 363, 412, 73, 1, |
| 2, 419, 175, 244, 250, 420, 32, 293, 33, 391, |
| 1, 2, 251, 249, 252, 109, 110, 245, 246, 34, |
| 345, 36, 314, 166, 37, 10, 168, 169, 170, 171, |
| 184, 185, 66, 247, 80, 356, 108, 356, 327, 328, |
| 329, 330, 10, 168, 159, 160, 171, 1, 2, 331, |
| 83, 84, 248, 1, 2, 159, 160, 111, 249, 327, |
| 328, 329, 330, 116, 245, 341, 342, 250, 124, 322, |
| 323, 414, 415, 125, 126, 251, 127, 252, 389, 380, |
| 294, 128, 129, 134, 302, 135, 180, 136, 138, 141, |
| 142, 156, 311, 389, 158, 315, 82, 188, 157, 207, |
| 10, 180, 232, 216, 405, 249, 83, 84, 213, 215, |
| -280, 231, 233, 234, 410, 239, 241, 85, 38, 86, |
| 242, 87, 118, 269, 284, 280, 267, 288, 303, 305, |
| 317, 88, 318, 326, 334, 89, 338, 336, 340, 90, |
| 410, 344, 91, 41, 42, 43, 350, 351, 357, 366, |
| 368, 346, 405, 92, 45, 352, 437, 364, 93, 46, |
| 94, 47, 95, 361, 406, 367, 372, 203, 373, 48, |
| 382, 96, 97, 375, 374, 385, 10, 386, 49, 407, |
| 50, 1, 2, 416, 401, 51, 98, 52, 53, 54, |
| 417, 424, 441, 38, 442, 18, 6, 35, 99, 81, |
| 113, 140, 182, 106, 137, 304, 399, 208, 39, 392, |
| 390, 287, 40, 439, 371, 271, 422, 337, 41, 42, |
| 43, 199, 431, 425, 44, 423, 396, 0, 358, 45, |
| 0, 227, 0, 228, 46, 0, 47, 0, 0, 0, |
| 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, |
| 0, 0, 0, 49, 0, 50, 0, 0, 189, 190, |
| 51, 0, 52, 53, 54, 191, 0, 0, 0, 85, |
| 38, 86, 0, 87, 192, 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, 193, 0, 92, 45, 0, 0, 0, |
| 93, 46, 94, 47, 95, 0, 0, 0, 0, 0, |
| 0, 48, 0, 96, 97, 194, 195, 0, 0, 0, |
| 49, 0, 50, 83, 84, 0, 0, 51, 98, 52, |
| 53, 54, 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, 1, 2, |
| 0, 0, 51, 98, 52, 53, 54, 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, 82, 214, 3, 233, 13, 194, 195, 147, 8, |
| 136, 221, 222, 223, 8, 8, 8, 227, 228, 48, |
| 30, 17, 8, 4, 21, 14, 15, 82, 346, 37, |
| 99, 105, 40, 32, 15, 16, 44, 37, 8, 113, |
| 40, 14, 15, 361, 44, 8, 32, 242, 56, 8, |
| 13, 14, 107, 321, 13, 14, 56, 252, 8, 9, |
| 19, 35, 35, 8, 9, 37, 74, 12, 413, 337, |
| 216, 281, 267, 219, 74, 71, 8, 9, 147, 75, |
| 77, 110, 427, 106, 56, 105, 155, 110, 8, 9, |
| 216, 301, 12, 219, 91, 234, 35, 71, 71, 99, |
| 14, 43, 110, 184, 185, 104, 116, 115, 22, 136, |
| 110, 104, 54, 239, 114, 115, 124, 116, 104, 348, |
| 106, 113, 116, 116, 124, 106, 207, 116, 136, 43, |
| 116, 45, 71, 106, 104, 135, 136, 110, 36, 113, |
| 54, 336, 4, 116, 354, 107, 109, 147, 156, 157, |
| 109, 9, 233, 15, 16, 155, 106, 157, 86, 104, |
| 241, 106, 5, 6, 7, 8, 9, 10, 11, 12, |
| 13, 14, 59, 6, 106, 8, 9, 10, 11, 12, |
| 13, 14, 355, 317, 104, 358, 19, 82, 400, 216, |
| 86, 6, 219, 8, 9, 10, 11, 12, 332, 333, |
| 33, 335, 106, 82, 47, 106, 110, 215, 216, 110, |
| 105, 219, 107, 294, 47, 48, 216, 405, 8, 219, |
| 346, 302, 65, 13, 14, 233, 105, 235, 107, 237, |
| 63, 239, 47, 241, 360, 361, 6, 103, 8, 9, |
| 10, 11, 12, 13, 14, 88, 106, 62, 114, 82, |
| 110, 251, 106, 106, 8, 88, 110, 110, 48, 13, |
| 14, 106, 105, 33, 97, 110, 55, 348, 86, 350, |
| 13, 14, 105, 88, 107, 109, 110, 47, 48, 3, |
| 288, 108, 363, 6, 23, 8, 9, 10, 11, 12, |
| 15, 16, 14, 63, 41, 303, 109, 305, 99, 100, |
| 101, 102, 8, 9, 15, 16, 12, 13, 14, 110, |
| 13, 14, 82, 13, 14, 15, 16, 105, 88, 99, |
| 100, 101, 102, 105, 47, 15, 16, 97, 113, 31, |
| 32, 394, 395, 83, 83, 105, 73, 107, 346, 62, |
| 348, 53, 83, 3, 352, 113, 346, 3, 106, 106, |
| 105, 111, 360, 361, 105, 363, 3, 9, 111, 3, |
| 8, 361, 37, 111, 372, 88, 13, 14, 113, 113, |
| 105, 117, 105, 70, 382, 105, 105, 24, 25, 26, |
| 107, 28, 116, 4, 97, 90, 107, 27, 70, 70, |
| 98, 38, 27, 108, 98, 42, 105, 107, 4, 46, |
| 408, 84, 49, 50, 51, 52, 70, 106, 106, 105, |
| 103, 112, 420, 60, 61, 110, 424, 108, 65, 66, |
| 67, 68, 69, 107, 110, 114, 105, 107, 106, 76, |
| 115, 78, 79, 104, 108, 108, 8, 105, 85, 108, |
| 87, 13, 14, 108, 114, 92, 93, 94, 95, 96, |
| 108, 113, 0, 25, 0, 13, 3, 26, 105, 56, |
| 74, 115, 139, 65, 110, 237, 363, 155, 40, 352, |
| 348, 230, 44, 427, 322, 213, 406, 258, 50, 51, |
| 52, 147, 420, 412, 56, 408, 360, -1, 305, 61, |
| -1, 185, -1, 185, 66, -1, 68, -1, -1, -1, |
| -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, |
| -1, -1, -1, 85, -1, 87, -1, -1, 13, 14, |
| 92, -1, 94, 95, 96, 20, -1, -1, -1, 24, |
| 25, 26, -1, 28, 29, -1, -1, -1, -1, -1, |
| -1, -1, -1, 38, -1, -1, -1, 42, -1, -1, |
| -1, 46, -1, -1, 49, 50, 51, 52, -1, -1, |
| -1, -1, -1, 58, -1, 60, 61, -1, -1, -1, |
| 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, |
| -1, 76, -1, 78, 79, 80, 81, -1, -1, -1, |
| 85, -1, 87, 13, 14, -1, -1, 92, 93, 94, |
| 95, 96, -1, -1, 24, 25, 26, -1, 28, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, |
| -1, -1, 42, -1, -1, -1, 46, -1, -1, 49, |
| 50, 51, 52, -1, -1, -1, -1, -1, -1, -1, |
| 60, 61, -1, -1, -1, 65, 66, 67, 68, 69, |
| -1, -1, -1, -1, -1, -1, 76, -1, 78, 79, |
| -1, -1, -1, -1, -1, 85, -1, 87, 13, 14, |
| -1, -1, 92, 93, 94, 95, 96, -1, -1, 24, |
| 25, 26, -1, 28, -1, -1, -1, -1, -1, -1, |
| -1, -1, -1, 38, -1, -1, -1, 42, -1, -1, |
| -1, 46, -1, -1, 49, 50, 51, 52, -1, -1, |
| -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, |
| 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, |
| -1, 76, -1, 78, 79, -1, -1, -1, -1, -1, |
| 85, -1, 87, -1, -1, -1, -1, 92, 93, 94, |
| 95, 96 |
| }; |
| /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
| #line 3 "/usr/share/bison.simple" |
| /* This file comes from bison-1.28. */ |
| |
| /* Skeleton output parser for bison, |
| Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. |
| |
| This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by |
| the Free Software Foundation; either version 2, or (at your option) |
| any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with this program; if not, write to the Free Software |
| Foundation, Inc., 59 Temple Place - Suite 330, |
| Boston, MA 02111-1307, USA. */ |
| |
| /* As a special exception, when this file is copied by Bison into a |
| Bison output file, you may use that output file without restriction. |
| This special exception was added by the Free Software Foundation |
| in version 1.24 of Bison. */ |
| |
| /* This is the parser code that is written into each bison parser |
| when the %semantic_parser declaration is not specified in the grammar. |
| It was written by Richard Stallman by simplifying the hairy parser |
| used when %semantic_parser is specified. */ |
| |
| #ifndef YYSTACK_USE_ALLOCA |
| #ifdef alloca |
| #define YYSTACK_USE_ALLOCA |
| #else /* alloca not defined */ |
| #ifdef __GNUC__ |
| #define YYSTACK_USE_ALLOCA |
| #define alloca __builtin_alloca |
| #else /* not GNU C. */ |
| #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) |
| #define YYSTACK_USE_ALLOCA |
| #include <alloca.h> |
| #else /* not sparc */ |
| /* We think this test detects Watcom and Microsoft C. */ |
| /* This used to test MSDOS, but that is a bad idea |
| since that symbol is in the user namespace. */ |
| #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) |
| #if 0 /* No need for malloc.h, which pollutes the namespace; |
| instead, just don't use alloca. */ |
| #include <malloc.h> |
| #endif |
| #else /* not MSDOS, or __TURBOC__ */ |
| #if defined(_AIX) |
| /* I don't know what this was needed for, but it pollutes the namespace. |
| So I turned it off. rms, 2 May 1997. */ |
| /* #include <malloc.h> */ |
| #pragma alloca |
| #define YYSTACK_USE_ALLOCA |
| #else /* not MSDOS, or __TURBOC__, or _AIX */ |
| #if 0 |
| #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, |
| and on HPUX 10. Eventually we can turn this on. */ |
| #define YYSTACK_USE_ALLOCA |
| #define alloca __builtin_alloca |
| #endif /* __hpux */ |
| #endif |
| #endif /* not _AIX */ |
| #endif /* not MSDOS, or __TURBOC__ */ |
| #endif /* not sparc */ |
| #endif /* not GNU C */ |
| #endif /* alloca not defined */ |
| #endif /* YYSTACK_USE_ALLOCA not defined */ |
| |
| #ifdef YYSTACK_USE_ALLOCA |
| #define YYSTACK_ALLOC alloca |
| #else |
| #define YYSTACK_ALLOC malloc |
| #endif |
| |
| /* Note: there must be only one dollar sign in this file. |
| It is replaced by the list of actions, each action |
| as one case of the switch. */ |
| |
| #define yyerrok (yyerrstatus = 0) |
| #define yyclearin (yychar = YYEMPTY) |
| #define YYEMPTY -2 |
| #define YYEOF 0 |
| #define YYACCEPT goto yyacceptlab |
| #define YYABORT goto yyabortlab |
| #define YYERROR goto yyerrlab1 |
| /* Like YYERROR except do call yyerror. |
| This remains here temporarily to ease the |
| transition to the new meaning of YYERROR, for GCC. |
| Once GCC version 2 has supplanted version 1, this can go. */ |
| #define YYFAIL goto yyerrlab |
| #define YYRECOVERING() (!!yyerrstatus) |
| #define YYBACKUP(token, value) \ |
| do \ |
| if (yychar == YYEMPTY && yylen == 1) \ |
| { yychar = (token), yylval = (value); \ |
| yychar1 = YYTRANSLATE (yychar); \ |
| YYPOPSTACK; \ |
| goto yybackup; \ |
| } \ |
| else \ |
| { yyerror ("syntax error: cannot back up"); YYERROR; } \ |
| while (0) |
| |
| #define YYTERROR 1 |
| #define YYERRCODE 256 |
| |
| #ifndef YYPURE |
| #define YYLEX yylex() |
| #endif |
| |
| #ifdef YYPURE |
| #ifdef YYLSP_NEEDED |
| #ifdef YYLEX_PARAM |
| #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) |
| #else |
| #define YYLEX yylex(&yylval, &yylloc) |
| #endif |
| #else /* not YYLSP_NEEDED */ |
| #ifdef YYLEX_PARAM |
| #define YYLEX yylex(&yylval, YYLEX_PARAM) |
| #else |
| #define YYLEX yylex(&yylval) |
| #endif |
| #endif /* not YYLSP_NEEDED */ |
| #endif |
| |
| /* If nonreentrant, generate the variables here */ |
| |
| #ifndef YYPURE |
| |
| int yychar; /* the lookahead symbol */ |
| YYSTYPE yylval; /* the semantic value of the */ |
| /* lookahead symbol */ |
| |
| #ifdef YYLSP_NEEDED |
| YYLTYPE yylloc; /* location data for the lookahead */ |
| /* symbol */ |
| #endif |
| |
| int yynerrs; /* number of parse errors so far */ |
| #endif /* not YYPURE */ |
| |
| #if YYDEBUG != 0 |
| int yydebug; /* nonzero means print parse trace */ |
| /* Since this is uninitialized, it does not stop multiple parsers |
| from coexisting. */ |
| #endif |
| |
| /* YYINITDEPTH indicates the initial size of the parser's stacks */ |
| |
| #ifndef YYINITDEPTH |
| #define YYINITDEPTH 200 |
| #endif |
| |
| /* YYMAXDEPTH is the maximum size the stacks can grow to |
| (effective only if the built-in stack extension method is used). */ |
| |
| #if YYMAXDEPTH == 0 |
| #undef YYMAXDEPTH |
| #endif |
| |
| #ifndef YYMAXDEPTH |
| #define YYMAXDEPTH 10000 |
| #endif |
| |
| /* Define __yy_memcpy. Note that the size argument |
| should be passed with type unsigned int, because that is what the non-GCC |
| definitions require. With GCC, __builtin_memcpy takes an arg |
| of type size_t, but it can handle unsigned int. */ |
| |
| #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ |
| #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) |
| #else /* not GNU C or C++ */ |
| #ifndef __cplusplus |
| |
| /* This is the most reliable way to avoid incompatibilities |
| in available built-in functions on various systems. */ |
| static void |
| __yy_memcpy (to, from, count) |
| char *to; |
| char *from; |
| unsigned int count; |
| { |
| register char *f = from; |
| register char *t = to; |
| register int i = count; |
| |
| while (i-- > 0) |
| *t++ = *f++; |
| } |
| |
| #else /* __cplusplus */ |
| |
| /* This is the most reliable way to avoid incompatibilities |
| in available built-in functions on various systems. */ |
| static void |
| __yy_memcpy (char *to, char *from, unsigned int count) |
| { |
| register char *t = to; |
| register char *f = from; |
| register int i = count; |
| |
| while (i-- > 0) |
| *t++ = *f++; |
| } |
| |
| #endif |
| #endif |
| |
| #line 217 "/usr/share/bison.simple" |
| |
| /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
| into yyparse. The argument should have type void *. |
| It should actually point to an object. |
| Grammar actions can access the variable by casting it |
| to the proper pointer type. */ |
| |
| #ifdef YYPARSE_PARAM |
| #ifdef __cplusplus |
| #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
| #define YYPARSE_PARAM_DECL |
| #else /* not __cplusplus */ |
| #define YYPARSE_PARAM_ARG YYPARSE_PARAM |
| #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
| #endif /* not __cplusplus */ |
| #else /* not YYPARSE_PARAM */ |
| #define YYPARSE_PARAM_ARG |
| #define YYPARSE_PARAM_DECL |
| #endif /* not YYPARSE_PARAM */ |
| |
| /* Prevent warning if -Wstrict-prototypes. */ |
| #ifdef __GNUC__ |
| #ifdef YYPARSE_PARAM |
| int yyparse (void *); |
| #else |
| int yyparse (void); |
| #endif |
| #endif |
| |
| int |
| yyparse(YYPARSE_PARAM_ARG) |
| YYPARSE_PARAM_DECL |
| { |
| register int yystate; |
| register int yyn; |
| register short *yyssp; |
| register YYSTYPE *yyvsp; |
| int yyerrstatus; /* number of tokens to shift before error messages enabled */ |
| int yychar1 = 0; /* lookahead token as an internal (translated) token number */ |
| |
| short yyssa[YYINITDEPTH]; /* the state stack */ |
| YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ |
| |
| short *yyss = yyssa; /* refer to the stacks thru separate pointers */ |
| YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ |
| |
| #ifdef YYLSP_NEEDED |
| YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ |
| YYLTYPE *yyls = yylsa; |
| YYLTYPE *yylsp; |
| |
| #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
| #else |
| #define YYPOPSTACK (yyvsp--, yyssp--) |
| #endif |
| |
| int yystacksize = YYINITDEPTH; |
| int yyfree_stacks = 0; |
| |
| #ifdef YYPURE |
| int yychar; |
| YYSTYPE yylval; |
| int yynerrs; |
| #ifdef YYLSP_NEEDED |
| YYLTYPE yylloc; |
| #endif |
| #endif |
| |
| YYSTYPE yyval; /* the variable used to return */ |
| /* semantic values from the action */ |
| /* routines */ |
| |
| int yylen; |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Starting parse\n"); |
| #endif |
| |
| yystate = 0; |
| yyerrstatus = 0; |
| yynerrs = 0; |
| yychar = YYEMPTY; /* Cause a token to be read. */ |
| |
| /* Initialize stack pointers. |
| Waste one element of value and location stack |
| so that they stay on the same level as the state stack. |
| The wasted elements are never initialized. */ |
| |
| yyssp = yyss - 1; |
| yyvsp = yyvs; |
| #ifdef YYLSP_NEEDED |
| yylsp = yyls; |
| #endif |
| |
| /* Push a new state, which is found in yystate . */ |
| /* In all cases, when you get here, the value and location stacks |
| have just been pushed. so pushing a state here evens the stacks. */ |
| yynewstate: |
| |
| *++yyssp = yystate; |
| |
| if (yyssp >= yyss + yystacksize - 1) |
| { |
| /* Give user a chance to reallocate the stack */ |
| /* Use copies of these so that the &'s don't force the real ones into memory. */ |
| YYSTYPE *yyvs1 = yyvs; |
| short *yyss1 = yyss; |
| #ifdef YYLSP_NEEDED |
| YYLTYPE *yyls1 = yyls; |
| #endif |
| |
| /* Get the current used size of the three stacks, in elements. */ |
| int size = yyssp - yyss + 1; |
| |
| #ifdef yyoverflow |
| /* Each stack pointer address is followed by the size of |
| the data in use in that stack, in bytes. */ |
| #ifdef YYLSP_NEEDED |
| /* This used to be a conditional around just the two extra args, |
| but that might be undefined if yyoverflow is a macro. */ |
| yyoverflow("parser stack overflow", |
| &yyss1, size * sizeof (*yyssp), |
| &yyvs1, size * sizeof (*yyvsp), |
| &yyls1, size * sizeof (*yylsp), |
| &yystacksize); |
| #else |
| yyoverflow("parser stack overflow", |
| &yyss1, size * sizeof (*yyssp), |
| &yyvs1, size * sizeof (*yyvsp), |
| &yystacksize); |
| #endif |
| |
| yyss = yyss1; yyvs = yyvs1; |
| #ifdef YYLSP_NEEDED |
| yyls = yyls1; |
| #endif |
| #else /* no yyoverflow */ |
| /* Extend the stack our own way. */ |
| if (yystacksize >= YYMAXDEPTH) |
| { |
| yyerror("parser stack overflow"); |
| if (yyfree_stacks) |
| { |
| free (yyss); |
| free (yyvs); |
| #ifdef YYLSP_NEEDED |
| free (yyls); |
| #endif |
| } |
| return 2; |
| } |
| yystacksize *= 2; |
| if (yystacksize > YYMAXDEPTH) |
| yystacksize = YYMAXDEPTH; |
| #ifndef YYSTACK_USE_ALLOCA |
| yyfree_stacks = 1; |
| #endif |
| yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); |
| __yy_memcpy ((char *)yyss, (char *)yyss1, |
| size * (unsigned int) sizeof (*yyssp)); |
| yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); |
| __yy_memcpy ((char *)yyvs, (char *)yyvs1, |
| size * (unsigned int) sizeof (*yyvsp)); |
| #ifdef YYLSP_NEEDED |
| yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); |
| __yy_memcpy ((char *)yyls, (char *)yyls1, |
| size * (unsigned int) sizeof (*yylsp)); |
| #endif |
| #endif /* no yyoverflow */ |
| |
| yyssp = yyss + size - 1; |
| yyvsp = yyvs + size - 1; |
| #ifdef YYLSP_NEEDED |
| yylsp = yyls + size - 1; |
| #endif |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Stack size increased to %d\n", yystacksize); |
| #endif |
| |
| if (yyssp >= yyss + yystacksize - 1) |
| YYABORT; |
| } |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Entering state %d\n", yystate); |
| #endif |
| |
| goto yybackup; |
| yybackup: |
| |
| /* Do appropriate processing given the current state. */ |
| /* Read a lookahead token if we need one and don't already have one. */ |
| /* yyresume: */ |
| |
| /* First try to decide what to do without reference to lookahead token. */ |
| |
| yyn = yypact[yystate]; |
| if (yyn == YYFLAG) |
| goto yydefault; |
| |
| /* Not known => get a lookahead token if don't already have one. */ |
| |
| /* yychar is either YYEMPTY or YYEOF |
| or a valid token in external form. */ |
| |
| if (yychar == YYEMPTY) |
| { |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Reading a token: "); |
| #endif |
| yychar = YYLEX; |
| } |
| |
| /* Convert token to internal form (in yychar1) for indexing tables with */ |
| |
| if (yychar <= 0) /* This means end of input. */ |
| { |
| yychar1 = 0; |
| yychar = YYEOF; /* Don't call YYLEX any more */ |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Now at end of input.\n"); |
| #endif |
| } |
| else |
| { |
| yychar1 = YYTRANSLATE(yychar); |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| { |
| fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); |
| /* Give the individual parser a way to print the precise meaning |
| of a token, for further debugging info. */ |
| #ifdef YYPRINT |
| YYPRINT (stderr, yychar, yylval); |
| #endif |
| fprintf (stderr, ")\n"); |
| } |
| #endif |
| } |
| |
| yyn += yychar1; |
| if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) |
| goto yydefault; |
| |
| yyn = yytable[yyn]; |
| |
| /* yyn is what to do for this token type in this state. |
| Negative => reduce, -yyn is rule number. |
| Positive => shift, yyn is new state. |
| New state is final state => don't bother to shift, |
| just return success. |
| 0, or most negative number => error. */ |
| |
| if (yyn < 0) |
| { |
| if (yyn == YYFLAG) |
| goto yyerrlab; |
| yyn = -yyn; |
| goto yyreduce; |
| } |
| else if (yyn == 0) |
| goto yyerrlab; |
| |
| if (yyn == YYFINAL) |
| YYACCEPT; |
| |
| /* Shift the lookahead token. */ |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); |
| #endif |
| |
| /* Discard the token being shifted unless it is eof. */ |
| if (yychar != YYEOF) |
| yychar = YYEMPTY; |
| |
| *++yyvsp = yylval; |
| #ifdef YYLSP_NEEDED |
| *++yylsp = yylloc; |
| #endif |
| |
| /* count tokens shifted since error; after three, turn off error status. */ |
| if (yyerrstatus) yyerrstatus--; |
| |
| yystate = yyn; |
| goto yynewstate; |
| |
| /* Do the default action for the current state. */ |
| yydefault: |
| |
| yyn = yydefact[yystate]; |
| if (yyn == 0) |
| goto yyerrlab; |
| |
| /* Do a reduction. yyn is the number of a rule to reduce with. */ |
| yyreduce: |
| yylen = yyr2[yyn]; |
| if (yylen > 0) |
| yyval = yyvsp[1-yylen]; /* implement default value of the action */ |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| { |
| int i; |
| |
| fprintf (stderr, "Reducing via rule %d (line %d), ", |
| yyn, yyrline[yyn]); |
| |
| /* Print the symbols being reduced, and their result. */ |
| for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) |
| fprintf (stderr, "%s ", yytname[yyrhs[i]]); |
| fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
| } |
| #endif |
| |
| |
| switch (yyn) { |
| |
| case 1: |
| #line 323 "asn1p_y.y" |
| { |
| *(void **)param = yyvsp[0].a_grammar; |
| ; |
| break;} |
| case 2: |
| #line 329 "asn1p_y.y" |
| { |
| yyval.a_grammar = asn1p_new(); |
| checkmem(yyval.a_grammar); |
| TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); |
| ; |
| break;} |
| case 3: |
| #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 355 "asn1p_y.y" |
| { |
| |
| if(yyvsp[-1].a_module) { |
| yyval.a_module = yyvsp[-1].a_module; |
| } else { |
| /* There's a chance that a module is just plain empty */ |
| yyval.a_module = asn1p_module_new(); |
| } |
| checkmem(yyval.a_module); |
| |
| yyval.a_module->ModuleName = yyvsp[-7].tv_str; |
| yyval.a_module->module_oid = yyvsp[-6].a_oid; |
| yyval.a_module->module_flags = yyvsp[-4].a_module_flags; |
| ; |
| break;} |
| case 5: |
| #line 376 "asn1p_y.y" |
| { yyval.a_oid = 0; ; |
| break;} |
| case 6: |
| #line 377 "asn1p_y.y" |
| { yyval.a_oid = yyvsp[0].a_oid; ; |
| break;} |
| case 7: |
| #line 381 "asn1p_y.y" |
| { |
| yyval.a_oid = yyvsp[-1].a_oid; |
| ; |
| break;} |
| case 8: |
| #line 384 "asn1p_y.y" |
| { |
| yyval.a_oid = 0; |
| ; |
| break;} |
| case 9: |
| #line 390 "asn1p_y.y" |
| { |
| yyval.a_oid = asn1p_oid_new(); |
| asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); |
| if(yyvsp[0].a_oid_arc.name) |
| free(yyvsp[0].a_oid_arc.name); |
| ; |
| break;} |
| case 10: |
| #line 396 "asn1p_y.y" |
| { |
| yyval.a_oid = yyvsp[-1].a_oid; |
| asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); |
| if(yyvsp[0].a_oid_arc.name) |
| free(yyvsp[0].a_oid_arc.name); |
| ; |
| break;} |
| case 11: |
| #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 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 413 "asn1p_y.y" |
| { /* 1 */ |
| yyval.a_oid_arc.name = 0; |
| yyval.a_oid_arc.number = yyvsp[0].a_int; |
| ; |
| break;} |
| case 14: |
| #line 423 "asn1p_y.y" |
| { yyval.a_module_flags = MSF_NOFLAGS; ; |
| break;} |
| case 15: |
| #line 424 "asn1p_y.y" |
| { |
| yyval.a_module_flags = yyvsp[0].a_module_flags; |
| ; |
| break;} |
| case 16: |
| #line 433 "asn1p_y.y" |
| { |
| yyval.a_module_flags = yyvsp[0].a_module_flags; |
| ; |
| break;} |
| case 17: |
| #line 436 "asn1p_y.y" |
| { |
| yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags; |
| ; |
| break;} |
| case 18: |
| #line 445 "asn1p_y.y" |
| { |
| yyval.a_module_flags = MSF_EXPLICIT_TAGS; |
| ; |
| break;} |
| case 19: |
| #line 448 "asn1p_y.y" |
| { |
| yyval.a_module_flags = MSF_IMPLICIT_TAGS; |
| ; |
| break;} |
| case 20: |
| #line 451 "asn1p_y.y" |
| { |
| yyval.a_module_flags = MSF_AUTOMATIC_TAGS; |
| ; |
| break;} |
| case 21: |
| #line 454 "asn1p_y.y" |
| { |
| yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED; |
| ; |
| break;} |
| case 22: |
| #line 458 "asn1p_y.y" |
| { |
| /* X.680Amd1 specifies TAG and XER */ |
| if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) { |
| yyval.a_module_flags = MSF_TAG_INSTRUCTIONS; |
| } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) { |
| yyval.a_module_flags = MSF_XER_INSTRUCTIONS; |
| } else { |
| fprintf(stderr, |
| "WARNING: %s INSTRUCTIONS at line %d: " |
| "Unrecognized encoding reference\n", |
| yyvsp[-1].tv_str, yylineno); |
| yyval.a_module_flags = MSF_unk_INSTRUCTIONS; |
| } |
| free(yyvsp[-1].tv_str); |
| ; |
| break;} |
| case 23: |
| #line 479 "asn1p_y.y" |
| { yyval.a_module = 0; ; |
| break;} |
| case 24: |
| #line 480 "asn1p_y.y" |
| { |
| yyval.a_module = yyvsp[0].a_module; |
| ; |
| break;} |
| case 25: |
| #line 489 "asn1p_y.y" |
| { |
| yyval.a_module = yyvsp[0].a_module; |
| ; |
| break;} |
| case 26: |
| #line 492 "asn1p_y.y" |
| { |
| yyval.a_module = yyvsp[-1].a_module; |
| |
| /* Behave well when one of them is skipped. */ |
| if(!(yyvsp[-1].a_module)) { |
| if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module; |
| break; |
| } |
| |
| #ifdef MY_IMPORT |
| #error MY_IMPORT DEFINED ELSEWHERE! |
| #endif |
| #define MY_IMPORT(foo,field) do { \ |
| while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \ |
| TQ_ADD(&(yyval.a_module->foo), \ |
| TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \ |
| field); \ |
| } \ |
| assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \ |
| } while(0) |
| |
| MY_IMPORT(imports, xp_next); |
| MY_IMPORT(exports, xp_next); |
| MY_IMPORT(members, next); |
| #undef MY_IMPORT |
| |
| ; |
| break;} |
| case 27: |
| #line 525 "asn1p_y.y" |
| { |
| yyval.a_module = yyvsp[0].a_module; |
| ; |
| break;} |
| case 28: |
| #line 528 "asn1p_y.y" |
| { |
| yyval.a_module = asn1p_module_new(); |
| checkmem(yyval.a_module); |
| if(yyvsp[0].a_xports) { |
| TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next); |
| } else { |
| /* "EXPORTS ALL;" ? */ |
| } |
| ; |
| break;} |
| case 29: |
| #line 537 "asn1p_y.y" |
| { |
| yyval.a_module = asn1p_module_new(); |
| checkmem(yyval.a_module); |
| assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
| ; |
| break;} |
| case 30: |
| #line 544 "asn1p_y.y" |
| { |
| yyval.a_module = asn1p_module_new(); |
| checkmem(yyval.a_module); |
| assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
| ; |
| break;} |
| case 31: |
| #line 557 "asn1p_y.y" |
| { |
| yyval.a_module = asn1p_module_new(); |
| checkmem(yyval.a_module); |
| assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
| ; |
| break;} |
| case 32: |
| #line 565 "asn1p_y.y" |
| { asn1p_lexer_hack_push_encoding_control(); ; |
| break;} |
| case 33: |
| #line 566 "asn1p_y.y" |
| { |
| fprintf(stderr, |
| "WARNING: ENCODING-CONTROL %s " |
| "specification at line %d ignored\n", |
| yyvsp[-1].tv_str, yylineno); |
| free(yyvsp[-1].tv_str); |
| yyval.a_module = 0; |
| ; |
| break;} |
| case 34: |
| #line 578 "asn1p_y.y" |
| { |
| return yyerror( |
| "Attempt to redefine a standard basic string type, " |
| "please comment out or remove this type redefinition."); |
| ; |
| break;} |
| case 35: |
| #line 591 "asn1p_y.y" |
| { |
| if(!saved_aid && 0) |
| return yyerror("Unterminated IMPORTS FROM, " |
| "expected semicolon ';'"); |
| saved_aid = 0; |
| yyval.a_module = yyvsp[-1].a_module; |
| ; |
| break;} |
| case 36: |
| #line 601 "asn1p_y.y" |
| { |
| return yyerror("Empty IMPORTS list"); |
| ; |
| break;} |
| case 37: |
| #line 607 "asn1p_y.y" |
| { |
| yyval.a_module = asn1p_module_new(); |
| checkmem(yyval.a_module); |
| TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); |
| ; |
| break;} |
| case 38: |
| #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 619 "asn1p_y.y" |
| { memset(&yyval.a_aid, 0, sizeof(yyval.a_aid)); ; |
| break;} |
| case 40: |
| #line 620 "asn1p_y.y" |
| { yyval.a_aid.oid = yyvsp[0].a_oid; ; |
| break;} |
| case 41: |
| #line 624 "asn1p_y.y" |
| { |
| yyval.a_xports = yyvsp[-3].a_xports; |
| yyval.a_xports->fromModuleName = yyvsp[-1].tv_str; |
| yyval.a_xports->identifier = yyvsp[0].a_aid; |
| /* This stupid thing is used for look-back hack. */ |
| saved_aid = yyval.a_xports->identifier.oid ? 0 : &(yyval.a_xports->identifier); |
| checkmem(yyval.a_xports); |
| ; |
| break;} |
| case 42: |
| #line 635 "asn1p_y.y" |
| { |
| yyval.a_xports = asn1p_xports_new(); |
| checkmem(yyval.a_xports); |
| TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
| ; |
| break;} |
| case 43: |
| #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 647 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| yyval.a_expr->expr_type = A1TC_REFERENCE; |
| ; |
| break;} |
| case 45: |
| #line 653 "asn1p_y.y" |
| { /* Completely equivalent to above */ |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->expr_type = A1TC_REFERENCE; |
| ; |
| break;} |
| case 46: |
| #line 659 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| yyval.a_expr->expr_type = A1TC_REFERENCE; |
| ; |
| break;} |
| case 47: |
| #line 668 "asn1p_y.y" |
| { |
| yyval.a_xports = yyvsp[-1].a_xports; |
| ; |
| break;} |
| case 48: |
| #line 671 "asn1p_y.y" |
| { |
| yyval.a_xports = 0; |
| ; |
| break;} |
| case 49: |
| #line 674 "asn1p_y.y" |
| { |
| /* Empty EXPORTS clause effectively prohibits export. */ |
| yyval.a_xports = asn1p_xports_new(); |
| checkmem(yyval.a_xports); |
| ; |
| break;} |
| case 50: |
| #line 682 "asn1p_y.y" |
| { |
| yyval.a_xports = asn1p_xports_new(); |
| assert(yyval.a_xports); |
| TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
| ; |
| break;} |
| case 51: |
| #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 694 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| yyval.a_expr->expr_type = A1TC_EXPORTVAR; |
| ; |
| break;} |
| case 53: |
| #line 700 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->expr_type = A1TC_EXPORTVAR; |
| ; |
| break;} |
| case 54: |
| #line 706 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| yyval.a_expr->expr_type = A1TC_EXPORTVAR; |
| ; |
| break;} |
| case 55: |
| #line 717 "asn1p_y.y" |
| { asn1p_lexer_hack_push_opaque_state(); ; |
| break;} |
| case 56: |
| #line 717 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-4].a_expr; |
| assert(yyval.a_expr->Identifier == 0); |
| yyval.a_expr->Identifier = yyvsp[-5].tv_str; |
| yyval.a_expr->meta_type = AMT_VALUESET; |
| // take care of ValueSet body |
| ; |
| break;} |
| case 57: |
| #line 727 "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 58: |
| #line 734 "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; |
| ; |
| break;} |
| case 59: |
| #line 752 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| assert(yyval.a_expr->expr_type); |
| assert(yyval.a_expr->meta_type); |
| ; |
| break;} |
| case 60: |
| #line 758 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); |
| assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); |
| ; |
| break;} |
| case 61: |
| #line 774 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| assert(yyval.a_expr->Identifier == 0); |
| yyval.a_expr->Identifier = yyvsp[-5].tv_str; |
| yyval.a_expr->params = yyvsp[-3].a_plist; |
| yyval.a_expr->meta_type = AMT_PARAMTYPE; |
| ; |
| break;} |
| case 62: |
| #line 784 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_plist = asn1p_paramlist_new(yylineno); |
| checkmem(yyval.a_plist); |
| ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); |
| checkmem(ret == 0); |
| if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); |
| if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); |
| ; |
| break;} |
| case 63: |
| #line 793 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_plist = yyvsp[-2].a_plist; |
| ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); |
| checkmem(ret == 0); |
| if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); |
| if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); |
| ; |
| break;} |
| case 64: |
| #line 804 "asn1p_y.y" |
| { |
| yyval.a_parg.governor = NULL; |
| yyval.a_parg.argument = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 65: |
| #line 808 "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 815 "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 67: |
| #line 822 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_parg.governor = asn1p_ref_new(yylineno); |
| ret = asn1p_ref_add_component(yyval.a_parg.governor, |
| ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1); |
| checkmem(ret == 0); |
| yyval.a_parg.argument = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 68: |
| #line 833 "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 838 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 70: |
| #line 845 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| ; |
| break;} |
| case 71: |
| #line 848 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| yyval.a_expr->expr_type = A1TC_REFERENCE; |
| yyval.a_expr->meta_type = AMT_VALUE; |
| ; |
| break;} |
| case 72: |
| #line 872 "asn1p_y.y" |
| { yyval.a_expr = asn1p_expr_new(yylineno); ; |
| break;} |
| case 73: |
| #line 873 "asn1p_y.y" |
| { yyval.a_expr = yyvsp[0].a_expr; ; |
| break;} |
| case 74: |
| #line 876 "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 881 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 76: |
| #line 888 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| assert(yyval.a_expr->Identifier == 0); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 77: |
| #line 895 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| _fixup_anonymous_identifier(yyval.a_expr); |
| ; |
| break;} |
| case 78: |
| #line 901 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type; |
| yyval.a_expr->expr_type = A1TC_COMPONENTS_OF; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 79: |
| #line 908 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| ; |
| break;} |
| case 80: |
| #line 914 "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 919 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 82: |
| #line 926 "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 931 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| ; |
| break;} |
| case 84: |
| #line 934 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| _fixup_anonymous_identifier(yyval.a_expr); |
| ; |
| break;} |
| case 85: |
| #line 941 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| checkmem(yyval.a_expr); |
| yyval.a_expr->with_syntax = yyvsp[0].a_wsynt; |
| assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); |
| assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS); |
| ; |
| break;} |
| case 86: |
| #line 951 "asn1p_y.y" |
| { yyval.a_int = 0; ; |
| break;} |
| case 87: |
| #line 952 "asn1p_y.y" |
| { yyval.a_int = 1; ; |
| break;} |
| case 88: |
| #line 956 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->expr_type = A1TC_CLASSDEF; |
| yyval.a_expr->meta_type = AMT_OBJECTCLASS; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 89: |
| #line 963 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 90: |
| #line 973 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-1].tv_str; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */ |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 91: |
| #line 983 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */ |
| yyval.a_expr->unique = yyvsp[-1].a_int; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| asn1p_expr_add(yyval.a_expr, yyvsp[-2].a_expr); |
| ; |
| break;} |
| case 92: |
| #line 994 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVFS; |
| yyval.a_expr->reference = yyvsp[-1].a_ref; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 93: |
| #line 1004 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->reference = yyvsp[-1].a_ref; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_OFS; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 94: |
| #line 1015 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVSFS; |
| yyval.a_expr->reference = yyvsp[-1].a_ref; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 95: |
| #line 1025 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVSFS; |
| asn1p_expr_add(yyval.a_expr, yyvsp[-1].a_expr); |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 96: |
| #line 1036 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| yyval.a_expr->reference = yyvsp[-1].a_ref; |
| yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| yyval.a_expr->expr_type = A1TC_CLASSFIELD_OSFS; |
| yyval.a_expr->marker = yyvsp[0].a_marker; |
| ; |
| break;} |
| case 97: |
| #line 1048 "asn1p_y.y" |
| { yyval.a_wsynt = 0; ; |
| break;} |
| case 98: |
| #line 1049 "asn1p_y.y" |
| { |
| yyval.a_wsynt = yyvsp[0].a_wsynt; |
| ; |
| break;} |
| case 99: |
| #line 1056 "asn1p_y.y" |
| { asn1p_lexer_hack_enable_with_syntax(); ; |
| break;} |
| case 100: |
| #line 1058 "asn1p_y.y" |
| { |
| yyval.a_wsynt = yyvsp[-1].a_wsynt; |
| ; |
| break;} |
| case 101: |
| #line 1064 "asn1p_y.y" |
| { |
| yyval.a_wsynt = asn1p_wsyntx_new(); |
| TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); |
| ; |
| break;} |
| case 102: |
| #line 1068 "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 1075 "asn1p_y.y" |
| { |
| yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
| ; |
| break;} |
| case 104: |
| #line 1078 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref; |
| int ret; |
| ref = asn1p_ref_new(yylineno); |
| checkmem(ref); |
| ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| checkmem(ret == 0); |
| yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0); |
| ; |
| break;} |
| case 105: |
| #line 1090 "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 106: |
| #line 1098 "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 107: |
| #line 1107 "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 108: |
| #line 1119 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| yyval.a_expr->tag = yyvsp[-2].a_tag; |
| /* |
| * Outer constraint for SEQUENCE OF and SET OF applies |
| * to the inner type. |
| */ |
| if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF |
| || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) { |
| assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints); |
| TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr; |
| } else { |
| if(yyval.a_expr->constraints) { |
| assert(!yyvsp[-1].a_expr); |
| } else { |
| yyval.a_expr->constraints = yyvsp[0].a_constr; |
| } |
| } |
| ; |
| break;} |
| case 109: |
| #line 1141 "asn1p_y.y" |
| { |
| yyval.a_int = asn1p_as_pointer ? EM_INDIRECT : 0; |
| asn1p_as_pointer = 0; |
| ; |
| break;} |
| case 110: |
| #line 1148 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| yyval.a_expr->marker.flags |= yyvsp[-1].a_int; |
| |
| if((yyval.a_expr->marker.flags & EM_INDIRECT) |
| && (yyval.a_expr->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) { |
| fprintf(stderr, |
| "INFO: Directive <ASN1C:RepresentAsPointer> " |
| "applied to %s at line %d\n", |
| ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type) |
| ? ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type) |
| : "member", |
| yyval.a_expr->_lineno |
| ); |
| } |
| ; |
| break;} |
| case 111: |
| #line 1167 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[0].a_expr; |
| ; |
| break;} |
| case 112: |
| #line 1170 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| yyval.a_expr->expr_type = ASN_CONSTR_CHOICE; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 113: |
| #line 1176 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 114: |
| #line 1182 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| yyval.a_expr->expr_type = ASN_CONSTR_SET; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 115: |
| #line 1188 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->constraints = yyvsp[-4].a_constr; |
| yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str; |
| yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 116: |
| #line 1198 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->constraints = yyvsp[-4].a_constr; |
| yyval.a_expr->expr_type = ASN_CONSTR_SET_OF; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str; |
| yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 117: |
| #line 1208 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->expr_type = ASN_TYPE_ANY; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 118: |
| #line 1214 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| yyval.a_expr->reference = asn1p_ref_new(yylineno); |
| ret = asn1p_ref_add_component(yyval.a_expr->reference, |
| yyvsp[0].tv_str, RLT_lowercase); |
| checkmem(ret == 0); |
| yyval.a_expr->expr_type = ASN_TYPE_ANY; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 119: |
| #line 1228 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_expr = yyvsp[-1].a_expr; |
| assert(yyval.a_expr->expr_type == 0); |
| assert(yyval.a_expr->meta_type == 0); |
| assert(yyval.a_expr->reference == 0); |
| yyval.a_expr->reference = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_expr->reference); |
| ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| free(yyvsp[-3].tv_str); |
| yyval.a_expr->expr_type = A1TC_PARAMETRIZED; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 120: |
| #line 1252 "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 121: |
| #line 1259 "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_INSTANCE; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 122: |
| #line 1274 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 123: |
| #line 1282 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| free(yyvsp[-2].tv_str); |
| ; |
| break;} |
| case 124: |
| #line 1292 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| free(yyvsp[-2].tv_str); |
| ; |
| break;} |
| case 125: |
| #line 1302 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase); |
| checkmem(ret == 0); |
| free(yyvsp[-2].tv_str); |
| ; |
| break;} |
| case 126: |
| #line 1312 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS); |
| free(yyvsp[0].tv_str); |
| checkmem(ret == 0); |
| ; |
| break;} |
| case 127: |
| #line 1320 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = yyvsp[0].a_ref; |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS); |
| free(yyvsp[-2].tv_str); |
| checkmem(ret == 0); |
| /* |
| * Move the last element infront. |
| */ |
| { |
| struct asn1p_ref_component_s tmp_comp; |
| tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1]; |
| memmove(&yyval.a_ref->components[1], |
| &yyval.a_ref->components[0], |
| sizeof(yyval.a_ref->components[0]) |
| * (yyval.a_ref->comp_count - 1)); |
| yyval.a_ref->components[0] = tmp_comp; |
| } |
| ; |
| break;} |
| case 128: |
| #line 1342 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| checkmem(yyval.a_ref); |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| free(yyvsp[0].a_refcomp.name); |
| checkmem(ret == 0); |
| ; |
| break;} |
| case 129: |
| #line 1350 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_ref = yyvsp[-2].a_ref; |
| ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| free(yyvsp[0].a_refcomp.name); |
| checkmem(ret == 0); |
| ; |
| break;} |
| case 132: |
| #line 1364 "asn1p_y.y" |
| { |
| yyval.a_refcomp.lex_type = RLT_AmpUppercase; |
| yyval.a_refcomp.name = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 133: |
| #line 1369 "asn1p_y.y" |
| { |
| yyval.a_refcomp.lex_type = RLT_Amplowercase; |
| yyval.a_refcomp.name = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 134: |
| #line 1378 "asn1p_y.y" |
| { |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase); |
| ; |
| break;} |
| case 135: |
| #line 1382 "asn1p_y.y" |
| { |
| yyval.a_ref = yyval.a_ref; |
| asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase); |
| ; |
| break;} |
| case 136: |
| #line 1386 "asn1p_y.y" |
| { |
| yyval.a_ref = yyval.a_ref; |
| asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_Amplowercase); |
| ; |
| break;} |
| case 137: |
| #line 1393 "asn1p_y.y" |
| { |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS); |
| ; |
| break;} |
| case 138: |
| #line 1413 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| assert(yyval.a_expr->Identifier == NULL); |
| yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| yyval.a_expr->meta_type = AMT_VALUE; |
| yyval.a_expr->value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 139: |
| #line 1423 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(0); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_CHOICE_IDENTIFIER; |
| yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str; |
| yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 140: |
| #line 1430 "asn1p_y.y" |
| { asn1p_lexer_hack_push_opaque_state(); ; |
| break;} |
| case 141: |
| #line 1430 "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 142: |
| #line 1435 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(0); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_NULL; |
| ; |
| break;} |
| case 143: |
| #line 1440 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(0); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_FALSE; |
| ; |
| break;} |
| case 144: |
| #line 1445 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(0); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_TRUE; |
| ; |
| break;} |
| case 145: |
| #line 1450 "asn1p_y.y" |
| { |
| yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B'); |
| checkmem(yyval.a_value); |
| ; |
| break;} |
| case 146: |
| #line 1454 "asn1p_y.y" |
| { |
| yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H'); |
| checkmem(yyval.a_value); |
| ; |
| break;} |
| case 147: |
| #line 1458 "asn1p_y.y" |
| { |
| yyval.a_value = yyval.a_value; |
| ; |
| break;} |
| case 148: |
| #line 1461 "asn1p_y.y" |
| { |
| yyval.a_value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 149: |
| #line 1464 "asn1p_y.y" |
| { |
| yyval.a_value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 150: |
| #line 1470 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref; |
| int ret; |
| ref = asn1p_ref_new(yylineno); |
| checkmem(ref); |
| ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| checkmem(ret == 0); |
| yyval.a_value = asn1p_value_fromref(ref, 0); |
| checkmem(yyval.a_value); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 151: |
| #line 1481 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref; |
| int ret; |
| ref = asn1p_ref_new(yylineno); |
| checkmem(ref); |
| ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| checkmem(ret == 0); |
| yyval.a_value = asn1p_value_fromref(ref, 0); |
| checkmem(yyval.a_value); |
| free(yyvsp[-2].tv_str); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 152: |
| #line 1499 "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 153: |
| #line 1503 "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 154: |
| #line 1508 "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 155: |
| #line 1542 "asn1p_y.y" |
| { |
| yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 1; |
| yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1); |
| checkmem(yyval.tv_opaque.buf); |
| yyval.tv_opaque.buf[0] = '{'; |
| memcpy(yyval.tv_opaque.buf + 1, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); |
| yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0'; |
| free(yyvsp[0].tv_opaque.buf); |
| ; |
| break;} |
| case 156: |
| #line 1551 "asn1p_y.y" |
| { |
| int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len; |
| char *p = malloc(newsize + 1); |
| checkmem(p); |
| memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len); |
| memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); |
| p[newsize] = '\0'; |
| free(yyvsp[-1].tv_opaque.buf); |
| free(yyvsp[0].tv_opaque.buf); |
| yyval.tv_opaque.buf = p; |
| yyval.tv_opaque.len = newsize; |
| ; |
| break;} |
| case 157: |
| #line 1566 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_BOOLEAN; ; |
| break;} |
| case 158: |
| #line 1567 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_NULL; ; |
| break;} |
| case 159: |
| #line 1568 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_REAL; ; |
| break;} |
| case 160: |
| #line 1569 "asn1p_y.y" |
| { yyval.a_type = yyvsp[0].a_type; ; |
| break;} |
| case 161: |
| #line 1570 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_OCTET_STRING; ; |
| break;} |
| case 162: |
| #line 1571 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ; |
| break;} |
| case 163: |
| #line 1572 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_RELATIVE_OID; ; |
| break;} |
| case 164: |
| #line 1573 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_EXTERNAL; ; |
| break;} |
| case 165: |
| #line 1574 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ; |
| break;} |
| case 166: |
| #line 1575 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_CHARACTER_STRING; ; |
| break;} |
| case 167: |
| #line 1576 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_UTCTime; ; |
| break;} |
| case 168: |
| #line 1577 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_GeneralizedTime; ; |
| break;} |
| case 169: |
| #line 1578 "asn1p_y.y" |
| { yyval.a_type = yyvsp[0].a_type; ; |
| break;} |
| case 170: |
| #line 1585 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_INTEGER; ; |
| break;} |
| case 171: |
| #line 1586 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_ENUMERATED; ; |
| break;} |
| case 172: |
| #line 1587 "asn1p_y.y" |
| { yyval.a_type = ASN_BASIC_BIT_STRING; ; |
| break;} |
| case 173: |
| #line 1591 "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; |
| ; |
| break;} |
| case 174: |
| #line 1597 "asn1p_y.y" |
| { |
| if(yyvsp[0].a_expr) { |
| yyval.a_expr = yyvsp[0].a_expr; |
| } else { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| } |
| yyval.a_expr->expr_type = yyvsp[-1].a_type; |
| yyval.a_expr->meta_type = AMT_TYPE; |
| ; |
| break;} |
| case 175: |
| #line 1610 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_BMPString; ; |
| break;} |
| case 176: |
| #line 1611 "asn1p_y.y" |
| { |
| yyval.a_type = ASN_STRING_GeneralString; |
| fprintf(stderr, "WARNING: GeneralString is not fully supported\n"); |
| ; |
| break;} |
| case 177: |
| #line 1615 "asn1p_y.y" |
| { |
| yyval.a_type = ASN_STRING_GraphicString; |
| fprintf(stderr, "WARNING: GraphicString is not fully supported\n"); |
| ; |
| break;} |
| case 178: |
| #line 1619 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_IA5String; ; |
| break;} |
| case 179: |
| #line 1620 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_ISO646String; ; |
| break;} |
| case 180: |
| #line 1621 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_NumericString; ; |
| break;} |
| case 181: |
| #line 1622 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_PrintableString; ; |
| break;} |
| case 182: |
| #line 1623 "asn1p_y.y" |
| { |
| yyval.a_type = ASN_STRING_T61String; |
| fprintf(stderr, "WARNING: T61String is not fully supported\n"); |
| ; |
| break;} |
| case 183: |
| #line 1627 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_TeletexString; ; |
| break;} |
| case 184: |
| #line 1628 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_UniversalString; ; |
| break;} |
| case 185: |
| #line 1629 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_UTF8String; ; |
| break;} |
| case 186: |
| #line 1630 "asn1p_y.y" |
| { |
| yyval.a_type = ASN_STRING_VideotexString; |
| fprintf(stderr, "WARNING: VideotexString is not fully supported\n"); |
| ; |
| break;} |
| case 187: |
| #line 1634 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_VisibleString; ; |
| break;} |
| case 188: |
| #line 1635 "asn1p_y.y" |
| { yyval.a_type = ASN_STRING_ObjectDescriptor; ; |
| break;} |
| case 194: |
| #line 1647 "asn1p_y.y" |
| { yyval.a_constr = 0; ; |
| break;} |
| case 195: |
| #line 1648 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 196: |
| #line 1654 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0); |
| ; |
| break;} |
| case 197: |
| #line 1657 "asn1p_y.y" |
| { |
| /* |
| * This is a special case, for compatibility purposes. |
| * It goes without parentheses. |
| */ |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0); |
| ; |
| break;} |
| case 198: |
| #line 1667 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[-1].a_constr; |
| ; |
| break;} |
| case 199: |
| #line 1670 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr); |
| ; |
| break;} |
| case 200: |
| #line 1676 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 201: |
| #line 1679 "asn1p_y.y" |
| { |
| asn1p_constraint_t *ct; |
| ct = asn1p_constraint_new(yylineno); |
| ct->type = ACT_EL_EXT; |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); |
| ; |
| break;} |
| case 202: |
| #line 1685 "asn1p_y.y" |
| { |
| asn1p_constraint_t *ct; |
| ct = asn1p_constraint_new(yylineno); |
| ct->type = ACT_EL_EXT; |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct); |
| ct = yyval.a_constr; |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr); |
| ; |
| break;} |
| case 203: |
| #line 1696 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 204: |
| #line 1699 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_AEX, yyvsp[0].a_constr, 0); |
| ; |
| break;} |
| case 205: |
| #line 1702 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
| ; |
| break;} |
| case 206: |
| #line 1705 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
| ; |
| break;} |
| case 207: |
| #line 1708 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
| ; |
| break;} |
| case 208: |
| #line 1714 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = yyvsp[-3].a_ctype; |
| ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); |
| checkmem(ret == 0); |
| ; |
| break;} |
| case 209: |
| #line 1722 "asn1p_y.y" |
| { |
| int ret; |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_CA_SET; |
| ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); |
| checkmem(ret == 0); |
| ; |
| break;} |
| case 210: |
| #line 1730 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_EL_VALUE; |
| yyval.a_constr->value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 211: |
| #line 1736 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_EL_TYPE; |
| yyval.a_constr->containedSubtype = yyvsp[0].a_value; |
| ; |
| break;} |
| case 212: |
| #line 1742 "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 = yyvsp[-2].a_value; |
| yyval.a_constr->range_stop = yyvsp[0].a_value; |
| ; |
| break;} |
| case 213: |
| #line 1749 "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 214: |
| #line 1757 "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 = yyvsp[-2].a_value; |
| yyval.a_constr->range_stop = asn1p_value_fromint(321); |
| yyval.a_constr->range_stop->type = ATV_MAX; |
| ; |
| break;} |
| case 215: |
| #line 1765 "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 216: |
| #line 1774 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 217: |
| #line 1777 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 218: |
| #line 1781 "asn1p_y.y" |
| { asn1p_lexer_hack_push_opaque_state(); ; |
| break;} |
| case 219: |
| #line 1781 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_CT_CTDBY; |
| yyval.a_constr->value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
| checkmem(yyval.a_constr->value); |
| yyval.a_constr->value->type = ATV_UNPARSED; |
| ; |
| break;} |
| case 220: |
| #line 1792 "asn1p_y.y" |
| { yyval.a_ctype = ACT_EL_RANGE; ; |
| break;} |
| case 221: |
| #line 1793 "asn1p_y.y" |
| { yyval.a_ctype = ACT_EL_RLRANGE; ; |
| break;} |
| case 222: |
| #line 1794 "asn1p_y.y" |
| { yyval.a_ctype = ACT_EL_LLRANGE; ; |
| break;} |
| case 223: |
| #line 1795 "asn1p_y.y" |
| { yyval.a_ctype = ACT_EL_ULRANGE; ; |
| break;} |
| case 224: |
| #line 1799 "asn1p_y.y" |
| { |
| yyval.a_ctype = ACT_CT_SIZE; |
| ; |
| break;} |
| case 225: |
| #line 1802 "asn1p_y.y" |
| { |
| yyval.a_ctype = ACT_CT_FROM; |
| ; |
| break;} |
| case 226: |
| #line 1808 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(0); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_FALSE; |
| ; |
| break;} |
| case 227: |
| #line 1813 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(1); |
| checkmem(yyval.a_value); |
| yyval.a_value->type = ATV_TRUE; |
| ; |
| break;} |
| case 228: |
| #line 1818 "asn1p_y.y" |
| { |
| yyval.a_value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 229: |
| #line 1821 "asn1p_y.y" |
| { |
| yyval.a_value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 230: |
| #line 1824 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref; |
| int ret; |
| ref = asn1p_ref_new(yylineno); |
| checkmem(ref); |
| ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| checkmem(ret == 0); |
| yyval.a_value = asn1p_value_fromref(ref, 0); |
| checkmem(yyval.a_value); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 231: |
| #line 1838 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref; |
| int ret; |
| ref = asn1p_ref_new(yylineno); |
| checkmem(ref); |
| ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| checkmem(ret == 0); |
| yyval.a_value = asn1p_value_fromref(ref, 0); |
| checkmem(yyval.a_value); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 232: |
| #line 1852 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMP, yyvsp[0].a_constr, 0); |
| ; |
| break;} |
| case 233: |
| #line 1855 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0); |
| ; |
| break;} |
| case 234: |
| #line 1861 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 235: |
| #line 1864 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
| ; |
| break;} |
| case 236: |
| #line 1870 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_EL_EXT; |
| yyval.a_constr->value = asn1p_value_frombuf("...", 3, 0); |
| ; |
| break;} |
| case 237: |
| #line 1876 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_EL_VALUE; |
| yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0); |
| yyval.a_constr->presence = yyvsp[0].a_pres; |
| if(yyvsp[-1].a_constr) asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); |
| ; |
| break;} |
| case 238: |
| #line 1890 "asn1p_y.y" |
| { yyval.a_pres = ACPRES_DEFAULT; ; |
| break;} |
| case 239: |
| #line 1891 "asn1p_y.y" |
| { yyval.a_pres = yyvsp[0].a_pres; ; |
| break;} |
| case 240: |
| #line 1895 "asn1p_y.y" |
| { |
| yyval.a_pres = ACPRES_PRESENT; |
| ; |
| break;} |
| case 241: |
| #line 1898 "asn1p_y.y" |
| { |
| yyval.a_pres = ACPRES_ABSENT; |
| ; |
| break;} |
| case 242: |
| #line 1901 "asn1p_y.y" |
| { |
| yyval.a_pres = ACPRES_OPTIONAL; |
| ; |
| break;} |
| case 243: |
| #line 1907 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 244: |
| #line 1910 "asn1p_y.y" |
| { |
| yyval.a_constr = yyvsp[0].a_constr; |
| ; |
| break;} |
| case 245: |
| #line 1919 "asn1p_y.y" |
| { |
| asn1p_ref_t *ref = asn1p_ref_new(yylineno); |
| asn1p_constraint_t *ct; |
| int ret; |
| ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0); |
| checkmem(ret == 0); |
| ct = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| ct->type = ACT_EL_VALUE; |
| ct->value = asn1p_value_fromref(ref, 0); |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0); |
| ; |
| break;} |
| case 246: |
| #line 1934 "asn1p_y.y" |
| { |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr); |
| ; |
| break;} |
| case 247: |
| #line 1940 "asn1p_y.y" |
| { |
| yyval.a_constr = asn1p_constraint_new(yylineno); |
| checkmem(yyval.a_constr); |
| yyval.a_constr->type = ACT_EL_VALUE; |
| yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); |
| ; |
| break;} |
| case 248: |
| #line 1946 "asn1p_y.y" |
| { |
| asn1p_constraint_t *ct; |
| ct = asn1p_constraint_new(yylineno); |
| checkmem(ct); |
| ct->type = ACT_EL_VALUE; |
| ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); |
| CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); |
| ; |
| break;} |
| case 249: |
| #line 1960 "asn1p_y.y" |
| { |
| char *p = malloc(strlen(yyvsp[0].tv_str) + 2); |
| int ret; |
| *p = '@'; |
| strcpy(p + 1, yyvsp[0].tv_str); |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| ret = asn1p_ref_add_component(yyval.a_ref, p, 0); |
| checkmem(ret == 0); |
| free(p); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 250: |
| #line 1971 "asn1p_y.y" |
| { |
| char *p = malloc(strlen(yyvsp[0].tv_str) + 3); |
| int ret; |
| p[0] = '@'; |
| p[1] = '.'; |
| strcpy(p + 2, yyvsp[0].tv_str); |
| yyval.a_ref = asn1p_ref_new(yylineno); |
| ret = asn1p_ref_add_component(yyval.a_ref, p, 0); |
| checkmem(ret == 0); |
| free(p); |
| free(yyvsp[0].tv_str); |
| ; |
| break;} |
| case 251: |
| #line 1987 "asn1p_y.y" |
| { |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 252: |
| #line 1990 "asn1p_y.y" |
| { |
| int l1 = strlen(yyvsp[-2].tv_str); |
| int l3 = strlen(yyvsp[0].tv_str); |
| yyval.tv_str = malloc(l1 + 1 + l3 + 1); |
| memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1); |
| yyval.tv_str[l1] = '.'; |
| memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3); |
| yyval.tv_str[l1 + 1 + l3] = '\0'; |
| ; |
| break;} |
| case 253: |
| #line 2008 "asn1p_y.y" |
| { |
| yyval.a_marker.flags = EM_NOMARK; |
| yyval.a_marker.default_value = 0; |
| ; |
| break;} |
| case 254: |
| #line 2012 "asn1p_y.y" |
| { yyval.a_marker = yyvsp[0].a_marker; ; |
| break;} |
| case 255: |
| #line 2016 "asn1p_y.y" |
| { |
| yyval.a_marker.flags = EM_OPTIONAL | EM_INDIRECT; |
| yyval.a_marker.default_value = 0; |
| ; |
| break;} |
| case 256: |
| #line 2020 "asn1p_y.y" |
| { |
| yyval.a_marker.flags = EM_DEFAULT; |
| yyval.a_marker.default_value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 257: |
| #line 2043 "asn1p_y.y" |
| { |
| yyval.a_expr = asn1p_expr_new(yylineno); |
| checkmem(yyval.a_expr); |
| ; |
| break;} |
| case 258: |
| #line 2047 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-1].a_expr; |
| ; |
| break;} |
| case 259: |
| #line 2053 "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 260: |
| #line 2058 "asn1p_y.y" |
| { |
| yyval.a_expr = yyvsp[-2].a_expr; |
| asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| ; |
| break;} |
| case 261: |
| #line 2065 "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[0].tv_str; |
| ; |
| break;} |
| case 262: |
| #line 2072 "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 263: |
| #line 2080 "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 2088 "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->value = yyvsp[0].a_value; |
| ; |
| break;} |
| case 265: |
| #line 2095 "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_VALUE; |
| ; |
| break;} |
| case 266: |
| #line 2106 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); |
| checkmem(yyval.a_value); |
| ; |
| break;} |
| case 267: |
| #line 2110 "asn1p_y.y" |
| { |
| yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); |
| checkmem(yyval.a_value); |
| ; |
| break;} |
| case 268: |
| #line 2141 "asn1p_y.y" |
| { memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ; |
| break;} |
| case 269: |
| #line 2142 "asn1p_y.y" |
| { yyval.a_tag = yyvsp[0].a_tag; ; |
| break;} |
| case 270: |
| #line 2146 "asn1p_y.y" |
| { |
| yyval.a_tag = yyvsp[-1].a_tag; |
| yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode; |
| ; |
| break;} |
| case 271: |
| #line 2153 "asn1p_y.y" |
| { |
| yyval.a_tag = yyvsp[-2].a_tag; |
| yyval.a_tag.tag_value = yyvsp[-1].a_int; |
| ; |
| break;} |
| case 272: |
| #line 2159 "asn1p_y.y" |
| { yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; ; |
| break;} |
| case 273: |
| #line 2160 "asn1p_y.y" |
| { yyval.a_tag.tag_class = TC_UNIVERSAL; ; |
| break;} |
| case 274: |
| #line 2161 "asn1p_y.y" |
| { yyval.a_tag.tag_class = TC_APPLICATION; ; |
| break;} |
| case 275: |
| #line 2162 "asn1p_y.y" |
| { yyval.a_tag.tag_class = TC_PRIVATE; ; |
| break;} |
| case 276: |
| #line 2166 "asn1p_y.y" |
| { yyval.a_tag.tag_mode = TM_DEFAULT; ; |
| break;} |
| case 277: |
| #line 2167 "asn1p_y.y" |
| { yyval.a_tag.tag_mode = TM_IMPLICIT; ; |
| break;} |
| case 278: |
| #line 2168 "asn1p_y.y" |
| { yyval.a_tag.tag_mode = TM_EXPLICIT; ; |
| break;} |
| case 279: |
| #line 2172 "asn1p_y.y" |
| { |
| checkmem(yyvsp[0].tv_str); |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 280: |
| #line 2176 "asn1p_y.y" |
| { |
| checkmem(yyvsp[0].tv_str); |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 281: |
| #line 2184 "asn1p_y.y" |
| { |
| checkmem(yyvsp[0].tv_str); |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 282: |
| #line 2191 "asn1p_y.y" |
| { yyval.tv_str = 0; ; |
| break;} |
| case 283: |
| #line 2192 "asn1p_y.y" |
| { |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| case 284: |
| #line 2198 "asn1p_y.y" |
| { |
| checkmem(yyvsp[0].tv_str); |
| yyval.tv_str = yyvsp[0].tv_str; |
| ; |
| break;} |
| } |
| /* the action file gets copied in in place of this dollarsign */ |
| #line 543 "/usr/share/bison.simple" |
| |
| yyvsp -= yylen; |
| yyssp -= yylen; |
| #ifdef YYLSP_NEEDED |
| yylsp -= yylen; |
| #endif |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| { |
| short *ssp1 = yyss - 1; |
| fprintf (stderr, "state stack now"); |
| while (ssp1 != yyssp) |
| fprintf (stderr, " %d", *++ssp1); |
| fprintf (stderr, "\n"); |
| } |
| #endif |
| |
| *++yyvsp = yyval; |
| |
| #ifdef YYLSP_NEEDED |
| yylsp++; |
| if (yylen == 0) |
| { |
| yylsp->first_line = yylloc.first_line; |
| yylsp->first_column = yylloc.first_column; |
| yylsp->last_line = (yylsp-1)->last_line; |
| yylsp->last_column = (yylsp-1)->last_column; |
| yylsp->text = 0; |
| } |
| else |
| { |
| yylsp->last_line = (yylsp+yylen-1)->last_line; |
| yylsp->last_column = (yylsp+yylen-1)->last_column; |
| } |
| #endif |
| |
| /* Now "shift" the result of the reduction. |
| Determine what state that goes to, |
| based on the state we popped back to |
| and the rule number reduced by. */ |
| |
| yyn = yyr1[yyn]; |
| |
| yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
| if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
| yystate = yytable[yystate]; |
| else |
| yystate = yydefgoto[yyn - YYNTBASE]; |
| |
| goto yynewstate; |
| |
| yyerrlab: /* here on detecting error */ |
| |
| if (! yyerrstatus) |
| /* If not already recovering from an error, report this error. */ |
| { |
| ++yynerrs; |
| |
| #ifdef YYERROR_VERBOSE |
| yyn = yypact[yystate]; |
| |
| if (yyn > YYFLAG && yyn < YYLAST) |
| { |
| int size = 0; |
| char *msg; |
| int x, count; |
| |
| count = 0; |
| /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ |
| for (x = (yyn < 0 ? -yyn : 0); |
| x < (int)(sizeof(yytname) / sizeof(char *)); x++) |
| if (yycheck[x + yyn] == x) |
| size += strlen(yytname[x]) + 15, count++; |
| msg = (char *) malloc(size + 15); |
| if (msg != 0) |
| { |
| strcpy(msg, "parse error"); |
| |
| if (count < 5) |
| { |
| count = 0; |
| for (x = (yyn < 0 ? -yyn : 0); |
| x < (int)(sizeof(yytname) / sizeof(char *)); x++) |
| if (yycheck[x + yyn] == x) |
| { |
| strcat(msg, count == 0 ? ", expecting `" : " or `"); |
| strcat(msg, yytname[x]); |
| strcat(msg, "'"); |
| count++; |
| } |
| } |
| yyerror(msg); |
| free(msg); |
| } |
| else |
| yyerror ("parse error; also virtual memory exceeded"); |
| } |
| else |
| #endif /* YYERROR_VERBOSE */ |
| yyerror("parse error"); |
| } |
| |
| goto yyerrlab1; |
| yyerrlab1: /* here on error raised explicitly by an action */ |
| |
| if (yyerrstatus == 3) |
| { |
| /* if just tried and failed to reuse lookahead token after an error, discard it. */ |
| |
| /* return failure if at end of input */ |
| if (yychar == YYEOF) |
| YYABORT; |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); |
| #endif |
| |
| yychar = YYEMPTY; |
| } |
| |
| /* Else will try to reuse lookahead token |
| after shifting the error token. */ |
| |
| yyerrstatus = 3; /* Each real token shifted decrements this */ |
| |
| goto yyerrhandle; |
| |
| yyerrdefault: /* current state does not do anything special for the error token. */ |
| |
| #if 0 |
| /* This is wrong; only states that explicitly want error tokens |
| should shift them. */ |
| yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ |
| if (yyn) goto yydefault; |
| #endif |
| |
| yyerrpop: /* pop the current state because it cannot handle the error token */ |
| |
| if (yyssp == yyss) YYABORT; |
| yyvsp--; |
| yystate = *--yyssp; |
| #ifdef YYLSP_NEEDED |
| yylsp--; |
| #endif |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| { |
| short *ssp1 = yyss - 1; |
| fprintf (stderr, "Error: state stack now"); |
| while (ssp1 != yyssp) |
| fprintf (stderr, " %d", *++ssp1); |
| fprintf (stderr, "\n"); |
| } |
| #endif |
| |
| yyerrhandle: |
| |
| yyn = yypact[yystate]; |
| if (yyn == YYFLAG) |
| goto yyerrdefault; |
| |
| yyn += YYTERROR; |
| if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) |
| goto yyerrdefault; |
| |
| yyn = yytable[yyn]; |
| if (yyn < 0) |
| { |
| if (yyn == YYFLAG) |
| goto yyerrpop; |
| yyn = -yyn; |
| goto yyreduce; |
| } |
| else if (yyn == 0) |
| goto yyerrpop; |
| |
| if (yyn == YYFINAL) |
| YYACCEPT; |
| |
| #if YYDEBUG != 0 |
| if (yydebug) |
| fprintf(stderr, "Shifting error token, "); |
| #endif |
| |
| *++yyvsp = yylval; |
| #ifdef YYLSP_NEEDED |
| *++yylsp = yylloc; |
| #endif |
| |
| yystate = yyn; |
| goto yynewstate; |
| |
| yyacceptlab: |
| /* YYACCEPT comes here. */ |
| if (yyfree_stacks) |
| { |
| free (yyss); |
| free (yyvs); |
| #ifdef YYLSP_NEEDED |
| free (yyls); |
| #endif |
| } |
| return 0; |
| |
| yyabortlab: |
| /* YYABORT comes here. */ |
| if (yyfree_stacks) |
| { |
| free (yyss); |
| free (yyvs); |
| #ifdef YYLSP_NEEDED |
| free (yyls); |
| #endif |
| } |
| return 1; |
| } |
| #line 2204 "asn1p_y.y" |
| |
| |
| |
| /* |
| * Convert Xstring ('0101'B or '5'H) to the binary vector. |
| */ |
| static asn1p_value_t * |
| _convert_bitstring2binary(char *str, int base) { |
| asn1p_value_t *val; |
| int slen; |
| int memlen; |
| int baselen; |
| int bits; |
| uint8_t *binary_vector; |
| uint8_t *bv_ptr; |
| uint8_t cur_val; |
| |
| assert(str); |
| assert(str[0] == '\''); |
| |
| switch(base) { |
| case 'B': |
| baselen = 1; |
| break; |
| case 'H': |
| baselen = 4; |
| break; |
| default: |
| assert(base == 'B' || base == 'H'); |
| errno = EINVAL; |
| return NULL; |
| } |
| |
| slen = strlen(str); |
| assert(str[slen - 1] == base); |
| assert(str[slen - 2] == '\''); |
| |
| memlen = slen / (8 / baselen); /* Conservative estimate */ |
| |
| bv_ptr = binary_vector = malloc(memlen + 1); |
| if(bv_ptr == NULL) |
| /* ENOMEM */ |
| return NULL; |
| |
| cur_val = 0; |
| bits = 0; |
| while(*(++str) != '\'') { |
| switch(baselen) { |
| case 1: |
| switch(*str) { |
| case '1': |
| cur_val |= 1 << (7 - (bits % 8)); |
| case '0': |
| break; |
| default: |
| assert(!"_y UNREACH1"); |
| case ' ': case '\r': case '\n': |
| continue; |
| } |
| break; |
| case 4: |
| switch(*str) { |
| case '0': case '1': case '2': case '3': case '4': |
| case '5': case '6': case '7': case '8': case '9': |
| cur_val |= (*str - '0') << (4 - (bits % 8)); |
| break; |
| case 'A': case 'B': case 'C': |
| case 'D': case 'E': case 'F': |
| cur_val |= ((*str - 'A') + 10) |
| << (4 - (bits % 8)); |
| break; |
| default: |
| assert(!"_y UNREACH2"); |
| case ' ': case '\r': case '\n': |
| continue; |
| } |
| break; |
| } |
| |
| bits += baselen; |
| if((bits % 8) == 0) { |
| *bv_ptr++ = cur_val; |
| cur_val = 0; |
| } |
| } |
| |
| *bv_ptr = cur_val; |
| assert((bv_ptr - binary_vector) <= memlen); |
| |
| val = asn1p_value_frombits(binary_vector, bits, 0); |
| if(val == NULL) { |
| free(binary_vector); |
| } |
| |
| return val; |
| } |
| |
| /* |
| * For unnamed types (used in old X.208 compliant modules) |
| * generate some sort of interim names, to not to force human being to fix |
| * the specification's compliance to modern ASN.1 standards. |
| */ |
| static void |
| _fixup_anonymous_identifier(asn1p_expr_t *expr) { |
| char *p; |
| assert(expr->Identifier == 0); |
| |
| /* |
| * Try to figure out the type name |
| * without going too much into details |
| */ |
| expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type); |
| if(expr->reference && expr->reference->comp_count > 0) |
| expr->Identifier = expr->reference->components[0].name; |
| |
| fprintf(stderr, |
| "WARNING: Line %d: expected lower-case member identifier, " |
| "found an unnamed %s.\n" |
| "WARNING: Obsolete X.208 syntax detected, " |
| "please give the member a name.\n", |
| yylineno, expr->Identifier ? expr->Identifier : "type"); |
| |
| if(!expr->Identifier) |
| expr->Identifier = "unnamed"; |
| expr->Identifier = strdup(expr->Identifier); |
| assert(expr->Identifier); |
| /* Make a lowercase identifier from the type name */ |
| for(p = expr->Identifier; *p; p++) { |
| switch(*p) { |
| case 'A' ... 'Z': *p += 32; break; |
| case ' ': *p = '_'; break; |
| case '-': *p = '_'; break; |
| } |
| } |
| fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". " |
| "Name clash may occur later.\n", |
| expr->Identifier); |
| } |
| |
| extern char *asn1p_text; |
| |
| int |
| yyerror(const char *msg) { |
| fprintf(stderr, |
| "ASN.1 grammar parse error " |
| "near line %d (token \"%s\"): %s\n", |
| yylineno, asn1p_text, msg); |
| return -1; |
| } |
| |
| |