2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 38 "asn1parse.c"
86 static Type
*new_type (Typetype t
);
87 static struct constraint_spec
*new_constraint_spec(enum ctype
);
88 static Type
*new_tag(int tagclass
, int tagvalue
, int tagenv
, Type
*oldtype
);
89 void yyerror (const char *);
90 static struct objid
*new_objid(const char *label
, int value
);
91 static void add_oid_to_tail(struct objid
*, struct objid
*);
92 static void fix_labels(Symbol
*s
);
96 struct string_list
*next
;
99 /* Declarations for Bison */
100 #define YYMALLOC malloc
105 /* Line 189 of yacc.c */
106 #line 107 "asn1parse.c"
108 /* Enabling traces. */
113 /* Enabling verbose error messages. */
114 #ifdef YYERROR_VERBOSE
115 # undef YYERROR_VERBOSE
116 # define YYERROR_VERBOSE 1
118 # define YYERROR_VERBOSE 0
121 /* Enabling the token table. */
122 #ifndef YYTOKEN_TABLE
123 # define YYTOKEN_TABLE 0
130 /* Put the tokens into the symbol table, so that GDB and other debuggers
134 kw_ABSTRACT_SYNTAX
= 259,
136 kw_APPLICATION
= 261,
148 kw_CONSTRAINED
= 273,
151 kw_DEFINITIONS
= 276,
159 kw_EXTENSIBILITY
= 284,
163 kw_GeneralString
= 288,
164 kw_GeneralizedTime
= 289,
165 kw_GraphicString
= 290,
174 kw_INTERSECTION
= 299,
175 kw_ISO646String
= 300,
178 kw_MINUS_INFINITY
= 303,
180 kw_NumericString
= 305,
185 kw_ObjectDescriptor
= 310,
188 kw_PLUS_INFINITY
= 313,
191 kw_PrintableString
= 316,
193 kw_RELATIVE_OID
= 318,
202 kw_TYPE_IDENTIFIER
= 327,
203 kw_TeletexString
= 328,
209 kw_UniversalString
= 334,
210 kw_VideotexString
= 335,
211 kw_VisibleString
= 336,
223 #define kw_ABSENT 258
224 #define kw_ABSTRACT_SYNTAX 259
226 #define kw_APPLICATION 261
227 #define kw_AUTOMATIC 262
230 #define kw_BMPString 265
231 #define kw_BOOLEAN 266
233 #define kw_CHARACTER 268
234 #define kw_CHOICE 269
236 #define kw_COMPONENT 271
237 #define kw_COMPONENTS 272
238 #define kw_CONSTRAINED 273
239 #define kw_CONTAINING 274
240 #define kw_DEFAULT 275
241 #define kw_DEFINITIONS 276
242 #define kw_EMBEDDED 277
243 #define kw_ENCODED 278
245 #define kw_ENUMERATED 280
246 #define kw_EXCEPT 281
247 #define kw_EXPLICIT 282
248 #define kw_EXPORTS 283
249 #define kw_EXTENSIBILITY 284
250 #define kw_EXTERNAL 285
253 #define kw_GeneralString 288
254 #define kw_GeneralizedTime 289
255 #define kw_GraphicString 290
256 #define kw_IA5String 291
257 #define kw_IDENTIFIER 292
258 #define kw_IMPLICIT 293
259 #define kw_IMPLIED 294
260 #define kw_IMPORTS 295
261 #define kw_INCLUDES 296
262 #define kw_INSTANCE 297
263 #define kw_INTEGER 298
264 #define kw_INTERSECTION 299
265 #define kw_ISO646String 300
268 #define kw_MINUS_INFINITY 303
270 #define kw_NumericString 305
271 #define kw_OBJECT 306
274 #define kw_OPTIONAL 309
275 #define kw_ObjectDescriptor 310
276 #define kw_PATTERN 311
278 #define kw_PLUS_INFINITY 313
279 #define kw_PRESENT 314
280 #define kw_PRIVATE 315
281 #define kw_PrintableString 316
283 #define kw_RELATIVE_OID 318
284 #define kw_SEQUENCE 319
287 #define kw_STRING 322
288 #define kw_SYNTAX 323
289 #define kw_T61String 324
292 #define kw_TYPE_IDENTIFIER 327
293 #define kw_TeletexString 328
295 #define kw_UNIQUE 330
296 #define kw_UNIVERSAL 331
297 #define kw_UTCTime 332
298 #define kw_UTF8String 333
299 #define kw_UniversalString 334
300 #define kw_VideotexString 335
301 #define kw_VisibleString 336
306 #define IDENTIFIER 341
307 #define referencename 342
314 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
315 typedef union YYSTYPE
318 /* Line 214 of yacc.c */
319 #line 71 "asn1parse.c"
329 struct string_list
*sl
;
331 struct memhead
*members
;
332 struct constraint_spec
*constraint_spec
;
336 /* Line 214 of yacc.c */
337 #line 338 "asn1parse.c"
339 # define YYSTYPE_IS_TRIVIAL 1
340 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
341 # define YYSTYPE_IS_DECLARED 1
345 /* Copy the second part of user declarations. */
348 /* Line 264 of yacc.c */
349 #line 350 "asn1parse.c"
356 typedef YYTYPE_UINT8 yytype_uint8
;
358 typedef unsigned char yytype_uint8
;
362 typedef YYTYPE_INT8 yytype_int8
;
363 #elif (defined __STDC__ || defined __C99__FUNC__ \
364 || defined __cplusplus || defined _MSC_VER)
365 typedef signed char yytype_int8
;
367 typedef short int yytype_int8
;
371 typedef YYTYPE_UINT16 yytype_uint16
;
373 typedef unsigned short int yytype_uint16
;
377 typedef YYTYPE_INT16 yytype_int16
;
379 typedef short int yytype_int16
;
383 # ifdef __SIZE_TYPE__
384 # define YYSIZE_T __SIZE_TYPE__
385 # elif defined size_t
386 # define YYSIZE_T size_t
387 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
388 || defined __cplusplus || defined _MSC_VER)
389 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
390 # define YYSIZE_T size_t
392 # define YYSIZE_T unsigned int
396 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
401 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
402 # define YY_(msgid) dgettext ("bison-runtime", msgid)
406 # define YY_(msgid) msgid
410 /* Suppress unused-variable warnings by "using" E. */
411 #if ! defined lint || defined __GNUC__
412 # define YYUSE(e) ((void) (e))
414 # define YYUSE(e) /* empty */
417 /* Identity function, used to suppress warnings about constant conditions. */
421 #if (defined __STDC__ || defined __C99__FUNC__ \
422 || defined __cplusplus || defined _MSC_VER)
435 #if ! defined yyoverflow || YYERROR_VERBOSE
437 /* The parser invokes alloca or malloc; define the necessary symbols. */
439 # ifdef YYSTACK_USE_ALLOCA
440 # if YYSTACK_USE_ALLOCA
442 # define YYSTACK_ALLOC __builtin_alloca
443 # elif defined __BUILTIN_VA_ARG_INCR
444 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
446 # define YYSTACK_ALLOC __alloca
447 # elif defined _MSC_VER
448 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
449 # define alloca _alloca
451 # define YYSTACK_ALLOC alloca
452 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
453 || defined __cplusplus || defined _MSC_VER)
454 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
463 # ifdef YYSTACK_ALLOC
464 /* Pacify GCC's `empty if-body' warning. */
465 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
466 # ifndef YYSTACK_ALLOC_MAXIMUM
467 /* The OS might guarantee only one guard page at the bottom of the stack,
468 and a page size can be as small as 4096 bytes. So we cannot safely
469 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
470 to allow for a few compiler-allocated temporary stack slots. */
471 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
474 # define YYSTACK_ALLOC YYMALLOC
475 # define YYSTACK_FREE YYFREE
476 # ifndef YYSTACK_ALLOC_MAXIMUM
477 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
479 # if (defined __cplusplus && ! defined _STDLIB_H \
480 && ! ((defined YYMALLOC || defined malloc) \
481 && (defined YYFREE || defined free)))
482 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
488 # define YYMALLOC malloc
489 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
490 || defined __cplusplus || defined _MSC_VER)
491 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
496 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
497 || defined __cplusplus || defined _MSC_VER)
498 void free (void *); /* INFRINGES ON USER NAME SPACE */
502 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
505 #if (! defined yyoverflow \
506 && (! defined __cplusplus \
507 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
509 /* A type that is properly aligned for any stack member. */
512 yytype_int16 yyss_alloc
;
516 /* The size of the maximum gap between one aligned stack and the next. */
517 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
519 /* The size of an array large to enough to hold all stacks, each with
521 # define YYSTACK_BYTES(N) \
522 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
523 + YYSTACK_GAP_MAXIMUM)
525 /* Copy COUNT objects from FROM to TO. The source and destination do
528 # if defined __GNUC__ && 1 < __GNUC__
529 # define YYCOPY(To, From, Count) \
530 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
532 # define YYCOPY(To, From, Count) \
536 for (yyi = 0; yyi < (Count); yyi++) \
537 (To)[yyi] = (From)[yyi]; \
543 /* Relocate STACK from its old location to the new one. The
544 local variables YYSIZE and YYSTACKSIZE give the old and new number of
545 elements in the stack, and YYPTR gives the new location of the
546 stack. Advance YYPTR to a properly aligned location for the next
548 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
551 YYSIZE_T yynewbytes; \
552 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
553 Stack = &yyptr->Stack_alloc; \
554 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
555 yyptr += yynewbytes / sizeof (*yyptr); \
561 /* YYFINAL -- State number of the termination state. */
563 /* YYLAST -- Last index in YYTABLE. */
566 /* YYNTOKENS -- Number of terminals. */
568 /* YYNNTS -- Number of nonterminals. */
570 /* YYNRULES -- Number of rules. */
572 /* YYNRULES -- Number of states. */
573 #define YYNSTATES 220
575 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
577 #define YYMAXUTOK 344
579 #define YYTRANSLATE(YYX) \
580 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
582 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
583 static const yytype_uint8 yytranslate
[] =
585 0, 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 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
611 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
612 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
613 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
614 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
615 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
616 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
617 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
618 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
623 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
625 static const yytype_uint16 yyprhs
[] =
627 0, 0, 3, 13, 16, 19, 22, 23, 26, 27,
628 31, 32, 36, 37, 39, 40, 42, 45, 50, 54,
629 57, 58, 60, 63, 65, 67, 71, 73, 77, 79,
630 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
631 101, 103, 105, 107, 109, 111, 113, 119, 125, 131,
632 135, 137, 140, 145, 147, 151, 155, 160, 165, 167,
633 170, 176, 179, 183, 185, 186, 189, 194, 198, 203,
634 208, 212, 216, 221, 223, 225, 227, 229, 231, 234,
635 238, 240, 242, 244, 247, 251, 257, 262, 266, 271,
636 272, 274, 276, 278, 279, 281, 283, 288, 290, 292,
637 294, 296, 298, 300, 302, 304, 306, 308, 312, 316,
638 319, 321, 324, 328, 330, 334, 339, 341, 342, 346,
639 347, 350, 355, 357, 359, 361, 363, 365, 367, 369,
640 371, 373, 375, 377, 379, 381, 383, 385, 387, 389,
644 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
645 static const yytype_int16 yyrhs
[] =
647 99, 0, -1, 86, 152, 21, 100, 101, 84, 8,
648 102, 24, -1, 27, 70, -1, 38, 70, -1, 7,
649 70, -1, -1, 29, 39, -1, -1, 107, 103, 108,
650 -1, -1, 40, 104, 90, -1, -1, 105, -1, -1,
651 106, -1, 105, 106, -1, 110, 32, 86, 152, -1,
652 28, 110, 90, -1, 28, 5, -1, -1, 109, -1,
653 109, 108, -1, 111, -1, 144, -1, 86, 91, 110,
654 -1, 86, -1, 86, 84, 112, -1, 113, -1, 131,
655 -1, 134, -1, 121, -1, 114, -1, 145, -1, 130,
656 -1, 119, -1, 116, -1, 124, -1, 122, -1, 123,
657 -1, 126, -1, 127, -1, 128, -1, 129, -1, 140,
658 -1, 11, -1, 92, 156, 83, 156, 93, -1, 92,
659 156, 83, 46, 93, -1, 92, 47, 83, 156, 93,
660 -1, 92, 156, 93, -1, 43, -1, 43, 115, -1,
661 43, 94, 117, 95, -1, 118, -1, 117, 91, 118,
662 -1, 117, 91, 85, -1, 86, 92, 164, 93, -1,
663 25, 94, 120, 95, -1, 117, -1, 9, 67, -1,
664 9, 67, 94, 150, 95, -1, 51, 37, -1, 52,
665 67, 125, -1, 49, -1, -1, 66, 115, -1, 64,
666 94, 147, 95, -1, 64, 94, 95, -1, 64, 125,
667 53, 112, -1, 65, 94, 147, 95, -1, 65, 94,
668 95, -1, 65, 53, 112, -1, 14, 94, 147, 95,
669 -1, 132, -1, 133, -1, 86, -1, 34, -1, 77,
670 -1, 112, 135, -1, 92, 136, 93, -1, 137, -1,
671 138, -1, 139, -1, 19, 112, -1, 23, 12, 156,
672 -1, 19, 112, 23, 12, 156, -1, 18, 12, 94,
673 95, -1, 141, 143, 112, -1, 96, 142, 89, 97,
674 -1, -1, 76, -1, 6, -1, 60, -1, -1, 27,
675 -1, 38, -1, 86, 112, 84, 156, -1, 146, -1,
676 33, -1, 73, -1, 78, -1, 61, -1, 81, -1,
677 36, -1, 10, -1, 79, -1, 149, -1, 147, 91,
678 149, -1, 147, 91, 85, -1, 86, 112, -1, 148,
679 -1, 148, 54, -1, 148, 20, 156, -1, 151, -1,
680 150, 91, 151, -1, 86, 92, 89, 93, -1, 153,
681 -1, -1, 94, 154, 95, -1, -1, 155, 154, -1,
682 86, 92, 89, 93, -1, 86, -1, 89, -1, 157,
683 -1, 158, -1, 162, -1, 161, -1, 163, -1, 166,
684 -1, 165, -1, 159, -1, 160, -1, 86, -1, 88,
685 -1, 71, -1, 31, -1, 164, -1, 89, -1, 49,
689 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
690 static const yytype_uint16 yyrline
[] =
692 0, 239, 239, 246, 247, 249, 251, 254, 256, 259,
693 260, 263, 264, 267, 268, 271, 272, 275, 287, 293,
694 294, 297, 298, 301, 302, 305, 311, 319, 329, 330,
695 331, 334, 335, 336, 337, 338, 339, 340, 341, 342,
696 343, 344, 345, 346, 347, 350, 357, 367, 375, 383,
697 394, 399, 405, 413, 419, 424, 428, 441, 449, 452,
698 459, 467, 473, 482, 490, 491, 496, 502, 510, 519,
699 525, 533, 541, 548, 549, 552, 563, 568, 575, 591,
700 597, 600, 601, 604, 610, 618, 628, 634, 647, 656,
701 659, 663, 667, 674, 677, 681, 688, 699, 702, 707,
702 712, 717, 722, 727, 732, 737, 745, 751, 756, 767,
703 778, 784, 790, 798, 804, 811, 824, 825, 828, 835,
704 838, 849, 853, 864, 870, 871, 874, 875, 876, 877,
705 878, 881, 884, 887, 898, 906, 912, 920, 928, 931,
710 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
711 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
712 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
713 static const char *const yytname
[] =
715 "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
716 "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
717 "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
718 "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
719 "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
720 "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
721 "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
722 "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
723 "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
724 "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
725 "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
726 "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
727 "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
728 "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
729 "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
730 "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
731 "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
732 "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
733 "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
734 "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
735 "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
736 "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
737 "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
738 "SymbolsFromModule", "Exports", "AssignmentList", "Assignment",
739 "referencenames", "TypeAssignment", "Type", "BuiltinType", "BooleanType",
740 "range", "IntegerType", "NamedNumberList", "NamedNumber",
741 "EnumeratedType", "Enumerations", "BitStringType",
742 "ObjectIdentifierType", "OctetStringType", "NullType", "size",
743 "SequenceType", "SequenceOfType", "SetType", "SetOfType", "ChoiceType",
744 "ReferencedType", "DefinedType", "UsefulType", "ConstrainedType",
745 "Constraint", "ConstraintSpec", "GeneralConstraint",
746 "ContentsConstraint", "UserDefinedConstraint", "TaggedType", "Tag",
747 "Class", "tagenv", "ValueAssignment", "CharacterStringType",
748 "RestrictedCharactedStringType", "ComponentTypeList", "NamedType",
749 "ComponentType", "NamedBitList", "NamedBit", "objid_opt", "objid",
750 "objid_list", "objid_element", "Value", "BuiltinValue",
751 "ReferencedValue", "DefinedValue", "Valuereference",
752 "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
753 "NullValue", "ObjectIdentifierValue", 0
758 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
760 static const yytype_uint16 yytoknum
[] =
762 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
763 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
764 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
765 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
766 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
767 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
768 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
769 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
770 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
771 59, 44, 40, 41, 123, 125, 91, 93
775 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
776 static const yytype_uint8 yyr1
[] =
778 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
779 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
780 107, 108, 108, 109, 109, 110, 110, 111, 112, 112,
781 112, 113, 113, 113, 113, 113, 113, 113, 113, 113,
782 113, 113, 113, 113, 113, 114, 115, 115, 115, 115,
783 116, 116, 116, 117, 117, 117, 118, 119, 120, 121,
784 121, 122, 123, 124, 125, 125, 126, 126, 127, 128,
785 128, 129, 130, 131, 131, 132, 133, 133, 134, 135,
786 136, 137, 137, 138, 138, 138, 139, 140, 141, 142,
787 142, 142, 142, 143, 143, 143, 144, 145, 146, 146,
788 146, 146, 146, 146, 146, 146, 147, 147, 147, 148,
789 149, 149, 149, 150, 150, 151, 152, 152, 153, 154,
790 154, 155, 155, 155, 156, 156, 157, 157, 157, 157,
791 157, 158, 159, 160, 161, 162, 162, 163, 164, 165,
795 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
796 static const yytype_uint8 yyr2
[] =
798 0, 2, 9, 2, 2, 2, 0, 2, 0, 3,
799 0, 3, 0, 1, 0, 1, 2, 4, 3, 2,
800 0, 1, 2, 1, 1, 3, 1, 3, 1, 1,
801 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
802 1, 1, 1, 1, 1, 1, 5, 5, 5, 3,
803 1, 2, 4, 1, 3, 3, 4, 4, 1, 2,
804 5, 2, 3, 1, 0, 2, 4, 3, 4, 4,
805 3, 3, 4, 1, 1, 1, 1, 1, 2, 3,
806 1, 1, 1, 2, 3, 5, 4, 3, 4, 0,
807 1, 1, 1, 0, 1, 1, 4, 1, 1, 1,
808 1, 1, 1, 1, 1, 1, 1, 3, 3, 2,
809 1, 2, 3, 1, 3, 4, 1, 0, 3, 0,
810 2, 4, 1, 1, 1, 1, 1, 1, 1, 1,
811 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
815 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
816 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
817 means the default is an error. */
818 static const yytype_uint8 yydefact
[] =
820 0, 117, 0, 119, 0, 116, 1, 122, 123, 0,
821 119, 6, 0, 118, 120, 0, 0, 0, 8, 0,
822 5, 3, 4, 0, 0, 121, 7, 0, 20, 0,
823 0, 12, 19, 26, 0, 2, 14, 0, 0, 18,
824 0, 13, 15, 0, 0, 9, 21, 23, 24, 25,
825 11, 16, 0, 0, 104, 45, 0, 0, 98, 76,
826 103, 50, 63, 0, 0, 101, 64, 0, 99, 77,
827 100, 105, 102, 0, 75, 89, 0, 28, 32, 36,
828 35, 31, 38, 39, 37, 40, 41, 42, 43, 34,
829 29, 73, 74, 30, 44, 93, 33, 97, 22, 117,
830 59, 0, 0, 0, 0, 51, 61, 64, 0, 0,
831 0, 0, 0, 27, 91, 92, 90, 0, 0, 0,
832 78, 94, 95, 0, 17, 0, 0, 0, 110, 106,
833 0, 58, 53, 0, 136, 0, 139, 135, 133, 134,
834 138, 140, 0, 124, 125, 131, 132, 127, 126, 128,
835 137, 130, 129, 0, 62, 65, 67, 0, 0, 71,
836 70, 0, 0, 96, 0, 0, 0, 0, 80, 81,
837 82, 87, 0, 0, 113, 109, 0, 72, 0, 111,
838 0, 0, 57, 0, 0, 49, 52, 66, 68, 69,
839 88, 0, 83, 0, 79, 0, 0, 60, 108, 107,
840 112, 0, 55, 54, 0, 0, 0, 0, 0, 84,
841 0, 114, 56, 48, 47, 46, 86, 0, 115, 85
844 /* YYDEFGOTO[NTERM-NUM]. */
845 static const yytype_int16 yydefgoto
[] =
847 -1, 2, 18, 24, 30, 37, 40, 41, 42, 31,
848 45, 46, 43, 47, 76, 77, 78, 105, 79, 131,
849 132, 80, 133, 81, 82, 83, 84, 110, 85, 86,
850 87, 88, 89, 90, 91, 92, 93, 120, 167, 168,
851 169, 170, 94, 95, 117, 123, 48, 96, 97, 127,
852 128, 129, 173, 174, 4, 141, 9, 10, 142, 143,
853 144, 145, 146, 147, 148, 149, 150, 151, 152
856 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
858 #define YYPACT_NINF -119
859 static const yytype_int16 yypact
[] =
861 -43, -56, 47, -65, 29, -119, -119, -31, -119, -25,
862 -65, 4, -1, -119, -119, 17, 20, 26, 50, 13,
863 -119, -119, -119, 63, 24, -119, -119, 104, 8, -2,
864 89, 74, -119, 33, 25, -119, 34, 39, 34, -119,
865 37, 34, -119, 98, 58, -119, 39, -119, -119, -119,
866 -119, -119, 52, 66, -119, -119, 51, 53, -119, -119,
867 -119, -79, -119, 109, 81, -119, -60, -48, -119, -119,
868 -119, -119, -119, 107, -119, 2, -74, -119, -119, -119,
869 -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
870 -119, -119, -119, -119, -119, -18, -119, -119, -119, -56,
871 55, 65, 67, -12, 67, -119, -119, 86, 68, -70,
872 102, 107, -69, 69, -119, -119, -119, 73, 40, 10,
873 -119, -119, -119, 107, -119, 71, 107, -47, -13, -119,
874 72, 75, -119, 70, -119, 80, -119, -119, -119, -119,
875 -119, -119, -71, -119, -119, -119, -119, -119, -119, -119,
876 -119, -119, -119, -46, -119, -119, -119, -39, 107, 69,
877 -119, -38, 76, -119, 155, 107, 157, 77, -119, -119,
878 -119, 69, 82, -10, -119, 69, -22, -119, 40, -119,
879 87, 19, -119, 40, 9, -119, -119, -119, 69, -119,
880 -119, 83, -19, 40, -119, 90, 71, -119, -119, -119,
881 -119, 85, -119, -119, 88, 94, 96, 95, 163, -119,
882 99, -119, -119, -119, -119, -119, -119, 40, -119, -119
885 /* YYPGOTO[NTERM-NUM]. */
886 static const yytype_int16 yypgoto
[] =
888 -119, -119, -119, -119, -119, -119, -119, -119, 141, -119,
889 137, -119, -15, -119, -72, -119, -119, 91, -119, 92,
890 14, -119, -119, -119, -119, -119, -119, 84, -119, -119,
891 -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
892 -119, -119, -119, -119, -119, -119, -119, -119, -119, -82,
893 -119, 18, -119, 5, 101, 1, 187, -119, -118, -119,
894 -119, -119, -119, -119, -119, -119, 22, -119, -119
897 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
898 positive, shift that token. If negative, reduce the rule which
899 number is the opposite. If zero, do what YYDEFACT says.
900 If YYTABLE_NINF, syntax error. */
901 #define YYTABLE_NINF -11
902 static const yytype_int16 yytable
[] =
904 163, 113, 5, 32, 208, 111, 108, 178, 114, 121,
905 118, 15, 184, 103, 34, 104, 126, 126, 119, 134,
906 122, 7, 185, 49, 8, 156, 160, 157, 164, 165,
907 161, 16, -10, 166, 109, 135, 29, 136, 3, 159,
908 134, 179, 17, 1, 176, 181, 112, 6, 177, 186,
909 11, 171, 176, 176, 175, 205, 187, 189, 136, 137,
910 200, 12, 115, 198, 126, 204, 206, 53, 54, 55,
911 13, 134, 56, 119, 138, 209, 139, 140, 116, 23,
912 137, 196, 3, 57, 33, 197, 188, 20, 19, 136,
913 21, 58, 59, 192, 60, 138, 22, 139, 140, 219,
914 5, 61, 26, 3, 202, 130, 25, 62, 27, 63,
915 64, 137, 28, 35, 36, 39, 53, 54, 55, 65,
916 33, 56, 66, 67, 38, 44, 138, 50, 139, 140,
917 52, 68, 57, 100, 3, 69, 70, 71, 99, 72,
918 58, 59, 73, 60, 74, 101, 106, 102, 107, 125,
919 61, 126, 108, 130, 75, 158, 62, 172, 63, 64,
920 103, 119, 162, 183, 180, 182, 181, 191, 65, 193,
921 194, 66, 67, 190, 195, 217, 140, 207, 212, 210,
922 68, 213, 51, 98, 69, 70, 71, 214, 72, 215,
923 216, 154, 218, 74, 199, 203, 153, 14, 0, 155,
927 static const yytype_int16 yycheck
[] =
929 118, 73, 1, 5, 23, 53, 66, 20, 6, 27,
930 84, 7, 83, 92, 29, 94, 86, 86, 92, 31,
931 38, 86, 93, 38, 89, 95, 95, 109, 18, 19,
932 112, 27, 24, 23, 94, 47, 28, 49, 94, 111,
933 31, 54, 38, 86, 91, 91, 94, 0, 95, 95,
934 21, 123, 91, 91, 126, 46, 95, 95, 49, 71,
935 178, 92, 60, 85, 86, 183, 184, 9, 10, 11,
936 95, 31, 14, 92, 86, 193, 88, 89, 76, 29,
937 71, 91, 94, 25, 86, 95, 158, 70, 89, 49,
938 70, 33, 34, 165, 36, 86, 70, 88, 89, 217,
939 99, 43, 39, 94, 85, 86, 93, 49, 84, 51,
940 52, 71, 8, 24, 40, 90, 9, 10, 11, 61,
941 86, 14, 64, 65, 91, 86, 86, 90, 88, 89,
942 32, 73, 25, 67, 94, 77, 78, 79, 86, 81,
943 33, 34, 84, 36, 86, 94, 37, 94, 67, 94,
944 43, 86, 66, 86, 96, 53, 49, 86, 51, 52,
945 92, 92, 89, 83, 92, 95, 91, 12, 61, 12,
946 93, 64, 65, 97, 92, 12, 89, 94, 93, 89,
947 73, 93, 41, 46, 77, 78, 79, 93, 81, 93,
948 95, 107, 93, 86, 176, 181, 104, 10, -1, 108,
952 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
953 symbol of state STATE-NUM. */
954 static const yytype_uint8 yystos
[] =
956 0, 86, 99, 94, 152, 153, 0, 86, 89, 154,
957 155, 21, 92, 95, 154, 7, 27, 38, 100, 89,
958 70, 70, 70, 29, 101, 93, 39, 84, 8, 28,
959 102, 107, 5, 86, 110, 24, 40, 103, 91, 90,
960 104, 105, 106, 110, 86, 108, 109, 111, 144, 110,
961 90, 106, 32, 9, 10, 11, 14, 25, 33, 34,
962 36, 43, 49, 51, 52, 61, 64, 65, 73, 77,
963 78, 79, 81, 84, 86, 96, 112, 113, 114, 116,
964 119, 121, 122, 123, 124, 126, 127, 128, 129, 130,
965 131, 132, 133, 134, 140, 141, 145, 146, 108, 86,
966 67, 94, 94, 92, 94, 115, 37, 67, 66, 94,
967 125, 53, 94, 112, 6, 60, 76, 142, 84, 92,
968 135, 27, 38, 143, 152, 94, 86, 147, 148, 149,
969 86, 117, 118, 120, 31, 47, 49, 71, 86, 88,
970 89, 153, 156, 157, 158, 159, 160, 161, 162, 163,
971 164, 165, 166, 117, 125, 115, 95, 147, 53, 112,
972 95, 147, 89, 156, 18, 19, 23, 136, 137, 138,
973 139, 112, 86, 150, 151, 112, 91, 95, 20, 54,
974 92, 91, 95, 83, 83, 93, 95, 95, 112, 95,
975 97, 12, 112, 12, 93, 92, 91, 95, 85, 149,
976 156, 164, 85, 118, 156, 46, 156, 94, 23, 156,
977 89, 151, 93, 93, 93, 93, 95, 12, 93, 156
980 #define yyerrok (yyerrstatus = 0)
981 #define yyclearin (yychar = YYEMPTY)
985 #define YYACCEPT goto yyacceptlab
986 #define YYABORT goto yyabortlab
987 #define YYERROR goto yyerrorlab
990 /* Like YYERROR except do call yyerror. This remains here temporarily
991 to ease the transition to the new meaning of YYERROR, for GCC.
992 Once GCC version 2 has supplanted version 1, this can go. */
994 #define YYFAIL goto yyerrlab
996 #define YYRECOVERING() (!!yyerrstatus)
998 #define YYBACKUP(Token, Value) \
1000 if (yychar == YYEMPTY && yylen == 1) \
1004 yytoken = YYTRANSLATE (yychar); \
1010 yyerror (YY_("syntax error: cannot back up")); \
1017 #define YYERRCODE 256
1020 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1021 If N is 0, then set CURRENT to the empty location which ends
1022 the previous symbol: RHS[0] (always defined). */
1024 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1025 #ifndef YYLLOC_DEFAULT
1026 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1030 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1031 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1032 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1033 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1037 (Current).first_line = (Current).last_line = \
1038 YYRHSLOC (Rhs, 0).last_line; \
1039 (Current).first_column = (Current).last_column = \
1040 YYRHSLOC (Rhs, 0).last_column; \
1046 /* YY_LOCATION_PRINT -- Print the location on the stream.
1047 This macro was not mandated originally: define only if we know
1048 we won't break user code: when these are the locations we know. */
1050 #ifndef YY_LOCATION_PRINT
1051 # if YYLTYPE_IS_TRIVIAL
1052 # define YY_LOCATION_PRINT(File, Loc) \
1053 fprintf (File, "%d.%d-%d.%d", \
1054 (Loc).first_line, (Loc).first_column, \
1055 (Loc).last_line, (Loc).last_column)
1057 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1062 /* YYLEX -- calling `yylex' with the right arguments. */
1065 # define YYLEX yylex (YYLEX_PARAM)
1067 # define YYLEX yylex ()
1070 /* Enable debugging if requested. */
1074 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1075 # define YYFPRINTF fprintf
1078 # define YYDPRINTF(Args) \
1084 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1088 YYFPRINTF (stderr, "%s ", Title); \
1089 yy_symbol_print (stderr, \
1091 YYFPRINTF (stderr, "\n"); \
1096 /*--------------------------------.
1097 | Print this symbol on YYOUTPUT. |
1098 `--------------------------------*/
1101 #if (defined __STDC__ || defined __C99__FUNC__ \
1102 || defined __cplusplus || defined _MSC_VER)
1104 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1107 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
1110 YYSTYPE
const * const yyvaluep
;
1116 if (yytype
< YYNTOKENS
)
1117 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1129 /*--------------------------------.
1130 | Print this symbol on YYOUTPUT. |
1131 `--------------------------------*/
1133 #if (defined __STDC__ || defined __C99__FUNC__ \
1134 || defined __cplusplus || defined _MSC_VER)
1136 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1139 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
1142 YYSTYPE
const * const yyvaluep
;
1145 if (yytype
< YYNTOKENS
)
1146 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1148 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1150 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1151 YYFPRINTF (yyoutput
, ")");
1154 /*------------------------------------------------------------------.
1155 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1157 `------------------------------------------------------------------*/
1159 #if (defined __STDC__ || defined __C99__FUNC__ \
1160 || defined __cplusplus || defined _MSC_VER)
1162 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1165 yy_stack_print (yybottom
, yytop
)
1166 yytype_int16
*yybottom
;
1167 yytype_int16
*yytop
;
1170 YYFPRINTF (stderr
, "Stack now");
1171 for (; yybottom
<= yytop
; yybottom
++)
1173 int yybot
= *yybottom
;
1174 YYFPRINTF (stderr
, " %d", yybot
);
1176 YYFPRINTF (stderr
, "\n");
1179 # define YY_STACK_PRINT(Bottom, Top) \
1182 yy_stack_print ((Bottom), (Top)); \
1186 /*------------------------------------------------.
1187 | Report that the YYRULE is going to be reduced. |
1188 `------------------------------------------------*/
1190 #if (defined __STDC__ || defined __C99__FUNC__ \
1191 || defined __cplusplus || defined _MSC_VER)
1193 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
1196 yy_reduce_print (yyvsp
, yyrule
)
1201 int yynrhs
= yyr2
[yyrule
];
1203 unsigned long int yylno
= yyrline
[yyrule
];
1204 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1206 /* The symbols being reduced. */
1207 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1209 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1210 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1211 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1213 YYFPRINTF (stderr
, "\n");
1217 # define YY_REDUCE_PRINT(Rule) \
1220 yy_reduce_print (yyvsp, Rule); \
1223 /* Nonzero means print parse trace. It is left uninitialized so that
1224 multiple parsers can coexist. */
1226 #else /* !YYDEBUG */
1227 # define YYDPRINTF(Args)
1228 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1229 # define YY_STACK_PRINT(Bottom, Top)
1230 # define YY_REDUCE_PRINT(Rule)
1231 #endif /* !YYDEBUG */
1234 /* YYINITDEPTH -- initial size of the parser's stacks. */
1236 # define YYINITDEPTH 200
1239 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1240 if the built-in stack extension method is used).
1242 Do not make this value too large; the results are undefined if
1243 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1244 evaluated with infinite-precision integer arithmetic. */
1247 # define YYMAXDEPTH 10000
1255 # if defined __GLIBC__ && defined _STRING_H
1256 # define yystrlen strlen
1258 /* Return the length of YYSTR. */
1259 #if (defined __STDC__ || defined __C99__FUNC__ \
1260 || defined __cplusplus || defined _MSC_VER)
1262 yystrlen (const char *yystr
)
1270 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1278 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1279 # define yystpcpy stpcpy
1281 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1283 #if (defined __STDC__ || defined __C99__FUNC__ \
1284 || defined __cplusplus || defined _MSC_VER)
1286 yystpcpy (char *yydest
, const char *yysrc
)
1289 yystpcpy (yydest
, yysrc
)
1295 const char *yys
= yysrc
;
1297 while ((*yyd
++ = *yys
++) != '\0')
1306 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1307 quotes and backslashes, so that it's suitable for yyerror. The
1308 heuristic is that double-quoting is unnecessary unless the string
1309 contains an apostrophe, a comma, or backslash (other than
1310 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1311 null, do not copy; instead, return the length of what the result
1314 yytnamerr (char *yyres
, const char *yystr
)
1319 char const *yyp
= yystr
;
1326 goto do_not_strip_quotes
;
1330 goto do_not_strip_quotes
;
1343 do_not_strip_quotes
: ;
1347 return yystrlen (yystr
);
1349 return yystpcpy (yyres
, yystr
) - yyres
;
1353 /* Copy into YYRESULT an error message about the unexpected token
1354 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1355 including the terminating null byte. If YYRESULT is null, do not
1356 copy anything; just return the number of bytes that would be
1357 copied. As a special case, return 0 if an ordinary "syntax error"
1358 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1359 size calculation. */
1361 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1363 int yyn
= yypact
[yystate
];
1365 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1369 int yytype
= YYTRANSLATE (yychar
);
1370 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1371 YYSIZE_T yysize
= yysize0
;
1373 int yysize_overflow
= 0;
1374 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1375 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1379 /* This is so xgettext sees the translatable formats that are
1380 constructed on the fly. */
1381 YY_("syntax error, unexpected %s");
1382 YY_("syntax error, unexpected %s, expecting %s");
1383 YY_("syntax error, unexpected %s, expecting %s or %s");
1384 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1385 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1389 static char const yyunexpected
[] = "syntax error, unexpected %s";
1390 static char const yyexpecting
[] = ", expecting %s";
1391 static char const yyor
[] = " or %s";
1392 char yyformat
[sizeof yyunexpected
1393 + sizeof yyexpecting
- 1
1394 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1395 * (sizeof yyor
- 1))];
1396 char const *yyprefix
= yyexpecting
;
1398 /* Start YYX at -YYN if negative to avoid negative indexes in
1400 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1402 /* Stay within bounds of both yycheck and yytname. */
1403 int yychecklim
= YYLAST
- yyn
+ 1;
1404 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1407 yyarg
[0] = yytname
[yytype
];
1408 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1410 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1411 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1413 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1417 yyformat
[sizeof yyunexpected
- 1] = '\0';
1420 yyarg
[yycount
++] = yytname
[yyx
];
1421 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1422 yysize_overflow
|= (yysize1
< yysize
);
1424 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1428 yyf
= YY_(yyformat
);
1429 yysize1
= yysize
+ yystrlen (yyf
);
1430 yysize_overflow
|= (yysize1
< yysize
);
1433 if (yysize_overflow
)
1434 return YYSIZE_MAXIMUM
;
1438 /* Avoid sprintf, as that infringes on the user's name space.
1439 Don't have undefined behavior even if the translation
1440 produced a string with the wrong number of "%s"s. */
1441 char *yyp
= yyresult
;
1443 while ((*yyp
= *yyf
) != '\0')
1445 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1447 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1460 #endif /* YYERROR_VERBOSE */
1463 /*-----------------------------------------------.
1464 | Release the memory associated to this symbol. |
1465 `-----------------------------------------------*/
1468 #if (defined __STDC__ || defined __C99__FUNC__ \
1469 || defined __cplusplus || defined _MSC_VER)
1471 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1474 yydestruct (yymsg
, yytype
, yyvaluep
)
1484 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1494 /* Prevent warnings from -Wmissing-prototypes. */
1495 #ifdef YYPARSE_PARAM
1496 #if defined __STDC__ || defined __cplusplus
1497 int yyparse (void *YYPARSE_PARAM
);
1501 #else /* ! YYPARSE_PARAM */
1502 #if defined __STDC__ || defined __cplusplus
1507 #endif /* ! YYPARSE_PARAM */
1510 /* The lookahead symbol. */
1513 /* The semantic value of the lookahead symbol. */
1516 /* Number of syntax errors so far. */
1521 /*-------------------------.
1522 | yyparse or yypush_parse. |
1523 `-------------------------*/
1525 #ifdef YYPARSE_PARAM
1526 #if (defined __STDC__ || defined __C99__FUNC__ \
1527 || defined __cplusplus || defined _MSC_VER)
1529 yyparse (void *YYPARSE_PARAM
)
1532 yyparse (YYPARSE_PARAM
)
1533 void *YYPARSE_PARAM
;
1535 #else /* ! YYPARSE_PARAM */
1536 #if (defined __STDC__ || defined __C99__FUNC__ \
1537 || defined __cplusplus || defined _MSC_VER)
1550 /* Number of tokens to shift before error messages enabled. */
1553 /* The stacks and their tools:
1554 `yyss': related to states.
1555 `yyvs': related to semantic values.
1557 Refer to the stacks thru separate pointers, to allow yyoverflow
1558 to reallocate them elsewhere. */
1560 /* The state stack. */
1561 yytype_int16 yyssa
[YYINITDEPTH
];
1563 yytype_int16
*yyssp
;
1565 /* The semantic value stack. */
1566 YYSTYPE yyvsa
[YYINITDEPTH
];
1570 YYSIZE_T yystacksize
;
1574 /* Lookahead token as an internal (translated) token number. */
1576 /* The variables used to return semantic value and location from the
1581 /* Buffer for error messages, and its allocated size. */
1583 char *yymsg
= yymsgbuf
;
1584 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1587 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1589 /* The number of symbols on the RHS of the reduced rule.
1590 Keep to zero when no symbol should be popped. */
1596 yystacksize
= YYINITDEPTH
;
1598 YYDPRINTF ((stderr
, "Starting parse\n"));
1603 yychar
= YYEMPTY
; /* Cause a token to be read. */
1605 /* Initialize stack pointers.
1606 Waste one element of value and location stack
1607 so that they stay on the same level as the state stack.
1608 The wasted elements are never initialized. */
1614 /*------------------------------------------------------------.
1615 | yynewstate -- Push a new state, which is found in yystate. |
1616 `------------------------------------------------------------*/
1618 /* In all cases, when you get here, the value and location stacks
1619 have just been pushed. So pushing a state here evens the stacks. */
1625 if (yyss
+ yystacksize
- 1 <= yyssp
)
1627 /* Get the current used size of the three stacks, in elements. */
1628 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1632 /* Give user a chance to reallocate the stack. Use copies of
1633 these so that the &'s don't force the real ones into
1635 YYSTYPE
*yyvs1
= yyvs
;
1636 yytype_int16
*yyss1
= yyss
;
1638 /* Each stack pointer address is followed by the size of the
1639 data in use in that stack, in bytes. This used to be a
1640 conditional around just the two extra args, but that might
1641 be undefined if yyoverflow is a macro. */
1642 yyoverflow (YY_("memory exhausted"),
1643 &yyss1
, yysize
* sizeof (*yyssp
),
1644 &yyvs1
, yysize
* sizeof (*yyvsp
),
1650 #else /* no yyoverflow */
1651 # ifndef YYSTACK_RELOCATE
1652 goto yyexhaustedlab
;
1654 /* Extend the stack our own way. */
1655 if (YYMAXDEPTH
<= yystacksize
)
1656 goto yyexhaustedlab
;
1658 if (YYMAXDEPTH
< yystacksize
)
1659 yystacksize
= YYMAXDEPTH
;
1662 yytype_int16
*yyss1
= yyss
;
1663 union yyalloc
*yyptr
=
1664 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1666 goto yyexhaustedlab
;
1667 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1668 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1669 # undef YYSTACK_RELOCATE
1671 YYSTACK_FREE (yyss1
);
1674 #endif /* no yyoverflow */
1676 yyssp
= yyss
+ yysize
- 1;
1677 yyvsp
= yyvs
+ yysize
- 1;
1679 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1680 (unsigned long int) yystacksize
));
1682 if (yyss
+ yystacksize
- 1 <= yyssp
)
1686 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1688 if (yystate
== YYFINAL
)
1698 /* Do appropriate processing given the current state. Read a
1699 lookahead token if we need one and don't already have one. */
1701 /* First try to decide what to do without reference to lookahead token. */
1702 yyn
= yypact
[yystate
];
1703 if (yyn
== YYPACT_NINF
)
1706 /* Not known => get a lookahead token if don't already have one. */
1708 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1709 if (yychar
== YYEMPTY
)
1711 YYDPRINTF ((stderr
, "Reading a token: "));
1715 if (yychar
<= YYEOF
)
1717 yychar
= yytoken
= YYEOF
;
1718 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1722 yytoken
= YYTRANSLATE (yychar
);
1723 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1726 /* If the proper action on seeing token YYTOKEN is to reduce or to
1727 detect an error, take that action. */
1729 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1734 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1740 /* Count tokens shifted since error; after three, turn off error
1745 /* Shift the lookahead token. */
1746 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1748 /* Discard the shifted token. */
1757 /*-----------------------------------------------------------.
1758 | yydefault -- do the default action for the current state. |
1759 `-----------------------------------------------------------*/
1761 yyn
= yydefact
[yystate
];
1767 /*-----------------------------.
1768 | yyreduce -- Do a reduction. |
1769 `-----------------------------*/
1771 /* yyn is the number of a rule to reduce with. */
1774 /* If YYLEN is nonzero, implement the default value of the action:
1777 Otherwise, the following line sets YYVAL to garbage.
1778 This behavior is undocumented and Bison
1779 users should not rely upon it. Assigning to YYVAL
1780 unconditionally makes the parser a bit smaller, and it avoids a
1781 GCC warning that YYVAL may be used uninitialized. */
1782 yyval
= yyvsp
[1-yylen
];
1785 YY_REDUCE_PRINT (yyn
);
1790 /* Line 1455 of yacc.c */
1791 #line 241 "asn1parse.c"
1799 /* Line 1455 of yacc.c */
1800 #line 248 "asn1parse.c"
1801 { lex_error_message("implicit tagging is not supported"); }
1806 /* Line 1455 of yacc.c */
1807 #line 250 "asn1parse.c"
1808 { lex_error_message("automatic tagging is not supported"); }
1813 /* Line 1455 of yacc.c */
1814 #line 255 "asn1parse.c"
1815 { lex_error_message("no extensibility options supported"); }
1820 /* Line 1455 of yacc.c */
1821 #line 276 "asn1parse.c"
1823 struct string_list
*sl
;
1824 for(sl
= (yyvsp
[(1) - (4)].sl
); sl
!= NULL
; sl
= sl
->next
) {
1825 Symbol
*s
= addsym(sl
->string
);
1827 gen_template_import(s
);
1829 add_import((yyvsp
[(3) - (4)].name
));
1835 /* Line 1455 of yacc.c */
1836 #line 288 "asn1parse.c"
1838 struct string_list
*sl
;
1839 for(sl
= (yyvsp
[(2) - (3)].sl
); sl
!= NULL
; sl
= sl
->next
)
1840 add_export(sl
->string
);
1846 /* Line 1455 of yacc.c */
1847 #line 306 "asn1parse.c"
1849 (yyval
.sl
) = emalloc(sizeof(*(yyval
.sl
)));
1850 (yyval
.sl
)->string
= (yyvsp
[(1) - (3)].name
);
1851 (yyval
.sl
)->next
= (yyvsp
[(3) - (3)].sl
);
1857 /* Line 1455 of yacc.c */
1858 #line 312 "asn1parse.c"
1860 (yyval
.sl
) = emalloc(sizeof(*(yyval
.sl
)));
1861 (yyval
.sl
)->string
= (yyvsp
[(1) - (1)].name
);
1862 (yyval
.sl
)->next
= NULL
;
1868 /* Line 1455 of yacc.c */
1869 #line 320 "asn1parse.c"
1871 Symbol
*s
= addsym ((yyvsp
[(1) - (3)].name
));
1873 s
->type
= (yyvsp
[(3) - (3)].type
);
1881 /* Line 1455 of yacc.c */
1882 #line 351 "asn1parse.c"
1884 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Boolean
,
1885 TE_EXPLICIT
, new_type(TBoolean
));
1891 /* Line 1455 of yacc.c */
1892 #line 358 "asn1parse.c"
1894 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1895 lex_error_message("Non-integer used in first part of range");
1896 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1897 lex_error_message("Non-integer in second part of range");
1898 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1899 (yyval
.range
)->min
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
;
1900 (yyval
.range
)->max
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
;
1906 /* Line 1455 of yacc.c */
1907 #line 368 "asn1parse.c"
1909 if((yyvsp
[(2) - (5)].value
)->type
!= integervalue
)
1910 lex_error_message("Non-integer in first part of range");
1911 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1912 (yyval
.range
)->min
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
;
1913 (yyval
.range
)->max
= (yyvsp
[(2) - (5)].value
)->u
.integervalue
- 1;
1919 /* Line 1455 of yacc.c */
1920 #line 376 "asn1parse.c"
1922 if((yyvsp
[(4) - (5)].value
)->type
!= integervalue
)
1923 lex_error_message("Non-integer in second part of range");
1924 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1925 (yyval
.range
)->min
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
+ 2;
1926 (yyval
.range
)->max
= (yyvsp
[(4) - (5)].value
)->u
.integervalue
;
1932 /* Line 1455 of yacc.c */
1933 #line 384 "asn1parse.c"
1935 if((yyvsp
[(2) - (3)].value
)->type
!= integervalue
)
1936 lex_error_message("Non-integer used in limit");
1937 (yyval
.range
) = ecalloc(1, sizeof(*(yyval
.range
)));
1938 (yyval
.range
)->min
= (yyvsp
[(2) - (3)].value
)->u
.integervalue
;
1939 (yyval
.range
)->max
= (yyvsp
[(2) - (3)].value
)->u
.integervalue
;
1945 /* Line 1455 of yacc.c */
1946 #line 395 "asn1parse.c"
1948 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
,
1949 TE_EXPLICIT
, new_type(TInteger
));
1955 /* Line 1455 of yacc.c */
1956 #line 400 "asn1parse.c"
1958 (yyval
.type
) = new_type(TInteger
);
1959 (yyval
.type
)->range
= (yyvsp
[(2) - (2)].range
);
1960 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
, TE_EXPLICIT
, (yyval
.type
));
1966 /* Line 1455 of yacc.c */
1967 #line 406 "asn1parse.c"
1969 (yyval
.type
) = new_type(TInteger
);
1970 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
1971 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Integer
, TE_EXPLICIT
, (yyval
.type
));
1977 /* Line 1455 of yacc.c */
1978 #line 414 "asn1parse.c"
1980 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
1981 ASN1_TAILQ_INIT((yyval
.members
));
1982 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
1988 /* Line 1455 of yacc.c */
1989 #line 420 "asn1parse.c"
1991 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
1992 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
1998 /* Line 1455 of yacc.c */
1999 #line 425 "asn1parse.c"
2000 { (yyval
.members
) = (yyvsp
[(1) - (3)].members
); }
2005 /* Line 1455 of yacc.c */
2006 #line 429 "asn1parse.c"
2008 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
2009 (yyval
.member
)->name
= (yyvsp
[(1) - (4)].name
);
2010 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (4)].name
));
2011 output_name ((yyval
.member
)->gen_name
);
2012 (yyval
.member
)->val
= (yyvsp
[(3) - (4)].constant
);
2013 (yyval
.member
)->optional
= 0;
2014 (yyval
.member
)->ellipsis
= 0;
2015 (yyval
.member
)->type
= NULL
;
2021 /* Line 1455 of yacc.c */
2022 #line 442 "asn1parse.c"
2024 (yyval
.type
) = new_type(TInteger
);
2025 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2026 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Enumerated
, TE_EXPLICIT
, (yyval
.type
));
2032 /* Line 1455 of yacc.c */
2033 #line 453 "asn1parse.c"
2035 (yyval
.type
) = new_type(TBitString
);
2036 (yyval
.type
)->members
= emalloc(sizeof(*(yyval
.type
)->members
));
2037 ASN1_TAILQ_INIT((yyval
.type
)->members
);
2038 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BitString
, TE_EXPLICIT
, (yyval
.type
));
2044 /* Line 1455 of yacc.c */
2045 #line 460 "asn1parse.c"
2047 (yyval
.type
) = new_type(TBitString
);
2048 (yyval
.type
)->members
= (yyvsp
[(4) - (5)].members
);
2049 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BitString
, TE_EXPLICIT
, (yyval
.type
));
2055 /* Line 1455 of yacc.c */
2056 #line 468 "asn1parse.c"
2058 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_OID
,
2059 TE_EXPLICIT
, new_type(TOID
));
2065 /* Line 1455 of yacc.c */
2066 #line 474 "asn1parse.c"
2068 Type
*t
= new_type(TOctetString
);
2069 t
->range
= (yyvsp
[(3) - (3)].range
);
2070 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_OctetString
,
2077 /* Line 1455 of yacc.c */
2078 #line 483 "asn1parse.c"
2080 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Null
,
2081 TE_EXPLICIT
, new_type(TNull
));
2087 /* Line 1455 of yacc.c */
2088 #line 490 "asn1parse.c"
2089 { (yyval
.range
) = NULL
; }
2094 /* Line 1455 of yacc.c */
2095 #line 492 "asn1parse.c"
2096 { (yyval
.range
) = (yyvsp
[(2) - (2)].range
); }
2101 /* Line 1455 of yacc.c */
2102 #line 497 "asn1parse.c"
2104 (yyval
.type
) = new_type(TSequence
);
2105 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2106 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2112 /* Line 1455 of yacc.c */
2113 #line 503 "asn1parse.c"
2115 (yyval
.type
) = new_type(TSequence
);
2116 (yyval
.type
)->members
= NULL
;
2117 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2123 /* Line 1455 of yacc.c */
2124 #line 511 "asn1parse.c"
2126 (yyval
.type
) = new_type(TSequenceOf
);
2127 (yyval
.type
)->range
= (yyvsp
[(2) - (4)].range
);
2128 (yyval
.type
)->subtype
= (yyvsp
[(4) - (4)].type
);
2129 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Sequence
, TE_EXPLICIT
, (yyval
.type
));
2135 /* Line 1455 of yacc.c */
2136 #line 520 "asn1parse.c"
2138 (yyval
.type
) = new_type(TSet
);
2139 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2140 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2146 /* Line 1455 of yacc.c */
2147 #line 526 "asn1parse.c"
2149 (yyval
.type
) = new_type(TSet
);
2150 (yyval
.type
)->members
= NULL
;
2151 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2157 /* Line 1455 of yacc.c */
2158 #line 534 "asn1parse.c"
2160 (yyval
.type
) = new_type(TSetOf
);
2161 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
);
2162 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_Set
, TE_EXPLICIT
, (yyval
.type
));
2168 /* Line 1455 of yacc.c */
2169 #line 542 "asn1parse.c"
2171 (yyval
.type
) = new_type(TChoice
);
2172 (yyval
.type
)->members
= (yyvsp
[(3) - (4)].members
);
2178 /* Line 1455 of yacc.c */
2179 #line 553 "asn1parse.c"
2181 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2182 (yyval
.type
) = new_type(TType
);
2183 if(s
->stype
!= Stype
&& s
->stype
!= SUndefined
)
2184 lex_error_message ("%s is not a type\n", (yyvsp
[(1) - (1)].name
));
2186 (yyval
.type
)->symbol
= s
;
2192 /* Line 1455 of yacc.c */
2193 #line 564 "asn1parse.c"
2195 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_GeneralizedTime
,
2196 TE_EXPLICIT
, new_type(TGeneralizedTime
));
2202 /* Line 1455 of yacc.c */
2203 #line 569 "asn1parse.c"
2205 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UTCTime
,
2206 TE_EXPLICIT
, new_type(TUTCTime
));
2212 /* Line 1455 of yacc.c */
2213 #line 576 "asn1parse.c"
2215 /* if (Constraint.type == contentConstrant) {
2216 assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
2217 if (Constraint.u.constraint.type) {
2218 assert((Constraint.u.constraint.type.length % 8) == 0);
2221 if (Constraint.u.constraint.encoding) {
2222 type == der-oid|ber-oid
2230 /* Line 1455 of yacc.c */
2231 #line 592 "asn1parse.c"
2233 (yyval
.constraint_spec
) = (yyvsp
[(2) - (3)].constraint_spec
);
2239 /* Line 1455 of yacc.c */
2240 #line 605 "asn1parse.c"
2242 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2243 (yyval
.constraint_spec
)->u
.content
.type
= (yyvsp
[(2) - (2)].type
);
2244 (yyval
.constraint_spec
)->u
.content
.encoding
= NULL
;
2250 /* Line 1455 of yacc.c */
2251 #line 611 "asn1parse.c"
2253 if ((yyvsp
[(3) - (3)].value
)->type
!= objectidentifiervalue
)
2254 lex_error_message("Non-OID used in ENCODED BY constraint");
2255 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2256 (yyval
.constraint_spec
)->u
.content
.type
= NULL
;
2257 (yyval
.constraint_spec
)->u
.content
.encoding
= (yyvsp
[(3) - (3)].value
);
2263 /* Line 1455 of yacc.c */
2264 #line 619 "asn1parse.c"
2266 if ((yyvsp
[(5) - (5)].value
)->type
!= objectidentifiervalue
)
2267 lex_error_message("Non-OID used in ENCODED BY constraint");
2268 (yyval
.constraint_spec
) = new_constraint_spec(CT_CONTENTS
);
2269 (yyval
.constraint_spec
)->u
.content
.type
= (yyvsp
[(2) - (5)].type
);
2270 (yyval
.constraint_spec
)->u
.content
.encoding
= (yyvsp
[(5) - (5)].value
);
2276 /* Line 1455 of yacc.c */
2277 #line 629 "asn1parse.c"
2279 (yyval
.constraint_spec
) = new_constraint_spec(CT_USER
);
2285 /* Line 1455 of yacc.c */
2286 #line 635 "asn1parse.c"
2288 (yyval
.type
) = new_type(TTag
);
2289 (yyval
.type
)->tag
= (yyvsp
[(1) - (3)].tag
);
2290 (yyval
.type
)->tag
.tagenv
= (yyvsp
[(2) - (3)].constant
);
2291 if((yyvsp
[(3) - (3)].type
)->type
== TTag
&& (yyvsp
[(2) - (3)].constant
) == TE_IMPLICIT
) {
2292 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
)->subtype
;
2293 free((yyvsp
[(3) - (3)].type
));
2295 (yyval
.type
)->subtype
= (yyvsp
[(3) - (3)].type
);
2301 /* Line 1455 of yacc.c */
2302 #line 648 "asn1parse.c"
2304 (yyval
.tag
).tagclass
= (yyvsp
[(2) - (4)].constant
);
2305 (yyval
.tag
).tagvalue
= (yyvsp
[(3) - (4)].constant
);
2306 (yyval
.tag
).tagenv
= TE_EXPLICIT
;
2312 /* Line 1455 of yacc.c */
2313 #line 656 "asn1parse.c"
2315 (yyval
.constant
) = ASN1_C_CONTEXT
;
2321 /* Line 1455 of yacc.c */
2322 #line 660 "asn1parse.c"
2324 (yyval
.constant
) = ASN1_C_UNIV
;
2330 /* Line 1455 of yacc.c */
2331 #line 664 "asn1parse.c"
2333 (yyval
.constant
) = ASN1_C_APPL
;
2339 /* Line 1455 of yacc.c */
2340 #line 668 "asn1parse.c"
2342 (yyval
.constant
) = ASN1_C_PRIVATE
;
2348 /* Line 1455 of yacc.c */
2349 #line 674 "asn1parse.c"
2351 (yyval
.constant
) = TE_EXPLICIT
;
2357 /* Line 1455 of yacc.c */
2358 #line 678 "asn1parse.c"
2360 (yyval
.constant
) = TE_EXPLICIT
;
2366 /* Line 1455 of yacc.c */
2367 #line 682 "asn1parse.c"
2369 (yyval
.constant
) = TE_IMPLICIT
;
2375 /* Line 1455 of yacc.c */
2376 #line 689 "asn1parse.c"
2379 s
= addsym ((yyvsp
[(1) - (4)].name
));
2382 s
->value
= (yyvsp
[(4) - (4)].value
);
2383 generate_constant (s
);
2389 /* Line 1455 of yacc.c */
2390 #line 703 "asn1parse.c"
2392 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_GeneralString
,
2393 TE_EXPLICIT
, new_type(TGeneralString
));
2399 /* Line 1455 of yacc.c */
2400 #line 708 "asn1parse.c"
2402 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_TeletexString
,
2403 TE_EXPLICIT
, new_type(TTeletexString
));
2409 /* Line 1455 of yacc.c */
2410 #line 713 "asn1parse.c"
2412 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UTF8String
,
2413 TE_EXPLICIT
, new_type(TUTF8String
));
2419 /* Line 1455 of yacc.c */
2420 #line 718 "asn1parse.c"
2422 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_PrintableString
,
2423 TE_EXPLICIT
, new_type(TPrintableString
));
2429 /* Line 1455 of yacc.c */
2430 #line 723 "asn1parse.c"
2432 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_VisibleString
,
2433 TE_EXPLICIT
, new_type(TVisibleString
));
2439 /* Line 1455 of yacc.c */
2440 #line 728 "asn1parse.c"
2442 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_IA5String
,
2443 TE_EXPLICIT
, new_type(TIA5String
));
2449 /* Line 1455 of yacc.c */
2450 #line 733 "asn1parse.c"
2452 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_BMPString
,
2453 TE_EXPLICIT
, new_type(TBMPString
));
2459 /* Line 1455 of yacc.c */
2460 #line 738 "asn1parse.c"
2462 (yyval
.type
) = new_tag(ASN1_C_UNIV
, UT_UniversalString
,
2463 TE_EXPLICIT
, new_type(TUniversalString
));
2469 /* Line 1455 of yacc.c */
2470 #line 746 "asn1parse.c"
2472 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
2473 ASN1_TAILQ_INIT((yyval
.members
));
2474 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
2480 /* Line 1455 of yacc.c */
2481 #line 752 "asn1parse.c"
2483 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
2484 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2490 /* Line 1455 of yacc.c */
2491 #line 757 "asn1parse.c"
2493 struct member
*m
= ecalloc(1, sizeof(*m
));
2494 m
->name
= estrdup("...");
2495 m
->gen_name
= estrdup("asn1_ellipsis");
2497 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), m
, members
);
2498 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2504 /* Line 1455 of yacc.c */
2505 #line 768 "asn1parse.c"
2507 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
2508 (yyval
.member
)->name
= (yyvsp
[(1) - (2)].name
);
2509 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (2)].name
));
2510 output_name ((yyval
.member
)->gen_name
);
2511 (yyval
.member
)->type
= (yyvsp
[(2) - (2)].type
);
2512 (yyval
.member
)->ellipsis
= 0;
2518 /* Line 1455 of yacc.c */
2519 #line 779 "asn1parse.c"
2521 (yyval
.member
) = (yyvsp
[(1) - (1)].member
);
2522 (yyval
.member
)->optional
= 0;
2523 (yyval
.member
)->defval
= NULL
;
2529 /* Line 1455 of yacc.c */
2530 #line 785 "asn1parse.c"
2532 (yyval
.member
) = (yyvsp
[(1) - (2)].member
);
2533 (yyval
.member
)->optional
= 1;
2534 (yyval
.member
)->defval
= NULL
;
2540 /* Line 1455 of yacc.c */
2541 #line 791 "asn1parse.c"
2543 (yyval
.member
) = (yyvsp
[(1) - (3)].member
);
2544 (yyval
.member
)->optional
= 0;
2545 (yyval
.member
)->defval
= (yyvsp
[(3) - (3)].value
);
2551 /* Line 1455 of yacc.c */
2552 #line 799 "asn1parse.c"
2554 (yyval
.members
) = emalloc(sizeof(*(yyval
.members
)));
2555 ASN1_TAILQ_INIT((yyval
.members
));
2556 ASN1_TAILQ_INSERT_HEAD((yyval
.members
), (yyvsp
[(1) - (1)].member
), members
);
2562 /* Line 1455 of yacc.c */
2563 #line 805 "asn1parse.c"
2565 ASN1_TAILQ_INSERT_TAIL((yyvsp
[(1) - (3)].members
), (yyvsp
[(3) - (3)].member
), members
);
2566 (yyval
.members
) = (yyvsp
[(1) - (3)].members
);
2572 /* Line 1455 of yacc.c */
2573 #line 812 "asn1parse.c"
2575 (yyval
.member
) = emalloc(sizeof(*(yyval
.member
)));
2576 (yyval
.member
)->name
= (yyvsp
[(1) - (4)].name
);
2577 (yyval
.member
)->gen_name
= estrdup((yyvsp
[(1) - (4)].name
));
2578 output_name ((yyval
.member
)->gen_name
);
2579 (yyval
.member
)->val
= (yyvsp
[(3) - (4)].constant
);
2580 (yyval
.member
)->optional
= 0;
2581 (yyval
.member
)->ellipsis
= 0;
2582 (yyval
.member
)->type
= NULL
;
2588 /* Line 1455 of yacc.c */
2589 #line 825 "asn1parse.c"
2590 { (yyval
.objid
) = NULL
; }
2595 /* Line 1455 of yacc.c */
2596 #line 829 "asn1parse.c"
2598 (yyval
.objid
) = (yyvsp
[(2) - (3)].objid
);
2604 /* Line 1455 of yacc.c */
2605 #line 835 "asn1parse.c"
2607 (yyval
.objid
) = NULL
;
2613 /* Line 1455 of yacc.c */
2614 #line 839 "asn1parse.c"
2616 if ((yyvsp
[(2) - (2)].objid
)) {
2617 (yyval
.objid
) = (yyvsp
[(2) - (2)].objid
);
2618 add_oid_to_tail((yyvsp
[(2) - (2)].objid
), (yyvsp
[(1) - (2)].objid
));
2620 (yyval
.objid
) = (yyvsp
[(1) - (2)].objid
);
2627 /* Line 1455 of yacc.c */
2628 #line 850 "asn1parse.c"
2630 (yyval
.objid
) = new_objid((yyvsp
[(1) - (4)].name
), (yyvsp
[(3) - (4)].constant
));
2636 /* Line 1455 of yacc.c */
2637 #line 854 "asn1parse.c"
2639 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2640 if(s
->stype
!= SValue
||
2641 s
->value
->type
!= objectidentifiervalue
) {
2642 lex_error_message("%s is not an object identifier\n",
2646 (yyval
.objid
) = s
->value
->u
.objectidentifiervalue
;
2652 /* Line 1455 of yacc.c */
2653 #line 865 "asn1parse.c"
2655 (yyval
.objid
) = new_objid(NULL
, (yyvsp
[(1) - (1)].constant
));
2661 /* Line 1455 of yacc.c */
2662 #line 888 "asn1parse.c"
2664 Symbol
*s
= addsym((yyvsp
[(1) - (1)].name
));
2665 if(s
->stype
!= SValue
)
2666 lex_error_message ("%s is not a value\n",
2669 (yyval
.value
) = s
->value
;
2675 /* Line 1455 of yacc.c */
2676 #line 899 "asn1parse.c"
2678 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2679 (yyval
.value
)->type
= stringvalue
;
2680 (yyval
.value
)->u
.stringvalue
= (yyvsp
[(1) - (1)].name
);
2686 /* Line 1455 of yacc.c */
2687 #line 907 "asn1parse.c"
2689 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2690 (yyval
.value
)->type
= booleanvalue
;
2691 (yyval
.value
)->u
.booleanvalue
= 0;
2697 /* Line 1455 of yacc.c */
2698 #line 913 "asn1parse.c"
2700 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2701 (yyval
.value
)->type
= booleanvalue
;
2702 (yyval
.value
)->u
.booleanvalue
= 0;
2708 /* Line 1455 of yacc.c */
2709 #line 921 "asn1parse.c"
2711 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2712 (yyval
.value
)->type
= integervalue
;
2713 (yyval
.value
)->u
.integervalue
= (yyvsp
[(1) - (1)].constant
);
2719 /* Line 1455 of yacc.c */
2720 #line 932 "asn1parse.c"
2727 /* Line 1455 of yacc.c */
2728 #line 937 "asn1parse.c"
2730 (yyval
.value
) = emalloc(sizeof(*(yyval
.value
)));
2731 (yyval
.value
)->type
= objectidentifiervalue
;
2732 (yyval
.value
)->u
.objectidentifiervalue
= (yyvsp
[(1) - (1)].objid
);
2738 /* Line 1455 of yacc.c */
2739 #line 2740 "asn1parse.c"
2742 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2746 YY_STACK_PRINT (yyss
, yyssp
);
2750 /* Now `shift' the result of the reduction. Determine what state
2751 that goes to, based on the state we popped back to and the rule
2752 number reduced by. */
2756 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2757 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2758 yystate
= yytable
[yystate
];
2760 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2765 /*------------------------------------.
2766 | yyerrlab -- here on detecting error |
2767 `------------------------------------*/
2769 /* If not already recovering from an error, report this error. */
2773 #if ! YYERROR_VERBOSE
2774 yyerror (YY_("syntax error"));
2777 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2778 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2780 YYSIZE_T yyalloc
= 2 * yysize
;
2781 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2782 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2783 if (yymsg
!= yymsgbuf
)
2784 YYSTACK_FREE (yymsg
);
2785 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2787 yymsg_alloc
= yyalloc
;
2791 yymsg_alloc
= sizeof yymsgbuf
;
2795 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2797 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2802 yyerror (YY_("syntax error"));
2804 goto yyexhaustedlab
;
2812 if (yyerrstatus
== 3)
2814 /* If just tried and failed to reuse lookahead token after an
2815 error, discard it. */
2817 if (yychar
<= YYEOF
)
2819 /* Return failure if at end of input. */
2820 if (yychar
== YYEOF
)
2825 yydestruct ("Error: discarding",
2831 /* Else will try to reuse lookahead token after shifting the error
2836 /*---------------------------------------------------.
2837 | yyerrorlab -- error raised explicitly by YYERROR. |
2838 `---------------------------------------------------*/
2841 /* Pacify compilers like GCC when the user code never invokes
2842 YYERROR and the label yyerrorlab therefore never appears in user
2844 if (/*CONSTCOND*/ 0)
2847 /* Do not reclaim the symbols of the rule which action triggered
2851 YY_STACK_PRINT (yyss
, yyssp
);
2856 /*-------------------------------------------------------------.
2857 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2858 `-------------------------------------------------------------*/
2860 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2864 yyn
= yypact
[yystate
];
2865 if (yyn
!= YYPACT_NINF
)
2868 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2876 /* Pop the current state because it cannot handle the error token. */
2881 yydestruct ("Error: popping",
2882 yystos
[yystate
], yyvsp
);
2885 YY_STACK_PRINT (yyss
, yyssp
);
2891 /* Shift the error token. */
2892 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2898 /*-------------------------------------.
2899 | yyacceptlab -- YYACCEPT comes here. |
2900 `-------------------------------------*/
2905 /*-----------------------------------.
2906 | yyabortlab -- YYABORT comes here. |
2907 `-----------------------------------*/
2912 #if !defined(yyoverflow) || YYERROR_VERBOSE
2913 /*-------------------------------------------------.
2914 | yyexhaustedlab -- memory exhaustion comes here. |
2915 `-------------------------------------------------*/
2917 yyerror (YY_("memory exhausted"));
2923 if (yychar
!= YYEMPTY
)
2924 yydestruct ("Cleanup: discarding lookahead",
2926 /* Do not reclaim the symbols of the rule which action triggered
2927 this YYABORT or YYACCEPT. */
2929 YY_STACK_PRINT (yyss
, yyssp
);
2930 while (yyssp
!= yyss
)
2932 yydestruct ("Cleanup: popping",
2933 yystos
[*yyssp
], yyvsp
);
2938 YYSTACK_FREE (yyss
);
2941 if (yymsg
!= yymsgbuf
)
2942 YYSTACK_FREE (yymsg
);
2944 /* Make sure YYID is used. */
2945 return YYID (yyresult
);
2950 /* Line 1675 of yacc.c */
2951 #line 944 "asn1parse.c"
2955 yyerror (const char *s
)
2957 lex_error_message ("%s\n", s
);
2961 new_tag(int tagclass
, int tagvalue
, int tagenv
, Type
*oldtype
)
2964 if(oldtype
->type
== TTag
&& oldtype
->tag
.tagenv
== TE_IMPLICIT
) {
2966 oldtype
= oldtype
->subtype
; /* XXX */
2968 t
= new_type (TTag
);
2970 t
->tag
.tagclass
= tagclass
;
2971 t
->tag
.tagvalue
= tagvalue
;
2972 t
->tag
.tagenv
= tagenv
;
2973 t
->subtype
= oldtype
;
2977 static struct objid
*
2978 new_objid(const char *label
, int value
)
2981 s
= emalloc(sizeof(*s
));
2989 add_oid_to_tail(struct objid
*head
, struct objid
*tail
)
2999 new_type (Typetype tt
)
3001 Type
*t
= ecalloc(1, sizeof(*t
));
3006 static struct constraint_spec
*
3007 new_constraint_spec(enum ctype ct
)
3009 struct constraint_spec
*c
= ecalloc(1, sizeof(*c
));
3014 static void fix_labels2(Type
*t
, const char *prefix
);
3015 static void fix_labels1(struct memhead
*members
, const char *prefix
)
3021 ASN1_TAILQ_FOREACH(m
, members
, members
) {
3022 if (asprintf(&m
->label
, "%s_%s", prefix
, m
->gen_name
) < 0)
3024 if (m
->label
== NULL
)
3027 fix_labels2(m
->type
, m
->label
);
3031 static void fix_labels2(Type
*t
, const char *prefix
)
3033 for(; t
; t
= t
->subtype
)
3034 fix_labels1(t
->members
, prefix
);
3038 fix_labels(Symbol
*s
)
3041 if (asprintf(&p
, "choice_%s", s
->gen_name
) < 0 || p
== NULL
)
3043 fix_labels2(s
->type
, p
);