blob: a3af2985d5ab5ec8e1a7cb064eb5b5d8b7aa6194 [file] [log] [blame]
vlmfa67ddc2004-06-03 03:38:44 +00001
vlm6a02a8a2004-09-08 00:28:11 +00002/* A Bison parser, made from asn1p_y.y
3 by GNU Bison version 1.28 */
vlmfa67ddc2004-06-03 03:38:44 +00004
vlm6a02a8a2004-09-08 00:28:11 +00005#define YYBISON 1 /* Identify Bison output. */
vlmfa67ddc2004-06-03 03:38:44 +00006
7#define yyparse asn1p_parse
vlm6a02a8a2004-09-08 00:28:11 +00008#define yylex asn1p_lex
vlmfa67ddc2004-06-03 03:38:44 +00009#define yyerror asn1p_error
vlm6a02a8a2004-09-08 00:28:11 +000010#define yylval asn1p_lval
11#define yychar asn1p_char
vlmfa67ddc2004-06-03 03:38:44 +000012#define yydebug asn1p_debug
13#define yynerrs asn1p_nerrs
vlm6a02a8a2004-09-08 00:28:11 +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
vlmfa67ddc2004-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);
vlm9283dbe2004-08-18 04:59:12 +0000132void asn1p_lexer_hack_push_encoding_control(void);
vlmfa67ddc2004-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
vlm6a02a8a2004-09-08 00:28:11 +0000140#define checkmem(ptr) do { \
141 if(!(ptr)) \
142 return yyerror("Memory failure"); \
vlmfa67ddc2004-06-03 03:38:44 +0000143 } 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
vlm9283dbe2004-08-18 04:59:12 +0000165#line 58 "asn1p_y.y"
vlmfa67ddc2004-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 */
vlmc94e28f2004-09-15 11:59:51 +0000185 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
vlmfa67ddc2004-06-03 03:38:44 +0000186 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
vlmec6acd42004-09-29 13:18:09 +0000187 asn1c_integer_t a_int;
vlmfa67ddc2004-06-03 03:38:44 +0000188 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;
vlm6a02a8a2004-09-08 00:28:11 +0000197} YYSTYPE;
198#include <stdio.h>
199
200#ifndef __cplusplus
201#ifndef __STDC__
202#define const
203#endif
vlmfa67ddc2004-06-03 03:38:44 +0000204#endif
205
206
207
vlm0aa86902004-10-12 23:26:53 +0000208#define YYFINAL 407
vlm6a02a8a2004-09-08 00:28:11 +0000209#define YYFLAG -32768
210#define YYNTBASE 115
vlmfa67ddc2004-06-03 03:38:44 +0000211
vlm0aa86902004-10-12 23:26:53 +0000212#define YYTRANSLATE(x) ((unsigned)(x) <= 355 ? yytranslate[x] : 213)
vlmfa67ddc2004-06-03 03:38:44 +0000213
vlm6a02a8a2004-09-08 00:28:11 +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};
vlmfa67ddc2004-06-03 03:38:44 +0000252
vlm6a02a8a2004-09-08 00:28:11 +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,
vlm0aa86902004-10-12 23:26:53 +0000259 107, 111, 113, 117, 119, 123, 127, 130, 132, 136,
260 138, 142, 144, 151, 153, 155, 156, 158, 160, 164,
261 166, 168, 173, 177, 181, 188, 190, 194, 196, 200,
262 204, 206, 210, 212, 214, 215, 217, 219, 223, 227,
263 231, 233, 235, 239, 242, 244, 250, 251, 253, 255,
264 259, 262, 267, 272, 273, 275, 276, 283, 285, 288,
265 290, 292, 294, 298, 302, 306, 308, 310, 315, 320,
266 325, 332, 339, 341, 346, 351, 353, 357, 359, 363,
267 367, 371, 373, 377, 379, 383, 385, 387, 389, 391,
268 396, 400, 401, 405, 407, 409, 411, 413, 415, 417,
269 419, 421, 423, 427, 429, 432, 434, 436, 438, 440,
270 443, 446, 448, 450, 453, 456, 458, 460, 462, 464,
271 467, 469, 472, 474, 476, 478, 480, 482, 484, 486,
272 488, 490, 492, 494, 496, 498, 500, 502, 504, 506,
273 508, 510, 511, 513, 515, 520, 524, 529, 531, 535,
274 541, 543, 547, 551, 555, 560, 564, 566, 570, 574,
275 578, 582, 584, 586, 588, 591, 594, 598, 600, 602,
276 604, 606, 608, 610, 612, 618, 620, 624, 626, 630,
277 631, 633, 635, 637, 639, 641, 643, 647, 652, 654,
278 658, 661, 665, 667, 671, 672, 674, 676, 679, 682,
279 686, 688, 692, 694, 699, 704, 706, 708, 710, 712,
280 713, 715, 717, 720, 723, 725, 727, 729, 730, 732
vlm6a02a8a2004-09-08 00:28:11 +0000281};
vlmfa67ddc2004-06-03 03:38:44 +0000282
vlm6a02a8a2004-09-08 00:28:11 +0000283static const short yyrhs[] = { 116,
vlm0aa86902004-10-12 23:26:53 +0000284 0, 117, 0, 116, 117, 0, 209, 118, 34, 122,
vlm6a02a8a2004-09-08 00:28:11 +0000285 3, 21, 125, 39, 0, 0, 119, 0, 104, 120,
286 105, 0, 104, 105, 0, 121, 0, 120, 121, 0,
vlm0aa86902004-10-12 23:26:53 +0000287 212, 0, 212, 106, 9, 107, 0, 9, 0, 0,
vlm6a02a8a2004-09-08 00:28:11 +0000288 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,
vlm0aa86902004-10-12 23:26:53 +0000291 129, 0, 134, 0, 142, 0, 169, 0, 137, 0,
292 0, 38, 12, 128, 0, 177, 0, 54, 130, 108,
vlm6a02a8a2004-09-08 00:28:11 +0000293 0, 54, 46, 0, 131, 0, 130, 131, 0, 132,
vlm0aa86902004-10-12 23:26:53 +0000294 46, 209, 118, 0, 133, 0, 132, 109, 133, 0,
295 209, 0, 209, 104, 105, 0, 212, 0, 42, 135,
296 108, 0, 42, 17, 108, 0, 42, 108, 0, 136,
297 0, 135, 109, 136, 0, 209, 0, 209, 104, 105,
298 0, 212, 0, 209, 138, 3, 104, 139, 105, 0,
299 164, 0, 174, 0, 0, 140, 0, 141, 0, 140,
300 109, 141, 0, 102, 0, 185, 0, 209, 3, 207,
301 87, 0, 209, 3, 162, 0, 209, 3, 152, 0,
302 209, 104, 143, 105, 3, 162, 0, 144, 0, 143,
303 109, 144, 0, 209, 0, 209, 110, 212, 0, 174,
304 110, 212, 0, 146, 0, 145, 109, 146, 0, 162,
305 0, 212, 0, 0, 148, 0, 149, 0, 148, 109,
306 149, 0, 212, 162, 201, 0, 30, 68, 162, 0,
307 161, 0, 151, 0, 150, 109, 151, 0, 212, 162,
308 0, 161, 0, 28, 104, 154, 105, 156, 0, 0,
309 88, 0, 155, 0, 154, 109, 155, 0, 167, 201,
vlmbde35d42004-11-24 17:43:29 +0000310 0, 167, 162, 153, 201, 0, 167, 167, 153, 201,
vlm0aa86902004-10-12 23:26:53 +0000311 0, 0, 157, 0, 0, 95, 82, 104, 158, 159,
312 105, 0, 160, 0, 159, 160, 0, 4, 0, 167,
313 0, 102, 0, 102, 111, 172, 0, 102, 111, 206,
314 0, 207, 163, 181, 0, 176, 0, 177, 0, 27,
315 104, 150, 105, 0, 78, 104, 147, 105, 0, 79,
316 104, 147, 105, 0, 78, 181, 68, 211, 207, 163,
317 0, 79, 181, 68, 211, 207, 163, 0, 18, 0,
318 18, 35, 25, 212, 0, 209, 104, 145, 105, 0,
319 164, 0, 56, 68, 164, 0, 11, 0, 11, 112,
320 209, 0, 210, 112, 209, 0, 11, 112, 212, 0,
321 210, 0, 210, 112, 165, 0, 166, 0, 165, 112,
322 166, 0, 168, 0, 168, 0, 13, 0, 14, 0,
323 212, 138, 3, 170, 0, 212, 110, 170, 0, 0,
324 104, 171, 173, 0, 63, 0, 45, 0, 86, 0,
325 5, 0, 7, 0, 6, 0, 206, 0, 172, 0,
326 212, 0, 209, 112, 212, 0, 4, 0, 173, 4,
327 0, 24, 0, 63, 0, 76, 0, 175, 0, 67,
328 81, 0, 65, 51, 0, 77, 0, 44, 0, 36,
329 71, 0, 26, 81, 0, 91, 0, 47, 0, 58,
330 0, 40, 0, 22, 81, 0, 174, 0, 175, 203,
331 0, 23, 0, 48, 0, 49, 0, 50, 0, 59,
332 0, 64, 0, 74, 0, 83, 0, 85, 0, 90,
333 0, 92, 0, 93, 0, 94, 0, 66, 0, 99,
334 0, 100, 0, 97, 0, 98, 0, 96, 0, 0,
335 182, 0, 183, 0, 80, 106, 184, 107, 0, 106,
336 184, 107, 0, 183, 106, 184, 107, 0, 185, 0,
337 185, 109, 102, 0, 185, 109, 102, 109, 185, 0,
338 186, 0, 185, 178, 186, 0, 185, 179, 186, 0,
339 186, 180, 186, 0, 188, 106, 184, 107, 0, 106,
340 184, 107, 0, 189, 0, 189, 187, 189, 0, 61,
341 187, 189, 0, 189, 187, 60, 0, 61, 187, 60,
342 0, 195, 0, 190, 0, 101, 0, 101, 113, 0,
343 113, 101, 0, 113, 101, 113, 0, 80, 0, 46,
344 0, 206, 0, 212, 0, 6, 0, 45, 0, 86,
345 0, 95, 30, 104, 191, 105, 0, 192, 0, 191,
346 109, 192, 0, 102, 0, 212, 181, 193, 0, 0,
347 194, 0, 73, 0, 15, 0, 69, 0, 196, 0,
348 197, 0, 104, 209, 105, 0, 196, 104, 198, 105,
349 0, 199, 0, 198, 109, 199, 0, 114, 200, 0,
350 114, 112, 200, 0, 212, 0, 200, 112, 212, 0,
351 0, 202, 0, 69, 0, 33, 170, 0, 104, 105,
352 0, 104, 204, 105, 0, 205, 0, 204, 109, 205,
353 0, 212, 0, 212, 106, 206, 107, 0, 212, 106,
354 172, 107, 0, 206, 0, 102, 0, 9, 0, 10,
355 0, 0, 208, 0, 103, 0, 103, 52, 0, 103,
356 41, 0, 11, 0, 12, 0, 12, 0, 0, 212,
357 0, 8, 0
vlm6a02a8a2004-09-08 00:28:11 +0000358};
vlmfa67ddc2004-06-03 03:38:44 +0000359
360#endif
361
vlm6a02a8a2004-09-08 00:28:11 +0000362#if YYDEBUG != 0
363static const short yyrline[] = { 0,
vlm0aa86902004-10-12 23:26:53 +0000364 301, 307, 313, 329, 354, 356, 359, 363, 368, 375,
365 383, 388, 392, 401, 403, 411, 415, 423, 427, 430,
366 433, 437, 457, 459, 467, 471, 503, 507, 516, 523,
367 536, 543, 545, 557, 570, 577, 582, 588, 594, 603,
368 609, 615, 622, 628, 636, 640, 643, 650, 656, 662,
369 669, 675, 684, 694, 702, 710, 712, 722, 725, 729,
370 732, 744, 756, 762, 778, 787, 797, 807, 812, 819,
371 829, 835, 841, 845, 857, 859, 861, 867, 873, 880,
372 887, 892, 898, 904, 910, 915, 925, 927, 930, 938,
373 944, 953, 959, 976, 978, 983, 987, 992, 997, 1003,
374 1007, 1018, 1027, 1036, 1047, 1069, 1073, 1079, 1085, 1091,
375 1097, 1107, 1117, 1123, 1137, 1161, 1168, 1182, 1191, 1201,
376 1211, 1221, 1229, 1250, 1259, 1268, 1269, 1271, 1278, 1290,
377 1300, 1308, 1308, 1313, 1318, 1323, 1328, 1332, 1336, 1340,
378 1343, 1348, 1360, 1376, 1387, 1401, 1403, 1404, 1405, 1406,
379 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1419, 1421, 1422,
380 1425, 1432, 1444, 1446, 1450, 1454, 1455, 1456, 1457, 1458,
381 1462, 1463, 1464, 1465, 1469, 1470, 1477, 1477, 1478, 1478,
382 1479, 1481, 1483, 1488, 1492, 1501, 1505, 1510, 1514, 1520,
383 1530, 1534, 1537, 1540, 1545, 1554, 1562, 1568, 1575, 1583,
384 1591, 1600, 1603, 1608, 1610, 1611, 1612, 1615, 1619, 1624,
385 1628, 1639, 1643, 1648, 1655, 1661, 1665, 1670, 1676, 1688,
386 1690, 1693, 1697, 1700, 1705, 1709, 1717, 1732, 1738, 1745,
387 1758, 1770, 1785, 1789, 1806, 1811, 1814, 1819, 1841, 1846,
388 1851, 1857, 1863, 1871, 1879, 1887, 1894, 1904, 1909, 1939,
389 1941, 1944, 1949, 1953, 1959, 1964, 1971, 1978, 1980, 1984
vlm6a02a8a2004-09-08 00:28:11 +0000390};
391#endif
392
393
394#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
395
396static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
397"TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number",
398"TOK_number_negative","TOK_typereference","TOK_capitalreference","TOK_typefieldreference",
399"TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY",
400"TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN",
401"TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS",
402"TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED",
403"TOK_EMBEDDED","TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED",
404"TOK_EXPLICIT","TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE",
405"TOK_FROM","TOK_GeneralizedTime","TOK_GeneralString","TOK_GraphicString","TOK_IA5String",
406"TOK_IDENTIFIER","TOK_IMPLICIT","TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE",
407"TOK_INSTRUCTIONS","TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY",
408"TOK_NULL","TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET",
409"TOK_OF","TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT",
410"TOK_PrintableString","TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE",
411"TOK_SET","TOK_SIZE","TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString",
412"TOK_TRUE","TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString",
413"TOK_UTCTime","TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH",
414"TOK_EXCEPT","'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots",
415"TOK_tag","'{'","'}'","'('","')'","';'","','","':'","'!'","'.'","'<'","'@'",
416"ParsedGrammar","ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
417"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
418"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
419"ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition",
420"ImportsBundleSet","ImportsBundle","ImportsList","ImportsElement","ExportsDefinition",
421"ExportsBody","ExportsElement","ValueSetDefinition","DefinedTypeRef","optValueSetBody",
422"ValueSetBody","ValueSetElement","DataTypeReference","ParameterArgumentList",
vlm0aa86902004-10-12 23:26:53 +0000423"ParameterArgumentName","ActualParameterList","ActualParameter","optComponentTypeLists",
424"ComponentTypeLists","ComponentType","AlternativeTypeLists","AlternativeType",
425"ClassDeclaration","optUnique","ClassFieldList","ClassField","optWithSyntax",
426"WithSyntax","@2","WithSyntaxFormat","WithSyntaxFormatToken","ExtensionAndException",
427"Type","TypeDeclaration","ComplexTypeReference","ComplexTypeReferenceAmpList",
428"ComplexTypeReferenceElement","ClassFieldIdentifier","ClassFieldName","ValueDefinition",
429"Value","@3","DefinedValue","Opaque","BasicTypeId","BasicTypeId_UniverationCompatible",
430"BasicType","BasicString","Union","Intersection","Except","optConstraints","Constraints",
431"SetOfConstraints","ElementSetSpecs","ElementSetSpec","ConstraintSubtypeElement",
432"ConstraintRangeSpec","ConstraintSpec","ConstraintValue","WithComponents","WithComponentsList",
433"WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint",
434"SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement",
435"ComponentIdList","optMarker","Marker","UniverationDefinition","UniverationList",
436"UniverationElement","SignedNumber","optTag","Tag","TypeRefName","ObjectClassReference",
437"optIdentifier","Identifier", NULL
vlm6a02a8a2004-09-08 00:28:11 +0000438};
439#endif
440
441static const short yyr1[] = { 0,
442 115, 116, 116, 117, 118, 118, 119, 119, 120, 120,
443 121, 121, 121, 122, 122, 123, 123, 124, 124, 124,
444 124, 124, 125, 125, 126, 126, 127, 127, 127, 127,
445 127, 128, 127, 127, 129, 129, 130, 130, 131, 132,
vlm0aa86902004-10-12 23:26:53 +0000446 132, 133, 133, 133, 134, 134, 134, 135, 135, 136,
447 136, 136, 137, 138, 138, 139, 139, 140, 140, 141,
448 141, 142, 142, 142, 142, 143, 143, 144, 144, 144,
449 145, 145, 146, 146, 147, 147, 148, 148, 149, 149,
450 149, 150, 150, 151, 151, 152, 153, 153, 154, 154,
451 155, 155, 155, 156, 156, 158, 157, 159, 159, 160,
452 160, 161, 161, 161, 162, 163, 163, 163, 163, 163,
453 163, 163, 163, 163, 163, 163, 163, 164, 164, 164,
454 164, 164, 164, 165, 165, 166, 167, 168, 168, 169,
455 170, 171, 170, 170, 170, 170, 170, 170, 170, 170,
456 170, 172, 172, 173, 173, 174, 174, 174, 174, 174,
457 174, 174, 174, 174, 174, 174, 174, 175, 175, 175,
458 176, 176, 177, 177, 177, 177, 177, 177, 177, 177,
459 177, 177, 177, 177, 177, 177, 178, 178, 179, 179,
460 180, 181, 181, 182, 182, 183, 183, 184, 184, 184,
461 185, 185, 185, 185, 186, 186, 186, 186, 186, 186,
462 186, 186, 186, 187, 187, 187, 187, 188, 188, 189,
463 189, 189, 189, 189, 190, 191, 191, 192, 192, 193,
464 193, 194, 194, 194, 195, 195, 196, 197, 198, 198,
465 199, 199, 200, 200, 201, 201, 202, 202, 203, 203,
466 204, 204, 205, 205, 205, 205, 205, 206, 206, 207,
467 207, 208, 208, 208, 209, 209, 210, 211, 211, 212
vlm6a02a8a2004-09-08 00:28:11 +0000468};
469
470static const short yyr2[] = { 0,
471 1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
472 1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
473 2, 2, 0, 1, 1, 2, 1, 1, 1, 1,
474 1, 0, 3, 1, 3, 2, 1, 2, 4, 1,
vlm0aa86902004-10-12 23:26:53 +0000475 3, 1, 3, 1, 3, 3, 2, 1, 3, 1,
476 3, 1, 6, 1, 1, 0, 1, 1, 3, 1,
477 1, 4, 3, 3, 6, 1, 3, 1, 3, 3,
478 1, 3, 1, 1, 0, 1, 1, 3, 3, 3,
479 1, 1, 3, 2, 1, 5, 0, 1, 1, 3,
480 2, 4, 4, 0, 1, 0, 6, 1, 2, 1,
481 1, 1, 3, 3, 3, 1, 1, 4, 4, 4,
482 6, 6, 1, 4, 4, 1, 3, 1, 3, 3,
483 3, 1, 3, 1, 3, 1, 1, 1, 1, 4,
484 3, 0, 3, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 3, 1, 2, 1, 1, 1, 1, 2,
486 2, 1, 1, 2, 2, 1, 1, 1, 1, 2,
487 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
vlm6a02a8a2004-09-08 00:28:11 +0000488 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
vlm0aa86902004-10-12 23:26:53 +0000489 1, 0, 1, 1, 4, 3, 4, 1, 3, 5,
490 1, 3, 3, 3, 4, 3, 1, 3, 3, 3,
491 3, 1, 1, 1, 2, 2, 3, 1, 1, 1,
492 1, 1, 1, 1, 5, 1, 3, 1, 3, 0,
493 1, 1, 1, 1, 1, 1, 3, 4, 1, 3,
494 2, 3, 1, 3, 0, 1, 1, 2, 2, 3,
495 1, 3, 1, 4, 4, 1, 1, 1, 1, 0,
496 1, 1, 2, 2, 1, 1, 1, 0, 1, 1
vlm6a02a8a2004-09-08 00:28:11 +0000497};
498
499static const short yydefact[] = { 0,
vlm0aa86902004-10-12 23:26:53 +0000500 255, 256, 1, 2, 5, 3, 0, 0, 6, 260,
vlm6a02a8a2004-09-08 00:28:11 +0000501 13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
502 0, 0, 0, 0, 0, 15, 16, 0, 22, 20,
vlm0aa86902004-10-12 23:26:53 +0000503 18, 21, 19, 0, 17, 12, 23, 163, 0, 0,
504 164, 165, 166, 0, 167, 168, 176, 169, 170, 171,
505 172, 173, 174, 175, 0, 24, 25, 27, 28, 31,
506 29, 30, 34, 0, 0, 32, 0, 47, 0, 48,
507 50, 52, 36, 0, 37, 0, 40, 42, 44, 4,
508 26, 250, 118, 257, 0, 146, 0, 0, 159, 153,
509 157, 158, 147, 0, 0, 148, 152, 156, 0, 0,
510 54, 55, 149, 122, 0, 33, 46, 45, 0, 0,
511 35, 38, 0, 0, 0, 0, 252, 64, 63, 0,
512 251, 0, 160, 155, 154, 151, 150, 0, 66, 0,
513 68, 0, 0, 0, 49, 51, 5, 41, 43, 0,
514 254, 253, 118, 257, 113, 0, 0, 182, 182, 62,
515 182, 116, 161, 149, 106, 107, 0, 119, 121, 0,
516 0, 0, 0, 56, 128, 129, 123, 124, 126, 120,
517 137, 139, 138, 248, 249, 135, 134, 136, 132, 130,
518 141, 140, 0, 142, 39, 0, 89, 250, 127, 0,
519 0, 0, 0, 75, 0, 0, 183, 184, 75, 0,
520 105, 0, 162, 250, 250, 67, 70, 69, 212, 213,
521 209, 0, 208, 214, 0, 60, 0, 0, 0, 57,
522 58, 61, 191, 0, 197, 203, 202, 225, 226, 210,
vlmbde35d42004-11-24 17:43:29 +0000523 211, 0, 0, 0, 0, 94, 0, 0, 237, 87,
524 87, 91, 236, 0, 0, 102, 0, 82, 85, 250,
vlm0aa86902004-10-12 23:26:53 +0000525 117, 0, 0, 0, 76, 77, 81, 250, 0, 188,
526 258, 0, 0, 258, 247, 239, 0, 241, 246, 243,
527 0, 71, 73, 74, 65, 204, 0, 0, 0, 0,
528 0, 53, 0, 179, 180, 177, 178, 0, 0, 181,
529 0, 0, 0, 0, 125, 144, 133, 143, 131, 0,
vlmbde35d42004-11-24 17:43:29 +0000530 86, 95, 90, 238, 88, 235, 235, 114, 0, 108,
531 0, 84, 0, 250, 109, 0, 235, 186, 0, 250,
532 259, 0, 110, 250, 240, 0, 0, 115, 250, 205,
533 206, 201, 199, 0, 227, 196, 59, 192, 193, 194,
534 0, 200, 198, 0, 0, 229, 145, 0, 92, 93,
vlm0aa86902004-10-12 23:26:53 +0000535 103, 104, 142, 83, 185, 80, 78, 79, 189, 0,
536 187, 0, 242, 0, 0, 72, 207, 218, 0, 216,
537 182, 195, 0, 231, 233, 228, 0, 96, 0, 111,
538 112, 245, 244, 215, 0, 220, 232, 0, 230, 0,
539 190, 217, 223, 224, 222, 219, 221, 234, 100, 0,
540 98, 101, 97, 99, 0, 0, 0
vlm6a02a8a2004-09-08 00:28:11 +0000541};
542
vlm0aa86902004-10-12 23:26:53 +0000543static const short yydefgoto[] = { 405,
vlm6a02a8a2004-09-08 00:28:11 +0000544 3, 4, 8, 9, 13, 14, 25, 26, 27, 55,
545 56, 57, 106, 58, 74, 75, 76, 77, 59, 69,
vlm0aa86902004-10-12 23:26:53 +0000546 70, 60, 100, 219, 220, 221, 61, 128, 129, 271,
vlmbde35d42004-11-24 17:43:29 +0000547 272, 254, 255, 256, 247, 248, 118, 306, 186, 187,
vlm0aa86902004-10-12 23:26:53 +0000548 301, 302, 390, 400, 401, 257, 273, 151, 152, 167,
549 168, 188, 189, 62, 180, 233, 181, 297, 153, 103,
550 155, 156, 288, 289, 291, 196, 197, 198, 259, 260,
551 223, 278, 224, 225, 226, 369, 370, 396, 397, 227,
vlmbde35d42004-11-24 17:43:29 +0000552 228, 229, 345, 346, 374, 242, 243, 203, 267, 268,
553 230, 244, 121, 183, 104, 320, 231
vlm6a02a8a2004-09-08 00:28:11 +0000554};
555
vlmbde35d42004-11-24 17:43:29 +0000556static const short yypact[] = { 244,
557-32768,-32768, 244,-32768, -75,-32768, 5, 42,-32768,-32768,
558-32768,-32768, 36,-32768, -67, 161,-32768,-32768, 76, 51,
559 -14, 29, 46, 50, 119, 161,-32768, 39,-32768,-32768,
560-32768,-32768,-32768, 141,-32768,-32768, 305,-32768, 168, 11,
561-32768,-32768,-32768, 157,-32768,-32768,-32768,-32768,-32768,-32768,
562-32768,-32768,-32768,-32768, 167, 305,-32768,-32768,-32768,-32768,
563-32768,-32768,-32768, 14, 519,-32768, 75,-32768, 197,-32768,
564 121,-32768,-32768, 23,-32768, -22,-32768, 130,-32768,-32768,
565-32768, -8, 111,-32768, 155,-32768, 166, 171,-32768,-32768,
566-32768,-32768,-32768, 202, 177,-32768,-32768,-32768, 536, 274,
567-32768,-32768,-32768, 154, 285,-32768,-32768,-32768, 174, 185,
568-32768,-32768, 244, 174, 193, 196, 108,-32768,-32768, 382,
569-32768, 174,-32768,-32768,-32768,-32768,-32768, 58,-32768, 201,
570 208, 199, 283, 263,-32768,-32768, -75,-32768,-32768, 310,
571-32768,-32768, -6, 203, 286, 221, 261, -24, 71,-32768,
572 -20,-32768,-32768, 235,-32768,-32768, 237,-32768,-32768, 335,
573 536, 334, 334, 144,-32768,-32768, 232,-32768,-32768,-32768,
vlm0aa86902004-10-12 23:26:53 +0000574-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
vlmbde35d42004-11-24 17:43:29 +0000575-32768,-32768, 233, 236,-32768, 117,-32768, 61,-32768, 323,
576 19, 324, 245, 43, 206, 282,-32768, 246, 43, 289,
577-32768, 38,-32768, 13, 255,-32768,-32768,-32768,-32768,-32768,
578-32768, -9,-32768,-32768, 330,-32768, 244, 206, 256, 253,
579-32768, 234, 267, 259, -9,-32768,-32768, 264,-32768,-32768,
580-32768, 310, 366, 334, 263, 277, 310, 263,-32768, 288,
581 288,-32768,-32768, 459, 334, 262, 128,-32768,-32768, 255,
582-32768, 206, 306, 275, 276,-32768,-32768, 255, 279, 101,
583 334, 206, 278, 334,-32768,-32768, 140,-32768,-32768, 281,
584 156,-32768,-32768,-32768,-32768, 269, 290, 254, 280, 284,
585 294,-32768, 144,-32768,-32768,-32768,-32768, 206, 206,-32768,
586 206, 206, 270, 293,-32768,-32768, 388,-32768,-32768, 314,
587-32768,-32768,-32768,-32768,-32768, 24, 24,-32768, 273,-32768,
588 19,-32768, 295, 255,-32768, 43, 24,-32768, 301, 255,
589-32768, 303,-32768, 255,-32768, 56, 273,-32768, 13,-32768,
590 298,-32768,-32768, 45,-32768,-32768,-32768,-32768,-32768,-32768,
591 307,-32768,-32768, 0, 182,-32768,-32768, 308,-32768,-32768,
592-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 304, 459,
593-32768, 459,-32768, 309, 312,-32768,-32768,-32768, 184,-32768,
594 -20,-32768, 334, 311,-32768,-32768, 293,-32768, 206,-32768,
595-32768,-32768,-32768,-32768, 45, 88, 311, 334,-32768, 207,
596 234,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 28,
597-32768,-32768,-32768,-32768, 415, 417,-32768
vlm6a02a8a2004-09-08 00:28:11 +0000598};
599
600static const short yypgoto[] = {-32768,
vlmbde35d42004-11-24 17:43:29 +0000601-32768, 418, 287,-32768,-32768, 407,-32768,-32768, 399,-32768,
602-32768, 371,-32768,-32768,-32768, 354,-32768, 319,-32768,-32768,
603 325,-32768, 370,-32768,-32768, 153,-32768,-32768, 291,-32768,
604 110, 238,-32768, 126,-32768, 132,-32768, 209,-32768, 214,
605-32768,-32768,-32768,-32768, 44, -179, -79, -188, -54,-32768,
606 222, -183, -90,-32768, -99,-32768, -231,-32768, -2, -119,
607-32768, 32,-32768,-32768,-32768, -142,-32768,-32768, -74, -160,
608 -95, 228,-32768, -210,-32768,-32768, 70,-32768,-32768,-32768,
609-32768,-32768,-32768, 80, 89, -206,-32768,-32768,-32768, 137,
610 -118, -80,-32768, 15,-32768, 200, -7
vlm6a02a8a2004-09-08 00:28:11 +0000611};
612
613
vlmbde35d42004-11-24 17:43:29 +0000614#define YYLAST 627
vlm6a02a8a2004-09-08 00:28:11 +0000615
616
617static const short yytable[] = { 15,
vlmbde35d42004-11-24 17:43:29 +0000618 154, 120, 119, 222, 241, 15, 200, 10, 201, 101,
619 101, 249, 10, 11, 5, 182, 82, 5, 10, 116,
620 10, 1, 2, 113, 83, 84, 10, 67, 7, 65,
621 10, 399, 72, 1, 2, 85, 79, 86, 19, 87,
622 165, 166, 169, 10, 11, 10, 174, 175, 65, 88,
623 10, 64, 10, 89, 71, 193, 238, 90, 78, 193,
624 91, 102, 102, 10, 174, 175, 79, 333, 63, 30,
625 64, 92, 253, 165, 166, 16, 93, 351, 94, 194,
626 95, 195, 343, 269, 28, 195, 114, 63, 78, 96,
627 97, 276, 239, 238, 117, 364, 130, -255, 32, 349,
628 350, 72, 393, 277, 98, 122, 79, 29, 240, 12,
629 358, 373, 31, 131, 159, 117, 182, 99, 68, 182,
630 246, 34, 222, 71, 154, 275, 184, 137, 78, 239,
631 111, 249, 403, 33, 157, 299, 158, 251, 304, 265,
632 17, 169, 266, 281, 246, 36, 368, 170, 141, 209,
633 193, 10, 174, 175, 207, 208, 394, 265, 130, 142,
634 395, 37, 160, 117, 10, -235, 161, 1, 2, -235,
635 312, 380, 20, 381, 199, 131, 195, 313, 317, 66,
636 21, 10, 107, 250, 1, 2, 258, 322, 210, 211,
637 352, 258, 338, 339, 270, 340, 274, 284, 285, 286,
638 287, 22, 73, 23, 212, 80, 402, 269, 365, 319,
639 399, 209, 24, 10, 174, 175, 402, 341, 391, 165,
640 166, 236, 122, 213, 110, 237, 298, 184, 386, 214,
641 184, 280, 310, 115, 356, 123, 311, 308, 215, 360,
642 154, 125, 154, 362, 325, 216, 124, 217, 326, 218,
643 210, 211, 126, 321, 1, 2, 321, 127, 157, 209,
644 328, 10, 174, 175, 329, 133, 212, 171, 172, 173,
645 10, 174, 175, 1, 2, 209, 132, 10, 174, 175,
646 10, 174, 175, 1, 2, 213, 376, 134, 384, 136,
647 377, 214, 385, 1, 2, 165, 166, 139, 210, 140,
648 215, 353, 164, 250, 108, 109, -256, 176, 258, 217,
649 162, 218, 10, 332, 210, 1, 2, 163, 270, 353,
650 190, 274, 165, 166, 191, 177, 371, 38, 192, 342,
651 284, 285, 286, 287, 83, 84, 375, 205, 202, 214,
652 204, 10, 39, 232, 234, 235, 40, 245, 178, 261,
653 252, 262, 41, 42, 43, 214, 264, 117, 44, 279,
654 282, 283, 290, 45, 292, 375, 179, 294, 46, 296,
655 47, 300, 309, 314, 157, 305, 157, 371, 48, 315,
656 398, 330, 323, 334, 316, 318, 327, 49, 335, 50,
657 331, 347, 143, 144, 51, 348, 52, 53, 54, 145,
658 336, 355, 359, 85, 38, 86, 344, 87, 146, 361,
659 367, 378, 379, 372, 406, 382, 407, 88, 383, 18,
660 6, 89, 388, 185, 35, 90, 81, 112, 91, 41,
661 42, 43, 138, 135, 105, 337, 263, 147, 366, 92,
662 45, 357, 354, 404, 93, 46, 94, 47, 95, 307,
663 303, 206, 293, 295, 392, 48, 389, 96, 97, 148,
664 149, 387, 363, 324, 49, 0, 50, 0, 150, 143,
665 144, 51, 98, 52, 53, 54, 145, 0, 0, 0,
666 85, 38, 86, 0, 87, 146, 0, 0, 0, 0,
667 0, 0, 0, 0, 88, 0, 0, 0, 89, 0,
668 0, 0, 90, 0, 0, 91, 41, 42, 43, 0,
669 0, 0, 0, 0, 147, 0, 92, 45, 0, 0,
670 0, 93, 46, 94, 47, 95, 0, 0, 0, 83,
671 84, 0, 48, 0, 96, 97, 148, 149, 0, 0,
672 85, 49, 86, 50, 87, 0, 1, 2, 51, 98,
673 52, 53, 54, 0, 88, 0, 0, 85, 89, 86,
674 0, 87, 90, 0, 0, 91, 0, 0, 0, 0,
675 0, 88, 0, 0, 0, 89, 92, 0, 0, 90,
676 0, 93, 91, 94, 0, 95, 0, 0, 0, 0,
677 0, 0, 0, 92, 96, 97, 0, 0, 93, 0,
678 94, 0, 95, 0, 0, 0, 0, 0, 0, 98,
679 0, 96, 97, 0, 0, 0, 0, 0, 0, 0,
680 0, 0, 0, 0, 0, 0, 98
vlm6a02a8a2004-09-08 00:28:11 +0000681};
682
683static const short yycheck[] = { 7,
vlmbde35d42004-11-24 17:43:29 +0000684 120, 82, 82, 164, 188, 13, 149, 8, 151, 64,
685 65, 191, 8, 9, 0, 134, 3, 3, 8, 28,
686 8, 11, 12, 46, 11, 12, 8, 17, 104, 37,
687 8, 4, 40, 11, 12, 22, 44, 24, 106, 26,
688 13, 14, 133, 8, 9, 8, 9, 10, 56, 36,
689 8, 37, 8, 40, 40, 80, 33, 44, 44, 80,
690 47, 64, 65, 8, 9, 10, 74, 278, 37, 84,
691 56, 58, 30, 13, 14, 34, 63, 309, 65, 104,
692 67, 106, 293, 202, 9, 106, 109, 56, 74, 76,
693 77, 101, 69, 33, 103, 327, 99, 104, 53, 306,
694 307, 109, 15, 113, 91, 112, 114, 57, 188, 105,
695 317, 112, 84, 99, 122, 103, 235, 104, 108, 238,
696 102, 3, 283, 109, 244, 205, 134, 113, 114, 69,
697 108, 311, 105, 84, 120, 235, 122, 192, 238, 102,
698 105, 232, 105, 218, 102, 107, 102, 133, 41, 6,
699 80, 8, 9, 10, 162, 163, 69, 102, 161, 52,
700 73, 21, 105, 103, 8, 105, 109, 11, 12, 109,
701 250, 360, 12, 362, 104, 161, 106, 252, 258, 12,
702 20, 8, 108, 191, 11, 12, 194, 262, 45, 46,
703 309, 199, 288, 289, 202, 291, 204, 97, 98, 99,
704 100, 41, 46, 43, 61, 39, 390, 326, 327, 109,
705 4, 6, 52, 8, 9, 10, 400, 292, 379, 13,
706 14, 105, 112, 80, 104, 109, 234, 235, 371, 86,
707 238, 217, 105, 104, 314, 81, 109, 245, 95, 320,
708 360, 71, 362, 324, 105, 102, 81, 104, 109, 106,
709 45, 46, 51, 261, 11, 12, 264, 81, 244, 6,
710 105, 8, 9, 10, 109, 112, 61, 5, 6, 7,
711 8, 9, 10, 11, 12, 6, 3, 8, 9, 10,
712 8, 9, 10, 11, 12, 80, 105, 3, 105, 105,
713 109, 86, 109, 11, 12, 13, 14, 105, 45, 104,
714 95, 309, 104, 311, 108, 109, 104, 45, 316, 104,
715 110, 106, 8, 60, 45, 11, 12, 110, 326, 327,
716 35, 329, 13, 14, 104, 63, 334, 23, 68, 60,
717 97, 98, 99, 100, 11, 12, 344, 3, 104, 86,
718 104, 8, 38, 112, 112, 110, 42, 25, 86, 68,
719 106, 106, 48, 49, 50, 86, 68, 103, 54, 30,
720 105, 109, 96, 59, 106, 373, 104, 104, 64, 4,
721 66, 95, 111, 68, 360, 88, 362, 385, 74, 105,
722 388, 113, 105, 104, 109, 107, 106, 83, 105, 85,
723 101, 4, 11, 12, 90, 82, 92, 93, 94, 18,
724 107, 107, 102, 22, 23, 24, 114, 26, 27, 107,
725 113, 104, 109, 107, 0, 107, 0, 36, 107, 13,
726 3, 40, 112, 137, 26, 44, 56, 74, 47, 48,
727 49, 50, 114, 109, 65, 283, 199, 56, 329, 58,
728 59, 316, 311, 400, 63, 64, 65, 66, 67, 241,
729 237, 161, 225, 232, 385, 74, 377, 76, 77, 78,
730 79, 373, 326, 264, 83, -1, 85, -1, 87, 11,
731 12, 90, 91, 92, 93, 94, 18, -1, -1, -1,
732 22, 23, 24, -1, 26, 27, -1, -1, -1, -1,
733 -1, -1, -1, -1, 36, -1, -1, -1, 40, -1,
734 -1, -1, 44, -1, -1, 47, 48, 49, 50, -1,
735 -1, -1, -1, -1, 56, -1, 58, 59, -1, -1,
736 -1, 63, 64, 65, 66, 67, -1, -1, -1, 11,
737 12, -1, 74, -1, 76, 77, 78, 79, -1, -1,
738 22, 83, 24, 85, 26, -1, 11, 12, 90, 91,
739 92, 93, 94, -1, 36, -1, -1, 22, 40, 24,
740 -1, 26, 44, -1, -1, 47, -1, -1, -1, -1,
741 -1, 36, -1, -1, -1, 40, 58, -1, -1, 44,
742 -1, 63, 47, 65, -1, 67, -1, -1, -1, -1,
743 -1, -1, -1, 58, 76, 77, -1, -1, 63, -1,
744 65, -1, 67, -1, -1, -1, -1, -1, -1, 91,
745 -1, 76, 77, -1, -1, -1, -1, -1, -1, -1,
746 -1, -1, -1, -1, -1, -1, 91
vlm6a02a8a2004-09-08 00:28:11 +0000747};
748/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
749#line 3 "/usr/share/bison.simple"
750/* This file comes from bison-1.28. */
751
752/* Skeleton output parser for bison,
753 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
754
755 This program is free software; you can redistribute it and/or modify
756 it under the terms of the GNU General Public License as published by
757 the Free Software Foundation; either version 2, or (at your option)
758 any later version.
759
760 This program is distributed in the hope that it will be useful,
761 but WITHOUT ANY WARRANTY; without even the implied warranty of
762 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
763 GNU General Public License for more details.
764
765 You should have received a copy of the GNU General Public License
766 along with this program; if not, write to the Free Software
767 Foundation, Inc., 59 Temple Place - Suite 330,
768 Boston, MA 02111-1307, USA. */
769
770/* As a special exception, when this file is copied by Bison into a
771 Bison output file, you may use that output file without restriction.
772 This special exception was added by the Free Software Foundation
773 in version 1.24 of Bison. */
774
775/* This is the parser code that is written into each bison parser
776 when the %semantic_parser declaration is not specified in the grammar.
777 It was written by Richard Stallman by simplifying the hairy parser
778 used when %semantic_parser is specified. */
779
780#ifndef YYSTACK_USE_ALLOCA
781#ifdef alloca
782#define YYSTACK_USE_ALLOCA
783#else /* alloca not defined */
784#ifdef __GNUC__
785#define YYSTACK_USE_ALLOCA
786#define alloca __builtin_alloca
787#else /* not GNU C. */
788#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
789#define YYSTACK_USE_ALLOCA
790#include <alloca.h>
791#else /* not sparc */
792/* We think this test detects Watcom and Microsoft C. */
793/* This used to test MSDOS, but that is a bad idea
794 since that symbol is in the user namespace. */
795#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
796#if 0 /* No need for malloc.h, which pollutes the namespace;
797 instead, just don't use alloca. */
798#include <malloc.h>
799#endif
800#else /* not MSDOS, or __TURBOC__ */
801#if defined(_AIX)
802/* I don't know what this was needed for, but it pollutes the namespace.
803 So I turned it off. rms, 2 May 1997. */
804/* #include <malloc.h> */
805 #pragma alloca
806#define YYSTACK_USE_ALLOCA
807#else /* not MSDOS, or __TURBOC__, or _AIX */
808#if 0
809#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
810 and on HPUX 10. Eventually we can turn this on. */
811#define YYSTACK_USE_ALLOCA
812#define alloca __builtin_alloca
813#endif /* __hpux */
814#endif
815#endif /* not _AIX */
816#endif /* not MSDOS, or __TURBOC__ */
817#endif /* not sparc */
818#endif /* not GNU C */
819#endif /* alloca not defined */
820#endif /* YYSTACK_USE_ALLOCA not defined */
821
822#ifdef YYSTACK_USE_ALLOCA
823#define YYSTACK_ALLOC alloca
vlmfa67ddc2004-06-03 03:38:44 +0000824#else
vlm6a02a8a2004-09-08 00:28:11 +0000825#define YYSTACK_ALLOC malloc
vlmfa67ddc2004-06-03 03:38:44 +0000826#endif
827
vlm6a02a8a2004-09-08 00:28:11 +0000828/* Note: there must be only one dollar sign in this file.
829 It is replaced by the list of actions, each action
830 as one case of the switch. */
vlmfa67ddc2004-06-03 03:38:44 +0000831
832#define yyerrok (yyerrstatus = 0)
833#define yyclearin (yychar = YYEMPTY)
834#define YYEMPTY -2
835#define YYEOF 0
836#define YYACCEPT goto yyacceptlab
vlm6a02a8a2004-09-08 00:28:11 +0000837#define YYABORT goto yyabortlab
vlmfa67ddc2004-06-03 03:38:44 +0000838#define YYERROR goto yyerrlab1
vlm6a02a8a2004-09-08 00:28:11 +0000839/* Like YYERROR except do call yyerror.
840 This remains here temporarily to ease the
841 transition to the new meaning of YYERROR, for GCC.
vlmfa67ddc2004-06-03 03:38:44 +0000842 Once GCC version 2 has supplanted version 1, this can go. */
843#define YYFAIL goto yyerrlab
844#define YYRECOVERING() (!!yyerrstatus)
vlm6a02a8a2004-09-08 00:28:11 +0000845#define YYBACKUP(token, value) \
vlmfa67ddc2004-06-03 03:38:44 +0000846do \
847 if (yychar == YYEMPTY && yylen == 1) \
vlm6a02a8a2004-09-08 00:28:11 +0000848 { yychar = (token), yylval = (value); \
vlmfa67ddc2004-06-03 03:38:44 +0000849 yychar1 = YYTRANSLATE (yychar); \
850 YYPOPSTACK; \
851 goto yybackup; \
852 } \
853 else \
vlm6a02a8a2004-09-08 00:28:11 +0000854 { yyerror ("syntax error: cannot back up"); YYERROR; } \
vlmfa67ddc2004-06-03 03:38:44 +0000855while (0)
856
857#define YYTERROR 1
858#define YYERRCODE 256
859
vlm6a02a8a2004-09-08 00:28:11 +0000860#ifndef YYPURE
861#define YYLEX yylex()
vlmfa67ddc2004-06-03 03:38:44 +0000862#endif
863
vlm6a02a8a2004-09-08 00:28:11 +0000864#ifdef YYPURE
865#ifdef YYLSP_NEEDED
866#ifdef YYLEX_PARAM
867#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
868#else
869#define YYLEX yylex(&yylval, &yylloc)
870#endif
871#else /* not YYLSP_NEEDED */
872#ifdef YYLEX_PARAM
873#define YYLEX yylex(&yylval, YYLEX_PARAM)
874#else
875#define YYLEX yylex(&yylval)
876#endif
877#endif /* not YYLSP_NEEDED */
878#endif
vlmfa67ddc2004-06-03 03:38:44 +0000879
vlm6a02a8a2004-09-08 00:28:11 +0000880/* If nonreentrant, generate the variables here */
vlmfa67ddc2004-06-03 03:38:44 +0000881
vlm6a02a8a2004-09-08 00:28:11 +0000882#ifndef YYPURE
vlmfa67ddc2004-06-03 03:38:44 +0000883
vlm6a02a8a2004-09-08 00:28:11 +0000884int yychar; /* the lookahead symbol */
885YYSTYPE yylval; /* the semantic value of the */
886 /* lookahead symbol */
vlmfa67ddc2004-06-03 03:38:44 +0000887
vlm6a02a8a2004-09-08 00:28:11 +0000888#ifdef YYLSP_NEEDED
889YYLTYPE yylloc; /* location data for the lookahead */
890 /* symbol */
891#endif
vlmfa67ddc2004-06-03 03:38:44 +0000892
vlm6a02a8a2004-09-08 00:28:11 +0000893int yynerrs; /* number of parse errors so far */
894#endif /* not YYPURE */
895
896#if YYDEBUG != 0
897int yydebug; /* nonzero means print parse trace */
898/* Since this is uninitialized, it does not stop multiple parsers
899 from coexisting. */
900#endif
901
902/* YYINITDEPTH indicates the initial size of the parser's stacks */
903
vlmfa67ddc2004-06-03 03:38:44 +0000904#ifndef YYINITDEPTH
vlm6a02a8a2004-09-08 00:28:11 +0000905#define YYINITDEPTH 200
vlmfa67ddc2004-06-03 03:38:44 +0000906#endif
907
vlm6a02a8a2004-09-08 00:28:11 +0000908/* YYMAXDEPTH is the maximum size the stacks can grow to
909 (effective only if the built-in stack extension method is used). */
vlmfa67ddc2004-06-03 03:38:44 +0000910
911#if YYMAXDEPTH == 0
vlm6a02a8a2004-09-08 00:28:11 +0000912#undef YYMAXDEPTH
vlmfa67ddc2004-06-03 03:38:44 +0000913#endif
914
915#ifndef YYMAXDEPTH
vlm6a02a8a2004-09-08 00:28:11 +0000916#define YYMAXDEPTH 10000
vlmfa67ddc2004-06-03 03:38:44 +0000917#endif
918
vlm6a02a8a2004-09-08 00:28:11 +0000919/* Define __yy_memcpy. Note that the size argument
920 should be passed with type unsigned int, because that is what the non-GCC
921 definitions require. With GCC, __builtin_memcpy takes an arg
922 of type size_t, but it can handle unsigned int. */
vlmfa67ddc2004-06-03 03:38:44 +0000923
vlm6a02a8a2004-09-08 00:28:11 +0000924#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
925#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
926#else /* not GNU C or C++ */
927#ifndef __cplusplus
vlmfa67ddc2004-06-03 03:38:44 +0000928
vlm6a02a8a2004-09-08 00:28:11 +0000929/* This is the most reliable way to avoid incompatibilities
930 in available built-in functions on various systems. */
vlm80103492004-09-07 10:39:09 +0000931static void
vlm6a02a8a2004-09-08 00:28:11 +0000932__yy_memcpy (to, from, count)
933 char *to;
934 char *from;
935 unsigned int count;
vlm80103492004-09-07 10:39:09 +0000936{
vlm6a02a8a2004-09-08 00:28:11 +0000937 register char *f = from;
938 register char *t = to;
939 register int i = count;
vlm80103492004-09-07 10:39:09 +0000940
vlm6a02a8a2004-09-08 00:28:11 +0000941 while (i-- > 0)
942 *t++ = *f++;
vlm80103492004-09-07 10:39:09 +0000943}
vlm80103492004-09-07 10:39:09 +0000944
vlm6a02a8a2004-09-08 00:28:11 +0000945#else /* __cplusplus */
vlm80103492004-09-07 10:39:09 +0000946
vlm6a02a8a2004-09-08 00:28:11 +0000947/* This is the most reliable way to avoid incompatibilities
948 in available built-in functions on various systems. */
vlm80103492004-09-07 10:39:09 +0000949static void
vlm6a02a8a2004-09-08 00:28:11 +0000950__yy_memcpy (char *to, char *from, unsigned int count)
vlm80103492004-09-07 10:39:09 +0000951{
vlm6a02a8a2004-09-08 00:28:11 +0000952 register char *t = to;
953 register char *f = from;
954 register int i = count;
vlm80103492004-09-07 10:39:09 +0000955
vlm6a02a8a2004-09-08 00:28:11 +0000956 while (i-- > 0)
957 *t++ = *f++;
vlm044f7442004-09-04 04:49:21 +0000958}
vlm044f7442004-09-04 04:49:21 +0000959
vlm6a02a8a2004-09-08 00:28:11 +0000960#endif
961#endif
vlmfa67ddc2004-06-03 03:38:44 +0000962
vlm6a02a8a2004-09-08 00:28:11 +0000963#line 217 "/usr/share/bison.simple"
vlmfa67ddc2004-06-03 03:38:44 +0000964
965/* The user can define YYPARSE_PARAM as the name of an argument to be passed
966 into yyparse. The argument should have type void *.
967 It should actually point to an object.
968 Grammar actions can access the variable by casting it
969 to the proper pointer type. */
970
971#ifdef YYPARSE_PARAM
vlm6a02a8a2004-09-08 00:28:11 +0000972#ifdef __cplusplus
973#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
974#define YYPARSE_PARAM_DECL
975#else /* not __cplusplus */
976#define YYPARSE_PARAM_ARG YYPARSE_PARAM
977#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
978#endif /* not __cplusplus */
979#else /* not YYPARSE_PARAM */
980#define YYPARSE_PARAM_ARG
981#define YYPARSE_PARAM_DECL
982#endif /* not YYPARSE_PARAM */
vlmfa67ddc2004-06-03 03:38:44 +0000983
984/* Prevent warning if -Wstrict-prototypes. */
985#ifdef __GNUC__
vlm6a02a8a2004-09-08 00:28:11 +0000986#ifdef YYPARSE_PARAM
vlmfa67ddc2004-06-03 03:38:44 +0000987int yyparse (void *);
vlm6a02a8a2004-09-08 00:28:11 +0000988#else
vlmfa67ddc2004-06-03 03:38:44 +0000989int yyparse (void);
vlm6a02a8a2004-09-08 00:28:11 +0000990#endif
vlm39e5ed72004-09-05 10:40:41 +0000991#endif
vlm80103492004-09-07 10:39:09 +0000992
vlmfa67ddc2004-06-03 03:38:44 +0000993int
vlm6a02a8a2004-09-08 00:28:11 +0000994yyparse(YYPARSE_PARAM_ARG)
vlmfa67ddc2004-06-03 03:38:44 +0000995 YYPARSE_PARAM_DECL
996{
997 register int yystate;
998 register int yyn;
999 register short *yyssp;
1000 register YYSTYPE *yyvsp;
vlm6a02a8a2004-09-08 00:28:11 +00001001 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1002 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
vlmfa67ddc2004-06-03 03:38:44 +00001003
vlm6a02a8a2004-09-08 00:28:11 +00001004 short yyssa[YYINITDEPTH]; /* the state stack */
1005 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
vlmfa67ddc2004-06-03 03:38:44 +00001006
vlm6a02a8a2004-09-08 00:28:11 +00001007 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1008 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
vlmfa67ddc2004-06-03 03:38:44 +00001009
vlm6a02a8a2004-09-08 00:28:11 +00001010#ifdef YYLSP_NEEDED
1011 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1012 YYLTYPE *yyls = yylsa;
1013 YYLTYPE *yylsp;
1014
1015#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1016#else
vlmfa67ddc2004-06-03 03:38:44 +00001017#define YYPOPSTACK (yyvsp--, yyssp--)
vlm6a02a8a2004-09-08 00:28:11 +00001018#endif
vlmfa67ddc2004-06-03 03:38:44 +00001019
vlm6a02a8a2004-09-08 00:28:11 +00001020 int yystacksize = YYINITDEPTH;
1021 int yyfree_stacks = 0;
vlmfa67ddc2004-06-03 03:38:44 +00001022
vlm6a02a8a2004-09-08 00:28:11 +00001023#ifdef YYPURE
1024 int yychar;
1025 YYSTYPE yylval;
1026 int yynerrs;
1027#ifdef YYLSP_NEEDED
1028 YYLTYPE yylloc;
1029#endif
1030#endif
vlmfa67ddc2004-06-03 03:38:44 +00001031
vlm6a02a8a2004-09-08 00:28:11 +00001032 YYSTYPE yyval; /* the variable used to return */
1033 /* semantic values from the action */
1034 /* routines */
vlmfa67ddc2004-06-03 03:38:44 +00001035
1036 int yylen;
1037
vlm6a02a8a2004-09-08 00:28:11 +00001038#if YYDEBUG != 0
1039 if (yydebug)
1040 fprintf(stderr, "Starting parse\n");
1041#endif
vlmfa67ddc2004-06-03 03:38:44 +00001042
1043 yystate = 0;
1044 yyerrstatus = 0;
1045 yynerrs = 0;
1046 yychar = YYEMPTY; /* Cause a token to be read. */
1047
1048 /* Initialize stack pointers.
1049 Waste one element of value and location stack
1050 so that they stay on the same level as the state stack.
1051 The wasted elements are never initialized. */
1052
vlm6a02a8a2004-09-08 00:28:11 +00001053 yyssp = yyss - 1;
vlmfa67ddc2004-06-03 03:38:44 +00001054 yyvsp = yyvs;
vlm6a02a8a2004-09-08 00:28:11 +00001055#ifdef YYLSP_NEEDED
1056 yylsp = yyls;
1057#endif
vlmfa67ddc2004-06-03 03:38:44 +00001058
vlm6a02a8a2004-09-08 00:28:11 +00001059/* Push a new state, which is found in yystate . */
1060/* In all cases, when you get here, the value and location stacks
1061 have just been pushed. so pushing a state here evens the stacks. */
1062yynewstate:
vlmfa67ddc2004-06-03 03:38:44 +00001063
vlm6a02a8a2004-09-08 00:28:11 +00001064 *++yyssp = yystate;
vlmfa67ddc2004-06-03 03:38:44 +00001065
1066 if (yyssp >= yyss + yystacksize - 1)
1067 {
vlm6a02a8a2004-09-08 00:28:11 +00001068 /* Give user a chance to reallocate the stack */
1069 /* Use copies of these so that the &'s don't force the real ones into memory. */
1070 YYSTYPE *yyvs1 = yyvs;
1071 short *yyss1 = yyss;
1072#ifdef YYLSP_NEEDED
1073 YYLTYPE *yyls1 = yyls;
1074#endif
1075
vlmfa67ddc2004-06-03 03:38:44 +00001076 /* Get the current used size of the three stacks, in elements. */
vlm6a02a8a2004-09-08 00:28:11 +00001077 int size = yyssp - yyss + 1;
vlmfa67ddc2004-06-03 03:38:44 +00001078
1079#ifdef yyoverflow
vlm6a02a8a2004-09-08 00:28:11 +00001080 /* Each stack pointer address is followed by the size of
1081 the data in use in that stack, in bytes. */
1082#ifdef YYLSP_NEEDED
1083 /* This used to be a conditional around just the two extra args,
1084 but that might be undefined if yyoverflow is a macro. */
1085 yyoverflow("parser stack overflow",
1086 &yyss1, size * sizeof (*yyssp),
1087 &yyvs1, size * sizeof (*yyvsp),
1088 &yyls1, size * sizeof (*yylsp),
1089 &yystacksize);
1090#else
1091 yyoverflow("parser stack overflow",
1092 &yyss1, size * sizeof (*yyssp),
1093 &yyvs1, size * sizeof (*yyvsp),
1094 &yystacksize);
1095#endif
vlmfa67ddc2004-06-03 03:38:44 +00001096
vlm6a02a8a2004-09-08 00:28:11 +00001097 yyss = yyss1; yyvs = yyvs1;
1098#ifdef YYLSP_NEEDED
1099 yyls = yyls1;
1100#endif
vlmfa67ddc2004-06-03 03:38:44 +00001101#else /* no yyoverflow */
1102 /* Extend the stack our own way. */
1103 if (yystacksize >= YYMAXDEPTH)
vlm6a02a8a2004-09-08 00:28:11 +00001104 {
1105 yyerror("parser stack overflow");
1106 if (yyfree_stacks)
1107 {
1108 free (yyss);
1109 free (yyvs);
1110#ifdef YYLSP_NEEDED
1111 free (yyls);
1112#endif
1113 }
1114 return 2;
1115 }
vlmfa67ddc2004-06-03 03:38:44 +00001116 yystacksize *= 2;
1117 if (yystacksize > YYMAXDEPTH)
1118 yystacksize = YYMAXDEPTH;
vlm6a02a8a2004-09-08 00:28:11 +00001119#ifndef YYSTACK_USE_ALLOCA
1120 yyfree_stacks = 1;
1121#endif
1122 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1123 __yy_memcpy ((char *)yyss, (char *)yyss1,
1124 size * (unsigned int) sizeof (*yyssp));
1125 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1126 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1127 size * (unsigned int) sizeof (*yyvsp));
1128#ifdef YYLSP_NEEDED
1129 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1130 __yy_memcpy ((char *)yyls, (char *)yyls1,
1131 size * (unsigned int) sizeof (*yylsp));
1132#endif
vlmfa67ddc2004-06-03 03:38:44 +00001133#endif /* no yyoverflow */
1134
vlm6a02a8a2004-09-08 00:28:11 +00001135 yyssp = yyss + size - 1;
1136 yyvsp = yyvs + size - 1;
1137#ifdef YYLSP_NEEDED
1138 yylsp = yyls + size - 1;
1139#endif
vlmfa67ddc2004-06-03 03:38:44 +00001140
vlm6a02a8a2004-09-08 00:28:11 +00001141#if YYDEBUG != 0
1142 if (yydebug)
1143 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1144#endif
vlmfa67ddc2004-06-03 03:38:44 +00001145
1146 if (yyssp >= yyss + yystacksize - 1)
1147 YYABORT;
1148 }
1149
vlm6a02a8a2004-09-08 00:28:11 +00001150#if YYDEBUG != 0
1151 if (yydebug)
1152 fprintf(stderr, "Entering state %d\n", yystate);
1153#endif
vlmfa67ddc2004-06-03 03:38:44 +00001154
1155 goto yybackup;
vlm6a02a8a2004-09-08 00:28:11 +00001156 yybackup:
vlmfa67ddc2004-06-03 03:38:44 +00001157
1158/* Do appropriate processing given the current state. */
1159/* Read a lookahead token if we need one and don't already have one. */
1160/* yyresume: */
1161
1162 /* First try to decide what to do without reference to lookahead token. */
1163
1164 yyn = yypact[yystate];
vlm6a02a8a2004-09-08 00:28:11 +00001165 if (yyn == YYFLAG)
vlmfa67ddc2004-06-03 03:38:44 +00001166 goto yydefault;
1167
1168 /* Not known => get a lookahead token if don't already have one. */
1169
1170 /* yychar is either YYEMPTY or YYEOF
1171 or a valid token in external form. */
1172
1173 if (yychar == YYEMPTY)
1174 {
vlm6a02a8a2004-09-08 00:28:11 +00001175#if YYDEBUG != 0
1176 if (yydebug)
1177 fprintf(stderr, "Reading a token: ");
1178#endif
vlmfa67ddc2004-06-03 03:38:44 +00001179 yychar = YYLEX;
1180 }
1181
vlm6a02a8a2004-09-08 00:28:11 +00001182 /* Convert token to internal form (in yychar1) for indexing tables with */
vlmfa67ddc2004-06-03 03:38:44 +00001183
vlm6a02a8a2004-09-08 00:28:11 +00001184 if (yychar <= 0) /* This means end of input. */
vlmfa67ddc2004-06-03 03:38:44 +00001185 {
1186 yychar1 = 0;
vlm6a02a8a2004-09-08 00:28:11 +00001187 yychar = YYEOF; /* Don't call YYLEX any more */
vlmfa67ddc2004-06-03 03:38:44 +00001188
vlm6a02a8a2004-09-08 00:28:11 +00001189#if YYDEBUG != 0
1190 if (yydebug)
1191 fprintf(stderr, "Now at end of input.\n");
1192#endif
vlmfa67ddc2004-06-03 03:38:44 +00001193 }
1194 else
1195 {
vlm6a02a8a2004-09-08 00:28:11 +00001196 yychar1 = YYTRANSLATE(yychar);
vlmfa67ddc2004-06-03 03:38:44 +00001197
vlm6a02a8a2004-09-08 00:28:11 +00001198#if YYDEBUG != 0
1199 if (yydebug)
1200 {
1201 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1202 /* Give the individual parser a way to print the precise meaning
1203 of a token, for further debugging info. */
1204#ifdef YYPRINT
1205 YYPRINT (stderr, yychar, yylval);
1206#endif
1207 fprintf (stderr, ")\n");
1208 }
1209#endif
vlmfa67ddc2004-06-03 03:38:44 +00001210 }
1211
1212 yyn += yychar1;
vlm6a02a8a2004-09-08 00:28:11 +00001213 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
vlmfa67ddc2004-06-03 03:38:44 +00001214 goto yydefault;
vlm6a02a8a2004-09-08 00:28:11 +00001215
vlmfa67ddc2004-06-03 03:38:44 +00001216 yyn = yytable[yyn];
vlm6a02a8a2004-09-08 00:28:11 +00001217
1218 /* yyn is what to do for this token type in this state.
1219 Negative => reduce, -yyn is rule number.
1220 Positive => shift, yyn is new state.
1221 New state is final state => don't bother to shift,
1222 just return success.
1223 0, or most negative number => error. */
1224
1225 if (yyn < 0)
vlmfa67ddc2004-06-03 03:38:44 +00001226 {
vlm6a02a8a2004-09-08 00:28:11 +00001227 if (yyn == YYFLAG)
vlmfa67ddc2004-06-03 03:38:44 +00001228 goto yyerrlab;
1229 yyn = -yyn;
1230 goto yyreduce;
1231 }
vlm6a02a8a2004-09-08 00:28:11 +00001232 else if (yyn == 0)
1233 goto yyerrlab;
vlmfa67ddc2004-06-03 03:38:44 +00001234
1235 if (yyn == YYFINAL)
1236 YYACCEPT;
1237
1238 /* Shift the lookahead token. */
vlm6a02a8a2004-09-08 00:28:11 +00001239
1240#if YYDEBUG != 0
1241 if (yydebug)
1242 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1243#endif
vlmfa67ddc2004-06-03 03:38:44 +00001244
1245 /* Discard the token being shifted unless it is eof. */
1246 if (yychar != YYEOF)
1247 yychar = YYEMPTY;
1248
1249 *++yyvsp = yylval;
vlm6a02a8a2004-09-08 00:28:11 +00001250#ifdef YYLSP_NEEDED
1251 *++yylsp = yylloc;
1252#endif
vlmfa67ddc2004-06-03 03:38:44 +00001253
vlm6a02a8a2004-09-08 00:28:11 +00001254 /* count tokens shifted since error; after three, turn off error status. */
1255 if (yyerrstatus) yyerrstatus--;
vlmfa67ddc2004-06-03 03:38:44 +00001256
1257 yystate = yyn;
1258 goto yynewstate;
1259
vlm6a02a8a2004-09-08 00:28:11 +00001260/* Do the default action for the current state. */
vlm80103492004-09-07 10:39:09 +00001261yydefault:
vlm6a02a8a2004-09-08 00:28:11 +00001262
vlmfa67ddc2004-06-03 03:38:44 +00001263 yyn = yydefact[yystate];
1264 if (yyn == 0)
1265 goto yyerrlab;
1266
vlm6a02a8a2004-09-08 00:28:11 +00001267/* Do a reduction. yyn is the number of a rule to reduce with. */
vlmfa67ddc2004-06-03 03:38:44 +00001268yyreduce:
1269 yylen = yyr2[yyn];
vlm6a02a8a2004-09-08 00:28:11 +00001270 if (yylen > 0)
1271 yyval = yyvsp[1-yylen]; /* implement default value of the action */
vlmfa67ddc2004-06-03 03:38:44 +00001272
vlm6a02a8a2004-09-08 00:28:11 +00001273#if YYDEBUG != 0
vlmfa67ddc2004-06-03 03:38:44 +00001274 if (yydebug)
1275 {
vlm6a02a8a2004-09-08 00:28:11 +00001276 int i;
vlmfa67ddc2004-06-03 03:38:44 +00001277
vlm6a02a8a2004-09-08 00:28:11 +00001278 fprintf (stderr, "Reducing via rule %d (line %d), ",
1279 yyn, yyrline[yyn]);
vlmfa67ddc2004-06-03 03:38:44 +00001280
1281 /* Print the symbols being reduced, and their result. */
vlm6a02a8a2004-09-08 00:28:11 +00001282 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1283 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1284 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
vlmfa67ddc2004-06-03 03:38:44 +00001285 }
1286#endif
vlm80103492004-09-07 10:39:09 +00001287
vlm6a02a8a2004-09-08 00:28:11 +00001288
1289 switch (yyn) {
1290
1291case 1:
vlm0aa86902004-10-12 23:26:53 +00001292#line 302 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001293{
1294 *(void **)param = yyvsp[0].a_grammar;
1295 ;
1296 break;}
1297case 2:
vlm0aa86902004-10-12 23:26:53 +00001298#line 308 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001299{
vlmfa67ddc2004-06-03 03:38:44 +00001300 yyval.a_grammar = asn1p_new();
1301 checkmem(yyval.a_grammar);
1302 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
vlm6a02a8a2004-09-08 00:28:11 +00001303 ;
1304 break;}
1305case 3:
vlm0aa86902004-10-12 23:26:53 +00001306#line 313 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001307{
vlmfa67ddc2004-06-03 03:38:44 +00001308 yyval.a_grammar = yyvsp[-1].a_grammar;
1309 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
vlm6a02a8a2004-09-08 00:28:11 +00001310 ;
1311 break;}
1312case 4:
vlm0aa86902004-10-12 23:26:53 +00001313#line 334 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001314{
vlmfa67ddc2004-06-03 03:38:44 +00001315
1316 if(yyvsp[-1].a_module) {
1317 yyval.a_module = yyvsp[-1].a_module;
1318 } else {
1319 /* There's a chance that a module is just plain empty */
1320 yyval.a_module = asn1p_module_new();
1321 }
1322 checkmem(yyval.a_module);
1323
1324 yyval.a_module->Identifier = yyvsp[-7].tv_str;
1325 yyval.a_module->module_oid = yyvsp[-6].a_oid;
1326 yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
vlm6a02a8a2004-09-08 00:28:11 +00001327 ;
1328 break;}
1329case 5:
vlm0aa86902004-10-12 23:26:53 +00001330#line 355 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001331{ yyval.a_oid = 0; ;
1332 break;}
1333case 6:
vlm0aa86902004-10-12 23:26:53 +00001334#line 356 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001335{ yyval.a_oid = yyvsp[0].a_oid; ;
1336 break;}
1337case 7:
vlm0aa86902004-10-12 23:26:53 +00001338#line 360 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001339{
vlmfa67ddc2004-06-03 03:38:44 +00001340 yyval.a_oid = yyvsp[-1].a_oid;
vlm6a02a8a2004-09-08 00:28:11 +00001341 ;
1342 break;}
1343case 8:
vlm0aa86902004-10-12 23:26:53 +00001344#line 363 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001345{
vlmfa67ddc2004-06-03 03:38:44 +00001346 yyval.a_oid = 0;
vlm6a02a8a2004-09-08 00:28:11 +00001347 ;
1348 break;}
1349case 9:
vlm0aa86902004-10-12 23:26:53 +00001350#line 369 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001351{
vlmfa67ddc2004-06-03 03:38:44 +00001352 yyval.a_oid = asn1p_oid_new();
1353 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1354 if(yyvsp[0].a_oid_arc.name)
1355 free(yyvsp[0].a_oid_arc.name);
vlm6a02a8a2004-09-08 00:28:11 +00001356 ;
1357 break;}
1358case 10:
vlm0aa86902004-10-12 23:26:53 +00001359#line 375 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001360{
vlmfa67ddc2004-06-03 03:38:44 +00001361 yyval.a_oid = yyvsp[-1].a_oid;
1362 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1363 if(yyvsp[0].a_oid_arc.name)
1364 free(yyvsp[0].a_oid_arc.name);
vlm6a02a8a2004-09-08 00:28:11 +00001365 ;
1366 break;}
1367case 11:
vlm0aa86902004-10-12 23:26:53 +00001368#line 384 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001369{ /* iso */
vlmfa67ddc2004-06-03 03:38:44 +00001370 yyval.a_oid_arc.name = yyvsp[0].tv_str;
1371 yyval.a_oid_arc.number = -1;
vlm6a02a8a2004-09-08 00:28:11 +00001372 ;
1373 break;}
1374case 12:
vlm0aa86902004-10-12 23:26:53 +00001375#line 388 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001376{ /* iso(1) */
vlmfa67ddc2004-06-03 03:38:44 +00001377 yyval.a_oid_arc.name = yyvsp[-3].tv_str;
1378 yyval.a_oid_arc.number = yyvsp[-1].a_int;
vlm6a02a8a2004-09-08 00:28:11 +00001379 ;
1380 break;}
1381case 13:
vlm0aa86902004-10-12 23:26:53 +00001382#line 392 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001383{ /* 1 */
vlmfa67ddc2004-06-03 03:38:44 +00001384 yyval.a_oid_arc.name = 0;
1385 yyval.a_oid_arc.number = yyvsp[0].a_int;
vlm6a02a8a2004-09-08 00:28:11 +00001386 ;
1387 break;}
1388case 14:
vlm0aa86902004-10-12 23:26:53 +00001389#line 402 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001390{ yyval.a_module_flags = MSF_NOFLAGS; ;
1391 break;}
1392case 15:
vlm0aa86902004-10-12 23:26:53 +00001393#line 403 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001394{
vlmfa67ddc2004-06-03 03:38:44 +00001395 yyval.a_module_flags = yyvsp[0].a_module_flags;
vlm6a02a8a2004-09-08 00:28:11 +00001396 ;
1397 break;}
1398case 16:
vlm0aa86902004-10-12 23:26:53 +00001399#line 412 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001400{
vlmfa67ddc2004-06-03 03:38:44 +00001401 yyval.a_module_flags = yyvsp[0].a_module_flags;
vlm6a02a8a2004-09-08 00:28:11 +00001402 ;
1403 break;}
1404case 17:
vlm0aa86902004-10-12 23:26:53 +00001405#line 415 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001406{
vlmfa67ddc2004-06-03 03:38:44 +00001407 yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
vlm6a02a8a2004-09-08 00:28:11 +00001408 ;
1409 break;}
1410case 18:
vlm0aa86902004-10-12 23:26:53 +00001411#line 424 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001412{
vlmfa67ddc2004-06-03 03:38:44 +00001413 yyval.a_module_flags = MSF_EXPLICIT_TAGS;
vlm6a02a8a2004-09-08 00:28:11 +00001414 ;
1415 break;}
1416case 19:
vlm0aa86902004-10-12 23:26:53 +00001417#line 427 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001418{
vlmfa67ddc2004-06-03 03:38:44 +00001419 yyval.a_module_flags = MSF_IMPLICIT_TAGS;
vlm6a02a8a2004-09-08 00:28:11 +00001420 ;
1421 break;}
1422case 20:
vlm0aa86902004-10-12 23:26:53 +00001423#line 430 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001424{
vlmfa67ddc2004-06-03 03:38:44 +00001425 yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
vlm6a02a8a2004-09-08 00:28:11 +00001426 ;
1427 break;}
1428case 21:
vlm0aa86902004-10-12 23:26:53 +00001429#line 433 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001430{
vlmfa67ddc2004-06-03 03:38:44 +00001431 yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
vlm6a02a8a2004-09-08 00:28:11 +00001432 ;
1433 break;}
1434case 22:
vlm0aa86902004-10-12 23:26:53 +00001435#line 437 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001436{
vlm9283dbe2004-08-18 04:59:12 +00001437 /* X.680Amd1 specifies TAG and XER */
1438 if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) {
1439 yyval.a_module_flags = MSF_TAG_INSTRUCTIONS;
1440 } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) {
1441 yyval.a_module_flags = MSF_XER_INSTRUCTIONS;
1442 } else {
1443 fprintf(stderr,
1444 "WARNING: %s INSTRUCTIONS at line %d: "
1445 "Unrecognized encoding reference\n",
1446 yyvsp[-1].tv_str, yylineno);
1447 yyval.a_module_flags = MSF_unk_INSTRUCTIONS;
1448 }
1449 free(yyvsp[-1].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00001450 ;
1451 break;}
1452case 23:
vlm0aa86902004-10-12 23:26:53 +00001453#line 458 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001454{ yyval.a_module = 0; ;
1455 break;}
1456case 24:
vlm0aa86902004-10-12 23:26:53 +00001457#line 459 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001458{
vlmfa67ddc2004-06-03 03:38:44 +00001459 yyval.a_module = yyvsp[0].a_module;
vlm6a02a8a2004-09-08 00:28:11 +00001460 ;
1461 break;}
1462case 25:
vlm0aa86902004-10-12 23:26:53 +00001463#line 468 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001464{
vlm9283dbe2004-08-18 04:59:12 +00001465 yyval.a_module = yyvsp[0].a_module;
vlm6a02a8a2004-09-08 00:28:11 +00001466 ;
1467 break;}
1468case 26:
vlm0aa86902004-10-12 23:26:53 +00001469#line 471 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001470{
vlmfa67ddc2004-06-03 03:38:44 +00001471 yyval.a_module = yyvsp[-1].a_module;
1472
vlm9283dbe2004-08-18 04:59:12 +00001473 /* Behave well when one of them is skipped. */
1474 if(!(yyvsp[-1].a_module)) {
1475 if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module;
1476 break;
1477 }
1478
vlmfa67ddc2004-06-03 03:38:44 +00001479#ifdef MY_IMPORT
1480#error MY_IMPORT DEFINED ELSEWHERE!
1481#endif
1482#define MY_IMPORT(foo,field) do { \
vlm97ed7152004-08-13 12:31:09 +00001483 while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
vlmfa67ddc2004-06-03 03:38:44 +00001484 TQ_ADD(&(yyval.a_module->foo), \
1485 TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
1486 field); \
vlm97ed7152004-08-13 12:31:09 +00001487 } \
1488 assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
1489 } while(0)
vlmfa67ddc2004-06-03 03:38:44 +00001490
1491 MY_IMPORT(imports, xp_next);
1492 MY_IMPORT(exports, xp_next);
1493 MY_IMPORT(members, next);
1494#undef MY_IMPORT
1495
vlm6a02a8a2004-09-08 00:28:11 +00001496 ;
1497 break;}
1498case 27:
vlm0aa86902004-10-12 23:26:53 +00001499#line 504 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001500{
vlmfa67ddc2004-06-03 03:38:44 +00001501 yyval.a_module = yyvsp[0].a_module;
vlm6a02a8a2004-09-08 00:28:11 +00001502 ;
1503 break;}
1504case 28:
vlm0aa86902004-10-12 23:26:53 +00001505#line 507 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001506{
vlmfa67ddc2004-06-03 03:38:44 +00001507 yyval.a_module = asn1p_module_new();
1508 checkmem(yyval.a_module);
1509 if(yyvsp[0].a_xports) {
1510 TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
1511 } else {
1512 /* "EXPORTS ALL;" ? */
1513 }
vlm6a02a8a2004-09-08 00:28:11 +00001514 ;
1515 break;}
1516case 29:
vlm0aa86902004-10-12 23:26:53 +00001517#line 516 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001518{
vlmfa67ddc2004-06-03 03:38:44 +00001519 yyval.a_module = asn1p_module_new();
1520 checkmem(yyval.a_module);
1521 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1522 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1523 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001524 ;
1525 break;}
1526case 30:
vlm0aa86902004-10-12 23:26:53 +00001527#line 523 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001528{
vlm9283dbe2004-08-18 04:59:12 +00001529 yyval.a_module = asn1p_module_new();
1530 checkmem(yyval.a_module);
1531 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1532 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1533 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001534 ;
1535 break;}
1536case 31:
vlm0aa86902004-10-12 23:26:53 +00001537#line 536 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001538{
vlm9283dbe2004-08-18 04:59:12 +00001539 yyval.a_module = asn1p_module_new();
1540 checkmem(yyval.a_module);
1541 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1542 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1543 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001544 ;
1545 break;}
1546case 32:
vlm0aa86902004-10-12 23:26:53 +00001547#line 544 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001548{ asn1p_lexer_hack_push_encoding_control(); ;
1549 break;}
1550case 33:
vlm0aa86902004-10-12 23:26:53 +00001551#line 545 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001552{
vlm9283dbe2004-08-18 04:59:12 +00001553 fprintf(stderr,
1554 "WARNING: ENCODING-CONTROL %s "
1555 "specification at line %d ignored\n",
1556 yyvsp[-1].tv_str, yylineno);
1557 free(yyvsp[-1].tv_str);
1558 yyval.a_module = 0;
vlm6a02a8a2004-09-08 00:28:11 +00001559 ;
1560 break;}
1561case 34:
vlm0aa86902004-10-12 23:26:53 +00001562#line 557 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001563{
vlmfa67ddc2004-06-03 03:38:44 +00001564 return yyerror(
1565 "Attempt to redefine a standard basic type, "
1566 "use -ftypesXY to switch back "
1567 "to older version of ASN.1 standard");
vlm6a02a8a2004-09-08 00:28:11 +00001568 ;
1569 break;}
1570case 35:
vlm0aa86902004-10-12 23:26:53 +00001571#line 571 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001572{
vlmfa67ddc2004-06-03 03:38:44 +00001573 yyval.a_module = yyvsp[-1].a_module;
vlm6a02a8a2004-09-08 00:28:11 +00001574 ;
1575 break;}
1576case 36:
vlm0aa86902004-10-12 23:26:53 +00001577#line 577 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001578{
vlmfa67ddc2004-06-03 03:38:44 +00001579 return yyerror("Empty IMPORTS list");
vlm6a02a8a2004-09-08 00:28:11 +00001580 ;
1581 break;}
1582case 37:
vlm0aa86902004-10-12 23:26:53 +00001583#line 583 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001584{
vlmfa67ddc2004-06-03 03:38:44 +00001585 yyval.a_module = asn1p_module_new();
1586 checkmem(yyval.a_module);
1587 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
vlm6a02a8a2004-09-08 00:28:11 +00001588 ;
1589 break;}
1590case 38:
vlm0aa86902004-10-12 23:26:53 +00001591#line 588 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001592{
vlmfa67ddc2004-06-03 03:38:44 +00001593 yyval.a_module = yyvsp[-1].a_module;
1594 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
vlm6a02a8a2004-09-08 00:28:11 +00001595 ;
1596 break;}
1597case 39:
vlm0aa86902004-10-12 23:26:53 +00001598#line 595 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001599{
vlmfa67ddc2004-06-03 03:38:44 +00001600 yyval.a_xports = yyvsp[-3].a_xports;
1601 yyval.a_xports->from = yyvsp[-1].tv_str;
1602 yyval.a_xports->from_oid = yyvsp[0].a_oid;
1603 checkmem(yyval.a_xports);
vlm6a02a8a2004-09-08 00:28:11 +00001604 ;
1605 break;}
1606case 40:
vlm0aa86902004-10-12 23:26:53 +00001607#line 604 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001608{
vlmfa67ddc2004-06-03 03:38:44 +00001609 yyval.a_xports = asn1p_xports_new();
1610 checkmem(yyval.a_xports);
1611 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001612 ;
1613 break;}
1614case 41:
vlm0aa86902004-10-12 23:26:53 +00001615#line 609 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001616{
vlmfa67ddc2004-06-03 03:38:44 +00001617 yyval.a_xports = yyvsp[-2].a_xports;
1618 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001619 ;
1620 break;}
1621case 42:
vlm0aa86902004-10-12 23:26:53 +00001622#line 616 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001623{
vlmfa67ddc2004-06-03 03:38:44 +00001624 yyval.a_expr = asn1p_expr_new(yylineno);
1625 checkmem(yyval.a_expr);
1626 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1627 yyval.a_expr->expr_type = A1TC_REFERENCE;
vlm6a02a8a2004-09-08 00:28:11 +00001628 ;
1629 break;}
1630case 43:
vlm0aa86902004-10-12 23:26:53 +00001631#line 622 "asn1p_y.y"
1632{ /* Completely equivalent to above */
1633 yyval.a_expr = asn1p_expr_new(yylineno);
1634 checkmem(yyval.a_expr);
1635 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1636 yyval.a_expr->expr_type = A1TC_REFERENCE;
1637 ;
1638 break;}
1639case 44:
1640#line 628 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001641{
vlmfa67ddc2004-06-03 03:38:44 +00001642 yyval.a_expr = asn1p_expr_new(yylineno);
1643 checkmem(yyval.a_expr);
1644 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1645 yyval.a_expr->expr_type = A1TC_REFERENCE;
vlm6a02a8a2004-09-08 00:28:11 +00001646 ;
1647 break;}
vlm0aa86902004-10-12 23:26:53 +00001648case 45:
1649#line 637 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001650{
vlmfa67ddc2004-06-03 03:38:44 +00001651 yyval.a_xports = yyvsp[-1].a_xports;
vlm6a02a8a2004-09-08 00:28:11 +00001652 ;
1653 break;}
vlm0aa86902004-10-12 23:26:53 +00001654case 46:
1655#line 640 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001656{
vlmfa67ddc2004-06-03 03:38:44 +00001657 yyval.a_xports = 0;
vlm6a02a8a2004-09-08 00:28:11 +00001658 ;
1659 break;}
vlm0aa86902004-10-12 23:26:53 +00001660case 47:
1661#line 643 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001662{
vlmfa67ddc2004-06-03 03:38:44 +00001663 /* Empty EXPORTS clause effectively prohibits export. */
1664 yyval.a_xports = asn1p_xports_new();
1665 checkmem(yyval.a_xports);
vlm6a02a8a2004-09-08 00:28:11 +00001666 ;
1667 break;}
vlm0aa86902004-10-12 23:26:53 +00001668case 48:
1669#line 651 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001670{
vlmfa67ddc2004-06-03 03:38:44 +00001671 yyval.a_xports = asn1p_xports_new();
1672 assert(yyval.a_xports);
1673 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001674 ;
1675 break;}
vlm0aa86902004-10-12 23:26:53 +00001676case 49:
1677#line 656 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001678{
vlmfa67ddc2004-06-03 03:38:44 +00001679 yyval.a_xports = yyvsp[-2].a_xports;
1680 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
vlm6a02a8a2004-09-08 00:28:11 +00001681 ;
1682 break;}
vlm6a02a8a2004-09-08 00:28:11 +00001683case 50:
vlm0aa86902004-10-12 23:26:53 +00001684#line 663 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001685{
vlmfa67ddc2004-06-03 03:38:44 +00001686 yyval.a_expr = asn1p_expr_new(yylineno);
1687 checkmem(yyval.a_expr);
1688 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1689 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
vlm6a02a8a2004-09-08 00:28:11 +00001690 ;
1691 break;}
1692case 51:
vlm0aa86902004-10-12 23:26:53 +00001693#line 669 "asn1p_y.y"
1694{
1695 yyval.a_expr = asn1p_expr_new(yylineno);
1696 checkmem(yyval.a_expr);
1697 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1698 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
1699 ;
1700 break;}
1701case 52:
1702#line 675 "asn1p_y.y"
1703{
1704 yyval.a_expr = asn1p_expr_new(yylineno);
1705 checkmem(yyval.a_expr);
1706 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1707 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
1708 ;
1709 break;}
1710case 53:
1711#line 685 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001712{
vlmfa67ddc2004-06-03 03:38:44 +00001713 yyval.a_expr = yyvsp[-4].a_expr;
1714 assert(yyval.a_expr->Identifier == 0);
1715 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1716 yyval.a_expr->meta_type = AMT_VALUESET;
1717 // take care of optValueSetBody
vlm6a02a8a2004-09-08 00:28:11 +00001718 ;
1719 break;}
vlm0aa86902004-10-12 23:26:53 +00001720case 54:
1721#line 695 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001722{
vlmfa67ddc2004-06-03 03:38:44 +00001723 yyval.a_expr = asn1p_expr_new(yylineno);
1724 checkmem(yyval.a_expr);
1725 yyval.a_expr->reference = yyvsp[0].a_ref;
1726 yyval.a_expr->expr_type = A1TC_REFERENCE;
1727 yyval.a_expr->meta_type = AMT_TYPEREF;
vlm6a02a8a2004-09-08 00:28:11 +00001728 ;
1729 break;}
vlm0aa86902004-10-12 23:26:53 +00001730case 55:
1731#line 702 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001732{
vlmfa67ddc2004-06-03 03:38:44 +00001733 yyval.a_expr = asn1p_expr_new(yylineno);
1734 checkmem(yyval.a_expr);
1735 yyval.a_expr->expr_type = yyvsp[0].a_type;
1736 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00001737 ;
1738 break;}
vlm6a02a8a2004-09-08 00:28:11 +00001739case 56:
vlm0aa86902004-10-12 23:26:53 +00001740#line 711 "asn1p_y.y"
1741{ ;
vlm6a02a8a2004-09-08 00:28:11 +00001742 break;}
1743case 57:
vlm151c0b22004-09-22 16:03:36 +00001744#line 712 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001745{
1746 ;
1747 break;}
1748case 58:
vlm0aa86902004-10-12 23:26:53 +00001749#line 723 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001750{
1751 ;
1752 break;}
1753case 59:
vlm0aa86902004-10-12 23:26:53 +00001754#line 725 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001755{
1756 ;
1757 break;}
1758case 60:
vlm0aa86902004-10-12 23:26:53 +00001759#line 730 "asn1p_y.y"
1760{
1761 ;
1762 break;}
1763case 61:
1764#line 732 "asn1p_y.y"
1765{
1766 ;
1767 break;}
1768case 62:
1769#line 748 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001770{
vlmfa67ddc2004-06-03 03:38:44 +00001771 yyval.a_expr = asn1p_expr_new(yylineno);
1772 checkmem(yyval.a_expr);
1773 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
1774 yyval.a_expr->tag = yyvsp[-1].a_tag;
1775 yyval.a_expr->expr_type = A1TC_TYPEID;
1776 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00001777 ;
1778 break;}
vlm0aa86902004-10-12 23:26:53 +00001779case 63:
1780#line 756 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001781{
vlmfa67ddc2004-06-03 03:38:44 +00001782 yyval.a_expr = yyvsp[0].a_expr;
vlmfce48a42004-09-14 02:36:39 +00001783 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
vlmfa67ddc2004-06-03 03:38:44 +00001784 assert(yyval.a_expr->expr_type);
1785 assert(yyval.a_expr->meta_type);
vlm6a02a8a2004-09-08 00:28:11 +00001786 ;
1787 break;}
vlm0aa86902004-10-12 23:26:53 +00001788case 64:
1789#line 762 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001790{
vlmfa67ddc2004-06-03 03:38:44 +00001791 yyval.a_expr = yyvsp[0].a_expr;
1792 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1793 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1794 assert(yyval.a_expr->meta_type == AMT_OBJECT);
vlm6a02a8a2004-09-08 00:28:11 +00001795 ;
1796 break;}
vlm0aa86902004-10-12 23:26:53 +00001797case 65:
1798#line 778 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001799{
vlmfa67ddc2004-06-03 03:38:44 +00001800 yyval.a_expr = yyvsp[0].a_expr;
1801 assert(yyval.a_expr->Identifier == 0);
1802 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1803 yyval.a_expr->params = yyvsp[-3].a_plist;
1804 yyval.a_expr->meta_type = AMT_PARAMTYPE;
vlm6a02a8a2004-09-08 00:28:11 +00001805 ;
1806 break;}
vlm0aa86902004-10-12 23:26:53 +00001807case 66:
1808#line 788 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001809{
vlmfa67ddc2004-06-03 03:38:44 +00001810 int ret;
1811 yyval.a_plist = asn1p_paramlist_new(yylineno);
1812 checkmem(yyval.a_plist);
1813 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1814 checkmem(ret == 0);
1815 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1816 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
vlm6a02a8a2004-09-08 00:28:11 +00001817 ;
1818 break;}
vlm0aa86902004-10-12 23:26:53 +00001819case 67:
1820#line 797 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001821{
vlmfa67ddc2004-06-03 03:38:44 +00001822 int ret;
1823 yyval.a_plist = yyvsp[-2].a_plist;
1824 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1825 checkmem(ret == 0);
1826 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1827 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
vlm6a02a8a2004-09-08 00:28:11 +00001828 ;
1829 break;}
vlm0aa86902004-10-12 23:26:53 +00001830case 68:
1831#line 808 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001832{
vlmfa67ddc2004-06-03 03:38:44 +00001833 yyval.a_parg.governor = NULL;
1834 yyval.a_parg.argument = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00001835 ;
1836 break;}
vlm0aa86902004-10-12 23:26:53 +00001837case 69:
1838#line 812 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001839{
vlmfa67ddc2004-06-03 03:38:44 +00001840 int ret;
1841 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1842 ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
1843 checkmem(ret == 0);
1844 yyval.a_parg.argument = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00001845 ;
1846 break;}
vlm0aa86902004-10-12 23:26:53 +00001847case 70:
1848#line 819 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001849{
vlmfa67ddc2004-06-03 03:38:44 +00001850 int ret;
1851 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1852 ret = asn1p_ref_add_component(yyval.a_parg.governor,
1853 ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
1854 checkmem(ret == 0);
1855 yyval.a_parg.argument = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00001856 ;
1857 break;}
vlm0aa86902004-10-12 23:26:53 +00001858case 71:
1859#line 830 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001860{
vlmfa67ddc2004-06-03 03:38:44 +00001861 yyval.a_expr = asn1p_expr_new(yylineno);
1862 checkmem(yyval.a_expr);
vlm6a02a8a2004-09-08 00:28:11 +00001863 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1864 ;
1865 break;}
vlm0aa86902004-10-12 23:26:53 +00001866case 72:
1867#line 835 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001868{
vlmfa67ddc2004-06-03 03:38:44 +00001869 yyval.a_expr = yyvsp[-2].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001870 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1871 ;
1872 break;}
vlm0aa86902004-10-12 23:26:53 +00001873case 73:
1874#line 842 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001875{
vlmfa67ddc2004-06-03 03:38:44 +00001876 yyval.a_expr = yyvsp[0].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001877 ;
1878 break;}
vlm0aa86902004-10-12 23:26:53 +00001879case 74:
1880#line 845 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001881{
vlmfa67ddc2004-06-03 03:38:44 +00001882 yyval.a_expr = asn1p_expr_new(yylineno);
1883 checkmem(yyval.a_expr);
1884 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1885 yyval.a_expr->expr_type = A1TC_REFERENCE;
1886 yyval.a_expr->meta_type = AMT_VALUE;
vlm6a02a8a2004-09-08 00:28:11 +00001887 ;
1888 break;}
vlm0aa86902004-10-12 23:26:53 +00001889case 75:
1890#line 858 "asn1p_y.y"
1891{ yyval.a_expr = asn1p_expr_new(yylineno); ;
1892 break;}
1893case 76:
1894#line 859 "asn1p_y.y"
1895{ yyval.a_expr = yyvsp[0].a_expr; ;
1896 break;}
1897case 77:
1898#line 862 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001899{
vlmfa67ddc2004-06-03 03:38:44 +00001900 yyval.a_expr = asn1p_expr_new(yylineno);
1901 checkmem(yyval.a_expr);
vlm6a02a8a2004-09-08 00:28:11 +00001902 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1903 ;
1904 break;}
vlm0aa86902004-10-12 23:26:53 +00001905case 78:
1906#line 867 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001907{
vlmfa67ddc2004-06-03 03:38:44 +00001908 yyval.a_expr = yyvsp[-2].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001909 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1910 ;
1911 break;}
vlm0aa86902004-10-12 23:26:53 +00001912case 79:
1913#line 874 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001914{
vlmec8f6812004-08-22 03:19:54 +00001915 yyval.a_expr = yyvsp[-1].a_expr;
1916 assert(yyval.a_expr->Identifier == 0);
vlmfce48a42004-09-14 02:36:39 +00001917 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
vlmec8f6812004-08-22 03:19:54 +00001918 yyval.a_expr->marker = yyvsp[0].a_marker;
vlm6a02a8a2004-09-08 00:28:11 +00001919 ;
1920 break;}
vlm0aa86902004-10-12 23:26:53 +00001921case 80:
1922#line 880 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001923{
vlmec8f6812004-08-22 03:19:54 +00001924 yyval.a_expr = asn1p_expr_new(yylineno);
1925 checkmem(yyval.a_expr);
1926 yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type;
1927 yyval.a_expr->expr_type = A1TC_COMPONENTS_OF;
vlm6a02a8a2004-09-08 00:28:11 +00001928 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1929 ;
1930 break;}
vlm0aa86902004-10-12 23:26:53 +00001931case 81:
1932#line 887 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001933{
vlmec8f6812004-08-22 03:19:54 +00001934 yyval.a_expr = yyvsp[0].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001935 ;
1936 break;}
vlm0aa86902004-10-12 23:26:53 +00001937case 82:
1938#line 893 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001939{
vlmec8f6812004-08-22 03:19:54 +00001940 yyval.a_expr = asn1p_expr_new(yylineno);
1941 checkmem(yyval.a_expr);
vlm6a02a8a2004-09-08 00:28:11 +00001942 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1943 ;
1944 break;}
vlm0aa86902004-10-12 23:26:53 +00001945case 83:
1946#line 898 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001947{
vlmec8f6812004-08-22 03:19:54 +00001948 yyval.a_expr = yyvsp[-2].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001949 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1950 ;
1951 break;}
vlm0aa86902004-10-12 23:26:53 +00001952case 84:
1953#line 905 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001954{
vlmec8f6812004-08-22 03:19:54 +00001955 yyval.a_expr = yyvsp[0].a_expr;
1956 assert(yyval.a_expr->Identifier == 0);
vlmfce48a42004-09-14 02:36:39 +00001957 yyval.a_expr->Identifier = yyvsp[-1].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00001958 ;
1959 break;}
vlm0aa86902004-10-12 23:26:53 +00001960case 85:
1961#line 910 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001962{
vlmec8f6812004-08-22 03:19:54 +00001963 yyval.a_expr = yyvsp[0].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001964 ;
1965 break;}
vlm0aa86902004-10-12 23:26:53 +00001966case 86:
1967#line 916 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001968{
vlmfa67ddc2004-06-03 03:38:44 +00001969 yyval.a_expr = yyvsp[-2].a_expr;
1970 checkmem(yyval.a_expr);
1971 yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
1972 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1973 assert(yyval.a_expr->meta_type == AMT_OBJECT);
vlm6a02a8a2004-09-08 00:28:11 +00001974 ;
1975 break;}
vlm0aa86902004-10-12 23:26:53 +00001976case 87:
1977#line 926 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001978{ yyval.a_int = 0; ;
1979 break;}
vlm0aa86902004-10-12 23:26:53 +00001980case 88:
1981#line 927 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001982{ yyval.a_int = 1; ;
1983 break;}
vlm0aa86902004-10-12 23:26:53 +00001984case 89:
1985#line 931 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001986{
vlmfa67ddc2004-06-03 03:38:44 +00001987 yyval.a_expr = asn1p_expr_new(yylineno);
1988 checkmem(yyval.a_expr);
1989 yyval.a_expr->expr_type = A1TC_CLASSDEF;
1990 yyval.a_expr->meta_type = AMT_OBJECT;
vlm6a02a8a2004-09-08 00:28:11 +00001991 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1992 ;
1993 break;}
vlm0aa86902004-10-12 23:26:53 +00001994case 90:
1995#line 938 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00001996{
vlmfa67ddc2004-06-03 03:38:44 +00001997 yyval.a_expr = yyvsp[-2].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00001998 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
1999 ;
2000 break;}
vlm0aa86902004-10-12 23:26:53 +00002001case 91:
2002#line 945 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002003{
vlmfa67ddc2004-06-03 03:38:44 +00002004 yyval.a_expr = asn1p_expr_new(yylineno);
2005 checkmem(yyval.a_expr);
2006 yyval.a_expr->Identifier = yyvsp[-1].a_refcomp.name;
2007 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
2008 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
2009 yyval.a_expr->marker = yyvsp[0].a_marker;
vlm6a02a8a2004-09-08 00:28:11 +00002010 ;
2011 break;}
vlm0aa86902004-10-12 23:26:53 +00002012case 92:
2013#line 953 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002014{
vlmec8f6812004-08-22 03:19:54 +00002015 yyval.a_expr = yyvsp[-2].a_expr;
2016 yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
vlmbde35d42004-11-24 17:43:29 +00002017 yyval.a_expr->marker = yyvsp[0].a_marker;
2018 yyval.a_expr->unique = yyvsp[-1].a_int;
vlm6a02a8a2004-09-08 00:28:11 +00002019 ;
2020 break;}
vlm0aa86902004-10-12 23:26:53 +00002021case 93:
2022#line 959 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002023{
vlmfa67ddc2004-06-03 03:38:44 +00002024 int ret;
2025 yyval.a_expr = asn1p_expr_new(yylineno);
2026 checkmem(yyval.a_expr);
2027 yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
2028 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2029 checkmem(yyval.a_expr->reference);
2030 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2031 yyvsp[-2].a_refcomp.name, yyvsp[-2].a_refcomp.lex_type);
2032 checkmem(ret == 0);
2033 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
2034 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
vlmbde35d42004-11-24 17:43:29 +00002035 yyval.a_expr->marker = yyvsp[0].a_marker;
2036 yyval.a_expr->unique = yyvsp[-1].a_int;
vlm6a02a8a2004-09-08 00:28:11 +00002037 ;
2038 break;}
vlm0aa86902004-10-12 23:26:53 +00002039case 94:
2040#line 977 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002041{ yyval.a_wsynt = 0; ;
2042 break;}
vlm0aa86902004-10-12 23:26:53 +00002043case 95:
2044#line 978 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002045{
vlmfa67ddc2004-06-03 03:38:44 +00002046 yyval.a_wsynt = yyvsp[0].a_wsynt;
vlm6a02a8a2004-09-08 00:28:11 +00002047 ;
2048 break;}
vlm0aa86902004-10-12 23:26:53 +00002049case 96:
2050#line 985 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002051{ asn1p_lexer_hack_enable_with_syntax(); ;
2052 break;}
vlm0aa86902004-10-12 23:26:53 +00002053case 97:
2054#line 987 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002055{
vlmfa67ddc2004-06-03 03:38:44 +00002056 yyval.a_wsynt = yyvsp[-1].a_wsynt;
vlm6a02a8a2004-09-08 00:28:11 +00002057 ;
2058 break;}
vlm0aa86902004-10-12 23:26:53 +00002059case 98:
2060#line 993 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002061{
vlmfa67ddc2004-06-03 03:38:44 +00002062 yyval.a_wsynt = asn1p_wsyntx_new();
2063 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
vlm6a02a8a2004-09-08 00:28:11 +00002064 ;
2065 break;}
vlm0aa86902004-10-12 23:26:53 +00002066case 99:
2067#line 997 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002068{
vlmfa67ddc2004-06-03 03:38:44 +00002069 yyval.a_wsynt = yyvsp[-1].a_wsynt;
2070 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
vlm6a02a8a2004-09-08 00:28:11 +00002071 ;
2072 break;}
vlm0aa86902004-10-12 23:26:53 +00002073case 100:
2074#line 1004 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002075{
vlmfa67ddc2004-06-03 03:38:44 +00002076 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
vlm6a02a8a2004-09-08 00:28:11 +00002077 ;
2078 break;}
vlm0aa86902004-10-12 23:26:53 +00002079case 101:
2080#line 1007 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002081{
vlmfa67ddc2004-06-03 03:38:44 +00002082 asn1p_ref_t *ref;
2083 int ret;
2084 ref = asn1p_ref_new(yylineno);
2085 checkmem(ref);
2086 ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2087 checkmem(ret == 0);
2088 yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0);
vlm6a02a8a2004-09-08 00:28:11 +00002089 ;
2090 break;}
vlm0aa86902004-10-12 23:26:53 +00002091case 102:
vlm151c0b22004-09-22 16:03:36 +00002092#line 1019 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002093{
vlm39e5ed72004-09-05 10:40:41 +00002094 yyval.a_expr = asn1p_expr_new(yylineno);
vlm5f0128b2004-08-20 13:25:29 +00002095 checkmem(yyval.a_expr);
2096 yyval.a_expr->Identifier = strdup("...");
vlm0aa86902004-10-12 23:26:53 +00002097 checkmem(yyval.a_expr->Identifier);
2098 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2099 yyval.a_expr->meta_type = AMT_TYPE;
2100 ;
2101 break;}
2102case 103:
2103#line 1027 "asn1p_y.y"
2104{
2105 yyval.a_expr = asn1p_expr_new(yylineno);
2106 checkmem(yyval.a_expr);
2107 yyval.a_expr->Identifier = strdup("...");
2108 checkmem(yyval.a_expr->Identifier);
2109 yyval.a_expr->value = yyvsp[0].a_value;
2110 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2111 yyval.a_expr->meta_type = AMT_TYPE;
2112 ;
2113 break;}
2114case 104:
2115#line 1036 "asn1p_y.y"
2116{
2117 yyval.a_expr = asn1p_expr_new(yylineno);
2118 checkmem(yyval.a_expr);
2119 yyval.a_expr->Identifier = strdup("...");
vlm5f0128b2004-08-20 13:25:29 +00002120 yyval.a_expr->value = yyvsp[0].a_value;
2121 checkmem(yyval.a_expr->Identifier);
2122 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2123 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002124 ;
2125 break;}
vlm0aa86902004-10-12 23:26:53 +00002126case 105:
2127#line 1048 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002128{
vlmec8f6812004-08-22 03:19:54 +00002129 yyval.a_expr = yyvsp[-1].a_expr;
vlmfce48a42004-09-14 02:36:39 +00002130 yyval.a_expr->tag = yyvsp[-2].a_tag;
vlmec8f6812004-08-22 03:19:54 +00002131 /*
2132 * Outer constraint for SEQUENCE OF and SET OF applies
2133 * to the inner type.
2134 */
2135 if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF
2136 || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) {
2137 assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints);
2138 TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr;
2139 } else {
2140 if(yyval.a_expr->constraints) {
vlmfce48a42004-09-14 02:36:39 +00002141 assert(!yyvsp[-1].a_expr);
vlmec8f6812004-08-22 03:19:54 +00002142 } else {
2143 yyval.a_expr->constraints = yyvsp[0].a_constr;
2144 }
2145 }
vlm6a02a8a2004-09-08 00:28:11 +00002146 ;
2147 break;}
vlm0aa86902004-10-12 23:26:53 +00002148case 106:
2149#line 1070 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002150{
vlm5f0128b2004-08-20 13:25:29 +00002151 yyval.a_expr = yyvsp[0].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00002152 ;
2153 break;}
vlm0aa86902004-10-12 23:26:53 +00002154case 107:
2155#line 1073 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002156{
vlmfa67ddc2004-06-03 03:38:44 +00002157 yyval.a_expr = asn1p_expr_new(yylineno);
2158 checkmem(yyval.a_expr);
2159 yyval.a_expr->expr_type = yyvsp[0].a_type;
2160 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002161 ;
2162 break;}
vlm0aa86902004-10-12 23:26:53 +00002163case 108:
2164#line 1079 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002165{
vlmec8f6812004-08-22 03:19:54 +00002166 yyval.a_expr = yyvsp[-1].a_expr;
2167 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2168 yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
2169 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002170 ;
2171 break;}
vlm0aa86902004-10-12 23:26:53 +00002172case 109:
2173#line 1085 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002174{
vlmec8f6812004-08-22 03:19:54 +00002175 yyval.a_expr = yyvsp[-1].a_expr;
2176 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2177 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
2178 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002179 ;
2180 break;}
vlm0aa86902004-10-12 23:26:53 +00002181case 110:
2182#line 1091 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002183{
vlmec8f6812004-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_SET;
2187 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002188 ;
2189 break;}
vlm0aa86902004-10-12 23:26:53 +00002190case 111:
2191#line 1097 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002192{
vlm39e5ed72004-09-05 10:40:41 +00002193 yyval.a_expr = asn1p_expr_new(yylineno);
vlmec8f6812004-08-22 03:19:54 +00002194 checkmem(yyval.a_expr);
vlm151c0b22004-09-22 16:03:36 +00002195 yyval.a_expr->constraints = yyvsp[-4].a_constr;
vlmec8f6812004-08-22 03:19:54 +00002196 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
2197 yyval.a_expr->meta_type = AMT_TYPE;
vlm151c0b22004-09-22 16:03:36 +00002198 yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
vlma2374a02004-09-14 02:44:07 +00002199 yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
vlm6a02a8a2004-09-08 00:28:11 +00002200 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2201 ;
2202 break;}
vlm0aa86902004-10-12 23:26:53 +00002203case 112:
2204#line 1107 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002205{
vlm39e5ed72004-09-05 10:40:41 +00002206 yyval.a_expr = asn1p_expr_new(yylineno);
vlmec8f6812004-08-22 03:19:54 +00002207 checkmem(yyval.a_expr);
vlm151c0b22004-09-22 16:03:36 +00002208 yyval.a_expr->constraints = yyvsp[-4].a_constr;
vlmec8f6812004-08-22 03:19:54 +00002209 yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
2210 yyval.a_expr->meta_type = AMT_TYPE;
vlm151c0b22004-09-22 16:03:36 +00002211 yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
vlma2374a02004-09-14 02:44:07 +00002212 yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
vlm6a02a8a2004-09-08 00:28:11 +00002213 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
2214 ;
2215 break;}
vlm0aa86902004-10-12 23:26:53 +00002216case 113:
2217#line 1117 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002218{
vlm39e5ed72004-09-05 10:40:41 +00002219 yyval.a_expr = asn1p_expr_new(yylineno);
vlmec8f6812004-08-22 03:19:54 +00002220 checkmem(yyval.a_expr);
vlm044f7442004-09-04 04:49:21 +00002221 yyval.a_expr->expr_type = ASN_TYPE_ANY;
vlmec8f6812004-08-22 03:19:54 +00002222 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002223 ;
2224 break;}
vlm0aa86902004-10-12 23:26:53 +00002225case 114:
2226#line 1123 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002227{
vlmec8f6812004-08-22 03:19:54 +00002228 int ret;
vlm39e5ed72004-09-05 10:40:41 +00002229 yyval.a_expr = asn1p_expr_new(yylineno);
vlmec8f6812004-08-22 03:19:54 +00002230 checkmem(yyval.a_expr);
2231 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2232 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2233 yyvsp[0].tv_str, RLT_lowercase);
2234 checkmem(ret == 0);
vlm044f7442004-09-04 04:49:21 +00002235 yyval.a_expr->expr_type = ASN_TYPE_ANY;
vlmec8f6812004-08-22 03:19:54 +00002236 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002237 ;
2238 break;}
vlm0aa86902004-10-12 23:26:53 +00002239case 115:
2240#line 1137 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002241{
vlmfa67ddc2004-06-03 03:38:44 +00002242 int ret;
2243 yyval.a_expr = yyvsp[-1].a_expr;
2244 assert(yyval.a_expr->expr_type == 0);
2245 assert(yyval.a_expr->meta_type == 0);
2246 assert(yyval.a_expr->reference == 0);
2247 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2248 checkmem(yyval.a_expr->reference);
2249 ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN);
2250 checkmem(ret == 0);
2251 free(yyvsp[-3].tv_str);
2252 yyval.a_expr->expr_type = A1TC_PARAMETRIZED;
2253 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002254 ;
2255 break;}
vlm0aa86902004-10-12 23:26:53 +00002256case 116:
2257#line 1161 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002258{
vlmfa67ddc2004-06-03 03:38:44 +00002259 yyval.a_expr = asn1p_expr_new(yylineno);
2260 checkmem(yyval.a_expr);
2261 yyval.a_expr->reference = yyvsp[0].a_ref;
2262 yyval.a_expr->expr_type = A1TC_REFERENCE;
2263 yyval.a_expr->meta_type = AMT_TYPEREF;
vlm6a02a8a2004-09-08 00:28:11 +00002264 ;
2265 break;}
vlm0aa86902004-10-12 23:26:53 +00002266case 117:
2267#line 1168 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002268{
vlmfa67ddc2004-06-03 03:38:44 +00002269 yyval.a_expr = asn1p_expr_new(yylineno);
2270 checkmem(yyval.a_expr);
2271 yyval.a_expr->reference = yyvsp[0].a_ref;
2272 yyval.a_expr->expr_type = A1TC_INSTANCE;
2273 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002274 ;
2275 break;}
vlm0aa86902004-10-12 23:26:53 +00002276case 118:
2277#line 1183 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002278{
vlmfa67ddc2004-06-03 03:38:44 +00002279 int ret;
2280 yyval.a_ref = asn1p_ref_new(yylineno);
2281 checkmem(yyval.a_ref);
2282 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2283 checkmem(ret == 0);
2284 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002285 ;
2286 break;}
vlm0aa86902004-10-12 23:26:53 +00002287case 119:
2288#line 1191 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002289{
vlmfa67ddc2004-06-03 03:38:44 +00002290 int ret;
2291 yyval.a_ref = asn1p_ref_new(yylineno);
2292 checkmem(yyval.a_ref);
2293 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2294 checkmem(ret == 0);
2295 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2296 checkmem(ret == 0);
2297 free(yyvsp[-2].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002298 ;
2299 break;}
vlm0aa86902004-10-12 23:26:53 +00002300case 120:
2301#line 1201 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002302{
vlmfa67ddc2004-06-03 03:38:44 +00002303 int ret;
2304 yyval.a_ref = asn1p_ref_new(yylineno);
2305 checkmem(yyval.a_ref);
2306 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2307 checkmem(ret == 0);
vlmc94e28f2004-09-15 11:59:51 +00002308 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
vlmfa67ddc2004-06-03 03:38:44 +00002309 checkmem(ret == 0);
2310 free(yyvsp[-2].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002311 ;
2312 break;}
vlm0aa86902004-10-12 23:26:53 +00002313case 121:
2314#line 1211 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002315{
vlmfa67ddc2004-06-03 03:38:44 +00002316 int ret;
2317 yyval.a_ref = asn1p_ref_new(yylineno);
2318 checkmem(yyval.a_ref);
vlmc94e28f2004-09-15 11:59:51 +00002319 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2320 checkmem(ret == 0);
2321 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
2322 checkmem(ret == 0);
2323 free(yyvsp[-2].tv_str);
2324 ;
2325 break;}
vlm0aa86902004-10-12 23:26:53 +00002326case 122:
2327#line 1221 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002328{
2329 int ret;
2330 yyval.a_ref = asn1p_ref_new(yylineno);
2331 checkmem(yyval.a_ref);
vlmfa67ddc2004-06-03 03:38:44 +00002332 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
2333 free(yyvsp[0].tv_str);
2334 checkmem(ret == 0);
vlm6a02a8a2004-09-08 00:28:11 +00002335 ;
2336 break;}
vlm0aa86902004-10-12 23:26:53 +00002337case 123:
2338#line 1229 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002339{
vlmfa67ddc2004-06-03 03:38:44 +00002340 int ret;
2341 yyval.a_ref = yyvsp[0].a_ref;
2342 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
2343 free(yyvsp[-2].tv_str);
2344 checkmem(ret == 0);
2345 /*
2346 * Move the last element infront.
2347 */
2348 {
2349 struct asn1p_ref_component_s tmp_comp;
2350 tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
2351 memmove(&yyval.a_ref->components[1],
2352 &yyval.a_ref->components[0],
2353 sizeof(yyval.a_ref->components[0])
2354 * (yyval.a_ref->comp_count - 1));
2355 yyval.a_ref->components[0] = tmp_comp;
2356 }
vlm6a02a8a2004-09-08 00:28:11 +00002357 ;
2358 break;}
vlm0aa86902004-10-12 23:26:53 +00002359case 124:
2360#line 1251 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002361{
vlmfa67ddc2004-06-03 03:38:44 +00002362 int ret;
2363 yyval.a_ref = asn1p_ref_new(yylineno);
2364 checkmem(yyval.a_ref);
2365 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2366 free(yyvsp[0].a_refcomp.name);
2367 checkmem(ret == 0);
vlm6a02a8a2004-09-08 00:28:11 +00002368 ;
2369 break;}
vlm0aa86902004-10-12 23:26:53 +00002370case 125:
2371#line 1259 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002372{
vlmfa67ddc2004-06-03 03:38:44 +00002373 int ret;
2374 yyval.a_ref = yyvsp[-2].a_ref;
2375 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2376 free(yyvsp[0].a_refcomp.name);
2377 checkmem(ret == 0);
vlm6a02a8a2004-09-08 00:28:11 +00002378 ;
2379 break;}
vlm0aa86902004-10-12 23:26:53 +00002380case 128:
2381#line 1273 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002382{
vlmfa67ddc2004-06-03 03:38:44 +00002383 yyval.a_refcomp.lex_type = RLT_AmpUppercase;
2384 yyval.a_refcomp.name = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00002385 ;
2386 break;}
vlm0aa86902004-10-12 23:26:53 +00002387case 129:
2388#line 1278 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002389{
vlmfa67ddc2004-06-03 03:38:44 +00002390 yyval.a_refcomp.lex_type = RLT_Amplowercase;
2391 yyval.a_refcomp.name = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00002392 ;
2393 break;}
vlm0aa86902004-10-12 23:26:53 +00002394case 130:
2395#line 1291 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002396{
vlmfa67ddc2004-06-03 03:38:44 +00002397 yyval.a_expr = yyvsp[-2].a_expr;
2398 assert(yyval.a_expr->Identifier == NULL);
2399 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
2400 yyval.a_expr->meta_type = AMT_VALUE;
2401 yyval.a_expr->value = yyvsp[0].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00002402 ;
2403 break;}
vlm0aa86902004-10-12 23:26:53 +00002404case 131:
2405#line 1301 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002406{
2407 yyval.a_value = asn1p_value_fromint(0);
2408 checkmem(yyval.a_value);
2409 yyval.a_value->type = ATV_CHOICE_IDENTIFIER;
2410 yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str;
2411 yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value;
2412 ;
2413 break;}
vlm0aa86902004-10-12 23:26:53 +00002414case 132:
2415#line 1308 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002416{ asn1p_lexer_hack_push_opaque_state(); ;
2417 break;}
vlm0aa86902004-10-12 23:26:53 +00002418case 133:
2419#line 1308 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002420{
vlmfa67ddc2004-06-03 03:38:44 +00002421 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2422 checkmem(yyval.a_value);
2423 yyval.a_value->type = ATV_UNPARSED;
vlm6a02a8a2004-09-08 00:28:11 +00002424 ;
2425 break;}
vlm0aa86902004-10-12 23:26:53 +00002426case 134:
2427#line 1313 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002428{
2429 yyval.a_value = asn1p_value_fromint(0);
2430 checkmem(yyval.a_value);
2431 yyval.a_value->type = ATV_NULL;
2432 ;
2433 break;}
vlm0aa86902004-10-12 23:26:53 +00002434case 135:
2435#line 1318 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002436{
2437 yyval.a_value = asn1p_value_fromint(0);
2438 checkmem(yyval.a_value);
2439 yyval.a_value->type = ATV_FALSE;
2440 ;
2441 break;}
vlm0aa86902004-10-12 23:26:53 +00002442case 136:
2443#line 1323 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002444{
2445 yyval.a_value = asn1p_value_fromint(0);
2446 checkmem(yyval.a_value);
2447 yyval.a_value->type = ATV_TRUE;
2448 ;
2449 break;}
vlm0aa86902004-10-12 23:26:53 +00002450case 137:
2451#line 1328 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002452{
vlmfa67ddc2004-06-03 03:38:44 +00002453 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
2454 checkmem(yyval.a_value);
vlm6a02a8a2004-09-08 00:28:11 +00002455 ;
2456 break;}
vlm0aa86902004-10-12 23:26:53 +00002457case 138:
2458#line 1332 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002459{
vlmfa67ddc2004-06-03 03:38:44 +00002460 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
2461 checkmem(yyval.a_value);
vlm6a02a8a2004-09-08 00:28:11 +00002462 ;
2463 break;}
vlm0aa86902004-10-12 23:26:53 +00002464case 139:
2465#line 1336 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002466{
vlmfa67ddc2004-06-03 03:38:44 +00002467 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2468 checkmem(yyval.a_value);
vlm6a02a8a2004-09-08 00:28:11 +00002469 ;
2470 break;}
vlm0aa86902004-10-12 23:26:53 +00002471case 140:
2472#line 1340 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002473{
vlm5f0128b2004-08-20 13:25:29 +00002474 yyval.a_value = yyvsp[0].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00002475 ;
2476 break;}
vlm0aa86902004-10-12 23:26:53 +00002477case 141:
2478#line 1343 "asn1p_y.y"
vlm151c0b22004-09-22 16:03:36 +00002479{
2480 yyval.a_value = yyvsp[0].a_value;
2481 ;
2482 break;}
vlm0aa86902004-10-12 23:26:53 +00002483case 142:
2484#line 1349 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002485{
vlmfa67ddc2004-06-03 03:38:44 +00002486 asn1p_ref_t *ref;
2487 int ret;
2488 ref = asn1p_ref_new(yylineno);
2489 checkmem(ref);
2490 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2491 checkmem(ret == 0);
2492 yyval.a_value = asn1p_value_fromref(ref, 0);
2493 checkmem(yyval.a_value);
2494 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002495 ;
2496 break;}
vlm0aa86902004-10-12 23:26:53 +00002497case 143:
2498#line 1360 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002499{
vlmfa67ddc2004-06-03 03:38:44 +00002500 asn1p_ref_t *ref;
2501 int ret;
2502 ref = asn1p_ref_new(yylineno);
2503 checkmem(ref);
2504 ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2505 checkmem(ret == 0);
2506 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2507 checkmem(ret == 0);
2508 yyval.a_value = asn1p_value_fromref(ref, 0);
2509 checkmem(yyval.a_value);
2510 free(yyvsp[-2].tv_str);
2511 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002512 ;
2513 break;}
vlm0aa86902004-10-12 23:26:53 +00002514case 144:
2515#line 1377 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002516{
vlmfa67ddc2004-06-03 03:38:44 +00002517 yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 2;
2518 yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
2519 checkmem(yyval.tv_opaque.buf);
2520 yyval.tv_opaque.buf[0] = '{';
2521 yyval.tv_opaque.buf[1] = ' ';
2522 memcpy(yyval.tv_opaque.buf + 2, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2523 yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
2524 free(yyvsp[0].tv_opaque.buf);
vlm6a02a8a2004-09-08 00:28:11 +00002525 ;
2526 break;}
vlm0aa86902004-10-12 23:26:53 +00002527case 145:
2528#line 1387 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002529{
vlmfa67ddc2004-06-03 03:38:44 +00002530 int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
2531 char *p = malloc(newsize + 1);
2532 checkmem(p);
2533 memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
2534 memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2535 p[newsize] = '\0';
2536 free(yyvsp[-1].tv_opaque.buf);
2537 free(yyvsp[0].tv_opaque.buf);
2538 yyval.tv_opaque.buf = p;
2539 yyval.tv_opaque.len = newsize;
vlm6a02a8a2004-09-08 00:28:11 +00002540 ;
2541 break;}
vlm0aa86902004-10-12 23:26:53 +00002542case 146:
2543#line 1402 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002544{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
2545 break;}
vlm0aa86902004-10-12 23:26:53 +00002546case 147:
2547#line 1403 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002548{ yyval.a_type = ASN_BASIC_NULL; ;
2549 break;}
vlm0aa86902004-10-12 23:26:53 +00002550case 148:
2551#line 1404 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002552{ yyval.a_type = ASN_BASIC_REAL; ;
2553 break;}
vlm0aa86902004-10-12 23:26:53 +00002554case 149:
2555#line 1405 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002556{ yyval.a_type = yyvsp[0].a_type; ;
2557 break;}
vlm0aa86902004-10-12 23:26:53 +00002558case 150:
2559#line 1406 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002560{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
2561 break;}
vlm0aa86902004-10-12 23:26:53 +00002562case 151:
2563#line 1407 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002564{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
2565 break;}
vlm0aa86902004-10-12 23:26:53 +00002566case 152:
2567#line 1408 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002568{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
2569 break;}
vlm0aa86902004-10-12 23:26:53 +00002570case 153:
2571#line 1409 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002572{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
2573 break;}
vlm0aa86902004-10-12 23:26:53 +00002574case 154:
2575#line 1410 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002576{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
2577 break;}
vlm0aa86902004-10-12 23:26:53 +00002578case 155:
2579#line 1411 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002580{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
2581 break;}
vlm0aa86902004-10-12 23:26:53 +00002582case 156:
2583#line 1412 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002584{ yyval.a_type = ASN_BASIC_UTCTime; ;
2585 break;}
vlm0aa86902004-10-12 23:26:53 +00002586case 157:
2587#line 1413 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002588{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
2589 break;}
vlm0aa86902004-10-12 23:26:53 +00002590case 158:
2591#line 1420 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002592{ yyval.a_type = ASN_BASIC_INTEGER; ;
2593 break;}
vlm0aa86902004-10-12 23:26:53 +00002594case 159:
2595#line 1421 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002596{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
2597 break;}
vlm0aa86902004-10-12 23:26:53 +00002598case 160:
2599#line 1422 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002600{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
2601 break;}
vlm0aa86902004-10-12 23:26:53 +00002602case 161:
2603#line 1426 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002604{
vlm39e5ed72004-09-05 10:40:41 +00002605 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00002606 checkmem(yyval.a_expr);
2607 yyval.a_expr->expr_type = yyvsp[0].a_type;
2608 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002609 ;
2610 break;}
vlm0aa86902004-10-12 23:26:53 +00002611case 162:
2612#line 1432 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002613{
vlmfa67ddc2004-06-03 03:38:44 +00002614 if(yyvsp[0].a_expr) {
2615 yyval.a_expr = yyvsp[0].a_expr;
2616 } else {
vlm39e5ed72004-09-05 10:40:41 +00002617 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00002618 checkmem(yyval.a_expr);
2619 }
2620 yyval.a_expr->expr_type = yyvsp[-1].a_type;
2621 yyval.a_expr->meta_type = AMT_TYPE;
vlm6a02a8a2004-09-08 00:28:11 +00002622 ;
2623 break;}
vlm0aa86902004-10-12 23:26:53 +00002624case 163:
2625#line 1445 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002626{ yyval.a_type = ASN_STRING_BMPString; ;
2627 break;}
vlm0aa86902004-10-12 23:26:53 +00002628case 164:
2629#line 1446 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002630{
vlmfa67ddc2004-06-03 03:38:44 +00002631 yyval.a_type = ASN_STRING_GeneralString;
vlmc94e28f2004-09-15 11:59:51 +00002632 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
vlm6a02a8a2004-09-08 00:28:11 +00002633 ;
2634 break;}
vlm0aa86902004-10-12 23:26:53 +00002635case 165:
2636#line 1450 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002637{
vlmc94e28f2004-09-15 11:59:51 +00002638 yyval.a_type = ASN_STRING_GraphicString;
2639 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
vlm6a02a8a2004-09-08 00:28:11 +00002640 ;
2641 break;}
vlm0aa86902004-10-12 23:26:53 +00002642case 166:
2643#line 1454 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002644{ yyval.a_type = ASN_STRING_IA5String; ;
vlm6a02a8a2004-09-08 00:28:11 +00002645 break;}
vlm0aa86902004-10-12 23:26:53 +00002646case 167:
2647#line 1455 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002648{ yyval.a_type = ASN_STRING_ISO646String; ;
vlm6a02a8a2004-09-08 00:28:11 +00002649 break;}
vlm0aa86902004-10-12 23:26:53 +00002650case 168:
2651#line 1456 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002652{ yyval.a_type = ASN_STRING_NumericString; ;
vlm6a02a8a2004-09-08 00:28:11 +00002653 break;}
vlm0aa86902004-10-12 23:26:53 +00002654case 169:
2655#line 1457 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002656{ yyval.a_type = ASN_STRING_PrintableString; ;
vlm6a02a8a2004-09-08 00:28:11 +00002657 break;}
vlm0aa86902004-10-12 23:26:53 +00002658case 170:
2659#line 1458 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002660{
2661 yyval.a_type = ASN_STRING_T61String;
2662 fprintf(stderr, "WARNING: T61String is not fully supported\n");
2663 ;
vlm6a02a8a2004-09-08 00:28:11 +00002664 break;}
vlm0aa86902004-10-12 23:26:53 +00002665case 171:
2666#line 1462 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002667{ yyval.a_type = ASN_STRING_TeletexString; ;
2668 break;}
vlm0aa86902004-10-12 23:26:53 +00002669case 172:
2670#line 1463 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002671{ yyval.a_type = ASN_STRING_UniversalString; ;
2672 break;}
vlm0aa86902004-10-12 23:26:53 +00002673case 173:
2674#line 1464 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002675{ yyval.a_type = ASN_STRING_UTF8String; ;
2676 break;}
vlm0aa86902004-10-12 23:26:53 +00002677case 174:
2678#line 1465 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002679{
2680 yyval.a_type = ASN_STRING_VideotexString;
2681 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
2682 ;
2683 break;}
vlm0aa86902004-10-12 23:26:53 +00002684case 175:
2685#line 1469 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002686{ yyval.a_type = ASN_STRING_VisibleString; ;
2687 break;}
vlm0aa86902004-10-12 23:26:53 +00002688case 176:
2689#line 1470 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002690{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
2691 break;}
vlm0aa86902004-10-12 23:26:53 +00002692case 182:
2693#line 1482 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002694{ yyval.a_constr = 0; ;
2695 break;}
vlm0aa86902004-10-12 23:26:53 +00002696case 183:
2697#line 1483 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002698{
vlm39e5ed72004-09-05 10:40:41 +00002699 yyval.a_constr = yyvsp[0].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00002700 ;
2701 break;}
vlm0aa86902004-10-12 23:26:53 +00002702case 184:
2703#line 1489 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002704{
vlm39e5ed72004-09-05 10:40:41 +00002705 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
vlm6a02a8a2004-09-08 00:28:11 +00002706 ;
2707 break;}
vlm0aa86902004-10-12 23:26:53 +00002708case 185:
2709#line 1492 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002710{
vlmfa67ddc2004-06-03 03:38:44 +00002711 /*
2712 * This is a special case, for compatibility purposes.
vlm9283dbe2004-08-18 04:59:12 +00002713 * It goes without parentheses.
vlmfa67ddc2004-06-03 03:38:44 +00002714 */
vlm5f0128b2004-08-20 13:25:29 +00002715 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0);
vlm6a02a8a2004-09-08 00:28:11 +00002716 ;
2717 break;}
vlm0aa86902004-10-12 23:26:53 +00002718case 186:
2719#line 1502 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002720{
vlmfa67ddc2004-06-03 03:38:44 +00002721 yyval.a_constr = yyvsp[-1].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00002722 ;
2723 break;}
vlm0aa86902004-10-12 23:26:53 +00002724case 187:
2725#line 1505 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002726{
vlm9283dbe2004-08-18 04:59:12 +00002727 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002728 ;
2729 break;}
vlm0aa86902004-10-12 23:26:53 +00002730case 188:
2731#line 1511 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002732{
vlmfa67ddc2004-06-03 03:38:44 +00002733 yyval.a_constr = yyvsp[0].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00002734 ;
2735 break;}
vlm0aa86902004-10-12 23:26:53 +00002736case 189:
2737#line 1514 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002738{
vlmfa67ddc2004-06-03 03:38:44 +00002739 asn1p_constraint_t *ct;
2740 ct = asn1p_constraint_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00002741 ct->type = ACT_EL_EXT;
2742 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
vlm6a02a8a2004-09-08 00:28:11 +00002743 ;
2744 break;}
vlm0aa86902004-10-12 23:26:53 +00002745case 190:
2746#line 1520 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002747{
vlmfa67ddc2004-06-03 03:38:44 +00002748 asn1p_constraint_t *ct;
2749 ct = asn1p_constraint_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00002750 ct->type = ACT_EL_EXT;
2751 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
vlm6f5eb0b2004-08-13 12:35:09 +00002752 ct = yyval.a_constr;
2753 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002754 ;
2755 break;}
vlm0aa86902004-10-12 23:26:53 +00002756case 191:
2757#line 1531 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002758{
vlm9283dbe2004-08-18 04:59:12 +00002759 yyval.a_constr = yyvsp[0].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00002760 ;
2761 break;}
vlm0aa86902004-10-12 23:26:53 +00002762case 192:
2763#line 1534 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002764{
vlmfa67ddc2004-06-03 03:38:44 +00002765 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002766 ;
2767 break;}
vlm0aa86902004-10-12 23:26:53 +00002768case 193:
2769#line 1537 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002770{
vlmfa67ddc2004-06-03 03:38:44 +00002771 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002772 ;
2773 break;}
vlm0aa86902004-10-12 23:26:53 +00002774case 194:
2775#line 1540 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002776{
vlmfa67ddc2004-06-03 03:38:44 +00002777 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002778 ;
2779 break;}
vlm0aa86902004-10-12 23:26:53 +00002780case 195:
2781#line 1546 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002782{
vlmfa67ddc2004-06-03 03:38:44 +00002783 int ret;
2784 yyval.a_constr = asn1p_constraint_new(yylineno);
2785 checkmem(yyval.a_constr);
2786 yyval.a_constr->type = yyvsp[-3].a_ctype;
2787 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2788 checkmem(ret == 0);
vlm6a02a8a2004-09-08 00:28:11 +00002789 ;
2790 break;}
vlm0aa86902004-10-12 23:26:53 +00002791case 196:
2792#line 1554 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002793{
vlm9283dbe2004-08-18 04:59:12 +00002794 int ret;
2795 yyval.a_constr = asn1p_constraint_new(yylineno);
2796 checkmem(yyval.a_constr);
2797 yyval.a_constr->type = ACT_CA_SET;
2798 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2799 checkmem(ret == 0);
vlm6a02a8a2004-09-08 00:28:11 +00002800 ;
2801 break;}
vlm0aa86902004-10-12 23:26:53 +00002802case 197:
2803#line 1562 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002804{
vlm9283dbe2004-08-18 04:59:12 +00002805 yyval.a_constr = asn1p_constraint_new(yylineno);
2806 checkmem(yyval.a_constr);
2807 yyval.a_constr->type = ACT_EL_VALUE;
2808 yyval.a_constr->value = yyvsp[0].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00002809 ;
2810 break;}
vlm6a02a8a2004-09-08 00:28:11 +00002811case 198:
vlm0aa86902004-10-12 23:26:53 +00002812#line 1568 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00002813{
vlm0aa86902004-10-12 23:26:53 +00002814 yyval.a_constr = asn1p_constraint_new(yylineno);
2815 checkmem(yyval.a_constr);
2816 yyval.a_constr->type = yyvsp[-1].a_ctype;
2817 yyval.a_constr->range_start = yyvsp[-2].a_value;
2818 yyval.a_constr->range_stop = yyvsp[0].a_value;
vlmc94e28f2004-09-15 11:59:51 +00002819 ;
2820 break;}
vlm151c0b22004-09-22 16:03:36 +00002821case 199:
vlm0aa86902004-10-12 23:26:53 +00002822#line 1575 "asn1p_y.y"
2823{
2824 yyval.a_constr = asn1p_constraint_new(yylineno);
2825 checkmem(yyval.a_constr);
2826 yyval.a_constr->type = yyvsp[-1].a_ctype;
2827 yyval.a_constr->range_start = asn1p_value_fromint(-123);
2828 yyval.a_constr->range_stop = yyvsp[0].a_value;
2829 yyval.a_constr->range_start->type = ATV_MIN;
2830 ;
2831 break;}
2832case 200:
2833#line 1583 "asn1p_y.y"
2834{
2835 yyval.a_constr = asn1p_constraint_new(yylineno);
2836 checkmem(yyval.a_constr);
2837 yyval.a_constr->type = yyvsp[-1].a_ctype;
2838 yyval.a_constr->range_start = yyvsp[-2].a_value;
2839 yyval.a_constr->range_stop = asn1p_value_fromint(321);
2840 yyval.a_constr->range_stop->type = ATV_MAX;
2841 ;
2842 break;}
2843case 201:
2844#line 1591 "asn1p_y.y"
2845{
2846 yyval.a_constr = asn1p_constraint_new(yylineno);
2847 checkmem(yyval.a_constr);
2848 yyval.a_constr->type = yyvsp[-1].a_ctype;
2849 yyval.a_constr->range_start = asn1p_value_fromint(-123);
2850 yyval.a_constr->range_stop = asn1p_value_fromint(321);
2851 yyval.a_constr->range_start->type = ATV_MIN;
2852 yyval.a_constr->range_stop->type = ATV_MAX;
2853 ;
2854 break;}
2855case 202:
2856#line 1600 "asn1p_y.y"
vlm151c0b22004-09-22 16:03:36 +00002857{
2858 yyval.a_constr = yyvsp[0].a_constr;
2859 ;
2860 break;}
vlmc94e28f2004-09-15 11:59:51 +00002861case 203:
vlm0aa86902004-10-12 23:26:53 +00002862#line 1603 "asn1p_y.y"
2863{
2864 yyval.a_constr = yyvsp[0].a_constr;
2865 ;
vlmc94e28f2004-09-15 11:59:51 +00002866 break;}
2867case 204:
vlm0aa86902004-10-12 23:26:53 +00002868#line 1609 "asn1p_y.y"
2869{ yyval.a_ctype = ACT_EL_RANGE; ;
2870 break;}
2871case 205:
2872#line 1610 "asn1p_y.y"
2873{ yyval.a_ctype = ACT_EL_RLRANGE; ;
2874 break;}
2875case 206:
2876#line 1611 "asn1p_y.y"
2877{ yyval.a_ctype = ACT_EL_LLRANGE; ;
2878 break;}
2879case 207:
2880#line 1612 "asn1p_y.y"
2881{ yyval.a_ctype = ACT_EL_ULRANGE; ;
2882 break;}
2883case 208:
2884#line 1616 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002885{
vlm39e5ed72004-09-05 10:40:41 +00002886 yyval.a_ctype = ACT_CT_SIZE;
vlm6a02a8a2004-09-08 00:28:11 +00002887 ;
2888 break;}
vlm0aa86902004-10-12 23:26:53 +00002889case 209:
2890#line 1619 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002891{
vlm39e5ed72004-09-05 10:40:41 +00002892 yyval.a_ctype = ACT_CT_FROM;
vlm6a02a8a2004-09-08 00:28:11 +00002893 ;
2894 break;}
vlm0aa86902004-10-12 23:26:53 +00002895case 210:
2896#line 1625 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002897{
vlmfa67ddc2004-06-03 03:38:44 +00002898 yyval.a_value = yyvsp[0].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00002899 ;
2900 break;}
vlm0aa86902004-10-12 23:26:53 +00002901case 211:
2902#line 1628 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002903{
vlmfa67ddc2004-06-03 03:38:44 +00002904 asn1p_ref_t *ref;
2905 int ret;
2906 ref = asn1p_ref_new(yylineno);
2907 checkmem(ref);
2908 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2909 checkmem(ret == 0);
2910 yyval.a_value = asn1p_value_fromref(ref, 0);
2911 checkmem(yyval.a_value);
2912 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00002913 ;
2914 break;}
vlm0aa86902004-10-12 23:26:53 +00002915case 212:
2916#line 1639 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002917{
vlmfa67ddc2004-06-03 03:38:44 +00002918 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2919 checkmem(yyval.a_value);
vlm6a02a8a2004-09-08 00:28:11 +00002920 ;
2921 break;}
vlm0aa86902004-10-12 23:26:53 +00002922case 213:
2923#line 1643 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002924{
vlmfa67ddc2004-06-03 03:38:44 +00002925 yyval.a_value = asn1p_value_fromint(0);
2926 checkmem(yyval.a_value);
2927 yyval.a_value->type = ATV_FALSE;
vlm6a02a8a2004-09-08 00:28:11 +00002928 ;
2929 break;}
vlm0aa86902004-10-12 23:26:53 +00002930case 214:
2931#line 1648 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002932{
vlmfa67ddc2004-06-03 03:38:44 +00002933 yyval.a_value = asn1p_value_fromint(1);
2934 checkmem(yyval.a_value);
2935 yyval.a_value->type = ATV_TRUE;
vlm6a02a8a2004-09-08 00:28:11 +00002936 ;
2937 break;}
vlm0aa86902004-10-12 23:26:53 +00002938case 215:
2939#line 1656 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002940{
vlmfa67ddc2004-06-03 03:38:44 +00002941 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
vlm6a02a8a2004-09-08 00:28:11 +00002942 ;
2943 break;}
vlm0aa86902004-10-12 23:26:53 +00002944case 216:
2945#line 1662 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002946{
vlmfa67ddc2004-06-03 03:38:44 +00002947 yyval.a_constr = yyvsp[0].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00002948 ;
2949 break;}
vlm0aa86902004-10-12 23:26:53 +00002950case 217:
2951#line 1665 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002952{
vlmfa67ddc2004-06-03 03:38:44 +00002953 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00002954 ;
2955 break;}
vlm0aa86902004-10-12 23:26:53 +00002956case 218:
2957#line 1671 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002958{
vlmfa67ddc2004-06-03 03:38:44 +00002959 yyval.a_constr = asn1p_constraint_new(yylineno);
2960 checkmem(yyval.a_constr);
2961 yyval.a_constr->type = ACT_EL_EXT;
vlm6a02a8a2004-09-08 00:28:11 +00002962 ;
2963 break;}
vlm0aa86902004-10-12 23:26:53 +00002964case 219:
2965#line 1676 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002966{
vlmfa67ddc2004-06-03 03:38:44 +00002967 yyval.a_constr = asn1p_constraint_new(yylineno);
2968 checkmem(yyval.a_constr);
2969 yyval.a_constr->type = ACT_EL_VALUE;
2970 yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
2971 yyval.a_constr->presence = yyvsp[0].a_pres;
vlm6a02a8a2004-09-08 00:28:11 +00002972 ;
2973 break;}
vlm0aa86902004-10-12 23:26:53 +00002974case 220:
2975#line 1689 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002976{ yyval.a_pres = ACPRES_DEFAULT; ;
2977 break;}
vlm0aa86902004-10-12 23:26:53 +00002978case 221:
2979#line 1690 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002980{ yyval.a_pres = yyvsp[0].a_pres; ;
2981 break;}
vlm0aa86902004-10-12 23:26:53 +00002982case 222:
2983#line 1694 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002984{
vlmfa67ddc2004-06-03 03:38:44 +00002985 yyval.a_pres = ACPRES_PRESENT;
vlm6a02a8a2004-09-08 00:28:11 +00002986 ;
2987 break;}
vlm0aa86902004-10-12 23:26:53 +00002988case 223:
2989#line 1697 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002990{
vlmfa67ddc2004-06-03 03:38:44 +00002991 yyval.a_pres = ACPRES_ABSENT;
vlm6a02a8a2004-09-08 00:28:11 +00002992 ;
2993 break;}
vlm0aa86902004-10-12 23:26:53 +00002994case 224:
2995#line 1700 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00002996{
vlmfa67ddc2004-06-03 03:38:44 +00002997 yyval.a_pres = ACPRES_OPTIONAL;
vlm6a02a8a2004-09-08 00:28:11 +00002998 ;
2999 break;}
vlm0aa86902004-10-12 23:26:53 +00003000case 225:
3001#line 1706 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003002{
vlm5f0128b2004-08-20 13:25:29 +00003003 yyval.a_constr = yyvsp[0].a_constr;
vlm6a02a8a2004-09-08 00:28:11 +00003004 ;
3005 break;}
vlm0aa86902004-10-12 23:26:53 +00003006case 226:
3007#line 1709 "asn1p_y.y"
vlm151c0b22004-09-22 16:03:36 +00003008{
3009 yyval.a_constr = yyvsp[0].a_constr;
3010 ;
3011 break;}
vlm0aa86902004-10-12 23:26:53 +00003012case 227:
3013#line 1718 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003014{
vlmfa67ddc2004-06-03 03:38:44 +00003015 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
3016 asn1p_constraint_t *ct;
3017 int ret;
3018 ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
3019 checkmem(ret == 0);
3020 ct = asn1p_constraint_new(yylineno);
3021 checkmem(yyval.a_constr);
3022 ct->type = ACT_EL_VALUE;
3023 ct->value = asn1p_value_fromref(ref, 0);
3024 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
vlm6a02a8a2004-09-08 00:28:11 +00003025 ;
3026 break;}
vlm0aa86902004-10-12 23:26:53 +00003027case 228:
3028#line 1733 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003029{
vlmfa67ddc2004-06-03 03:38:44 +00003030 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
vlm6a02a8a2004-09-08 00:28:11 +00003031 ;
3032 break;}
vlm0aa86902004-10-12 23:26:53 +00003033case 229:
3034#line 1739 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003035{
vlmfa67ddc2004-06-03 03:38:44 +00003036 yyval.a_constr = asn1p_constraint_new(yylineno);
3037 checkmem(yyval.a_constr);
3038 yyval.a_constr->type = ACT_EL_VALUE;
3039 yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
vlm6a02a8a2004-09-08 00:28:11 +00003040 ;
3041 break;}
vlm0aa86902004-10-12 23:26:53 +00003042case 230:
3043#line 1745 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003044{
vlmfa67ddc2004-06-03 03:38:44 +00003045 asn1p_constraint_t *ct;
3046 ct = asn1p_constraint_new(yylineno);
3047 checkmem(ct);
3048 ct->type = ACT_EL_VALUE;
3049 ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
3050 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
vlm6a02a8a2004-09-08 00:28:11 +00003051 ;
3052 break;}
vlm0aa86902004-10-12 23:26:53 +00003053case 231:
3054#line 1759 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003055{
vlmfa67ddc2004-06-03 03:38:44 +00003056 char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
3057 int ret;
3058 *p = '@';
3059 strcpy(p + 1, yyvsp[0].tv_str);
3060 yyval.a_ref = asn1p_ref_new(yylineno);
3061 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3062 checkmem(ret == 0);
3063 free(p);
3064 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00003065 ;
3066 break;}
vlm0aa86902004-10-12 23:26:53 +00003067case 232:
3068#line 1770 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003069{
vlmfa67ddc2004-06-03 03:38:44 +00003070 char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
3071 int ret;
3072 p[0] = '@';
3073 p[1] = '.';
3074 strcpy(p + 2, yyvsp[0].tv_str);
3075 yyval.a_ref = asn1p_ref_new(yylineno);
3076 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
3077 checkmem(ret == 0);
3078 free(p);
3079 free(yyvsp[0].tv_str);
vlm6a02a8a2004-09-08 00:28:11 +00003080 ;
3081 break;}
vlm0aa86902004-10-12 23:26:53 +00003082case 233:
3083#line 1786 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003084{
vlmfa67ddc2004-06-03 03:38:44 +00003085 yyval.tv_str = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00003086 ;
3087 break;}
vlm0aa86902004-10-12 23:26:53 +00003088case 234:
3089#line 1789 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003090{
vlmfa67ddc2004-06-03 03:38:44 +00003091 int l1 = strlen(yyvsp[-2].tv_str);
3092 int l3 = strlen(yyvsp[0].tv_str);
3093 yyval.tv_str = malloc(l1 + 1 + l3 + 1);
3094 memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
3095 yyval.tv_str[l1] = '.';
3096 memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
3097 yyval.tv_str[l1 + 1 + l3] = '\0';
vlm6a02a8a2004-09-08 00:28:11 +00003098 ;
3099 break;}
vlm0aa86902004-10-12 23:26:53 +00003100case 235:
3101#line 1807 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003102{
vlmc94e28f2004-09-15 11:59:51 +00003103 yyval.a_marker.flags = EM_NOMARK;
3104 yyval.a_marker.default_value = 0;
vlm6a02a8a2004-09-08 00:28:11 +00003105 ;
3106 break;}
vlm0aa86902004-10-12 23:26:53 +00003107case 236:
3108#line 1811 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003109{ yyval.a_marker = yyvsp[0].a_marker; ;
vlma2374a02004-09-14 02:44:07 +00003110 break;}
vlm0aa86902004-10-12 23:26:53 +00003111case 237:
3112#line 1815 "asn1p_y.y"
vlma2374a02004-09-14 02:44:07 +00003113{
vlmc94e28f2004-09-15 11:59:51 +00003114 yyval.a_marker.flags = EM_OPTIONAL;
3115 yyval.a_marker.default_value = 0;
vlma2374a02004-09-14 02:44:07 +00003116 ;
3117 break;}
vlm0aa86902004-10-12 23:26:53 +00003118case 238:
3119#line 1819 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003120{
3121 yyval.a_marker.flags = EM_DEFAULT;
3122 yyval.a_marker.default_value = yyvsp[0].a_value;
3123 ;
3124 break;}
vlm0aa86902004-10-12 23:26:53 +00003125case 239:
3126#line 1842 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003127{
vlm39e5ed72004-09-05 10:40:41 +00003128 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003129 checkmem(yyval.a_expr);
vlm6a02a8a2004-09-08 00:28:11 +00003130 ;
3131 break;}
vlm0aa86902004-10-12 23:26:53 +00003132case 240:
3133#line 1846 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003134{
vlmfa67ddc2004-06-03 03:38:44 +00003135 yyval.a_expr = yyvsp[-1].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00003136 ;
3137 break;}
vlm0aa86902004-10-12 23:26:53 +00003138case 241:
3139#line 1852 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003140{
vlm39e5ed72004-09-05 10:40:41 +00003141 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003142 checkmem(yyval.a_expr);
vlm6a02a8a2004-09-08 00:28:11 +00003143 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
3144 ;
3145 break;}
vlm0aa86902004-10-12 23:26:53 +00003146case 242:
3147#line 1857 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003148{
vlmfa67ddc2004-06-03 03:38:44 +00003149 yyval.a_expr = yyvsp[-2].a_expr;
vlm6a02a8a2004-09-08 00:28:11 +00003150 asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
3151 ;
3152 break;}
vlm0aa86902004-10-12 23:26:53 +00003153case 243:
3154#line 1864 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003155{
vlm39e5ed72004-09-05 10:40:41 +00003156 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003157 checkmem(yyval.a_expr);
3158 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3159 yyval.a_expr->meta_type = AMT_VALUE;
3160 yyval.a_expr->Identifier = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00003161 ;
3162 break;}
vlm0aa86902004-10-12 23:26:53 +00003163case 244:
3164#line 1871 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003165{
vlm39e5ed72004-09-05 10:40:41 +00003166 yyval.a_expr = asn1p_expr_new(yylineno);
vlm5f0128b2004-08-20 13:25:29 +00003167 checkmem(yyval.a_expr);
3168 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3169 yyval.a_expr->meta_type = AMT_VALUE;
3170 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3171 yyval.a_expr->value = yyvsp[-1].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00003172 ;
3173 break;}
vlm0aa86902004-10-12 23:26:53 +00003174case 245:
3175#line 1879 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003176{
3177 yyval.a_expr = asn1p_expr_new(yylineno);
3178 checkmem(yyval.a_expr);
3179 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3180 yyval.a_expr->meta_type = AMT_VALUE;
3181 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3182 yyval.a_expr->value = yyvsp[-1].a_value;
3183 ;
3184 break;}
vlm0aa86902004-10-12 23:26:53 +00003185case 246:
3186#line 1887 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003187{
vlm39e5ed72004-09-05 10:40:41 +00003188 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003189 checkmem(yyval.a_expr);
3190 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3191 yyval.a_expr->meta_type = AMT_VALUE;
3192 yyval.a_expr->value = yyvsp[0].a_value;
vlm6a02a8a2004-09-08 00:28:11 +00003193 ;
3194 break;}
vlm0aa86902004-10-12 23:26:53 +00003195case 247:
3196#line 1894 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003197{
vlm39e5ed72004-09-05 10:40:41 +00003198 yyval.a_expr = asn1p_expr_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003199 checkmem(yyval.a_expr);
3200 yyval.a_expr->Identifier = strdup("...");
3201 checkmem(yyval.a_expr->Identifier);
3202 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
3203 yyval.a_expr->meta_type = AMT_VALUE;
vlm6a02a8a2004-09-08 00:28:11 +00003204 ;
3205 break;}
vlm0aa86902004-10-12 23:26:53 +00003206case 248:
3207#line 1905 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003208{
vlmec8f6812004-08-22 03:19:54 +00003209 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3210 checkmem(yyval.a_value);
vlm6a02a8a2004-09-08 00:28:11 +00003211 ;
3212 break;}
vlm0aa86902004-10-12 23:26:53 +00003213case 249:
3214#line 1909 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003215{
3216 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3217 checkmem(yyval.a_value);
3218 ;
vlm6a02a8a2004-09-08 00:28:11 +00003219 break;}
vlm0aa86902004-10-12 23:26:53 +00003220case 250:
3221#line 1940 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003222{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
vlm6a02a8a2004-09-08 00:28:11 +00003223 break;}
vlm0aa86902004-10-12 23:26:53 +00003224case 251:
3225#line 1941 "asn1p_y.y"
vlmc94e28f2004-09-15 11:59:51 +00003226{ yyval.a_tag = yyvsp[0].a_tag; ;
3227 break;}
vlm0aa86902004-10-12 23:26:53 +00003228case 252:
3229#line 1945 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003230{
vlmfa67ddc2004-06-03 03:38:44 +00003231 yyval.a_tag = yyvsp[0].a_tag;
3232 yyval.a_tag.tag_mode = TM_DEFAULT;
vlm6a02a8a2004-09-08 00:28:11 +00003233 ;
3234 break;}
vlm0aa86902004-10-12 23:26:53 +00003235case 253:
3236#line 1949 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003237{
vlmfa67ddc2004-06-03 03:38:44 +00003238 yyval.a_tag = yyvsp[-1].a_tag;
3239 yyval.a_tag.tag_mode = TM_IMPLICIT;
vlm6a02a8a2004-09-08 00:28:11 +00003240 ;
3241 break;}
vlm0aa86902004-10-12 23:26:53 +00003242case 254:
3243#line 1953 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003244{
vlmfa67ddc2004-06-03 03:38:44 +00003245 yyval.a_tag = yyvsp[-1].a_tag;
3246 yyval.a_tag.tag_mode = TM_EXPLICIT;
vlm6a02a8a2004-09-08 00:28:11 +00003247 ;
3248 break;}
vlm151c0b22004-09-22 16:03:36 +00003249case 255:
vlm0aa86902004-10-12 23:26:53 +00003250#line 1960 "asn1p_y.y"
vlm151c0b22004-09-22 16:03:36 +00003251{
vlm0aa86902004-10-12 23:26:53 +00003252 checkmem(yyvsp[0].tv_str);
vlm151c0b22004-09-22 16:03:36 +00003253 yyval.tv_str = yyvsp[0].tv_str;
3254 ;
3255 break;}
3256case 256:
vlm0aa86902004-10-12 23:26:53 +00003257#line 1964 "asn1p_y.y"
3258{
3259 checkmem(yyvsp[0].tv_str);
3260 yyval.tv_str = yyvsp[0].tv_str;
3261 ;
3262 break;}
3263case 257:
3264#line 1972 "asn1p_y.y"
3265{
3266 checkmem(yyvsp[0].tv_str);
3267 yyval.tv_str = yyvsp[0].tv_str;
3268 ;
3269 break;}
3270case 258:
3271#line 1979 "asn1p_y.y"
3272{ yyval.tv_str = 0; ;
3273 break;}
3274case 259:
3275#line 1980 "asn1p_y.y"
3276{
3277 yyval.tv_str = yyvsp[0].tv_str;
3278 ;
3279 break;}
3280case 260:
3281#line 1985 "asn1p_y.y"
vlm6a02a8a2004-09-08 00:28:11 +00003282{
vlm39e5ed72004-09-05 10:40:41 +00003283 checkmem(yyvsp[0].tv_str);
3284 yyval.tv_str = yyvsp[0].tv_str;
vlm6a02a8a2004-09-08 00:28:11 +00003285 ;
3286 break;}
vlm6a02a8a2004-09-08 00:28:11 +00003287}
3288 /* the action file gets copied in in place of this dollarsign */
3289#line 543 "/usr/share/bison.simple"
vlmfa67ddc2004-06-03 03:38:44 +00003290
3291 yyvsp -= yylen;
3292 yyssp -= yylen;
vlm6a02a8a2004-09-08 00:28:11 +00003293#ifdef YYLSP_NEEDED
3294 yylsp -= yylen;
3295#endif
vlmfa67ddc2004-06-03 03:38:44 +00003296
vlm6a02a8a2004-09-08 00:28:11 +00003297#if YYDEBUG != 0
vlmfa67ddc2004-06-03 03:38:44 +00003298 if (yydebug)
3299 {
vlm6a02a8a2004-09-08 00:28:11 +00003300 short *ssp1 = yyss - 1;
3301 fprintf (stderr, "state stack now");
3302 while (ssp1 != yyssp)
3303 fprintf (stderr, " %d", *++ssp1);
3304 fprintf (stderr, "\n");
vlmfa67ddc2004-06-03 03:38:44 +00003305 }
3306#endif
3307
3308 *++yyvsp = yyval;
3309
vlm6a02a8a2004-09-08 00:28:11 +00003310#ifdef YYLSP_NEEDED
3311 yylsp++;
3312 if (yylen == 0)
3313 {
3314 yylsp->first_line = yylloc.first_line;
3315 yylsp->first_column = yylloc.first_column;
3316 yylsp->last_line = (yylsp-1)->last_line;
3317 yylsp->last_column = (yylsp-1)->last_column;
3318 yylsp->text = 0;
3319 }
3320 else
3321 {
3322 yylsp->last_line = (yylsp+yylen-1)->last_line;
3323 yylsp->last_column = (yylsp+yylen-1)->last_column;
3324 }
3325#endif
vlmfa67ddc2004-06-03 03:38:44 +00003326
vlm6a02a8a2004-09-08 00:28:11 +00003327 /* Now "shift" the result of the reduction.
3328 Determine what state that goes to,
3329 based on the state we popped back to
3330 and the rule number reduced by. */
vlmfa67ddc2004-06-03 03:38:44 +00003331
3332 yyn = yyr1[yyn];
3333
vlm6a02a8a2004-09-08 00:28:11 +00003334 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3335 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
vlmfa67ddc2004-06-03 03:38:44 +00003336 yystate = yytable[yystate];
3337 else
vlm6a02a8a2004-09-08 00:28:11 +00003338 yystate = yydefgoto[yyn - YYNTBASE];
vlmfa67ddc2004-06-03 03:38:44 +00003339
3340 goto yynewstate;
3341
vlm6a02a8a2004-09-08 00:28:11 +00003342yyerrlab: /* here on detecting error */
vlmfa67ddc2004-06-03 03:38:44 +00003343
vlm6a02a8a2004-09-08 00:28:11 +00003344 if (! yyerrstatus)
3345 /* If not already recovering from an error, report this error. */
vlmfa67ddc2004-06-03 03:38:44 +00003346 {
3347 ++yynerrs;
vlm6a02a8a2004-09-08 00:28:11 +00003348
3349#ifdef YYERROR_VERBOSE
vlmfa67ddc2004-06-03 03:38:44 +00003350 yyn = yypact[yystate];
3351
vlm6a02a8a2004-09-08 00:28:11 +00003352 if (yyn > YYFLAG && yyn < YYLAST)
vlmfa67ddc2004-06-03 03:38:44 +00003353 {
vlm6a02a8a2004-09-08 00:28:11 +00003354 int size = 0;
3355 char *msg;
3356 int x, count;
vlmfa67ddc2004-06-03 03:38:44 +00003357
vlm6a02a8a2004-09-08 00:28:11 +00003358 count = 0;
3359 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3360 for (x = (yyn < 0 ? -yyn : 0);
3361 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3362 if (yycheck[x + yyn] == x)
3363 size += strlen(yytname[x]) + 15, count++;
3364 msg = (char *) malloc(size + 15);
3365 if (msg != 0)
vlmfa67ddc2004-06-03 03:38:44 +00003366 {
vlm6a02a8a2004-09-08 00:28:11 +00003367 strcpy(msg, "parse error");
vlmfa67ddc2004-06-03 03:38:44 +00003368
vlm6a02a8a2004-09-08 00:28:11 +00003369 if (count < 5)
vlmfa67ddc2004-06-03 03:38:44 +00003370 {
vlm6a02a8a2004-09-08 00:28:11 +00003371 count = 0;
3372 for (x = (yyn < 0 ? -yyn : 0);
3373 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3374 if (yycheck[x + yyn] == x)
vlmfa67ddc2004-06-03 03:38:44 +00003375 {
vlm6a02a8a2004-09-08 00:28:11 +00003376 strcat(msg, count == 0 ? ", expecting `" : " or `");
3377 strcat(msg, yytname[x]);
3378 strcat(msg, "'");
3379 count++;
vlmfa67ddc2004-06-03 03:38:44 +00003380 }
3381 }
vlm6a02a8a2004-09-08 00:28:11 +00003382 yyerror(msg);
3383 free(msg);
vlmfa67ddc2004-06-03 03:38:44 +00003384 }
3385 else
vlm6a02a8a2004-09-08 00:28:11 +00003386 yyerror ("parse error; also virtual memory exceeded");
vlmfa67ddc2004-06-03 03:38:44 +00003387 }
3388 else
3389#endif /* YYERROR_VERBOSE */
vlm6a02a8a2004-09-08 00:28:11 +00003390 yyerror("parse error");
vlmfa67ddc2004-06-03 03:38:44 +00003391 }
vlm6a02a8a2004-09-08 00:28:11 +00003392
vlmfa67ddc2004-06-03 03:38:44 +00003393 goto yyerrlab1;
vlm6a02a8a2004-09-08 00:28:11 +00003394yyerrlab1: /* here on error raised explicitly by an action */
vlmfa67ddc2004-06-03 03:38:44 +00003395
3396 if (yyerrstatus == 3)
3397 {
vlm6a02a8a2004-09-08 00:28:11 +00003398 /* if just tried and failed to reuse lookahead token after an error, discard it. */
vlmfa67ddc2004-06-03 03:38:44 +00003399
vlm6a02a8a2004-09-08 00:28:11 +00003400 /* return failure if at end of input */
vlmfa67ddc2004-06-03 03:38:44 +00003401 if (yychar == YYEOF)
vlm6a02a8a2004-09-08 00:28:11 +00003402 YYABORT;
vlmfa67ddc2004-06-03 03:38:44 +00003403
vlm6a02a8a2004-09-08 00:28:11 +00003404#if YYDEBUG != 0
3405 if (yydebug)
3406 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3407#endif
3408
vlmfa67ddc2004-06-03 03:38:44 +00003409 yychar = YYEMPTY;
3410 }
3411
vlm6a02a8a2004-09-08 00:28:11 +00003412 /* Else will try to reuse lookahead token
3413 after shifting the error token. */
vlmfa67ddc2004-06-03 03:38:44 +00003414
vlm6a02a8a2004-09-08 00:28:11 +00003415 yyerrstatus = 3; /* Each real token shifted decrements this */
vlmfa67ddc2004-06-03 03:38:44 +00003416
vlm6a02a8a2004-09-08 00:28:11 +00003417 goto yyerrhandle;
vlm80103492004-09-07 10:39:09 +00003418
vlm6a02a8a2004-09-08 00:28:11 +00003419yyerrdefault: /* current state does not do anything special for the error token. */
vlm80103492004-09-07 10:39:09 +00003420
vlm6a02a8a2004-09-08 00:28:11 +00003421#if 0
3422 /* This is wrong; only states that explicitly want error tokens
3423 should shift them. */
3424 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3425 if (yyn) goto yydefault;
vlm39e5ed72004-09-05 10:40:41 +00003426#endif
vlm6a02a8a2004-09-08 00:28:11 +00003427
3428yyerrpop: /* pop the current state because it cannot handle the error token */
3429
3430 if (yyssp == yyss) YYABORT;
3431 yyvsp--;
3432 yystate = *--yyssp;
3433#ifdef YYLSP_NEEDED
3434 yylsp--;
3435#endif
3436
3437#if YYDEBUG != 0
3438 if (yydebug)
3439 {
3440 short *ssp1 = yyss - 1;
3441 fprintf (stderr, "Error: state stack now");
3442 while (ssp1 != yyssp)
3443 fprintf (stderr, " %d", *++ssp1);
3444 fprintf (stderr, "\n");
vlm39e5ed72004-09-05 10:40:41 +00003445 }
vlm6a02a8a2004-09-08 00:28:11 +00003446#endif
3447
3448yyerrhandle:
3449
3450 yyn = yypact[yystate];
3451 if (yyn == YYFLAG)
3452 goto yyerrdefault;
3453
3454 yyn += YYTERROR;
3455 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3456 goto yyerrdefault;
3457
3458 yyn = yytable[yyn];
3459 if (yyn < 0)
3460 {
3461 if (yyn == YYFLAG)
3462 goto yyerrpop;
3463 yyn = -yyn;
3464 goto yyreduce;
3465 }
3466 else if (yyn == 0)
3467 goto yyerrpop;
vlmfa67ddc2004-06-03 03:38:44 +00003468
3469 if (yyn == YYFINAL)
3470 YYACCEPT;
3471
vlm6a02a8a2004-09-08 00:28:11 +00003472#if YYDEBUG != 0
3473 if (yydebug)
3474 fprintf(stderr, "Shifting error token, ");
3475#endif
vlmfa67ddc2004-06-03 03:38:44 +00003476
3477 *++yyvsp = yylval;
vlm6a02a8a2004-09-08 00:28:11 +00003478#ifdef YYLSP_NEEDED
3479 *++yylsp = yylloc;
3480#endif
vlmfa67ddc2004-06-03 03:38:44 +00003481
3482 yystate = yyn;
3483 goto yynewstate;
3484
vlm6a02a8a2004-09-08 00:28:11 +00003485 yyacceptlab:
3486 /* YYACCEPT comes here. */
3487 if (yyfree_stacks)
3488 {
3489 free (yyss);
3490 free (yyvs);
3491#ifdef YYLSP_NEEDED
3492 free (yyls);
vlm044f7442004-09-04 04:49:21 +00003493#endif
vlm6a02a8a2004-09-08 00:28:11 +00003494 }
3495 return 0;
vlm80103492004-09-07 10:39:09 +00003496
vlm6a02a8a2004-09-08 00:28:11 +00003497 yyabortlab:
3498 /* YYABORT comes here. */
3499 if (yyfree_stacks)
3500 {
3501 free (yyss);
3502 free (yyvs);
3503#ifdef YYLSP_NEEDED
3504 free (yyls);
vlm80103492004-09-07 10:39:09 +00003505#endif
vlm6a02a8a2004-09-08 00:28:11 +00003506 }
3507 return 1;
vlmfa67ddc2004-06-03 03:38:44 +00003508}
vlm0aa86902004-10-12 23:26:53 +00003509#line 1991 "asn1p_y.y"
vlmfa67ddc2004-06-03 03:38:44 +00003510
3511
3512
3513/*
3514 * Convert Xstring ('0101'B or '5'H) to the binary vector.
3515 */
3516static asn1p_value_t *
3517_convert_bitstring2binary(char *str, int base) {
3518 asn1p_value_t *val;
3519 int slen;
3520 int memlen;
3521 int baselen;
3522 int bits;
3523 uint8_t *binary_vector;
3524 uint8_t *bv_ptr;
3525 uint8_t cur_val;
3526
3527 assert(str);
3528 assert(str[0] == '\'');
3529
3530 switch(base) {
3531 case 'B':
3532 baselen = 1;
3533 break;
3534 case 'H':
3535 baselen = 4;
3536 break;
3537 default:
3538 assert(base == 'B' || base == 'H');
3539 errno = EINVAL;
3540 return NULL;
3541 }
3542
3543 slen = strlen(str);
3544 assert(str[slen - 1] == base);
3545 assert(str[slen - 2] == '\'');
3546
3547 memlen = slen / (8 / baselen); /* Conservative estimate */
3548
3549 bv_ptr = binary_vector = malloc(memlen + 1);
3550 if(bv_ptr == NULL)
3551 /* ENOMEM */
3552 return NULL;
3553
3554 cur_val = 0;
3555 bits = 0;
3556 while(*(++str) != '\'') {
3557 switch(baselen) {
3558 case 1:
3559 switch(*str) {
3560 case '1':
3561 cur_val |= 1 << (7 - (bits % 8));
3562 case '0':
3563 break;
3564 default:
3565 assert(!"_y UNREACH1");
3566 case ' ': case '\r': case '\n':
3567 continue;
3568 }
3569 break;
3570 case 4:
3571 switch(*str) {
3572 case '0': case '1': case '2': case '3': case '4':
3573 case '5': case '6': case '7': case '8': case '9':
3574 cur_val |= (*str - '0') << (4 - (bits % 8));
3575 break;
3576 case 'A': case 'B': case 'C':
3577 case 'D': case 'E': case 'F':
3578 cur_val |= ((*str - 'A') + 10)
3579 << (4 - (bits % 8));
3580 break;
3581 default:
3582 assert(!"_y UNREACH2");
3583 case ' ': case '\r': case '\n':
3584 continue;
3585 }
3586 break;
3587 }
3588
3589 bits += baselen;
3590 if((bits % 8) == 0) {
3591 *bv_ptr++ = cur_val;
3592 cur_val = 0;
3593 }
3594 }
3595
3596 *bv_ptr = cur_val;
3597 assert((bv_ptr - binary_vector) <= memlen);
3598
3599 val = asn1p_value_frombits(binary_vector, bits, 0);
3600 if(val == NULL) {
3601 free(binary_vector);
3602 }
3603
3604 return val;
3605}
3606
3607extern char *asn1p_text;
3608
3609int
3610yyerror(const char *msg) {
3611 fprintf(stderr,
3612 "ASN.1 grammar parse error "
3613 "near line %d (token \"%s\"): %s\n",
vlm39e5ed72004-09-05 10:40:41 +00003614 yylineno, asn1p_text, msg);
vlmfa67ddc2004-06-03 03:38:44 +00003615 return -1;
3616}
3617
3618