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