blob: b36871cbff90f26bdb8c74ec9fa1d3129dfca32b [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001
Lev Walkinceb20e72004-09-05 10:40:41 +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 Walkinceb20e72004-09-05 10:40:41 +00005#define YYBISON 1 /* Identify Bison output. */
Lev Walkinf15320b2004-06-03 03:38:44 +00006
7#define yyparse asn1p_parse
Lev Walkinceb20e72004-09-05 10:40:41 +00008#define yylex asn1p_lex
Lev Walkinf15320b2004-06-03 03:38:44 +00009#define yyerror asn1p_error
Lev Walkinceb20e72004-09-05 10:40:41 +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 Walkinceb20e72004-09-05 10:40:41 +000014#define TOK_PPEQ 257
15#define TOK_opaque 258
16#define TOK_bstring 259
17#define TOK_cstring 260
18#define TOK_hstring 261
19#define TOK_identifier 262
20#define TOK_number 263
21#define TOK_number_negative 264
22#define TOK_typereference 265
23#define TOK_capitalreference 266
24#define TOK_typefieldreference 267
25#define TOK_valuefieldreference 268
26#define TOK_ABSENT 269
27#define TOK_ABSTRACT_SYNTAX 270
28#define TOK_ALL 271
29#define TOK_ANY 272
30#define TOK_APPLICATION 273
31#define TOK_AUTOMATIC 274
32#define TOK_BEGIN 275
33#define TOK_BIT 276
34#define TOK_BMPString 277
35#define TOK_BOOLEAN 278
36#define TOK_BY 279
37#define TOK_CHARACTER 280
38#define TOK_CHOICE 281
39#define TOK_CLASS 282
40#define TOK_COMPONENT 283
41#define TOK_COMPONENTS 284
42#define TOK_CONSTRAINED 285
43#define TOK_CONTAINING 286
44#define TOK_DEFAULT 287
45#define TOK_DEFINITIONS 288
46#define TOK_DEFINED 289
47#define TOK_EMBEDDED 290
48#define TOK_ENCODED 291
49#define TOK_ENCODING_CONTROL 292
50#define TOK_END 293
51#define TOK_ENUMERATED 294
52#define TOK_EXPLICIT 295
53#define TOK_EXPORTS 296
54#define TOK_EXTENSIBILITY 297
55#define TOK_EXTERNAL 298
56#define TOK_FALSE 299
57#define TOK_FROM 300
58#define TOK_GeneralizedTime 301
59#define TOK_GeneralString 302
60#define TOK_GraphicString 303
61#define TOK_IA5String 304
62#define TOK_IDENTIFIER 305
63#define TOK_IMPLICIT 306
64#define TOK_IMPLIED 307
65#define TOK_IMPORTS 308
66#define TOK_INCLUDES 309
67#define TOK_INSTANCE 310
68#define TOK_INSTRUCTIONS 311
69#define TOK_INTEGER 312
70#define TOK_ISO646String 313
71#define TOK_MAX 314
72#define TOK_MIN 315
73#define TOK_MINUS_INFINITY 316
74#define TOK_NULL 317
75#define TOK_NumericString 318
76#define TOK_OBJECT 319
77#define TOK_ObjectDescriptor 320
78#define TOK_OCTET 321
79#define TOK_OF 322
80#define TOK_OPTIONAL 323
81#define TOK_PATTERN 324
82#define TOK_PDV 325
83#define TOK_PLUS_INFINITY 326
84#define TOK_PRESENT 327
85#define TOK_PrintableString 328
86#define TOK_PRIVATE 329
87#define TOK_REAL 330
88#define TOK_RELATIVE_OID 331
89#define TOK_SEQUENCE 332
90#define TOK_SET 333
91#define TOK_SIZE 334
92#define TOK_STRING 335
93#define TOK_SYNTAX 336
94#define TOK_T61String 337
95#define TOK_TAGS 338
96#define TOK_TeletexString 339
97#define TOK_TRUE 340
98#define TOK_TYPE_IDENTIFIER 341
99#define TOK_UNIQUE 342
100#define TOK_UNIVERSAL 343
101#define TOK_UniversalString 344
102#define TOK_UTCTime 345
103#define TOK_UTF8String 346
104#define TOK_VideotexString 347
105#define TOK_VisibleString 348
106#define TOK_WITH 349
107#define TOK_EXCEPT 350
108#define TOK_INTERSECTION 351
109#define TOK_UNION 352
110#define TOK_TwoDots 353
111#define TOK_ThreeDots 354
112#define TOK_tag 355
Lev Walkinf15320b2004-06-03 03:38:44 +0000113
114#line 1 "asn1p_y.y"
115
116
117#include <stdlib.h>
118#include <stdio.h>
119#include <string.h>
120#include <errno.h>
121#include <assert.h>
122
123#include "asn1parser.h"
124
125#define YYPARSE_PARAM param
126#define YYERROR_VERBOSE
127
128int yylex(void);
129int yyerror(const char *msg);
130void asn1p_lexer_hack_push_opaque_state(void);
131void asn1p_lexer_hack_enable_with_syntax(void);
Lev Walkinf59d0752004-08-18 04:59:12 +0000132void asn1p_lexer_hack_push_encoding_control(void);
Lev Walkinf15320b2004-06-03 03:38:44 +0000133#define yylineno asn1p_lineno
134extern int asn1p_lineno;
135
136
137static asn1p_value_t *
138 _convert_bitstring2binary(char *str, int base);
139
140#define checkmem(ptr) do { \
141 if(!(ptr)) \
142 return yyerror("Memory failure"); \
143 } while(0)
144
145#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
146 if(arg1->type != constr_type) { \
147 int __ret; \
148 root = asn1p_constraint_new(yylineno); \
149 checkmem(root); \
150 root->type = constr_type; \
151 __ret = asn1p_constraint_insert(root, \
152 arg1); \
153 checkmem(__ret == 0); \
154 } else { \
155 root = arg1; \
156 } \
157 if(arg2) { \
158 int __ret \
159 = asn1p_constraint_insert(root, arg2); \
160 checkmem(__ret == 0); \
161 } \
162 } while(0)
163
164
Lev Walkinf59d0752004-08-18 04:59:12 +0000165#line 58 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +0000166typedef union {
167 asn1p_t *a_grammar;
168 asn1p_module_flags_e a_module_flags;
169 asn1p_module_t *a_module;
170 asn1p_expr_type_e a_type; /* ASN.1 Type */
171 asn1p_expr_t *a_expr; /* Constructed collection */
172 asn1p_constraint_t *a_constr; /* Constraint */
173 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
174 asn1p_xports_t *a_xports; /* IMports/EXports */
175 asn1p_oid_t *a_oid; /* Object Identifier */
176 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
177 struct asn1p_type_tag_s a_tag; /* A tag */
178 asn1p_ref_t *a_ref; /* Reference to custom type */
179 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
180 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
181 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
182 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
183 struct asn1p_param_s a_parg; /* A parameter argument */
184 asn1p_paramlist_t *a_plist; /* A pargs list */
185 enum asn1p_expr_marker_e a_marker; /* OPTIONAL/DEFAULT */
186 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
187 asn1_integer_t a_int;
188 char *tv_str;
189 struct {
190 char *buf;
191 int len;
192 } tv_opaque;
193 struct {
194 char *name;
195 struct asn1p_type_tag_s tag;
196 } tv_nametag;
Lev Walkinceb20e72004-09-05 10:40:41 +0000197} YYSTYPE;
198#include <stdio.h>
199
200#ifndef __cplusplus
201#ifndef __STDC__
202#define const
203#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000204#endif
205
206
207
Lev Walkinceb20e72004-09-05 10:40:41 +0000208#define YYFINAL 396
209#define YYFLAG -32768
210#define YYNTBASE 115
Lev Walkinf15320b2004-06-03 03:38:44 +0000211
Lev Walkinceb20e72004-09-05 10:40:41 +0000212#define YYTRANSLATE(x) ((unsigned)(x) <= 355 ? yytranslate[x] : 214)
Lev Walkinf15320b2004-06-03 03:38:44 +0000213
Lev Walkinceb20e72004-09-05 10:40:41 +0000214static const char yytranslate[] = { 0,
215 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
216 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
217 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
218 2, 2, 111, 2, 2, 2, 2, 2, 2, 106,
219 107, 2, 2, 109, 2, 112, 2, 2, 2, 2,
220 2, 2, 2, 2, 2, 2, 2, 110, 108, 113,
221 2, 2, 2, 114, 2, 2, 2, 2, 2, 2,
222 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
223 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
224 2, 2, 2, 97, 2, 2, 2, 2, 2, 2,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
227 2, 2, 104, 99, 105, 2, 2, 2, 2, 2,
228 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
229 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
231 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
234 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
241 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
242 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
243 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
244 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
245 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
246 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
247 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
248 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
249 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
250 98, 100, 101, 102, 103
251};
Lev Walkinf15320b2004-06-03 03:38:44 +0000252
Lev Walkinceb20e72004-09-05 10:40:41 +0000253#if YYDEBUG != 0
254static const short yyprhs[] = { 0,
255 0, 2, 4, 7, 16, 17, 19, 23, 26, 28,
256 31, 33, 38, 40, 41, 43, 45, 48, 51, 54,
257 57, 60, 63, 64, 66, 68, 71, 73, 75, 77,
258 79, 81, 82, 86, 88, 92, 95, 97, 100, 105,
259 107, 111, 113, 115, 119, 123, 126, 128, 132, 134,
260 136, 143, 145, 147, 148, 150, 152, 156, 158, 160,
261 165, 170, 174, 181, 183, 187, 189, 193, 197, 199,
262 203, 205, 207, 209, 213, 217, 221, 223, 225, 229,
263 232, 234, 240, 241, 243, 245, 249, 252, 257, 262,
264 263, 265, 266, 273, 275, 278, 280, 282, 284, 288,
265 292, 295, 297, 299, 304, 309, 314, 319, 324, 326,
266 331, 336, 338, 342, 344, 348, 352, 354, 358, 360,
267 364, 366, 368, 370, 372, 377, 378, 382, 384, 386,
268 388, 390, 392, 394, 398, 400, 403, 405, 407, 409,
269 411, 414, 417, 419, 421, 424, 427, 429, 431, 433,
270 435, 438, 440, 443, 445, 447, 449, 451, 453, 455,
271 457, 459, 461, 463, 465, 467, 469, 471, 473, 475,
272 477, 479, 481, 482, 484, 486, 491, 495, 500, 502,
273 506, 512, 514, 518, 522, 526, 531, 535, 537, 541,
274 545, 549, 553, 555, 557, 559, 562, 565, 569, 571,
275 573, 575, 577, 579, 581, 583, 589, 591, 595, 597,
276 601, 602, 604, 606, 608, 610, 612, 614, 618, 623,
277 625, 629, 632, 636, 638, 642, 643, 645, 647, 650,
278 652, 654, 655, 659, 662, 666, 668, 672, 674, 679,
279 684, 686, 688, 690, 692, 693, 695, 697, 700, 703,
280 705, 707, 709, 711, 713
281};
Lev Walkinf15320b2004-06-03 03:38:44 +0000282
Lev Walkinceb20e72004-09-05 10:40:41 +0000283static const short yyrhs[] = { 116,
284 0, 117, 0, 116, 117, 0, 210, 118, 34, 122,
285 3, 21, 125, 39, 0, 0, 119, 0, 104, 120,
286 105, 0, 104, 105, 0, 121, 0, 120, 121, 0,
287 212, 0, 212, 106, 9, 107, 0, 9, 0, 0,
288 123, 0, 124, 0, 123, 124, 0, 41, 84, 0,
289 52, 84, 0, 20, 84, 0, 43, 53, 0, 12,
290 57, 0, 0, 126, 0, 127, 0, 126, 127, 0,
291 129, 0, 134, 0, 142, 0, 168, 0, 137, 0,
292 0, 38, 12, 128, 0, 176, 0, 54, 130, 108,
293 0, 54, 46, 0, 131, 0, 130, 131, 0, 132,
294 46, 210, 118, 0, 133, 0, 132, 109, 133, 0,
295 210, 0, 212, 0, 42, 135, 108, 0, 42, 17,
296 108, 0, 42, 108, 0, 136, 0, 135, 109, 136,
297 0, 210, 0, 212, 0, 210, 138, 3, 104, 139,
298 105, 0, 163, 0, 173, 0, 0, 140, 0, 141,
299 0, 140, 109, 141, 0, 102, 0, 184, 0, 210,
300 3, 208, 87, 0, 210, 3, 208, 161, 0, 210,
301 3, 151, 0, 210, 104, 143, 105, 3, 161, 0,
302 144, 0, 143, 109, 144, 0, 210, 0, 210, 110,
303 212, 0, 173, 110, 212, 0, 146, 0, 145, 109,
304 146, 0, 161, 0, 212, 0, 148, 0, 147, 109,
305 148, 0, 213, 161, 200, 0, 30, 68, 161, 0,
306 160, 0, 150, 0, 149, 109, 150, 0, 213, 161,
307 0, 160, 0, 28, 104, 153, 105, 155, 0, 0,
308 88, 0, 154, 0, 153, 109, 154, 0, 166, 200,
309 0, 166, 161, 200, 152, 0, 166, 166, 200, 152,
310 0, 0, 156, 0, 0, 95, 82, 104, 157, 158,
311 105, 0, 159, 0, 158, 159, 0, 4, 0, 166,
312 0, 102, 0, 102, 111, 171, 0, 102, 111, 207,
313 0, 162, 180, 0, 175, 0, 176, 0, 27, 104,
314 149, 105, 0, 78, 104, 147, 105, 0, 79, 104,
315 147, 105, 0, 78, 180, 68, 162, 0, 79, 180,
316 68, 162, 0, 18, 0, 18, 35, 25, 212, 0,
317 210, 104, 145, 105, 0, 163, 0, 56, 68, 163,
318 0, 11, 0, 11, 112, 210, 0, 11, 112, 212,
319 0, 211, 0, 211, 112, 164, 0, 165, 0, 164,
320 112, 165, 0, 167, 0, 167, 0, 13, 0, 14,
321 0, 212, 138, 3, 169, 0, 0, 104, 170, 172,
322 0, 5, 0, 7, 0, 6, 0, 207, 0, 171,
323 0, 212, 0, 210, 112, 212, 0, 4, 0, 172,
324 4, 0, 24, 0, 63, 0, 76, 0, 174, 0,
325 67, 81, 0, 65, 51, 0, 77, 0, 44, 0,
326 36, 71, 0, 26, 81, 0, 91, 0, 47, 0,
327 58, 0, 40, 0, 22, 81, 0, 173, 0, 174,
328 204, 0, 23, 0, 48, 0, 49, 0, 50, 0,
329 59, 0, 64, 0, 74, 0, 83, 0, 85, 0,
330 90, 0, 92, 0, 93, 0, 94, 0, 66, 0,
331 99, 0, 100, 0, 97, 0, 98, 0, 96, 0,
332 0, 181, 0, 182, 0, 80, 106, 183, 107, 0,
333 106, 183, 107, 0, 182, 106, 183, 107, 0, 184,
334 0, 184, 109, 102, 0, 184, 109, 102, 109, 184,
335 0, 185, 0, 184, 177, 185, 0, 184, 178, 185,
336 0, 185, 179, 185, 0, 187, 106, 183, 107, 0,
337 106, 183, 107, 0, 188, 0, 188, 186, 188, 0,
338 61, 186, 188, 0, 188, 186, 60, 0, 61, 186,
339 60, 0, 194, 0, 189, 0, 101, 0, 101, 113,
340 0, 113, 101, 0, 113, 101, 113, 0, 80, 0,
341 46, 0, 207, 0, 212, 0, 6, 0, 45, 0,
342 86, 0, 95, 30, 104, 190, 105, 0, 191, 0,
343 190, 109, 191, 0, 102, 0, 212, 180, 192, 0,
344 0, 193, 0, 73, 0, 15, 0, 69, 0, 195,
345 0, 196, 0, 104, 210, 105, 0, 195, 104, 197,
346 105, 0, 198, 0, 197, 109, 198, 0, 114, 199,
347 0, 114, 112, 199, 0, 212, 0, 199, 112, 212,
348 0, 0, 201, 0, 69, 0, 33, 202, 0, 188,
349 0, 173, 0, 0, 104, 203, 172, 0, 104, 105,
350 0, 104, 205, 105, 0, 206, 0, 205, 109, 206,
351 0, 212, 0, 212, 106, 207, 107, 0, 212, 106,
352 171, 107, 0, 207, 0, 102, 0, 9, 0, 10,
353 0, 0, 209, 0, 103, 0, 103, 52, 0, 103,
354 41, 0, 11, 0, 12, 0, 12, 0, 8, 0,
355 212, 0, 212, 209, 0
356};
Lev Walkinf15320b2004-06-03 03:38:44 +0000357
358#endif
359
Lev Walkinceb20e72004-09-05 10:40:41 +0000360#if YYDEBUG != 0
361static const short yyrline[] = { 0,
362 300, 306, 312, 328, 353, 355, 358, 362, 367, 374,
363 382, 387, 391, 400, 402, 410, 414, 422, 426, 429,
364 432, 436, 456, 458, 466, 470, 502, 506, 515, 522,
365 535, 542, 544, 556, 569, 576, 581, 587, 593, 602,
366 608, 614, 621, 629, 633, 636, 643, 649, 655, 662,
367 671, 681, 689, 697, 699, 709, 712, 716, 719, 731,
368 743, 750, 766, 775, 785, 795, 800, 807, 817, 823,
369 829, 833, 845, 851, 857, 865, 872, 877, 883, 889,
370 896, 901, 911, 913, 916, 924, 930, 939, 945, 962,
371 964, 969, 973, 978, 983, 989, 993, 1004, 1013, 1022,
372 1033, 1054, 1058, 1064, 1070, 1076, 1082, 1090, 1098, 1104,
373 1118, 1142, 1149, 1163, 1172, 1182, 1192, 1200, 1221, 1230,
374 1239, 1240, 1242, 1249, 1261, 1271, 1273, 1278, 1282, 1286,
375 1290, 1293, 1298, 1310, 1326, 1337, 1351, 1353, 1354, 1355,
376 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1369, 1371,
377 1372, 1375, 1382, 1394, 1396, 1400, 1404, 1405, 1406, 1407,
378 1408, 1412, 1413, 1414, 1415, 1419, 1420, 1427, 1427, 1428,
379 1428, 1429, 1431, 1433, 1438, 1442, 1451, 1455, 1460, 1464,
380 1470, 1480, 1484, 1487, 1490, 1495, 1504, 1512, 1518, 1525,
381 1533, 1541, 1550, 1553, 1558, 1560, 1561, 1562, 1565, 1569,
382 1574, 1578, 1589, 1594, 1599, 1606, 1612, 1616, 1621, 1627,
383 1639, 1641, 1644, 1648, 1651, 1656, 1660, 1668, 1683, 1689,
384 1696, 1709, 1721, 1736, 1740, 1757, 1759, 1762, 1766, 1772,
385 1775, 1777, 1777, 1797, 1802, 1807, 1813, 1819, 1827, 1835,
386 1843, 1850, 1860, 1865, 1895, 1897, 1900, 1905, 1909, 1915,
387 1920, 1927, 1934, 1941, 1946
388};
389#endif
390
391
392#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
393
394static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
395"TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number",
396"TOK_number_negative","TOK_typereference","TOK_capitalreference","TOK_typefieldreference",
397"TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY",
398"TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN",
399"TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS",
400"TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED",
401"TOK_EMBEDDED","TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED",
402"TOK_EXPLICIT","TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE",
403"TOK_FROM","TOK_GeneralizedTime","TOK_GeneralString","TOK_GraphicString","TOK_IA5String",
404"TOK_IDENTIFIER","TOK_IMPLICIT","TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE",
405"TOK_INSTRUCTIONS","TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY",
406"TOK_NULL","TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET",
407"TOK_OF","TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT",
408"TOK_PrintableString","TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE",
409"TOK_SET","TOK_SIZE","TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString",
410"TOK_TRUE","TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString",
411"TOK_UTCTime","TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH",
412"TOK_EXCEPT","'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots",
413"TOK_tag","'{'","'}'","'('","')'","';'","','","':'","'!'","'.'","'<'","'@'",
414"ParsedGrammar","ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
415"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
416"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
417"ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition",
418"ImportsBundleSet","ImportsBundle","ImportsList","ImportsElement","ExportsDefinition",
419"ExportsBody","ExportsElement","ValueSetDefinition","DefinedTypeRef","optValueSetBody",
420"ValueSetBody","ValueSetElement","DataTypeReference","ParameterArgumentList",
421"ParameterArgumentName","ActualParameterList","ActualParameter","ComponentTypeLists",
422"ComponentType","AlternativeTypeLists","AlternativeType","ClassDeclaration",
423"optUnique","ClassFieldList","ClassField","optWithSyntax","WithSyntax","@2",
424"WithSyntaxFormat","WithSyntaxFormatToken","ExtensionAndException","Type","TypeDeclaration",
425"ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement",
426"ClassFieldIdentifier","ClassFieldName","ValueDefinition","InlineOrDefinedValue",
427"@3","DefinedValue","Opaque","BasicTypeId","BasicTypeId_UniverationCompatible",
428"BasicType","BasicString","Union","Intersection","Except","optConstraints","Constraints",
429"SetOfConstraints","ElementSetSpecs","ElementSetSpec","ConstraintSubtypeElement",
430"ConstraintRangeSpec","ConstraintSpec","ConstraintValue","WithComponents","WithComponentsList",
431"WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint",
432"SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement",
433"ComponentIdList","optMarker","Marker","DefaultValue","@4","UniverationDefinition",
434"UniverationList","UniverationElement","SignedNumber","optTag","Tag","TypeRefName",
435"ObjectClassReference","Identifier","TaggedIdentifier", NULL
436};
437#endif
438
439static const short yyr1[] = { 0,
440 115, 116, 116, 117, 118, 118, 119, 119, 120, 120,
441 121, 121, 121, 122, 122, 123, 123, 124, 124, 124,
442 124, 124, 125, 125, 126, 126, 127, 127, 127, 127,
443 127, 128, 127, 127, 129, 129, 130, 130, 131, 132,
444 132, 133, 133, 134, 134, 134, 135, 135, 136, 136,
445 137, 138, 138, 139, 139, 140, 140, 141, 141, 142,
446 142, 142, 142, 143, 143, 144, 144, 144, 145, 145,
447 146, 146, 147, 147, 148, 148, 148, 149, 149, 150,
448 150, 151, 152, 152, 153, 153, 154, 154, 154, 155,
449 155, 157, 156, 158, 158, 159, 159, 160, 160, 160,
450 161, 162, 162, 162, 162, 162, 162, 162, 162, 162,
451 162, 162, 162, 163, 163, 163, 163, 163, 164, 164,
452 165, 166, 167, 167, 168, 170, 169, 169, 169, 169,
453 169, 169, 171, 171, 172, 172, 173, 173, 173, 173,
454 173, 173, 173, 173, 173, 173, 173, 173, 174, 174,
455 174, 175, 175, 176, 176, 176, 176, 176, 176, 176,
456 176, 176, 176, 176, 176, 176, 176, 177, 177, 178,
457 178, 179, 180, 180, 181, 181, 182, 182, 183, 183,
458 183, 184, 184, 184, 184, 185, 185, 185, 185, 185,
459 185, 185, 185, 185, 186, 186, 186, 186, 187, 187,
460 188, 188, 188, 188, 188, 189, 190, 190, 191, 191,
461 192, 192, 193, 193, 193, 194, 194, 195, 196, 197,
462 197, 198, 198, 199, 199, 200, 200, 201, 201, 202,
463 202, 203, 202, 204, 204, 205, 205, 206, 206, 206,
464 206, 206, 207, 207, 208, 208, 209, 209, 209, 210,
465 210, 211, 212, 213, 213
466};
467
468static const short yyr2[] = { 0,
469 1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
470 1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
471 2, 2, 0, 1, 1, 2, 1, 1, 1, 1,
472 1, 0, 3, 1, 3, 2, 1, 2, 4, 1,
473 3, 1, 1, 3, 3, 2, 1, 3, 1, 1,
474 6, 1, 1, 0, 1, 1, 3, 1, 1, 4,
475 4, 3, 6, 1, 3, 1, 3, 3, 1, 3,
476 1, 1, 1, 3, 3, 3, 1, 1, 3, 2,
477 1, 5, 0, 1, 1, 3, 2, 4, 4, 0,
478 1, 0, 6, 1, 2, 1, 1, 1, 3, 3,
479 2, 1, 1, 4, 4, 4, 4, 4, 1, 4,
480 4, 1, 3, 1, 3, 3, 1, 3, 1, 3,
481 1, 1, 1, 1, 4, 0, 3, 1, 1, 1,
482 1, 1, 1, 3, 1, 2, 1, 1, 1, 1,
483 2, 2, 1, 1, 2, 2, 1, 1, 1, 1,
484 2, 1, 2, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486 1, 1, 0, 1, 1, 4, 3, 4, 1, 3,
487 5, 1, 3, 3, 3, 4, 3, 1, 3, 3,
488 3, 3, 1, 1, 1, 2, 2, 3, 1, 1,
489 1, 1, 1, 1, 1, 5, 1, 3, 1, 3,
490 0, 1, 1, 1, 1, 1, 1, 3, 4, 1,
491 3, 2, 3, 1, 3, 0, 1, 1, 2, 1,
492 1, 0, 3, 2, 3, 1, 3, 1, 4, 4,
493 1, 1, 1, 1, 0, 1, 1, 2, 2, 1,
494 1, 1, 1, 1, 2
495};
496
497static const short yydefact[] = { 0,
498 250, 251, 1, 2, 5, 3, 0, 0, 6, 253,
499 13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
500 0, 0, 0, 0, 0, 15, 16, 0, 22, 20,
501 18, 21, 19, 0, 17, 12, 23, 154, 0, 0,
502 155, 156, 157, 0, 158, 159, 167, 160, 161, 162,
503 163, 164, 165, 166, 0, 24, 25, 27, 28, 31,
504 29, 30, 34, 0, 0, 32, 0, 46, 0, 47,
505 49, 50, 36, 0, 37, 0, 40, 42, 43, 4,
506 26, 245, 114, 252, 0, 137, 0, 0, 150, 144,
507 148, 149, 138, 0, 0, 139, 143, 147, 0, 0,
508 52, 53, 140, 117, 0, 33, 45, 44, 0, 35,
509 38, 0, 0, 0, 247, 62, 0, 246, 0, 151,
510 146, 145, 142, 141, 0, 64, 0, 66, 0, 0,
511 0, 48, 5, 41, 0, 249, 248, 114, 252, 109,
512 0, 0, 173, 173, 60, 61, 173, 112, 152, 140,
513 102, 103, 0, 115, 116, 0, 0, 0, 0, 54,
514 123, 124, 118, 119, 121, 128, 130, 129, 243, 244,
515 126, 125, 132, 131, 0, 133, 39, 0, 85, 226,
516 122, 0, 0, 0, 0, 0, 0, 0, 174, 175,
517 0, 0, 101, 0, 153, 0, 0, 65, 68, 67,
518 203, 204, 200, 0, 199, 205, 0, 58, 0, 0,
519 0, 55, 56, 59, 182, 0, 188, 194, 193, 216,
520 217, 201, 202, 0, 0, 0, 90, 0, 0, 228,
521 226, 226, 87, 227, 0, 98, 0, 78, 81, 254,
522 0, 113, 0, 0, 0, 73, 77, 0, 0, 179,
523 0, 0, 0, 0, 242, 234, 0, 236, 241, 238,
524 0, 69, 71, 72, 63, 195, 0, 0, 0, 0,
525 0, 51, 0, 170, 171, 168, 169, 0, 0, 172,
526 0, 0, 0, 0, 120, 135, 127, 134, 0, 82,
527 91, 86, 232, 231, 230, 229, 83, 83, 110, 0,
528 104, 0, 255, 80, 0, 0, 105, 0, 226, 177,
529 0, 107, 0, 106, 108, 235, 0, 0, 111, 0,
530 196, 197, 192, 190, 0, 218, 187, 57, 183, 184,
531 185, 0, 191, 189, 0, 0, 220, 136, 0, 0,
532 84, 88, 89, 99, 100, 79, 176, 76, 74, 75,
533 180, 178, 237, 0, 0, 70, 198, 209, 0, 207,
534 173, 186, 0, 222, 224, 219, 0, 92, 233, 0,
535 240, 239, 206, 0, 211, 223, 0, 221, 0, 181,
536 208, 214, 215, 213, 210, 212, 225, 96, 0, 94,
537 97, 93, 95, 0, 0, 0
538};
539
540static const short yydefgoto[] = { 394,
541 3, 4, 8, 9, 13, 14, 25, 26, 27, 55,
542 56, 57, 106, 58, 74, 75, 76, 77, 59, 69,
543 70, 60, 100, 211, 212, 213, 61, 125, 126, 261,
544 262, 245, 246, 237, 238, 116, 342, 178, 179, 290,
545 291, 379, 389, 390, 247, 263, 147, 148, 163, 164,
546 180, 181, 62, 172, 225, 173, 287, 149, 150, 151,
547 152, 278, 279, 281, 188, 189, 190, 249, 250, 215,
548 268, 216, 217, 218, 359, 360, 385, 386, 219, 220,
549 221, 336, 337, 364, 233, 234, 296, 340, 195, 257,
550 258, 222, 117, 118, 153, 104, 223, 248
551};
552
553static const short yypact[] = { 86,
554-32768,-32768, 86,-32768, -66,-32768, 12, 95,-32768,-32768,
555-32768,-32768, 14,-32768, 4, 217,-32768,-32768, 118, 97,
556 56, 82, 121, 104, 195, 217,-32768, 115,-32768,-32768,
557-32768,-32768,-32768, 179,-32768,-32768, 446,-32768, 213, 23,
558-32768,-32768,-32768, 96,-32768,-32768,-32768,-32768,-32768,-32768,
559-32768,-32768,-32768,-32768, 191, 446,-32768,-32768,-32768,-32768,
560-32768,-32768,-32768, 212, 744,-32768, 133,-32768, 124,-32768,
561-32768,-32768,-32768, 45,-32768, -19,-32768,-32768,-32768,-32768,
562-32768, 20, 135,-32768, 164,-32768, 176, 197,-32768,-32768,
563-32768,-32768,-32768, 225, 199,-32768,-32768,-32768, 761, 275,
564-32768,-32768,-32768, 171, 282,-32768,-32768,-32768, 159,-32768,
565-32768, 86, 159, 182, 32,-32768, 607,-32768, 159,-32768,
566-32768,-32768,-32768,-32768, -30,-32768, 177, 184, 188, 236,
567 54,-32768, -66,-32768, 236,-32768,-32768, 61, 192, 262,
568 194, 231, 76, 77,-32768,-32768, -11,-32768,-32768, 196,
569-32768,-32768, 200,-32768,-32768, 302, 761, 299, 299, 140,
570-32768,-32768, 202,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
571-32768,-32768,-32768,-32768, 203,-32768,-32768, -24,-32768, 530,
572-32768, 283, 28, 255, 206, 24, 245, 241,-32768, 211,
573 24, 251,-32768, 42,-32768, 385, 684,-32768,-32768,-32768,
574-32768,-32768,-32768, -31,-32768,-32768, 291,-32768, 86, 245,
575 218, 215,-32768, 174, 226, 220, -31,-32768,-32768, 223,
576-32768,-32768,-32768, 236, 325, 299, 240, 236, 324,-32768,
577 92, 92,-32768,-32768, 299, 227, -9,-32768,-32768, 233,
578 684,-32768, 245, 269, 63,-32768,-32768, 684, 232, 93,
579 684, 245, 100, 684,-32768,-32768, 103,-32768,-32768, 235,
580 112,-32768,-32768,-32768,-32768, 229, 242, 83, 243, 239,
581 238,-32768, 140,-32768,-32768,-32768,-32768, 245, 245,-32768,
582 245, 245, 154, 244,-32768,-32768, 348,-32768, 271,-32768,
583-32768,-32768,-32768,-32768,-32768,-32768, 266, 266,-32768, 253,
584-32768, 28,-32768,-32768, 248, 684,-32768, 24, 92,-32768,
585 257,-32768, 250,-32768,-32768,-32768, 16, 253,-32768, 385,
586-32768, 249,-32768,-32768, 35,-32768,-32768,-32768,-32768,-32768,
587-32768, 254,-32768,-32768, 10, 122,-32768,-32768, 259, 325,
588-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
589 256,-32768,-32768, 265, 267,-32768,-32768,-32768, 134,-32768,
590 -11,-32768, 299, 261,-32768,-32768, 244,-32768, 348, 245,
591-32768,-32768,-32768, 35, 72, 261, 299,-32768, 190, 174,
592-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 15,-32768,
593-32768,-32768,-32768, 366, 375,-32768
594};
595
596static const short yypgoto[] = {-32768,
597-32768, 373, 246,-32768,-32768, 364,-32768,-32768, 352,-32768,
598-32768, 327,-32768,-32768,-32768, 306,-32768, 268,-32768,-32768,
599 276,-32768, 319,-32768,-32768, 113,-32768,-32768, 237,-32768,
600 68, 201, 87,-32768, 88,-32768, 101,-32768, 170,-32768,
601-32768,-32768,-32768, 13, -167, -109, -44, -50,-32768, 180,
602 -173, -86,-32768,-32768,-32768, -232, 65, -54, -52,-32768,
603 43,-32768,-32768,-32768, -143,-32768,-32768, -169, -157, 3,
604 189,-32768, -174,-32768,-32768, 39,-32768,-32768,-32768,-32768,
605-32768,-32768, 47, 53, -154,-32768,-32768,-32768,-32768,-32768,
606 102, -122,-32768, 178, 2,-32768, -7, -166
607};
608
609
610#define YYLAST 852
611
612
613static const short yytable[] = { 15,
614 192, 5, 214, 193, 5, 15, 232, 146, 174, 102,
615 102, 103, 103, 101, 101, 239, 241, 10, 388, 10,
616 11, 10, 11, 10, 169, 170, 112, 161, 162, 65,
617 10, 10, 72, 1, 2, 10, 79, 7, 64, 67,
618 271, 71, 10, 165, 127, 78, 103, 114, 65, 10,
619 169, 170, 10, 244, 295, 1, 2, 64, 166, 167,
620 168, 10, 169, 170, 1, 2, 79, 344, 185, 266,
621 231, 259, 136, 305, 156, 78, 297, 298, 157, 63,
622 227, 267, 313, 137, 228, 354, 382, 265, 201, 113,
623 10, 169, 170, 324, 187, 301, 1, 2, 63, 302,
624 128, 72, 127, 10, 103, 79, 1, 2, 334, 19,
625 71, 155, 332, 133, 78, 214, 12, 255, 17, 392,
626 154, 363, 115, 176, 229, 236, 28, 202, 16, 236,
627 68, 304, 175, 242, 239, 241, 358, 165, 309, 30,
628 383, 73, 323, 255, 384, 201, 256, 10, 169, 170,
629 199, 200, 110, 29, 350, 185, 185, 171, 128, 201,
630 230, 10, 169, 170, -250, 31, 10, 307, 206, 1,
631 2, 308, 119, 32, 294, 240, 103, 345, 240, 186,
632 191, 187, 187, 240, 202, 203, 260, 33, 264, 274,
633 275, 276, 277, 388, 259, 355, 348, 34, 202, 37,
634 204, 311, 161, 162, 314, 391, 312, 316, 308, 315,
635 270, 317, 380, 333, 82, 391, 319, 375, 288, 205,
636 320, 36, 83, 84, 66, 206, 366, 299, 20, 80,
637 367, 108, 109, 85, 207, 86, 21, 87, 373, 206,
638 107, 208, 374, 209, 120, 210, 119, 88, 161, 162,
639 201, 89, 10, 169, 170, 90, 121, 22, 91, 23,
640 10, 169, 170, 1, 2, 83, 84, 122, 24, 92,
641 274, 275, 276, 277, 93, 123, 94, 129, 95, 124,
642 329, 330, 130, 331, 131, 135, 158, 96, 97, 202,
643 203, 160, 176, 159, 240, -251, 182, 183, 184, 194,
644 240, 175, 98, 196, 197, 204, 10, 235, 251, 260,
645 176, 243, 264, 224, 226, 99, 252, 361, 254, 175,
646 269, 280, 272, 273, 205, 282, 284, 365, 286, 201,
647 206, 10, 169, 170, 289, 115, 306, 300, 310, 207,
648 318, 321, 322, 326, 327, 85, 325, 86, 209, 87,
649 210, 338, 339, 341, 347, 365, 352, 335, 351, 88,
650 362, 357, 368, 89, 370, 395, 361, 90, 202, 387,
651 91, 371, 377, 372, 396, 6, 18, 35, 177, 111,
652 134, 92, 81, 105, 132, 328, 93, 356, 94, 346,
653 95, 253, 10, 198, 349, 138, 139, 292, 343, 96,
654 97, 393, 140, 285, 369, 283, 85, 38, 86, 206,
655 87, 141, 381, 378, 98, 376, 0, 303, 353, 0,
656 88, 0, 0, 0, 89, 0, 0, 293, 90, 0,
657 0, 91, 41, 42, 43, 0, 0, 0, 0, 0,
658 142, 0, 92, 45, 0, 0, 0, 93, 46, 94,
659 47, 95, 0, 10, 0, 0, 1, 2, 48, 0,
660 96, 97, 143, 144, 0, 0, 0, 49, 38, 50,
661 0, 0, 0, 0, 51, 98, 52, 53, 54, 0,
662 0, 0, 0, 39, 0, 0, 0, 40, 0, 0,
663 0, 0, 0, 41, 42, 43, 0, 0, 0, 44,
664 0, 0, 0, 0, 45, 0, 0, 0, 0, 46,
665 0, 47, 0, 0, 0, 0, 0, 0, 0, 48,
666 0, 0, 0, 0, 0, 0, 0, 0, 49, 0,
667 50, 0, 0, 0, 0, 51, 0, 52, 53, 54,
668 138, 139, 161, 162, 0, 0, 0, 140, 0, 0,
669 0, 85, 38, 86, 0, 87, 141, 0, 0, 0,
670 0, 0, 229, 0, 0, 88, 0, 0, 0, 89,
671 0, 0, 0, 90, 0, 0, 91, 41, 42, 43,
672 0, 0, 0, 0, 0, 142, 0, 92, 45, 0,
673 0, 0, 93, 46, 94, 47, 95, 0, 230, 0,
674 0, 0, 0, 48, 0, 96, 97, 143, 144, 0,
675 0, 0, 49, 0, 50, 0, 0, 138, 139, 51,
676 98, 52, 53, 54, 140, 0, 0, 0, 85, 38,
677 86, 0, 87, 141, 0, 0, 0, 0, 0, 0,
678 0, 0, 88, 0, 0, 0, 89, 0, 0, 0,
679 90, 0, 0, 91, 41, 42, 43, 0, 0, 0,
680 0, 0, 142, 0, 92, 45, 0, 0, 0, 93,
681 46, 94, 47, 95, 0, 0, 0, 0, 0, 0,
682 48, 0, 96, 97, 143, 144, 0, 0, 0, 49,
683 0, 50, 0, 145, 138, 139, 51, 98, 52, 53,
684 54, 140, 0, 0, 0, 85, 38, 86, 0, 87,
685 141, 0, 0, 0, 0, 0, 0, 0, 0, 88,
686 0, 0, 0, 89, 0, 0, 0, 90, 0, 0,
687 91, 41, 42, 43, 0, 0, 0, 0, 0, 142,
688 0, 92, 45, 0, 0, 0, 93, 46, 94, 47,
689 95, 0, 0, 0, 83, 84, 0, 48, 0, 96,
690 97, 143, 144, 0, 0, 85, 49, 86, 50, 87,
691 0, 1, 2, 51, 98, 52, 53, 54, 0, 88,
692 0, 0, 85, 89, 86, 0, 87, 90, 0, 0,
693 91, 0, 0, 0, 0, 0, 88, 0, 0, 0,
694 89, 92, 0, 0, 90, 0, 93, 91, 94, 0,
695 95, 0, 0, 0, 0, 0, 0, 0, 92, 96,
696 97, 0, 0, 93, 0, 94, 0, 95, 0, 0,
697 0, 0, 0, 0, 98, 0, 96, 97, 0, 0,
698 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
699 0, 98
700};
701
702static const short yycheck[] = { 7,
703 144, 0, 160, 147, 3, 13, 180, 117, 131, 64,
704 65, 64, 65, 64, 65, 183, 183, 8, 4, 8,
705 9, 8, 9, 8, 9, 10, 46, 13, 14, 37,
706 8, 8, 40, 11, 12, 8, 44, 104, 37, 17,
707 210, 40, 8, 130, 99, 44, 99, 28, 56, 8,
708 9, 10, 8, 30, 229, 11, 12, 56, 5, 6,
709 7, 8, 9, 10, 11, 12, 74, 300, 80, 101,
710 180, 194, 41, 243, 105, 74, 231, 232, 109, 37,
711 105, 113, 252, 52, 109, 318, 15, 197, 6, 109,
712 8, 9, 10, 268, 106, 105, 11, 12, 56, 109,
713 99, 109, 157, 8, 157, 113, 11, 12, 283, 106,
714 109, 119, 282, 112, 113, 273, 105, 102, 105, 105,
715 119, 112, 103, 131, 33, 102, 9, 45, 34, 102,
716 108, 241, 131, 184, 302, 302, 102, 224, 248, 84,
717 69, 46, 60, 102, 73, 6, 105, 8, 9, 10,
718 158, 159, 108, 57, 309, 80, 80, 104, 157, 6,
719 69, 8, 9, 10, 104, 84, 8, 105, 86, 11,
720 12, 109, 112, 53, 229, 183, 229, 300, 186, 104,
721 104, 106, 106, 191, 45, 46, 194, 84, 196, 97,
722 98, 99, 100, 4, 317, 318, 306, 3, 45, 21,
723 61, 109, 13, 14, 105, 379, 251, 105, 109, 254,
724 209, 109, 370, 60, 3, 389, 105, 361, 226, 80,
725 109, 107, 11, 12, 12, 86, 105, 235, 12, 39,
726 109, 108, 109, 22, 95, 24, 20, 26, 105, 86,
727 108, 102, 109, 104, 81, 106, 112, 36, 13, 14,
728 6, 40, 8, 9, 10, 44, 81, 41, 47, 43,
729 8, 9, 10, 11, 12, 11, 12, 71, 52, 58,
730 97, 98, 99, 100, 63, 51, 65, 3, 67, 81,
731 278, 279, 112, 281, 3, 104, 110, 76, 77, 45,
732 46, 104, 300, 110, 302, 104, 35, 104, 68, 104,
733 308, 300, 91, 104, 3, 61, 8, 25, 68, 317,
734 318, 106, 320, 112, 112, 104, 106, 325, 68, 318,
735 30, 96, 105, 109, 80, 106, 104, 335, 4, 6,
736 86, 8, 9, 10, 95, 103, 68, 111, 107, 95,
737 106, 113, 101, 105, 107, 22, 104, 24, 104, 26,
738 106, 4, 82, 88, 107, 363, 107, 114, 102, 36,
739 107, 113, 104, 40, 109, 0, 374, 44, 45, 377,
740 47, 107, 112, 107, 0, 3, 13, 26, 133, 74,
741 113, 58, 56, 65, 109, 273, 63, 320, 65, 302,
742 67, 191, 8, 157, 308, 11, 12, 228, 298, 76,
743 77, 389, 18, 224, 340, 217, 22, 23, 24, 86,
744 26, 27, 374, 367, 91, 363, -1, 240, 317, -1,
745 36, -1, -1, -1, 40, -1, -1, 104, 44, -1,
746 -1, 47, 48, 49, 50, -1, -1, -1, -1, -1,
747 56, -1, 58, 59, -1, -1, -1, 63, 64, 65,
748 66, 67, -1, 8, -1, -1, 11, 12, 74, -1,
749 76, 77, 78, 79, -1, -1, -1, 83, 23, 85,
750 -1, -1, -1, -1, 90, 91, 92, 93, 94, -1,
751 -1, -1, -1, 38, -1, -1, -1, 42, -1, -1,
752 -1, -1, -1, 48, 49, 50, -1, -1, -1, 54,
753 -1, -1, -1, -1, 59, -1, -1, -1, -1, 64,
754 -1, 66, -1, -1, -1, -1, -1, -1, -1, 74,
755 -1, -1, -1, -1, -1, -1, -1, -1, 83, -1,
756 85, -1, -1, -1, -1, 90, -1, 92, 93, 94,
757 11, 12, 13, 14, -1, -1, -1, 18, -1, -1,
758 -1, 22, 23, 24, -1, 26, 27, -1, -1, -1,
759 -1, -1, 33, -1, -1, 36, -1, -1, -1, 40,
760 -1, -1, -1, 44, -1, -1, 47, 48, 49, 50,
761 -1, -1, -1, -1, -1, 56, -1, 58, 59, -1,
762 -1, -1, 63, 64, 65, 66, 67, -1, 69, -1,
763 -1, -1, -1, 74, -1, 76, 77, 78, 79, -1,
764 -1, -1, 83, -1, 85, -1, -1, 11, 12, 90,
765 91, 92, 93, 94, 18, -1, -1, -1, 22, 23,
766 24, -1, 26, 27, -1, -1, -1, -1, -1, -1,
767 -1, -1, 36, -1, -1, -1, 40, -1, -1, -1,
768 44, -1, -1, 47, 48, 49, 50, -1, -1, -1,
769 -1, -1, 56, -1, 58, 59, -1, -1, -1, 63,
770 64, 65, 66, 67, -1, -1, -1, -1, -1, -1,
771 74, -1, 76, 77, 78, 79, -1, -1, -1, 83,
772 -1, 85, -1, 87, 11, 12, 90, 91, 92, 93,
773 94, 18, -1, -1, -1, 22, 23, 24, -1, 26,
774 27, -1, -1, -1, -1, -1, -1, -1, -1, 36,
775 -1, -1, -1, 40, -1, -1, -1, 44, -1, -1,
776 47, 48, 49, 50, -1, -1, -1, -1, -1, 56,
777 -1, 58, 59, -1, -1, -1, 63, 64, 65, 66,
778 67, -1, -1, -1, 11, 12, -1, 74, -1, 76,
779 77, 78, 79, -1, -1, 22, 83, 24, 85, 26,
780 -1, 11, 12, 90, 91, 92, 93, 94, -1, 36,
781 -1, -1, 22, 40, 24, -1, 26, 44, -1, -1,
782 47, -1, -1, -1, -1, -1, 36, -1, -1, -1,
783 40, 58, -1, -1, 44, -1, 63, 47, 65, -1,
784 67, -1, -1, -1, -1, -1, -1, -1, 58, 76,
785 77, -1, -1, 63, -1, 65, -1, 67, -1, -1,
786 -1, -1, -1, -1, 91, -1, 76, 77, -1, -1,
787 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
788 -1, 91
789};
790/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
791#line 3 "/usr/share/bison.simple"
792/* This file comes from bison-1.28. */
793
794/* Skeleton output parser for bison,
795 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
796
797 This program is free software; you can redistribute it and/or modify
798 it under the terms of the GNU General Public License as published by
799 the Free Software Foundation; either version 2, or (at your option)
800 any later version.
801
802 This program is distributed in the hope that it will be useful,
803 but WITHOUT ANY WARRANTY; without even the implied warranty of
804 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
805 GNU General Public License for more details.
806
807 You should have received a copy of the GNU General Public License
808 along with this program; if not, write to the Free Software
809 Foundation, Inc., 59 Temple Place - Suite 330,
810 Boston, MA 02111-1307, USA. */
811
812/* As a special exception, when this file is copied by Bison into a
813 Bison output file, you may use that output file without restriction.
814 This special exception was added by the Free Software Foundation
815 in version 1.24 of Bison. */
816
817/* This is the parser code that is written into each bison parser
818 when the %semantic_parser declaration is not specified in the grammar.
819 It was written by Richard Stallman by simplifying the hairy parser
820 used when %semantic_parser is specified. */
821
822#ifndef YYSTACK_USE_ALLOCA
823#ifdef alloca
824#define YYSTACK_USE_ALLOCA
825#else /* alloca not defined */
826#ifdef __GNUC__
827#define YYSTACK_USE_ALLOCA
828#define alloca __builtin_alloca
829#else /* not GNU C. */
830#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
831#define YYSTACK_USE_ALLOCA
832#include <alloca.h>
833#else /* not sparc */
834/* We think this test detects Watcom and Microsoft C. */
835/* This used to test MSDOS, but that is a bad idea
836 since that symbol is in the user namespace. */
837#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
838#if 0 /* No need for malloc.h, which pollutes the namespace;
839 instead, just don't use alloca. */
840#include <malloc.h>
841#endif
842#else /* not MSDOS, or __TURBOC__ */
843#if defined(_AIX)
844/* I don't know what this was needed for, but it pollutes the namespace.
845 So I turned it off. rms, 2 May 1997. */
846/* #include <malloc.h> */
847 #pragma alloca
848#define YYSTACK_USE_ALLOCA
849#else /* not MSDOS, or __TURBOC__, or _AIX */
850#if 0
851#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
852 and on HPUX 10. Eventually we can turn this on. */
853#define YYSTACK_USE_ALLOCA
854#define alloca __builtin_alloca
855#endif /* __hpux */
856#endif
857#endif /* not _AIX */
858#endif /* not MSDOS, or __TURBOC__ */
859#endif /* not sparc */
860#endif /* not GNU C */
861#endif /* alloca not defined */
862#endif /* YYSTACK_USE_ALLOCA not defined */
863
864#ifdef YYSTACK_USE_ALLOCA
865#define YYSTACK_ALLOC alloca
Lev Walkinf15320b2004-06-03 03:38:44 +0000866#else
Lev Walkinceb20e72004-09-05 10:40:41 +0000867#define YYSTACK_ALLOC malloc
Lev Walkinf15320b2004-06-03 03:38:44 +0000868#endif
869
Lev Walkinceb20e72004-09-05 10:40:41 +0000870/* Note: there must be only one dollar sign in this file.
871 It is replaced by the list of actions, each action
872 as one case of the switch. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000873
874#define yyerrok (yyerrstatus = 0)
875#define yyclearin (yychar = YYEMPTY)
876#define YYEMPTY -2
877#define YYEOF 0
878#define YYACCEPT goto yyacceptlab
Lev Walkinceb20e72004-09-05 10:40:41 +0000879#define YYABORT goto yyabortlab
Lev Walkinf15320b2004-06-03 03:38:44 +0000880#define YYERROR goto yyerrlab1
Lev Walkinceb20e72004-09-05 10:40:41 +0000881/* Like YYERROR except do call yyerror.
882 This remains here temporarily to ease the
883 transition to the new meaning of YYERROR, for GCC.
Lev Walkinf15320b2004-06-03 03:38:44 +0000884 Once GCC version 2 has supplanted version 1, this can go. */
885#define YYFAIL goto yyerrlab
886#define YYRECOVERING() (!!yyerrstatus)
Lev Walkinceb20e72004-09-05 10:40:41 +0000887#define YYBACKUP(token, value) \
Lev Walkinf15320b2004-06-03 03:38:44 +0000888do \
889 if (yychar == YYEMPTY && yylen == 1) \
Lev Walkinceb20e72004-09-05 10:40:41 +0000890 { yychar = (token), yylval = (value); \
Lev Walkinf15320b2004-06-03 03:38:44 +0000891 yychar1 = YYTRANSLATE (yychar); \
892 YYPOPSTACK; \
893 goto yybackup; \
894 } \
895 else \
Lev Walkinceb20e72004-09-05 10:40:41 +0000896 { yyerror ("syntax error: cannot back up"); YYERROR; } \
Lev Walkinf15320b2004-06-03 03:38:44 +0000897while (0)
898
899#define YYTERROR 1
900#define YYERRCODE 256
901
Lev Walkinceb20e72004-09-05 10:40:41 +0000902#ifndef YYPURE
903#define YYLEX yylex()
Lev Walkinf15320b2004-06-03 03:38:44 +0000904#endif
905
Lev Walkinceb20e72004-09-05 10:40:41 +0000906#ifdef YYPURE
907#ifdef YYLSP_NEEDED
908#ifdef YYLEX_PARAM
909#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
910#else
911#define YYLEX yylex(&yylval, &yylloc)
912#endif
913#else /* not YYLSP_NEEDED */
914#ifdef YYLEX_PARAM
915#define YYLEX yylex(&yylval, YYLEX_PARAM)
916#else
917#define YYLEX yylex(&yylval)
918#endif
919#endif /* not YYLSP_NEEDED */
920#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000921
Lev Walkinceb20e72004-09-05 10:40:41 +0000922/* If nonreentrant, generate the variables here */
Lev Walkinf15320b2004-06-03 03:38:44 +0000923
Lev Walkinceb20e72004-09-05 10:40:41 +0000924#ifndef YYPURE
Lev Walkinf15320b2004-06-03 03:38:44 +0000925
Lev Walkinceb20e72004-09-05 10:40:41 +0000926int yychar; /* the lookahead symbol */
927YYSTYPE yylval; /* the semantic value of the */
928 /* lookahead symbol */
Lev Walkinf15320b2004-06-03 03:38:44 +0000929
Lev Walkinceb20e72004-09-05 10:40:41 +0000930#ifdef YYLSP_NEEDED
931YYLTYPE yylloc; /* location data for the lookahead */
932 /* symbol */
933#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000934
Lev Walkinceb20e72004-09-05 10:40:41 +0000935int yynerrs; /* number of parse errors so far */
936#endif /* not YYPURE */
937
938#if YYDEBUG != 0
939int yydebug; /* nonzero means print parse trace */
940/* Since this is uninitialized, it does not stop multiple parsers
941 from coexisting. */
942#endif
943
944/* YYINITDEPTH indicates the initial size of the parser's stacks */
945
Lev Walkinf15320b2004-06-03 03:38:44 +0000946#ifndef YYINITDEPTH
Lev Walkinceb20e72004-09-05 10:40:41 +0000947#define YYINITDEPTH 200
Lev Walkinf15320b2004-06-03 03:38:44 +0000948#endif
949
Lev Walkinceb20e72004-09-05 10:40:41 +0000950/* YYMAXDEPTH is the maximum size the stacks can grow to
951 (effective only if the built-in stack extension method is used). */
Lev Walkinf15320b2004-06-03 03:38:44 +0000952
953#if YYMAXDEPTH == 0
Lev Walkinceb20e72004-09-05 10:40:41 +0000954#undef YYMAXDEPTH
Lev Walkinf15320b2004-06-03 03:38:44 +0000955#endif
956
957#ifndef YYMAXDEPTH
Lev Walkinceb20e72004-09-05 10:40:41 +0000958#define YYMAXDEPTH 10000
Lev Walkinf15320b2004-06-03 03:38:44 +0000959#endif
960
Lev Walkinceb20e72004-09-05 10:40:41 +0000961/* Define __yy_memcpy. Note that the size argument
962 should be passed with type unsigned int, because that is what the non-GCC
963 definitions require. With GCC, __builtin_memcpy takes an arg
964 of type size_t, but it can handle unsigned int. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000965
Lev Walkinceb20e72004-09-05 10:40:41 +0000966#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
967#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
968#else /* not GNU C or C++ */
969#ifndef __cplusplus
Lev Walkinf15320b2004-06-03 03:38:44 +0000970
Lev Walkinceb20e72004-09-05 10:40:41 +0000971/* This is the most reliable way to avoid incompatibilities
972 in available built-in functions on various systems. */
Lev Walkin609ccbb2004-09-04 04:49:21 +0000973static void
Lev Walkinceb20e72004-09-05 10:40:41 +0000974__yy_memcpy (to, from, count)
975 char *to;
976 char *from;
977 unsigned int count;
Lev Walkin609ccbb2004-09-04 04:49:21 +0000978{
Lev Walkinceb20e72004-09-05 10:40:41 +0000979 register char *f = from;
980 register char *t = to;
981 register int i = count;
Lev Walkin609ccbb2004-09-04 04:49:21 +0000982
Lev Walkinceb20e72004-09-05 10:40:41 +0000983 while (i-- > 0)
984 *t++ = *f++;
Lev Walkin609ccbb2004-09-04 04:49:21 +0000985}
Lev Walkin609ccbb2004-09-04 04:49:21 +0000986
Lev Walkinceb20e72004-09-05 10:40:41 +0000987#else /* __cplusplus */
Lev Walkin609ccbb2004-09-04 04:49:21 +0000988
Lev Walkinceb20e72004-09-05 10:40:41 +0000989/* This is the most reliable way to avoid incompatibilities
990 in available built-in functions on various systems. */
Lev Walkin609ccbb2004-09-04 04:49:21 +0000991static void
Lev Walkinceb20e72004-09-05 10:40:41 +0000992__yy_memcpy (char *to, char *from, unsigned int count)
Lev Walkin609ccbb2004-09-04 04:49:21 +0000993{
Lev Walkinceb20e72004-09-05 10:40:41 +0000994 register char *t = to;
995 register char *f = from;
996 register int i = count;
Lev Walkin609ccbb2004-09-04 04:49:21 +0000997
Lev Walkinceb20e72004-09-05 10:40:41 +0000998 while (i-- > 0)
999 *t++ = *f++;
Lev Walkinc3b72e92004-06-03 05:07:41 +00001000}
Lev Walkinc3b72e92004-06-03 05:07:41 +00001001
Lev Walkinceb20e72004-09-05 10:40:41 +00001002#endif
1003#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001004
Lev Walkinceb20e72004-09-05 10:40:41 +00001005#line 217 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +00001006
1007/* The user can define YYPARSE_PARAM as the name of an argument to be passed
1008 into yyparse. The argument should have type void *.
1009 It should actually point to an object.
1010 Grammar actions can access the variable by casting it
1011 to the proper pointer type. */
1012
1013#ifdef YYPARSE_PARAM
Lev Walkinceb20e72004-09-05 10:40:41 +00001014#ifdef __cplusplus
1015#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1016#define YYPARSE_PARAM_DECL
1017#else /* not __cplusplus */
1018#define YYPARSE_PARAM_ARG YYPARSE_PARAM
1019#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1020#endif /* not __cplusplus */
1021#else /* not YYPARSE_PARAM */
1022#define YYPARSE_PARAM_ARG
1023#define YYPARSE_PARAM_DECL
1024#endif /* not YYPARSE_PARAM */
Lev Walkinf15320b2004-06-03 03:38:44 +00001025
1026/* Prevent warning if -Wstrict-prototypes. */
1027#ifdef __GNUC__
Lev Walkinceb20e72004-09-05 10:40:41 +00001028#ifdef YYPARSE_PARAM
Lev Walkinf15320b2004-06-03 03:38:44 +00001029int yyparse (void *);
Lev Walkinceb20e72004-09-05 10:40:41 +00001030#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001031int yyparse (void);
Lev Walkinceb20e72004-09-05 10:40:41 +00001032#endif
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001033#endif
Lev Walkin609ccbb2004-09-04 04:49:21 +00001034
Lev Walkinf15320b2004-06-03 03:38:44 +00001035int
Lev Walkinceb20e72004-09-05 10:40:41 +00001036yyparse(YYPARSE_PARAM_ARG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001037 YYPARSE_PARAM_DECL
1038{
1039 register int yystate;
1040 register int yyn;
1041 register short *yyssp;
1042 register YYSTYPE *yyvsp;
Lev Walkinceb20e72004-09-05 10:40:41 +00001043 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1044 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
Lev Walkinf15320b2004-06-03 03:38:44 +00001045
Lev Walkinceb20e72004-09-05 10:40:41 +00001046 short yyssa[YYINITDEPTH]; /* the state stack */
1047 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
Lev Walkinf15320b2004-06-03 03:38:44 +00001048
Lev Walkinceb20e72004-09-05 10:40:41 +00001049 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1050 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
Lev Walkinf15320b2004-06-03 03:38:44 +00001051
Lev Walkinceb20e72004-09-05 10:40:41 +00001052#ifdef YYLSP_NEEDED
1053 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1054 YYLTYPE *yyls = yylsa;
1055 YYLTYPE *yylsp;
1056
1057#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1058#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001059#define YYPOPSTACK (yyvsp--, yyssp--)
Lev Walkinceb20e72004-09-05 10:40:41 +00001060#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001061
Lev Walkinceb20e72004-09-05 10:40:41 +00001062 int yystacksize = YYINITDEPTH;
1063 int yyfree_stacks = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00001064
Lev Walkinceb20e72004-09-05 10:40:41 +00001065#ifdef YYPURE
1066 int yychar;
1067 YYSTYPE yylval;
1068 int yynerrs;
1069#ifdef YYLSP_NEEDED
1070 YYLTYPE yylloc;
1071#endif
1072#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001073
Lev Walkinceb20e72004-09-05 10:40:41 +00001074 YYSTYPE yyval; /* the variable used to return */
1075 /* semantic values from the action */
1076 /* routines */
Lev Walkinf15320b2004-06-03 03:38:44 +00001077
1078 int yylen;
1079
Lev Walkinceb20e72004-09-05 10:40:41 +00001080#if YYDEBUG != 0
1081 if (yydebug)
1082 fprintf(stderr, "Starting parse\n");
1083#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001084
1085 yystate = 0;
1086 yyerrstatus = 0;
1087 yynerrs = 0;
1088 yychar = YYEMPTY; /* Cause a token to be read. */
1089
1090 /* Initialize stack pointers.
1091 Waste one element of value and location stack
1092 so that they stay on the same level as the state stack.
1093 The wasted elements are never initialized. */
1094
Lev Walkinceb20e72004-09-05 10:40:41 +00001095 yyssp = yyss - 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001096 yyvsp = yyvs;
Lev Walkinceb20e72004-09-05 10:40:41 +00001097#ifdef YYLSP_NEEDED
1098 yylsp = yyls;
1099#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001100
Lev Walkinceb20e72004-09-05 10:40:41 +00001101/* Push a new state, which is found in yystate . */
1102/* In all cases, when you get here, the value and location stacks
1103 have just been pushed. so pushing a state here evens the stacks. */
1104yynewstate:
Lev Walkinf15320b2004-06-03 03:38:44 +00001105
Lev Walkinceb20e72004-09-05 10:40:41 +00001106 *++yyssp = yystate;
Lev Walkinf15320b2004-06-03 03:38:44 +00001107
1108 if (yyssp >= yyss + yystacksize - 1)
1109 {
Lev Walkinceb20e72004-09-05 10:40:41 +00001110 /* Give user a chance to reallocate the stack */
1111 /* Use copies of these so that the &'s don't force the real ones into memory. */
1112 YYSTYPE *yyvs1 = yyvs;
1113 short *yyss1 = yyss;
1114#ifdef YYLSP_NEEDED
1115 YYLTYPE *yyls1 = yyls;
1116#endif
1117
Lev Walkinf15320b2004-06-03 03:38:44 +00001118 /* Get the current used size of the three stacks, in elements. */
Lev Walkinceb20e72004-09-05 10:40:41 +00001119 int size = yyssp - yyss + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001120
1121#ifdef yyoverflow
Lev Walkinceb20e72004-09-05 10:40:41 +00001122 /* Each stack pointer address is followed by the size of
1123 the data in use in that stack, in bytes. */
1124#ifdef YYLSP_NEEDED
1125 /* This used to be a conditional around just the two extra args,
1126 but that might be undefined if yyoverflow is a macro. */
1127 yyoverflow("parser stack overflow",
1128 &yyss1, size * sizeof (*yyssp),
1129 &yyvs1, size * sizeof (*yyvsp),
1130 &yyls1, size * sizeof (*yylsp),
1131 &yystacksize);
1132#else
1133 yyoverflow("parser stack overflow",
1134 &yyss1, size * sizeof (*yyssp),
1135 &yyvs1, size * sizeof (*yyvsp),
1136 &yystacksize);
1137#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001138
Lev Walkinceb20e72004-09-05 10:40:41 +00001139 yyss = yyss1; yyvs = yyvs1;
1140#ifdef YYLSP_NEEDED
1141 yyls = yyls1;
1142#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001143#else /* no yyoverflow */
1144 /* Extend the stack our own way. */
1145 if (yystacksize >= YYMAXDEPTH)
Lev Walkinceb20e72004-09-05 10:40:41 +00001146 {
1147 yyerror("parser stack overflow");
1148 if (yyfree_stacks)
1149 {
1150 free (yyss);
1151 free (yyvs);
1152#ifdef YYLSP_NEEDED
1153 free (yyls);
1154#endif
1155 }
1156 return 2;
1157 }
Lev Walkinf15320b2004-06-03 03:38:44 +00001158 yystacksize *= 2;
1159 if (yystacksize > YYMAXDEPTH)
1160 yystacksize = YYMAXDEPTH;
Lev Walkinceb20e72004-09-05 10:40:41 +00001161#ifndef YYSTACK_USE_ALLOCA
1162 yyfree_stacks = 1;
1163#endif
1164 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1165 __yy_memcpy ((char *)yyss, (char *)yyss1,
1166 size * (unsigned int) sizeof (*yyssp));
1167 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1168 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1169 size * (unsigned int) sizeof (*yyvsp));
1170#ifdef YYLSP_NEEDED
1171 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1172 __yy_memcpy ((char *)yyls, (char *)yyls1,
1173 size * (unsigned int) sizeof (*yylsp));
1174#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001175#endif /* no yyoverflow */
1176
Lev Walkinceb20e72004-09-05 10:40:41 +00001177 yyssp = yyss + size - 1;
1178 yyvsp = yyvs + size - 1;
1179#ifdef YYLSP_NEEDED
1180 yylsp = yyls + size - 1;
1181#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001182
Lev Walkinceb20e72004-09-05 10:40:41 +00001183#if YYDEBUG != 0
1184 if (yydebug)
1185 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1186#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001187
1188 if (yyssp >= yyss + yystacksize - 1)
1189 YYABORT;
1190 }
1191
Lev Walkinceb20e72004-09-05 10:40:41 +00001192#if YYDEBUG != 0
1193 if (yydebug)
1194 fprintf(stderr, "Entering state %d\n", yystate);
1195#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001196
1197 goto yybackup;
Lev Walkinceb20e72004-09-05 10:40:41 +00001198 yybackup:
Lev Walkinf15320b2004-06-03 03:38:44 +00001199
1200/* Do appropriate processing given the current state. */
1201/* Read a lookahead token if we need one and don't already have one. */
1202/* yyresume: */
1203
1204 /* First try to decide what to do without reference to lookahead token. */
1205
1206 yyn = yypact[yystate];
Lev Walkinceb20e72004-09-05 10:40:41 +00001207 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001208 goto yydefault;
1209
1210 /* Not known => get a lookahead token if don't already have one. */
1211
1212 /* yychar is either YYEMPTY or YYEOF
1213 or a valid token in external form. */
1214
1215 if (yychar == YYEMPTY)
1216 {
Lev Walkinceb20e72004-09-05 10:40:41 +00001217#if YYDEBUG != 0
1218 if (yydebug)
1219 fprintf(stderr, "Reading a token: ");
1220#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001221 yychar = YYLEX;
1222 }
1223
Lev Walkinceb20e72004-09-05 10:40:41 +00001224 /* Convert token to internal form (in yychar1) for indexing tables with */
Lev Walkinf15320b2004-06-03 03:38:44 +00001225
Lev Walkinceb20e72004-09-05 10:40:41 +00001226 if (yychar <= 0) /* This means end of input. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001227 {
1228 yychar1 = 0;
Lev Walkinceb20e72004-09-05 10:40:41 +00001229 yychar = YYEOF; /* Don't call YYLEX any more */
Lev Walkinf15320b2004-06-03 03:38:44 +00001230
Lev Walkinceb20e72004-09-05 10:40:41 +00001231#if YYDEBUG != 0
1232 if (yydebug)
1233 fprintf(stderr, "Now at end of input.\n");
1234#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001235 }
1236 else
1237 {
Lev Walkinceb20e72004-09-05 10:40:41 +00001238 yychar1 = YYTRANSLATE(yychar);
Lev Walkinf15320b2004-06-03 03:38:44 +00001239
Lev Walkinceb20e72004-09-05 10:40:41 +00001240#if YYDEBUG != 0
1241 if (yydebug)
1242 {
1243 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1244 /* Give the individual parser a way to print the precise meaning
1245 of a token, for further debugging info. */
1246#ifdef YYPRINT
1247 YYPRINT (stderr, yychar, yylval);
1248#endif
1249 fprintf (stderr, ")\n");
1250 }
1251#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001252 }
1253
1254 yyn += yychar1;
Lev Walkinceb20e72004-09-05 10:40:41 +00001255 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
Lev Walkinf15320b2004-06-03 03:38:44 +00001256 goto yydefault;
Lev Walkinceb20e72004-09-05 10:40:41 +00001257
Lev Walkinf15320b2004-06-03 03:38:44 +00001258 yyn = yytable[yyn];
Lev Walkinceb20e72004-09-05 10:40:41 +00001259
1260 /* yyn is what to do for this token type in this state.
1261 Negative => reduce, -yyn is rule number.
1262 Positive => shift, yyn is new state.
1263 New state is final state => don't bother to shift,
1264 just return success.
1265 0, or most negative number => error. */
1266
1267 if (yyn < 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001268 {
Lev Walkinceb20e72004-09-05 10:40:41 +00001269 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001270 goto yyerrlab;
1271 yyn = -yyn;
1272 goto yyreduce;
1273 }
Lev Walkinceb20e72004-09-05 10:40:41 +00001274 else if (yyn == 0)
1275 goto yyerrlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00001276
1277 if (yyn == YYFINAL)
1278 YYACCEPT;
1279
1280 /* Shift the lookahead token. */
Lev Walkinceb20e72004-09-05 10:40:41 +00001281
1282#if YYDEBUG != 0
1283 if (yydebug)
1284 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1285#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001286
1287 /* Discard the token being shifted unless it is eof. */
1288 if (yychar != YYEOF)
1289 yychar = YYEMPTY;
1290
1291 *++yyvsp = yylval;
Lev Walkinceb20e72004-09-05 10:40:41 +00001292#ifdef YYLSP_NEEDED
1293 *++yylsp = yylloc;
1294#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001295
Lev Walkinceb20e72004-09-05 10:40:41 +00001296 /* count tokens shifted since error; after three, turn off error status. */
1297 if (yyerrstatus) yyerrstatus--;
Lev Walkinf15320b2004-06-03 03:38:44 +00001298
1299 yystate = yyn;
1300 goto yynewstate;
1301
Lev Walkinceb20e72004-09-05 10:40:41 +00001302/* Do the default action for the current state. */
Lev Walkin609ccbb2004-09-04 04:49:21 +00001303yydefault:
Lev Walkinceb20e72004-09-05 10:40:41 +00001304
Lev Walkinf15320b2004-06-03 03:38:44 +00001305 yyn = yydefact[yystate];
1306 if (yyn == 0)
1307 goto yyerrlab;
1308
Lev Walkinceb20e72004-09-05 10:40:41 +00001309/* Do a reduction. yyn is the number of a rule to reduce with. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001310yyreduce:
1311 yylen = yyr2[yyn];
Lev Walkinceb20e72004-09-05 10:40:41 +00001312 if (yylen > 0)
1313 yyval = yyvsp[1-yylen]; /* implement default value of the action */
Lev Walkinf15320b2004-06-03 03:38:44 +00001314
Lev Walkinceb20e72004-09-05 10:40:41 +00001315#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00001316 if (yydebug)
1317 {
Lev Walkinceb20e72004-09-05 10:40:41 +00001318 int i;
Lev Walkinf15320b2004-06-03 03:38:44 +00001319
Lev Walkinceb20e72004-09-05 10:40:41 +00001320 fprintf (stderr, "Reducing via rule %d (line %d), ",
1321 yyn, yyrline[yyn]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001322
1323 /* Print the symbols being reduced, and their result. */
Lev Walkinceb20e72004-09-05 10:40:41 +00001324 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1325 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1326 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001327 }
1328#endif
Lev Walkin609ccbb2004-09-04 04:49:21 +00001329
Lev Walkinceb20e72004-09-05 10:40:41 +00001330
1331 switch (yyn) {
1332
1333case 1:
1334#line 301 "asn1p_y.y"
1335{
1336 *(void **)param = yyvsp[0].a_grammar;
1337 ;
1338 break;}
1339case 2:
1340#line 307 "asn1p_y.y"
1341{
Lev Walkinf15320b2004-06-03 03:38:44 +00001342 yyval.a_grammar = asn1p_new();
1343 checkmem(yyval.a_grammar);
1344 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001345 ;
1346 break;}
1347case 3:
1348#line 312 "asn1p_y.y"
1349{
Lev Walkinf15320b2004-06-03 03:38:44 +00001350 yyval.a_grammar = yyvsp[-1].a_grammar;
1351 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001352 ;
1353 break;}
1354case 4:
1355#line 333 "asn1p_y.y"
1356{
Lev Walkinf15320b2004-06-03 03:38:44 +00001357
1358 if(yyvsp[-1].a_module) {
1359 yyval.a_module = yyvsp[-1].a_module;
1360 } else {
1361 /* There's a chance that a module is just plain empty */
1362 yyval.a_module = asn1p_module_new();
1363 }
1364 checkmem(yyval.a_module);
1365
1366 yyval.a_module->Identifier = yyvsp[-7].tv_str;
1367 yyval.a_module->module_oid = yyvsp[-6].a_oid;
1368 yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
Lev Walkinceb20e72004-09-05 10:40:41 +00001369 ;
1370 break;}
1371case 5:
1372#line 354 "asn1p_y.y"
1373{ yyval.a_oid = 0; ;
1374 break;}
1375case 6:
1376#line 355 "asn1p_y.y"
1377{ yyval.a_oid = yyvsp[0].a_oid; ;
1378 break;}
1379case 7:
1380#line 359 "asn1p_y.y"
1381{
Lev Walkinf15320b2004-06-03 03:38:44 +00001382 yyval.a_oid = yyvsp[-1].a_oid;
Lev Walkinceb20e72004-09-05 10:40:41 +00001383 ;
1384 break;}
1385case 8:
1386#line 362 "asn1p_y.y"
1387{
Lev Walkinf15320b2004-06-03 03:38:44 +00001388 yyval.a_oid = 0;
Lev Walkinceb20e72004-09-05 10:40:41 +00001389 ;
1390 break;}
1391case 9:
1392#line 368 "asn1p_y.y"
1393{
Lev Walkinf15320b2004-06-03 03:38:44 +00001394 yyval.a_oid = asn1p_oid_new();
1395 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1396 if(yyvsp[0].a_oid_arc.name)
1397 free(yyvsp[0].a_oid_arc.name);
Lev Walkinceb20e72004-09-05 10:40:41 +00001398 ;
1399 break;}
1400case 10:
1401#line 374 "asn1p_y.y"
1402{
Lev Walkinf15320b2004-06-03 03:38:44 +00001403 yyval.a_oid = yyvsp[-1].a_oid;
1404 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1405 if(yyvsp[0].a_oid_arc.name)
1406 free(yyvsp[0].a_oid_arc.name);
Lev Walkinceb20e72004-09-05 10:40:41 +00001407 ;
1408 break;}
1409case 11:
1410#line 383 "asn1p_y.y"
1411{ /* iso */
Lev Walkinf15320b2004-06-03 03:38:44 +00001412 yyval.a_oid_arc.name = yyvsp[0].tv_str;
1413 yyval.a_oid_arc.number = -1;
Lev Walkinceb20e72004-09-05 10:40:41 +00001414 ;
1415 break;}
1416case 12:
1417#line 387 "asn1p_y.y"
1418{ /* iso(1) */
Lev Walkinf15320b2004-06-03 03:38:44 +00001419 yyval.a_oid_arc.name = yyvsp[-3].tv_str;
1420 yyval.a_oid_arc.number = yyvsp[-1].a_int;
Lev Walkinceb20e72004-09-05 10:40:41 +00001421 ;
1422 break;}
1423case 13:
1424#line 391 "asn1p_y.y"
1425{ /* 1 */
Lev Walkinf15320b2004-06-03 03:38:44 +00001426 yyval.a_oid_arc.name = 0;
1427 yyval.a_oid_arc.number = yyvsp[0].a_int;
Lev Walkinceb20e72004-09-05 10:40:41 +00001428 ;
1429 break;}
1430case 14:
1431#line 401 "asn1p_y.y"
1432{ yyval.a_module_flags = MSF_NOFLAGS; ;
1433 break;}
1434case 15:
1435#line 402 "asn1p_y.y"
1436{
Lev Walkinf15320b2004-06-03 03:38:44 +00001437 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkinceb20e72004-09-05 10:40:41 +00001438 ;
1439 break;}
1440case 16:
1441#line 411 "asn1p_y.y"
1442{
Lev Walkinf15320b2004-06-03 03:38:44 +00001443 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkinceb20e72004-09-05 10:40:41 +00001444 ;
1445 break;}
1446case 17:
1447#line 414 "asn1p_y.y"
1448{
Lev Walkinf15320b2004-06-03 03:38:44 +00001449 yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
Lev Walkinceb20e72004-09-05 10:40:41 +00001450 ;
1451 break;}
1452case 18:
1453#line 423 "asn1p_y.y"
1454{
Lev Walkinf15320b2004-06-03 03:38:44 +00001455 yyval.a_module_flags = MSF_EXPLICIT_TAGS;
Lev Walkinceb20e72004-09-05 10:40:41 +00001456 ;
1457 break;}
1458case 19:
1459#line 426 "asn1p_y.y"
1460{
Lev Walkinf15320b2004-06-03 03:38:44 +00001461 yyval.a_module_flags = MSF_IMPLICIT_TAGS;
Lev Walkinceb20e72004-09-05 10:40:41 +00001462 ;
1463 break;}
1464case 20:
1465#line 429 "asn1p_y.y"
1466{
Lev Walkinf15320b2004-06-03 03:38:44 +00001467 yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
Lev Walkinceb20e72004-09-05 10:40:41 +00001468 ;
1469 break;}
1470case 21:
1471#line 432 "asn1p_y.y"
1472{
Lev Walkinf15320b2004-06-03 03:38:44 +00001473 yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
Lev Walkinceb20e72004-09-05 10:40:41 +00001474 ;
1475 break;}
1476case 22:
1477#line 436 "asn1p_y.y"
1478{
Lev Walkinf59d0752004-08-18 04:59:12 +00001479 /* X.680Amd1 specifies TAG and XER */
1480 if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) {
1481 yyval.a_module_flags = MSF_TAG_INSTRUCTIONS;
1482 } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) {
1483 yyval.a_module_flags = MSF_XER_INSTRUCTIONS;
1484 } else {
1485 fprintf(stderr,
1486 "WARNING: %s INSTRUCTIONS at line %d: "
1487 "Unrecognized encoding reference\n",
1488 yyvsp[-1].tv_str, yylineno);
1489 yyval.a_module_flags = MSF_unk_INSTRUCTIONS;
1490 }
1491 free(yyvsp[-1].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00001492 ;
1493 break;}
1494case 23:
1495#line 457 "asn1p_y.y"
1496{ yyval.a_module = 0; ;
1497 break;}
1498case 24:
1499#line 458 "asn1p_y.y"
1500{
Lev Walkinf15320b2004-06-03 03:38:44 +00001501 yyval.a_module = yyvsp[0].a_module;
Lev Walkinceb20e72004-09-05 10:40:41 +00001502 ;
1503 break;}
1504case 25:
1505#line 467 "asn1p_y.y"
1506{
Lev Walkinf59d0752004-08-18 04:59:12 +00001507 yyval.a_module = yyvsp[0].a_module;
Lev Walkinceb20e72004-09-05 10:40:41 +00001508 ;
1509 break;}
1510case 26:
1511#line 470 "asn1p_y.y"
1512{
Lev Walkinf15320b2004-06-03 03:38:44 +00001513 yyval.a_module = yyvsp[-1].a_module;
1514
Lev Walkinf59d0752004-08-18 04:59:12 +00001515 /* Behave well when one of them is skipped. */
1516 if(!(yyvsp[-1].a_module)) {
1517 if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module;
1518 break;
1519 }
1520
Lev Walkinf15320b2004-06-03 03:38:44 +00001521#ifdef MY_IMPORT
1522#error MY_IMPORT DEFINED ELSEWHERE!
1523#endif
1524#define MY_IMPORT(foo,field) do { \
Lev Walkinbc55d232004-08-13 12:31:09 +00001525 while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
Lev Walkinf15320b2004-06-03 03:38:44 +00001526 TQ_ADD(&(yyval.a_module->foo), \
1527 TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
1528 field); \
Lev Walkinbc55d232004-08-13 12:31:09 +00001529 } \
1530 assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
1531 } while(0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001532
1533 MY_IMPORT(imports, xp_next);
1534 MY_IMPORT(exports, xp_next);
1535 MY_IMPORT(members, next);
1536#undef MY_IMPORT
1537
Lev Walkinceb20e72004-09-05 10:40:41 +00001538 ;
1539 break;}
1540case 27:
1541#line 503 "asn1p_y.y"
1542{
Lev Walkinf15320b2004-06-03 03:38:44 +00001543 yyval.a_module = yyvsp[0].a_module;
Lev Walkinceb20e72004-09-05 10:40:41 +00001544 ;
1545 break;}
1546case 28:
1547#line 506 "asn1p_y.y"
1548{
Lev Walkinf15320b2004-06-03 03:38:44 +00001549 yyval.a_module = asn1p_module_new();
1550 checkmem(yyval.a_module);
1551 if(yyvsp[0].a_xports) {
1552 TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
1553 } else {
1554 /* "EXPORTS ALL;" ? */
1555 }
Lev Walkinceb20e72004-09-05 10:40:41 +00001556 ;
1557 break;}
1558case 29:
1559#line 515 "asn1p_y.y"
1560{
Lev Walkinf15320b2004-06-03 03:38:44 +00001561 yyval.a_module = asn1p_module_new();
1562 checkmem(yyval.a_module);
1563 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1564 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1565 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001566 ;
1567 break;}
1568case 30:
1569#line 522 "asn1p_y.y"
1570{
Lev Walkinf59d0752004-08-18 04:59:12 +00001571 yyval.a_module = asn1p_module_new();
1572 checkmem(yyval.a_module);
1573 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1574 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1575 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001576 ;
1577 break;}
1578case 31:
1579#line 535 "asn1p_y.y"
1580{
Lev Walkinf59d0752004-08-18 04:59:12 +00001581 yyval.a_module = asn1p_module_new();
1582 checkmem(yyval.a_module);
1583 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1584 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1585 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001586 ;
1587 break;}
1588case 32:
1589#line 543 "asn1p_y.y"
1590{ asn1p_lexer_hack_push_encoding_control(); ;
1591 break;}
1592case 33:
1593#line 544 "asn1p_y.y"
1594{
Lev Walkinf59d0752004-08-18 04:59:12 +00001595 fprintf(stderr,
1596 "WARNING: ENCODING-CONTROL %s "
1597 "specification at line %d ignored\n",
1598 yyvsp[-1].tv_str, yylineno);
1599 free(yyvsp[-1].tv_str);
1600 yyval.a_module = 0;
Lev Walkinceb20e72004-09-05 10:40:41 +00001601 ;
1602 break;}
1603case 34:
1604#line 556 "asn1p_y.y"
1605{
Lev Walkinf15320b2004-06-03 03:38:44 +00001606 return yyerror(
1607 "Attempt to redefine a standard basic type, "
1608 "use -ftypesXY to switch back "
1609 "to older version of ASN.1 standard");
Lev Walkinceb20e72004-09-05 10:40:41 +00001610 ;
1611 break;}
1612case 35:
1613#line 570 "asn1p_y.y"
1614{
Lev Walkinf15320b2004-06-03 03:38:44 +00001615 yyval.a_module = yyvsp[-1].a_module;
Lev Walkinceb20e72004-09-05 10:40:41 +00001616 ;
1617 break;}
1618case 36:
1619#line 576 "asn1p_y.y"
1620{
Lev Walkinf15320b2004-06-03 03:38:44 +00001621 return yyerror("Empty IMPORTS list");
Lev Walkinceb20e72004-09-05 10:40:41 +00001622 ;
1623 break;}
1624case 37:
1625#line 582 "asn1p_y.y"
1626{
Lev Walkinf15320b2004-06-03 03:38:44 +00001627 yyval.a_module = asn1p_module_new();
1628 checkmem(yyval.a_module);
1629 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001630 ;
1631 break;}
1632case 38:
1633#line 587 "asn1p_y.y"
1634{
Lev Walkinf15320b2004-06-03 03:38:44 +00001635 yyval.a_module = yyvsp[-1].a_module;
1636 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001637 ;
1638 break;}
1639case 39:
1640#line 594 "asn1p_y.y"
1641{
Lev Walkinf15320b2004-06-03 03:38:44 +00001642 yyval.a_xports = yyvsp[-3].a_xports;
1643 yyval.a_xports->from = yyvsp[-1].tv_str;
1644 yyval.a_xports->from_oid = yyvsp[0].a_oid;
1645 checkmem(yyval.a_xports);
Lev Walkinceb20e72004-09-05 10:40:41 +00001646 ;
1647 break;}
1648case 40:
1649#line 603 "asn1p_y.y"
1650{
Lev Walkinf15320b2004-06-03 03:38:44 +00001651 yyval.a_xports = asn1p_xports_new();
1652 checkmem(yyval.a_xports);
1653 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001654 ;
1655 break;}
1656case 41:
1657#line 608 "asn1p_y.y"
1658{
Lev Walkinf15320b2004-06-03 03:38:44 +00001659 yyval.a_xports = yyvsp[-2].a_xports;
1660 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001661 ;
1662 break;}
1663case 42:
1664#line 615 "asn1p_y.y"
1665{
Lev Walkinf15320b2004-06-03 03:38:44 +00001666 yyval.a_expr = asn1p_expr_new(yylineno);
1667 checkmem(yyval.a_expr);
1668 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1669 yyval.a_expr->expr_type = A1TC_REFERENCE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001670 ;
1671 break;}
1672case 43:
1673#line 621 "asn1p_y.y"
1674{
Lev Walkinf15320b2004-06-03 03:38:44 +00001675 yyval.a_expr = asn1p_expr_new(yylineno);
1676 checkmem(yyval.a_expr);
1677 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1678 yyval.a_expr->expr_type = A1TC_REFERENCE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001679 ;
1680 break;}
1681case 44:
1682#line 630 "asn1p_y.y"
1683{
Lev Walkinf15320b2004-06-03 03:38:44 +00001684 yyval.a_xports = yyvsp[-1].a_xports;
Lev Walkinceb20e72004-09-05 10:40:41 +00001685 ;
1686 break;}
1687case 45:
1688#line 633 "asn1p_y.y"
1689{
Lev Walkinf15320b2004-06-03 03:38:44 +00001690 yyval.a_xports = 0;
Lev Walkinceb20e72004-09-05 10:40:41 +00001691 ;
1692 break;}
1693case 46:
1694#line 636 "asn1p_y.y"
1695{
Lev Walkinf15320b2004-06-03 03:38:44 +00001696 /* Empty EXPORTS clause effectively prohibits export. */
1697 yyval.a_xports = asn1p_xports_new();
1698 checkmem(yyval.a_xports);
Lev Walkinceb20e72004-09-05 10:40:41 +00001699 ;
1700 break;}
1701case 47:
1702#line 644 "asn1p_y.y"
1703{
Lev Walkinf15320b2004-06-03 03:38:44 +00001704 yyval.a_xports = asn1p_xports_new();
1705 assert(yyval.a_xports);
1706 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001707 ;
1708 break;}
1709case 48:
1710#line 649 "asn1p_y.y"
1711{
Lev Walkinf15320b2004-06-03 03:38:44 +00001712 yyval.a_xports = yyvsp[-2].a_xports;
1713 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001714 ;
1715 break;}
1716case 49:
1717#line 656 "asn1p_y.y"
1718{
Lev Walkinf15320b2004-06-03 03:38:44 +00001719 yyval.a_expr = asn1p_expr_new(yylineno);
1720 checkmem(yyval.a_expr);
1721 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1722 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
Lev Walkinceb20e72004-09-05 10:40:41 +00001723 ;
1724 break;}
1725case 50:
1726#line 662 "asn1p_y.y"
1727{
Lev Walkinf15320b2004-06-03 03:38:44 +00001728 yyval.a_expr = asn1p_expr_new(yylineno);
1729 checkmem(yyval.a_expr);
1730 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1731 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
Lev Walkinceb20e72004-09-05 10:40:41 +00001732 ;
1733 break;}
1734case 51:
1735#line 672 "asn1p_y.y"
1736{
Lev Walkinf15320b2004-06-03 03:38:44 +00001737 yyval.a_expr = yyvsp[-4].a_expr;
1738 assert(yyval.a_expr->Identifier == 0);
1739 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1740 yyval.a_expr->meta_type = AMT_VALUESET;
1741 // take care of optValueSetBody
Lev Walkinceb20e72004-09-05 10:40:41 +00001742 ;
1743 break;}
1744case 52:
1745#line 682 "asn1p_y.y"
1746{
Lev Walkinf15320b2004-06-03 03:38:44 +00001747 yyval.a_expr = asn1p_expr_new(yylineno);
1748 checkmem(yyval.a_expr);
1749 yyval.a_expr->reference = yyvsp[0].a_ref;
1750 yyval.a_expr->expr_type = A1TC_REFERENCE;
1751 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkinceb20e72004-09-05 10:40:41 +00001752 ;
1753 break;}
1754case 53:
1755#line 689 "asn1p_y.y"
1756{
Lev Walkinf15320b2004-06-03 03:38:44 +00001757 yyval.a_expr = asn1p_expr_new(yylineno);
1758 checkmem(yyval.a_expr);
1759 yyval.a_expr->expr_type = yyvsp[0].a_type;
1760 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001761 ;
1762 break;}
1763case 54:
1764#line 698 "asn1p_y.y"
1765{ ;
1766 break;}
1767case 55:
1768#line 699 "asn1p_y.y"
1769{
1770 ;
1771 break;}
1772case 56:
1773#line 710 "asn1p_y.y"
1774{
1775 ;
1776 break;}
1777case 57:
1778#line 712 "asn1p_y.y"
1779{
1780 ;
1781 break;}
1782case 58:
1783#line 717 "asn1p_y.y"
1784{
1785 ;
1786 break;}
1787case 59:
1788#line 719 "asn1p_y.y"
1789{
1790 ;
1791 break;}
1792case 60:
1793#line 735 "asn1p_y.y"
1794{
Lev Walkinf15320b2004-06-03 03:38:44 +00001795 yyval.a_expr = asn1p_expr_new(yylineno);
1796 checkmem(yyval.a_expr);
1797 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
1798 yyval.a_expr->tag = yyvsp[-1].a_tag;
1799 yyval.a_expr->expr_type = A1TC_TYPEID;
1800 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001801 ;
1802 break;}
1803case 61:
1804#line 743 "asn1p_y.y"
1805{
Lev Walkinf15320b2004-06-03 03:38:44 +00001806 yyval.a_expr = yyvsp[0].a_expr;
1807 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
1808 yyval.a_expr->tag = yyvsp[-1].a_tag;
1809 assert(yyval.a_expr->expr_type);
1810 assert(yyval.a_expr->meta_type);
Lev Walkinceb20e72004-09-05 10:40:41 +00001811 ;
1812 break;}
1813case 62:
1814#line 750 "asn1p_y.y"
1815{
Lev Walkinf15320b2004-06-03 03:38:44 +00001816 yyval.a_expr = yyvsp[0].a_expr;
1817 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1818 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1819 assert(yyval.a_expr->meta_type == AMT_OBJECT);
Lev Walkinceb20e72004-09-05 10:40:41 +00001820 ;
1821 break;}
1822case 63:
1823#line 766 "asn1p_y.y"
1824{
Lev Walkinf15320b2004-06-03 03:38:44 +00001825 yyval.a_expr = yyvsp[0].a_expr;
1826 assert(yyval.a_expr->Identifier == 0);
1827 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1828 yyval.a_expr->params = yyvsp[-3].a_plist;
1829 yyval.a_expr->meta_type = AMT_PARAMTYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001830 ;
1831 break;}
1832case 64:
1833#line 776 "asn1p_y.y"
1834{
Lev Walkinf15320b2004-06-03 03:38:44 +00001835 int ret;
1836 yyval.a_plist = asn1p_paramlist_new(yylineno);
1837 checkmem(yyval.a_plist);
1838 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1839 checkmem(ret == 0);
1840 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1841 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkinceb20e72004-09-05 10:40:41 +00001842 ;
1843 break;}
1844case 65:
1845#line 785 "asn1p_y.y"
1846{
Lev Walkinf15320b2004-06-03 03:38:44 +00001847 int ret;
1848 yyval.a_plist = yyvsp[-2].a_plist;
1849 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1850 checkmem(ret == 0);
1851 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1852 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkinceb20e72004-09-05 10:40:41 +00001853 ;
1854 break;}
1855case 66:
1856#line 796 "asn1p_y.y"
1857{
Lev Walkinf15320b2004-06-03 03:38:44 +00001858 yyval.a_parg.governor = NULL;
1859 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00001860 ;
1861 break;}
1862case 67:
1863#line 800 "asn1p_y.y"
1864{
Lev Walkinf15320b2004-06-03 03:38:44 +00001865 int ret;
1866 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1867 ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
1868 checkmem(ret == 0);
1869 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00001870 ;
1871 break;}
1872case 68:
1873#line 807 "asn1p_y.y"
1874{
Lev Walkinf15320b2004-06-03 03:38:44 +00001875 int ret;
1876 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1877 ret = asn1p_ref_add_component(yyval.a_parg.governor,
1878 ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
1879 checkmem(ret == 0);
1880 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00001881 ;
1882 break;}
1883case 69:
1884#line 818 "asn1p_y.y"
1885{
Lev Walkinf15320b2004-06-03 03:38:44 +00001886 yyval.a_expr = asn1p_expr_new(yylineno);
1887 checkmem(yyval.a_expr);
1888 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001889 ;
1890 break;}
1891case 70:
1892#line 823 "asn1p_y.y"
1893{
Lev Walkinf15320b2004-06-03 03:38:44 +00001894 yyval.a_expr = yyvsp[-2].a_expr;
1895 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001896 ;
1897 break;}
1898case 71:
1899#line 830 "asn1p_y.y"
1900{
Lev Walkinf15320b2004-06-03 03:38:44 +00001901 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinceb20e72004-09-05 10:40:41 +00001902 ;
1903 break;}
1904case 72:
1905#line 833 "asn1p_y.y"
1906{
Lev Walkinf15320b2004-06-03 03:38:44 +00001907 yyval.a_expr = asn1p_expr_new(yylineno);
1908 checkmem(yyval.a_expr);
1909 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1910 yyval.a_expr->expr_type = A1TC_REFERENCE;
1911 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkinceb20e72004-09-05 10:40:41 +00001912 ;
1913 break;}
1914case 73:
1915#line 846 "asn1p_y.y"
1916{
Lev Walkinf15320b2004-06-03 03:38:44 +00001917 yyval.a_expr = asn1p_expr_new(yylineno);
1918 checkmem(yyval.a_expr);
1919 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001920 ;
1921 break;}
1922case 74:
1923#line 851 "asn1p_y.y"
1924{
Lev Walkinf15320b2004-06-03 03:38:44 +00001925 yyval.a_expr = yyvsp[-2].a_expr;
1926 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001927 ;
1928 break;}
1929case 75:
1930#line 858 "asn1p_y.y"
1931{
Lev Walkin070a52d2004-08-22 03:19:54 +00001932 yyval.a_expr = yyvsp[-1].a_expr;
1933 assert(yyval.a_expr->Identifier == 0);
1934 yyval.a_expr->Identifier = yyvsp[-2].tv_nametag.name;
1935 yyval.a_expr->tag = yyvsp[-2].tv_nametag.tag;
1936 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkinceb20e72004-09-05 10:40:41 +00001937 ;
1938 break;}
1939case 76:
1940#line 865 "asn1p_y.y"
1941{
Lev Walkin070a52d2004-08-22 03:19:54 +00001942 yyval.a_expr = asn1p_expr_new(yylineno);
1943 checkmem(yyval.a_expr);
1944 yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type;
1945 yyval.a_expr->expr_type = A1TC_COMPONENTS_OF;
1946 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001947 ;
1948 break;}
1949case 77:
1950#line 872 "asn1p_y.y"
1951{
Lev Walkin070a52d2004-08-22 03:19:54 +00001952 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinceb20e72004-09-05 10:40:41 +00001953 ;
1954 break;}
1955case 78:
1956#line 878 "asn1p_y.y"
1957{
Lev Walkin070a52d2004-08-22 03:19:54 +00001958 yyval.a_expr = asn1p_expr_new(yylineno);
1959 checkmem(yyval.a_expr);
1960 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001961 ;
1962 break;}
1963case 79:
1964#line 883 "asn1p_y.y"
1965{
Lev Walkin070a52d2004-08-22 03:19:54 +00001966 yyval.a_expr = yyvsp[-2].a_expr;
1967 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00001968 ;
1969 break;}
1970case 80:
1971#line 890 "asn1p_y.y"
1972{
Lev Walkin070a52d2004-08-22 03:19:54 +00001973 yyval.a_expr = yyvsp[0].a_expr;
1974 assert(yyval.a_expr->Identifier == 0);
1975 yyval.a_expr->Identifier = yyvsp[-1].tv_nametag.name;
1976 yyval.a_expr->tag = yyvsp[-1].tv_nametag.tag;
Lev Walkinceb20e72004-09-05 10:40:41 +00001977 ;
1978 break;}
1979case 81:
1980#line 896 "asn1p_y.y"
1981{
Lev Walkin070a52d2004-08-22 03:19:54 +00001982 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinceb20e72004-09-05 10:40:41 +00001983 ;
1984 break;}
1985case 82:
1986#line 902 "asn1p_y.y"
1987{
Lev Walkinf15320b2004-06-03 03:38:44 +00001988 yyval.a_expr = yyvsp[-2].a_expr;
1989 checkmem(yyval.a_expr);
1990 yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
1991 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1992 assert(yyval.a_expr->meta_type == AMT_OBJECT);
Lev Walkinceb20e72004-09-05 10:40:41 +00001993 ;
1994 break;}
1995case 83:
1996#line 912 "asn1p_y.y"
1997{ yyval.a_int = 0; ;
1998 break;}
1999case 84:
2000#line 913 "asn1p_y.y"
2001{ yyval.a_int = 1; ;
2002 break;}
2003case 85:
2004#line 917 "asn1p_y.y"
2005{
Lev Walkinf15320b2004-06-03 03:38:44 +00002006 yyval.a_expr = asn1p_expr_new(yylineno);
2007 checkmem(yyval.a_expr);
2008 yyval.a_expr->expr_type = A1TC_CLASSDEF;
2009 yyval.a_expr->meta_type = AMT_OBJECT;
2010 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002011 ;
2012 break;}
2013case 86:
2014#line 924 "asn1p_y.y"
2015{
Lev Walkinf15320b2004-06-03 03:38:44 +00002016 yyval.a_expr = yyvsp[-2].a_expr;
2017 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002018 ;
2019 break;}
2020case 87:
2021#line 931 "asn1p_y.y"
2022{
Lev Walkinf15320b2004-06-03 03:38:44 +00002023 yyval.a_expr = asn1p_expr_new(yylineno);
2024 checkmem(yyval.a_expr);
2025 yyval.a_expr->Identifier = yyvsp[-1].a_refcomp.name;
2026 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
2027 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2028 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkinceb20e72004-09-05 10:40:41 +00002029 ;
2030 break;}
2031case 88:
2032#line 939 "asn1p_y.y"
2033{
Lev Walkin070a52d2004-08-22 03:19:54 +00002034 yyval.a_expr = yyvsp[-2].a_expr;
2035 yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
2036 yyval.a_expr->marker = yyvsp[-1].a_marker;
Lev Walkinf15320b2004-06-03 03:38:44 +00002037 yyval.a_expr->unique = yyvsp[0].a_int;
Lev Walkinceb20e72004-09-05 10:40:41 +00002038 ;
2039 break;}
2040case 89:
2041#line 945 "asn1p_y.y"
2042{
Lev Walkinf15320b2004-06-03 03:38:44 +00002043 int ret;
2044 yyval.a_expr = asn1p_expr_new(yylineno);
2045 checkmem(yyval.a_expr);
2046 yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
2047 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2048 checkmem(yyval.a_expr->reference);
2049 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2050 yyvsp[-2].a_refcomp.name, yyvsp[-2].a_refcomp.lex_type);
2051 checkmem(ret == 0);
2052 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
2053 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2054 yyval.a_expr->marker = yyvsp[-1].a_marker;
2055 yyval.a_expr->unique = yyvsp[0].a_int;
Lev Walkinceb20e72004-09-05 10:40:41 +00002056 ;
2057 break;}
2058case 90:
2059#line 963 "asn1p_y.y"
2060{ yyval.a_wsynt = 0; ;
2061 break;}
2062case 91:
2063#line 964 "asn1p_y.y"
2064{
Lev Walkinf15320b2004-06-03 03:38:44 +00002065 yyval.a_wsynt = yyvsp[0].a_wsynt;
Lev Walkinceb20e72004-09-05 10:40:41 +00002066 ;
2067 break;}
2068case 92:
2069#line 971 "asn1p_y.y"
2070{ asn1p_lexer_hack_enable_with_syntax(); ;
2071 break;}
2072case 93:
2073#line 973 "asn1p_y.y"
2074{
Lev Walkinf15320b2004-06-03 03:38:44 +00002075 yyval.a_wsynt = yyvsp[-1].a_wsynt;
Lev Walkinceb20e72004-09-05 10:40:41 +00002076 ;
2077 break;}
2078case 94:
2079#line 979 "asn1p_y.y"
2080{
Lev Walkinf15320b2004-06-03 03:38:44 +00002081 yyval.a_wsynt = asn1p_wsyntx_new();
2082 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002083 ;
2084 break;}
2085case 95:
2086#line 983 "asn1p_y.y"
2087{
Lev Walkinf15320b2004-06-03 03:38:44 +00002088 yyval.a_wsynt = yyvsp[-1].a_wsynt;
2089 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002090 ;
2091 break;}
2092case 96:
2093#line 990 "asn1p_y.y"
2094{
Lev Walkinf15320b2004-06-03 03:38:44 +00002095 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002096 ;
2097 break;}
2098case 97:
2099#line 993 "asn1p_y.y"
2100{
Lev Walkinf15320b2004-06-03 03:38:44 +00002101 asn1p_ref_t *ref;
2102 int ret;
2103 ref = asn1p_ref_new(yylineno);
2104 checkmem(ref);
2105 ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2106 checkmem(ret == 0);
2107 yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002108 ;
2109 break;}
2110case 98:
2111#line 1005 "asn1p_y.y"
2112{
2113 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf59d0752004-08-18 04:59:12 +00002114 checkmem(yyval.a_expr);
2115 yyval.a_expr->Identifier = strdup("...");
2116 checkmem(yyval.a_expr->Identifier);
Lev Walkinf59d0752004-08-18 04:59:12 +00002117 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2118 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002119 ;
2120 break;}
2121case 99:
2122#line 1013 "asn1p_y.y"
2123{
2124 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf59d0752004-08-18 04:59:12 +00002125 checkmem(yyval.a_expr);
2126 yyval.a_expr->Identifier = strdup("...");
Lev Walkinf59d0752004-08-18 04:59:12 +00002127 checkmem(yyval.a_expr->Identifier);
Lev Walkind2ea1de2004-08-20 13:25:29 +00002128 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkinf59d0752004-08-18 04:59:12 +00002129 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2130 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002131 ;
2132 break;}
2133case 100:
2134#line 1022 "asn1p_y.y"
2135{
2136 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkind2ea1de2004-08-20 13:25:29 +00002137 checkmem(yyval.a_expr);
2138 yyval.a_expr->Identifier = strdup("...");
2139 yyval.a_expr->value = yyvsp[0].a_value;
2140 checkmem(yyval.a_expr->Identifier);
2141 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2142 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002143 ;
2144 break;}
2145case 101:
2146#line 1034 "asn1p_y.y"
2147{
Lev Walkin070a52d2004-08-22 03:19:54 +00002148 yyval.a_expr = yyvsp[-1].a_expr;
2149 /*
2150 * Outer constraint for SEQUENCE OF and SET OF applies
2151 * to the inner type.
2152 */
2153 if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF
2154 || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) {
2155 assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints);
2156 TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr;
2157 } else {
2158 if(yyval.a_expr->constraints) {
2159 assert(!yyvsp[0].a_constr);
2160 } else {
2161 yyval.a_expr->constraints = yyvsp[0].a_constr;
2162 }
2163 }
Lev Walkinceb20e72004-09-05 10:40:41 +00002164 ;
2165 break;}
2166case 102:
2167#line 1055 "asn1p_y.y"
2168{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002169 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002170 ;
2171 break;}
2172case 103:
2173#line 1058 "asn1p_y.y"
2174{
Lev Walkinf15320b2004-06-03 03:38:44 +00002175 yyval.a_expr = asn1p_expr_new(yylineno);
2176 checkmem(yyval.a_expr);
2177 yyval.a_expr->expr_type = yyvsp[0].a_type;
2178 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002179 ;
2180 break;}
2181case 104:
2182#line 1064 "asn1p_y.y"
2183{
Lev Walkin070a52d2004-08-22 03:19:54 +00002184 yyval.a_expr = yyvsp[-1].a_expr;
2185 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2186 yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
2187 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002188 ;
2189 break;}
2190case 105:
2191#line 1070 "asn1p_y.y"
2192{
Lev Walkin070a52d2004-08-22 03:19:54 +00002193 yyval.a_expr = yyvsp[-1].a_expr;
2194 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2195 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
2196 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002197 ;
2198 break;}
2199case 106:
2200#line 1076 "asn1p_y.y"
2201{
Lev Walkin070a52d2004-08-22 03:19:54 +00002202 yyval.a_expr = yyvsp[-1].a_expr;
2203 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2204 yyval.a_expr->expr_type = ASN_CONSTR_SET;
2205 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002206 ;
2207 break;}
2208case 107:
2209#line 1082 "asn1p_y.y"
2210{
2211 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002212 checkmem(yyval.a_expr);
2213 yyval.a_expr->constraints = yyvsp[-2].a_constr;
2214 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
2215 yyval.a_expr->meta_type = AMT_TYPE;
2216 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002217 ;
2218 break;}
2219case 108:
2220#line 1090 "asn1p_y.y"
2221{
2222 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002223 checkmem(yyval.a_expr);
2224 yyval.a_expr->constraints = yyvsp[-2].a_constr;
2225 yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
2226 yyval.a_expr->meta_type = AMT_TYPE;
2227 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00002228 ;
2229 break;}
2230case 109:
2231#line 1098 "asn1p_y.y"
2232{
2233 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002234 checkmem(yyval.a_expr);
Lev Walkin609ccbb2004-09-04 04:49:21 +00002235 yyval.a_expr->expr_type = ASN_TYPE_ANY;
Lev Walkin070a52d2004-08-22 03:19:54 +00002236 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002237 ;
2238 break;}
2239case 110:
2240#line 1104 "asn1p_y.y"
2241{
Lev Walkin070a52d2004-08-22 03:19:54 +00002242 int ret;
Lev Walkinceb20e72004-09-05 10:40:41 +00002243 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkin070a52d2004-08-22 03:19:54 +00002244 checkmem(yyval.a_expr);
2245 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2246 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2247 yyvsp[0].tv_str, RLT_lowercase);
2248 checkmem(ret == 0);
Lev Walkin609ccbb2004-09-04 04:49:21 +00002249 yyval.a_expr->expr_type = ASN_TYPE_ANY;
Lev Walkin070a52d2004-08-22 03:19:54 +00002250 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002251 ;
2252 break;}
2253case 111:
2254#line 1118 "asn1p_y.y"
2255{
Lev Walkinf15320b2004-06-03 03:38:44 +00002256 int ret;
2257 yyval.a_expr = yyvsp[-1].a_expr;
2258 assert(yyval.a_expr->expr_type == 0);
2259 assert(yyval.a_expr->meta_type == 0);
2260 assert(yyval.a_expr->reference == 0);
2261 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2262 checkmem(yyval.a_expr->reference);
2263 ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN);
2264 checkmem(ret == 0);
2265 free(yyvsp[-3].tv_str);
2266 yyval.a_expr->expr_type = A1TC_PARAMETRIZED;
2267 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002268 ;
2269 break;}
2270case 112:
2271#line 1142 "asn1p_y.y"
2272{
Lev Walkinf15320b2004-06-03 03:38:44 +00002273 yyval.a_expr = asn1p_expr_new(yylineno);
2274 checkmem(yyval.a_expr);
2275 yyval.a_expr->reference = yyvsp[0].a_ref;
2276 yyval.a_expr->expr_type = A1TC_REFERENCE;
2277 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkinceb20e72004-09-05 10:40:41 +00002278 ;
2279 break;}
2280case 113:
2281#line 1149 "asn1p_y.y"
2282{
Lev Walkinf15320b2004-06-03 03:38:44 +00002283 yyval.a_expr = asn1p_expr_new(yylineno);
2284 checkmem(yyval.a_expr);
2285 yyval.a_expr->reference = yyvsp[0].a_ref;
2286 yyval.a_expr->expr_type = A1TC_INSTANCE;
2287 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002288 ;
2289 break;}
2290case 114:
2291#line 1164 "asn1p_y.y"
2292{
Lev Walkinf15320b2004-06-03 03:38:44 +00002293 int ret;
2294 yyval.a_ref = asn1p_ref_new(yylineno);
2295 checkmem(yyval.a_ref);
2296 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2297 checkmem(ret == 0);
2298 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002299 ;
2300 break;}
2301case 115:
2302#line 1172 "asn1p_y.y"
2303{
Lev Walkinf15320b2004-06-03 03:38:44 +00002304 int ret;
2305 yyval.a_ref = asn1p_ref_new(yylineno);
2306 checkmem(yyval.a_ref);
2307 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2308 checkmem(ret == 0);
2309 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2310 checkmem(ret == 0);
2311 free(yyvsp[-2].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002312 ;
2313 break;}
2314case 116:
2315#line 1182 "asn1p_y.y"
2316{
Lev Walkinf15320b2004-06-03 03:38:44 +00002317 int ret;
2318 yyval.a_ref = asn1p_ref_new(yylineno);
2319 checkmem(yyval.a_ref);
2320 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2321 checkmem(ret == 0);
2322 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
2323 checkmem(ret == 0);
2324 free(yyvsp[-2].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002325 ;
2326 break;}
2327case 117:
2328#line 1192 "asn1p_y.y"
2329{
Lev Walkinf15320b2004-06-03 03:38:44 +00002330 int ret;
2331 yyval.a_ref = asn1p_ref_new(yylineno);
2332 checkmem(yyval.a_ref);
2333 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
2334 free(yyvsp[0].tv_str);
2335 checkmem(ret == 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002336 ;
2337 break;}
2338case 118:
2339#line 1200 "asn1p_y.y"
2340{
Lev Walkinf15320b2004-06-03 03:38:44 +00002341 int ret;
2342 yyval.a_ref = yyvsp[0].a_ref;
2343 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
2344 free(yyvsp[-2].tv_str);
2345 checkmem(ret == 0);
2346 /*
2347 * Move the last element infront.
2348 */
2349 {
2350 struct asn1p_ref_component_s tmp_comp;
2351 tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
2352 memmove(&yyval.a_ref->components[1],
2353 &yyval.a_ref->components[0],
2354 sizeof(yyval.a_ref->components[0])
2355 * (yyval.a_ref->comp_count - 1));
2356 yyval.a_ref->components[0] = tmp_comp;
2357 }
Lev Walkinceb20e72004-09-05 10:40:41 +00002358 ;
2359 break;}
2360case 119:
2361#line 1222 "asn1p_y.y"
2362{
Lev Walkinf15320b2004-06-03 03:38:44 +00002363 int ret;
2364 yyval.a_ref = asn1p_ref_new(yylineno);
2365 checkmem(yyval.a_ref);
2366 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2367 free(yyvsp[0].a_refcomp.name);
2368 checkmem(ret == 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002369 ;
2370 break;}
2371case 120:
2372#line 1230 "asn1p_y.y"
2373{
Lev Walkinf15320b2004-06-03 03:38:44 +00002374 int ret;
2375 yyval.a_ref = yyvsp[-2].a_ref;
2376 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2377 free(yyvsp[0].a_refcomp.name);
2378 checkmem(ret == 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002379 ;
2380 break;}
2381case 123:
2382#line 1244 "asn1p_y.y"
2383{
Lev Walkinf15320b2004-06-03 03:38:44 +00002384 yyval.a_refcomp.lex_type = RLT_AmpUppercase;
2385 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00002386 ;
2387 break;}
2388case 124:
2389#line 1249 "asn1p_y.y"
2390{
Lev Walkinf15320b2004-06-03 03:38:44 +00002391 yyval.a_refcomp.lex_type = RLT_Amplowercase;
2392 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00002393 ;
2394 break;}
2395case 125:
2396#line 1262 "asn1p_y.y"
2397{
Lev Walkinf15320b2004-06-03 03:38:44 +00002398 yyval.a_expr = yyvsp[-2].a_expr;
2399 assert(yyval.a_expr->Identifier == NULL);
2400 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
2401 yyval.a_expr->meta_type = AMT_VALUE;
2402 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002403 ;
2404 break;}
2405case 126:
2406#line 1272 "asn1p_y.y"
2407{ asn1p_lexer_hack_push_opaque_state(); ;
2408 break;}
2409case 127:
2410#line 1273 "asn1p_y.y"
2411{
Lev Walkinf15320b2004-06-03 03:38:44 +00002412 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2413 checkmem(yyval.a_value);
2414 yyval.a_value->type = ATV_UNPARSED;
Lev Walkinceb20e72004-09-05 10:40:41 +00002415 ;
2416 break;}
2417case 128:
2418#line 1278 "asn1p_y.y"
2419{
Lev Walkinf15320b2004-06-03 03:38:44 +00002420 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
2421 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00002422 ;
2423 break;}
2424case 129:
2425#line 1282 "asn1p_y.y"
2426{
Lev Walkinf15320b2004-06-03 03:38:44 +00002427 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
2428 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00002429 ;
2430 break;}
2431case 130:
2432#line 1286 "asn1p_y.y"
2433{
Lev Walkinf15320b2004-06-03 03:38:44 +00002434 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2435 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00002436 ;
2437 break;}
2438case 131:
2439#line 1290 "asn1p_y.y"
2440{
Lev Walkinf15320b2004-06-03 03:38:44 +00002441 yyval.a_value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002442 ;
2443 break;}
2444case 132:
2445#line 1293 "asn1p_y.y"
2446{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002447 yyval.a_value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002448 ;
2449 break;}
2450case 133:
2451#line 1299 "asn1p_y.y"
2452{
Lev Walkinf15320b2004-06-03 03:38:44 +00002453 asn1p_ref_t *ref;
2454 int ret;
2455 ref = asn1p_ref_new(yylineno);
2456 checkmem(ref);
2457 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2458 checkmem(ret == 0);
2459 yyval.a_value = asn1p_value_fromref(ref, 0);
2460 checkmem(yyval.a_value);
2461 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002462 ;
2463 break;}
2464case 134:
2465#line 1310 "asn1p_y.y"
2466{
Lev Walkinf15320b2004-06-03 03:38:44 +00002467 asn1p_ref_t *ref;
2468 int ret;
2469 ref = asn1p_ref_new(yylineno);
2470 checkmem(ref);
2471 ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2472 checkmem(ret == 0);
2473 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2474 checkmem(ret == 0);
2475 yyval.a_value = asn1p_value_fromref(ref, 0);
2476 checkmem(yyval.a_value);
2477 free(yyvsp[-2].tv_str);
2478 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002479 ;
2480 break;}
2481case 135:
2482#line 1327 "asn1p_y.y"
2483{
Lev Walkinf15320b2004-06-03 03:38:44 +00002484 yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 2;
2485 yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
2486 checkmem(yyval.tv_opaque.buf);
2487 yyval.tv_opaque.buf[0] = '{';
2488 yyval.tv_opaque.buf[1] = ' ';
2489 memcpy(yyval.tv_opaque.buf + 2, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2490 yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
2491 free(yyvsp[0].tv_opaque.buf);
Lev Walkinceb20e72004-09-05 10:40:41 +00002492 ;
2493 break;}
2494case 136:
2495#line 1337 "asn1p_y.y"
2496{
Lev Walkinf15320b2004-06-03 03:38:44 +00002497 int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
2498 char *p = malloc(newsize + 1);
2499 checkmem(p);
2500 memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
2501 memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2502 p[newsize] = '\0';
2503 free(yyvsp[-1].tv_opaque.buf);
2504 free(yyvsp[0].tv_opaque.buf);
2505 yyval.tv_opaque.buf = p;
2506 yyval.tv_opaque.len = newsize;
Lev Walkinceb20e72004-09-05 10:40:41 +00002507 ;
2508 break;}
2509case 137:
2510#line 1352 "asn1p_y.y"
2511{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
2512 break;}
2513case 138:
2514#line 1353 "asn1p_y.y"
2515{ yyval.a_type = ASN_BASIC_NULL; ;
2516 break;}
2517case 139:
Lev Walkin609ccbb2004-09-04 04:49:21 +00002518#line 1354 "asn1p_y.y"
Lev Walkinceb20e72004-09-05 10:40:41 +00002519{ yyval.a_type = ASN_BASIC_REAL; ;
2520 break;}
2521case 140:
2522#line 1355 "asn1p_y.y"
2523{ yyval.a_type = yyvsp[0].a_type; ;
2524 break;}
2525case 141:
2526#line 1356 "asn1p_y.y"
2527{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
2528 break;}
2529case 142:
2530#line 1357 "asn1p_y.y"
2531{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
2532 break;}
2533case 143:
2534#line 1358 "asn1p_y.y"
2535{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
2536 break;}
2537case 144:
2538#line 1359 "asn1p_y.y"
2539{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
2540 break;}
2541case 145:
2542#line 1360 "asn1p_y.y"
2543{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
2544 break;}
2545case 146:
2546#line 1361 "asn1p_y.y"
2547{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
2548 break;}
2549case 147:
2550#line 1362 "asn1p_y.y"
2551{ yyval.a_type = ASN_BASIC_UTCTime; ;
2552 break;}
2553case 148:
2554#line 1363 "asn1p_y.y"
2555{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
2556 break;}
2557case 149:
2558#line 1370 "asn1p_y.y"
2559{ yyval.a_type = ASN_BASIC_INTEGER; ;
2560 break;}
2561case 150:
2562#line 1371 "asn1p_y.y"
2563{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
2564 break;}
2565case 151:
2566#line 1372 "asn1p_y.y"
2567{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
2568 break;}
2569case 152:
2570#line 1376 "asn1p_y.y"
2571{
2572 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002573 checkmem(yyval.a_expr);
2574 yyval.a_expr->expr_type = yyvsp[0].a_type;
2575 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002576 ;
2577 break;}
2578case 153:
2579#line 1382 "asn1p_y.y"
2580{
Lev Walkinf15320b2004-06-03 03:38:44 +00002581 if(yyvsp[0].a_expr) {
2582 yyval.a_expr = yyvsp[0].a_expr;
2583 } else {
Lev Walkinceb20e72004-09-05 10:40:41 +00002584 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002585 checkmem(yyval.a_expr);
2586 }
2587 yyval.a_expr->expr_type = yyvsp[-1].a_type;
2588 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002589 ;
2590 break;}
2591case 154:
2592#line 1395 "asn1p_y.y"
2593{ yyval.a_type = ASN_STRING_BMPString; ;
2594 break;}
2595case 155:
2596#line 1396 "asn1p_y.y"
2597{
Lev Walkinf15320b2004-06-03 03:38:44 +00002598 yyval.a_type = ASN_STRING_GeneralString;
2599 return yyerror("GeneralString is not supported");
Lev Walkinceb20e72004-09-05 10:40:41 +00002600 ;
2601 break;}
2602case 156:
2603#line 1400 "asn1p_y.y"
2604{
Lev Walkinf15320b2004-06-03 03:38:44 +00002605 yyval.a_type = ASN_STRING_GraphicString;
2606 return yyerror("GraphicString is not supported");
Lev Walkinceb20e72004-09-05 10:40:41 +00002607 ;
2608 break;}
2609case 157:
2610#line 1404 "asn1p_y.y"
2611{ yyval.a_type = ASN_STRING_IA5String; ;
2612 break;}
2613case 158:
2614#line 1405 "asn1p_y.y"
2615{ yyval.a_type = ASN_STRING_ISO646String; ;
2616 break;}
2617case 159:
2618#line 1406 "asn1p_y.y"
2619{ yyval.a_type = ASN_STRING_NumericString; ;
2620 break;}
2621case 160:
2622#line 1407 "asn1p_y.y"
2623{ yyval.a_type = ASN_STRING_PrintableString; ;
2624 break;}
2625case 161:
2626#line 1408 "asn1p_y.y"
2627{
Lev Walkinf15320b2004-06-03 03:38:44 +00002628 yyval.a_type = ASN_STRING_T61String;
2629 return yyerror("T61String not implemented yet");
Lev Walkinceb20e72004-09-05 10:40:41 +00002630 ;
2631 break;}
2632case 162:
2633#line 1412 "asn1p_y.y"
2634{ yyval.a_type = ASN_STRING_TeletexString; ;
2635 break;}
2636case 163:
2637#line 1413 "asn1p_y.y"
2638{ yyval.a_type = ASN_STRING_UniversalString; ;
2639 break;}
2640case 164:
2641#line 1414 "asn1p_y.y"
2642{ yyval.a_type = ASN_STRING_UTF8String; ;
2643 break;}
2644case 165:
2645#line 1415 "asn1p_y.y"
2646{
Lev Walkinf15320b2004-06-03 03:38:44 +00002647 yyval.a_type = ASN_STRING_VideotexString;
2648 return yyerror("VideotexString is no longer supported");
Lev Walkinceb20e72004-09-05 10:40:41 +00002649 ;
2650 break;}
2651case 166:
2652#line 1419 "asn1p_y.y"
2653{ yyval.a_type = ASN_STRING_VisibleString; ;
2654 break;}
2655case 167:
Lev Walkin609ccbb2004-09-04 04:49:21 +00002656#line 1420 "asn1p_y.y"
Lev Walkinceb20e72004-09-05 10:40:41 +00002657{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
2658 break;}
2659case 173:
2660#line 1432 "asn1p_y.y"
2661{ yyval.a_constr = 0; ;
2662 break;}
2663case 174:
2664#line 1433 "asn1p_y.y"
2665{
2666 yyval.a_constr = yyvsp[0].a_constr;
2667 ;
2668 break;}
2669case 175:
2670#line 1439 "asn1p_y.y"
2671{
2672 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
2673 ;
2674 break;}
2675case 176:
2676#line 1442 "asn1p_y.y"
2677{
Lev Walkinf15320b2004-06-03 03:38:44 +00002678 /*
2679 * This is a special case, for compatibility purposes.
Lev Walkinf59d0752004-08-18 04:59:12 +00002680 * It goes without parentheses.
Lev Walkinf15320b2004-06-03 03:38:44 +00002681 */
Lev Walkind2ea1de2004-08-20 13:25:29 +00002682 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002683 ;
2684 break;}
2685case 177:
2686#line 1452 "asn1p_y.y"
2687{
Lev Walkinf15320b2004-06-03 03:38:44 +00002688 yyval.a_constr = yyvsp[-1].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002689 ;
2690 break;}
2691case 178:
2692#line 1455 "asn1p_y.y"
2693{
Lev Walkinf59d0752004-08-18 04:59:12 +00002694 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002695 ;
2696 break;}
2697case 179:
2698#line 1461 "asn1p_y.y"
2699{
Lev Walkinf15320b2004-06-03 03:38:44 +00002700 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002701 ;
2702 break;}
2703case 180:
2704#line 1464 "asn1p_y.y"
2705{
Lev Walkinf15320b2004-06-03 03:38:44 +00002706 asn1p_constraint_t *ct;
2707 ct = asn1p_constraint_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002708 ct->type = ACT_EL_EXT;
2709 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkinceb20e72004-09-05 10:40:41 +00002710 ;
2711 break;}
2712case 181:
2713#line 1470 "asn1p_y.y"
2714{
Lev Walkinf15320b2004-06-03 03:38:44 +00002715 asn1p_constraint_t *ct;
2716 ct = asn1p_constraint_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00002717 ct->type = ACT_EL_EXT;
2718 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002719 ct = yyval.a_constr;
2720 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002721 ;
2722 break;}
2723case 182:
2724#line 1481 "asn1p_y.y"
2725{
Lev Walkinf59d0752004-08-18 04:59:12 +00002726 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002727 ;
2728 break;}
2729case 183:
2730#line 1484 "asn1p_y.y"
2731{
Lev Walkinf15320b2004-06-03 03:38:44 +00002732 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002733 ;
2734 break;}
2735case 184:
2736#line 1487 "asn1p_y.y"
2737{
Lev Walkinf15320b2004-06-03 03:38:44 +00002738 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002739 ;
2740 break;}
2741case 185:
2742#line 1490 "asn1p_y.y"
2743{
Lev Walkinf15320b2004-06-03 03:38:44 +00002744 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002745 ;
2746 break;}
2747case 186:
2748#line 1496 "asn1p_y.y"
2749{
Lev Walkinf15320b2004-06-03 03:38:44 +00002750 int ret;
2751 yyval.a_constr = asn1p_constraint_new(yylineno);
2752 checkmem(yyval.a_constr);
2753 yyval.a_constr->type = yyvsp[-3].a_ctype;
2754 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2755 checkmem(ret == 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002756 ;
2757 break;}
2758case 187:
2759#line 1504 "asn1p_y.y"
2760{
Lev Walkinf59d0752004-08-18 04:59:12 +00002761 int ret;
2762 yyval.a_constr = asn1p_constraint_new(yylineno);
2763 checkmem(yyval.a_constr);
2764 yyval.a_constr->type = ACT_CA_SET;
2765 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2766 checkmem(ret == 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002767 ;
2768 break;}
2769case 188:
2770#line 1512 "asn1p_y.y"
2771{
Lev Walkinf59d0752004-08-18 04:59:12 +00002772 yyval.a_constr = asn1p_constraint_new(yylineno);
2773 checkmem(yyval.a_constr);
2774 yyval.a_constr->type = ACT_EL_VALUE;
2775 yyval.a_constr->value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002776 ;
2777 break;}
2778case 189:
2779#line 1518 "asn1p_y.y"
2780{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002781 yyval.a_constr = asn1p_constraint_new(yylineno);
2782 checkmem(yyval.a_constr);
2783 yyval.a_constr->type = yyvsp[-1].a_ctype;
Lev Walkin070a52d2004-08-22 03:19:54 +00002784 yyval.a_constr->range_start = yyvsp[-2].a_value;
2785 yyval.a_constr->range_stop = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002786 ;
2787 break;}
2788case 190:
2789#line 1525 "asn1p_y.y"
2790{
Lev Walkin070a52d2004-08-22 03:19:54 +00002791 yyval.a_constr = asn1p_constraint_new(yylineno);
2792 checkmem(yyval.a_constr);
2793 yyval.a_constr->type = yyvsp[-1].a_ctype;
2794 yyval.a_constr->range_start = asn1p_value_fromint(-123);
2795 yyval.a_constr->range_stop = yyvsp[0].a_value;
2796 yyval.a_constr->range_start->type = ATV_MIN;
Lev Walkinceb20e72004-09-05 10:40:41 +00002797 ;
2798 break;}
2799case 191:
2800#line 1533 "asn1p_y.y"
2801{
Lev Walkin070a52d2004-08-22 03:19:54 +00002802 yyval.a_constr = asn1p_constraint_new(yylineno);
2803 checkmem(yyval.a_constr);
2804 yyval.a_constr->type = yyvsp[-1].a_ctype;
2805 yyval.a_constr->range_start = yyvsp[-2].a_value;
2806 yyval.a_constr->range_stop = asn1p_value_fromint(321);
2807 yyval.a_constr->range_stop->type = ATV_MAX;
Lev Walkinceb20e72004-09-05 10:40:41 +00002808 ;
2809 break;}
2810case 192:
2811#line 1541 "asn1p_y.y"
2812{
Lev Walkin070a52d2004-08-22 03:19:54 +00002813 yyval.a_constr = asn1p_constraint_new(yylineno);
2814 checkmem(yyval.a_constr);
2815 yyval.a_constr->type = yyvsp[-1].a_ctype;
2816 yyval.a_constr->range_start = asn1p_value_fromint(-123);
2817 yyval.a_constr->range_stop = asn1p_value_fromint(321);
2818 yyval.a_constr->range_start->type = ATV_MIN;
2819 yyval.a_constr->range_stop->type = ATV_MAX;
Lev Walkinceb20e72004-09-05 10:40:41 +00002820 ;
2821 break;}
2822case 193:
2823#line 1550 "asn1p_y.y"
2824{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002825 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002826 ;
2827 break;}
2828case 194:
Lev Walkin609ccbb2004-09-04 04:49:21 +00002829#line 1553 "asn1p_y.y"
Lev Walkinceb20e72004-09-05 10:40:41 +00002830{
2831 yyval.a_constr = yyvsp[0].a_constr;
2832 ;
2833 break;}
2834case 195:
2835#line 1559 "asn1p_y.y"
2836{ yyval.a_ctype = ACT_EL_RANGE; ;
2837 break;}
2838case 196:
2839#line 1560 "asn1p_y.y"
2840{ yyval.a_ctype = ACT_EL_RLRANGE; ;
2841 break;}
2842case 197:
2843#line 1561 "asn1p_y.y"
2844{ yyval.a_ctype = ACT_EL_LLRANGE; ;
2845 break;}
2846case 198:
2847#line 1562 "asn1p_y.y"
2848{ yyval.a_ctype = ACT_EL_ULRANGE; ;
2849 break;}
2850case 199:
2851#line 1566 "asn1p_y.y"
2852{
2853 yyval.a_ctype = ACT_CT_SIZE;
2854 ;
2855 break;}
2856case 200:
2857#line 1569 "asn1p_y.y"
2858{
2859 yyval.a_ctype = ACT_CT_FROM;
2860 ;
2861 break;}
2862case 201:
2863#line 1575 "asn1p_y.y"
2864{
Lev Walkinf15320b2004-06-03 03:38:44 +00002865 yyval.a_value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00002866 ;
2867 break;}
2868case 202:
2869#line 1578 "asn1p_y.y"
2870{
Lev Walkinf15320b2004-06-03 03:38:44 +00002871 asn1p_ref_t *ref;
2872 int ret;
2873 ref = asn1p_ref_new(yylineno);
2874 checkmem(ref);
2875 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2876 checkmem(ret == 0);
2877 yyval.a_value = asn1p_value_fromref(ref, 0);
2878 checkmem(yyval.a_value);
2879 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00002880 ;
2881 break;}
2882case 203:
2883#line 1589 "asn1p_y.y"
2884{
Lev Walkinf15320b2004-06-03 03:38:44 +00002885 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2886 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00002887 ;
2888 break;}
2889case 204:
2890#line 1594 "asn1p_y.y"
2891{
Lev Walkinf15320b2004-06-03 03:38:44 +00002892 yyval.a_value = asn1p_value_fromint(0);
2893 checkmem(yyval.a_value);
2894 yyval.a_value->type = ATV_FALSE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002895 ;
2896 break;}
2897case 205:
2898#line 1599 "asn1p_y.y"
2899{
Lev Walkinf15320b2004-06-03 03:38:44 +00002900 yyval.a_value = asn1p_value_fromint(1);
2901 checkmem(yyval.a_value);
2902 yyval.a_value->type = ATV_TRUE;
Lev Walkinceb20e72004-09-05 10:40:41 +00002903 ;
2904 break;}
2905case 206:
2906#line 1607 "asn1p_y.y"
2907{
Lev Walkinf15320b2004-06-03 03:38:44 +00002908 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002909 ;
2910 break;}
2911case 207:
2912#line 1613 "asn1p_y.y"
2913{
Lev Walkinf15320b2004-06-03 03:38:44 +00002914 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002915 ;
2916 break;}
2917case 208:
2918#line 1616 "asn1p_y.y"
2919{
Lev Walkinf15320b2004-06-03 03:38:44 +00002920 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002921 ;
2922 break;}
2923case 209:
2924#line 1622 "asn1p_y.y"
2925{
Lev Walkinf15320b2004-06-03 03:38:44 +00002926 yyval.a_constr = asn1p_constraint_new(yylineno);
2927 checkmem(yyval.a_constr);
2928 yyval.a_constr->type = ACT_EL_EXT;
Lev Walkinceb20e72004-09-05 10:40:41 +00002929 ;
2930 break;}
2931case 210:
2932#line 1627 "asn1p_y.y"
2933{
Lev Walkinf15320b2004-06-03 03:38:44 +00002934 yyval.a_constr = asn1p_constraint_new(yylineno);
2935 checkmem(yyval.a_constr);
2936 yyval.a_constr->type = ACT_EL_VALUE;
2937 yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
2938 yyval.a_constr->presence = yyvsp[0].a_pres;
Lev Walkinceb20e72004-09-05 10:40:41 +00002939 ;
2940 break;}
2941case 211:
2942#line 1640 "asn1p_y.y"
2943{ yyval.a_pres = ACPRES_DEFAULT; ;
2944 break;}
2945case 212:
2946#line 1641 "asn1p_y.y"
2947{ yyval.a_pres = yyvsp[0].a_pres; ;
2948 break;}
2949case 213:
2950#line 1645 "asn1p_y.y"
2951{
Lev Walkinf15320b2004-06-03 03:38:44 +00002952 yyval.a_pres = ACPRES_PRESENT;
Lev Walkinceb20e72004-09-05 10:40:41 +00002953 ;
2954 break;}
2955case 214:
2956#line 1648 "asn1p_y.y"
2957{
Lev Walkinf15320b2004-06-03 03:38:44 +00002958 yyval.a_pres = ACPRES_ABSENT;
Lev Walkinceb20e72004-09-05 10:40:41 +00002959 ;
2960 break;}
2961case 215:
2962#line 1651 "asn1p_y.y"
2963{
Lev Walkinf15320b2004-06-03 03:38:44 +00002964 yyval.a_pres = ACPRES_OPTIONAL;
Lev Walkinceb20e72004-09-05 10:40:41 +00002965 ;
2966 break;}
2967case 216:
2968#line 1657 "asn1p_y.y"
2969{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002970 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002971 ;
2972 break;}
2973case 217:
2974#line 1660 "asn1p_y.y"
2975{
Lev Walkind2ea1de2004-08-20 13:25:29 +00002976 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinceb20e72004-09-05 10:40:41 +00002977 ;
2978 break;}
2979case 218:
2980#line 1669 "asn1p_y.y"
2981{
Lev Walkinf15320b2004-06-03 03:38:44 +00002982 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
2983 asn1p_constraint_t *ct;
2984 int ret;
2985 ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
2986 checkmem(ret == 0);
2987 ct = asn1p_constraint_new(yylineno);
2988 checkmem(yyval.a_constr);
2989 ct->type = ACT_EL_VALUE;
2990 ct->value = asn1p_value_fromref(ref, 0);
2991 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00002992 ;
2993 break;}
2994case 219:
2995#line 1684 "asn1p_y.y"
2996{
Lev Walkinf15320b2004-06-03 03:38:44 +00002997 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
Lev Walkinceb20e72004-09-05 10:40:41 +00002998 ;
2999 break;}
3000case 220:
3001#line 1690 "asn1p_y.y"
3002{
Lev Walkinf15320b2004-06-03 03:38:44 +00003003 yyval.a_constr = asn1p_constraint_new(yylineno);
3004 checkmem(yyval.a_constr);
3005 yyval.a_constr->type = ACT_EL_VALUE;
3006 yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
Lev Walkinceb20e72004-09-05 10:40:41 +00003007 ;
3008 break;}
3009case 221:
3010#line 1696 "asn1p_y.y"
3011{
Lev Walkinf15320b2004-06-03 03:38:44 +00003012 asn1p_constraint_t *ct;
3013 ct = asn1p_constraint_new(yylineno);
3014 checkmem(ct);
3015 ct->type = ACT_EL_VALUE;
3016 ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
3017 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkinceb20e72004-09-05 10:40:41 +00003018 ;
3019 break;}
3020case 222:
3021#line 1710 "asn1p_y.y"
3022{
Lev Walkinf15320b2004-06-03 03:38:44 +00003023 char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
3024 int ret;
3025 *p = '@';
3026 strcpy(p + 1, yyvsp[0].tv_str);
3027 yyval.a_ref = asn1p_ref_new(yylineno);
3028 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3029 checkmem(ret == 0);
3030 free(p);
3031 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00003032 ;
3033 break;}
3034case 223:
3035#line 1721 "asn1p_y.y"
3036{
Lev Walkinf15320b2004-06-03 03:38:44 +00003037 char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
3038 int ret;
3039 p[0] = '@';
3040 p[1] = '.';
3041 strcpy(p + 2, yyvsp[0].tv_str);
3042 yyval.a_ref = asn1p_ref_new(yylineno);
3043 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3044 checkmem(ret == 0);
3045 free(p);
3046 free(yyvsp[0].tv_str);
Lev Walkinceb20e72004-09-05 10:40:41 +00003047 ;
3048 break;}
3049case 224:
3050#line 1737 "asn1p_y.y"
3051{
Lev Walkinf15320b2004-06-03 03:38:44 +00003052 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00003053 ;
3054 break;}
3055case 225:
3056#line 1740 "asn1p_y.y"
3057{
Lev Walkinf15320b2004-06-03 03:38:44 +00003058 int l1 = strlen(yyvsp[-2].tv_str);
3059 int l3 = strlen(yyvsp[0].tv_str);
3060 yyval.tv_str = malloc(l1 + 1 + l3 + 1);
3061 memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
3062 yyval.tv_str[l1] = '.';
3063 memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
3064 yyval.tv_str[l1 + 1 + l3] = '\0';
Lev Walkinceb20e72004-09-05 10:40:41 +00003065 ;
3066 break;}
3067case 226:
3068#line 1758 "asn1p_y.y"
3069{ yyval.a_marker = EM_NOMARK; ;
3070 break;}
3071case 227:
3072#line 1759 "asn1p_y.y"
3073{ yyval.a_marker = yyvsp[0].a_marker; ;
3074 break;}
3075case 228:
3076#line 1763 "asn1p_y.y"
3077{
Lev Walkinf15320b2004-06-03 03:38:44 +00003078 yyval.a_marker = EM_OPTIONAL;
Lev Walkinceb20e72004-09-05 10:40:41 +00003079 ;
3080 break;}
3081case 229:
3082#line 1766 "asn1p_y.y"
3083{
Lev Walkinf15320b2004-06-03 03:38:44 +00003084 yyval.a_marker = EM_DEFAULT;
3085 /* FIXME: store DefaultValue somewhere */
Lev Walkinceb20e72004-09-05 10:40:41 +00003086 ;
3087 break;}
3088case 230:
3089#line 1773 "asn1p_y.y"
3090{
3091 ;
3092 break;}
3093case 231:
3094#line 1775 "asn1p_y.y"
3095{
3096 ;
3097 break;}
3098case 232:
3099#line 1777 "asn1p_y.y"
3100{ asn1p_lexer_hack_push_opaque_state(); ;
3101 break;}
3102case 233:
3103#line 1777 "asn1p_y.y"
3104{
3105 ;
3106 break;}
3107case 234:
3108#line 1798 "asn1p_y.y"
3109{
3110 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003111 checkmem(yyval.a_expr);
Lev Walkinceb20e72004-09-05 10:40:41 +00003112 ;
3113 break;}
3114case 235:
3115#line 1802 "asn1p_y.y"
3116{
Lev Walkinf15320b2004-06-03 03:38:44 +00003117 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkinceb20e72004-09-05 10:40:41 +00003118 ;
3119 break;}
3120case 236:
3121#line 1808 "asn1p_y.y"
3122{
3123 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003124 checkmem(yyval.a_expr);
3125 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00003126 ;
3127 break;}
3128case 237:
3129#line 1813 "asn1p_y.y"
3130{
Lev Walkinf15320b2004-06-03 03:38:44 +00003131 yyval.a_expr = yyvsp[-2].a_expr;
3132 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinceb20e72004-09-05 10:40:41 +00003133 ;
3134 break;}
3135case 238:
3136#line 1820 "asn1p_y.y"
3137{
3138 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003139 checkmem(yyval.a_expr);
3140 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3141 yyval.a_expr->meta_type = AMT_VALUE;
3142 yyval.a_expr->Identifier = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00003143 ;
3144 break;}
3145case 239:
3146#line 1827 "asn1p_y.y"
3147{
3148 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkind2ea1de2004-08-20 13:25:29 +00003149 checkmem(yyval.a_expr);
3150 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3151 yyval.a_expr->meta_type = AMT_VALUE;
3152 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3153 yyval.a_expr->value = yyvsp[-1].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00003154 ;
3155 break;}
3156case 240:
3157#line 1835 "asn1p_y.y"
3158{
3159 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkind2ea1de2004-08-20 13:25:29 +00003160 checkmem(yyval.a_expr);
3161 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3162 yyval.a_expr->meta_type = AMT_VALUE;
3163 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3164 yyval.a_expr->value = yyvsp[-1].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00003165 ;
3166 break;}
3167case 241:
3168#line 1843 "asn1p_y.y"
3169{
3170 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003171 checkmem(yyval.a_expr);
3172 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3173 yyval.a_expr->meta_type = AMT_VALUE;
3174 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkinceb20e72004-09-05 10:40:41 +00003175 ;
3176 break;}
3177case 242:
3178#line 1850 "asn1p_y.y"
3179{
3180 yyval.a_expr = asn1p_expr_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00003181 checkmem(yyval.a_expr);
3182 yyval.a_expr->Identifier = strdup("...");
3183 checkmem(yyval.a_expr->Identifier);
3184 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
3185 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkinceb20e72004-09-05 10:40:41 +00003186 ;
3187 break;}
3188case 243:
3189#line 1861 "asn1p_y.y"
3190{
Lev Walkin070a52d2004-08-22 03:19:54 +00003191 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3192 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00003193 ;
3194 break;}
3195case 244:
3196#line 1865 "asn1p_y.y"
3197{
Lev Walkin070a52d2004-08-22 03:19:54 +00003198 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3199 checkmem(yyval.a_value);
Lev Walkinceb20e72004-09-05 10:40:41 +00003200 ;
3201 break;}
3202case 245:
3203#line 1896 "asn1p_y.y"
3204{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
3205 break;}
3206case 246:
3207#line 1897 "asn1p_y.y"
3208{ yyval.a_tag = yyvsp[0].a_tag; ;
3209 break;}
3210case 247:
3211#line 1901 "asn1p_y.y"
3212{
Lev Walkinf15320b2004-06-03 03:38:44 +00003213 yyval.a_tag = yyvsp[0].a_tag;
3214 yyval.a_tag.tag_mode = TM_DEFAULT;
Lev Walkinceb20e72004-09-05 10:40:41 +00003215 ;
3216 break;}
3217case 248:
3218#line 1905 "asn1p_y.y"
3219{
Lev Walkinf15320b2004-06-03 03:38:44 +00003220 yyval.a_tag = yyvsp[-1].a_tag;
3221 yyval.a_tag.tag_mode = TM_IMPLICIT;
Lev Walkinceb20e72004-09-05 10:40:41 +00003222 ;
3223 break;}
3224case 249:
3225#line 1909 "asn1p_y.y"
3226{
Lev Walkinf15320b2004-06-03 03:38:44 +00003227 yyval.a_tag = yyvsp[-1].a_tag;
3228 yyval.a_tag.tag_mode = TM_EXPLICIT;
Lev Walkinceb20e72004-09-05 10:40:41 +00003229 ;
3230 break;}
3231case 250:
3232#line 1916 "asn1p_y.y"
3233{
Lev Walkind2ea1de2004-08-20 13:25:29 +00003234 checkmem(yyvsp[0].tv_str);
3235 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00003236 ;
3237 break;}
3238case 251:
Lev Walkin609ccbb2004-09-04 04:49:21 +00003239#line 1920 "asn1p_y.y"
Lev Walkinceb20e72004-09-05 10:40:41 +00003240{
3241 checkmem(yyvsp[0].tv_str);
3242 yyval.tv_str = yyvsp[0].tv_str;
3243 ;
3244 break;}
3245case 252:
3246#line 1928 "asn1p_y.y"
3247{
3248 checkmem(yyvsp[0].tv_str);
3249 yyval.tv_str = yyvsp[0].tv_str;
3250 ;
3251 break;}
3252case 253:
3253#line 1935 "asn1p_y.y"
3254{
3255 checkmem(yyvsp[0].tv_str);
3256 yyval.tv_str = yyvsp[0].tv_str;
3257 ;
3258 break;}
3259case 254:
3260#line 1942 "asn1p_y.y"
3261{
Lev Walkinf15320b2004-06-03 03:38:44 +00003262 memset(&yyval.tv_nametag, 0, sizeof(yyval.tv_nametag));
3263 yyval.tv_nametag.name = yyvsp[0].tv_str;
Lev Walkinceb20e72004-09-05 10:40:41 +00003264 ;
3265 break;}
3266case 255:
3267#line 1946 "asn1p_y.y"
3268{
Lev Walkinf15320b2004-06-03 03:38:44 +00003269 yyval.tv_nametag.name = yyvsp[-1].tv_str;
3270 yyval.tv_nametag.tag = yyvsp[0].a_tag;
Lev Walkinceb20e72004-09-05 10:40:41 +00003271 ;
3272 break;}
3273}
3274 /* the action file gets copied in in place of this dollarsign */
3275#line 543 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +00003276
3277 yyvsp -= yylen;
3278 yyssp -= yylen;
Lev Walkinceb20e72004-09-05 10:40:41 +00003279#ifdef YYLSP_NEEDED
3280 yylsp -= yylen;
3281#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003282
Lev Walkinceb20e72004-09-05 10:40:41 +00003283#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00003284 if (yydebug)
3285 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003286 short *ssp1 = yyss - 1;
3287 fprintf (stderr, "state stack now");
3288 while (ssp1 != yyssp)
3289 fprintf (stderr, " %d", *++ssp1);
3290 fprintf (stderr, "\n");
Lev Walkinf15320b2004-06-03 03:38:44 +00003291 }
3292#endif
3293
3294 *++yyvsp = yyval;
3295
Lev Walkinceb20e72004-09-05 10:40:41 +00003296#ifdef YYLSP_NEEDED
3297 yylsp++;
3298 if (yylen == 0)
3299 {
3300 yylsp->first_line = yylloc.first_line;
3301 yylsp->first_column = yylloc.first_column;
3302 yylsp->last_line = (yylsp-1)->last_line;
3303 yylsp->last_column = (yylsp-1)->last_column;
3304 yylsp->text = 0;
3305 }
3306 else
3307 {
3308 yylsp->last_line = (yylsp+yylen-1)->last_line;
3309 yylsp->last_column = (yylsp+yylen-1)->last_column;
3310 }
3311#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003312
Lev Walkinceb20e72004-09-05 10:40:41 +00003313 /* Now "shift" the result of the reduction.
3314 Determine what state that goes to,
3315 based on the state we popped back to
3316 and the rule number reduced by. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003317
3318 yyn = yyr1[yyn];
3319
Lev Walkinceb20e72004-09-05 10:40:41 +00003320 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3321 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00003322 yystate = yytable[yystate];
3323 else
Lev Walkinceb20e72004-09-05 10:40:41 +00003324 yystate = yydefgoto[yyn - YYNTBASE];
Lev Walkinf15320b2004-06-03 03:38:44 +00003325
3326 goto yynewstate;
3327
Lev Walkinceb20e72004-09-05 10:40:41 +00003328yyerrlab: /* here on detecting error */
Lev Walkinf15320b2004-06-03 03:38:44 +00003329
Lev Walkinceb20e72004-09-05 10:40:41 +00003330 if (! yyerrstatus)
3331 /* If not already recovering from an error, report this error. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003332 {
3333 ++yynerrs;
Lev Walkinceb20e72004-09-05 10:40:41 +00003334
3335#ifdef YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +00003336 yyn = yypact[yystate];
3337
Lev Walkinceb20e72004-09-05 10:40:41 +00003338 if (yyn > YYFLAG && yyn < YYLAST)
Lev Walkinf15320b2004-06-03 03:38:44 +00003339 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003340 int size = 0;
3341 char *msg;
3342 int x, count;
Lev Walkinf15320b2004-06-03 03:38:44 +00003343
Lev Walkinceb20e72004-09-05 10:40:41 +00003344 count = 0;
3345 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3346 for (x = (yyn < 0 ? -yyn : 0);
3347 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3348 if (yycheck[x + yyn] == x)
3349 size += strlen(yytname[x]) + 15, count++;
3350 msg = (char *) malloc(size + 15);
3351 if (msg != 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00003352 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003353 strcpy(msg, "parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003354
Lev Walkinceb20e72004-09-05 10:40:41 +00003355 if (count < 5)
Lev Walkinf15320b2004-06-03 03:38:44 +00003356 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003357 count = 0;
3358 for (x = (yyn < 0 ? -yyn : 0);
3359 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3360 if (yycheck[x + yyn] == x)
Lev Walkinf15320b2004-06-03 03:38:44 +00003361 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003362 strcat(msg, count == 0 ? ", expecting `" : " or `");
3363 strcat(msg, yytname[x]);
3364 strcat(msg, "'");
3365 count++;
Lev Walkinf15320b2004-06-03 03:38:44 +00003366 }
3367 }
Lev Walkinceb20e72004-09-05 10:40:41 +00003368 yyerror(msg);
3369 free(msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00003370 }
3371 else
Lev Walkinceb20e72004-09-05 10:40:41 +00003372 yyerror ("parse error; also virtual memory exceeded");
Lev Walkinf15320b2004-06-03 03:38:44 +00003373 }
3374 else
3375#endif /* YYERROR_VERBOSE */
Lev Walkinceb20e72004-09-05 10:40:41 +00003376 yyerror("parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003377 }
Lev Walkinceb20e72004-09-05 10:40:41 +00003378
Lev Walkinf15320b2004-06-03 03:38:44 +00003379 goto yyerrlab1;
Lev Walkinceb20e72004-09-05 10:40:41 +00003380yyerrlab1: /* here on error raised explicitly by an action */
Lev Walkinf15320b2004-06-03 03:38:44 +00003381
3382 if (yyerrstatus == 3)
3383 {
Lev Walkinceb20e72004-09-05 10:40:41 +00003384 /* if just tried and failed to reuse lookahead token after an error, discard it. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003385
Lev Walkinceb20e72004-09-05 10:40:41 +00003386 /* return failure if at end of input */
Lev Walkinf15320b2004-06-03 03:38:44 +00003387 if (yychar == YYEOF)
Lev Walkinceb20e72004-09-05 10:40:41 +00003388 YYABORT;
Lev Walkinf15320b2004-06-03 03:38:44 +00003389
Lev Walkinceb20e72004-09-05 10:40:41 +00003390#if YYDEBUG != 0
3391 if (yydebug)
3392 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3393#endif
3394
Lev Walkinf15320b2004-06-03 03:38:44 +00003395 yychar = YYEMPTY;
3396 }
3397
Lev Walkinceb20e72004-09-05 10:40:41 +00003398 /* Else will try to reuse lookahead token
3399 after shifting the error token. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003400
Lev Walkinceb20e72004-09-05 10:40:41 +00003401 yyerrstatus = 3; /* Each real token shifted decrements this */
Lev Walkinf15320b2004-06-03 03:38:44 +00003402
Lev Walkinceb20e72004-09-05 10:40:41 +00003403 goto yyerrhandle;
Lev Walkin609ccbb2004-09-04 04:49:21 +00003404
Lev Walkinceb20e72004-09-05 10:40:41 +00003405yyerrdefault: /* current state does not do anything special for the error token. */
Lev Walkin609ccbb2004-09-04 04:49:21 +00003406
Lev Walkinceb20e72004-09-05 10:40:41 +00003407#if 0
3408 /* This is wrong; only states that explicitly want error tokens
3409 should shift them. */
3410 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3411 if (yyn) goto yydefault;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003412#endif
Lev Walkinceb20e72004-09-05 10:40:41 +00003413
3414yyerrpop: /* pop the current state because it cannot handle the error token */
3415
3416 if (yyssp == yyss) YYABORT;
3417 yyvsp--;
3418 yystate = *--yyssp;
3419#ifdef YYLSP_NEEDED
3420 yylsp--;
3421#endif
3422
3423#if YYDEBUG != 0
3424 if (yydebug)
3425 {
3426 short *ssp1 = yyss - 1;
3427 fprintf (stderr, "Error: state stack now");
3428 while (ssp1 != yyssp)
3429 fprintf (stderr, " %d", *++ssp1);
3430 fprintf (stderr, "\n");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003431 }
Lev Walkinceb20e72004-09-05 10:40:41 +00003432#endif
3433
3434yyerrhandle:
3435
3436 yyn = yypact[yystate];
3437 if (yyn == YYFLAG)
3438 goto yyerrdefault;
3439
3440 yyn += YYTERROR;
3441 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3442 goto yyerrdefault;
3443
3444 yyn = yytable[yyn];
3445 if (yyn < 0)
3446 {
3447 if (yyn == YYFLAG)
3448 goto yyerrpop;
3449 yyn = -yyn;
3450 goto yyreduce;
3451 }
3452 else if (yyn == 0)
3453 goto yyerrpop;
Lev Walkinf15320b2004-06-03 03:38:44 +00003454
3455 if (yyn == YYFINAL)
3456 YYACCEPT;
3457
Lev Walkinceb20e72004-09-05 10:40:41 +00003458#if YYDEBUG != 0
3459 if (yydebug)
3460 fprintf(stderr, "Shifting error token, ");
3461#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003462
3463 *++yyvsp = yylval;
Lev Walkinceb20e72004-09-05 10:40:41 +00003464#ifdef YYLSP_NEEDED
3465 *++yylsp = yylloc;
3466#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003467
3468 yystate = yyn;
3469 goto yynewstate;
3470
Lev Walkinceb20e72004-09-05 10:40:41 +00003471 yyacceptlab:
3472 /* YYACCEPT comes here. */
3473 if (yyfree_stacks)
3474 {
3475 free (yyss);
3476 free (yyvs);
3477#ifdef YYLSP_NEEDED
3478 free (yyls);
Lev Walkinc3b72e92004-06-03 05:07:41 +00003479#endif
Lev Walkinceb20e72004-09-05 10:40:41 +00003480 }
3481 return 0;
Lev Walkin609ccbb2004-09-04 04:49:21 +00003482
Lev Walkinceb20e72004-09-05 10:40:41 +00003483 yyabortlab:
3484 /* YYABORT comes here. */
3485 if (yyfree_stacks)
3486 {
3487 free (yyss);
3488 free (yyvs);
3489#ifdef YYLSP_NEEDED
3490 free (yyls);
Lev Walkin609ccbb2004-09-04 04:49:21 +00003491#endif
Lev Walkinceb20e72004-09-05 10:40:41 +00003492 }
3493 return 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00003494}
Lev Walkinceb20e72004-09-05 10:40:41 +00003495#line 1953 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +00003496
3497
3498
3499/*
3500 * Convert Xstring ('0101'B or '5'H) to the binary vector.
3501 */
3502static asn1p_value_t *
3503_convert_bitstring2binary(char *str, int base) {
3504 asn1p_value_t *val;
3505 int slen;
3506 int memlen;
3507 int baselen;
3508 int bits;
3509 uint8_t *binary_vector;
3510 uint8_t *bv_ptr;
3511 uint8_t cur_val;
3512
3513 assert(str);
3514 assert(str[0] == '\'');
3515
3516 switch(base) {
3517 case 'B':
3518 baselen = 1;
3519 break;
3520 case 'H':
3521 baselen = 4;
3522 break;
3523 default:
3524 assert(base == 'B' || base == 'H');
3525 errno = EINVAL;
3526 return NULL;
3527 }
3528
3529 slen = strlen(str);
3530 assert(str[slen - 1] == base);
3531 assert(str[slen - 2] == '\'');
3532
3533 memlen = slen / (8 / baselen); /* Conservative estimate */
3534
3535 bv_ptr = binary_vector = malloc(memlen + 1);
3536 if(bv_ptr == NULL)
3537 /* ENOMEM */
3538 return NULL;
3539
3540 cur_val = 0;
3541 bits = 0;
3542 while(*(++str) != '\'') {
3543 switch(baselen) {
3544 case 1:
3545 switch(*str) {
3546 case '1':
3547 cur_val |= 1 << (7 - (bits % 8));
3548 case '0':
3549 break;
3550 default:
3551 assert(!"_y UNREACH1");
3552 case ' ': case '\r': case '\n':
3553 continue;
3554 }
3555 break;
3556 case 4:
3557 switch(*str) {
3558 case '0': case '1': case '2': case '3': case '4':
3559 case '5': case '6': case '7': case '8': case '9':
3560 cur_val |= (*str - '0') << (4 - (bits % 8));
3561 break;
3562 case 'A': case 'B': case 'C':
3563 case 'D': case 'E': case 'F':
3564 cur_val |= ((*str - 'A') + 10)
3565 << (4 - (bits % 8));
3566 break;
3567 default:
3568 assert(!"_y UNREACH2");
3569 case ' ': case '\r': case '\n':
3570 continue;
3571 }
3572 break;
3573 }
3574
3575 bits += baselen;
3576 if((bits % 8) == 0) {
3577 *bv_ptr++ = cur_val;
3578 cur_val = 0;
3579 }
3580 }
3581
3582 *bv_ptr = cur_val;
3583 assert((bv_ptr - binary_vector) <= memlen);
3584
3585 val = asn1p_value_frombits(binary_vector, bits, 0);
3586 if(val == NULL) {
3587 free(binary_vector);
3588 }
3589
3590 return val;
3591}
3592
3593extern char *asn1p_text;
3594
3595int
3596yyerror(const char *msg) {
3597 fprintf(stderr,
3598 "ASN.1 grammar parse error "
3599 "near line %d (token \"%s\"): %s\n",
Lev Walkinceb20e72004-09-05 10:40:41 +00003600 yylineno, asn1p_text, msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00003601 return -1;
3602}
3603
3604