1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
70 kw_ABSTRACT_SYNTAX = 259,
95 kw_EXTENSIBILITY = 284,
99 kw_GeneralString = 288,
100 kw_GeneralizedTime = 289,
101 kw_GraphicString = 290,
110 kw_INTERSECTION = 299,
111 kw_ISO646String = 300,
114 kw_MINUS_INFINITY = 303,
116 kw_NumericString = 305,
121 kw_ObjectDescriptor = 310,
124 kw_PLUS_INFINITY = 313,
127 kw_PrintableString = 316,
129 kw_RELATIVE_OID = 318,
138 kw_TYPE_IDENTIFIER = 327,
139 kw_TeletexString = 328,
145 kw_UniversalString = 334,
146 kw_VideotexString = 335,
147 kw_VisibleString = 336,
159 #define kw_ABSENT 258
160 #define kw_ABSTRACT_SYNTAX 259
162 #define kw_APPLICATION 261
163 #define kw_AUTOMATIC 262
166 #define kw_BMPString 265
167 #define kw_BOOLEAN 266
169 #define kw_CHARACTER 268
170 #define kw_CHOICE 269
172 #define kw_COMPONENT 271
173 #define kw_COMPONENTS 272
174 #define kw_CONSTRAINED 273
175 #define kw_CONTAINING 274
176 #define kw_DEFAULT 275
177 #define kw_DEFINITIONS 276
178 #define kw_EMBEDDED 277
179 #define kw_ENCODED 278
181 #define kw_ENUMERATED 280
182 #define kw_EXCEPT 281
183 #define kw_EXPLICIT 282
184 #define kw_EXPORTS 283
185 #define kw_EXTENSIBILITY 284
186 #define kw_EXTERNAL 285
189 #define kw_GeneralString 288
190 #define kw_GeneralizedTime 289
191 #define kw_GraphicString 290
192 #define kw_IA5String 291
193 #define kw_IDENTIFIER 292
194 #define kw_IMPLICIT 293
195 #define kw_IMPLIED 294
196 #define kw_IMPORTS 295
197 #define kw_INCLUDES 296
198 #define kw_INSTANCE 297
199 #define kw_INTEGER 298
200 #define kw_INTERSECTION 299
201 #define kw_ISO646String 300
204 #define kw_MINUS_INFINITY 303
206 #define kw_NumericString 305
207 #define kw_OBJECT 306
210 #define kw_OPTIONAL 309
211 #define kw_ObjectDescriptor 310
212 #define kw_PATTERN 311
214 #define kw_PLUS_INFINITY 313
215 #define kw_PRESENT 314
216 #define kw_PRIVATE 315
217 #define kw_PrintableString 316
219 #define kw_RELATIVE_OID 318
220 #define kw_SEQUENCE 319
223 #define kw_STRING 322
224 #define kw_SYNTAX 323
225 #define kw_T61String 324
228 #define kw_TYPE_IDENTIFIER 327
229 #define kw_TeletexString 328
231 #define kw_UNIQUE 330
232 #define kw_UNIVERSAL 331
233 #define kw_UTCTime 332
234 #define kw_UTF8String 333
235 #define kw_UniversalString 334
236 #define kw_VideotexString 335
237 #define kw_VisibleString 336
242 #define IDENTIFIER 341
243 #define referencename 342
250 /* Copy the first part of user declarations. */
261 #include "gen_locl.h"
264 RCSID("$Id: parse.y 19539 2006-12-28 17:15:05Z lha $");
266 static Type *new_type (Typetype t);
267 static struct constraint_spec *new_constraint_spec(enum ctype);
268 static Type *new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype);
269 void yyerror (const char *);
270 static struct objid *new_objid(const char *label, int value);
271 static void add_oid_to_tail(struct objid *, struct objid *);
272 static void fix_labels(Symbol *s);
276 struct string_list *next;
281 /* Enabling traces. */
286 /* Enabling verbose error messages. */
287 #ifdef YYERROR_VERBOSE
288 # undef YYERROR_VERBOSE
289 # define YYERROR_VERBOSE 1
291 # define YYERROR_VERBOSE 0
294 /* Enabling the token table. */
295 #ifndef YYTOKEN_TABLE
296 # define YYTOKEN_TABLE 0
299 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
300 typedef union YYSTYPE
311 struct string_list *sl;
313 struct memhead *members;
314 struct constraint_spec *constraint_spec;
316 /* Line 187 of yacc.c. */
319 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
320 # define YYSTYPE_IS_DECLARED 1
321 # define YYSTYPE_IS_TRIVIAL 1
326 /* Copy the second part of user declarations. */
329 /* Line 216 of yacc.c. */
337 typedef YYTYPE_UINT8 yytype_uint8;
339 typedef unsigned char yytype_uint8;
343 typedef YYTYPE_INT8 yytype_int8;
344 #elif (defined __STDC__ || defined __C99__FUNC__ \
345 || defined __cplusplus || defined _MSC_VER)
346 typedef signed char yytype_int8;
348 typedef short int yytype_int8;
352 typedef YYTYPE_UINT16 yytype_uint16;
354 typedef unsigned short int yytype_uint16;
358 typedef YYTYPE_INT16 yytype_int16;
360 typedef short int yytype_int16;
364 # ifdef __SIZE_TYPE__
365 # define YYSIZE_T __SIZE_TYPE__
366 # elif defined size_t
367 # define YYSIZE_T size_t
368 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
371 # define YYSIZE_T size_t
373 # define YYSIZE_T unsigned int
377 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
382 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
383 # define YY_(msgid) dgettext ("bison-runtime", msgid)
387 # define YY_(msgid) msgid
391 /* Suppress unused-variable warnings by "using" E. */
392 #if ! defined lint || defined __GNUC__
393 # define YYUSE(e) ((void) (e))
395 # define YYUSE(e) /* empty */
398 /* Identity function, used to suppress warnings about constant conditions. */
402 #if (defined __STDC__ || defined __C99__FUNC__ \
403 || defined __cplusplus || defined _MSC_VER)
416 #if ! defined yyoverflow || YYERROR_VERBOSE
418 /* The parser invokes alloca or malloc; define the necessary symbols. */
420 # ifdef YYSTACK_USE_ALLOCA
421 # if YYSTACK_USE_ALLOCA
423 # define YYSTACK_ALLOC __builtin_alloca
424 # elif defined __BUILTIN_VA_ARG_INCR
425 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
427 # define YYSTACK_ALLOC __alloca
428 # elif defined _MSC_VER
429 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
430 # define alloca _alloca
432 # define YYSTACK_ALLOC alloca
433 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
434 || defined __cplusplus || defined _MSC_VER)
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
444 # ifdef YYSTACK_ALLOC
445 /* Pacify GCC's `empty if-body' warning. */
446 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
447 # ifndef YYSTACK_ALLOC_MAXIMUM
448 /* The OS might guarantee only one guard page at the bottom of the stack,
449 and a page size can be as small as 4096 bytes. So we cannot safely
450 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
451 to allow for a few compiler-allocated temporary stack slots. */
452 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455 # define YYSTACK_ALLOC YYMALLOC
456 # define YYSTACK_FREE YYFREE
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
460 # if (defined __cplusplus && ! defined _STDLIB_H \
461 && ! ((defined YYMALLOC || defined malloc) \
462 && (defined YYFREE || defined free)))
463 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469 # define YYMALLOC malloc
470 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
471 || defined __cplusplus || defined _MSC_VER)
472 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
477 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478 || defined __cplusplus || defined _MSC_VER)
479 void free (void *); /* INFRINGES ON USER NAME SPACE */
483 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
486 #if (! defined yyoverflow \
487 && (! defined __cplusplus \
488 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
490 /* A type that is properly aligned for any stack member. */
497 /* The size of the maximum gap between one aligned stack and the next. */
498 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
500 /* The size of an array large to enough to hold all stacks, each with
502 # define YYSTACK_BYTES(N) \
503 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
504 + YYSTACK_GAP_MAXIMUM)
506 /* Copy COUNT objects from FROM to TO. The source and destination do
509 # if defined __GNUC__ && 1 < __GNUC__
510 # define YYCOPY(To, From, Count) \
511 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
513 # define YYCOPY(To, From, Count) \
517 for (yyi = 0; yyi < (Count); yyi++) \
518 (To)[yyi] = (From)[yyi]; \
524 /* Relocate STACK from its old location to the new one. The
525 local variables YYSIZE and YYSTACKSIZE give the old and new number of
526 elements in the stack, and YYPTR gives the new location of the
527 stack. Advance YYPTR to a properly aligned location for the next
529 # define YYSTACK_RELOCATE(Stack) \
532 YYSIZE_T yynewbytes; \
533 YYCOPY (&yyptr->Stack, Stack, yysize); \
534 Stack = &yyptr->Stack; \
535 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
536 yyptr += yynewbytes / sizeof (*yyptr); \
542 /* YYFINAL -- State number of the termination state. */
544 /* YYLAST -- Last index in YYTABLE. */
547 /* YYNTOKENS -- Number of terminals. */
549 /* YYNNTS -- Number of nonterminals. */
551 /* YYNRULES -- Number of rules. */
553 /* YYNRULES -- Number of states. */
554 #define YYNSTATES 202
556 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
558 #define YYMAXUTOK 344
560 #define YYTRANSLATE(YYX) \
561 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
563 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
564 static const yytype_uint8 yytranslate[] =
566 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
592 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
593 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
594 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
595 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
596 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
597 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
598 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
599 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
604 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
606 static const yytype_uint16 yyprhs[] =
608 0, 0, 3, 12, 15, 18, 21, 22, 25, 26,
609 29, 30, 34, 35, 37, 38, 40, 43, 48, 50,
610 53, 55, 57, 61, 63, 67, 69, 71, 73, 75,
611 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
612 97, 99, 101, 103, 109, 111, 114, 119, 121, 125,
613 129, 134, 139, 141, 144, 150, 153, 156, 158, 163,
614 167, 171, 176, 180, 184, 189, 191, 193, 195, 197,
615 199, 202, 206, 208, 210, 212, 215, 219, 225, 230,
616 234, 239, 240, 242, 244, 246, 247, 249, 251, 256,
617 258, 260, 262, 264, 266, 268, 270, 272, 274, 278,
618 282, 285, 287, 290, 294, 296, 300, 305, 307, 308,
619 312, 313, 316, 321, 323, 325, 327, 329, 331, 333,
620 335, 337, 339, 341, 343, 345, 347, 349, 351, 353,
624 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
625 static const yytype_int16 yyrhs[] =
627 99, 0, -1, 86, 21, 100, 101, 84, 8, 102,
628 24, -1, 27, 70, -1, 38, 70, -1, 7, 70,
629 -1, -1, 29, 39, -1, -1, 103, 107, -1, -1,
630 40, 104, 90, -1, -1, 105, -1, -1, 106, -1,
631 105, 106, -1, 109, 32, 86, 150, -1, 108, -1,
632 108, 107, -1, 110, -1, 142, -1, 86, 91, 109,
633 -1, 86, -1, 86, 84, 111, -1, 112, -1, 129,
634 -1, 132, -1, 120, -1, 113, -1, 143, -1, 128,
635 -1, 118, -1, 115, -1, 123, -1, 121, -1, 122,
636 -1, 124, -1, 125, -1, 126, -1, 127, -1, 138,
637 -1, 11, -1, 92, 154, 83, 154, 93, -1, 43,
638 -1, 43, 114, -1, 43, 94, 116, 95, -1, 117,
639 -1, 116, 91, 117, -1, 116, 91, 85, -1, 86,
640 92, 162, 93, -1, 25, 94, 119, 95, -1, 116,
641 -1, 9, 67, -1, 9, 67, 94, 148, 95, -1,
642 51, 37, -1, 52, 67, -1, 49, -1, 64, 94,
643 145, 95, -1, 64, 94, 95, -1, 64, 53, 111,
644 -1, 65, 94, 145, 95, -1, 65, 94, 95, -1,
645 65, 53, 111, -1, 14, 94, 145, 95, -1, 130,
646 -1, 131, -1, 86, -1, 34, -1, 77, -1, 111,
647 133, -1, 92, 134, 93, -1, 135, -1, 136, -1,
648 137, -1, 19, 111, -1, 23, 12, 154, -1, 19,
649 111, 23, 12, 154, -1, 18, 12, 94, 95, -1,
650 139, 141, 111, -1, 96, 140, 89, 97, -1, -1,
651 76, -1, 6, -1, 60, -1, -1, 27, -1, 38,
652 -1, 86, 111, 84, 154, -1, 144, -1, 33, -1,
653 78, -1, 61, -1, 81, -1, 36, -1, 10, -1,
654 79, -1, 147, -1, 145, 91, 147, -1, 145, 91,
655 85, -1, 86, 111, -1, 146, -1, 146, 54, -1,
656 146, 20, 154, -1, 149, -1, 148, 91, 149, -1,
657 86, 92, 89, 93, -1, 151, -1, -1, 94, 152,
658 95, -1, -1, 153, 152, -1, 86, 92, 89, 93,
659 -1, 86, -1, 89, -1, 155, -1, 156, -1, 160,
660 -1, 159, -1, 161, -1, 164, -1, 163, -1, 157,
661 -1, 158, -1, 86, -1, 88, -1, 71, -1, 31,
662 -1, 162, -1, 89, -1, 49, -1, 151, -1
665 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
666 static const yytype_uint16 yyrline[] =
668 0, 231, 231, 238, 239, 241, 243, 246, 248, 251,
669 252, 255, 256, 259, 260, 263, 264, 267, 278, 279,
670 282, 283, 286, 292, 300, 310, 311, 312, 315, 316,
671 317, 318, 319, 320, 321, 322, 323, 324, 325, 326,
672 327, 328, 331, 338, 348, 353, 360, 368, 374, 379,
673 383, 396, 404, 407, 414, 422, 428, 435, 442, 448,
674 456, 464, 470, 478, 486, 493, 494, 497, 508, 513,
675 520, 536, 542, 545, 546, 549, 555, 563, 573, 579,
676 592, 601, 604, 608, 612, 619, 622, 626, 633, 644,
677 647, 652, 657, 662, 667, 672, 677, 685, 691, 696,
678 707, 718, 724, 730, 738, 744, 751, 764, 765, 768,
679 775, 778, 789, 793, 804, 810, 811, 814, 815, 816,
680 817, 818, 821, 824, 827, 838, 846, 852, 860, 868,
685 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
686 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
687 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
688 static const char *const yytname[] =
690 "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
691 "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
692 "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
693 "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
694 "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
695 "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
696 "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
697 "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
698 "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
699 "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
700 "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
701 "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
702 "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
703 "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
704 "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
705 "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
706 "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
707 "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
708 "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
709 "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
710 "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
711 "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
712 "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
713 "SymbolsFromModule", "AssignmentList", "Assignment", "referencenames",
714 "TypeAssignment", "Type", "BuiltinType", "BooleanType", "range",
715 "IntegerType", "NamedNumberList", "NamedNumber", "EnumeratedType",
716 "Enumerations", "BitStringType", "ObjectIdentifierType",
717 "OctetStringType", "NullType", "SequenceType", "SequenceOfType",
718 "SetType", "SetOfType", "ChoiceType", "ReferencedType", "DefinedType",
719 "UsefulType", "ConstrainedType", "Constraint", "ConstraintSpec",
720 "GeneralConstraint", "ContentsConstraint", "UserDefinedConstraint",
721 "TaggedType", "Tag", "Class", "tagenv", "ValueAssignment",
722 "CharacterStringType", "RestrictedCharactedStringType",
723 "ComponentTypeList", "NamedType", "ComponentType", "NamedBitList",
724 "NamedBit", "objid_opt", "objid", "objid_list", "objid_element", "Value",
725 "BuiltinValue", "ReferencedValue", "DefinedValue", "Valuereference",
726 "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
727 "NullValue", "ObjectIdentifierValue", 0
732 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
734 static const yytype_uint16 yytoknum[] =
736 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
737 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
738 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
739 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
740 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
741 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
742 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
743 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
744 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
745 59, 44, 40, 41, 123, 125, 91, 93
749 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
750 static const yytype_uint8 yyr1[] =
752 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
753 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
754 108, 108, 109, 109, 110, 111, 111, 111, 112, 112,
755 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
756 112, 112, 113, 114, 115, 115, 115, 116, 116, 116,
757 117, 118, 119, 120, 120, 121, 122, 123, 124, 124,
758 125, 126, 126, 127, 128, 129, 129, 130, 131, 131,
759 132, 133, 134, 135, 135, 136, 136, 136, 137, 138,
760 139, 140, 140, 140, 140, 141, 141, 141, 142, 143,
761 144, 144, 144, 144, 144, 144, 144, 145, 145, 145,
762 146, 147, 147, 147, 148, 148, 149, 150, 150, 151,
763 152, 152, 153, 153, 153, 154, 154, 155, 155, 155,
764 155, 155, 156, 157, 158, 159, 160, 160, 161, 162,
768 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
769 static const yytype_uint8 yyr2[] =
771 0, 2, 8, 2, 2, 2, 0, 2, 0, 2,
772 0, 3, 0, 1, 0, 1, 2, 4, 1, 2,
773 1, 1, 3, 1, 3, 1, 1, 1, 1, 1,
774 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
775 1, 1, 1, 5, 1, 2, 4, 1, 3, 3,
776 4, 4, 1, 2, 5, 2, 2, 1, 4, 3,
777 3, 4, 3, 3, 4, 1, 1, 1, 1, 1,
778 2, 3, 1, 1, 1, 2, 3, 5, 4, 3,
779 4, 0, 1, 1, 1, 0, 1, 1, 4, 1,
780 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
781 2, 1, 2, 3, 1, 3, 4, 1, 0, 3,
782 0, 2, 4, 1, 1, 1, 1, 1, 1, 1,
783 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
787 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
788 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
789 means the default is an error. */
790 static const yytype_uint8 yydefact[] =
792 0, 0, 0, 6, 1, 0, 0, 0, 8, 5,
793 3, 4, 0, 0, 7, 0, 10, 14, 0, 0,
794 23, 0, 13, 15, 0, 2, 0, 9, 18, 20,
795 21, 0, 11, 16, 0, 0, 95, 42, 0, 0,
796 90, 68, 94, 44, 57, 0, 0, 92, 0, 0,
797 69, 91, 96, 93, 0, 67, 81, 0, 25, 29,
798 33, 32, 28, 35, 36, 34, 37, 38, 39, 40,
799 31, 26, 65, 66, 27, 41, 85, 30, 89, 19,
800 22, 108, 53, 0, 0, 0, 0, 45, 55, 56,
801 0, 0, 0, 0, 24, 83, 84, 82, 0, 0,
802 0, 70, 86, 87, 0, 110, 17, 107, 0, 0,
803 0, 101, 97, 0, 52, 47, 0, 127, 130, 126,
804 124, 125, 129, 131, 0, 115, 116, 122, 123, 118,
805 117, 119, 128, 121, 120, 0, 60, 59, 0, 63,
806 62, 0, 0, 88, 0, 0, 0, 0, 72, 73,
807 74, 79, 113, 114, 0, 110, 0, 0, 104, 100,
808 0, 64, 0, 102, 0, 0, 51, 0, 46, 58,
809 61, 80, 0, 75, 0, 71, 0, 109, 111, 0,
810 0, 54, 99, 98, 103, 0, 49, 48, 0, 0,
811 0, 76, 0, 0, 105, 50, 43, 78, 0, 112,
815 /* YYDEFGOTO[NTERM-NUM]. */
816 static const yytype_int16 yydefgoto[] =
818 -1, 2, 8, 13, 18, 19, 21, 22, 23, 27,
819 28, 24, 29, 57, 58, 59, 87, 60, 114, 115,
820 61, 116, 62, 63, 64, 65, 66, 67, 68, 69,
821 70, 71, 72, 73, 74, 101, 147, 148, 149, 150,
822 75, 76, 98, 104, 30, 77, 78, 110, 111, 112,
823 157, 158, 106, 123, 154, 155, 124, 125, 126, 127,
824 128, 129, 130, 131, 132, 133, 134
827 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
829 #define YYPACT_NINF -100
830 static const yytype_int16 yypact[] =
832 -65, 19, 33, 5, -100, -29, -17, 11, 53, -100,
833 -100, -100, 47, 13, -100, 90, -34, 18, 81, 20,
834 16, 21, 18, -100, 76, -100, -7, -100, 20, -100,
835 -100, 18, -100, -100, 23, 43, -100, -100, 24, 25,
836 -100, -100, -100, -4, -100, 77, 46, -100, -48, -45,
837 -100, -100, -100, -100, 51, -100, 4, -64, -100, -100,
838 -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
839 -100, -100, -100, -100, -100, -100, -16, -100, -100, -100,
840 -100, 26, 27, 31, 36, 52, 36, -100, -100, -100,
841 51, -71, 51, -70, 32, -100, -100, -100, 37, 52,
842 12, -100, -100, -100, 51, -39, -100, -100, 39, 51,
843 -78, -6, -100, 35, 40, -100, 38, -100, -100, -100,
844 -100, -100, -100, -100, 56, -100, -100, -100, -100, -100,
845 -100, -100, -100, -100, -100, -72, 32, -100, -57, 32,
846 -100, -36, 45, -100, 122, 51, 123, 50, -100, -100,
847 -100, 32, 44, -100, 49, -39, 57, -22, -100, 32,
848 -19, -100, 52, -100, 59, 10, -100, 52, -100, -100,
849 -100, -100, 58, -14, 52, -100, 61, -100, -100, 62,
850 39, -100, -100, -100, -100, 60, -100, -100, 63, 64,
851 133, -100, 65, 67, -100, -100, -100, -100, 52, -100,
855 /* YYPGOTO[NTERM-NUM]. */
856 static const yytype_int16 yypgoto[] =
858 -100, -100, -100, -100, -100, -100, -100, -100, 132, 127,
859 -100, 126, -100, -53, -100, -100, -100, -100, 75, -3,
860 -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
861 -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
862 -100, -100, -100, -100, -100, -100, -100, 0, -100, 3,
863 -100, -15, -100, 83, 14, -100, -99, -100, -100, -100,
864 -100, -100, -100, -100, 2, -100, -100
867 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
868 positive, shift that token. If negative, reduce the rule which
869 number is the opposite. If zero, do what YYDEFACT says.
870 If YYTABLE_NINF, syntax error. */
871 #define YYTABLE_NINF -13
872 static const yytype_int16 yytable[] =
874 143, 94, 35, 36, 37, 90, 17, 38, 92, 190,
875 95, 102, 5, 160, 162, 109, 109, 161, 39, 165,
876 99, 1, 103, 168, 137, 140, 40, 41, 100, 42,
877 144, 145, 6, 4, 160, 146, 43, 136, 169, 139,
878 3, 9, 44, 7, 45, 46, 91, 152, 163, 93,
879 153, 151, -12, 10, 47, 160, 159, 48, 49, 170,
880 35, 36, 37, 184, 96, 38, 182, 109, 188, 180,
881 50, 51, 52, 181, 53, 191, 39, 54, 100, 55,
882 97, 11, 12, 117, 40, 41, 14, 42, 85, 56,
883 86, 138, 173, 141, 43, 186, 113, 15, 16, 201,
884 44, 118, 45, 46, 20, 25, 26, 31, 34, 81,
885 82, 32, 47, 89, 88, 48, 49, 109, 83, 84,
886 105, 108, 113, 119, 100, 156, 142, 164, 50, 51,
887 52, 165, 53, 166, 172, 174, 176, 55, 120, 167,
888 121, 122, 171, 175, 177, 198, 105, 56, 122, 179,
889 192, 193, 189, 195, 33, 79, 196, 80, 199, 197,
890 200, 135, 187, 183, 107, 194, 185, 0, 0, 178
893 static const yytype_int16 yycheck[] =
895 99, 54, 9, 10, 11, 53, 40, 14, 53, 23,
896 6, 27, 7, 91, 20, 86, 86, 95, 25, 91,
897 84, 86, 38, 95, 95, 95, 33, 34, 92, 36,
898 18, 19, 27, 0, 91, 23, 43, 90, 95, 92,
899 21, 70, 49, 38, 51, 52, 94, 86, 54, 94,
900 89, 104, 86, 70, 61, 91, 109, 64, 65, 95,
901 9, 10, 11, 162, 60, 14, 85, 86, 167, 91,
902 77, 78, 79, 95, 81, 174, 25, 84, 92, 86,
903 76, 70, 29, 31, 33, 34, 39, 36, 92, 96,
904 94, 91, 145, 93, 43, 85, 86, 84, 8, 198,
905 49, 49, 51, 52, 86, 24, 86, 91, 32, 86,
906 67, 90, 61, 67, 37, 64, 65, 86, 94, 94,
907 94, 94, 86, 71, 92, 86, 89, 92, 77, 78,
908 79, 91, 81, 95, 12, 12, 92, 86, 86, 83,
909 88, 89, 97, 93, 95, 12, 94, 96, 89, 92,
910 89, 89, 94, 93, 22, 28, 93, 31, 93, 95,
911 93, 86, 165, 160, 81, 180, 164, -1, -1, 155
914 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
915 symbol of state STATE-NUM. */
916 static const yytype_uint8 yystos[] =
918 0, 86, 99, 21, 0, 7, 27, 38, 100, 70,
919 70, 70, 29, 101, 39, 84, 8, 40, 102, 103,
920 86, 104, 105, 106, 109, 24, 86, 107, 108, 110,
921 142, 91, 90, 106, 32, 9, 10, 11, 14, 25,
922 33, 34, 36, 43, 49, 51, 52, 61, 64, 65,
923 77, 78, 79, 81, 84, 86, 96, 111, 112, 113,
924 115, 118, 120, 121, 122, 123, 124, 125, 126, 127,
925 128, 129, 130, 131, 132, 138, 139, 143, 144, 107,
926 109, 86, 67, 94, 94, 92, 94, 114, 37, 67,
927 53, 94, 53, 94, 111, 6, 60, 76, 140, 84,
928 92, 133, 27, 38, 141, 94, 150, 151, 94, 86,
929 145, 146, 147, 86, 116, 117, 119, 31, 49, 71,
930 86, 88, 89, 151, 154, 155, 156, 157, 158, 159,
931 160, 161, 162, 163, 164, 116, 111, 95, 145, 111,
932 95, 145, 89, 154, 18, 19, 23, 134, 135, 136,
933 137, 111, 86, 89, 152, 153, 86, 148, 149, 111,
934 91, 95, 20, 54, 92, 91, 95, 83, 95, 95,
935 95, 97, 12, 111, 12, 93, 92, 95, 152, 92,
936 91, 95, 85, 147, 154, 162, 85, 117, 154, 94,
937 23, 154, 89, 89, 149, 93, 93, 95, 12, 93,
941 #define yyerrok (yyerrstatus = 0)
942 #define yyclearin (yychar = YYEMPTY)
946 #define YYACCEPT goto yyacceptlab
947 #define YYABORT goto yyabortlab
948 #define YYERROR goto yyerrorlab
951 /* Like YYERROR except do call yyerror. This remains here temporarily
952 to ease the transition to the new meaning of YYERROR, for GCC.
953 Once GCC version 2 has supplanted version 1, this can go. */
955 #define YYFAIL goto yyerrlab
957 #define YYRECOVERING() (!!yyerrstatus)
959 #define YYBACKUP(Token, Value) \
961 if (yychar == YYEMPTY && yylen == 1) \
965 yytoken = YYTRANSLATE (yychar); \
971 yyerror (YY_("syntax error: cannot back up")); \
978 #define YYERRCODE 256
981 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
982 If N is 0, then set CURRENT to the empty location which ends
983 the previous symbol: RHS[0] (always defined). */
985 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
986 #ifndef YYLLOC_DEFAULT
987 # define YYLLOC_DEFAULT(Current, Rhs, N) \
991 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
992 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
993 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
994 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
998 (Current).first_line = (Current).last_line = \
999 YYRHSLOC (Rhs, 0).last_line; \
1000 (Current).first_column = (Current).last_column = \
1001 YYRHSLOC (Rhs, 0).last_column; \
1007 /* YY_LOCATION_PRINT -- Print the location on the stream.
1008 This macro was not mandated originally: define only if we know
1009 we won't break user code: when these are the locations we know. */
1011 #ifndef YY_LOCATION_PRINT
1012 # if YYLTYPE_IS_TRIVIAL
1013 # define YY_LOCATION_PRINT(File, Loc) \
1014 fprintf (File, "%d.%d-%d.%d", \
1015 (Loc).first_line, (Loc).first_column, \
1016 (Loc).last_line, (Loc).last_column)
1018 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1023 /* YYLEX -- calling `yylex' with the right arguments. */
1026 # define YYLEX yylex (YYLEX_PARAM)
1028 # define YYLEX yylex ()
1031 /* Enable debugging if requested. */
1035 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1036 # define YYFPRINTF fprintf
1039 # define YYDPRINTF(Args) \
1045 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1049 YYFPRINTF (stderr, "%s ", Title); \
1050 yy_symbol_print (stderr, \
1052 YYFPRINTF (stderr, "\n"); \
1057 /*--------------------------------.
1058 | Print this symbol on YYOUTPUT. |
1059 `--------------------------------*/
1062 #if (defined __STDC__ || defined __C99__FUNC__ \
1063 || defined __cplusplus || defined _MSC_VER)
1065 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1068 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1071 YYSTYPE const * const yyvaluep;
1077 if (yytype < YYNTOKENS)
1078 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1090 /*--------------------------------.
1091 | Print this symbol on YYOUTPUT. |
1092 `--------------------------------*/
1094 #if (defined __STDC__ || defined __C99__FUNC__ \
1095 || defined __cplusplus || defined _MSC_VER)
1097 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1100 yy_symbol_print (yyoutput, yytype, yyvaluep)
1103 YYSTYPE const * const yyvaluep;
1106 if (yytype < YYNTOKENS)
1107 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1109 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1111 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1112 YYFPRINTF (yyoutput, ")");
1115 /*------------------------------------------------------------------.
1116 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1118 `------------------------------------------------------------------*/
1120 #if (defined __STDC__ || defined __C99__FUNC__ \
1121 || defined __cplusplus || defined _MSC_VER)
1123 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1126 yy_stack_print (bottom, top)
1127 yytype_int16 *bottom;
1131 YYFPRINTF (stderr, "Stack now");
1132 for (; bottom <= top; ++bottom)
1133 YYFPRINTF (stderr, " %d", *bottom);
1134 YYFPRINTF (stderr, "\n");
1137 # define YY_STACK_PRINT(Bottom, Top) \
1140 yy_stack_print ((Bottom), (Top)); \
1144 /*------------------------------------------------.
1145 | Report that the YYRULE is going to be reduced. |
1146 `------------------------------------------------*/
1148 #if (defined __STDC__ || defined __C99__FUNC__ \
1149 || defined __cplusplus || defined _MSC_VER)
1151 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1154 yy_reduce_print (yyvsp, yyrule)
1159 int yynrhs = yyr2[yyrule];
1161 unsigned long int yylno = yyrline[yyrule];
1162 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1164 /* The symbols being reduced. */
1165 for (yyi = 0; yyi < yynrhs; yyi++)
1167 fprintf (stderr, " $%d = ", yyi + 1);
1168 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1169 &(yyvsp[(yyi + 1) - (yynrhs)])
1171 fprintf (stderr, "\n");
1175 # define YY_REDUCE_PRINT(Rule) \
1178 yy_reduce_print (yyvsp, Rule); \
1181 /* Nonzero means print parse trace. It is left uninitialized so that
1182 multiple parsers can coexist. */
1184 #else /* !YYDEBUG */
1185 # define YYDPRINTF(Args)
1186 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1187 # define YY_STACK_PRINT(Bottom, Top)
1188 # define YY_REDUCE_PRINT(Rule)
1189 #endif /* !YYDEBUG */
1192 /* YYINITDEPTH -- initial size of the parser's stacks. */
1194 # define YYINITDEPTH 200
1197 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1198 if the built-in stack extension method is used).
1200 Do not make this value too large; the results are undefined if
1201 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1202 evaluated with infinite-precision integer arithmetic. */
1205 # define YYMAXDEPTH 10000
1213 # if defined __GLIBC__ && defined _STRING_H
1214 # define yystrlen strlen
1216 /* Return the length of YYSTR. */
1217 #if (defined __STDC__ || defined __C99__FUNC__ \
1218 || defined __cplusplus || defined _MSC_VER)
1220 yystrlen (const char *yystr)
1228 for (yylen = 0; yystr[yylen]; yylen++)
1236 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1237 # define yystpcpy stpcpy
1239 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1241 #if (defined __STDC__ || defined __C99__FUNC__ \
1242 || defined __cplusplus || defined _MSC_VER)
1244 yystpcpy (char *yydest, const char *yysrc)
1247 yystpcpy (yydest, yysrc)
1253 const char *yys = yysrc;
1255 while ((*yyd++ = *yys++) != '\0')
1264 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1265 quotes and backslashes, so that it's suitable for yyerror. The
1266 heuristic is that double-quoting is unnecessary unless the string
1267 contains an apostrophe, a comma, or backslash (other than
1268 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1269 null, do not copy; instead, return the length of what the result
1272 yytnamerr (char *yyres, const char *yystr)
1277 char const *yyp = yystr;
1284 goto do_not_strip_quotes;
1288 goto do_not_strip_quotes;
1301 do_not_strip_quotes: ;
1305 return yystrlen (yystr);
1307 return yystpcpy (yyres, yystr) - yyres;
1311 /* Copy into YYRESULT an error message about the unexpected token
1312 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1313 including the terminating null byte. If YYRESULT is null, do not
1314 copy anything; just return the number of bytes that would be
1315 copied. As a special case, return 0 if an ordinary "syntax error"
1316 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1317 size calculation. */
1319 yysyntax_error (char *yyresult, int yystate, int yychar)
1321 int yyn = yypact[yystate];
1323 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1327 int yytype = YYTRANSLATE (yychar);
1328 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1329 YYSIZE_T yysize = yysize0;
1331 int yysize_overflow = 0;
1332 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1333 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1337 /* This is so xgettext sees the translatable formats that are
1338 constructed on the fly. */
1339 YY_("syntax error, unexpected %s");
1340 YY_("syntax error, unexpected %s, expecting %s");
1341 YY_("syntax error, unexpected %s, expecting %s or %s");
1342 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1343 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1347 static char const yyunexpected[] = "syntax error, unexpected %s";
1348 static char const yyexpecting[] = ", expecting %s";
1349 static char const yyor[] = " or %s";
1350 char yyformat[sizeof yyunexpected
1351 + sizeof yyexpecting - 1
1352 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1353 * (sizeof yyor - 1))];
1354 char const *yyprefix = yyexpecting;
1356 /* Start YYX at -YYN if negative to avoid negative indexes in
1358 int yyxbegin = yyn < 0 ? -yyn : 0;
1360 /* Stay within bounds of both yycheck and yytname. */
1361 int yychecklim = YYLAST - yyn + 1;
1362 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1365 yyarg[0] = yytname[yytype];
1366 yyfmt = yystpcpy (yyformat, yyunexpected);
1368 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1369 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1371 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1375 yyformat[sizeof yyunexpected - 1] = '\0';
1378 yyarg[yycount++] = yytname[yyx];
1379 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1380 yysize_overflow |= (yysize1 < yysize);
1382 yyfmt = yystpcpy (yyfmt, yyprefix);
1386 yyf = YY_(yyformat);
1387 yysize1 = yysize + yystrlen (yyf);
1388 yysize_overflow |= (yysize1 < yysize);
1391 if (yysize_overflow)
1392 return YYSIZE_MAXIMUM;
1396 /* Avoid sprintf, as that infringes on the user's name space.
1397 Don't have undefined behavior even if the translation
1398 produced a string with the wrong number of "%s"s. */
1399 char *yyp = yyresult;
1401 while ((*yyp = *yyf) != '\0')
1403 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1405 yyp += yytnamerr (yyp, yyarg[yyi++]);
1418 #endif /* YYERROR_VERBOSE */
1421 /*-----------------------------------------------.
1422 | Release the memory associated to this symbol. |
1423 `-----------------------------------------------*/
1426 #if (defined __STDC__ || defined __C99__FUNC__ \
1427 || defined __cplusplus || defined _MSC_VER)
1429 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1432 yydestruct (yymsg, yytype, yyvaluep)
1442 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1453 /* Prevent warnings from -Wmissing-prototypes. */
1455 #ifdef YYPARSE_PARAM
1456 #if defined __STDC__ || defined __cplusplus
1457 int yyparse (void *YYPARSE_PARAM);
1461 #else /* ! YYPARSE_PARAM */
1462 #if defined __STDC__ || defined __cplusplus
1467 #endif /* ! YYPARSE_PARAM */
1471 /* The look-ahead symbol. */
1474 /* The semantic value of the look-ahead symbol. */
1477 /* Number of syntax errors so far. */
1486 #ifdef YYPARSE_PARAM
1487 #if (defined __STDC__ || defined __C99__FUNC__ \
1488 || defined __cplusplus || defined _MSC_VER)
1490 yyparse (void *YYPARSE_PARAM)
1493 yyparse (YYPARSE_PARAM)
1494 void *YYPARSE_PARAM;
1496 #else /* ! YYPARSE_PARAM */
1497 #if (defined __STDC__ || defined __C99__FUNC__ \
1498 || defined __cplusplus || defined _MSC_VER)
1512 /* Number of tokens to shift before error messages enabled. */
1514 /* Look-ahead token as an internal (translated) token number. */
1517 /* Buffer for error messages, and its allocated size. */
1519 char *yymsg = yymsgbuf;
1520 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1523 /* Three stacks and their tools:
1524 `yyss': related to states,
1525 `yyvs': related to semantic values,
1526 `yyls': related to locations.
1528 Refer to the stacks thru separate pointers, to allow yyoverflow
1529 to reallocate them elsewhere. */
1531 /* The state stack. */
1532 yytype_int16 yyssa[YYINITDEPTH];
1533 yytype_int16 *yyss = yyssa;
1534 yytype_int16 *yyssp;
1536 /* The semantic value stack. */
1537 YYSTYPE yyvsa[YYINITDEPTH];
1538 YYSTYPE *yyvs = yyvsa;
1543 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1545 YYSIZE_T yystacksize = YYINITDEPTH;
1547 /* The variables used to return semantic value and location from the
1552 /* The number of symbols on the RHS of the reduced rule.
1553 Keep to zero when no symbol should be popped. */
1556 YYDPRINTF ((stderr, "Starting parse\n"));
1561 yychar = YYEMPTY; /* Cause a token to be read. */
1563 /* Initialize stack pointers.
1564 Waste one element of value and location stack
1565 so that they stay on the same level as the state stack.
1566 The wasted elements are never initialized. */
1573 /*------------------------------------------------------------.
1574 | yynewstate -- Push a new state, which is found in yystate. |
1575 `------------------------------------------------------------*/
1577 /* In all cases, when you get here, the value and location stacks
1578 have just been pushed. So pushing a state here evens the stacks. */
1584 if (yyss + yystacksize - 1 <= yyssp)
1586 /* Get the current used size of the three stacks, in elements. */
1587 YYSIZE_T yysize = yyssp - yyss + 1;
1591 /* Give user a chance to reallocate the stack. Use copies of
1592 these so that the &'s don't force the real ones into
1594 YYSTYPE *yyvs1 = yyvs;
1595 yytype_int16 *yyss1 = yyss;
1598 /* Each stack pointer address is followed by the size of the
1599 data in use in that stack, in bytes. This used to be a
1600 conditional around just the two extra args, but that might
1601 be undefined if yyoverflow is a macro. */
1602 yyoverflow (YY_("memory exhausted"),
1603 &yyss1, yysize * sizeof (*yyssp),
1604 &yyvs1, yysize * sizeof (*yyvsp),
1611 #else /* no yyoverflow */
1612 # ifndef YYSTACK_RELOCATE
1613 goto yyexhaustedlab;
1615 /* Extend the stack our own way. */
1616 if (YYMAXDEPTH <= yystacksize)
1617 goto yyexhaustedlab;
1619 if (YYMAXDEPTH < yystacksize)
1620 yystacksize = YYMAXDEPTH;
1623 yytype_int16 *yyss1 = yyss;
1624 union yyalloc *yyptr =
1625 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1627 goto yyexhaustedlab;
1628 YYSTACK_RELOCATE (yyss);
1629 YYSTACK_RELOCATE (yyvs);
1631 # undef YYSTACK_RELOCATE
1633 YYSTACK_FREE (yyss1);
1636 #endif /* no yyoverflow */
1638 yyssp = yyss + yysize - 1;
1639 yyvsp = yyvs + yysize - 1;
1642 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1643 (unsigned long int) yystacksize));
1645 if (yyss + yystacksize - 1 <= yyssp)
1649 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1658 /* Do appropriate processing given the current state. Read a
1659 look-ahead token if we need one and don't already have one. */
1661 /* First try to decide what to do without reference to look-ahead token. */
1662 yyn = yypact[yystate];
1663 if (yyn == YYPACT_NINF)
1666 /* Not known => get a look-ahead token if don't already have one. */
1668 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1669 if (yychar == YYEMPTY)
1671 YYDPRINTF ((stderr, "Reading a token: "));
1675 if (yychar <= YYEOF)
1677 yychar = yytoken = YYEOF;
1678 YYDPRINTF ((stderr, "Now at end of input.\n"));
1682 yytoken = YYTRANSLATE (yychar);
1683 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1686 /* If the proper action on seeing token YYTOKEN is to reduce or to
1687 detect an error, take that action. */
1689 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1694 if (yyn == 0 || yyn == YYTABLE_NINF)
1703 /* Count tokens shifted since error; after three, turn off error
1708 /* Shift the look-ahead token. */
1709 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1711 /* Discard the shifted token unless it is eof. */
1712 if (yychar != YYEOF)
1721 /*-----------------------------------------------------------.
1722 | yydefault -- do the default action for the current state. |
1723 `-----------------------------------------------------------*/
1725 yyn = yydefact[yystate];
1731 /*-----------------------------.
1732 | yyreduce -- Do a reduction. |
1733 `-----------------------------*/
1735 /* yyn is the number of a rule to reduce with. */
1738 /* If YYLEN is nonzero, implement the default value of the action:
1741 Otherwise, the following line sets YYVAL to garbage.
1742 This behavior is undocumented and Bison
1743 users should not rely upon it. Assigning to YYVAL
1744 unconditionally makes the parser a bit smaller, and it avoids a
1745 GCC warning that YYVAL may be used uninitialized. */
1746 yyval = yyvsp[1-yylen];
1749 YY_REDUCE_PRINT (yyn);
1761 { error_message("implicit tagging is not supported"); }
1766 { error_message("automatic tagging is not supported"); }
1771 { error_message("no extensibility options supported"); }
1777 struct string_list *sl;
1778 for(sl = (yyvsp[(1) - (4)].sl); sl != NULL; sl = sl->next) {
1779 Symbol *s = addsym(sl->string);
1782 add_import((yyvsp[(3) - (4)].name));
1789 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1790 (yyval.sl)->string = (yyvsp[(1) - (3)].name);
1791 (yyval.sl)->next = (yyvsp[(3) - (3)].sl);
1798 (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1799 (yyval.sl)->string = (yyvsp[(1) - (1)].name);
1800 (yyval.sl)->next = NULL;
1807 Symbol *s = addsym ((yyvsp[(1) - (3)].name));
1809 s->type = (yyvsp[(3) - (3)].type);
1818 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Boolean,
1819 TE_EXPLICIT, new_type(TBoolean));
1826 if((yyvsp[(2) - (5)].value)->type != integervalue ||
1827 (yyvsp[(4) - (5)].value)->type != integervalue)
1828 error_message("Non-integer value used in range");
1829 (yyval.range).min = (yyvsp[(2) - (5)].value)->u.integervalue;
1830 (yyval.range).max = (yyvsp[(4) - (5)].value)->u.integervalue;
1837 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer,
1838 TE_EXPLICIT, new_type(TInteger));
1845 (yyval.type) = new_type(TInteger);
1846 (yyval.type)->range = emalloc(sizeof(*(yyval.type)->range));
1847 *((yyval.type)->range) = (yyvsp[(2) - (2)].range);
1848 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1855 (yyval.type) = new_type(TInteger);
1856 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1857 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1864 (yyval.members) = emalloc(sizeof(*(yyval.members)));
1865 ASN1_TAILQ_INIT((yyval.members));
1866 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
1873 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
1874 (yyval.members) = (yyvsp[(1) - (3)].members);
1880 { (yyval.members) = (yyvsp[(1) - (3)].members); }
1886 (yyval.member) = emalloc(sizeof(*(yyval.member)));
1887 (yyval.member)->name = (yyvsp[(1) - (4)].name);
1888 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
1889 output_name ((yyval.member)->gen_name);
1890 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
1891 (yyval.member)->optional = 0;
1892 (yyval.member)->ellipsis = 0;
1893 (yyval.member)->type = NULL;
1900 (yyval.type) = new_type(TInteger);
1901 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1902 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Enumerated, TE_EXPLICIT, (yyval.type));
1909 (yyval.type) = new_type(TBitString);
1910 (yyval.type)->members = emalloc(sizeof(*(yyval.type)->members));
1911 ASN1_TAILQ_INIT((yyval.type)->members);
1912 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1919 (yyval.type) = new_type(TBitString);
1920 (yyval.type)->members = (yyvsp[(4) - (5)].members);
1921 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1928 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OID,
1929 TE_EXPLICIT, new_type(TOID));
1936 (yyval.type) = new_tag(ASN1_C_UNIV, UT_OctetString,
1937 TE_EXPLICIT, new_type(TOctetString));
1944 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Null,
1945 TE_EXPLICIT, new_type(TNull));
1952 (yyval.type) = new_type(TSequence);
1953 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1954 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1961 (yyval.type) = new_type(TSequence);
1962 (yyval.type)->members = NULL;
1963 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1970 (yyval.type) = new_type(TSequenceOf);
1971 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
1972 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1979 (yyval.type) = new_type(TSet);
1980 (yyval.type)->members = (yyvsp[(3) - (4)].members);
1981 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
1988 (yyval.type) = new_type(TSet);
1989 (yyval.type)->members = NULL;
1990 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
1997 (yyval.type) = new_type(TSetOf);
1998 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
1999 (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
2006 (yyval.type) = new_type(TChoice);
2007 (yyval.type)->members = (yyvsp[(3) - (4)].members);
2014 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2015 (yyval.type) = new_type(TType);
2016 if(s->stype != Stype && s->stype != SUndefined)
2017 error_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
2019 (yyval.type)->symbol = s;
2026 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralizedTime,
2027 TE_EXPLICIT, new_type(TGeneralizedTime));
2034 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTCTime,
2035 TE_EXPLICIT, new_type(TUTCTime));
2042 /* if (Constraint.type == contentConstrant) {
2043 assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
2044 if (Constraint.u.constraint.type) {
2045 assert((Constraint.u.constraint.type.length % 8) == 0);
2048 if (Constraint.u.constraint.encoding) {
2049 type == der-oid|ber-oid
2058 (yyval.constraint_spec) = (yyvsp[(2) - (3)].constraint_spec);
2065 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2066 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (2)].type);
2067 (yyval.constraint_spec)->u.content.encoding = NULL;
2074 if ((yyvsp[(3) - (3)].value)->type != objectidentifiervalue)
2075 error_message("Non-OID used in ENCODED BY constraint");
2076 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2077 (yyval.constraint_spec)->u.content.type = NULL;
2078 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(3) - (3)].value);
2085 if ((yyvsp[(5) - (5)].value)->type != objectidentifiervalue)
2086 error_message("Non-OID used in ENCODED BY constraint");
2087 (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
2088 (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (5)].type);
2089 (yyval.constraint_spec)->u.content.encoding = (yyvsp[(5) - (5)].value);
2096 (yyval.constraint_spec) = new_constraint_spec(CT_USER);
2103 (yyval.type) = new_type(TTag);
2104 (yyval.type)->tag = (yyvsp[(1) - (3)].tag);
2105 (yyval.type)->tag.tagenv = (yyvsp[(2) - (3)].constant);
2106 if((yyvsp[(3) - (3)].type)->type == TTag && (yyvsp[(2) - (3)].constant) == TE_IMPLICIT) {
2107 (yyval.type)->subtype = (yyvsp[(3) - (3)].type)->subtype;
2108 free((yyvsp[(3) - (3)].type));
2110 (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
2117 (yyval.tag).tagclass = (yyvsp[(2) - (4)].constant);
2118 (yyval.tag).tagvalue = (yyvsp[(3) - (4)].constant);
2119 (yyval.tag).tagenv = TE_EXPLICIT;
2126 (yyval.constant) = ASN1_C_CONTEXT;
2133 (yyval.constant) = ASN1_C_UNIV;
2140 (yyval.constant) = ASN1_C_APPL;
2147 (yyval.constant) = ASN1_C_PRIVATE;
2154 (yyval.constant) = TE_EXPLICIT;
2161 (yyval.constant) = TE_EXPLICIT;
2168 (yyval.constant) = TE_IMPLICIT;
2176 s = addsym ((yyvsp[(1) - (4)].name));
2179 s->value = (yyvsp[(4) - (4)].value);
2180 generate_constant (s);
2187 (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralString,
2188 TE_EXPLICIT, new_type(TGeneralString));
2195 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTF8String,
2196 TE_EXPLICIT, new_type(TUTF8String));
2203 (yyval.type) = new_tag(ASN1_C_UNIV, UT_PrintableString,
2204 TE_EXPLICIT, new_type(TPrintableString));
2211 (yyval.type) = new_tag(ASN1_C_UNIV, UT_VisibleString,
2212 TE_EXPLICIT, new_type(TVisibleString));
2219 (yyval.type) = new_tag(ASN1_C_UNIV, UT_IA5String,
2220 TE_EXPLICIT, new_type(TIA5String));
2227 (yyval.type) = new_tag(ASN1_C_UNIV, UT_BMPString,
2228 TE_EXPLICIT, new_type(TBMPString));
2235 (yyval.type) = new_tag(ASN1_C_UNIV, UT_UniversalString,
2236 TE_EXPLICIT, new_type(TUniversalString));
2243 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2244 ASN1_TAILQ_INIT((yyval.members));
2245 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2252 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2253 (yyval.members) = (yyvsp[(1) - (3)].members);
2260 struct member *m = ecalloc(1, sizeof(*m));
2261 m->name = estrdup("...");
2262 m->gen_name = estrdup("asn1_ellipsis");
2264 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), m, members);
2265 (yyval.members) = (yyvsp[(1) - (3)].members);
2272 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2273 (yyval.member)->name = (yyvsp[(1) - (2)].name);
2274 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (2)].name));
2275 output_name ((yyval.member)->gen_name);
2276 (yyval.member)->type = (yyvsp[(2) - (2)].type);
2277 (yyval.member)->ellipsis = 0;
2284 (yyval.member) = (yyvsp[(1) - (1)].member);
2285 (yyval.member)->optional = 0;
2286 (yyval.member)->defval = NULL;
2293 (yyval.member) = (yyvsp[(1) - (2)].member);
2294 (yyval.member)->optional = 1;
2295 (yyval.member)->defval = NULL;
2302 (yyval.member) = (yyvsp[(1) - (3)].member);
2303 (yyval.member)->optional = 0;
2304 (yyval.member)->defval = (yyvsp[(3) - (3)].value);
2311 (yyval.members) = emalloc(sizeof(*(yyval.members)));
2312 ASN1_TAILQ_INIT((yyval.members));
2313 ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
2320 ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
2321 (yyval.members) = (yyvsp[(1) - (3)].members);
2328 (yyval.member) = emalloc(sizeof(*(yyval.member)));
2329 (yyval.member)->name = (yyvsp[(1) - (4)].name);
2330 (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
2331 output_name ((yyval.member)->gen_name);
2332 (yyval.member)->val = (yyvsp[(3) - (4)].constant);
2333 (yyval.member)->optional = 0;
2334 (yyval.member)->ellipsis = 0;
2335 (yyval.member)->type = NULL;
2341 { (yyval.objid) = NULL; }
2347 (yyval.objid) = (yyvsp[(2) - (3)].objid);
2354 (yyval.objid) = NULL;
2361 if ((yyvsp[(2) - (2)].objid)) {
2362 (yyval.objid) = (yyvsp[(2) - (2)].objid);
2363 add_oid_to_tail((yyvsp[(2) - (2)].objid), (yyvsp[(1) - (2)].objid));
2365 (yyval.objid) = (yyvsp[(1) - (2)].objid);
2373 (yyval.objid) = new_objid((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].constant));
2380 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2381 if(s->stype != SValue ||
2382 s->value->type != objectidentifiervalue) {
2383 error_message("%s is not an object identifier\n",
2387 (yyval.objid) = s->value->u.objectidentifiervalue;
2394 (yyval.objid) = new_objid(NULL, (yyvsp[(1) - (1)].constant));
2401 Symbol *s = addsym((yyvsp[(1) - (1)].name));
2402 if(s->stype != SValue)
2403 error_message ("%s is not a value\n",
2406 (yyval.value) = s->value;
2413 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2414 (yyval.value)->type = stringvalue;
2415 (yyval.value)->u.stringvalue = (yyvsp[(1) - (1)].name);
2422 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2423 (yyval.value)->type = booleanvalue;
2424 (yyval.value)->u.booleanvalue = 0;
2431 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2432 (yyval.value)->type = booleanvalue;
2433 (yyval.value)->u.booleanvalue = 0;
2440 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2441 (yyval.value)->type = integervalue;
2442 (yyval.value)->u.integervalue = (yyvsp[(1) - (1)].constant);
2455 (yyval.value) = emalloc(sizeof(*(yyval.value)));
2456 (yyval.value)->type = objectidentifiervalue;
2457 (yyval.value)->u.objectidentifiervalue = (yyvsp[(1) - (1)].objid);
2462 /* Line 1267 of yacc.c. */
2463 #line 2464 "parse.c"
2466 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2470 YY_STACK_PRINT (yyss, yyssp);
2475 /* Now `shift' the result of the reduction. Determine what state
2476 that goes to, based on the state we popped back to and the rule
2477 number reduced by. */
2481 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2482 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2483 yystate = yytable[yystate];
2485 yystate = yydefgoto[yyn - YYNTOKENS];
2490 /*------------------------------------.
2491 | yyerrlab -- here on detecting error |
2492 `------------------------------------*/
2494 /* If not already recovering from an error, report this error. */
2498 #if ! YYERROR_VERBOSE
2499 yyerror (YY_("syntax error"));
2502 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2503 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2505 YYSIZE_T yyalloc = 2 * yysize;
2506 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2507 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2508 if (yymsg != yymsgbuf)
2509 YYSTACK_FREE (yymsg);
2510 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2512 yymsg_alloc = yyalloc;
2516 yymsg_alloc = sizeof yymsgbuf;
2520 if (0 < yysize && yysize <= yymsg_alloc)
2522 (void) yysyntax_error (yymsg, yystate, yychar);
2527 yyerror (YY_("syntax error"));
2529 goto yyexhaustedlab;
2537 if (yyerrstatus == 3)
2539 /* If just tried and failed to reuse look-ahead token after an
2540 error, discard it. */
2542 if (yychar <= YYEOF)
2544 /* Return failure if at end of input. */
2545 if (yychar == YYEOF)
2550 yydestruct ("Error: discarding",
2556 /* Else will try to reuse look-ahead token after shifting the error
2561 /*---------------------------------------------------.
2562 | yyerrorlab -- error raised explicitly by YYERROR. |
2563 `---------------------------------------------------*/
2566 /* Pacify compilers like GCC when the user code never invokes
2567 YYERROR and the label yyerrorlab therefore never appears in user
2569 if (/*CONSTCOND*/ 0)
2572 /* Do not reclaim the symbols of the rule which action triggered
2576 YY_STACK_PRINT (yyss, yyssp);
2581 /*-------------------------------------------------------------.
2582 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2583 `-------------------------------------------------------------*/
2585 yyerrstatus = 3; /* Each real token shifted decrements this. */
2589 yyn = yypact[yystate];
2590 if (yyn != YYPACT_NINF)
2593 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2601 /* Pop the current state because it cannot handle the error token. */
2606 yydestruct ("Error: popping",
2607 yystos[yystate], yyvsp);
2610 YY_STACK_PRINT (yyss, yyssp);
2619 /* Shift the error token. */
2620 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2626 /*-------------------------------------.
2627 | yyacceptlab -- YYACCEPT comes here. |
2628 `-------------------------------------*/
2633 /*-----------------------------------.
2634 | yyabortlab -- YYABORT comes here. |
2635 `-----------------------------------*/
2641 /*-------------------------------------------------.
2642 | yyexhaustedlab -- memory exhaustion comes here. |
2643 `-------------------------------------------------*/
2645 yyerror (YY_("memory exhausted"));
2651 if (yychar != YYEOF && yychar != YYEMPTY)
2652 yydestruct ("Cleanup: discarding lookahead",
2654 /* Do not reclaim the symbols of the rule which action triggered
2655 this YYABORT or YYACCEPT. */
2657 YY_STACK_PRINT (yyss, yyssp);
2658 while (yyssp != yyss)
2660 yydestruct ("Cleanup: popping",
2661 yystos[*yyssp], yyvsp);
2666 YYSTACK_FREE (yyss);
2669 if (yymsg != yymsgbuf)
2670 YYSTACK_FREE (yymsg);
2672 /* Make sure YYID is used. */
2673 return YYID (yyresult);
2681 yyerror (const char *s)
2683 error_message ("%s\n", s);
2687 new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype)
2690 if(oldtype->type == TTag && oldtype->tag.tagenv == TE_IMPLICIT) {
2692 oldtype = oldtype->subtype; /* XXX */
2694 t = new_type (TTag);
2696 t->tag.tagclass = tagclass;
2697 t->tag.tagvalue = tagvalue;
2698 t->tag.tagenv = tagenv;
2699 t->subtype = oldtype;
2703 static struct objid *
2704 new_objid(const char *label, int value)
2707 s = emalloc(sizeof(*s));
2715 add_oid_to_tail(struct objid *head, struct objid *tail)
2725 new_type (Typetype tt)
2727 Type *t = ecalloc(1, sizeof(*t));
2732 static struct constraint_spec *
2733 new_constraint_spec(enum ctype ct)
2735 struct constraint_spec *c = ecalloc(1, sizeof(*c));
2740 static void fix_labels2(Type *t, const char *prefix);
2741 static void fix_labels1(struct memhead *members, const char *prefix)
2747 ASN1_TAILQ_FOREACH(m, members, members) {
2748 asprintf(&m->label, "%s_%s", prefix, m->gen_name);
2749 if (m->label == NULL)
2752 fix_labels2(m->type, m->label);
2756 static void fix_labels2(Type *t, const char *prefix)
2758 for(; t; t = t->subtype)
2759 fix_labels1(t->members, prefix);
2763 fix_labels(Symbol *s)
2766 asprintf(&p, "choice_%s", s->gen_name);
2769 fix_labels2(s->type, p);