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