blob: 68a94fea15908ec6c55cfc8ef213abd765f14b18 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002/* A Bison parser, made from asn1p_y.y
3 by GNU Bison version 1.28 */
Lev Walkinf15320b2004-06-03 03:38:44 +00004
Lev Walkinb4fcdd22004-08-13 12:35:09 +00005#define YYBISON 1 /* Identify Bison output. */
Lev Walkinf15320b2004-06-03 03:38:44 +00006
7#define yyparse asn1p_parse
Lev Walkinb4fcdd22004-08-13 12:35:09 +00008#define yylex asn1p_lex
Lev Walkinf15320b2004-06-03 03:38:44 +00009#define yyerror asn1p_error
Lev Walkinb4fcdd22004-08-13 12:35:09 +000010#define yylval asn1p_lval
11#define yychar asn1p_char
Lev Walkinf15320b2004-06-03 03:38:44 +000012#define yydebug asn1p_debug
13#define yynerrs asn1p_nerrs
Lev Walkinb4fcdd22004-08-13 12:35:09 +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_objectclassreference 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_END 292
50#define TOK_ENUMERATED 293
51#define TOK_EXPLICIT 294
52#define TOK_EXPORTS 295
53#define TOK_EXTENSIBILITY 296
54#define TOK_EXTERNAL 297
55#define TOK_FALSE 298
56#define TOK_FROM 299
57#define TOK_GeneralizedTime 300
58#define TOK_GeneralString 301
59#define TOK_GraphicString 302
60#define TOK_IA5String 303
61#define TOK_IDENTIFIER 304
62#define TOK_IMPLICIT 305
63#define TOK_IMPLIED 306
64#define TOK_IMPORTS 307
65#define TOK_INCLUDES 308
66#define TOK_INSTANCE 309
67#define TOK_INTEGER 310
68#define TOK_ISO646String 311
69#define TOK_MAX 312
70#define TOK_MIN 313
71#define TOK_MINUS_INFINITY 314
72#define TOK_NULL 315
73#define TOK_NumericString 316
74#define TOK_OBJECT 317
75#define TOK_ObjectDescriptor 318
76#define TOK_OCTET 319
77#define TOK_OF 320
78#define TOK_OPTIONAL 321
79#define TOK_PATTERN 322
80#define TOK_PDV 323
81#define TOK_PLUS_INFINITY 324
82#define TOK_PRESENT 325
83#define TOK_PrintableString 326
84#define TOK_PRIVATE 327
85#define TOK_REAL 328
86#define TOK_RELATIVE_OID 329
87#define TOK_SEQUENCE 330
88#define TOK_SET 331
89#define TOK_SIZE 332
90#define TOK_STRING 333
91#define TOK_SYNTAX 334
92#define TOK_T61String 335
93#define TOK_TAGS 336
94#define TOK_TeletexString 337
95#define TOK_TRUE 338
96#define TOK_TYPE_IDENTIFIER 339
97#define TOK_UNIQUE 340
98#define TOK_UNIVERSAL 341
99#define TOK_UniversalString 342
100#define TOK_UTCTime 343
101#define TOK_UTF8String 344
102#define TOK_VideotexString 345
103#define TOK_VisibleString 346
104#define TOK_WITH 347
105#define TOK_UNION 348
106#define TOK_INTERSECTION 349
107#define TOK_EXCEPT 350
108#define TOK_TwoDots 351
109#define TOK_ThreeDots 352
110#define TOK_tag 353
Lev Walkinf15320b2004-06-03 03:38:44 +0000111
112#line 1 "asn1p_y.y"
113
114
115#include <stdlib.h>
116#include <stdio.h>
117#include <string.h>
118#include <errno.h>
119#include <assert.h>
120
121#include "asn1parser.h"
122
123#define YYPARSE_PARAM param
124#define YYERROR_VERBOSE
125
126int yylex(void);
127int yyerror(const char *msg);
128void asn1p_lexer_hack_push_opaque_state(void);
129void asn1p_lexer_hack_enable_with_syntax(void);
130#define yylineno asn1p_lineno
131extern int asn1p_lineno;
132
133
134static asn1p_value_t *
135 _convert_bitstring2binary(char *str, int base);
136
137#define checkmem(ptr) do { \
138 if(!(ptr)) \
139 return yyerror("Memory failure"); \
140 } while(0)
141
142#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
143 if(arg1->type != constr_type) { \
144 int __ret; \
145 root = asn1p_constraint_new(yylineno); \
146 checkmem(root); \
147 root->type = constr_type; \
148 __ret = asn1p_constraint_insert(root, \
149 arg1); \
150 checkmem(__ret == 0); \
151 } else { \
152 root = arg1; \
153 } \
154 if(arg2) { \
155 int __ret \
156 = asn1p_constraint_insert(root, arg2); \
157 checkmem(__ret == 0); \
158 } \
159 } while(0)
160
161
162#line 57 "asn1p_y.y"
163typedef union {
164 asn1p_t *a_grammar;
165 asn1p_module_flags_e a_module_flags;
166 asn1p_module_t *a_module;
167 asn1p_expr_type_e a_type; /* ASN.1 Type */
168 asn1p_expr_t *a_expr; /* Constructed collection */
169 asn1p_constraint_t *a_constr; /* Constraint */
170 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
171 asn1p_xports_t *a_xports; /* IMports/EXports */
172 asn1p_oid_t *a_oid; /* Object Identifier */
173 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
174 struct asn1p_type_tag_s a_tag; /* A tag */
175 asn1p_ref_t *a_ref; /* Reference to custom type */
176 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
177 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
178 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
179 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
180 struct asn1p_param_s a_parg; /* A parameter argument */
181 asn1p_paramlist_t *a_plist; /* A pargs list */
182 enum asn1p_expr_marker_e a_marker; /* OPTIONAL/DEFAULT */
183 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
184 asn1_integer_t a_int;
185 char *tv_str;
186 struct {
187 char *buf;
188 int len;
189 } tv_opaque;
190 struct {
191 char *name;
192 struct asn1p_type_tag_s tag;
193 } tv_nametag;
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000194} YYSTYPE;
195#include <stdio.h>
196
197#ifndef __cplusplus
198#ifndef __STDC__
199#define const
200#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000201#endif
202
203
204
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000205#define YYFINAL 375
206#define YYFLAG -32768
207#define YYNTBASE 113
Lev Walkinf15320b2004-06-03 03:38:44 +0000208
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000209#define YYTRANSLATE(x) ((unsigned)(x) <= 353 ? yytranslate[x] : 211)
Lev Walkinf15320b2004-06-03 03:38:44 +0000210
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000211static const char yytranslate[] = { 0,
212 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
213 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
214 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
215 2, 2, 109, 2, 2, 2, 2, 2, 2, 104,
216 105, 2, 2, 107, 2, 110, 2, 2, 2, 2,
217 2, 2, 2, 2, 2, 2, 2, 108, 106, 111,
218 2, 2, 2, 112, 2, 2, 2, 2, 2, 2,
219 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
220 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
221 2, 2, 2, 96, 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, 102, 94, 103, 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, 2, 2, 2, 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, 1, 3, 4, 5, 6,
238 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
239 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
240 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
241 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
242 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
243 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
244 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
245 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
246 87, 88, 89, 90, 91, 92, 93, 95, 97, 98,
247 99, 100, 101
248};
Lev Walkinf15320b2004-06-03 03:38:44 +0000249
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000250#if YYDEBUG != 0
251static const short yyprhs[] = { 0,
252 0, 2, 4, 7, 16, 17, 19, 23, 26, 28,
253 31, 33, 38, 40, 41, 43, 45, 48, 51, 54,
254 57, 60, 61, 63, 65, 68, 70, 72, 74, 76,
255 78, 80, 84, 87, 89, 92, 97, 99, 103, 105,
256 107, 111, 115, 118, 120, 124, 126, 128, 135, 137,
257 139, 140, 142, 147, 152, 156, 163, 165, 169, 171,
258 175, 179, 181, 185, 187, 189, 191, 195, 201, 202,
259 204, 206, 210, 213, 217, 222, 223, 225, 226, 233,
260 235, 238, 240, 242, 245, 247, 251, 253, 257, 261,
261 263, 265, 267, 272, 274, 278, 280, 284, 288, 290,
262 294, 296, 300, 302, 304, 306, 308, 313, 314, 318,
263 320, 322, 324, 326, 328, 330, 334, 336, 339, 341,
264 343, 345, 347, 350, 353, 355, 357, 360, 363, 365,
265 367, 369, 371, 374, 376, 379, 381, 383, 385, 387,
266 389, 391, 393, 395, 397, 399, 401, 403, 405, 407,
267 412, 417, 422, 427, 432, 434, 439, 440, 442, 444,
268 446, 448, 450, 452, 457, 459, 462, 466, 468, 472,
269 478, 480, 484, 486, 488, 492, 494, 498, 500, 504,
270 506, 510, 515, 517, 519, 521, 524, 527, 531, 533,
271 535, 537, 539, 541, 543, 545, 547, 549, 555, 557,
272 561, 563, 567, 568, 570, 572, 574, 576, 578, 580,
273 584, 589, 591, 595, 598, 602, 604, 608, 609, 611,
274 613, 616, 618, 620, 621, 625, 628, 632, 634, 638,
275 640, 645, 650, 652, 654, 656, 658, 659, 661, 663,
276 666, 669, 671, 673, 675, 677, 679
277};
Lev Walkinf15320b2004-06-03 03:38:44 +0000278
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000279static const short yyrhs[] = { 114,
280 0, 115, 0, 114, 115, 0, 207, 116, 34, 120,
281 3, 21, 123, 38, 0, 0, 117, 0, 102, 118,
282 103, 0, 102, 103, 0, 119, 0, 118, 119, 0,
283 209, 0, 209, 104, 9, 105, 0, 9, 0, 0,
284 121, 0, 122, 0, 121, 122, 0, 40, 82, 0,
285 51, 82, 0, 20, 82, 0, 42, 52, 0, 0,
286 124, 0, 125, 0, 124, 125, 0, 126, 0, 131,
287 0, 137, 0, 161, 0, 134, 0, 169, 0, 53,
288 127, 106, 0, 53, 45, 0, 128, 0, 127, 128,
289 0, 129, 45, 207, 116, 0, 130, 0, 129, 107,
290 130, 0, 207, 0, 209, 0, 41, 132, 106, 0,
291 41, 17, 106, 0, 41, 106, 0, 133, 0, 132,
292 107, 133, 0, 207, 0, 209, 0, 207, 135, 3,
293 102, 136, 103, 0, 156, 0, 166, 0, 0, 177,
294 0, 207, 3, 205, 85, 0, 207, 3, 205, 153,
295 0, 207, 3, 143, 0, 207, 102, 138, 103, 3,
296 153, 0, 139, 0, 138, 107, 139, 0, 207, 0,
297 207, 108, 209, 0, 166, 108, 209, 0, 141, 0,
298 140, 107, 141, 0, 155, 0, 209, 0, 152, 0,
299 142, 107, 152, 0, 28, 102, 145, 103, 147, 0,
300 0, 86, 0, 146, 0, 145, 107, 146, 0, 159,
301 197, 0, 159, 153, 144, 0, 159, 159, 197, 144,
302 0, 0, 148, 0, 0, 93, 80, 102, 149, 150,
303 103, 0, 151, 0, 150, 151, 0, 4, 0, 159,
304 0, 210, 153, 0, 154, 0, 155, 171, 197, 0,
305 100, 0, 100, 109, 164, 0, 100, 109, 204, 0,
306 168, 0, 169, 0, 170, 0, 207, 102, 140, 103,
307 0, 156, 0, 55, 66, 156, 0, 11, 0, 11,
308 110, 207, 0, 11, 110, 209, 0, 208, 0, 208,
309 110, 157, 0, 158, 0, 157, 110, 158, 0, 160,
310 0, 160, 0, 13, 0, 14, 0, 209, 135, 3,
311 162, 0, 0, 102, 163, 165, 0, 5, 0, 7,
312 0, 6, 0, 204, 0, 164, 0, 209, 0, 207,
313 110, 209, 0, 4, 0, 165, 4, 0, 24, 0,
314 61, 0, 74, 0, 167, 0, 65, 79, 0, 63,
315 50, 0, 75, 0, 43, 0, 36, 69, 0, 26,
316 79, 0, 89, 0, 46, 0, 56, 0, 39, 0,
317 22, 79, 0, 166, 0, 167, 201, 0, 23, 0,
318 47, 0, 48, 0, 49, 0, 57, 0, 62, 0,
319 72, 0, 81, 0, 83, 0, 88, 0, 90, 0,
320 91, 0, 92, 0, 64, 0, 27, 102, 142, 103,
321 0, 76, 102, 142, 103, 0, 77, 102, 142, 103,
322 0, 76, 171, 66, 155, 0, 77, 171, 66, 155,
323 0, 18, 0, 18, 35, 25, 209, 0, 0, 175,
324 0, 94, 0, 95, 0, 96, 0, 97, 0, 98,
325 0, 78, 104, 177, 105, 0, 176, 0, 175, 176,
326 0, 104, 177, 105, 0, 178, 0, 178, 107, 100,
327 0, 178, 107, 100, 107, 178, 0, 100, 0, 100,
328 107, 178, 0, 179, 0, 180, 0, 179, 172, 180,
329 0, 181, 0, 180, 173, 181, 0, 182, 0, 181,
330 174, 182, 0, 185, 0, 185, 183, 185, 0, 184,
331 104, 177, 105, 0, 191, 0, 186, 0, 99, 0,
332 99, 111, 0, 111, 99, 0, 111, 99, 111, 0,
333 78, 0, 45, 0, 204, 0, 209, 0, 6, 0,
334 59, 0, 58, 0, 44, 0, 84, 0, 93, 30,
335 102, 187, 103, 0, 188, 0, 187, 107, 188, 0,
336 100, 0, 209, 171, 189, 0, 0, 190, 0, 71,
337 0, 15, 0, 67, 0, 192, 0, 193, 0, 102,
338 207, 103, 0, 192, 102, 194, 103, 0, 195, 0,
339 194, 107, 195, 0, 112, 196, 0, 112, 110, 196,
340 0, 209, 0, 196, 110, 209, 0, 0, 198, 0,
341 67, 0, 33, 199, 0, 185, 0, 166, 0, 0,
342 102, 200, 165, 0, 102, 103, 0, 102, 202, 103,
343 0, 203, 0, 202, 107, 203, 0, 209, 0, 209,
344 104, 204, 105, 0, 209, 104, 164, 105, 0, 204,
345 0, 100, 0, 9, 0, 10, 0, 0, 206, 0,
346 101, 0, 101, 51, 0, 101, 40, 0, 11, 0,
347 12, 0, 12, 0, 8, 0, 209, 0, 209, 206,
348 0
349};
Lev Walkinf15320b2004-06-03 03:38:44 +0000350
351#endif
352
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000353#if YYDEBUG != 0
354static const short yyrline[] = { 0,
355 297, 303, 309, 325, 350, 352, 355, 359, 364, 371,
356 379, 384, 388, 397, 399, 407, 411, 419, 423, 426,
357 429, 437, 439, 448, 452, 478, 482, 491, 498, 511,
358 522, 535, 542, 547, 553, 559, 568, 574, 580, 587,
359 595, 599, 602, 609, 615, 621, 628, 637, 647, 655,
360 663, 665, 677, 689, 696, 712, 722, 732, 742, 747,
361 754, 764, 770, 776, 780, 792, 798, 804, 814, 816,
362 819, 827, 833, 842, 847, 864, 866, 871, 875, 880,
363 885, 891, 895, 920, 927, 932, 940, 949, 958, 969,
364 973, 979, 987, 1011, 1018, 1032, 1041, 1051, 1061, 1069,
365 1090, 1099, 1108, 1109, 1111, 1118, 1130, 1140, 1142, 1147,
366 1151, 1155, 1159, 1162, 1167, 1179, 1195, 1206, 1220, 1222,
367 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232,
368 1238, 1240, 1241, 1244, 1251, 1263, 1265, 1269, 1273, 1274,
369 1275, 1276, 1277, 1281, 1282, 1283, 1284, 1288, 1289, 1292,
370 1299, 1305, 1311, 1319, 1327, 1333, 1349, 1351, 1354, 1354,
371 1355, 1355, 1356, 1358, 1371, 1374, 1379, 1385, 1389, 1396,
372 1405, 1410, 1419, 1421, 1423, 1428, 1430, 1436, 1438, 1443,
373 1450, 1457, 1465, 1468, 1473, 1475, 1476, 1477, 1480, 1484,
374 1489, 1493, 1504, 1508, 1513, 1518, 1523, 1530, 1536, 1540,
375 1545, 1551, 1563, 1565, 1568, 1572, 1575, 1580, 1584, 1592,
376 1607, 1613, 1620, 1633, 1645, 1660, 1664, 1681, 1683, 1686,
377 1690, 1696, 1699, 1701, 1701, 1721, 1726, 1731, 1737, 1743,
378 1751, 1759, 1767, 1774, 1784, 1789, 1819, 1821, 1824, 1829,
379 1833, 1839, 1844, 1850, 1857, 1864, 1869
380};
381#endif
382
383
384#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
385
386static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
387"TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number",
388"TOK_number_negative","TOK_typereference","TOK_objectclassreference","TOK_typefieldreference",
389"TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY",
390"TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN",
391"TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS",
392"TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED",
393"TOK_EMBEDDED","TOK_ENCODED","TOK_END","TOK_ENUMERATED","TOK_EXPLICIT","TOK_EXPORTS",
394"TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE","TOK_FROM","TOK_GeneralizedTime",
395"TOK_GeneralString","TOK_GraphicString","TOK_IA5String","TOK_IDENTIFIER","TOK_IMPLICIT",
396"TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE","TOK_INTEGER","TOK_ISO646String",
397"TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY","TOK_NULL","TOK_NumericString","TOK_OBJECT",
398"TOK_ObjectDescriptor","TOK_OCTET","TOK_OF","TOK_OPTIONAL","TOK_PATTERN","TOK_PDV",
399"TOK_PLUS_INFINITY","TOK_PRESENT","TOK_PrintableString","TOK_PRIVATE","TOK_REAL",
400"TOK_RELATIVE_OID","TOK_SEQUENCE","TOK_SET","TOK_SIZE","TOK_STRING","TOK_SYNTAX",
401"TOK_T61String","TOK_TAGS","TOK_TeletexString","TOK_TRUE","TOK_TYPE_IDENTIFIER",
402"TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString","TOK_UTCTime","TOK_UTF8String",
403"TOK_VideotexString","TOK_VisibleString","TOK_WITH","'|'","TOK_UNION","'^'",
404"TOK_INTERSECTION","TOK_EXCEPT","TOK_TwoDots","TOK_ThreeDots","TOK_tag","'{'",
405"'}'","'('","')'","';'","','","':'","'!'","'.'","'<'","'@'","ParsedGrammar",
406"ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
407"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
408"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
409"ModuleSpecificationBody","ModuleSpecificationElement","ImportsDefinition","ImportsBundleSet",
410"ImportsBundle","ImportsList","ImportsElement","ExportsDefinition","ExportsBody",
411"ExportsElement","ValueSetDefinition","DefinedTypeRef","optValueSetBody","DataTypeReference",
412"ParameterArgumentList","ParameterArgumentName","ActualParameterList","ActualParameter",
413"ConstructedDataTypeDefinition","ClassDeclaration","optUnique","ClassFieldList",
414"ClassField","optWithSyntax","WithSyntax","@1","WithSyntaxFormat","WithSyntaxFormatToken",
415"DataTypeMember","ConstrainedTypeDeclaration","ExtensionAndException","TypeDeclaration",
416"ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement",
417"ClassFieldIdentifier","ClassFieldName","ValueDefinition","InlineOrDefinedValue",
418"@2","DefinedValue","Opaque","BasicTypeId","BasicTypeId_UniverationCompatible",
419"BasicType","BasicString","ConstructedType","optConstraints","Union","Intersection",
420"Except","Constraints","SingleConstraint","ConstraintElementSet","ConstraintElement",
421"ConstraintElementUnion","ConstraintElementIntersection","ConstraintElementException",
422"ConstraintSubtypeElement","ConstraintRangeSpec","ConstraintSpec","ConstraintValue",
423"WithComponents","WithComponentsList","WithComponentsElement","optPresenceConstraint",
424"PresenceConstraint","TableConstraint","SimpleTableConstraint","ComponentRelationConstraint",
425"AtNotationList","AtNotationElement","ComponentIdList","optMarker","Marker",
426"DefaultValue","@3","UniverationDefinition","UniverationList","UniverationElement",
427"SignedNumber","optTag","Tag","TypeRefName","ObjectClassReference","Identifier",
428"TaggedIdentifier", NULL
429};
430#endif
431
432static const short yyr1[] = { 0,
433 113, 114, 114, 115, 116, 116, 117, 117, 118, 118,
434 119, 119, 119, 120, 120, 121, 121, 122, 122, 122,
435 122, 123, 123, 124, 124, 125, 125, 125, 125, 125,
436 125, 126, 126, 127, 127, 128, 129, 129, 130, 130,
437 131, 131, 131, 132, 132, 133, 133, 134, 135, 135,
438 136, 136, 137, 137, 137, 137, 138, 138, 139, 139,
439 139, 140, 140, 141, 141, 142, 142, 143, 144, 144,
440 145, 145, 146, 146, 146, 147, 147, 149, 148, 150,
441 150, 151, 151, 152, 152, 153, 154, 154, 154, 155,
442 155, 155, 155, 155, 155, 156, 156, 156, 156, 156,
443 157, 157, 158, 159, 160, 160, 161, 163, 162, 162,
444 162, 162, 162, 162, 164, 164, 165, 165, 166, 166,
445 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
446 167, 167, 167, 168, 168, 169, 169, 169, 169, 169,
447 169, 169, 169, 169, 169, 169, 169, 169, 169, 170,
448 170, 170, 170, 170, 170, 170, 171, 171, 172, 172,
449 173, 173, 174, 175, 175, 175, 176, 177, 177, 177,
450 177, 177, 178, 179, 179, 180, 180, 181, 181, 182,
451 182, 182, 182, 182, 183, 183, 183, 183, 184, 184,
452 185, 185, 185, 185, 185, 185, 185, 186, 187, 187,
453 188, 188, 189, 189, 190, 190, 190, 191, 191, 192,
454 193, 194, 194, 195, 195, 196, 196, 197, 197, 198,
455 198, 199, 199, 200, 199, 201, 201, 202, 202, 203,
456 203, 203, 203, 203, 204, 204, 205, 205, 206, 206,
457 206, 207, 207, 208, 209, 210, 210
458};
459
460static const short yyr2[] = { 0,
461 1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
462 1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
463 2, 0, 1, 1, 2, 1, 1, 1, 1, 1,
464 1, 3, 2, 1, 2, 4, 1, 3, 1, 1,
465 3, 3, 2, 1, 3, 1, 1, 6, 1, 1,
466 0, 1, 4, 4, 3, 6, 1, 3, 1, 3,
467 3, 1, 3, 1, 1, 1, 3, 5, 0, 1,
468 1, 3, 2, 3, 4, 0, 1, 0, 6, 1,
469 2, 1, 1, 2, 1, 3, 1, 3, 3, 1,
470 1, 1, 4, 1, 3, 1, 3, 3, 1, 3,
471 1, 3, 1, 1, 1, 1, 4, 0, 3, 1,
472 1, 1, 1, 1, 1, 3, 1, 2, 1, 1,
473 1, 1, 2, 2, 1, 1, 2, 2, 1, 1,
474 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
476 4, 4, 4, 4, 1, 4, 0, 1, 1, 1,
477 1, 1, 1, 4, 1, 2, 3, 1, 3, 5,
478 1, 3, 1, 1, 3, 1, 3, 1, 3, 1,
479 3, 4, 1, 1, 1, 2, 2, 3, 1, 1,
480 1, 1, 1, 1, 1, 1, 1, 5, 1, 3,
481 1, 3, 0, 1, 1, 1, 1, 1, 1, 3,
482 4, 1, 3, 2, 3, 1, 3, 0, 1, 1,
483 2, 1, 1, 0, 3, 2, 3, 1, 3, 1,
484 4, 4, 1, 1, 1, 1, 0, 1, 1, 2,
485 2, 1, 1, 1, 1, 1, 2
486};
487
488static const short yydefact[] = { 0,
489 242, 243, 1, 2, 5, 3, 0, 0, 6, 245,
490 13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
491 0, 0, 0, 0, 15, 16, 0, 20, 18, 21,
492 19, 0, 17, 12, 22, 136, 0, 137, 138, 139,
493 0, 140, 141, 149, 142, 143, 144, 145, 146, 147,
494 148, 0, 23, 24, 26, 27, 30, 28, 29, 31,
495 0, 0, 0, 43, 0, 44, 46, 47, 33, 0,
496 34, 0, 37, 39, 40, 4, 25, 237, 96, 244,
497 0, 119, 0, 0, 132, 126, 130, 131, 120, 0,
498 0, 121, 125, 129, 0, 0, 49, 50, 122, 99,
499 0, 42, 41, 0, 32, 35, 0, 0, 0, 239,
500 55, 0, 238, 0, 133, 128, 127, 124, 123, 0,
501 57, 0, 59, 0, 0, 0, 45, 5, 38, 0,
502 241, 240, 96, 244, 155, 0, 0, 157, 157, 53,
503 54, 157, 94, 134, 122, 90, 91, 92, 0, 97,
504 98, 0, 0, 0, 0, 51, 105, 106, 100, 101,
505 103, 110, 112, 111, 235, 236, 108, 107, 114, 113,
506 0, 115, 36, 0, 71, 218, 104, 0, 0, 0,
507 0, 0, 0, 0, 158, 165, 0, 0, 218, 0,
508 135, 0, 0, 58, 61, 60, 193, 196, 190, 195,
509 194, 189, 197, 0, 171, 0, 0, 52, 168, 173,
510 174, 176, 178, 0, 180, 184, 183, 208, 209, 191,
511 192, 0, 0, 0, 76, 0, 0, 220, 69, 218,
512 73, 219, 0, 87, 0, 66, 85, 246, 0, 95,
513 0, 0, 0, 0, 166, 0, 0, 86, 234, 226,
514 0, 228, 233, 230, 0, 62, 64, 65, 56, 0,
515 0, 0, 48, 0, 159, 160, 0, 161, 162, 0,
516 163, 0, 0, 185, 0, 0, 0, 102, 117, 109,
517 116, 0, 68, 77, 72, 224, 223, 222, 221, 70,
518 74, 69, 156, 0, 150, 0, 247, 84, 0, 151,
519 167, 153, 152, 154, 227, 0, 0, 93, 0, 0,
520 172, 210, 169, 175, 177, 179, 0, 186, 187, 181,
521 0, 0, 212, 118, 0, 0, 75, 88, 89, 67,
522 164, 229, 0, 0, 63, 201, 0, 199, 157, 0,
523 182, 188, 0, 214, 216, 211, 0, 78, 225, 232,
524 231, 198, 0, 203, 170, 215, 0, 213, 0, 200,
525 206, 207, 205, 202, 204, 217, 82, 0, 80, 83,
526 79, 81, 0, 0, 0
527};
528
529static const short yydefgoto[] = { 373,
530 3, 4, 8, 9, 13, 14, 24, 25, 26, 52,
531 53, 54, 55, 70, 71, 72, 73, 56, 65, 66,
532 57, 96, 207, 58, 120, 121, 255, 256, 235, 111,
533 291, 174, 175, 283, 284, 359, 368, 369, 236, 141,
534 237, 142, 143, 159, 160, 176, 177, 59, 168, 223,
535 169, 280, 144, 145, 146, 147, 148, 184, 267, 270,
536 272, 185, 186, 208, 209, 210, 211, 212, 213, 276,
537 214, 215, 216, 337, 338, 364, 365, 217, 218, 219,
538 322, 323, 344, 231, 232, 289, 326, 191, 251, 252,
539 220, 112, 113, 149, 100, 221, 239
540};
541
542static const short yypact[] = { 81,
543-32768,-32768, 81,-32768, -45,-32768, 23, 70,-32768,-32768,
544-32768,-32768, 47,-32768, 31, 190,-32768,-32768, 132, 61,
545 69, 108, 86, 176, 190,-32768, 76,-32768,-32768,-32768,
546-32768, 166,-32768,-32768, 442,-32768, 32,-32768,-32768,-32768,
547 121,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
548-32768, 168, 442,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
549 179, 732, 103,-32768, 52,-32768,-32768,-32768,-32768, 39,
550-32768, 16,-32768,-32768,-32768,-32768,-32768, -11, 111,-32768,
551 150,-32768, 152, 142,-32768,-32768,-32768,-32768,-32768, 184,
552 159,-32768,-32768,-32768, 748, 240,-32768,-32768,-32768, 135,
553 243,-32768,-32768, 141,-32768,-32768, 81, 141, 145, 60,
554-32768, 599,-32768, 141,-32768,-32768,-32768,-32768,-32768, -1,
555-32768, 143, 144, 147, 206, 68,-32768, -45,-32768, 206,
556-32768,-32768, -42, 148, 221, 161, 198, 40, 53,-32768,
557-32768, -37,-32768,-32768, 163,-32768,-32768,-32768, 164,-32768,
558-32768, 264, 748, 261, 261, 155,-32768,-32768, 160,-32768,
559-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
560 162,-32768,-32768, 64,-32768, 524,-32768, 246, 21, 212,
561 169, 21, 155, 208, 171,-32768, 21, 210, 2, 17,
562-32768, 383, 674,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
563-32768,-32768,-32768, 247, 172, 81, 175,-32768, 173, 133,
564 140, 185,-32768, 178, 35,-32768,-32768, 182,-32768,-32768,
565-32768, 206, 281, 261, 193, 206, 301,-32768, 202, 2,
566-32768,-32768, 261, 181, 66,-32768,-32768, 191, 674,-32768,
567 155, 71, 186, 674,-32768, 89, 674,-32768,-32768,-32768,
568 90,-32768,-32768, 189, 91,-32768,-32768,-32768,-32768, 192,
569 309, 194,-32768, 196,-32768,-32768, 309,-32768,-32768, 309,
570-32768, 309, 155, 187, 205, 78, 200,-32768,-32768, 297,
571-32768, 225,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
572-32768, 202,-32768, 250,-32768, 21,-32768,-32768, 201,-32768,
573-32768,-32768,-32768,-32768,-32768, 56, 250,-32768, 383, 25,
574-32768,-32768, 209, 140, 185,-32768, 215,-32768, 211,-32768,
575 6, 101,-32768,-32768, 219, 281,-32768,-32768,-32768,-32768,
576-32768,-32768, 223, 224,-32768,-32768, 109,-32768, -37, 309,
577-32768,-32768, 261, 203,-32768,-32768, 200,-32768, 297,-32768,
578-32768,-32768, 25, 24,-32768, 203, 261,-32768, 126,-32768,
579-32768,-32768,-32768,-32768,-32768,-32768,-32768, 9,-32768,-32768,
580-32768,-32768, 324, 326,-32768
581};
582
583static const short yypgoto[] = {-32768,
584-32768, 327, 204,-32768,-32768, 318,-32768,-32768, 308,-32768,
585-32768, 282,-32768,-32768, 268,-32768, 226,-32768,-32768, 235,
586-32768, 279,-32768,-32768,-32768, 195,-32768, 33, -129,-32768,
587 51,-32768, 123,-32768,-32768,-32768,-32768, -17, 59, -156,
588-32768, -185, -52,-32768, 130, -173, -109,-32768,-32768,-32768,
589 -209, 30, -50, -43,-32768, 46,-32768, -137,-32768,-32768,
590-32768,-32768, 180, -159, -246,-32768, 94, 88, 97,-32768,
591-32768, -206,-32768,-32768, 10,-32768,-32768,-32768,-32768,-32768,
592-32768, 26, 27, -141,-32768,-32768,-32768,-32768,-32768, 65,
593 -118,-32768, 134, 1,-32768, -7,-32768
594};
595
596
597#define YYLAST 837
598
599
600static const short yytable[] = { 15,
601 5, 188, 230, 5, 189, 15, 257, 170, 97, 97,
602 98, 98, 367, 10, 311, 161, 109, 99, 99, 229,
603 288, 157, 158, 243, 10, 165, 166, 62, 10, 68,
604 10, 11, 10, 75, 227, 61, 259, 67, 361, 10,
605 181, 74, 1, 2, 122, 62, 10, 248, 63, 1,
606 2, 99, 242, 61, 10, 11, 7, 246, 302, -242,
607 107, 304, 75, 10, 165, 166, 183, 114, 228, 320,
608 74, 253, 162, 163, 164, 10, 165, 166, 1, 2,
609 60, 299, 298, 197, 328, 10, 165, 166, 292, 110,
610 362, 1, 2, 355, 363, 123, 68, 333, 60, 131,
611 75, 152, 122, 16, 67, 153, 151, 128, 74, 99,
612 132, 371, 161, 317, 150, 343, 249, 181, 172, 250,
613 234, 198, 108, 257, 336, 12, 171, 240, 10, 367,
614 181, 1, 2, 274, 19, 200, 201, 64, 157, 158,
615 27, 182, 28, 183, 105, 275, 195, 196, 10, 17,
616 29, 1, 2, 123, 187, 249, 183, 103, 104, 30,
617 197, 203, 10, 165, 166, 69, 225, 31, 295, 167,
618 226, 238, 296, 300, 238, 329, 287, 296, 32, 238,
619 34, 78, 254, 99, 258, 370, 35, 253, 334, 79,
620 80, 303, 305, 308, 370, 296, 306, 309, 198, 199,
621 81, 354, 82, 346, 83, 76, 262, 347, 102, 20,
622 117, 352, 200, 201, 84, 353, 281, 85, 157, 158,
623 114, 86, 79, 80, 87, 293, 265, 266, 115, 21,
624 116, 22, 202, 118, 88, 268, 269, 119, 203, 89,
625 23, 90, 124, 91, 125, 126, 130, 204, 156, -243,
626 154, 155, 92, 93, 205, 178, 206, 10, 165, 166,
627 1, 2, 179, 180, 190, 192, 193, 94, 10, 222,
628 233, 224, 241, 244, 183, 247, 260, 263, 261, 264,
629 95, 273, 271, 277, 279, 282, 172, 290, 238, 294,
630 301, 110, 307, 310, 171, 313, 312, 318, 254, 172,
631 324, 258, 339, 319, 325, 331, 197, 171, 10, 165,
632 166, 321, 357, 345, 197, 340, 10, 165, 166, 341,
633 348, 342, 81, 374, 82, 375, 83, 350, 351, 6,
634 18, 173, 33, 129, 77, 345, 84, 106, 127, 85,
635 101, 335, 327, 86, 198, 339, 87, 194, 285, 366,
636 372, 278, 198, 199, 330, 349, 88, 315, 200, 201,
637 314, 89, 360, 90, 245, 91, 200, 201, 316, 356,
638 332, 297, 358, 0, 92, 93, 0, 0, 0, 0,
639 0, 0, 0, 0, 203, 0, 202, 0, 0, 94,
640 10, 0, 203, 133, 134, 0, 0, 0, 0, 0,
641 135, 204, 286, 0, 81, 36, 82, 0, 83, 136,
642 206, 0, 0, 0, 0, 0, 0, 0, 84, 0,
643 0, 85, 0, 0, 0, 86, 0, 0, 87, 38,
644 39, 40, 0, 0, 0, 0, 0, 137, 88, 42,
645 0, 0, 0, 89, 43, 90, 44, 91, 0, 10,
646 0, 0, 1, 2, 45, 0, 92, 93, 138, 139,
647 0, 0, 0, 46, 36, 47, 0, 0, 0, 0,
648 48, 94, 49, 50, 51, 0, 0, 0, 0, 0,
649 0, 0, 37, 0, 0, 0, 0, 0, 38, 39,
650 40, 0, 0, 0, 41, 0, 0, 0, 42, 0,
651 0, 0, 0, 43, 0, 44, 0, 0, 0, 0,
652 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
653 0, 0, 46, 0, 47, 0, 0, 0, 0, 48,
654 0, 49, 50, 51, 133, 134, 157, 158, 0, 0,
655 0, 135, 0, 0, 0, 81, 36, 82, 0, 83,
656 136, 0, 0, 0, 0, 0, 227, 0, 0, 84,
657 0, 0, 85, 0, 0, 0, 86, 0, 0, 87,
658 38, 39, 40, 0, 0, 0, 0, 0, 137, 88,
659 42, 0, 0, 0, 89, 43, 90, 44, 91, 0,
660 228, 0, 0, 0, 0, 45, 0, 92, 93, 138,
661 139, 0, 0, 0, 46, 0, 47, 0, 0, 133,
662 134, 48, 94, 49, 50, 51, 135, 0, 0, 0,
663 81, 36, 82, 0, 83, 136, 0, 0, 0, 0,
664 0, 0, 0, 0, 84, 0, 0, 85, 0, 0,
665 0, 86, 0, 0, 87, 38, 39, 40, 0, 0,
666 0, 0, 0, 137, 88, 42, 0, 0, 0, 89,
667 43, 90, 44, 91, 0, 0, 0, 0, 0, 0,
668 45, 0, 92, 93, 138, 139, 0, 0, 0, 46,
669 0, 47, 0, 140, 133, 134, 48, 94, 49, 50,
670 51, 135, 0, 0, 0, 81, 36, 82, 0, 83,
671 136, 0, 0, 0, 0, 0, 0, 0, 0, 84,
672 0, 0, 85, 0, 0, 0, 86, 0, 0, 87,
673 38, 39, 40, 0, 0, 0, 0, 0, 137, 88,
674 42, 0, 0, 0, 89, 43, 90, 44, 91, 0,
675 0, 0, 79, 80, 0, 45, 0, 92, 93, 138,
676 139, 0, 0, 81, 46, 82, 47, 83, 1, 2,
677 0, 48, 94, 49, 50, 51, 0, 84, 0, 81,
678 85, 82, 0, 83, 86, 0, 0, 87, 0, 0,
679 0, 0, 0, 84, 0, 0, 85, 88, 0, 0,
680 86, 0, 89, 87, 90, 0, 91, 0, 0, 0,
681 0, 0, 0, 88, 0, 92, 93, 0, 89, 0,
682 90, 0, 91, 0, 0, 0, 0, 0, 0, 0,
683 94, 92, 93, 0, 0, 0, 0, 0, 0, 0,
684 0, 0, 0, 0, 0, 0, 94
685};
686
687static const short yycheck[] = { 7,
688 0, 139, 176, 3, 142, 13, 192, 126, 61, 62,
689 61, 62, 4, 8, 261, 125, 28, 61, 62, 176,
690 227, 13, 14, 183, 8, 9, 10, 35, 8, 37,
691 8, 9, 8, 41, 33, 35, 193, 37, 15, 8,
692 78, 41, 11, 12, 95, 53, 8, 189, 17, 11,
693 12, 95, 182, 53, 8, 9, 102, 187, 244, 102,
694 45, 247, 70, 8, 9, 10, 104, 110, 67, 276,
695 70, 190, 5, 6, 7, 8, 9, 10, 11, 12,
696 35, 241, 239, 6, 294, 8, 9, 10, 230, 101,
697 67, 11, 12, 340, 71, 95, 104, 307, 53, 40,
698 108, 103, 153, 34, 104, 107, 114, 107, 108, 153,
699 51, 103, 222, 273, 114, 110, 100, 78, 126, 103,
700 100, 44, 107, 309, 100, 103, 126, 180, 8, 4,
701 78, 11, 12, 99, 104, 58, 59, 106, 13, 14,
702 9, 102, 82, 104, 106, 111, 154, 155, 8, 103,
703 82, 11, 12, 153, 102, 100, 104, 106, 107, 52,
704 6, 84, 8, 9, 10, 45, 103, 82, 103, 102,
705 107, 179, 107, 103, 182, 294, 227, 107, 3, 187,
706 105, 3, 190, 227, 192, 359, 21, 306, 307, 11,
707 12, 103, 103, 103, 368, 107, 107, 107, 44, 45,
708 22, 339, 24, 103, 26, 38, 206, 107, 106, 20,
709 69, 103, 58, 59, 36, 107, 224, 39, 13, 14,
710 110, 43, 11, 12, 46, 233, 94, 95, 79, 40,
711 79, 42, 78, 50, 56, 96, 97, 79, 84, 61,
712 51, 63, 3, 65, 110, 3, 102, 93, 102, 102,
713 108, 108, 74, 75, 100, 35, 102, 8, 9, 10,
714 11, 12, 102, 66, 102, 102, 3, 89, 8, 110,
715 25, 110, 104, 66, 104, 66, 30, 103, 107, 107,
716 102, 104, 98, 102, 4, 93, 294, 86, 296, 109,
717 105, 101, 104, 102, 294, 100, 103, 111, 306, 307,
718 4, 309, 310, 99, 80, 105, 6, 307, 8, 9,
719 10, 112, 110, 321, 6, 107, 8, 9, 10, 105,
720 102, 111, 22, 0, 24, 0, 26, 105, 105, 3,
721 13, 128, 25, 108, 53, 343, 36, 70, 104, 39,
722 62, 309, 292, 43, 44, 353, 46, 153, 226, 357,
723 368, 222, 44, 45, 296, 326, 56, 270, 58, 59,
724 267, 61, 353, 63, 185, 65, 58, 59, 272, 343,
725 306, 238, 347, -1, 74, 75, -1, -1, -1, -1,
726 -1, -1, -1, -1, 84, -1, 78, -1, -1, 89,
727 8, -1, 84, 11, 12, -1, -1, -1, -1, -1,
728 18, 93, 102, -1, 22, 23, 24, -1, 26, 27,
729 102, -1, -1, -1, -1, -1, -1, -1, 36, -1,
730 -1, 39, -1, -1, -1, 43, -1, -1, 46, 47,
731 48, 49, -1, -1, -1, -1, -1, 55, 56, 57,
732 -1, -1, -1, 61, 62, 63, 64, 65, -1, 8,
733 -1, -1, 11, 12, 72, -1, 74, 75, 76, 77,
734 -1, -1, -1, 81, 23, 83, -1, -1, -1, -1,
735 88, 89, 90, 91, 92, -1, -1, -1, -1, -1,
736 -1, -1, 41, -1, -1, -1, -1, -1, 47, 48,
737 49, -1, -1, -1, 53, -1, -1, -1, 57, -1,
738 -1, -1, -1, 62, -1, 64, -1, -1, -1, -1,
739 -1, -1, -1, 72, -1, -1, -1, -1, -1, -1,
740 -1, -1, 81, -1, 83, -1, -1, -1, -1, 88,
741 -1, 90, 91, 92, 11, 12, 13, 14, -1, -1,
742 -1, 18, -1, -1, -1, 22, 23, 24, -1, 26,
743 27, -1, -1, -1, -1, -1, 33, -1, -1, 36,
744 -1, -1, 39, -1, -1, -1, 43, -1, -1, 46,
745 47, 48, 49, -1, -1, -1, -1, -1, 55, 56,
746 57, -1, -1, -1, 61, 62, 63, 64, 65, -1,
747 67, -1, -1, -1, -1, 72, -1, 74, 75, 76,
748 77, -1, -1, -1, 81, -1, 83, -1, -1, 11,
749 12, 88, 89, 90, 91, 92, 18, -1, -1, -1,
750 22, 23, 24, -1, 26, 27, -1, -1, -1, -1,
751 -1, -1, -1, -1, 36, -1, -1, 39, -1, -1,
752 -1, 43, -1, -1, 46, 47, 48, 49, -1, -1,
753 -1, -1, -1, 55, 56, 57, -1, -1, -1, 61,
754 62, 63, 64, 65, -1, -1, -1, -1, -1, -1,
755 72, -1, 74, 75, 76, 77, -1, -1, -1, 81,
756 -1, 83, -1, 85, 11, 12, 88, 89, 90, 91,
757 92, 18, -1, -1, -1, 22, 23, 24, -1, 26,
758 27, -1, -1, -1, -1, -1, -1, -1, -1, 36,
759 -1, -1, 39, -1, -1, -1, 43, -1, -1, 46,
760 47, 48, 49, -1, -1, -1, -1, -1, 55, 56,
761 57, -1, -1, -1, 61, 62, 63, 64, 65, -1,
762 -1, -1, 11, 12, -1, 72, -1, 74, 75, 76,
763 77, -1, -1, 22, 81, 24, 83, 26, 11, 12,
764 -1, 88, 89, 90, 91, 92, -1, 36, -1, 22,
765 39, 24, -1, 26, 43, -1, -1, 46, -1, -1,
766 -1, -1, -1, 36, -1, -1, 39, 56, -1, -1,
767 43, -1, 61, 46, 63, -1, 65, -1, -1, -1,
768 -1, -1, -1, 56, -1, 74, 75, -1, 61, -1,
769 63, -1, 65, -1, -1, -1, -1, -1, -1, -1,
770 89, 74, 75, -1, -1, -1, -1, -1, -1, -1,
771 -1, -1, -1, -1, -1, -1, 89
772};
773/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
774#line 3 "/usr/share/bison.simple"
775/* This file comes from bison-1.28. */
776
777/* Skeleton output parser for bison,
778 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
779
780 This program is free software; you can redistribute it and/or modify
781 it under the terms of the GNU General Public License as published by
782 the Free Software Foundation; either version 2, or (at your option)
783 any later version.
784
785 This program is distributed in the hope that it will be useful,
786 but WITHOUT ANY WARRANTY; without even the implied warranty of
787 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788 GNU General Public License for more details.
789
790 You should have received a copy of the GNU General Public License
791 along with this program; if not, write to the Free Software
792 Foundation, Inc., 59 Temple Place - Suite 330,
793 Boston, MA 02111-1307, USA. */
794
795/* As a special exception, when this file is copied by Bison into a
796 Bison output file, you may use that output file without restriction.
797 This special exception was added by the Free Software Foundation
798 in version 1.24 of Bison. */
799
800/* This is the parser code that is written into each bison parser
801 when the %semantic_parser declaration is not specified in the grammar.
802 It was written by Richard Stallman by simplifying the hairy parser
803 used when %semantic_parser is specified. */
804
805#ifndef YYSTACK_USE_ALLOCA
806#ifdef alloca
807#define YYSTACK_USE_ALLOCA
808#else /* alloca not defined */
809#ifdef __GNUC__
810#define YYSTACK_USE_ALLOCA
811#define alloca __builtin_alloca
812#else /* not GNU C. */
813#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
814#define YYSTACK_USE_ALLOCA
815#include <alloca.h>
816#else /* not sparc */
817/* We think this test detects Watcom and Microsoft C. */
818/* This used to test MSDOS, but that is a bad idea
819 since that symbol is in the user namespace. */
820#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
821#if 0 /* No need for malloc.h, which pollutes the namespace;
822 instead, just don't use alloca. */
823#include <malloc.h>
824#endif
825#else /* not MSDOS, or __TURBOC__ */
826#if defined(_AIX)
827/* I don't know what this was needed for, but it pollutes the namespace.
828 So I turned it off. rms, 2 May 1997. */
829/* #include <malloc.h> */
830 #pragma alloca
831#define YYSTACK_USE_ALLOCA
832#else /* not MSDOS, or __TURBOC__, or _AIX */
833#if 0
834#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
835 and on HPUX 10. Eventually we can turn this on. */
836#define YYSTACK_USE_ALLOCA
837#define alloca __builtin_alloca
838#endif /* __hpux */
839#endif
840#endif /* not _AIX */
841#endif /* not MSDOS, or __TURBOC__ */
842#endif /* not sparc */
843#endif /* not GNU C */
844#endif /* alloca not defined */
845#endif /* YYSTACK_USE_ALLOCA not defined */
846
847#ifdef YYSTACK_USE_ALLOCA
848#define YYSTACK_ALLOC alloca
Lev Walkinf15320b2004-06-03 03:38:44 +0000849#else
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000850#define YYSTACK_ALLOC malloc
Lev Walkinf15320b2004-06-03 03:38:44 +0000851#endif
852
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000853/* Note: there must be only one dollar sign in this file.
854 It is replaced by the list of actions, each action
855 as one case of the switch. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000856
857#define yyerrok (yyerrstatus = 0)
858#define yyclearin (yychar = YYEMPTY)
859#define YYEMPTY -2
860#define YYEOF 0
861#define YYACCEPT goto yyacceptlab
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000862#define YYABORT goto yyabortlab
Lev Walkinf15320b2004-06-03 03:38:44 +0000863#define YYERROR goto yyerrlab1
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000864/* Like YYERROR except do call yyerror.
865 This remains here temporarily to ease the
866 transition to the new meaning of YYERROR, for GCC.
Lev Walkinf15320b2004-06-03 03:38:44 +0000867 Once GCC version 2 has supplanted version 1, this can go. */
868#define YYFAIL goto yyerrlab
869#define YYRECOVERING() (!!yyerrstatus)
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000870#define YYBACKUP(token, value) \
Lev Walkinf15320b2004-06-03 03:38:44 +0000871do \
872 if (yychar == YYEMPTY && yylen == 1) \
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000873 { yychar = (token), yylval = (value); \
Lev Walkinf15320b2004-06-03 03:38:44 +0000874 yychar1 = YYTRANSLATE (yychar); \
875 YYPOPSTACK; \
876 goto yybackup; \
877 } \
878 else \
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000879 { yyerror ("syntax error: cannot back up"); YYERROR; } \
Lev Walkinf15320b2004-06-03 03:38:44 +0000880while (0)
881
882#define YYTERROR 1
883#define YYERRCODE 256
884
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000885#ifndef YYPURE
886#define YYLEX yylex()
Lev Walkinf15320b2004-06-03 03:38:44 +0000887#endif
888
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000889#ifdef YYPURE
890#ifdef YYLSP_NEEDED
891#ifdef YYLEX_PARAM
892#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
893#else
894#define YYLEX yylex(&yylval, &yylloc)
895#endif
896#else /* not YYLSP_NEEDED */
897#ifdef YYLEX_PARAM
898#define YYLEX yylex(&yylval, YYLEX_PARAM)
899#else
900#define YYLEX yylex(&yylval)
901#endif
902#endif /* not YYLSP_NEEDED */
903#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000904
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000905/* If nonreentrant, generate the variables here */
Lev Walkinf15320b2004-06-03 03:38:44 +0000906
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000907#ifndef YYPURE
Lev Walkinf15320b2004-06-03 03:38:44 +0000908
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000909int yychar; /* the lookahead symbol */
910YYSTYPE yylval; /* the semantic value of the */
911 /* lookahead symbol */
Lev Walkinf15320b2004-06-03 03:38:44 +0000912
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000913#ifdef YYLSP_NEEDED
914YYLTYPE yylloc; /* location data for the lookahead */
915 /* symbol */
916#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000917
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000918int yynerrs; /* number of parse errors so far */
919#endif /* not YYPURE */
920
921#if YYDEBUG != 0
922int yydebug; /* nonzero means print parse trace */
923/* Since this is uninitialized, it does not stop multiple parsers
924 from coexisting. */
925#endif
926
927/* YYINITDEPTH indicates the initial size of the parser's stacks */
928
Lev Walkinf15320b2004-06-03 03:38:44 +0000929#ifndef YYINITDEPTH
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000930#define YYINITDEPTH 200
Lev Walkinf15320b2004-06-03 03:38:44 +0000931#endif
932
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000933/* YYMAXDEPTH is the maximum size the stacks can grow to
934 (effective only if the built-in stack extension method is used). */
Lev Walkinf15320b2004-06-03 03:38:44 +0000935
936#if YYMAXDEPTH == 0
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000937#undef YYMAXDEPTH
Lev Walkinf15320b2004-06-03 03:38:44 +0000938#endif
939
940#ifndef YYMAXDEPTH
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000941#define YYMAXDEPTH 10000
Lev Walkinf15320b2004-06-03 03:38:44 +0000942#endif
943
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000944/* Define __yy_memcpy. Note that the size argument
945 should be passed with type unsigned int, because that is what the non-GCC
946 definitions require. With GCC, __builtin_memcpy takes an arg
947 of type size_t, but it can handle unsigned int. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000948
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000949#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
950#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
951#else /* not GNU C or C++ */
952#ifndef __cplusplus
Lev Walkinf15320b2004-06-03 03:38:44 +0000953
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000954/* This is the most reliable way to avoid incompatibilities
955 in available built-in functions on various systems. */
Lev Walkinc3b72e92004-06-03 05:07:41 +0000956static void
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000957__yy_memcpy (to, from, count)
958 char *to;
959 char *from;
960 unsigned int count;
Lev Walkinc3b72e92004-06-03 05:07:41 +0000961{
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000962 register char *f = from;
963 register char *t = to;
964 register int i = count;
Lev Walkinc3b72e92004-06-03 05:07:41 +0000965
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000966 while (i-- > 0)
967 *t++ = *f++;
Lev Walkinc3b72e92004-06-03 05:07:41 +0000968}
Lev Walkinc3b72e92004-06-03 05:07:41 +0000969
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000970#else /* __cplusplus */
Lev Walkinc3b72e92004-06-03 05:07:41 +0000971
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000972/* This is the most reliable way to avoid incompatibilities
973 in available built-in functions on various systems. */
Lev Walkinc3b72e92004-06-03 05:07:41 +0000974static void
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000975__yy_memcpy (char *to, char *from, unsigned int count)
Lev Walkinc3b72e92004-06-03 05:07:41 +0000976{
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000977 register char *t = to;
978 register char *f = from;
979 register int i = count;
Lev Walkinc3b72e92004-06-03 05:07:41 +0000980
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000981 while (i-- > 0)
982 *t++ = *f++;
Lev Walkinf15320b2004-06-03 03:38:44 +0000983}
984
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000985#endif
986#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000987
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000988#line 217 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +0000989
990/* The user can define YYPARSE_PARAM as the name of an argument to be passed
991 into yyparse. The argument should have type void *.
992 It should actually point to an object.
993 Grammar actions can access the variable by casting it
994 to the proper pointer type. */
995
996#ifdef YYPARSE_PARAM
Lev Walkinb4fcdd22004-08-13 12:35:09 +0000997#ifdef __cplusplus
998#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
999#define YYPARSE_PARAM_DECL
1000#else /* not __cplusplus */
1001#define YYPARSE_PARAM_ARG YYPARSE_PARAM
1002#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1003#endif /* not __cplusplus */
1004#else /* not YYPARSE_PARAM */
1005#define YYPARSE_PARAM_ARG
1006#define YYPARSE_PARAM_DECL
1007#endif /* not YYPARSE_PARAM */
Lev Walkinf15320b2004-06-03 03:38:44 +00001008
1009/* Prevent warning if -Wstrict-prototypes. */
1010#ifdef __GNUC__
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001011#ifdef YYPARSE_PARAM
Lev Walkinf15320b2004-06-03 03:38:44 +00001012int yyparse (void *);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001013#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001014int yyparse (void);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001015#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001016#endif
Lev Walkinc3b72e92004-06-03 05:07:41 +00001017
Lev Walkinf15320b2004-06-03 03:38:44 +00001018int
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001019yyparse(YYPARSE_PARAM_ARG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001020 YYPARSE_PARAM_DECL
1021{
1022 register int yystate;
1023 register int yyn;
1024 register short *yyssp;
1025 register YYSTYPE *yyvsp;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001026 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1027 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
Lev Walkinf15320b2004-06-03 03:38:44 +00001028
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001029 short yyssa[YYINITDEPTH]; /* the state stack */
1030 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
Lev Walkinf15320b2004-06-03 03:38:44 +00001031
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001032 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1033 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
Lev Walkinf15320b2004-06-03 03:38:44 +00001034
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001035#ifdef YYLSP_NEEDED
1036 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1037 YYLTYPE *yyls = yylsa;
1038 YYLTYPE *yylsp;
1039
1040#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1041#else
Lev Walkinf15320b2004-06-03 03:38:44 +00001042#define YYPOPSTACK (yyvsp--, yyssp--)
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001043#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001044
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001045 int yystacksize = YYINITDEPTH;
1046 int yyfree_stacks = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00001047
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001048#ifdef YYPURE
1049 int yychar;
1050 YYSTYPE yylval;
1051 int yynerrs;
1052#ifdef YYLSP_NEEDED
1053 YYLTYPE yylloc;
1054#endif
1055#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001056
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001057 YYSTYPE yyval; /* the variable used to return */
1058 /* semantic values from the action */
1059 /* routines */
Lev Walkinf15320b2004-06-03 03:38:44 +00001060
1061 int yylen;
1062
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001063#if YYDEBUG != 0
1064 if (yydebug)
1065 fprintf(stderr, "Starting parse\n");
1066#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001067
1068 yystate = 0;
1069 yyerrstatus = 0;
1070 yynerrs = 0;
1071 yychar = YYEMPTY; /* Cause a token to be read. */
1072
1073 /* Initialize stack pointers.
1074 Waste one element of value and location stack
1075 so that they stay on the same level as the state stack.
1076 The wasted elements are never initialized. */
1077
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001078 yyssp = yyss - 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001079 yyvsp = yyvs;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001080#ifdef YYLSP_NEEDED
1081 yylsp = yyls;
1082#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001083
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001084/* Push a new state, which is found in yystate . */
1085/* In all cases, when you get here, the value and location stacks
1086 have just been pushed. so pushing a state here evens the stacks. */
1087yynewstate:
Lev Walkinf15320b2004-06-03 03:38:44 +00001088
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001089 *++yyssp = yystate;
Lev Walkinf15320b2004-06-03 03:38:44 +00001090
1091 if (yyssp >= yyss + yystacksize - 1)
1092 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001093 /* Give user a chance to reallocate the stack */
1094 /* Use copies of these so that the &'s don't force the real ones into memory. */
1095 YYSTYPE *yyvs1 = yyvs;
1096 short *yyss1 = yyss;
1097#ifdef YYLSP_NEEDED
1098 YYLTYPE *yyls1 = yyls;
1099#endif
1100
Lev Walkinf15320b2004-06-03 03:38:44 +00001101 /* Get the current used size of the three stacks, in elements. */
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001102 int size = yyssp - yyss + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00001103
1104#ifdef yyoverflow
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001105 /* Each stack pointer address is followed by the size of
1106 the data in use in that stack, in bytes. */
1107#ifdef YYLSP_NEEDED
1108 /* This used to be a conditional around just the two extra args,
1109 but that might be undefined if yyoverflow is a macro. */
1110 yyoverflow("parser stack overflow",
1111 &yyss1, size * sizeof (*yyssp),
1112 &yyvs1, size * sizeof (*yyvsp),
1113 &yyls1, size * sizeof (*yylsp),
1114 &yystacksize);
1115#else
1116 yyoverflow("parser stack overflow",
1117 &yyss1, size * sizeof (*yyssp),
1118 &yyvs1, size * sizeof (*yyvsp),
1119 &yystacksize);
1120#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001121
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001122 yyss = yyss1; yyvs = yyvs1;
1123#ifdef YYLSP_NEEDED
1124 yyls = yyls1;
1125#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001126#else /* no yyoverflow */
1127 /* Extend the stack our own way. */
1128 if (yystacksize >= YYMAXDEPTH)
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001129 {
1130 yyerror("parser stack overflow");
1131 if (yyfree_stacks)
1132 {
1133 free (yyss);
1134 free (yyvs);
1135#ifdef YYLSP_NEEDED
1136 free (yyls);
1137#endif
1138 }
1139 return 2;
1140 }
Lev Walkinf15320b2004-06-03 03:38:44 +00001141 yystacksize *= 2;
1142 if (yystacksize > YYMAXDEPTH)
1143 yystacksize = YYMAXDEPTH;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001144#ifndef YYSTACK_USE_ALLOCA
1145 yyfree_stacks = 1;
1146#endif
1147 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1148 __yy_memcpy ((char *)yyss, (char *)yyss1,
1149 size * (unsigned int) sizeof (*yyssp));
1150 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1151 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1152 size * (unsigned int) sizeof (*yyvsp));
1153#ifdef YYLSP_NEEDED
1154 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1155 __yy_memcpy ((char *)yyls, (char *)yyls1,
1156 size * (unsigned int) sizeof (*yylsp));
1157#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001158#endif /* no yyoverflow */
1159
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001160 yyssp = yyss + size - 1;
1161 yyvsp = yyvs + size - 1;
1162#ifdef YYLSP_NEEDED
1163 yylsp = yyls + size - 1;
1164#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001165
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001166#if YYDEBUG != 0
1167 if (yydebug)
1168 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1169#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001170
1171 if (yyssp >= yyss + yystacksize - 1)
1172 YYABORT;
1173 }
1174
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001175#if YYDEBUG != 0
1176 if (yydebug)
1177 fprintf(stderr, "Entering state %d\n", yystate);
1178#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001179
1180 goto yybackup;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001181 yybackup:
Lev Walkinf15320b2004-06-03 03:38:44 +00001182
1183/* Do appropriate processing given the current state. */
1184/* Read a lookahead token if we need one and don't already have one. */
1185/* yyresume: */
1186
1187 /* First try to decide what to do without reference to lookahead token. */
1188
1189 yyn = yypact[yystate];
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001190 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001191 goto yydefault;
1192
1193 /* Not known => get a lookahead token if don't already have one. */
1194
1195 /* yychar is either YYEMPTY or YYEOF
1196 or a valid token in external form. */
1197
1198 if (yychar == YYEMPTY)
1199 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001200#if YYDEBUG != 0
1201 if (yydebug)
1202 fprintf(stderr, "Reading a token: ");
1203#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001204 yychar = YYLEX;
1205 }
1206
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001207 /* Convert token to internal form (in yychar1) for indexing tables with */
Lev Walkinf15320b2004-06-03 03:38:44 +00001208
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001209 if (yychar <= 0) /* This means end of input. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001210 {
1211 yychar1 = 0;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001212 yychar = YYEOF; /* Don't call YYLEX any more */
Lev Walkinf15320b2004-06-03 03:38:44 +00001213
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001214#if YYDEBUG != 0
1215 if (yydebug)
1216 fprintf(stderr, "Now at end of input.\n");
1217#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001218 }
1219 else
1220 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001221 yychar1 = YYTRANSLATE(yychar);
Lev Walkinf15320b2004-06-03 03:38:44 +00001222
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001223#if YYDEBUG != 0
1224 if (yydebug)
1225 {
1226 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1227 /* Give the individual parser a way to print the precise meaning
1228 of a token, for further debugging info. */
1229#ifdef YYPRINT
1230 YYPRINT (stderr, yychar, yylval);
1231#endif
1232 fprintf (stderr, ")\n");
1233 }
1234#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001235 }
1236
1237 yyn += yychar1;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001238 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
Lev Walkinf15320b2004-06-03 03:38:44 +00001239 goto yydefault;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001240
Lev Walkinf15320b2004-06-03 03:38:44 +00001241 yyn = yytable[yyn];
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001242
1243 /* yyn is what to do for this token type in this state.
1244 Negative => reduce, -yyn is rule number.
1245 Positive => shift, yyn is new state.
1246 New state is final state => don't bother to shift,
1247 just return success.
1248 0, or most negative number => error. */
1249
1250 if (yyn < 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001251 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001252 if (yyn == YYFLAG)
Lev Walkinf15320b2004-06-03 03:38:44 +00001253 goto yyerrlab;
1254 yyn = -yyn;
1255 goto yyreduce;
1256 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001257 else if (yyn == 0)
1258 goto yyerrlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00001259
1260 if (yyn == YYFINAL)
1261 YYACCEPT;
1262
1263 /* Shift the lookahead token. */
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001264
1265#if YYDEBUG != 0
1266 if (yydebug)
1267 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1268#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001269
1270 /* Discard the token being shifted unless it is eof. */
1271 if (yychar != YYEOF)
1272 yychar = YYEMPTY;
1273
1274 *++yyvsp = yylval;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001275#ifdef YYLSP_NEEDED
1276 *++yylsp = yylloc;
1277#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00001278
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001279 /* count tokens shifted since error; after three, turn off error status. */
1280 if (yyerrstatus) yyerrstatus--;
Lev Walkinf15320b2004-06-03 03:38:44 +00001281
1282 yystate = yyn;
1283 goto yynewstate;
1284
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001285/* Do the default action for the current state. */
Lev Walkinc3b72e92004-06-03 05:07:41 +00001286yydefault:
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001287
Lev Walkinf15320b2004-06-03 03:38:44 +00001288 yyn = yydefact[yystate];
1289 if (yyn == 0)
1290 goto yyerrlab;
1291
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001292/* Do a reduction. yyn is the number of a rule to reduce with. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001293yyreduce:
1294 yylen = yyr2[yyn];
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001295 if (yylen > 0)
1296 yyval = yyvsp[1-yylen]; /* implement default value of the action */
Lev Walkinf15320b2004-06-03 03:38:44 +00001297
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001298#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00001299 if (yydebug)
1300 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001301 int i;
Lev Walkinf15320b2004-06-03 03:38:44 +00001302
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001303 fprintf (stderr, "Reducing via rule %d (line %d), ",
1304 yyn, yyrline[yyn]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001305
1306 /* Print the symbols being reduced, and their result. */
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001307 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1308 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1309 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
Lev Walkinf15320b2004-06-03 03:38:44 +00001310 }
1311#endif
Lev Walkinc3b72e92004-06-03 05:07:41 +00001312
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001313
1314 switch (yyn) {
1315
1316case 1:
1317#line 298 "asn1p_y.y"
1318{
1319 *(void **)param = yyvsp[0].a_grammar;
1320 ;
1321 break;}
1322case 2:
Lev Walkinf15320b2004-06-03 03:38:44 +00001323#line 304 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001324{
Lev Walkinf15320b2004-06-03 03:38:44 +00001325 yyval.a_grammar = asn1p_new();
1326 checkmem(yyval.a_grammar);
1327 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001328 ;
1329 break;}
1330case 3:
Lev Walkinf15320b2004-06-03 03:38:44 +00001331#line 309 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001332{
Lev Walkinf15320b2004-06-03 03:38:44 +00001333 yyval.a_grammar = yyvsp[-1].a_grammar;
1334 TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001335 ;
1336 break;}
1337case 4:
Lev Walkinf15320b2004-06-03 03:38:44 +00001338#line 330 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001339{
Lev Walkinf15320b2004-06-03 03:38:44 +00001340
1341 if(yyvsp[-1].a_module) {
1342 yyval.a_module = yyvsp[-1].a_module;
1343 } else {
1344 /* There's a chance that a module is just plain empty */
1345 yyval.a_module = asn1p_module_new();
1346 }
1347 checkmem(yyval.a_module);
1348
1349 yyval.a_module->Identifier = yyvsp[-7].tv_str;
1350 yyval.a_module->module_oid = yyvsp[-6].a_oid;
1351 yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001352 ;
1353 break;}
1354case 5:
Lev Walkinf15320b2004-06-03 03:38:44 +00001355#line 351 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001356{ yyval.a_oid = 0; ;
1357 break;}
1358case 6:
Lev Walkinf15320b2004-06-03 03:38:44 +00001359#line 352 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001360{ yyval.a_oid = yyvsp[0].a_oid; ;
1361 break;}
1362case 7:
Lev Walkinf15320b2004-06-03 03:38:44 +00001363#line 356 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001364{
Lev Walkinf15320b2004-06-03 03:38:44 +00001365 yyval.a_oid = yyvsp[-1].a_oid;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001366 ;
1367 break;}
1368case 8:
Lev Walkinf15320b2004-06-03 03:38:44 +00001369#line 359 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001370{
Lev Walkinf15320b2004-06-03 03:38:44 +00001371 yyval.a_oid = 0;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001372 ;
1373 break;}
1374case 9:
Lev Walkinf15320b2004-06-03 03:38:44 +00001375#line 365 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001376{
Lev Walkinf15320b2004-06-03 03:38:44 +00001377 yyval.a_oid = asn1p_oid_new();
1378 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1379 if(yyvsp[0].a_oid_arc.name)
1380 free(yyvsp[0].a_oid_arc.name);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001381 ;
1382 break;}
1383case 10:
Lev Walkinf15320b2004-06-03 03:38:44 +00001384#line 371 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001385{
Lev Walkinf15320b2004-06-03 03:38:44 +00001386 yyval.a_oid = yyvsp[-1].a_oid;
1387 asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
1388 if(yyvsp[0].a_oid_arc.name)
1389 free(yyvsp[0].a_oid_arc.name);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001390 ;
1391 break;}
1392case 11:
Lev Walkinf15320b2004-06-03 03:38:44 +00001393#line 380 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001394{ /* iso */
Lev Walkinf15320b2004-06-03 03:38:44 +00001395 yyval.a_oid_arc.name = yyvsp[0].tv_str;
1396 yyval.a_oid_arc.number = -1;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001397 ;
1398 break;}
1399case 12:
Lev Walkinf15320b2004-06-03 03:38:44 +00001400#line 384 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001401{ /* iso(1) */
Lev Walkinf15320b2004-06-03 03:38:44 +00001402 yyval.a_oid_arc.name = yyvsp[-3].tv_str;
1403 yyval.a_oid_arc.number = yyvsp[-1].a_int;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001404 ;
1405 break;}
1406case 13:
Lev Walkinf15320b2004-06-03 03:38:44 +00001407#line 388 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001408{ /* 1 */
Lev Walkinf15320b2004-06-03 03:38:44 +00001409 yyval.a_oid_arc.name = 0;
1410 yyval.a_oid_arc.number = yyvsp[0].a_int;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001411 ;
1412 break;}
1413case 14:
Lev Walkinf15320b2004-06-03 03:38:44 +00001414#line 398 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001415{ yyval.a_module_flags = MSF_NOFLAGS; ;
1416 break;}
1417case 15:
Lev Walkinf15320b2004-06-03 03:38:44 +00001418#line 399 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001419{
Lev Walkinf15320b2004-06-03 03:38:44 +00001420 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001421 ;
1422 break;}
1423case 16:
Lev Walkinf15320b2004-06-03 03:38:44 +00001424#line 408 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001425{
Lev Walkinf15320b2004-06-03 03:38:44 +00001426 yyval.a_module_flags = yyvsp[0].a_module_flags;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001427 ;
1428 break;}
1429case 17:
Lev Walkinf15320b2004-06-03 03:38:44 +00001430#line 411 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001431{
Lev Walkinf15320b2004-06-03 03:38:44 +00001432 yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001433 ;
1434 break;}
1435case 18:
Lev Walkinf15320b2004-06-03 03:38:44 +00001436#line 420 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001437{
Lev Walkinf15320b2004-06-03 03:38:44 +00001438 yyval.a_module_flags = MSF_EXPLICIT_TAGS;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001439 ;
1440 break;}
1441case 19:
Lev Walkinf15320b2004-06-03 03:38:44 +00001442#line 423 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001443{
Lev Walkinf15320b2004-06-03 03:38:44 +00001444 yyval.a_module_flags = MSF_IMPLICIT_TAGS;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001445 ;
1446 break;}
1447case 20:
Lev Walkinf15320b2004-06-03 03:38:44 +00001448#line 426 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001449{
Lev Walkinf15320b2004-06-03 03:38:44 +00001450 yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001451 ;
1452 break;}
1453case 21:
Lev Walkinf15320b2004-06-03 03:38:44 +00001454#line 429 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001455{
Lev Walkinf15320b2004-06-03 03:38:44 +00001456 yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001457 ;
1458 break;}
1459case 22:
Lev Walkinf15320b2004-06-03 03:38:44 +00001460#line 438 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001461{ yyval.a_module = 0; ;
1462 break;}
1463case 23:
Lev Walkinf15320b2004-06-03 03:38:44 +00001464#line 439 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001465{
Lev Walkinf15320b2004-06-03 03:38:44 +00001466 assert(yyvsp[0].a_module);
1467 yyval.a_module = yyvsp[0].a_module;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001468 ;
1469 break;}
1470case 24:
Lev Walkinf15320b2004-06-03 03:38:44 +00001471#line 449 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001472{
Lev Walkinf15320b2004-06-03 03:38:44 +00001473 yyval.a_module = yyvsp[0].a_module;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001474 ;
1475 break;}
1476case 25:
Lev Walkinf15320b2004-06-03 03:38:44 +00001477#line 452 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001478{
Lev Walkinf15320b2004-06-03 03:38:44 +00001479 yyval.a_module = yyvsp[-1].a_module;
1480
1481#ifdef MY_IMPORT
1482#error MY_IMPORT DEFINED ELSEWHERE!
1483#endif
1484#define MY_IMPORT(foo,field) do { \
Lev Walkinbc55d232004-08-13 12:31:09 +00001485 while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
Lev Walkinf15320b2004-06-03 03:38:44 +00001486 TQ_ADD(&(yyval.a_module->foo), \
1487 TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
1488 field); \
Lev Walkinbc55d232004-08-13 12:31:09 +00001489 } \
1490 assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
1491 } while(0)
Lev Walkinf15320b2004-06-03 03:38:44 +00001492
1493 MY_IMPORT(imports, xp_next);
1494 MY_IMPORT(exports, xp_next);
1495 MY_IMPORT(members, next);
1496#undef MY_IMPORT
1497
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001498 ;
1499 break;}
1500case 26:
Lev Walkinbc55d232004-08-13 12:31:09 +00001501#line 479 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001502{
Lev Walkinf15320b2004-06-03 03:38:44 +00001503 yyval.a_module = yyvsp[0].a_module;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001504 ;
1505 break;}
1506case 27:
Lev Walkinbc55d232004-08-13 12:31:09 +00001507#line 482 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001508{
Lev Walkinf15320b2004-06-03 03:38:44 +00001509 yyval.a_module = asn1p_module_new();
1510 checkmem(yyval.a_module);
1511 if(yyvsp[0].a_xports) {
1512 TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
1513 } else {
1514 /* "EXPORTS ALL;" ? */
1515 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001516 ;
1517 break;}
1518case 28:
Lev Walkinbc55d232004-08-13 12:31:09 +00001519#line 491 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001520{
Lev Walkinf15320b2004-06-03 03:38:44 +00001521 yyval.a_module = asn1p_module_new();
1522 checkmem(yyval.a_module);
1523 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1524 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1525 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001526 ;
1527 break;}
1528case 29:
Lev Walkinbc55d232004-08-13 12:31:09 +00001529#line 498 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001530{
Lev Walkinf15320b2004-06-03 03:38:44 +00001531 yyval.a_module = asn1p_module_new();
1532 checkmem(yyval.a_module);
1533 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1534 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1535 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001536 ;
1537 break;}
1538case 30:
Lev Walkinbc55d232004-08-13 12:31:09 +00001539#line 511 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001540{
Lev Walkinf15320b2004-06-03 03:38:44 +00001541 yyval.a_module = asn1p_module_new();
1542 checkmem(yyval.a_module);
1543 assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
1544 assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
1545 TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001546 ;
1547 break;}
1548case 31:
Lev Walkinbc55d232004-08-13 12:31:09 +00001549#line 522 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001550{
Lev Walkinf15320b2004-06-03 03:38:44 +00001551 return yyerror(
1552 "Attempt to redefine a standard basic type, "
1553 "use -ftypesXY to switch back "
1554 "to older version of ASN.1 standard");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001555 ;
1556 break;}
1557case 32:
Lev Walkinbc55d232004-08-13 12:31:09 +00001558#line 536 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001559{
Lev Walkinf15320b2004-06-03 03:38:44 +00001560 yyval.a_module = yyvsp[-1].a_module;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001561 ;
1562 break;}
1563case 33:
Lev Walkinbc55d232004-08-13 12:31:09 +00001564#line 542 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001565{
Lev Walkinf15320b2004-06-03 03:38:44 +00001566 return yyerror("Empty IMPORTS list");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001567 ;
1568 break;}
1569case 34:
Lev Walkinbc55d232004-08-13 12:31:09 +00001570#line 548 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001571{
Lev Walkinf15320b2004-06-03 03:38:44 +00001572 yyval.a_module = asn1p_module_new();
1573 checkmem(yyval.a_module);
1574 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001575 ;
1576 break;}
1577case 35:
Lev Walkinbc55d232004-08-13 12:31:09 +00001578#line 553 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001579{
Lev Walkinf15320b2004-06-03 03:38:44 +00001580 yyval.a_module = yyvsp[-1].a_module;
1581 TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001582 ;
1583 break;}
1584case 36:
Lev Walkinbc55d232004-08-13 12:31:09 +00001585#line 560 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001586{
Lev Walkinf15320b2004-06-03 03:38:44 +00001587 yyval.a_xports = yyvsp[-3].a_xports;
1588 yyval.a_xports->from = yyvsp[-1].tv_str;
1589 yyval.a_xports->from_oid = yyvsp[0].a_oid;
1590 checkmem(yyval.a_xports);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001591 ;
1592 break;}
1593case 37:
Lev Walkinbc55d232004-08-13 12:31:09 +00001594#line 569 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001595{
Lev Walkinf15320b2004-06-03 03:38:44 +00001596 yyval.a_xports = asn1p_xports_new();
1597 checkmem(yyval.a_xports);
1598 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001599 ;
1600 break;}
1601case 38:
Lev Walkinbc55d232004-08-13 12:31:09 +00001602#line 574 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001603{
Lev Walkinf15320b2004-06-03 03:38:44 +00001604 yyval.a_xports = yyvsp[-2].a_xports;
1605 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001606 ;
1607 break;}
1608case 39:
Lev Walkinbc55d232004-08-13 12:31:09 +00001609#line 581 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001610{
Lev Walkinf15320b2004-06-03 03:38:44 +00001611 yyval.a_expr = asn1p_expr_new(yylineno);
1612 checkmem(yyval.a_expr);
1613 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1614 yyval.a_expr->expr_type = A1TC_REFERENCE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001615 ;
1616 break;}
1617case 40:
Lev Walkinbc55d232004-08-13 12:31:09 +00001618#line 587 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001619{
Lev Walkinf15320b2004-06-03 03:38:44 +00001620 yyval.a_expr = asn1p_expr_new(yylineno);
1621 checkmem(yyval.a_expr);
1622 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1623 yyval.a_expr->expr_type = A1TC_REFERENCE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001624 ;
1625 break;}
1626case 41:
Lev Walkinbc55d232004-08-13 12:31:09 +00001627#line 596 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001628{
Lev Walkinf15320b2004-06-03 03:38:44 +00001629 yyval.a_xports = yyvsp[-1].a_xports;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001630 ;
1631 break;}
1632case 42:
Lev Walkinbc55d232004-08-13 12:31:09 +00001633#line 599 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001634{
Lev Walkinf15320b2004-06-03 03:38:44 +00001635 yyval.a_xports = 0;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001636 ;
1637 break;}
1638case 43:
Lev Walkinbc55d232004-08-13 12:31:09 +00001639#line 602 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001640{
Lev Walkinf15320b2004-06-03 03:38:44 +00001641 /* Empty EXPORTS clause effectively prohibits export. */
1642 yyval.a_xports = asn1p_xports_new();
1643 checkmem(yyval.a_xports);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001644 ;
1645 break;}
1646case 44:
Lev Walkinbc55d232004-08-13 12:31:09 +00001647#line 610 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001648{
Lev Walkinf15320b2004-06-03 03:38:44 +00001649 yyval.a_xports = asn1p_xports_new();
1650 assert(yyval.a_xports);
1651 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001652 ;
1653 break;}
1654case 45:
Lev Walkinbc55d232004-08-13 12:31:09 +00001655#line 615 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001656{
Lev Walkinf15320b2004-06-03 03:38:44 +00001657 yyval.a_xports = yyvsp[-2].a_xports;
1658 TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001659 ;
1660 break;}
1661case 46:
Lev Walkinbc55d232004-08-13 12:31:09 +00001662#line 622 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001663{
Lev Walkinf15320b2004-06-03 03:38:44 +00001664 yyval.a_expr = asn1p_expr_new(yylineno);
1665 checkmem(yyval.a_expr);
1666 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1667 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001668 ;
1669 break;}
1670case 47:
Lev Walkinbc55d232004-08-13 12:31:09 +00001671#line 628 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001672{
Lev Walkinf15320b2004-06-03 03:38:44 +00001673 yyval.a_expr = asn1p_expr_new(yylineno);
1674 checkmem(yyval.a_expr);
1675 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1676 yyval.a_expr->expr_type = A1TC_EXPORTVAR;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001677 ;
1678 break;}
1679case 48:
Lev Walkinbc55d232004-08-13 12:31:09 +00001680#line 638 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001681{
Lev Walkinf15320b2004-06-03 03:38:44 +00001682 yyval.a_expr = yyvsp[-4].a_expr;
1683 assert(yyval.a_expr->Identifier == 0);
1684 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1685 yyval.a_expr->meta_type = AMT_VALUESET;
1686 // take care of optValueSetBody
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001687 ;
1688 break;}
1689case 49:
Lev Walkinbc55d232004-08-13 12:31:09 +00001690#line 648 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001691{
Lev Walkinf15320b2004-06-03 03:38:44 +00001692 yyval.a_expr = asn1p_expr_new(yylineno);
1693 checkmem(yyval.a_expr);
1694 yyval.a_expr->reference = yyvsp[0].a_ref;
1695 yyval.a_expr->expr_type = A1TC_REFERENCE;
1696 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001697 ;
1698 break;}
1699case 50:
Lev Walkinbc55d232004-08-13 12:31:09 +00001700#line 655 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001701{
Lev Walkinf15320b2004-06-03 03:38:44 +00001702 yyval.a_expr = asn1p_expr_new(yylineno);
1703 checkmem(yyval.a_expr);
1704 yyval.a_expr->expr_type = yyvsp[0].a_type;
1705 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001706 ;
1707 break;}
1708case 51:
Lev Walkinbc55d232004-08-13 12:31:09 +00001709#line 664 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001710{ ;
1711 break;}
1712case 52:
Lev Walkinbc55d232004-08-13 12:31:09 +00001713#line 665 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001714{
1715 ;
1716 break;}
1717case 53:
Lev Walkinbc55d232004-08-13 12:31:09 +00001718#line 681 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001719{
Lev Walkinf15320b2004-06-03 03:38:44 +00001720 yyval.a_expr = asn1p_expr_new(yylineno);
1721 checkmem(yyval.a_expr);
1722 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
1723 yyval.a_expr->tag = yyvsp[-1].a_tag;
1724 yyval.a_expr->expr_type = A1TC_TYPEID;
1725 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001726 ;
1727 break;}
1728case 54:
Lev Walkinbc55d232004-08-13 12:31:09 +00001729#line 689 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001730{
Lev Walkinf15320b2004-06-03 03:38:44 +00001731 yyval.a_expr = yyvsp[0].a_expr;
1732 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
1733 yyval.a_expr->tag = yyvsp[-1].a_tag;
1734 assert(yyval.a_expr->expr_type);
1735 assert(yyval.a_expr->meta_type);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001736 ;
1737 break;}
1738case 55:
Lev Walkinbc55d232004-08-13 12:31:09 +00001739#line 696 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001740{
Lev Walkinf15320b2004-06-03 03:38:44 +00001741 yyval.a_expr = yyvsp[0].a_expr;
1742 yyval.a_expr->Identifier = yyvsp[-2].tv_str;
1743 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1744 assert(yyval.a_expr->meta_type == AMT_OBJECT);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001745 ;
1746 break;}
1747case 56:
Lev Walkinbc55d232004-08-13 12:31:09 +00001748#line 713 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001749{
Lev Walkinf15320b2004-06-03 03:38:44 +00001750 yyval.a_expr = yyvsp[0].a_expr;
1751 assert(yyval.a_expr->Identifier == 0);
1752 yyval.a_expr->Identifier = yyvsp[-5].tv_str;
1753 yyval.a_expr->params = yyvsp[-3].a_plist;
1754 yyval.a_expr->meta_type = AMT_PARAMTYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001755 ;
1756 break;}
1757case 57:
Lev Walkinbc55d232004-08-13 12:31:09 +00001758#line 723 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001759{
Lev Walkinf15320b2004-06-03 03:38:44 +00001760 int ret;
1761 yyval.a_plist = asn1p_paramlist_new(yylineno);
1762 checkmem(yyval.a_plist);
1763 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1764 checkmem(ret == 0);
1765 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1766 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001767 ;
1768 break;}
1769case 58:
Lev Walkinbc55d232004-08-13 12:31:09 +00001770#line 732 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001771{
Lev Walkinf15320b2004-06-03 03:38:44 +00001772 int ret;
1773 yyval.a_plist = yyvsp[-2].a_plist;
1774 ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
1775 checkmem(ret == 0);
1776 if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
1777 if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001778 ;
1779 break;}
1780case 59:
Lev Walkinbc55d232004-08-13 12:31:09 +00001781#line 743 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001782{
Lev Walkinf15320b2004-06-03 03:38:44 +00001783 yyval.a_parg.governor = NULL;
1784 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001785 ;
1786 break;}
1787case 60:
Lev Walkinbc55d232004-08-13 12:31:09 +00001788#line 747 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001789{
Lev Walkinf15320b2004-06-03 03:38:44 +00001790 int ret;
1791 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1792 ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
1793 checkmem(ret == 0);
1794 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001795 ;
1796 break;}
1797case 61:
Lev Walkinbc55d232004-08-13 12:31:09 +00001798#line 754 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001799{
Lev Walkinf15320b2004-06-03 03:38:44 +00001800 int ret;
1801 yyval.a_parg.governor = asn1p_ref_new(yylineno);
1802 ret = asn1p_ref_add_component(yyval.a_parg.governor,
1803 ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
1804 checkmem(ret == 0);
1805 yyval.a_parg.argument = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001806 ;
1807 break;}
1808case 62:
Lev Walkinbc55d232004-08-13 12:31:09 +00001809#line 765 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001810{
Lev Walkinf15320b2004-06-03 03:38:44 +00001811 yyval.a_expr = asn1p_expr_new(yylineno);
1812 checkmem(yyval.a_expr);
1813 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001814 ;
1815 break;}
1816case 63:
Lev Walkinbc55d232004-08-13 12:31:09 +00001817#line 770 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001818{
Lev Walkinf15320b2004-06-03 03:38:44 +00001819 yyval.a_expr = yyvsp[-2].a_expr;
1820 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001821 ;
1822 break;}
1823case 64:
Lev Walkinbc55d232004-08-13 12:31:09 +00001824#line 777 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001825{
Lev Walkinf15320b2004-06-03 03:38:44 +00001826 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001827 ;
1828 break;}
1829case 65:
Lev Walkinbc55d232004-08-13 12:31:09 +00001830#line 780 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001831{
Lev Walkinf15320b2004-06-03 03:38:44 +00001832 yyval.a_expr = asn1p_expr_new(yylineno);
1833 checkmem(yyval.a_expr);
1834 yyval.a_expr->Identifier = yyvsp[0].tv_str;
1835 yyval.a_expr->expr_type = A1TC_REFERENCE;
1836 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001837 ;
1838 break;}
1839case 66:
Lev Walkinbc55d232004-08-13 12:31:09 +00001840#line 793 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001841{
Lev Walkinf15320b2004-06-03 03:38:44 +00001842 yyval.a_expr = asn1p_expr_new(yylineno);
1843 checkmem(yyval.a_expr);
1844 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001845 ;
1846 break;}
1847case 67:
Lev Walkinbc55d232004-08-13 12:31:09 +00001848#line 798 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001849{
Lev Walkinf15320b2004-06-03 03:38:44 +00001850 yyval.a_expr = yyvsp[-2].a_expr;
1851 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001852 ;
1853 break;}
1854case 68:
Lev Walkinbc55d232004-08-13 12:31:09 +00001855#line 805 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001856{
Lev Walkinf15320b2004-06-03 03:38:44 +00001857 yyval.a_expr = yyvsp[-2].a_expr;
1858 checkmem(yyval.a_expr);
1859 yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
1860 assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
1861 assert(yyval.a_expr->meta_type == AMT_OBJECT);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001862 ;
1863 break;}
1864case 69:
Lev Walkinbc55d232004-08-13 12:31:09 +00001865#line 815 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001866{ yyval.a_int = 0; ;
1867 break;}
1868case 70:
Lev Walkinbc55d232004-08-13 12:31:09 +00001869#line 816 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001870{ yyval.a_int = 1; ;
1871 break;}
1872case 71:
Lev Walkinbc55d232004-08-13 12:31:09 +00001873#line 820 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001874{
Lev Walkinf15320b2004-06-03 03:38:44 +00001875 yyval.a_expr = asn1p_expr_new(yylineno);
1876 checkmem(yyval.a_expr);
1877 yyval.a_expr->expr_type = A1TC_CLASSDEF;
1878 yyval.a_expr->meta_type = AMT_OBJECT;
1879 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001880 ;
1881 break;}
1882case 72:
Lev Walkinbc55d232004-08-13 12:31:09 +00001883#line 827 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001884{
Lev Walkinf15320b2004-06-03 03:38:44 +00001885 yyval.a_expr = yyvsp[-2].a_expr;
1886 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001887 ;
1888 break;}
1889case 73:
Lev Walkinbc55d232004-08-13 12:31:09 +00001890#line 834 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001891{
Lev Walkinf15320b2004-06-03 03:38:44 +00001892 yyval.a_expr = asn1p_expr_new(yylineno);
1893 checkmem(yyval.a_expr);
1894 yyval.a_expr->Identifier = yyvsp[-1].a_refcomp.name;
1895 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
1896 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
1897 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001898 ;
1899 break;}
1900case 74:
Lev Walkinbc55d232004-08-13 12:31:09 +00001901#line 842 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001902{
Lev Walkinf15320b2004-06-03 03:38:44 +00001903 yyval.a_expr = yyvsp[-1].a_expr;
1904 yyval.a_expr->Identifier = yyvsp[-2].a_refcomp.name;
1905 yyval.a_expr->unique = yyvsp[0].a_int;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001906 ;
1907 break;}
1908case 75:
Lev Walkinbc55d232004-08-13 12:31:09 +00001909#line 847 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001910{
Lev Walkinf15320b2004-06-03 03:38:44 +00001911 int ret;
1912 yyval.a_expr = asn1p_expr_new(yylineno);
1913 checkmem(yyval.a_expr);
1914 yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
1915 yyval.a_expr->reference = asn1p_ref_new(yylineno);
1916 checkmem(yyval.a_expr->reference);
1917 ret = asn1p_ref_add_component(yyval.a_expr->reference,
1918 yyvsp[-2].a_refcomp.name, yyvsp[-2].a_refcomp.lex_type);
1919 checkmem(ret == 0);
1920 yyval.a_expr->expr_type = A1TC_CLASSFIELD;
1921 yyval.a_expr->meta_type = AMT_OBJECTFIELD;
1922 yyval.a_expr->marker = yyvsp[-1].a_marker;
1923 yyval.a_expr->unique = yyvsp[0].a_int;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001924 ;
1925 break;}
1926case 76:
Lev Walkinbc55d232004-08-13 12:31:09 +00001927#line 865 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001928{ yyval.a_wsynt = 0; ;
1929 break;}
1930case 77:
Lev Walkinbc55d232004-08-13 12:31:09 +00001931#line 866 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001932{
Lev Walkinf15320b2004-06-03 03:38:44 +00001933 yyval.a_wsynt = yyvsp[0].a_wsynt;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001934 ;
1935 break;}
1936case 78:
Lev Walkinbc55d232004-08-13 12:31:09 +00001937#line 873 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001938{ asn1p_lexer_hack_enable_with_syntax(); ;
1939 break;}
1940case 79:
Lev Walkinbc55d232004-08-13 12:31:09 +00001941#line 875 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001942{
Lev Walkinf15320b2004-06-03 03:38:44 +00001943 yyval.a_wsynt = yyvsp[-1].a_wsynt;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001944 ;
1945 break;}
1946case 80:
Lev Walkinbc55d232004-08-13 12:31:09 +00001947#line 881 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001948{
Lev Walkinf15320b2004-06-03 03:38:44 +00001949 yyval.a_wsynt = asn1p_wsyntx_new();
1950 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001951 ;
1952 break;}
1953case 81:
Lev Walkinbc55d232004-08-13 12:31:09 +00001954#line 885 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001955{
Lev Walkinf15320b2004-06-03 03:38:44 +00001956 yyval.a_wsynt = yyvsp[-1].a_wsynt;
1957 TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001958 ;
1959 break;}
1960case 82:
Lev Walkinbc55d232004-08-13 12:31:09 +00001961#line 892 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001962{
Lev Walkinf15320b2004-06-03 03:38:44 +00001963 yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001964 ;
1965 break;}
1966case 83:
Lev Walkinbc55d232004-08-13 12:31:09 +00001967#line 895 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001968{
Lev Walkinf15320b2004-06-03 03:38:44 +00001969 asn1p_ref_t *ref;
1970 int ret;
1971 ref = asn1p_ref_new(yylineno);
1972 checkmem(ref);
1973 ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
1974 checkmem(ret == 0);
1975 yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001976 ;
1977 break;}
1978case 84:
Lev Walkinbc55d232004-08-13 12:31:09 +00001979#line 921 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001980{
Lev Walkinf15320b2004-06-03 03:38:44 +00001981 yyval.a_expr = yyvsp[0].a_expr;
1982 assert(yyval.a_expr->Identifier == 0);
1983 yyval.a_expr->Identifier = yyvsp[-1].tv_nametag.name;
1984 yyval.a_expr->tag = yyvsp[-1].tv_nametag.tag;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001985 ;
1986 break;}
1987case 85:
Lev Walkinbc55d232004-08-13 12:31:09 +00001988#line 927 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001989{
Lev Walkinf15320b2004-06-03 03:38:44 +00001990 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001991 ;
1992 break;}
1993case 86:
Lev Walkinbc55d232004-08-13 12:31:09 +00001994#line 933 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001995{
Lev Walkinf15320b2004-06-03 03:38:44 +00001996 yyval.a_expr = yyvsp[-2].a_expr;
1997 yyval.a_expr->constraints = yyvsp[-1].a_constr;
1998 yyval.a_expr->marker = yyvsp[0].a_marker;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00001999 ;
2000 break;}
2001case 87:
Lev Walkinbc55d232004-08-13 12:31:09 +00002002#line 941 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002003{
Lev Walkinf15320b2004-06-03 03:38:44 +00002004 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2005 checkmem(yyval.a_expr);
2006 yyval.a_expr->Identifier = strdup("...");
2007 checkmem(yyval.a_expr->Identifier);
2008 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2009 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002010 ;
2011 break;}
2012case 88:
Lev Walkinbc55d232004-08-13 12:31:09 +00002013#line 949 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002014{
Lev Walkinf15320b2004-06-03 03:38:44 +00002015 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2016 checkmem(yyval.a_expr);
2017 yyval.a_expr->Identifier = strdup("...");
2018 checkmem(yyval.a_expr->Identifier);
2019 yyval.a_expr->value = yyvsp[0].a_value;
2020 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2021 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002022 ;
2023 break;}
2024case 89:
Lev Walkinbc55d232004-08-13 12:31:09 +00002025#line 958 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002026{
Lev Walkinf15320b2004-06-03 03:38:44 +00002027 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2028 checkmem(yyval.a_expr);
2029 yyval.a_expr->Identifier = strdup("...");
2030 yyval.a_expr->value = yyvsp[0].a_value;
2031 checkmem(yyval.a_expr->Identifier);
2032 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
2033 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002034 ;
2035 break;}
2036case 90:
Lev Walkinbc55d232004-08-13 12:31:09 +00002037#line 970 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002038{
Lev Walkinf15320b2004-06-03 03:38:44 +00002039 yyval.a_expr = yyvsp[0].a_expr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002040 ;
2041 break;}
2042case 91:
Lev Walkinbc55d232004-08-13 12:31:09 +00002043#line 973 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002044{
Lev Walkinf15320b2004-06-03 03:38:44 +00002045 yyval.a_expr = asn1p_expr_new(yylineno);
2046 checkmem(yyval.a_expr);
2047 yyval.a_expr->expr_type = yyvsp[0].a_type;
2048 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002049 ;
2050 break;}
2051case 92:
Lev Walkinbc55d232004-08-13 12:31:09 +00002052#line 979 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002053{
Lev Walkinf15320b2004-06-03 03:38:44 +00002054 yyval.a_expr = yyvsp[0].a_expr;
2055 checkmem(yyval.a_expr);
2056 assert(yyval.a_expr->meta_type);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002057 ;
2058 break;}
2059case 93:
Lev Walkinbc55d232004-08-13 12:31:09 +00002060#line 987 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002061{
Lev Walkinf15320b2004-06-03 03:38:44 +00002062 int ret;
2063 yyval.a_expr = yyvsp[-1].a_expr;
2064 assert(yyval.a_expr->expr_type == 0);
2065 assert(yyval.a_expr->meta_type == 0);
2066 assert(yyval.a_expr->reference == 0);
2067 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2068 checkmem(yyval.a_expr->reference);
2069 ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN);
2070 checkmem(ret == 0);
2071 free(yyvsp[-3].tv_str);
2072 yyval.a_expr->expr_type = A1TC_PARAMETRIZED;
2073 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002074 ;
2075 break;}
2076case 94:
Lev Walkinbc55d232004-08-13 12:31:09 +00002077#line 1011 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002078{
Lev Walkinf15320b2004-06-03 03:38:44 +00002079 yyval.a_expr = asn1p_expr_new(yylineno);
2080 checkmem(yyval.a_expr);
2081 yyval.a_expr->reference = yyvsp[0].a_ref;
2082 yyval.a_expr->expr_type = A1TC_REFERENCE;
2083 yyval.a_expr->meta_type = AMT_TYPEREF;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002084 ;
2085 break;}
2086case 95:
Lev Walkinbc55d232004-08-13 12:31:09 +00002087#line 1018 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002088{
Lev Walkinf15320b2004-06-03 03:38:44 +00002089 yyval.a_expr = asn1p_expr_new(yylineno);
2090 checkmem(yyval.a_expr);
2091 yyval.a_expr->reference = yyvsp[0].a_ref;
2092 yyval.a_expr->expr_type = A1TC_INSTANCE;
2093 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002094 ;
2095 break;}
2096case 96:
Lev Walkinbc55d232004-08-13 12:31:09 +00002097#line 1033 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002098{
Lev Walkinf15320b2004-06-03 03:38:44 +00002099 int ret;
2100 yyval.a_ref = asn1p_ref_new(yylineno);
2101 checkmem(yyval.a_ref);
2102 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2103 checkmem(ret == 0);
2104 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002105 ;
2106 break;}
2107case 97:
Lev Walkinbc55d232004-08-13 12:31:09 +00002108#line 1041 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002109{
Lev Walkinf15320b2004-06-03 03:38:44 +00002110 int ret;
2111 yyval.a_ref = asn1p_ref_new(yylineno);
2112 checkmem(yyval.a_ref);
2113 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2114 checkmem(ret == 0);
2115 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
2116 checkmem(ret == 0);
2117 free(yyvsp[-2].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002118 ;
2119 break;}
2120case 98:
Lev Walkinbc55d232004-08-13 12:31:09 +00002121#line 1051 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002122{
Lev Walkinf15320b2004-06-03 03:38:44 +00002123 int ret;
2124 yyval.a_ref = asn1p_ref_new(yylineno);
2125 checkmem(yyval.a_ref);
2126 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2127 checkmem(ret == 0);
2128 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
2129 checkmem(ret == 0);
2130 free(yyvsp[-2].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002131 ;
2132 break;}
2133case 99:
Lev Walkinbc55d232004-08-13 12:31:09 +00002134#line 1061 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002135{
Lev Walkinf15320b2004-06-03 03:38:44 +00002136 int ret;
2137 yyval.a_ref = asn1p_ref_new(yylineno);
2138 checkmem(yyval.a_ref);
2139 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
2140 free(yyvsp[0].tv_str);
2141 checkmem(ret == 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002142 ;
2143 break;}
2144case 100:
Lev Walkinbc55d232004-08-13 12:31:09 +00002145#line 1069 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002146{
Lev Walkinf15320b2004-06-03 03:38:44 +00002147 int ret;
2148 yyval.a_ref = yyvsp[0].a_ref;
2149 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
2150 free(yyvsp[-2].tv_str);
2151 checkmem(ret == 0);
2152 /*
2153 * Move the last element infront.
2154 */
2155 {
2156 struct asn1p_ref_component_s tmp_comp;
2157 tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
2158 memmove(&yyval.a_ref->components[1],
2159 &yyval.a_ref->components[0],
2160 sizeof(yyval.a_ref->components[0])
2161 * (yyval.a_ref->comp_count - 1));
2162 yyval.a_ref->components[0] = tmp_comp;
2163 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002164 ;
2165 break;}
2166case 101:
Lev Walkinbc55d232004-08-13 12:31:09 +00002167#line 1091 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002168{
Lev Walkinf15320b2004-06-03 03:38:44 +00002169 int ret;
2170 yyval.a_ref = asn1p_ref_new(yylineno);
2171 checkmem(yyval.a_ref);
2172 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2173 free(yyvsp[0].a_refcomp.name);
2174 checkmem(ret == 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002175 ;
2176 break;}
2177case 102:
Lev Walkinbc55d232004-08-13 12:31:09 +00002178#line 1099 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002179{
Lev Walkinf15320b2004-06-03 03:38:44 +00002180 int ret;
2181 yyval.a_ref = yyvsp[-2].a_ref;
2182 ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
2183 free(yyvsp[0].a_refcomp.name);
2184 checkmem(ret == 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002185 ;
2186 break;}
2187case 105:
Lev Walkinbc55d232004-08-13 12:31:09 +00002188#line 1113 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002189{
Lev Walkinf15320b2004-06-03 03:38:44 +00002190 yyval.a_refcomp.lex_type = RLT_AmpUppercase;
2191 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002192 ;
2193 break;}
2194case 106:
Lev Walkinbc55d232004-08-13 12:31:09 +00002195#line 1118 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002196{
Lev Walkinf15320b2004-06-03 03:38:44 +00002197 yyval.a_refcomp.lex_type = RLT_Amplowercase;
2198 yyval.a_refcomp.name = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002199 ;
2200 break;}
2201case 107:
Lev Walkinbc55d232004-08-13 12:31:09 +00002202#line 1131 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002203{
Lev Walkinf15320b2004-06-03 03:38:44 +00002204 yyval.a_expr = yyvsp[-2].a_expr;
2205 assert(yyval.a_expr->Identifier == NULL);
2206 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
2207 yyval.a_expr->meta_type = AMT_VALUE;
2208 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002209 ;
2210 break;}
2211case 108:
Lev Walkinbc55d232004-08-13 12:31:09 +00002212#line 1141 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002213{ asn1p_lexer_hack_push_opaque_state(); ;
2214 break;}
2215case 109:
Lev Walkinbc55d232004-08-13 12:31:09 +00002216#line 1142 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002217{
Lev Walkinf15320b2004-06-03 03:38:44 +00002218 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2219 checkmem(yyval.a_value);
2220 yyval.a_value->type = ATV_UNPARSED;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002221 ;
2222 break;}
2223case 110:
Lev Walkinbc55d232004-08-13 12:31:09 +00002224#line 1147 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002225{
Lev Walkinf15320b2004-06-03 03:38:44 +00002226 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
2227 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002228 ;
2229 break;}
2230case 111:
Lev Walkinbc55d232004-08-13 12:31:09 +00002231#line 1151 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002232{
Lev Walkinf15320b2004-06-03 03:38:44 +00002233 yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
2234 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002235 ;
2236 break;}
2237case 112:
Lev Walkinbc55d232004-08-13 12:31:09 +00002238#line 1155 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002239{
Lev Walkinf15320b2004-06-03 03:38:44 +00002240 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2241 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002242 ;
2243 break;}
2244case 113:
Lev Walkinbc55d232004-08-13 12:31:09 +00002245#line 1159 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002246{
Lev Walkinf15320b2004-06-03 03:38:44 +00002247 yyval.a_value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002248 ;
2249 break;}
2250case 114:
Lev Walkinbc55d232004-08-13 12:31:09 +00002251#line 1162 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002252{
Lev Walkinf15320b2004-06-03 03:38:44 +00002253 yyval.a_value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002254 ;
2255 break;}
2256case 115:
Lev Walkinbc55d232004-08-13 12:31:09 +00002257#line 1168 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002258{
Lev Walkinf15320b2004-06-03 03:38:44 +00002259 asn1p_ref_t *ref;
2260 int ret;
2261 ref = asn1p_ref_new(yylineno);
2262 checkmem(ref);
2263 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2264 checkmem(ret == 0);
2265 yyval.a_value = asn1p_value_fromref(ref, 0);
2266 checkmem(yyval.a_value);
2267 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002268 ;
2269 break;}
2270case 116:
Lev Walkinbc55d232004-08-13 12:31:09 +00002271#line 1179 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002272{
Lev Walkinf15320b2004-06-03 03:38:44 +00002273 asn1p_ref_t *ref;
2274 int ret;
2275 ref = asn1p_ref_new(yylineno);
2276 checkmem(ref);
2277 ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
2278 checkmem(ret == 0);
2279 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2280 checkmem(ret == 0);
2281 yyval.a_value = asn1p_value_fromref(ref, 0);
2282 checkmem(yyval.a_value);
2283 free(yyvsp[-2].tv_str);
2284 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002285 ;
2286 break;}
2287case 117:
Lev Walkinbc55d232004-08-13 12:31:09 +00002288#line 1196 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002289{
Lev Walkinf15320b2004-06-03 03:38:44 +00002290 yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 2;
2291 yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
2292 checkmem(yyval.tv_opaque.buf);
2293 yyval.tv_opaque.buf[0] = '{';
2294 yyval.tv_opaque.buf[1] = ' ';
2295 memcpy(yyval.tv_opaque.buf + 2, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2296 yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
2297 free(yyvsp[0].tv_opaque.buf);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002298 ;
2299 break;}
2300case 118:
Lev Walkinbc55d232004-08-13 12:31:09 +00002301#line 1206 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002302{
Lev Walkinf15320b2004-06-03 03:38:44 +00002303 int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
2304 char *p = malloc(newsize + 1);
2305 checkmem(p);
2306 memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
2307 memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
2308 p[newsize] = '\0';
2309 free(yyvsp[-1].tv_opaque.buf);
2310 free(yyvsp[0].tv_opaque.buf);
2311 yyval.tv_opaque.buf = p;
2312 yyval.tv_opaque.len = newsize;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002313 ;
2314 break;}
2315case 119:
Lev Walkinbc55d232004-08-13 12:31:09 +00002316#line 1221 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002317{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
2318 break;}
2319case 120:
Lev Walkinbc55d232004-08-13 12:31:09 +00002320#line 1222 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002321{ yyval.a_type = ASN_BASIC_NULL; ;
2322 break;}
2323case 121:
Lev Walkinbc55d232004-08-13 12:31:09 +00002324#line 1223 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002325{ yyval.a_type = ASN_BASIC_REAL; ;
2326 break;}
2327case 122:
Lev Walkinbc55d232004-08-13 12:31:09 +00002328#line 1224 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002329{ yyval.a_type = yyvsp[0].a_type; ;
2330 break;}
2331case 123:
Lev Walkinbc55d232004-08-13 12:31:09 +00002332#line 1225 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002333{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
2334 break;}
2335case 124:
Lev Walkinbc55d232004-08-13 12:31:09 +00002336#line 1226 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002337{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
2338 break;}
2339case 125:
Lev Walkinbc55d232004-08-13 12:31:09 +00002340#line 1227 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002341{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
2342 break;}
2343case 126:
Lev Walkinbc55d232004-08-13 12:31:09 +00002344#line 1228 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002345{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
2346 break;}
2347case 127:
Lev Walkinbc55d232004-08-13 12:31:09 +00002348#line 1229 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002349{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
2350 break;}
2351case 128:
Lev Walkinbc55d232004-08-13 12:31:09 +00002352#line 1230 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002353{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
2354 break;}
2355case 129:
Lev Walkinbc55d232004-08-13 12:31:09 +00002356#line 1231 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002357{ yyval.a_type = ASN_BASIC_UTCTime; ;
2358 break;}
2359case 130:
Lev Walkinbc55d232004-08-13 12:31:09 +00002360#line 1232 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002361{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
2362 break;}
2363case 131:
Lev Walkinbc55d232004-08-13 12:31:09 +00002364#line 1239 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002365{ yyval.a_type = ASN_BASIC_INTEGER; ;
2366 break;}
2367case 132:
Lev Walkinbc55d232004-08-13 12:31:09 +00002368#line 1240 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002369{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
2370 break;}
2371case 133:
Lev Walkinbc55d232004-08-13 12:31:09 +00002372#line 1241 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002373{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
2374 break;}
2375case 134:
Lev Walkinbc55d232004-08-13 12:31:09 +00002376#line 1245 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002377{
Lev Walkinf15320b2004-06-03 03:38:44 +00002378 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2379 checkmem(yyval.a_expr);
2380 yyval.a_expr->expr_type = yyvsp[0].a_type;
2381 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002382 ;
2383 break;}
2384case 135:
Lev Walkinbc55d232004-08-13 12:31:09 +00002385#line 1251 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002386{
Lev Walkinf15320b2004-06-03 03:38:44 +00002387 if(yyvsp[0].a_expr) {
2388 yyval.a_expr = yyvsp[0].a_expr;
2389 } else {
2390 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2391 checkmem(yyval.a_expr);
2392 }
2393 yyval.a_expr->expr_type = yyvsp[-1].a_type;
2394 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002395 ;
2396 break;}
2397case 136:
Lev Walkinbc55d232004-08-13 12:31:09 +00002398#line 1264 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002399{ yyval.a_type = ASN_STRING_BMPString; ;
2400 break;}
2401case 137:
Lev Walkinbc55d232004-08-13 12:31:09 +00002402#line 1265 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002403{
Lev Walkinf15320b2004-06-03 03:38:44 +00002404 yyval.a_type = ASN_STRING_GeneralString;
2405 return yyerror("GeneralString is not supported");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002406 ;
2407 break;}
2408case 138:
Lev Walkinbc55d232004-08-13 12:31:09 +00002409#line 1269 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002410{
Lev Walkinf15320b2004-06-03 03:38:44 +00002411 yyval.a_type = ASN_STRING_GraphicString;
2412 return yyerror("GraphicString is not supported");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002413 ;
2414 break;}
2415case 139:
Lev Walkinbc55d232004-08-13 12:31:09 +00002416#line 1273 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002417{ yyval.a_type = ASN_STRING_IA5String; ;
2418 break;}
2419case 140:
Lev Walkinbc55d232004-08-13 12:31:09 +00002420#line 1274 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002421{ yyval.a_type = ASN_STRING_ISO646String; ;
2422 break;}
2423case 141:
Lev Walkinbc55d232004-08-13 12:31:09 +00002424#line 1275 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002425{ yyval.a_type = ASN_STRING_NumericString; ;
2426 break;}
2427case 142:
Lev Walkinbc55d232004-08-13 12:31:09 +00002428#line 1276 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002429{ yyval.a_type = ASN_STRING_PrintableString; ;
2430 break;}
2431case 143:
Lev Walkinbc55d232004-08-13 12:31:09 +00002432#line 1277 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002433{
Lev Walkinf15320b2004-06-03 03:38:44 +00002434 yyval.a_type = ASN_STRING_T61String;
2435 return yyerror("T61String not implemented yet");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002436 ;
2437 break;}
2438case 144:
Lev Walkinbc55d232004-08-13 12:31:09 +00002439#line 1281 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002440{ yyval.a_type = ASN_STRING_TeletexString; ;
2441 break;}
2442case 145:
Lev Walkinbc55d232004-08-13 12:31:09 +00002443#line 1282 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002444{ yyval.a_type = ASN_STRING_UniversalString; ;
2445 break;}
2446case 146:
Lev Walkinbc55d232004-08-13 12:31:09 +00002447#line 1283 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002448{ yyval.a_type = ASN_STRING_UTF8String; ;
2449 break;}
2450case 147:
Lev Walkinbc55d232004-08-13 12:31:09 +00002451#line 1284 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002452{
Lev Walkinf15320b2004-06-03 03:38:44 +00002453 yyval.a_type = ASN_STRING_VideotexString;
2454 return yyerror("VideotexString is no longer supported");
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002455 ;
2456 break;}
2457case 148:
Lev Walkinbc55d232004-08-13 12:31:09 +00002458#line 1288 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002459{ yyval.a_type = ASN_STRING_VisibleString; ;
2460 break;}
2461case 149:
Lev Walkinbc55d232004-08-13 12:31:09 +00002462#line 1289 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002463{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
2464 break;}
2465case 150:
Lev Walkinbc55d232004-08-13 12:31:09 +00002466#line 1293 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002467{
Lev Walkinf15320b2004-06-03 03:38:44 +00002468 yyval.a_expr = yyvsp[-1].a_expr;
2469 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2470 yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
2471 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002472 ;
2473 break;}
2474case 151:
Lev Walkinbc55d232004-08-13 12:31:09 +00002475#line 1299 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002476{
Lev Walkinf15320b2004-06-03 03:38:44 +00002477 yyval.a_expr = yyvsp[-1].a_expr;
2478 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2479 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
2480 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002481 ;
2482 break;}
2483case 152:
Lev Walkinbc55d232004-08-13 12:31:09 +00002484#line 1305 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002485{
Lev Walkinf15320b2004-06-03 03:38:44 +00002486 yyval.a_expr = yyvsp[-1].a_expr;
2487 assert(yyval.a_expr->expr_type == A1TC_INVALID);
2488 yyval.a_expr->expr_type = ASN_CONSTR_SET;
2489 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002490 ;
2491 break;}
2492case 153:
Lev Walkinbc55d232004-08-13 12:31:09 +00002493#line 1311 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002494{
Lev Walkinf15320b2004-06-03 03:38:44 +00002495 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2496 checkmem(yyval.a_expr);
2497 yyval.a_expr->constraints = yyvsp[-2].a_constr;
2498 yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
2499 yyval.a_expr->meta_type = AMT_TYPE;
2500 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002501 ;
2502 break;}
2503case 154:
Lev Walkinbc55d232004-08-13 12:31:09 +00002504#line 1319 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002505{
Lev Walkinf15320b2004-06-03 03:38:44 +00002506 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2507 checkmem(yyval.a_expr);
2508 yyval.a_expr->constraints = yyvsp[-2].a_constr;
2509 yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
2510 yyval.a_expr->meta_type = AMT_TYPE;
2511 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002512 ;
2513 break;}
2514case 155:
Lev Walkinbc55d232004-08-13 12:31:09 +00002515#line 1327 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002516{
Lev Walkinf15320b2004-06-03 03:38:44 +00002517 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2518 checkmem(yyval.a_expr);
2519 yyval.a_expr->expr_type = ASN_CONSTR_ANY;
2520 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002521 ;
2522 break;}
2523case 156:
Lev Walkinbc55d232004-08-13 12:31:09 +00002524#line 1333 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002525{
Lev Walkinf15320b2004-06-03 03:38:44 +00002526 int ret;
2527 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2528 checkmem(yyval.a_expr);
2529 yyval.a_expr->reference = asn1p_ref_new(yylineno);
2530 ret = asn1p_ref_add_component(yyval.a_expr->reference,
2531 yyvsp[0].tv_str, RLT_lowercase);
2532 checkmem(ret == 0);
2533 yyval.a_expr->expr_type = ASN_CONSTR_ANY;
2534 yyval.a_expr->meta_type = AMT_TYPE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002535 ;
2536 break;}
2537case 157:
Lev Walkinbc55d232004-08-13 12:31:09 +00002538#line 1350 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002539{ yyval.a_constr = 0; ;
2540 break;}
2541case 158:
Lev Walkinbc55d232004-08-13 12:31:09 +00002542#line 1351 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002543{ yyval.a_constr = yyvsp[0].a_constr; ;
2544 break;}
2545case 164:
Lev Walkinbc55d232004-08-13 12:31:09 +00002546#line 1359 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002547{
Lev Walkinf15320b2004-06-03 03:38:44 +00002548 /*
2549 * This is a special case, for compatibility purposes.
2550 * It goes without parenthesis.
2551 */
2552 int ret;
2553 yyval.a_constr = asn1p_constraint_new(yylineno);
2554 checkmem(yyval.a_constr);
2555 yyval.a_constr->type = ACT_CT_SIZE;
2556 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2557 checkmem(ret == 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002558 ;
2559 break;}
2560case 165:
Lev Walkinbc55d232004-08-13 12:31:09 +00002561#line 1371 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002562{
Lev Walkinf15320b2004-06-03 03:38:44 +00002563 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002564 ;
2565 break;}
2566case 166:
Lev Walkinbc55d232004-08-13 12:31:09 +00002567#line 1374 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002568{
Lev Walkinf15320b2004-06-03 03:38:44 +00002569 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-1].a_constr, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002570 ;
2571 break;}
2572case 167:
Lev Walkinbc55d232004-08-13 12:31:09 +00002573#line 1380 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002574{
Lev Walkinf15320b2004-06-03 03:38:44 +00002575 yyval.a_constr = yyvsp[-1].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002576 ;
2577 break;}
2578case 168:
Lev Walkinbc55d232004-08-13 12:31:09 +00002579#line 1386 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002580{
Lev Walkinf15320b2004-06-03 03:38:44 +00002581 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002582 ;
2583 break;}
2584case 169:
Lev Walkinbc55d232004-08-13 12:31:09 +00002585#line 1389 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002586{
Lev Walkinf15320b2004-06-03 03:38:44 +00002587 asn1p_constraint_t *ct;
2588 ct = asn1p_constraint_new(yylineno);
2589 checkmem(ct);
2590 ct->type = ACT_EL_EXT;
2591 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002592 ;
2593 break;}
2594case 170:
Lev Walkinbc55d232004-08-13 12:31:09 +00002595#line 1396 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002596{
Lev Walkinf15320b2004-06-03 03:38:44 +00002597 asn1p_constraint_t *ct;
2598 ct = asn1p_constraint_new(yylineno);
2599 checkmem(ct);
2600 ct->type = ACT_EL_EXT;
2601 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002602 ct = yyval.a_constr;
2603 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
2604 ;
2605 break;}
2606case 171:
2607#line 1405 "asn1p_y.y"
2608{
Lev Walkinf15320b2004-06-03 03:38:44 +00002609 yyval.a_constr = asn1p_constraint_new(yylineno);
2610 checkmem(yyval.a_constr);
2611 yyval.a_constr->type = ACT_EL_EXT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002612 ;
2613 break;}
2614case 172:
2615#line 1410 "asn1p_y.y"
2616{
Lev Walkinf15320b2004-06-03 03:38:44 +00002617 asn1p_constraint_t *ct;
2618 ct = asn1p_constraint_new(yylineno);
2619 checkmem(ct);
2620 ct->type = ACT_EL_EXT;
2621 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002622 ;
2623 break;}
2624case 173:
2625#line 1419 "asn1p_y.y"
2626{ yyval.a_constr = yyvsp[0].a_constr; ;
2627 break;}
2628case 174:
Lev Walkinbc55d232004-08-13 12:31:09 +00002629#line 1422 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002630{ yyval.a_constr = yyvsp[0].a_constr; ;
2631 break;}
2632case 175:
2633#line 1423 "asn1p_y.y"
2634{
Lev Walkinf15320b2004-06-03 03:38:44 +00002635 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002636 ;
2637 break;}
2638case 176:
2639#line 1429 "asn1p_y.y"
2640{ yyval.a_constr = yyvsp[0].a_constr; ;
2641 break;}
2642case 177:
2643#line 1431 "asn1p_y.y"
2644{
Lev Walkinf15320b2004-06-03 03:38:44 +00002645 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002646 ;
2647 break;}
2648case 178:
Lev Walkinbc55d232004-08-13 12:31:09 +00002649#line 1437 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002650{ yyval.a_constr = yyvsp[0].a_constr; ;
2651 break;}
2652case 179:
2653#line 1438 "asn1p_y.y"
2654{
Lev Walkinf15320b2004-06-03 03:38:44 +00002655 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002656 ;
2657 break;}
2658case 180:
2659#line 1444 "asn1p_y.y"
2660{
Lev Walkinf15320b2004-06-03 03:38:44 +00002661 yyval.a_constr = asn1p_constraint_new(yylineno);
2662 checkmem(yyval.a_constr);
2663 yyval.a_constr->type = ACT_EL_VALUE;
2664 yyval.a_constr->value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002665 ;
2666 break;}
2667case 181:
2668#line 1450 "asn1p_y.y"
2669{
Lev Walkinf15320b2004-06-03 03:38:44 +00002670 yyval.a_constr = asn1p_constraint_new(yylineno);
2671 checkmem(yyval.a_constr);
2672 yyval.a_constr->type = yyvsp[-1].a_ctype;
2673 yyval.a_constr->range_start = yyvsp[-2].a_value;
2674 yyval.a_constr->range_stop = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002675 ;
2676 break;}
2677case 182:
2678#line 1457 "asn1p_y.y"
2679{
Lev Walkinf15320b2004-06-03 03:38:44 +00002680 int ret;
2681 yyval.a_constr = asn1p_constraint_new(yylineno);
2682 checkmem(yyval.a_constr);
2683 yyval.a_constr->type = yyvsp[-3].a_ctype;
2684 ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
2685 checkmem(ret == 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002686 ;
2687 break;}
2688case 183:
2689#line 1465 "asn1p_y.y"
2690{
Lev Walkinf15320b2004-06-03 03:38:44 +00002691 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002692 ;
2693 break;}
2694case 184:
2695#line 1468 "asn1p_y.y"
2696{
Lev Walkinf15320b2004-06-03 03:38:44 +00002697 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002698 ;
2699 break;}
2700case 185:
Lev Walkinbc55d232004-08-13 12:31:09 +00002701#line 1474 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002702{ yyval.a_ctype = ACT_EL_RANGE; ;
2703 break;}
2704case 186:
Lev Walkinbc55d232004-08-13 12:31:09 +00002705#line 1475 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002706{ yyval.a_ctype = ACT_EL_RLRANGE; ;
2707 break;}
2708case 187:
Lev Walkinbc55d232004-08-13 12:31:09 +00002709#line 1476 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002710{ yyval.a_ctype = ACT_EL_LLRANGE; ;
2711 break;}
2712case 188:
2713#line 1477 "asn1p_y.y"
2714{ yyval.a_ctype = ACT_EL_ULRANGE; ;
2715 break;}
2716case 189:
2717#line 1481 "asn1p_y.y"
2718{
Lev Walkinf15320b2004-06-03 03:38:44 +00002719 yyval.a_ctype = ACT_CT_SIZE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002720 ;
2721 break;}
2722case 190:
2723#line 1484 "asn1p_y.y"
2724{
Lev Walkinf15320b2004-06-03 03:38:44 +00002725 yyval.a_ctype = ACT_CT_FROM;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002726 ;
2727 break;}
2728case 191:
2729#line 1490 "asn1p_y.y"
2730{
Lev Walkinf15320b2004-06-03 03:38:44 +00002731 yyval.a_value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002732 ;
2733 break;}
2734case 192:
2735#line 1493 "asn1p_y.y"
2736{
Lev Walkinf15320b2004-06-03 03:38:44 +00002737 asn1p_ref_t *ref;
2738 int ret;
2739 ref = asn1p_ref_new(yylineno);
2740 checkmem(ref);
2741 ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
2742 checkmem(ret == 0);
2743 yyval.a_value = asn1p_value_fromref(ref, 0);
2744 checkmem(yyval.a_value);
2745 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002746 ;
2747 break;}
2748case 193:
2749#line 1504 "asn1p_y.y"
2750{
Lev Walkinf15320b2004-06-03 03:38:44 +00002751 yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
2752 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002753 ;
2754 break;}
2755case 194:
2756#line 1508 "asn1p_y.y"
2757{
Lev Walkinf15320b2004-06-03 03:38:44 +00002758 yyval.a_value = asn1p_value_fromint(123);
2759 checkmem(yyval.a_value);
2760 yyval.a_value->type = ATV_MIN;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002761 ;
2762 break;}
2763case 195:
2764#line 1513 "asn1p_y.y"
2765{
Lev Walkinf15320b2004-06-03 03:38:44 +00002766 yyval.a_value = asn1p_value_fromint(321);
2767 checkmem(yyval.a_value);
2768 yyval.a_value->type = ATV_MAX;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002769 ;
2770 break;}
2771case 196:
2772#line 1518 "asn1p_y.y"
2773{
Lev Walkinf15320b2004-06-03 03:38:44 +00002774 yyval.a_value = asn1p_value_fromint(0);
2775 checkmem(yyval.a_value);
2776 yyval.a_value->type = ATV_FALSE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002777 ;
2778 break;}
2779case 197:
2780#line 1523 "asn1p_y.y"
2781{
Lev Walkinf15320b2004-06-03 03:38:44 +00002782 yyval.a_value = asn1p_value_fromint(1);
2783 checkmem(yyval.a_value);
2784 yyval.a_value->type = ATV_TRUE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002785 ;
2786 break;}
2787case 198:
2788#line 1531 "asn1p_y.y"
2789{
Lev Walkinf15320b2004-06-03 03:38:44 +00002790 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002791 ;
2792 break;}
2793case 199:
2794#line 1537 "asn1p_y.y"
2795{
Lev Walkinf15320b2004-06-03 03:38:44 +00002796 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002797 ;
2798 break;}
2799case 200:
2800#line 1540 "asn1p_y.y"
2801{
Lev Walkinf15320b2004-06-03 03:38:44 +00002802 CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002803 ;
2804 break;}
2805case 201:
2806#line 1546 "asn1p_y.y"
2807{
Lev Walkinf15320b2004-06-03 03:38:44 +00002808 yyval.a_constr = asn1p_constraint_new(yylineno);
2809 checkmem(yyval.a_constr);
2810 yyval.a_constr->type = ACT_EL_EXT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002811 ;
2812 break;}
2813case 202:
2814#line 1551 "asn1p_y.y"
2815{
Lev Walkinf15320b2004-06-03 03:38:44 +00002816 yyval.a_constr = asn1p_constraint_new(yylineno);
2817 checkmem(yyval.a_constr);
2818 yyval.a_constr->type = ACT_EL_VALUE;
2819 yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
2820 yyval.a_constr->presence = yyvsp[0].a_pres;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002821 ;
2822 break;}
2823case 203:
Lev Walkinbc55d232004-08-13 12:31:09 +00002824#line 1564 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002825{ yyval.a_pres = ACPRES_DEFAULT; ;
2826 break;}
2827case 204:
2828#line 1565 "asn1p_y.y"
2829{ yyval.a_pres = yyvsp[0].a_pres; ;
2830 break;}
2831case 205:
2832#line 1569 "asn1p_y.y"
2833{
Lev Walkinf15320b2004-06-03 03:38:44 +00002834 yyval.a_pres = ACPRES_PRESENT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002835 ;
2836 break;}
2837case 206:
2838#line 1572 "asn1p_y.y"
2839{
Lev Walkinf15320b2004-06-03 03:38:44 +00002840 yyval.a_pres = ACPRES_ABSENT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002841 ;
2842 break;}
2843case 207:
2844#line 1575 "asn1p_y.y"
2845{
Lev Walkinf15320b2004-06-03 03:38:44 +00002846 yyval.a_pres = ACPRES_OPTIONAL;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002847 ;
2848 break;}
2849case 208:
2850#line 1581 "asn1p_y.y"
2851{
Lev Walkinf15320b2004-06-03 03:38:44 +00002852 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002853 ;
2854 break;}
2855case 209:
2856#line 1584 "asn1p_y.y"
2857{
Lev Walkinf15320b2004-06-03 03:38:44 +00002858 yyval.a_constr = yyvsp[0].a_constr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002859 ;
2860 break;}
2861case 210:
2862#line 1593 "asn1p_y.y"
2863{
Lev Walkinf15320b2004-06-03 03:38:44 +00002864 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
2865 asn1p_constraint_t *ct;
2866 int ret;
2867 ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
2868 checkmem(ret == 0);
2869 ct = asn1p_constraint_new(yylineno);
2870 checkmem(yyval.a_constr);
2871 ct->type = ACT_EL_VALUE;
2872 ct->value = asn1p_value_fromref(ref, 0);
2873 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002874 ;
2875 break;}
2876case 211:
2877#line 1608 "asn1p_y.y"
2878{
Lev Walkinf15320b2004-06-03 03:38:44 +00002879 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002880 ;
2881 break;}
2882case 212:
2883#line 1614 "asn1p_y.y"
2884{
Lev Walkinf15320b2004-06-03 03:38:44 +00002885 yyval.a_constr = asn1p_constraint_new(yylineno);
2886 checkmem(yyval.a_constr);
2887 yyval.a_constr->type = ACT_EL_VALUE;
2888 yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002889 ;
2890 break;}
2891case 213:
2892#line 1620 "asn1p_y.y"
2893{
Lev Walkinf15320b2004-06-03 03:38:44 +00002894 asn1p_constraint_t *ct;
2895 ct = asn1p_constraint_new(yylineno);
2896 checkmem(ct);
2897 ct->type = ACT_EL_VALUE;
2898 ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
2899 CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002900 ;
2901 break;}
2902case 214:
2903#line 1634 "asn1p_y.y"
2904{
Lev Walkinf15320b2004-06-03 03:38:44 +00002905 char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
2906 int ret;
2907 *p = '@';
2908 strcpy(p + 1, yyvsp[0].tv_str);
2909 yyval.a_ref = asn1p_ref_new(yylineno);
2910 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
2911 checkmem(ret == 0);
2912 free(p);
2913 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002914 ;
2915 break;}
2916case 215:
2917#line 1645 "asn1p_y.y"
2918{
Lev Walkinf15320b2004-06-03 03:38:44 +00002919 char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
2920 int ret;
2921 p[0] = '@';
2922 p[1] = '.';
2923 strcpy(p + 2, yyvsp[0].tv_str);
2924 yyval.a_ref = asn1p_ref_new(yylineno);
2925 ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
2926 checkmem(ret == 0);
2927 free(p);
2928 free(yyvsp[0].tv_str);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002929 ;
2930 break;}
2931case 216:
2932#line 1661 "asn1p_y.y"
2933{
Lev Walkinf15320b2004-06-03 03:38:44 +00002934 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002935 ;
2936 break;}
2937case 217:
2938#line 1664 "asn1p_y.y"
2939{
Lev Walkinf15320b2004-06-03 03:38:44 +00002940 int l1 = strlen(yyvsp[-2].tv_str);
2941 int l3 = strlen(yyvsp[0].tv_str);
2942 yyval.tv_str = malloc(l1 + 1 + l3 + 1);
2943 memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
2944 yyval.tv_str[l1] = '.';
2945 memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
2946 yyval.tv_str[l1 + 1 + l3] = '\0';
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002947 ;
2948 break;}
2949case 218:
Lev Walkinbc55d232004-08-13 12:31:09 +00002950#line 1682 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002951{ yyval.a_marker = EM_NOMARK; ;
2952 break;}
2953case 219:
2954#line 1683 "asn1p_y.y"
2955{ yyval.a_marker = yyvsp[0].a_marker; ;
2956 break;}
2957case 220:
2958#line 1687 "asn1p_y.y"
2959{
Lev Walkinf15320b2004-06-03 03:38:44 +00002960 yyval.a_marker = EM_OPTIONAL;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002961 ;
2962 break;}
2963case 221:
2964#line 1690 "asn1p_y.y"
2965{
Lev Walkinf15320b2004-06-03 03:38:44 +00002966 yyval.a_marker = EM_DEFAULT;
2967 /* FIXME: store DefaultValue somewhere */
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002968 ;
2969 break;}
2970case 222:
2971#line 1697 "asn1p_y.y"
2972{
2973 ;
2974 break;}
2975case 223:
2976#line 1699 "asn1p_y.y"
2977{
2978 ;
2979 break;}
2980case 224:
2981#line 1701 "asn1p_y.y"
2982{ asn1p_lexer_hack_push_opaque_state(); ;
2983 break;}
2984case 225:
2985#line 1701 "asn1p_y.y"
2986{
2987 ;
2988 break;}
2989case 226:
2990#line 1722 "asn1p_y.y"
2991{
Lev Walkinf15320b2004-06-03 03:38:44 +00002992 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
2993 checkmem(yyval.a_expr);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00002994 ;
2995 break;}
2996case 227:
2997#line 1726 "asn1p_y.y"
2998{
Lev Walkinf15320b2004-06-03 03:38:44 +00002999 yyval.a_expr = yyvsp[-1].a_expr;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003000 ;
3001 break;}
3002case 228:
3003#line 1732 "asn1p_y.y"
3004{
Lev Walkinf15320b2004-06-03 03:38:44 +00003005 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3006 checkmem(yyval.a_expr);
3007 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003008 ;
3009 break;}
3010case 229:
3011#line 1737 "asn1p_y.y"
3012{
Lev Walkinf15320b2004-06-03 03:38:44 +00003013 yyval.a_expr = yyvsp[-2].a_expr;
3014 TQ_ADD(&(yyval.a_expr->members), yyvsp[0].a_expr, next);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003015 ;
3016 break;}
3017case 230:
3018#line 1744 "asn1p_y.y"
3019{
Lev Walkinf15320b2004-06-03 03:38:44 +00003020 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3021 checkmem(yyval.a_expr);
3022 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3023 yyval.a_expr->meta_type = AMT_VALUE;
3024 yyval.a_expr->Identifier = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003025 ;
3026 break;}
3027case 231:
3028#line 1751 "asn1p_y.y"
3029{
Lev Walkinf15320b2004-06-03 03:38:44 +00003030 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3031 checkmem(yyval.a_expr);
3032 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3033 yyval.a_expr->meta_type = AMT_VALUE;
3034 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3035 yyval.a_expr->value = yyvsp[-1].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003036 ;
3037 break;}
3038case 232:
3039#line 1759 "asn1p_y.y"
3040{
Lev Walkinf15320b2004-06-03 03:38:44 +00003041 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3042 checkmem(yyval.a_expr);
3043 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3044 yyval.a_expr->meta_type = AMT_VALUE;
3045 yyval.a_expr->Identifier = yyvsp[-3].tv_str;
3046 yyval.a_expr->value = yyvsp[-1].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003047 ;
3048 break;}
3049case 233:
3050#line 1767 "asn1p_y.y"
3051{
Lev Walkinf15320b2004-06-03 03:38:44 +00003052 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3053 checkmem(yyval.a_expr);
3054 yyval.a_expr->expr_type = A1TC_UNIVERVAL;
3055 yyval.a_expr->meta_type = AMT_VALUE;
3056 yyval.a_expr->value = yyvsp[0].a_value;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003057 ;
3058 break;}
3059case 234:
3060#line 1774 "asn1p_y.y"
3061{
Lev Walkinf15320b2004-06-03 03:38:44 +00003062 yyval.a_expr = asn1p_expr_new(asn1p_lineno);
3063 checkmem(yyval.a_expr);
3064 yyval.a_expr->Identifier = strdup("...");
3065 checkmem(yyval.a_expr->Identifier);
3066 yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
3067 yyval.a_expr->meta_type = AMT_VALUE;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003068 ;
3069 break;}
3070case 235:
3071#line 1785 "asn1p_y.y"
3072{
Lev Walkinf15320b2004-06-03 03:38:44 +00003073 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3074 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003075 ;
3076 break;}
3077case 236:
3078#line 1789 "asn1p_y.y"
3079{
Lev Walkinf15320b2004-06-03 03:38:44 +00003080 yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
3081 checkmem(yyval.a_value);
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003082 ;
3083 break;}
3084case 237:
Lev Walkinbc55d232004-08-13 12:31:09 +00003085#line 1820 "asn1p_y.y"
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003086{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
3087 break;}
3088case 238:
3089#line 1821 "asn1p_y.y"
3090{ yyval.a_tag = yyvsp[0].a_tag; ;
3091 break;}
3092case 239:
3093#line 1825 "asn1p_y.y"
3094{
Lev Walkinf15320b2004-06-03 03:38:44 +00003095 yyval.a_tag = yyvsp[0].a_tag;
3096 yyval.a_tag.tag_mode = TM_DEFAULT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003097 ;
3098 break;}
3099case 240:
3100#line 1829 "asn1p_y.y"
3101{
Lev Walkinf15320b2004-06-03 03:38:44 +00003102 yyval.a_tag = yyvsp[-1].a_tag;
3103 yyval.a_tag.tag_mode = TM_IMPLICIT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003104 ;
3105 break;}
3106case 241:
3107#line 1833 "asn1p_y.y"
3108{
Lev Walkinf15320b2004-06-03 03:38:44 +00003109 yyval.a_tag = yyvsp[-1].a_tag;
3110 yyval.a_tag.tag_mode = TM_EXPLICIT;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003111 ;
3112 break;}
3113case 242:
3114#line 1840 "asn1p_y.y"
3115{
Lev Walkinf15320b2004-06-03 03:38:44 +00003116 checkmem(yyvsp[0].tv_str);
3117 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003118 ;
3119 break;}
3120case 243:
3121#line 1844 "asn1p_y.y"
3122{
Lev Walkinf15320b2004-06-03 03:38:44 +00003123 checkmem(yyvsp[0].tv_str);
3124 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003125 ;
3126 break;}
3127case 244:
3128#line 1851 "asn1p_y.y"
3129{
Lev Walkinf15320b2004-06-03 03:38:44 +00003130 checkmem(yyvsp[0].tv_str);
3131 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003132 ;
3133 break;}
3134case 245:
3135#line 1858 "asn1p_y.y"
3136{
Lev Walkinf15320b2004-06-03 03:38:44 +00003137 checkmem(yyvsp[0].tv_str);
3138 yyval.tv_str = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003139 ;
3140 break;}
3141case 246:
3142#line 1865 "asn1p_y.y"
3143{
Lev Walkinf15320b2004-06-03 03:38:44 +00003144 memset(&yyval.tv_nametag, 0, sizeof(yyval.tv_nametag));
3145 yyval.tv_nametag.name = yyvsp[0].tv_str;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003146 ;
3147 break;}
3148case 247:
3149#line 1869 "asn1p_y.y"
3150{
Lev Walkinf15320b2004-06-03 03:38:44 +00003151 yyval.tv_nametag.name = yyvsp[-1].tv_str;
3152 yyval.tv_nametag.tag = yyvsp[0].a_tag;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003153 ;
3154 break;}
3155}
3156 /* the action file gets copied in in place of this dollarsign */
3157#line 543 "/usr/share/bison.simple"
Lev Walkinf15320b2004-06-03 03:38:44 +00003158
3159 yyvsp -= yylen;
3160 yyssp -= yylen;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003161#ifdef YYLSP_NEEDED
3162 yylsp -= yylen;
3163#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003164
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003165#if YYDEBUG != 0
Lev Walkinf15320b2004-06-03 03:38:44 +00003166 if (yydebug)
3167 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003168 short *ssp1 = yyss - 1;
3169 fprintf (stderr, "state stack now");
3170 while (ssp1 != yyssp)
3171 fprintf (stderr, " %d", *++ssp1);
3172 fprintf (stderr, "\n");
Lev Walkinf15320b2004-06-03 03:38:44 +00003173 }
3174#endif
3175
3176 *++yyvsp = yyval;
3177
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003178#ifdef YYLSP_NEEDED
3179 yylsp++;
3180 if (yylen == 0)
3181 {
3182 yylsp->first_line = yylloc.first_line;
3183 yylsp->first_column = yylloc.first_column;
3184 yylsp->last_line = (yylsp-1)->last_line;
3185 yylsp->last_column = (yylsp-1)->last_column;
3186 yylsp->text = 0;
3187 }
3188 else
3189 {
3190 yylsp->last_line = (yylsp+yylen-1)->last_line;
3191 yylsp->last_column = (yylsp+yylen-1)->last_column;
3192 }
3193#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003194
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003195 /* Now "shift" the result of the reduction.
3196 Determine what state that goes to,
3197 based on the state we popped back to
3198 and the rule number reduced by. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003199
3200 yyn = yyr1[yyn];
3201
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003202 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3203 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00003204 yystate = yytable[yystate];
3205 else
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003206 yystate = yydefgoto[yyn - YYNTBASE];
Lev Walkinf15320b2004-06-03 03:38:44 +00003207
3208 goto yynewstate;
3209
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003210yyerrlab: /* here on detecting error */
Lev Walkinf15320b2004-06-03 03:38:44 +00003211
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003212 if (! yyerrstatus)
3213 /* If not already recovering from an error, report this error. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003214 {
3215 ++yynerrs;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003216
3217#ifdef YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +00003218 yyn = yypact[yystate];
3219
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003220 if (yyn > YYFLAG && yyn < YYLAST)
Lev Walkinf15320b2004-06-03 03:38:44 +00003221 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003222 int size = 0;
3223 char *msg;
3224 int x, count;
Lev Walkinf15320b2004-06-03 03:38:44 +00003225
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003226 count = 0;
3227 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
3228 for (x = (yyn < 0 ? -yyn : 0);
3229 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3230 if (yycheck[x + yyn] == x)
3231 size += strlen(yytname[x]) + 15, count++;
3232 msg = (char *) malloc(size + 15);
3233 if (msg != 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00003234 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003235 strcpy(msg, "parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003236
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003237 if (count < 5)
Lev Walkinf15320b2004-06-03 03:38:44 +00003238 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003239 count = 0;
3240 for (x = (yyn < 0 ? -yyn : 0);
3241 x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
3242 if (yycheck[x + yyn] == x)
Lev Walkinf15320b2004-06-03 03:38:44 +00003243 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003244 strcat(msg, count == 0 ? ", expecting `" : " or `");
3245 strcat(msg, yytname[x]);
3246 strcat(msg, "'");
3247 count++;
Lev Walkinf15320b2004-06-03 03:38:44 +00003248 }
3249 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003250 yyerror(msg);
3251 free(msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00003252 }
3253 else
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003254 yyerror ("parse error; also virtual memory exceeded");
Lev Walkinf15320b2004-06-03 03:38:44 +00003255 }
3256 else
3257#endif /* YYERROR_VERBOSE */
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003258 yyerror("parse error");
Lev Walkinf15320b2004-06-03 03:38:44 +00003259 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003260
Lev Walkinf15320b2004-06-03 03:38:44 +00003261 goto yyerrlab1;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003262yyerrlab1: /* here on error raised explicitly by an action */
Lev Walkinf15320b2004-06-03 03:38:44 +00003263
3264 if (yyerrstatus == 3)
3265 {
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003266 /* if just tried and failed to reuse lookahead token after an error, discard it. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003267
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003268 /* return failure if at end of input */
Lev Walkinf15320b2004-06-03 03:38:44 +00003269 if (yychar == YYEOF)
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003270 YYABORT;
Lev Walkinf15320b2004-06-03 03:38:44 +00003271
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003272#if YYDEBUG != 0
3273 if (yydebug)
3274 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3275#endif
3276
Lev Walkinf15320b2004-06-03 03:38:44 +00003277 yychar = YYEMPTY;
3278 }
3279
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003280 /* Else will try to reuse lookahead token
3281 after shifting the error token. */
Lev Walkinf15320b2004-06-03 03:38:44 +00003282
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003283 yyerrstatus = 3; /* Each real token shifted decrements this */
Lev Walkinf15320b2004-06-03 03:38:44 +00003284
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003285 goto yyerrhandle;
Lev Walkinc3b72e92004-06-03 05:07:41 +00003286
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003287yyerrdefault: /* current state does not do anything special for the error token. */
Lev Walkinc3b72e92004-06-03 05:07:41 +00003288
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003289#if 0
3290 /* This is wrong; only states that explicitly want error tokens
3291 should shift them. */
3292 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3293 if (yyn) goto yydefault;
Lev Walkinf15320b2004-06-03 03:38:44 +00003294#endif
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003295
3296yyerrpop: /* pop the current state because it cannot handle the error token */
3297
3298 if (yyssp == yyss) YYABORT;
3299 yyvsp--;
3300 yystate = *--yyssp;
3301#ifdef YYLSP_NEEDED
3302 yylsp--;
3303#endif
3304
3305#if YYDEBUG != 0
3306 if (yydebug)
3307 {
3308 short *ssp1 = yyss - 1;
3309 fprintf (stderr, "Error: state stack now");
3310 while (ssp1 != yyssp)
3311 fprintf (stderr, " %d", *++ssp1);
3312 fprintf (stderr, "\n");
Lev Walkinf15320b2004-06-03 03:38:44 +00003313 }
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003314#endif
3315
3316yyerrhandle:
3317
3318 yyn = yypact[yystate];
3319 if (yyn == YYFLAG)
3320 goto yyerrdefault;
3321
3322 yyn += YYTERROR;
3323 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3324 goto yyerrdefault;
3325
3326 yyn = yytable[yyn];
3327 if (yyn < 0)
3328 {
3329 if (yyn == YYFLAG)
3330 goto yyerrpop;
3331 yyn = -yyn;
3332 goto yyreduce;
3333 }
3334 else if (yyn == 0)
3335 goto yyerrpop;
Lev Walkinf15320b2004-06-03 03:38:44 +00003336
3337 if (yyn == YYFINAL)
3338 YYACCEPT;
3339
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003340#if YYDEBUG != 0
3341 if (yydebug)
3342 fprintf(stderr, "Shifting error token, ");
3343#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003344
3345 *++yyvsp = yylval;
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003346#ifdef YYLSP_NEEDED
3347 *++yylsp = yylloc;
3348#endif
Lev Walkinf15320b2004-06-03 03:38:44 +00003349
3350 yystate = yyn;
3351 goto yynewstate;
3352
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003353 yyacceptlab:
3354 /* YYACCEPT comes here. */
3355 if (yyfree_stacks)
3356 {
3357 free (yyss);
3358 free (yyvs);
3359#ifdef YYLSP_NEEDED
3360 free (yyls);
Lev Walkinf15320b2004-06-03 03:38:44 +00003361#endif
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003362 }
3363 return 0;
Lev Walkinc3b72e92004-06-03 05:07:41 +00003364
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003365 yyabortlab:
3366 /* YYABORT comes here. */
3367 if (yyfree_stacks)
3368 {
3369 free (yyss);
3370 free (yyvs);
3371#ifdef YYLSP_NEEDED
3372 free (yyls);
Lev Walkinc3b72e92004-06-03 05:07:41 +00003373#endif
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003374 }
3375 return 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00003376}
Lev Walkinb4fcdd22004-08-13 12:35:09 +00003377#line 1876 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +00003378
3379
3380
3381/*
3382 * Convert Xstring ('0101'B or '5'H) to the binary vector.
3383 */
3384static asn1p_value_t *
3385_convert_bitstring2binary(char *str, int base) {
3386 asn1p_value_t *val;
3387 int slen;
3388 int memlen;
3389 int baselen;
3390 int bits;
3391 uint8_t *binary_vector;
3392 uint8_t *bv_ptr;
3393 uint8_t cur_val;
3394
3395 assert(str);
3396 assert(str[0] == '\'');
3397
3398 switch(base) {
3399 case 'B':
3400 baselen = 1;
3401 break;
3402 case 'H':
3403 baselen = 4;
3404 break;
3405 default:
3406 assert(base == 'B' || base == 'H');
3407 errno = EINVAL;
3408 return NULL;
3409 }
3410
3411 slen = strlen(str);
3412 assert(str[slen - 1] == base);
3413 assert(str[slen - 2] == '\'');
3414
3415 memlen = slen / (8 / baselen); /* Conservative estimate */
3416
3417 bv_ptr = binary_vector = malloc(memlen + 1);
3418 if(bv_ptr == NULL)
3419 /* ENOMEM */
3420 return NULL;
3421
3422 cur_val = 0;
3423 bits = 0;
3424 while(*(++str) != '\'') {
3425 switch(baselen) {
3426 case 1:
3427 switch(*str) {
3428 case '1':
3429 cur_val |= 1 << (7 - (bits % 8));
3430 case '0':
3431 break;
3432 default:
3433 assert(!"_y UNREACH1");
3434 case ' ': case '\r': case '\n':
3435 continue;
3436 }
3437 break;
3438 case 4:
3439 switch(*str) {
3440 case '0': case '1': case '2': case '3': case '4':
3441 case '5': case '6': case '7': case '8': case '9':
3442 cur_val |= (*str - '0') << (4 - (bits % 8));
3443 break;
3444 case 'A': case 'B': case 'C':
3445 case 'D': case 'E': case 'F':
3446 cur_val |= ((*str - 'A') + 10)
3447 << (4 - (bits % 8));
3448 break;
3449 default:
3450 assert(!"_y UNREACH2");
3451 case ' ': case '\r': case '\n':
3452 continue;
3453 }
3454 break;
3455 }
3456
3457 bits += baselen;
3458 if((bits % 8) == 0) {
3459 *bv_ptr++ = cur_val;
3460 cur_val = 0;
3461 }
3462 }
3463
3464 *bv_ptr = cur_val;
3465 assert((bv_ptr - binary_vector) <= memlen);
3466
3467 val = asn1p_value_frombits(binary_vector, bits, 0);
3468 if(val == NULL) {
3469 free(binary_vector);
3470 }
3471
3472 return val;
3473}
3474
3475extern char *asn1p_text;
3476
3477int
3478yyerror(const char *msg) {
3479 fprintf(stderr,
3480 "ASN.1 grammar parse error "
3481 "near line %d (token \"%s\"): %s\n",
3482 asn1p_lineno, asn1p_text, msg);
3483 return -1;
3484}
3485
3486