Line data Source code
1 : /* A Bison parser, made by GNU Bison 3.0.4. */
2 :
3 : /* Bison implementation for Yacc-like parsers in C
4 :
5 : Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 :
7 : This program is free software: you can redistribute it and/or modify
8 : it under the terms of the GNU General Public License as published by
9 : the Free Software Foundation, either version 3 of the License, or
10 : (at your option) any later version.
11 :
12 : This program is distributed in the hope that it will be useful,
13 : but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 : GNU General Public License for more details.
16 :
17 : You should have received a copy of the GNU General Public License
18 : along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 :
20 : /* As a special exception, you may create a larger work that contains
21 : part or all of the Bison parser skeleton and distribute that work
22 : under terms of your choice, so long as that work isn't itself a
23 : parser generator using the skeleton or a modified version thereof
24 : as a parser skeleton. Alternatively, if you modify or redistribute
25 : the parser skeleton itself, you may (at your option) remove this
26 : special exception, which will cause the skeleton and the resulting
27 : Bison output files to be licensed under the GNU General Public
28 : License without this special exception.
29 :
30 : This special exception was added by the Free Software Foundation in
31 : version 2.2 of Bison. */
32 :
33 : /* C LALR(1) parser skeleton written by Richard Stallman, by
34 : simplifying the original so-called "semantic" parser. */
35 :
36 : /* All symbols defined below should begin with yy or YY, to avoid
37 : infringing on user name space. This should be done even for local
38 : variables, as they might otherwise be expanded by user macros.
39 : There are some unavoidable exceptions within include files to
40 : define necessary library symbols; they are noted "INFRINGES ON
41 : USER NAME SPACE" below. */
42 :
43 : /* Identify Bison output. */
44 : #define YYBISON 1
45 :
46 : /* Bison version. */
47 : #define YYBISON_VERSION "3.0.4"
48 :
49 : /* Skeleton name. */
50 : #define YYSKELETON_NAME "yacc.c"
51 :
52 : /* Pure parsers. */
53 : #define YYPURE 0
54 :
55 : /* Push parsers. */
56 : #define YYPUSH 0
57 :
58 : /* Pull parsers. */
59 : #define YYPULL 1
60 :
61 :
62 :
63 :
64 : /* Copy the first part of user declarations. */
65 :
66 :
67 :
68 : #include <config.h>
69 :
70 : #include <stdio.h>
71 : #include <stdlib.h>
72 : #include <string.h>
73 : #include "symbol.h"
74 : #include "lex.h"
75 : #include "gen_locl.h"
76 : #include "der.h"
77 :
78 : RCSID("$Id$");
79 :
80 : static Type *new_type (Typetype t);
81 : static struct constraint_spec *new_constraint_spec(enum ctype);
82 : static Type *new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype);
83 : void yyerror (const char *);
84 : static struct objid *new_objid(const char *label, int value);
85 : static void add_oid_to_tail(struct objid *, struct objid *);
86 : static void fix_labels(Symbol *s);
87 :
88 : struct string_list {
89 : char *string;
90 : struct string_list *next;
91 : };
92 :
93 : /* Declarations for Bison */
94 : #define YYMALLOC malloc
95 : #define YYFREE free
96 :
97 :
98 :
99 :
100 : # ifndef YY_NULLPTR
101 : # if defined __cplusplus && 201103L <= __cplusplus
102 : # define YY_NULLPTR nullptr
103 : # else
104 : # define YY_NULLPTR 0
105 : # endif
106 : # endif
107 :
108 : /* Enabling verbose error messages. */
109 : #ifdef YYERROR_VERBOSE
110 : # undef YYERROR_VERBOSE
111 : # define YYERROR_VERBOSE 1
112 : #else
113 : # define YYERROR_VERBOSE 0
114 : #endif
115 :
116 : /* In a future release of Bison, this section will be replaced
117 : by #include "asn1parse.tab.h". */
118 : #ifndef YY_YY_ASN1PARSE_TAB_H_INCLUDED
119 : # define YY_YY_ASN1PARSE_TAB_H_INCLUDED
120 : /* Debug traces. */
121 : #ifndef YYDEBUG
122 : # define YYDEBUG 0
123 : #endif
124 : #if YYDEBUG
125 : extern int yydebug;
126 : #endif
127 :
128 : /* Token type. */
129 : #ifndef YYTOKENTYPE
130 : # define YYTOKENTYPE
131 : enum yytokentype
132 : {
133 : kw_ABSENT = 258,
134 : kw_ABSTRACT_SYNTAX = 259,
135 : kw_ALL = 260,
136 : kw_APPLICATION = 261,
137 : kw_AUTOMATIC = 262,
138 : kw_BEGIN = 263,
139 : kw_BIT = 264,
140 : kw_BMPString = 265,
141 : kw_BOOLEAN = 266,
142 : kw_BY = 267,
143 : kw_CHARACTER = 268,
144 : kw_CHOICE = 269,
145 : kw_CLASS = 270,
146 : kw_COMPONENT = 271,
147 : kw_COMPONENTS = 272,
148 : kw_CONSTRAINED = 273,
149 : kw_CONTAINING = 274,
150 : kw_DEFAULT = 275,
151 : kw_DEFINITIONS = 276,
152 : kw_EMBEDDED = 277,
153 : kw_ENCODED = 278,
154 : kw_END = 279,
155 : kw_ENUMERATED = 280,
156 : kw_EXCEPT = 281,
157 : kw_EXPLICIT = 282,
158 : kw_EXPORTS = 283,
159 : kw_EXTENSIBILITY = 284,
160 : kw_EXTERNAL = 285,
161 : kw_FALSE = 286,
162 : kw_FROM = 287,
163 : kw_GeneralString = 288,
164 : kw_GeneralizedTime = 289,
165 : kw_GraphicString = 290,
166 : kw_IA5String = 291,
167 : kw_IDENTIFIER = 292,
168 : kw_IMPLICIT = 293,
169 : kw_IMPLIED = 294,
170 : kw_IMPORTS = 295,
171 : kw_INCLUDES = 296,
172 : kw_INSTANCE = 297,
173 : kw_INTEGER = 298,
174 : kw_INTERSECTION = 299,
175 : kw_ISO646String = 300,
176 : kw_MAX = 301,
177 : kw_MIN = 302,
178 : kw_MINUS_INFINITY = 303,
179 : kw_NULL = 304,
180 : kw_NumericString = 305,
181 : kw_OBJECT = 306,
182 : kw_OCTET = 307,
183 : kw_OF = 308,
184 : kw_OPTIONAL = 309,
185 : kw_ObjectDescriptor = 310,
186 : kw_PATTERN = 311,
187 : kw_PDV = 312,
188 : kw_PLUS_INFINITY = 313,
189 : kw_PRESENT = 314,
190 : kw_PRIVATE = 315,
191 : kw_PrintableString = 316,
192 : kw_REAL = 317,
193 : kw_RELATIVE_OID = 318,
194 : kw_SEQUENCE = 319,
195 : kw_SET = 320,
196 : kw_SIZE = 321,
197 : kw_STRING = 322,
198 : kw_SYNTAX = 323,
199 : kw_T61String = 324,
200 : kw_TAGS = 325,
201 : kw_TRUE = 326,
202 : kw_TYPE_IDENTIFIER = 327,
203 : kw_TeletexString = 328,
204 : kw_UNION = 329,
205 : kw_UNIQUE = 330,
206 : kw_UNIVERSAL = 331,
207 : kw_UTCTime = 332,
208 : kw_UTF8String = 333,
209 : kw_UniversalString = 334,
210 : kw_VideotexString = 335,
211 : kw_VisibleString = 336,
212 : kw_WITH = 337,
213 : RANGE = 338,
214 : EEQUAL = 339,
215 : ELLIPSIS = 340,
216 : IDENTIFIER = 341,
217 : referencename = 342,
218 : STRING = 343,
219 : NUMBER = 344
220 : };
221 : #endif
222 :
223 : /* Value type. */
224 : #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
225 :
226 : union YYSTYPE
227 : {
228 :
229 :
230 : int constant;
231 : struct value *value;
232 : struct range *range;
233 : char *name;
234 : Type *type;
235 : Member *member;
236 : struct objid *objid;
237 : char *defval;
238 : struct string_list *sl;
239 : struct tagtype tag;
240 : struct memhead *members;
241 : struct constraint_spec *constraint_spec;
242 :
243 :
244 : };
245 :
246 : typedef union YYSTYPE YYSTYPE;
247 : # define YYSTYPE_IS_TRIVIAL 1
248 : # define YYSTYPE_IS_DECLARED 1
249 : #endif
250 :
251 :
252 : extern YYSTYPE yylval;
253 :
254 : int yyparse (void);
255 :
256 : #endif /* !YY_YY_ASN1PARSE_TAB_H_INCLUDED */
257 :
258 : /* Copy the second part of user declarations. */
259 :
260 :
261 :
262 : #ifdef short
263 : # undef short
264 : #endif
265 :
266 : #ifdef YYTYPE_UINT8
267 : typedef YYTYPE_UINT8 yytype_uint8;
268 : #else
269 : typedef unsigned char yytype_uint8;
270 : #endif
271 :
272 : #ifdef YYTYPE_INT8
273 : typedef YYTYPE_INT8 yytype_int8;
274 : #else
275 : typedef signed char yytype_int8;
276 : #endif
277 :
278 : #ifdef YYTYPE_UINT16
279 : typedef YYTYPE_UINT16 yytype_uint16;
280 : #else
281 : typedef unsigned short int yytype_uint16;
282 : #endif
283 :
284 : #ifdef YYTYPE_INT16
285 : typedef YYTYPE_INT16 yytype_int16;
286 : #else
287 : typedef short int yytype_int16;
288 : #endif
289 :
290 : #ifndef YYSIZE_T
291 : # ifdef __SIZE_TYPE__
292 : # define YYSIZE_T __SIZE_TYPE__
293 : # elif defined size_t
294 : # define YYSIZE_T size_t
295 : # elif ! defined YYSIZE_T
296 : # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
297 : # define YYSIZE_T size_t
298 : # else
299 : # define YYSIZE_T unsigned int
300 : # endif
301 : #endif
302 :
303 : #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
304 :
305 : #ifndef YY_
306 : # if defined YYENABLE_NLS && YYENABLE_NLS
307 : # if ENABLE_NLS
308 : # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
309 : # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
310 : # endif
311 : # endif
312 : # ifndef YY_
313 : # define YY_(Msgid) Msgid
314 : # endif
315 : #endif
316 :
317 : #ifndef YY_ATTRIBUTE
318 : # if (defined __GNUC__ \
319 : && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
320 : || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
321 : # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
322 : # else
323 : # define YY_ATTRIBUTE(Spec) /* empty */
324 : # endif
325 : #endif
326 :
327 : #ifndef YY_ATTRIBUTE_PURE
328 : # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
329 : #endif
330 :
331 : #ifndef YY_ATTRIBUTE_UNUSED
332 : # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
333 : #endif
334 :
335 : #if !defined _Noreturn \
336 : && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
337 : # if defined _MSC_VER && 1200 <= _MSC_VER
338 : # define _Noreturn __declspec (noreturn)
339 : # else
340 : # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
341 : # endif
342 : #endif
343 :
344 : /* Suppress unused-variable warnings by "using" E. */
345 : #if ! defined lint || defined __GNUC__
346 : # define YYUSE(E) ((void) (E))
347 : #else
348 : # define YYUSE(E) /* empty */
349 : #endif
350 :
351 : #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
352 : /* Suppress an incorrect diagnostic about yylval being uninitialized. */
353 : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
354 : _Pragma ("GCC diagnostic push") \
355 : _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
356 : _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
357 : # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
358 : _Pragma ("GCC diagnostic pop")
359 : #else
360 : # define YY_INITIAL_VALUE(Value) Value
361 : #endif
362 : #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
363 : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
364 : # define YY_IGNORE_MAYBE_UNINITIALIZED_END
365 : #endif
366 : #ifndef YY_INITIAL_VALUE
367 : # define YY_INITIAL_VALUE(Value) /* Nothing. */
368 : #endif
369 :
370 :
371 : #if ! defined yyoverflow || YYERROR_VERBOSE
372 :
373 : /* The parser invokes alloca or malloc; define the necessary symbols. */
374 :
375 : # ifdef YYSTACK_USE_ALLOCA
376 : # if YYSTACK_USE_ALLOCA
377 : # ifdef __GNUC__
378 : # define YYSTACK_ALLOC __builtin_alloca
379 : # elif defined __BUILTIN_VA_ARG_INCR
380 : # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
381 : # elif defined _AIX
382 : # define YYSTACK_ALLOC __alloca
383 : # elif defined _MSC_VER
384 : # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
385 : # define alloca _alloca
386 : # else
387 : # define YYSTACK_ALLOC alloca
388 : # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
389 : # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
390 : /* Use EXIT_SUCCESS as a witness for stdlib.h. */
391 : # ifndef EXIT_SUCCESS
392 : # define EXIT_SUCCESS 0
393 : # endif
394 : # endif
395 : # endif
396 : # endif
397 : # endif
398 :
399 : # ifdef YYSTACK_ALLOC
400 : /* Pacify GCC's 'empty if-body' warning. */
401 : # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
402 : # ifndef YYSTACK_ALLOC_MAXIMUM
403 : /* The OS might guarantee only one guard page at the bottom of the stack,
404 : and a page size can be as small as 4096 bytes. So we cannot safely
405 : invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
406 : to allow for a few compiler-allocated temporary stack slots. */
407 : # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
408 : # endif
409 : # else
410 : # define YYSTACK_ALLOC YYMALLOC
411 : # define YYSTACK_FREE YYFREE
412 : # ifndef YYSTACK_ALLOC_MAXIMUM
413 : # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
414 : # endif
415 : # if (defined __cplusplus && ! defined EXIT_SUCCESS \
416 : && ! ((defined YYMALLOC || defined malloc) \
417 : && (defined YYFREE || defined free)))
418 : # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
419 : # ifndef EXIT_SUCCESS
420 : # define EXIT_SUCCESS 0
421 : # endif
422 : # endif
423 : # ifndef YYMALLOC
424 : # define YYMALLOC malloc
425 : # if ! defined malloc && ! defined EXIT_SUCCESS
426 : void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
427 : # endif
428 : # endif
429 : # ifndef YYFREE
430 : # define YYFREE free
431 : # if ! defined free && ! defined EXIT_SUCCESS
432 : void free (void *); /* INFRINGES ON USER NAME SPACE */
433 : # endif
434 : # endif
435 : # endif
436 : #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
437 :
438 :
439 : #if (! defined yyoverflow \
440 : && (! defined __cplusplus \
441 : || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
442 :
443 : /* A type that is properly aligned for any stack member. */
444 : union yyalloc
445 : {
446 : yytype_int16 yyss_alloc;
447 : YYSTYPE yyvs_alloc;
448 : };
449 :
450 : /* The size of the maximum gap between one aligned stack and the next. */
451 : # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
452 :
453 : /* The size of an array large to enough to hold all stacks, each with
454 : N elements. */
455 : # define YYSTACK_BYTES(N) \
456 : ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
457 : + YYSTACK_GAP_MAXIMUM)
458 :
459 : # define YYCOPY_NEEDED 1
460 :
461 : /* Relocate STACK from its old location to the new one. The
462 : local variables YYSIZE and YYSTACKSIZE give the old and new number of
463 : elements in the stack, and YYPTR gives the new location of the
464 : stack. Advance YYPTR to a properly aligned location for the next
465 : stack. */
466 : # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
467 : do \
468 : { \
469 : YYSIZE_T yynewbytes; \
470 : YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
471 : Stack = &yyptr->Stack_alloc; \
472 : yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
473 : yyptr += yynewbytes / sizeof (*yyptr); \
474 : } \
475 : while (0)
476 :
477 : #endif
478 :
479 : #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
480 : /* Copy COUNT objects from SRC to DST. The source and destination do
481 : not overlap. */
482 : # ifndef YYCOPY
483 : # if defined __GNUC__ && 1 < __GNUC__
484 : # define YYCOPY(Dst, Src, Count) \
485 : __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
486 : # else
487 : # define YYCOPY(Dst, Src, Count) \
488 : do \
489 : { \
490 : YYSIZE_T yyi; \
491 : for (yyi = 0; yyi < (Count); yyi++) \
492 : (Dst)[yyi] = (Src)[yyi]; \
493 : } \
494 : while (0)
495 : # endif
496 : # endif
497 : #endif /* !YYCOPY_NEEDED */
498 :
499 : /* YYFINAL -- State number of the termination state. */
500 : #define YYFINAL 6
501 : /* YYLAST -- Last index in YYTABLE. */
502 : #define YYLAST 203
503 :
504 : /* YYNTOKENS -- Number of terminals. */
505 : #define YYNTOKENS 98
506 : /* YYNNTS -- Number of nonterminals. */
507 : #define YYNNTS 69
508 : /* YYNRULES -- Number of rules. */
509 : #define YYNRULES 140
510 : /* YYNSTATES -- Number of states. */
511 : #define YYNSTATES 220
512 :
513 : /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
514 : by yylex, with out-of-bounds checking. */
515 : #define YYUNDEFTOK 2
516 : #define YYMAXUTOK 344
517 :
518 : #define YYTRANSLATE(YYX) \
519 : ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
520 :
521 : /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
522 : as returned by yylex, without out-of-bounds checking. */
523 : static const yytype_uint8 yytranslate[] =
524 : {
525 : 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 : 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
530 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
531 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 : 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
535 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 : 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
538 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 : 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
551 : 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
552 : 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
553 : 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
554 : 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
555 : 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
556 : 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
557 : 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
558 : 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
559 : 85, 86, 87, 88, 89
560 : };
561 :
562 : #if YYDEBUG
563 : /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
564 : static const yytype_uint16 yyrline[] =
565 : {
566 : 0, 239, 239, 246, 247, 249, 251, 254, 256, 259,
567 : 260, 263, 264, 267, 268, 271, 272, 275, 287, 293,
568 : 294, 297, 298, 301, 302, 305, 311, 319, 329, 330,
569 : 331, 334, 335, 336, 337, 338, 339, 340, 341, 342,
570 : 343, 344, 345, 346, 347, 350, 357, 367, 375, 383,
571 : 394, 399, 405, 413, 419, 424, 428, 441, 449, 452,
572 : 459, 467, 473, 482, 490, 491, 496, 502, 510, 519,
573 : 525, 533, 541, 548, 549, 552, 563, 568, 575, 591,
574 : 597, 600, 601, 604, 610, 618, 628, 634, 647, 656,
575 : 659, 663, 667, 674, 677, 681, 688, 699, 702, 707,
576 : 712, 717, 722, 727, 732, 737, 745, 751, 756, 767,
577 : 778, 784, 790, 798, 804, 811, 824, 825, 828, 835,
578 : 838, 849, 853, 864, 870, 871, 874, 875, 876, 877,
579 : 878, 881, 884, 887, 898, 906, 912, 920, 928, 931,
580 : 936
581 : };
582 : #endif
583 :
584 : #if YYDEBUG || YYERROR_VERBOSE || 0
585 : /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
586 : First, the terminals, then, starting at YYNTOKENS, nonterminals. */
587 : static const char *const yytname[] =
588 : {
589 : "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
590 : "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
591 : "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
592 : "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
593 : "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
594 : "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
595 : "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
596 : "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
597 : "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
598 : "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
599 : "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
600 : "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
601 : "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
602 : "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
603 : "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
604 : "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
605 : "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
606 : "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
607 : "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
608 : "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
609 : "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
610 : "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
611 : "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
612 : "SymbolsFromModule", "Exports", "AssignmentList", "Assignment",
613 : "referencenames", "TypeAssignment", "Type", "BuiltinType", "BooleanType",
614 : "range", "IntegerType", "NamedNumberList", "NamedNumber",
615 : "EnumeratedType", "Enumerations", "BitStringType",
616 : "ObjectIdentifierType", "OctetStringType", "NullType", "size",
617 : "SequenceType", "SequenceOfType", "SetType", "SetOfType", "ChoiceType",
618 : "ReferencedType", "DefinedType", "UsefulType", "ConstrainedType",
619 : "Constraint", "ConstraintSpec", "GeneralConstraint",
620 : "ContentsConstraint", "UserDefinedConstraint", "TaggedType", "Tag",
621 : "Class", "tagenv", "ValueAssignment", "CharacterStringType",
622 : "RestrictedCharactedStringType", "ComponentTypeList", "NamedType",
623 : "ComponentType", "NamedBitList", "NamedBit", "objid_opt", "objid",
624 : "objid_list", "objid_element", "Value", "BuiltinValue",
625 : "ReferencedValue", "DefinedValue", "Valuereference",
626 : "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
627 : "NullValue", "ObjectIdentifierValue", YY_NULLPTR
628 : };
629 : #endif
630 :
631 : # ifdef YYPRINT
632 : /* YYTOKNUM[NUM] -- (External) token number corresponding to the
633 : (internal) symbol number NUM (which must be that of a token). */
634 : static const yytype_uint16 yytoknum[] =
635 : {
636 : 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
637 : 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
638 : 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
639 : 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
640 : 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
641 : 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
642 : 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
643 : 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
644 : 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
645 : 59, 44, 40, 41, 123, 125, 91, 93
646 : };
647 : # endif
648 :
649 : #define YYPACT_NINF -119
650 :
651 : #define yypact_value_is_default(Yystate) \
652 : (!!((Yystate) == (-119)))
653 :
654 : #define YYTABLE_NINF -11
655 :
656 : #define yytable_value_is_error(Yytable_value) \
657 : 0
658 :
659 : /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
660 : STATE-NUM. */
661 : static const yytype_int16 yypact[] =
662 : {
663 : -43, -56, 47, -65, 29, -119, -119, -31, -119, -25,
664 : -65, 4, -1, -119, -119, 17, 20, 26, 50, 13,
665 : -119, -119, -119, 63, 24, -119, -119, 104, 8, -2,
666 : 89, 74, -119, 33, 25, -119, 34, 39, 34, -119,
667 : 37, 34, -119, 98, 58, -119, 39, -119, -119, -119,
668 : -119, -119, 52, 66, -119, -119, 51, 53, -119, -119,
669 : -119, -79, -119, 109, 81, -119, -60, -48, -119, -119,
670 : -119, -119, -119, 107, -119, 2, -74, -119, -119, -119,
671 : -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
672 : -119, -119, -119, -119, -119, -18, -119, -119, -119, -56,
673 : 55, 65, 67, -12, 67, -119, -119, 86, 68, -70,
674 : 102, 107, -69, 69, -119, -119, -119, 73, 40, 10,
675 : -119, -119, -119, 107, -119, 71, 107, -47, -13, -119,
676 : 72, 75, -119, 70, -119, 80, -119, -119, -119, -119,
677 : -119, -119, -71, -119, -119, -119, -119, -119, -119, -119,
678 : -119, -119, -119, -46, -119, -119, -119, -39, 107, 69,
679 : -119, -38, 76, -119, 155, 107, 157, 77, -119, -119,
680 : -119, 69, 82, -10, -119, 69, -22, -119, 40, -119,
681 : 87, 19, -119, 40, 9, -119, -119, -119, 69, -119,
682 : -119, 83, -19, 40, -119, 90, 71, -119, -119, -119,
683 : -119, 85, -119, -119, 88, 94, 96, 95, 163, -119,
684 : 99, -119, -119, -119, -119, -119, -119, 40, -119, -119
685 : };
686 :
687 : /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
688 : Performed when YYTABLE does not specify something else to do. Zero
689 : means the default is an error. */
690 : static const yytype_uint8 yydefact[] =
691 : {
692 : 0, 117, 0, 119, 0, 116, 1, 122, 123, 0,
693 : 119, 6, 0, 118, 120, 0, 0, 0, 8, 0,
694 : 5, 3, 4, 0, 0, 121, 7, 0, 20, 0,
695 : 0, 12, 19, 26, 0, 2, 14, 0, 0, 18,
696 : 0, 13, 15, 0, 0, 9, 21, 23, 24, 25,
697 : 11, 16, 0, 0, 104, 45, 0, 0, 98, 76,
698 : 103, 50, 63, 0, 0, 101, 64, 0, 99, 77,
699 : 100, 105, 102, 0, 75, 89, 0, 28, 32, 36,
700 : 35, 31, 38, 39, 37, 40, 41, 42, 43, 34,
701 : 29, 73, 74, 30, 44, 93, 33, 97, 22, 117,
702 : 59, 0, 0, 0, 0, 51, 61, 64, 0, 0,
703 : 0, 0, 0, 27, 91, 92, 90, 0, 0, 0,
704 : 78, 94, 95, 0, 17, 0, 0, 0, 110, 106,
705 : 0, 58, 53, 0, 136, 0, 139, 135, 133, 134,
706 : 138, 140, 0, 124, 125, 131, 132, 127, 126, 128,
707 : 137, 130, 129, 0, 62, 65, 67, 0, 0, 71,
708 : 70, 0, 0, 96, 0, 0, 0, 0, 80, 81,
709 : 82, 87, 0, 0, 113, 109, 0, 72, 0, 111,
710 : 0, 0, 57, 0, 0, 49, 52, 66, 68, 69,
711 : 88, 0, 83, 0, 79, 0, 0, 60, 108, 107,
712 : 112, 0, 55, 54, 0, 0, 0, 0, 0, 84,
713 : 0, 114, 56, 48, 47, 46, 86, 0, 115, 85
714 : };
715 :
716 : /* YYPGOTO[NTERM-NUM]. */
717 : static const yytype_int16 yypgoto[] =
718 : {
719 : -119, -119, -119, -119, -119, -119, -119, -119, 141, -119,
720 : 137, -119, -15, -119, -72, -119, -119, 91, -119, 92,
721 : 14, -119, -119, -119, -119, -119, -119, 84, -119, -119,
722 : -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
723 : -119, -119, -119, -119, -119, -119, -119, -119, -119, -82,
724 : -119, 18, -119, 5, 101, 1, 187, -119, -118, -119,
725 : -119, -119, -119, -119, -119, -119, 22, -119, -119
726 : };
727 :
728 : /* YYDEFGOTO[NTERM-NUM]. */
729 : static const yytype_int16 yydefgoto[] =
730 : {
731 : -1, 2, 18, 24, 30, 37, 40, 41, 42, 31,
732 : 45, 46, 43, 47, 76, 77, 78, 105, 79, 131,
733 : 132, 80, 133, 81, 82, 83, 84, 110, 85, 86,
734 : 87, 88, 89, 90, 91, 92, 93, 120, 167, 168,
735 : 169, 170, 94, 95, 117, 123, 48, 96, 97, 127,
736 : 128, 129, 173, 174, 4, 141, 9, 10, 142, 143,
737 : 144, 145, 146, 147, 148, 149, 150, 151, 152
738 : };
739 :
740 : /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
741 : positive, shift that token. If negative, reduce the rule whose
742 : number is the opposite. If YYTABLE_NINF, syntax error. */
743 : static const yytype_int16 yytable[] =
744 : {
745 : 163, 113, 5, 32, 208, 111, 108, 178, 114, 121,
746 : 118, 15, 184, 103, 34, 104, 126, 126, 119, 134,
747 : 122, 7, 185, 49, 8, 156, 160, 157, 164, 165,
748 : 161, 16, -10, 166, 109, 135, 29, 136, 3, 159,
749 : 134, 179, 17, 1, 176, 181, 112, 6, 177, 186,
750 : 11, 171, 176, 176, 175, 205, 187, 189, 136, 137,
751 : 200, 12, 115, 198, 126, 204, 206, 53, 54, 55,
752 : 13, 134, 56, 119, 138, 209, 139, 140, 116, 23,
753 : 137, 196, 3, 57, 33, 197, 188, 20, 19, 136,
754 : 21, 58, 59, 192, 60, 138, 22, 139, 140, 219,
755 : 5, 61, 26, 3, 202, 130, 25, 62, 27, 63,
756 : 64, 137, 28, 35, 36, 39, 53, 54, 55, 65,
757 : 33, 56, 66, 67, 38, 44, 138, 50, 139, 140,
758 : 52, 68, 57, 100, 3, 69, 70, 71, 99, 72,
759 : 58, 59, 73, 60, 74, 101, 106, 102, 107, 125,
760 : 61, 126, 108, 130, 75, 158, 62, 172, 63, 64,
761 : 103, 119, 162, 183, 180, 182, 181, 191, 65, 193,
762 : 194, 66, 67, 190, 195, 217, 140, 207, 212, 210,
763 : 68, 213, 51, 98, 69, 70, 71, 214, 72, 215,
764 : 216, 154, 218, 74, 199, 203, 153, 14, 0, 155,
765 : 124, 211, 201, 75
766 : };
767 :
768 : static const yytype_int16 yycheck[] =
769 : {
770 : 118, 73, 1, 5, 23, 53, 66, 20, 6, 27,
771 : 84, 7, 83, 92, 29, 94, 86, 86, 92, 31,
772 : 38, 86, 93, 38, 89, 95, 95, 109, 18, 19,
773 : 112, 27, 24, 23, 94, 47, 28, 49, 94, 111,
774 : 31, 54, 38, 86, 91, 91, 94, 0, 95, 95,
775 : 21, 123, 91, 91, 126, 46, 95, 95, 49, 71,
776 : 178, 92, 60, 85, 86, 183, 184, 9, 10, 11,
777 : 95, 31, 14, 92, 86, 193, 88, 89, 76, 29,
778 : 71, 91, 94, 25, 86, 95, 158, 70, 89, 49,
779 : 70, 33, 34, 165, 36, 86, 70, 88, 89, 217,
780 : 99, 43, 39, 94, 85, 86, 93, 49, 84, 51,
781 : 52, 71, 8, 24, 40, 90, 9, 10, 11, 61,
782 : 86, 14, 64, 65, 91, 86, 86, 90, 88, 89,
783 : 32, 73, 25, 67, 94, 77, 78, 79, 86, 81,
784 : 33, 34, 84, 36, 86, 94, 37, 94, 67, 94,
785 : 43, 86, 66, 86, 96, 53, 49, 86, 51, 52,
786 : 92, 92, 89, 83, 92, 95, 91, 12, 61, 12,
787 : 93, 64, 65, 97, 92, 12, 89, 94, 93, 89,
788 : 73, 93, 41, 46, 77, 78, 79, 93, 81, 93,
789 : 95, 107, 93, 86, 176, 181, 104, 10, -1, 108,
790 : 99, 196, 180, 96
791 : };
792 :
793 : /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
794 : symbol of state STATE-NUM. */
795 : static const yytype_uint8 yystos[] =
796 : {
797 : 0, 86, 99, 94, 152, 153, 0, 86, 89, 154,
798 : 155, 21, 92, 95, 154, 7, 27, 38, 100, 89,
799 : 70, 70, 70, 29, 101, 93, 39, 84, 8, 28,
800 : 102, 107, 5, 86, 110, 24, 40, 103, 91, 90,
801 : 104, 105, 106, 110, 86, 108, 109, 111, 144, 110,
802 : 90, 106, 32, 9, 10, 11, 14, 25, 33, 34,
803 : 36, 43, 49, 51, 52, 61, 64, 65, 73, 77,
804 : 78, 79, 81, 84, 86, 96, 112, 113, 114, 116,
805 : 119, 121, 122, 123, 124, 126, 127, 128, 129, 130,
806 : 131, 132, 133, 134, 140, 141, 145, 146, 108, 86,
807 : 67, 94, 94, 92, 94, 115, 37, 67, 66, 94,
808 : 125, 53, 94, 112, 6, 60, 76, 142, 84, 92,
809 : 135, 27, 38, 143, 152, 94, 86, 147, 148, 149,
810 : 86, 117, 118, 120, 31, 47, 49, 71, 86, 88,
811 : 89, 153, 156, 157, 158, 159, 160, 161, 162, 163,
812 : 164, 165, 166, 117, 125, 115, 95, 147, 53, 112,
813 : 95, 147, 89, 156, 18, 19, 23, 136, 137, 138,
814 : 139, 112, 86, 150, 151, 112, 91, 95, 20, 54,
815 : 92, 91, 95, 83, 83, 93, 95, 95, 112, 95,
816 : 97, 12, 112, 12, 93, 92, 91, 95, 85, 149,
817 : 156, 164, 85, 118, 156, 46, 156, 94, 23, 156,
818 : 89, 151, 93, 93, 93, 93, 95, 12, 93, 156
819 : };
820 :
821 : /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
822 : static const yytype_uint8 yyr1[] =
823 : {
824 : 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
825 : 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
826 : 107, 108, 108, 109, 109, 110, 110, 111, 112, 112,
827 : 112, 113, 113, 113, 113, 113, 113, 113, 113, 113,
828 : 113, 113, 113, 113, 113, 114, 115, 115, 115, 115,
829 : 116, 116, 116, 117, 117, 117, 118, 119, 120, 121,
830 : 121, 122, 123, 124, 125, 125, 126, 126, 127, 128,
831 : 128, 129, 130, 131, 131, 132, 133, 133, 134, 135,
832 : 136, 137, 137, 138, 138, 138, 139, 140, 141, 142,
833 : 142, 142, 142, 143, 143, 143, 144, 145, 146, 146,
834 : 146, 146, 146, 146, 146, 146, 147, 147, 147, 148,
835 : 149, 149, 149, 150, 150, 151, 152, 152, 153, 154,
836 : 154, 155, 155, 155, 156, 156, 157, 157, 157, 157,
837 : 157, 158, 159, 160, 161, 162, 162, 163, 164, 165,
838 : 166
839 : };
840 :
841 : /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
842 : static const yytype_uint8 yyr2[] =
843 : {
844 : 0, 2, 9, 2, 2, 2, 0, 2, 0, 3,
845 : 0, 3, 0, 1, 0, 1, 2, 4, 3, 2,
846 : 0, 1, 2, 1, 1, 3, 1, 3, 1, 1,
847 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
848 : 1, 1, 1, 1, 1, 1, 5, 5, 5, 3,
849 : 1, 2, 4, 1, 3, 3, 4, 4, 1, 2,
850 : 5, 2, 3, 1, 0, 2, 4, 3, 4, 4,
851 : 3, 3, 4, 1, 1, 1, 1, 1, 2, 3,
852 : 1, 1, 1, 2, 3, 5, 4, 3, 4, 0,
853 : 1, 1, 1, 0, 1, 1, 4, 1, 1, 1,
854 : 1, 1, 1, 1, 1, 1, 1, 3, 3, 2,
855 : 1, 2, 3, 1, 3, 4, 1, 0, 3, 0,
856 : 2, 4, 1, 1, 1, 1, 1, 1, 1, 1,
857 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
858 : 1
859 : };
860 :
861 :
862 : #define yyerrok (yyerrstatus = 0)
863 : #define yyclearin (yychar = YYEMPTY)
864 : #define YYEMPTY (-2)
865 : #define YYEOF 0
866 :
867 : #define YYACCEPT goto yyacceptlab
868 : #define YYABORT goto yyabortlab
869 : #define YYERROR goto yyerrorlab
870 :
871 :
872 : #define YYRECOVERING() (!!yyerrstatus)
873 :
874 : #define YYBACKUP(Token, Value) \
875 : do \
876 : if (yychar == YYEMPTY) \
877 : { \
878 : yychar = (Token); \
879 : yylval = (Value); \
880 : YYPOPSTACK (yylen); \
881 : yystate = *yyssp; \
882 : goto yybackup; \
883 : } \
884 : else \
885 : { \
886 : yyerror (YY_("syntax error: cannot back up")); \
887 : YYERROR; \
888 : } \
889 : while (0)
890 :
891 : /* Error token number */
892 : #define YYTERROR 1
893 : #define YYERRCODE 256
894 :
895 :
896 :
897 : /* Enable debugging if requested. */
898 : #if YYDEBUG
899 :
900 : # ifndef YYFPRINTF
901 : # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
902 : # define YYFPRINTF fprintf
903 : # endif
904 :
905 : # define YYDPRINTF(Args) \
906 : do { \
907 : if (yydebug) \
908 : YYFPRINTF Args; \
909 : } while (0)
910 :
911 : /* This macro is provided for backward compatibility. */
912 : #ifndef YY_LOCATION_PRINT
913 : # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
914 : #endif
915 :
916 :
917 : # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
918 : do { \
919 : if (yydebug) \
920 : { \
921 : YYFPRINTF (stderr, "%s ", Title); \
922 : yy_symbol_print (stderr, \
923 : Type, Value); \
924 : YYFPRINTF (stderr, "\n"); \
925 : } \
926 : } while (0)
927 :
928 :
929 : /*----------------------------------------.
930 : | Print this symbol's value on YYOUTPUT. |
931 : `----------------------------------------*/
932 :
933 : static void
934 : yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
935 : {
936 : FILE *yyo = yyoutput;
937 : YYUSE (yyo);
938 : if (!yyvaluep)
939 : return;
940 : # ifdef YYPRINT
941 : if (yytype < YYNTOKENS)
942 : YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
943 : # endif
944 : YYUSE (yytype);
945 : }
946 :
947 :
948 : /*--------------------------------.
949 : | Print this symbol on YYOUTPUT. |
950 : `--------------------------------*/
951 :
952 : static void
953 : yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
954 : {
955 : YYFPRINTF (yyoutput, "%s %s (",
956 : yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
957 :
958 : yy_symbol_value_print (yyoutput, yytype, yyvaluep);
959 : YYFPRINTF (yyoutput, ")");
960 : }
961 :
962 : /*------------------------------------------------------------------.
963 : | yy_stack_print -- Print the state stack from its BOTTOM up to its |
964 : | TOP (included). |
965 : `------------------------------------------------------------------*/
966 :
967 : static void
968 : yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
969 : {
970 : YYFPRINTF (stderr, "Stack now");
971 : for (; yybottom <= yytop; yybottom++)
972 : {
973 : int yybot = *yybottom;
974 : YYFPRINTF (stderr, " %d", yybot);
975 : }
976 : YYFPRINTF (stderr, "\n");
977 : }
978 :
979 : # define YY_STACK_PRINT(Bottom, Top) \
980 : do { \
981 : if (yydebug) \
982 : yy_stack_print ((Bottom), (Top)); \
983 : } while (0)
984 :
985 :
986 : /*------------------------------------------------.
987 : | Report that the YYRULE is going to be reduced. |
988 : `------------------------------------------------*/
989 :
990 : static void
991 : yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
992 : {
993 : unsigned long int yylno = yyrline[yyrule];
994 : int yynrhs = yyr2[yyrule];
995 : int yyi;
996 : YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
997 : yyrule - 1, yylno);
998 : /* The symbols being reduced. */
999 : for (yyi = 0; yyi < yynrhs; yyi++)
1000 : {
1001 : YYFPRINTF (stderr, " $%d = ", yyi + 1);
1002 : yy_symbol_print (stderr,
1003 : yystos[yyssp[yyi + 1 - yynrhs]],
1004 : &(yyvsp[(yyi + 1) - (yynrhs)])
1005 : );
1006 : YYFPRINTF (stderr, "\n");
1007 : }
1008 : }
1009 :
1010 : # define YY_REDUCE_PRINT(Rule) \
1011 : do { \
1012 : if (yydebug) \
1013 : yy_reduce_print (yyssp, yyvsp, Rule); \
1014 : } while (0)
1015 :
1016 : /* Nonzero means print parse trace. It is left uninitialized so that
1017 : multiple parsers can coexist. */
1018 : int yydebug;
1019 : #else /* !YYDEBUG */
1020 : # define YYDPRINTF(Args)
1021 : # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1022 : # define YY_STACK_PRINT(Bottom, Top)
1023 : # define YY_REDUCE_PRINT(Rule)
1024 : #endif /* !YYDEBUG */
1025 :
1026 :
1027 : /* YYINITDEPTH -- initial size of the parser's stacks. */
1028 : #ifndef YYINITDEPTH
1029 : # define YYINITDEPTH 200
1030 : #endif
1031 :
1032 : /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1033 : if the built-in stack extension method is used).
1034 :
1035 : Do not make this value too large; the results are undefined if
1036 : YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1037 : evaluated with infinite-precision integer arithmetic. */
1038 :
1039 : #ifndef YYMAXDEPTH
1040 : # define YYMAXDEPTH 10000
1041 : #endif
1042 :
1043 :
1044 : #if YYERROR_VERBOSE
1045 :
1046 : # ifndef yystrlen
1047 : # if defined __GLIBC__ && defined _STRING_H
1048 : # define yystrlen strlen
1049 : # else
1050 : /* Return the length of YYSTR. */
1051 : static YYSIZE_T
1052 : yystrlen (const char *yystr)
1053 : {
1054 : YYSIZE_T yylen;
1055 : for (yylen = 0; yystr[yylen]; yylen++)
1056 : continue;
1057 : return yylen;
1058 : }
1059 : # endif
1060 : # endif
1061 :
1062 : # ifndef yystpcpy
1063 : # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1064 : # define yystpcpy stpcpy
1065 : # else
1066 : /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1067 : YYDEST. */
1068 : static char *
1069 : yystpcpy (char *yydest, const char *yysrc)
1070 : {
1071 : char *yyd = yydest;
1072 : const char *yys = yysrc;
1073 :
1074 : while ((*yyd++ = *yys++) != '\0')
1075 : continue;
1076 :
1077 : return yyd - 1;
1078 : }
1079 : # endif
1080 : # endif
1081 :
1082 : # ifndef yytnamerr
1083 : /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1084 : quotes and backslashes, so that it's suitable for yyerror. The
1085 : heuristic is that double-quoting is unnecessary unless the string
1086 : contains an apostrophe, a comma, or backslash (other than
1087 : backslash-backslash). YYSTR is taken from yytname. If YYRES is
1088 : null, do not copy; instead, return the length of what the result
1089 : would have been. */
1090 : static YYSIZE_T
1091 : yytnamerr (char *yyres, const char *yystr)
1092 : {
1093 : if (*yystr == '"')
1094 : {
1095 : YYSIZE_T yyn = 0;
1096 : char const *yyp = yystr;
1097 :
1098 : for (;;)
1099 : switch (*++yyp)
1100 : {
1101 : case '\'':
1102 : case ',':
1103 : goto do_not_strip_quotes;
1104 :
1105 : case '\\':
1106 : if (*++yyp != '\\')
1107 : goto do_not_strip_quotes;
1108 : /* Fall through. */
1109 : default:
1110 : if (yyres)
1111 : yyres[yyn] = *yyp;
1112 : yyn++;
1113 : break;
1114 :
1115 : case '"':
1116 : if (yyres)
1117 : yyres[yyn] = '\0';
1118 : return yyn;
1119 : }
1120 : do_not_strip_quotes: ;
1121 : }
1122 :
1123 : if (! yyres)
1124 : return yystrlen (yystr);
1125 :
1126 : return yystpcpy (yyres, yystr) - yyres;
1127 : }
1128 : # endif
1129 :
1130 : /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1131 : about the unexpected token YYTOKEN for the state stack whose top is
1132 : YYSSP.
1133 :
1134 : Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1135 : not large enough to hold the message. In that case, also set
1136 : *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1137 : required number of bytes is too large to store. */
1138 : static int
1139 : yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1140 : yytype_int16 *yyssp, int yytoken)
1141 : {
1142 : YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1143 : YYSIZE_T yysize = yysize0;
1144 : enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1145 : /* Internationalized format string. */
1146 : const char *yyformat = YY_NULLPTR;
1147 : /* Arguments of yyformat. */
1148 : char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1149 : /* Number of reported tokens (one for the "unexpected", one per
1150 : "expected"). */
1151 : int yycount = 0;
1152 :
1153 : /* There are many possibilities here to consider:
1154 : - If this state is a consistent state with a default action, then
1155 : the only way this function was invoked is if the default action
1156 : is an error action. In that case, don't check for expected
1157 : tokens because there are none.
1158 : - The only way there can be no lookahead present (in yychar) is if
1159 : this state is a consistent state with a default action. Thus,
1160 : detecting the absence of a lookahead is sufficient to determine
1161 : that there is no unexpected or expected token to report. In that
1162 : case, just report a simple "syntax error".
1163 : - Don't assume there isn't a lookahead just because this state is a
1164 : consistent state with a default action. There might have been a
1165 : previous inconsistent state, consistent state with a non-default
1166 : action, or user semantic action that manipulated yychar.
1167 : - Of course, the expected token list depends on states to have
1168 : correct lookahead information, and it depends on the parser not
1169 : to perform extra reductions after fetching a lookahead from the
1170 : scanner and before detecting a syntax error. Thus, state merging
1171 : (from LALR or IELR) and default reductions corrupt the expected
1172 : token list. However, the list is correct for canonical LR with
1173 : one exception: it will still contain any token that will not be
1174 : accepted due to an error action in a later state.
1175 : */
1176 : if (yytoken != YYEMPTY)
1177 : {
1178 : int yyn = yypact[*yyssp];
1179 : yyarg[yycount++] = yytname[yytoken];
1180 : if (!yypact_value_is_default (yyn))
1181 : {
1182 : /* Start YYX at -YYN if negative to avoid negative indexes in
1183 : YYCHECK. In other words, skip the first -YYN actions for
1184 : this state because they are default actions. */
1185 : int yyxbegin = yyn < 0 ? -yyn : 0;
1186 : /* Stay within bounds of both yycheck and yytname. */
1187 : int yychecklim = YYLAST - yyn + 1;
1188 : int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1189 : int yyx;
1190 :
1191 : for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1192 : if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1193 : && !yytable_value_is_error (yytable[yyx + yyn]))
1194 : {
1195 : if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1196 : {
1197 : yycount = 1;
1198 : yysize = yysize0;
1199 : break;
1200 : }
1201 : yyarg[yycount++] = yytname[yyx];
1202 : {
1203 : YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1204 : if (! (yysize <= yysize1
1205 : && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1206 : return 2;
1207 : yysize = yysize1;
1208 : }
1209 : }
1210 : }
1211 : }
1212 :
1213 : switch (yycount)
1214 : {
1215 : # define YYCASE_(N, S) \
1216 : case N: \
1217 : yyformat = S; \
1218 : break
1219 : YYCASE_(0, YY_("syntax error"));
1220 : YYCASE_(1, YY_("syntax error, unexpected %s"));
1221 : YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1222 : YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1223 : YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1224 : YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1225 : # undef YYCASE_
1226 : }
1227 :
1228 : {
1229 : YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1230 : if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1231 : return 2;
1232 : yysize = yysize1;
1233 : }
1234 :
1235 : if (*yymsg_alloc < yysize)
1236 : {
1237 : *yymsg_alloc = 2 * yysize;
1238 : if (! (yysize <= *yymsg_alloc
1239 : && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1240 : *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1241 : return 1;
1242 : }
1243 :
1244 : /* Avoid sprintf, as that infringes on the user's name space.
1245 : Don't have undefined behavior even if the translation
1246 : produced a string with the wrong number of "%s"s. */
1247 : {
1248 : char *yyp = *yymsg;
1249 : int yyi = 0;
1250 : while ((*yyp = *yyformat) != '\0')
1251 : if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1252 : {
1253 : yyp += yytnamerr (yyp, yyarg[yyi++]);
1254 : yyformat += 2;
1255 : }
1256 : else
1257 : {
1258 : yyp++;
1259 : yyformat++;
1260 : }
1261 : }
1262 : return 0;
1263 : }
1264 : #endif /* YYERROR_VERBOSE */
1265 :
1266 : /*-----------------------------------------------.
1267 : | Release the memory associated to this symbol. |
1268 : `-----------------------------------------------*/
1269 :
1270 : static void
1271 504 : yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1272 : {
1273 : YYUSE (yyvaluep);
1274 504 : if (!yymsg)
1275 0 : yymsg = "Deleting";
1276 : YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1277 :
1278 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1279 : YYUSE (yytype);
1280 : YY_IGNORE_MAYBE_UNINITIALIZED_END
1281 504 : }
1282 :
1283 :
1284 :
1285 :
1286 : /* The lookahead symbol. */
1287 : int yychar;
1288 :
1289 : /* The semantic value of the lookahead symbol. */
1290 : YYSTYPE yylval;
1291 : /* Number of syntax errors so far. */
1292 : int yynerrs;
1293 :
1294 :
1295 : /*----------.
1296 : | yyparse. |
1297 : `----------*/
1298 :
1299 : int
1300 266 : yyparse (void)
1301 : {
1302 : int yystate;
1303 : /* Number of tokens to shift before error messages enabled. */
1304 : int yyerrstatus;
1305 :
1306 : /* The stacks and their tools:
1307 : 'yyss': related to states.
1308 : 'yyvs': related to semantic values.
1309 :
1310 : Refer to the stacks through separate pointers, to allow yyoverflow
1311 : to reallocate them elsewhere. */
1312 :
1313 : /* The state stack. */
1314 : yytype_int16 yyssa[YYINITDEPTH];
1315 : yytype_int16 *yyss;
1316 : yytype_int16 *yyssp;
1317 :
1318 : /* The semantic value stack. */
1319 : YYSTYPE yyvsa[YYINITDEPTH];
1320 : YYSTYPE *yyvs;
1321 : YYSTYPE *yyvsp;
1322 :
1323 : YYSIZE_T yystacksize;
1324 :
1325 : int yyn;
1326 : int yyresult;
1327 : /* Lookahead token as an internal (translated) token number. */
1328 266 : int yytoken = 0;
1329 : /* The variables used to return semantic value and location from the
1330 : action routines. */
1331 : YYSTYPE yyval;
1332 :
1333 : #if YYERROR_VERBOSE
1334 : /* Buffer for error messages, and its allocated size. */
1335 : char yymsgbuf[128];
1336 : char *yymsg = yymsgbuf;
1337 : YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1338 : #endif
1339 :
1340 : #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1341 :
1342 : /* The number of symbols on the RHS of the reduced rule.
1343 : Keep to zero when no symbol should be popped. */
1344 266 : int yylen = 0;
1345 :
1346 266 : yyssp = yyss = yyssa;
1347 266 : yyvsp = yyvs = yyvsa;
1348 266 : yystacksize = YYINITDEPTH;
1349 :
1350 : YYDPRINTF ((stderr, "Starting parse\n"));
1351 :
1352 266 : yystate = 0;
1353 266 : yyerrstatus = 0;
1354 266 : yynerrs = 0;
1355 266 : yychar = YYEMPTY; /* Cause a token to be read. */
1356 266 : goto yysetstate;
1357 :
1358 : /*------------------------------------------------------------.
1359 : | yynewstate -- Push a new state, which is found in yystate. |
1360 : `------------------------------------------------------------*/
1361 429837 : yynewstate:
1362 : /* In all cases, when you get here, the value and location stacks
1363 : have just been pushed. So pushing a state here evens the stacks. */
1364 429837 : yyssp++;
1365 :
1366 430103 : yysetstate:
1367 430103 : *yyssp = yystate;
1368 :
1369 430103 : if (yyss + yystacksize - 1 <= yyssp)
1370 : {
1371 : /* Get the current used size of the three stacks, in elements. */
1372 0 : YYSIZE_T yysize = yyssp - yyss + 1;
1373 :
1374 : #ifdef yyoverflow
1375 : {
1376 : /* Give user a chance to reallocate the stack. Use copies of
1377 : these so that the &'s don't force the real ones into
1378 : memory. */
1379 : YYSTYPE *yyvs1 = yyvs;
1380 : yytype_int16 *yyss1 = yyss;
1381 :
1382 : /* Each stack pointer address is followed by the size of the
1383 : data in use in that stack, in bytes. This used to be a
1384 : conditional around just the two extra args, but that might
1385 : be undefined if yyoverflow is a macro. */
1386 : yyoverflow (YY_("memory exhausted"),
1387 : &yyss1, yysize * sizeof (*yyssp),
1388 : &yyvs1, yysize * sizeof (*yyvsp),
1389 : &yystacksize);
1390 :
1391 : yyss = yyss1;
1392 : yyvs = yyvs1;
1393 : }
1394 : #else /* no yyoverflow */
1395 : # ifndef YYSTACK_RELOCATE
1396 : goto yyexhaustedlab;
1397 : # else
1398 : /* Extend the stack our own way. */
1399 0 : if (YYMAXDEPTH <= yystacksize)
1400 0 : goto yyexhaustedlab;
1401 0 : yystacksize *= 2;
1402 0 : if (YYMAXDEPTH < yystacksize)
1403 0 : yystacksize = YYMAXDEPTH;
1404 :
1405 : {
1406 0 : yytype_int16 *yyss1 = yyss;
1407 0 : union yyalloc *yyptr =
1408 0 : (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1409 0 : if (! yyptr)
1410 0 : goto yyexhaustedlab;
1411 0 : YYSTACK_RELOCATE (yyss_alloc, yyss);
1412 0 : YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1413 : # undef YYSTACK_RELOCATE
1414 0 : if (yyss1 != yyssa)
1415 0 : YYSTACK_FREE (yyss1);
1416 : }
1417 : # endif
1418 : #endif /* no yyoverflow */
1419 :
1420 0 : yyssp = yyss + yysize - 1;
1421 0 : yyvsp = yyvs + yysize - 1;
1422 :
1423 : YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1424 : (unsigned long int) yystacksize));
1425 :
1426 0 : if (yyss + yystacksize - 1 <= yyssp)
1427 0 : YYABORT;
1428 : }
1429 :
1430 : YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1431 :
1432 430103 : if (yystate == YYFINAL)
1433 252 : YYACCEPT;
1434 :
1435 407214 : goto yybackup;
1436 :
1437 : /*-----------.
1438 : | yybackup. |
1439 : `-----------*/
1440 429837 : yybackup:
1441 :
1442 : /* Do appropriate processing given the current state. Read a
1443 : lookahead token if we need one and don't already have one. */
1444 :
1445 : /* First try to decide what to do without reference to lookahead token. */
1446 429837 : yyn = yypact[yystate];
1447 429837 : if (yypact_value_is_default (yyn))
1448 179064 : goto yydefault;
1449 :
1450 : /* Not known => get a lookahead token if don't already have one. */
1451 :
1452 : /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1453 240825 : if (yychar == YYEMPTY)
1454 : {
1455 : YYDPRINTF ((stderr, "Reading a token: "));
1456 174743 : yychar = yylex ();
1457 : }
1458 :
1459 240825 : if (yychar <= YYEOF)
1460 : {
1461 266 : yychar = yytoken = YYEOF;
1462 : YYDPRINTF ((stderr, "Now at end of input.\n"));
1463 : }
1464 : else
1465 : {
1466 240559 : yytoken = YYTRANSLATE (yychar);
1467 : YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1468 : }
1469 :
1470 : /* If the proper action on seeing token YYTOKEN is to reduce or to
1471 : detect an error, take that action. */
1472 240825 : yyn += yytoken;
1473 480187 : if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1474 : goto yydefault;
1475 174743 : yyn = yytable[yyn];
1476 174743 : if (yyn <= 0)
1477 : {
1478 : if (yytable_value_is_error (yyn))
1479 : goto yyerrlab;
1480 0 : yyn = -yyn;
1481 0 : goto yyreduce;
1482 : }
1483 :
1484 : /* Count tokens shifted since error; after three, turn off error
1485 : status. */
1486 174743 : if (yyerrstatus)
1487 0 : yyerrstatus--;
1488 :
1489 : /* Shift the lookahead token. */
1490 : YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1491 :
1492 : /* Discard the shifted token. */
1493 174743 : yychar = YYEMPTY;
1494 :
1495 174743 : yystate = yyn;
1496 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1497 174743 : *++yyvsp = yylval;
1498 : YY_IGNORE_MAYBE_UNINITIALIZED_END
1499 :
1500 174743 : goto yynewstate;
1501 :
1502 :
1503 : /*-----------------------------------------------------------.
1504 : | yydefault -- do the default action for the current state. |
1505 : `-----------------------------------------------------------*/
1506 76030 : yydefault:
1507 255094 : yyn = yydefact[yystate];
1508 255094 : if (yyn == 0)
1509 0 : goto yyerrlab;
1510 241668 : goto yyreduce;
1511 :
1512 :
1513 : /*-----------------------------.
1514 : | yyreduce -- Do a reduction. |
1515 : `-----------------------------*/
1516 255094 : yyreduce:
1517 : /* yyn is the number of a rule to reduce with. */
1518 255094 : yylen = yyr2[yyn];
1519 :
1520 : /* If YYLEN is nonzero, implement the default value of the action:
1521 : '$$ = $1'.
1522 :
1523 : Otherwise, the following line sets YYVAL to garbage.
1524 : This behavior is undocumented and Bison
1525 : users should not rely upon it. Assigning to YYVAL
1526 : unconditionally makes the parser a bit smaller, and it avoids a
1527 : GCC warning that YYVAL may be used uninitialized. */
1528 255094 : yyval = yyvsp[1-yylen];
1529 :
1530 :
1531 : YY_REDUCE_PRINT (yyn);
1532 255094 : switch (yyn)
1533 : {
1534 266 : case 2:
1535 :
1536 : {
1537 266 : checkundefined();
1538 : }
1539 :
1540 266 : break;
1541 :
1542 0 : case 4:
1543 :
1544 0 : { lex_error_message("implicit tagging is not supported"); }
1545 :
1546 0 : break;
1547 :
1548 0 : case 5:
1549 :
1550 0 : { lex_error_message("automatic tagging is not supported"); }
1551 :
1552 0 : break;
1553 :
1554 0 : case 7:
1555 :
1556 0 : { lex_error_message("no extensibility options supported"); }
1557 :
1558 0 : break;
1559 :
1560 323 : case 17:
1561 :
1562 : {
1563 : struct string_list *sl;
1564 1178 : for(sl = (yyvsp[-3].sl); sl != NULL; sl = sl->next) {
1565 855 : Symbol *s = addsym(sl->string);
1566 855 : s->stype = Stype;
1567 855 : gen_template_import(s);
1568 : }
1569 323 : add_import((yyvsp[-1].name));
1570 : }
1571 :
1572 323 : break;
1573 :
1574 19 : case 18:
1575 :
1576 19 : {
1577 : struct string_list *sl;
1578 1349 : for(sl = (yyvsp[-1].sl); sl != NULL; sl = sl->next)
1579 1330 : add_export(sl->string);
1580 : }
1581 :
1582 18 : break;
1583 :
1584 1843 : case 25:
1585 :
1586 : {
1587 1843 : (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1588 1843 : (yyval.sl)->string = (yyvsp[-2].name);
1589 1843 : (yyval.sl)->next = (yyvsp[0].sl);
1590 : }
1591 :
1592 1843 : break;
1593 :
1594 342 : case 26:
1595 :
1596 : {
1597 342 : (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
1598 342 : (yyval.sl)->string = (yyvsp[0].name);
1599 342 : (yyval.sl)->next = NULL;
1600 : }
1601 :
1602 342 : break;
1603 :
1604 5586 : case 27:
1605 :
1606 : {
1607 5586 : Symbol *s = addsym ((yyvsp[-2].name));
1608 5586 : s->stype = Stype;
1609 5586 : s->type = (yyvsp[0].type);
1610 5586 : fix_labels(s);
1611 5586 : generate_type (s);
1612 : }
1613 :
1614 5586 : break;
1615 :
1616 152 : case 45:
1617 :
1618 : {
1619 152 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Boolean,
1620 : TE_EXPLICIT, new_type(TBoolean));
1621 : }
1622 :
1623 152 : break;
1624 :
1625 646 : case 46:
1626 :
1627 : {
1628 646 : if((yyvsp[-3].value)->type != integervalue)
1629 0 : lex_error_message("Non-integer used in first part of range");
1630 646 : if((yyvsp[-3].value)->type != integervalue)
1631 0 : lex_error_message("Non-integer in second part of range");
1632 646 : (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1633 646 : (yyval.range)->min = (yyvsp[-3].value)->u.integervalue;
1634 646 : (yyval.range)->max = (yyvsp[-1].value)->u.integervalue;
1635 : }
1636 :
1637 646 : break;
1638 :
1639 133 : case 47:
1640 :
1641 : {
1642 133 : if((yyvsp[-3].value)->type != integervalue)
1643 0 : lex_error_message("Non-integer in first part of range");
1644 133 : (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1645 133 : (yyval.range)->min = (yyvsp[-3].value)->u.integervalue;
1646 133 : (yyval.range)->max = (yyvsp[-3].value)->u.integervalue - 1;
1647 : }
1648 :
1649 133 : break;
1650 :
1651 0 : case 48:
1652 :
1653 : {
1654 0 : if((yyvsp[-1].value)->type != integervalue)
1655 0 : lex_error_message("Non-integer in second part of range");
1656 0 : (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1657 0 : (yyval.range)->min = (yyvsp[-1].value)->u.integervalue + 2;
1658 0 : (yyval.range)->max = (yyvsp[-1].value)->u.integervalue;
1659 : }
1660 :
1661 0 : break;
1662 :
1663 19 : case 49:
1664 :
1665 : {
1666 19 : if((yyvsp[-1].value)->type != integervalue)
1667 0 : lex_error_message("Non-integer used in limit");
1668 19 : (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
1669 19 : (yyval.range)->min = (yyvsp[-1].value)->u.integervalue;
1670 19 : (yyval.range)->max = (yyvsp[-1].value)->u.integervalue;
1671 : }
1672 :
1673 19 : break;
1674 :
1675 874 : case 50:
1676 :
1677 : {
1678 874 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer,
1679 : TE_EXPLICIT, new_type(TInteger));
1680 : }
1681 :
1682 874 : break;
1683 :
1684 646 : case 51:
1685 :
1686 : {
1687 646 : (yyval.type) = new_type(TInteger);
1688 646 : (yyval.type)->range = (yyvsp[0].range);
1689 646 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1690 : }
1691 :
1692 646 : break;
1693 :
1694 247 : case 52:
1695 :
1696 : {
1697 247 : (yyval.type) = new_type(TInteger);
1698 247 : (yyval.type)->members = (yyvsp[-1].members);
1699 247 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
1700 : }
1701 :
1702 247 : break;
1703 :
1704 304 : case 53:
1705 :
1706 : {
1707 304 : (yyval.members) = emalloc(sizeof(*(yyval.members)));
1708 304 : ASN1_TAILQ_INIT((yyval.members));
1709 304 : ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[0].member), members);
1710 : }
1711 :
1712 304 : break;
1713 :
1714 3363 : case 54:
1715 :
1716 : {
1717 3363 : ASN1_TAILQ_INSERT_TAIL((yyvsp[-2].members), (yyvsp[0].member), members);
1718 3363 : (yyval.members) = (yyvsp[-2].members);
1719 : }
1720 :
1721 3363 : break;
1722 :
1723 0 : case 55:
1724 :
1725 0 : { (yyval.members) = (yyvsp[-2].members); }
1726 :
1727 0 : break;
1728 :
1729 3667 : case 56:
1730 :
1731 : {
1732 3667 : (yyval.member) = emalloc(sizeof(*(yyval.member)));
1733 3667 : (yyval.member)->name = (yyvsp[-3].name);
1734 3667 : (yyval.member)->gen_name = estrdup((yyvsp[-3].name));
1735 3667 : output_name ((yyval.member)->gen_name);
1736 3667 : (yyval.member)->val = (yyvsp[-1].constant);
1737 3667 : (yyval.member)->optional = 0;
1738 3667 : (yyval.member)->ellipsis = 0;
1739 3667 : (yyval.member)->type = NULL;
1740 : }
1741 :
1742 3667 : break;
1743 :
1744 57 : case 57:
1745 :
1746 : {
1747 57 : (yyval.type) = new_type(TInteger);
1748 57 : (yyval.type)->members = (yyvsp[-1].members);
1749 57 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Enumerated, TE_EXPLICIT, (yyval.type));
1750 : }
1751 :
1752 57 : break;
1753 :
1754 228 : case 59:
1755 :
1756 : {
1757 228 : (yyval.type) = new_type(TBitString);
1758 228 : (yyval.type)->members = emalloc(sizeof(*(yyval.type)->members));
1759 228 : ASN1_TAILQ_INIT((yyval.type)->members);
1760 228 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1761 : }
1762 :
1763 228 : break;
1764 :
1765 190 : case 60:
1766 :
1767 : {
1768 190 : (yyval.type) = new_type(TBitString);
1769 190 : (yyval.type)->members = (yyvsp[-1].members);
1770 190 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
1771 : }
1772 :
1773 190 : break;
1774 :
1775 3401 : case 61:
1776 :
1777 : {
1778 3401 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_OID,
1779 : TE_EXPLICIT, new_type(TOID));
1780 : }
1781 :
1782 3401 : break;
1783 :
1784 1824 : case 62:
1785 :
1786 : {
1787 1824 : Type *t = new_type(TOctetString);
1788 1824 : t->range = (yyvsp[0].range);
1789 1824 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_OctetString,
1790 : TE_EXPLICIT, t);
1791 : }
1792 :
1793 1824 : break;
1794 :
1795 57 : case 63:
1796 :
1797 : {
1798 57 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Null,
1799 : TE_EXPLICIT, new_type(TNull));
1800 : }
1801 :
1802 57 : break;
1803 :
1804 2698 : case 64:
1805 :
1806 2698 : { (yyval.range) = NULL; }
1807 :
1808 2698 : break;
1809 :
1810 152 : case 65:
1811 :
1812 152 : { (yyval.range) = (yyvsp[0].range); }
1813 :
1814 152 : break;
1815 :
1816 3173 : case 66:
1817 :
1818 : {
1819 3173 : (yyval.type) = new_type(TSequence);
1820 3173 : (yyval.type)->members = (yyvsp[-1].members);
1821 3173 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1822 : }
1823 :
1824 3173 : break;
1825 :
1826 0 : case 67:
1827 :
1828 : {
1829 0 : (yyval.type) = new_type(TSequence);
1830 0 : (yyval.type)->members = NULL;
1831 0 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1832 : }
1833 :
1834 0 : break;
1835 :
1836 1026 : case 68:
1837 :
1838 : {
1839 1026 : (yyval.type) = new_type(TSequenceOf);
1840 1026 : (yyval.type)->range = (yyvsp[-2].range);
1841 1026 : (yyval.type)->subtype = (yyvsp[0].type);
1842 1026 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
1843 : }
1844 :
1845 1026 : break;
1846 :
1847 0 : case 69:
1848 :
1849 : {
1850 0 : (yyval.type) = new_type(TSet);
1851 0 : (yyval.type)->members = (yyvsp[-1].members);
1852 0 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
1853 : }
1854 :
1855 0 : break;
1856 :
1857 0 : case 70:
1858 :
1859 : {
1860 0 : (yyval.type) = new_type(TSet);
1861 0 : (yyval.type)->members = NULL;
1862 0 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
1863 : }
1864 :
1865 0 : break;
1866 :
1867 342 : case 71:
1868 :
1869 : {
1870 342 : (yyval.type) = new_type(TSetOf);
1871 342 : (yyval.type)->subtype = (yyvsp[0].type);
1872 342 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
1873 : }
1874 :
1875 342 : break;
1876 :
1877 380 : case 72:
1878 :
1879 : {
1880 380 : (yyval.type) = new_type(TChoice);
1881 380 : (yyval.type)->members = (yyvsp[-1].members);
1882 : }
1883 :
1884 380 : break;
1885 :
1886 8816 : case 75:
1887 :
1888 : {
1889 8816 : Symbol *s = addsym((yyvsp[0].name));
1890 8816 : (yyval.type) = new_type(TType);
1891 8816 : if(s->stype != Stype && s->stype != SUndefined)
1892 0 : lex_error_message ("%s is not a type\n", (yyvsp[0].name));
1893 : else
1894 8816 : (yyval.type)->symbol = s;
1895 : }
1896 :
1897 8352 : break;
1898 :
1899 114 : case 76:
1900 :
1901 : {
1902 114 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralizedTime,
1903 : TE_EXPLICIT, new_type(TGeneralizedTime));
1904 : }
1905 :
1906 114 : break;
1907 :
1908 19 : case 77:
1909 :
1910 : {
1911 19 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTCTime,
1912 : TE_EXPLICIT, new_type(TUTCTime));
1913 : }
1914 :
1915 19 : break;
1916 :
1917 0 : case 78:
1918 :
1919 : {
1920 : /* if (Constraint.type == contentConstrant) {
1921 : assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
1922 : if (Constraint.u.constraint.type) {
1923 : assert((Constraint.u.constraint.type.length % 8) == 0);
1924 : }
1925 : }
1926 : if (Constraint.u.constraint.encoding) {
1927 : type == der-oid|ber-oid
1928 : }
1929 : */
1930 : }
1931 :
1932 0 : break;
1933 :
1934 0 : case 79:
1935 :
1936 : {
1937 0 : (yyval.constraint_spec) = (yyvsp[-1].constraint_spec);
1938 : }
1939 :
1940 0 : break;
1941 :
1942 0 : case 83:
1943 :
1944 : {
1945 0 : (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
1946 0 : (yyval.constraint_spec)->u.content.type = (yyvsp[0].type);
1947 0 : (yyval.constraint_spec)->u.content.encoding = NULL;
1948 : }
1949 :
1950 0 : break;
1951 :
1952 0 : case 84:
1953 :
1954 : {
1955 0 : if ((yyvsp[0].value)->type != objectidentifiervalue)
1956 0 : lex_error_message("Non-OID used in ENCODED BY constraint");
1957 0 : (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
1958 0 : (yyval.constraint_spec)->u.content.type = NULL;
1959 0 : (yyval.constraint_spec)->u.content.encoding = (yyvsp[0].value);
1960 : }
1961 :
1962 0 : break;
1963 :
1964 0 : case 85:
1965 :
1966 : {
1967 0 : if ((yyvsp[0].value)->type != objectidentifiervalue)
1968 0 : lex_error_message("Non-OID used in ENCODED BY constraint");
1969 0 : (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
1970 0 : (yyval.constraint_spec)->u.content.type = (yyvsp[-3].type);
1971 0 : (yyval.constraint_spec)->u.content.encoding = (yyvsp[0].value);
1972 : }
1973 :
1974 0 : break;
1975 :
1976 0 : case 86:
1977 :
1978 : {
1979 0 : (yyval.constraint_spec) = new_constraint_spec(CT_USER);
1980 : }
1981 :
1982 0 : break;
1983 :
1984 9538 : case 87:
1985 :
1986 : {
1987 9538 : (yyval.type) = new_type(TTag);
1988 9538 : (yyval.type)->tag = (yyvsp[-2].tag);
1989 9538 : (yyval.type)->tag.tagenv = (yyvsp[-1].constant);
1990 9538 : if((yyvsp[0].type)->type == TTag && (yyvsp[-1].constant) == TE_IMPLICIT) {
1991 760 : (yyval.type)->subtype = (yyvsp[0].type)->subtype;
1992 760 : free((yyvsp[0].type));
1993 : } else
1994 8778 : (yyval.type)->subtype = (yyvsp[0].type);
1995 : }
1996 :
1997 9036 : break;
1998 :
1999 9538 : case 88:
2000 :
2001 : {
2002 9538 : (yyval.tag).tagclass = (yyvsp[-2].constant);
2003 9538 : (yyval.tag).tagvalue = (yyvsp[-1].constant);
2004 9538 : (yyval.tag).tagenv = TE_EXPLICIT;
2005 : }
2006 :
2007 9538 : break;
2008 :
2009 9120 : case 89:
2010 :
2011 : {
2012 9120 : (yyval.constant) = ASN1_C_CONTEXT;
2013 : }
2014 :
2015 9120 : break;
2016 :
2017 0 : case 90:
2018 :
2019 : {
2020 0 : (yyval.constant) = ASN1_C_UNIV;
2021 : }
2022 :
2023 0 : break;
2024 :
2025 418 : case 91:
2026 :
2027 : {
2028 418 : (yyval.constant) = ASN1_C_APPL;
2029 : }
2030 :
2031 418 : break;
2032 :
2033 0 : case 92:
2034 :
2035 : {
2036 0 : (yyval.constant) = ASN1_C_PRIVATE;
2037 : }
2038 :
2039 0 : break;
2040 :
2041 8246 : case 93:
2042 :
2043 : {
2044 8246 : (yyval.constant) = TE_EXPLICIT;
2045 : }
2046 :
2047 8246 : break;
2048 :
2049 361 : case 94:
2050 :
2051 : {
2052 361 : (yyval.constant) = TE_EXPLICIT;
2053 : }
2054 :
2055 361 : break;
2056 :
2057 931 : case 95:
2058 :
2059 : {
2060 931 : (yyval.constant) = TE_IMPLICIT;
2061 : }
2062 :
2063 931 : break;
2064 :
2065 3230 : case 96:
2066 :
2067 : {
2068 : Symbol *s;
2069 3230 : s = addsym ((yyvsp[-3].name));
2070 :
2071 3230 : s->stype = SValue;
2072 3230 : s->value = (yyvsp[0].value);
2073 3230 : generate_constant (s);
2074 : }
2075 :
2076 3230 : break;
2077 :
2078 266 : case 98:
2079 :
2080 : {
2081 266 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralString,
2082 : TE_EXPLICIT, new_type(TGeneralString));
2083 : }
2084 :
2085 266 : break;
2086 :
2087 19 : case 99:
2088 :
2089 : {
2090 19 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_TeletexString,
2091 : TE_EXPLICIT, new_type(TTeletexString));
2092 : }
2093 :
2094 19 : break;
2095 :
2096 760 : case 100:
2097 :
2098 : {
2099 760 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTF8String,
2100 : TE_EXPLICIT, new_type(TUTF8String));
2101 : }
2102 :
2103 760 : break;
2104 :
2105 19 : case 101:
2106 :
2107 : {
2108 19 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_PrintableString,
2109 : TE_EXPLICIT, new_type(TPrintableString));
2110 : }
2111 :
2112 19 : break;
2113 :
2114 19 : case 102:
2115 :
2116 : {
2117 19 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_VisibleString,
2118 : TE_EXPLICIT, new_type(TVisibleString));
2119 : }
2120 :
2121 19 : break;
2122 :
2123 76 : case 103:
2124 :
2125 : {
2126 76 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_IA5String,
2127 : TE_EXPLICIT, new_type(TIA5String));
2128 : }
2129 :
2130 76 : break;
2131 :
2132 38 : case 104:
2133 :
2134 : {
2135 38 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_BMPString,
2136 : TE_EXPLICIT, new_type(TBMPString));
2137 : }
2138 :
2139 38 : break;
2140 :
2141 19 : case 105:
2142 :
2143 : {
2144 19 : (yyval.type) = new_tag(ASN1_C_UNIV, UT_UniversalString,
2145 : TE_EXPLICIT, new_type(TUniversalString));
2146 : }
2147 :
2148 19 : break;
2149 :
2150 3553 : case 106:
2151 :
2152 : {
2153 3553 : (yyval.members) = emalloc(sizeof(*(yyval.members)));
2154 3553 : ASN1_TAILQ_INIT((yyval.members));
2155 3553 : ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[0].member), members);
2156 : }
2157 :
2158 3553 : break;
2159 :
2160 9025 : case 107:
2161 :
2162 : {
2163 9025 : ASN1_TAILQ_INSERT_TAIL((yyvsp[-2].members), (yyvsp[0].member), members);
2164 9025 : (yyval.members) = (yyvsp[-2].members);
2165 : }
2166 :
2167 9025 : break;
2168 :
2169 608 : case 108:
2170 :
2171 : {
2172 608 : struct member *m = ecalloc(1, sizeof(*m));
2173 608 : m->name = estrdup("...");
2174 608 : m->gen_name = estrdup("asn1_ellipsis");
2175 608 : m->ellipsis = 1;
2176 608 : ASN1_TAILQ_INSERT_TAIL((yyvsp[-2].members), m, members);
2177 608 : (yyval.members) = (yyvsp[-2].members);
2178 : }
2179 :
2180 608 : break;
2181 :
2182 12578 : case 109:
2183 :
2184 : {
2185 12578 : (yyval.member) = emalloc(sizeof(*(yyval.member)));
2186 12578 : (yyval.member)->name = (yyvsp[-1].name);
2187 12578 : (yyval.member)->gen_name = estrdup((yyvsp[-1].name));
2188 12578 : output_name ((yyval.member)->gen_name);
2189 12578 : (yyval.member)->type = (yyvsp[0].type);
2190 12578 : (yyval.member)->ellipsis = 0;
2191 : }
2192 :
2193 12578 : break;
2194 :
2195 8189 : case 110:
2196 :
2197 : {
2198 8189 : (yyval.member) = (yyvsp[0].member);
2199 8189 : (yyval.member)->optional = 0;
2200 8189 : (yyval.member)->defval = NULL;
2201 : }
2202 :
2203 8189 : break;
2204 :
2205 4389 : case 111:
2206 :
2207 : {
2208 4389 : (yyval.member) = (yyvsp[-1].member);
2209 4389 : (yyval.member)->optional = 1;
2210 4389 : (yyval.member)->defval = NULL;
2211 : }
2212 :
2213 4389 : break;
2214 :
2215 0 : case 112:
2216 :
2217 : {
2218 0 : (yyval.member) = (yyvsp[-2].member);
2219 0 : (yyval.member)->optional = 0;
2220 0 : (yyval.member)->defval = (yyvsp[0].value);
2221 : }
2222 :
2223 0 : break;
2224 :
2225 190 : case 113:
2226 :
2227 : {
2228 190 : (yyval.members) = emalloc(sizeof(*(yyval.members)));
2229 190 : ASN1_TAILQ_INIT((yyval.members));
2230 190 : ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[0].member), members);
2231 : }
2232 :
2233 190 : break;
2234 :
2235 1539 : case 114:
2236 :
2237 : {
2238 1539 : ASN1_TAILQ_INSERT_TAIL((yyvsp[-2].members), (yyvsp[0].member), members);
2239 1539 : (yyval.members) = (yyvsp[-2].members);
2240 : }
2241 :
2242 1539 : break;
2243 :
2244 1729 : case 115:
2245 :
2246 : {
2247 1729 : (yyval.member) = emalloc(sizeof(*(yyval.member)));
2248 1729 : (yyval.member)->name = (yyvsp[-3].name);
2249 1729 : (yyval.member)->gen_name = estrdup((yyvsp[-3].name));
2250 1729 : output_name ((yyval.member)->gen_name);
2251 1729 : (yyval.member)->val = (yyvsp[-1].constant);
2252 1729 : (yyval.member)->optional = 0;
2253 1729 : (yyval.member)->ellipsis = 0;
2254 1729 : (yyval.member)->type = NULL;
2255 : }
2256 :
2257 1729 : break;
2258 :
2259 589 : case 117:
2260 :
2261 589 : { (yyval.objid) = NULL; }
2262 :
2263 589 : break;
2264 :
2265 3040 : case 118:
2266 :
2267 : {
2268 3040 : (yyval.objid) = (yyvsp[-1].objid);
2269 : }
2270 :
2271 3040 : break;
2272 :
2273 3040 : case 119:
2274 :
2275 : {
2276 3040 : (yyval.objid) = NULL;
2277 : }
2278 :
2279 3040 : break;
2280 :
2281 9234 : case 120:
2282 :
2283 : {
2284 9234 : if ((yyvsp[0].objid)) {
2285 6194 : (yyval.objid) = (yyvsp[0].objid);
2286 6194 : add_oid_to_tail((yyvsp[0].objid), (yyvsp[-1].objid));
2287 : } else {
2288 3040 : (yyval.objid) = (yyvsp[-1].objid);
2289 : }
2290 : }
2291 :
2292 8748 : break;
2293 :
2294 2964 : case 121:
2295 :
2296 : {
2297 3120 : (yyval.objid) = new_objid((yyvsp[-3].name), (yyvsp[-1].constant));
2298 : }
2299 :
2300 2964 : break;
2301 :
2302 2337 : case 122:
2303 :
2304 : {
2305 2337 : Symbol *s = addsym((yyvsp[0].name));
2306 4674 : if(s->stype != SValue ||
2307 2337 : s->value->type != objectidentifiervalue) {
2308 0 : lex_error_message("%s is not an object identifier\n",
2309 : s->name);
2310 0 : exit(1);
2311 : }
2312 2337 : (yyval.objid) = s->value->u.objectidentifiervalue;
2313 : }
2314 :
2315 2337 : break;
2316 :
2317 3933 : case 123:
2318 :
2319 : {
2320 4140 : (yyval.objid) = new_objid(NULL, (yyvsp[0].constant));
2321 : }
2322 :
2323 3933 : break;
2324 :
2325 0 : case 133:
2326 :
2327 : {
2328 0 : Symbol *s = addsym((yyvsp[0].name));
2329 0 : if(s->stype != SValue)
2330 0 : lex_error_message ("%s is not a value\n",
2331 : s->name);
2332 : else
2333 0 : (yyval.value) = s->value;
2334 : }
2335 :
2336 0 : break;
2337 :
2338 0 : case 134:
2339 :
2340 : {
2341 0 : (yyval.value) = emalloc(sizeof(*(yyval.value)));
2342 0 : (yyval.value)->type = stringvalue;
2343 0 : (yyval.value)->u.stringvalue = (yyvsp[0].name);
2344 : }
2345 :
2346 0 : break;
2347 :
2348 0 : case 135:
2349 :
2350 : {
2351 0 : (yyval.value) = emalloc(sizeof(*(yyval.value)));
2352 0 : (yyval.value)->type = booleanvalue;
2353 0 : (yyval.value)->u.booleanvalue = 0;
2354 : }
2355 :
2356 0 : break;
2357 :
2358 0 : case 136:
2359 :
2360 : {
2361 0 : (yyval.value) = emalloc(sizeof(*(yyval.value)));
2362 0 : (yyval.value)->type = booleanvalue;
2363 0 : (yyval.value)->u.booleanvalue = 0;
2364 : }
2365 :
2366 0 : break;
2367 :
2368 1634 : case 137:
2369 :
2370 : {
2371 1634 : (yyval.value) = emalloc(sizeof(*(yyval.value)));
2372 1634 : (yyval.value)->type = integervalue;
2373 1634 : (yyval.value)->u.integervalue = (yyvsp[0].constant);
2374 : }
2375 :
2376 1634 : break;
2377 :
2378 0 : case 139:
2379 :
2380 : {
2381 : }
2382 :
2383 0 : break;
2384 :
2385 3040 : case 140:
2386 :
2387 : {
2388 3040 : (yyval.value) = emalloc(sizeof(*(yyval.value)));
2389 3040 : (yyval.value)->type = objectidentifiervalue;
2390 3040 : (yyval.value)->u.objectidentifiervalue = (yyvsp[0].objid);
2391 : }
2392 :
2393 3040 : break;
2394 :
2395 :
2396 :
2397 94716 : default: break;
2398 : }
2399 : /* User semantic actions sometimes alter yychar, and that requires
2400 : that yytoken be updated with the new translation. We take the
2401 : approach of translating immediately before every use of yytoken.
2402 : One alternative is translating here after every semantic action,
2403 : but that translation would be missed if the semantic action invokes
2404 : YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2405 : if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2406 : incorrect destructor might then be invoked immediately. In the
2407 : case of YYERROR or YYBACKUP, subsequent parser actions might lead
2408 : to an incorrect destructor call or verbose syntax error message
2409 : before the lookahead is translated. */
2410 : YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2411 :
2412 255094 : YYPOPSTACK (yylen);
2413 255094 : yylen = 0;
2414 : YY_STACK_PRINT (yyss, yyssp);
2415 :
2416 255094 : *++yyvsp = yyval;
2417 :
2418 : /* Now 'shift' the result of the reduction. Determine what state
2419 : that goes to, based on the state we popped back to and the rule
2420 : number reduced by. */
2421 :
2422 255094 : yyn = yyr1[yyn];
2423 :
2424 255094 : yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2425 255094 : if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2426 87837 : yystate = yytable[yystate];
2427 : else
2428 167257 : yystate = yydefgoto[yyn - YYNTOKENS];
2429 :
2430 241668 : goto yynewstate;
2431 :
2432 :
2433 : /*--------------------------------------.
2434 : | yyerrlab -- here on detecting error. |
2435 : `--------------------------------------*/
2436 0 : yyerrlab:
2437 : /* Make sure we have latest lookahead translation. See comments at
2438 : user semantic actions for why this is necessary. */
2439 0 : yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2440 :
2441 : /* If not already recovering from an error, report this error. */
2442 0 : if (!yyerrstatus)
2443 : {
2444 0 : ++yynerrs;
2445 : #if ! YYERROR_VERBOSE
2446 0 : yyerror (YY_("syntax error"));
2447 : #else
2448 : # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2449 : yyssp, yytoken)
2450 : {
2451 : char const *yymsgp = YY_("syntax error");
2452 : int yysyntax_error_status;
2453 : yysyntax_error_status = YYSYNTAX_ERROR;
2454 : if (yysyntax_error_status == 0)
2455 : yymsgp = yymsg;
2456 : else if (yysyntax_error_status == 1)
2457 : {
2458 : if (yymsg != yymsgbuf)
2459 : YYSTACK_FREE (yymsg);
2460 : yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2461 : if (!yymsg)
2462 : {
2463 : yymsg = yymsgbuf;
2464 : yymsg_alloc = sizeof yymsgbuf;
2465 : yysyntax_error_status = 2;
2466 : }
2467 : else
2468 : {
2469 : yysyntax_error_status = YYSYNTAX_ERROR;
2470 : yymsgp = yymsg;
2471 : }
2472 : }
2473 : yyerror (yymsgp);
2474 : if (yysyntax_error_status == 2)
2475 : goto yyexhaustedlab;
2476 : }
2477 : # undef YYSYNTAX_ERROR
2478 : #endif
2479 : }
2480 :
2481 :
2482 :
2483 0 : if (yyerrstatus == 3)
2484 : {
2485 : /* If just tried and failed to reuse lookahead token after an
2486 : error, discard it. */
2487 :
2488 0 : if (yychar <= YYEOF)
2489 : {
2490 : /* Return failure if at end of input. */
2491 0 : if (yychar == YYEOF)
2492 0 : YYABORT;
2493 : }
2494 : else
2495 : {
2496 0 : yydestruct ("Error: discarding",
2497 : yytoken, &yylval);
2498 0 : yychar = YYEMPTY;
2499 : }
2500 : }
2501 :
2502 : /* Else will try to reuse lookahead token after shifting the error
2503 : token. */
2504 0 : goto yyerrlab1;
2505 :
2506 :
2507 : /*---------------------------------------------------.
2508 : | yyerrorlab -- error raised explicitly by YYERROR. |
2509 : `---------------------------------------------------*/
2510 : yyerrorlab:
2511 :
2512 : /* Pacify compilers like GCC when the user code never invokes
2513 : YYERROR and the label yyerrorlab therefore never appears in user
2514 : code. */
2515 : if (/*CONSTCOND*/ 0)
2516 : goto yyerrorlab;
2517 :
2518 : /* Do not reclaim the symbols of the rule whose action triggered
2519 : this YYERROR. */
2520 : YYPOPSTACK (yylen);
2521 : yylen = 0;
2522 : YY_STACK_PRINT (yyss, yyssp);
2523 : yystate = *yyssp;
2524 : goto yyerrlab1;
2525 :
2526 :
2527 : /*-------------------------------------------------------------.
2528 : | yyerrlab1 -- common code for both syntax error and YYERROR. |
2529 : `-------------------------------------------------------------*/
2530 0 : yyerrlab1:
2531 0 : yyerrstatus = 3; /* Each real token shifted decrements this. */
2532 :
2533 : for (;;)
2534 : {
2535 0 : yyn = yypact[yystate];
2536 0 : if (!yypact_value_is_default (yyn))
2537 : {
2538 0 : yyn += YYTERROR;
2539 0 : if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2540 : {
2541 0 : yyn = yytable[yyn];
2542 0 : if (0 < yyn)
2543 0 : break;
2544 : }
2545 : }
2546 :
2547 : /* Pop the current state because it cannot handle the error token. */
2548 0 : if (yyssp == yyss)
2549 0 : YYABORT;
2550 :
2551 :
2552 0 : yydestruct ("Error: popping",
2553 0 : yystos[yystate], yyvsp);
2554 0 : YYPOPSTACK (1);
2555 0 : yystate = *yyssp;
2556 : YY_STACK_PRINT (yyss, yyssp);
2557 : }
2558 :
2559 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2560 0 : *++yyvsp = yylval;
2561 : YY_IGNORE_MAYBE_UNINITIALIZED_END
2562 :
2563 :
2564 : /* Shift the error token. */
2565 : YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2566 :
2567 0 : yystate = yyn;
2568 0 : goto yynewstate;
2569 :
2570 :
2571 : /*-------------------------------------.
2572 : | yyacceptlab -- YYACCEPT comes here. |
2573 : `-------------------------------------*/
2574 280 : yyacceptlab:
2575 252 : yyresult = 0;
2576 252 : goto yyreturn;
2577 :
2578 : /*-----------------------------------.
2579 : | yyabortlab -- YYABORT comes here. |
2580 : `-----------------------------------*/
2581 0 : yyabortlab:
2582 0 : yyresult = 1;
2583 0 : goto yyreturn;
2584 :
2585 : #if !defined yyoverflow || YYERROR_VERBOSE
2586 : /*-------------------------------------------------.
2587 : | yyexhaustedlab -- memory exhaustion comes here. |
2588 : `-------------------------------------------------*/
2589 0 : yyexhaustedlab:
2590 0 : yyerror (YY_("memory exhausted"));
2591 0 : yyresult = 2;
2592 : /* Fall through. */
2593 : #endif
2594 :
2595 266 : yyreturn:
2596 252 : if (yychar != YYEMPTY)
2597 : {
2598 : /* Make sure we have latest lookahead translation. See comments at
2599 : user semantic actions for why this is necessary. */
2600 0 : yytoken = YYTRANSLATE (yychar);
2601 0 : yydestruct ("Cleanup: discarding lookahead",
2602 : yytoken, &yylval);
2603 : }
2604 : /* Do not reclaim the symbols of the rule whose action triggered
2605 : this YYABORT or YYACCEPT. */
2606 252 : YYPOPSTACK (yylen);
2607 : YY_STACK_PRINT (yyss, yyssp);
2608 1008 : while (yyssp != yyss)
2609 : {
2610 504 : yydestruct ("Cleanup: popping",
2611 504 : yystos[*yyssp], yyvsp);
2612 504 : YYPOPSTACK (1);
2613 : }
2614 : #ifndef yyoverflow
2615 266 : if (yyss != yyssa)
2616 0 : YYSTACK_FREE (yyss);
2617 : #endif
2618 : #if YYERROR_VERBOSE
2619 : if (yymsg != yymsgbuf)
2620 : YYSTACK_FREE (yymsg);
2621 : #endif
2622 266 : return yyresult;
2623 : }
2624 :
2625 :
2626 :
2627 : void
2628 0 : yyerror (const char *s)
2629 : {
2630 0 : lex_error_message ("%s\n", s);
2631 0 : }
2632 :
2633 : static Type *
2634 13566 : new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype)
2635 : {
2636 : Type *t;
2637 13566 : if(oldtype->type == TTag && oldtype->tag.tagenv == TE_IMPLICIT) {
2638 0 : t = oldtype;
2639 0 : oldtype = oldtype->subtype; /* XXX */
2640 : } else
2641 13566 : t = new_type (TTag);
2642 :
2643 13566 : t->tag.tagclass = tagclass;
2644 13566 : t->tag.tagvalue = tagvalue;
2645 13566 : t->tag.tagenv = tagenv;
2646 13566 : t->subtype = oldtype;
2647 13566 : return t;
2648 : }
2649 :
2650 : static struct objid *
2651 6534 : new_objid(const char *label, int value)
2652 : {
2653 : struct objid *s;
2654 6897 : s = emalloc(sizeof(*s));
2655 6897 : s->label = label;
2656 6897 : s->value = value;
2657 6897 : s->next = NULL;
2658 6534 : return s;
2659 : }
2660 :
2661 : static void
2662 5868 : add_oid_to_tail(struct objid *head, struct objid *tail)
2663 : {
2664 : struct objid *o;
2665 6194 : o = head;
2666 21505 : while (o->next)
2667 8946 : o = o->next;
2668 6194 : o->next = tail;
2669 5868 : }
2670 :
2671 : static Type *
2672 43452 : new_type (Typetype tt)
2673 : {
2674 45866 : Type *t = ecalloc(1, sizeof(*t));
2675 45866 : t->type = tt;
2676 43452 : return t;
2677 : }
2678 :
2679 : static struct constraint_spec *
2680 0 : new_constraint_spec(enum ctype ct)
2681 : {
2682 0 : struct constraint_spec *c = ecalloc(1, sizeof(*c));
2683 0 : c->ctype = ct;
2684 0 : return c;
2685 : }
2686 :
2687 : static void fix_labels2(Type *t, const char *prefix);
2688 38684 : static void fix_labels1(struct memhead *members, const char *prefix)
2689 : {
2690 : Member *m;
2691 :
2692 38684 : if(members == NULL)
2693 32598 : return;
2694 22857 : ASN1_TAILQ_FOREACH(m, members, members) {
2695 19560 : if (asprintf(&m->label, "%s_%s", prefix, m->gen_name) < 0)
2696 0 : errx(1, "malloc");
2697 18582 : if (m->label == NULL)
2698 0 : errx(1, "malloc");
2699 18582 : if(m->type != NULL)
2700 12578 : fix_labels2(m->type, m->label);
2701 : }
2702 : }
2703 :
2704 17870 : static void fix_labels2(Type *t, const char *prefix)
2705 : {
2706 56554 : for(; t; t = t->subtype)
2707 38684 : fix_labels1(t->members, prefix);
2708 17870 : }
2709 :
2710 : static void
2711 5586 : fix_labels(Symbol *s)
2712 : {
2713 5586 : char *p = NULL;
2714 5880 : if (asprintf(&p, "choice_%s", s->gen_name) < 0 || p == NULL)
2715 0 : errx(1, "malloc");
2716 5880 : fix_labels2(s->type, p);
2717 5586 : free(p);
2718 5586 : }
|