vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2 | /* A Bison parser, made from asn1p_y.y |
| 3 | by GNU Bison version 1.28 */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 4 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 5 | #define YYBISON 1 /* Identify Bison output. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 6 | |
| 7 | #define yyparse asn1p_parse |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 8 | #define yylex asn1p_lex |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 9 | #define yyerror asn1p_error |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 10 | #define yylval asn1p_lval |
| 11 | #define yychar asn1p_char |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 12 | #define yydebug asn1p_debug |
| 13 | #define yynerrs asn1p_nerrs |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 14 | #define TOK_PPEQ 257 |
| 15 | #define TOK_opaque 258 |
| 16 | #define TOK_bstring 259 |
| 17 | #define TOK_cstring 260 |
| 18 | #define TOK_hstring 261 |
| 19 | #define TOK_identifier 262 |
| 20 | #define TOK_number 263 |
| 21 | #define TOK_number_negative 264 |
| 22 | #define TOK_typereference 265 |
| 23 | #define TOK_capitalreference 266 |
| 24 | #define TOK_typefieldreference 267 |
| 25 | #define TOK_valuefieldreference 268 |
| 26 | #define TOK_ABSENT 269 |
| 27 | #define TOK_ABSTRACT_SYNTAX 270 |
| 28 | #define TOK_ALL 271 |
| 29 | #define TOK_ANY 272 |
| 30 | #define TOK_APPLICATION 273 |
| 31 | #define TOK_AUTOMATIC 274 |
| 32 | #define TOK_BEGIN 275 |
| 33 | #define TOK_BIT 276 |
| 34 | #define TOK_BMPString 277 |
| 35 | #define TOK_BOOLEAN 278 |
| 36 | #define TOK_BY 279 |
| 37 | #define TOK_CHARACTER 280 |
| 38 | #define TOK_CHOICE 281 |
| 39 | #define TOK_CLASS 282 |
| 40 | #define TOK_COMPONENT 283 |
| 41 | #define TOK_COMPONENTS 284 |
| 42 | #define TOK_CONSTRAINED 285 |
| 43 | #define TOK_CONTAINING 286 |
| 44 | #define TOK_DEFAULT 287 |
| 45 | #define TOK_DEFINITIONS 288 |
| 46 | #define TOK_DEFINED 289 |
| 47 | #define TOK_EMBEDDED 290 |
| 48 | #define TOK_ENCODED 291 |
| 49 | #define TOK_ENCODING_CONTROL 292 |
| 50 | #define TOK_END 293 |
| 51 | #define TOK_ENUMERATED 294 |
| 52 | #define TOK_EXPLICIT 295 |
| 53 | #define TOK_EXPORTS 296 |
| 54 | #define TOK_EXTENSIBILITY 297 |
| 55 | #define TOK_EXTERNAL 298 |
| 56 | #define TOK_FALSE 299 |
| 57 | #define TOK_FROM 300 |
| 58 | #define TOK_GeneralizedTime 301 |
| 59 | #define TOK_GeneralString 302 |
| 60 | #define TOK_GraphicString 303 |
| 61 | #define TOK_IA5String 304 |
| 62 | #define TOK_IDENTIFIER 305 |
| 63 | #define TOK_IMPLICIT 306 |
| 64 | #define TOK_IMPLIED 307 |
| 65 | #define TOK_IMPORTS 308 |
| 66 | #define TOK_INCLUDES 309 |
| 67 | #define TOK_INSTANCE 310 |
| 68 | #define TOK_INSTRUCTIONS 311 |
| 69 | #define TOK_INTEGER 312 |
| 70 | #define TOK_ISO646String 313 |
| 71 | #define TOK_MAX 314 |
| 72 | #define TOK_MIN 315 |
| 73 | #define TOK_MINUS_INFINITY 316 |
| 74 | #define TOK_NULL 317 |
| 75 | #define TOK_NumericString 318 |
| 76 | #define TOK_OBJECT 319 |
| 77 | #define TOK_ObjectDescriptor 320 |
| 78 | #define TOK_OCTET 321 |
| 79 | #define TOK_OF 322 |
| 80 | #define TOK_OPTIONAL 323 |
| 81 | #define TOK_PATTERN 324 |
| 82 | #define TOK_PDV 325 |
| 83 | #define TOK_PLUS_INFINITY 326 |
| 84 | #define TOK_PRESENT 327 |
| 85 | #define TOK_PrintableString 328 |
| 86 | #define TOK_PRIVATE 329 |
| 87 | #define TOK_REAL 330 |
| 88 | #define TOK_RELATIVE_OID 331 |
| 89 | #define TOK_SEQUENCE 332 |
| 90 | #define TOK_SET 333 |
| 91 | #define TOK_SIZE 334 |
| 92 | #define TOK_STRING 335 |
| 93 | #define TOK_SYNTAX 336 |
| 94 | #define TOK_T61String 337 |
| 95 | #define TOK_TAGS 338 |
| 96 | #define TOK_TeletexString 339 |
| 97 | #define TOK_TRUE 340 |
| 98 | #define TOK_TYPE_IDENTIFIER 341 |
| 99 | #define TOK_UNIQUE 342 |
| 100 | #define TOK_UNIVERSAL 343 |
| 101 | #define TOK_UniversalString 344 |
| 102 | #define TOK_UTCTime 345 |
| 103 | #define TOK_UTF8String 346 |
| 104 | #define TOK_VideotexString 347 |
| 105 | #define TOK_VisibleString 348 |
| 106 | #define TOK_WITH 349 |
| 107 | #define TOK_EXCEPT 350 |
| 108 | #define TOK_INTERSECTION 351 |
| 109 | #define TOK_UNION 352 |
| 110 | #define TOK_TwoDots 353 |
| 111 | #define TOK_ThreeDots 354 |
| 112 | #define TOK_tag 355 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 113 | |
| 114 | #line 1 "asn1p_y.y" |
| 115 | |
| 116 | |
| 117 | #include <stdlib.h> |
| 118 | #include <stdio.h> |
| 119 | #include <string.h> |
| 120 | #include <errno.h> |
| 121 | #include <assert.h> |
| 122 | |
| 123 | #include "asn1parser.h" |
| 124 | |
| 125 | #define YYPARSE_PARAM param |
| 126 | #define YYERROR_VERBOSE |
| 127 | |
| 128 | int yylex(void); |
| 129 | int yyerror(const char *msg); |
| 130 | void asn1p_lexer_hack_push_opaque_state(void); |
| 131 | void asn1p_lexer_hack_enable_with_syntax(void); |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 132 | void asn1p_lexer_hack_push_encoding_control(void); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 133 | #define yylineno asn1p_lineno |
| 134 | extern int asn1p_lineno; |
| 135 | |
| 136 | |
| 137 | static asn1p_value_t * |
| 138 | _convert_bitstring2binary(char *str, int base); |
| 139 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 140 | #define checkmem(ptr) do { \ |
| 141 | if(!(ptr)) \ |
| 142 | return yyerror("Memory failure"); \ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 143 | } while(0) |
| 144 | |
| 145 | #define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \ |
| 146 | if(arg1->type != constr_type) { \ |
| 147 | int __ret; \ |
| 148 | root = asn1p_constraint_new(yylineno); \ |
| 149 | checkmem(root); \ |
| 150 | root->type = constr_type; \ |
| 151 | __ret = asn1p_constraint_insert(root, \ |
| 152 | arg1); \ |
| 153 | checkmem(__ret == 0); \ |
| 154 | } else { \ |
| 155 | root = arg1; \ |
| 156 | } \ |
| 157 | if(arg2) { \ |
| 158 | int __ret \ |
| 159 | = asn1p_constraint_insert(root, arg2); \ |
| 160 | checkmem(__ret == 0); \ |
| 161 | } \ |
| 162 | } while(0) |
| 163 | |
| 164 | |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 165 | #line 58 "asn1p_y.y" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 166 | typedef union { |
| 167 | asn1p_t *a_grammar; |
| 168 | asn1p_module_flags_e a_module_flags; |
| 169 | asn1p_module_t *a_module; |
| 170 | asn1p_expr_type_e a_type; /* ASN.1 Type */ |
| 171 | asn1p_expr_t *a_expr; /* Constructed collection */ |
| 172 | asn1p_constraint_t *a_constr; /* Constraint */ |
| 173 | enum asn1p_constraint_type_e a_ctype;/* Constraint type */ |
| 174 | asn1p_xports_t *a_xports; /* IMports/EXports */ |
| 175 | asn1p_oid_t *a_oid; /* Object Identifier */ |
| 176 | asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */ |
| 177 | struct asn1p_type_tag_s a_tag; /* A tag */ |
| 178 | asn1p_ref_t *a_ref; /* Reference to custom type */ |
| 179 | asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */ |
| 180 | asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */ |
| 181 | struct asn1p_ref_component_s a_refcomp; /* Component of a reference */ |
| 182 | asn1p_value_t *a_value; /* Number, DefinedValue, etc */ |
| 183 | struct asn1p_param_s a_parg; /* A parameter argument */ |
| 184 | asn1p_paramlist_t *a_plist; /* A pargs list */ |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 185 | struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 186 | enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */ |
| 187 | asn1_integer_t a_int; |
| 188 | char *tv_str; |
| 189 | struct { |
| 190 | char *buf; |
| 191 | int len; |
| 192 | } tv_opaque; |
| 193 | struct { |
| 194 | char *name; |
| 195 | struct asn1p_type_tag_s tag; |
| 196 | } tv_nametag; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 197 | } YYSTYPE; |
| 198 | #include <stdio.h> |
| 199 | |
| 200 | #ifndef __cplusplus |
| 201 | #ifndef __STDC__ |
| 202 | #define const |
| 203 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 204 | #endif |
| 205 | |
| 206 | |
| 207 | |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 208 | #define YYFINAL 399 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 209 | #define YYFLAG -32768 |
| 210 | #define YYNTBASE 115 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 211 | |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 212 | #define YYTRANSLATE(x) ((unsigned)(x) <= 355 ? yytranslate[x] : 211) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 213 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 214 | static const char yytranslate[] = { 0, |
| 215 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 216 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 217 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 218 | 2, 2, 111, 2, 2, 2, 2, 2, 2, 106, |
| 219 | 107, 2, 2, 109, 2, 112, 2, 2, 2, 2, |
| 220 | 2, 2, 2, 2, 2, 2, 2, 110, 108, 113, |
| 221 | 2, 2, 2, 114, 2, 2, 2, 2, 2, 2, |
| 222 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 223 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 224 | 2, 2, 2, 97, 2, 2, 2, 2, 2, 2, |
| 225 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 226 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 227 | 2, 2, 104, 99, 105, 2, 2, 2, 2, 2, |
| 228 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 229 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 230 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 231 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 232 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 233 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 234 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 235 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 236 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 237 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 238 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 239 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 240 | 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, |
| 241 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
| 242 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 243 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, |
| 244 | 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, |
| 245 | 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
| 246 | 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, |
| 247 | 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, |
| 248 | 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, |
| 249 | 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, |
| 250 | 98, 100, 101, 102, 103 |
| 251 | }; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 252 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 253 | #if YYDEBUG != 0 |
| 254 | static const short yyprhs[] = { 0, |
| 255 | 0, 2, 4, 7, 16, 17, 19, 23, 26, 28, |
| 256 | 31, 33, 38, 40, 41, 43, 45, 48, 51, 54, |
| 257 | 57, 60, 63, 64, 66, 68, 71, 73, 75, 77, |
| 258 | 79, 81, 82, 86, 88, 92, 95, 97, 100, 105, |
| 259 | 107, 111, 113, 115, 119, 123, 126, 128, 132, 134, |
| 260 | 136, 143, 145, 147, 148, 150, 152, 156, 158, 160, |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 261 | 165, 169, 173, 180, 182, 186, 188, 192, 196, 198, |
| 262 | 202, 204, 206, 208, 212, 216, 220, 222, 224, 228, |
| 263 | 231, 233, 239, 240, 242, 244, 248, 251, 256, 261, |
| 264 | 262, 264, 265, 272, 274, 277, 279, 281, 283, 287, |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 265 | 291, 295, 297, 299, 304, 309, 314, 320, 326, 328, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 266 | 333, 338, 340, 344, 346, 350, 354, 358, 360, 364, |
| 267 | 366, 370, 372, 374, 376, 378, 383, 387, 388, 392, |
| 268 | 394, 396, 398, 400, 402, 404, 406, 408, 410, 414, |
| 269 | 416, 419, 421, 423, 425, 427, 430, 433, 435, 437, |
| 270 | 440, 443, 445, 447, 449, 451, 454, 456, 459, 461, |
| 271 | 463, 465, 467, 469, 471, 473, 475, 477, 479, 481, |
| 272 | 483, 485, 487, 489, 491, 493, 495, 497, 498, 500, |
| 273 | 502, 507, 511, 516, 518, 522, 528, 530, 534, 538, |
| 274 | 542, 547, 551, 553, 557, 561, 565, 569, 571, 573, |
| 275 | 575, 578, 581, 585, 587, 589, 591, 593, 595, 597, |
| 276 | 599, 605, 607, 611, 613, 617, 618, 620, 622, 624, |
| 277 | 626, 628, 630, 634, 639, 641, 645, 648, 652, 654, |
| 278 | 658, 659, 661, 663, 666, 669, 673, 675, 679, 681, |
| 279 | 686, 691, 693, 695, 697, 699, 700, 702, 704, 707, |
| 280 | 710, 712, 714, 716 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 281 | }; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 282 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 283 | static const short yyrhs[] = { 116, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 284 | 0, 117, 0, 116, 117, 0, 208, 118, 34, 122, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 285 | 3, 21, 125, 39, 0, 0, 119, 0, 104, 120, |
| 286 | 105, 0, 104, 105, 0, 121, 0, 120, 121, 0, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 287 | 210, 0, 210, 106, 9, 107, 0, 9, 0, 0, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 288 | 123, 0, 124, 0, 123, 124, 0, 41, 84, 0, |
| 289 | 52, 84, 0, 20, 84, 0, 43, 53, 0, 12, |
| 290 | 57, 0, 0, 126, 0, 127, 0, 126, 127, 0, |
| 291 | 129, 0, 134, 0, 142, 0, 168, 0, 137, 0, |
| 292 | 0, 38, 12, 128, 0, 176, 0, 54, 130, 108, |
| 293 | 0, 54, 46, 0, 131, 0, 130, 131, 0, 132, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 294 | 46, 208, 118, 0, 133, 0, 132, 109, 133, 0, |
| 295 | 208, 0, 210, 0, 42, 135, 108, 0, 42, 17, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 296 | 108, 0, 42, 108, 0, 136, 0, 135, 109, 136, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 297 | 0, 208, 0, 210, 0, 208, 138, 3, 104, 139, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 298 | 105, 0, 163, 0, 173, 0, 0, 140, 0, 141, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 299 | 0, 140, 109, 141, 0, 102, 0, 184, 0, 208, |
| 300 | 3, 206, 87, 0, 208, 3, 161, 0, 208, 3, |
| 301 | 151, 0, 208, 104, 143, 105, 3, 161, 0, 144, |
| 302 | 0, 143, 109, 144, 0, 208, 0, 208, 110, 210, |
| 303 | 0, 173, 110, 210, 0, 146, 0, 145, 109, 146, |
| 304 | 0, 161, 0, 210, 0, 148, 0, 147, 109, 148, |
| 305 | 0, 210, 161, 200, 0, 30, 68, 161, 0, 160, |
| 306 | 0, 150, 0, 149, 109, 150, 0, 210, 161, 0, |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 307 | 160, 0, 28, 104, 153, 105, 155, 0, 0, 88, |
| 308 | 0, 154, 0, 153, 109, 154, 0, 166, 200, 0, |
| 309 | 166, 161, 200, 152, 0, 166, 166, 200, 152, 0, |
| 310 | 0, 156, 0, 0, 95, 82, 104, 157, 158, 105, |
| 311 | 0, 159, 0, 158, 159, 0, 4, 0, 166, 0, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 312 | 102, 0, 102, 111, 171, 0, 102, 111, 205, 0, |
| 313 | 206, 162, 180, 0, 175, 0, 176, 0, 27, 104, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 314 | 149, 105, 0, 78, 104, 147, 105, 0, 79, 104, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 315 | 147, 105, 0, 78, 180, 68, 206, 162, 0, 79, |
| 316 | 180, 68, 206, 162, 0, 18, 0, 18, 35, 25, |
| 317 | 210, 0, 208, 104, 145, 105, 0, 163, 0, 56, |
| 318 | 68, 163, 0, 11, 0, 11, 112, 208, 0, 209, |
| 319 | 112, 208, 0, 11, 112, 210, 0, 209, 0, 209, |
| 320 | 112, 164, 0, 165, 0, 164, 112, 165, 0, 167, |
| 321 | 0, 167, 0, 13, 0, 14, 0, 210, 138, 3, |
| 322 | 169, 0, 210, 110, 169, 0, 0, 104, 170, 172, |
| 323 | 0, 63, 0, 45, 0, 86, 0, 5, 0, 7, |
| 324 | 0, 6, 0, 205, 0, 171, 0, 210, 0, 208, |
| 325 | 112, 210, 0, 4, 0, 172, 4, 0, 24, 0, |
| 326 | 63, 0, 76, 0, 174, 0, 67, 81, 0, 65, |
| 327 | 51, 0, 77, 0, 44, 0, 36, 71, 0, 26, |
| 328 | 81, 0, 91, 0, 47, 0, 58, 0, 40, 0, |
| 329 | 22, 81, 0, 173, 0, 174, 202, 0, 23, 0, |
| 330 | 48, 0, 49, 0, 50, 0, 59, 0, 64, 0, |
| 331 | 74, 0, 83, 0, 85, 0, 90, 0, 92, 0, |
| 332 | 93, 0, 94, 0, 66, 0, 99, 0, 100, 0, |
| 333 | 97, 0, 98, 0, 96, 0, 0, 181, 0, 182, |
| 334 | 0, 80, 106, 183, 107, 0, 106, 183, 107, 0, |
| 335 | 182, 106, 183, 107, 0, 184, 0, 184, 109, 102, |
| 336 | 0, 184, 109, 102, 109, 184, 0, 185, 0, 184, |
| 337 | 177, 185, 0, 184, 178, 185, 0, 185, 179, 185, |
| 338 | 0, 187, 106, 183, 107, 0, 106, 183, 107, 0, |
| 339 | 188, 0, 188, 186, 188, 0, 61, 186, 188, 0, |
| 340 | 188, 186, 60, 0, 61, 186, 60, 0, 194, 0, |
| 341 | 189, 0, 101, 0, 101, 113, 0, 113, 101, 0, |
| 342 | 113, 101, 113, 0, 80, 0, 46, 0, 205, 0, |
| 343 | 210, 0, 6, 0, 45, 0, 86, 0, 95, 30, |
| 344 | 104, 190, 105, 0, 191, 0, 190, 109, 191, 0, |
| 345 | 102, 0, 210, 180, 192, 0, 0, 193, 0, 73, |
| 346 | 0, 15, 0, 69, 0, 195, 0, 196, 0, 104, |
| 347 | 208, 105, 0, 195, 104, 197, 105, 0, 198, 0, |
| 348 | 197, 109, 198, 0, 114, 199, 0, 114, 112, 199, |
| 349 | 0, 210, 0, 199, 112, 210, 0, 0, 201, 0, |
| 350 | 69, 0, 33, 169, 0, 104, 105, 0, 104, 203, |
| 351 | 105, 0, 204, 0, 203, 109, 204, 0, 210, 0, |
| 352 | 210, 106, 205, 107, 0, 210, 106, 171, 107, 0, |
| 353 | 205, 0, 102, 0, 9, 0, 10, 0, 0, 207, |
| 354 | 0, 103, 0, 103, 52, 0, 103, 41, 0, 11, |
| 355 | 0, 12, 0, 12, 0, 8, 0 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 356 | }; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 357 | |
| 358 | #endif |
| 359 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 360 | #if YYDEBUG != 0 |
| 361 | static const short yyrline[] = { 0, |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 362 | 299, 305, 311, 327, 352, 354, 357, 361, 366, 373, |
| 363 | 381, 386, 390, 399, 401, 409, 413, 421, 425, 428, |
| 364 | 431, 435, 455, 457, 465, 469, 501, 505, 514, 521, |
| 365 | 534, 541, 543, 555, 568, 575, 580, 586, 592, 601, |
| 366 | 607, 613, 620, 628, 632, 635, 642, 648, 654, 661, |
| 367 | 670, 680, 688, 696, 698, 708, 711, 715, 718, 730, |
| 368 | 742, 748, 764, 773, 783, 793, 798, 805, 815, 821, |
| 369 | 827, 831, 843, 849, 855, 862, 869, 874, 880, 886, |
| 370 | 892, 897, 907, 909, 912, 920, 926, 935, 941, 958, |
| 371 | 960, 965, 969, 974, 979, 985, 989, 1000, 1009, 1018, |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 372 | 1029, 1051, 1055, 1061, 1067, 1073, 1079, 1088, 1097, 1103, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 373 | 1117, 1141, 1148, 1162, 1171, 1181, 1191, 1201, 1209, 1230, |
| 374 | 1239, 1248, 1249, 1251, 1258, 1270, 1280, 1288, 1288, 1293, |
| 375 | 1298, 1303, 1308, 1312, 1316, 1320, 1323, 1328, 1340, 1356, |
| 376 | 1367, 1381, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, |
| 377 | 1391, 1392, 1393, 1399, 1401, 1402, 1405, 1412, 1424, 1426, |
| 378 | 1430, 1434, 1435, 1436, 1437, 1438, 1442, 1443, 1444, 1445, |
| 379 | 1449, 1450, 1457, 1457, 1458, 1458, 1459, 1461, 1463, 1468, |
| 380 | 1472, 1481, 1485, 1490, 1494, 1500, 1510, 1514, 1517, 1520, |
| 381 | 1525, 1534, 1542, 1548, 1555, 1563, 1571, 1580, 1583, 1588, |
| 382 | 1590, 1591, 1592, 1595, 1599, 1604, 1608, 1619, 1623, 1628, |
| 383 | 1635, 1641, 1645, 1650, 1656, 1668, 1670, 1673, 1677, 1680, |
| 384 | 1685, 1689, 1697, 1712, 1718, 1725, 1738, 1750, 1765, 1769, |
| 385 | 1786, 1791, 1794, 1799, 1821, 1826, 1831, 1837, 1843, 1851, |
| 386 | 1859, 1867, 1874, 1884, 1889, 1919, 1921, 1924, 1929, 1933, |
| 387 | 1939, 1944, 1951, 1958 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 388 | }; |
| 389 | #endif |
| 390 | |
| 391 | |
| 392 | #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) |
| 393 | |
| 394 | static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ", |
| 395 | "TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number", |
| 396 | "TOK_number_negative","TOK_typereference","TOK_capitalreference","TOK_typefieldreference", |
| 397 | "TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY", |
| 398 | "TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN", |
| 399 | "TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS", |
| 400 | "TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED", |
| 401 | "TOK_EMBEDDED","TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED", |
| 402 | "TOK_EXPLICIT","TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE", |
| 403 | "TOK_FROM","TOK_GeneralizedTime","TOK_GeneralString","TOK_GraphicString","TOK_IA5String", |
| 404 | "TOK_IDENTIFIER","TOK_IMPLICIT","TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE", |
| 405 | "TOK_INSTRUCTIONS","TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY", |
| 406 | "TOK_NULL","TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET", |
| 407 | "TOK_OF","TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT", |
| 408 | "TOK_PrintableString","TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE", |
| 409 | "TOK_SET","TOK_SIZE","TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString", |
| 410 | "TOK_TRUE","TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString", |
| 411 | "TOK_UTCTime","TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH", |
| 412 | "TOK_EXCEPT","'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots", |
| 413 | "TOK_tag","'{'","'}'","'('","')'","';'","','","':'","'!'","'.'","'<'","'@'", |
| 414 | "ParsedGrammar","ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier", |
| 415 | "ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags", |
| 416 | "ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody", |
| 417 | "ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition", |
| 418 | "ImportsBundleSet","ImportsBundle","ImportsList","ImportsElement","ExportsDefinition", |
| 419 | "ExportsBody","ExportsElement","ValueSetDefinition","DefinedTypeRef","optValueSetBody", |
| 420 | "ValueSetBody","ValueSetElement","DataTypeReference","ParameterArgumentList", |
| 421 | "ParameterArgumentName","ActualParameterList","ActualParameter","ComponentTypeLists", |
| 422 | "ComponentType","AlternativeTypeLists","AlternativeType","ClassDeclaration", |
| 423 | "optUnique","ClassFieldList","ClassField","optWithSyntax","WithSyntax","@2", |
| 424 | "WithSyntaxFormat","WithSyntaxFormatToken","ExtensionAndException","Type","TypeDeclaration", |
| 425 | "ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement", |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 426 | "ClassFieldIdentifier","ClassFieldName","ValueDefinition","Value","@3","DefinedValue", |
| 427 | "Opaque","BasicTypeId","BasicTypeId_UniverationCompatible","BasicType","BasicString", |
| 428 | "Union","Intersection","Except","optConstraints","Constraints","SetOfConstraints", |
| 429 | "ElementSetSpecs","ElementSetSpec","ConstraintSubtypeElement","ConstraintRangeSpec", |
| 430 | "ConstraintSpec","ConstraintValue","WithComponents","WithComponentsList","WithComponentsElement", |
| 431 | "optPresenceConstraint","PresenceConstraint","TableConstraint","SimpleTableConstraint", |
| 432 | "ComponentRelationConstraint","AtNotationList","AtNotationElement","ComponentIdList", |
| 433 | "optMarker","Marker","UniverationDefinition","UniverationList","UniverationElement", |
| 434 | "SignedNumber","optTag","Tag","TypeRefName","ObjectClassReference","Identifier", NULL |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 435 | }; |
| 436 | #endif |
| 437 | |
| 438 | static const short yyr1[] = { 0, |
| 439 | 115, 116, 116, 117, 118, 118, 119, 119, 120, 120, |
| 440 | 121, 121, 121, 122, 122, 123, 123, 124, 124, 124, |
| 441 | 124, 124, 125, 125, 126, 126, 127, 127, 127, 127, |
| 442 | 127, 128, 127, 127, 129, 129, 130, 130, 131, 132, |
| 443 | 132, 133, 133, 134, 134, 134, 135, 135, 136, 136, |
| 444 | 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, |
| 445 | 142, 142, 142, 143, 143, 144, 144, 144, 145, 145, |
| 446 | 146, 146, 147, 147, 148, 148, 148, 149, 149, 150, |
| 447 | 150, 151, 152, 152, 153, 153, 154, 154, 154, 155, |
| 448 | 155, 157, 156, 158, 158, 159, 159, 160, 160, 160, |
| 449 | 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 450 | 162, 162, 162, 163, 163, 163, 163, 163, 163, 164, |
| 451 | 164, 165, 166, 167, 167, 168, 169, 170, 169, 169, |
| 452 | 169, 169, 169, 169, 169, 169, 169, 171, 171, 172, |
| 453 | 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, |
| 454 | 173, 173, 173, 174, 174, 174, 175, 175, 176, 176, |
| 455 | 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, |
| 456 | 176, 176, 177, 177, 178, 178, 179, 180, 180, 181, |
| 457 | 181, 182, 182, 183, 183, 183, 184, 184, 184, 184, |
| 458 | 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, |
| 459 | 186, 186, 186, 187, 187, 188, 188, 188, 188, 188, |
| 460 | 189, 190, 190, 191, 191, 192, 192, 193, 193, 193, |
| 461 | 194, 194, 195, 196, 197, 197, 198, 198, 199, 199, |
| 462 | 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, |
| 463 | 204, 204, 204, 205, 205, 206, 206, 207, 207, 207, |
| 464 | 208, 208, 209, 210 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 465 | }; |
| 466 | |
| 467 | static const short yyr2[] = { 0, |
| 468 | 1, 1, 2, 8, 0, 1, 3, 2, 1, 2, |
| 469 | 1, 4, 1, 0, 1, 1, 2, 2, 2, 2, |
| 470 | 2, 2, 0, 1, 1, 2, 1, 1, 1, 1, |
| 471 | 1, 0, 3, 1, 3, 2, 1, 2, 4, 1, |
| 472 | 3, 1, 1, 3, 3, 2, 1, 3, 1, 1, |
| 473 | 6, 1, 1, 0, 1, 1, 3, 1, 1, 4, |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 474 | 3, 3, 6, 1, 3, 1, 3, 3, 1, 3, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 475 | 1, 1, 1, 3, 3, 3, 1, 1, 3, 2, |
| 476 | 1, 5, 0, 1, 1, 3, 2, 4, 4, 0, |
| 477 | 1, 0, 6, 1, 2, 1, 1, 1, 3, 3, |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 478 | 3, 1, 1, 4, 4, 4, 5, 5, 1, 4, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 479 | 4, 1, 3, 1, 3, 3, 3, 1, 3, 1, |
| 480 | 3, 1, 1, 1, 1, 4, 3, 0, 3, 1, |
| 481 | 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, |
| 482 | 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, |
| 483 | 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 484 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 485 | 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, |
| 486 | 4, 3, 4, 1, 3, 5, 1, 3, 3, 3, |
| 487 | 4, 3, 1, 3, 3, 3, 3, 1, 1, 1, |
| 488 | 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, |
| 489 | 5, 1, 3, 1, 3, 0, 1, 1, 1, 1, |
| 490 | 1, 1, 3, 4, 1, 3, 2, 3, 1, 3, |
| 491 | 0, 1, 1, 2, 2, 3, 1, 3, 1, 4, |
| 492 | 4, 1, 1, 1, 1, 0, 1, 1, 2, 2, |
| 493 | 1, 1, 1, 1 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 494 | }; |
| 495 | |
| 496 | static const short yydefact[] = { 0, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 497 | 251, 252, 1, 2, 5, 3, 0, 0, 6, 254, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 498 | 13, 8, 0, 9, 11, 14, 7, 10, 0, 0, |
| 499 | 0, 0, 0, 0, 0, 15, 16, 0, 22, 20, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 500 | 18, 21, 19, 0, 17, 12, 23, 159, 0, 0, |
| 501 | 160, 161, 162, 0, 163, 164, 172, 165, 166, 167, |
| 502 | 168, 169, 170, 171, 0, 24, 25, 27, 28, 31, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 503 | 29, 30, 34, 0, 0, 32, 0, 46, 0, 47, |
| 504 | 49, 50, 36, 0, 37, 0, 40, 42, 43, 4, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 505 | 26, 246, 114, 253, 0, 142, 0, 0, 155, 149, |
| 506 | 153, 154, 143, 0, 0, 144, 148, 152, 0, 0, |
| 507 | 52, 53, 145, 118, 0, 33, 45, 44, 0, 35, |
| 508 | 38, 0, 0, 0, 248, 62, 61, 0, 247, 0, |
| 509 | 156, 151, 150, 147, 146, 0, 64, 0, 66, 0, |
| 510 | 0, 0, 48, 5, 41, 0, 250, 249, 114, 253, |
| 511 | 109, 0, 0, 178, 178, 60, 178, 112, 157, 145, |
| 512 | 102, 103, 0, 115, 117, 0, 0, 0, 0, 54, |
| 513 | 124, 125, 119, 120, 122, 116, 133, 135, 134, 244, |
| 514 | 245, 131, 130, 132, 128, 126, 137, 136, 0, 138, |
| 515 | 39, 0, 85, 246, 123, 0, 0, 0, 0, 0, |
| 516 | 0, 0, 179, 180, 0, 0, 101, 0, 158, 246, |
| 517 | 246, 65, 68, 67, 208, 209, 205, 0, 204, 210, |
| 518 | 0, 58, 0, 0, 0, 55, 56, 59, 187, 0, |
| 519 | 193, 199, 198, 221, 222, 206, 207, 0, 0, 0, |
| 520 | 0, 90, 0, 0, 233, 231, 231, 87, 232, 0, |
| 521 | 0, 98, 0, 78, 81, 246, 113, 0, 0, 0, |
| 522 | 73, 77, 246, 0, 184, 246, 0, 0, 246, 243, |
| 523 | 235, 0, 237, 242, 239, 0, 69, 71, 72, 63, |
| 524 | 200, 0, 0, 0, 0, 0, 51, 0, 175, 176, |
| 525 | 173, 174, 0, 0, 177, 0, 0, 0, 0, 121, |
| 526 | 140, 129, 139, 127, 0, 82, 91, 86, 234, 83, |
| 527 | 83, 110, 0, 104, 0, 80, 0, 246, 105, 0, |
| 528 | 231, 182, 0, 0, 0, 106, 0, 236, 0, 0, |
| 529 | 111, 246, 201, 202, 197, 195, 0, 223, 192, 57, |
| 530 | 188, 189, 190, 0, 196, 194, 0, 0, 225, 141, |
| 531 | 0, 84, 88, 89, 99, 100, 138, 79, 181, 76, |
| 532 | 74, 75, 185, 107, 183, 108, 238, 0, 0, 70, |
| 533 | 203, 214, 0, 212, 178, 191, 0, 227, 229, 224, |
| 534 | 0, 92, 0, 241, 240, 211, 0, 216, 228, 0, |
| 535 | 226, 0, 186, 213, 219, 220, 218, 215, 217, 230, |
| 536 | 96, 0, 94, 97, 93, 95, 0, 0, 0 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 537 | }; |
| 538 | |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 539 | static const short yydefgoto[] = { 397, |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 540 | 3, 4, 8, 9, 13, 14, 25, 26, 27, 55, |
| 541 | 56, 57, 106, 58, 74, 75, 76, 77, 59, 69, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 542 | 70, 60, 100, 215, 216, 217, 61, 126, 127, 266, |
| 543 | 267, 250, 251, 243, 244, 116, 343, 182, 183, 296, |
| 544 | 297, 382, 392, 393, 252, 268, 147, 148, 163, 164, |
| 545 | 184, 185, 62, 176, 229, 177, 292, 149, 103, 151, |
| 546 | 152, 283, 284, 286, 192, 193, 194, 254, 255, 219, |
| 547 | 273, 220, 221, 222, 363, 364, 388, 389, 223, 224, |
| 548 | 225, 338, 339, 368, 238, 239, 199, 262, 263, 226, |
| 549 | 240, 119, 179, 104, 227 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 550 | }; |
| 551 | |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 552 | static const short yypact[] = { 42, |
| 553 | -32768,-32768, 42,-32768, -6,-32768, 72, 111,-32768,-32768, |
| 554 | -32768,-32768, 74,-32768, -1, 162,-32768,-32768, 138, 99, |
| 555 | 83, 91, 123, 97, 222, 162,-32768, 121,-32768,-32768, |
| 556 | -32768,-32768,-32768, 209,-32768,-32768, 313,-32768, 219, 33, |
| 557 | -32768,-32768,-32768, 96,-32768,-32768,-32768,-32768,-32768,-32768, |
| 558 | -32768,-32768,-32768,-32768, 210, 313,-32768,-32768,-32768,-32768, |
| 559 | -32768,-32768,-32768, 12, 527,-32768, 185,-32768, -18,-32768, |
| 560 | -32768,-32768,-32768, 49,-32768, -25,-32768,-32768,-32768,-32768, |
| 561 | -32768, -3, 145,-32768, 186,-32768, 202, 229,-32768,-32768, |
| 562 | -32768,-32768,-32768, 250, 223,-32768,-32768,-32768, 544, 302, |
| 563 | -32768,-32768,-32768, 194, 311,-32768,-32768,-32768, 158,-32768, |
| 564 | -32768, 42, 158, 214, 102,-32768,-32768, 390,-32768, 158, |
| 565 | -32768,-32768,-32768,-32768,-32768, 87,-32768, 213, 216, 225, |
| 566 | 297, 254,-32768, -6,-32768, 124,-32768,-32768, -57, 231, |
| 567 | 292, 233, 270, -12, 149,-32768, -37,-32768,-32768, 235, |
| 568 | -32768,-32768, 237,-32768,-32768, 339, 544, 335, 335, 152, |
| 569 | -32768,-32768, 232,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 570 | -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 238, 236, |
| 571 | -32768, 90,-32768, 176,-32768, 320, 8, 207, 241, 32, |
| 572 | 140, 281,-32768, 246, 32, 285,-32768, 63,-32768, 20, |
| 573 | 251,-32768,-32768,-32768,-32768,-32768,-32768, -16,-32768,-32768, |
| 574 | 326,-32768, 42, 140, 252, 255,-32768, 234, 263, 259, |
| 575 | -16,-32768,-32768, 264,-32768,-32768,-32768, 124, 362, 335, |
| 576 | 254, 274, 124, 254,-32768, 18, 18,-32768,-32768, 467, |
| 577 | 335, 260, 101,-32768,-32768, 251,-32768, 140, 306, 131, |
| 578 | -32768,-32768, 251, 268, 177, 251, 140, 132, 251,-32768, |
| 579 | -32768, 134,-32768,-32768, 272, 164,-32768,-32768,-32768,-32768, |
| 580 | 267, 275, 242, 277, 278, 279,-32768, 152,-32768,-32768, |
| 581 | -32768,-32768, 140, 140,-32768, 140, 140, 262, 271,-32768, |
| 582 | -32768, 378,-32768,-32768, 307,-32768,-32768,-32768,-32768, 296, |
| 583 | 296,-32768, 280,-32768, 8,-32768, 283, 251,-32768, 32, |
| 584 | 18,-32768, 286, 467, 284,-32768, 467,-32768, 10, 280, |
| 585 | -32768, 20,-32768, 282,-32768,-32768, 27,-32768,-32768,-32768, |
| 586 | -32768,-32768,-32768, 287,-32768,-32768, 5, 173,-32768,-32768, |
| 587 | 288,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 588 | -32768,-32768, 290,-32768,-32768,-32768,-32768, 293, 303,-32768, |
| 589 | -32768,-32768, 175,-32768, -37,-32768, 335, 299,-32768,-32768, |
| 590 | 271,-32768, 140,-32768,-32768,-32768, 27, 71, 299, 335, |
| 591 | -32768, 159, 234,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
| 592 | -32768, 13,-32768,-32768,-32768,-32768, 393, 397,-32768 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 593 | }; |
| 594 | |
| 595 | static const short yypgoto[] = {-32768, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 596 | -32768, 401, 289,-32768,-32768, 396,-32768,-32768, 389,-32768, |
| 597 | -32768, 363,-32768,-32768,-32768, 344,-32768, 308,-32768,-32768, |
| 598 | 315,-32768, 355,-32768,-32768, 144,-32768,-32768, 276,-32768, |
| 599 | 103, 240, 117,-32768, 126,-32768, 127,-32768, 196,-32768, |
| 600 | -32768,-32768,-32768, 40, -173, -75, -218, -53,-32768, 208, |
| 601 | -180, -109,-32768, -23,-32768, -167,-32768, -33, -110,-32768, |
| 602 | 37,-32768,-32768,-32768, -144,-32768,-32768, -93, -151, 11, |
| 603 | 220,-32768, -210,-32768,-32768, 65,-32768,-32768,-32768,-32768, |
| 604 | -32768,-32768, 73, 76, -172,-32768,-32768,-32768, 128, -103, |
| 605 | -72,-32768, 2,-32768, -7 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 606 | }; |
| 607 | |
| 608 | |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 609 | #define YYLAST 635 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 610 | |
| 611 | |
| 612 | static const short yytable[] = { 15, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 613 | 196, 5, 197, 237, 5, 15, 117, 150, 218, 118, |
| 614 | 101, 101, 10, 245, 82, 10, 391, 10, 170, 171, |
| 615 | 112, 165, 83, 84, 114, 161, 162, 10, 178, 65, |
| 616 | 102, 102, 72, 85, 10, 86, 79, 87, 64, 10, |
| 617 | 10, 71, 189, 1, 2, 78, -251, 88, 65, 67, |
| 618 | 234, 89, 1, 2, 120, 90, 10, 64, 91, 1, |
| 619 | 2, 249, 326, 300, 301, 128, 79, 189, 191, 92, |
| 620 | 10, 170, 171, 63, 93, 78, 94, 336, 95, 10, |
| 621 | 11, 10, 11, 113, 271, 385, 235, 96, 97, 108, |
| 622 | 109, 190, 63, 191, 264, 354, 272, 7, 356, 115, |
| 623 | 129, 72, 98, 10, 19, 79, 1, 2, 236, 242, |
| 624 | 71, 260, 155, 134, 78, 99, 367, 395, 165, 153, |
| 625 | 276, 154, 115, 128, 180, 270, 218, 178, 362, 150, |
| 626 | 178, 245, 166, 242, 247, 345, 161, 162, 352, 386, |
| 627 | 68, 73, 137, 387, 16, 205, 28, 10, 170, 171, |
| 628 | 203, 204, 358, 138, 307, 29, 110, 205, 129, 10, |
| 629 | 170, 171, 391, 315, 260, 10, 30, 261, 1, 2, |
| 630 | 306, 161, 162, 20, 31, 32, 12, 311, 17, 246, |
| 631 | 33, 21, 253, 314, 206, 207, 317, 253, 161, 162, |
| 632 | 265, 156, 269, 334, 232, 157, 206, 207, 233, 346, |
| 633 | 208, 394, 22, 150, 23, 304, 150, 294, 234, 305, |
| 634 | 299, 394, 208, 24, 275, 264, 359, 83, 84, 209, |
| 635 | 378, 383, 293, 180, 34, 210, 180, 36, 189, 37, |
| 636 | 66, 209, 350, 302, 211, 309, 316, 210, 318, 310, |
| 637 | 310, 153, 319, 213, 235, 214, 211, 205, 80, 10, |
| 638 | 170, 171, 195, 212, 191, 213, 120, 214, 167, 168, |
| 639 | 169, 10, 170, 171, 1, 2, 121, 205, 321, 10, |
| 640 | 170, 171, 322, 279, 280, 281, 282, 370, 115, 376, |
| 641 | -231, 371, 122, 377, -231, 313, 206, 10, 170, 171, |
| 642 | 1, 2, 107, 331, 332, 347, 333, 246, 172, 123, |
| 643 | 124, 325, 253, 125, 130, 131, 206, 1, 2, 161, |
| 644 | 162, 265, 347, 132, 269, 153, 173, 136, 153, 365, |
| 645 | 10, 335, 158, 1, 2, 159, 186, 210, 160, 369, |
| 646 | 279, 280, 281, 282, -252, 38, 187, 188, 198, 174, |
| 647 | 200, 201, 10, 228, 241, 231, 248, 210, 256, 230, |
| 648 | 39, 257, 259, 115, 40, 274, 277, 175, 285, 369, |
| 649 | 41, 42, 43, 278, 287, 291, 44, 289, 295, 365, |
| 650 | 303, 45, 390, 308, 312, 324, 46, 320, 47, 323, |
| 651 | 327, 340, 328, 342, 337, 329, 48, 353, 341, 349, |
| 652 | 355, 372, 398, 366, 361, 49, 399, 50, 373, 374, |
| 653 | 139, 140, 51, 6, 52, 53, 54, 141, 18, 375, |
| 654 | 380, 85, 38, 86, 35, 87, 142, 111, 81, 105, |
| 655 | 135, 330, 181, 133, 360, 88, 351, 344, 298, 89, |
| 656 | 348, 396, 202, 90, 258, 290, 91, 41, 42, 43, |
| 657 | 288, 384, 379, 381, 0, 143, 357, 92, 45, 0, |
| 658 | 0, 0, 93, 46, 94, 47, 95, 0, 0, 0, |
| 659 | 0, 0, 0, 48, 0, 96, 97, 144, 145, 0, |
| 660 | 0, 0, 49, 0, 50, 0, 146, 139, 140, 51, |
| 661 | 98, 52, 53, 54, 141, 0, 0, 0, 85, 38, |
| 662 | 86, 0, 87, 142, 0, 0, 0, 0, 0, 0, |
| 663 | 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, |
| 664 | 90, 0, 0, 91, 41, 42, 43, 0, 0, 0, |
| 665 | 0, 0, 143, 0, 92, 45, 0, 0, 0, 93, |
| 666 | 46, 94, 47, 95, 0, 0, 0, 83, 84, 0, |
| 667 | 48, 0, 96, 97, 144, 145, 0, 0, 85, 49, |
| 668 | 86, 50, 87, 0, 1, 2, 51, 98, 52, 53, |
| 669 | 54, 0, 88, 0, 0, 85, 89, 86, 0, 87, |
| 670 | 90, 0, 0, 91, 0, 0, 0, 0, 0, 88, |
| 671 | 0, 0, 0, 89, 92, 0, 0, 90, 0, 93, |
| 672 | 91, 94, 0, 95, 0, 0, 0, 0, 0, 0, |
| 673 | 0, 92, 96, 97, 0, 0, 93, 0, 94, 0, |
| 674 | 95, 0, 0, 0, 0, 0, 0, 98, 0, 96, |
| 675 | 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 676 | 0, 0, 0, 0, 98 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 677 | }; |
| 678 | |
| 679 | static const short yycheck[] = { 7, |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 680 | 145, 0, 147, 184, 3, 13, 82, 118, 160, 82, |
| 681 | 64, 65, 8, 187, 3, 8, 4, 8, 9, 10, |
| 682 | 46, 131, 11, 12, 28, 13, 14, 8, 132, 37, |
| 683 | 64, 65, 40, 22, 8, 24, 44, 26, 37, 8, |
| 684 | 8, 40, 80, 11, 12, 44, 104, 36, 56, 17, |
| 685 | 33, 40, 11, 12, 112, 44, 8, 56, 47, 11, |
| 686 | 12, 30, 273, 236, 237, 99, 74, 80, 106, 58, |
| 687 | 8, 9, 10, 37, 63, 74, 65, 288, 67, 8, |
| 688 | 9, 8, 9, 109, 101, 15, 69, 76, 77, 108, |
| 689 | 109, 104, 56, 106, 198, 314, 113, 104, 317, 103, |
| 690 | 99, 109, 91, 8, 106, 113, 11, 12, 184, 102, |
| 691 | 109, 102, 120, 112, 113, 104, 112, 105, 228, 118, |
| 692 | 214, 120, 103, 157, 132, 201, 278, 231, 102, 240, |
| 693 | 234, 305, 131, 102, 188, 303, 13, 14, 311, 69, |
| 694 | 108, 46, 41, 73, 34, 6, 9, 8, 9, 10, |
| 695 | 158, 159, 320, 52, 248, 57, 108, 6, 157, 8, |
| 696 | 9, 10, 4, 257, 102, 8, 84, 105, 11, 12, |
| 697 | 246, 13, 14, 12, 84, 53, 105, 253, 105, 187, |
| 698 | 84, 20, 190, 256, 45, 46, 259, 195, 13, 14, |
| 699 | 198, 105, 200, 287, 105, 109, 45, 46, 109, 303, |
| 700 | 61, 382, 41, 314, 43, 105, 317, 231, 33, 109, |
| 701 | 234, 392, 61, 52, 213, 319, 320, 11, 12, 80, |
| 702 | 365, 373, 230, 231, 3, 86, 234, 107, 80, 21, |
| 703 | 12, 80, 308, 241, 95, 105, 105, 86, 105, 109, |
| 704 | 109, 240, 109, 104, 69, 106, 95, 6, 39, 8, |
| 705 | 9, 10, 104, 102, 106, 104, 112, 106, 5, 6, |
| 706 | 7, 8, 9, 10, 11, 12, 81, 6, 105, 8, |
| 707 | 9, 10, 109, 97, 98, 99, 100, 105, 103, 105, |
| 708 | 105, 109, 81, 109, 109, 109, 45, 8, 9, 10, |
| 709 | 11, 12, 108, 283, 284, 303, 286, 305, 45, 71, |
| 710 | 51, 60, 310, 81, 3, 112, 45, 11, 12, 13, |
| 711 | 14, 319, 320, 3, 322, 314, 63, 104, 317, 327, |
| 712 | 8, 60, 110, 11, 12, 110, 35, 86, 104, 337, |
| 713 | 97, 98, 99, 100, 104, 23, 104, 68, 104, 86, |
| 714 | 104, 3, 8, 112, 25, 110, 106, 86, 68, 112, |
| 715 | 38, 106, 68, 103, 42, 30, 105, 104, 96, 367, |
| 716 | 48, 49, 50, 109, 106, 4, 54, 104, 95, 377, |
| 717 | 111, 59, 380, 68, 107, 101, 64, 106, 66, 113, |
| 718 | 104, 4, 105, 88, 114, 107, 74, 102, 82, 107, |
| 719 | 107, 104, 0, 107, 113, 83, 0, 85, 109, 107, |
| 720 | 11, 12, 90, 3, 92, 93, 94, 18, 13, 107, |
| 721 | 112, 22, 23, 24, 26, 26, 27, 74, 56, 65, |
| 722 | 113, 278, 134, 109, 322, 36, 310, 301, 233, 40, |
| 723 | 305, 392, 157, 44, 195, 228, 47, 48, 49, 50, |
| 724 | 221, 377, 367, 371, -1, 56, 319, 58, 59, -1, |
| 725 | -1, -1, 63, 64, 65, 66, 67, -1, -1, -1, |
| 726 | -1, -1, -1, 74, -1, 76, 77, 78, 79, -1, |
| 727 | -1, -1, 83, -1, 85, -1, 87, 11, 12, 90, |
| 728 | 91, 92, 93, 94, 18, -1, -1, -1, 22, 23, |
| 729 | 24, -1, 26, 27, -1, -1, -1, -1, -1, -1, |
| 730 | -1, -1, 36, -1, -1, -1, 40, -1, -1, -1, |
| 731 | 44, -1, -1, 47, 48, 49, 50, -1, -1, -1, |
| 732 | -1, -1, 56, -1, 58, 59, -1, -1, -1, 63, |
| 733 | 64, 65, 66, 67, -1, -1, -1, 11, 12, -1, |
| 734 | 74, -1, 76, 77, 78, 79, -1, -1, 22, 83, |
| 735 | 24, 85, 26, -1, 11, 12, 90, 91, 92, 93, |
| 736 | 94, -1, 36, -1, -1, 22, 40, 24, -1, 26, |
| 737 | 44, -1, -1, 47, -1, -1, -1, -1, -1, 36, |
| 738 | -1, -1, -1, 40, 58, -1, -1, 44, -1, 63, |
| 739 | 47, 65, -1, 67, -1, -1, -1, -1, -1, -1, |
| 740 | -1, 58, 76, 77, -1, -1, 63, -1, 65, -1, |
| 741 | 67, -1, -1, -1, -1, -1, -1, 91, -1, 76, |
| 742 | 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 743 | -1, -1, -1, -1, 91 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 744 | }; |
| 745 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
| 746 | #line 3 "/usr/share/bison.simple" |
| 747 | /* This file comes from bison-1.28. */ |
| 748 | |
| 749 | /* Skeleton output parser for bison, |
| 750 | Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. |
| 751 | |
| 752 | This program is free software; you can redistribute it and/or modify |
| 753 | it under the terms of the GNU General Public License as published by |
| 754 | the Free Software Foundation; either version 2, or (at your option) |
| 755 | any later version. |
| 756 | |
| 757 | This program is distributed in the hope that it will be useful, |
| 758 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 759 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 760 | GNU General Public License for more details. |
| 761 | |
| 762 | You should have received a copy of the GNU General Public License |
| 763 | along with this program; if not, write to the Free Software |
| 764 | Foundation, Inc., 59 Temple Place - Suite 330, |
| 765 | Boston, MA 02111-1307, USA. */ |
| 766 | |
| 767 | /* As a special exception, when this file is copied by Bison into a |
| 768 | Bison output file, you may use that output file without restriction. |
| 769 | This special exception was added by the Free Software Foundation |
| 770 | in version 1.24 of Bison. */ |
| 771 | |
| 772 | /* This is the parser code that is written into each bison parser |
| 773 | when the %semantic_parser declaration is not specified in the grammar. |
| 774 | It was written by Richard Stallman by simplifying the hairy parser |
| 775 | used when %semantic_parser is specified. */ |
| 776 | |
| 777 | #ifndef YYSTACK_USE_ALLOCA |
| 778 | #ifdef alloca |
| 779 | #define YYSTACK_USE_ALLOCA |
| 780 | #else /* alloca not defined */ |
| 781 | #ifdef __GNUC__ |
| 782 | #define YYSTACK_USE_ALLOCA |
| 783 | #define alloca __builtin_alloca |
| 784 | #else /* not GNU C. */ |
| 785 | #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) |
| 786 | #define YYSTACK_USE_ALLOCA |
| 787 | #include <alloca.h> |
| 788 | #else /* not sparc */ |
| 789 | /* We think this test detects Watcom and Microsoft C. */ |
| 790 | /* This used to test MSDOS, but that is a bad idea |
| 791 | since that symbol is in the user namespace. */ |
| 792 | #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) |
| 793 | #if 0 /* No need for malloc.h, which pollutes the namespace; |
| 794 | instead, just don't use alloca. */ |
| 795 | #include <malloc.h> |
| 796 | #endif |
| 797 | #else /* not MSDOS, or __TURBOC__ */ |
| 798 | #if defined(_AIX) |
| 799 | /* I don't know what this was needed for, but it pollutes the namespace. |
| 800 | So I turned it off. rms, 2 May 1997. */ |
| 801 | /* #include <malloc.h> */ |
| 802 | #pragma alloca |
| 803 | #define YYSTACK_USE_ALLOCA |
| 804 | #else /* not MSDOS, or __TURBOC__, or _AIX */ |
| 805 | #if 0 |
| 806 | #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, |
| 807 | and on HPUX 10. Eventually we can turn this on. */ |
| 808 | #define YYSTACK_USE_ALLOCA |
| 809 | #define alloca __builtin_alloca |
| 810 | #endif /* __hpux */ |
| 811 | #endif |
| 812 | #endif /* not _AIX */ |
| 813 | #endif /* not MSDOS, or __TURBOC__ */ |
| 814 | #endif /* not sparc */ |
| 815 | #endif /* not GNU C */ |
| 816 | #endif /* alloca not defined */ |
| 817 | #endif /* YYSTACK_USE_ALLOCA not defined */ |
| 818 | |
| 819 | #ifdef YYSTACK_USE_ALLOCA |
| 820 | #define YYSTACK_ALLOC alloca |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 821 | #else |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 822 | #define YYSTACK_ALLOC malloc |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 823 | #endif |
| 824 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 825 | /* Note: there must be only one dollar sign in this file. |
| 826 | It is replaced by the list of actions, each action |
| 827 | as one case of the switch. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 828 | |
| 829 | #define yyerrok (yyerrstatus = 0) |
| 830 | #define yyclearin (yychar = YYEMPTY) |
| 831 | #define YYEMPTY -2 |
| 832 | #define YYEOF 0 |
| 833 | #define YYACCEPT goto yyacceptlab |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 834 | #define YYABORT goto yyabortlab |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 835 | #define YYERROR goto yyerrlab1 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 836 | /* Like YYERROR except do call yyerror. |
| 837 | This remains here temporarily to ease the |
| 838 | transition to the new meaning of YYERROR, for GCC. |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 839 | Once GCC version 2 has supplanted version 1, this can go. */ |
| 840 | #define YYFAIL goto yyerrlab |
| 841 | #define YYRECOVERING() (!!yyerrstatus) |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 842 | #define YYBACKUP(token, value) \ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 843 | do \ |
| 844 | if (yychar == YYEMPTY && yylen == 1) \ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 845 | { yychar = (token), yylval = (value); \ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 846 | yychar1 = YYTRANSLATE (yychar); \ |
| 847 | YYPOPSTACK; \ |
| 848 | goto yybackup; \ |
| 849 | } \ |
| 850 | else \ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 851 | { yyerror ("syntax error: cannot back up"); YYERROR; } \ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 852 | while (0) |
| 853 | |
| 854 | #define YYTERROR 1 |
| 855 | #define YYERRCODE 256 |
| 856 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 857 | #ifndef YYPURE |
| 858 | #define YYLEX yylex() |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 859 | #endif |
| 860 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 861 | #ifdef YYPURE |
| 862 | #ifdef YYLSP_NEEDED |
| 863 | #ifdef YYLEX_PARAM |
| 864 | #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) |
| 865 | #else |
| 866 | #define YYLEX yylex(&yylval, &yylloc) |
| 867 | #endif |
| 868 | #else /* not YYLSP_NEEDED */ |
| 869 | #ifdef YYLEX_PARAM |
| 870 | #define YYLEX yylex(&yylval, YYLEX_PARAM) |
| 871 | #else |
| 872 | #define YYLEX yylex(&yylval) |
| 873 | #endif |
| 874 | #endif /* not YYLSP_NEEDED */ |
| 875 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 876 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 877 | /* If nonreentrant, generate the variables here */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 878 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 879 | #ifndef YYPURE |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 880 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 881 | int yychar; /* the lookahead symbol */ |
| 882 | YYSTYPE yylval; /* the semantic value of the */ |
| 883 | /* lookahead symbol */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 884 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 885 | #ifdef YYLSP_NEEDED |
| 886 | YYLTYPE yylloc; /* location data for the lookahead */ |
| 887 | /* symbol */ |
| 888 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 889 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 890 | int yynerrs; /* number of parse errors so far */ |
| 891 | #endif /* not YYPURE */ |
| 892 | |
| 893 | #if YYDEBUG != 0 |
| 894 | int yydebug; /* nonzero means print parse trace */ |
| 895 | /* Since this is uninitialized, it does not stop multiple parsers |
| 896 | from coexisting. */ |
| 897 | #endif |
| 898 | |
| 899 | /* YYINITDEPTH indicates the initial size of the parser's stacks */ |
| 900 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 901 | #ifndef YYINITDEPTH |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 902 | #define YYINITDEPTH 200 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 903 | #endif |
| 904 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 905 | /* YYMAXDEPTH is the maximum size the stacks can grow to |
| 906 | (effective only if the built-in stack extension method is used). */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 907 | |
| 908 | #if YYMAXDEPTH == 0 |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 909 | #undef YYMAXDEPTH |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 910 | #endif |
| 911 | |
| 912 | #ifndef YYMAXDEPTH |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 913 | #define YYMAXDEPTH 10000 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 914 | #endif |
| 915 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 916 | /* Define __yy_memcpy. Note that the size argument |
| 917 | should be passed with type unsigned int, because that is what the non-GCC |
| 918 | definitions require. With GCC, __builtin_memcpy takes an arg |
| 919 | of type size_t, but it can handle unsigned int. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 920 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 921 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ |
| 922 | #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) |
| 923 | #else /* not GNU C or C++ */ |
| 924 | #ifndef __cplusplus |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 925 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 926 | /* This is the most reliable way to avoid incompatibilities |
| 927 | in available built-in functions on various systems. */ |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 928 | static void |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 929 | __yy_memcpy (to, from, count) |
| 930 | char *to; |
| 931 | char *from; |
| 932 | unsigned int count; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 933 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 934 | register char *f = from; |
| 935 | register char *t = to; |
| 936 | register int i = count; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 937 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 938 | while (i-- > 0) |
| 939 | *t++ = *f++; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 940 | } |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 941 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 942 | #else /* __cplusplus */ |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 943 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 944 | /* This is the most reliable way to avoid incompatibilities |
| 945 | in available built-in functions on various systems. */ |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 946 | static void |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 947 | __yy_memcpy (char *to, char *from, unsigned int count) |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 948 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 949 | register char *t = to; |
| 950 | register char *f = from; |
| 951 | register int i = count; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 952 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 953 | while (i-- > 0) |
| 954 | *t++ = *f++; |
vlm | 044f744 | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 955 | } |
vlm | 044f744 | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 956 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 957 | #endif |
| 958 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 959 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 960 | #line 217 "/usr/share/bison.simple" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 961 | |
| 962 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
| 963 | into yyparse. The argument should have type void *. |
| 964 | It should actually point to an object. |
| 965 | Grammar actions can access the variable by casting it |
| 966 | to the proper pointer type. */ |
| 967 | |
| 968 | #ifdef YYPARSE_PARAM |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 969 | #ifdef __cplusplus |
| 970 | #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
| 971 | #define YYPARSE_PARAM_DECL |
| 972 | #else /* not __cplusplus */ |
| 973 | #define YYPARSE_PARAM_ARG YYPARSE_PARAM |
| 974 | #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
| 975 | #endif /* not __cplusplus */ |
| 976 | #else /* not YYPARSE_PARAM */ |
| 977 | #define YYPARSE_PARAM_ARG |
| 978 | #define YYPARSE_PARAM_DECL |
| 979 | #endif /* not YYPARSE_PARAM */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 980 | |
| 981 | /* Prevent warning if -Wstrict-prototypes. */ |
| 982 | #ifdef __GNUC__ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 983 | #ifdef YYPARSE_PARAM |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 984 | int yyparse (void *); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 985 | #else |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 986 | int yyparse (void); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 987 | #endif |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 988 | #endif |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 989 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 990 | int |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 991 | yyparse(YYPARSE_PARAM_ARG) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 992 | YYPARSE_PARAM_DECL |
| 993 | { |
| 994 | register int yystate; |
| 995 | register int yyn; |
| 996 | register short *yyssp; |
| 997 | register YYSTYPE *yyvsp; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 998 | int yyerrstatus; /* number of tokens to shift before error messages enabled */ |
| 999 | int yychar1 = 0; /* lookahead token as an internal (translated) token number */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1000 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1001 | short yyssa[YYINITDEPTH]; /* the state stack */ |
| 1002 | YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1003 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1004 | short *yyss = yyssa; /* refer to the stacks thru separate pointers */ |
| 1005 | YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1006 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1007 | #ifdef YYLSP_NEEDED |
| 1008 | YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ |
| 1009 | YYLTYPE *yyls = yylsa; |
| 1010 | YYLTYPE *yylsp; |
| 1011 | |
| 1012 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
| 1013 | #else |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1014 | #define YYPOPSTACK (yyvsp--, yyssp--) |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1015 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1016 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1017 | int yystacksize = YYINITDEPTH; |
| 1018 | int yyfree_stacks = 0; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1019 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1020 | #ifdef YYPURE |
| 1021 | int yychar; |
| 1022 | YYSTYPE yylval; |
| 1023 | int yynerrs; |
| 1024 | #ifdef YYLSP_NEEDED |
| 1025 | YYLTYPE yylloc; |
| 1026 | #endif |
| 1027 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1028 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1029 | YYSTYPE yyval; /* the variable used to return */ |
| 1030 | /* semantic values from the action */ |
| 1031 | /* routines */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1032 | |
| 1033 | int yylen; |
| 1034 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1035 | #if YYDEBUG != 0 |
| 1036 | if (yydebug) |
| 1037 | fprintf(stderr, "Starting parse\n"); |
| 1038 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1039 | |
| 1040 | yystate = 0; |
| 1041 | yyerrstatus = 0; |
| 1042 | yynerrs = 0; |
| 1043 | yychar = YYEMPTY; /* Cause a token to be read. */ |
| 1044 | |
| 1045 | /* Initialize stack pointers. |
| 1046 | Waste one element of value and location stack |
| 1047 | so that they stay on the same level as the state stack. |
| 1048 | The wasted elements are never initialized. */ |
| 1049 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1050 | yyssp = yyss - 1; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1051 | yyvsp = yyvs; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1052 | #ifdef YYLSP_NEEDED |
| 1053 | yylsp = yyls; |
| 1054 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1055 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1056 | /* Push a new state, which is found in yystate . */ |
| 1057 | /* In all cases, when you get here, the value and location stacks |
| 1058 | have just been pushed. so pushing a state here evens the stacks. */ |
| 1059 | yynewstate: |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1060 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1061 | *++yyssp = yystate; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1062 | |
| 1063 | if (yyssp >= yyss + yystacksize - 1) |
| 1064 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1065 | /* Give user a chance to reallocate the stack */ |
| 1066 | /* Use copies of these so that the &'s don't force the real ones into memory. */ |
| 1067 | YYSTYPE *yyvs1 = yyvs; |
| 1068 | short *yyss1 = yyss; |
| 1069 | #ifdef YYLSP_NEEDED |
| 1070 | YYLTYPE *yyls1 = yyls; |
| 1071 | #endif |
| 1072 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1073 | /* Get the current used size of the three stacks, in elements. */ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1074 | int size = yyssp - yyss + 1; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1075 | |
| 1076 | #ifdef yyoverflow |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1077 | /* Each stack pointer address is followed by the size of |
| 1078 | the data in use in that stack, in bytes. */ |
| 1079 | #ifdef YYLSP_NEEDED |
| 1080 | /* This used to be a conditional around just the two extra args, |
| 1081 | but that might be undefined if yyoverflow is a macro. */ |
| 1082 | yyoverflow("parser stack overflow", |
| 1083 | &yyss1, size * sizeof (*yyssp), |
| 1084 | &yyvs1, size * sizeof (*yyvsp), |
| 1085 | &yyls1, size * sizeof (*yylsp), |
| 1086 | &yystacksize); |
| 1087 | #else |
| 1088 | yyoverflow("parser stack overflow", |
| 1089 | &yyss1, size * sizeof (*yyssp), |
| 1090 | &yyvs1, size * sizeof (*yyvsp), |
| 1091 | &yystacksize); |
| 1092 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1093 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1094 | yyss = yyss1; yyvs = yyvs1; |
| 1095 | #ifdef YYLSP_NEEDED |
| 1096 | yyls = yyls1; |
| 1097 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1098 | #else /* no yyoverflow */ |
| 1099 | /* Extend the stack our own way. */ |
| 1100 | if (yystacksize >= YYMAXDEPTH) |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1101 | { |
| 1102 | yyerror("parser stack overflow"); |
| 1103 | if (yyfree_stacks) |
| 1104 | { |
| 1105 | free (yyss); |
| 1106 | free (yyvs); |
| 1107 | #ifdef YYLSP_NEEDED |
| 1108 | free (yyls); |
| 1109 | #endif |
| 1110 | } |
| 1111 | return 2; |
| 1112 | } |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1113 | yystacksize *= 2; |
| 1114 | if (yystacksize > YYMAXDEPTH) |
| 1115 | yystacksize = YYMAXDEPTH; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1116 | #ifndef YYSTACK_USE_ALLOCA |
| 1117 | yyfree_stacks = 1; |
| 1118 | #endif |
| 1119 | yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); |
| 1120 | __yy_memcpy ((char *)yyss, (char *)yyss1, |
| 1121 | size * (unsigned int) sizeof (*yyssp)); |
| 1122 | yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); |
| 1123 | __yy_memcpy ((char *)yyvs, (char *)yyvs1, |
| 1124 | size * (unsigned int) sizeof (*yyvsp)); |
| 1125 | #ifdef YYLSP_NEEDED |
| 1126 | yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); |
| 1127 | __yy_memcpy ((char *)yyls, (char *)yyls1, |
| 1128 | size * (unsigned int) sizeof (*yylsp)); |
| 1129 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1130 | #endif /* no yyoverflow */ |
| 1131 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1132 | yyssp = yyss + size - 1; |
| 1133 | yyvsp = yyvs + size - 1; |
| 1134 | #ifdef YYLSP_NEEDED |
| 1135 | yylsp = yyls + size - 1; |
| 1136 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1137 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1138 | #if YYDEBUG != 0 |
| 1139 | if (yydebug) |
| 1140 | fprintf(stderr, "Stack size increased to %d\n", yystacksize); |
| 1141 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1142 | |
| 1143 | if (yyssp >= yyss + yystacksize - 1) |
| 1144 | YYABORT; |
| 1145 | } |
| 1146 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1147 | #if YYDEBUG != 0 |
| 1148 | if (yydebug) |
| 1149 | fprintf(stderr, "Entering state %d\n", yystate); |
| 1150 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1151 | |
| 1152 | goto yybackup; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1153 | yybackup: |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1154 | |
| 1155 | /* Do appropriate processing given the current state. */ |
| 1156 | /* Read a lookahead token if we need one and don't already have one. */ |
| 1157 | /* yyresume: */ |
| 1158 | |
| 1159 | /* First try to decide what to do without reference to lookahead token. */ |
| 1160 | |
| 1161 | yyn = yypact[yystate]; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1162 | if (yyn == YYFLAG) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1163 | goto yydefault; |
| 1164 | |
| 1165 | /* Not known => get a lookahead token if don't already have one. */ |
| 1166 | |
| 1167 | /* yychar is either YYEMPTY or YYEOF |
| 1168 | or a valid token in external form. */ |
| 1169 | |
| 1170 | if (yychar == YYEMPTY) |
| 1171 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1172 | #if YYDEBUG != 0 |
| 1173 | if (yydebug) |
| 1174 | fprintf(stderr, "Reading a token: "); |
| 1175 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1176 | yychar = YYLEX; |
| 1177 | } |
| 1178 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1179 | /* Convert token to internal form (in yychar1) for indexing tables with */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1180 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1181 | if (yychar <= 0) /* This means end of input. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1182 | { |
| 1183 | yychar1 = 0; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1184 | yychar = YYEOF; /* Don't call YYLEX any more */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1185 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1186 | #if YYDEBUG != 0 |
| 1187 | if (yydebug) |
| 1188 | fprintf(stderr, "Now at end of input.\n"); |
| 1189 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1190 | } |
| 1191 | else |
| 1192 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1193 | yychar1 = YYTRANSLATE(yychar); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1194 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1195 | #if YYDEBUG != 0 |
| 1196 | if (yydebug) |
| 1197 | { |
| 1198 | fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); |
| 1199 | /* Give the individual parser a way to print the precise meaning |
| 1200 | of a token, for further debugging info. */ |
| 1201 | #ifdef YYPRINT |
| 1202 | YYPRINT (stderr, yychar, yylval); |
| 1203 | #endif |
| 1204 | fprintf (stderr, ")\n"); |
| 1205 | } |
| 1206 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1207 | } |
| 1208 | |
| 1209 | yyn += yychar1; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1210 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1211 | goto yydefault; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1212 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1213 | yyn = yytable[yyn]; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1214 | |
| 1215 | /* yyn is what to do for this token type in this state. |
| 1216 | Negative => reduce, -yyn is rule number. |
| 1217 | Positive => shift, yyn is new state. |
| 1218 | New state is final state => don't bother to shift, |
| 1219 | just return success. |
| 1220 | 0, or most negative number => error. */ |
| 1221 | |
| 1222 | if (yyn < 0) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1223 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1224 | if (yyn == YYFLAG) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1225 | goto yyerrlab; |
| 1226 | yyn = -yyn; |
| 1227 | goto yyreduce; |
| 1228 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1229 | else if (yyn == 0) |
| 1230 | goto yyerrlab; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1231 | |
| 1232 | if (yyn == YYFINAL) |
| 1233 | YYACCEPT; |
| 1234 | |
| 1235 | /* Shift the lookahead token. */ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1236 | |
| 1237 | #if YYDEBUG != 0 |
| 1238 | if (yydebug) |
| 1239 | fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); |
| 1240 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1241 | |
| 1242 | /* Discard the token being shifted unless it is eof. */ |
| 1243 | if (yychar != YYEOF) |
| 1244 | yychar = YYEMPTY; |
| 1245 | |
| 1246 | *++yyvsp = yylval; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1247 | #ifdef YYLSP_NEEDED |
| 1248 | *++yylsp = yylloc; |
| 1249 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1250 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1251 | /* count tokens shifted since error; after three, turn off error status. */ |
| 1252 | if (yyerrstatus) yyerrstatus--; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1253 | |
| 1254 | yystate = yyn; |
| 1255 | goto yynewstate; |
| 1256 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1257 | /* Do the default action for the current state. */ |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 1258 | yydefault: |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1259 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1260 | yyn = yydefact[yystate]; |
| 1261 | if (yyn == 0) |
| 1262 | goto yyerrlab; |
| 1263 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1264 | /* Do a reduction. yyn is the number of a rule to reduce with. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1265 | yyreduce: |
| 1266 | yylen = yyr2[yyn]; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1267 | if (yylen > 0) |
| 1268 | yyval = yyvsp[1-yylen]; /* implement default value of the action */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1269 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1270 | #if YYDEBUG != 0 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1271 | if (yydebug) |
| 1272 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1273 | int i; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1274 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1275 | fprintf (stderr, "Reducing via rule %d (line %d), ", |
| 1276 | yyn, yyrline[yyn]); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1277 | |
| 1278 | /* Print the symbols being reduced, and their result. */ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1279 | for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) |
| 1280 | fprintf (stderr, "%s ", yytname[yyrhs[i]]); |
| 1281 | fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1282 | } |
| 1283 | #endif |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 1284 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1285 | |
| 1286 | switch (yyn) { |
| 1287 | |
| 1288 | case 1: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1289 | #line 300 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1290 | { |
| 1291 | *(void **)param = yyvsp[0].a_grammar; |
| 1292 | ; |
| 1293 | break;} |
| 1294 | case 2: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1295 | #line 306 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1296 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1297 | yyval.a_grammar = asn1p_new(); |
| 1298 | checkmem(yyval.a_grammar); |
| 1299 | TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1300 | ; |
| 1301 | break;} |
| 1302 | case 3: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1303 | #line 311 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1304 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1305 | yyval.a_grammar = yyvsp[-1].a_grammar; |
| 1306 | TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1307 | ; |
| 1308 | break;} |
| 1309 | case 4: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1310 | #line 332 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1311 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1312 | |
| 1313 | if(yyvsp[-1].a_module) { |
| 1314 | yyval.a_module = yyvsp[-1].a_module; |
| 1315 | } else { |
| 1316 | /* There's a chance that a module is just plain empty */ |
| 1317 | yyval.a_module = asn1p_module_new(); |
| 1318 | } |
| 1319 | checkmem(yyval.a_module); |
| 1320 | |
| 1321 | yyval.a_module->Identifier = yyvsp[-7].tv_str; |
| 1322 | yyval.a_module->module_oid = yyvsp[-6].a_oid; |
| 1323 | yyval.a_module->module_flags = yyvsp[-4].a_module_flags; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1324 | ; |
| 1325 | break;} |
| 1326 | case 5: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1327 | #line 353 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1328 | { yyval.a_oid = 0; ; |
| 1329 | break;} |
| 1330 | case 6: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1331 | #line 354 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1332 | { yyval.a_oid = yyvsp[0].a_oid; ; |
| 1333 | break;} |
| 1334 | case 7: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1335 | #line 358 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1336 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1337 | yyval.a_oid = yyvsp[-1].a_oid; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1338 | ; |
| 1339 | break;} |
| 1340 | case 8: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1341 | #line 361 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1342 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1343 | yyval.a_oid = 0; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1344 | ; |
| 1345 | break;} |
| 1346 | case 9: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1347 | #line 367 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1348 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1349 | yyval.a_oid = asn1p_oid_new(); |
| 1350 | asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); |
| 1351 | if(yyvsp[0].a_oid_arc.name) |
| 1352 | free(yyvsp[0].a_oid_arc.name); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1353 | ; |
| 1354 | break;} |
| 1355 | case 10: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1356 | #line 373 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1357 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1358 | yyval.a_oid = yyvsp[-1].a_oid; |
| 1359 | asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc); |
| 1360 | if(yyvsp[0].a_oid_arc.name) |
| 1361 | free(yyvsp[0].a_oid_arc.name); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1362 | ; |
| 1363 | break;} |
| 1364 | case 11: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1365 | #line 382 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1366 | { /* iso */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1367 | yyval.a_oid_arc.name = yyvsp[0].tv_str; |
| 1368 | yyval.a_oid_arc.number = -1; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1369 | ; |
| 1370 | break;} |
| 1371 | case 12: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1372 | #line 386 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1373 | { /* iso(1) */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1374 | yyval.a_oid_arc.name = yyvsp[-3].tv_str; |
| 1375 | yyval.a_oid_arc.number = yyvsp[-1].a_int; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1376 | ; |
| 1377 | break;} |
| 1378 | case 13: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1379 | #line 390 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1380 | { /* 1 */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1381 | yyval.a_oid_arc.name = 0; |
| 1382 | yyval.a_oid_arc.number = yyvsp[0].a_int; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1383 | ; |
| 1384 | break;} |
| 1385 | case 14: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1386 | #line 400 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1387 | { yyval.a_module_flags = MSF_NOFLAGS; ; |
| 1388 | break;} |
| 1389 | case 15: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1390 | #line 401 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1391 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1392 | yyval.a_module_flags = yyvsp[0].a_module_flags; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1393 | ; |
| 1394 | break;} |
| 1395 | case 16: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1396 | #line 410 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1397 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1398 | yyval.a_module_flags = yyvsp[0].a_module_flags; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1399 | ; |
| 1400 | break;} |
| 1401 | case 17: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1402 | #line 413 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1403 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1404 | yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1405 | ; |
| 1406 | break;} |
| 1407 | case 18: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1408 | #line 422 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1409 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1410 | yyval.a_module_flags = MSF_EXPLICIT_TAGS; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1411 | ; |
| 1412 | break;} |
| 1413 | case 19: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1414 | #line 425 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1415 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1416 | yyval.a_module_flags = MSF_IMPLICIT_TAGS; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1417 | ; |
| 1418 | break;} |
| 1419 | case 20: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1420 | #line 428 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1421 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1422 | yyval.a_module_flags = MSF_AUTOMATIC_TAGS; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1423 | ; |
| 1424 | break;} |
| 1425 | case 21: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1426 | #line 431 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1427 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1428 | yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1429 | ; |
| 1430 | break;} |
| 1431 | case 22: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1432 | #line 435 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1433 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1434 | /* X.680Amd1 specifies TAG and XER */ |
| 1435 | if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) { |
| 1436 | yyval.a_module_flags = MSF_TAG_INSTRUCTIONS; |
| 1437 | } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) { |
| 1438 | yyval.a_module_flags = MSF_XER_INSTRUCTIONS; |
| 1439 | } else { |
| 1440 | fprintf(stderr, |
| 1441 | "WARNING: %s INSTRUCTIONS at line %d: " |
| 1442 | "Unrecognized encoding reference\n", |
| 1443 | yyvsp[-1].tv_str, yylineno); |
| 1444 | yyval.a_module_flags = MSF_unk_INSTRUCTIONS; |
| 1445 | } |
| 1446 | free(yyvsp[-1].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1447 | ; |
| 1448 | break;} |
| 1449 | case 23: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1450 | #line 456 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1451 | { yyval.a_module = 0; ; |
| 1452 | break;} |
| 1453 | case 24: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1454 | #line 457 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1455 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1456 | yyval.a_module = yyvsp[0].a_module; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1457 | ; |
| 1458 | break;} |
| 1459 | case 25: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1460 | #line 466 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1461 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1462 | yyval.a_module = yyvsp[0].a_module; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1463 | ; |
| 1464 | break;} |
| 1465 | case 26: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1466 | #line 469 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1467 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1468 | yyval.a_module = yyvsp[-1].a_module; |
| 1469 | |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1470 | /* Behave well when one of them is skipped. */ |
| 1471 | if(!(yyvsp[-1].a_module)) { |
| 1472 | if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module; |
| 1473 | break; |
| 1474 | } |
| 1475 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1476 | #ifdef MY_IMPORT |
| 1477 | #error MY_IMPORT DEFINED ELSEWHERE! |
| 1478 | #endif |
| 1479 | #define MY_IMPORT(foo,field) do { \ |
vlm | 97ed715 | 2004-08-13 12:31:09 +0000 | [diff] [blame] | 1480 | while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1481 | TQ_ADD(&(yyval.a_module->foo), \ |
| 1482 | TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \ |
| 1483 | field); \ |
vlm | 97ed715 | 2004-08-13 12:31:09 +0000 | [diff] [blame] | 1484 | } \ |
| 1485 | assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \ |
| 1486 | } while(0) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1487 | |
| 1488 | MY_IMPORT(imports, xp_next); |
| 1489 | MY_IMPORT(exports, xp_next); |
| 1490 | MY_IMPORT(members, next); |
| 1491 | #undef MY_IMPORT |
| 1492 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1493 | ; |
| 1494 | break;} |
| 1495 | case 27: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1496 | #line 502 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1497 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1498 | yyval.a_module = yyvsp[0].a_module; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1499 | ; |
| 1500 | break;} |
| 1501 | case 28: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1502 | #line 505 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1503 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1504 | yyval.a_module = asn1p_module_new(); |
| 1505 | checkmem(yyval.a_module); |
| 1506 | if(yyvsp[0].a_xports) { |
| 1507 | TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next); |
| 1508 | } else { |
| 1509 | /* "EXPORTS ALL;" ? */ |
| 1510 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1511 | ; |
| 1512 | break;} |
| 1513 | case 29: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1514 | #line 514 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1515 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1516 | yyval.a_module = asn1p_module_new(); |
| 1517 | checkmem(yyval.a_module); |
| 1518 | assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| 1519 | assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| 1520 | TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1521 | ; |
| 1522 | break;} |
| 1523 | case 30: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1524 | #line 521 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1525 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1526 | yyval.a_module = asn1p_module_new(); |
| 1527 | checkmem(yyval.a_module); |
| 1528 | assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| 1529 | assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| 1530 | TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1531 | ; |
| 1532 | break;} |
| 1533 | case 31: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1534 | #line 534 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1535 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1536 | yyval.a_module = asn1p_module_new(); |
| 1537 | checkmem(yyval.a_module); |
| 1538 | assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID); |
| 1539 | assert(yyvsp[0].a_expr->meta_type != AMT_INVALID); |
| 1540 | TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1541 | ; |
| 1542 | break;} |
| 1543 | case 32: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1544 | #line 542 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1545 | { asn1p_lexer_hack_push_encoding_control(); ; |
| 1546 | break;} |
| 1547 | case 33: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1548 | #line 543 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1549 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 1550 | fprintf(stderr, |
| 1551 | "WARNING: ENCODING-CONTROL %s " |
| 1552 | "specification at line %d ignored\n", |
| 1553 | yyvsp[-1].tv_str, yylineno); |
| 1554 | free(yyvsp[-1].tv_str); |
| 1555 | yyval.a_module = 0; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1556 | ; |
| 1557 | break;} |
| 1558 | case 34: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1559 | #line 555 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1560 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1561 | return yyerror( |
| 1562 | "Attempt to redefine a standard basic type, " |
| 1563 | "use -ftypesXY to switch back " |
| 1564 | "to older version of ASN.1 standard"); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1565 | ; |
| 1566 | break;} |
| 1567 | case 35: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1568 | #line 569 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1569 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1570 | yyval.a_module = yyvsp[-1].a_module; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1571 | ; |
| 1572 | break;} |
| 1573 | case 36: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1574 | #line 575 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1575 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1576 | return yyerror("Empty IMPORTS list"); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1577 | ; |
| 1578 | break;} |
| 1579 | case 37: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1580 | #line 581 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1581 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1582 | yyval.a_module = asn1p_module_new(); |
| 1583 | checkmem(yyval.a_module); |
| 1584 | TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1585 | ; |
| 1586 | break;} |
| 1587 | case 38: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1588 | #line 586 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1589 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1590 | yyval.a_module = yyvsp[-1].a_module; |
| 1591 | TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1592 | ; |
| 1593 | break;} |
| 1594 | case 39: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1595 | #line 593 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1596 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1597 | yyval.a_xports = yyvsp[-3].a_xports; |
| 1598 | yyval.a_xports->from = yyvsp[-1].tv_str; |
| 1599 | yyval.a_xports->from_oid = yyvsp[0].a_oid; |
| 1600 | checkmem(yyval.a_xports); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1601 | ; |
| 1602 | break;} |
| 1603 | case 40: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1604 | #line 602 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1605 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1606 | yyval.a_xports = asn1p_xports_new(); |
| 1607 | checkmem(yyval.a_xports); |
| 1608 | TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1609 | ; |
| 1610 | break;} |
| 1611 | case 41: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1612 | #line 607 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1613 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1614 | yyval.a_xports = yyvsp[-2].a_xports; |
| 1615 | TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1616 | ; |
| 1617 | break;} |
| 1618 | case 42: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1619 | #line 614 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1620 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1621 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1622 | checkmem(yyval.a_expr); |
| 1623 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| 1624 | yyval.a_expr->expr_type = A1TC_REFERENCE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1625 | ; |
| 1626 | break;} |
| 1627 | case 43: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1628 | #line 620 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1629 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1630 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1631 | checkmem(yyval.a_expr); |
| 1632 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| 1633 | yyval.a_expr->expr_type = A1TC_REFERENCE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1634 | ; |
| 1635 | break;} |
| 1636 | case 44: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1637 | #line 629 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1638 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1639 | yyval.a_xports = yyvsp[-1].a_xports; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1640 | ; |
| 1641 | break;} |
| 1642 | case 45: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1643 | #line 632 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1644 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1645 | yyval.a_xports = 0; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1646 | ; |
| 1647 | break;} |
| 1648 | case 46: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1649 | #line 635 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1650 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1651 | /* Empty EXPORTS clause effectively prohibits export. */ |
| 1652 | yyval.a_xports = asn1p_xports_new(); |
| 1653 | checkmem(yyval.a_xports); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1654 | ; |
| 1655 | break;} |
| 1656 | case 47: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1657 | #line 643 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1658 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1659 | yyval.a_xports = asn1p_xports_new(); |
| 1660 | assert(yyval.a_xports); |
| 1661 | TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1662 | ; |
| 1663 | break;} |
| 1664 | case 48: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1665 | #line 648 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1666 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1667 | yyval.a_xports = yyvsp[-2].a_xports; |
| 1668 | TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1669 | ; |
| 1670 | break;} |
| 1671 | case 49: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1672 | #line 655 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1673 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1674 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1675 | checkmem(yyval.a_expr); |
| 1676 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| 1677 | yyval.a_expr->expr_type = A1TC_EXPORTVAR; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1678 | ; |
| 1679 | break;} |
| 1680 | case 50: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1681 | #line 661 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1682 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1683 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1684 | checkmem(yyval.a_expr); |
| 1685 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| 1686 | yyval.a_expr->expr_type = A1TC_EXPORTVAR; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1687 | ; |
| 1688 | break;} |
| 1689 | case 51: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1690 | #line 671 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1691 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1692 | yyval.a_expr = yyvsp[-4].a_expr; |
| 1693 | assert(yyval.a_expr->Identifier == 0); |
| 1694 | yyval.a_expr->Identifier = yyvsp[-5].tv_str; |
| 1695 | yyval.a_expr->meta_type = AMT_VALUESET; |
| 1696 | // take care of optValueSetBody |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1697 | ; |
| 1698 | break;} |
| 1699 | case 52: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1700 | #line 681 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1701 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1702 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1703 | checkmem(yyval.a_expr); |
| 1704 | yyval.a_expr->reference = yyvsp[0].a_ref; |
| 1705 | yyval.a_expr->expr_type = A1TC_REFERENCE; |
| 1706 | yyval.a_expr->meta_type = AMT_TYPEREF; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1707 | ; |
| 1708 | break;} |
| 1709 | case 53: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1710 | #line 688 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1711 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1712 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1713 | checkmem(yyval.a_expr); |
| 1714 | yyval.a_expr->expr_type = yyvsp[0].a_type; |
| 1715 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1716 | ; |
| 1717 | break;} |
| 1718 | case 54: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1719 | #line 697 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1720 | { ; |
| 1721 | break;} |
| 1722 | case 55: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1723 | #line 698 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1724 | { |
| 1725 | ; |
| 1726 | break;} |
| 1727 | case 56: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1728 | #line 709 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1729 | { |
| 1730 | ; |
| 1731 | break;} |
| 1732 | case 57: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1733 | #line 711 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1734 | { |
| 1735 | ; |
| 1736 | break;} |
| 1737 | case 58: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1738 | #line 716 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1739 | { |
| 1740 | ; |
| 1741 | break;} |
| 1742 | case 59: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1743 | #line 718 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1744 | { |
| 1745 | ; |
| 1746 | break;} |
| 1747 | case 60: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1748 | #line 734 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1749 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1750 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1751 | checkmem(yyval.a_expr); |
| 1752 | yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| 1753 | yyval.a_expr->tag = yyvsp[-1].a_tag; |
| 1754 | yyval.a_expr->expr_type = A1TC_TYPEID; |
| 1755 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1756 | ; |
| 1757 | break;} |
| 1758 | case 61: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1759 | #line 742 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1760 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1761 | yyval.a_expr = yyvsp[0].a_expr; |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1762 | yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1763 | assert(yyval.a_expr->expr_type); |
| 1764 | assert(yyval.a_expr->meta_type); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1765 | ; |
| 1766 | break;} |
| 1767 | case 62: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1768 | #line 748 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1769 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1770 | yyval.a_expr = yyvsp[0].a_expr; |
| 1771 | yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
| 1772 | assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); |
| 1773 | assert(yyval.a_expr->meta_type == AMT_OBJECT); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1774 | ; |
| 1775 | break;} |
| 1776 | case 63: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1777 | #line 764 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1778 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1779 | yyval.a_expr = yyvsp[0].a_expr; |
| 1780 | assert(yyval.a_expr->Identifier == 0); |
| 1781 | yyval.a_expr->Identifier = yyvsp[-5].tv_str; |
| 1782 | yyval.a_expr->params = yyvsp[-3].a_plist; |
| 1783 | yyval.a_expr->meta_type = AMT_PARAMTYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1784 | ; |
| 1785 | break;} |
| 1786 | case 64: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1787 | #line 774 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1788 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1789 | int ret; |
| 1790 | yyval.a_plist = asn1p_paramlist_new(yylineno); |
| 1791 | checkmem(yyval.a_plist); |
| 1792 | ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); |
| 1793 | checkmem(ret == 0); |
| 1794 | if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); |
| 1795 | if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1796 | ; |
| 1797 | break;} |
| 1798 | case 65: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1799 | #line 783 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1800 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1801 | int ret; |
| 1802 | yyval.a_plist = yyvsp[-2].a_plist; |
| 1803 | ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument); |
| 1804 | checkmem(ret == 0); |
| 1805 | if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor); |
| 1806 | if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1807 | ; |
| 1808 | break;} |
| 1809 | case 66: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1810 | #line 794 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1811 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1812 | yyval.a_parg.governor = NULL; |
| 1813 | yyval.a_parg.argument = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1814 | ; |
| 1815 | break;} |
| 1816 | case 67: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1817 | #line 798 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1818 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1819 | int ret; |
| 1820 | yyval.a_parg.governor = asn1p_ref_new(yylineno); |
| 1821 | ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0); |
| 1822 | checkmem(ret == 0); |
| 1823 | yyval.a_parg.argument = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1824 | ; |
| 1825 | break;} |
| 1826 | case 68: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1827 | #line 805 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1828 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1829 | int ret; |
| 1830 | yyval.a_parg.governor = asn1p_ref_new(yylineno); |
| 1831 | ret = asn1p_ref_add_component(yyval.a_parg.governor, |
| 1832 | ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1); |
| 1833 | checkmem(ret == 0); |
| 1834 | yyval.a_parg.argument = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1835 | ; |
| 1836 | break;} |
| 1837 | case 69: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1838 | #line 816 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1839 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1840 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1841 | checkmem(yyval.a_expr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1842 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1843 | ; |
| 1844 | break;} |
| 1845 | case 70: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1846 | #line 821 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1847 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1848 | yyval.a_expr = yyvsp[-2].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1849 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1850 | ; |
| 1851 | break;} |
| 1852 | case 71: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1853 | #line 828 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1854 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1855 | yyval.a_expr = yyvsp[0].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1856 | ; |
| 1857 | break;} |
| 1858 | case 72: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1859 | #line 831 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1860 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1861 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1862 | checkmem(yyval.a_expr); |
| 1863 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
| 1864 | yyval.a_expr->expr_type = A1TC_REFERENCE; |
| 1865 | yyval.a_expr->meta_type = AMT_VALUE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1866 | ; |
| 1867 | break;} |
| 1868 | case 73: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1869 | #line 844 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1870 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1871 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1872 | checkmem(yyval.a_expr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1873 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1874 | ; |
| 1875 | break;} |
| 1876 | case 74: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1877 | #line 849 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1878 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1879 | yyval.a_expr = yyvsp[-2].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1880 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1881 | ; |
| 1882 | break;} |
| 1883 | case 75: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1884 | #line 856 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1885 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1886 | yyval.a_expr = yyvsp[-1].a_expr; |
| 1887 | assert(yyval.a_expr->Identifier == 0); |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1888 | yyval.a_expr->Identifier = yyvsp[-2].tv_str; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1889 | yyval.a_expr->marker = yyvsp[0].a_marker; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1890 | ; |
| 1891 | break;} |
| 1892 | case 76: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1893 | #line 862 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1894 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1895 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1896 | checkmem(yyval.a_expr); |
| 1897 | yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type; |
| 1898 | yyval.a_expr->expr_type = A1TC_COMPONENTS_OF; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1899 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1900 | ; |
| 1901 | break;} |
| 1902 | case 77: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1903 | #line 869 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1904 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1905 | yyval.a_expr = yyvsp[0].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1906 | ; |
| 1907 | break;} |
| 1908 | case 78: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1909 | #line 875 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1910 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1911 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1912 | checkmem(yyval.a_expr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1913 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1914 | ; |
| 1915 | break;} |
| 1916 | case 79: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1917 | #line 880 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1918 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1919 | yyval.a_expr = yyvsp[-2].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1920 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1921 | ; |
| 1922 | break;} |
| 1923 | case 80: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1924 | #line 887 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1925 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1926 | yyval.a_expr = yyvsp[0].a_expr; |
| 1927 | assert(yyval.a_expr->Identifier == 0); |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1928 | yyval.a_expr->Identifier = yyvsp[-1].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1929 | ; |
| 1930 | break;} |
| 1931 | case 81: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1932 | #line 892 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1933 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1934 | yyval.a_expr = yyvsp[0].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1935 | ; |
| 1936 | break;} |
| 1937 | case 82: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1938 | #line 898 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1939 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1940 | yyval.a_expr = yyvsp[-2].a_expr; |
| 1941 | checkmem(yyval.a_expr); |
| 1942 | yyval.a_expr->with_syntax = yyvsp[0].a_wsynt; |
| 1943 | assert(yyval.a_expr->expr_type == A1TC_CLASSDEF); |
| 1944 | assert(yyval.a_expr->meta_type == AMT_OBJECT); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1945 | ; |
| 1946 | break;} |
| 1947 | case 83: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1948 | #line 908 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1949 | { yyval.a_int = 0; ; |
| 1950 | break;} |
| 1951 | case 84: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1952 | #line 909 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1953 | { yyval.a_int = 1; ; |
| 1954 | break;} |
| 1955 | case 85: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1956 | #line 913 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1957 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1958 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1959 | checkmem(yyval.a_expr); |
| 1960 | yyval.a_expr->expr_type = A1TC_CLASSDEF; |
| 1961 | yyval.a_expr->meta_type = AMT_OBJECT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1962 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1963 | ; |
| 1964 | break;} |
| 1965 | case 86: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1966 | #line 920 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1967 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1968 | yyval.a_expr = yyvsp[-2].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1969 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 1970 | ; |
| 1971 | break;} |
| 1972 | case 87: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1973 | #line 927 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1974 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1975 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1976 | checkmem(yyval.a_expr); |
| 1977 | yyval.a_expr->Identifier = yyvsp[-1].a_refcomp.name; |
| 1978 | yyval.a_expr->expr_type = A1TC_CLASSFIELD; |
| 1979 | yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| 1980 | yyval.a_expr->marker = yyvsp[0].a_marker; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1981 | ; |
| 1982 | break;} |
| 1983 | case 88: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1984 | #line 935 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1985 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 1986 | yyval.a_expr = yyvsp[-2].a_expr; |
| 1987 | yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name; |
| 1988 | yyval.a_expr->marker = yyvsp[-1].a_marker; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1989 | yyval.a_expr->unique = yyvsp[0].a_int; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1990 | ; |
| 1991 | break;} |
| 1992 | case 89: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 1993 | #line 941 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 1994 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1995 | int ret; |
| 1996 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 1997 | checkmem(yyval.a_expr); |
| 1998 | yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name; |
| 1999 | yyval.a_expr->reference = asn1p_ref_new(yylineno); |
| 2000 | checkmem(yyval.a_expr->reference); |
| 2001 | ret = asn1p_ref_add_component(yyval.a_expr->reference, |
| 2002 | yyvsp[-2].a_refcomp.name, yyvsp[-2].a_refcomp.lex_type); |
| 2003 | checkmem(ret == 0); |
| 2004 | yyval.a_expr->expr_type = A1TC_CLASSFIELD; |
| 2005 | yyval.a_expr->meta_type = AMT_OBJECTFIELD; |
| 2006 | yyval.a_expr->marker = yyvsp[-1].a_marker; |
| 2007 | yyval.a_expr->unique = yyvsp[0].a_int; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2008 | ; |
| 2009 | break;} |
| 2010 | case 90: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2011 | #line 959 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2012 | { yyval.a_wsynt = 0; ; |
| 2013 | break;} |
| 2014 | case 91: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2015 | #line 960 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2016 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2017 | yyval.a_wsynt = yyvsp[0].a_wsynt; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2018 | ; |
| 2019 | break;} |
| 2020 | case 92: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2021 | #line 967 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2022 | { asn1p_lexer_hack_enable_with_syntax(); ; |
| 2023 | break;} |
| 2024 | case 93: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2025 | #line 969 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2026 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2027 | yyval.a_wsynt = yyvsp[-1].a_wsynt; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2028 | ; |
| 2029 | break;} |
| 2030 | case 94: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2031 | #line 975 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2032 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2033 | yyval.a_wsynt = asn1p_wsyntx_new(); |
| 2034 | TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2035 | ; |
| 2036 | break;} |
| 2037 | case 95: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2038 | #line 979 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2039 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2040 | yyval.a_wsynt = yyvsp[-1].a_wsynt; |
| 2041 | TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2042 | ; |
| 2043 | break;} |
| 2044 | case 96: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2045 | #line 986 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2046 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2047 | yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2048 | ; |
| 2049 | break;} |
| 2050 | case 97: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2051 | #line 989 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2052 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2053 | asn1p_ref_t *ref; |
| 2054 | int ret; |
| 2055 | ref = asn1p_ref_new(yylineno); |
| 2056 | checkmem(ref); |
| 2057 | ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| 2058 | checkmem(ret == 0); |
| 2059 | yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2060 | ; |
| 2061 | break;} |
| 2062 | case 98: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2063 | #line 1001 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2064 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2065 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2066 | checkmem(yyval.a_expr); |
| 2067 | yyval.a_expr->Identifier = strdup("..."); |
| 2068 | checkmem(yyval.a_expr->Identifier); |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2069 | yyval.a_expr->expr_type = A1TC_EXTENSIBLE; |
| 2070 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2071 | ; |
| 2072 | break;} |
| 2073 | case 99: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2074 | #line 1009 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2075 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2076 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2077 | checkmem(yyval.a_expr); |
| 2078 | yyval.a_expr->Identifier = strdup("..."); |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2079 | checkmem(yyval.a_expr->Identifier); |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2080 | yyval.a_expr->value = yyvsp[0].a_value; |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2081 | yyval.a_expr->expr_type = A1TC_EXTENSIBLE; |
| 2082 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2083 | ; |
| 2084 | break;} |
| 2085 | case 100: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2086 | #line 1018 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2087 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2088 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2089 | checkmem(yyval.a_expr); |
| 2090 | yyval.a_expr->Identifier = strdup("..."); |
| 2091 | yyval.a_expr->value = yyvsp[0].a_value; |
| 2092 | checkmem(yyval.a_expr->Identifier); |
| 2093 | yyval.a_expr->expr_type = A1TC_EXTENSIBLE; |
| 2094 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2095 | ; |
| 2096 | break;} |
| 2097 | case 101: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2098 | #line 1030 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2099 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2100 | yyval.a_expr = yyvsp[-1].a_expr; |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2101 | yyval.a_expr->tag = yyvsp[-2].a_tag; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2102 | /* |
| 2103 | * Outer constraint for SEQUENCE OF and SET OF applies |
| 2104 | * to the inner type. |
| 2105 | */ |
| 2106 | if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF |
| 2107 | || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) { |
| 2108 | assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints); |
| 2109 | TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr; |
| 2110 | } else { |
| 2111 | if(yyval.a_expr->constraints) { |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2112 | assert(!yyvsp[-1].a_expr); |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2113 | } else { |
| 2114 | yyval.a_expr->constraints = yyvsp[0].a_constr; |
| 2115 | } |
| 2116 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2117 | ; |
| 2118 | break;} |
| 2119 | case 102: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2120 | #line 1052 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2121 | { |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2122 | yyval.a_expr = yyvsp[0].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2123 | ; |
| 2124 | break;} |
| 2125 | case 103: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2126 | #line 1055 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2127 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2128 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 2129 | checkmem(yyval.a_expr); |
| 2130 | yyval.a_expr->expr_type = yyvsp[0].a_type; |
| 2131 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2132 | ; |
| 2133 | break;} |
| 2134 | case 104: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2135 | #line 1061 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2136 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2137 | yyval.a_expr = yyvsp[-1].a_expr; |
| 2138 | assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| 2139 | yyval.a_expr->expr_type = ASN_CONSTR_CHOICE; |
| 2140 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2141 | ; |
| 2142 | break;} |
| 2143 | case 105: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2144 | #line 1067 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2145 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2146 | yyval.a_expr = yyvsp[-1].a_expr; |
| 2147 | assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| 2148 | yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE; |
| 2149 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2150 | ; |
| 2151 | break;} |
| 2152 | case 106: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2153 | #line 1073 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2154 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2155 | yyval.a_expr = yyvsp[-1].a_expr; |
| 2156 | assert(yyval.a_expr->expr_type == A1TC_INVALID); |
| 2157 | yyval.a_expr->expr_type = ASN_CONSTR_SET; |
| 2158 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2159 | ; |
| 2160 | break;} |
| 2161 | case 107: |
vlm | fce48a4 | 2004-09-14 02:36:39 +0000 | [diff] [blame] | 2162 | #line 1079 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2163 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2164 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2165 | checkmem(yyval.a_expr); |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2166 | yyval.a_expr->constraints = yyvsp[-3].a_constr; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2167 | yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF; |
| 2168 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2169 | yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2170 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 2171 | ; |
| 2172 | break;} |
| 2173 | case 108: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2174 | #line 1088 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2175 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2176 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2177 | checkmem(yyval.a_expr); |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2178 | yyval.a_expr->constraints = yyvsp[-3].a_constr; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2179 | yyval.a_expr->expr_type = ASN_CONSTR_SET_OF; |
| 2180 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2181 | yyvsp[0].a_expr->tag = yyvsp[-1].a_tag; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2182 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 2183 | ; |
| 2184 | break;} |
| 2185 | case 109: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2186 | #line 1097 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2187 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2188 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2189 | checkmem(yyval.a_expr); |
vlm | 044f744 | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 2190 | yyval.a_expr->expr_type = ASN_TYPE_ANY; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2191 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2192 | ; |
| 2193 | break;} |
| 2194 | case 110: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2195 | #line 1103 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2196 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2197 | int ret; |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2198 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2199 | checkmem(yyval.a_expr); |
| 2200 | yyval.a_expr->reference = asn1p_ref_new(yylineno); |
| 2201 | ret = asn1p_ref_add_component(yyval.a_expr->reference, |
| 2202 | yyvsp[0].tv_str, RLT_lowercase); |
| 2203 | checkmem(ret == 0); |
vlm | 044f744 | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 2204 | yyval.a_expr->expr_type = ASN_TYPE_ANY; |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 2205 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2206 | ; |
| 2207 | break;} |
| 2208 | case 111: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2209 | #line 1117 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2210 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2211 | int ret; |
| 2212 | yyval.a_expr = yyvsp[-1].a_expr; |
| 2213 | assert(yyval.a_expr->expr_type == 0); |
| 2214 | assert(yyval.a_expr->meta_type == 0); |
| 2215 | assert(yyval.a_expr->reference == 0); |
| 2216 | yyval.a_expr->reference = asn1p_ref_new(yylineno); |
| 2217 | checkmem(yyval.a_expr->reference); |
| 2218 | ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN); |
| 2219 | checkmem(ret == 0); |
| 2220 | free(yyvsp[-3].tv_str); |
| 2221 | yyval.a_expr->expr_type = A1TC_PARAMETRIZED; |
| 2222 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2223 | ; |
| 2224 | break;} |
| 2225 | case 112: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2226 | #line 1141 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2227 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2228 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 2229 | checkmem(yyval.a_expr); |
| 2230 | yyval.a_expr->reference = yyvsp[0].a_ref; |
| 2231 | yyval.a_expr->expr_type = A1TC_REFERENCE; |
| 2232 | yyval.a_expr->meta_type = AMT_TYPEREF; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2233 | ; |
| 2234 | break;} |
| 2235 | case 113: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2236 | #line 1148 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2237 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2238 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 2239 | checkmem(yyval.a_expr); |
| 2240 | yyval.a_expr->reference = yyvsp[0].a_ref; |
| 2241 | yyval.a_expr->expr_type = A1TC_INSTANCE; |
| 2242 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2243 | ; |
| 2244 | break;} |
| 2245 | case 114: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2246 | #line 1163 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2247 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2248 | int ret; |
| 2249 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2250 | checkmem(yyval.a_ref); |
| 2251 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| 2252 | checkmem(ret == 0); |
| 2253 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2254 | ; |
| 2255 | break;} |
| 2256 | case 115: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2257 | #line 1171 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2258 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2259 | int ret; |
| 2260 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2261 | checkmem(yyval.a_ref); |
| 2262 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| 2263 | checkmem(ret == 0); |
| 2264 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
| 2265 | checkmem(ret == 0); |
| 2266 | free(yyvsp[-2].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2267 | ; |
| 2268 | break;} |
| 2269 | case 116: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2270 | #line 1181 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2271 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2272 | int ret; |
| 2273 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2274 | checkmem(yyval.a_ref); |
| 2275 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| 2276 | checkmem(ret == 0); |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2277 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2278 | checkmem(ret == 0); |
| 2279 | free(yyvsp[-2].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2280 | ; |
| 2281 | break;} |
| 2282 | case 117: |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 2283 | #line 1191 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2284 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2285 | int ret; |
| 2286 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2287 | checkmem(yyval.a_ref); |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2288 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| 2289 | checkmem(ret == 0); |
| 2290 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase); |
| 2291 | checkmem(ret == 0); |
| 2292 | free(yyvsp[-2].tv_str); |
| 2293 | ; |
| 2294 | break;} |
| 2295 | case 118: |
| 2296 | #line 1201 "asn1p_y.y" |
| 2297 | { |
| 2298 | int ret; |
| 2299 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2300 | checkmem(yyval.a_ref); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2301 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS); |
| 2302 | free(yyvsp[0].tv_str); |
| 2303 | checkmem(ret == 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2304 | ; |
| 2305 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2306 | case 119: |
| 2307 | #line 1209 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2308 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2309 | int ret; |
| 2310 | yyval.a_ref = yyvsp[0].a_ref; |
| 2311 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS); |
| 2312 | free(yyvsp[-2].tv_str); |
| 2313 | checkmem(ret == 0); |
| 2314 | /* |
| 2315 | * Move the last element infront. |
| 2316 | */ |
| 2317 | { |
| 2318 | struct asn1p_ref_component_s tmp_comp; |
| 2319 | tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1]; |
| 2320 | memmove(&yyval.a_ref->components[1], |
| 2321 | &yyval.a_ref->components[0], |
| 2322 | sizeof(yyval.a_ref->components[0]) |
| 2323 | * (yyval.a_ref->comp_count - 1)); |
| 2324 | yyval.a_ref->components[0] = tmp_comp; |
| 2325 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2326 | ; |
| 2327 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2328 | case 120: |
| 2329 | #line 1231 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2330 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2331 | int ret; |
| 2332 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 2333 | checkmem(yyval.a_ref); |
| 2334 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| 2335 | free(yyvsp[0].a_refcomp.name); |
| 2336 | checkmem(ret == 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2337 | ; |
| 2338 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2339 | case 121: |
| 2340 | #line 1239 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2341 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2342 | int ret; |
| 2343 | yyval.a_ref = yyvsp[-2].a_ref; |
| 2344 | ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type); |
| 2345 | free(yyvsp[0].a_refcomp.name); |
| 2346 | checkmem(ret == 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2347 | ; |
| 2348 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2349 | case 124: |
| 2350 | #line 1253 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2351 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2352 | yyval.a_refcomp.lex_type = RLT_AmpUppercase; |
| 2353 | yyval.a_refcomp.name = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2354 | ; |
| 2355 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2356 | case 125: |
| 2357 | #line 1258 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2358 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2359 | yyval.a_refcomp.lex_type = RLT_Amplowercase; |
| 2360 | yyval.a_refcomp.name = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2361 | ; |
| 2362 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2363 | case 126: |
| 2364 | #line 1271 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2365 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2366 | yyval.a_expr = yyvsp[-2].a_expr; |
| 2367 | assert(yyval.a_expr->Identifier == NULL); |
| 2368 | yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| 2369 | yyval.a_expr->meta_type = AMT_VALUE; |
| 2370 | yyval.a_expr->value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2371 | ; |
| 2372 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2373 | case 127: |
| 2374 | #line 1281 "asn1p_y.y" |
| 2375 | { |
| 2376 | yyval.a_value = asn1p_value_fromint(0); |
| 2377 | checkmem(yyval.a_value); |
| 2378 | yyval.a_value->type = ATV_CHOICE_IDENTIFIER; |
| 2379 | yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str; |
| 2380 | yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value; |
| 2381 | ; |
| 2382 | break;} |
| 2383 | case 128: |
| 2384 | #line 1288 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2385 | { asn1p_lexer_hack_push_opaque_state(); ; |
| 2386 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2387 | case 129: |
| 2388 | #line 1288 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2389 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2390 | yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
| 2391 | checkmem(yyval.a_value); |
| 2392 | yyval.a_value->type = ATV_UNPARSED; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2393 | ; |
| 2394 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2395 | case 130: |
| 2396 | #line 1293 "asn1p_y.y" |
| 2397 | { |
| 2398 | yyval.a_value = asn1p_value_fromint(0); |
| 2399 | checkmem(yyval.a_value); |
| 2400 | yyval.a_value->type = ATV_NULL; |
| 2401 | ; |
| 2402 | break;} |
| 2403 | case 131: |
| 2404 | #line 1298 "asn1p_y.y" |
| 2405 | { |
| 2406 | yyval.a_value = asn1p_value_fromint(0); |
| 2407 | checkmem(yyval.a_value); |
| 2408 | yyval.a_value->type = ATV_FALSE; |
| 2409 | ; |
| 2410 | break;} |
| 2411 | case 132: |
| 2412 | #line 1303 "asn1p_y.y" |
| 2413 | { |
| 2414 | yyval.a_value = asn1p_value_fromint(0); |
| 2415 | checkmem(yyval.a_value); |
| 2416 | yyval.a_value->type = ATV_TRUE; |
| 2417 | ; |
| 2418 | break;} |
| 2419 | case 133: |
| 2420 | #line 1308 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2421 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2422 | yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B'); |
| 2423 | checkmem(yyval.a_value); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2424 | ; |
| 2425 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2426 | case 134: |
| 2427 | #line 1312 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2428 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2429 | yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H'); |
| 2430 | checkmem(yyval.a_value); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2431 | ; |
| 2432 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2433 | case 135: |
| 2434 | #line 1316 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2435 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2436 | yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
| 2437 | checkmem(yyval.a_value); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2438 | ; |
| 2439 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2440 | case 136: |
| 2441 | #line 1320 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2442 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2443 | yyval.a_value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2444 | ; |
| 2445 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2446 | case 137: |
| 2447 | #line 1323 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2448 | { |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2449 | yyval.a_value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2450 | ; |
| 2451 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2452 | case 138: |
| 2453 | #line 1329 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2454 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2455 | asn1p_ref_t *ref; |
| 2456 | int ret; |
| 2457 | ref = asn1p_ref_new(yylineno); |
| 2458 | checkmem(ref); |
| 2459 | ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| 2460 | checkmem(ret == 0); |
| 2461 | yyval.a_value = asn1p_value_fromref(ref, 0); |
| 2462 | checkmem(yyval.a_value); |
| 2463 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2464 | ; |
| 2465 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2466 | case 139: |
| 2467 | #line 1340 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2468 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2469 | asn1p_ref_t *ref; |
| 2470 | int ret; |
| 2471 | ref = asn1p_ref_new(yylineno); |
| 2472 | checkmem(ref); |
| 2473 | ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN); |
| 2474 | checkmem(ret == 0); |
| 2475 | ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| 2476 | checkmem(ret == 0); |
| 2477 | yyval.a_value = asn1p_value_fromref(ref, 0); |
| 2478 | checkmem(yyval.a_value); |
| 2479 | free(yyvsp[-2].tv_str); |
| 2480 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2481 | ; |
| 2482 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2483 | case 140: |
| 2484 | #line 1357 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2485 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2486 | yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 2; |
| 2487 | yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1); |
| 2488 | checkmem(yyval.tv_opaque.buf); |
| 2489 | yyval.tv_opaque.buf[0] = '{'; |
| 2490 | yyval.tv_opaque.buf[1] = ' '; |
| 2491 | memcpy(yyval.tv_opaque.buf + 2, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); |
| 2492 | yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0'; |
| 2493 | free(yyvsp[0].tv_opaque.buf); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2494 | ; |
| 2495 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2496 | case 141: |
| 2497 | #line 1367 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2498 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2499 | int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len; |
| 2500 | char *p = malloc(newsize + 1); |
| 2501 | checkmem(p); |
| 2502 | memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len); |
| 2503 | memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len); |
| 2504 | p[newsize] = '\0'; |
| 2505 | free(yyvsp[-1].tv_opaque.buf); |
| 2506 | free(yyvsp[0].tv_opaque.buf); |
| 2507 | yyval.tv_opaque.buf = p; |
| 2508 | yyval.tv_opaque.len = newsize; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2509 | ; |
| 2510 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2511 | case 142: |
| 2512 | #line 1382 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2513 | { yyval.a_type = ASN_BASIC_BOOLEAN; ; |
| 2514 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2515 | case 143: |
| 2516 | #line 1383 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2517 | { yyval.a_type = ASN_BASIC_NULL; ; |
| 2518 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2519 | case 144: |
| 2520 | #line 1384 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2521 | { yyval.a_type = ASN_BASIC_REAL; ; |
| 2522 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2523 | case 145: |
| 2524 | #line 1385 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2525 | { yyval.a_type = yyvsp[0].a_type; ; |
| 2526 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2527 | case 146: |
| 2528 | #line 1386 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2529 | { yyval.a_type = ASN_BASIC_OCTET_STRING; ; |
| 2530 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2531 | case 147: |
| 2532 | #line 1387 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2533 | { yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ; |
| 2534 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2535 | case 148: |
| 2536 | #line 1388 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2537 | { yyval.a_type = ASN_BASIC_RELATIVE_OID; ; |
| 2538 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2539 | case 149: |
| 2540 | #line 1389 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2541 | { yyval.a_type = ASN_BASIC_EXTERNAL; ; |
| 2542 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2543 | case 150: |
| 2544 | #line 1390 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2545 | { yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ; |
| 2546 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2547 | case 151: |
| 2548 | #line 1391 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2549 | { yyval.a_type = ASN_BASIC_CHARACTER_STRING; ; |
| 2550 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2551 | case 152: |
| 2552 | #line 1392 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2553 | { yyval.a_type = ASN_BASIC_UTCTime; ; |
| 2554 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2555 | case 153: |
| 2556 | #line 1393 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2557 | { yyval.a_type = ASN_BASIC_GeneralizedTime; ; |
| 2558 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2559 | case 154: |
| 2560 | #line 1400 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2561 | { yyval.a_type = ASN_BASIC_INTEGER; ; |
| 2562 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2563 | case 155: |
| 2564 | #line 1401 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2565 | { yyval.a_type = ASN_BASIC_ENUMERATED; ; |
| 2566 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2567 | case 156: |
| 2568 | #line 1402 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2569 | { yyval.a_type = ASN_BASIC_BIT_STRING; ; |
| 2570 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2571 | case 157: |
| 2572 | #line 1406 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2573 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2574 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2575 | checkmem(yyval.a_expr); |
| 2576 | yyval.a_expr->expr_type = yyvsp[0].a_type; |
| 2577 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2578 | ; |
| 2579 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2580 | case 158: |
| 2581 | #line 1412 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2582 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2583 | if(yyvsp[0].a_expr) { |
| 2584 | yyval.a_expr = yyvsp[0].a_expr; |
| 2585 | } else { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2586 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2587 | checkmem(yyval.a_expr); |
| 2588 | } |
| 2589 | yyval.a_expr->expr_type = yyvsp[-1].a_type; |
| 2590 | yyval.a_expr->meta_type = AMT_TYPE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2591 | ; |
| 2592 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2593 | case 159: |
| 2594 | #line 1425 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2595 | { yyval.a_type = ASN_STRING_BMPString; ; |
| 2596 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2597 | case 160: |
| 2598 | #line 1426 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2599 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2600 | yyval.a_type = ASN_STRING_GeneralString; |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2601 | fprintf(stderr, "WARNING: GeneralString is not fully supported\n"); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2602 | ; |
| 2603 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2604 | case 161: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2605 | #line 1430 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2606 | { |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2607 | yyval.a_type = ASN_STRING_GraphicString; |
| 2608 | fprintf(stderr, "WARNING: GraphicString is not fully supported\n"); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2609 | ; |
| 2610 | break;} |
| 2611 | case 162: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2612 | #line 1434 "asn1p_y.y" |
| 2613 | { yyval.a_type = ASN_STRING_IA5String; ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2614 | break;} |
| 2615 | case 163: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2616 | #line 1435 "asn1p_y.y" |
| 2617 | { yyval.a_type = ASN_STRING_ISO646String; ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2618 | break;} |
| 2619 | case 164: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2620 | #line 1436 "asn1p_y.y" |
| 2621 | { yyval.a_type = ASN_STRING_NumericString; ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2622 | break;} |
| 2623 | case 165: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2624 | #line 1437 "asn1p_y.y" |
| 2625 | { yyval.a_type = ASN_STRING_PrintableString; ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2626 | break;} |
| 2627 | case 166: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2628 | #line 1438 "asn1p_y.y" |
| 2629 | { |
| 2630 | yyval.a_type = ASN_STRING_T61String; |
| 2631 | fprintf(stderr, "WARNING: T61String is not fully supported\n"); |
| 2632 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2633 | break;} |
| 2634 | case 167: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2635 | #line 1442 "asn1p_y.y" |
| 2636 | { yyval.a_type = ASN_STRING_TeletexString; ; |
| 2637 | break;} |
| 2638 | case 168: |
| 2639 | #line 1443 "asn1p_y.y" |
| 2640 | { yyval.a_type = ASN_STRING_UniversalString; ; |
| 2641 | break;} |
| 2642 | case 169: |
| 2643 | #line 1444 "asn1p_y.y" |
| 2644 | { yyval.a_type = ASN_STRING_UTF8String; ; |
| 2645 | break;} |
| 2646 | case 170: |
| 2647 | #line 1445 "asn1p_y.y" |
| 2648 | { |
| 2649 | yyval.a_type = ASN_STRING_VideotexString; |
| 2650 | fprintf(stderr, "WARNING: VideotexString is not fully supported\n"); |
| 2651 | ; |
| 2652 | break;} |
| 2653 | case 171: |
| 2654 | #line 1449 "asn1p_y.y" |
| 2655 | { yyval.a_type = ASN_STRING_VisibleString; ; |
| 2656 | break;} |
| 2657 | case 172: |
| 2658 | #line 1450 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2659 | { yyval.a_type = ASN_STRING_ObjectDescriptor; ; |
| 2660 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2661 | case 178: |
| 2662 | #line 1462 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2663 | { yyval.a_constr = 0; ; |
| 2664 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2665 | case 179: |
| 2666 | #line 1463 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2667 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2668 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2669 | ; |
| 2670 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2671 | case 180: |
| 2672 | #line 1469 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2673 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2674 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2675 | ; |
| 2676 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2677 | case 181: |
| 2678 | #line 1472 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2679 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2680 | /* |
| 2681 | * This is a special case, for compatibility purposes. |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2682 | * It goes without parentheses. |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2683 | */ |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2684 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2685 | ; |
| 2686 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2687 | case 182: |
| 2688 | #line 1482 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2689 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2690 | yyval.a_constr = yyvsp[-1].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2691 | ; |
| 2692 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2693 | case 183: |
| 2694 | #line 1485 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2695 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2696 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2697 | ; |
| 2698 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2699 | case 184: |
| 2700 | #line 1491 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2701 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2702 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2703 | ; |
| 2704 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2705 | case 185: |
| 2706 | #line 1494 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2707 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2708 | asn1p_constraint_t *ct; |
| 2709 | ct = asn1p_constraint_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2710 | ct->type = ACT_EL_EXT; |
| 2711 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2712 | ; |
| 2713 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2714 | case 186: |
| 2715 | #line 1500 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2716 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2717 | asn1p_constraint_t *ct; |
| 2718 | ct = asn1p_constraint_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2719 | ct->type = ACT_EL_EXT; |
| 2720 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct); |
vlm | 6f5eb0b | 2004-08-13 12:35:09 +0000 | [diff] [blame] | 2721 | ct = yyval.a_constr; |
| 2722 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2723 | ; |
| 2724 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2725 | case 187: |
| 2726 | #line 1511 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2727 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2728 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2729 | ; |
| 2730 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2731 | case 188: |
| 2732 | #line 1514 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2733 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2734 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2735 | ; |
| 2736 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2737 | case 189: |
| 2738 | #line 1517 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2739 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2740 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2741 | ; |
| 2742 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2743 | case 190: |
| 2744 | #line 1520 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2745 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2746 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2747 | ; |
| 2748 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2749 | case 191: |
| 2750 | #line 1526 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2751 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2752 | int ret; |
| 2753 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2754 | checkmem(yyval.a_constr); |
| 2755 | yyval.a_constr->type = yyvsp[-3].a_ctype; |
| 2756 | ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); |
| 2757 | checkmem(ret == 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2758 | ; |
| 2759 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2760 | case 192: |
| 2761 | #line 1534 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2762 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2763 | int ret; |
| 2764 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2765 | checkmem(yyval.a_constr); |
| 2766 | yyval.a_constr->type = ACT_CA_SET; |
| 2767 | ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr); |
| 2768 | checkmem(ret == 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2769 | ; |
| 2770 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2771 | case 193: |
| 2772 | #line 1542 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2773 | { |
vlm | 9283dbe | 2004-08-18 04:59:12 +0000 | [diff] [blame] | 2774 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2775 | checkmem(yyval.a_constr); |
| 2776 | yyval.a_constr->type = ACT_EL_VALUE; |
| 2777 | yyval.a_constr->value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2778 | ; |
| 2779 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2780 | case 194: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2781 | #line 1548 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2782 | { |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2783 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2784 | checkmem(yyval.a_constr); |
| 2785 | yyval.a_constr->type = yyvsp[-1].a_ctype; |
| 2786 | yyval.a_constr->range_start = yyvsp[-2].a_value; |
| 2787 | yyval.a_constr->range_stop = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2788 | ; |
| 2789 | break;} |
| 2790 | case 195: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2791 | #line 1555 "asn1p_y.y" |
| 2792 | { |
| 2793 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2794 | checkmem(yyval.a_constr); |
| 2795 | yyval.a_constr->type = yyvsp[-1].a_ctype; |
| 2796 | yyval.a_constr->range_start = asn1p_value_fromint(-123); |
| 2797 | yyval.a_constr->range_stop = yyvsp[0].a_value; |
| 2798 | yyval.a_constr->range_start->type = ATV_MIN; |
| 2799 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2800 | break;} |
| 2801 | case 196: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2802 | #line 1563 "asn1p_y.y" |
| 2803 | { |
| 2804 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2805 | checkmem(yyval.a_constr); |
| 2806 | yyval.a_constr->type = yyvsp[-1].a_ctype; |
| 2807 | yyval.a_constr->range_start = yyvsp[-2].a_value; |
| 2808 | yyval.a_constr->range_stop = asn1p_value_fromint(321); |
| 2809 | yyval.a_constr->range_stop->type = ATV_MAX; |
| 2810 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2811 | break;} |
| 2812 | case 197: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2813 | #line 1571 "asn1p_y.y" |
| 2814 | { |
| 2815 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2816 | checkmem(yyval.a_constr); |
| 2817 | yyval.a_constr->type = yyvsp[-1].a_ctype; |
| 2818 | yyval.a_constr->range_start = asn1p_value_fromint(-123); |
| 2819 | yyval.a_constr->range_stop = asn1p_value_fromint(321); |
| 2820 | yyval.a_constr->range_start->type = ATV_MIN; |
| 2821 | yyval.a_constr->range_stop->type = ATV_MAX; |
| 2822 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2823 | break;} |
| 2824 | case 198: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2825 | #line 1580 "asn1p_y.y" |
| 2826 | { |
| 2827 | yyval.a_constr = yyvsp[0].a_constr; |
| 2828 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2829 | break;} |
| 2830 | case 199: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2831 | #line 1583 "asn1p_y.y" |
| 2832 | { |
| 2833 | yyval.a_constr = yyvsp[0].a_constr; |
| 2834 | ; |
| 2835 | break;} |
| 2836 | case 200: |
| 2837 | #line 1589 "asn1p_y.y" |
| 2838 | { yyval.a_ctype = ACT_EL_RANGE; ; |
| 2839 | break;} |
| 2840 | case 201: |
| 2841 | #line 1590 "asn1p_y.y" |
| 2842 | { yyval.a_ctype = ACT_EL_RLRANGE; ; |
| 2843 | break;} |
| 2844 | case 202: |
| 2845 | #line 1591 "asn1p_y.y" |
| 2846 | { yyval.a_ctype = ACT_EL_LLRANGE; ; |
| 2847 | break;} |
| 2848 | case 203: |
| 2849 | #line 1592 "asn1p_y.y" |
| 2850 | { yyval.a_ctype = ACT_EL_ULRANGE; ; |
| 2851 | break;} |
| 2852 | case 204: |
| 2853 | #line 1596 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2854 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2855 | yyval.a_ctype = ACT_CT_SIZE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2856 | ; |
| 2857 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2858 | case 205: |
| 2859 | #line 1599 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2860 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 2861 | yyval.a_ctype = ACT_CT_FROM; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2862 | ; |
| 2863 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2864 | case 206: |
| 2865 | #line 1605 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2866 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2867 | yyval.a_value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2868 | ; |
| 2869 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2870 | case 207: |
| 2871 | #line 1608 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2872 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2873 | asn1p_ref_t *ref; |
| 2874 | int ret; |
| 2875 | ref = asn1p_ref_new(yylineno); |
| 2876 | checkmem(ref); |
| 2877 | ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase); |
| 2878 | checkmem(ret == 0); |
| 2879 | yyval.a_value = asn1p_value_fromref(ref, 0); |
| 2880 | checkmem(yyval.a_value); |
| 2881 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2882 | ; |
| 2883 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2884 | case 208: |
| 2885 | #line 1619 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2886 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2887 | yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0); |
| 2888 | checkmem(yyval.a_value); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2889 | ; |
| 2890 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2891 | case 209: |
| 2892 | #line 1623 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2893 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2894 | yyval.a_value = asn1p_value_fromint(0); |
| 2895 | checkmem(yyval.a_value); |
| 2896 | yyval.a_value->type = ATV_FALSE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2897 | ; |
| 2898 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2899 | case 210: |
| 2900 | #line 1628 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2901 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2902 | yyval.a_value = asn1p_value_fromint(1); |
| 2903 | checkmem(yyval.a_value); |
| 2904 | yyval.a_value->type = ATV_TRUE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2905 | ; |
| 2906 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2907 | case 211: |
| 2908 | #line 1636 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2909 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2910 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2911 | ; |
| 2912 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2913 | case 212: |
| 2914 | #line 1642 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2915 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2916 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2917 | ; |
| 2918 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2919 | case 213: |
| 2920 | #line 1645 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2921 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2922 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2923 | ; |
| 2924 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2925 | case 214: |
| 2926 | #line 1651 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2927 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2928 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2929 | checkmem(yyval.a_constr); |
| 2930 | yyval.a_constr->type = ACT_EL_EXT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2931 | ; |
| 2932 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2933 | case 215: |
| 2934 | #line 1656 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2935 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2936 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 2937 | checkmem(yyval.a_constr); |
| 2938 | yyval.a_constr->type = ACT_EL_VALUE; |
| 2939 | yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0); |
| 2940 | yyval.a_constr->presence = yyvsp[0].a_pres; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2941 | ; |
| 2942 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2943 | case 216: |
| 2944 | #line 1669 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2945 | { yyval.a_pres = ACPRES_DEFAULT; ; |
| 2946 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2947 | case 217: |
| 2948 | #line 1670 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2949 | { yyval.a_pres = yyvsp[0].a_pres; ; |
| 2950 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2951 | case 218: |
| 2952 | #line 1674 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2953 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2954 | yyval.a_pres = ACPRES_PRESENT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2955 | ; |
| 2956 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2957 | case 219: |
| 2958 | #line 1677 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2959 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2960 | yyval.a_pres = ACPRES_ABSENT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2961 | ; |
| 2962 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2963 | case 220: |
| 2964 | #line 1680 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2965 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2966 | yyval.a_pres = ACPRES_OPTIONAL; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2967 | ; |
| 2968 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2969 | case 221: |
| 2970 | #line 1686 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2971 | { |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2972 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2973 | ; |
| 2974 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2975 | case 222: |
| 2976 | #line 1689 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2977 | { |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 2978 | yyval.a_constr = yyvsp[0].a_constr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2979 | ; |
| 2980 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2981 | case 223: |
| 2982 | #line 1698 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2983 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2984 | asn1p_ref_t *ref = asn1p_ref_new(yylineno); |
| 2985 | asn1p_constraint_t *ct; |
| 2986 | int ret; |
| 2987 | ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0); |
| 2988 | checkmem(ret == 0); |
| 2989 | ct = asn1p_constraint_new(yylineno); |
| 2990 | checkmem(yyval.a_constr); |
| 2991 | ct->type = ACT_EL_VALUE; |
| 2992 | ct->value = asn1p_value_fromref(ref, 0); |
| 2993 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2994 | ; |
| 2995 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 2996 | case 224: |
| 2997 | #line 1713 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 2998 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 2999 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3000 | ; |
| 3001 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3002 | case 225: |
| 3003 | #line 1719 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3004 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3005 | yyval.a_constr = asn1p_constraint_new(yylineno); |
| 3006 | checkmem(yyval.a_constr); |
| 3007 | yyval.a_constr->type = ACT_EL_VALUE; |
| 3008 | yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3009 | ; |
| 3010 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3011 | case 226: |
| 3012 | #line 1725 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3013 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3014 | asn1p_constraint_t *ct; |
| 3015 | ct = asn1p_constraint_new(yylineno); |
| 3016 | checkmem(ct); |
| 3017 | ct->type = ACT_EL_VALUE; |
| 3018 | ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0); |
| 3019 | CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3020 | ; |
| 3021 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3022 | case 227: |
| 3023 | #line 1739 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3024 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3025 | char *p = malloc(strlen(yyvsp[0].tv_str) + 2); |
| 3026 | int ret; |
| 3027 | *p = '@'; |
| 3028 | strcpy(p + 1, yyvsp[0].tv_str); |
| 3029 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 3030 | ret = asn1p_ref_add_component(yyval.a_ref, p, 0); |
| 3031 | checkmem(ret == 0); |
| 3032 | free(p); |
| 3033 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3034 | ; |
| 3035 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3036 | case 228: |
| 3037 | #line 1750 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3038 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3039 | char *p = malloc(strlen(yyvsp[0].tv_str) + 3); |
| 3040 | int ret; |
| 3041 | p[0] = '@'; |
| 3042 | p[1] = '.'; |
| 3043 | strcpy(p + 2, yyvsp[0].tv_str); |
| 3044 | yyval.a_ref = asn1p_ref_new(yylineno); |
| 3045 | ret = asn1p_ref_add_component(yyval.a_ref, p, 0); |
| 3046 | checkmem(ret == 0); |
| 3047 | free(p); |
| 3048 | free(yyvsp[0].tv_str); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3049 | ; |
| 3050 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3051 | case 229: |
| 3052 | #line 1766 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3053 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3054 | yyval.tv_str = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3055 | ; |
| 3056 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3057 | case 230: |
| 3058 | #line 1769 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3059 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3060 | int l1 = strlen(yyvsp[-2].tv_str); |
| 3061 | int l3 = strlen(yyvsp[0].tv_str); |
| 3062 | yyval.tv_str = malloc(l1 + 1 + l3 + 1); |
| 3063 | memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1); |
| 3064 | yyval.tv_str[l1] = '.'; |
| 3065 | memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3); |
| 3066 | yyval.tv_str[l1 + 1 + l3] = '\0'; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3067 | ; |
| 3068 | break;} |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 3069 | case 231: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3070 | #line 1787 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3071 | { |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3072 | yyval.a_marker.flags = EM_NOMARK; |
| 3073 | yyval.a_marker.default_value = 0; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3074 | ; |
| 3075 | break;} |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 3076 | case 232: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3077 | #line 1791 "asn1p_y.y" |
| 3078 | { yyval.a_marker = yyvsp[0].a_marker; ; |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 3079 | break;} |
| 3080 | case 233: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3081 | #line 1795 "asn1p_y.y" |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 3082 | { |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3083 | yyval.a_marker.flags = EM_OPTIONAL; |
| 3084 | yyval.a_marker.default_value = 0; |
vlm | a2374a0 | 2004-09-14 02:44:07 +0000 | [diff] [blame] | 3085 | ; |
| 3086 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3087 | case 234: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3088 | #line 1799 "asn1p_y.y" |
| 3089 | { |
| 3090 | yyval.a_marker.flags = EM_DEFAULT; |
| 3091 | yyval.a_marker.default_value = yyvsp[0].a_value; |
| 3092 | ; |
| 3093 | break;} |
| 3094 | case 235: |
| 3095 | #line 1822 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3096 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3097 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3098 | checkmem(yyval.a_expr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3099 | ; |
| 3100 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3101 | case 236: |
| 3102 | #line 1826 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3103 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3104 | yyval.a_expr = yyvsp[-1].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3105 | ; |
| 3106 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3107 | case 237: |
| 3108 | #line 1832 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3109 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3110 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3111 | checkmem(yyval.a_expr); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3112 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 3113 | ; |
| 3114 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3115 | case 238: |
| 3116 | #line 1837 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3117 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3118 | yyval.a_expr = yyvsp[-2].a_expr; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3119 | asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr); |
| 3120 | ; |
| 3121 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3122 | case 239: |
| 3123 | #line 1844 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3124 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3125 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3126 | checkmem(yyval.a_expr); |
| 3127 | yyval.a_expr->expr_type = A1TC_UNIVERVAL; |
| 3128 | yyval.a_expr->meta_type = AMT_VALUE; |
| 3129 | yyval.a_expr->Identifier = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3130 | ; |
| 3131 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3132 | case 240: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3133 | #line 1851 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3134 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3135 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | 5f0128b | 2004-08-20 13:25:29 +0000 | [diff] [blame] | 3136 | checkmem(yyval.a_expr); |
| 3137 | yyval.a_expr->expr_type = A1TC_UNIVERVAL; |
| 3138 | yyval.a_expr->meta_type = AMT_VALUE; |
| 3139 | yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| 3140 | yyval.a_expr->value = yyvsp[-1].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3141 | ; |
| 3142 | break;} |
| 3143 | case 241: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3144 | #line 1859 "asn1p_y.y" |
| 3145 | { |
| 3146 | yyval.a_expr = asn1p_expr_new(yylineno); |
| 3147 | checkmem(yyval.a_expr); |
| 3148 | yyval.a_expr->expr_type = A1TC_UNIVERVAL; |
| 3149 | yyval.a_expr->meta_type = AMT_VALUE; |
| 3150 | yyval.a_expr->Identifier = yyvsp[-3].tv_str; |
| 3151 | yyval.a_expr->value = yyvsp[-1].a_value; |
| 3152 | ; |
| 3153 | break;} |
| 3154 | case 242: |
| 3155 | #line 1867 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3156 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3157 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3158 | checkmem(yyval.a_expr); |
| 3159 | yyval.a_expr->expr_type = A1TC_UNIVERVAL; |
| 3160 | yyval.a_expr->meta_type = AMT_VALUE; |
| 3161 | yyval.a_expr->value = yyvsp[0].a_value; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3162 | ; |
| 3163 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3164 | case 243: |
| 3165 | #line 1874 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3166 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3167 | yyval.a_expr = asn1p_expr_new(yylineno); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3168 | checkmem(yyval.a_expr); |
| 3169 | yyval.a_expr->Identifier = strdup("..."); |
| 3170 | checkmem(yyval.a_expr->Identifier); |
| 3171 | yyval.a_expr->expr_type = A1TC_EXTENSIBLE; |
| 3172 | yyval.a_expr->meta_type = AMT_VALUE; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3173 | ; |
| 3174 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3175 | case 244: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3176 | #line 1885 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3177 | { |
vlm | ec8f681 | 2004-08-22 03:19:54 +0000 | [diff] [blame] | 3178 | yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); |
| 3179 | checkmem(yyval.a_value); |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3180 | ; |
| 3181 | break;} |
| 3182 | case 245: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3183 | #line 1889 "asn1p_y.y" |
| 3184 | { |
| 3185 | yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int); |
| 3186 | checkmem(yyval.a_value); |
| 3187 | ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3188 | break;} |
| 3189 | case 246: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3190 | #line 1920 "asn1p_y.y" |
| 3191 | { memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3192 | break;} |
| 3193 | case 247: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3194 | #line 1921 "asn1p_y.y" |
| 3195 | { yyval.a_tag = yyvsp[0].a_tag; ; |
| 3196 | break;} |
| 3197 | case 248: |
| 3198 | #line 1925 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3199 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3200 | yyval.a_tag = yyvsp[0].a_tag; |
| 3201 | yyval.a_tag.tag_mode = TM_DEFAULT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3202 | ; |
| 3203 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3204 | case 249: |
| 3205 | #line 1929 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3206 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3207 | yyval.a_tag = yyvsp[-1].a_tag; |
| 3208 | yyval.a_tag.tag_mode = TM_IMPLICIT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3209 | ; |
| 3210 | break;} |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3211 | case 250: |
| 3212 | #line 1933 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3213 | { |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3214 | yyval.a_tag = yyvsp[-1].a_tag; |
| 3215 | yyval.a_tag.tag_mode = TM_EXPLICIT; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3216 | ; |
| 3217 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3218 | case 251: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3219 | #line 1940 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3220 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3221 | checkmem(yyvsp[0].tv_str); |
| 3222 | yyval.tv_str = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3223 | ; |
| 3224 | break;} |
| 3225 | case 252: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3226 | #line 1944 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3227 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3228 | checkmem(yyvsp[0].tv_str); |
| 3229 | yyval.tv_str = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3230 | ; |
| 3231 | break;} |
| 3232 | case 253: |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3233 | #line 1952 "asn1p_y.y" |
| 3234 | { |
| 3235 | checkmem(yyvsp[0].tv_str); |
| 3236 | yyval.tv_str = yyvsp[0].tv_str; |
| 3237 | ; |
| 3238 | break;} |
| 3239 | case 254: |
| 3240 | #line 1959 "asn1p_y.y" |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3241 | { |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3242 | checkmem(yyvsp[0].tv_str); |
| 3243 | yyval.tv_str = yyvsp[0].tv_str; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3244 | ; |
| 3245 | break;} |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3246 | } |
| 3247 | /* the action file gets copied in in place of this dollarsign */ |
| 3248 | #line 543 "/usr/share/bison.simple" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3249 | |
| 3250 | yyvsp -= yylen; |
| 3251 | yyssp -= yylen; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3252 | #ifdef YYLSP_NEEDED |
| 3253 | yylsp -= yylen; |
| 3254 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3255 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3256 | #if YYDEBUG != 0 |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3257 | if (yydebug) |
| 3258 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3259 | short *ssp1 = yyss - 1; |
| 3260 | fprintf (stderr, "state stack now"); |
| 3261 | while (ssp1 != yyssp) |
| 3262 | fprintf (stderr, " %d", *++ssp1); |
| 3263 | fprintf (stderr, "\n"); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3264 | } |
| 3265 | #endif |
| 3266 | |
| 3267 | *++yyvsp = yyval; |
| 3268 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3269 | #ifdef YYLSP_NEEDED |
| 3270 | yylsp++; |
| 3271 | if (yylen == 0) |
| 3272 | { |
| 3273 | yylsp->first_line = yylloc.first_line; |
| 3274 | yylsp->first_column = yylloc.first_column; |
| 3275 | yylsp->last_line = (yylsp-1)->last_line; |
| 3276 | yylsp->last_column = (yylsp-1)->last_column; |
| 3277 | yylsp->text = 0; |
| 3278 | } |
| 3279 | else |
| 3280 | { |
| 3281 | yylsp->last_line = (yylsp+yylen-1)->last_line; |
| 3282 | yylsp->last_column = (yylsp+yylen-1)->last_column; |
| 3283 | } |
| 3284 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3285 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3286 | /* Now "shift" the result of the reduction. |
| 3287 | Determine what state that goes to, |
| 3288 | based on the state we popped back to |
| 3289 | and the rule number reduced by. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3290 | |
| 3291 | yyn = yyr1[yyn]; |
| 3292 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3293 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
| 3294 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3295 | yystate = yytable[yystate]; |
| 3296 | else |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3297 | yystate = yydefgoto[yyn - YYNTBASE]; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3298 | |
| 3299 | goto yynewstate; |
| 3300 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3301 | yyerrlab: /* here on detecting error */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3302 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3303 | if (! yyerrstatus) |
| 3304 | /* If not already recovering from an error, report this error. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3305 | { |
| 3306 | ++yynerrs; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3307 | |
| 3308 | #ifdef YYERROR_VERBOSE |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3309 | yyn = yypact[yystate]; |
| 3310 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3311 | if (yyn > YYFLAG && yyn < YYLAST) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3312 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3313 | int size = 0; |
| 3314 | char *msg; |
| 3315 | int x, count; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3316 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3317 | count = 0; |
| 3318 | /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ |
| 3319 | for (x = (yyn < 0 ? -yyn : 0); |
| 3320 | x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++) |
| 3321 | if (yycheck[x + yyn] == x) |
| 3322 | size += strlen(yytname[x]) + 15, count++; |
| 3323 | msg = (char *) malloc(size + 15); |
| 3324 | if (msg != 0) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3325 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3326 | strcpy(msg, "parse error"); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3327 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3328 | if (count < 5) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3329 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3330 | count = 0; |
| 3331 | for (x = (yyn < 0 ? -yyn : 0); |
| 3332 | x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++) |
| 3333 | if (yycheck[x + yyn] == x) |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3334 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3335 | strcat(msg, count == 0 ? ", expecting `" : " or `"); |
| 3336 | strcat(msg, yytname[x]); |
| 3337 | strcat(msg, "'"); |
| 3338 | count++; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3339 | } |
| 3340 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3341 | yyerror(msg); |
| 3342 | free(msg); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3343 | } |
| 3344 | else |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3345 | yyerror ("parse error; also virtual memory exceeded"); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3346 | } |
| 3347 | else |
| 3348 | #endif /* YYERROR_VERBOSE */ |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3349 | yyerror("parse error"); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3350 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3351 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3352 | goto yyerrlab1; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3353 | yyerrlab1: /* here on error raised explicitly by an action */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3354 | |
| 3355 | if (yyerrstatus == 3) |
| 3356 | { |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3357 | /* if just tried and failed to reuse lookahead token after an error, discard it. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3358 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3359 | /* return failure if at end of input */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3360 | if (yychar == YYEOF) |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3361 | YYABORT; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3362 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3363 | #if YYDEBUG != 0 |
| 3364 | if (yydebug) |
| 3365 | fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); |
| 3366 | #endif |
| 3367 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3368 | yychar = YYEMPTY; |
| 3369 | } |
| 3370 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3371 | /* Else will try to reuse lookahead token |
| 3372 | after shifting the error token. */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3373 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3374 | yyerrstatus = 3; /* Each real token shifted decrements this */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3375 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3376 | goto yyerrhandle; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 3377 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3378 | yyerrdefault: /* current state does not do anything special for the error token. */ |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 3379 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3380 | #if 0 |
| 3381 | /* This is wrong; only states that explicitly want error tokens |
| 3382 | should shift them. */ |
| 3383 | yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ |
| 3384 | if (yyn) goto yydefault; |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3385 | #endif |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3386 | |
| 3387 | yyerrpop: /* pop the current state because it cannot handle the error token */ |
| 3388 | |
| 3389 | if (yyssp == yyss) YYABORT; |
| 3390 | yyvsp--; |
| 3391 | yystate = *--yyssp; |
| 3392 | #ifdef YYLSP_NEEDED |
| 3393 | yylsp--; |
| 3394 | #endif |
| 3395 | |
| 3396 | #if YYDEBUG != 0 |
| 3397 | if (yydebug) |
| 3398 | { |
| 3399 | short *ssp1 = yyss - 1; |
| 3400 | fprintf (stderr, "Error: state stack now"); |
| 3401 | while (ssp1 != yyssp) |
| 3402 | fprintf (stderr, " %d", *++ssp1); |
| 3403 | fprintf (stderr, "\n"); |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3404 | } |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3405 | #endif |
| 3406 | |
| 3407 | yyerrhandle: |
| 3408 | |
| 3409 | yyn = yypact[yystate]; |
| 3410 | if (yyn == YYFLAG) |
| 3411 | goto yyerrdefault; |
| 3412 | |
| 3413 | yyn += YYTERROR; |
| 3414 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) |
| 3415 | goto yyerrdefault; |
| 3416 | |
| 3417 | yyn = yytable[yyn]; |
| 3418 | if (yyn < 0) |
| 3419 | { |
| 3420 | if (yyn == YYFLAG) |
| 3421 | goto yyerrpop; |
| 3422 | yyn = -yyn; |
| 3423 | goto yyreduce; |
| 3424 | } |
| 3425 | else if (yyn == 0) |
| 3426 | goto yyerrpop; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3427 | |
| 3428 | if (yyn == YYFINAL) |
| 3429 | YYACCEPT; |
| 3430 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3431 | #if YYDEBUG != 0 |
| 3432 | if (yydebug) |
| 3433 | fprintf(stderr, "Shifting error token, "); |
| 3434 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3435 | |
| 3436 | *++yyvsp = yylval; |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3437 | #ifdef YYLSP_NEEDED |
| 3438 | *++yylsp = yylloc; |
| 3439 | #endif |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3440 | |
| 3441 | yystate = yyn; |
| 3442 | goto yynewstate; |
| 3443 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3444 | yyacceptlab: |
| 3445 | /* YYACCEPT comes here. */ |
| 3446 | if (yyfree_stacks) |
| 3447 | { |
| 3448 | free (yyss); |
| 3449 | free (yyvs); |
| 3450 | #ifdef YYLSP_NEEDED |
| 3451 | free (yyls); |
vlm | 044f744 | 2004-09-04 04:49:21 +0000 | [diff] [blame] | 3452 | #endif |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3453 | } |
| 3454 | return 0; |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 3455 | |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3456 | yyabortlab: |
| 3457 | /* YYABORT comes here. */ |
| 3458 | if (yyfree_stacks) |
| 3459 | { |
| 3460 | free (yyss); |
| 3461 | free (yyvs); |
| 3462 | #ifdef YYLSP_NEEDED |
| 3463 | free (yyls); |
vlm | 8010349 | 2004-09-07 10:39:09 +0000 | [diff] [blame] | 3464 | #endif |
vlm | 6a02a8a | 2004-09-08 00:28:11 +0000 | [diff] [blame] | 3465 | } |
| 3466 | return 1; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3467 | } |
vlm | c94e28f | 2004-09-15 11:59:51 +0000 | [diff] [blame] | 3468 | #line 1965 "asn1p_y.y" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3469 | |
| 3470 | |
| 3471 | |
| 3472 | /* |
| 3473 | * Convert Xstring ('0101'B or '5'H) to the binary vector. |
| 3474 | */ |
| 3475 | static asn1p_value_t * |
| 3476 | _convert_bitstring2binary(char *str, int base) { |
| 3477 | asn1p_value_t *val; |
| 3478 | int slen; |
| 3479 | int memlen; |
| 3480 | int baselen; |
| 3481 | int bits; |
| 3482 | uint8_t *binary_vector; |
| 3483 | uint8_t *bv_ptr; |
| 3484 | uint8_t cur_val; |
| 3485 | |
| 3486 | assert(str); |
| 3487 | assert(str[0] == '\''); |
| 3488 | |
| 3489 | switch(base) { |
| 3490 | case 'B': |
| 3491 | baselen = 1; |
| 3492 | break; |
| 3493 | case 'H': |
| 3494 | baselen = 4; |
| 3495 | break; |
| 3496 | default: |
| 3497 | assert(base == 'B' || base == 'H'); |
| 3498 | errno = EINVAL; |
| 3499 | return NULL; |
| 3500 | } |
| 3501 | |
| 3502 | slen = strlen(str); |
| 3503 | assert(str[slen - 1] == base); |
| 3504 | assert(str[slen - 2] == '\''); |
| 3505 | |
| 3506 | memlen = slen / (8 / baselen); /* Conservative estimate */ |
| 3507 | |
| 3508 | bv_ptr = binary_vector = malloc(memlen + 1); |
| 3509 | if(bv_ptr == NULL) |
| 3510 | /* ENOMEM */ |
| 3511 | return NULL; |
| 3512 | |
| 3513 | cur_val = 0; |
| 3514 | bits = 0; |
| 3515 | while(*(++str) != '\'') { |
| 3516 | switch(baselen) { |
| 3517 | case 1: |
| 3518 | switch(*str) { |
| 3519 | case '1': |
| 3520 | cur_val |= 1 << (7 - (bits % 8)); |
| 3521 | case '0': |
| 3522 | break; |
| 3523 | default: |
| 3524 | assert(!"_y UNREACH1"); |
| 3525 | case ' ': case '\r': case '\n': |
| 3526 | continue; |
| 3527 | } |
| 3528 | break; |
| 3529 | case 4: |
| 3530 | switch(*str) { |
| 3531 | case '0': case '1': case '2': case '3': case '4': |
| 3532 | case '5': case '6': case '7': case '8': case '9': |
| 3533 | cur_val |= (*str - '0') << (4 - (bits % 8)); |
| 3534 | break; |
| 3535 | case 'A': case 'B': case 'C': |
| 3536 | case 'D': case 'E': case 'F': |
| 3537 | cur_val |= ((*str - 'A') + 10) |
| 3538 | << (4 - (bits % 8)); |
| 3539 | break; |
| 3540 | default: |
| 3541 | assert(!"_y UNREACH2"); |
| 3542 | case ' ': case '\r': case '\n': |
| 3543 | continue; |
| 3544 | } |
| 3545 | break; |
| 3546 | } |
| 3547 | |
| 3548 | bits += baselen; |
| 3549 | if((bits % 8) == 0) { |
| 3550 | *bv_ptr++ = cur_val; |
| 3551 | cur_val = 0; |
| 3552 | } |
| 3553 | } |
| 3554 | |
| 3555 | *bv_ptr = cur_val; |
| 3556 | assert((bv_ptr - binary_vector) <= memlen); |
| 3557 | |
| 3558 | val = asn1p_value_frombits(binary_vector, bits, 0); |
| 3559 | if(val == NULL) { |
| 3560 | free(binary_vector); |
| 3561 | } |
| 3562 | |
| 3563 | return val; |
| 3564 | } |
| 3565 | |
| 3566 | extern char *asn1p_text; |
| 3567 | |
| 3568 | int |
| 3569 | yyerror(const char *msg) { |
| 3570 | fprintf(stderr, |
| 3571 | "ASN.1 grammar parse error " |
| 3572 | "near line %d (token \"%s\"): %s\n", |
vlm | 39e5ed7 | 2004-09-05 10:40:41 +0000 | [diff] [blame] | 3573 | yylineno, asn1p_text, msg); |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3574 | return -1; |
| 3575 | } |
| 3576 | |
| 3577 | |