blob: 6aa198347f2853ac066a9fcda66af9643143aca5 [file] [log] [blame]
/* A Bison parser, made from asn1p_y.y
by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */
#define yyparse asn1p_parse
#define yylex asn1p_lex
#define yyerror asn1p_error
#define yylval asn1p_lval
#define yychar asn1p_char
#define yydebug asn1p_debug
#define yynerrs asn1p_nerrs
#define TOK_PPEQ 257
#define TOK_opaque 258
#define TOK_bstring 259
#define TOK_cstring 260
#define TOK_hstring 261
#define TOK_identifier 262
#define TOK_number 263
#define TOK_number_negative 264
#define TOK_typereference 265
#define TOK_capitalreference 266
#define TOK_typefieldreference 267
#define TOK_valuefieldreference 268
#define TOK_ABSENT 269
#define TOK_ABSTRACT_SYNTAX 270
#define TOK_ALL 271
#define TOK_ANY 272
#define TOK_APPLICATION 273
#define TOK_AUTOMATIC 274
#define TOK_BEGIN 275
#define TOK_BIT 276
#define TOK_BMPString 277
#define TOK_BOOLEAN 278
#define TOK_BY 279
#define TOK_CHARACTER 280
#define TOK_CHOICE 281
#define TOK_CLASS 282
#define TOK_COMPONENT 283
#define TOK_COMPONENTS 284
#define TOK_CONSTRAINED 285
#define TOK_CONTAINING 286
#define TOK_DEFAULT 287
#define TOK_DEFINITIONS 288
#define TOK_DEFINED 289
#define TOK_EMBEDDED 290
#define TOK_ENCODED 291
#define TOK_ENCODING_CONTROL 292
#define TOK_END 293
#define TOK_ENUMERATED 294
#define TOK_EXPLICIT 295
#define TOK_EXPORTS 296
#define TOK_EXTENSIBILITY 297
#define TOK_EXTERNAL 298
#define TOK_FALSE 299
#define TOK_FROM 300
#define TOK_GeneralizedTime 301
#define TOK_GeneralString 302
#define TOK_GraphicString 303
#define TOK_IA5String 304
#define TOK_IDENTIFIER 305
#define TOK_IMPLICIT 306
#define TOK_IMPLIED 307
#define TOK_IMPORTS 308
#define TOK_INCLUDES 309
#define TOK_INSTANCE 310
#define TOK_INSTRUCTIONS 311
#define TOK_INTEGER 312
#define TOK_ISO646String 313
#define TOK_MAX 314
#define TOK_MIN 315
#define TOK_MINUS_INFINITY 316
#define TOK_NULL 317
#define TOK_NumericString 318
#define TOK_OBJECT 319
#define TOK_ObjectDescriptor 320
#define TOK_OCTET 321
#define TOK_OF 322
#define TOK_OPTIONAL 323
#define TOK_PATTERN 324
#define TOK_PDV 325
#define TOK_PLUS_INFINITY 326
#define TOK_PRESENT 327
#define TOK_PrintableString 328
#define TOK_PRIVATE 329
#define TOK_REAL 330
#define TOK_RELATIVE_OID 331
#define TOK_SEQUENCE 332
#define TOK_SET 333
#define TOK_SIZE 334
#define TOK_STRING 335
#define TOK_SYNTAX 336
#define TOK_T61String 337
#define TOK_TAGS 338
#define TOK_TeletexString 339
#define TOK_TRUE 340
#define TOK_TYPE_IDENTIFIER 341
#define TOK_UNIQUE 342
#define TOK_UNIVERSAL 343
#define TOK_UniversalString 344
#define TOK_UTCTime 345
#define TOK_UTF8String 346
#define TOK_VideotexString 347
#define TOK_VisibleString 348
#define TOK_WITH 349
#define TOK_EXCEPT 350
#define TOK_INTERSECTION 351
#define TOK_UNION 352
#define TOK_TwoDots 353
#define TOK_ThreeDots 354
#line 1 "asn1p_y.y"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include "asn1parser.h"
#define YYPARSE_PARAM param
#define YYERROR_VERBOSE
int yylex(void);
int yyerror(const char *msg);
void asn1p_lexer_hack_push_opaque_state(void);
void asn1p_lexer_hack_enable_with_syntax(void);
void asn1p_lexer_hack_push_encoding_control(void);
#define yylineno asn1p_lineno
extern int asn1p_lineno;
static asn1p_value_t *
_convert_bitstring2binary(char *str, int base);
#define checkmem(ptr) do { \
if(!(ptr)) \
return yyerror("Memory failure"); \
} while(0)
#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
if(arg1->type != constr_type) { \
int __ret; \
root = asn1p_constraint_new(yylineno); \
checkmem(root); \
root->type = constr_type; \
__ret = asn1p_constraint_insert(root, \
arg1); \
checkmem(__ret == 0); \
} else { \
root = arg1; \
} \
if(arg2) { \
int __ret \
= asn1p_constraint_insert(root, arg2); \
checkmem(__ret == 0); \
} \
} while(0)
#line 58 "asn1p_y.y"
typedef union {
asn1p_t *a_grammar;
asn1p_module_flags_e a_module_flags;
asn1p_module_t *a_module;
asn1p_expr_type_e a_type; /* ASN.1 Type */
asn1p_expr_t *a_expr; /* Constructed collection */
asn1p_constraint_t *a_constr; /* Constraint */
enum asn1p_constraint_type_e a_ctype;/* Constraint type */
asn1p_xports_t *a_xports; /* IMports/EXports */
asn1p_oid_t *a_oid; /* Object Identifier */
asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
struct asn1p_type_tag_s a_tag; /* A tag */
asn1p_ref_t *a_ref; /* Reference to custom type */
asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
asn1p_value_t *a_value; /* Number, DefinedValue, etc */
struct asn1p_param_s a_parg; /* A parameter argument */
asn1p_paramlist_t *a_plist; /* A pargs list */
struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
asn1c_integer_t a_int;
char *tv_str;
struct {
char *buf;
int len;
} tv_opaque;
struct {
char *name;
struct asn1p_type_tag_s tag;
} tv_nametag;
} YYSTYPE;
#include <stdio.h>
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
#define YYFINAL 418
#define YYFLAG -32768
#define YYNTBASE 116
#define YYTRANSLATE(x) ((unsigned)(x) <= 354 ? yytranslate[x] : 218)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 110, 2, 2, 2, 2, 2, 2, 105,
106, 2, 2, 108, 2, 111, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 109, 107, 112,
2, 2, 2, 113, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114, 2, 115, 97, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 103, 99, 104, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
98, 100, 101, 102
};
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
0, 2, 4, 7, 16, 17, 19, 23, 26, 28,
31, 33, 38, 40, 41, 43, 45, 48, 51, 54,
57, 60, 63, 64, 66, 68, 71, 73, 75, 77,
79, 81, 82, 86, 88, 92, 95, 97, 100, 105,
107, 111, 113, 117, 119, 123, 127, 130, 132, 136,
138, 142, 144, 151, 153, 155, 156, 158, 160, 164,
166, 168, 173, 177, 181, 188, 190, 194, 196, 200,
204, 208, 210, 214, 216, 218, 219, 221, 223, 227,
231, 235, 237, 239, 243, 246, 248, 254, 255, 257,
259, 263, 266, 271, 276, 277, 279, 280, 287, 289,
292, 294, 296, 298, 302, 306, 310, 312, 317, 322,
327, 334, 341, 343, 348, 353, 355, 359, 361, 365,
369, 373, 375, 379, 381, 385, 387, 389, 391, 393,
398, 402, 403, 407, 409, 411, 413, 415, 417, 419,
421, 423, 425, 429, 431, 434, 436, 438, 440, 442,
445, 448, 450, 452, 455, 458, 460, 462, 464, 466,
468, 471, 473, 476, 478, 480, 482, 484, 486, 488,
490, 492, 494, 496, 498, 500, 502, 504, 506, 508,
510, 512, 514, 515, 517, 519, 524, 528, 533, 535,
539, 545, 547, 551, 555, 559, 564, 568, 570, 572,
576, 580, 584, 588, 590, 592, 594, 597, 600, 604,
606, 608, 610, 612, 614, 616, 618, 620, 626, 628,
632, 634, 638, 639, 641, 643, 645, 647, 649, 651,
655, 660, 662, 666, 669, 673, 675, 679, 680, 682,
684, 687, 690, 694, 696, 700, 702, 707, 712, 714,
716, 718, 720, 721, 723, 726, 731, 732, 734, 736,
738, 739, 741, 743, 745, 747, 749, 750, 752
};
static const short yyrhs[] = { 117,
0, 118, 0, 117, 118, 0, 214, 119, 34, 123,
3, 21, 126, 39, 0, 0, 120, 0, 103, 121,
104, 0, 103, 104, 0, 122, 0, 121, 122, 0,
217, 0, 217, 105, 9, 106, 0, 9, 0, 0,
124, 0, 125, 0, 124, 125, 0, 41, 84, 0,
52, 84, 0, 20, 84, 0, 43, 53, 0, 12,
57, 0, 0, 127, 0, 128, 0, 127, 128, 0,
130, 0, 135, 0, 143, 0, 170, 0, 138, 0,
0, 38, 12, 129, 0, 178, 0, 54, 131, 107,
0, 54, 46, 0, 132, 0, 131, 132, 0, 133,
46, 214, 119, 0, 134, 0, 133, 108, 134, 0,
214, 0, 214, 103, 104, 0, 217, 0, 42, 136,
107, 0, 42, 17, 107, 0, 42, 107, 0, 137,
0, 136, 108, 137, 0, 214, 0, 214, 103, 104,
0, 217, 0, 214, 139, 3, 103, 140, 104, 0,
165, 0, 175, 0, 0, 141, 0, 142, 0, 141,
108, 142, 0, 102, 0, 186, 0, 214, 3, 209,
87, 0, 214, 3, 163, 0, 214, 3, 153, 0,
214, 103, 144, 104, 3, 163, 0, 145, 0, 144,
108, 145, 0, 214, 0, 214, 109, 217, 0, 214,
109, 214, 0, 175, 109, 217, 0, 147, 0, 146,
108, 147, 0, 163, 0, 217, 0, 0, 149, 0,
150, 0, 149, 108, 150, 0, 217, 163, 203, 0,
30, 68, 163, 0, 162, 0, 152, 0, 151, 108,
152, 0, 217, 163, 0, 162, 0, 28, 103, 155,
104, 157, 0, 0, 88, 0, 156, 0, 155, 108,
156, 0, 168, 203, 0, 168, 163, 154, 203, 0,
168, 168, 154, 203, 0, 0, 158, 0, 0, 95,
82, 103, 159, 160, 104, 0, 161, 0, 160, 161,
0, 4, 0, 168, 0, 102, 0, 102, 110, 173,
0, 102, 110, 208, 0, 209, 164, 182, 0, 177,
0, 27, 103, 151, 104, 0, 78, 103, 148, 104,
0, 79, 103, 148, 104, 0, 78, 182, 68, 216,
209, 164, 0, 79, 182, 68, 216, 209, 164, 0,
18, 0, 18, 35, 25, 217, 0, 214, 103, 146,
104, 0, 165, 0, 56, 68, 165, 0, 11, 0,
11, 111, 214, 0, 215, 111, 214, 0, 11, 111,
217, 0, 215, 0, 215, 111, 166, 0, 167, 0,
166, 111, 167, 0, 169, 0, 169, 0, 13, 0,
14, 0, 217, 139, 3, 171, 0, 217, 109, 171,
0, 0, 103, 172, 174, 0, 63, 0, 45, 0,
86, 0, 5, 0, 7, 0, 6, 0, 208, 0,
173, 0, 217, 0, 214, 111, 217, 0, 4, 0,
174, 4, 0, 24, 0, 63, 0, 76, 0, 176,
0, 67, 81, 0, 65, 51, 0, 77, 0, 44,
0, 36, 71, 0, 26, 81, 0, 91, 0, 47,
0, 178, 0, 58, 0, 40, 0, 22, 81, 0,
175, 0, 176, 205, 0, 23, 0, 48, 0, 49,
0, 50, 0, 59, 0, 64, 0, 74, 0, 83,
0, 85, 0, 90, 0, 92, 0, 93, 0, 94,
0, 66, 0, 99, 0, 100, 0, 97, 0, 98,
0, 96, 0, 0, 183, 0, 184, 0, 80, 105,
185, 106, 0, 105, 185, 106, 0, 184, 105, 185,
106, 0, 186, 0, 186, 108, 102, 0, 186, 108,
102, 108, 186, 0, 187, 0, 186, 179, 187, 0,
186, 180, 187, 0, 187, 181, 187, 0, 189, 105,
185, 106, 0, 105, 185, 106, 0, 190, 0, 191,
0, 190, 188, 190, 0, 61, 188, 190, 0, 190,
188, 60, 0, 61, 188, 60, 0, 197, 0, 192,
0, 101, 0, 101, 112, 0, 112, 101, 0, 112,
101, 112, 0, 80, 0, 46, 0, 45, 0, 86,
0, 208, 0, 6, 0, 217, 0, 214, 0, 95,
30, 103, 193, 104, 0, 194, 0, 193, 108, 194,
0, 102, 0, 217, 182, 195, 0, 0, 196, 0,
73, 0, 15, 0, 69, 0, 198, 0, 199, 0,
103, 214, 104, 0, 198, 103, 200, 104, 0, 201,
0, 200, 108, 201, 0, 113, 202, 0, 113, 111,
202, 0, 217, 0, 202, 111, 217, 0, 0, 204,
0, 69, 0, 33, 171, 0, 103, 104, 0, 103,
206, 104, 0, 207, 0, 206, 108, 207, 0, 217,
0, 217, 105, 208, 106, 0, 217, 105, 173, 106,
0, 208, 0, 102, 0, 9, 0, 10, 0, 0,
210, 0, 211, 213, 0, 114, 212, 9, 115, 0,
0, 89, 0, 19, 0, 75, 0, 0, 52, 0,
41, 0, 11, 0, 12, 0, 12, 0, 0, 217,
0, 8, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
302, 308, 314, 330, 355, 357, 360, 364, 369, 376,
384, 389, 393, 402, 404, 412, 416, 424, 428, 431,
434, 438, 458, 460, 468, 472, 504, 508, 517, 524,
537, 544, 546, 558, 571, 578, 583, 589, 595, 604,
610, 616, 623, 629, 637, 641, 644, 651, 657, 663,
670, 676, 685, 695, 703, 711, 713, 723, 726, 730,
733, 745, 757, 763, 779, 788, 798, 808, 813, 820,
827, 837, 843, 849, 853, 876, 878, 880, 886, 892,
899, 906, 911, 917, 923, 929, 934, 944, 946, 949,
957, 963, 972, 978, 995, 997, 1002, 1006, 1011, 1016,
1022, 1026, 1037, 1046, 1055, 1066, 1088, 1092, 1098, 1104,
1110, 1120, 1130, 1136, 1150, 1174, 1181, 1195, 1204, 1214,
1224, 1234, 1242, 1263, 1272, 1281, 1282, 1284, 1291, 1303,
1313, 1321, 1321, 1326, 1331, 1336, 1341, 1345, 1349, 1353,
1356, 1361, 1373, 1389, 1400, 1414, 1416, 1417, 1418, 1419,
1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1433, 1435,
1436, 1439, 1446, 1458, 1460, 1464, 1468, 1469, 1470, 1471,
1472, 1476, 1477, 1478, 1479, 1483, 1484, 1491, 1491, 1492,
1492, 1493, 1495, 1497, 1502, 1506, 1515, 1519, 1524, 1528,
1534, 1544, 1548, 1551, 1554, 1559, 1568, 1576, 1582, 1588,
1595, 1603, 1611, 1620, 1623, 1628, 1630, 1631, 1632, 1635,
1639, 1644, 1650, 1655, 1658, 1662, 1675, 1689, 1695, 1699,
1704, 1710, 1722, 1724, 1727, 1731, 1734, 1739, 1743, 1751,
1766, 1772, 1779, 1792, 1804, 1819, 1823, 1840, 1845, 1848,
1853, 1875, 1880, 1885, 1891, 1897, 1905, 1913, 1921, 1928,
1938, 1943, 1973, 1975, 1978, 1985, 1991, 1993, 1994, 1995,
1998, 2000, 2001, 2004, 2009, 2016, 2023, 2025, 2029
};
#endif
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
"TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier","TOK_number",
"TOK_number_negative","TOK_typereference","TOK_capitalreference","TOK_typefieldreference",
"TOK_valuefieldreference","TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY",
"TOK_APPLICATION","TOK_AUTOMATIC","TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN",
"TOK_BY","TOK_CHARACTER","TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS",
"TOK_CONSTRAINED","TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED",
"TOK_EMBEDDED","TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED",
"TOK_EXPLICIT","TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE",
"TOK_FROM","TOK_GeneralizedTime","TOK_GeneralString","TOK_GraphicString","TOK_IA5String",
"TOK_IDENTIFIER","TOK_IMPLICIT","TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE",
"TOK_INSTRUCTIONS","TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY",
"TOK_NULL","TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET",
"TOK_OF","TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT",
"TOK_PrintableString","TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE",
"TOK_SET","TOK_SIZE","TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString",
"TOK_TRUE","TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString",
"TOK_UTCTime","TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH",
"TOK_EXCEPT","'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots",
"'{'","'}'","'('","')'","';'","','","':'","'!'","'.'","'<'","'@'","'['","']'",
"ParsedGrammar","ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
"ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition",
"ImportsBundleSet","ImportsBundle","ImportsList","ImportsElement","ExportsDefinition",
"ExportsBody","ExportsElement","ValueSetDefinition","DefinedTypeRef","optValueSetBody",
"ValueSetBody","ValueSetElement","DataTypeReference","ParameterArgumentList",
"ParameterArgumentName","ActualParameterList","ActualParameter","optComponentTypeLists",
"ComponentTypeLists","ComponentType","AlternativeTypeLists","AlternativeType",
"ClassDeclaration","optUnique","ClassFieldList","ClassField","optWithSyntax",
"WithSyntax","@2","WithSyntaxFormat","WithSyntaxFormatToken","ExtensionAndException",
"Type","TypeDeclaration","ComplexTypeReference","ComplexTypeReferenceAmpList",
"ComplexTypeReferenceElement","ClassFieldIdentifier","ClassFieldName","ValueDefinition",
"Value","@3","DefinedValue","Opaque","BasicTypeId","BasicTypeId_UniverationCompatible",
"BasicType","BasicString","Union","Intersection","Except","optConstraints","Constraints",
"SetOfConstraints","ElementSetSpecs","ElementSetSpec","ConstraintSubtypeElement",
"ConstraintRangeSpec","ConstraintSpec","SingleValue","ContainedSubtype","WithComponents",
"WithComponentsList","WithComponentsElement","optPresenceConstraint","PresenceConstraint",
"TableConstraint","SimpleTableConstraint","ComponentRelationConstraint","AtNotationList",
"AtNotationElement","ComponentIdList","optMarker","Marker","UniverationDefinition",
"UniverationList","UniverationElement","SignedNumber","optTag","Tag","TagTypeValue",
"TagClass","TagPlicit","TypeRefName","ObjectClassReference","optIdentifier",
"Identifier", NULL
};
#endif
static const short yyr1[] = { 0,
116, 117, 117, 118, 119, 119, 120, 120, 121, 121,
122, 122, 122, 123, 123, 124, 124, 125, 125, 125,
125, 125, 126, 126, 127, 127, 128, 128, 128, 128,
128, 129, 128, 128, 130, 130, 131, 131, 132, 133,
133, 134, 134, 134, 135, 135, 135, 136, 136, 137,
137, 137, 138, 139, 139, 140, 140, 141, 141, 142,
142, 143, 143, 143, 143, 144, 144, 145, 145, 145,
145, 146, 146, 147, 147, 148, 148, 149, 149, 150,
150, 150, 151, 151, 152, 152, 153, 154, 154, 155,
155, 156, 156, 156, 157, 157, 159, 158, 160, 160,
161, 161, 162, 162, 162, 163, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 165, 165, 165,
165, 165, 165, 166, 166, 167, 168, 169, 169, 170,
171, 172, 171, 171, 171, 171, 171, 171, 171, 171,
171, 173, 173, 174, 174, 175, 175, 175, 175, 175,
175, 175, 175, 175, 175, 175, 175, 175, 176, 176,
176, 177, 177, 178, 178, 178, 178, 178, 178, 178,
178, 178, 178, 178, 178, 178, 178, 179, 179, 180,
180, 181, 182, 182, 183, 183, 184, 184, 185, 185,
185, 186, 186, 186, 186, 187, 187, 187, 187, 187,
187, 187, 187, 187, 187, 188, 188, 188, 188, 189,
189, 190, 190, 190, 190, 190, 191, 192, 193, 193,
194, 194, 195, 195, 196, 196, 196, 197, 197, 198,
199, 200, 200, 201, 201, 202, 202, 203, 203, 204,
204, 205, 205, 206, 206, 207, 207, 207, 207, 207,
208, 208, 209, 209, 210, 211, 212, 212, 212, 212,
213, 213, 213, 214, 214, 215, 216, 216, 217
};
static const short yyr2[] = { 0,
1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
2, 2, 0, 1, 1, 2, 1, 1, 1, 1,
1, 0, 3, 1, 3, 2, 1, 2, 4, 1,
3, 1, 3, 1, 3, 3, 2, 1, 3, 1,
3, 1, 6, 1, 1, 0, 1, 1, 3, 1,
1, 4, 3, 3, 6, 1, 3, 1, 3, 3,
3, 1, 3, 1, 1, 0, 1, 1, 3, 3,
3, 1, 1, 3, 2, 1, 5, 0, 1, 1,
3, 2, 4, 4, 0, 1, 0, 6, 1, 2,
1, 1, 1, 3, 3, 3, 1, 4, 4, 4,
6, 6, 1, 4, 4, 1, 3, 1, 3, 3,
3, 1, 3, 1, 3, 1, 1, 1, 1, 4,
3, 0, 3, 1, 1, 1, 1, 1, 1, 1,
1, 1, 3, 1, 2, 1, 1, 1, 1, 2,
2, 1, 1, 2, 2, 1, 1, 1, 1, 1,
2, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 1, 1, 4, 3, 4, 1, 3,
5, 1, 3, 3, 3, 4, 3, 1, 1, 3,
3, 3, 3, 1, 1, 1, 2, 2, 3, 1,
1, 1, 1, 1, 1, 1, 1, 5, 1, 3,
1, 3, 0, 1, 1, 1, 1, 1, 1, 3,
4, 1, 3, 2, 3, 1, 3, 0, 1, 1,
2, 2, 3, 1, 3, 1, 4, 4, 1, 1,
1, 1, 0, 1, 2, 4, 0, 1, 1, 1,
0, 1, 1, 1, 1, 1, 0, 1, 1
};
static const short yydefact[] = { 0,
264, 265, 1, 2, 5, 3, 0, 0, 6, 269,
13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
0, 0, 0, 0, 0, 15, 16, 0, 22, 20,
18, 21, 19, 0, 17, 12, 23, 164, 0, 0,
165, 166, 167, 0, 168, 169, 177, 170, 171, 172,
173, 174, 175, 176, 0, 24, 25, 27, 28, 31,
29, 30, 34, 0, 0, 32, 0, 47, 0, 48,
50, 52, 36, 0, 37, 0, 40, 42, 44, 4,
26, 253, 118, 266, 0, 146, 0, 0, 160, 153,
157, 159, 147, 0, 0, 148, 152, 156, 0, 0,
54, 55, 149, 158, 122, 0, 33, 46, 45, 0,
0, 35, 38, 0, 0, 0, 0, 257, 64, 63,
0, 254, 261, 0, 161, 155, 154, 151, 150, 0,
66, 0, 68, 0, 0, 0, 49, 51, 5, 41,
43, 0, 259, 260, 258, 0, 118, 266, 113, 0,
0, 183, 183, 62, 183, 116, 162, 149, 107, 0,
263, 262, 255, 119, 121, 0, 0, 0, 0, 56,
128, 129, 123, 124, 126, 120, 137, 139, 138, 251,
252, 135, 134, 136, 132, 130, 141, 140, 0, 142,
39, 0, 90, 253, 127, 0, 0, 0, 0, 0,
76, 0, 0, 184, 185, 76, 0, 106, 0, 163,
253, 253, 67, 71, 70, 69, 215, 212, 211, 0,
210, 213, 0, 60, 0, 0, 0, 57, 58, 61,
192, 0, 198, 199, 205, 204, 228, 229, 214, 217,
216, 0, 0, 0, 0, 95, 0, 0, 240, 88,
88, 92, 239, 0, 256, 0, 103, 0, 83, 86,
253, 117, 0, 0, 0, 77, 78, 82, 253, 0,
189, 267, 0, 0, 267, 250, 242, 0, 244, 249,
246, 0, 72, 74, 75, 65, 206, 0, 0, 0,
0, 0, 53, 0, 180, 181, 178, 179, 0, 0,
182, 0, 0, 0, 0, 125, 144, 133, 143, 131,
0, 87, 96, 91, 241, 89, 238, 238, 114, 0,
108, 0, 85, 0, 253, 109, 0, 238, 187, 0,
253, 268, 0, 110, 253, 243, 0, 0, 115, 253,
207, 208, 203, 201, 0, 230, 197, 59, 193, 194,
195, 0, 202, 200, 0, 0, 232, 145, 0, 93,
94, 104, 105, 142, 84, 186, 81, 79, 80, 190,
0, 188, 0, 245, 0, 0, 73, 209, 221, 0,
219, 183, 196, 0, 234, 236, 231, 0, 97, 0,
111, 112, 248, 247, 218, 0, 223, 235, 0, 233,
0, 191, 220, 226, 227, 225, 222, 224, 237, 101,
0, 99, 102, 98, 100, 0, 0, 0
};
static const short yydefgoto[] = { 416,
3, 4, 8, 9, 13, 14, 25, 26, 27, 55,
56, 57, 107, 58, 74, 75, 76, 77, 59, 69,
70, 60, 100, 227, 228, 229, 61, 130, 131, 282,
283, 265, 266, 267, 258, 259, 119, 317, 192, 193,
312, 313, 401, 411, 412, 268, 284, 155, 156, 173,
174, 194, 195, 62, 186, 243, 187, 308, 157, 103,
159, 104, 299, 300, 302, 203, 204, 205, 270, 271,
231, 289, 232, 233, 234, 235, 380, 381, 407, 408,
236, 237, 238, 356, 357, 385, 252, 253, 210, 278,
279, 239, 254, 122, 123, 146, 163, 240, 105, 331,
241
};
static const short yypact[] = { 228,
-32768,-32768, 228,-32768, -71,-32768, 38, 59,-32768,-32768,
-32768,-32768, 49,-32768, -3, 58,-32768,-32768, 74, 54,
60, 67, 112, 84, 136, 58,-32768, 82,-32768,-32768,
-32768,-32768,-32768, 152,-32768,-32768, 419,-32768, 178, 33,
-32768,-32768,-32768, 61,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768, 181, 419,-32768,-32768,-32768,-32768,
-32768,-32768,-32768, 332, 648,-32768, 121,-32768, 144,-32768,
132,-32768,-32768, 17,-32768, -22,-32768, 143,-32768,-32768,
-32768, -17, 137,-32768, 183,-32768, 194, 186,-32768,-32768,
-32768,-32768,-32768, 208, 203,-32768,-32768,-32768, 723, 275,
-32768,-32768,-32768,-32768, 179, 288,-32768,-32768,-32768, 184,
190,-32768,-32768, 228, 184, 191, 193, 20,-32768,-32768,
496,-32768, 86, 184,-32768,-32768,-32768,-32768,-32768, 79,
-32768, 188, 195, 200, 258, 355,-32768,-32768, -71,-32768,
-32768, 260,-32768,-32768,-32768, 284, 53, 202, 263, 205,
238, -15, -14,-32768, 55,-32768,-32768, 206,-32768, 207,
-32768,-32768,-32768,-32768,-32768, 308, 723, 304, 184, 197,
-32768,-32768, 210,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 211, 209,
-32768, 93,-32768, 29,-32768, 199, 292, 11, 269, 214,
10, 221, 255,-32768, 220, 10, 259,-32768, 46,-32768,
6, 215,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 62,
-32768,-32768, 298,-32768, 228, 221, 230, 224,-32768, 189,
240, 232, 62,-32768,-32768,-32768, 236,-32768,-32768,-32768,
-32768, 260, 336, 304, 355, 246, 260, 355,-32768, 254,
254,-32768,-32768, 573,-32768, 304, 235, 108,-32768,-32768,
215,-32768, 221, 278, 243, 241,-32768,-32768, 215, 244,
72, 304, 221, 248, 304,-32768,-32768, 109,-32768,-32768,
252, 110,-32768,-32768,-32768,-32768, 247, 270, 71, 250,
266, 267,-32768, 197,-32768,-32768,-32768,-32768, 221, 221,
-32768, 221, 221, 176, 261,-32768,-32768, 371,-32768,-32768,
296,-32768,-32768,-32768,-32768,-32768, 15, 15,-32768, 167,
-32768, 11,-32768, 277, 215,-32768, 10, 15,-32768, 282,
215,-32768, 279,-32768, 215,-32768, 13, 167,-32768, 6,
-32768, 274,-32768,-32768, 52,-32768,-32768,-32768,-32768,-32768,
-32768, 281,-32768,-32768, 12, 115,-32768,-32768, 285,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 286,
573,-32768, 573,-32768, 287, 295,-32768,-32768,-32768, 118,
-32768, 55,-32768, 304, 294,-32768,-32768, 261,-32768, 221,
-32768,-32768,-32768,-32768,-32768, 52, 23, 294, 304,-32768,
145, 189,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
22,-32768,-32768,-32768,-32768, 403, 407,-32768
};
static const short yypgoto[] = {-32768,
-32768, 408, 271,-32768,-32768, 399,-32768,-32768, 387,-32768,
-32768, 358,-32768,-32768,-32768, 342,-32768, 305,-32768,-32768,
309,-32768, 356,-32768,-32768, 134,-32768,-32768, 262,-32768,
92, 227,-32768, 107,-32768, 114,-32768, 187,-32768, 192,
-32768,-32768,-32768,-32768, 26, -188, -80, -312, -52,-32768,
198, -186, -120,-32768, -1,-32768, -244,-32768, -48, -118,
-32768, 69,-32768,-32768,-32768, -148,-32768,-32768, -199, -166,
-39, 212,-32768, -204,-32768,-32768,-32768, 47,-32768,-32768,
-32768,-32768,-32768,-32768, 56, 63, -265,-32768,-32768,-32768,
111, -127, -81,-32768,-32768,-32768,-32768, 31,-32768, 171,
-7
};
#define YYLAST 817
static const short yytable[] = { 15,
121, 120, 158, 230, 207, 15, 208, 251, 188, 260,
117, 101, 101, 10, 175, 102, 102, 10, 10, 10,
10, 180, 181, 114, 10, 410, 292, 1, 2, 65,
5, 7, 72, 5, 171, 172, 79, 404, 143, 264,
10, 171, 172, 1, 2, 10, 11, 248, 65, 67,
132, 360, 361, 10, 180, 181, 10, 11, 391, 10,
392, 248, 369, 324, 200, 200, 79, 64, 10, 20,
71, 1, 2, 333, 78, 362, 217, 21, 10, 180,
181, 280, 28, 249, 344, 115, 64, 201, 206, 202,
202, 405, 16, 375, 144, 406, 118, 249, 22, 354,
23, 19, 72, 352, 78, 63, 73, 79, 145, 24,
29, 257, 257, 250, 276, 218, 165, 188, 132, 118,
188, 175, 384, 112, 63, 414, 161, 230, 190, 133,
343, 286, -238, 260, 200, 158, -238, 162, 34, 68,
71, 12, 118, 30, 139, 78, 262, 276, 410, 277,
31, 160, 17, 379, 164, -264, 222, 171, 172, 202,
214, 216, 287, 124, 32, 176, 189, 33, 295, 296,
297, 298, 37, 288, 10, 180, 181, 1, 2, 330,
323, 217, 166, 10, 180, 181, 167, 36, 328, 66,
261, 10, 363, 269, 1, 2, 246, 133, 269, 215,
247, 281, 217, 285, 10, 180, 181, 1, 2, 280,
376, 321, 336, 339, 413, 322, 337, 340, 387, 80,
218, 395, 388, 402, 413, 396, 217, 108, 10, 180,
181, 1, 2, 397, 111, 353, 309, 190, 1, 2,
190, 218, 219, 310, 367, 116, 315, 124, 319, 371,
109, 110, 158, 373, 158, 291, 127, 220, 128, 349,
350, 222, 351, 125, 332, 218, 219, 332, 1, 2,
171, 172, 171, 172, 126, 189, 221, 134, 189, 83,
84, 220, 222, 129, 160, 295, 296, 297, 298, 135,
136, 223, 196, 138, 141, 142, 168, 197, 224, 225,
221, 226, 170, 169, -265, 199, 222, 198, 209, 211,
212, 10, 364, 255, 261, 223, 256, 245, 263, 269,
242, 244, 272, 225, 273, 226, 275, 290, 118, 281,
364, 294, 285, 293, 82, 301, 303, 382, 305, 307,
311, 316, 83, 84, 320, 325, 326, 386, 327, 329,
189, 334, 345, 85, 38, 86, 338, 87, 341, 177,
178, 179, 10, 180, 181, 1, 2, 88, 189, 346,
342, 89, 347, 355, 358, 90, 386, 359, 91, 41,
42, 43, 366, 370, 372, 378, 383, 389, 382, 92,
45, 409, 393, 390, 93, 46, 94, 47, 95, 182,
394, 160, 417, 160, 399, 48, 418, 96, 97, 191,
6, 18, 35, 81, 49, 113, 50, 183, 137, 140,
106, 51, 98, 52, 53, 54, 10, 348, 213, 1,
2, 377, 274, 368, 99, 365, 415, 318, 314, 306,
184, 38, 403, 400, 304, 335, 398, 374, 0, 0,
0, 0, 0, 0, 0, 0, 39, 185, 0, 0,
40, 0, 0, 0, 0, 0, 41, 42, 43, 0,
0, 0, 44, 0, 0, 0, 0, 45, 0, 0,
0, 0, 46, 0, 47, 0, 0, 0, 0, 0,
0, 0, 48, 0, 0, 0, 0, 0, 0, 0,
0, 49, 0, 50, 0, 0, 147, 148, 51, 0,
52, 53, 54, 149, 0, 0, 0, 85, 38, 86,
0, 87, 150, 0, 0, 0, 0, 0, 0, 0,
0, 88, 0, 0, 0, 89, 0, 0, 0, 90,
0, 0, 91, 41, 42, 43, 0, 0, 0, 0,
0, 151, 0, 92, 45, 0, 0, 0, 93, 46,
94, 47, 95, 0, 0, 0, 0, 0, 0, 48,
0, 96, 97, 152, 153, 0, 0, 0, 49, 0,
50, 0, 154, 147, 148, 51, 98, 52, 53, 54,
149, 0, 0, 0, 85, 38, 86, 0, 87, 150,
0, 0, 0, 0, 0, 0, 0, 0, 88, 0,
0, 0, 89, 0, 0, 0, 90, 0, 0, 91,
41, 42, 43, 0, 0, 0, 0, 0, 151, 0,
92, 45, 0, 0, 0, 93, 46, 94, 47, 95,
0, 0, 0, 0, 0, 0, 48, 0, 96, 97,
152, 153, 0, 0, 0, 49, 0, 50, 83, 84,
0, 0, 51, 98, 52, 53, 54, 0, 0, 85,
38, 86, 0, 87, 0, 0, 0, 0, 0, 0,
0, 0, 0, 88, 0, 0, 0, 89, 0, 0,
0, 90, 0, 0, 91, 41, 42, 43, 0, 0,
0, 0, 0, 0, 0, 92, 45, 0, 0, 0,
93, 46, 94, 47, 95, 0, 0, 0, 0, 0,
0, 48, 0, 96, 97, 0, 0, 0, 0, 0,
49, 0, 50, 1, 2, 0, 0, 51, 98, 52,
53, 54, 0, 0, 85, 38, 86, 0, 87, 0,
0, 0, 0, 0, 0, 0, 0, 0, 88, 0,
0, 0, 89, 0, 0, 0, 90, 0, 0, 91,
41, 42, 43, 0, 0, 0, 0, 0, 0, 0,
92, 45, 0, 0, 0, 93, 46, 94, 47, 95,
0, 0, 0, 0, 0, 0, 48, 0, 96, 97,
0, 0, 0, 0, 0, 49, 0, 50, 0, 0,
0, 0, 51, 98, 52, 53, 54
};
static const short yycheck[] = { 7,
82, 82, 121, 170, 153, 13, 155, 194, 136, 198,
28, 64, 65, 8, 135, 64, 65, 8, 8, 8,
8, 9, 10, 46, 8, 4, 226, 11, 12, 37,
0, 103, 40, 3, 13, 14, 44, 15, 19, 30,
8, 13, 14, 11, 12, 8, 9, 33, 56, 17,
99, 317, 318, 8, 9, 10, 8, 9, 371, 8,
373, 33, 328, 263, 80, 80, 74, 37, 8, 12,
40, 11, 12, 273, 44, 320, 6, 20, 8, 9,
10, 209, 9, 69, 289, 108, 56, 103, 103, 105,
105, 69, 34, 338, 75, 73, 114, 69, 41, 304,
43, 105, 110, 303, 74, 37, 46, 115, 89, 52,
57, 102, 102, 194, 102, 45, 124, 245, 167, 114,
248, 242, 111, 107, 56, 104, 41, 294, 136, 99,
60, 212, 104, 322, 80, 254, 108, 52, 3, 107,
110, 104, 114, 84, 114, 115, 199, 102, 4, 104,
84, 121, 104, 102, 124, 103, 86, 13, 14, 105,
168, 169, 101, 111, 53, 135, 136, 84, 97, 98,
99, 100, 21, 112, 8, 9, 10, 11, 12, 108,
261, 6, 104, 8, 9, 10, 108, 106, 269, 12,
198, 8, 320, 201, 11, 12, 104, 167, 206, 169,
108, 209, 6, 211, 8, 9, 10, 11, 12, 337,
338, 104, 104, 104, 401, 108, 108, 108, 104, 39,
45, 104, 108, 390, 411, 108, 6, 107, 8, 9,
10, 11, 12, 382, 103, 60, 244, 245, 11, 12,
248, 45, 46, 245, 325, 103, 248, 111, 256, 331,
107, 108, 371, 335, 373, 225, 71, 61, 51, 299,
300, 86, 302, 81, 272, 45, 46, 275, 11, 12,
13, 14, 13, 14, 81, 245, 80, 3, 248, 11,
12, 61, 86, 81, 254, 97, 98, 99, 100, 111,
3, 95, 9, 104, 104, 103, 109, 35, 102, 103,
80, 105, 103, 109, 103, 68, 86, 103, 103, 103,
3, 8, 320, 115, 322, 95, 25, 109, 105, 327,
111, 111, 68, 103, 105, 105, 68, 30, 114, 337,
338, 108, 340, 104, 3, 96, 105, 345, 103, 4,
95, 88, 11, 12, 110, 68, 104, 355, 108, 106,
320, 104, 103, 22, 23, 24, 105, 26, 112, 5,
6, 7, 8, 9, 10, 11, 12, 36, 338, 104,
101, 40, 106, 113, 4, 44, 384, 82, 47, 48,
49, 50, 106, 102, 106, 112, 106, 103, 396, 58,
59, 399, 106, 108, 63, 64, 65, 66, 67, 45,
106, 371, 0, 373, 111, 74, 0, 76, 77, 139,
3, 13, 26, 56, 83, 74, 85, 63, 110, 115,
65, 90, 91, 92, 93, 94, 8, 294, 167, 11,
12, 340, 206, 327, 103, 322, 411, 251, 247, 242,
86, 23, 396, 388, 233, 275, 384, 337, -1, -1,
-1, -1, -1, -1, -1, -1, 38, 103, -1, -1,
42, -1, -1, -1, -1, -1, 48, 49, 50, -1,
-1, -1, 54, -1, -1, -1, -1, 59, -1, -1,
-1, -1, 64, -1, 66, -1, -1, -1, -1, -1,
-1, -1, 74, -1, -1, -1, -1, -1, -1, -1,
-1, 83, -1, 85, -1, -1, 11, 12, 90, -1,
92, 93, 94, 18, -1, -1, -1, 22, 23, 24,
-1, 26, 27, -1, -1, -1, -1, -1, -1, -1,
-1, 36, -1, -1, -1, 40, -1, -1, -1, 44,
-1, -1, 47, 48, 49, 50, -1, -1, -1, -1,
-1, 56, -1, 58, 59, -1, -1, -1, 63, 64,
65, 66, 67, -1, -1, -1, -1, -1, -1, 74,
-1, 76, 77, 78, 79, -1, -1, -1, 83, -1,
85, -1, 87, 11, 12, 90, 91, 92, 93, 94,
18, -1, -1, -1, 22, 23, 24, -1, 26, 27,
-1, -1, -1, -1, -1, -1, -1, -1, 36, -1,
-1, -1, 40, -1, -1, -1, 44, -1, -1, 47,
48, 49, 50, -1, -1, -1, -1, -1, 56, -1,
58, 59, -1, -1, -1, 63, 64, 65, 66, 67,
-1, -1, -1, -1, -1, -1, 74, -1, 76, 77,
78, 79, -1, -1, -1, 83, -1, 85, 11, 12,
-1, -1, 90, 91, 92, 93, 94, -1, -1, 22,
23, 24, -1, 26, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 36, -1, -1, -1, 40, -1, -1,
-1, 44, -1, -1, 47, 48, 49, 50, -1, -1,
-1, -1, -1, -1, -1, 58, 59, -1, -1, -1,
63, 64, 65, 66, 67, -1, -1, -1, -1, -1,
-1, 74, -1, 76, 77, -1, -1, -1, -1, -1,
83, -1, 85, 11, 12, -1, -1, 90, 91, 92,
93, 94, -1, -1, 22, 23, 24, -1, 26, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 36, -1,
-1, -1, 40, -1, -1, -1, 44, -1, -1, 47,
48, 49, 50, -1, -1, -1, -1, -1, -1, -1,
58, 59, -1, -1, -1, 63, 64, 65, 66, 67,
-1, -1, -1, -1, -1, -1, 74, -1, 76, 77,
-1, -1, -1, -1, -1, 83, -1, 85, -1, -1,
-1, -1, 90, 91, 92, 93, 94
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison.simple"
/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
#ifndef YYSTACK_USE_ALLOCA
#ifdef alloca
#define YYSTACK_USE_ALLOCA
#else /* alloca not defined */
#ifdef __GNUC__
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
/* We think this test detects Watcom and Microsoft C. */
/* This used to test MSDOS, but that is a bad idea
since that symbol is in the user namespace. */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
instead, just don't use alloca. */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
/* I don't know what this was needed for, but it pollutes the namespace.
So I turned it off. rms, 2 May 1997. */
/* #include <malloc.h> */
#pragma alloca
#define YYSTACK_USE_ALLOCA
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
and on HPUX 10. Eventually we can turn this on. */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc */
#endif /* not GNU C */
#endif /* alloca not defined */
#endif /* YYSTACK_USE_ALLOCA not defined */
#ifdef YYSTACK_USE_ALLOCA
#define YYSTACK_ALLOC alloca
#else
#define YYSTACK_ALLOC malloc
#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif
/* If nonreentrant, generate the variables here */
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
/* Define __yy_memcpy. Note that the size argument
should be passed with type unsigned int, because that is what the non-GCC
definitions require. With GCC, __builtin_memcpy takes an arg
of type size_t, but it can handle unsigned int. */
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (to, from, count)
char *to;
char *from;
unsigned int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (char *to, char *from, unsigned int count)
{
register char *t = to;
register char *f = from;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 217 "/usr/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
#ifdef __cplusplus
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* not __cplusplus */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#endif /* not __cplusplus */
#else /* not YYPARSE_PARAM */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
#ifdef YYPARSE_PARAM
int yyparse (void *);
#else
int yyparse (void);
#endif
#endif
int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
#ifndef YYSTACK_USE_ALLOCA
yyfree_stacks = 1;
#endif
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss, (char *)yyss1,
size * (unsigned int) sizeof (*yyssp));
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
__yy_memcpy ((char *)yyls, (char *)yyls1,
size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
goto yybackup;
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Reading a token: ");
#endif
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(yychar);
#if YYDEBUG != 0
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
/* Do the default action for the current state. */
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn) {
case 1:
#line 303 "asn1p_y.y"
{
*(void **)param = yyvsp[0].a_grammar;
;
break;}
case 2:
#line 309 "asn1p_y.y"
{
yyval.a_grammar = asn1p_new();
checkmem(yyval.a_grammar);
TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
;
break;}
case 3:
#line 314 "asn1p_y.y"
{
yyval.a_grammar = yyvsp[-1].a_grammar;
TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
;
break;}
case 4:
#line 335 "asn1p_y.y"
{
if(yyvsp[-1].a_module) {
yyval.a_module = yyvsp[-1].a_module;
} else {
/* There's a chance that a module is just plain empty */
yyval.a_module = asn1p_module_new();
}
checkmem(yyval.a_module);
yyval.a_module->Identifier = yyvsp[-7].tv_str;
yyval.a_module->module_oid = yyvsp[-6].a_oid;
yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
;
break;}
case 5:
#line 356 "asn1p_y.y"
{ yyval.a_oid = 0; ;
break;}
case 6:
#line 357 "asn1p_y.y"
{ yyval.a_oid = yyvsp[0].a_oid; ;
break;}
case 7:
#line 361 "asn1p_y.y"
{
yyval.a_oid = yyvsp[-1].a_oid;
;
break;}
case 8:
#line 364 "asn1p_y.y"
{
yyval.a_oid = 0;
;
break;}
case 9:
#line 370 "asn1p_y.y"
{
yyval.a_oid = asn1p_oid_new();
asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
if(yyvsp[0].a_oid_arc.name)
free(yyvsp[0].a_oid_arc.name);
;
break;}
case 10:
#line 376 "asn1p_y.y"
{
yyval.a_oid = yyvsp[-1].a_oid;
asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
if(yyvsp[0].a_oid_arc.name)
free(yyvsp[0].a_oid_arc.name);
;
break;}
case 11:
#line 385 "asn1p_y.y"
{ /* iso */
yyval.a_oid_arc.name = yyvsp[0].tv_str;
yyval.a_oid_arc.number = -1;
;
break;}
case 12:
#line 389 "asn1p_y.y"
{ /* iso(1) */
yyval.a_oid_arc.name = yyvsp[-3].tv_str;
yyval.a_oid_arc.number = yyvsp[-1].a_int;
;
break;}
case 13:
#line 393 "asn1p_y.y"
{ /* 1 */
yyval.a_oid_arc.name = 0;
yyval.a_oid_arc.number = yyvsp[0].a_int;
;
break;}
case 14:
#line 403 "asn1p_y.y"
{ yyval.a_module_flags = MSF_NOFLAGS; ;
break;}
case 15:
#line 404 "asn1p_y.y"
{
yyval.a_module_flags = yyvsp[0].a_module_flags;
;
break;}
case 16:
#line 413 "asn1p_y.y"
{
yyval.a_module_flags = yyvsp[0].a_module_flags;
;
break;}
case 17:
#line 416 "asn1p_y.y"
{
yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
;
break;}
case 18:
#line 425 "asn1p_y.y"
{
yyval.a_module_flags = MSF_EXPLICIT_TAGS;
;
break;}
case 19:
#line 428 "asn1p_y.y"
{
yyval.a_module_flags = MSF_IMPLICIT_TAGS;
;
break;}
case 20:
#line 431 "asn1p_y.y"
{
yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
;
break;}
case 21:
#line 434 "asn1p_y.y"
{
yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
;
break;}
case 22:
#line 438 "asn1p_y.y"
{
/* X.680Amd1 specifies TAG and XER */
if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) {
yyval.a_module_flags = MSF_TAG_INSTRUCTIONS;
} else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) {
yyval.a_module_flags = MSF_XER_INSTRUCTIONS;
} else {
fprintf(stderr,
"WARNING: %s INSTRUCTIONS at line %d: "
"Unrecognized encoding reference\n",
yyvsp[-1].tv_str, yylineno);
yyval.a_module_flags = MSF_unk_INSTRUCTIONS;
}
free(yyvsp[-1].tv_str);
;
break;}
case 23:
#line 459 "asn1p_y.y"
{ yyval.a_module = 0; ;
break;}
case 24:
#line 460 "asn1p_y.y"
{
yyval.a_module = yyvsp[0].a_module;
;
break;}
case 25:
#line 469 "asn1p_y.y"
{
yyval.a_module = yyvsp[0].a_module;
;
break;}
case 26:
#line 472 "asn1p_y.y"
{
yyval.a_module = yyvsp[-1].a_module;
/* Behave well when one of them is skipped. */
if(!(yyvsp[-1].a_module)) {
if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module;
break;
}
#ifdef MY_IMPORT
#error MY_IMPORT DEFINED ELSEWHERE!
#endif
#define MY_IMPORT(foo,field) do { \
while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
TQ_ADD(&(yyval.a_module->foo), \
TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
field); \
} \
assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
} while(0)
MY_IMPORT(imports, xp_next);
MY_IMPORT(exports, xp_next);
MY_IMPORT(members, next);
#undef MY_IMPORT
;
break;}
case 27:
#line 505 "asn1p_y.y"
{
yyval.a_module = yyvsp[0].a_module;
;
break;}
case 28:
#line 508 "asn1p_y.y"
{
yyval.a_module = asn1p_module_new();
checkmem(yyval.a_module);
if(yyvsp[0].a_xports) {
TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
} else {
/* "EXPORTS ALL;" ? */
}
;
break;}
case 29:
#line 517 "asn1p_y.y"
{
yyval.a_module = asn1p_module_new();
checkmem(yyval.a_module);
assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
;
break;}
case 30:
#line 524 "asn1p_y.y"
{
yyval.a_module = asn1p_module_new();
checkmem(yyval.a_module);
assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
;
break;}
case 31:
#line 537 "asn1p_y.y"
{
yyval.a_module = asn1p_module_new();
checkmem(yyval.a_module);
assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
;
break;}
case 32:
#line 545 "asn1p_y.y"
{ asn1p_lexer_hack_push_encoding_control(); ;
break;}
case 33:
#line 546 "asn1p_y.y"
{
fprintf(stderr,
"WARNING: ENCODING-CONTROL %s "
"specification at line %d ignored\n",
yyvsp[-1].tv_str, yylineno);
free(yyvsp[-1].tv_str);
yyval.a_module = 0;
;
break;}
case 34:
#line 558 "asn1p_y.y"
{
return yyerror(
"Attempt to redefine a standard basic type, "
"use -ftypesXY to switch back "
"to older version of ASN.1 standard");
;
break;}
case 35:
#line 572 "asn1p_y.y"
{
yyval.a_module = yyvsp[-1].a_module;
;
break;}
case 36:
#line 578 "asn1p_y.y"
{
return yyerror("Empty IMPORTS list");
;
break;}
case 37:
#line 584 "asn1p_y.y"
{
yyval.a_module = asn1p_module_new();
checkmem(yyval.a_module);
TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
;
break;}
case 38:
#line 589 "asn1p_y.y"
{
yyval.a_module = yyvsp[-1].a_module;
TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
;
break;}
case 39:
#line 596 "asn1p_y.y"
{
yyval.a_xports = yyvsp[-3].a_xports;
yyval.a_xports->from = yyvsp[-1].tv_str;
yyval.a_xports->from_oid = yyvsp[0].a_oid;
checkmem(yyval.a_xports);
;
break;}
case 40:
#line 605 "asn1p_y.y"
{
yyval.a_xports = asn1p_xports_new();
checkmem(yyval.a_xports);
TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
;
break;}
case 41:
#line 610 "asn1p_y.y"
{
yyval.a_xports = yyvsp[-2].a_xports;
TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
;
break;}
case 42:
#line 617 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[0].tv_str;
yyval.a_expr->expr_type = A1TC_REFERENCE;
;
break;}
case 43:
#line 623 "asn1p_y.y"
{ /* Completely equivalent to above */
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[-2].tv_str;
yyval.a_expr->expr_type = A1TC_REFERENCE;
;
break;}
case 44:
#line 629 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[0].tv_str;
yyval.a_expr->expr_type = A1TC_REFERENCE;
;
break;}
case 45:
#line 638 "asn1p_y.y"
{
yyval.a_xports = yyvsp[-1].a_xports;
;
break;}
case 46:
#line 641 "asn1p_y.y"
{
yyval.a_xports = 0;
;
break;}
case 47:
#line 644 "asn1p_y.y"
{
/* Empty EXPORTS clause effectively prohibits export. */
yyval.a_xports = asn1p_xports_new();
checkmem(yyval.a_xports);
;
break;}
case 48:
#line 652 "asn1p_y.y"
{
yyval.a_xports = asn1p_xports_new();
assert(yyval.a_xports);
TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
;
break;}
case 49:
#line 657 "asn1p_y.y"
{
yyval.a_xports = yyvsp[-2].a_xports;
TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
;
break;}
case 50:
#line 664 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[0].tv_str;
yyval.a_expr->expr_type = A1TC_EXPORTVAR;
;
break;}
case 51:
#line 670 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[-2].tv_str;
yyval.a_expr->expr_type = A1TC_EXPORTVAR;
;
break;}
case 52:
#line 676 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[0].tv_str;
yyval.a_expr->expr_type = A1TC_EXPORTVAR;
;
break;}
case 53:
#line 686 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-4].a_expr;
assert(yyval.a_expr->Identifier == 0);
yyval.a_expr->Identifier = yyvsp[-5].tv_str;
yyval.a_expr->meta_type = AMT_VALUESET;
// take care of optValueSetBody
;
break;}
case 54:
#line 696 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->reference = yyvsp[0].a_ref;
yyval.a_expr->expr_type = A1TC_REFERENCE;
yyval.a_expr->meta_type = AMT_TYPEREF;
;
break;}
case 55:
#line 703 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = yyvsp[0].a_type;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 56:
#line 712 "asn1p_y.y"
{ ;
break;}
case 57:
#line 713 "asn1p_y.y"
{
;
break;}
case 58:
#line 724 "asn1p_y.y"
{
;
break;}
case 59:
#line 726 "asn1p_y.y"
{
;
break;}
case 60:
#line 731 "asn1p_y.y"
{
;
break;}
case 61:
#line 733 "asn1p_y.y"
{
;
break;}
case 62:
#line 749 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[-3].tv_str;
yyval.a_expr->tag = yyvsp[-1].a_tag;
yyval.a_expr->expr_type = A1TC_TYPEID;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 63:
#line 757 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
yyval.a_expr->Identifier = yyvsp[-2].tv_str;
assert(yyval.a_expr->expr_type);
assert(yyval.a_expr->meta_type);
;
break;}
case 64:
#line 763 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
yyval.a_expr->Identifier = yyvsp[-2].tv_str;
assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
assert(yyval.a_expr->meta_type == AMT_OBJECT);
;
break;}
case 65:
#line 779 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
assert(yyval.a_expr->Identifier == 0);
yyval.a_expr->Identifier = yyvsp[-5].tv_str;
yyval.a_expr->params = yyvsp[-3].a_plist;
yyval.a_expr->meta_type = AMT_PARAMTYPE;
;
break;}
case 66:
#line 789 "asn1p_y.y"
{
int ret;
yyval.a_plist = asn1p_paramlist_new(yylineno);
checkmem(yyval.a_plist);
ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
checkmem(ret == 0);
if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
;
break;}
case 67:
#line 798 "asn1p_y.y"
{
int ret;
yyval.a_plist = yyvsp[-2].a_plist;
ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
checkmem(ret == 0);
if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
;
break;}
case 68:
#line 809 "asn1p_y.y"
{
yyval.a_parg.governor = NULL;
yyval.a_parg.argument = yyvsp[0].tv_str;
;
break;}
case 69:
#line 813 "asn1p_y.y"
{
int ret;
yyval.a_parg.governor = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
checkmem(ret == 0);
yyval.a_parg.argument = yyvsp[0].tv_str;
;
break;}
case 70:
#line 820 "asn1p_y.y"
{
int ret;
yyval.a_parg.governor = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
checkmem(ret == 0);
yyval.a_parg.argument = yyvsp[0].tv_str;
;
break;}
case 71:
#line 827 "asn1p_y.y"
{
int ret;
yyval.a_parg.governor = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_parg.governor,
ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
checkmem(ret == 0);
yyval.a_parg.argument = yyvsp[0].tv_str;
;
break;}
case 72:
#line 838 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 73:
#line 843 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 74:
#line 850 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
;
break;}
case 75:
#line 853 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[0].tv_str;
yyval.a_expr->expr_type = A1TC_REFERENCE;
yyval.a_expr->meta_type = AMT_VALUE;
;
break;}
case 76:
#line 877 "asn1p_y.y"
{ yyval.a_expr = asn1p_expr_new(yylineno); ;
break;}
case 77:
#line 878 "asn1p_y.y"
{ yyval.a_expr = yyvsp[0].a_expr; ;
break;}
case 78:
#line 881 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 79:
#line 886 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 80:
#line 893 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
assert(yyval.a_expr->Identifier == 0);
yyval.a_expr->Identifier = yyvsp[-2].tv_str;
yyval.a_expr->marker = yyvsp[0].a_marker;
;
break;}
case 81:
#line 899 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type;
yyval.a_expr->expr_type = A1TC_COMPONENTS_OF;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 82:
#line 906 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
;
break;}
case 83:
#line 912 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 84:
#line 917 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 85:
#line 924 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
assert(yyval.a_expr->Identifier == 0);
yyval.a_expr->Identifier = yyvsp[-1].tv_str;
;
break;}
case 86:
#line 929 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
;
break;}
case 87:
#line 935 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
checkmem(yyval.a_expr);
yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
assert(yyval.a_expr->meta_type == AMT_OBJECT);
;
break;}
case 88:
#line 945 "asn1p_y.y"
{ yyval.a_int = 0; ;
break;}
case 89:
#line 946 "asn1p_y.y"
{ yyval.a_int = 1; ;
break;}
case 90:
#line 950 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = A1TC_CLASSDEF;
yyval.a_expr->meta_type = AMT_OBJECT;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 91:
#line 957 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 92:
#line 964 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[-1].a_refcomp.name;
yyval.a_expr->expr_type = A1TC_CLASSFIELD;
yyval.a_expr->meta_type = AMT_OBJECTFIELD;
yyval.a_expr->marker = yyvsp[0].a_marker;
;
break;}
case 93:
#line 972 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
yyval.a_expr->marker = yyvsp[0].a_marker;
yyval.a_expr->unique = yyvsp[-1].a_int;
;
break;}
case 94:
#line 978 "asn1p_y.y"
{
int ret;
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = yyvsp[-3].a_refcomp.name;
yyval.a_expr->reference = asn1p_ref_new(yylineno);
checkmem(yyval.a_expr->reference);
ret = asn1p_ref_add_component(yyval.a_expr->reference,
yyvsp[-2].a_refcomp.name, yyvsp[-2].a_refcomp.lex_type);
checkmem(ret == 0);
yyval.a_expr->expr_type = A1TC_CLASSFIELD;
yyval.a_expr->meta_type = AMT_OBJECTFIELD;
yyval.a_expr->marker = yyvsp[0].a_marker;
yyval.a_expr->unique = yyvsp[-1].a_int;
;
break;}
case 95:
#line 996 "asn1p_y.y"
{ yyval.a_wsynt = 0; ;
break;}
case 96:
#line 997 "asn1p_y.y"
{
yyval.a_wsynt = yyvsp[0].a_wsynt;
;
break;}
case 97:
#line 1004 "asn1p_y.y"
{ asn1p_lexer_hack_enable_with_syntax(); ;
break;}
case 98:
#line 1006 "asn1p_y.y"
{
yyval.a_wsynt = yyvsp[-1].a_wsynt;
;
break;}
case 99:
#line 1012 "asn1p_y.y"
{
yyval.a_wsynt = asn1p_wsyntx_new();
TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
;
break;}
case 100:
#line 1016 "asn1p_y.y"
{
yyval.a_wsynt = yyvsp[-1].a_wsynt;
TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
;
break;}
case 101:
#line 1023 "asn1p_y.y"
{
yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
;
break;}
case 102:
#line 1026 "asn1p_y.y"
{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
ret = asn1p_ref_add_component(ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
checkmem(ret == 0);
yyval.a_wchunk = asn1p_wsyntx_chunk_fromref(ref, 0);
;
break;}
case 103:
#line 1038 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = strdup("...");
checkmem(yyval.a_expr->Identifier);
yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 104:
#line 1046 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = strdup("...");
checkmem(yyval.a_expr->Identifier);
yyval.a_expr->value = yyvsp[0].a_value;
yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 105:
#line 1055 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = strdup("...");
yyval.a_expr->value = yyvsp[0].a_value;
checkmem(yyval.a_expr->Identifier);
yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 106:
#line 1067 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
yyval.a_expr->tag = yyvsp[-2].a_tag;
/*
* Outer constraint for SEQUENCE OF and SET OF applies
* to the inner type.
*/
if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF
|| yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) {
assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints);
TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr;
} else {
if(yyval.a_expr->constraints) {
assert(!yyvsp[-1].a_expr);
} else {
yyval.a_expr->constraints = yyvsp[0].a_constr;
}
}
;
break;}
case 107:
#line 1089 "asn1p_y.y"
{
yyval.a_expr = yyvsp[0].a_expr;
;
break;}
case 108:
#line 1092 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
assert(yyval.a_expr->expr_type == A1TC_INVALID);
yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 109:
#line 1098 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
assert(yyval.a_expr->expr_type == A1TC_INVALID);
yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 110:
#line 1104 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
assert(yyval.a_expr->expr_type == A1TC_INVALID);
yyval.a_expr->expr_type = ASN_CONSTR_SET;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 111:
#line 1110 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->constraints = yyvsp[-4].a_constr;
yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
yyval.a_expr->meta_type = AMT_TYPE;
yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 112:
#line 1120 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->constraints = yyvsp[-4].a_constr;
yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
yyval.a_expr->meta_type = AMT_TYPE;
yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 113:
#line 1130 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = ASN_TYPE_ANY;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 114:
#line 1136 "asn1p_y.y"
{
int ret;
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->reference = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_expr->reference,
yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
yyval.a_expr->expr_type = ASN_TYPE_ANY;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 115:
#line 1150 "asn1p_y.y"
{
int ret;
yyval.a_expr = yyvsp[-1].a_expr;
assert(yyval.a_expr->expr_type == 0);
assert(yyval.a_expr->meta_type == 0);
assert(yyval.a_expr->reference == 0);
yyval.a_expr->reference = asn1p_ref_new(yylineno);
checkmem(yyval.a_expr->reference);
ret = asn1p_ref_add_component(yyval.a_expr->reference, yyvsp[-3].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
free(yyvsp[-3].tv_str);
yyval.a_expr->expr_type = A1TC_PARAMETRIZED;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 116:
#line 1174 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->reference = yyvsp[0].a_ref;
yyval.a_expr->expr_type = A1TC_REFERENCE;
yyval.a_expr->meta_type = AMT_TYPEREF;
;
break;}
case 117:
#line 1181 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->reference = yyvsp[0].a_ref;
yyval.a_expr->expr_type = A1TC_INSTANCE;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 118:
#line 1196 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
free(yyvsp[0].tv_str);
;
break;}
case 119:
#line 1204 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
free(yyvsp[-2].tv_str);
;
break;}
case 120:
#line 1214 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
free(yyvsp[-2].tv_str);
;
break;}
case 121:
#line 1224 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
free(yyvsp[-2].tv_str);
;
break;}
case 122:
#line 1234 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
free(yyvsp[0].tv_str);
checkmem(ret == 0);
;
break;}
case 123:
#line 1242 "asn1p_y.y"
{
int ret;
yyval.a_ref = yyvsp[0].a_ref;
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
free(yyvsp[-2].tv_str);
checkmem(ret == 0);
/*
* Move the last element infront.
*/
{
struct asn1p_ref_component_s tmp_comp;
tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
memmove(&yyval.a_ref->components[1],
&yyval.a_ref->components[0],
sizeof(yyval.a_ref->components[0])
* (yyval.a_ref->comp_count - 1));
yyval.a_ref->components[0] = tmp_comp;
}
;
break;}
case 124:
#line 1264 "asn1p_y.y"
{
int ret;
yyval.a_ref = asn1p_ref_new(yylineno);
checkmem(yyval.a_ref);
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
free(yyvsp[0].a_refcomp.name);
checkmem(ret == 0);
;
break;}
case 125:
#line 1272 "asn1p_y.y"
{
int ret;
yyval.a_ref = yyvsp[-2].a_ref;
ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
free(yyvsp[0].a_refcomp.name);
checkmem(ret == 0);
;
break;}
case 128:
#line 1286 "asn1p_y.y"
{
yyval.a_refcomp.lex_type = RLT_AmpUppercase;
yyval.a_refcomp.name = yyvsp[0].tv_str;
;
break;}
case 129:
#line 1291 "asn1p_y.y"
{
yyval.a_refcomp.lex_type = RLT_Amplowercase;
yyval.a_refcomp.name = yyvsp[0].tv_str;
;
break;}
case 130:
#line 1304 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
assert(yyval.a_expr->Identifier == NULL);
yyval.a_expr->Identifier = yyvsp[-3].tv_str;
yyval.a_expr->meta_type = AMT_VALUE;
yyval.a_expr->value = yyvsp[0].a_value;
;
break;}
case 131:
#line 1314 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_CHOICE_IDENTIFIER;
yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str;
yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value;
;
break;}
case 132:
#line 1321 "asn1p_y.y"
{ asn1p_lexer_hack_push_opaque_state(); ;
break;}
case 133:
#line 1321 "asn1p_y.y"
{
yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_UNPARSED;
;
break;}
case 134:
#line 1326 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_NULL;
;
break;}
case 135:
#line 1331 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_FALSE;
;
break;}
case 136:
#line 1336 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_TRUE;
;
break;}
case 137:
#line 1341 "asn1p_y.y"
{
yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
checkmem(yyval.a_value);
;
break;}
case 138:
#line 1345 "asn1p_y.y"
{
yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
checkmem(yyval.a_value);
;
break;}
case 139:
#line 1349 "asn1p_y.y"
{
yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
checkmem(yyval.a_value);
;
break;}
case 140:
#line 1353 "asn1p_y.y"
{
yyval.a_value = yyvsp[0].a_value;
;
break;}
case 141:
#line 1356 "asn1p_y.y"
{
yyval.a_value = yyvsp[0].a_value;
;
break;}
case 142:
#line 1362 "asn1p_y.y"
{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
yyval.a_value = asn1p_value_fromref(ref, 0);
checkmem(yyval.a_value);
free(yyvsp[0].tv_str);
;
break;}
case 143:
#line 1373 "asn1p_y.y"
{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
yyval.a_value = asn1p_value_fromref(ref, 0);
checkmem(yyval.a_value);
free(yyvsp[-2].tv_str);
free(yyvsp[0].tv_str);
;
break;}
case 144:
#line 1390 "asn1p_y.y"
{
yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 2;
yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
checkmem(yyval.tv_opaque.buf);
yyval.tv_opaque.buf[0] = '{';
yyval.tv_opaque.buf[1] = ' ';
memcpy(yyval.tv_opaque.buf + 2, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
free(yyvsp[0].tv_opaque.buf);
;
break;}
case 145:
#line 1400 "asn1p_y.y"
{
int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
char *p = malloc(newsize + 1);
checkmem(p);
memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
p[newsize] = '\0';
free(yyvsp[-1].tv_opaque.buf);
free(yyvsp[0].tv_opaque.buf);
yyval.tv_opaque.buf = p;
yyval.tv_opaque.len = newsize;
;
break;}
case 146:
#line 1415 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
break;}
case 147:
#line 1416 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_NULL; ;
break;}
case 148:
#line 1417 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_REAL; ;
break;}
case 149:
#line 1418 "asn1p_y.y"
{ yyval.a_type = yyvsp[0].a_type; ;
break;}
case 150:
#line 1419 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
break;}
case 151:
#line 1420 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
break;}
case 152:
#line 1421 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
break;}
case 153:
#line 1422 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
break;}
case 154:
#line 1423 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
break;}
case 155:
#line 1424 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
break;}
case 156:
#line 1425 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_UTCTime; ;
break;}
case 157:
#line 1426 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
break;}
case 158:
#line 1427 "asn1p_y.y"
{ yyval.a_type = yyvsp[0].a_type; ;
break;}
case 159:
#line 1434 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_INTEGER; ;
break;}
case 160:
#line 1435 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
break;}
case 161:
#line 1436 "asn1p_y.y"
{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
break;}
case 162:
#line 1440 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = yyvsp[0].a_type;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 163:
#line 1446 "asn1p_y.y"
{
if(yyvsp[0].a_expr) {
yyval.a_expr = yyvsp[0].a_expr;
} else {
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
}
yyval.a_expr->expr_type = yyvsp[-1].a_type;
yyval.a_expr->meta_type = AMT_TYPE;
;
break;}
case 164:
#line 1459 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_BMPString; ;
break;}
case 165:
#line 1460 "asn1p_y.y"
{
yyval.a_type = ASN_STRING_GeneralString;
fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
;
break;}
case 166:
#line 1464 "asn1p_y.y"
{
yyval.a_type = ASN_STRING_GraphicString;
fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
;
break;}
case 167:
#line 1468 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_IA5String; ;
break;}
case 168:
#line 1469 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_ISO646String; ;
break;}
case 169:
#line 1470 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_NumericString; ;
break;}
case 170:
#line 1471 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_PrintableString; ;
break;}
case 171:
#line 1472 "asn1p_y.y"
{
yyval.a_type = ASN_STRING_T61String;
fprintf(stderr, "WARNING: T61String is not fully supported\n");
;
break;}
case 172:
#line 1476 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_TeletexString; ;
break;}
case 173:
#line 1477 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_UniversalString; ;
break;}
case 174:
#line 1478 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_UTF8String; ;
break;}
case 175:
#line 1479 "asn1p_y.y"
{
yyval.a_type = ASN_STRING_VideotexString;
fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
;
break;}
case 176:
#line 1483 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_VisibleString; ;
break;}
case 177:
#line 1484 "asn1p_y.y"
{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
break;}
case 183:
#line 1496 "asn1p_y.y"
{ yyval.a_constr = 0; ;
break;}
case 184:
#line 1497 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 185:
#line 1503 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
;
break;}
case 186:
#line 1506 "asn1p_y.y"
{
/*
* This is a special case, for compatibility purposes.
* It goes without parentheses.
*/
CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0);
;
break;}
case 187:
#line 1516 "asn1p_y.y"
{
yyval.a_constr = yyvsp[-1].a_constr;
;
break;}
case 188:
#line 1519 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
;
break;}
case 189:
#line 1525 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 190:
#line 1528 "asn1p_y.y"
{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
ct->type = ACT_EL_EXT;
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
;
break;}
case 191:
#line 1534 "asn1p_y.y"
{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
ct->type = ACT_EL_EXT;
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
ct = yyval.a_constr;
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
;
break;}
case 192:
#line 1545 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 193:
#line 1548 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
;
break;}
case 194:
#line 1551 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
;
break;}
case 195:
#line 1554 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
;
break;}
case 196:
#line 1560 "asn1p_y.y"
{
int ret;
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = yyvsp[-3].a_ctype;
ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
checkmem(ret == 0);
;
break;}
case 197:
#line 1568 "asn1p_y.y"
{
int ret;
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_CA_SET;
ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
checkmem(ret == 0);
;
break;}
case 198:
#line 1576 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_EL_VALUE;
yyval.a_constr->value = yyvsp[0].a_value;
;
break;}
case 199:
#line 1582 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_EL_TYPE;
yyval.a_constr->containedSubtype = yyvsp[0].a_value;
;
break;}
case 200:
#line 1588 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = yyvsp[-1].a_ctype;
yyval.a_constr->range_start = yyvsp[-2].a_value;
yyval.a_constr->range_stop = yyvsp[0].a_value;
;
break;}
case 201:
#line 1595 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = yyvsp[-1].a_ctype;
yyval.a_constr->range_start = asn1p_value_fromint(-123);
yyval.a_constr->range_stop = yyvsp[0].a_value;
yyval.a_constr->range_start->type = ATV_MIN;
;
break;}
case 202:
#line 1603 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = yyvsp[-1].a_ctype;
yyval.a_constr->range_start = yyvsp[-2].a_value;
yyval.a_constr->range_stop = asn1p_value_fromint(321);
yyval.a_constr->range_stop->type = ATV_MAX;
;
break;}
case 203:
#line 1611 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = yyvsp[-1].a_ctype;
yyval.a_constr->range_start = asn1p_value_fromint(-123);
yyval.a_constr->range_stop = asn1p_value_fromint(321);
yyval.a_constr->range_start->type = ATV_MIN;
yyval.a_constr->range_stop->type = ATV_MAX;
;
break;}
case 204:
#line 1620 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 205:
#line 1623 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 206:
#line 1629 "asn1p_y.y"
{ yyval.a_ctype = ACT_EL_RANGE; ;
break;}
case 207:
#line 1630 "asn1p_y.y"
{ yyval.a_ctype = ACT_EL_RLRANGE; ;
break;}
case 208:
#line 1631 "asn1p_y.y"
{ yyval.a_ctype = ACT_EL_LLRANGE; ;
break;}
case 209:
#line 1632 "asn1p_y.y"
{ yyval.a_ctype = ACT_EL_ULRANGE; ;
break;}
case 210:
#line 1636 "asn1p_y.y"
{
yyval.a_ctype = ACT_CT_SIZE;
;
break;}
case 211:
#line 1639 "asn1p_y.y"
{
yyval.a_ctype = ACT_CT_FROM;
;
break;}
case 212:
#line 1645 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(0);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_FALSE;
;
break;}
case 213:
#line 1650 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(1);
checkmem(yyval.a_value);
yyval.a_value->type = ATV_TRUE;
;
break;}
case 214:
#line 1655 "asn1p_y.y"
{
yyval.a_value = yyvsp[0].a_value;
;
break;}
case 215:
#line 1658 "asn1p_y.y"
{
yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
checkmem(yyval.a_value);
;
break;}
case 216:
#line 1662 "asn1p_y.y"
{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
yyval.a_value = asn1p_value_fromref(ref, 0);
checkmem(yyval.a_value);
free(yyvsp[0].tv_str);
;
break;}
case 217:
#line 1676 "asn1p_y.y"
{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
yyval.a_value = asn1p_value_fromref(ref, 0);
checkmem(yyval.a_value);
free(yyvsp[0].tv_str);
;
break;}
case 218:
#line 1690 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
;
break;}
case 219:
#line 1696 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 220:
#line 1699 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
;
break;}
case 221:
#line 1705 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_EL_EXT;
;
break;}
case 222:
#line 1710 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_EL_VALUE;
yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
yyval.a_constr->presence = yyvsp[0].a_pres;
;
break;}
case 223:
#line 1723 "asn1p_y.y"
{ yyval.a_pres = ACPRES_DEFAULT; ;
break;}
case 224:
#line 1724 "asn1p_y.y"
{ yyval.a_pres = yyvsp[0].a_pres; ;
break;}
case 225:
#line 1728 "asn1p_y.y"
{
yyval.a_pres = ACPRES_PRESENT;
;
break;}
case 226:
#line 1731 "asn1p_y.y"
{
yyval.a_pres = ACPRES_ABSENT;
;
break;}
case 227:
#line 1734 "asn1p_y.y"
{
yyval.a_pres = ACPRES_OPTIONAL;
;
break;}
case 228:
#line 1740 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 229:
#line 1743 "asn1p_y.y"
{
yyval.a_constr = yyvsp[0].a_constr;
;
break;}
case 230:
#line 1752 "asn1p_y.y"
{
asn1p_ref_t *ref = asn1p_ref_new(yylineno);
asn1p_constraint_t *ct;
int ret;
ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
checkmem(ret == 0);
ct = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
ct->type = ACT_EL_VALUE;
ct->value = asn1p_value_fromref(ref, 0);
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
;
break;}
case 231:
#line 1767 "asn1p_y.y"
{
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
;
break;}
case 232:
#line 1773 "asn1p_y.y"
{
yyval.a_constr = asn1p_constraint_new(yylineno);
checkmem(yyval.a_constr);
yyval.a_constr->type = ACT_EL_VALUE;
yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
;
break;}
case 233:
#line 1779 "asn1p_y.y"
{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
checkmem(ct);
ct->type = ACT_EL_VALUE;
ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
;
break;}
case 234:
#line 1793 "asn1p_y.y"
{
char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
int ret;
*p = '@';
strcpy(p + 1, yyvsp[0].tv_str);
yyval.a_ref = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
checkmem(ret == 0);
free(p);
free(yyvsp[0].tv_str);
;
break;}
case 235:
#line 1804 "asn1p_y.y"
{
char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
int ret;
p[0] = '@';
p[1] = '.';
strcpy(p + 2, yyvsp[0].tv_str);
yyval.a_ref = asn1p_ref_new(yylineno);
ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
checkmem(ret == 0);
free(p);
free(yyvsp[0].tv_str);
;
break;}
case 236:
#line 1820 "asn1p_y.y"
{
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
case 237:
#line 1823 "asn1p_y.y"
{
int l1 = strlen(yyvsp[-2].tv_str);
int l3 = strlen(yyvsp[0].tv_str);
yyval.tv_str = malloc(l1 + 1 + l3 + 1);
memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
yyval.tv_str[l1] = '.';
memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
yyval.tv_str[l1 + 1 + l3] = '\0';
;
break;}
case 238:
#line 1841 "asn1p_y.y"
{
yyval.a_marker.flags = EM_NOMARK;
yyval.a_marker.default_value = 0;
;
break;}
case 239:
#line 1845 "asn1p_y.y"
{ yyval.a_marker = yyvsp[0].a_marker; ;
break;}
case 240:
#line 1849 "asn1p_y.y"
{
yyval.a_marker.flags = EM_OPTIONAL;
yyval.a_marker.default_value = 0;
;
break;}
case 241:
#line 1853 "asn1p_y.y"
{
yyval.a_marker.flags = EM_DEFAULT;
yyval.a_marker.default_value = yyvsp[0].a_value;
;
break;}
case 242:
#line 1876 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
;
break;}
case 243:
#line 1880 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-1].a_expr;
;
break;}
case 244:
#line 1886 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 245:
#line 1891 "asn1p_y.y"
{
yyval.a_expr = yyvsp[-2].a_expr;
asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
;
break;}
case 246:
#line 1898 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = A1TC_UNIVERVAL;
yyval.a_expr->meta_type = AMT_VALUE;
yyval.a_expr->Identifier = yyvsp[0].tv_str;
;
break;}
case 247:
#line 1905 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = A1TC_UNIVERVAL;
yyval.a_expr->meta_type = AMT_VALUE;
yyval.a_expr->Identifier = yyvsp[-3].tv_str;
yyval.a_expr->value = yyvsp[-1].a_value;
;
break;}
case 248:
#line 1913 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = A1TC_UNIVERVAL;
yyval.a_expr->meta_type = AMT_VALUE;
yyval.a_expr->Identifier = yyvsp[-3].tv_str;
yyval.a_expr->value = yyvsp[-1].a_value;
;
break;}
case 249:
#line 1921 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->expr_type = A1TC_UNIVERVAL;
yyval.a_expr->meta_type = AMT_VALUE;
yyval.a_expr->value = yyvsp[0].a_value;
;
break;}
case 250:
#line 1928 "asn1p_y.y"
{
yyval.a_expr = asn1p_expr_new(yylineno);
checkmem(yyval.a_expr);
yyval.a_expr->Identifier = strdup("...");
checkmem(yyval.a_expr->Identifier);
yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
yyval.a_expr->meta_type = AMT_VALUE;
;
break;}
case 251:
#line 1939 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
checkmem(yyval.a_value);
;
break;}
case 252:
#line 1943 "asn1p_y.y"
{
yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
checkmem(yyval.a_value);
;
break;}
case 253:
#line 1974 "asn1p_y.y"
{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
break;}
case 254:
#line 1975 "asn1p_y.y"
{ yyval.a_tag = yyvsp[0].a_tag; ;
break;}
case 255:
#line 1979 "asn1p_y.y"
{
yyval.a_tag = yyvsp[-1].a_tag;
yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode;
;
break;}
case 256:
#line 1986 "asn1p_y.y"
{
yyval.a_tag = yyvsp[-2].a_tag;
yyval.a_tag.tag_value = yyvsp[-1].a_int;
;
break;}
case 257:
#line 1992 "asn1p_y.y"
{ yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; ;
break;}
case 258:
#line 1993 "asn1p_y.y"
{ yyval.a_tag.tag_class = TC_UNIVERSAL; ;
break;}
case 259:
#line 1994 "asn1p_y.y"
{ yyval.a_tag.tag_class = TC_APPLICATION; ;
break;}
case 260:
#line 1995 "asn1p_y.y"
{ yyval.a_tag.tag_class = TC_PRIVATE; ;
break;}
case 261:
#line 1999 "asn1p_y.y"
{ yyval.a_tag.tag_mode = TM_DEFAULT; ;
break;}
case 262:
#line 2000 "asn1p_y.y"
{ yyval.a_tag.tag_mode = TM_IMPLICIT; ;
break;}
case 263:
#line 2001 "asn1p_y.y"
{ yyval.a_tag.tag_mode = TM_EXPLICIT; ;
break;}
case 264:
#line 2005 "asn1p_y.y"
{
checkmem(yyvsp[0].tv_str);
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
case 265:
#line 2009 "asn1p_y.y"
{
checkmem(yyvsp[0].tv_str);
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
case 266:
#line 2017 "asn1p_y.y"
{
checkmem(yyvsp[0].tv_str);
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
case 267:
#line 2024 "asn1p_y.y"
{ yyval.tv_str = 0; ;
break;}
case 268:
#line 2025 "asn1p_y.y"
{
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
case 269:
#line 2030 "asn1p_y.y"
{
checkmem(yyvsp[0].tv_str);
yyval.tv_str = yyvsp[0].tv_str;
;
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 543 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (ssize_t)(sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
yyacceptlab:
/* YYACCEPT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 0;
yyabortlab:
/* YYABORT comes here. */
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
#endif
}
return 1;
}
#line 2036 "asn1p_y.y"
/*
* Convert Xstring ('0101'B or '5'H) to the binary vector.
*/
static asn1p_value_t *
_convert_bitstring2binary(char *str, int base) {
asn1p_value_t *val;
int slen;
int memlen;
int baselen;
int bits;
uint8_t *binary_vector;
uint8_t *bv_ptr;
uint8_t cur_val;
assert(str);
assert(str[0] == '\'');
switch(base) {
case 'B':
baselen = 1;
break;
case 'H':
baselen = 4;
break;
default:
assert(base == 'B' || base == 'H');
errno = EINVAL;
return NULL;
}
slen = strlen(str);
assert(str[slen - 1] == base);
assert(str[slen - 2] == '\'');
memlen = slen / (8 / baselen); /* Conservative estimate */
bv_ptr = binary_vector = malloc(memlen + 1);
if(bv_ptr == NULL)
/* ENOMEM */
return NULL;
cur_val = 0;
bits = 0;
while(*(++str) != '\'') {
switch(baselen) {
case 1:
switch(*str) {
case '1':
cur_val |= 1 << (7 - (bits % 8));
case '0':
break;
default:
assert(!"_y UNREACH1");
case ' ': case '\r': case '\n':
continue;
}
break;
case 4:
switch(*str) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
cur_val |= (*str - '0') << (4 - (bits % 8));
break;
case 'A': case 'B': case 'C':
case 'D': case 'E': case 'F':
cur_val |= ((*str - 'A') + 10)
<< (4 - (bits % 8));
break;
default:
assert(!"_y UNREACH2");
case ' ': case '\r': case '\n':
continue;
}
break;
}
bits += baselen;
if((bits % 8) == 0) {
*bv_ptr++ = cur_val;
cur_val = 0;
}
}
*bv_ptr = cur_val;
assert((bv_ptr - binary_vector) <= memlen);
val = asn1p_value_frombits(binary_vector, bits, 0);
if(val == NULL) {
free(binary_vector);
}
return val;
}
extern char *asn1p_text;
int
yyerror(const char *msg) {
fprintf(stderr,
"ASN.1 grammar parse error "
"near line %d (token \"%s\"): %s\n",
yylineno, asn1p_text, msg);
return -1;
}