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("$Heimdal: parse.y 21597 2007-07-16 18:48:58Z lha $"
267 static Type
*new_type (Typetype t
);
268 static struct constraint_spec
*new_constraint_spec(enum ctype
);
269 static Type
*new_tag(int tagclass
, int tagvalue
, int tagenv
, Type
*oldtype
);
270 void yyerror (const char *);
271 static struct objid
*new_objid(const char *label
, int value
);
272 static void add_oid_to_tail(struct objid
*, struct objid
*);
273 static void fix_labels(Symbol
*s
);
277 struct string_list
*next
;
282 /* Enabling traces. */
287 /* Enabling verbose error messages. */
288 #ifdef YYERROR_VERBOSE
289 # undef YYERROR_VERBOSE
290 # define YYERROR_VERBOSE 1
292 # define YYERROR_VERBOSE 0
295 /* Enabling the token table. */
296 #ifndef YYTOKEN_TABLE
297 # define YYTOKEN_TABLE 0
300 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
301 typedef union YYSTYPE
312 struct string_list
*sl
;
314 struct memhead
*members
;
315 struct constraint_spec
*constraint_spec
;
317 /* Line 193 of yacc.c. */
320 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
321 # define YYSTYPE_IS_DECLARED 1
322 # define YYSTYPE_IS_TRIVIAL 1
327 /* Copy the second part of user declarations. */
330 /* Line 216 of yacc.c. */
338 typedef YYTYPE_UINT8 yytype_uint8
;
340 typedef unsigned char yytype_uint8
;
344 typedef YYTYPE_INT8 yytype_int8
;
345 #elif (defined __STDC__ || defined __C99__FUNC__ \
346 || defined __cplusplus || defined _MSC_VER)
347 typedef signed char yytype_int8
;
349 typedef short int yytype_int8
;
353 typedef YYTYPE_UINT16 yytype_uint16
;
355 typedef unsigned short int yytype_uint16
;
359 typedef YYTYPE_INT16 yytype_int16
;
361 typedef short int yytype_int16
;
365 # ifdef __SIZE_TYPE__
366 # define YYSIZE_T __SIZE_TYPE__
367 # elif defined size_t
368 # define YYSIZE_T size_t
369 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
370 || defined __cplusplus || defined _MSC_VER)
371 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
372 # define YYSIZE_T size_t
374 # define YYSIZE_T unsigned int
378 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
381 # if defined YYENABLE_NLS && YYENABLE_NLS
383 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
384 # define YY_(msgid) dgettext ("bison-runtime", msgid)
388 # define YY_(msgid) msgid
392 /* Suppress unused-variable warnings by "using" E. */
393 #if ! defined lint || defined __GNUC__
394 # define YYUSE(e) ((void) (e))
396 # define YYUSE(e) /* empty */
399 /* Identity function, used to suppress warnings about constant conditions. */
403 #if (defined __STDC__ || defined __C99__FUNC__ \
404 || defined __cplusplus || defined _MSC_VER)
417 #if ! defined yyoverflow || YYERROR_VERBOSE
419 /* The parser invokes alloca or malloc; define the necessary symbols. */
421 # ifdef YYSTACK_USE_ALLOCA
422 # if YYSTACK_USE_ALLOCA
424 # define YYSTACK_ALLOC __builtin_alloca
425 # elif defined __BUILTIN_VA_ARG_INCR
426 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
428 # define YYSTACK_ALLOC __alloca
429 # elif defined _MSC_VER
430 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
431 # define alloca _alloca
433 # define YYSTACK_ALLOC alloca
434 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
435 || defined __cplusplus || defined _MSC_VER)
436 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
445 # ifdef YYSTACK_ALLOC
446 /* Pacify GCC's `empty if-body' warning. */
447 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
448 # ifndef YYSTACK_ALLOC_MAXIMUM
449 /* The OS might guarantee only one guard page at the bottom of the stack,
450 and a page size can be as small as 4096 bytes. So we cannot safely
451 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
452 to allow for a few compiler-allocated temporary stack slots. */
453 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
456 # define YYSTACK_ALLOC YYMALLOC
457 # define YYSTACK_FREE YYFREE
458 # ifndef YYSTACK_ALLOC_MAXIMUM
459 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
461 # if (defined __cplusplus && ! defined _STDLIB_H \
462 && ! ((defined YYMALLOC || defined malloc) \
463 && (defined YYFREE || defined free)))
464 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
470 # define YYMALLOC malloc
471 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
478 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
479 || defined __cplusplus || defined _MSC_VER)
480 void free (void *); /* INFRINGES ON USER NAME SPACE */
484 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
487 #if (! defined yyoverflow \
488 && (! defined __cplusplus \
489 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
491 /* A type that is properly aligned for any stack member. */
498 /* The size of the maximum gap between one aligned stack and the next. */
499 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
501 /* The size of an array large to enough to hold all stacks, each with
503 # define YYSTACK_BYTES(N) \
504 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
505 + YYSTACK_GAP_MAXIMUM)
507 /* Copy COUNT objects from FROM to TO. The source and destination do
510 # if defined __GNUC__ && 1 < __GNUC__
511 # define YYCOPY(To, From, Count) \
512 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
514 # define YYCOPY(To, From, Count) \
518 for (yyi = 0; yyi < (Count); yyi++) \
519 (To)[yyi] = (From)[yyi]; \
525 /* Relocate STACK from its old location to the new one. The
526 local variables YYSIZE and YYSTACKSIZE give the old and new number of
527 elements in the stack, and YYPTR gives the new location of the
528 stack. Advance YYPTR to a properly aligned location for the next
530 # define YYSTACK_RELOCATE(Stack) \
533 YYSIZE_T yynewbytes; \
534 YYCOPY (&yyptr->Stack, Stack, yysize); \
535 Stack = &yyptr->Stack; \
536 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
537 yyptr += yynewbytes / sizeof (*yyptr); \
543 /* YYFINAL -- State number of the termination state. */
545 /* YYLAST -- Last index in YYTABLE. */
548 /* YYNTOKENS -- Number of terminals. */
550 /* YYNNTS -- Number of nonterminals. */
552 /* YYNRULES -- Number of rules. */
554 /* YYNRULES -- Number of states. */
555 #define YYNSTATES 214
557 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
559 #define YYMAXUTOK 344
561 #define YYTRANSLATE(YYX) \
562 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
564 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
565 static const yytype_uint8 yytranslate
[] =
567 0, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 94, 2, 95, 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, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
593 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
594 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
595 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
596 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
597 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
598 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
599 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
600 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
605 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
607 static const yytype_uint16 yyprhs
[] =
609 0, 0, 3, 13, 16, 19, 22, 23, 26, 27,
610 30, 31, 35, 36, 38, 39, 41, 44, 49, 51,
611 54, 56, 58, 62, 64, 68, 70, 72, 74, 76,
612 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
613 98, 100, 102, 104, 110, 116, 122, 126, 128, 131,
614 136, 138, 142, 146, 151, 156, 158, 161, 167, 170,
615 174, 176, 177, 180, 185, 189, 194, 199, 203, 207,
616 212, 214, 216, 218, 220, 222, 225, 229, 231, 233,
617 235, 238, 242, 248, 253, 257, 262, 263, 265, 267,
618 269, 270, 272, 274, 279, 281, 283, 285, 287, 289,
619 291, 293, 295, 297, 301, 305, 308, 310, 313, 317,
620 319, 323, 328, 330, 331, 335, 336, 339, 344, 346,
621 348, 350, 352, 354, 356, 358, 360, 362, 364, 366,
622 368, 370, 372, 374, 376, 378, 380
625 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
626 static const yytype_int16 yyrhs
[] =
628 99, 0, -1, 86, 151, 21, 100, 101, 84, 8,
629 102, 24, -1, 27, 70, -1, 38, 70, -1, 7,
630 70, -1, -1, 29, 39, -1, -1, 103, 107, -1,
631 -1, 40, 104, 90, -1, -1, 105, -1, -1, 106,
632 -1, 105, 106, -1, 109, 32, 86, 151, -1, 108,
633 -1, 108, 107, -1, 110, -1, 143, -1, 86, 91,
634 109, -1, 86, -1, 86, 84, 111, -1, 112, -1,
635 130, -1, 133, -1, 120, -1, 113, -1, 144, -1,
636 129, -1, 118, -1, 115, -1, 123, -1, 121, -1,
637 122, -1, 125, -1, 126, -1, 127, -1, 128, -1,
638 139, -1, 11, -1, 92, 155, 83, 155, 93, -1,
639 92, 155, 83, 46, 93, -1, 92, 47, 83, 155,
640 93, -1, 92, 155, 93, -1, 43, -1, 43, 114,
641 -1, 43, 94, 116, 95, -1, 117, -1, 116, 91,
642 117, -1, 116, 91, 85, -1, 86, 92, 163, 93,
643 -1, 25, 94, 119, 95, -1, 116, -1, 9, 67,
644 -1, 9, 67, 94, 149, 95, -1, 51, 37, -1,
645 52, 67, 124, -1, 49, -1, -1, 66, 114, -1,
646 64, 94, 146, 95, -1, 64, 94, 95, -1, 64,
647 124, 53, 111, -1, 65, 94, 146, 95, -1, 65,
648 94, 95, -1, 65, 53, 111, -1, 14, 94, 146,
649 95, -1, 131, -1, 132, -1, 86, -1, 34, -1,
650 77, -1, 111, 134, -1, 92, 135, 93, -1, 136,
651 -1, 137, -1, 138, -1, 19, 111, -1, 23, 12,
652 155, -1, 19, 111, 23, 12, 155, -1, 18, 12,
653 94, 95, -1, 140, 142, 111, -1, 96, 141, 89,
654 97, -1, -1, 76, -1, 6, -1, 60, -1, -1,
655 27, -1, 38, -1, 86, 111, 84, 155, -1, 145,
656 -1, 33, -1, 78, -1, 61, -1, 81, -1, 36,
657 -1, 10, -1, 79, -1, 148, -1, 146, 91, 148,
658 -1, 146, 91, 85, -1, 86, 111, -1, 147, -1,
659 147, 54, -1, 147, 20, 155, -1, 150, -1, 149,
660 91, 150, -1, 86, 92, 89, 93, -1, 152, -1,
661 -1, 94, 153, 95, -1, -1, 154, 153, -1, 86,
662 92, 89, 93, -1, 86, -1, 89, -1, 156, -1,
663 157, -1, 161, -1, 160, -1, 162, -1, 165, -1,
664 164, -1, 158, -1, 159, -1, 86, -1, 88, -1,
665 71, -1, 31, -1, 163, -1, 89, -1, 49, -1,
669 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
670 static const yytype_uint16 yyrline
[] =
672 0, 233, 233, 240, 241, 243, 245, 248, 250, 253,
673 254, 257, 258, 261, 262, 265, 266, 269, 280, 281,
674 284, 285, 288, 294, 302, 312, 313, 314, 317, 318,
675 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
676 329, 330, 333, 340, 350, 358, 366, 377, 382, 388,
677 396, 402, 407, 411, 424, 432, 435, 442, 450, 456,
678 465, 473, 474, 479, 485, 493, 502, 508, 516, 524,
679 531, 532, 535, 546, 551, 558, 574, 580, 583, 584,
680 587, 593, 601, 611, 617, 630, 639, 642, 646, 650,
681 657, 660, 664, 671, 682, 685, 690, 695, 700, 705,
682 710, 715, 723, 729, 734, 745, 756, 762, 768, 776,
683 782, 789, 802, 803, 806, 813, 816, 827, 831, 842,
684 848, 849, 852, 853, 854, 855, 856, 859, 862, 865,
685 876, 884, 890, 898, 906, 909, 914
689 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
690 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
691 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
692 static const char *const yytname
[] =
694 "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
695 "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
696 "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
697 "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
698 "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
699 "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
700 "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
701 "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
702 "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
703 "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
704 "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
705 "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
706 "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
707 "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
708 "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
709 "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
710 "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
711 "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
712 "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
713 "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
714 "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
715 "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
716 "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
717 "SymbolsFromModule", "AssignmentList", "Assignment", "referencenames",
718 "TypeAssignment", "Type", "BuiltinType", "BooleanType", "range",
719 "IntegerType", "NamedNumberList", "NamedNumber", "EnumeratedType",
720 "Enumerations", "BitStringType", "ObjectIdentifierType",
721 "OctetStringType", "NullType", "size", "SequenceType", "SequenceOfType",
722 "SetType", "SetOfType", "ChoiceType", "ReferencedType", "DefinedType",
723 "UsefulType", "ConstrainedType", "Constraint", "ConstraintSpec",
724 "GeneralConstraint", "ContentsConstraint", "UserDefinedConstraint",
725 "TaggedType", "Tag", "Class", "tagenv", "ValueAssignment",
726 "CharacterStringType", "RestrictedCharactedStringType",
727 "ComponentTypeList", "NamedType", "ComponentType", "NamedBitList",
728 "NamedBit", "objid_opt", "objid", "objid_list", "objid_element", "Value",
729 "BuiltinValue", "ReferencedValue", "DefinedValue", "Valuereference",
730 "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
731 "NullValue", "ObjectIdentifierValue", 0
736 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
738 static const yytype_uint16 yytoknum
[] =
740 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
741 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
742 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
743 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
744 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
745 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
746 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
747 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
748 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
749 59, 44, 40, 41, 123, 125, 91, 93
753 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
754 static const yytype_uint8 yyr1
[] =
756 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
757 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
758 108, 108, 109, 109, 110, 111, 111, 111, 112, 112,
759 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
760 112, 112, 113, 114, 114, 114, 114, 115, 115, 115,
761 116, 116, 116, 117, 118, 119, 120, 120, 121, 122,
762 123, 124, 124, 125, 125, 126, 127, 127, 128, 129,
763 130, 130, 131, 132, 132, 133, 134, 135, 136, 136,
764 137, 137, 137, 138, 139, 140, 141, 141, 141, 141,
765 142, 142, 142, 143, 144, 145, 145, 145, 145, 145,
766 145, 145, 146, 146, 146, 147, 148, 148, 148, 149,
767 149, 150, 151, 151, 152, 153, 153, 154, 154, 154,
768 155, 155, 156, 156, 156, 156, 156, 157, 158, 159,
769 160, 161, 161, 162, 163, 164, 165
772 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
773 static const yytype_uint8 yyr2
[] =
775 0, 2, 9, 2, 2, 2, 0, 2, 0, 2,
776 0, 3, 0, 1, 0, 1, 2, 4, 1, 2,
777 1, 1, 3, 1, 3, 1, 1, 1, 1, 1,
778 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
779 1, 1, 1, 5, 5, 5, 3, 1, 2, 4,
780 1, 3, 3, 4, 4, 1, 2, 5, 2, 3,
781 1, 0, 2, 4, 3, 4, 4, 3, 3, 4,
782 1, 1, 1, 1, 1, 2, 3, 1, 1, 1,
783 2, 3, 5, 4, 3, 4, 0, 1, 1, 1,
784 0, 1, 1, 4, 1, 1, 1, 1, 1, 1,
785 1, 1, 1, 3, 3, 2, 1, 2, 3, 1,
786 3, 4, 1, 0, 3, 0, 2, 4, 1, 1,
787 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
791 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
792 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
793 means the default is an error. */
794 static const yytype_uint8 yydefact
[] =
796 0, 113, 0, 115, 0, 112, 1, 118, 119, 0,
797 115, 6, 0, 114, 116, 0, 0, 0, 8, 0,
798 5, 3, 4, 0, 0, 117, 7, 0, 10, 14,
799 0, 0, 23, 0, 13, 15, 0, 2, 0, 9,
800 18, 20, 21, 0, 11, 16, 0, 0, 100, 42,
801 0, 0, 95, 73, 99, 47, 60, 0, 0, 97,
802 61, 0, 74, 96, 101, 98, 0, 72, 86, 0,
803 25, 29, 33, 32, 28, 35, 36, 34, 37, 38,
804 39, 40, 31, 26, 70, 71, 27, 41, 90, 30,
805 94, 19, 22, 113, 56, 0, 0, 0, 0, 48,
806 58, 61, 0, 0, 0, 0, 0, 24, 88, 89,
807 87, 0, 0, 0, 75, 91, 92, 0, 17, 0,
808 0, 0, 106, 102, 0, 55, 50, 0, 132, 0,
809 135, 131, 129, 130, 134, 136, 0, 120, 121, 127,
810 128, 123, 122, 124, 133, 126, 125, 0, 59, 62,
811 64, 0, 0, 68, 67, 0, 0, 93, 0, 0,
812 0, 0, 77, 78, 79, 84, 0, 0, 109, 105,
813 0, 69, 0, 107, 0, 0, 54, 0, 0, 46,
814 49, 63, 65, 66, 85, 0, 80, 0, 76, 0,
815 0, 57, 104, 103, 108, 0, 52, 51, 0, 0,
816 0, 0, 0, 81, 0, 110, 53, 45, 44, 43,
820 /* YYDEFGOTO[NTERM-NUM]. */
821 static const yytype_int16 yydefgoto
[] =
823 -1, 2, 18, 24, 30, 31, 33, 34, 35, 39,
824 40, 36, 41, 69, 70, 71, 99, 72, 125, 126,
825 73, 127, 74, 75, 76, 77, 104, 78, 79, 80,
826 81, 82, 83, 84, 85, 86, 114, 161, 162, 163,
827 164, 87, 88, 111, 117, 42, 89, 90, 121, 122,
828 123, 167, 168, 4, 135, 9, 10, 136, 137, 138,
829 139, 140, 141, 142, 143, 144, 145, 146
832 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
834 #define YYPACT_NINF -113
835 static const yytype_int16 yypact
[] =
837 -74, -67, 38, -69, 23, -113, -113, -44, -113, -41,
838 -69, 4, -26, -113, -113, -3, 1, 10, 52, -10,
839 -113, -113, -113, 45, 13, -113, -113, 77, -35, 15,
840 64, 19, 17, 20, 15, -113, 85, -113, 25, -113,
841 19, -113, -113, 15, -113, -113, 27, 47, -113, -113,
842 26, 29, -113, -113, -113, -30, -113, 89, 61, -113,
843 -57, -47, -113, -113, -113, -113, 82, -113, -4, -68,
844 -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
845 -113, -113, -113, -113, -113, -113, -113, -113, -17, -113,
846 -113, -113, -113, -67, 35, 33, 46, 51, 46, -113,
847 -113, 69, 44, -73, 88, 82, -72, 56, -113, -113,
848 -113, 49, 93, 7, -113, -113, -113, 82, -113, 58,
849 82, -76, -13, -113, 57, 59, -113, 60, -113, 68,
850 -113, -113, -113, -113, -113, -113, -75, -113, -113, -113,
851 -113, -113, -113, -113, -113, -113, -113, -63, -113, -113,
852 -113, -62, 82, 56, -113, -46, 65, -113, 141, 82,
853 142, 63, -113, -113, -113, 56, 66, -38, -113, 56,
854 -16, -113, 93, -113, 76, -7, -113, 93, 81, -113,
855 -113, -113, 56, -113, -113, 72, -19, 93, -113, 83,
856 58, -113, -113, -113, -113, 78, -113, -113, 80, 84,
857 87, 62, 162, -113, 90, -113, -113, -113, -113, -113,
861 /* YYPGOTO[NTERM-NUM]. */
862 static const yytype_int16 yypgoto
[] =
864 -113, -113, -113, -113, -113, -113, -113, -113, 150, 136,
865 -113, 143, -113, -65, -113, -113, 86, -113, 91, 16,
866 -113, -113, -113, -113, -113, -113, 92, -113, -113, -113,
867 -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
868 -113, -113, -113, -113, -113, -113, -113, -113, -60, -113,
869 22, -113, -5, 97, 2, 184, -113, -112, -113, -113,
870 -113, -113, -113, -113, -113, 21, -113, -113
873 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
874 positive, shift that token. If negative, reduce the rule which
875 number is the opposite. If zero, do what YYDEFACT says.
876 If YYTABLE_NINF, syntax error. */
877 #define YYTABLE_NINF -13
878 static const yytype_int16 yytable
[] =
880 157, 107, 108, 5, 202, 29, 105, 172, 178, 102,
881 115, 15, 1, 120, 120, 170, 112, 7, 179, 171,
882 8, 116, 150, 154, 113, 158, 159, 3, 175, 170,
883 160, 16, 180, 181, 47, 48, 49, 103, 6, 50,
884 153, 173, 17, 151, 11, 170, 155, 106, 12, 183,
885 51, -12, 165, 190, 13, 169, 109, 191, 52, 53,
886 194, 54, 97, 19, 98, 198, 200, 20, 55, 192,
887 120, 21, 110, 113, 56, 203, 57, 58, 196, 124,
888 22, 23, 128, 25, 26, 28, 59, 182, 37, 60,
889 61, 47, 48, 49, 186, 5, 50, 27, 129, 213,
890 130, 32, 62, 63, 64, 38, 65, 51, 43, 66,
891 44, 67, 128, 93, 94, 52, 53, 46, 54, 120,
892 95, 68, 131, 96, 128, 55, 100, 199, 101, 119,
893 130, 56, 124, 57, 58, 102, 97, 132, 156, 133,
894 134, 152, 130, 59, 166, 3, 60, 61, 113, 174,
895 175, 177, 131, 185, 187, 176, 188, 210, 189, 62,
896 63, 64, 184, 65, 131, 134, 201, 132, 67, 133,
897 134, 206, 204, 207, 211, 3, 91, 208, 68, 132,
898 209, 133, 134, 212, 45, 205, 92, 3, 149, 147,
899 118, 197, 193, 148, 14, 195
902 static const yytype_uint8 yycheck
[] =
904 112, 66, 6, 1, 23, 40, 53, 20, 83, 66,
905 27, 7, 86, 86, 86, 91, 84, 86, 93, 95,
906 89, 38, 95, 95, 92, 18, 19, 94, 91, 91,
907 23, 27, 95, 95, 9, 10, 11, 94, 0, 14,
908 105, 54, 38, 103, 21, 91, 106, 94, 92, 95,
909 25, 86, 117, 91, 95, 120, 60, 95, 33, 34,
910 172, 36, 92, 89, 94, 177, 178, 70, 43, 85,
911 86, 70, 76, 92, 49, 187, 51, 52, 85, 86,
912 70, 29, 31, 93, 39, 8, 61, 152, 24, 64,
913 65, 9, 10, 11, 159, 93, 14, 84, 47, 211,
914 49, 86, 77, 78, 79, 86, 81, 25, 91, 84,
915 90, 86, 31, 86, 67, 33, 34, 32, 36, 86,
916 94, 96, 71, 94, 31, 43, 37, 46, 67, 94,
917 49, 49, 86, 51, 52, 66, 92, 86, 89, 88,
918 89, 53, 49, 61, 86, 94, 64, 65, 92, 92,
919 91, 83, 71, 12, 12, 95, 93, 95, 92, 77,
920 78, 79, 97, 81, 71, 89, 94, 86, 86, 88,
921 89, 93, 89, 93, 12, 94, 40, 93, 96, 86,
922 93, 88, 89, 93, 34, 190, 43, 94, 102, 98,
923 93, 175, 170, 101, 10, 174
926 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
927 symbol of state STATE-NUM. */
928 static const yytype_uint8 yystos
[] =
930 0, 86, 99, 94, 151, 152, 0, 86, 89, 153,
931 154, 21, 92, 95, 153, 7, 27, 38, 100, 89,
932 70, 70, 70, 29, 101, 93, 39, 84, 8, 40,
933 102, 103, 86, 104, 105, 106, 109, 24, 86, 107,
934 108, 110, 143, 91, 90, 106, 32, 9, 10, 11,
935 14, 25, 33, 34, 36, 43, 49, 51, 52, 61,
936 64, 65, 77, 78, 79, 81, 84, 86, 96, 111,
937 112, 113, 115, 118, 120, 121, 122, 123, 125, 126,
938 127, 128, 129, 130, 131, 132, 133, 139, 140, 144,
939 145, 107, 109, 86, 67, 94, 94, 92, 94, 114,
940 37, 67, 66, 94, 124, 53, 94, 111, 6, 60,
941 76, 141, 84, 92, 134, 27, 38, 142, 151, 94,
942 86, 146, 147, 148, 86, 116, 117, 119, 31, 47,
943 49, 71, 86, 88, 89, 152, 155, 156, 157, 158,
944 159, 160, 161, 162, 163, 164, 165, 116, 124, 114,
945 95, 146, 53, 111, 95, 146, 89, 155, 18, 19,
946 23, 135, 136, 137, 138, 111, 86, 149, 150, 111,
947 91, 95, 20, 54, 92, 91, 95, 83, 83, 93,
948 95, 95, 111, 95, 97, 12, 111, 12, 93, 92,
949 91, 95, 85, 148, 155, 163, 85, 117, 155, 46,
950 155, 94, 23, 155, 89, 150, 93, 93, 93, 93,
954 #define yyerrok (yyerrstatus = 0)
955 #define yyclearin (yychar = YYEMPTY)
959 #define YYACCEPT goto yyacceptlab
960 #define YYABORT goto yyabortlab
961 #define YYERROR goto yyerrorlab
964 /* Like YYERROR except do call yyerror. This remains here temporarily
965 to ease the transition to the new meaning of YYERROR, for GCC.
966 Once GCC version 2 has supplanted version 1, this can go. */
968 #define YYFAIL goto yyerrlab
970 #define YYRECOVERING() (!!yyerrstatus)
972 #define YYBACKUP(Token, Value) \
974 if (yychar == YYEMPTY && yylen == 1) \
978 yytoken = YYTRANSLATE (yychar); \
984 yyerror (YY_("syntax error: cannot back up")); \
991 #define YYERRCODE 256
994 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
995 If N is 0, then set CURRENT to the empty location which ends
996 the previous symbol: RHS[0] (always defined). */
998 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
999 #ifndef YYLLOC_DEFAULT
1000 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1004 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1005 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1006 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1007 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1011 (Current).first_line = (Current).last_line = \
1012 YYRHSLOC (Rhs, 0).last_line; \
1013 (Current).first_column = (Current).last_column = \
1014 YYRHSLOC (Rhs, 0).last_column; \
1020 /* YY_LOCATION_PRINT -- Print the location on the stream.
1021 This macro was not mandated originally: define only if we know
1022 we won't break user code: when these are the locations we know. */
1024 #ifndef YY_LOCATION_PRINT
1025 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1026 # define YY_LOCATION_PRINT(File, Loc) \
1027 fprintf (File, "%d.%d-%d.%d", \
1028 (Loc).first_line, (Loc).first_column, \
1029 (Loc).last_line, (Loc).last_column)
1031 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1036 /* YYLEX -- calling `yylex' with the right arguments. */
1039 # define YYLEX yylex (YYLEX_PARAM)
1041 # define YYLEX yylex ()
1044 /* Enable debugging if requested. */
1048 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1049 # define YYFPRINTF fprintf
1052 # define YYDPRINTF(Args) \
1058 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1062 YYFPRINTF (stderr, "%s ", Title); \
1063 yy_symbol_print (stderr, \
1065 YYFPRINTF (stderr, "\n"); \
1070 /*--------------------------------.
1071 | Print this symbol on YYOUTPUT. |
1072 `--------------------------------*/
1075 #if (defined __STDC__ || defined __C99__FUNC__ \
1076 || defined __cplusplus || defined _MSC_VER)
1078 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1081 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
1084 YYSTYPE
const * const yyvaluep
;
1090 if (yytype
< YYNTOKENS
)
1091 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1103 /*--------------------------------.
1104 | Print this symbol on YYOUTPUT. |
1105 `--------------------------------*/
1107 #if (defined __STDC__ || defined __C99__FUNC__ \
1108 || defined __cplusplus || defined _MSC_VER)
1110 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1113 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
1116 YYSTYPE
const * const yyvaluep
;
1119 if (yytype
< YYNTOKENS
)
1120 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1122 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1124 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1125 YYFPRINTF (yyoutput
, ")");
1128 /*------------------------------------------------------------------.
1129 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1131 `------------------------------------------------------------------*/
1133 #if (defined __STDC__ || defined __C99__FUNC__ \
1134 || defined __cplusplus || defined _MSC_VER)
1136 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
1139 yy_stack_print (bottom
, top
)
1140 yytype_int16
*bottom
;
1144 YYFPRINTF (stderr
, "Stack now");
1145 for (; bottom
<= top
; ++bottom
)
1146 YYFPRINTF (stderr
, " %d", *bottom
);
1147 YYFPRINTF (stderr
, "\n");
1150 # define YY_STACK_PRINT(Bottom, Top) \
1153 yy_stack_print ((Bottom), (Top)); \
1157 /*------------------------------------------------.
1158 | Report that the YYRULE is going to be reduced. |
1159 `------------------------------------------------*/
1161 #if (defined __STDC__ || defined __C99__FUNC__ \
1162 || defined __cplusplus || defined _MSC_VER)
1164 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
1167 yy_reduce_print (yyvsp
, yyrule
)
1172 int yynrhs
= yyr2
[yyrule
];
1174 unsigned long int yylno
= yyrline
[yyrule
];
1175 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1177 /* The symbols being reduced. */
1178 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1180 fprintf (stderr
, " $%d = ", yyi
+ 1);
1181 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1182 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1184 fprintf (stderr
, "\n");
1188 # define YY_REDUCE_PRINT(Rule) \
1191 yy_reduce_print (yyvsp, Rule); \
1194 /* Nonzero means print parse trace. It is left uninitialized so that
1195 multiple parsers can coexist. */
1197 #else /* !YYDEBUG */
1198 # define YYDPRINTF(Args)
1199 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1200 # define YY_STACK_PRINT(Bottom, Top)
1201 # define YY_REDUCE_PRINT(Rule)
1202 #endif /* !YYDEBUG */
1205 /* YYINITDEPTH -- initial size of the parser's stacks. */
1207 # define YYINITDEPTH 200
1210 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1211 if the built-in stack extension method is used).
1213 Do not make this value too large; the results are undefined if
1214 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1215 evaluated with infinite-precision integer arithmetic. */
1218 # define YYMAXDEPTH 10000
1226 # if defined __GLIBC__ && defined _STRING_H
1227 # define yystrlen strlen
1229 /* Return the length of YYSTR. */
1230 #if (defined __STDC__ || defined __C99__FUNC__ \
1231 || defined __cplusplus || defined _MSC_VER)
1233 yystrlen (const char *yystr
)
1241 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1249 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1250 # define yystpcpy stpcpy
1252 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1254 #if (defined __STDC__ || defined __C99__FUNC__ \
1255 || defined __cplusplus || defined _MSC_VER)
1257 yystpcpy (char *yydest
, const char *yysrc
)
1260 yystpcpy (yydest
, yysrc
)
1266 const char *yys
= yysrc
;
1268 while ((*yyd
++ = *yys
++) != '\0')
1277 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1278 quotes and backslashes, so that it's suitable for yyerror. The
1279 heuristic is that double-quoting is unnecessary unless the string
1280 contains an apostrophe, a comma, or backslash (other than
1281 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1282 null, do not copy; instead, return the length of what the result
1285 yytnamerr (char *yyres
, const char *yystr
)
1290 char const *yyp
= yystr
;
1297 goto do_not_strip_quotes
;
1301 goto do_not_strip_quotes
;
1314 do_not_strip_quotes
: ;
1318 return yystrlen (yystr
);
1320 return yystpcpy (yyres
, yystr
) - yyres
;
1324 /* Copy into YYRESULT an error message about the unexpected token
1325 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1326 including the terminating null byte. If YYRESULT is null, do not
1327 copy anything; just return the number of bytes that would be
1328 copied. As a special case, return 0 if an ordinary "syntax error"
1329 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1330 size calculation. */
1332 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1334 int yyn
= yypact
[yystate
];
1336 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1340 int yytype
= YYTRANSLATE (yychar
);
1341 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1342 YYSIZE_T yysize
= yysize0
;
1344 int yysize_overflow
= 0;
1345 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1346 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1350 /* This is so xgettext sees the translatable formats that are
1351 constructed on the fly. */
1352 YY_("syntax error, unexpected %s");
1353 YY_("syntax error, unexpected %s, expecting %s");
1354 YY_("syntax error, unexpected %s, expecting %s or %s");
1355 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1356 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1360 static char const yyunexpected
[] = "syntax error, unexpected %s";
1361 static char const yyexpecting
[] = ", expecting %s";
1362 static char const yyor
[] = " or %s";
1363 char yyformat
[sizeof yyunexpected
1364 + sizeof yyexpecting
- 1
1365 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1366 * (sizeof yyor
- 1))];
1367 char const *yyprefix
= yyexpecting
;
1369 /* Start YYX at -YYN if negative to avoid negative indexes in
1371 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1373 /* Stay within bounds of both yycheck and yytname. */
1374 int yychecklim
= YYLAST
- yyn
+ 1;
1375 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1378 yyarg
[0] = yytname
[yytype
];
1379 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1381 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1382 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1384 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1388 yyformat
[sizeof yyunexpected
- 1] = '\0';
1391 yyarg
[yycount
++] = yytname
[yyx
];
1392 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1393 yysize_overflow
|= (yysize1
< yysize
);
1395 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1399 yyf
= YY_(yyformat
);
1400 yysize1
= yysize
+ yystrlen (yyf
);
1401 yysize_overflow
|= (yysize1
< yysize
);
1404 if (yysize_overflow
)
1405 return YYSIZE_MAXIMUM
;
1409 /* Avoid sprintf, as that infringes on the user's name space.
1410 Don't have undefined behavior even if the translation
1411 produced a string with the wrong number of "%s"s. */
1412 char *yyp
= yyresult
;
1414 while ((*yyp
= *yyf
) != '\0')
1416 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1418 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1431 #endif /* YYERROR_VERBOSE */
1434 /*-----------------------------------------------.
1435 | Release the memory associated to this symbol. |
1436 `-----------------------------------------------*/
1439 #if (defined __STDC__ || defined __C99__FUNC__ \
1440 || defined __cplusplus || defined _MSC_VER)
1442 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1445 yydestruct (yymsg
, yytype
, yyvaluep
)
1455 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1466 /* Prevent warnings from -Wmissing-prototypes. */
1468 #ifdef YYPARSE_PARAM
1469 #if defined __STDC__ || defined __cplusplus
1470 int yyparse (void *YYPARSE_PARAM
);
1474 #else /* ! YYPARSE_PARAM */
1475 #if defined __STDC__ || defined __cplusplus
1480 #endif /* ! YYPARSE_PARAM */
1484 /* The look-ahead symbol. */
1487 /* The semantic value of the look-ahead symbol. */
1490 /* Number of syntax errors so far. */
1499 #ifdef YYPARSE_PARAM
1500 #if (defined __STDC__ || defined __C99__FUNC__ \
1501 || defined __cplusplus || defined _MSC_VER)
1503 yyparse (void *YYPARSE_PARAM
)
1506 yyparse (YYPARSE_PARAM
)
1507 void *YYPARSE_PARAM
;
1509 #else /* ! YYPARSE_PARAM */
1510 #if (defined __STDC__ || defined __C99__FUNC__ \
1511 || defined __cplusplus || defined _MSC_VER)
1525 /* Number of tokens to shift before error messages enabled. */
1527 /* Look-ahead token as an internal (translated) token number. */
1530 /* Buffer for error messages, and its allocated size. */
1532 char *yymsg
= yymsgbuf
;
1533 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1536 /* Three stacks and their tools:
1537 `yyss': related to states,
1538 `yyvs': related to semantic values,
1539 `yyls': related to locations.
1541 Refer to the stacks thru separate pointers, to allow yyoverflow
1542 to reallocate them elsewhere. */
1544 /* The state stack. */
1545 yytype_int16 yyssa
[YYINITDEPTH
];
1546 yytype_int16
*yyss
= yyssa
;
1547 yytype_int16
*yyssp
;
1549 /* The semantic value stack. */
1550 YYSTYPE yyvsa
[YYINITDEPTH
];
1551 YYSTYPE
*yyvs
= yyvsa
;
1556 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1558 YYSIZE_T yystacksize
= YYINITDEPTH
;
1560 /* The variables used to return semantic value and location from the
1565 /* The number of symbols on the RHS of the reduced rule.
1566 Keep to zero when no symbol should be popped. */
1569 YYDPRINTF ((stderr
, "Starting parse\n"));
1574 yychar
= YYEMPTY
; /* Cause a token to be read. */
1576 /* Initialize stack pointers.
1577 Waste one element of value and location stack
1578 so that they stay on the same level as the state stack.
1579 The wasted elements are never initialized. */
1586 /*------------------------------------------------------------.
1587 | yynewstate -- Push a new state, which is found in yystate. |
1588 `------------------------------------------------------------*/
1590 /* In all cases, when you get here, the value and location stacks
1591 have just been pushed. So pushing a state here evens the stacks. */
1597 if (yyss
+ yystacksize
- 1 <= yyssp
)
1599 /* Get the current used size of the three stacks, in elements. */
1600 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1604 /* Give user a chance to reallocate the stack. Use copies of
1605 these so that the &'s don't force the real ones into
1607 YYSTYPE
*yyvs1
= yyvs
;
1608 yytype_int16
*yyss1
= yyss
;
1611 /* Each stack pointer address is followed by the size of the
1612 data in use in that stack, in bytes. This used to be a
1613 conditional around just the two extra args, but that might
1614 be undefined if yyoverflow is a macro. */
1615 yyoverflow (YY_("memory exhausted"),
1616 &yyss1
, yysize
* sizeof (*yyssp
),
1617 &yyvs1
, yysize
* sizeof (*yyvsp
),
1624 #else /* no yyoverflow */
1625 # ifndef YYSTACK_RELOCATE
1626 goto yyexhaustedlab
;
1628 /* Extend the stack our own way. */
1629 if (YYMAXDEPTH
<= yystacksize
)
1630 goto yyexhaustedlab
;
1632 if (YYMAXDEPTH
< yystacksize
)
1633 yystacksize
= YYMAXDEPTH
;
1636 yytype_int16
*yyss1
= yyss
;
1637 union yyalloc
*yyptr
=
1638 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1640 goto yyexhaustedlab
;
1641 YYSTACK_RELOCATE (yyss
);
1642 YYSTACK_RELOCATE (yyvs
);
1644 # undef YYSTACK_RELOCATE
1646 YYSTACK_FREE (yyss1
);
1649 #endif /* no yyoverflow */
1651 yyssp
= yyss
+ yysize
- 1;
1652 yyvsp
= yyvs
+ yysize
- 1;
1655 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1656 (unsigned long int) yystacksize
));
1658 if (yyss
+ yystacksize
- 1 <= yyssp
)
1662 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1671 /* Do appropriate processing given the current state. Read a
1672 look-ahead token if we need one and don't already have one. */
1674 /* First try to decide what to do without reference to look-ahead token. */
1675 yyn
= yypact
[yystate
];
1676 if (yyn
== YYPACT_NINF
)
1679 /* Not known => get a look-ahead token if don't already have one. */
1681 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1682 if (yychar
== YYEMPTY
)
1684 YYDPRINTF ((stderr
, "Reading a token: "));
1688 if (yychar
<= YYEOF
)
1690 yychar
= yytoken
= YYEOF
;
1691 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1695 yytoken
= YYTRANSLATE (yychar
);
1696 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1699 /* If the proper action on seeing token YYTOKEN is to reduce or to
1700 detect an error, take that action. */
1702 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1707 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1716 /* Count tokens shifted since error; after three, turn off error
1721 /* Shift the look-ahead token. */
1722 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1724 /* Discard the shifted token unless it is eof. */
1725 if (yychar
!= YYEOF
)
1734 /*-----------------------------------------------------------.
1735 | yydefault -- do the default action for the current state. |
1736 `-----------------------------------------------------------*/
1738 yyn
= yydefact
[yystate
];
1744 /*-----------------------------.
1745 | yyreduce -- Do a reduction. |
1746 `-----------------------------*/
1748 /* yyn is the number of a rule to reduce with. */
1751 /* If YYLEN is nonzero, implement the default value of the action:
1754 Otherwise, the following line sets YYVAL to garbage.
1755 This behavior is undocumented and Bison
1756 users should not rely upon it. Assigning to YYVAL
1757 unconditionally makes the parser a bit smaller, and it avoids a
1758 GCC warning that YYVAL may be used uninitialized. */
1759 yyval
= yyvsp
[1-yylen
];
1762 YY_REDUCE_PRINT (yyn
);
1774 { error_message("implicit tagging is not supported"); }
1779 { error_message("automatic tagging is not supported"); }
1784 { error_message("no extensibility options supported"); }
1790 struct string_list
*sl
;
1791 for(sl
= (yyvsp
[(1) - (4)].sl
); sl
!= NULL
; sl
= sl
->next
) {
1792 Symbol
*s
= addsym(sl
->string
);
1795 add_import((yyvsp
[(3) - (4)].name
));
1802 (yyval
.sl
) = emalloc(sizeof(*(yyval
.sl
)));
1803 (yyval
.sl
)->string
= (yyvsp
[(1) - (3)].name
);
1804 (yyval
.sl
)->next
= (yyvsp
[(3) - (3)].sl
);
1811 (yyval
.sl
) = emalloc(sizeof(*(yyval
.sl
)));
1812 (yyval
.sl
)->string
= (yyvsp
[(1) - (1)].name
);
1813 (yyval
.sl
)->next
= NULL
;
1820 Symbol
*s
= addsym ((yyvsp
[(1) - (3)].name
));
1822 s
->type
= (yyvsp
[(3) - (3)].type
);
1831 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Boolean
,
1832 TE_EXPLICIT
, new_type(TBoolean
));
1839 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1840 error_message("Non-integer used in first part of range");
1841 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1842 error_message("Non-integer in second part of range");
1843 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1844 (yyval
.range
)->min
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
;
1845 (yyval
.range
)->max
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
;
1852 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1853 error_message("Non-integer in first part of range");
1854 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1855 (yyval
.range
)->min
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
;
1856 (yyval
.range
)->max
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
- 1;
1863 if((yyvsp
[(4) - (5)].value
)->type
!= integervalue
)
1864 error_message("Non-integer in second part of range");
1865 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1866 (yyval
.range
)->min
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
+ 2;
1867 (yyval
.range
)->max
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
;
1874 if((yyvsp
[(2) - (3)].value
)->type
!= integervalue
)
1875 error_message("Non-integer used in limit");
1876 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1877 (yyval
.range
)->min
= (yyvsp
[(2) - (3)].value
)->u
.integervalue
;
1878 (yyval
.range
)->max
= (yyvsp
[(2) - (3)].value
)->u
.integervalue
;
1885 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
,
1886 TE_EXPLICIT
, new_type(TInteger
));
1893 (yyval
.type
) = new_type(TInteger
);
1894 (yyval
.type
)->range
= (yyvsp
[(2) - (2)].range
);
1895 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
, TE_EXPLICIT
, (yyval
.type
));
1902 (yyval
.type
) = new_type(TInteger
);
1903 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
1904 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
, TE_EXPLICIT
, (yyval
.type
));
1911 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
1912 ASN1_TAILQ_INIT((yyval
.members
));
1913 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
1920 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
1921 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
1927 { (yyval
.members
) = (yyvsp
[(1) - (3)].members
); }
1933 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
1934 (yyval
.member
)->name
= (yyvsp
[(1) - (4)].name
);
1935 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (4)].name
));
1936 output_name ((yyval
.member
)->gen_name
);
1937 (yyval
.member
)->val
= (yyvsp
[(3) - (4)].constant
);
1938 (yyval
.member
)->optional
= 0;
1939 (yyval
.member
)->ellipsis
= 0;
1940 (yyval
.member
)->type
= NULL
;
1947 (yyval
.type
) = new_type(TInteger
);
1948 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
1949 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Enumerated
, TE_EXPLICIT
, (yyval
.type
));
1956 (yyval
.type
) = new_type(TBitString
);
1957 (yyval
.type
)->members
= emalloc(sizeof(*(yyval
.type
)->members
));
1958 ASN1_TAILQ_INIT((yyval
.type
)->members
);
1959 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BitString
, TE_EXPLICIT
, (yyval
.type
));
1966 (yyval
.type
) = new_type(TBitString
);
1967 (yyval
.type
)->members
= (yyvsp
[(4) - (5)].members
);
1968 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BitString
, TE_EXPLICIT
, (yyval
.type
));
1975 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_OID
,
1976 TE_EXPLICIT
, new_type(TOID
));
1983 Type
*t
= new_type(TOctetString
);
1984 t
->range
= (yyvsp
[(3) - (3)].range
);
1985 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_OctetString
,
1993 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Null
,
1994 TE_EXPLICIT
, new_type(TNull
));
2000 { (yyval
.range
) = NULL
; }
2005 { (yyval
.range
) = (yyvsp
[(2) - (2)].range
); }
2011 (yyval
.type
) = new_type(TSequence
);
2012 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2013 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2020 (yyval
.type
) = new_type(TSequence
);
2021 (yyval
.type
)->members
= NULL
;
2022 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2029 (yyval
.type
) = new_type(TSequenceOf
);
2030 (yyval
.type
)->range
= (yyvsp
[(2) - (4)].range
);
2031 (yyval
.type
)->subtype
= (yyvsp
[(4) - (4)].type
);
2032 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2039 (yyval
.type
) = new_type(TSet
);
2040 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2041 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2048 (yyval
.type
) = new_type(TSet
);
2049 (yyval
.type
)->members
= NULL
;
2050 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2057 (yyval
.type
) = new_type(TSetOf
);
2058 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
);
2059 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2066 (yyval
.type
) = new_type(TChoice
);
2067 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2074 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2075 (yyval
.type
) = new_type(TType
);
2076 if(s
->stype
!= Stype
&& s
->stype
!= SUndefined
)
2077 error_message ("%s is not a type\n", (yyvsp
[(1) - (1)].name
));
2079 (yyval
.type
)->symbol
= s
;
2086 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_GeneralizedTime
,
2087 TE_EXPLICIT
, new_type(TGeneralizedTime
));
2094 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UTCTime
,
2095 TE_EXPLICIT
, new_type(TUTCTime
));
2102 /* if (Constraint.type == contentConstrant) {
2103 assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
2104 if (Constraint.u.constraint.type) {
2105 assert((Constraint.u.constraint.type.length % 8) == 0);
2108 if (Constraint.u.constraint.encoding) {
2109 type == der-oid|ber-oid
2118 (yyval
.constraint_spec
) = (yyvsp
[(2) - (3)].constraint_spec
);
2125 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2126 (yyval
.constraint_spec
)->u
.content
.type
= (yyvsp
[(2) - (2)].type
);
2127 (yyval
.constraint_spec
)->u
.content
.encoding
= NULL
;
2134 if ((yyvsp
[(3) - (3)].value
)->type
!= objectidentifiervalue
)
2135 error_message("Non-OID used in ENCODED BY constraint");
2136 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2137 (yyval
.constraint_spec
)->u
.content
.type
= NULL
;
2138 (yyval
.constraint_spec
)->u
.content
.encoding
= (yyvsp
[(3) - (3)].value
);
2145 if ((yyvsp
[(5) - (5)].value
)->type
!= objectidentifiervalue
)
2146 error_message("Non-OID used in ENCODED BY constraint");
2147 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2148 (yyval
.constraint_spec
)->u
.content
.type
= (yyvsp
[(2) - (5)].type
);
2149 (yyval
.constraint_spec
)->u
.content
.encoding
= (yyvsp
[(5) - (5)].value
);
2156 (yyval
.constraint_spec
) = new_constraint_spec(CT_USER
);
2163 (yyval
.type
) = new_type(TTag
);
2164 (yyval
.type
)->tag
= (yyvsp
[(1) - (3)].tag
);
2165 (yyval
.type
)->tag
.tagenv
= (yyvsp
[(2) - (3)].constant
);
2166 if((yyvsp
[(3) - (3)].type
)->type
== TTag
&& (yyvsp
[(2) - (3)].constant
) == TE_IMPLICIT
) {
2167 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
)->subtype
;
2168 free((yyvsp
[(3) - (3)].type
));
2170 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
);
2177 (yyval
.tag
).tagclass
= (yyvsp
[(2) - (4)].constant
);
2178 (yyval
.tag
).tagvalue
= (yyvsp
[(3) - (4)].constant
);
2179 (yyval
.tag
).tagenv
= TE_EXPLICIT
;
2186 (yyval
.constant
) = ASN1_C_CONTEXT
;
2193 (yyval
.constant
) = ASN1_C_UNIV
;
2200 (yyval
.constant
) = ASN1_C_APPL
;
2207 (yyval
.constant
) = ASN1_C_PRIVATE
;
2214 (yyval
.constant
) = TE_EXPLICIT
;
2221 (yyval
.constant
) = TE_EXPLICIT
;
2228 (yyval
.constant
) = TE_IMPLICIT
;
2236 s
= addsym ((yyvsp
[(1) - (4)].name
));
2239 s
->value
= (yyvsp
[(4) - (4)].value
);
2240 generate_constant (s
);
2247 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_GeneralString
,
2248 TE_EXPLICIT
, new_type(TGeneralString
));
2255 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UTF8String
,
2256 TE_EXPLICIT
, new_type(TUTF8String
));
2263 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_PrintableString
,
2264 TE_EXPLICIT
, new_type(TPrintableString
));
2271 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_VisibleString
,
2272 TE_EXPLICIT
, new_type(TVisibleString
));
2279 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_IA5String
,
2280 TE_EXPLICIT
, new_type(TIA5String
));
2287 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BMPString
,
2288 TE_EXPLICIT
, new_type(TBMPString
));
2295 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UniversalString
,
2296 TE_EXPLICIT
, new_type(TUniversalString
));
2303 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
2304 ASN1_TAILQ_INIT((yyval
.members
));
2305 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
2312 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
2313 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2320 struct member
*m
= ecalloc(1, sizeof(*m
));
2321 m
->name
= estrdup("...");
2322 m
->gen_name
= estrdup("asn1_ellipsis");
2324 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), m
, members
);
2325 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2332 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
2333 (yyval
.member
)->name
= (yyvsp
[(1) - (2)].name
);
2334 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (2)].name
));
2335 output_name ((yyval
.member
)->gen_name
);
2336 (yyval
.member
)->type
= (yyvsp
[(2) - (2)].type
);
2337 (yyval
.member
)->ellipsis
= 0;
2344 (yyval
.member
) = (yyvsp
[(1) - (1)].member
);
2345 (yyval
.member
)->optional
= 0;
2346 (yyval
.member
)->defval
= NULL
;
2353 (yyval
.member
) = (yyvsp
[(1) - (2)].member
);
2354 (yyval
.member
)->optional
= 1;
2355 (yyval
.member
)->defval
= NULL
;
2362 (yyval
.member
) = (yyvsp
[(1) - (3)].member
);
2363 (yyval
.member
)->optional
= 0;
2364 (yyval
.member
)->defval
= (yyvsp
[(3) - (3)].value
);
2371 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
2372 ASN1_TAILQ_INIT((yyval
.members
));
2373 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
2380 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
2381 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2388 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
2389 (yyval
.member
)->name
= (yyvsp
[(1) - (4)].name
);
2390 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (4)].name
));
2391 output_name ((yyval
.member
)->gen_name
);
2392 (yyval
.member
)->val
= (yyvsp
[(3) - (4)].constant
);
2393 (yyval
.member
)->optional
= 0;
2394 (yyval
.member
)->ellipsis
= 0;
2395 (yyval
.member
)->type
= NULL
;
2401 { (yyval
.objid
) = NULL
; }
2407 (yyval
.objid
) = (yyvsp
[(2) - (3)].objid
);
2414 (yyval
.objid
) = NULL
;
2421 if ((yyvsp
[(2) - (2)].objid
)) {
2422 (yyval
.objid
) = (yyvsp
[(2) - (2)].objid
);
2423 add_oid_to_tail((yyvsp
[(2) - (2)].objid
), (yyvsp
[(1) - (2)].objid
));
2425 (yyval
.objid
) = (yyvsp
[(1) - (2)].objid
);
2433 (yyval
.objid
) = new_objid((yyvsp
[(1) - (4)].name
), (yyvsp
[(3) - (4)].constant
));
2440 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2441 if(s
->stype
!= SValue
||
2442 s
->value
->type
!= objectidentifiervalue
) {
2443 error_message("%s is not an object identifier\n",
2447 (yyval
.objid
) = s
->value
->u
.objectidentifiervalue
;
2454 (yyval
.objid
) = new_objid(NULL
, (yyvsp
[(1) - (1)].constant
));
2461 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2462 if(s
->stype
!= SValue
)
2463 error_message ("%s is not a value\n",
2466 (yyval
.value
) = s
->value
;
2473 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2474 (yyval
.value
)->type
= stringvalue
;
2475 (yyval
.value
)->u
.stringvalue
= (yyvsp
[(1) - (1)].name
);
2482 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2483 (yyval
.value
)->type
= booleanvalue
;
2484 (yyval
.value
)->u
.booleanvalue
= 0;
2491 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2492 (yyval
.value
)->type
= booleanvalue
;
2493 (yyval
.value
)->u
.booleanvalue
= 0;
2500 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2501 (yyval
.value
)->type
= integervalue
;
2502 (yyval
.value
)->u
.integervalue
= (yyvsp
[(1) - (1)].constant
);
2515 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2516 (yyval
.value
)->type
= objectidentifiervalue
;
2517 (yyval
.value
)->u
.objectidentifiervalue
= (yyvsp
[(1) - (1)].objid
);
2522 /* Line 1267 of yacc.c. */
2523 #line 2523 "parse.c"
2526 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2530 YY_STACK_PRINT (yyss
, yyssp
);
2535 /* Now `shift' the result of the reduction. Determine what state
2536 that goes to, based on the state we popped back to and the rule
2537 number reduced by. */
2541 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2542 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2543 yystate
= yytable
[yystate
];
2545 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2550 /*------------------------------------.
2551 | yyerrlab -- here on detecting error |
2552 `------------------------------------*/
2554 /* If not already recovering from an error, report this error. */
2558 #if ! YYERROR_VERBOSE
2559 yyerror (YY_("syntax error"));
2562 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2563 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2565 YYSIZE_T yyalloc
= 2 * yysize
;
2566 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2567 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2568 if (yymsg
!= yymsgbuf
)
2569 YYSTACK_FREE (yymsg
);
2570 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2572 yymsg_alloc
= yyalloc
;
2576 yymsg_alloc
= sizeof yymsgbuf
;
2580 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2582 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2587 yyerror (YY_("syntax error"));
2589 goto yyexhaustedlab
;
2597 if (yyerrstatus
== 3)
2599 /* If just tried and failed to reuse look-ahead token after an
2600 error, discard it. */
2602 if (yychar
<= YYEOF
)
2604 /* Return failure if at end of input. */
2605 if (yychar
== YYEOF
)
2610 yydestruct ("Error: discarding",
2616 /* Else will try to reuse look-ahead token after shifting the error
2621 /*---------------------------------------------------.
2622 | yyerrorlab -- error raised explicitly by YYERROR. |
2623 `---------------------------------------------------*/
2626 /* Pacify compilers like GCC when the user code never invokes
2627 YYERROR and the label yyerrorlab therefore never appears in user
2629 if (/*CONSTCOND*/ 0)
2632 /* Do not reclaim the symbols of the rule which action triggered
2636 YY_STACK_PRINT (yyss
, yyssp
);
2641 /*-------------------------------------------------------------.
2642 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2643 `-------------------------------------------------------------*/
2645 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2649 yyn
= yypact
[yystate
];
2650 if (yyn
!= YYPACT_NINF
)
2653 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2661 /* Pop the current state because it cannot handle the error token. */
2666 yydestruct ("Error: popping",
2667 yystos
[yystate
], yyvsp
);
2670 YY_STACK_PRINT (yyss
, yyssp
);
2679 /* Shift the error token. */
2680 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2686 /*-------------------------------------.
2687 | yyacceptlab -- YYACCEPT comes here. |
2688 `-------------------------------------*/
2693 /*-----------------------------------.
2694 | yyabortlab -- YYABORT comes here. |
2695 `-----------------------------------*/
2701 /*-------------------------------------------------.
2702 | yyexhaustedlab -- memory exhaustion comes here. |
2703 `-------------------------------------------------*/
2705 yyerror (YY_("memory exhausted"));
2711 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2712 yydestruct ("Cleanup: discarding lookahead",
2714 /* Do not reclaim the symbols of the rule which action triggered
2715 this YYABORT or YYACCEPT. */
2717 YY_STACK_PRINT (yyss
, yyssp
);
2718 while (yyssp
!= yyss
)
2720 yydestruct ("Cleanup: popping",
2721 yystos
[*yyssp
], yyvsp
);
2726 YYSTACK_FREE (yyss
);
2729 if (yymsg
!= yymsgbuf
)
2730 YYSTACK_FREE (yymsg
);
2732 /* Make sure YYID is used. */
2733 return YYID (yyresult
);
2741 yyerror (const char *s
)
2743 error_message ("%s\n", s
);
2747 new_tag(int tagclass
, int tagvalue
, int tagenv
, Type
*oldtype
)
2750 if(oldtype
->type
== TTag
&& oldtype
->tag
.tagenv
== TE_IMPLICIT
) {
2752 oldtype
= oldtype
->subtype
; /* XXX */
2754 t
= new_type (TTag
);
2756 t
->tag
.tagclass
= tagclass
;
2757 t
->tag
.tagvalue
= tagvalue
;
2758 t
->tag
.tagenv
= tagenv
;
2759 t
->subtype
= oldtype
;
2763 static struct objid
*
2764 new_objid(const char *label
, int value
)
2767 s
= emalloc(sizeof(*s
));
2775 add_oid_to_tail(struct objid
*head
, struct objid
*tail
)
2785 new_type (Typetype tt
)
2787 Type
*t
= ecalloc(1, sizeof(*t
));
2792 static struct constraint_spec
*
2793 new_constraint_spec(enum ctype ct
)
2795 struct constraint_spec
*c
= ecalloc(1, sizeof(*c
));
2800 static void fix_labels2(Type
*t
, const char *prefix
);
2801 static void fix_labels1(struct memhead
*members
, const char *prefix
)
2807 ASN1_TAILQ_FOREACH(m
, members
, members
) {
2808 asprintf(&m
->label
, "%s_%s", prefix
, m
->gen_name
);
2809 if (m
->label
== NULL
)
2812 fix_labels2(m
->type
, m
->label
);
2816 static void fix_labels2(Type
*t
, const char *prefix
)
2818 for(; t
; t
= t
->subtype
)
2819 fix_labels1(t
->members
, prefix
);
2823 fix_labels(Symbol
*s
)
2826 asprintf(&p
, "choice_%s", s
->gen_name
);
2829 fix_labels2(s
->type
, p
);