2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 38 "heimdal/lib/asn1/asn1parse.y"
86 static Type *new_type (Typetype t);
87 static struct constraint_spec *new_constraint_spec(enum ctype);
88 static Type *new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype);
89 void yyerror (const char *);
90 static struct objid *new_objid(const char *label, int value);
91 static void add_oid_to_tail(struct objid *, struct objid *);
92 static void fix_labels(Symbol *s);
96 struct string_list *next;
101 /* Line 189 of yacc.c */
102 #line 103 "heimdal/lib/asn1/asn1parse.y"
104 /* Enabling traces. */
109 /* Enabling verbose error messages. */
110 #ifdef YYERROR_VERBOSE
111 # undef YYERROR_VERBOSE
112 # define YYERROR_VERBOSE 1
114 # define YYERROR_VERBOSE 0
117 /* Enabling the token table. */
118 #ifndef YYTOKEN_TABLE
119 # define YYTOKEN_TABLE 0
126 /* Put the tokens into the symbol table, so that GDB and other debuggers
130 kw_ABSTRACT_SYNTAX = 259,
132 kw_APPLICATION = 261,
144 kw_CONSTRAINED = 273,
147 kw_DEFINITIONS = 276,
155 kw_EXTENSIBILITY = 284,
159 kw_GeneralString = 288,
160 kw_GeneralizedTime = 289,
161 kw_GraphicString = 290,
170 kw_INTERSECTION = 299,
171 kw_ISO646String = 300,
174 kw_MINUS_INFINITY = 303,
176 kw_NumericString = 305,
181 kw_ObjectDescriptor = 310,
184 kw_PLUS_INFINITY = 313,
187 kw_PrintableString = 316,
189 kw_RELATIVE_OID = 318,
198 kw_TYPE_IDENTIFIER = 327,
199 kw_TeletexString = 328,
205 kw_UniversalString = 334,
206 kw_VideotexString = 335,
207 kw_VisibleString = 336,
219 #define kw_ABSENT 258
220 #define kw_ABSTRACT_SYNTAX 259
222 #define kw_APPLICATION 261
223 #define kw_AUTOMATIC 262
226 #define kw_BMPString 265
227 #define kw_BOOLEAN 266
229 #define kw_CHARACTER 268
230 #define kw_CHOICE 269
232 #define kw_COMPONENT 271
233 #define kw_COMPONENTS 272
234 #define kw_CONSTRAINED 273
235 #define kw_CONTAINING 274
236 #define kw_DEFAULT 275
237 #define kw_DEFINITIONS 276
238 #define kw_EMBEDDED 277
239 #define kw_ENCODED 278
241 #define kw_ENUMERATED 280
242 #define kw_EXCEPT 281
243 #define kw_EXPLICIT 282
244 #define kw_EXPORTS 283
245 #define kw_EXTENSIBILITY 284
246 #define kw_EXTERNAL 285
249 #define kw_GeneralString 288
250 #define kw_GeneralizedTime 289
251 #define kw_GraphicString 290
252 #define kw_IA5String 291
253 #define kw_IDENTIFIER 292
254 #define kw_IMPLICIT 293
255 #define kw_IMPLIED 294
256 #define kw_IMPORTS 295
257 #define kw_INCLUDES 296
258 #define kw_INSTANCE 297
259 #define kw_INTEGER 298
260 #define kw_INTERSECTION 299
261 #define kw_ISO646String 300
264 #define kw_MINUS_INFINITY 303
266 #define kw_NumericString 305
267 #define kw_OBJECT 306
270 #define kw_OPTIONAL 309
271 #define kw_ObjectDescriptor 310
272 #define kw_PATTERN 311
274 #define kw_PLUS_INFINITY 313
275 #define kw_PRESENT 314
276 #define kw_PRIVATE 315
277 #define kw_PrintableString 316
279 #define kw_RELATIVE_OID 318
280 #define kw_SEQUENCE 319
283 #define kw_STRING 322
284 #define kw_SYNTAX 323
285 #define kw_T61String 324
288 #define kw_TYPE_IDENTIFIER 327
289 #define kw_TeletexString 328
291 #define kw_UNIQUE 330
292 #define kw_UNIVERSAL 331
293 #define kw_UTCTime 332
294 #define kw_UTF8String 333
295 #define kw_UniversalString 334
296 #define kw_VideotexString 335
297 #define kw_VisibleString 336
302 #define IDENTIFIER 341
303 #define referencename 342
310 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
311 typedef union YYSTYPE
314 /* Line 214 of yacc.c */
315 #line 67 "heimdal/lib/asn1/asn1parse.y"
325 struct string_list *sl;
327 struct memhead *members;
328 struct constraint_spec *constraint_spec;
332 /* Line 214 of yacc.c */
333 #line 334 "heimdal/lib/asn1/asn1parse.y"
335 # define YYSTYPE_IS_TRIVIAL 1
336 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
337 # define YYSTYPE_IS_DECLARED 1
341 /* Copy the second part of user declarations. */
344 /* Line 264 of yacc.c */
345 #line 346 "heimdal/lib/asn1/asn1parse.y"
352 typedef YYTYPE_UINT8 yytype_uint8;
354 typedef unsigned char yytype_uint8;
358 typedef YYTYPE_INT8 yytype_int8;
359 #elif (defined __STDC__ || defined __C99__FUNC__ \
360 || defined __cplusplus || defined _MSC_VER)
361 typedef signed char yytype_int8;
363 typedef short int yytype_int8;
367 typedef YYTYPE_UINT16 yytype_uint16;
369 typedef unsigned short int yytype_uint16;
373 typedef YYTYPE_INT16 yytype_int16;
375 typedef short int yytype_int16;
379 # ifdef __SIZE_TYPE__
380 # define YYSIZE_T __SIZE_TYPE__
381 # elif defined size_t
382 # define YYSIZE_T size_t
383 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
384 || defined __cplusplus || defined _MSC_VER)
385 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
386 # define YYSIZE_T size_t
388 # define YYSIZE_T unsigned int
392 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
397 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
398 # define YY_(msgid) dgettext ("bison-runtime", msgid)
402 # define YY_(msgid) msgid
406 /* Suppress unused-variable warnings by "using" E. */
407 #if ! defined lint || defined __GNUC__
408 # define YYUSE(e) ((void) (e))
410 # define YYUSE(e) /* empty */
413 /* Identity function, used to suppress warnings about constant conditions. */
417 #if (defined __STDC__ || defined __C99__FUNC__ \
418 || defined __cplusplus || defined _MSC_VER)
431 #if ! defined yyoverflow || YYERROR_VERBOSE
433 /* The parser invokes alloca or malloc; define the necessary symbols. */
435 # ifdef YYSTACK_USE_ALLOCA
436 # if YYSTACK_USE_ALLOCA
438 # define YYSTACK_ALLOC __builtin_alloca
439 # elif defined __BUILTIN_VA_ARG_INCR
440 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
442 # define YYSTACK_ALLOC __alloca
443 # elif defined _MSC_VER
444 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
445 # define alloca _alloca
447 # define YYSTACK_ALLOC alloca
448 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
449 || defined __cplusplus || defined _MSC_VER)
450 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
459 # ifdef YYSTACK_ALLOC
460 /* Pacify GCC's `empty if-body' warning. */
461 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
462 # ifndef YYSTACK_ALLOC_MAXIMUM
463 /* The OS might guarantee only one guard page at the bottom of the stack,
464 and a page size can be as small as 4096 bytes. So we cannot safely
465 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
466 to allow for a few compiler-allocated temporary stack slots. */
467 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
470 # define YYSTACK_ALLOC YYMALLOC
471 # define YYSTACK_FREE YYFREE
472 # ifndef YYSTACK_ALLOC_MAXIMUM
473 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
475 # if (defined __cplusplus && ! defined _STDLIB_H \
476 && ! ((defined YYMALLOC || defined malloc) \
477 && (defined YYFREE || defined free)))
478 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 # define YYMALLOC malloc
485 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
486 || defined __cplusplus || defined _MSC_VER)
487 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
492 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
493 || defined __cplusplus || defined _MSC_VER)
494 void free (void *); /* INFRINGES ON USER NAME SPACE */
498 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
501 #if (! defined yyoverflow \
502 && (! defined __cplusplus \
503 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
505 /* A type that is properly aligned for any stack member. */
508 yytype_int16 yyss_alloc;
512 /* The size of the maximum gap between one aligned stack and the next. */
513 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
515 /* The size of an array large to enough to hold all stacks, each with
517 # define YYSTACK_BYTES(N) \
518 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
519 + YYSTACK_GAP_MAXIMUM)
521 /* Copy COUNT objects from FROM to TO. The source and destination do
524 # if defined __GNUC__ && 1 < __GNUC__
525 # define YYCOPY(To, From, Count) \
526 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
528 # define YYCOPY(To, From, Count) \
532 for (yyi = 0; yyi < (Count); yyi++) \
533 (To)[yyi] = (From)[yyi]; \
539 /* Relocate STACK from its old location to the new one. The
540 local variables YYSIZE and YYSTACKSIZE give the old and new number of
541 elements in the stack, and YYPTR gives the new location of the
542 stack. Advance YYPTR to a properly aligned location for the next
544 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
547 YYSIZE_T yynewbytes; \
548 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
549 Stack = &yyptr->Stack_alloc; \
550 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
551 yyptr += yynewbytes / sizeof (*yyptr); \
557 /* YYFINAL -- State number of the termination state. */
559 /* YYLAST -- Last index in YYTABLE. */
562 /* YYNTOKENS -- Number of terminals. */
564 /* YYNNTS -- Number of nonterminals. */
566 /* YYNRULES -- Number of rules. */
568 /* YYNRULES -- Number of states. */
569 #define YYNSTATES 220
571 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
573 #define YYMAXUTOK 344
575 #define YYTRANSLATE(YYX) \
576 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
578 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
579 static const yytype_uint8 yytranslate[] =
581 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
607 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
608 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
609 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
610 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
611 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
612 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
613 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
614 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
619 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
621 static const yytype_uint16 yyprhs[] =
623 0, 0, 3, 13, 16, 19, 22, 23, 26, 27,
624 31, 32, 36, 37, 39, 40, 42, 45, 50, 54,
625 57, 58, 60, 63, 65, 67, 71, 73, 77, 79,
626 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
627 101, 103, 105, 107, 109, 111, 113, 119, 125, 131,
628 135, 137, 140, 145, 147, 151, 155, 160, 165, 167,
629 170, 176, 179, 183, 185, 186, 189, 194, 198, 203,
630 208, 212, 216, 221, 223, 225, 227, 229, 231, 234,
631 238, 240, 242, 244, 247, 251, 257, 262, 266, 271,
632 272, 274, 276, 278, 279, 281, 283, 288, 290, 292,
633 294, 296, 298, 300, 302, 304, 306, 308, 312, 316,
634 319, 321, 324, 328, 330, 334, 339, 341, 342, 346,
635 347, 350, 355, 357, 359, 361, 363, 365, 367, 369,
636 371, 373, 375, 377, 379, 381, 383, 385, 387, 389,
640 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
641 static const yytype_int16 yyrhs[] =
643 99, 0, -1, 86, 152, 21, 100, 101, 84, 8,
644 102, 24, -1, 27, 70, -1, 38, 70, -1, 7,
645 70, -1, -1, 29, 39, -1, -1, 107, 103, 108,
646 -1, -1, 40, 104, 90, -1, -1, 105, -1, -1,
647 106, -1, 105, 106, -1, 110, 32, 86, 152, -1,
648 28, 110, 90, -1, 28, 5, -1, -1, 109, -1,
649 109, 108, -1, 111, -1, 144, -1, 86, 91, 110,
650 -1, 86, -1, 86, 84, 112, -1, 113, -1, 131,
651 -1, 134, -1, 121, -1, 114, -1, 145, -1, 130,
652 -1, 119, -1, 116, -1, 124, -1, 122, -1, 123,
653 -1, 126, -1, 127, -1, 128, -1, 129, -1, 140,
654 -1, 11, -1, 92, 156, 83, 156, 93, -1, 92,
655 156, 83, 46, 93, -1, 92, 47, 83, 156, 93,
656 -1, 92, 156, 93, -1, 43, -1, 43, 115, -1,
657 43, 94, 117, 95, -1, 118, -1, 117, 91, 118,
658 -1, 117, 91, 85, -1, 86, 92, 164, 93, -1,
659 25, 94, 120, 95, -1, 117, -1, 9, 67, -1,
660 9, 67, 94, 150, 95, -1, 51, 37, -1, 52,
661 67, 125, -1, 49, -1, -1, 66, 115, -1, 64,
662 94, 147, 95, -1, 64, 94, 95, -1, 64, 125,
663 53, 112, -1, 65, 94, 147, 95, -1, 65, 94,
664 95, -1, 65, 53, 112, -1, 14, 94, 147, 95,
665 -1, 132, -1, 133, -1, 86, -1, 34, -1, 77,
666 -1, 112, 135, -1, 92, 136, 93, -1, 137, -1,
667 138, -1, 139, -1, 19, 112, -1, 23, 12, 156,
668 -1, 19, 112, 23, 12, 156, -1, 18, 12, 94,
669 95, -1, 141, 143, 112, -1, 96, 142, 89, 97,
670 -1, -1, 76, -1, 6, -1, 60, -1, -1, 27,
671 -1, 38, -1, 86, 112, 84, 156, -1, 146, -1,
672 33, -1, 73, -1, 78, -1, 61, -1, 81, -1,
673 36, -1, 10, -1, 79, -1, 149, -1, 147, 91,
674 149, -1, 147, 91, 85, -1, 86, 112, -1, 148,
675 -1, 148, 54, -1, 148, 20, 156, -1, 151, -1,
676 150, 91, 151, -1, 86, 92, 89, 93, -1, 153,
677 -1, -1, 94, 154, 95, -1, -1, 155, 154, -1,
678 86, 92, 89, 93, -1, 86, -1, 89, -1, 157,
679 -1, 158, -1, 162, -1, 161, -1, 163, -1, 166,
680 -1, 165, -1, 159, -1, 160, -1, 86, -1, 88,
681 -1, 71, -1, 31, -1, 164, -1, 89, -1, 49,
685 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
686 static const yytype_uint16 yyrline[] =
688 0, 235, 235, 242, 243, 245, 247, 250, 252, 255,
689 256, 259, 260, 263, 264, 267, 268, 271, 283, 289,
690 290, 293, 294, 297, 298, 301, 307, 315, 325, 326,
691 327, 330, 331, 332, 333, 334, 335, 336, 337, 338,
692 339, 340, 341, 342, 343, 346, 353, 363, 371, 379,
693 390, 395, 401, 409, 415, 420, 424, 437, 445, 448,
694 455, 463, 469, 478, 486, 487, 492, 498, 506, 515,
695 521, 529, 537, 544, 545, 548, 559, 564, 571, 587,
696 593, 596, 597, 600, 606, 614, 624, 630, 643, 652,
697 655, 659, 663, 670, 673, 677, 684, 695, 698, 703,
698 708, 713, 718, 723, 728, 733, 741, 747, 752, 763,
699 774, 780, 786, 794, 800, 807, 820, 821, 824, 831,
700 834, 845, 849, 860, 866, 867, 870, 871, 872, 873,
701 874, 877, 880, 883, 894, 902, 908, 916, 924, 927,
706 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
707 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
708 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
709 static const char *const yytname[] =
711 "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
712 "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
713 "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
714 "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
715 "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
716 "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
717 "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
718 "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
719 "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
720 "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
721 "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
722 "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
723 "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
724 "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
725 "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
726 "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
727 "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
728 "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
729 "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
730 "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
731 "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
732 "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
733 "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
734 "SymbolsFromModule", "Exports", "AssignmentList", "Assignment",
735 "referencenames", "TypeAssignment", "Type", "BuiltinType", "BooleanType",
736 "range", "IntegerType", "NamedNumberList", "NamedNumber",
737 "EnumeratedType", "Enumerations", "BitStringType",
738 "ObjectIdentifierType", "OctetStringType", "NullType", "size",
739 "SequenceType", "SequenceOfType", "SetType", "SetOfType", "ChoiceType",
740 "ReferencedType", "DefinedType", "UsefulType", "ConstrainedType",
741 "Constraint", "ConstraintSpec", "GeneralConstraint",
742 "ContentsConstraint", "UserDefinedConstraint", "TaggedType", "Tag",
743 "Class", "tagenv", "ValueAssignment", "CharacterStringType",
744 "RestrictedCharactedStringType", "ComponentTypeList", "NamedType",
745 "ComponentType", "NamedBitList", "NamedBit", "objid_opt", "objid",
746 "objid_list", "objid_element", "Value", "BuiltinValue",
747 "ReferencedValue", "DefinedValue", "Valuereference",
748 "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
749 "NullValue", "ObjectIdentifierValue", 0
754 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
756 static const yytype_uint16 yytoknum[] =
758 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
759 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
760 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
761 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
762 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
763 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
764 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
765 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
766 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
767 59, 44, 40, 41, 123, 125, 91, 93
771 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
772 static const yytype_uint8 yyr1[] =
774 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
775 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
776 107, 108, 108, 109, 109, 110, 110, 111, 112, 112,
777 112, 113, 113, 113, 113, 113, 113, 113, 113, 113,
778 113, 113, 113, 113, 113, 114, 115, 115, 115, 115,
779 116, 116, 116, 117, 117, 117, 118, 119, 120, 121,
780 121, 122, 123, 124, 125, 125, 126, 126, 127, 128,
781 128, 129, 130, 131, 131, 132, 133, 133, 134, 135,
782 136, 137, 137, 138, 138, 138, 139, 140, 141, 142,
783 142, 142, 142, 143, 143, 143, 144, 145, 146, 146,
784 146, 146, 146, 146, 146, 146, 147, 147, 147, 148,
785 149, 149, 149, 150, 150, 151, 152, 152, 153, 154,
786 154, 155, 155, 155, 156, 156, 157, 157, 157, 157,
787 157, 158, 159, 160, 161, 162, 162, 163, 164, 165,
791 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
792 static const yytype_uint8 yyr2[] =
794 0, 2, 9, 2, 2, 2, 0, 2, 0, 3,
795 0, 3, 0, 1, 0, 1, 2, 4, 3, 2,
796 0, 1, 2, 1, 1, 3, 1, 3, 1, 1,
797 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
798 1, 1, 1, 1, 1, 1, 5, 5, 5, 3,
799 1, 2, 4, 1, 3, 3, 4, 4, 1, 2,
800 5, 2, 3, 1, 0, 2, 4, 3, 4, 4,
801 3, 3, 4, 1, 1, 1, 1, 1, 2, 3,
802 1, 1, 1, 2, 3, 5, 4, 3, 4, 0,
803 1, 1, 1, 0, 1, 1, 4, 1, 1, 1,
804 1, 1, 1, 1, 1, 1, 1, 3, 3, 2,
805 1, 2, 3, 1, 3, 4, 1, 0, 3, 0,
806 2, 4, 1, 1, 1, 1, 1, 1, 1, 1,
807 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
811 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
812 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
813 means the default is an error. */
814 static const yytype_uint8 yydefact[] =
816 0, 117, 0, 119, 0, 116, 1, 122, 123, 0,
817 119, 6, 0, 118, 120, 0, 0, 0, 8, 0,
818 5, 3, 4, 0, 0, 121, 7, 0, 20, 0,
819 0, 12, 19, 26, 0, 2, 14, 0, 0, 18,
820 0, 13, 15, 0, 0, 9, 21, 23, 24, 25,
821 11, 16, 0, 0, 104, 45, 0, 0, 98, 76,
822 103, 50, 63, 0, 0, 101, 64, 0, 99, 77,
823 100, 105, 102, 0, 75, 89, 0, 28, 32, 36,
824 35, 31, 38, 39, 37, 40, 41, 42, 43, 34,
825 29, 73, 74, 30, 44, 93, 33, 97, 22, 117,
826 59, 0, 0, 0, 0, 51, 61, 64, 0, 0,
827 0, 0, 0, 27, 91, 92, 90, 0, 0, 0,
828 78, 94, 95, 0, 17, 0, 0, 0, 110, 106,
829 0, 58, 53, 0, 136, 0, 139, 135, 133, 134,
830 138, 140, 0, 124, 125, 131, 132, 127, 126, 128,
831 137, 130, 129, 0, 62, 65, 67, 0, 0, 71,
832 70, 0, 0, 96, 0, 0, 0, 0, 80, 81,
833 82, 87, 0, 0, 113, 109, 0, 72, 0, 111,
834 0, 0, 57, 0, 0, 49, 52, 66, 68, 69,
835 88, 0, 83, 0, 79, 0, 0, 60, 108, 107,
836 112, 0, 55, 54, 0, 0, 0, 0, 0, 84,
837 0, 114, 56, 48, 47, 46, 86, 0, 115, 85
840 /* YYDEFGOTO[NTERM-NUM]. */
841 static const yytype_int16 yydefgoto[] =
843 -1, 2, 18, 24, 30, 37, 40, 41, 42, 31,
844 45, 46, 43, 47, 76, 77, 78, 105, 79, 131,
845 132, 80, 133, 81, 82, 83, 84, 110, 85, 86,
846 87, 88, 89, 90, 91, 92, 93, 120, 167, 168,
847 169, 170, 94, 95, 117, 123, 48, 96, 97, 127,
848 128, 129, 173, 174, 4, 141, 9, 10, 142, 143,
849 144, 145, 146, 147, 148, 149, 150, 151, 152
852 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
854 #define YYPACT_NINF -119
855 static const yytype_int16 yypact[] =
857 -43, -56, 47, -65, 29, -119, -119, -31, -119, -25,
858 -65, 4, -1, -119, -119, 17, 20, 26, 50, 13,
859 -119, -119, -119, 63, 24, -119, -119, 104, 8, -2,
860 89, 74, -119, 33, 25, -119, 34, 39, 34, -119,
861 37, 34, -119, 98, 58, -119, 39, -119, -119, -119,
862 -119, -119, 52, 66, -119, -119, 51, 53, -119, -119,
863 -119, -79, -119, 109, 81, -119, -60, -48, -119, -119,
864 -119, -119, -119, 107, -119, 2, -74, -119, -119, -119,
865 -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
866 -119, -119, -119, -119, -119, -18, -119, -119, -119, -56,
867 55, 65, 67, -12, 67, -119, -119, 86, 68, -70,
868 102, 107, -69, 69, -119, -119, -119, 73, 40, 10,
869 -119, -119, -119, 107, -119, 71, 107, -47, -13, -119,
870 72, 75, -119, 70, -119, 80, -119, -119, -119, -119,
871 -119, -119, -71, -119, -119, -119, -119, -119, -119, -119,
872 -119, -119, -119, -46, -119, -119, -119, -39, 107, 69,
873 -119, -38, 76, -119, 155, 107, 157, 77, -119, -119,
874 -119, 69, 82, -10, -119, 69, -22, -119, 40, -119,
875 87, 19, -119, 40, 9, -119, -119, -119, 69, -119,
876 -119, 83, -19, 40, -119, 90, 71, -119, -119, -119,
877 -119, 85, -119, -119, 88, 94, 96, 95, 163, -119,
878 99, -119, -119, -119, -119, -119, -119, 40, -119, -119
881 /* YYPGOTO[NTERM-NUM]. */
882 static const yytype_int16 yypgoto[] =
884 -119, -119, -119, -119, -119, -119, -119, -119, 141, -119,
885 137, -119, -15, -119, -72, -119, -119, 91, -119, 92,
886 14, -119, -119, -119, -119, -119, -119, 84, -119, -119,
887 -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
888 -119, -119, -119, -119, -119, -119, -119, -119, -119, -82,
889 -119, 18, -119, 5, 101, 1, 187, -119, -118, -119,
890 -119, -119, -119, -119, -119, -119, 22, -119, -119
893 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
894 positive, shift that token. If negative, reduce the rule which
895 number is the opposite. If zero, do what YYDEFACT says.
896 If YYTABLE_NINF, syntax error. */
897 #define YYTABLE_NINF -11
898 static const yytype_int16 yytable[] =
900 163, 113, 5, 32, 208, 111, 108, 178, 114, 121,
901 118, 15, 184, 103, 34, 104, 126, 126, 119, 134,
902 122, 7, 185, 49, 8, 156, 160, 157, 164, 165,
903 161, 16, -10, 166, 109, 135, 29, 136, 3, 159,
904 134, 179, 17, 1, 176, 181, 112, 6, 177, 186,
905 11, 171, 176, 176, 175, 205, 187, 189, 136, 137,
906 200, 12, 115, 198, 126, 204, 206, 53, 54, 55,
907 13, 134, 56, 119, 138, 209, 139, 140, 116, 23,
908 137, 196, 3, 57, 33, 197, 188, 20, 19, 136,
909 21, 58, 59, 192, 60, 138, 22, 139, 140, 219,
910 5, 61, 26, 3, 202, 130, 25, 62, 27, 63,
911 64, 137, 28, 35, 36, 39, 53, 54, 55, 65,
912 33, 56, 66, 67, 38, 44, 138, 50, 139, 140,
913 52, 68, 57, 100, 3, 69, 70, 71, 99, 72,
914 58, 59, 73, 60, 74, 101, 106, 102, 107, 125,
915 61, 126, 108, 130, 75, 158, 62, 172, 63, 64,
916 103, 119, 162, 183, 180, 182, 181, 191, 65, 193,
917 194, 66, 67, 190, 195, 217, 140, 207, 212, 210,
918 68, 213, 51, 98, 69, 70, 71, 214, 72, 215,
919 216, 154, 218, 74, 199, 203, 153, 14, 0, 155,
923 static const yytype_int16 yycheck[] =
925 118, 73, 1, 5, 23, 53, 66, 20, 6, 27,
926 84, 7, 83, 92, 29, 94, 86, 86, 92, 31,
927 38, 86, 93, 38, 89, 95, 95, 109, 18, 19,
928 112, 27, 24, 23, 94, 47, 28, 49, 94, 111,
929 31, 54, 38, 86, 91, 91, 94, 0, 95, 95,
930 21, 123, 91, 91, 126, 46, 95, 95, 49, 71,
931 178, 92, 60, 85, 86, 183, 184, 9, 10, 11,
932 95, 31, 14, 92, 86, 193, 88, 89, 76, 29,
933 71, 91, 94, 25, 86, 95, 158, 70, 89, 49,
934 70, 33, 34, 165, 36, 86, 70, 88, 89, 217,
935 99, 43, 39, 94, 85, 86, 93, 49, 84, 51,
936 52, 71, 8, 24, 40, 90, 9, 10, 11, 61,
937 86, 14, 64, 65, 91, 86, 86, 90, 88, 89,
938 32, 73, 25, 67, 94, 77, 78, 79, 86, 81,
939 33, 34, 84, 36, 86, 94, 37, 94, 67, 94,
940 43, 86, 66, 86, 96, 53, 49, 86, 51, 52,
941 92, 92, 89, 83, 92, 95, 91, 12, 61, 12,
942 93, 64, 65, 97, 92, 12, 89, 94, 93, 89,
943 73, 93, 41, 46, 77, 78, 79, 93, 81, 93,
944 95, 107, 93, 86, 176, 181, 104, 10, -1, 108,
948 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
949 symbol of state STATE-NUM. */
950 static const yytype_uint8 yystos[] =
952 0, 86, 99, 94, 152, 153, 0, 86, 89, 154,
953 155, 21, 92, 95, 154, 7, 27, 38, 100, 89,
954 70, 70, 70, 29, 101, 93, 39, 84, 8, 28,
955 102, 107, 5, 86, 110, 24, 40, 103, 91, 90,
956 104, 105, 106, 110, 86, 108, 109, 111, 144, 110,
957 90, 106, 32, 9, 10, 11, 14, 25, 33, 34,
958 36, 43, 49, 51, 52, 61, 64, 65, 73, 77,
959 78, 79, 81, 84, 86, 96, 112, 113, 114, 116,
960 119, 121, 122, 123, 124, 126, 127, 128, 129, 130,
961 131, 132, 133, 134, 140, 141, 145, 146, 108, 86,
962 67, 94, 94, 92, 94, 115, 37, 67, 66, 94,
963 125, 53, 94, 112, 6, 60, 76, 142, 84, 92,
964 135, 27, 38, 143, 152, 94, 86, 147, 148, 149,
965 86, 117, 118, 120, 31, 47, 49, 71, 86, 88,
966 89, 153, 156, 157, 158, 159, 160, 161, 162, 163,
967 164, 165, 166, 117, 125, 115, 95, 147, 53, 112,
968 95, 147, 89, 156, 18, 19, 23, 136, 137, 138,
969 139, 112, 86, 150, 151, 112, 91, 95, 20, 54,
970 92, 91, 95, 83, 83, 93, 95, 95, 112, 95,
971 97, 12, 112, 12, 93, 92, 91, 95, 85, 149,
972 156, 164, 85, 118, 156, 46, 156, 94, 23, 156,
973 89, 151, 93, 93, 93, 93, 95, 12, 93, 156
976 #define yyerrok (yyerrstatus = 0)
977 #define yyclearin (yychar = YYEMPTY)
981 #define YYACCEPT goto yyacceptlab
982 #define YYABORT goto yyabortlab
983 #define YYERROR goto yyerrorlab
986 /* Like YYERROR except do call yyerror. This remains here temporarily
987 to ease the transition to the new meaning of YYERROR, for GCC.
988 Once GCC version 2 has supplanted version 1, this can go. */
990 #define YYFAIL goto yyerrlab
992 #define YYRECOVERING() (!!yyerrstatus)
994 #define YYBACKUP(Token, Value) \
996 if (yychar == YYEMPTY && yylen == 1) \
1000 yytoken = YYTRANSLATE (yychar); \
1006 yyerror (YY_("syntax error: cannot back up")); \
1013 #define YYERRCODE 256
1016 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1017 If N is 0, then set CURRENT to the empty location which ends
1018 the previous symbol: RHS[0] (always defined). */
1020 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1021 #ifndef YYLLOC_DEFAULT
1022 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1026 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1027 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1028 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1029 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1033 (Current).first_line = (Current).last_line = \
1034 YYRHSLOC (Rhs, 0).last_line; \
1035 (Current).first_column = (Current).last_column = \
1036 YYRHSLOC (Rhs, 0).last_column; \
1042 /* YY_LOCATION_PRINT -- Print the location on the stream.
1043 This macro was not mandated originally: define only if we know
1044 we won't break user code: when these are the locations we know. */
1046 #ifndef YY_LOCATION_PRINT
1047 # if YYLTYPE_IS_TRIVIAL
1048 # define YY_LOCATION_PRINT(File, Loc) \
1049 fprintf (File, "%d.%d-%d.%d", \
1050 (Loc).first_line, (Loc).first_column, \
1051 (Loc).last_line, (Loc).last_column)
1053 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1058 /* YYLEX -- calling `yylex' with the right arguments. */
1061 # define YYLEX yylex (YYLEX_PARAM)
1063 # define YYLEX yylex ()
1066 /* Enable debugging if requested. */
1070 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1071 # define YYFPRINTF fprintf
1074 # define YYDPRINTF(Args) \
1080 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1084 YYFPRINTF (stderr, "%s ", Title); \
1085 yy_symbol_print (stderr, \
1087 YYFPRINTF (stderr, "\n"); \
1092 /*--------------------------------.
1093 | Print this symbol on YYOUTPUT. |
1094 `--------------------------------*/
1097 #if (defined __STDC__ || defined __C99__FUNC__ \
1098 || defined __cplusplus || defined _MSC_VER)
1100 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1103 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1106 YYSTYPE const * const yyvaluep;
1112 if (yytype < YYNTOKENS)
1113 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1125 /*--------------------------------.
1126 | Print this symbol on YYOUTPUT. |
1127 `--------------------------------*/
1129 #if (defined __STDC__ || defined __C99__FUNC__ \
1130 || defined __cplusplus || defined _MSC_VER)
1132 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1135 yy_symbol_print (yyoutput, yytype, yyvaluep)
1138 YYSTYPE const * const yyvaluep;
1141 if (yytype < YYNTOKENS)
1142 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1144 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1146 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1147 YYFPRINTF (yyoutput, ")");
1150 /*------------------------------------------------------------------.
1151 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1153 `------------------------------------------------------------------*/
1155 #if (defined __STDC__ || defined __C99__FUNC__ \
1156 || defined __cplusplus || defined _MSC_VER)
1158 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1161 yy_stack_print (yybottom, yytop)
1162 yytype_int16 *yybottom;
1163 yytype_int16 *yytop;
1166 YYFPRINTF (stderr, "Stack now");
1167 for (; yybottom <= yytop; yybottom++)
1169 int yybot = *yybottom;
1170 YYFPRINTF (stderr, " %d", yybot);
1172 YYFPRINTF (stderr, "\n");
1175 # define YY_STACK_PRINT(Bottom, Top) \
1178 yy_stack_print ((Bottom), (Top)); \
1182 /*------------------------------------------------.
1183 | Report that the YYRULE is going to be reduced. |
1184 `------------------------------------------------*/
1186 #if (defined __STDC__ || defined __C99__FUNC__ \
1187 || defined __cplusplus || defined _MSC_VER)
1189 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1192 yy_reduce_print (yyvsp, yyrule)
1197 int yynrhs = yyr2[yyrule];
1199 unsigned long int yylno = yyrline[yyrule];
1200 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1202 /* The symbols being reduced. */
1203 for (yyi = 0; yyi < yynrhs; yyi++)
1205 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1206 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1207 &(yyvsp[(yyi + 1) - (yynrhs)])
1209 YYFPRINTF (stderr, "\n");
1213 # define YY_REDUCE_PRINT(Rule) \
1216 yy_reduce_print (yyvsp, Rule); \
1219 /* Nonzero means print parse trace. It is left uninitialized so that
1220 multiple parsers can coexist. */
1222 #else /* !YYDEBUG */
1223 # define YYDPRINTF(Args)
1224 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1225 # define YY_STACK_PRINT(Bottom, Top)
1226 # define YY_REDUCE_PRINT(Rule)
1227 #endif /* !YYDEBUG */
1230 /* YYINITDEPTH -- initial size of the parser's stacks. */
1232 # define YYINITDEPTH 200
1235 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1236 if the built-in stack extension method is used).
1238 Do not make this value too large; the results are undefined if
1239 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1240 evaluated with infinite-precision integer arithmetic. */
1243 # define YYMAXDEPTH 10000
1251 # if defined __GLIBC__ && defined _STRING_H
1252 # define yystrlen strlen
1254 /* Return the length of YYSTR. */
1255 #if (defined __STDC__ || defined __C99__FUNC__ \
1256 || defined __cplusplus || defined _MSC_VER)
1258 yystrlen (const char *yystr)
1266 for (yylen = 0; yystr[yylen]; yylen++)
1274 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1275 # define yystpcpy stpcpy
1277 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1279 #if (defined __STDC__ || defined __C99__FUNC__ \
1280 || defined __cplusplus || defined _MSC_VER)
1282 yystpcpy (char *yydest, const char *yysrc)
1285 yystpcpy (yydest, yysrc)
1291 const char *yys = yysrc;
1293 while ((*yyd++ = *yys++) != '\0')
1302 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1303 quotes and backslashes, so that it's suitable for yyerror. The
1304 heuristic is that double-quoting is unnecessary unless the string
1305 contains an apostrophe, a comma, or backslash (other than
1306 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1307 null, do not copy; instead, return the length of what the result
1310 yytnamerr (char *yyres, const char *yystr)
1315 char const *yyp = yystr;
1322 goto do_not_strip_quotes;
1326 goto do_not_strip_quotes;
1339 do_not_strip_quotes: ;
1343 return yystrlen (yystr);
1345 return yystpcpy (yyres, yystr) - yyres;
1349 /* Copy into YYRESULT an error message about the unexpected token
1350 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1351 including the terminating null byte. If YYRESULT is null, do not
1352 copy anything; just return the number of bytes that would be
1353 copied. As a special case, return 0 if an ordinary "syntax error"
1354 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1355 size calculation. */
1357 yysyntax_error (char *yyresult, int yystate, int yychar)
1359 int yyn = yypact[yystate];
1361 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1365 int yytype = YYTRANSLATE (yychar);
1366 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1367 YYSIZE_T yysize = yysize0;
1369 int yysize_overflow = 0;
1370 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1371 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1375 /* This is so xgettext sees the translatable formats that are
1376 constructed on the fly. */
1377 YY_("syntax error, unexpected %s");
1378 YY_("syntax error, unexpected %s, expecting %s");
1379 YY_("syntax error, unexpected %s, expecting %s or %s");
1380 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1381 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1385 static char const yyunexpected[] = "syntax error, unexpected %s";
1386 static char const yyexpecting[] = ", expecting %s";
1387 static char const yyor[] = " or %s";
1388 char yyformat[sizeof yyunexpected
1389 + sizeof yyexpecting - 1
1390 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1391 * (sizeof yyor - 1))];
1392 char const *yyprefix = yyexpecting;
1394 /* Start YYX at -YYN if negative to avoid negative indexes in
1396 int yyxbegin = yyn < 0 ? -yyn : 0;
1398 /* Stay within bounds of both yycheck and yytname. */
1399 int yychecklim = YYLAST - yyn + 1;
1400 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1403 yyarg[0] = yytname[yytype];
1404 yyfmt = yystpcpy (yyformat, yyunexpected);
1406 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1407 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1409 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1413 yyformat[sizeof yyunexpected - 1] = '\0';
1416 yyarg[yycount++] = yytname[yyx];
1417 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1418 yysize_overflow |= (yysize1 < yysize);
1420 yyfmt = yystpcpy (yyfmt, yyprefix);
1424 yyf = YY_(yyformat);
1425 yysize1 = yysize + yystrlen (yyf);
1426 yysize_overflow |= (yysize1 < yysize);
1429 if (yysize_overflow)
1430 return YYSIZE_MAXIMUM;
1434 /* Avoid sprintf, as that infringes on the user's name space.
1435 Don't have undefined behavior even if the translation
1436 produced a string with the wrong number of "%s"s. */
1437 char *yyp = yyresult;
1439 while ((*yyp = *yyf) != '\0')
1441 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1443 yyp += yytnamerr (yyp, yyarg[yyi++]);
1456 #endif /* YYERROR_VERBOSE */
1459 /*-----------------------------------------------.
1460 | Release the memory associated to this symbol. |
1461 `-----------------------------------------------*/
1464 #if (defined __STDC__ || defined __C99__FUNC__ \
1465 || defined __cplusplus || defined _MSC_VER)
1467 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1470 yydestruct (yymsg, yytype, yyvaluep)
1480 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1490 /* Prevent warnings from -Wmissing-prototypes. */
1491 #ifdef YYPARSE_PARAM
1492 #if defined __STDC__ || defined __cplusplus
1493 int yyparse (void *YYPARSE_PARAM);
1497 #else /* ! YYPARSE_PARAM */
1498 #if defined __STDC__ || defined __cplusplus
1503 #endif /* ! YYPARSE_PARAM */
1506 /* The lookahead symbol. */
1509 /* The semantic value of the lookahead symbol. */
1512 /* Number of syntax errors so far. */
1517 /*-------------------------.
1518 | yyparse or yypush_parse. |
1519 `-------------------------*/
1521 #ifdef YYPARSE_PARAM
1522 #if (defined __STDC__ || defined __C99__FUNC__ \
1523 || defined __cplusplus || defined _MSC_VER)
1525 yyparse (void *YYPARSE_PARAM)
1528 yyparse (YYPARSE_PARAM)
1529 void *YYPARSE_PARAM;
1531 #else /* ! YYPARSE_PARAM */
1532 #if (defined __STDC__ || defined __C99__FUNC__ \
1533 || defined __cplusplus || defined _MSC_VER)
1546 /* Number of tokens to shift before error messages enabled. */
1549 /* The stacks and their tools:
1550 `yyss': related to states.
1551 `yyvs': related to semantic values.
1553 Refer to the stacks thru separate pointers, to allow yyoverflow
1554 to reallocate them elsewhere. */
1556 /* The state stack. */
1557 yytype_int16 yyssa[YYINITDEPTH];
1559 yytype_int16 *yyssp;
1561 /* The semantic value stack. */
1562 YYSTYPE yyvsa[YYINITDEPTH];
1566 YYSIZE_T yystacksize;
1570 /* Lookahead token as an internal (translated) token number. */
1572 /* The variables used to return semantic value and location from the
1577 /* Buffer for error messages, and its allocated size. */
1579 char *yymsg = yymsgbuf;
1580 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1583 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1585 /* The number of symbols on the RHS of the reduced rule.
1586 Keep to zero when no symbol should be popped. */
1592 yystacksize = YYINITDEPTH;
1594 YYDPRINTF ((stderr, "Starting parse\n"));
1599 yychar = YYEMPTY; /* Cause a token to be read. */
1601 /* Initialize stack pointers.
1602 Waste one element of value and location stack
1603 so that they stay on the same level as the state stack.
1604 The wasted elements are never initialized. */
1610 /*------------------------------------------------------------.
1611 | yynewstate -- Push a new state, which is found in yystate. |
1612 `------------------------------------------------------------*/
1614 /* In all cases, when you get here, the value and location stacks
1615 have just been pushed. So pushing a state here evens the stacks. */
1621 if (yyss + yystacksize - 1 <= yyssp)
1623 /* Get the current used size of the three stacks, in elements. */
1624 YYSIZE_T yysize = yyssp - yyss + 1;
1628 /* Give user a chance to reallocate the stack. Use copies of
1629 these so that the &'s don't force the real ones into
1631 YYSTYPE *yyvs1 = yyvs;
1632 yytype_int16 *yyss1 = yyss;
1634 /* Each stack pointer address is followed by the size of the
1635 data in use in that stack, in bytes. This used to be a
1636 conditional around just the two extra args, but that might
1637 be undefined if yyoverflow is a macro. */
1638 yyoverflow (YY_("memory exhausted"),
1639 &yyss1, yysize * sizeof (*yyssp),
1640 &yyvs1, yysize * sizeof (*yyvsp),
1646 #else /* no yyoverflow */
1647 # ifndef YYSTACK_RELOCATE
1648 goto yyexhaustedlab;
1650 /* Extend the stack our own way. */
1651 if (YYMAXDEPTH <= yystacksize)
1652 goto yyexhaustedlab;
1654 if (YYMAXDEPTH < yystacksize)
1655 yystacksize = YYMAXDEPTH;
1658 yytype_int16 *yyss1 = yyss;
1659 union yyalloc *yyptr =
1660 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1662 goto yyexhaustedlab;
1663 YYSTACK_RELOCATE (yyss_alloc, yyss);
1664 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1665 # undef YYSTACK_RELOCATE
1667 YYSTACK_FREE (yyss1);
1670 #endif /* no yyoverflow */
1672 yyssp = yyss + yysize - 1;
1673 yyvsp = yyvs + yysize - 1;
1675 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1676 (unsigned long int) yystacksize));
1678 if (yyss + yystacksize - 1 <= yyssp)
1682 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1684 if (yystate == YYFINAL)
1694 /* Do appropriate processing given the current state. Read a
1695 lookahead token if we need one and don't already have one. */
1697 /* First try to decide what to do without reference to lookahead token. */
1698 yyn = yypact[yystate];
1699 if (yyn == YYPACT_NINF)
1702 /* Not known => get a lookahead token if don't already have one. */
1704 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1705 if (yychar == YYEMPTY)
1707 YYDPRINTF ((stderr, "Reading a token: "));
1711 if (yychar <= YYEOF)
1713 yychar = yytoken = YYEOF;
1714 YYDPRINTF ((stderr, "Now at end of input.\n"));
1718 yytoken = YYTRANSLATE (yychar);
1719 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1722 /* If the proper action on seeing token YYTOKEN is to reduce or to
1723 detect an error, take that action. */
1725 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1730 if (yyn == 0 || yyn == YYTABLE_NINF)
1736 /* Count tokens shifted since error; after three, turn off error
1741 /* Shift the lookahead token. */
1742 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1744 /* Discard the shifted token. */
1753 /*-----------------------------------------------------------.
1754 | yydefault -- do the default action for the current state. |
1755 `-----------------------------------------------------------*/
1757 yyn = yydefact[yystate];
1763 /*-----------------------------.
1764 | yyreduce -- Do a reduction. |
1765 `-----------------------------*/
1767 /* yyn is the number of a rule to reduce with. */
1770 /* If YYLEN is nonzero, implement the default value of the action:
1773 Otherwise, the following line sets YYVAL to garbage.
1774 This behavior is undocumented and Bison
1775 users should not rely upon it. Assigning to YYVAL
1776 unconditionally makes the parser a bit smaller, and it avoids a
1777 GCC warning that YYVAL may be used uninitialized. */
1778 yyval = yyvsp[1-yylen];
1781 YY_REDUCE_PRINT (yyn);
1786 /* Line 1455 of yacc.c */
1787 #line 237 "heimdal/lib/asn1/asn1parse.y"
1795 /* Line 1455 of yacc.c */
1796 #line 244 "heimdal/lib/asn1/asn1parse.y"
1797 { error_message("implicit tagging is not supported"); }
1802 /* Line 1455 of yacc.c */
1803 #line 246 "heimdal/lib/asn1/asn1parse.y"
1804 { error_message("automatic tagging is not supported"); }
1809 /* Line 1455 of yacc.c */
1810 #line 251 "heimdal/lib/asn1/asn1parse.y"
1811 { error_message("no extensibility options supported"); }
1816 /* Line 1455 of yacc.c */
1817 #line 272 "heimdal/lib/asn1/asn1parse.y"
1819 struct string_list *sl;
1820 for(sl = (yyvsp[(1) - (4)].sl); sl != NULL; sl = sl->next) {
1821 Symbol *s = addsym(sl->string);
1823 gen_template_import(s);
1825 add_import((yyvsp[(3) - (4)].name));
1831 /* Line 1455 of yacc.c */
1832 #line 284 "heimdal/lib/asn1/asn1parse.y"
1834 struct string_list *sl;
1835 for(sl = (yyvsp[(2) - (3)].sl); sl != NULL; sl = sl->next)
1836 add_export(sl->string);
1842 /* Line 1455 of yacc.c */
1843 #line 302 "heimdal/lib/asn1/asn1parse.y"
1845 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1846 (yyval.sl)->string = (yyvsp[(1) - (3)].name);
1847 (yyval.sl)->next = (yyvsp[(3) - (3)].sl);
1853 /* Line 1455 of yacc.c */
1854 #line 308 "heimdal/lib/asn1/asn1parse.y"
1856 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1857 (yyval.sl)->string = (yyvsp[(1) - (1)].name);
1858 (yyval.sl)->next = NULL;
1864 /* Line 1455 of yacc.c */
1865 #line 316 "heimdal/lib/asn1/asn1parse.y"
1867 Symbol *s = addsym ((yyvsp[(1) - (3)].name));
1869 s->type = (yyvsp[(3) - (3)].type);
1877 /* Line 1455 of yacc.c */
1878 #line 347 "heimdal/lib/asn1/asn1parse.y"
1880 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Boolean,
1881 TE_EXPLICIT, new_type(TBoolean));
1887 /* Line 1455 of yacc.c */
1888 #line 354 "heimdal/lib/asn1/asn1parse.y"
1890 if((yyvsp[(2) - (5)].value)->type != integervalue)
1891 error_message("Non-integer used in first part of range");
1892 if((yyvsp[(2) - (5)].value)->type != integervalue)
1893 error_message("Non-integer in second part of range");
1894 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1895 (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
1896 (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
1902 /* Line 1455 of yacc.c */
1903 #line 364 "heimdal/lib/asn1/asn1parse.y"
1905 if((yyvsp[(2) - (5)].value)->type != integervalue)
1906 error_message("Non-integer in first part of range");
1907 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1908 (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
1909 (yyval.range)->max = (yyvsp[(2) - (5)].value)->u.integervalue - 1;
1915 /* Line 1455 of yacc.c */
1916 #line 372 "heimdal/lib/asn1/asn1parse.y"
1918 if((yyvsp[(4) - (5)].value)->type != integervalue)
1919 error_message("Non-integer in second part of range");
1920 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1921 (yyval.range)->min = (yyvsp[(4) - (5)].value)->u.integervalue + 2;
1922 (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
1928 /* Line 1455 of yacc.c */
1929 #line 380 "heimdal/lib/asn1/asn1parse.y"
1931 if((yyvsp[(2) - (3)].value)->type != integervalue)
1932 error_message("Non-integer used in limit");
1933 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1934 (yyval.range)->min = (yyvsp[(2) - (3)].value)->u.integervalue;
1935 (yyval.range)->max = (yyvsp[(2) - (3)].value)->u.integervalue;
1941 /* Line 1455 of yacc.c */
1942 #line 391 "heimdal/lib/asn1/asn1parse.y"
1944 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer,
1945 TE_EXPLICIT, new_type(TInteger));
1951 /* Line 1455 of yacc.c */
1952 #line 396 "heimdal/lib/asn1/asn1parse.y"
1954 (yyval.type) = new_type(TInteger);
1955 (yyval.type)->range = (yyvsp[(2) - (2)].range);
1956 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1962 /* Line 1455 of yacc.c */
1963 #line 402 "heimdal/lib/asn1/asn1parse.y"
1965 (yyval.type) = new_type(TInteger);
1966 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1967 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1973 /* Line 1455 of yacc.c */
1974 #line 410 "heimdal/lib/asn1/asn1parse.y"
1976 (yyval.members) = emalloc(sizeof(*(yyval.members)));
1977 ASN1_TAILQ_INIT((yyval.members));
1978 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
1984 /* Line 1455 of yacc.c */
1985 #line 416 "heimdal/lib/asn1/asn1parse.y"
1987 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
1988 (yyval.members) = (yyvsp[(1) - (3)].members);
1994 /* Line 1455 of yacc.c */
1995 #line 421 "heimdal/lib/asn1/asn1parse.y"
1996 { (yyval.members) = (yyvsp[(1) - (3)].members); }
2001 /* Line 1455 of yacc.c */
2002 #line 425 "heimdal/lib/asn1/asn1parse.y"
2004 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2005 (yyval.member)->name = (yyvsp[(1) - (4)].name);
2006 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
2007 output_name ((yyval.member)->gen_name);
2008 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
2009 (yyval.member)->optional = 0;
2010 (yyval.member)->ellipsis = 0;
2011 (yyval.member)->type = NULL;
2017 /* Line 1455 of yacc.c */
2018 #line 438 "heimdal/lib/asn1/asn1parse.y"
2020 (yyval.type) = new_type(TInteger);
2021 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2022 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Enumerated, TE_EXPLICIT, (yyval.type));
2028 /* Line 1455 of yacc.c */
2029 #line 449 "heimdal/lib/asn1/asn1parse.y"
2031 (yyval.type) = new_type(TBitString);
2032 (yyval.type)->members = emalloc(sizeof(*(yyval.type)->members));
2033 ASN1_TAILQ_INIT((yyval.type)->members);
2034 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
2040 /* Line 1455 of yacc.c */
2041 #line 456 "heimdal/lib/asn1/asn1parse.y"
2043 (yyval.type) = new_type(TBitString);
2044 (yyval.type)->members = (yyvsp[(4) - (5)].members);
2045 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
2051 /* Line 1455 of yacc.c */
2052 #line 464 "heimdal/lib/asn1/asn1parse.y"
2054 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OID,
2055 TE_EXPLICIT, new_type(TOID));
2061 /* Line 1455 of yacc.c */
2062 #line 470 "heimdal/lib/asn1/asn1parse.y"
2064 Type *t = new_type(TOctetString);
2065 t->range = (yyvsp[(3) - (3)].range);
2066 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OctetString,
2073 /* Line 1455 of yacc.c */
2074 #line 479 "heimdal/lib/asn1/asn1parse.y"
2076 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Null,
2077 TE_EXPLICIT, new_type(TNull));
2083 /* Line 1455 of yacc.c */
2084 #line 486 "heimdal/lib/asn1/asn1parse.y"
2085 { (yyval.range) = NULL; }
2090 /* Line 1455 of yacc.c */
2091 #line 488 "heimdal/lib/asn1/asn1parse.y"
2092 { (yyval.range) = (yyvsp[(2) - (2)].range); }
2097 /* Line 1455 of yacc.c */
2098 #line 493 "heimdal/lib/asn1/asn1parse.y"
2100 (yyval.type) = new_type(TSequence);
2101 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2102 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2108 /* Line 1455 of yacc.c */
2109 #line 499 "heimdal/lib/asn1/asn1parse.y"
2111 (yyval.type) = new_type(TSequence);
2112 (yyval.type)->members = NULL;
2113 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2119 /* Line 1455 of yacc.c */
2120 #line 507 "heimdal/lib/asn1/asn1parse.y"
2122 (yyval.type) = new_type(TSequenceOf);
2123 (yyval.type)->range = (yyvsp[(2) - (4)].range);
2124 (yyval.type)->subtype = (yyvsp[(4) - (4)].type);
2125 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2131 /* Line 1455 of yacc.c */
2132 #line 516 "heimdal/lib/asn1/asn1parse.y"
2134 (yyval.type) = new_type(TSet);
2135 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2136 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2142 /* Line 1455 of yacc.c */
2143 #line 522 "heimdal/lib/asn1/asn1parse.y"
2145 (yyval.type) = new_type(TSet);
2146 (yyval.type)->members = NULL;
2147 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2153 /* Line 1455 of yacc.c */
2154 #line 530 "heimdal/lib/asn1/asn1parse.y"
2156 (yyval.type) = new_type(TSetOf);
2157 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
2158 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2164 /* Line 1455 of yacc.c */
2165 #line 538 "heimdal/lib/asn1/asn1parse.y"
2167 (yyval.type) = new_type(TChoice);
2168 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2174 /* Line 1455 of yacc.c */
2175 #line 549 "heimdal/lib/asn1/asn1parse.y"
2177 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2178 (yyval.type) = new_type(TType);
2179 if(s->stype != Stype && s->stype != SUndefined)
2180 error_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
2182 (yyval.type)->symbol = s;
2188 /* Line 1455 of yacc.c */
2189 #line 560 "heimdal/lib/asn1/asn1parse.y"
2191 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralizedTime,
2192 TE_EXPLICIT, new_type(TGeneralizedTime));
2198 /* Line 1455 of yacc.c */
2199 #line 565 "heimdal/lib/asn1/asn1parse.y"
2201 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTCTime,
2202 TE_EXPLICIT, new_type(TUTCTime));
2208 /* Line 1455 of yacc.c */
2209 #line 572 "heimdal/lib/asn1/asn1parse.y"
2211 /* if (Constraint.type == contentConstrant) {
2212 assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
2213 if (Constraint.u.constraint.type) {
2214 assert((Constraint.u.constraint.type.length % 8) == 0);
2217 if (Constraint.u.constraint.encoding) {
2218 type == der-oid|ber-oid
2226 /* Line 1455 of yacc.c */
2227 #line 588 "heimdal/lib/asn1/asn1parse.y"
2229 (yyval.constraint_spec) = (yyvsp[(2) - (3)].constraint_spec);
2235 /* Line 1455 of yacc.c */
2236 #line 601 "heimdal/lib/asn1/asn1parse.y"
2238 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2239 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (2)].type);
2240 (yyval.constraint_spec)->u.content.encoding = NULL;
2246 /* Line 1455 of yacc.c */
2247 #line 607 "heimdal/lib/asn1/asn1parse.y"
2249 if ((yyvsp[(3) - (3)].value)->type != objectidentifiervalue)
2250 error_message("Non-OID used in ENCODED BY constraint");
2251 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2252 (yyval.constraint_spec)->u.content.type = NULL;
2253 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(3) - (3)].value);
2259 /* Line 1455 of yacc.c */
2260 #line 615 "heimdal/lib/asn1/asn1parse.y"
2262 if ((yyvsp[(5) - (5)].value)->type != objectidentifiervalue)
2263 error_message("Non-OID used in ENCODED BY constraint");
2264 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2265 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (5)].type);
2266 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(5) - (5)].value);
2272 /* Line 1455 of yacc.c */
2273 #line 625 "heimdal/lib/asn1/asn1parse.y"
2275 (yyval.constraint_spec) = new_constraint_spec(CT_USER);
2281 /* Line 1455 of yacc.c */
2282 #line 631 "heimdal/lib/asn1/asn1parse.y"
2284 (yyval.type) = new_type(TTag);
2285 (yyval.type)->tag = (yyvsp[(1) - (3)].tag);
2286 (yyval.type)->tag.tagenv = (yyvsp[(2) - (3)].constant);
2287 if((yyvsp[(3) - (3)].type)->type == TTag && (yyvsp[(2) - (3)].constant) == TE_IMPLICIT) {
2288 (yyval.type)->subtype = (yyvsp[(3) - (3)].type)->subtype;
2289 free((yyvsp[(3) - (3)].type));
2291 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
2297 /* Line 1455 of yacc.c */
2298 #line 644 "heimdal/lib/asn1/asn1parse.y"
2300 (yyval.tag).tagclass = (yyvsp[(2) - (4)].constant);
2301 (yyval.tag).tagvalue = (yyvsp[(3) - (4)].constant);
2302 (yyval.tag).tagenv = TE_EXPLICIT;
2308 /* Line 1455 of yacc.c */
2309 #line 652 "heimdal/lib/asn1/asn1parse.y"
2311 (yyval.constant) = ASN1_C_CONTEXT;
2317 /* Line 1455 of yacc.c */
2318 #line 656 "heimdal/lib/asn1/asn1parse.y"
2320 (yyval.constant) = ASN1_C_UNIV;
2326 /* Line 1455 of yacc.c */
2327 #line 660 "heimdal/lib/asn1/asn1parse.y"
2329 (yyval.constant) = ASN1_C_APPL;
2335 /* Line 1455 of yacc.c */
2336 #line 664 "heimdal/lib/asn1/asn1parse.y"
2338 (yyval.constant) = ASN1_C_PRIVATE;
2344 /* Line 1455 of yacc.c */
2345 #line 670 "heimdal/lib/asn1/asn1parse.y"
2347 (yyval.constant) = TE_EXPLICIT;
2353 /* Line 1455 of yacc.c */
2354 #line 674 "heimdal/lib/asn1/asn1parse.y"
2356 (yyval.constant) = TE_EXPLICIT;
2362 /* Line 1455 of yacc.c */
2363 #line 678 "heimdal/lib/asn1/asn1parse.y"
2365 (yyval.constant) = TE_IMPLICIT;
2371 /* Line 1455 of yacc.c */
2372 #line 685 "heimdal/lib/asn1/asn1parse.y"
2375 s = addsym ((yyvsp[(1) - (4)].name));
2378 s->value = (yyvsp[(4) - (4)].value);
2379 generate_constant (s);
2385 /* Line 1455 of yacc.c */
2386 #line 699 "heimdal/lib/asn1/asn1parse.y"
2388 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralString,
2389 TE_EXPLICIT, new_type(TGeneralString));
2395 /* Line 1455 of yacc.c */
2396 #line 704 "heimdal/lib/asn1/asn1parse.y"
2398 (yyval.type) = new_tag(ASN1_C_UNIV, UT_TeletexString,
2399 TE_EXPLICIT, new_type(TTeletexString));
2405 /* Line 1455 of yacc.c */
2406 #line 709 "heimdal/lib/asn1/asn1parse.y"
2408 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTF8String,
2409 TE_EXPLICIT, new_type(TUTF8String));
2415 /* Line 1455 of yacc.c */
2416 #line 714 "heimdal/lib/asn1/asn1parse.y"
2418 (yyval.type) = new_tag(ASN1_C_UNIV, UT_PrintableString,
2419 TE_EXPLICIT, new_type(TPrintableString));
2425 /* Line 1455 of yacc.c */
2426 #line 719 "heimdal/lib/asn1/asn1parse.y"
2428 (yyval.type) = new_tag(ASN1_C_UNIV, UT_VisibleString,
2429 TE_EXPLICIT, new_type(TVisibleString));
2435 /* Line 1455 of yacc.c */
2436 #line 724 "heimdal/lib/asn1/asn1parse.y"
2438 (yyval.type) = new_tag(ASN1_C_UNIV, UT_IA5String,
2439 TE_EXPLICIT, new_type(TIA5String));
2445 /* Line 1455 of yacc.c */
2446 #line 729 "heimdal/lib/asn1/asn1parse.y"
2448 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BMPString,
2449 TE_EXPLICIT, new_type(TBMPString));
2455 /* Line 1455 of yacc.c */
2456 #line 734 "heimdal/lib/asn1/asn1parse.y"
2458 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UniversalString,
2459 TE_EXPLICIT, new_type(TUniversalString));
2465 /* Line 1455 of yacc.c */
2466 #line 742 "heimdal/lib/asn1/asn1parse.y"
2468 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2469 ASN1_TAILQ_INIT((yyval.members));
2470 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2476 /* Line 1455 of yacc.c */
2477 #line 748 "heimdal/lib/asn1/asn1parse.y"
2479 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2480 (yyval.members) = (yyvsp[(1) - (3)].members);
2486 /* Line 1455 of yacc.c */
2487 #line 753 "heimdal/lib/asn1/asn1parse.y"
2489 struct member *m = ecalloc(1, sizeof(*m));
2490 m->name = estrdup("...");
2491 m->gen_name = estrdup("asn1_ellipsis");
2493 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), m, members);
2494 (yyval.members) = (yyvsp[(1) - (3)].members);
2500 /* Line 1455 of yacc.c */
2501 #line 764 "heimdal/lib/asn1/asn1parse.y"
2503 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2504 (yyval.member)->name = (yyvsp[(1) - (2)].name);
2505 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (2)].name));
2506 output_name ((yyval.member)->gen_name);
2507 (yyval.member)->type = (yyvsp[(2) - (2)].type);
2508 (yyval.member)->ellipsis = 0;
2514 /* Line 1455 of yacc.c */
2515 #line 775 "heimdal/lib/asn1/asn1parse.y"
2517 (yyval.member) = (yyvsp[(1) - (1)].member);
2518 (yyval.member)->optional = 0;
2519 (yyval.member)->defval = NULL;
2525 /* Line 1455 of yacc.c */
2526 #line 781 "heimdal/lib/asn1/asn1parse.y"
2528 (yyval.member) = (yyvsp[(1) - (2)].member);
2529 (yyval.member)->optional = 1;
2530 (yyval.member)->defval = NULL;
2536 /* Line 1455 of yacc.c */
2537 #line 787 "heimdal/lib/asn1/asn1parse.y"
2539 (yyval.member) = (yyvsp[(1) - (3)].member);
2540 (yyval.member)->optional = 0;
2541 (yyval.member)->defval = (yyvsp[(3) - (3)].value);
2547 /* Line 1455 of yacc.c */
2548 #line 795 "heimdal/lib/asn1/asn1parse.y"
2550 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2551 ASN1_TAILQ_INIT((yyval.members));
2552 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2558 /* Line 1455 of yacc.c */
2559 #line 801 "heimdal/lib/asn1/asn1parse.y"
2561 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2562 (yyval.members) = (yyvsp[(1) - (3)].members);
2568 /* Line 1455 of yacc.c */
2569 #line 808 "heimdal/lib/asn1/asn1parse.y"
2571 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2572 (yyval.member)->name = (yyvsp[(1) - (4)].name);
2573 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
2574 output_name ((yyval.member)->gen_name);
2575 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
2576 (yyval.member)->optional = 0;
2577 (yyval.member)->ellipsis = 0;
2578 (yyval.member)->type = NULL;
2584 /* Line 1455 of yacc.c */
2585 #line 821 "heimdal/lib/asn1/asn1parse.y"
2586 { (yyval.objid) = NULL; }
2591 /* Line 1455 of yacc.c */
2592 #line 825 "heimdal/lib/asn1/asn1parse.y"
2594 (yyval.objid) = (yyvsp[(2) - (3)].objid);
2600 /* Line 1455 of yacc.c */
2601 #line 831 "heimdal/lib/asn1/asn1parse.y"
2603 (yyval.objid) = NULL;
2609 /* Line 1455 of yacc.c */
2610 #line 835 "heimdal/lib/asn1/asn1parse.y"
2612 if ((yyvsp[(2) - (2)].objid)) {
2613 (yyval.objid) = (yyvsp[(2) - (2)].objid);
2614 add_oid_to_tail((yyvsp[(2) - (2)].objid), (yyvsp[(1) - (2)].objid));
2616 (yyval.objid) = (yyvsp[(1) - (2)].objid);
2623 /* Line 1455 of yacc.c */
2624 #line 846 "heimdal/lib/asn1/asn1parse.y"
2626 (yyval.objid) = new_objid((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].constant));
2632 /* Line 1455 of yacc.c */
2633 #line 850 "heimdal/lib/asn1/asn1parse.y"
2635 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2636 if(s->stype != SValue ||
2637 s->value->type != objectidentifiervalue) {
2638 error_message("%s is not an object identifier\n",
2642 (yyval.objid) = s->value->u.objectidentifiervalue;
2648 /* Line 1455 of yacc.c */
2649 #line 861 "heimdal/lib/asn1/asn1parse.y"
2651 (yyval.objid) = new_objid(NULL, (yyvsp[(1) - (1)].constant));
2657 /* Line 1455 of yacc.c */
2658 #line 884 "heimdal/lib/asn1/asn1parse.y"
2660 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2661 if(s->stype != SValue)
2662 error_message ("%s is not a value\n",
2665 (yyval.value) = s->value;
2671 /* Line 1455 of yacc.c */
2672 #line 895 "heimdal/lib/asn1/asn1parse.y"
2674 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2675 (yyval.value)->type = stringvalue;
2676 (yyval.value)->u.stringvalue = (yyvsp[(1) - (1)].name);
2682 /* Line 1455 of yacc.c */
2683 #line 903 "heimdal/lib/asn1/asn1parse.y"
2685 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2686 (yyval.value)->type = booleanvalue;
2687 (yyval.value)->u.booleanvalue = 0;
2693 /* Line 1455 of yacc.c */
2694 #line 909 "heimdal/lib/asn1/asn1parse.y"
2696 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2697 (yyval.value)->type = booleanvalue;
2698 (yyval.value)->u.booleanvalue = 0;
2704 /* Line 1455 of yacc.c */
2705 #line 917 "heimdal/lib/asn1/asn1parse.y"
2707 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2708 (yyval.value)->type = integervalue;
2709 (yyval.value)->u.integervalue = (yyvsp[(1) - (1)].constant);
2715 /* Line 1455 of yacc.c */
2716 #line 928 "heimdal/lib/asn1/asn1parse.y"
2723 /* Line 1455 of yacc.c */
2724 #line 933 "heimdal/lib/asn1/asn1parse.y"
2726 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2727 (yyval.value)->type = objectidentifiervalue;
2728 (yyval.value)->u.objectidentifiervalue = (yyvsp[(1) - (1)].objid);
2734 /* Line 1455 of yacc.c */
2735 #line 2736 "heimdal/lib/asn1/asn1parse.y"
2738 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2742 YY_STACK_PRINT (yyss, yyssp);
2746 /* Now `shift' the result of the reduction. Determine what state
2747 that goes to, based on the state we popped back to and the rule
2748 number reduced by. */
2752 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2753 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2754 yystate = yytable[yystate];
2756 yystate = yydefgoto[yyn - YYNTOKENS];
2761 /*------------------------------------.
2762 | yyerrlab -- here on detecting error |
2763 `------------------------------------*/
2765 /* If not already recovering from an error, report this error. */
2769 #if ! YYERROR_VERBOSE
2770 yyerror (YY_("syntax error"));
2773 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2774 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2776 YYSIZE_T yyalloc = 2 * yysize;
2777 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2778 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2779 if (yymsg != yymsgbuf)
2780 YYSTACK_FREE (yymsg);
2781 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2783 yymsg_alloc = yyalloc;
2787 yymsg_alloc = sizeof yymsgbuf;
2791 if (0 < yysize && yysize <= yymsg_alloc)
2793 (void) yysyntax_error (yymsg, yystate, yychar);
2798 yyerror (YY_("syntax error"));
2800 goto yyexhaustedlab;
2808 if (yyerrstatus == 3)
2810 /* If just tried and failed to reuse lookahead token after an
2811 error, discard it. */
2813 if (yychar <= YYEOF)
2815 /* Return failure if at end of input. */
2816 if (yychar == YYEOF)
2821 yydestruct ("Error: discarding",
2827 /* Else will try to reuse lookahead token after shifting the error
2832 /*---------------------------------------------------.
2833 | yyerrorlab -- error raised explicitly by YYERROR. |
2834 `---------------------------------------------------*/
2837 /* Pacify compilers like GCC when the user code never invokes
2838 YYERROR and the label yyerrorlab therefore never appears in user
2840 if (/*CONSTCOND*/ 0)
2843 /* Do not reclaim the symbols of the rule which action triggered
2847 YY_STACK_PRINT (yyss, yyssp);
2852 /*-------------------------------------------------------------.
2853 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2854 `-------------------------------------------------------------*/
2856 yyerrstatus = 3; /* Each real token shifted decrements this. */
2860 yyn = yypact[yystate];
2861 if (yyn != YYPACT_NINF)
2864 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2872 /* Pop the current state because it cannot handle the error token. */
2877 yydestruct ("Error: popping",
2878 yystos[yystate], yyvsp);
2881 YY_STACK_PRINT (yyss, yyssp);
2887 /* Shift the error token. */
2888 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2894 /*-------------------------------------.
2895 | yyacceptlab -- YYACCEPT comes here. |
2896 `-------------------------------------*/
2901 /*-----------------------------------.
2902 | yyabortlab -- YYABORT comes here. |
2903 `-----------------------------------*/
2908 #if !defined(yyoverflow) || YYERROR_VERBOSE
2909 /*-------------------------------------------------.
2910 | yyexhaustedlab -- memory exhaustion comes here. |
2911 `-------------------------------------------------*/
2913 yyerror (YY_("memory exhausted"));
2919 if (yychar != YYEMPTY)
2920 yydestruct ("Cleanup: discarding lookahead",
2922 /* Do not reclaim the symbols of the rule which action triggered
2923 this YYABORT or YYACCEPT. */
2925 YY_STACK_PRINT (yyss, yyssp);
2926 while (yyssp != yyss)
2928 yydestruct ("Cleanup: popping",
2929 yystos[*yyssp], yyvsp);
2934 YYSTACK_FREE (yyss);
2937 if (yymsg != yymsgbuf)
2938 YYSTACK_FREE (yymsg);
2940 /* Make sure YYID is used. */
2941 return YYID (yyresult);
2946 /* Line 1675 of yacc.c */
2947 #line 940 "heimdal/lib/asn1/asn1parse.y"
2951 yyerror (const char *s)
2953 error_message ("%s\n", s);
2957 new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype)
2960 if(oldtype->type == TTag && oldtype->tag.tagenv == TE_IMPLICIT) {
2962 oldtype = oldtype->subtype; /* XXX */
2964 t = new_type (TTag);
2966 t->tag.tagclass = tagclass;
2967 t->tag.tagvalue = tagvalue;
2968 t->tag.tagenv = tagenv;
2969 t->subtype = oldtype;
2973 static struct objid *
2974 new_objid(const char *label, int value)
2977 s = emalloc(sizeof(*s));
2985 add_oid_to_tail(struct objid *head, struct objid *tail)
2995 new_type (Typetype tt)
2997 Type *t = ecalloc(1, sizeof(*t));
3002 static struct constraint_spec *
3003 new_constraint_spec(enum ctype ct)
3005 struct constraint_spec *c = ecalloc(1, sizeof(*c));
3010 static void fix_labels2(Type *t, const char *prefix);
3011 static void fix_labels1(struct memhead *members, const char *prefix)
3017 ASN1_TAILQ_FOREACH(m, members, members) {
3018 if (asprintf(&m->label, "%s_%s", prefix, m->gen_name) < 0)
3020 if (m->label == NULL)
3023 fix_labels2(m->type, m->label);
3027 static void fix_labels2(Type *t, const char *prefix)
3029 for(; t; t = t->subtype)
3030 fix_labels1(t->members, prefix);
3034 fix_labels(Symbol *s)
3037 if (asprintf(&p, "choice_%s", s->gen_name) < 0 || p == NULL)
3039 fix_labels2(s->type, p);