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