blob: 02e0ba9998b1a5a6ec1083af9db27fcb66e09bfe [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001
Lev Walkin1004aa92004-09-08 00:28:11 +00002/* A Bison parser, made from asn1p_y.y
3 by GNU Bison version 1.28 */
Lev Walkinf15320b2004-06-03 03:38:44 +00004
Lev Walkin1004aa92004-09-08 00:28:11 +00005#define YYBISON 1 /* Identify Bison output. */
Lev Walkinf15320b2004-06-03 03:38:44 +00006
7#define yyparse asn1p_parse
Lev Walkin1004aa92004-09-08 00:28:11 +00008#define yylex asn1p_lex
Lev Walkinf15320b2004-06-03 03:38:44 +00009#define yyerror asn1p_error
Lev Walkin1004aa92004-09-08 00:28:11 +000010#define yylval asn1p_lval
11#define yychar asn1p_char
Lev Walkinf15320b2004-06-03 03:38:44 +000012#define yydebug asn1p_debug
13#define yynerrs asn1p_nerrs
Lev Walkin1004aa92004-09-08 00:28:11 +000014#define TOK_PPEQ 257
Lev Walkin57074f12006-03-16 05:11:14 +000015#define TOK_whitespace 258
16#define TOK_opaque 259
17#define TOK_bstring 260
18#define TOK_cstring 261
19#define TOK_hstring 262
20#define TOK_identifier 263
21#define TOK_number 264
22#define TOK_tuple 265
23#define TOK_quadruple 266
24#define TOK_number_negative 267
25#define TOK_typereference 268
26#define TOK_capitalreference 269
27#define TOK_typefieldreference 270
28#define TOK_valuefieldreference 271
29#define TOK_Literal 272
30#define TOK_ABSENT 273
31#define TOK_ABSTRACT_SYNTAX 274
32#define TOK_ALL 275
33#define TOK_ANY 276
34#define TOK_APPLICATION 277
35#define TOK_AUTOMATIC 278
36#define TOK_BEGIN 279
37#define TOK_BIT 280
38#define TOK_BMPString 281
39#define TOK_BOOLEAN 282
40#define TOK_BY 283
41#define TOK_CHARACTER 284
42#define TOK_CHOICE 285
43#define TOK_CLASS 286
44#define TOK_COMPONENT 287
45#define TOK_COMPONENTS 288
46#define TOK_CONSTRAINED 289
47#define TOK_CONTAINING 290
48#define TOK_DEFAULT 291
49#define TOK_DEFINITIONS 292
50#define TOK_DEFINED 293
51#define TOK_EMBEDDED 294
52#define TOK_ENCODED 295
53#define TOK_ENCODING_CONTROL 296
54#define TOK_END 297
55#define TOK_ENUMERATED 298
56#define TOK_EXPLICIT 299
57#define TOK_EXPORTS 300
58#define TOK_EXTENSIBILITY 301
59#define TOK_EXTERNAL 302
60#define TOK_FALSE 303
61#define TOK_FROM 304
62#define TOK_GeneralizedTime 305
63#define TOK_GeneralString 306
64#define TOK_GraphicString 307
65#define TOK_IA5String 308
66#define TOK_IDENTIFIER 309
67#define TOK_IMPLICIT 310
68#define TOK_IMPLIED 311
69#define TOK_IMPORTS 312
70#define TOK_INCLUDES 313
71#define TOK_INSTANCE 314
72#define TOK_INSTRUCTIONS 315
73#define TOK_INTEGER 316
74#define TOK_ISO646String 317
75#define TOK_MAX 318
76#define TOK_MIN 319
77#define TOK_MINUS_INFINITY 320
78#define TOK_NULL 321
79#define TOK_NumericString 322
80#define TOK_OBJECT 323
81#define TOK_ObjectDescriptor 324
82#define TOK_OCTET 325
83#define TOK_OF 326
84#define TOK_OPTIONAL 327
85#define TOK_PATTERN 328
86#define TOK_PDV 329
87#define TOK_PLUS_INFINITY 330
88#define TOK_PRESENT 331
89#define TOK_PrintableString 332
90#define TOK_PRIVATE 333
91#define TOK_REAL 334
92#define TOK_RELATIVE_OID 335
93#define TOK_SEQUENCE 336
94#define TOK_SET 337
95#define TOK_SIZE 338
96#define TOK_STRING 339
97#define TOK_SYNTAX 340
98#define TOK_T61String 341
99#define TOK_TAGS 342
100#define TOK_TeletexString 343
101#define TOK_TRUE 344
102#define TOK_TYPE_IDENTIFIER 345
103#define TOK_UNIQUE 346
104#define TOK_UNIVERSAL 347
105#define TOK_UniversalString 348
106#define TOK_UTCTime 349
107#define TOK_UTF8String 350
108#define TOK_VideotexString 351
109#define TOK_VisibleString 352
110#define TOK_WITH 353
111#define TOK_EXCEPT 354
112#define TOK_INTERSECTION 355
113#define TOK_UNION 356
114#define TOK_TwoDots 357
115#define TOK_ThreeDots 358
Lev Walkinf15320b2004-06-03 03:38:44 +0000116
117#line 1 "asn1p_y.y"
118
119
120#include <stdlib.h>
121#include <stdio.h>
122#include <string.h>
123#include <errno.h>
124#include <assert.h>
125
126#include "asn1parser.h"
127
128#define YYPARSE_PARAM param
Lev Walkin4a4bdf72005-06-07 21:43:32 +0000129#define YYPARSE_PARAM_TYPE void **
Lev Walkinf15320b2004-06-03 03:38:44 +0000130#define YYERROR_VERBOSE
131
132int yylex(void);
133int yyerror(const char *msg);
Lev Walkin4a4bdf72005-06-07 21:43:32 +0000134#ifdef YYBYACC
135int yyparse(void **param); /* byacc does not produce a prototype */
136#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000137void asn1p_lexer_hack_push_opaque_state(void);
138void asn1p_lexer_hack_enable_with_syntax(void);
Lev Walkinf59d0752004-08-18 04:59:12 +0000139void asn1p_lexer_hack_push_encoding_control(void);
Lev Walkinf15320b2004-06-03 03:38:44 +0000140#define yylineno asn1p_lineno
141extern int asn1p_lineno;
142
Lev Walkinb36317c2005-08-12 10:09:10 +0000143/*
Lev Walkinef625402005-09-05 05:17:57 +0000144 * Process directives as <ASN1C:RepresentAsPointer>
Lev Walkin4696c742005-08-22 12:23:54 +0000145 */
146extern int asn1p_as_pointer;
Lev Walkin4696c742005-08-22 12:23:54 +0000147
148/*
Lev Walkinb36317c2005-08-12 10:09:10 +0000149 * This temporary variable is used to solve the shortcomings of 1-lookahead
150 * parser.
151 */
152static struct AssignedIdentifier *saved_aid;
Lev Walkinf15320b2004-06-03 03:38:44 +0000153
Lev Walkin2e9bd5c2005-08-13 09:07:11 +0000154static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
155static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
Lev Walkinf15320b2004-06-03 03:38:44 +0000156
Lev Walkinb36317c2005-08-12 10:09:10 +0000157#define checkmem(ptr) do { \
158 if(!(ptr)) \
159 return yyerror("Memory failure"); \
Lev Walkinf15320b2004-06-03 03:38:44 +0000160 } while(0)
161
Lev Walkinb36317c2005-08-12 10:09:10 +0000162#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
163 if(arg1->type != constr_type) { \
164 int __ret; \
165 root = asn1p_constraint_new(yylineno); \
166 checkmem(root); \
167 root->type = constr_type; \
168 __ret = asn1p_constraint_insert(root, \
169 arg1); \
170 checkmem(__ret == 0); \
171 } else { \
172 root = arg1; \
173 } \
174 if(arg2) { \
175 int __ret \
176 = asn1p_constraint_insert(root, arg2); \
177 checkmem(__ret == 0); \
178 } \
Lev Walkinf15320b2004-06-03 03:38:44 +0000179 } while(0)
180
181
Lev Walkinef625402005-09-05 05:17:57 +0000182#line 72 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +0000183typedef union {
184 asn1p_t *a_grammar;
185 asn1p_module_flags_e a_module_flags;
186 asn1p_module_t *a_module;
187 asn1p_expr_type_e a_type; /* ASN.1 Type */
188 asn1p_expr_t *a_expr; /* Constructed collection */
189 asn1p_constraint_t *a_constr; /* Constraint */
190 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
191 asn1p_xports_t *a_xports; /* IMports/EXports */
Lev Walkinb36317c2005-08-12 10:09:10 +0000192 struct AssignedIdentifier a_aid; /* Assigned Identifier */
Lev Walkinf15320b2004-06-03 03:38:44 +0000193 asn1p_oid_t *a_oid; /* Object Identifier */
194 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
195 struct asn1p_type_tag_s a_tag; /* A tag */
196 asn1p_ref_t *a_ref; /* Reference to custom type */
197 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
198 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
199 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
200 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
201 struct asn1p_param_s a_parg; /* A parameter argument */
202 asn1p_paramlist_t *a_plist; /* A pargs list */
Lev Walkin9c974182004-09-15 11:59:51 +0000203 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
Lev Walkinf15320b2004-06-03 03:38:44 +0000204 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
Lev Walkind21c5052004-09-29 13:18:09 +0000205 asn1c_integer_t a_int;
Lev Walkinf15320b2004-06-03 03:38:44 +0000206 char *tv_str;
207 struct {
208 char *buf;
209 int len;
210 } tv_opaque;
211 struct {
212 char *name;
213 struct asn1p_type_tag_s tag;
214 } tv_nametag;
Lev Walkin1004aa92004-09-08 00:28:11 +0000215} YYSTYPE;
216#include <stdio.h>
217
218#ifndef __cplusplus
219#ifndef __STDC__
220#define const
221#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000222#endif
223
224
225
Lev Walkind370e9f2006-03-16 10:03:35 +0000226#define YYFINAL 445
Lev Walkin1004aa92004-09-08 00:28:11 +0000227#define YYFLAG -32768
Lev Walkin57074f12006-03-16 05:11:14 +0000228#define YYNTBASE 120
Lev Walkinf15320b2004-06-03 03:38:44 +0000229
Lev Walkind370e9f2006-03-16 10:03:35 +0000230#define YYTRANSLATE(x) ((unsigned)(x) <= 358 ? yytranslate[x] : 226)
Lev Walkinf15320b2004-06-03 03:38:44 +0000231
Lev Walkin1004aa92004-09-08 00:28:11 +0000232static const char yytranslate[] = { 0,
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,
Lev Walkin57074f12006-03-16 05:11:14 +0000236 2, 2, 116, 2, 2, 2, 2, 2, 2, 109,
237 110, 2, 2, 112, 2, 117, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 113, 111, 118,
239 2, 2, 2, 119, 2, 2, 2, 2, 2, 2,
Lev Walkin1004aa92004-09-08 00:28:11 +0000240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin57074f12006-03-16 05:11:14 +0000242 114, 2, 115, 101, 2, 2, 2, 2, 2, 2,
Lev Walkin1004aa92004-09-08 00:28:11 +0000243 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin57074f12006-03-16 05:11:14 +0000245 2, 2, 107, 103, 108, 2, 2, 2, 2, 2,
Lev Walkin1004aa92004-09-08 00:28:11 +0000246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
251 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
252 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
253 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
254 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
255 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
256 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
258 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
259 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
260 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
261 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
262 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
263 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
264 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
265 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
266 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
267 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
Lev Walkin57074f12006-03-16 05:11:14 +0000268 97, 98, 99, 100, 102, 104, 105, 106
Lev Walkin1004aa92004-09-08 00:28:11 +0000269};
Lev Walkinf15320b2004-06-03 03:38:44 +0000270
Lev Walkin1004aa92004-09-08 00:28:11 +0000271#if YYDEBUG != 0
272static const short yyprhs[] = { 0,
273 0, 2, 4, 7, 16, 17, 19, 23, 26, 28,
274 31, 33, 38, 40, 41, 43, 45, 48, 51, 54,
275 57, 60, 63, 64, 66, 68, 71, 73, 75, 77,
Lev Walkinb36317c2005-08-12 10:09:10 +0000276 79, 81, 82, 86, 88, 92, 95, 97, 100, 101,
277 103, 108, 110, 114, 116, 120, 122, 126, 130, 133,
Lev Walkin9c2285a2006-03-09 08:49:26 +0000278 135, 139, 141, 145, 147, 148, 155, 157, 159, 163,
279 167, 174, 176, 180, 182, 186, 190, 194, 196, 200,
280 202, 204, 205, 207, 209, 213, 217, 220, 224, 226,
281 228, 232, 235, 237, 239, 245, 246, 248, 250, 254,
282 257, 262, 266, 270, 274, 278, 282, 283, 285, 286,
Lev Walkin9d542d22006-03-14 16:31:37 +0000283 293, 295, 298, 300, 302, 304, 308, 310, 314, 318,
284 322, 323, 326, 328, 333, 338, 343, 350, 357, 359,
285 364, 369, 371, 375, 377, 381, 385, 389, 391, 395,
Lev Walkind370e9f2006-03-16 10:03:35 +0000286 397, 401, 403, 405, 407, 409, 413, 417, 419, 424,
287 428, 429, 433, 435, 437, 439, 441, 443, 445, 447,
288 449, 451, 455, 457, 459, 461, 463, 466, 468, 470,
289 472, 474, 477, 480, 482, 484, 487, 490, 492, 494,
290 496, 498, 500, 503, 505, 508, 510, 512, 514, 516,
Lev Walkin9d542d22006-03-14 16:31:37 +0000291 518, 520, 522, 524, 526, 528, 530, 532, 534, 536,
Lev Walkind370e9f2006-03-16 10:03:35 +0000292 538, 540, 542, 544, 546, 547, 549, 551, 556, 560,
293 565, 567, 571, 577, 579, 583, 587, 591, 595, 600,
294 604, 606, 608, 612, 616, 620, 624, 626, 628, 629,
295 635, 637, 640, 643, 647, 649, 651, 653, 655, 657,
296 659, 661, 663, 667, 673, 675, 679, 681, 685, 686,
297 688, 690, 692, 694, 696, 698, 702, 707, 709, 713,
298 716, 720, 722, 726, 727, 729, 731, 734, 737, 741,
299 743, 747, 749, 754, 759, 761, 763, 765, 767, 768,
300 770, 773, 778, 779, 781, 783, 785, 786, 788, 790,
301 792, 794, 796, 797, 799
Lev Walkin1004aa92004-09-08 00:28:11 +0000302};
Lev Walkinf15320b2004-06-03 03:38:44 +0000303
Lev Walkin57074f12006-03-16 05:11:14 +0000304static const short yyrhs[] = { 121,
Lev Walkind370e9f2006-03-16 10:03:35 +0000305 0, 122, 0, 121, 122, 0, 222, 123, 38, 127,
Lev Walkin57074f12006-03-16 05:11:14 +0000306 3, 25, 130, 43, 0, 0, 124, 0, 107, 125,
307 108, 0, 107, 108, 0, 126, 0, 125, 126, 0,
Lev Walkind370e9f2006-03-16 10:03:35 +0000308 225, 0, 225, 109, 10, 110, 0, 10, 0, 0,
Lev Walkin57074f12006-03-16 05:11:14 +0000309 128, 0, 129, 0, 128, 129, 0, 45, 88, 0,
310 56, 88, 0, 24, 88, 0, 47, 57, 0, 15,
311 61, 0, 0, 131, 0, 132, 0, 131, 132, 0,
Lev Walkind370e9f2006-03-16 10:03:35 +0000312 134, 0, 140, 0, 146, 0, 176, 0, 143, 0,
313 0, 42, 15, 133, 0, 185, 0, 58, 135, 111,
Lev Walkin57074f12006-03-16 05:11:14 +0000314 0, 58, 50, 0, 137, 0, 135, 137, 0, 0,
Lev Walkind370e9f2006-03-16 10:03:35 +0000315 124, 0, 138, 50, 222, 136, 0, 139, 0, 138,
316 112, 139, 0, 222, 0, 222, 107, 108, 0, 225,
Lev Walkin57074f12006-03-16 05:11:14 +0000317 0, 46, 141, 111, 0, 46, 21, 111, 0, 46,
Lev Walkind370e9f2006-03-16 10:03:35 +0000318 111, 0, 142, 0, 141, 112, 142, 0, 222, 0,
319 222, 107, 108, 0, 225, 0, 0, 222, 145, 3,
320 107, 144, 181, 0, 170, 0, 182, 0, 222, 3,
321 166, 0, 222, 3, 156, 0, 222, 107, 147, 108,
322 3, 166, 0, 148, 0, 147, 112, 148, 0, 222,
323 0, 222, 113, 225, 0, 222, 113, 222, 0, 182,
324 113, 225, 0, 150, 0, 149, 112, 150, 0, 166,
325 0, 225, 0, 0, 152, 0, 153, 0, 152, 112,
326 153, 0, 225, 166, 211, 0, 166, 211, 0, 34,
Lev Walkin57074f12006-03-16 05:11:14 +0000327 72, 166, 0, 165, 0, 155, 0, 154, 112, 155,
Lev Walkind370e9f2006-03-16 10:03:35 +0000328 0, 225, 166, 0, 165, 0, 166, 0, 32, 107,
Lev Walkin57074f12006-03-16 05:11:14 +0000329 158, 108, 160, 0, 0, 92, 0, 159, 0, 158,
Lev Walkind370e9f2006-03-16 10:03:35 +0000330 112, 159, 0, 16, 211, 0, 17, 166, 157, 211,
331 0, 17, 174, 211, 0, 17, 175, 211, 0, 16,
332 174, 211, 0, 16, 166, 211, 0, 16, 175, 211,
Lev Walkin57074f12006-03-16 05:11:14 +0000333 0, 0, 161, 0, 0, 99, 86, 107, 162, 163,
334 108, 0, 164, 0, 163, 164, 0, 4, 0, 18,
335 0, 173, 0, 114, 163, 115, 0, 106, 0, 106,
Lev Walkind370e9f2006-03-16 10:03:35 +0000336 116, 179, 0, 106, 116, 216, 0, 217, 168, 189,
337 0, 0, 167, 169, 0, 184, 0, 31, 107, 154,
Lev Walkin57074f12006-03-16 05:11:14 +0000338 108, 0, 82, 107, 151, 108, 0, 83, 107, 151,
Lev Walkind370e9f2006-03-16 10:03:35 +0000339 108, 0, 82, 189, 72, 224, 217, 168, 0, 83,
340 189, 72, 224, 217, 168, 0, 22, 0, 22, 39,
341 29, 225, 0, 222, 107, 149, 108, 0, 170, 0,
342 60, 72, 170, 0, 14, 0, 14, 117, 222, 0,
343 223, 117, 222, 0, 14, 117, 225, 0, 223, 0,
344 223, 117, 171, 0, 172, 0, 171, 117, 172, 0,
345 173, 0, 16, 0, 17, 0, 16, 0, 174, 117,
346 16, 0, 174, 117, 17, 0, 15, 0, 225, 145,
347 3, 177, 0, 225, 113, 177, 0, 0, 107, 178,
348 181, 0, 67, 0, 49, 0, 90, 0, 6, 0,
349 8, 0, 180, 0, 216, 0, 179, 0, 225, 0,
350 222, 117, 225, 0, 7, 0, 11, 0, 12, 0,
351 5, 0, 181, 5, 0, 28, 0, 67, 0, 80,
352 0, 183, 0, 71, 85, 0, 69, 55, 0, 81,
353 0, 48, 0, 40, 75, 0, 30, 85, 0, 95,
354 0, 51, 0, 185, 0, 62, 0, 44, 0, 26,
355 85, 0, 182, 0, 183, 213, 0, 27, 0, 52,
356 0, 53, 0, 54, 0, 63, 0, 68, 0, 78,
357 0, 87, 0, 89, 0, 94, 0, 96, 0, 97,
358 0, 98, 0, 70, 0, 103, 0, 104, 0, 101,
359 0, 102, 0, 100, 0, 0, 190, 0, 191, 0,
360 84, 109, 192, 110, 0, 109, 192, 110, 0, 191,
361 109, 192, 110, 0, 193, 0, 193, 112, 106, 0,
362 193, 112, 106, 112, 193, 0, 194, 0, 21, 100,
363 194, 0, 193, 186, 194, 0, 193, 187, 194, 0,
364 194, 188, 194, 0, 197, 109, 192, 110, 0, 109,
365 192, 110, 0, 198, 0, 199, 0, 198, 196, 198,
366 0, 65, 196, 198, 0, 198, 196, 64, 0, 65,
367 196, 64, 0, 205, 0, 200, 0, 0, 35, 29,
368 107, 195, 181, 0, 105, 0, 105, 118, 0, 118,
369 105, 0, 118, 105, 118, 0, 84, 0, 50, 0,
370 49, 0, 90, 0, 216, 0, 180, 0, 225, 0,
371 222, 0, 99, 33, 191, 0, 99, 34, 107, 201,
372 108, 0, 202, 0, 201, 112, 202, 0, 106, 0,
373 225, 189, 203, 0, 0, 204, 0, 77, 0, 19,
374 0, 73, 0, 206, 0, 207, 0, 107, 222, 108,
375 0, 206, 107, 208, 108, 0, 209, 0, 208, 112,
376 209, 0, 119, 210, 0, 119, 117, 210, 0, 225,
377 0, 210, 117, 225, 0, 0, 212, 0, 73, 0,
378 37, 177, 0, 107, 108, 0, 107, 214, 108, 0,
379 215, 0, 214, 112, 215, 0, 225, 0, 225, 109,
380 216, 110, 0, 225, 109, 179, 110, 0, 216, 0,
381 106, 0, 10, 0, 13, 0, 0, 218, 0, 219,
382 221, 0, 114, 220, 10, 115, 0, 0, 93, 0,
383 23, 0, 79, 0, 0, 56, 0, 45, 0, 14,
384 0, 15, 0, 15, 0, 0, 225, 0, 9, 0
Lev Walkin1004aa92004-09-08 00:28:11 +0000385};
Lev Walkinf15320b2004-06-03 03:38:44 +0000386
387#endif
388
Lev Walkin1004aa92004-09-08 00:28:11 +0000389#if YYDEBUG != 0
390static const short yyrline[] = { 0,
Lev Walkind370e9f2006-03-16 10:03:35 +0000391 323, 329, 335, 351, 376, 378, 381, 385, 390, 397,
392 405, 410, 414, 423, 425, 433, 437, 445, 449, 452,
393 455, 459, 479, 481, 489, 493, 525, 529, 538, 545,
394 558, 565, 567, 579, 591, 602, 607, 613, 619, 621,
395 624, 635, 641, 647, 654, 660, 668, 672, 675, 682,
396 688, 694, 701, 707, 716, 718, 727, 735, 749, 759,
397 775, 784, 794, 804, 809, 816, 823, 833, 839, 845,
398 849, 872, 874, 876, 882, 888, 896, 902, 909, 914,
399 920, 926, 932, 935, 941, 951, 953, 956, 964, 971,
400 984, 995, 1005, 1016, 1026, 1037, 1048, 1050, 1055, 1059,
401 1064, 1069, 1075, 1080, 1083, 1087, 1092, 1101, 1110, 1121,
402 1143, 1150, 1169, 1173, 1179, 1185, 1191, 1201, 1211, 1217,
403 1231, 1255, 1262, 1276, 1285, 1295, 1305, 1315, 1323, 1344,
404 1353, 1362, 1364, 1371, 1378, 1384, 1388, 1394, 1414, 1424,
405 1432, 1432, 1437, 1442, 1447, 1452, 1456, 1460, 1463, 1466,
406 1471, 1483, 1500, 1505, 1510, 1543, 1553, 1567, 1569, 1570,
407 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580,
408 1586, 1588, 1589, 1592, 1599, 1611, 1613, 1617, 1621, 1622,
409 1623, 1624, 1625, 1629, 1630, 1631, 1632, 1636, 1637, 1644,
410 1644, 1645, 1645, 1646, 1648, 1650, 1655, 1659, 1668, 1672,
411 1677, 1681, 1687, 1697, 1701, 1704, 1707, 1710, 1715, 1724,
412 1732, 1738, 1744, 1751, 1759, 1767, 1776, 1779, 1782, 1783,
413 1793, 1795, 1796, 1797, 1800, 1804, 1809, 1815, 1820, 1823,
414 1826, 1839, 1853, 1857, 1862, 1866, 1871, 1878, 1891, 1893,
415 1896, 1900, 1903, 1908, 1912, 1920, 1935, 1941, 1948, 1961,
416 1973, 1988, 1992, 2009, 2014, 2017, 2022, 2044, 2049, 2054,
417 2060, 2066, 2074, 2082, 2090, 2097, 2107, 2112, 2142, 2144,
418 2147, 2154, 2160, 2162, 2163, 2164, 2167, 2169, 2170, 2173,
419 2178, 2185, 2192, 2194, 2199
Lev Walkin1004aa92004-09-08 00:28:11 +0000420};
421#endif
422
423
424#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
425
426static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
Lev Walkin57074f12006-03-16 05:11:14 +0000427"TOK_whitespace","TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier",
428"TOK_number","TOK_tuple","TOK_quadruple","TOK_number_negative","TOK_typereference",
429"TOK_capitalreference","TOK_typefieldreference","TOK_valuefieldreference","TOK_Literal",
430"TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY","TOK_APPLICATION","TOK_AUTOMATIC",
Lev Walkin9d542d22006-03-14 16:31:37 +0000431"TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN","TOK_BY","TOK_CHARACTER",
432"TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS","TOK_CONSTRAINED",
433"TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED","TOK_EMBEDDED",
434"TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED","TOK_EXPLICIT",
435"TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE","TOK_FROM","TOK_GeneralizedTime",
436"TOK_GeneralString","TOK_GraphicString","TOK_IA5String","TOK_IDENTIFIER","TOK_IMPLICIT",
437"TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE","TOK_INSTRUCTIONS",
438"TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY","TOK_NULL",
439"TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET","TOK_OF",
440"TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT","TOK_PrintableString",
441"TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE","TOK_SET","TOK_SIZE",
442"TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString","TOK_TRUE",
443"TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString","TOK_UTCTime",
444"TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH","TOK_EXCEPT",
445"'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots","'{'",
446"'}'","'('","')'","';'","','","':'","'['","']'","'!'","'.'","'<'","'@'","ParsedGrammar",
447"ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
448"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
449"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
450"ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition",
451"ImportsBundleSet","AssignedIdentifier","ImportsBundle","ImportsList","ImportsElement",
452"ExportsDefinition","ExportsBody","ExportsElement","ValueSetDefinition","@2",
453"DefinedTypeRef","DataTypeReference","ParameterArgumentList","ParameterArgumentName",
454"ActualParameterList","ActualParameter","optComponentTypeLists","ComponentTypeLists",
455"ComponentType","AlternativeTypeLists","AlternativeType","ObjectClass","optUnique",
456"FieldSpec","ClassField","optWithSyntax","WithSyntax","@3","WithSyntaxList",
457"WithSyntaxToken","ExtensionAndException","Type","NSTD_IndirectMarker","TypeDeclaration",
458"TypeDeclarationSet","ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement",
Lev Walkind370e9f2006-03-16 10:03:35 +0000459"PrimitiveFieldReference","FieldName","DefinedObjectClass","ValueDefinition",
Lev Walkin9d542d22006-03-14 16:31:37 +0000460"Value","@4","DefinedValue","RestrictedCharacterStringValue","Opaque","BasicTypeId",
Lev Walkin9c2285a2006-03-09 08:49:26 +0000461"BasicTypeId_UniverationCompatible","BasicType","BasicString","Union","Intersection",
462"Except","optConstraints","Constraints","SetOfConstraints","ElementSetSpecs",
463"ElementSetSpec","ConstraintSubtypeElement","@5","ConstraintRangeSpec","ConstraintSpec",
464"SingleValue","ContainedSubtype","InnerTypeConstraint","WithComponentsList",
465"WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint",
466"SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement",
467"ComponentIdList","optMarker","Marker","UniverationDefinition","UniverationList",
468"UniverationElement","SignedNumber","optTag","Tag","TagTypeValue","TagClass",
469"TagPlicit","TypeRefName","ObjectClassReference","optIdentifier","Identifier", NULL
Lev Walkin1004aa92004-09-08 00:28:11 +0000470};
471#endif
472
473static const short yyr1[] = { 0,
Lev Walkin57074f12006-03-16 05:11:14 +0000474 120, 121, 121, 122, 123, 123, 124, 124, 125, 125,
475 126, 126, 126, 127, 127, 128, 128, 129, 129, 129,
476 129, 129, 130, 130, 131, 131, 132, 132, 132, 132,
477 132, 133, 132, 132, 134, 134, 135, 135, 136, 136,
478 137, 138, 138, 139, 139, 139, 140, 140, 140, 141,
479 141, 142, 142, 142, 144, 143, 145, 145, 146, 146,
480 146, 147, 147, 148, 148, 148, 148, 149, 149, 150,
481 150, 151, 151, 152, 152, 153, 153, 153, 153, 154,
482 154, 155, 155, 155, 156, 157, 157, 158, 158, 159,
483 159, 159, 159, 159, 159, 159, 160, 160, 162, 161,
484 163, 163, 164, 164, 164, 164, 165, 165, 165, 166,
485 167, 168, 169, 169, 169, 169, 169, 169, 169, 169,
486 169, 169, 169, 170, 170, 170, 170, 170, 170, 171,
Lev Walkind370e9f2006-03-16 10:03:35 +0000487 171, 172, 173, 173, 174, 174, 174, 175, 176, 177,
488 178, 177, 177, 177, 177, 177, 177, 177, 177, 177,
489 179, 179, 180, 180, 180, 181, 181, 182, 182, 182,
490 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
491 183, 183, 183, 184, 184, 185, 185, 185, 185, 185,
492 185, 185, 185, 185, 185, 185, 185, 185, 185, 186,
493 186, 187, 187, 188, 189, 189, 190, 190, 191, 191,
494 192, 192, 192, 193, 193, 193, 193, 193, 194, 194,
495 194, 194, 194, 194, 194, 194, 194, 194, 195, 194,
496 196, 196, 196, 196, 197, 197, 198, 198, 198, 198,
497 198, 199, 200, 200, 201, 201, 202, 202, 203, 203,
498 204, 204, 204, 205, 205, 206, 207, 208, 208, 209,
499 209, 210, 210, 211, 211, 212, 212, 213, 213, 214,
500 214, 215, 215, 215, 215, 215, 216, 216, 217, 217,
501 218, 219, 220, 220, 220, 220, 221, 221, 221, 222,
502 222, 223, 224, 224, 225
Lev Walkin1004aa92004-09-08 00:28:11 +0000503};
504
505static const short yyr2[] = { 0,
506 1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
507 1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
508 2, 2, 0, 1, 1, 2, 1, 1, 1, 1,
Lev Walkinb36317c2005-08-12 10:09:10 +0000509 1, 0, 3, 1, 3, 2, 1, 2, 0, 1,
510 4, 1, 3, 1, 3, 1, 3, 3, 2, 1,
Lev Walkin9c2285a2006-03-09 08:49:26 +0000511 3, 1, 3, 1, 0, 6, 1, 1, 3, 3,
512 6, 1, 3, 1, 3, 3, 3, 1, 3, 1,
513 1, 0, 1, 1, 3, 3, 2, 3, 1, 1,
514 3, 2, 1, 1, 5, 0, 1, 1, 3, 2,
515 4, 3, 3, 3, 3, 3, 0, 1, 0, 6,
Lev Walkin9d542d22006-03-14 16:31:37 +0000516 1, 2, 1, 1, 1, 3, 1, 3, 3, 3,
517 0, 2, 1, 4, 4, 4, 6, 6, 1, 4,
518 4, 1, 3, 1, 3, 3, 3, 1, 3, 1,
Lev Walkind370e9f2006-03-16 10:03:35 +0000519 3, 1, 1, 1, 1, 3, 3, 1, 4, 3,
520 0, 3, 1, 1, 1, 1, 1, 1, 1, 1,
521 1, 3, 1, 1, 1, 1, 2, 1, 1, 1,
522 1, 2, 2, 1, 1, 2, 2, 1, 1, 1,
523 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
Lev Walkin1004aa92004-09-08 00:28:11 +0000524 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Lev Walkind370e9f2006-03-16 10:03:35 +0000525 1, 1, 1, 1, 0, 1, 1, 4, 3, 4,
526 1, 3, 5, 1, 3, 3, 3, 3, 4, 3,
527 1, 1, 3, 3, 3, 3, 1, 1, 0, 5,
528 1, 2, 2, 3, 1, 1, 1, 1, 1, 1,
529 1, 1, 3, 5, 1, 3, 1, 3, 0, 1,
530 1, 1, 1, 1, 1, 3, 4, 1, 3, 2,
531 3, 1, 3, 0, 1, 1, 2, 2, 3, 1,
532 3, 1, 4, 4, 1, 1, 1, 1, 0, 1,
533 2, 4, 0, 1, 1, 1, 0, 1, 1, 1,
534 1, 1, 0, 1, 1
Lev Walkin1004aa92004-09-08 00:28:11 +0000535};
536
537static const short yydefact[] = { 0,
Lev Walkind370e9f2006-03-16 10:03:35 +0000538 280, 281, 1, 2, 5, 3, 0, 0, 6, 285,
Lev Walkin1004aa92004-09-08 00:28:11 +0000539 13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
540 0, 0, 0, 0, 0, 15, 16, 0, 22, 20,
Lev Walkind370e9f2006-03-16 10:03:35 +0000541 18, 21, 19, 0, 17, 12, 23, 176, 0, 0,
542 177, 178, 179, 0, 180, 181, 189, 182, 183, 184,
543 185, 186, 187, 188, 0, 24, 25, 27, 28, 31,
Lev Walkinb36317c2005-08-12 10:09:10 +0000544 29, 30, 34, 0, 0, 32, 0, 49, 0, 50,
545 52, 54, 36, 0, 37, 0, 42, 44, 46, 4,
Lev Walkind370e9f2006-03-16 10:03:35 +0000546 26, 269, 124, 282, 0, 158, 0, 0, 172, 165,
547 169, 171, 159, 0, 0, 160, 164, 168, 0, 0,
548 57, 58, 161, 170, 128, 0, 33, 48, 47, 0,
549 0, 35, 38, 0, 0, 0, 0, 273, 60, 59,
550 111, 270, 277, 0, 173, 167, 166, 163, 162, 0,
Lev Walkin9c2285a2006-03-09 08:49:26 +0000551 62, 0, 64, 0, 0, 0, 51, 53, 39, 43,
Lev Walkind370e9f2006-03-16 10:03:35 +0000552 45, 0, 275, 276, 274, 0, 0, 195, 279, 278,
553 271, 125, 127, 0, 0, 0, 0, 55, 133, 134,
554 129, 130, 132, 126, 146, 153, 147, 267, 154, 155,
555 268, 144, 143, 145, 141, 139, 150, 148, 149, 0,
556 151, 40, 41, 269, 269, 0, 88, 0, 124, 282,
557 119, 0, 0, 195, 195, 112, 122, 174, 161, 113,
558 0, 0, 0, 110, 196, 197, 269, 63, 67, 66,
559 65, 0, 0, 0, 0, 0, 138, 135, 0, 256,
560 254, 254, 254, 90, 255, 86, 254, 254, 97, 0,
561 272, 0, 269, 0, 269, 0, 269, 0, 0, 175,
562 269, 0, 0, 0, 227, 226, 0, 225, 228, 0,
563 0, 0, 230, 0, 201, 204, 0, 211, 212, 218,
564 217, 244, 245, 229, 232, 231, 0, 61, 156, 56,
565 131, 142, 152, 140, 257, 95, 0, 94, 96, 87,
566 254, 92, 93, 0, 85, 98, 89, 0, 107, 0,
567 80, 83, 84, 269, 123, 0, 0, 73, 74, 79,
568 254, 269, 283, 0, 283, 266, 258, 0, 260, 265,
569 262, 0, 68, 70, 71, 0, 0, 0, 221, 0,
570 0, 0, 0, 0, 0, 199, 192, 193, 190, 191,
571 0, 0, 0, 194, 0, 0, 0, 0, 0, 157,
572 136, 137, 91, 0, 120, 0, 114, 269, 82, 269,
573 115, 269, 77, 254, 269, 284, 116, 269, 259, 0,
574 0, 121, 269, 198, 205, 219, 222, 223, 216, 214,
575 233, 0, 246, 210, 202, 206, 207, 208, 0, 215,
576 213, 0, 0, 248, 200, 99, 108, 109, 151, 81,
577 78, 75, 76, 111, 111, 261, 0, 0, 69, 0,
578 224, 237, 0, 235, 195, 0, 209, 0, 250, 252,
579 247, 0, 0, 117, 118, 264, 263, 220, 234, 0,
580 239, 203, 251, 0, 249, 103, 104, 0, 0, 101,
581 105, 236, 242, 243, 241, 238, 240, 253, 0, 100,
582 102, 106, 0, 0, 0
Lev Walkin1004aa92004-09-08 00:28:11 +0000583};
584
Lev Walkind370e9f2006-03-16 10:03:35 +0000585static const short yydefgoto[] = { 443,
Lev Walkin1004aa92004-09-08 00:28:11 +0000586 3, 4, 8, 9, 13, 14, 25, 26, 27, 55,
Lev Walkin9c2285a2006-03-09 08:49:26 +0000587 56, 57, 107, 58, 74, 183, 75, 76, 77, 59,
Lev Walkin1db91132006-03-09 09:11:53 +0000588 69, 70, 60, 212, 100, 61, 130, 131, 312, 313,
589 297, 298, 299, 290, 291, 119, 281, 186, 187, 285,
Lev Walkin9d542d22006-03-14 16:31:37 +0000590 286, 413, 429, 430, 300, 301, 147, 148, 196, 101,
Lev Walkind370e9f2006-03-16 10:03:35 +0000591 161, 162, 431, 222, 223, 62, 176, 214, 177, 253,
592 270, 102, 103, 200, 104, 332, 333, 335, 204, 205,
593 206, 254, 255, 256, 400, 321, 257, 258, 259, 260,
594 403, 404, 436, 437, 261, 262, 263, 383, 384, 409,
595 224, 225, 240, 308, 309, 264, 121, 122, 123, 146,
596 151, 265, 105, 355, 266
Lev Walkin1004aa92004-09-08 00:28:11 +0000597};
598
Lev Walkin57074f12006-03-16 05:11:14 +0000599static const short yypact[] = { 223,
600-32768,-32768, 223,-32768, -76,-32768, 30, 24,-32768,-32768,
601-32768,-32768, 34,-32768, -61, 247,-32768,-32768, 61, 27,
Lev Walkind370e9f2006-03-16 10:03:35 +0000602 71, 84, 145, 118, 210, 247,-32768, 109,-32768,-32768,
603-32768,-32768,-32768, 199,-32768,-32768, 428,-32768, 212, 49,
Lev Walkin57074f12006-03-16 05:11:14 +0000604-32768,-32768,-32768, 154,-32768,-32768,-32768,-32768,-32768,-32768,
Lev Walkind370e9f2006-03-16 10:03:35 +0000605-32768,-32768,-32768,-32768, 186, 428,-32768,-32768,-32768,-32768,
606-32768,-32768,-32768, 352, 581,-32768, 129,-32768, 174,-32768,
607 157,-32768,-32768, 59,-32768, -26,-32768, 159,-32768,-32768,
608-32768, -15, 152,-32768, 193,-32768, 204, 218,-32768,-32768,
609-32768,-32768,-32768, 262, 217,-32768,-32768,-32768, 657, 337,
610-32768,-32768,-32768,-32768, 220, 343,-32768,-32768,-32768, 286,
611 244,-32768,-32768, 223, 286, 249, 256, 3,-32768,-32768,
Lev Walkin57074f12006-03-16 05:11:14 +0000612-32768,-32768, 45, 286,-32768,-32768,-32768,-32768,-32768, -23,
Lev Walkind370e9f2006-03-16 10:03:35 +0000613-32768, 251, 255, 263, 294, 184,-32768,-32768, -76,-32768,
614-32768, 297,-32768,-32768,-32768, 359, 505, 57,-32768,-32768,
615-32768,-32768,-32768, 368, 657, 363, 286,-32768,-32768,-32768,
616 259,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
617-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 260,
618 268,-32768,-32768, 168, 37, 32,-32768, 258, 48, 276,
Lev Walkin57074f12006-03-16 05:11:14 +0000619 345, 278, 314, 116, 170,-32768,-32768,-32768, 280,-32768,
620 281, 282, 166,-32768,-32768, 285, 275,-32768,-32768,-32768,
Lev Walkind370e9f2006-03-16 10:03:35 +0000621-32768, 385, 312, 385, 363, 184,-32768,-32768, 184,-32768,
622 98, 94, 98,-32768,-32768, 303, 94, 98, 298, 297,
623-32768, 369, 7, 328, 16, 330, 16, 335, 56,-32768,
624 14, 166, 310, 380,-32768,-32768, -25,-32768,-32768, 315,
Lev Walkin57074f12006-03-16 05:11:14 +0000625 223, 166,-32768, 301, 203, 324, 316, -25,-32768,-32768,
626-32768, 305,-32768,-32768,-32768,-32768, 166,-32768,-32768, 421,
Lev Walkind370e9f2006-03-16 10:03:35 +0000627-32768, 421,-32768,-32768,-32768,-32768, 334,-32768,-32768,-32768,
628 98,-32768,-32768, 341,-32768,-32768,-32768, 363, 313, 35,
Lev Walkin57074f12006-03-16 05:11:14 +0000629-32768,-32768,-32768, 275,-32768, 356, 323, 322,-32768,-32768,
Lev Walkind370e9f2006-03-16 10:03:35 +0000630 98, 275, 363, 327, 363,-32768,-32768, 74,-32768,-32768,
631 329, 131,-32768,-32768,-32768, 326, 309, 333, 336, 339,
632 235, 342, 338, 344, 346,-32768,-32768,-32768,-32768,-32768,
633 347, 309, 309,-32768, 309, 166, 248, 348, 350,-32768,
634-32768,-32768,-32768, 351,-32768, 317,-32768, 7,-32768, 275,
Lev Walkin57074f12006-03-16 05:11:14 +0000635-32768, 12,-32768, 98, 275,-32768,-32768, 275,-32768, 68,
Lev Walkind370e9f2006-03-16 10:03:35 +0000636 317,-32768, 14,-32768,-32768,-32768,-32768, 353,-32768,-32768,
637 285, 0,-32768,-32768, 349,-32768,-32768,-32768, 354,-32768,
638-32768, 6, 141,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
639-32768,-32768,-32768,-32768,-32768,-32768, 355, 358,-32768, 385,
640-32768,-32768, 155,-32768, 57, 166,-32768, 363, 340,-32768,
641-32768, 348, 43,-32768,-32768,-32768,-32768, 421,-32768, 0,
642 10, 232, 340, 363,-32768,-32768,-32768, 43, 38,-32768,
643-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 18,-32768,
644-32768,-32768, 462, 463,-32768
Lev Walkin1004aa92004-09-08 00:28:11 +0000645};
646
647static const short yypgoto[] = {-32768,
Lev Walkind370e9f2006-03-16 10:03:35 +0000648-32768, 466,-32768, 360,-32768, 453,-32768,-32768, 446,-32768,
649-32768, 417,-32768,-32768,-32768,-32768, 401,-32768, 361,-32768,
650-32768, 367,-32768,-32768, 413,-32768,-32768, 332,-32768, 120,
651 242,-32768, 132,-32768, 137,-32768,-32768,-32768, 264,-32768,
652-32768,-32768, 60, -327, -228, -80,-32768, -34,-32768, -137,
653-32768, 277, -115, 304, 307,-32768, -31,-32768, -207, -109,
654 -211, -71, 357,-32768, -5,-32768,-32768,-32768, -187,-32768,
655 171, -133, 89, -45,-32768, 239,-32768, -242,-32768,-32768,
656-32768, 80,-32768,-32768,-32768,-32768,-32768,-32768, 90, 93,
657 -209,-32768,-32768,-32768, 143, -125, -148,-32768,-32768,-32768,
658-32768, 1,-32768, 200, -7
Lev Walkin1004aa92004-09-08 00:28:11 +0000659};
660
661
Lev Walkin57074f12006-03-16 05:11:14 +0000662#define YYLAST 755
Lev Walkin1004aa92004-09-08 00:28:11 +0000663
664
665static const short yytable[] = { 15,
Lev Walkin57074f12006-03-16 05:11:14 +0000666 5, 120, 272, 5, 292, 15, 236, 238, 10, 197,
667 179, 276, 278, 279, 10, 10, 117, 282, 283, 163,
Lev Walkind370e9f2006-03-16 10:03:35 +0000668 10, 426, 10, 114, 10, 143, 178, 132, 433, 65,
Lev Walkin57074f12006-03-16 05:11:14 +0000669 7, 63, 72, 159, 160, 427, 79, 64, 10, 11,
670 71, 426, 10, 11, 78, 296, 426, 19, 65, 296,
671 63, 217, 218, 159, 160, 427, 64, 10, 159, 160,
672 427, 16, 1, 2, 10, 168, 79, 10, 171, 67,
673 28, 343, 1, 2, 78, 198, 10, 168, 370, 319,
Lev Walkind370e9f2006-03-16 10:03:35 +0000674 171, 144, 434, 132, 154, 115, 435, 29, 155, 149,
Lev Walkin57074f12006-03-16 05:11:14 +0000675 179, 353, 320, 179, 381, 145, 295, 163, 118, 133,
Lev Walkind370e9f2006-03-16 10:03:35 +0000676 150, 441, 72, 221, 226, 402, 178, 79, 316, 178,
677 71, 441, 289, 310, 139, 78, 153, 289, 325, 292,
Lev Walkin57074f12006-03-16 05:11:14 +0000678 118, 289, 408, -72, 152, 118, 268, 118, 181, 118,
Lev Walkind370e9f2006-03-16 10:03:35 +0000679 219, 428, 442, 339, 219, 164, 180, 12, 387, 229,
680 202, 17, 347, 230, 393, 440, 348, 201, 209, 211,
681 118, 428, 293, 397, -280, 133, 428, 210, 30, 68,
682 314, 306, 10, 307, 124, 203, 220, 1, 2, 112,
683 220, 31, 166, 306, 10, 168, 169, 170, 171, 1,
684 2, 359, 217, 218, 274, 360, 243, 275, 418, 165,
Lev Walkin57074f12006-03-16 05:11:14 +0000685 166, 167, 10, 168, 169, 170, 171, 1, 2, 202,
Lev Walkind370e9f2006-03-16 10:03:35 +0000686 244, 32, 379, 73, 219, 33, 394, 273, 181, 395,
687 277, 181, 34, 349, 245, 246, 180, 421, 36, 180,
688 388, 354, 235, 37, 203, 294, 66, 302, 80, 302,
689 247, 311, 172, 315, 310, 398, 1, 2, 362, 108,
690 220, 166, 363, 10, 168, 169, 170, 171, 411, 248,
691 173, 324, 412, 202, 166, 249, 10, 168, 169, 170,
692 171, 20, 419, 111, 250, 116, 420, 293, 124, 391,
693 21, 365, 251, 174, 252, -254, 237, 125, 203, -254,
694 345, 118, 314, 245, 109, 110, 376, 377, 126, 378,
695 175, 22, 127, 23, 10, 356, 245, 356, 369, 1,
696 2, 129, 24, 327, 328, 329, 330, 1, 2, 159,
697 160, 380, 184, 185, 331, 166, 128, 10, 168, 169,
698 170, 171, 1, 2, 249, 10, 168, 159, 160, 171,
699 1, 2, 327, 328, 329, 330, 135, 249, 389, 134,
700 294, 83, 84, 244, 302, 136, 180, 322, 323, 341,
701 342, 138, 311, 389, 82, 315, 141, 245, 246, 414,
702 415, 180, 142, 156, 405, 83, 84, 157, 188, 158,
703 207, 10, 231, 247, 410, 213, 215, 85, 38, 86,
704 216, 87, -281, 232, 233, 234, 239, 241, 118, 269,
Lev Walkin57074f12006-03-16 05:11:14 +0000705 242, 88, 248, 267, 280, 89, 284, 288, 249, 90,
706 410, 303, 91, 41, 42, 43, 305, 250, 318, 317,
Lev Walkind370e9f2006-03-16 10:03:35 +0000707 326, 338, 405, 92, 45, 251, 438, 252, 93, 46,
Lev Walkin57074f12006-03-16 05:11:14 +0000708 94, 47, 95, 334, 336, 340, 344, 350, 346, 48,
Lev Walkind370e9f2006-03-16 10:03:35 +0000709 351, 96, 97, 352, 357, 364, 10, 361, 49, 366,
710 50, 1, 2, 368, 372, 51, 98, 52, 53, 54,
711 203, 373, 375, 367, 38, 374, 424, 386, 99, 385,
712 406, 444, 445, 407, 416, 18, 382, 417, 6, 39,
713 401, 35, 81, 40, 113, 140, 137, 106, 304, 41,
714 42, 43, 399, 392, 390, 44, 208, 439, 227, 271,
715 45, 228, 371, 287, 422, 46, 337, 47, 182, 432,
716 423, 425, 396, 199, 358, 48, 0, 0, 0, 0,
Lev Walkin57074f12006-03-16 05:11:14 +0000717 0, 0, 0, 0, 49, 0, 50, 0, 189, 190,
718 0, 51, 0, 52, 53, 54, 191, 0, 0, 0,
719 85, 38, 86, 0, 87, 192, 0, 0, 0, 0,
720 0, 0, 0, 0, 88, 0, 0, 0, 89, 0,
721 0, 0, 90, 0, 0, 91, 41, 42, 43, 0,
722 0, 0, 0, 0, 193, 0, 92, 45, 0, 0,
723 0, 93, 46, 94, 47, 95, 0, 0, 0, 0,
724 0, 0, 48, 0, 96, 97, 194, 195, 0, 0,
725 0, 49, 0, 50, 83, 84, 0, 0, 51, 98,
726 52, 53, 54, 0, 0, 0, 85, 38, 86, 0,
727 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
728 88, 0, 0, 0, 89, 0, 0, 0, 90, 0,
729 0, 91, 41, 42, 43, 0, 0, 0, 0, 0,
730 0, 0, 92, 45, 0, 0, 0, 93, 46, 94,
731 47, 95, 0, 0, 0, 0, 0, 0, 48, 0,
732 96, 97, 0, 0, 0, 0, 0, 49, 0, 50,
733 1, 2, 0, 0, 51, 98, 52, 53, 54, 0,
734 0, 0, 85, 38, 86, 0, 87, 0, 0, 0,
735 0, 0, 0, 0, 0, 0, 88, 0, 0, 0,
736 89, 0, 0, 0, 90, 0, 0, 91, 41, 42,
737 43, 0, 0, 0, 0, 0, 0, 0, 92, 45,
738 0, 0, 0, 93, 46, 94, 47, 95, 0, 0,
739 0, 0, 0, 0, 48, 0, 96, 97, 0, 0,
740 0, 0, 0, 49, 0, 50, 0, 0, 0, 0,
741 51, 98, 52, 53, 54
Lev Walkin1004aa92004-09-08 00:28:11 +0000742};
743
744static const short yycheck[] = { 7,
Lev Walkin57074f12006-03-16 05:11:14 +0000745 0, 82, 214, 3, 233, 13, 194, 195, 9, 147,
746 136, 221, 222, 223, 9, 9, 32, 227, 228, 135,
747 9, 4, 9, 50, 9, 23, 136, 99, 19, 37,
748 107, 37, 40, 16, 17, 18, 44, 37, 9, 10,
749 40, 4, 9, 10, 44, 34, 4, 109, 56, 34,
750 56, 15, 16, 16, 17, 18, 56, 9, 16, 17,
751 18, 38, 14, 15, 9, 10, 74, 9, 13, 21,
752 10, 281, 14, 15, 74, 147, 9, 10, 321, 105,
753 13, 79, 73, 155, 108, 112, 77, 61, 112, 45,
754 216, 301, 118, 219, 337, 93, 234, 213, 114, 99,
Lev Walkind370e9f2006-03-16 10:03:35 +0000755 56, 429, 110, 184, 185, 106, 216, 115, 242, 219,
756 110, 439, 106, 239, 114, 115, 124, 106, 252, 348,
Lev Walkin57074f12006-03-16 05:11:14 +0000757 114, 106, 117, 108, 124, 114, 207, 114, 136, 114,
Lev Walkind370e9f2006-03-16 10:03:35 +0000758 37, 114, 115, 267, 37, 135, 136, 108, 346, 108,
759 84, 108, 108, 112, 354, 108, 112, 147, 156, 157,
760 114, 114, 233, 361, 107, 155, 114, 157, 88, 111,
761 241, 106, 9, 108, 117, 109, 73, 14, 15, 111,
762 73, 88, 7, 106, 9, 10, 11, 12, 13, 14,
763 15, 108, 15, 16, 216, 112, 21, 219, 400, 6,
Lev Walkin57074f12006-03-16 05:11:14 +0000764 7, 8, 9, 10, 11, 12, 13, 14, 15, 84,
Lev Walkind370e9f2006-03-16 10:03:35 +0000765 35, 57, 336, 50, 37, 88, 355, 215, 216, 358,
766 117, 219, 3, 294, 49, 50, 216, 405, 110, 219,
767 346, 302, 107, 25, 109, 233, 15, 235, 43, 237,
768 65, 239, 49, 241, 360, 361, 14, 15, 108, 111,
Lev Walkin57074f12006-03-16 05:11:14 +0000769 73, 7, 112, 9, 10, 11, 12, 13, 108, 84,
770 67, 251, 112, 84, 7, 90, 9, 10, 11, 12,
Lev Walkind370e9f2006-03-16 10:03:35 +0000771 13, 15, 108, 107, 99, 107, 112, 348, 117, 350,
Lev Walkin57074f12006-03-16 05:11:14 +0000772 24, 317, 107, 90, 109, 108, 107, 85, 109, 112,
Lev Walkind370e9f2006-03-16 10:03:35 +0000773 288, 114, 363, 49, 111, 112, 332, 333, 85, 335,
774 107, 45, 75, 47, 9, 303, 49, 305, 64, 14,
775 15, 85, 56, 101, 102, 103, 104, 14, 15, 16,
776 17, 64, 16, 17, 112, 7, 55, 9, 10, 11,
Lev Walkin57074f12006-03-16 05:11:14 +0000777 12, 13, 14, 15, 90, 9, 10, 16, 17, 13,
Lev Walkind370e9f2006-03-16 10:03:35 +0000778 14, 15, 101, 102, 103, 104, 117, 90, 346, 3,
779 348, 14, 15, 35, 352, 3, 346, 33, 34, 16,
780 17, 108, 360, 361, 3, 363, 108, 49, 50, 394,
781 395, 361, 107, 113, 372, 14, 15, 113, 10, 107,
782 3, 9, 115, 65, 382, 117, 117, 26, 27, 28,
783 113, 30, 107, 39, 107, 72, 107, 107, 114, 5,
Lev Walkin57074f12006-03-16 05:11:14 +0000784 109, 40, 84, 109, 92, 44, 99, 29, 90, 48,
785 408, 72, 51, 52, 53, 54, 72, 99, 29, 100,
786 110, 107, 420, 62, 63, 107, 424, 109, 67, 68,
787 69, 70, 71, 100, 109, 5, 86, 72, 116, 78,
Lev Walkind370e9f2006-03-16 10:03:35 +0000788 108, 80, 81, 112, 108, 110, 9, 109, 87, 107,
789 89, 14, 15, 105, 107, 94, 95, 96, 97, 98,
790 109, 108, 106, 118, 27, 110, 117, 107, 107, 110,
791 112, 0, 0, 110, 110, 13, 119, 110, 3, 42,
792 118, 26, 56, 46, 74, 115, 110, 65, 237, 52,
793 53, 54, 363, 352, 348, 58, 155, 428, 185, 213,
794 63, 185, 322, 230, 406, 68, 258, 70, 139, 420,
795 408, 412, 360, 147, 305, 78, -1, -1, -1, -1,
Lev Walkin57074f12006-03-16 05:11:14 +0000796 -1, -1, -1, -1, 87, -1, 89, -1, 14, 15,
797 -1, 94, -1, 96, 97, 98, 22, -1, -1, -1,
798 26, 27, 28, -1, 30, 31, -1, -1, -1, -1,
799 -1, -1, -1, -1, 40, -1, -1, -1, 44, -1,
800 -1, -1, 48, -1, -1, 51, 52, 53, 54, -1,
801 -1, -1, -1, -1, 60, -1, 62, 63, -1, -1,
802 -1, 67, 68, 69, 70, 71, -1, -1, -1, -1,
803 -1, -1, 78, -1, 80, 81, 82, 83, -1, -1,
804 -1, 87, -1, 89, 14, 15, -1, -1, 94, 95,
805 96, 97, 98, -1, -1, -1, 26, 27, 28, -1,
806 30, -1, -1, -1, -1, -1, -1, -1, -1, -1,
807 40, -1, -1, -1, 44, -1, -1, -1, 48, -1,
808 -1, 51, 52, 53, 54, -1, -1, -1, -1, -1,
809 -1, -1, 62, 63, -1, -1, -1, 67, 68, 69,
810 70, 71, -1, -1, -1, -1, -1, -1, 78, -1,
811 80, 81, -1, -1, -1, -1, -1, 87, -1, 89,
812 14, 15, -1, -1, 94, 95, 96, 97, 98, -1,
813 -1, -1, 26, 27, 28, -1, 30, -1, -1, -1,
814 -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
815 44, -1, -1, -1, 48, -1, -1, 51, 52, 53,
816 54, -1, -1, -1, -1, -1, -1, -1, 62, 63,
817 -1, -1, -1, 67, 68, 69, 70, 71, -1, -1,
818 -1, -1, -1, -1, 78, -1, 80, 81, -1, -1,
819 -1, -1, -1, 87, -1, 89, -1, -1, -1, -1,
820 94, 95, 96, 97, 98
Lev Walkin1004aa92004-09-08 00:28:11 +0000821};
822/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
823#line 3 "/usr/share/bison.simple"
824/* This file comes from bison-1.28. */
825
826/* Skeleton output parser for bison,
827 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
828
829 This program is free software; you can redistribute it and/or modify
830 it under the terms of the GNU General Public License as published by
831 the Free Software Foundation; either version 2, or (at your option)
832 any later version.
833
834 This program is distributed in the hope that it will be useful,
835 but WITHOUT ANY WARRANTY; without even the implied warranty of
836 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
837 GNU General Public License for more details.
838
839 You should have received a copy of the GNU General Public License
840 along with this program; if not, write to the Free Software
841 Foundation, Inc., 59 Temple Place - Suite 330,
842 Boston, MA 02111-1307, USA. */
843
844/* As a special exception, when this file is copied by Bison into a
845 Bison output file, you may use that output file without restriction.
846 This special exception was added by the Free Software Foundation
847 in version 1.24 of Bison. */
848
849/* This is the parser code that is written into each bison parser
850 when the %semantic_parser declaration is not specified in the grammar.
851 It was written by Richard Stallman by simplifying the hairy parser
852 used when %semantic_parser is specified. */
853
854#ifndef YYSTACK_USE_ALLOCA
855#ifdef alloca
856#define YYSTACK_USE_ALLOCA
857#else /* alloca not defined */
858#ifdef __GNUC__
859#define YYSTACK_USE_ALLOCA
860#define alloca __builtin_alloca
861#else /* not GNU C. */
862#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
863#define YYSTACK_USE_ALLOCA
864#include <alloca.h>
865#else /* not sparc */
866/* We think this test detects Watcom and Microsoft C. */
867/* This used to test MSDOS, but that is a bad idea
868 since that symbol is in the user namespace. */
869#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
870#if 0 /* No need for malloc.h, which pollutes the namespace;
871 instead, just don't use alloca. */
872#include <malloc.h>
873#endif
874#else /* not MSDOS, or __TURBOC__ */
875#if defined(_AIX)
876/* I don't know what this was needed for, but it pollutes the namespace.
877 So I turned it off. rms, 2 May 1997. */
878/* #include <malloc.h> */
879 #pragma alloca
880#define YYSTACK_USE_ALLOCA
881#else /* not MSDOS, or __TURBOC__, or _AIX */
882#if 0
883#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
884 and on HPUX 10. Eventually we can turn this on. */
885#define YYSTACK_USE_ALLOCA
886#define alloca __builtin_alloca
887#endif /* __hpux */
888#endif
889#endif /* not _AIX */
890#endif /* not MSDOS, or __TURBOC__ */
891#endif /* not sparc */
892#endif /* not GNU C */
893#endif /* alloca not defined */
894#endif /* YYSTACK_USE_ALLOCA not defined */
895
896#ifdef YYSTACK_USE_ALLOCA
897#define YYSTACK_ALLOC alloca
Lev Walkinf15320b2004-06-03 03:38:44 +0000898#else
Lev Walkin1004aa92004-09-08 00:28:11 +0000899#define YYSTACK_ALLOC malloc
Lev Walkinf15320b2004-06-03 03:38:44 +0000900#endif
901
Lev Walkin1004aa92004-09-08 00:28:11 +0000902/* Note: there must be only one dollar sign in this file.
903 It is replaced by the list of actions, each action
904 as one case of the switch. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000905
906#define yyerrok (yyerrstatus = 0)
907#define yyclearin (yychar = YYEMPTY)
908#define YYEMPTY -2
909#define YYEOF 0
910#define YYACCEPT goto yyacceptlab
Lev Walkin1004aa92004-09-08 00:28:11 +0000911#define YYABORT goto yyabortlab
Lev Walkinf15320b2004-06-03 03:38:44 +0000912#define YYERROR goto yyerrlab1
Lev Walkin1004aa92004-09-08 00:28:11 +0000913/* Like YYERROR except do call yyerror.
914 This remains here temporarily to ease the
915 transition to the new meaning of YYERROR, for GCC.
Lev Walkinf15320b2004-06-03 03:38:44 +0000916 Once GCC version 2 has supplanted version 1, this can go. */
917#define YYFAIL goto yyerrlab
918#define YYRECOVERING() (!!yyerrstatus)
Lev Walkin1004aa92004-09-08 00:28:11 +0000919#define YYBACKUP(token, value) \
Lev Walkinf15320b2004-06-03 03:38:44 +0000920do \
921 if (yychar == YYEMPTY && yylen == 1) \
Lev Walkin1004aa92004-09-08 00:28:11 +0000922 { yychar = (token), yylval = (value); \
Lev Walkinf15320b2004-06-03 03:38:44 +0000923 yychar1 = YYTRANSLATE (yychar); \
924 YYPOPSTACK; \
925 goto yybackup; \
926 } \
927 else \
Lev Walkin1004aa92004-09-08 00:28:11 +0000928 { yyerror ("syntax error: cannot back up"); YYERROR; } \
Lev Walkinf15320b2004-06-03 03:38:44 +0000929while (0)
930
931#define YYTERROR 1
932#define YYERRCODE 256
933
Lev Walkin1004aa92004-09-08 00:28:11 +0000934#ifndef YYPURE
935#define YYLEX yylex()
Lev Walkinf15320b2004-06-03 03:38:44 +0000936#endif
937
Lev Walkin1004aa92004-09-08 00:28:11 +0000938#ifdef YYPURE
939#ifdef YYLSP_NEEDED
940#ifdef YYLEX_PARAM
941#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
942#else
943#define YYLEX yylex(&yylval, &yylloc)
944#endif
945#else /* not YYLSP_NEEDED */
946#ifdef YYLEX_PARAM
947#define YYLEX yylex(&yylval, YYLEX_PARAM)
948#else
949#define YYLEX yylex(&yylval)
950#endif
951#endif /* not YYLSP_NEEDED */
952#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000953
Lev Walkin1004aa92004-09-08 00:28:11 +0000954/* If nonreentrant, generate the variables here */
Lev Walkinf15320b2004-06-03 03:38:44 +0000955
Lev Walkin1004aa92004-09-08 00:28:11 +0000956#ifndef YYPURE
Lev Walkinf15320b2004-06-03 03:38:44 +0000957
Lev Walkin1004aa92004-09-08 00:28:11 +0000958int yychar; /* the lookahead symbol */
959YYSTYPE yylval; /* the semantic value of the */
960 /* lookahead symbol */
Lev Walkinf15320b2004-06-03 03:38:44 +0000961
Lev Walkin1004aa92004-09-08 00:28:11 +0000962#ifdef YYLSP_NEEDED
963YYLTYPE yylloc; /* location data for the lookahead */
964 /* symbol */
965#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000966
Lev Walkin1004aa92004-09-08 00:28:11 +0000967int yynerrs; /* number of parse errors so far */
968#endif /* not YYPURE */
969
970#if YYDEBUG != 0
971int yydebug; /* nonzero means print parse trace */
972/* Since this is uninitialized, it does not stop multiple parsers
973 from coexisting. */
974#endif
975
976/* YYINITDEPTH indicates the initial size of the parser's stacks */
977
Lev Walkinf15320b2004-06-03 03:38:44 +0000978#ifndef YYINITDEPTH
Lev Walkin1004aa92004-09-08 00:28:11 +0000979#define YYINITDEPTH 200
Lev Walkinf15320b2004-06-03 03:38:44 +0000980#endif
981
Lev Walkin1004aa92004-09-08 00:28:11 +0000982/* YYMAXDEPTH is the maximum size the stacks can grow to
983 (effective only if the built-in stack extension method is used). */
Lev Walkinf15320b2004-06-03 03:38:44 +0000984
985#if YYMAXDEPTH == 0
Lev Walkin1004aa92004-09-08 00:28:11 +0000986#undef YYMAXDEPTH
Lev Walkinf15320b2004-06-03 03:38:44 +0000987#endif
988
989#ifndef YYMAXDEPTH
Lev Walkin1004aa92004-09-08 00:28:11 +0000990#define YYMAXDEPTH 10000
Lev Walkinf15320b2004-06-03 03:38:44 +0000991#endif
992
Lev Walkin1004aa92004-09-08 00:28:11 +0000993/* Define __yy_memcpy. Note that the size argument
994 should be passed with type unsigned int, because that is what the non-GCC
995 definitions require. With GCC, __builtin_memcpy takes an arg
996 of type size_t, but it can handle unsigned int. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000997
Lev Walkin1004aa92004-09-08 00:28:11 +0000998#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
999#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1000#else /* not GNU C or C++ */
1001#ifndef __cplusplus
Lev Walkinf15320b2004-06-03 03:38:44 +00001002
Lev Walkin1004aa92004-09-08 00:28:11 +00001003/* This is the most reliable way to avoid incompatibilities
1004 in available built-in functions on various systems. */
Lev Walkin459ab022004-09-07 10:39:09 +00001005static void
Lev Walkin1004aa92004-09-08 00:28:11 +00001006__yy_memcpy (to, from, count)
1007 char *to;
1008 char *from;
1009 unsigned int count;
Lev Walkin459ab022004-09-07 10:39:09 +00001010{
Lev Walkin1004aa92004-09-08 00:28:11 +00001011 register char *f = from;
1012 register char *t = to;
1013 register int i = count;
Lev Walkin459ab022004-09-07 10:39:09 +00001014
Lev Walkin1004aa92004-09-08 00:28:11 +00001015 while (i-- > 0)
1016 *t++ = *f++;
Lev Walkin459ab022004-09-07 10:39:09 +00001017}
Lev Walkin459ab022004-09-07 10:39:09 +00001018
Lev Walkin1004aa92004-09-08 00:28:11 +00001019#else /* __cplusplus */
Lev Walkin459ab022004-09-07 10:39:09 +00001020
Lev Walkin1004aa92004-09-08 00:28:11 +00001021/* This is the most reliable way to avoid incompatibilities
1022 in available built-in functions on various systems. */
Lev Walkin459ab022004-09-07 10:39:09 +00001023static void
Lev Walkin1004aa92004-09-08 00:28:11 +00001024__yy_memcpy (char *to, char *from, unsigned int count)
Lev Walkin459ab022004-09-07 10:39:09 +00001025{
Lev Walkin1004aa92004-09-08 00:28:11 +00001026 register char *t = to;
1027 register char *f = from;
1028 register int i = count;
Lev Walkin459ab022004-09-07 10:39:09 +00001029
Lev Walkin1004aa92004-09-08 00:28:11 +00001030 while (i-- > 0)
1031 *t++ = *f++;
Lev Walkin609ccbb2004-09-04 04:49:21 +00001032}
Lev Walkin609ccbb2004-09-04 04:49:21 +00001033
Lev Walkin1004aa92004-09-08 00:28:11 +00001034#endif
1035#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001036
Lev Walkin1004aa92004-09-08 00:28:11 +00001037#line 217 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +00001038
1039/* The user can define YYPARSE_PARAM as the name of an argument to be passed
1040 into yyparse. The argument should have type void *.
1041 It should actually point to an object.
1042 Grammar actions can access the variable by casting it
1043 to the proper pointer type. */
1044
1045#ifdef YYPARSE_PARAM
Lev Walkin1004aa92004-09-08 00:28:11 +00001046#ifdef __cplusplus
1047#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1048#define YYPARSE_PARAM_DECL
1049#else /* not __cplusplus */
1050#define YYPARSE_PARAM_ARG YYPARSE_PARAM
1051#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1052#endif /* not __cplusplus */
1053#else /* not YYPARSE_PARAM */
1054#define YYPARSE_PARAM_ARG
1055#define YYPARSE_PARAM_DECL
1056#endif /* not YYPARSE_PARAM */
Lev Walkinf15320b2004-06-03 03:38:44 +00001057
1058/* Prevent warning if -Wstrict-prototypes. */
1059#ifdef __GNUC__
Lev Walkin1004aa92004-09-08 00:28:11 +00001060#ifdef YYPARSE_PARAM
Lev Walkinf15320b2004-06-03 03:38:44 +00001061int yyparse (void *);
Lev Walkin1004aa92004-09-08 00:28:11 +00001062#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001063int yyparse (void);
Lev Walkin1004aa92004-09-08 00:28:11 +00001064#endif
Lev Walkinceb20e72004-09-05 10:40:41 +00001065#endif
Lev Walkin459ab022004-09-07 10:39:09 +00001066
Lev Walkinf15320b2004-06-03 03:38:44 +00001067int
Lev Walkin1004aa92004-09-08 00:28:11 +00001068yyparse(YYPARSE_PARAM_ARG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001069 YYPARSE_PARAM_DECL
1070{
1071 register int yystate;
1072 register int yyn;
1073 register short *yyssp;
1074 register YYSTYPE *yyvsp;
Lev Walkin1004aa92004-09-08 00:28:11 +00001075 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1076 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
Lev Walkinf15320b2004-06-03 03:38:44 +00001077
Lev Walkin1004aa92004-09-08 00:28:11 +00001078 short yyssa[YYINITDEPTH]; /* the state stack */
1079 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
Lev Walkinf15320b2004-06-03 03:38:44 +00001080
Lev Walkin1004aa92004-09-08 00:28:11 +00001081 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1082 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
Lev Walkinf15320b2004-06-03 03:38:44 +00001083
Lev Walkin1004aa92004-09-08 00:28:11 +00001084#ifdef YYLSP_NEEDED
1085 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1086 YYLTYPE *yyls = yylsa;
1087 YYLTYPE *yylsp;
1088
1089#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1090#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001091#define YYPOPSTACK (yyvsp--, yyssp--)
Lev Walkin1004aa92004-09-08 00:28:11 +00001092#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001093
Lev Walkin1004aa92004-09-08 00:28:11 +00001094 int yystacksize = YYINITDEPTH;
1095 int yyfree_stacks = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00001096
Lev Walkin1004aa92004-09-08 00:28:11 +00001097#ifdef YYPURE
1098 int yychar;
1099 YYSTYPE yylval;
1100 int yynerrs;
1101#ifdef YYLSP_NEEDED
1102 YYLTYPE yylloc;
1103#endif
1104#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001105
Lev Walkin1004aa92004-09-08 00:28:11 +00001106 YYSTYPE yyval; /* the variable used to return */
1107 /* semantic values from the action */
1108 /* routines */
Lev Walkinf15320b2004-06-03 03:38:44 +00001109
1110 int yylen;
1111
Lev Walkin1004aa92004-09-08 00:28:11 +00001112#if YYDEBUG != 0
1113 if (yydebug)
1114 fprintf(stderr, "Starting parse\n");
1115#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001116
1117 yystate = 0;
1118 yyerrstatus = 0;
1119 yynerrs = 0;
1120 yychar = YYEMPTY; /* Cause a token to be read. */
1121
1122 /* Initialize stack pointers.
1123 Waste one element of value and location stack
1124 so that they stay on the same level as the state stack.
1125 The wasted elements are never initialized. */
1126
Lev Walkin1004aa92004-09-08 00:28:11 +00001127 yyssp = yyss - 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001128 yyvsp = yyvs;
Lev Walkin1004aa92004-09-08 00:28:11 +00001129#ifdef YYLSP_NEEDED
1130 yylsp = yyls;
1131#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001132
Lev Walkin1004aa92004-09-08 00:28:11 +00001133/* Push a new state, which is found in yystate . */
1134/* In all cases, when you get here, the value and location stacks
1135 have just been pushed. so pushing a state here evens the stacks. */
1136yynewstate:
Lev Walkinf15320b2004-06-03 03:38:44 +00001137
Lev Walkin1004aa92004-09-08 00:28:11 +00001138 *++yyssp = yystate;
Lev Walkinf15320b2004-06-03 03:38:44 +00001139
1140 if (yyssp >= yyss + yystacksize - 1)
1141 {
Lev Walkin1004aa92004-09-08 00:28:11 +00001142 /* Give user a chance to reallocate the stack */
1143 /* Use copies of these so that the &'s don't force the real ones into memory. */
1144 YYSTYPE *yyvs1 = yyvs;
1145 short *yyss1 = yyss;
1146#ifdef YYLSP_NEEDED
1147 YYLTYPE *yyls1 = yyls;
1148#endif
1149
Lev Walkinf15320b2004-06-03 03:38:44 +00001150 /* Get the current used size of the three stacks, in elements. */
Lev Walkin1004aa92004-09-08 00:28:11 +00001151 int size = yyssp - yyss + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001152
1153#ifdef yyoverflow
Lev Walkin1004aa92004-09-08 00:28:11 +00001154 /* Each stack pointer address is followed by the size of
1155 the data in use in that stack, in bytes. */
1156#ifdef YYLSP_NEEDED
1157 /* This used to be a conditional around just the two extra args,
1158 but that might be undefined if yyoverflow is a macro. */
1159 yyoverflow("parser stack overflow",
1160 &yyss1, size * sizeof (*yyssp),
1161 &yyvs1, size * sizeof (*yyvsp),
1162 &yyls1, size * sizeof (*yylsp),
1163 &yystacksize);
1164#else
1165 yyoverflow("parser stack overflow",
1166 &yyss1, size * sizeof (*yyssp),
1167 &yyvs1, size * sizeof (*yyvsp),
1168 &yystacksize);
1169#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001170
Lev Walkin1004aa92004-09-08 00:28:11 +00001171 yyss = yyss1; yyvs = yyvs1;
1172#ifdef YYLSP_NEEDED
1173 yyls = yyls1;
1174#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001175#else /* no yyoverflow */
1176 /* Extend the stack our own way. */
1177 if (yystacksize >= YYMAXDEPTH)
Lev Walkin1004aa92004-09-08 00:28:11 +00001178 {
1179 yyerror("parser stack overflow");
1180 if (yyfree_stacks)
1181 {
1182 free (yyss);
1183 free (yyvs);
1184#ifdef YYLSP_NEEDED
1185 free (yyls);
1186#endif
1187 }
1188 return 2;
1189 }
Lev Walkinf15320b2004-06-03 03:38:44 +00001190 yystacksize *= 2;
1191 if (yystacksize > YYMAXDEPTH)
1192 yystacksize = YYMAXDEPTH;
Lev Walkin1004aa92004-09-08 00:28:11 +00001193#ifndef YYSTACK_USE_ALLOCA
1194 yyfree_stacks = 1;
1195#endif
1196 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1197 __yy_memcpy ((char *)yyss, (char *)yyss1,
1198 size * (unsigned int) sizeof (*yyssp));
1199 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1200 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1201 size * (unsigned int) sizeof (*yyvsp));
1202#ifdef YYLSP_NEEDED
1203 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1204 __yy_memcpy ((char *)yyls, (char *)yyls1,
1205 size * (unsigned int) sizeof (*yylsp));
1206#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001207#endif /* no yyoverflow */
1208
Lev Walkin1004aa92004-09-08 00:28:11 +00001209 yyssp = yyss + size - 1;
1210 yyvsp = yyvs + size - 1;
1211#ifdef YYLSP_NEEDED
1212 yylsp = yyls + size - 1;
1213#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001214
Lev Walkin1004aa92004-09-08 00:28:11 +00001215#if YYDEBUG != 0
1216 if (yydebug)
1217 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1218#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001219
1220 if (yyssp >= yyss + yystacksize - 1)
1221 YYABORT;
1222 }
1223
Lev Walkin1004aa92004-09-08 00:28:11 +00001224#if YYDEBUG != 0
1225 if (yydebug)
1226 fprintf(stderr, "Entering state %d\n", yystate);
1227#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001228
1229 goto yybackup;
Lev Walkin1004aa92004-09-08 00:28:11 +00001230 yybackup:
Lev Walkinf15320b2004-06-03 03:38:44 +00001231
1232/* Do appropriate processing given the current state. */
1233/* Read a lookahead token if we need one and don't already have one. */
1234/* yyresume: */
1235
1236 /* First try to decide what to do without reference to lookahead token. */
1237
1238 yyn = yypact[yystate];
Lev Walkin1004aa92004-09-08 00:28:11 +00001239 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001240 goto yydefault;
1241
1242 /* Not known => get a lookahead token if don't already have one. */
1243
1244 /* yychar is either YYEMPTY or YYEOF
1245 or a valid token in external form. */
1246
1247 if (yychar == YYEMPTY)
1248 {
Lev Walkin1004aa92004-09-08 00:28:11 +00001249#if YYDEBUG != 0
1250 if (yydebug)
1251 fprintf(stderr, "Reading a token: ");
1252#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001253 yychar = YYLEX;
1254 }
1255
Lev Walkin1004aa92004-09-08 00:28:11 +00001256 /* Convert token to internal form (in yychar1) for indexing tables with */
Lev Walkinf15320b2004-06-03 03:38:44 +00001257
Lev Walkin1004aa92004-09-08 00:28:11 +00001258 if (yychar <= 0) /* This means end of input. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001259 {
1260 yychar1 = 0;
Lev Walkin1004aa92004-09-08 00:28:11 +00001261 yychar = YYEOF; /* Don't call YYLEX any more */
Lev Walkinf15320b2004-06-03 03:38:44 +00001262
Lev Walkin1004aa92004-09-08 00:28:11 +00001263#if YYDEBUG != 0
1264 if (yydebug)
1265 fprintf(stderr, "Now at end of input.\n");
1266#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001267 }
1268 else
1269 {
Lev Walkin1004aa92004-09-08 00:28:11 +00001270 yychar1 = YYTRANSLATE(yychar);
Lev Walkinf15320b2004-06-03 03:38:44 +00001271
Lev Walkin1004aa92004-09-08 00:28:11 +00001272#if YYDEBUG != 0
1273 if (yydebug)
1274 {
1275 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1276 /* Give the individual parser a way to print the precise meaning
1277 of a token, for further debugging info. */
1278#ifdef YYPRINT
1279 YYPRINT (stderr, yychar, yylval);
1280#endif
1281 fprintf (stderr, ")\n");
1282 }
1283#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001284 }
1285
1286 yyn += yychar1;
Lev Walkin1004aa92004-09-08 00:28:11 +00001287 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
Lev Walkinf15320b2004-06-03 03:38:44 +00001288 goto yydefault;
Lev Walkin1004aa92004-09-08 00:28:11 +00001289
Lev Walkinf15320b2004-06-03 03:38:44 +00001290 yyn = yytable[yyn];
Lev Walkin1004aa92004-09-08 00:28:11 +00001291
1292 /* yyn is what to do for this token type in this state.
1293 Negative => reduce, -yyn is rule number.
1294 Positive => shift, yyn is new state.
1295 New state is final state => don't bother to shift,
1296 just return success.
1297 0, or most negative number => error. */
1298
1299 if (yyn < 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001300 {
Lev Walkin1004aa92004-09-08 00:28:11 +00001301 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001302 goto yyerrlab;
1303 yyn = -yyn;
1304 goto yyreduce;
1305 }
Lev Walkin1004aa92004-09-08 00:28:11 +00001306 else if (yyn == 0)
1307 goto yyerrlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00001308
1309 if (yyn == YYFINAL)
1310 YYACCEPT;
1311
1312 /* Shift the lookahead token. */
Lev Walkin1004aa92004-09-08 00:28:11 +00001313
1314#if YYDEBUG != 0
1315 if (yydebug)
1316 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1317#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001318
1319 /* Discard the token being shifted unless it is eof. */
1320 if (yychar != YYEOF)
1321 yychar = YYEMPTY;
1322
1323 *++yyvsp = yylval;
Lev Walkin1004aa92004-09-08 00:28:11 +00001324#ifdef YYLSP_NEEDED
1325 *++yylsp = yylloc;
1326#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001327
Lev Walkin1004aa92004-09-08 00:28:11 +00001328 /* count tokens shifted since error; after three, turn off error status. */
1329 if (yyerrstatus) yyerrstatus--;
Lev Walkinf15320b2004-06-03 03:38:44 +00001330
1331 yystate = yyn;
1332 goto yynewstate;
1333
Lev Walkin1004aa92004-09-08 00:28:11 +00001334/* Do the default action for the current state. */
Lev Walkin459ab022004-09-07 10:39:09 +00001335yydefault:
Lev Walkin1004aa92004-09-08 00:28:11 +00001336
Lev Walkinf15320b2004-06-03 03:38:44 +00001337 yyn = yydefact[yystate];
1338 if (yyn == 0)
1339 goto yyerrlab;
1340
Lev Walkin1004aa92004-09-08 00:28:11 +00001341/* Do a reduction. yyn is the number of a rule to reduce with. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001342yyreduce:
1343 yylen = yyr2[yyn];
Lev Walkin1004aa92004-09-08 00:28:11 +00001344 if (yylen > 0)
1345 yyval = yyvsp[1-yylen]; /* implement default value of the action */
Lev Walkinf15320b2004-06-03 03:38:44 +00001346
Lev Walkin1004aa92004-09-08 00:28:11 +00001347#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00001348 if (yydebug)
1349 {
Lev Walkin1004aa92004-09-08 00:28:11 +00001350 int i;
Lev Walkinf15320b2004-06-03 03:38:44 +00001351
Lev Walkin1004aa92004-09-08 00:28:11 +00001352 fprintf (stderr, "Reducing via rule %d (line %d), ",
1353 yyn, yyrline[yyn]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001354
1355 /* Print the symbols being reduced, and their result. */
Lev Walkin1004aa92004-09-08 00:28:11 +00001356 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1357 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1358 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001359 }
1360#endif
Lev Walkin459ab022004-09-07 10:39:09 +00001361
Lev Walkin1004aa92004-09-08 00:28:11 +00001362
1363 switch (yyn) {
1364
1365case 1:
Lev Walkind370e9f2006-03-16 10:03:35 +00001366#line 324 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001367{
1368 *(void **)param = yyvsp[0].a_grammar;
1369 ;
1370 break;}
1371case 2:
Lev Walkind370e9f2006-03-16 10:03:35 +00001372#line 330 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001373{
Lev Walkinf15320b2004-06-03 03:38:44 +00001374 yyval.a_grammar = asn1p_new();
1375 checkmem(yyval.a_grammar);
1376 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001377 ;
1378 break;}
1379case 3:
Lev Walkind370e9f2006-03-16 10:03:35 +00001380#line 335 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001381{
Lev Walkinf15320b2004-06-03 03:38:44 +00001382 yyval.a_grammar = yyvsp[-1].a_grammar;
1383 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001384 ;
1385 break;}
1386case 4:
Lev Walkind370e9f2006-03-16 10:03:35 +00001387#line 356 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001388{
Lev Walkinf15320b2004-06-03 03:38:44 +00001389
1390 if(yyvsp[-1].a_module) {
1391 yyval.a_module = yyvsp[-1].a_module;
1392 } else {
1393 /* There's a chance that a module is just plain empty */
1394 yyval.a_module = asn1p_module_new();
1395 }
1396 checkmem(yyval.a_module);
1397
Lev Walkinb36317c2005-08-12 10:09:10 +00001398 yyval.a_module->ModuleName = yyvsp[-7].tv_str;
Lev Walkinf15320b2004-06-03 03:38:44 +00001399 yyval.a_module->module_oid = yyvsp[-6].a_oid;
1400 yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
Lev Walkin1004aa92004-09-08 00:28:11 +00001401 ;
1402 break;}
1403case 5:
Lev Walkind370e9f2006-03-16 10:03:35 +00001404#line 377 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001405{ yyval.a_oid = 0; ;
1406 break;}
1407case 6:
Lev Walkind370e9f2006-03-16 10:03:35 +00001408#line 378 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001409{ yyval.a_oid = yyvsp[0].a_oid; ;
1410 break;}
1411case 7:
Lev Walkind370e9f2006-03-16 10:03:35 +00001412#line 382 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001413{
Lev Walkinf15320b2004-06-03 03:38:44 +00001414 yyval.a_oid = yyvsp[-1].a_oid;
Lev Walkin1004aa92004-09-08 00:28:11 +00001415 ;
1416 break;}
1417case 8:
Lev Walkind370e9f2006-03-16 10:03:35 +00001418#line 385 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001419{
Lev Walkinf15320b2004-06-03 03:38:44 +00001420 yyval.a_oid = 0;
Lev Walkin1004aa92004-09-08 00:28:11 +00001421 ;
1422 break;}
1423case 9:
Lev Walkind370e9f2006-03-16 10:03:35 +00001424#line 391 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001425{
Lev Walkinf15320b2004-06-03 03:38:44 +00001426 yyval.a_oid = asn1p_oid_new();
1427 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1428 if(yyvsp[0].a_oid_arc.name)
1429 free(yyvsp[0].a_oid_arc.name);
Lev Walkin1004aa92004-09-08 00:28:11 +00001430 ;
1431 break;}
1432case 10:
Lev Walkind370e9f2006-03-16 10:03:35 +00001433#line 397 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001434{
Lev Walkinf15320b2004-06-03 03:38:44 +00001435 yyval.a_oid = yyvsp[-1].a_oid;
1436 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1437 if(yyvsp[0].a_oid_arc.name)
1438 free(yyvsp[0].a_oid_arc.name);
Lev Walkin1004aa92004-09-08 00:28:11 +00001439 ;
1440 break;}
1441case 11:
Lev Walkind370e9f2006-03-16 10:03:35 +00001442#line 406 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001443{ /* iso */
Lev Walkinf15320b2004-06-03 03:38:44 +00001444 yyval.a_oid_arc.name = yyvsp[0].tv_str;
1445 yyval.a_oid_arc.number = -1;
Lev Walkin1004aa92004-09-08 00:28:11 +00001446 ;
1447 break;}
1448case 12:
Lev Walkind370e9f2006-03-16 10:03:35 +00001449#line 410 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001450{ /* iso(1) */
Lev Walkinf15320b2004-06-03 03:38:44 +00001451 yyval.a_oid_arc.name = yyvsp[-3].tv_str;
1452 yyval.a_oid_arc.number = yyvsp[-1].a_int;
Lev Walkin1004aa92004-09-08 00:28:11 +00001453 ;
1454 break;}
1455case 13:
Lev Walkind370e9f2006-03-16 10:03:35 +00001456#line 414 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001457{ /* 1 */
Lev Walkinf15320b2004-06-03 03:38:44 +00001458 yyval.a_oid_arc.name = 0;
1459 yyval.a_oid_arc.number = yyvsp[0].a_int;
Lev Walkin1004aa92004-09-08 00:28:11 +00001460 ;
1461 break;}
1462case 14:
Lev Walkind370e9f2006-03-16 10:03:35 +00001463#line 424 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001464{ yyval.a_module_flags = MSF_NOFLAGS; ;
1465 break;}
1466case 15:
Lev Walkind370e9f2006-03-16 10:03:35 +00001467#line 425 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001468{
Lev Walkinf15320b2004-06-03 03:38:44 +00001469 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkin1004aa92004-09-08 00:28:11 +00001470 ;
1471 break;}
1472case 16:
Lev Walkind370e9f2006-03-16 10:03:35 +00001473#line 434 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001474{
Lev Walkinf15320b2004-06-03 03:38:44 +00001475 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkin1004aa92004-09-08 00:28:11 +00001476 ;
1477 break;}
1478case 17:
Lev Walkind370e9f2006-03-16 10:03:35 +00001479#line 437 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001480{
Lev Walkinf15320b2004-06-03 03:38:44 +00001481 yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
Lev Walkin1004aa92004-09-08 00:28:11 +00001482 ;
1483 break;}
1484case 18:
Lev Walkind370e9f2006-03-16 10:03:35 +00001485#line 446 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001486{
Lev Walkinf15320b2004-06-03 03:38:44 +00001487 yyval.a_module_flags = MSF_EXPLICIT_TAGS;
Lev Walkin1004aa92004-09-08 00:28:11 +00001488 ;
1489 break;}
1490case 19:
Lev Walkind370e9f2006-03-16 10:03:35 +00001491#line 449 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001492{
Lev Walkinf15320b2004-06-03 03:38:44 +00001493 yyval.a_module_flags = MSF_IMPLICIT_TAGS;
Lev Walkin1004aa92004-09-08 00:28:11 +00001494 ;
1495 break;}
1496case 20:
Lev Walkind370e9f2006-03-16 10:03:35 +00001497#line 452 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001498{
Lev Walkinf15320b2004-06-03 03:38:44 +00001499 yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
Lev Walkin1004aa92004-09-08 00:28:11 +00001500 ;
1501 break;}
1502case 21:
Lev Walkind370e9f2006-03-16 10:03:35 +00001503#line 455 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001504{
Lev Walkinf15320b2004-06-03 03:38:44 +00001505 yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
Lev Walkin1004aa92004-09-08 00:28:11 +00001506 ;
1507 break;}
1508case 22:
Lev Walkind370e9f2006-03-16 10:03:35 +00001509#line 459 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001510{
Lev Walkinf59d0752004-08-18 04:59:12 +00001511 /* X.680Amd1 specifies TAG and XER */
1512 if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) {
1513 yyval.a_module_flags = MSF_TAG_INSTRUCTIONS;
1514 } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) {
1515 yyval.a_module_flags = MSF_XER_INSTRUCTIONS;
1516 } else {
1517 fprintf(stderr,
1518 "WARNING: %s INSTRUCTIONS at line %d: "
1519 "Unrecognized encoding reference\n",
1520 yyvsp[-1].tv_str, yylineno);
1521 yyval.a_module_flags = MSF_unk_INSTRUCTIONS;
1522 }
1523 free(yyvsp[-1].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00001524 ;
1525 break;}
1526case 23:
Lev Walkind370e9f2006-03-16 10:03:35 +00001527#line 480 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001528{ yyval.a_module = 0; ;
1529 break;}
1530case 24:
Lev Walkind370e9f2006-03-16 10:03:35 +00001531#line 481 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001532{
Lev Walkinf15320b2004-06-03 03:38:44 +00001533 yyval.a_module = yyvsp[0].a_module;
Lev Walkin1004aa92004-09-08 00:28:11 +00001534 ;
1535 break;}
1536case 25:
Lev Walkind370e9f2006-03-16 10:03:35 +00001537#line 490 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001538{
Lev Walkinf59d0752004-08-18 04:59:12 +00001539 yyval.a_module = yyvsp[0].a_module;
Lev Walkin1004aa92004-09-08 00:28:11 +00001540 ;
1541 break;}
1542case 26:
Lev Walkind370e9f2006-03-16 10:03:35 +00001543#line 493 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001544{
Lev Walkinf15320b2004-06-03 03:38:44 +00001545 yyval.a_module = yyvsp[-1].a_module;
1546
Lev Walkinf59d0752004-08-18 04:59:12 +00001547 /* Behave well when one of them is skipped. */
1548 if(!(yyvsp[-1].a_module)) {
1549 if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module;
1550 break;
1551 }
1552
Lev Walkinf15320b2004-06-03 03:38:44 +00001553#ifdef MY_IMPORT
1554#error MY_IMPORT DEFINED ELSEWHERE!
1555#endif
1556#define MY_IMPORT(foo,field) do { \
Lev Walkinbc55d232004-08-13 12:31:09 +00001557 while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
Lev Walkinf15320b2004-06-03 03:38:44 +00001558 TQ_ADD(&(yyval.a_module->foo), \
1559 TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
1560 field); \
Lev Walkinbc55d232004-08-13 12:31:09 +00001561 } \
1562 assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
1563 } while(0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001564
1565 MY_IMPORT(imports, xp_next);
1566 MY_IMPORT(exports, xp_next);
1567 MY_IMPORT(members, next);
1568#undef MY_IMPORT
1569
Lev Walkin1004aa92004-09-08 00:28:11 +00001570 ;
1571 break;}
1572case 27:
Lev Walkind370e9f2006-03-16 10:03:35 +00001573#line 526 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001574{
Lev Walkinf15320b2004-06-03 03:38:44 +00001575 yyval.a_module = yyvsp[0].a_module;
Lev Walkin1004aa92004-09-08 00:28:11 +00001576 ;
1577 break;}
1578case 28:
Lev Walkind370e9f2006-03-16 10:03:35 +00001579#line 529 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001580{
Lev Walkinf15320b2004-06-03 03:38:44 +00001581 yyval.a_module = asn1p_module_new();
1582 checkmem(yyval.a_module);
1583 if(yyvsp[0].a_xports) {
1584 TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
1585 } else {
1586 /* "EXPORTS ALL;" ? */
1587 }
Lev Walkin1004aa92004-09-08 00:28:11 +00001588 ;
1589 break;}
1590case 29:
Lev Walkind370e9f2006-03-16 10:03:35 +00001591#line 538 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001592{
Lev Walkinf59d0752004-08-18 04:59:12 +00001593 yyval.a_module = asn1p_module_new();
1594 checkmem(yyval.a_module);
1595 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1596 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1597 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001598 ;
1599 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001600case 30:
Lev Walkind370e9f2006-03-16 10:03:35 +00001601#line 545 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001602{
1603 yyval.a_module = asn1p_module_new();
1604 checkmem(yyval.a_module);
1605 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1606 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1607 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
1608 ;
1609 break;}
Lev Walkin1004aa92004-09-08 00:28:11 +00001610case 31:
Lev Walkind370e9f2006-03-16 10:03:35 +00001611#line 558 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001612{
Lev Walkinf59d0752004-08-18 04:59:12 +00001613 yyval.a_module = asn1p_module_new();
1614 checkmem(yyval.a_module);
1615 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1616 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1617 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001618 ;
1619 break;}
1620case 32:
Lev Walkind370e9f2006-03-16 10:03:35 +00001621#line 566 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001622{ asn1p_lexer_hack_push_encoding_control(); ;
1623 break;}
1624case 33:
Lev Walkind370e9f2006-03-16 10:03:35 +00001625#line 567 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001626{
Lev Walkinf59d0752004-08-18 04:59:12 +00001627 fprintf(stderr,
1628 "WARNING: ENCODING-CONTROL %s "
1629 "specification at line %d ignored\n",
1630 yyvsp[-1].tv_str, yylineno);
1631 free(yyvsp[-1].tv_str);
1632 yyval.a_module = 0;
Lev Walkin1004aa92004-09-08 00:28:11 +00001633 ;
1634 break;}
1635case 34:
Lev Walkind370e9f2006-03-16 10:03:35 +00001636#line 579 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001637{
Lev Walkinf15320b2004-06-03 03:38:44 +00001638 return yyerror(
Lev Walkin70853052005-11-26 11:21:55 +00001639 "Attempt to redefine a standard basic string type, "
1640 "please comment out or remove this type redefinition.");
Lev Walkin1004aa92004-09-08 00:28:11 +00001641 ;
1642 break;}
1643case 35:
Lev Walkind370e9f2006-03-16 10:03:35 +00001644#line 592 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001645{
Lev Walkinb36317c2005-08-12 10:09:10 +00001646 if(!saved_aid && 0)
1647 return yyerror("Unterminated IMPORTS FROM, "
1648 "expected semicolon ';'");
1649 saved_aid = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00001650 yyval.a_module = yyvsp[-1].a_module;
Lev Walkin1004aa92004-09-08 00:28:11 +00001651 ;
1652 break;}
1653case 36:
Lev Walkind370e9f2006-03-16 10:03:35 +00001654#line 602 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001655{
Lev Walkinf15320b2004-06-03 03:38:44 +00001656 return yyerror("Empty IMPORTS list");
Lev Walkin1004aa92004-09-08 00:28:11 +00001657 ;
1658 break;}
1659case 37:
Lev Walkind370e9f2006-03-16 10:03:35 +00001660#line 608 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001661{
Lev Walkinf15320b2004-06-03 03:38:44 +00001662 yyval.a_module = asn1p_module_new();
1663 checkmem(yyval.a_module);
1664 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001665 ;
1666 break;}
1667case 38:
Lev Walkind370e9f2006-03-16 10:03:35 +00001668#line 613 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001669{
Lev Walkinf15320b2004-06-03 03:38:44 +00001670 yyval.a_module = yyvsp[-1].a_module;
1671 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001672 ;
1673 break;}
1674case 39:
Lev Walkind370e9f2006-03-16 10:03:35 +00001675#line 620 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001676{ memset(&yyval.a_aid, 0, sizeof(yyval.a_aid)); ;
1677 break;}
1678case 40:
Lev Walkind370e9f2006-03-16 10:03:35 +00001679#line 621 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001680{ yyval.a_aid.oid = yyvsp[0].a_oid; ;
1681 break;}
1682case 41:
Lev Walkind370e9f2006-03-16 10:03:35 +00001683#line 625 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001684{
Lev Walkinf15320b2004-06-03 03:38:44 +00001685 yyval.a_xports = yyvsp[-3].a_xports;
Lev Walkinb36317c2005-08-12 10:09:10 +00001686 yyval.a_xports->fromModuleName = yyvsp[-1].tv_str;
1687 yyval.a_xports->identifier = yyvsp[0].a_aid;
1688 /* This stupid thing is used for look-back hack. */
1689 saved_aid = yyval.a_xports->identifier.oid ? 0 : &(yyval.a_xports->identifier);
Lev Walkinf15320b2004-06-03 03:38:44 +00001690 checkmem(yyval.a_xports);
Lev Walkin1004aa92004-09-08 00:28:11 +00001691 ;
1692 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001693case 42:
Lev Walkind370e9f2006-03-16 10:03:35 +00001694#line 636 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001695{
Lev Walkinf15320b2004-06-03 03:38:44 +00001696 yyval.a_xports = asn1p_xports_new();
1697 checkmem(yyval.a_xports);
1698 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001699 ;
1700 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001701case 43:
Lev Walkind370e9f2006-03-16 10:03:35 +00001702#line 641 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001703{
Lev Walkinf15320b2004-06-03 03:38:44 +00001704 yyval.a_xports = yyvsp[-2].a_xports;
1705 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001706 ;
1707 break;}
Lev Walkin144db9b2004-10-12 23:26:53 +00001708case 44:
Lev Walkind370e9f2006-03-16 10:03:35 +00001709#line 648 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001710{
Lev Walkinf15320b2004-06-03 03:38:44 +00001711 yyval.a_expr = asn1p_expr_new(yylineno);
1712 checkmem(yyval.a_expr);
1713 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1714 yyval.a_expr->expr_type = A1TC_REFERENCE;
Lev Walkin1004aa92004-09-08 00:28:11 +00001715 ;
1716 break;}
Lev Walkin144db9b2004-10-12 23:26:53 +00001717case 45:
Lev Walkind370e9f2006-03-16 10:03:35 +00001718#line 654 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001719{ /* Completely equivalent to above */
1720 yyval.a_expr = asn1p_expr_new(yylineno);
1721 checkmem(yyval.a_expr);
1722 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1723 yyval.a_expr->expr_type = A1TC_REFERENCE;
1724 ;
1725 break;}
1726case 46:
Lev Walkind370e9f2006-03-16 10:03:35 +00001727#line 660 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001728{
1729 yyval.a_expr = asn1p_expr_new(yylineno);
1730 checkmem(yyval.a_expr);
1731 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1732 yyval.a_expr->expr_type = A1TC_REFERENCE;
1733 ;
1734 break;}
1735case 47:
Lev Walkind370e9f2006-03-16 10:03:35 +00001736#line 669 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001737{
Lev Walkinf15320b2004-06-03 03:38:44 +00001738 yyval.a_xports = yyvsp[-1].a_xports;
Lev Walkin1004aa92004-09-08 00:28:11 +00001739 ;
1740 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001741case 48:
Lev Walkind370e9f2006-03-16 10:03:35 +00001742#line 672 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001743{
Lev Walkinf15320b2004-06-03 03:38:44 +00001744 yyval.a_xports = 0;
Lev Walkin1004aa92004-09-08 00:28:11 +00001745 ;
1746 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001747case 49:
Lev Walkind370e9f2006-03-16 10:03:35 +00001748#line 675 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001749{
Lev Walkinf15320b2004-06-03 03:38:44 +00001750 /* Empty EXPORTS clause effectively prohibits export. */
1751 yyval.a_xports = asn1p_xports_new();
1752 checkmem(yyval.a_xports);
Lev Walkin1004aa92004-09-08 00:28:11 +00001753 ;
1754 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001755case 50:
Lev Walkind370e9f2006-03-16 10:03:35 +00001756#line 683 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001757{
Lev Walkinf15320b2004-06-03 03:38:44 +00001758 yyval.a_xports = asn1p_xports_new();
1759 assert(yyval.a_xports);
1760 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001761 ;
1762 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001763case 51:
Lev Walkind370e9f2006-03-16 10:03:35 +00001764#line 688 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001765{
Lev Walkinf15320b2004-06-03 03:38:44 +00001766 yyval.a_xports = yyvsp[-2].a_xports;
1767 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00001768 ;
1769 break;}
Lev Walkin144db9b2004-10-12 23:26:53 +00001770case 52:
Lev Walkind370e9f2006-03-16 10:03:35 +00001771#line 695 "asn1p_y.y"
Lev Walkin144db9b2004-10-12 23:26:53 +00001772{
1773 yyval.a_expr = asn1p_expr_new(yylineno);
1774 checkmem(yyval.a_expr);
1775 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1776 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
1777 ;
1778 break;}
1779case 53:
Lev Walkind370e9f2006-03-16 10:03:35 +00001780#line 701 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001781{
1782 yyval.a_expr = asn1p_expr_new(yylineno);
1783 checkmem(yyval.a_expr);
1784 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1785 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
1786 ;
Lev Walkin8ea99482005-03-31 21:48:13 +00001787 break;}
1788case 54:
Lev Walkind370e9f2006-03-16 10:03:35 +00001789#line 707 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001790{
1791 yyval.a_expr = asn1p_expr_new(yylineno);
1792 checkmem(yyval.a_expr);
1793 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1794 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
1795 ;
1796 break;}
1797case 55:
Lev Walkind370e9f2006-03-16 10:03:35 +00001798#line 718 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001799{ asn1p_lexer_hack_push_opaque_state(); ;
1800 break;}
1801case 56:
Lev Walkind370e9f2006-03-16 10:03:35 +00001802#line 718 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001803{
Lev Walkinf15320b2004-06-03 03:38:44 +00001804 yyval.a_expr = yyvsp[-4].a_expr;
1805 assert(yyval.a_expr->Identifier == 0);
1806 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1807 yyval.a_expr->meta_type = AMT_VALUESET;
Lev Walkin8ea99482005-03-31 21:48:13 +00001808 // take care of ValueSet body
Lev Walkin1004aa92004-09-08 00:28:11 +00001809 ;
1810 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001811case 57:
Lev Walkind370e9f2006-03-16 10:03:35 +00001812#line 728 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001813{
Lev Walkinf15320b2004-06-03 03:38:44 +00001814 yyval.a_expr = asn1p_expr_new(yylineno);
1815 checkmem(yyval.a_expr);
1816 yyval.a_expr->reference = yyvsp[0].a_ref;
1817 yyval.a_expr->expr_type = A1TC_REFERENCE;
1818 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkin1004aa92004-09-08 00:28:11 +00001819 ;
1820 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001821case 58:
Lev Walkind370e9f2006-03-16 10:03:35 +00001822#line 735 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001823{
Lev Walkinf15320b2004-06-03 03:38:44 +00001824 yyval.a_expr = asn1p_expr_new(yylineno);
1825 checkmem(yyval.a_expr);
1826 yyval.a_expr->expr_type = yyvsp[0].a_type;
1827 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00001828 ;
1829 break;}
Lev Walkinb36317c2005-08-12 10:09:10 +00001830case 59:
Lev Walkind370e9f2006-03-16 10:03:35 +00001831#line 753 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001832{
Lev Walkinf15320b2004-06-03 03:38:44 +00001833 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinaf120f72004-09-14 02:36:39 +00001834 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
Lev Walkinf15320b2004-06-03 03:38:44 +00001835 assert(yyval.a_expr->expr_type);
1836 assert(yyval.a_expr->meta_type);
Lev Walkin1004aa92004-09-08 00:28:11 +00001837 ;
1838 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001839case 60:
Lev Walkind370e9f2006-03-16 10:03:35 +00001840#line 759 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001841{
Lev Walkinf15320b2004-06-03 03:38:44 +00001842 yyval.a_expr = yyvsp[0].a_expr;
1843 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1844 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
Lev Walkin9c2285a2006-03-09 08:49:26 +00001845 assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS);
Lev Walkin1004aa92004-09-08 00:28:11 +00001846 ;
1847 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001848case 61:
Lev Walkind370e9f2006-03-16 10:03:35 +00001849#line 775 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001850{
Lev Walkinf15320b2004-06-03 03:38:44 +00001851 yyval.a_expr = yyvsp[0].a_expr;
1852 assert(yyval.a_expr->Identifier == 0);
1853 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1854 yyval.a_expr->params = yyvsp[-3].a_plist;
1855 yyval.a_expr->meta_type = AMT_PARAMTYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00001856 ;
1857 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001858case 62:
Lev Walkind370e9f2006-03-16 10:03:35 +00001859#line 785 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001860{
Lev Walkinf15320b2004-06-03 03:38:44 +00001861 int ret;
1862 yyval.a_plist = asn1p_paramlist_new(yylineno);
1863 checkmem(yyval.a_plist);
1864 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1865 checkmem(ret == 0);
1866 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1867 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkin1004aa92004-09-08 00:28:11 +00001868 ;
1869 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001870case 63:
Lev Walkind370e9f2006-03-16 10:03:35 +00001871#line 794 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001872{
Lev Walkinf15320b2004-06-03 03:38:44 +00001873 int ret;
1874 yyval.a_plist = yyvsp[-2].a_plist;
1875 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1876 checkmem(ret == 0);
1877 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1878 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkin1004aa92004-09-08 00:28:11 +00001879 ;
1880 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001881case 64:
Lev Walkind370e9f2006-03-16 10:03:35 +00001882#line 805 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001883{
Lev Walkinf15320b2004-06-03 03:38:44 +00001884 yyval.a_parg.governor = NULL;
1885 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00001886 ;
1887 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001888case 65:
Lev Walkind370e9f2006-03-16 10:03:35 +00001889#line 809 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00001890{
1891 int ret;
1892 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1893 ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
1894 checkmem(ret == 0);
1895 yyval.a_parg.argument = yyvsp[0].tv_str;
1896 ;
1897 break;}
Lev Walkin8ea99482005-03-31 21:48:13 +00001898case 66:
Lev Walkind370e9f2006-03-16 10:03:35 +00001899#line 816 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00001900{
1901 int ret;
1902 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1903 ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
1904 checkmem(ret == 0);
1905 yyval.a_parg.argument = yyvsp[0].tv_str;
1906 ;
1907 break;}
1908case 67:
Lev Walkind370e9f2006-03-16 10:03:35 +00001909#line 823 "asn1p_y.y"
Lev Walkinc8092cb2005-02-18 16:34:21 +00001910{
1911 int ret;
1912 yyval.a_parg.governor = asn1p_ref_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00001913 ret = asn1p_ref_add_component(yyval.a_parg.governor,
1914 ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
1915 checkmem(ret == 0);
1916 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00001917 ;
1918 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001919case 68:
Lev Walkind370e9f2006-03-16 10:03:35 +00001920#line 834 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001921{
Lev Walkinf15320b2004-06-03 03:38:44 +00001922 yyval.a_expr = asn1p_expr_new(yylineno);
1923 checkmem(yyval.a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00001924 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1925 ;
1926 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001927case 69:
Lev Walkind370e9f2006-03-16 10:03:35 +00001928#line 839 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001929{
Lev Walkinf15320b2004-06-03 03:38:44 +00001930 yyval.a_expr = yyvsp[-2].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00001931 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1932 ;
1933 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001934case 70:
Lev Walkind370e9f2006-03-16 10:03:35 +00001935#line 846 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001936{
Lev Walkinf15320b2004-06-03 03:38:44 +00001937 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00001938 ;
1939 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001940case 71:
Lev Walkind370e9f2006-03-16 10:03:35 +00001941#line 849 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001942{
Lev Walkinf15320b2004-06-03 03:38:44 +00001943 yyval.a_expr = asn1p_expr_new(yylineno);
1944 checkmem(yyval.a_expr);
1945 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1946 yyval.a_expr->expr_type = A1TC_REFERENCE;
1947 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkin1004aa92004-09-08 00:28:11 +00001948 ;
1949 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001950case 72:
Lev Walkind370e9f2006-03-16 10:03:35 +00001951#line 873 "asn1p_y.y"
Lev Walkin144db9b2004-10-12 23:26:53 +00001952{ yyval.a_expr = asn1p_expr_new(yylineno); ;
1953 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001954case 73:
Lev Walkind370e9f2006-03-16 10:03:35 +00001955#line 874 "asn1p_y.y"
Lev Walkin144db9b2004-10-12 23:26:53 +00001956{ yyval.a_expr = yyvsp[0].a_expr; ;
1957 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001958case 74:
Lev Walkind370e9f2006-03-16 10:03:35 +00001959#line 877 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001960{
Lev Walkinf15320b2004-06-03 03:38:44 +00001961 yyval.a_expr = asn1p_expr_new(yylineno);
1962 checkmem(yyval.a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00001963 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1964 ;
1965 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001966case 75:
Lev Walkind370e9f2006-03-16 10:03:35 +00001967#line 882 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001968{
Lev Walkinf15320b2004-06-03 03:38:44 +00001969 yyval.a_expr = yyvsp[-2].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00001970 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1971 ;
1972 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001973case 76:
Lev Walkind370e9f2006-03-16 10:03:35 +00001974#line 889 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001975{
Lev Walkin070a52d2004-08-22 03:19:54 +00001976 yyval.a_expr = yyvsp[-1].a_expr;
1977 assert(yyval.a_expr->Identifier == 0);
Lev Walkinaf120f72004-09-14 02:36:39 +00001978 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
Lev Walkinef625402005-09-05 05:17:57 +00001979 yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags;
Lev Walkin070a52d2004-08-22 03:19:54 +00001980 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkin1004aa92004-09-08 00:28:11 +00001981 ;
1982 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001983case 77:
Lev Walkind370e9f2006-03-16 10:03:35 +00001984#line 896 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00001985{
Lev Walkinef625402005-09-05 05:17:57 +00001986 yyval.a_expr = yyvsp[-1].a_expr;
1987 yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags;
1988 yyval.a_expr->marker = yyvsp[0].a_marker;
1989 _fixup_anonymous_identifier(yyval.a_expr);
1990 ;
1991 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00001992case 78:
Lev Walkind370e9f2006-03-16 10:03:35 +00001993#line 902 "asn1p_y.y"
Lev Walkinef625402005-09-05 05:17:57 +00001994{
Lev Walkin070a52d2004-08-22 03:19:54 +00001995 yyval.a_expr = asn1p_expr_new(yylineno);
1996 checkmem(yyval.a_expr);
1997 yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type;
1998 yyval.a_expr->expr_type = A1TC_COMPONENTS_OF;
Lev Walkin1004aa92004-09-08 00:28:11 +00001999 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2000 ;
2001 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002002case 79:
Lev Walkind370e9f2006-03-16 10:03:35 +00002003#line 909 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002004{
Lev Walkin070a52d2004-08-22 03:19:54 +00002005 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002006 ;
2007 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002008case 80:
Lev Walkind370e9f2006-03-16 10:03:35 +00002009#line 915 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002010{
Lev Walkin070a52d2004-08-22 03:19:54 +00002011 yyval.a_expr = asn1p_expr_new(yylineno);
2012 checkmem(yyval.a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002013 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2014 ;
2015 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002016case 81:
Lev Walkind370e9f2006-03-16 10:03:35 +00002017#line 920 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002018{
Lev Walkin070a52d2004-08-22 03:19:54 +00002019 yyval.a_expr = yyvsp[-2].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002020 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2021 ;
2022 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002023case 82:
Lev Walkind370e9f2006-03-16 10:03:35 +00002024#line 927 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002025{
Lev Walkin070a52d2004-08-22 03:19:54 +00002026 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002027 assert(yyval.a_expr->Identifier == 0);
2028 yyval.a_expr->Identifier = yyvsp[-1].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00002029 ;
2030 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002031case 83:
Lev Walkind370e9f2006-03-16 10:03:35 +00002032#line 932 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002033{
2034 yyval.a_expr = yyvsp[0].a_expr;
2035 ;
2036 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002037case 84:
Lev Walkind370e9f2006-03-16 10:03:35 +00002038#line 935 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002039{
2040 yyval.a_expr = yyvsp[0].a_expr;
2041 _fixup_anonymous_identifier(yyval.a_expr);
2042 ;
2043 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002044case 85:
Lev Walkind370e9f2006-03-16 10:03:35 +00002045#line 942 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002046{
Lev Walkinf15320b2004-06-03 03:38:44 +00002047 yyval.a_expr = yyvsp[-2].a_expr;
2048 checkmem(yyval.a_expr);
2049 yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
2050 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
Lev Walkin9c2285a2006-03-09 08:49:26 +00002051 assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS);
Lev Walkin1004aa92004-09-08 00:28:11 +00002052 ;
2053 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002054case 86:
Lev Walkind370e9f2006-03-16 10:03:35 +00002055#line 952 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002056{ yyval.a_int = 0; ;
2057 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002058case 87:
Lev Walkind370e9f2006-03-16 10:03:35 +00002059#line 953 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002060{ yyval.a_int = 1; ;
2061 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002062case 88:
Lev Walkind370e9f2006-03-16 10:03:35 +00002063#line 957 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002064{
Lev Walkinf15320b2004-06-03 03:38:44 +00002065 yyval.a_expr = asn1p_expr_new(yylineno);
2066 checkmem(yyval.a_expr);
2067 yyval.a_expr->expr_type = A1TC_CLASSDEF;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002068 yyval.a_expr->meta_type = AMT_OBJECTCLASS;
2069 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2070 ;
2071 break;}
2072case 89:
Lev Walkind370e9f2006-03-16 10:03:35 +00002073#line 964 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002074{
2075 yyval.a_expr = yyvsp[-2].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002076 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2077 ;
2078 break;}
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002079case 90:
Lev Walkind370e9f2006-03-16 10:03:35 +00002080#line 974 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002081{
Lev Walkin9c2285a2006-03-09 08:49:26 +00002082 yyval.a_expr = asn1p_expr_new(yylineno);
2083 checkmem(yyval.a_expr);
2084 yyval.a_expr->Identifier = yyvsp[-1].tv_str;
2085 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2086 yyval.a_expr->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
2087 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkin1004aa92004-09-08 00:28:11 +00002088 ;
2089 break;}
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002090case 91:
Lev Walkind370e9f2006-03-16 10:03:35 +00002091#line 984 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002092{
Lev Walkinf15320b2004-06-03 03:38:44 +00002093 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin9c2285a2006-03-09 08:49:26 +00002094 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
Lev Walkinf15320b2004-06-03 03:38:44 +00002095 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002096 yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
2097 yyval.a_expr->unique = yyvsp[-1].a_int;
Lev Walkinf15320b2004-06-03 03:38:44 +00002098 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002099 asn1p_expr_add(yyval.a_expr, yyvsp[-2].a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002100 ;
2101 break;}
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002102case 92:
Lev Walkind370e9f2006-03-16 10:03:35 +00002103#line 995 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002104{
Lev Walkin9c2285a2006-03-09 08:49:26 +00002105 yyval.a_expr = asn1p_expr_new(yylineno);
2106 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
2107 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2108 yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVFS;
2109 yyval.a_expr->reference = yyvsp[-1].a_ref;
Lev Walkinb7c45ca2004-11-24 17:43:29 +00002110 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkin1004aa92004-09-08 00:28:11 +00002111 ;
2112 break;}
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002113case 93:
Lev Walkind370e9f2006-03-16 10:03:35 +00002114#line 1005 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002115{
Lev Walkinf15320b2004-06-03 03:38:44 +00002116 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin9c2285a2006-03-09 08:49:26 +00002117 checkmem(yyval.a_expr);
2118 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
2119 yyval.a_expr->reference = yyvsp[-1].a_ref;
2120 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2121 yyval.a_expr->expr_type = A1TC_CLASSFIELD_OFS;
2122 yyval.a_expr->marker = yyvsp[0].a_marker;
2123 ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002124 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00002125case 94:
Lev Walkind370e9f2006-03-16 10:03:35 +00002126#line 1016 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002127{
2128 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin9c2285a2006-03-09 08:49:26 +00002129 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002130 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
Lev Walkin1db91132006-03-09 09:11:53 +00002131 yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVSFS;
2132 yyval.a_expr->reference = yyvsp[-1].a_ref;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002133 yyval.a_expr->marker = yyvsp[0].a_marker;
2134 ;
2135 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00002136case 95:
Lev Walkind370e9f2006-03-16 10:03:35 +00002137#line 1026 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002138{
2139 yyval.a_expr = asn1p_expr_new(yylineno);
2140 checkmem(yyval.a_expr);
2141 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
2142 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2143 yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVSFS;
2144 asn1p_expr_add(yyval.a_expr, yyvsp[-1].a_expr);
2145 yyval.a_expr->marker = yyvsp[0].a_marker;
2146 ;
2147 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00002148case 96:
Lev Walkind370e9f2006-03-16 10:03:35 +00002149#line 1037 "asn1p_y.y"
Lev Walkin1db91132006-03-09 09:11:53 +00002150{
2151 yyval.a_expr = asn1p_expr_new(yylineno);
2152 checkmem(yyval.a_expr);
2153 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
2154 yyval.a_expr->reference = yyvsp[-1].a_ref;
2155 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2156 yyval.a_expr->expr_type = A1TC_CLASSFIELD_OSFS;
2157 yyval.a_expr->marker = yyvsp[0].a_marker;
2158 ;
2159 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002160case 97:
Lev Walkind370e9f2006-03-16 10:03:35 +00002161#line 1049 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002162{ yyval.a_wsynt = 0; ;
2163 break;}
2164case 98:
Lev Walkind370e9f2006-03-16 10:03:35 +00002165#line 1050 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002166{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002167 yyval.a_wsynt = yyvsp[0].a_wsynt;
Lev Walkin1004aa92004-09-08 00:28:11 +00002168 ;
2169 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002170case 99:
Lev Walkind370e9f2006-03-16 10:03:35 +00002171#line 1057 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002172{ asn1p_lexer_hack_enable_with_syntax(); ;
2173 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002174case 100:
Lev Walkind370e9f2006-03-16 10:03:35 +00002175#line 1059 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002176{
2177 yyval.a_wsynt = yyvsp[-1].a_wsynt;
2178 ;
2179 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002180case 101:
Lev Walkind370e9f2006-03-16 10:03:35 +00002181#line 1065 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002182{
Lev Walkinf15320b2004-06-03 03:38:44 +00002183 yyval.a_wsynt = asn1p_wsyntx_new();
2184 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00002185 ;
2186 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002187case 102:
Lev Walkind370e9f2006-03-16 10:03:35 +00002188#line 1069 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002189{
Lev Walkinf15320b2004-06-03 03:38:44 +00002190 yyval.a_wsynt = yyvsp[-1].a_wsynt;
2191 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkin1004aa92004-09-08 00:28:11 +00002192 ;
2193 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002194case 103:
Lev Walkind370e9f2006-03-16 10:03:35 +00002195#line 1076 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002196{
Lev Walkinf15320b2004-06-03 03:38:44 +00002197 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
Lev Walkin57074f12006-03-16 05:11:14 +00002198 yyval.a_wchunk->type = WC_WHITESPACE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002199 ;
2200 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002201case 104:
Lev Walkind370e9f2006-03-16 10:03:35 +00002202#line 1080 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002203{
2204 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_str, strlen(yyvsp[0].tv_str), 0);
2205 ;
2206 break;}
2207case 105:
Lev Walkind370e9f2006-03-16 10:03:35 +00002208#line 1083 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002209{
Lev Walkind370e9f2006-03-16 10:03:35 +00002210 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].a_refcomp.name, strlen(yyvsp[0].a_refcomp.name), 0);
2211 yyval.a_wchunk->type = WC_FIELD;
Lev Walkin1004aa92004-09-08 00:28:11 +00002212 ;
2213 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002214case 106:
Lev Walkind370e9f2006-03-16 10:03:35 +00002215#line 1087 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002216{
Lev Walkin9d542d22006-03-14 16:31:37 +00002217 yyval.a_wchunk = asn1p_wsyntx_chunk_fromsyntax(yyvsp[-1].a_wsynt);
Lev Walkin9c2285a2006-03-09 08:49:26 +00002218 ;
2219 break;}
2220case 107:
Lev Walkind370e9f2006-03-16 10:03:35 +00002221#line 1093 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002222{
2223 yyval.a_expr = asn1p_expr_new(yylineno);
2224 checkmem(yyval.a_expr);
2225 yyval.a_expr->Identifier = strdup("...");
Lev Walkin9c2285a2006-03-09 08:49:26 +00002226 checkmem(yyval.a_expr->Identifier);
2227 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2228 yyval.a_expr->meta_type = AMT_TYPE;
2229 ;
2230 break;}
2231case 108:
Lev Walkind370e9f2006-03-16 10:03:35 +00002232#line 1101 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002233{
2234 yyval.a_expr = asn1p_expr_new(yylineno);
2235 checkmem(yyval.a_expr);
2236 yyval.a_expr->Identifier = strdup("...");
2237 checkmem(yyval.a_expr->Identifier);
2238 yyval.a_expr->value = yyvsp[0].a_value;
2239 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2240 yyval.a_expr->meta_type = AMT_TYPE;
2241 ;
2242 break;}
2243case 109:
Lev Walkind370e9f2006-03-16 10:03:35 +00002244#line 1110 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002245{
2246 yyval.a_expr = asn1p_expr_new(yylineno);
2247 checkmem(yyval.a_expr);
2248 yyval.a_expr->Identifier = strdup("...");
2249 yyval.a_expr->value = yyvsp[0].a_value;
2250 checkmem(yyval.a_expr->Identifier);
2251 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2252 yyval.a_expr->meta_type = AMT_TYPE;
2253 ;
2254 break;}
2255case 110:
Lev Walkind370e9f2006-03-16 10:03:35 +00002256#line 1122 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002257{
Lev Walkin070a52d2004-08-22 03:19:54 +00002258 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkinaf120f72004-09-14 02:36:39 +00002259 yyval.a_expr->tag = yyvsp[-2].a_tag;
Lev Walkin070a52d2004-08-22 03:19:54 +00002260 /*
2261 * Outer constraint for SEQUENCE OF and SET OF applies
2262 * to the inner type.
2263 */
2264 if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF
2265 || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) {
2266 assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints);
2267 TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr;
2268 } else {
2269 if(yyval.a_expr->constraints) {
Lev Walkinaf120f72004-09-14 02:36:39 +00002270 assert(!yyvsp[-1].a_expr);
Lev Walkin070a52d2004-08-22 03:19:54 +00002271 } else {
2272 yyval.a_expr->constraints = yyvsp[0].a_constr;
2273 }
2274 }
Lev Walkin1004aa92004-09-08 00:28:11 +00002275 ;
2276 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002277case 111:
Lev Walkind370e9f2006-03-16 10:03:35 +00002278#line 1144 "asn1p_y.y"
Lev Walkinef625402005-09-05 05:17:57 +00002279{
2280 yyval.a_int = asn1p_as_pointer ? EM_INDIRECT : 0;
2281 asn1p_as_pointer = 0;
2282 ;
Lev Walkin4696c742005-08-22 12:23:54 +00002283 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002284case 112:
Lev Walkind370e9f2006-03-16 10:03:35 +00002285#line 1151 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002286{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002287 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinef625402005-09-05 05:17:57 +00002288 yyval.a_expr->marker.flags |= yyvsp[-1].a_int;
2289
2290 if((yyval.a_expr->marker.flags & EM_INDIRECT)
2291 && (yyval.a_expr->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
2292 fprintf(stderr,
2293 "INFO: Directive <ASN1C:RepresentAsPointer> "
2294 "applied to %s at line %d\n",
2295 ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type)
2296 ? ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type)
2297 : "member",
2298 yyval.a_expr->_lineno
2299 );
2300 }
Lev Walkin1004aa92004-09-08 00:28:11 +00002301 ;
2302 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002303case 113:
Lev Walkind370e9f2006-03-16 10:03:35 +00002304#line 1170 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002305{
Lev Walkin4696c742005-08-22 12:23:54 +00002306 yyval.a_expr = yyvsp[0].a_expr;
2307 ;
2308 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002309case 114:
Lev Walkind370e9f2006-03-16 10:03:35 +00002310#line 1173 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00002311{
Lev Walkinef625402005-09-05 05:17:57 +00002312 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkinc7d939d2005-03-20 11:12:40 +00002313 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2314 yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
Lev Walkinf15320b2004-06-03 03:38:44 +00002315 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002316 ;
2317 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002318case 115:
Lev Walkind370e9f2006-03-16 10:03:35 +00002319#line 1179 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002320{
Lev Walkinef625402005-09-05 05:17:57 +00002321 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkin070a52d2004-08-22 03:19:54 +00002322 assert(yyval.a_expr->expr_type == A1TC_INVALID);
Lev Walkinc7d939d2005-03-20 11:12:40 +00002323 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
Lev Walkin070a52d2004-08-22 03:19:54 +00002324 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002325 ;
2326 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002327case 116:
Lev Walkind370e9f2006-03-16 10:03:35 +00002328#line 1185 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002329{
Lev Walkinef625402005-09-05 05:17:57 +00002330 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkin070a52d2004-08-22 03:19:54 +00002331 assert(yyval.a_expr->expr_type == A1TC_INVALID);
Lev Walkinc7d939d2005-03-20 11:12:40 +00002332 yyval.a_expr->expr_type = ASN_CONSTR_SET;
Lev Walkin070a52d2004-08-22 03:19:54 +00002333 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002334 ;
2335 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002336case 117:
Lev Walkind370e9f2006-03-16 10:03:35 +00002337#line 1191 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002338{
Lev Walkinceb20e72004-09-05 10:40:41 +00002339 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002340 checkmem(yyval.a_expr);
Lev Walkin83cac2f2004-09-22 16:03:36 +00002341 yyval.a_expr->constraints = yyvsp[-4].a_constr;
Lev Walkin070a52d2004-08-22 03:19:54 +00002342 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
2343 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin83cac2f2004-09-22 16:03:36 +00002344 yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
Lev Walkinec208e62004-09-14 02:44:07 +00002345 yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
Lev Walkin1004aa92004-09-08 00:28:11 +00002346 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2347 ;
2348 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002349case 118:
Lev Walkind370e9f2006-03-16 10:03:35 +00002350#line 1201 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002351{
Lev Walkinceb20e72004-09-05 10:40:41 +00002352 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002353 checkmem(yyval.a_expr);
Lev Walkin83cac2f2004-09-22 16:03:36 +00002354 yyval.a_expr->constraints = yyvsp[-4].a_constr;
Lev Walkin070a52d2004-08-22 03:19:54 +00002355 yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
2356 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin83cac2f2004-09-22 16:03:36 +00002357 yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
Lev Walkinec208e62004-09-14 02:44:07 +00002358 yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
Lev Walkin1004aa92004-09-08 00:28:11 +00002359 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2360 ;
2361 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002362case 119:
Lev Walkind370e9f2006-03-16 10:03:35 +00002363#line 1211 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002364{
Lev Walkinceb20e72004-09-05 10:40:41 +00002365 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002366 checkmem(yyval.a_expr);
Lev Walkin609ccbb2004-09-04 04:49:21 +00002367 yyval.a_expr->expr_type = ASN_TYPE_ANY;
Lev Walkin070a52d2004-08-22 03:19:54 +00002368 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002369 ;
2370 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002371case 120:
Lev Walkind370e9f2006-03-16 10:03:35 +00002372#line 1217 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002373{
Lev Walkin070a52d2004-08-22 03:19:54 +00002374 int ret;
Lev Walkinceb20e72004-09-05 10:40:41 +00002375 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002376 checkmem(yyval.a_expr);
2377 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2378 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2379 yyvsp[0].tv_str, RLT_lowercase);
2380 checkmem(ret == 0);
Lev Walkin609ccbb2004-09-04 04:49:21 +00002381 yyval.a_expr->expr_type = ASN_TYPE_ANY;
Lev Walkin070a52d2004-08-22 03:19:54 +00002382 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002383 ;
2384 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002385case 121:
Lev Walkind370e9f2006-03-16 10:03:35 +00002386#line 1231 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002387{
Lev Walkinf15320b2004-06-03 03:38:44 +00002388 int ret;
2389 yyval.a_expr = yyvsp[-1].a_expr;
2390 assert(yyval.a_expr->expr_type == 0);
2391 assert(yyval.a_expr->meta_type == 0);
2392 assert(yyval.a_expr->reference == 0);
2393 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2394 checkmem(yyval.a_expr->reference);
2395 ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN);
2396 checkmem(ret == 0);
2397 free(yyvsp[-3].tv_str);
2398 yyval.a_expr->expr_type = A1TC_PARAMETRIZED;
2399 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002400 ;
2401 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002402case 122:
Lev Walkind370e9f2006-03-16 10:03:35 +00002403#line 1255 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002404{
Lev Walkinf15320b2004-06-03 03:38:44 +00002405 yyval.a_expr = asn1p_expr_new(yylineno);
2406 checkmem(yyval.a_expr);
2407 yyval.a_expr->reference = yyvsp[0].a_ref;
2408 yyval.a_expr->expr_type = A1TC_REFERENCE;
2409 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkin1004aa92004-09-08 00:28:11 +00002410 ;
2411 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002412case 123:
Lev Walkind370e9f2006-03-16 10:03:35 +00002413#line 1262 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002414{
Lev Walkinf15320b2004-06-03 03:38:44 +00002415 yyval.a_expr = asn1p_expr_new(yylineno);
2416 checkmem(yyval.a_expr);
2417 yyval.a_expr->reference = yyvsp[0].a_ref;
2418 yyval.a_expr->expr_type = A1TC_INSTANCE;
2419 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002420 ;
2421 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002422case 124:
Lev Walkind370e9f2006-03-16 10:03:35 +00002423#line 1277 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002424{
Lev Walkinf15320b2004-06-03 03:38:44 +00002425 int ret;
2426 yyval.a_ref = asn1p_ref_new(yylineno);
2427 checkmem(yyval.a_ref);
2428 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2429 checkmem(ret == 0);
2430 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00002431 ;
2432 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002433case 125:
Lev Walkind370e9f2006-03-16 10:03:35 +00002434#line 1285 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002435{
2436 int ret;
2437 yyval.a_ref = asn1p_ref_new(yylineno);
2438 checkmem(yyval.a_ref);
2439 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2440 checkmem(ret == 0);
2441 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2442 checkmem(ret == 0);
2443 free(yyvsp[-2].tv_str);
2444 ;
2445 break;}
2446case 126:
Lev Walkind370e9f2006-03-16 10:03:35 +00002447#line 1295 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002448{
2449 int ret;
2450 yyval.a_ref = asn1p_ref_new(yylineno);
2451 checkmem(yyval.a_ref);
2452 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2453 checkmem(ret == 0);
2454 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2455 checkmem(ret == 0);
2456 free(yyvsp[-2].tv_str);
2457 ;
2458 break;}
2459case 127:
Lev Walkind370e9f2006-03-16 10:03:35 +00002460#line 1305 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002461{
Lev Walkinf15320b2004-06-03 03:38:44 +00002462 int ret;
2463 yyval.a_ref = asn1p_ref_new(yylineno);
2464 checkmem(yyval.a_ref);
Lev Walkin9c974182004-09-15 11:59:51 +00002465 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2466 checkmem(ret == 0);
2467 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
2468 checkmem(ret == 0);
2469 free(yyvsp[-2].tv_str);
2470 ;
2471 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002472case 128:
Lev Walkind370e9f2006-03-16 10:03:35 +00002473#line 1315 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002474{
2475 int ret;
2476 yyval.a_ref = asn1p_ref_new(yylineno);
2477 checkmem(yyval.a_ref);
Lev Walkinf15320b2004-06-03 03:38:44 +00002478 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
2479 free(yyvsp[0].tv_str);
2480 checkmem(ret == 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002481 ;
2482 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002483case 129:
Lev Walkind370e9f2006-03-16 10:03:35 +00002484#line 1323 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002485{
Lev Walkinf15320b2004-06-03 03:38:44 +00002486 int ret;
2487 yyval.a_ref = yyvsp[0].a_ref;
2488 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
2489 free(yyvsp[-2].tv_str);
2490 checkmem(ret == 0);
2491 /*
2492 * Move the last element infront.
2493 */
2494 {
2495 struct asn1p_ref_component_s tmp_comp;
2496 tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
2497 memmove(&yyval.a_ref->components[1],
2498 &yyval.a_ref->components[0],
2499 sizeof(yyval.a_ref->components[0])
2500 * (yyval.a_ref->comp_count - 1));
2501 yyval.a_ref->components[0] = tmp_comp;
2502 }
Lev Walkin1004aa92004-09-08 00:28:11 +00002503 ;
2504 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002505case 130:
Lev Walkind370e9f2006-03-16 10:03:35 +00002506#line 1345 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002507{
Lev Walkinf15320b2004-06-03 03:38:44 +00002508 int ret;
2509 yyval.a_ref = asn1p_ref_new(yylineno);
2510 checkmem(yyval.a_ref);
2511 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2512 free(yyvsp[0].a_refcomp.name);
2513 checkmem(ret == 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002514 ;
2515 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00002516case 131:
Lev Walkind370e9f2006-03-16 10:03:35 +00002517#line 1353 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002518{
Lev Walkinf15320b2004-06-03 03:38:44 +00002519 int ret;
2520 yyval.a_ref = yyvsp[-2].a_ref;
2521 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2522 free(yyvsp[0].a_refcomp.name);
2523 checkmem(ret == 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002524 ;
2525 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002526case 133:
2527#line 1366 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002528{
Lev Walkinf15320b2004-06-03 03:38:44 +00002529 yyval.a_refcomp.lex_type = RLT_AmpUppercase;
2530 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00002531 ;
2532 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002533case 134:
2534#line 1371 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002535{
Lev Walkinf15320b2004-06-03 03:38:44 +00002536 yyval.a_refcomp.lex_type = RLT_Amplowercase;
2537 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00002538 ;
2539 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002540case 135:
2541#line 1380 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002542{
2543 yyval.a_ref = asn1p_ref_new(yylineno);
2544 asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase);
2545 ;
2546 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002547case 136:
2548#line 1384 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002549{
2550 yyval.a_ref = yyval.a_ref;
2551 asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase);
2552 ;
2553 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002554case 137:
2555#line 1388 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002556{
2557 yyval.a_ref = yyval.a_ref;
2558 asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_Amplowercase);
2559 ;
2560 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002561case 138:
2562#line 1395 "asn1p_y.y"
Lev Walkin9c2285a2006-03-09 08:49:26 +00002563{
2564 yyval.a_ref = asn1p_ref_new(yylineno);
2565 asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
2566 ;
2567 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002568case 139:
2569#line 1415 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002570{
Lev Walkinf15320b2004-06-03 03:38:44 +00002571 yyval.a_expr = yyvsp[-2].a_expr;
2572 assert(yyval.a_expr->Identifier == NULL);
2573 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
2574 yyval.a_expr->meta_type = AMT_VALUE;
2575 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkin1004aa92004-09-08 00:28:11 +00002576 ;
2577 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002578case 140:
2579#line 1425 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002580{
2581 yyval.a_value = asn1p_value_fromint(0);
2582 checkmem(yyval.a_value);
2583 yyval.a_value->type = ATV_CHOICE_IDENTIFIER;
2584 yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str;
2585 yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value;
2586 ;
2587 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002588case 141:
2589#line 1432 "asn1p_y.y"
Lev Walkincbad2512005-03-24 16:27:02 +00002590{ asn1p_lexer_hack_push_opaque_state(); ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002591 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002592case 142:
2593#line 1432 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002594{
Lev Walkinf15320b2004-06-03 03:38:44 +00002595 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2596 checkmem(yyval.a_value);
2597 yyval.a_value->type = ATV_UNPARSED;
Lev Walkin1004aa92004-09-08 00:28:11 +00002598 ;
2599 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002600case 143:
2601#line 1437 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002602{
2603 yyval.a_value = asn1p_value_fromint(0);
2604 checkmem(yyval.a_value);
2605 yyval.a_value->type = ATV_NULL;
2606 ;
2607 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002608case 144:
2609#line 1442 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002610{
2611 yyval.a_value = asn1p_value_fromint(0);
2612 checkmem(yyval.a_value);
2613 yyval.a_value->type = ATV_FALSE;
2614 ;
2615 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002616case 145:
2617#line 1447 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002618{
2619 yyval.a_value = asn1p_value_fromint(0);
2620 checkmem(yyval.a_value);
2621 yyval.a_value->type = ATV_TRUE;
2622 ;
2623 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002624case 146:
2625#line 1452 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002626{
Lev Walkinf15320b2004-06-03 03:38:44 +00002627 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
2628 checkmem(yyval.a_value);
Lev Walkin1004aa92004-09-08 00:28:11 +00002629 ;
2630 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002631case 147:
2632#line 1456 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002633{
Lev Walkinf15320b2004-06-03 03:38:44 +00002634 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
2635 checkmem(yyval.a_value);
Lev Walkin1004aa92004-09-08 00:28:11 +00002636 ;
2637 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002638case 148:
2639#line 1460 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002640{
Lev Walkin1e448d32005-03-24 14:26:38 +00002641 yyval.a_value = yyval.a_value;
Lev Walkin1004aa92004-09-08 00:28:11 +00002642 ;
2643 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002644case 149:
2645#line 1463 "asn1p_y.y"
2646{
2647 yyval.a_value = yyvsp[0].a_value;
2648 ;
2649 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00002650case 150:
Lev Walkind370e9f2006-03-16 10:03:35 +00002651#line 1466 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002652{
2653 yyval.a_value = yyvsp[0].a_value;
2654 ;
2655 break;}
2656case 151:
Lev Walkind370e9f2006-03-16 10:03:35 +00002657#line 1472 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00002658{
Lev Walkinf15320b2004-06-03 03:38:44 +00002659 asn1p_ref_t *ref;
2660 int ret;
2661 ref = asn1p_ref_new(yylineno);
2662 checkmem(ref);
2663 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2664 checkmem(ret == 0);
2665 yyval.a_value = asn1p_value_fromref(ref, 0);
2666 checkmem(yyval.a_value);
2667 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00002668 ;
2669 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002670case 152:
2671#line 1483 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002672{
Lev Walkinf15320b2004-06-03 03:38:44 +00002673 asn1p_ref_t *ref;
2674 int ret;
2675 ref = asn1p_ref_new(yylineno);
2676 checkmem(ref);
2677 ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2678 checkmem(ret == 0);
2679 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2680 checkmem(ret == 0);
2681 yyval.a_value = asn1p_value_fromref(ref, 0);
2682 checkmem(yyval.a_value);
2683 free(yyvsp[-2].tv_str);
2684 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00002685 ;
2686 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002687case 153:
2688#line 1501 "asn1p_y.y"
Lev Walkin1e448d32005-03-24 14:26:38 +00002689{
2690 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2691 checkmem(yyval.a_value);
2692 ;
2693 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002694case 154:
2695#line 1505 "asn1p_y.y"
Lev Walkin1e448d32005-03-24 14:26:38 +00002696{
Lev Walkind9574ae2005-03-24 16:22:35 +00002697 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
Lev Walkin1e448d32005-03-24 14:26:38 +00002698 checkmem(yyval.a_value);
2699 yyval.a_value->type = ATV_TUPLE;
2700 ;
2701 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002702case 155:
2703#line 1510 "asn1p_y.y"
Lev Walkin1e448d32005-03-24 14:26:38 +00002704{
Lev Walkind9574ae2005-03-24 16:22:35 +00002705 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
Lev Walkin1e448d32005-03-24 14:26:38 +00002706 checkmem(yyval.a_value);
2707 yyval.a_value->type = ATV_QUADRUPLE;
2708 ;
2709 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002710case 156:
2711#line 1544 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002712{
Lev Walkin1893ddf2005-03-20 14:28:32 +00002713 yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00002714 yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
2715 checkmem(yyval.tv_opaque.buf);
2716 yyval.tv_opaque.buf[0] = '{';
Lev Walkin1893ddf2005-03-20 14:28:32 +00002717 memcpy(yyval.tv_opaque.buf + 1, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
Lev Walkinf15320b2004-06-03 03:38:44 +00002718 yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
2719 free(yyvsp[0].tv_opaque.buf);
Lev Walkin1004aa92004-09-08 00:28:11 +00002720 ;
2721 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002722case 157:
2723#line 1553 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002724{
Lev Walkinf15320b2004-06-03 03:38:44 +00002725 int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
2726 char *p = malloc(newsize + 1);
2727 checkmem(p);
2728 memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
2729 memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2730 p[newsize] = '\0';
2731 free(yyvsp[-1].tv_opaque.buf);
2732 free(yyvsp[0].tv_opaque.buf);
2733 yyval.tv_opaque.buf = p;
2734 yyval.tv_opaque.len = newsize;
Lev Walkin1004aa92004-09-08 00:28:11 +00002735 ;
2736 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002737case 158:
2738#line 1568 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002739{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
2740 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002741case 159:
2742#line 1569 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002743{ yyval.a_type = ASN_BASIC_NULL; ;
2744 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002745case 160:
2746#line 1570 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002747{ yyval.a_type = ASN_BASIC_REAL; ;
2748 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002749case 161:
2750#line 1571 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002751{ yyval.a_type = yyvsp[0].a_type; ;
Lev Walkin4696c742005-08-22 12:23:54 +00002752 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002753case 162:
2754#line 1572 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002755{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
Lev Walkin4696c742005-08-22 12:23:54 +00002756 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002757case 163:
2758#line 1573 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002759{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
Lev Walkin4696c742005-08-22 12:23:54 +00002760 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002761case 164:
2762#line 1574 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002763{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002764 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002765case 165:
2766#line 1575 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002767{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002768 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002769case 166:
2770#line 1576 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002771{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002772 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002773case 167:
2774#line 1577 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002775{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002776 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002777case 168:
2778#line 1578 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002779{ yyval.a_type = ASN_BASIC_UTCTime; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002780 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002781case 169:
2782#line 1579 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002783{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002784 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002785case 170:
2786#line 1580 "asn1p_y.y"
2787{ yyval.a_type = yyvsp[0].a_type; ;
2788 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00002789case 171:
Lev Walkin57074f12006-03-16 05:11:14 +00002790#line 1587 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002791{ yyval.a_type = ASN_BASIC_INTEGER; ;
Lev Walkin9c2285a2006-03-09 08:49:26 +00002792 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002793case 172:
2794#line 1588 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002795{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
2796 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002797case 173:
2798#line 1589 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00002799{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
2800 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002801case 174:
2802#line 1593 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002803{
Lev Walkinceb20e72004-09-05 10:40:41 +00002804 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002805 checkmem(yyval.a_expr);
2806 yyval.a_expr->expr_type = yyvsp[0].a_type;
2807 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002808 ;
2809 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002810case 175:
2811#line 1599 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002812{
Lev Walkinf15320b2004-06-03 03:38:44 +00002813 if(yyvsp[0].a_expr) {
2814 yyval.a_expr = yyvsp[0].a_expr;
2815 } else {
Lev Walkinceb20e72004-09-05 10:40:41 +00002816 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002817 checkmem(yyval.a_expr);
2818 }
2819 yyval.a_expr->expr_type = yyvsp[-1].a_type;
2820 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkin1004aa92004-09-08 00:28:11 +00002821 ;
2822 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002823case 176:
2824#line 1612 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002825{ yyval.a_type = ASN_STRING_BMPString; ;
2826 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002827case 177:
2828#line 1613 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002829{
Lev Walkinf15320b2004-06-03 03:38:44 +00002830 yyval.a_type = ASN_STRING_GeneralString;
Lev Walkin9c974182004-09-15 11:59:51 +00002831 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
Lev Walkin1004aa92004-09-08 00:28:11 +00002832 ;
2833 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002834case 178:
2835#line 1617 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002836{
Lev Walkin9c974182004-09-15 11:59:51 +00002837 yyval.a_type = ASN_STRING_GraphicString;
2838 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
Lev Walkin1004aa92004-09-08 00:28:11 +00002839 ;
2840 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002841case 179:
2842#line 1621 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002843{ yyval.a_type = ASN_STRING_IA5String; ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002844 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002845case 180:
2846#line 1622 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002847{ yyval.a_type = ASN_STRING_ISO646String; ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002848 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002849case 181:
2850#line 1623 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002851{ yyval.a_type = ASN_STRING_NumericString; ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002852 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002853case 182:
2854#line 1624 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002855{ yyval.a_type = ASN_STRING_PrintableString; ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002856 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002857case 183:
2858#line 1625 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002859{
2860 yyval.a_type = ASN_STRING_T61String;
2861 fprintf(stderr, "WARNING: T61String is not fully supported\n");
2862 ;
Lev Walkin1004aa92004-09-08 00:28:11 +00002863 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002864case 184:
2865#line 1629 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002866{ yyval.a_type = ASN_STRING_TeletexString; ;
2867 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002868case 185:
2869#line 1630 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002870{ yyval.a_type = ASN_STRING_UniversalString; ;
2871 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002872case 186:
2873#line 1631 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002874{ yyval.a_type = ASN_STRING_UTF8String; ;
2875 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002876case 187:
2877#line 1632 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002878{
2879 yyval.a_type = ASN_STRING_VideotexString;
2880 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
2881 ;
2882 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002883case 188:
2884#line 1636 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00002885{ yyval.a_type = ASN_STRING_VisibleString; ;
2886 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002887case 189:
2888#line 1637 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002889{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
2890 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002891case 195:
2892#line 1649 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002893{ yyval.a_constr = 0; ;
2894 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002895case 196:
2896#line 1650 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002897{
Lev Walkinceb20e72004-09-05 10:40:41 +00002898 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002899 ;
2900 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002901case 197:
2902#line 1656 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002903{
Lev Walkinceb20e72004-09-05 10:40:41 +00002904 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002905 ;
2906 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002907case 198:
2908#line 1659 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002909{
Lev Walkinf15320b2004-06-03 03:38:44 +00002910 /*
2911 * This is a special case, for compatibility purposes.
Lev Walkinf59d0752004-08-18 04:59:12 +00002912 * It goes without parentheses.
Lev Walkinf15320b2004-06-03 03:38:44 +00002913 */
Lev Walkind2ea1de2004-08-20 13:25:29 +00002914 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002915 ;
2916 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002917case 199:
2918#line 1669 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002919{
Lev Walkinf15320b2004-06-03 03:38:44 +00002920 yyval.a_constr = yyvsp[-1].a_constr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002921 ;
2922 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002923case 200:
2924#line 1672 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002925{
Lev Walkinf59d0752004-08-18 04:59:12 +00002926 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002927 ;
2928 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002929case 201:
2930#line 1678 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002931{
Lev Walkinf15320b2004-06-03 03:38:44 +00002932 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002933 ;
2934 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002935case 202:
2936#line 1681 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002937{
Lev Walkinf15320b2004-06-03 03:38:44 +00002938 asn1p_constraint_t *ct;
2939 ct = asn1p_constraint_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002940 ct->type = ACT_EL_EXT;
2941 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkin1004aa92004-09-08 00:28:11 +00002942 ;
2943 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002944case 203:
2945#line 1687 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002946{
Lev Walkinf15320b2004-06-03 03:38:44 +00002947 asn1p_constraint_t *ct;
2948 ct = asn1p_constraint_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002949 ct->type = ACT_EL_EXT;
2950 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002951 ct = yyval.a_constr;
2952 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002953 ;
2954 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002955case 204:
2956#line 1698 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002957{
Lev Walkinf59d0752004-08-18 04:59:12 +00002958 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkin1004aa92004-09-08 00:28:11 +00002959 ;
2960 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002961case 205:
2962#line 1701 "asn1p_y.y"
Lev Walkin1e448d32005-03-24 14:26:38 +00002963{
2964 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_AEX, yyvsp[0].a_constr, 0);
2965 ;
2966 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002967case 206:
2968#line 1704 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002969{
Lev Walkinf15320b2004-06-03 03:38:44 +00002970 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002971 ;
2972 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002973case 207:
2974#line 1707 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002975{
Lev Walkinf15320b2004-06-03 03:38:44 +00002976 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002977 ;
2978 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002979case 208:
2980#line 1710 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002981{
Lev Walkinf15320b2004-06-03 03:38:44 +00002982 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00002983 ;
2984 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002985case 209:
2986#line 1716 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002987{
Lev Walkinf15320b2004-06-03 03:38:44 +00002988 int ret;
2989 yyval.a_constr = asn1p_constraint_new(yylineno);
2990 checkmem(yyval.a_constr);
2991 yyval.a_constr->type = yyvsp[-3].a_ctype;
2992 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2993 checkmem(ret == 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00002994 ;
2995 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00002996case 210:
2997#line 1724 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00002998{
Lev Walkinf59d0752004-08-18 04:59:12 +00002999 int ret;
3000 yyval.a_constr = asn1p_constraint_new(yylineno);
3001 checkmem(yyval.a_constr);
3002 yyval.a_constr->type = ACT_CA_SET;
3003 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
3004 checkmem(ret == 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00003005 ;
3006 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003007case 211:
3008#line 1732 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003009{
Lev Walkinf59d0752004-08-18 04:59:12 +00003010 yyval.a_constr = asn1p_constraint_new(yylineno);
3011 checkmem(yyval.a_constr);
3012 yyval.a_constr->type = ACT_EL_VALUE;
3013 yyval.a_constr->value = yyvsp[0].a_value;
Lev Walkin1004aa92004-09-08 00:28:11 +00003014 ;
3015 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003016case 212:
3017#line 1738 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00003018{
Lev Walkin144db9b2004-10-12 23:26:53 +00003019 yyval.a_constr = asn1p_constraint_new(yylineno);
3020 checkmem(yyval.a_constr);
Lev Walkinff7dd142005-03-20 12:58:00 +00003021 yyval.a_constr->type = ACT_EL_TYPE;
3022 yyval.a_constr->containedSubtype = yyvsp[0].a_value;
Lev Walkin9c974182004-09-15 11:59:51 +00003023 ;
3024 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003025case 213:
3026#line 1744 "asn1p_y.y"
3027{
3028 yyval.a_constr = asn1p_constraint_new(yylineno);
3029 checkmem(yyval.a_constr);
3030 yyval.a_constr->type = yyvsp[-1].a_ctype;
3031 yyval.a_constr->range_start = yyvsp[-2].a_value;
3032 yyval.a_constr->range_stop = yyvsp[0].a_value;
3033 ;
3034 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00003035case 214:
Lev Walkin57074f12006-03-16 05:11:14 +00003036#line 1751 "asn1p_y.y"
Lev Walkinef625402005-09-05 05:17:57 +00003037{
3038 yyval.a_constr = asn1p_constraint_new(yylineno);
3039 checkmem(yyval.a_constr);
3040 yyval.a_constr->type = yyvsp[-1].a_ctype;
3041 yyval.a_constr->range_start = asn1p_value_fromint(-123);
3042 yyval.a_constr->range_stop = yyvsp[0].a_value;
3043 yyval.a_constr->range_start->type = ATV_MIN;
3044 ;
3045 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003046case 215:
3047#line 1759 "asn1p_y.y"
Lev Walkinef625402005-09-05 05:17:57 +00003048{
3049 yyval.a_constr = asn1p_constraint_new(yylineno);
3050 checkmem(yyval.a_constr);
3051 yyval.a_constr->type = yyvsp[-1].a_ctype;
3052 yyval.a_constr->range_start = yyvsp[-2].a_value;
3053 yyval.a_constr->range_stop = asn1p_value_fromint(321);
3054 yyval.a_constr->range_stop->type = ATV_MAX;
3055 ;
3056 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003057case 216:
3058#line 1767 "asn1p_y.y"
3059{
3060 yyval.a_constr = asn1p_constraint_new(yylineno);
3061 checkmem(yyval.a_constr);
3062 yyval.a_constr->type = yyvsp[-1].a_ctype;
3063 yyval.a_constr->range_start = asn1p_value_fromint(-123);
3064 yyval.a_constr->range_stop = asn1p_value_fromint(321);
3065 yyval.a_constr->range_start->type = ATV_MIN;
3066 yyval.a_constr->range_stop->type = ATV_MAX;
3067 ;
3068 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00003069case 217:
Lev Walkind370e9f2006-03-16 10:03:35 +00003070#line 1776 "asn1p_y.y"
Lev Walkin1db91132006-03-09 09:11:53 +00003071{
Lev Walkind370e9f2006-03-16 10:03:35 +00003072 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkin1db91132006-03-09 09:11:53 +00003073 ;
3074 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003075case 218:
Lev Walkind370e9f2006-03-16 10:03:35 +00003076#line 1779 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003077{
3078 yyval.a_constr = yyvsp[0].a_constr;
3079 ;
Lev Walkin4696c742005-08-22 12:23:54 +00003080 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00003081case 219:
Lev Walkind370e9f2006-03-16 10:03:35 +00003082#line 1783 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003083{ asn1p_lexer_hack_push_opaque_state(); ;
3084 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003085case 220:
3086#line 1783 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003087{
3088 yyval.a_constr = asn1p_constraint_new(yylineno);
3089 checkmem(yyval.a_constr);
3090 yyval.a_constr->type = ACT_CT_CTDBY;
3091 yyval.a_constr->value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
3092 checkmem(yyval.a_constr->value);
3093 yyval.a_constr->value->type = ATV_UNPARSED;
3094 ;
Lev Walkin144db9b2004-10-12 23:26:53 +00003095 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003096case 221:
3097#line 1794 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003098{ yyval.a_ctype = ACT_EL_RANGE; ;
Lev Walkinc8092cb2005-02-18 16:34:21 +00003099 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003100case 222:
3101#line 1795 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003102{ yyval.a_ctype = ACT_EL_RLRANGE; ;
Lev Walkinff7dd142005-03-20 12:58:00 +00003103 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003104case 223:
3105#line 1796 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003106{ yyval.a_ctype = ACT_EL_LLRANGE; ;
3107 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003108case 224:
3109#line 1797 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003110{ yyval.a_ctype = ACT_EL_ULRANGE; ;
3111 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003112case 225:
3113#line 1801 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003114{
Lev Walkinceb20e72004-09-05 10:40:41 +00003115 yyval.a_ctype = ACT_CT_SIZE;
Lev Walkin1004aa92004-09-08 00:28:11 +00003116 ;
3117 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003118case 226:
3119#line 1804 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003120{
Lev Walkinceb20e72004-09-05 10:40:41 +00003121 yyval.a_ctype = ACT_CT_FROM;
Lev Walkin1004aa92004-09-08 00:28:11 +00003122 ;
3123 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003124case 227:
3125#line 1810 "asn1p_y.y"
Lev Walkinc8092cb2005-02-18 16:34:21 +00003126{
3127 yyval.a_value = asn1p_value_fromint(0);
3128 checkmem(yyval.a_value);
3129 yyval.a_value->type = ATV_FALSE;
3130 ;
3131 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003132case 228:
3133#line 1815 "asn1p_y.y"
Lev Walkinc8092cb2005-02-18 16:34:21 +00003134{
3135 yyval.a_value = asn1p_value_fromint(1);
3136 checkmem(yyval.a_value);
3137 yyval.a_value->type = ATV_TRUE;
3138 ;
3139 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003140case 229:
3141#line 1820 "asn1p_y.y"
3142{
3143 yyval.a_value = yyvsp[0].a_value;
3144 ;
3145 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003146case 230:
Lev Walkind370e9f2006-03-16 10:03:35 +00003147#line 1823 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003148{
3149 yyval.a_value = yyvsp[0].a_value;
3150 ;
3151 break;}
3152case 231:
Lev Walkind370e9f2006-03-16 10:03:35 +00003153#line 1826 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003154{
Lev Walkinf15320b2004-06-03 03:38:44 +00003155 asn1p_ref_t *ref;
3156 int ret;
3157 ref = asn1p_ref_new(yylineno);
3158 checkmem(ref);
3159 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
3160 checkmem(ret == 0);
3161 yyval.a_value = asn1p_value_fromref(ref, 0);
3162 checkmem(yyval.a_value);
3163 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00003164 ;
3165 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003166case 232:
3167#line 1840 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003168{
Lev Walkinc8092cb2005-02-18 16:34:21 +00003169 asn1p_ref_t *ref;
3170 int ret;
3171 ref = asn1p_ref_new(yylineno);
3172 checkmem(ref);
3173 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_UNKNOWN);
3174 checkmem(ret == 0);
3175 yyval.a_value = asn1p_value_fromref(ref, 0);
Lev Walkinf15320b2004-06-03 03:38:44 +00003176 checkmem(yyval.a_value);
Lev Walkinc8092cb2005-02-18 16:34:21 +00003177 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00003178 ;
3179 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003180case 233:
3181#line 1854 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003182{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003183 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMP, yyvsp[0].a_constr, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00003184 ;
3185 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003186case 234:
3187#line 1857 "asn1p_y.y"
Lev Walkine596bf02005-03-28 15:01:27 +00003188{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003189 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
Lev Walkine596bf02005-03-28 15:01:27 +00003190 ;
3191 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003192case 235:
3193#line 1863 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003194{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003195 yyval.a_constr = yyvsp[0].a_constr;
3196 ;
3197 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003198case 236:
3199#line 1866 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003200{
3201 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
3202 ;
3203 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003204case 237:
3205#line 1872 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003206{
Lev Walkinf15320b2004-06-03 03:38:44 +00003207 yyval.a_constr = asn1p_constraint_new(yylineno);
3208 checkmem(yyval.a_constr);
3209 yyval.a_constr->type = ACT_EL_EXT;
Lev Walkine596bf02005-03-28 15:01:27 +00003210 yyval.a_constr->value = asn1p_value_frombuf("...", 3, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00003211 ;
3212 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003213case 238:
3214#line 1878 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003215{
Lev Walkinf15320b2004-06-03 03:38:44 +00003216 yyval.a_constr = asn1p_constraint_new(yylineno);
3217 checkmem(yyval.a_constr);
3218 yyval.a_constr->type = ACT_EL_VALUE;
3219 yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
3220 yyval.a_constr->presence = yyvsp[0].a_pres;
Lev Walkine596bf02005-03-28 15:01:27 +00003221 if(yyvsp[-1].a_constr) asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00003222 ;
3223 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003224case 239:
3225#line 1892 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003226{ yyval.a_pres = ACPRES_DEFAULT; ;
3227 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003228case 240:
3229#line 1893 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003230{ yyval.a_pres = yyvsp[0].a_pres; ;
3231 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003232case 241:
3233#line 1897 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003234{
Lev Walkinf15320b2004-06-03 03:38:44 +00003235 yyval.a_pres = ACPRES_PRESENT;
Lev Walkin1004aa92004-09-08 00:28:11 +00003236 ;
3237 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003238case 242:
3239#line 1900 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00003240{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003241 yyval.a_pres = ACPRES_ABSENT;
Lev Walkinb36317c2005-08-12 10:09:10 +00003242 ;
3243 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003244case 243:
3245#line 1903 "asn1p_y.y"
Lev Walkinb36317c2005-08-12 10:09:10 +00003246{
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003247 yyval.a_pres = ACPRES_OPTIONAL;
Lev Walkinb36317c2005-08-12 10:09:10 +00003248 ;
3249 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003250case 244:
3251#line 1909 "asn1p_y.y"
3252{
3253 yyval.a_constr = yyvsp[0].a_constr;
3254 ;
3255 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003256case 245:
Lev Walkind370e9f2006-03-16 10:03:35 +00003257#line 1912 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003258{
3259 yyval.a_constr = yyvsp[0].a_constr;
3260 ;
3261 break;}
3262case 246:
Lev Walkind370e9f2006-03-16 10:03:35 +00003263#line 1921 "asn1p_y.y"
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003264{
Lev Walkinf15320b2004-06-03 03:38:44 +00003265 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
3266 asn1p_constraint_t *ct;
3267 int ret;
3268 ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
3269 checkmem(ret == 0);
3270 ct = asn1p_constraint_new(yylineno);
3271 checkmem(yyval.a_constr);
3272 ct->type = ACT_EL_VALUE;
3273 ct->value = asn1p_value_fromref(ref, 0);
3274 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00003275 ;
3276 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003277case 247:
3278#line 1936 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003279{
Lev Walkinf15320b2004-06-03 03:38:44 +00003280 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
Lev Walkin1004aa92004-09-08 00:28:11 +00003281 ;
3282 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003283case 248:
3284#line 1942 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003285{
Lev Walkinf15320b2004-06-03 03:38:44 +00003286 yyval.a_constr = asn1p_constraint_new(yylineno);
3287 checkmem(yyval.a_constr);
3288 yyval.a_constr->type = ACT_EL_VALUE;
3289 yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
Lev Walkin1004aa92004-09-08 00:28:11 +00003290 ;
3291 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003292case 249:
3293#line 1948 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003294{
Lev Walkinf15320b2004-06-03 03:38:44 +00003295 asn1p_constraint_t *ct;
3296 ct = asn1p_constraint_new(yylineno);
3297 checkmem(ct);
3298 ct->type = ACT_EL_VALUE;
3299 ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
3300 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkin1004aa92004-09-08 00:28:11 +00003301 ;
3302 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003303case 250:
3304#line 1962 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003305{
Lev Walkinf15320b2004-06-03 03:38:44 +00003306 char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
3307 int ret;
3308 *p = '@';
3309 strcpy(p + 1, yyvsp[0].tv_str);
3310 yyval.a_ref = asn1p_ref_new(yylineno);
3311 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3312 checkmem(ret == 0);
3313 free(p);
3314 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00003315 ;
3316 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003317case 251:
3318#line 1973 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003319{
Lev Walkinf15320b2004-06-03 03:38:44 +00003320 char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
3321 int ret;
3322 p[0] = '@';
3323 p[1] = '.';
3324 strcpy(p + 2, yyvsp[0].tv_str);
3325 yyval.a_ref = asn1p_ref_new(yylineno);
3326 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3327 checkmem(ret == 0);
3328 free(p);
3329 free(yyvsp[0].tv_str);
Lev Walkin1004aa92004-09-08 00:28:11 +00003330 ;
3331 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003332case 252:
3333#line 1989 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003334{
Lev Walkinf15320b2004-06-03 03:38:44 +00003335 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00003336 ;
3337 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003338case 253:
3339#line 1992 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003340{
Lev Walkinf15320b2004-06-03 03:38:44 +00003341 int l1 = strlen(yyvsp[-2].tv_str);
3342 int l3 = strlen(yyvsp[0].tv_str);
3343 yyval.tv_str = malloc(l1 + 1 + l3 + 1);
3344 memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
3345 yyval.tv_str[l1] = '.';
3346 memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
3347 yyval.tv_str[l1 + 1 + l3] = '\0';
Lev Walkin1004aa92004-09-08 00:28:11 +00003348 ;
3349 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003350case 254:
3351#line 2010 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003352{
Lev Walkin9c974182004-09-15 11:59:51 +00003353 yyval.a_marker.flags = EM_NOMARK;
3354 yyval.a_marker.default_value = 0;
Lev Walkin1004aa92004-09-08 00:28:11 +00003355 ;
3356 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003357case 255:
3358#line 2014 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00003359{ yyval.a_marker = yyvsp[0].a_marker; ;
Lev Walkinec208e62004-09-14 02:44:07 +00003360 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003361case 256:
3362#line 2018 "asn1p_y.y"
Lev Walkinec208e62004-09-14 02:44:07 +00003363{
Lev Walkin70853052005-11-26 11:21:55 +00003364 yyval.a_marker.flags = EM_OPTIONAL | EM_INDIRECT;
Lev Walkin9c974182004-09-15 11:59:51 +00003365 yyval.a_marker.default_value = 0;
Lev Walkinec208e62004-09-14 02:44:07 +00003366 ;
3367 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003368case 257:
3369#line 2022 "asn1p_y.y"
Lev Walkin9c974182004-09-15 11:59:51 +00003370{
3371 yyval.a_marker.flags = EM_DEFAULT;
3372 yyval.a_marker.default_value = yyvsp[0].a_value;
3373 ;
3374 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003375case 258:
3376#line 2045 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003377{
Lev Walkinceb20e72004-09-05 10:40:41 +00003378 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003379 checkmem(yyval.a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00003380 ;
3381 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003382case 259:
3383#line 2049 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003384{
Lev Walkine596bf02005-03-28 15:01:27 +00003385 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkin1004aa92004-09-08 00:28:11 +00003386 ;
3387 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003388case 260:
3389#line 2055 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003390{
Lev Walkine596bf02005-03-28 15:01:27 +00003391 yyval.a_expr = asn1p_expr_new(yylineno);
3392 checkmem(yyval.a_expr);
Lev Walkin1004aa92004-09-08 00:28:11 +00003393 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
3394 ;
3395 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003396case 261:
3397#line 2060 "asn1p_y.y"
3398{
3399 yyval.a_expr = yyvsp[-2].a_expr;
3400 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
3401 ;
3402 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00003403case 262:
Lev Walkin57074f12006-03-16 05:11:14 +00003404#line 2067 "asn1p_y.y"
Lev Walkine596bf02005-03-28 15:01:27 +00003405{
Lev Walkind370e9f2006-03-16 10:03:35 +00003406 yyval.a_expr = asn1p_expr_new(yylineno);
3407 checkmem(yyval.a_expr);
3408 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3409 yyval.a_expr->meta_type = AMT_VALUE;
3410 yyval.a_expr->Identifier = yyvsp[0].tv_str;
Lev Walkine596bf02005-03-28 15:01:27 +00003411 ;
3412 break;}
Lev Walkin9d542d22006-03-14 16:31:37 +00003413case 263:
Lev Walkin57074f12006-03-16 05:11:14 +00003414#line 2074 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003415{
Lev Walkinceb20e72004-09-05 10:40:41 +00003416 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003417 checkmem(yyval.a_expr);
3418 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3419 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkind370e9f2006-03-16 10:03:35 +00003420 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3421 yyval.a_expr->value = yyvsp[-1].a_value;
Lev Walkin1004aa92004-09-08 00:28:11 +00003422 ;
3423 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003424case 264:
Lev Walkind370e9f2006-03-16 10:03:35 +00003425#line 2082 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003426{
3427 yyval.a_expr = asn1p_expr_new(yylineno);
3428 checkmem(yyval.a_expr);
3429 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3430 yyval.a_expr->meta_type = AMT_VALUE;
3431 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3432 yyval.a_expr->value = yyvsp[-1].a_value;
3433 ;
3434 break;}
3435case 265:
Lev Walkind370e9f2006-03-16 10:03:35 +00003436#line 2090 "asn1p_y.y"
Lev Walkin1893ddf2005-03-20 14:28:32 +00003437{
3438 yyval.a_expr = asn1p_expr_new(yylineno);
3439 checkmem(yyval.a_expr);
3440 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3441 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkinf15320b2004-06-03 03:38:44 +00003442 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkin1004aa92004-09-08 00:28:11 +00003443 ;
3444 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003445case 266:
3446#line 2097 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003447{
Lev Walkinceb20e72004-09-05 10:40:41 +00003448 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003449 checkmem(yyval.a_expr);
3450 yyval.a_expr->Identifier = strdup("...");
3451 checkmem(yyval.a_expr->Identifier);
3452 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
3453 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkin1004aa92004-09-08 00:28:11 +00003454 ;
3455 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003456case 267:
3457#line 2108 "asn1p_y.y"
3458{
3459 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3460 checkmem(yyval.a_value);
3461 ;
3462 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003463case 268:
Lev Walkind370e9f2006-03-16 10:03:35 +00003464#line 2112 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003465{
3466 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3467 checkmem(yyval.a_value);
3468 ;
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003469 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00003470case 269:
Lev Walkind370e9f2006-03-16 10:03:35 +00003471#line 2143 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003472{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
3473 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003474case 270:
3475#line 2144 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003476{ yyval.a_tag = yyvsp[0].a_tag; ;
3477 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003478case 271:
3479#line 2148 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003480{
Lev Walkinc603f102005-01-23 09:51:44 +00003481 yyval.a_tag = yyvsp[-1].a_tag;
3482 yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode;
Lev Walkin1004aa92004-09-08 00:28:11 +00003483 ;
3484 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003485case 272:
3486#line 2155 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003487{
Lev Walkinc603f102005-01-23 09:51:44 +00003488 yyval.a_tag = yyvsp[-2].a_tag;
3489 yyval.a_tag.tag_value = yyvsp[-1].a_int;
Lev Walkin1004aa92004-09-08 00:28:11 +00003490 ;
3491 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003492case 273:
3493#line 2161 "asn1p_y.y"
Lev Walkinc603f102005-01-23 09:51:44 +00003494{ yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; ;
Lev Walkin1004aa92004-09-08 00:28:11 +00003495 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003496case 274:
3497#line 2162 "asn1p_y.y"
Lev Walkinc603f102005-01-23 09:51:44 +00003498{ yyval.a_tag.tag_class = TC_UNIVERSAL; ;
Lev Walkin83cac2f2004-09-22 16:03:36 +00003499 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003500case 275:
3501#line 2163 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003502{ yyval.a_tag.tag_class = TC_APPLICATION; ;
Lev Walkin1e448d32005-03-24 14:26:38 +00003503 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003504case 276:
3505#line 2164 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003506{ yyval.a_tag.tag_class = TC_PRIVATE; ;
Lev Walkinb36317c2005-08-12 10:09:10 +00003507 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003508case 277:
3509#line 2168 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003510{ yyval.a_tag.tag_mode = TM_DEFAULT; ;
3511 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003512case 278:
3513#line 2169 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003514{ yyval.a_tag.tag_mode = TM_IMPLICIT; ;
3515 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003516case 279:
3517#line 2170 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003518{ yyval.a_tag.tag_mode = TM_EXPLICIT; ;
3519 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003520case 280:
3521#line 2174 "asn1p_y.y"
3522{
3523 checkmem(yyvsp[0].tv_str);
3524 yyval.tv_str = yyvsp[0].tv_str;
3525 ;
3526 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003527case 281:
Lev Walkind370e9f2006-03-16 10:03:35 +00003528#line 2178 "asn1p_y.y"
Lev Walkin4696c742005-08-22 12:23:54 +00003529{
3530 checkmem(yyvsp[0].tv_str);
3531 yyval.tv_str = yyvsp[0].tv_str;
3532 ;
3533 break;}
Lev Walkin9c2285a2006-03-09 08:49:26 +00003534case 282:
Lev Walkind370e9f2006-03-16 10:03:35 +00003535#line 2186 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003536{
3537 checkmem(yyvsp[0].tv_str);
3538 yyval.tv_str = yyvsp[0].tv_str;
3539 ;
Lev Walkinef625402005-09-05 05:17:57 +00003540 break;}
Lev Walkin1db91132006-03-09 09:11:53 +00003541case 283:
Lev Walkin57074f12006-03-16 05:11:14 +00003542#line 2193 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003543{ yyval.tv_str = 0; ;
3544 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003545case 284:
3546#line 2194 "asn1p_y.y"
Lev Walkin9d542d22006-03-14 16:31:37 +00003547{
3548 yyval.tv_str = yyvsp[0].tv_str;
3549 ;
3550 break;}
Lev Walkind370e9f2006-03-16 10:03:35 +00003551case 285:
3552#line 2200 "asn1p_y.y"
Lev Walkin1004aa92004-09-08 00:28:11 +00003553{
Lev Walkinceb20e72004-09-05 10:40:41 +00003554 checkmem(yyvsp[0].tv_str);
3555 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkin1004aa92004-09-08 00:28:11 +00003556 ;
3557 break;}
Lev Walkin1004aa92004-09-08 00:28:11 +00003558}
3559 /* the action file gets copied in in place of this dollarsign */
3560#line 543 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +00003561
3562 yyvsp -= yylen;
3563 yyssp -= yylen;
Lev Walkin1004aa92004-09-08 00:28:11 +00003564#ifdef YYLSP_NEEDED
3565 yylsp -= yylen;
3566#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003567
Lev Walkin1004aa92004-09-08 00:28:11 +00003568#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00003569 if (yydebug)
3570 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003571 short *ssp1 = yyss - 1;
3572 fprintf (stderr, "state stack now");
3573 while (ssp1 != yyssp)
3574 fprintf (stderr, " %d", *++ssp1);
3575 fprintf (stderr, "\n");
Lev Walkinf15320b2004-06-03 03:38:44 +00003576 }
3577#endif
3578
3579 *++yyvsp = yyval;
3580
Lev Walkin1004aa92004-09-08 00:28:11 +00003581#ifdef YYLSP_NEEDED
3582 yylsp++;
3583 if (yylen == 0)
3584 {
3585 yylsp->first_line = yylloc.first_line;
3586 yylsp->first_column = yylloc.first_column;
3587 yylsp->last_line = (yylsp-1)->last_line;
3588 yylsp->last_column = (yylsp-1)->last_column;
3589 yylsp->text = 0;
3590 }
3591 else
3592 {
3593 yylsp->last_line = (yylsp+yylen-1)->last_line;
3594 yylsp->last_column = (yylsp+yylen-1)->last_column;
3595 }
3596#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003597
Lev Walkin1004aa92004-09-08 00:28:11 +00003598 /* Now "shift" the result of the reduction.
3599 Determine what state that goes to,
3600 based on the state we popped back to
3601 and the rule number reduced by. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003602
3603 yyn = yyr1[yyn];
3604
Lev Walkin1004aa92004-09-08 00:28:11 +00003605 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3606 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00003607 yystate = yytable[yystate];
3608 else
Lev Walkin1004aa92004-09-08 00:28:11 +00003609 yystate = yydefgoto[yyn - YYNTBASE];
Lev Walkinf15320b2004-06-03 03:38:44 +00003610
3611 goto yynewstate;
3612
Lev Walkin1004aa92004-09-08 00:28:11 +00003613yyerrlab: /* here on detecting error */
Lev Walkinf15320b2004-06-03 03:38:44 +00003614
Lev Walkin1004aa92004-09-08 00:28:11 +00003615 if (! yyerrstatus)
3616 /* If not already recovering from an error, report this error. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003617 {
3618 ++yynerrs;
Lev Walkin1004aa92004-09-08 00:28:11 +00003619
3620#ifdef YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +00003621 yyn = yypact[yystate];
3622
Lev Walkin1004aa92004-09-08 00:28:11 +00003623 if (yyn > YYFLAG && yyn < YYLAST)
Lev Walkinf15320b2004-06-03 03:38:44 +00003624 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003625 int size = 0;
3626 char *msg;
3627 int x, count;
Lev Walkinf15320b2004-06-03 03:38:44 +00003628
Lev Walkin1004aa92004-09-08 00:28:11 +00003629 count = 0;
3630 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3631 for (x = (yyn < 0 ? -yyn : 0);
Lev Walkin4a4bdf72005-06-07 21:43:32 +00003632 x < (int)(sizeof(yytname) / sizeof(char *)); x++)
Lev Walkin1004aa92004-09-08 00:28:11 +00003633 if (yycheck[x + yyn] == x)
3634 size += strlen(yytname[x]) + 15, count++;
3635 msg = (char *) malloc(size + 15);
3636 if (msg != 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00003637 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003638 strcpy(msg, "parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003639
Lev Walkin1004aa92004-09-08 00:28:11 +00003640 if (count < 5)
Lev Walkinf15320b2004-06-03 03:38:44 +00003641 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003642 count = 0;
3643 for (x = (yyn < 0 ? -yyn : 0);
Lev Walkin4a4bdf72005-06-07 21:43:32 +00003644 x < (int)(sizeof(yytname) / sizeof(char *)); x++)
Lev Walkin1004aa92004-09-08 00:28:11 +00003645 if (yycheck[x + yyn] == x)
Lev Walkinf15320b2004-06-03 03:38:44 +00003646 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003647 strcat(msg, count == 0 ? ", expecting `" : " or `");
3648 strcat(msg, yytname[x]);
3649 strcat(msg, "'");
3650 count++;
Lev Walkinf15320b2004-06-03 03:38:44 +00003651 }
3652 }
Lev Walkin1004aa92004-09-08 00:28:11 +00003653 yyerror(msg);
3654 free(msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00003655 }
3656 else
Lev Walkin1004aa92004-09-08 00:28:11 +00003657 yyerror ("parse error; also virtual memory exceeded");
Lev Walkinf15320b2004-06-03 03:38:44 +00003658 }
3659 else
3660#endif /* YYERROR_VERBOSE */
Lev Walkin1004aa92004-09-08 00:28:11 +00003661 yyerror("parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003662 }
Lev Walkin1004aa92004-09-08 00:28:11 +00003663
Lev Walkinf15320b2004-06-03 03:38:44 +00003664 goto yyerrlab1;
Lev Walkin1004aa92004-09-08 00:28:11 +00003665yyerrlab1: /* here on error raised explicitly by an action */
Lev Walkinf15320b2004-06-03 03:38:44 +00003666
3667 if (yyerrstatus == 3)
3668 {
Lev Walkin1004aa92004-09-08 00:28:11 +00003669 /* if just tried and failed to reuse lookahead token after an error, discard it. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003670
Lev Walkin1004aa92004-09-08 00:28:11 +00003671 /* return failure if at end of input */
Lev Walkinf15320b2004-06-03 03:38:44 +00003672 if (yychar == YYEOF)
Lev Walkin1004aa92004-09-08 00:28:11 +00003673 YYABORT;
Lev Walkinf15320b2004-06-03 03:38:44 +00003674
Lev Walkin1004aa92004-09-08 00:28:11 +00003675#if YYDEBUG != 0
3676 if (yydebug)
3677 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3678#endif
3679
Lev Walkinf15320b2004-06-03 03:38:44 +00003680 yychar = YYEMPTY;
3681 }
3682
Lev Walkin1004aa92004-09-08 00:28:11 +00003683 /* Else will try to reuse lookahead token
3684 after shifting the error token. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003685
Lev Walkin1004aa92004-09-08 00:28:11 +00003686 yyerrstatus = 3; /* Each real token shifted decrements this */
Lev Walkinf15320b2004-06-03 03:38:44 +00003687
Lev Walkin1004aa92004-09-08 00:28:11 +00003688 goto yyerrhandle;
Lev Walkin459ab022004-09-07 10:39:09 +00003689
Lev Walkin1004aa92004-09-08 00:28:11 +00003690yyerrdefault: /* current state does not do anything special for the error token. */
Lev Walkin459ab022004-09-07 10:39:09 +00003691
Lev Walkin1004aa92004-09-08 00:28:11 +00003692#if 0
3693 /* This is wrong; only states that explicitly want error tokens
3694 should shift them. */
3695 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3696 if (yyn) goto yydefault;
Lev Walkinceb20e72004-09-05 10:40:41 +00003697#endif
Lev Walkin1004aa92004-09-08 00:28:11 +00003698
3699yyerrpop: /* pop the current state because it cannot handle the error token */
3700
3701 if (yyssp == yyss) YYABORT;
3702 yyvsp--;
3703 yystate = *--yyssp;
3704#ifdef YYLSP_NEEDED
3705 yylsp--;
3706#endif
3707
3708#if YYDEBUG != 0
3709 if (yydebug)
3710 {
3711 short *ssp1 = yyss - 1;
3712 fprintf (stderr, "Error: state stack now");
3713 while (ssp1 != yyssp)
3714 fprintf (stderr, " %d", *++ssp1);
3715 fprintf (stderr, "\n");
Lev Walkinceb20e72004-09-05 10:40:41 +00003716 }
Lev Walkin1004aa92004-09-08 00:28:11 +00003717#endif
3718
3719yyerrhandle:
3720
3721 yyn = yypact[yystate];
3722 if (yyn == YYFLAG)
3723 goto yyerrdefault;
3724
3725 yyn += YYTERROR;
3726 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3727 goto yyerrdefault;
3728
3729 yyn = yytable[yyn];
3730 if (yyn < 0)
3731 {
3732 if (yyn == YYFLAG)
3733 goto yyerrpop;
3734 yyn = -yyn;
3735 goto yyreduce;
3736 }
3737 else if (yyn == 0)
3738 goto yyerrpop;
Lev Walkinf15320b2004-06-03 03:38:44 +00003739
3740 if (yyn == YYFINAL)
3741 YYACCEPT;
3742
Lev Walkin1004aa92004-09-08 00:28:11 +00003743#if YYDEBUG != 0
3744 if (yydebug)
3745 fprintf(stderr, "Shifting error token, ");
3746#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003747
3748 *++yyvsp = yylval;
Lev Walkin1004aa92004-09-08 00:28:11 +00003749#ifdef YYLSP_NEEDED
3750 *++yylsp = yylloc;
3751#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003752
3753 yystate = yyn;
3754 goto yynewstate;
3755
Lev Walkin1004aa92004-09-08 00:28:11 +00003756 yyacceptlab:
3757 /* YYACCEPT comes here. */
3758 if (yyfree_stacks)
3759 {
3760 free (yyss);
3761 free (yyvs);
3762#ifdef YYLSP_NEEDED
3763 free (yyls);
Lev Walkin609ccbb2004-09-04 04:49:21 +00003764#endif
Lev Walkin1004aa92004-09-08 00:28:11 +00003765 }
3766 return 0;
Lev Walkin459ab022004-09-07 10:39:09 +00003767
Lev Walkin1004aa92004-09-08 00:28:11 +00003768 yyabortlab:
3769 /* YYABORT comes here. */
3770 if (yyfree_stacks)
3771 {
3772 free (yyss);
3773 free (yyvs);
3774#ifdef YYLSP_NEEDED
3775 free (yyls);
Lev Walkin459ab022004-09-07 10:39:09 +00003776#endif
Lev Walkin1004aa92004-09-08 00:28:11 +00003777 }
3778 return 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00003779}
Lev Walkind370e9f2006-03-16 10:03:35 +00003780#line 2206 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +00003781
3782
3783
3784/*
3785 * Convert Xstring ('0101'B or '5'H) to the binary vector.
3786 */
3787static asn1p_value_t *
3788_convert_bitstring2binary(char *str, int base) {
3789 asn1p_value_t *val;
3790 int slen;
3791 int memlen;
3792 int baselen;
3793 int bits;
3794 uint8_t *binary_vector;
3795 uint8_t *bv_ptr;
3796 uint8_t cur_val;
3797
3798 assert(str);
3799 assert(str[0] == '\'');
3800
3801 switch(base) {
3802 case 'B':
3803 baselen = 1;
3804 break;
3805 case 'H':
3806 baselen = 4;
3807 break;
3808 default:
3809 assert(base == 'B' || base == 'H');
3810 errno = EINVAL;
3811 return NULL;
3812 }
3813
3814 slen = strlen(str);
3815 assert(str[slen - 1] == base);
3816 assert(str[slen - 2] == '\'');
3817
3818 memlen = slen / (8 / baselen); /* Conservative estimate */
3819
3820 bv_ptr = binary_vector = malloc(memlen + 1);
3821 if(bv_ptr == NULL)
3822 /* ENOMEM */
3823 return NULL;
3824
3825 cur_val = 0;
3826 bits = 0;
3827 while(*(++str) != '\'') {
3828 switch(baselen) {
3829 case 1:
3830 switch(*str) {
3831 case '1':
3832 cur_val |= 1 << (7 - (bits % 8));
3833 case '0':
3834 break;
3835 default:
3836 assert(!"_y UNREACH1");
3837 case ' ': case '\r': case '\n':
3838 continue;
3839 }
3840 break;
3841 case 4:
3842 switch(*str) {
3843 case '0': case '1': case '2': case '3': case '4':
3844 case '5': case '6': case '7': case '8': case '9':
3845 cur_val |= (*str - '0') << (4 - (bits % 8));
3846 break;
3847 case 'A': case 'B': case 'C':
3848 case 'D': case 'E': case 'F':
3849 cur_val |= ((*str - 'A') + 10)
3850 << (4 - (bits % 8));
3851 break;
3852 default:
3853 assert(!"_y UNREACH2");
3854 case ' ': case '\r': case '\n':
3855 continue;
3856 }
3857 break;
3858 }
3859
3860 bits += baselen;
3861 if((bits % 8) == 0) {
3862 *bv_ptr++ = cur_val;
3863 cur_val = 0;
3864 }
3865 }
3866
3867 *bv_ptr = cur_val;
3868 assert((bv_ptr - binary_vector) <= memlen);
3869
3870 val = asn1p_value_frombits(binary_vector, bits, 0);
3871 if(val == NULL) {
3872 free(binary_vector);
3873 }
3874
3875 return val;
3876}
3877
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00003878/*
3879 * For unnamed types (used in old X.208 compliant modules)
3880 * generate some sort of interim names, to not to force human being to fix
3881 * the specification's compliance to modern ASN.1 standards.
3882 */
3883static void
3884_fixup_anonymous_identifier(asn1p_expr_t *expr) {
3885 char *p;
3886 assert(expr->Identifier == 0);
3887
3888 /*
3889 * Try to figure out the type name
3890 * without going too much into details
3891 */
3892 expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
3893 if(expr->reference && expr->reference->comp_count > 0)
3894 expr->Identifier = expr->reference->components[0].name;
3895
3896 fprintf(stderr,
3897 "WARNING: Line %d: expected lower-case member identifier, "
3898 "found an unnamed %s.\n"
3899 "WARNING: Obsolete X.208 syntax detected, "
3900 "please give the member a name.\n",
3901 yylineno, expr->Identifier ? expr->Identifier : "type");
3902
3903 if(!expr->Identifier)
3904 expr->Identifier = "unnamed";
3905 expr->Identifier = strdup(expr->Identifier);
3906 assert(expr->Identifier);
3907 /* Make a lowercase identifier from the type name */
3908 for(p = expr->Identifier; *p; p++) {
3909 switch(*p) {
3910 case 'A' ... 'Z': *p += 32; break;
3911 case ' ': *p = '_'; break;
3912 case '-': *p = '_'; break;
3913 }
3914 }
3915 fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
3916 "Name clash may occur later.\n",
3917 expr->Identifier);
3918}
3919
Lev Walkinf15320b2004-06-03 03:38:44 +00003920int
3921yyerror(const char *msg) {
Lev Walkin9d542d22006-03-14 16:31:37 +00003922 extern char *asn1p_text;
Lev Walkinf15320b2004-06-03 03:38:44 +00003923 fprintf(stderr,
3924 "ASN.1 grammar parse error "
3925 "near line %d (token \"%s\"): %s\n",
Lev Walkinceb20e72004-09-05 10:40:41 +00003926 yylineno, asn1p_text, msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00003927 return -1;
3928}
3929