1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
70 kw_ABSTRACT_SYNTAX = 259,
95 kw_EXTENSIBILITY = 284,
99 kw_GeneralString = 288,
100 kw_GeneralizedTime = 289,
101 kw_GraphicString = 290,
110 kw_INTERSECTION = 299,
111 kw_ISO646String = 300,
114 kw_MINUS_INFINITY = 303,
116 kw_NumericString = 305,
121 kw_ObjectDescriptor = 310,
124 kw_PLUS_INFINITY = 313,
127 kw_PrintableString = 316,
129 kw_RELATIVE_OID = 318,
138 kw_TYPE_IDENTIFIER = 327,
139 kw_TeletexString = 328,
145 kw_UniversalString = 334,
146 kw_VideotexString = 335,
147 kw_VisibleString = 336,
159 #define kw_ABSENT 258
160 #define kw_ABSTRACT_SYNTAX 259
162 #define kw_APPLICATION 261
163 #define kw_AUTOMATIC 262
166 #define kw_BMPString 265
167 #define kw_BOOLEAN 266
169 #define kw_CHARACTER 268
170 #define kw_CHOICE 269
172 #define kw_COMPONENT 271
173 #define kw_COMPONENTS 272
174 #define kw_CONSTRAINED 273
175 #define kw_CONTAINING 274
176 #define kw_DEFAULT 275
177 #define kw_DEFINITIONS 276
178 #define kw_EMBEDDED 277
179 #define kw_ENCODED 278
181 #define kw_ENUMERATED 280
182 #define kw_EXCEPT 281
183 #define kw_EXPLICIT 282
184 #define kw_EXPORTS 283
185 #define kw_EXTENSIBILITY 284
186 #define kw_EXTERNAL 285
189 #define kw_GeneralString 288
190 #define kw_GeneralizedTime 289
191 #define kw_GraphicString 290
192 #define kw_IA5String 291
193 #define kw_IDENTIFIER 292
194 #define kw_IMPLICIT 293
195 #define kw_IMPLIED 294
196 #define kw_IMPORTS 295
197 #define kw_INCLUDES 296
198 #define kw_INSTANCE 297
199 #define kw_INTEGER 298
200 #define kw_INTERSECTION 299
201 #define kw_ISO646String 300
204 #define kw_MINUS_INFINITY 303
206 #define kw_NumericString 305
207 #define kw_OBJECT 306
210 #define kw_OPTIONAL 309
211 #define kw_ObjectDescriptor 310
212 #define kw_PATTERN 311
214 #define kw_PLUS_INFINITY 313
215 #define kw_PRESENT 314
216 #define kw_PRIVATE 315
217 #define kw_PrintableString 316
219 #define kw_RELATIVE_OID 318
220 #define kw_SEQUENCE 319
223 #define kw_STRING 322
224 #define kw_SYNTAX 323
225 #define kw_T61String 324
228 #define kw_TYPE_IDENTIFIER 327
229 #define kw_TeletexString 328
231 #define kw_UNIQUE 330
232 #define kw_UNIVERSAL 331
233 #define kw_UTCTime 332
234 #define kw_UTF8String 333
235 #define kw_UniversalString 334
236 #define kw_VideotexString 335
237 #define kw_VisibleString 336
242 #define IDENTIFIER 341
243 #define referencename 342
250 /* Copy the first part of user declarations. */
261 #include "gen_locl.h"
264 RCSID("$Id: parse.y 21597 2007-07-16 18:48:58Z lha $");
266 static Type *new_type (Typetype t);
267 static struct constraint_spec *new_constraint_spec(enum ctype);
268 static Type *new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype);
269 void yyerror (const char *);
270 static struct objid *new_objid(const char *label, int value);
271 static void add_oid_to_tail(struct objid *, struct objid *);
272 static void fix_labels(Symbol *s);
276 struct string_list *next;
281 /* Enabling traces. */
286 /* Enabling verbose error messages. */
287 #ifdef YYERROR_VERBOSE
288 # undef YYERROR_VERBOSE
289 # define YYERROR_VERBOSE 1
291 # define YYERROR_VERBOSE 0
294 /* Enabling the token table. */
295 #ifndef YYTOKEN_TABLE
296 # define YYTOKEN_TABLE 0
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
311 struct string_list *sl;
313 struct memhead *members;
314 struct constraint_spec *constraint_spec;
316 /* Line 193 of yacc.c. */
319 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
320 # define YYSTYPE_IS_DECLARED 1
321 # define YYSTYPE_IS_TRIVIAL 1
326 /* Copy the second part of user declarations. */
329 /* Line 216 of yacc.c. */
337 typedef YYTYPE_UINT8 yytype_uint8;
339 typedef unsigned char yytype_uint8;
343 typedef YYTYPE_INT8 yytype_int8;
344 #elif (defined __STDC__ || defined __C99__FUNC__ \
345 || defined __cplusplus || defined _MSC_VER)
346 typedef signed char yytype_int8;
348 typedef short int yytype_int8;
352 typedef YYTYPE_UINT16 yytype_uint16;
354 typedef unsigned short int yytype_uint16;
358 typedef YYTYPE_INT16 yytype_int16;
360 typedef short int yytype_int16;
364 # ifdef __SIZE_TYPE__
365 # define YYSIZE_T __SIZE_TYPE__
366 # elif defined size_t
367 # define YYSIZE_T size_t
368 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
371 # define YYSIZE_T size_t
373 # define YYSIZE_T unsigned int
377 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
380 # if defined YYENABLE_NLS && YYENABLE_NLS
382 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
383 # define YY_(msgid) dgettext ("bison-runtime", msgid)
387 # define YY_(msgid) msgid
391 /* Suppress unused-variable warnings by "using" E. */
392 #if ! defined lint || defined __GNUC__
393 # define YYUSE(e) ((void) (e))
395 # define YYUSE(e) /* empty */
398 /* Identity function, used to suppress warnings about constant conditions. */
402 #if (defined __STDC__ || defined __C99__FUNC__ \
403 || defined __cplusplus || defined _MSC_VER)
416 #if ! defined yyoverflow || YYERROR_VERBOSE
418 /* The parser invokes alloca or malloc; define the necessary symbols. */
420 # ifdef YYSTACK_USE_ALLOCA
421 # if YYSTACK_USE_ALLOCA
423 # define YYSTACK_ALLOC __builtin_alloca
424 # elif defined __BUILTIN_VA_ARG_INCR
425 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
427 # define YYSTACK_ALLOC __alloca
428 # elif defined _MSC_VER
429 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
430 # define alloca _alloca
432 # define YYSTACK_ALLOC alloca
433 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
434 || defined __cplusplus || defined _MSC_VER)
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
444 # ifdef YYSTACK_ALLOC
445 /* Pacify GCC's `empty if-body' warning. */
446 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
447 # ifndef YYSTACK_ALLOC_MAXIMUM
448 /* The OS might guarantee only one guard page at the bottom of the stack,
449 and a page size can be as small as 4096 bytes. So we cannot safely
450 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
451 to allow for a few compiler-allocated temporary stack slots. */
452 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455 # define YYSTACK_ALLOC YYMALLOC
456 # define YYSTACK_FREE YYFREE
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
460 # if (defined __cplusplus && ! defined _STDLIB_H \
461 && ! ((defined YYMALLOC || defined malloc) \
462 && (defined YYFREE || defined free)))
463 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469 # define YYMALLOC malloc
470 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
471 || defined __cplusplus || defined _MSC_VER)
472 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
477 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478 || defined __cplusplus || defined _MSC_VER)
479 void free (void *); /* INFRINGES ON USER NAME SPACE */
483 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
486 #if (! defined yyoverflow \
487 && (! defined __cplusplus \
488 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
490 /* A type that is properly aligned for any stack member. */
497 /* The size of the maximum gap between one aligned stack and the next. */
498 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
500 /* The size of an array large to enough to hold all stacks, each with
502 # define YYSTACK_BYTES(N) \
503 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
504 + YYSTACK_GAP_MAXIMUM)
506 /* Copy COUNT objects from FROM to TO. The source and destination do
509 # if defined __GNUC__ && 1 < __GNUC__
510 # define YYCOPY(To, From, Count) \
511 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
513 # define YYCOPY(To, From, Count) \
517 for (yyi = 0; yyi < (Count); yyi++) \
518 (To)[yyi] = (From)[yyi]; \
524 /* Relocate STACK from its old location to the new one. The
525 local variables YYSIZE and YYSTACKSIZE give the old and new number of
526 elements in the stack, and YYPTR gives the new location of the
527 stack. Advance YYPTR to a properly aligned location for the next
529 # define YYSTACK_RELOCATE(Stack) \
532 YYSIZE_T yynewbytes; \
533 YYCOPY (&yyptr->Stack, Stack, yysize); \
534 Stack = &yyptr->Stack; \
535 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
536 yyptr += yynewbytes / sizeof (*yyptr); \
542 /* YYFINAL -- State number of the termination state. */
544 /* YYLAST -- Last index in YYTABLE. */
547 /* YYNTOKENS -- Number of terminals. */
549 /* YYNNTS -- Number of nonterminals. */
551 /* YYNRULES -- Number of rules. */
553 /* YYNRULES -- Number of states. */
554 #define YYNSTATES 214
556 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
558 #define YYMAXUTOK 344
560 #define YYTRANSLATE(YYX) \
561 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
563 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
564 static const yytype_uint8 yytranslate[] =
566 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
592 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
593 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
594 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
595 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
596 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
597 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
598 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
599 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
604 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
606 static const yytype_uint16 yyprhs[] =
608 0, 0, 3, 13, 16, 19, 22, 23, 26, 27,
609 30, 31, 35, 36, 38, 39, 41, 44, 49, 51,
610 54, 56, 58, 62, 64, 68, 70, 72, 74, 76,
611 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
612 98, 100, 102, 104, 110, 116, 122, 126, 128, 131,
613 136, 138, 142, 146, 151, 156, 158, 161, 167, 170,
614 174, 176, 177, 180, 185, 189, 194, 199, 203, 207,
615 212, 214, 216, 218, 220, 222, 225, 229, 231, 233,
616 235, 238, 242, 248, 253, 257, 262, 263, 265, 267,
617 269, 270, 272, 274, 279, 281, 283, 285, 287, 289,
618 291, 293, 295, 297, 301, 305, 308, 310, 313, 317,
619 319, 323, 328, 330, 331, 335, 336, 339, 344, 346,
620 348, 350, 352, 354, 356, 358, 360, 362, 364, 366,
621 368, 370, 372, 374, 376, 378, 380
624 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
625 static const yytype_int16 yyrhs[] =
627 99, 0, -1, 86, 151, 21, 100, 101, 84, 8,
628 102, 24, -1, 27, 70, -1, 38, 70, -1, 7,
629 70, -1, -1, 29, 39, -1, -1, 103, 107, -1,
630 -1, 40, 104, 90, -1, -1, 105, -1, -1, 106,
631 -1, 105, 106, -1, 109, 32, 86, 151, -1, 108,
632 -1, 108, 107, -1, 110, -1, 143, -1, 86, 91,
633 109, -1, 86, -1, 86, 84, 111, -1, 112, -1,
634 130, -1, 133, -1, 120, -1, 113, -1, 144, -1,
635 129, -1, 118, -1, 115, -1, 123, -1, 121, -1,
636 122, -1, 125, -1, 126, -1, 127, -1, 128, -1,
637 139, -1, 11, -1, 92, 155, 83, 155, 93, -1,
638 92, 155, 83, 46, 93, -1, 92, 47, 83, 155,
639 93, -1, 92, 155, 93, -1, 43, -1, 43, 114,
640 -1, 43, 94, 116, 95, -1, 117, -1, 116, 91,
641 117, -1, 116, 91, 85, -1, 86, 92, 163, 93,
642 -1, 25, 94, 119, 95, -1, 116, -1, 9, 67,
643 -1, 9, 67, 94, 149, 95, -1, 51, 37, -1,
644 52, 67, 124, -1, 49, -1, -1, 66, 114, -1,
645 64, 94, 146, 95, -1, 64, 94, 95, -1, 64,
646 124, 53, 111, -1, 65, 94, 146, 95, -1, 65,
647 94, 95, -1, 65, 53, 111, -1, 14, 94, 146,
648 95, -1, 131, -1, 132, -1, 86, -1, 34, -1,
649 77, -1, 111, 134, -1, 92, 135, 93, -1, 136,
650 -1, 137, -1, 138, -1, 19, 111, -1, 23, 12,
651 155, -1, 19, 111, 23, 12, 155, -1, 18, 12,
652 94, 95, -1, 140, 142, 111, -1, 96, 141, 89,
653 97, -1, -1, 76, -1, 6, -1, 60, -1, -1,
654 27, -1, 38, -1, 86, 111, 84, 155, -1, 145,
655 -1, 33, -1, 78, -1, 61, -1, 81, -1, 36,
656 -1, 10, -1, 79, -1, 148, -1, 146, 91, 148,
657 -1, 146, 91, 85, -1, 86, 111, -1, 147, -1,
658 147, 54, -1, 147, 20, 155, -1, 150, -1, 149,
659 91, 150, -1, 86, 92, 89, 93, -1, 152, -1,
660 -1, 94, 153, 95, -1, -1, 154, 153, -1, 86,
661 92, 89, 93, -1, 86, -1, 89, -1, 156, -1,
662 157, -1, 161, -1, 160, -1, 162, -1, 165, -1,
663 164, -1, 158, -1, 159, -1, 86, -1, 88, -1,
664 71, -1, 31, -1, 163, -1, 89, -1, 49, -1,
668 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
669 static const yytype_uint16 yyrline[] =
671 0, 233, 233, 240, 241, 243, 245, 248, 250, 253,
672 254, 257, 258, 261, 262, 265, 266, 269, 280, 281,
673 284, 285, 288, 294, 302, 312, 313, 314, 317, 318,
674 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
675 329, 330, 333, 340, 350, 358, 366, 377, 382, 388,
676 396, 402, 407, 411, 424, 432, 435, 442, 450, 456,
677 465, 473, 474, 479, 485, 493, 502, 508, 516, 524,
678 531, 532, 535, 546, 551, 558, 574, 580, 583, 584,
679 587, 593, 601, 611, 617, 630, 639, 642, 646, 650,
680 657, 660, 664, 671, 682, 685, 690, 695, 700, 705,
681 710, 715, 723, 729, 734, 745, 756, 762, 768, 776,
682 782, 789, 802, 803, 806, 813, 816, 827, 831, 842,
683 848, 849, 852, 853, 854, 855, 856, 859, 862, 865,
684 876, 884, 890, 898, 906, 909, 914
688 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
689 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
690 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
691 static const char *const yytname[] =
693 "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
694 "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
695 "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
696 "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
697 "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
698 "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
699 "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
700 "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
701 "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
702 "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
703 "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
704 "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
705 "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
706 "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
707 "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
708 "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
709 "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
710 "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
711 "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
712 "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
713 "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
714 "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
715 "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
716 "SymbolsFromModule", "AssignmentList", "Assignment", "referencenames",
717 "TypeAssignment", "Type", "BuiltinType", "BooleanType", "range",
718 "IntegerType", "NamedNumberList", "NamedNumber", "EnumeratedType",
719 "Enumerations", "BitStringType", "ObjectIdentifierType",
720 "OctetStringType", "NullType", "size", "SequenceType", "SequenceOfType",
721 "SetType", "SetOfType", "ChoiceType", "ReferencedType", "DefinedType",
722 "UsefulType", "ConstrainedType", "Constraint", "ConstraintSpec",
723 "GeneralConstraint", "ContentsConstraint", "UserDefinedConstraint",
724 "TaggedType", "Tag", "Class", "tagenv", "ValueAssignment",
725 "CharacterStringType", "RestrictedCharactedStringType",
726 "ComponentTypeList", "NamedType", "ComponentType", "NamedBitList",
727 "NamedBit", "objid_opt", "objid", "objid_list", "objid_element", "Value",
728 "BuiltinValue", "ReferencedValue", "DefinedValue", "Valuereference",
729 "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
730 "NullValue", "ObjectIdentifierValue", 0
735 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
737 static const yytype_uint16 yytoknum[] =
739 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
740 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
741 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
742 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
743 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
744 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
745 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
746 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
747 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
748 59, 44, 40, 41, 123, 125, 91, 93
752 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
753 static const yytype_uint8 yyr1[] =
755 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
756 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
757 108, 108, 109, 109, 110, 111, 111, 111, 112, 112,
758 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
759 112, 112, 113, 114, 114, 114, 114, 115, 115, 115,
760 116, 116, 116, 117, 118, 119, 120, 120, 121, 122,
761 123, 124, 124, 125, 125, 126, 127, 127, 128, 129,
762 130, 130, 131, 132, 132, 133, 134, 135, 136, 136,
763 137, 137, 137, 138, 139, 140, 141, 141, 141, 141,
764 142, 142, 142, 143, 144, 145, 145, 145, 145, 145,
765 145, 145, 146, 146, 146, 147, 148, 148, 148, 149,
766 149, 150, 151, 151, 152, 153, 153, 154, 154, 154,
767 155, 155, 156, 156, 156, 156, 156, 157, 158, 159,
768 160, 161, 161, 162, 163, 164, 165
771 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
772 static const yytype_uint8 yyr2[] =
774 0, 2, 9, 2, 2, 2, 0, 2, 0, 2,
775 0, 3, 0, 1, 0, 1, 2, 4, 1, 2,
776 1, 1, 3, 1, 3, 1, 1, 1, 1, 1,
777 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
778 1, 1, 1, 5, 5, 5, 3, 1, 2, 4,
779 1, 3, 3, 4, 4, 1, 2, 5, 2, 3,
780 1, 0, 2, 4, 3, 4, 4, 3, 3, 4,
781 1, 1, 1, 1, 1, 2, 3, 1, 1, 1,
782 2, 3, 5, 4, 3, 4, 0, 1, 1, 1,
783 0, 1, 1, 4, 1, 1, 1, 1, 1, 1,
784 1, 1, 1, 3, 3, 2, 1, 2, 3, 1,
785 3, 4, 1, 0, 3, 0, 2, 4, 1, 1,
786 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
790 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
791 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
792 means the default is an error. */
793 static const yytype_uint8 yydefact[] =
795 0, 113, 0, 115, 0, 112, 1, 118, 119, 0,
796 115, 6, 0, 114, 116, 0, 0, 0, 8, 0,
797 5, 3, 4, 0, 0, 117, 7, 0, 10, 14,
798 0, 0, 23, 0, 13, 15, 0, 2, 0, 9,
799 18, 20, 21, 0, 11, 16, 0, 0, 100, 42,
800 0, 0, 95, 73, 99, 47, 60, 0, 0, 97,
801 61, 0, 74, 96, 101, 98, 0, 72, 86, 0,
802 25, 29, 33, 32, 28, 35, 36, 34, 37, 38,
803 39, 40, 31, 26, 70, 71, 27, 41, 90, 30,
804 94, 19, 22, 113, 56, 0, 0, 0, 0, 48,
805 58, 61, 0, 0, 0, 0, 0, 24, 88, 89,
806 87, 0, 0, 0, 75, 91, 92, 0, 17, 0,
807 0, 0, 106, 102, 0, 55, 50, 0, 132, 0,
808 135, 131, 129, 130, 134, 136, 0, 120, 121, 127,
809 128, 123, 122, 124, 133, 126, 125, 0, 59, 62,
810 64, 0, 0, 68, 67, 0, 0, 93, 0, 0,
811 0, 0, 77, 78, 79, 84, 0, 0, 109, 105,
812 0, 69, 0, 107, 0, 0, 54, 0, 0, 46,
813 49, 63, 65, 66, 85, 0, 80, 0, 76, 0,
814 0, 57, 104, 103, 108, 0, 52, 51, 0, 0,
815 0, 0, 0, 81, 0, 110, 53, 45, 44, 43,
819 /* YYDEFGOTO[NTERM-NUM]. */
820 static const yytype_int16 yydefgoto[] =
822 -1, 2, 18, 24, 30, 31, 33, 34, 35, 39,
823 40, 36, 41, 69, 70, 71, 99, 72, 125, 126,
824 73, 127, 74, 75, 76, 77, 104, 78, 79, 80,
825 81, 82, 83, 84, 85, 86, 114, 161, 162, 163,
826 164, 87, 88, 111, 117, 42, 89, 90, 121, 122,
827 123, 167, 168, 4, 135, 9, 10, 136, 137, 138,
828 139, 140, 141, 142, 143, 144, 145, 146
831 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
833 #define YYPACT_NINF -113
834 static const yytype_int16 yypact[] =
836 -74, -67, 38, -69, 23, -113, -113, -44, -113, -41,
837 -69, 4, -26, -113, -113, -3, 1, 10, 52, -10,
838 -113, -113, -113, 45, 13, -113, -113, 77, -35, 15,
839 64, 19, 17, 20, 15, -113, 85, -113, 25, -113,
840 19, -113, -113, 15, -113, -113, 27, 47, -113, -113,
841 26, 29, -113, -113, -113, -30, -113, 89, 61, -113,
842 -57, -47, -113, -113, -113, -113, 82, -113, -4, -68,
843 -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
844 -113, -113, -113, -113, -113, -113, -113, -113, -17, -113,
845 -113, -113, -113, -67, 35, 33, 46, 51, 46, -113,
846 -113, 69, 44, -73, 88, 82, -72, 56, -113, -113,
847 -113, 49, 93, 7, -113, -113, -113, 82, -113, 58,
848 82, -76, -13, -113, 57, 59, -113, 60, -113, 68,
849 -113, -113, -113, -113, -113, -113, -75, -113, -113, -113,
850 -113, -113, -113, -113, -113, -113, -113, -63, -113, -113,
851 -113, -62, 82, 56, -113, -46, 65, -113, 141, 82,
852 142, 63, -113, -113, -113, 56, 66, -38, -113, 56,
853 -16, -113, 93, -113, 76, -7, -113, 93, 81, -113,
854 -113, -113, 56, -113, -113, 72, -19, 93, -113, 83,
855 58, -113, -113, -113, -113, 78, -113, -113, 80, 84,
856 87, 62, 162, -113, 90, -113, -113, -113, -113, -113,
860 /* YYPGOTO[NTERM-NUM]. */
861 static const yytype_int16 yypgoto[] =
863 -113, -113, -113, -113, -113, -113, -113, -113, 150, 136,
864 -113, 143, -113, -65, -113, -113, 86, -113, 91, 16,
865 -113, -113, -113, -113, -113, -113, 92, -113, -113, -113,
866 -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
867 -113, -113, -113, -113, -113, -113, -113, -113, -60, -113,
868 22, -113, -5, 97, 2, 184, -113, -112, -113, -113,
869 -113, -113, -113, -113, -113, 21, -113, -113
872 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
873 positive, shift that token. If negative, reduce the rule which
874 number is the opposite. If zero, do what YYDEFACT says.
875 If YYTABLE_NINF, syntax error. */
876 #define YYTABLE_NINF -13
877 static const yytype_int16 yytable[] =
879 157, 107, 108, 5, 202, 29, 105, 172, 178, 102,
880 115, 15, 1, 120, 120, 170, 112, 7, 179, 171,
881 8, 116, 150, 154, 113, 158, 159, 3, 175, 170,
882 160, 16, 180, 181, 47, 48, 49, 103, 6, 50,
883 153, 173, 17, 151, 11, 170, 155, 106, 12, 183,
884 51, -12, 165, 190, 13, 169, 109, 191, 52, 53,
885 194, 54, 97, 19, 98, 198, 200, 20, 55, 192,
886 120, 21, 110, 113, 56, 203, 57, 58, 196, 124,
887 22, 23, 128, 25, 26, 28, 59, 182, 37, 60,
888 61, 47, 48, 49, 186, 5, 50, 27, 129, 213,
889 130, 32, 62, 63, 64, 38, 65, 51, 43, 66,
890 44, 67, 128, 93, 94, 52, 53, 46, 54, 120,
891 95, 68, 131, 96, 128, 55, 100, 199, 101, 119,
892 130, 56, 124, 57, 58, 102, 97, 132, 156, 133,
893 134, 152, 130, 59, 166, 3, 60, 61, 113, 174,
894 175, 177, 131, 185, 187, 176, 188, 210, 189, 62,
895 63, 64, 184, 65, 131, 134, 201, 132, 67, 133,
896 134, 206, 204, 207, 211, 3, 91, 208, 68, 132,
897 209, 133, 134, 212, 45, 205, 92, 3, 149, 147,
898 118, 197, 193, 148, 14, 195
901 static const yytype_uint8 yycheck[] =
903 112, 66, 6, 1, 23, 40, 53, 20, 83, 66,
904 27, 7, 86, 86, 86, 91, 84, 86, 93, 95,
905 89, 38, 95, 95, 92, 18, 19, 94, 91, 91,
906 23, 27, 95, 95, 9, 10, 11, 94, 0, 14,
907 105, 54, 38, 103, 21, 91, 106, 94, 92, 95,
908 25, 86, 117, 91, 95, 120, 60, 95, 33, 34,
909 172, 36, 92, 89, 94, 177, 178, 70, 43, 85,
910 86, 70, 76, 92, 49, 187, 51, 52, 85, 86,
911 70, 29, 31, 93, 39, 8, 61, 152, 24, 64,
912 65, 9, 10, 11, 159, 93, 14, 84, 47, 211,
913 49, 86, 77, 78, 79, 86, 81, 25, 91, 84,
914 90, 86, 31, 86, 67, 33, 34, 32, 36, 86,
915 94, 96, 71, 94, 31, 43, 37, 46, 67, 94,
916 49, 49, 86, 51, 52, 66, 92, 86, 89, 88,
917 89, 53, 49, 61, 86, 94, 64, 65, 92, 92,
918 91, 83, 71, 12, 12, 95, 93, 95, 92, 77,
919 78, 79, 97, 81, 71, 89, 94, 86, 86, 88,
920 89, 93, 89, 93, 12, 94, 40, 93, 96, 86,
921 93, 88, 89, 93, 34, 190, 43, 94, 102, 98,
922 93, 175, 170, 101, 10, 174
925 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
926 symbol of state STATE-NUM. */
927 static const yytype_uint8 yystos[] =
929 0, 86, 99, 94, 151, 152, 0, 86, 89, 153,
930 154, 21, 92, 95, 153, 7, 27, 38, 100, 89,
931 70, 70, 70, 29, 101, 93, 39, 84, 8, 40,
932 102, 103, 86, 104, 105, 106, 109, 24, 86, 107,
933 108, 110, 143, 91, 90, 106, 32, 9, 10, 11,
934 14, 25, 33, 34, 36, 43, 49, 51, 52, 61,
935 64, 65, 77, 78, 79, 81, 84, 86, 96, 111,
936 112, 113, 115, 118, 120, 121, 122, 123, 125, 126,
937 127, 128, 129, 130, 131, 132, 133, 139, 140, 144,
938 145, 107, 109, 86, 67, 94, 94, 92, 94, 114,
939 37, 67, 66, 94, 124, 53, 94, 111, 6, 60,
940 76, 141, 84, 92, 134, 27, 38, 142, 151, 94,
941 86, 146, 147, 148, 86, 116, 117, 119, 31, 47,
942 49, 71, 86, 88, 89, 152, 155, 156, 157, 158,
943 159, 160, 161, 162, 163, 164, 165, 116, 124, 114,
944 95, 146, 53, 111, 95, 146, 89, 155, 18, 19,
945 23, 135, 136, 137, 138, 111, 86, 149, 150, 111,
946 91, 95, 20, 54, 92, 91, 95, 83, 83, 93,
947 95, 95, 111, 95, 97, 12, 111, 12, 93, 92,
948 91, 95, 85, 148, 155, 163, 85, 117, 155, 46,
949 155, 94, 23, 155, 89, 150, 93, 93, 93, 93,
953 #define yyerrok (yyerrstatus = 0)
954 #define yyclearin (yychar = YYEMPTY)
958 #define YYACCEPT goto yyacceptlab
959 #define YYABORT goto yyabortlab
960 #define YYERROR goto yyerrorlab
963 /* Like YYERROR except do call yyerror. This remains here temporarily
964 to ease the transition to the new meaning of YYERROR, for GCC.
965 Once GCC version 2 has supplanted version 1, this can go. */
967 #define YYFAIL goto yyerrlab
969 #define YYRECOVERING() (!!yyerrstatus)
971 #define YYBACKUP(Token, Value) \
973 if (yychar == YYEMPTY && yylen == 1) \
977 yytoken = YYTRANSLATE (yychar); \
983 yyerror (YY_("syntax error: cannot back up")); \
990 #define YYERRCODE 256
993 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
994 If N is 0, then set CURRENT to the empty location which ends
995 the previous symbol: RHS[0] (always defined). */
997 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
998 #ifndef YYLLOC_DEFAULT
999 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1003 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1004 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1005 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1006 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1010 (Current).first_line = (Current).last_line = \
1011 YYRHSLOC (Rhs, 0).last_line; \
1012 (Current).first_column = (Current).last_column = \
1013 YYRHSLOC (Rhs, 0).last_column; \
1019 /* YY_LOCATION_PRINT -- Print the location on the stream.
1020 This macro was not mandated originally: define only if we know
1021 we won't break user code: when these are the locations we know. */
1023 #ifndef YY_LOCATION_PRINT
1024 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1025 # define YY_LOCATION_PRINT(File, Loc) \
1026 fprintf (File, "%d.%d-%d.%d", \
1027 (Loc).first_line, (Loc).first_column, \
1028 (Loc).last_line, (Loc).last_column)
1030 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1035 /* YYLEX -- calling `yylex' with the right arguments. */
1038 # define YYLEX yylex (YYLEX_PARAM)
1040 # define YYLEX yylex ()
1043 /* Enable debugging if requested. */
1047 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1048 # define YYFPRINTF fprintf
1051 # define YYDPRINTF(Args) \
1057 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1061 YYFPRINTF (stderr, "%s ", Title); \
1062 yy_symbol_print (stderr, \
1064 YYFPRINTF (stderr, "\n"); \
1069 /*--------------------------------.
1070 | Print this symbol on YYOUTPUT. |
1071 `--------------------------------*/
1074 #if (defined __STDC__ || defined __C99__FUNC__ \
1075 || defined __cplusplus || defined _MSC_VER)
1077 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1080 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1083 YYSTYPE const * const yyvaluep;
1089 if (yytype < YYNTOKENS)
1090 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1102 /*--------------------------------.
1103 | Print this symbol on YYOUTPUT. |
1104 `--------------------------------*/
1106 #if (defined __STDC__ || defined __C99__FUNC__ \
1107 || defined __cplusplus || defined _MSC_VER)
1109 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1112 yy_symbol_print (yyoutput, yytype, yyvaluep)
1115 YYSTYPE const * const yyvaluep;
1118 if (yytype < YYNTOKENS)
1119 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1121 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1123 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1124 YYFPRINTF (yyoutput, ")");
1127 /*------------------------------------------------------------------.
1128 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1130 `------------------------------------------------------------------*/
1132 #if (defined __STDC__ || defined __C99__FUNC__ \
1133 || defined __cplusplus || defined _MSC_VER)
1135 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1138 yy_stack_print (bottom, top)
1139 yytype_int16 *bottom;
1143 YYFPRINTF (stderr, "Stack now");
1144 for (; bottom <= top; ++bottom)
1145 YYFPRINTF (stderr, " %d", *bottom);
1146 YYFPRINTF (stderr, "\n");
1149 # define YY_STACK_PRINT(Bottom, Top) \
1152 yy_stack_print ((Bottom), (Top)); \
1156 /*------------------------------------------------.
1157 | Report that the YYRULE is going to be reduced. |
1158 `------------------------------------------------*/
1160 #if (defined __STDC__ || defined __C99__FUNC__ \
1161 || defined __cplusplus || defined _MSC_VER)
1163 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1166 yy_reduce_print (yyvsp, yyrule)
1171 int yynrhs = yyr2[yyrule];
1173 unsigned long int yylno = yyrline[yyrule];
1174 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1176 /* The symbols being reduced. */
1177 for (yyi = 0; yyi < yynrhs; yyi++)
1179 fprintf (stderr, " $%d = ", yyi + 1);
1180 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1181 &(yyvsp[(yyi + 1) - (yynrhs)])
1183 fprintf (stderr, "\n");
1187 # define YY_REDUCE_PRINT(Rule) \
1190 yy_reduce_print (yyvsp, Rule); \
1193 /* Nonzero means print parse trace. It is left uninitialized so that
1194 multiple parsers can coexist. */
1196 #else /* !YYDEBUG */
1197 # define YYDPRINTF(Args)
1198 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1199 # define YY_STACK_PRINT(Bottom, Top)
1200 # define YY_REDUCE_PRINT(Rule)
1201 #endif /* !YYDEBUG */
1204 /* YYINITDEPTH -- initial size of the parser's stacks. */
1206 # define YYINITDEPTH 200
1209 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1210 if the built-in stack extension method is used).
1212 Do not make this value too large; the results are undefined if
1213 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1214 evaluated with infinite-precision integer arithmetic. */
1217 # define YYMAXDEPTH 10000
1225 # if defined __GLIBC__ && defined _STRING_H
1226 # define yystrlen strlen
1228 /* Return the length of YYSTR. */
1229 #if (defined __STDC__ || defined __C99__FUNC__ \
1230 || defined __cplusplus || defined _MSC_VER)
1232 yystrlen (const char *yystr)
1240 for (yylen = 0; yystr[yylen]; yylen++)
1248 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1249 # define yystpcpy stpcpy
1251 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1256 yystpcpy (char *yydest, const char *yysrc)
1259 yystpcpy (yydest, yysrc)
1265 const char *yys = yysrc;
1267 while ((*yyd++ = *yys++) != '\0')
1276 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1277 quotes and backslashes, so that it's suitable for yyerror. The
1278 heuristic is that double-quoting is unnecessary unless the string
1279 contains an apostrophe, a comma, or backslash (other than
1280 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1281 null, do not copy; instead, return the length of what the result
1284 yytnamerr (char *yyres, const char *yystr)
1289 char const *yyp = yystr;
1296 goto do_not_strip_quotes;
1300 goto do_not_strip_quotes;
1313 do_not_strip_quotes: ;
1317 return yystrlen (yystr);
1319 return yystpcpy (yyres, yystr) - yyres;
1323 /* Copy into YYRESULT an error message about the unexpected token
1324 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1325 including the terminating null byte. If YYRESULT is null, do not
1326 copy anything; just return the number of bytes that would be
1327 copied. As a special case, return 0 if an ordinary "syntax error"
1328 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1329 size calculation. */
1331 yysyntax_error (char *yyresult, int yystate, int yychar)
1333 int yyn = yypact[yystate];
1335 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1339 int yytype = YYTRANSLATE (yychar);
1340 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1341 YYSIZE_T yysize = yysize0;
1343 int yysize_overflow = 0;
1344 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1345 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1349 /* This is so xgettext sees the translatable formats that are
1350 constructed on the fly. */
1351 YY_("syntax error, unexpected %s");
1352 YY_("syntax error, unexpected %s, expecting %s");
1353 YY_("syntax error, unexpected %s, expecting %s or %s");
1354 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1355 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1359 static char const yyunexpected[] = "syntax error, unexpected %s";
1360 static char const yyexpecting[] = ", expecting %s";
1361 static char const yyor[] = " or %s";
1362 char yyformat[sizeof yyunexpected
1363 + sizeof yyexpecting - 1
1364 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1365 * (sizeof yyor - 1))];
1366 char const *yyprefix = yyexpecting;
1368 /* Start YYX at -YYN if negative to avoid negative indexes in
1370 int yyxbegin = yyn < 0 ? -yyn : 0;
1372 /* Stay within bounds of both yycheck and yytname. */
1373 int yychecklim = YYLAST - yyn + 1;
1374 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1377 yyarg[0] = yytname[yytype];
1378 yyfmt = yystpcpy (yyformat, yyunexpected);
1380 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1381 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1383 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1387 yyformat[sizeof yyunexpected - 1] = '\0';
1390 yyarg[yycount++] = yytname[yyx];
1391 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1392 yysize_overflow |= (yysize1 < yysize);
1394 yyfmt = yystpcpy (yyfmt, yyprefix);
1398 yyf = YY_(yyformat);
1399 yysize1 = yysize + yystrlen (yyf);
1400 yysize_overflow |= (yysize1 < yysize);
1403 if (yysize_overflow)
1404 return YYSIZE_MAXIMUM;
1408 /* Avoid sprintf, as that infringes on the user's name space.
1409 Don't have undefined behavior even if the translation
1410 produced a string with the wrong number of "%s"s. */
1411 char *yyp = yyresult;
1413 while ((*yyp = *yyf) != '\0')
1415 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1417 yyp += yytnamerr (yyp, yyarg[yyi++]);
1430 #endif /* YYERROR_VERBOSE */
1433 /*-----------------------------------------------.
1434 | Release the memory associated to this symbol. |
1435 `-----------------------------------------------*/
1438 #if (defined __STDC__ || defined __C99__FUNC__ \
1439 || defined __cplusplus || defined _MSC_VER)
1441 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1444 yydestruct (yymsg, yytype, yyvaluep)
1454 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1465 /* Prevent warnings from -Wmissing-prototypes. */
1467 #ifdef YYPARSE_PARAM
1468 #if defined __STDC__ || defined __cplusplus
1469 int yyparse (void *YYPARSE_PARAM);
1473 #else /* ! YYPARSE_PARAM */
1474 #if defined __STDC__ || defined __cplusplus
1479 #endif /* ! YYPARSE_PARAM */
1483 /* The look-ahead symbol. */
1486 /* The semantic value of the look-ahead symbol. */
1489 /* Number of syntax errors so far. */
1498 #ifdef YYPARSE_PARAM
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500 || defined __cplusplus || defined _MSC_VER)
1502 yyparse (void *YYPARSE_PARAM)
1505 yyparse (YYPARSE_PARAM)
1506 void *YYPARSE_PARAM;
1508 #else /* ! YYPARSE_PARAM */
1509 #if (defined __STDC__ || defined __C99__FUNC__ \
1510 || defined __cplusplus || defined _MSC_VER)
1524 /* Number of tokens to shift before error messages enabled. */
1526 /* Look-ahead token as an internal (translated) token number. */
1529 /* Buffer for error messages, and its allocated size. */
1531 char *yymsg = yymsgbuf;
1532 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1535 /* Three stacks and their tools:
1536 `yyss': related to states,
1537 `yyvs': related to semantic values,
1538 `yyls': related to locations.
1540 Refer to the stacks thru separate pointers, to allow yyoverflow
1541 to reallocate them elsewhere. */
1543 /* The state stack. */
1544 yytype_int16 yyssa[YYINITDEPTH];
1545 yytype_int16 *yyss = yyssa;
1546 yytype_int16 *yyssp;
1548 /* The semantic value stack. */
1549 YYSTYPE yyvsa[YYINITDEPTH];
1550 YYSTYPE *yyvs = yyvsa;
1555 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1557 YYSIZE_T yystacksize = YYINITDEPTH;
1559 /* The variables used to return semantic value and location from the
1564 /* The number of symbols on the RHS of the reduced rule.
1565 Keep to zero when no symbol should be popped. */
1568 YYDPRINTF ((stderr, "Starting parse\n"));
1573 yychar = YYEMPTY; /* Cause a token to be read. */
1575 /* Initialize stack pointers.
1576 Waste one element of value and location stack
1577 so that they stay on the same level as the state stack.
1578 The wasted elements are never initialized. */
1585 /*------------------------------------------------------------.
1586 | yynewstate -- Push a new state, which is found in yystate. |
1587 `------------------------------------------------------------*/
1589 /* In all cases, when you get here, the value and location stacks
1590 have just been pushed. So pushing a state here evens the stacks. */
1596 if (yyss + yystacksize - 1 <= yyssp)
1598 /* Get the current used size of the three stacks, in elements. */
1599 YYSIZE_T yysize = yyssp - yyss + 1;
1603 /* Give user a chance to reallocate the stack. Use copies of
1604 these so that the &'s don't force the real ones into
1606 YYSTYPE *yyvs1 = yyvs;
1607 yytype_int16 *yyss1 = yyss;
1610 /* Each stack pointer address is followed by the size of the
1611 data in use in that stack, in bytes. This used to be a
1612 conditional around just the two extra args, but that might
1613 be undefined if yyoverflow is a macro. */
1614 yyoverflow (YY_("memory exhausted"),
1615 &yyss1, yysize * sizeof (*yyssp),
1616 &yyvs1, yysize * sizeof (*yyvsp),
1623 #else /* no yyoverflow */
1624 # ifndef YYSTACK_RELOCATE
1625 goto yyexhaustedlab;
1627 /* Extend the stack our own way. */
1628 if (YYMAXDEPTH <= yystacksize)
1629 goto yyexhaustedlab;
1631 if (YYMAXDEPTH < yystacksize)
1632 yystacksize = YYMAXDEPTH;
1635 yytype_int16 *yyss1 = yyss;
1636 union yyalloc *yyptr =
1637 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1639 goto yyexhaustedlab;
1640 YYSTACK_RELOCATE (yyss);
1641 YYSTACK_RELOCATE (yyvs);
1643 # undef YYSTACK_RELOCATE
1645 YYSTACK_FREE (yyss1);
1648 #endif /* no yyoverflow */
1650 yyssp = yyss + yysize - 1;
1651 yyvsp = yyvs + yysize - 1;
1654 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1655 (unsigned long int) yystacksize));
1657 if (yyss + yystacksize - 1 <= yyssp)
1661 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1670 /* Do appropriate processing given the current state. Read a
1671 look-ahead token if we need one and don't already have one. */
1673 /* First try to decide what to do without reference to look-ahead token. */
1674 yyn = yypact[yystate];
1675 if (yyn == YYPACT_NINF)
1678 /* Not known => get a look-ahead token if don't already have one. */
1680 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1681 if (yychar == YYEMPTY)
1683 YYDPRINTF ((stderr, "Reading a token: "));
1687 if (yychar <= YYEOF)
1689 yychar = yytoken = YYEOF;
1690 YYDPRINTF ((stderr, "Now at end of input.\n"));
1694 yytoken = YYTRANSLATE (yychar);
1695 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1698 /* If the proper action on seeing token YYTOKEN is to reduce or to
1699 detect an error, take that action. */
1701 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1706 if (yyn == 0 || yyn == YYTABLE_NINF)
1715 /* Count tokens shifted since error; after three, turn off error
1720 /* Shift the look-ahead token. */
1721 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1723 /* Discard the shifted token unless it is eof. */
1724 if (yychar != YYEOF)
1733 /*-----------------------------------------------------------.
1734 | yydefault -- do the default action for the current state. |
1735 `-----------------------------------------------------------*/
1737 yyn = yydefact[yystate];
1743 /*-----------------------------.
1744 | yyreduce -- Do a reduction. |
1745 `-----------------------------*/
1747 /* yyn is the number of a rule to reduce with. */
1750 /* If YYLEN is nonzero, implement the default value of the action:
1753 Otherwise, the following line sets YYVAL to garbage.
1754 This behavior is undocumented and Bison
1755 users should not rely upon it. Assigning to YYVAL
1756 unconditionally makes the parser a bit smaller, and it avoids a
1757 GCC warning that YYVAL may be used uninitialized. */
1758 yyval = yyvsp[1-yylen];
1761 YY_REDUCE_PRINT (yyn);
1773 { error_message("implicit tagging is not supported"); }
1778 { error_message("automatic tagging is not supported"); }
1783 { error_message("no extensibility options supported"); }
1789 struct string_list *sl;
1790 for(sl = (yyvsp[(1) - (4)].sl); sl != NULL; sl = sl->next) {
1791 Symbol *s = addsym(sl->string);
1794 add_import((yyvsp[(3) - (4)].name));
1801 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1802 (yyval.sl)->string = (yyvsp[(1) - (3)].name);
1803 (yyval.sl)->next = (yyvsp[(3) - (3)].sl);
1810 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1811 (yyval.sl)->string = (yyvsp[(1) - (1)].name);
1812 (yyval.sl)->next = NULL;
1819 Symbol *s = addsym ((yyvsp[(1) - (3)].name));
1821 s->type = (yyvsp[(3) - (3)].type);
1830 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Boolean,
1831 TE_EXPLICIT, new_type(TBoolean));
1838 if((yyvsp[(2) - (5)].value)->type != integervalue)
1839 error_message("Non-integer used in first part of range");
1840 if((yyvsp[(2) - (5)].value)->type != integervalue)
1841 error_message("Non-integer in second part of range");
1842 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1843 (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
1844 (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
1851 if((yyvsp[(2) - (5)].value)->type != integervalue)
1852 error_message("Non-integer in first part of range");
1853 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1854 (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
1855 (yyval.range)->max = (yyvsp[(2) - (5)].value)->u.integervalue - 1;
1862 if((yyvsp[(4) - (5)].value)->type != integervalue)
1863 error_message("Non-integer in second part of range");
1864 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1865 (yyval.range)->min = (yyvsp[(4) - (5)].value)->u.integervalue + 2;
1866 (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
1873 if((yyvsp[(2) - (3)].value)->type != integervalue)
1874 error_message("Non-integer used in limit");
1875 (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1876 (yyval.range)->min = (yyvsp[(2) - (3)].value)->u.integervalue;
1877 (yyval.range)->max = (yyvsp[(2) - (3)].value)->u.integervalue;
1884 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer,
1885 TE_EXPLICIT, new_type(TInteger));
1892 (yyval.type) = new_type(TInteger);
1893 (yyval.type)->range = (yyvsp[(2) - (2)].range);
1894 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1901 (yyval.type) = new_type(TInteger);
1902 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1903 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1910 (yyval.members) = emalloc(sizeof(*(yyval.members)));
1911 ASN1_TAILQ_INIT((yyval.members));
1912 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
1919 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
1920 (yyval.members) = (yyvsp[(1) - (3)].members);
1926 { (yyval.members) = (yyvsp[(1) - (3)].members); }
1932 (yyval.member) = emalloc(sizeof(*(yyval.member)));
1933 (yyval.member)->name = (yyvsp[(1) - (4)].name);
1934 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
1935 output_name ((yyval.member)->gen_name);
1936 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
1937 (yyval.member)->optional = 0;
1938 (yyval.member)->ellipsis = 0;
1939 (yyval.member)->type = NULL;
1946 (yyval.type) = new_type(TInteger);
1947 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1948 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Enumerated, TE_EXPLICIT, (yyval.type));
1955 (yyval.type) = new_type(TBitString);
1956 (yyval.type)->members = emalloc(sizeof(*(yyval.type)->members));
1957 ASN1_TAILQ_INIT((yyval.type)->members);
1958 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1965 (yyval.type) = new_type(TBitString);
1966 (yyval.type)->members = (yyvsp[(4) - (5)].members);
1967 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1974 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OID,
1975 TE_EXPLICIT, new_type(TOID));
1982 Type *t = new_type(TOctetString);
1983 t->range = (yyvsp[(3) - (3)].range);
1984 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OctetString,
1992 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Null,
1993 TE_EXPLICIT, new_type(TNull));
1999 { (yyval.range) = NULL; }
2004 { (yyval.range) = (yyvsp[(2) - (2)].range); }
2010 (yyval.type) = new_type(TSequence);
2011 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2012 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2019 (yyval.type) = new_type(TSequence);
2020 (yyval.type)->members = NULL;
2021 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2028 (yyval.type) = new_type(TSequenceOf);
2029 (yyval.type)->range = (yyvsp[(2) - (4)].range);
2030 (yyval.type)->subtype = (yyvsp[(4) - (4)].type);
2031 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
2038 (yyval.type) = new_type(TSet);
2039 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2040 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2047 (yyval.type) = new_type(TSet);
2048 (yyval.type)->members = NULL;
2049 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2056 (yyval.type) = new_type(TSetOf);
2057 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
2058 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2065 (yyval.type) = new_type(TChoice);
2066 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2073 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2074 (yyval.type) = new_type(TType);
2075 if(s->stype != Stype && s->stype != SUndefined)
2076 error_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
2078 (yyval.type)->symbol = s;
2085 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralizedTime,
2086 TE_EXPLICIT, new_type(TGeneralizedTime));
2093 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTCTime,
2094 TE_EXPLICIT, new_type(TUTCTime));
2101 /* if (Constraint.type == contentConstrant) {
2102 assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
2103 if (Constraint.u.constraint.type) {
2104 assert((Constraint.u.constraint.type.length % 8) == 0);
2107 if (Constraint.u.constraint.encoding) {
2108 type == der-oid|ber-oid
2117 (yyval.constraint_spec) = (yyvsp[(2) - (3)].constraint_spec);
2124 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2125 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (2)].type);
2126 (yyval.constraint_spec)->u.content.encoding = NULL;
2133 if ((yyvsp[(3) - (3)].value)->type != objectidentifiervalue)
2134 error_message("Non-OID used in ENCODED BY constraint");
2135 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2136 (yyval.constraint_spec)->u.content.type = NULL;
2137 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(3) - (3)].value);
2144 if ((yyvsp[(5) - (5)].value)->type != objectidentifiervalue)
2145 error_message("Non-OID used in ENCODED BY constraint");
2146 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2147 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (5)].type);
2148 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(5) - (5)].value);
2155 (yyval.constraint_spec) = new_constraint_spec(CT_USER);
2162 (yyval.type) = new_type(TTag);
2163 (yyval.type)->tag = (yyvsp[(1) - (3)].tag);
2164 (yyval.type)->tag.tagenv = (yyvsp[(2) - (3)].constant);
2165 if((yyvsp[(3) - (3)].type)->type == TTag && (yyvsp[(2) - (3)].constant) == TE_IMPLICIT) {
2166 (yyval.type)->subtype = (yyvsp[(3) - (3)].type)->subtype;
2167 free((yyvsp[(3) - (3)].type));
2169 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
2176 (yyval.tag).tagclass = (yyvsp[(2) - (4)].constant);
2177 (yyval.tag).tagvalue = (yyvsp[(3) - (4)].constant);
2178 (yyval.tag).tagenv = TE_EXPLICIT;
2185 (yyval.constant) = ASN1_C_CONTEXT;
2192 (yyval.constant) = ASN1_C_UNIV;
2199 (yyval.constant) = ASN1_C_APPL;
2206 (yyval.constant) = ASN1_C_PRIVATE;
2213 (yyval.constant) = TE_EXPLICIT;
2220 (yyval.constant) = TE_EXPLICIT;
2227 (yyval.constant) = TE_IMPLICIT;
2235 s = addsym ((yyvsp[(1) - (4)].name));
2238 s->value = (yyvsp[(4) - (4)].value);
2239 generate_constant (s);
2246 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralString,
2247 TE_EXPLICIT, new_type(TGeneralString));
2254 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTF8String,
2255 TE_EXPLICIT, new_type(TUTF8String));
2262 (yyval.type) = new_tag(ASN1_C_UNIV, UT_PrintableString,
2263 TE_EXPLICIT, new_type(TPrintableString));
2270 (yyval.type) = new_tag(ASN1_C_UNIV, UT_VisibleString,
2271 TE_EXPLICIT, new_type(TVisibleString));
2278 (yyval.type) = new_tag(ASN1_C_UNIV, UT_IA5String,
2279 TE_EXPLICIT, new_type(TIA5String));
2286 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BMPString,
2287 TE_EXPLICIT, new_type(TBMPString));
2294 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UniversalString,
2295 TE_EXPLICIT, new_type(TUniversalString));
2302 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2303 ASN1_TAILQ_INIT((yyval.members));
2304 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2311 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2312 (yyval.members) = (yyvsp[(1) - (3)].members);
2319 struct member *m = ecalloc(1, sizeof(*m));
2320 m->name = estrdup("...");
2321 m->gen_name = estrdup("asn1_ellipsis");
2323 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), m, members);
2324 (yyval.members) = (yyvsp[(1) - (3)].members);
2331 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2332 (yyval.member)->name = (yyvsp[(1) - (2)].name);
2333 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (2)].name));
2334 output_name ((yyval.member)->gen_name);
2335 (yyval.member)->type = (yyvsp[(2) - (2)].type);
2336 (yyval.member)->ellipsis = 0;
2343 (yyval.member) = (yyvsp[(1) - (1)].member);
2344 (yyval.member)->optional = 0;
2345 (yyval.member)->defval = NULL;
2352 (yyval.member) = (yyvsp[(1) - (2)].member);
2353 (yyval.member)->optional = 1;
2354 (yyval.member)->defval = NULL;
2361 (yyval.member) = (yyvsp[(1) - (3)].member);
2362 (yyval.member)->optional = 0;
2363 (yyval.member)->defval = (yyvsp[(3) - (3)].value);
2370 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2371 ASN1_TAILQ_INIT((yyval.members));
2372 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2379 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2380 (yyval.members) = (yyvsp[(1) - (3)].members);
2387 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2388 (yyval.member)->name = (yyvsp[(1) - (4)].name);
2389 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
2390 output_name ((yyval.member)->gen_name);
2391 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
2392 (yyval.member)->optional = 0;
2393 (yyval.member)->ellipsis = 0;
2394 (yyval.member)->type = NULL;
2400 { (yyval.objid) = NULL; }
2406 (yyval.objid) = (yyvsp[(2) - (3)].objid);
2413 (yyval.objid) = NULL;
2420 if ((yyvsp[(2) - (2)].objid)) {
2421 (yyval.objid) = (yyvsp[(2) - (2)].objid);
2422 add_oid_to_tail((yyvsp[(2) - (2)].objid), (yyvsp[(1) - (2)].objid));
2424 (yyval.objid) = (yyvsp[(1) - (2)].objid);
2432 (yyval.objid) = new_objid((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].constant));
2439 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2440 if(s->stype != SValue ||
2441 s->value->type != objectidentifiervalue) {
2442 error_message("%s is not an object identifier\n",
2446 (yyval.objid) = s->value->u.objectidentifiervalue;
2453 (yyval.objid) = new_objid(NULL, (yyvsp[(1) - (1)].constant));
2460 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2461 if(s->stype != SValue)
2462 error_message ("%s is not a value\n",
2465 (yyval.value) = s->value;
2472 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2473 (yyval.value)->type = stringvalue;
2474 (yyval.value)->u.stringvalue = (yyvsp[(1) - (1)].name);
2481 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2482 (yyval.value)->type = booleanvalue;
2483 (yyval.value)->u.booleanvalue = 0;
2490 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2491 (yyval.value)->type = booleanvalue;
2492 (yyval.value)->u.booleanvalue = 0;
2499 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2500 (yyval.value)->type = integervalue;
2501 (yyval.value)->u.integervalue = (yyvsp[(1) - (1)].constant);
2514 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2515 (yyval.value)->type = objectidentifiervalue;
2516 (yyval.value)->u.objectidentifiervalue = (yyvsp[(1) - (1)].objid);
2521 /* Line 1267 of yacc.c. */
2522 #line 2523 "parse.c"
2525 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2529 YY_STACK_PRINT (yyss, yyssp);
2534 /* Now `shift' the result of the reduction. Determine what state
2535 that goes to, based on the state we popped back to and the rule
2536 number reduced by. */
2540 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2541 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2542 yystate = yytable[yystate];
2544 yystate = yydefgoto[yyn - YYNTOKENS];
2549 /*------------------------------------.
2550 | yyerrlab -- here on detecting error |
2551 `------------------------------------*/
2553 /* If not already recovering from an error, report this error. */
2557 #if ! YYERROR_VERBOSE
2558 yyerror (YY_("syntax error"));
2561 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2562 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2564 YYSIZE_T yyalloc = 2 * yysize;
2565 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2566 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2567 if (yymsg != yymsgbuf)
2568 YYSTACK_FREE (yymsg);
2569 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2571 yymsg_alloc = yyalloc;
2575 yymsg_alloc = sizeof yymsgbuf;
2579 if (0 < yysize && yysize <= yymsg_alloc)
2581 (void) yysyntax_error (yymsg, yystate, yychar);
2586 yyerror (YY_("syntax error"));
2588 goto yyexhaustedlab;
2596 if (yyerrstatus == 3)
2598 /* If just tried and failed to reuse look-ahead token after an
2599 error, discard it. */
2601 if (yychar <= YYEOF)
2603 /* Return failure if at end of input. */
2604 if (yychar == YYEOF)
2609 yydestruct ("Error: discarding",
2615 /* Else will try to reuse look-ahead token after shifting the error
2620 /*---------------------------------------------------.
2621 | yyerrorlab -- error raised explicitly by YYERROR. |
2622 `---------------------------------------------------*/
2625 /* Pacify compilers like GCC when the user code never invokes
2626 YYERROR and the label yyerrorlab therefore never appears in user
2628 if (/*CONSTCOND*/ 0)
2631 /* Do not reclaim the symbols of the rule which action triggered
2635 YY_STACK_PRINT (yyss, yyssp);
2640 /*-------------------------------------------------------------.
2641 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2642 `-------------------------------------------------------------*/
2644 yyerrstatus = 3; /* Each real token shifted decrements this. */
2648 yyn = yypact[yystate];
2649 if (yyn != YYPACT_NINF)
2652 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2660 /* Pop the current state because it cannot handle the error token. */
2665 yydestruct ("Error: popping",
2666 yystos[yystate], yyvsp);
2669 YY_STACK_PRINT (yyss, yyssp);
2678 /* Shift the error token. */
2679 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2685 /*-------------------------------------.
2686 | yyacceptlab -- YYACCEPT comes here. |
2687 `-------------------------------------*/
2692 /*-----------------------------------.
2693 | yyabortlab -- YYABORT comes here. |
2694 `-----------------------------------*/
2700 /*-------------------------------------------------.
2701 | yyexhaustedlab -- memory exhaustion comes here. |
2702 `-------------------------------------------------*/
2704 yyerror (YY_("memory exhausted"));
2710 if (yychar != YYEOF && yychar != YYEMPTY)
2711 yydestruct ("Cleanup: discarding lookahead",
2713 /* Do not reclaim the symbols of the rule which action triggered
2714 this YYABORT or YYACCEPT. */
2716 YY_STACK_PRINT (yyss, yyssp);
2717 while (yyssp != yyss)
2719 yydestruct ("Cleanup: popping",
2720 yystos[*yyssp], yyvsp);
2725 YYSTACK_FREE (yyss);
2728 if (yymsg != yymsgbuf)
2729 YYSTACK_FREE (yymsg);
2731 /* Make sure YYID is used. */
2732 return YYID (yyresult);
2740 yyerror (const char *s)
2742 error_message ("%s\n", s);
2746 new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype)
2749 if(oldtype->type == TTag && oldtype->tag.tagenv == TE_IMPLICIT) {
2751 oldtype = oldtype->subtype; /* XXX */
2753 t = new_type (TTag);
2755 t->tag.tagclass = tagclass;
2756 t->tag.tagvalue = tagvalue;
2757 t->tag.tagenv = tagenv;
2758 t->subtype = oldtype;
2762 static struct objid *
2763 new_objid(const char *label, int value)
2766 s = emalloc(sizeof(*s));
2774 add_oid_to_tail(struct objid *head, struct objid *tail)
2784 new_type (Typetype tt)
2786 Type *t = ecalloc(1, sizeof(*t));
2791 static struct constraint_spec *
2792 new_constraint_spec(enum ctype ct)
2794 struct constraint_spec *c = ecalloc(1, sizeof(*c));
2799 static void fix_labels2(Type *t, const char *prefix);
2800 static void fix_labels1(struct memhead *members, const char *prefix)
2806 ASN1_TAILQ_FOREACH(m, members, members) {
2807 asprintf(&m->label, "%s_%s", prefix, m->gen_name);
2808 if (m->label == NULL)
2811 fix_labels2(m->type, m->label);
2815 static void fix_labels2(Type *t, const char *prefix)
2817 for(; t; t = t->subtype)
2818 fix_labels1(t->members, prefix);
2822 fix_labels(Symbol *s)
2825 asprintf(&p, "choice_%s", s->gen_name);
2828 fix_labels2(s->type, p);