source: trunk/server/source4/heimdal/lib/asn1/asn1parse.c

Last change on this file was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

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