Coverage Report

Created: 2025-07-11 06:59

/src/libtasn1/lib/ASN1.c
Line
Count
Source (jump to first uncovered line)
1
/* A Bison parser, made by GNU Bison 3.5.1.  */
2
3
/* Bison implementation for Yacc-like parsers in C
4
5
   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
6
   Inc.
7
8
   This program is free software: you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation, either version 3 of the License, or
11
   (at your option) any later version.
12
13
   This program is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17
18
   You should have received a copy of the GNU General Public License
19
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20
21
/* As a special exception, you may create a larger work that contains
22
   part or all of the Bison parser skeleton and distribute that work
23
   under terms of your choice, so long as that work isn't itself a
24
   parser generator using the skeleton or a modified version thereof
25
   as a parser skeleton.  Alternatively, if you modify or redistribute
26
   the parser skeleton itself, you may (at your option) remove this
27
   special exception, which will cause the skeleton and the resulting
28
   Bison output files to be licensed under the GNU General Public
29
   License without this special exception.
30
31
   This special exception was added by the Free Software Foundation in
32
   version 2.2 of Bison.  */
33
34
/* C LALR(1) parser skeleton written by Richard Stallman, by
35
   simplifying the original so-called "semantic" parser.  */
36
37
/* All symbols defined below should begin with yy or YY, to avoid
38
   infringing on user name space.  This should be done even for local
39
   variables, as they might otherwise be expanded by user macros.
40
   There are some unavoidable exceptions within include files to
41
   define necessary library symbols; they are noted "INFRINGES ON
42
   USER NAME SPACE" below.  */
43
44
/* Undocumented macros, especially those whose name start with YY_,
45
   are private implementation details.  Do not rely on them.  */
46
47
/* Identify Bison output.  */
48
#define YYBISON 1
49
50
/* Bison version.  */
51
#define YYBISON_VERSION "3.5.1"
52
53
/* Skeleton name.  */
54
#define YYSKELETON_NAME "yacc.c"
55
56
/* Pure parsers.  */
57
#define YYPURE 0
58
59
/* Push parsers.  */
60
#define YYPUSH 0
61
62
/* Pull parsers.  */
63
#define YYPULL 1
64
65
/* Substitute the type names.  */
66
9.04k
#define YYSTYPE         _ASN1_YYSTYPE
67
/* Substitute the variable and function names.  */
68
2.26k
#define yyparse         _asn1_yyparse
69
165k
#define yylex           _asn1_yylex
70
1.29k
#define yyerror         _asn1_yyerror
71
#define yydebug         _asn1_yydebug
72
3.55k
#define yynerrs         _asn1_yynerrs
73
280k
#define yylval          _asn1_yylval
74
733k
#define yychar          _asn1_yychar
75
76
/* First part of user prologue.  */
77
#line 1 "ASN1.y"
78
79
/*
80
 * Copyright (C) 2001-2025 Free Software Foundation, Inc.
81
 *
82
 * This file is part of LIBTASN1.
83
 *
84
 * The LIBTASN1 library is free software; you can redistribute it
85
 * and/or modify it under the terms of the GNU Lesser General Public
86
 * License as published by the Free Software Foundation; either
87
 * version 2.1 of the License, or (at your option) any later version.
88
 *
89
 * This library is distributed in the hope that it will be useful, but
90
 * WITHOUT ANY WARRANTY; without even the implied warranty of
91
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
92
 * Lesser General Public License for more details.
93
 *
94
 * You should have received a copy of the GNU Lesser General Public
95
 * License along with this library; if not, see
96
 * <https://www.gnu.org/licenses/>.
97
 */
98
99
#include <config.h>
100
101
/*****************************************************/
102
/* File: x509_ASN.y                                  */
103
/* Description: input file for 'bison' program.      */
104
/*   The output file is a parser (in C language) for */
105
/*   ASN.1 syntax                                    */
106
/*****************************************************/
107
108
#include "int.h"
109
#include "parser_aux.h"
110
#include "structure.h"
111
#include <libtasn1.h>
112
#include "c-ctype.h"
113
114
static list_type *e_list = NULL;
115
static FILE *file_asn1;     /* Pointer to file to parse */
116
static int result_parse = 0;  /* result of the parser
117
             algorithm */
118
static asn1_node p_tree;    /* pointer to the root of the
119
             structure created by the
120
             parser*/
121
static unsigned int line_number;  /* line number describing the
122
             parser position inside the
123
             file */
124
static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
125
static char last_error_token[ASN1_MAX_ERROR_DESCRIPTION_SIZE+1] = ""; /* used when expected errors occur */
126
static char last_token[ASN1_MAX_NAME_SIZE+1] = ""; /* last token find in the file
127
             to parse before the 'parse
128
             error' */
129
extern char _asn1_identifierMissing[];
130
static const char *file_name;   /* file to parse */
131
132
static void _asn1_yyerror (const char *);
133
static int _asn1_yylex(void);
134
135
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
136
2.68k
#define SAFE_COPY(dst, dst_size, fmt, ...) { snprintf(dst, dst_size, fmt, __VA_ARGS__); }
137
#else
138
#define SAFE_COPY(dst, dst_size, fmt, ...) { \
139
  int _ret = snprintf(dst, dst_size, fmt, __VA_ARGS__); \
140
  if (_ret != (int)strlen(dst)) \
141
    { \
142
      fprintf(stderr, "%s:%u: Oversize value\n", \
143
               file_name, line_number); \
144
      exit(EXIT_FAILURE);   \
145
    } \
146
}
147
#endif
148
149
#line 150 "ASN1.c"
150
151
# ifndef YY_CAST
152
#  ifdef __cplusplus
153
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
154
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
155
#  else
156
349k
#   define YY_CAST(Type, Val) ((Type) (Val))
157
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
158
#  endif
159
# endif
160
# ifndef YY_NULLPTR
161
#  if defined __cplusplus
162
#   if 201103L <= __cplusplus
163
#    define YY_NULLPTR nullptr
164
#   else
165
#    define YY_NULLPTR 0
166
#   endif
167
#  else
168
5.37k
#   define YY_NULLPTR ((void*)0)
169
#  endif
170
# endif
171
172
/* Enabling verbose error messages.  */
173
#ifdef YYERROR_VERBOSE
174
# undef YYERROR_VERBOSE
175
# define YYERROR_VERBOSE 1
176
#else
177
# define YYERROR_VERBOSE 1
178
#endif
179
180
181
/* Debug traces.  */
182
#ifndef _ASN1_YYDEBUG
183
# if defined YYDEBUG
184
#if YYDEBUG
185
#   define _ASN1_YYDEBUG 1
186
#  else
187
#   define _ASN1_YYDEBUG 0
188
#  endif
189
# else /* ! defined YYDEBUG */
190
#  define _ASN1_YYDEBUG 0
191
# endif /* ! defined YYDEBUG */
192
#endif  /* ! defined _ASN1_YYDEBUG */
193
#if _ASN1_YYDEBUG
194
extern int _asn1_yydebug;
195
#endif
196
197
/* Token type.  */
198
#ifndef _ASN1_YYTOKENTYPE
199
# define _ASN1_YYTOKENTYPE
200
  enum _asn1_yytokentype
201
  {
202
    ASSIG = 258,
203
    NUM = 259,
204
    IDENTIFIER = 260,
205
    OPTIONAL = 261,
206
    INTEGER = 262,
207
    SIZE = 263,
208
    OCTET = 264,
209
    STRING = 265,
210
    SEQUENCE = 266,
211
    BIT = 267,
212
    UNIVERSAL = 268,
213
    PRIVATE = 269,
214
    APPLICATION = 270,
215
    DEFAULT = 271,
216
    CHOICE = 272,
217
    OF = 273,
218
    OBJECT = 274,
219
    STR_IDENTIFIER = 275,
220
    BOOLEAN = 276,
221
    ASN1_TRUE = 277,
222
    ASN1_FALSE = 278,
223
    TOKEN_NULL = 279,
224
    ANY = 280,
225
    DEFINED = 281,
226
    BY = 282,
227
    SET = 283,
228
    EXPLICIT = 284,
229
    IMPLICIT = 285,
230
    DEFINITIONS = 286,
231
    TAGS = 287,
232
    BEGIN = 288,
233
    END = 289,
234
    UTCTime = 290,
235
    GeneralizedTime = 291,
236
    GeneralString = 292,
237
    NumericString = 293,
238
    IA5String = 294,
239
    TeletexString = 295,
240
    PrintableString = 296,
241
    UniversalString = 297,
242
    BMPString = 298,
243
    UTF8String = 299,
244
    VisibleString = 300,
245
    FROM = 301,
246
    IMPORTS = 302,
247
    ENUMERATED = 303
248
  };
249
#endif
250
/* Tokens.  */
251
#define ASSIG 258
252
13.8k
#define NUM 259
253
44.1k
#define IDENTIFIER 260
254
#define OPTIONAL 261
255
#define INTEGER 262
256
#define SIZE 263
257
#define OCTET 264
258
#define STRING 265
259
#define SEQUENCE 266
260
#define BIT 267
261
#define UNIVERSAL 268
262
#define PRIVATE 269
263
#define APPLICATION 270
264
#define DEFAULT 271
265
#define CHOICE 272
266
#define OF 273
267
#define OBJECT 274
268
#define STR_IDENTIFIER 275
269
#define BOOLEAN 276
270
#define ASN1_TRUE 277
271
#define ASN1_FALSE 278
272
#define TOKEN_NULL 279
273
#define ANY 280
274
#define DEFINED 281
275
#define BY 282
276
#define SET 283
277
#define EXPLICIT 284
278
#define IMPLICIT 285
279
#define DEFINITIONS 286
280
#define TAGS 287
281
#define BEGIN 288
282
#define END 289
283
#define UTCTime 290
284
#define GeneralizedTime 291
285
#define GeneralString 292
286
#define NumericString 293
287
#define IA5String 294
288
#define TeletexString 295
289
#define PrintableString 296
290
#define UniversalString 297
291
#define BMPString 298
292
#define UTF8String 299
293
#define VisibleString 300
294
#define FROM 301
295
#define IMPORTS 302
296
#define ENUMERATED 303
297
298
/* Value type.  */
299
#if ! defined _ASN1_YYSTYPE && ! defined _ASN1_YYSTYPE_IS_DECLARED
300
union _ASN1_YYSTYPE
301
{
302
#line 78 "ASN1.y"
303
304
  unsigned int constant;
305
  char str[ASN1_MAX_NAME_SIZE+1];
306
  asn1_node node;
307
308
#line 309 "ASN1.c"
309
310
};
311
typedef union _ASN1_YYSTYPE _ASN1_YYSTYPE;
312
# define _ASN1_YYSTYPE_IS_TRIVIAL 1
313
# define _ASN1_YYSTYPE_IS_DECLARED 1
314
#endif
315
316
317
extern _ASN1_YYSTYPE _asn1_yylval;
318
319
int _asn1_yyparse (void);
320
321
322
323
324
325
#ifdef short
326
# undef short
327
#endif
328
329
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
330
   <limits.h> and (if available) <stdint.h> are included
331
   so that the code can choose integer types of a good width.  */
332
333
#ifndef __PTRDIFF_MAX__
334
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
335
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
336
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
337
#  define YY_STDINT_H
338
# endif
339
#endif
340
341
/* Narrow types that promote to a signed type and that can represent a
342
   signed or unsigned integer of at least N bits.  In tables they can
343
   save space and decrease cache pressure.  Promoting to a signed type
344
   helps avoid bugs in integer arithmetic.  */
345
346
#ifdef __INT_LEAST8_MAX__
347
typedef __INT_LEAST8_TYPE__ yytype_int8;
348
#elif defined YY_STDINT_H
349
typedef int_least8_t yytype_int8;
350
#else
351
typedef signed char yytype_int8;
352
#endif
353
354
#ifdef __INT_LEAST16_MAX__
355
typedef __INT_LEAST16_TYPE__ yytype_int16;
356
#elif defined YY_STDINT_H
357
typedef int_least16_t yytype_int16;
358
#else
359
typedef short yytype_int16;
360
#endif
361
362
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
363
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
364
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
365
       && UINT_LEAST8_MAX <= INT_MAX)
366
typedef uint_least8_t yytype_uint8;
367
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
368
typedef unsigned char yytype_uint8;
369
#else
370
typedef short yytype_uint8;
371
#endif
372
373
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
374
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
375
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
376
       && UINT_LEAST16_MAX <= INT_MAX)
377
typedef uint_least16_t yytype_uint16;
378
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
379
typedef unsigned short yytype_uint16;
380
#else
381
typedef int yytype_uint16;
382
#endif
383
384
#ifndef YYPTRDIFF_T
385
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
386
11.4k
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
387
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
388
# elif defined PTRDIFF_MAX
389
#  ifndef ptrdiff_t
390
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
391
#  endif
392
#  define YYPTRDIFF_T ptrdiff_t
393
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
394
# else
395
#  define YYPTRDIFF_T long
396
#  define YYPTRDIFF_MAXIMUM LONG_MAX
397
# endif
398
#endif
399
400
#ifndef YYSIZE_T
401
# ifdef __SIZE_TYPE__
402
#  define YYSIZE_T __SIZE_TYPE__
403
# elif defined size_t
404
#  define YYSIZE_T size_t
405
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
406
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
407
#  define YYSIZE_T size_t
408
# else
409
#  define YYSIZE_T unsigned
410
# endif
411
#endif
412
413
#define YYSIZE_MAXIMUM                                  \
414
4.07k
  YY_CAST (YYPTRDIFF_T,                                 \
415
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
416
            ? YYPTRDIFF_MAXIMUM                         \
417
            : YY_CAST (YYSIZE_T, -1)))
418
419
168
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
420
421
/* Stored state numbers (used for stacks). */
422
typedef yytype_uint8 yy_state_t;
423
424
/* State numbers in computations.  */
425
typedef int yy_state_fast_t;
426
427
#ifndef YY_
428
# if defined YYENABLE_NLS && YYENABLE_NLS
429
#  if ENABLE_NLS
430
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
431
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
432
#  endif
433
# endif
434
# ifndef YY_
435
1.29k
#  define YY_(Msgid) Msgid
436
# endif
437
#endif
438
439
#ifndef YY_ATTRIBUTE_PURE
440
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
441
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
442
# else
443
#  define YY_ATTRIBUTE_PURE
444
# endif
445
#endif
446
447
#ifndef YY_ATTRIBUTE_UNUSED
448
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
449
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
450
# else
451
#  define YY_ATTRIBUTE_UNUSED
452
# endif
453
#endif
454
455
/* Suppress unused-variable warnings by "using" E.  */
456
#if ! defined lint || defined __GNUC__
457
37.4k
# define YYUSE(E) ((void) (E))
458
#else
459
# define YYUSE(E) /* empty */
460
#endif
461
462
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
463
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
464
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
465
    _Pragma ("GCC diagnostic push")                                     \
466
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
467
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
468
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
469
    _Pragma ("GCC diagnostic pop")
470
#else
471
# define YY_INITIAL_VALUE(Value) Value
472
#endif
473
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
474
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
475
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
476
#endif
477
#ifndef YY_INITIAL_VALUE
478
# define YY_INITIAL_VALUE(Value) /* Nothing. */
479
#endif
480
481
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
482
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
483
    _Pragma ("GCC diagnostic push")                            \
484
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
485
# define YY_IGNORE_USELESS_CAST_END            \
486
    _Pragma ("GCC diagnostic pop")
487
#endif
488
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
489
# define YY_IGNORE_USELESS_CAST_BEGIN
490
# define YY_IGNORE_USELESS_CAST_END
491
#endif
492
493
494
340k
#define YY_ASSERT(E) ((void) (0 && (E)))
495
496
#if ! defined yyoverflow || YYERROR_VERBOSE
497
498
/* The parser invokes alloca or malloc; define the necessary symbols.  */
499
500
# ifdef YYSTACK_USE_ALLOCA
501
#  if YYSTACK_USE_ALLOCA
502
#   ifdef __GNUC__
503
#    define YYSTACK_ALLOC __builtin_alloca
504
#   elif defined __BUILTIN_VA_ARG_INCR
505
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
506
#   elif defined _AIX
507
#    define YYSTACK_ALLOC __alloca
508
#   elif defined _MSC_VER
509
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
510
#    define alloca _alloca
511
#   else
512
#    define YYSTACK_ALLOC alloca
513
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
514
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
515
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
516
#     ifndef EXIT_SUCCESS
517
#      define EXIT_SUCCESS 0
518
#     endif
519
#    endif
520
#   endif
521
#  endif
522
# endif
523
524
# ifdef YYSTACK_ALLOC
525
   /* Pacify GCC's 'empty if-body' warning.  */
526
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
527
#  ifndef YYSTACK_ALLOC_MAXIMUM
528
    /* The OS might guarantee only one guard page at the bottom of the stack,
529
       and a page size can be as small as 4096 bytes.  So we cannot safely
530
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
531
       to allow for a few compiler-allocated temporary stack slots.  */
532
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
533
#  endif
534
# else
535
#  define YYSTACK_ALLOC YYMALLOC
536
28
#  define YYSTACK_FREE YYFREE
537
#  ifndef YYSTACK_ALLOC_MAXIMUM
538
4.07k
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
539
#  endif
540
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
541
       && ! ((defined YYMALLOC || defined malloc) \
542
             && (defined YYFREE || defined free)))
543
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
544
#   ifndef EXIT_SUCCESS
545
#    define EXIT_SUCCESS 0
546
#   endif
547
#  endif
548
#  ifndef YYMALLOC
549
#   define YYMALLOC malloc
550
#   if ! defined malloc && ! defined EXIT_SUCCESS
551
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
552
#   endif
553
#  endif
554
#  ifndef YYFREE
555
28
#   define YYFREE free
556
#   if ! defined free && ! defined EXIT_SUCCESS
557
void free (void *); /* INFRINGES ON USER NAME SPACE */
558
#   endif
559
#  endif
560
# endif
561
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
562
563
564
#if (! defined yyoverflow \
565
     && (! defined __cplusplus \
566
         || (defined _ASN1_YYSTYPE_IS_TRIVIAL && _ASN1_YYSTYPE_IS_TRIVIAL)))
567
568
/* A type that is properly aligned for any stack member.  */
569
union yyalloc
570
{
571
  yy_state_t yyss_alloc;
572
  YYSTYPE yyvs_alloc;
573
};
574
575
/* The size of the maximum gap between one aligned stack and the next.  */
576
56
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
577
578
/* The size of an array large to enough to hold all stacks, each with
579
   N elements.  */
580
# define YYSTACK_BYTES(N) \
581
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
582
      + YYSTACK_GAP_MAXIMUM)
583
584
# define YYCOPY_NEEDED 1
585
586
/* Relocate STACK from its old location to the new one.  The
587
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
588
   elements in the stack, and YYPTR gives the new location of the
589
   stack.  Advance YYPTR to a properly aligned location for the next
590
   stack.  */
591
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
592
56
    do                                                                  \
593
56
      {                                                                 \
594
56
        YYPTRDIFF_T yynewbytes;                                         \
595
56
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
596
56
        Stack = &yyptr->Stack_alloc;                                    \
597
56
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
598
56
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
599
56
      }                                                                 \
600
56
    while (0)
601
602
#endif
603
604
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
605
/* Copy COUNT objects from SRC to DST.  The source and destination do
606
   not overlap.  */
607
# ifndef YYCOPY
608
#  if defined __GNUC__ && 1 < __GNUC__
609
#   define YYCOPY(Dst, Src, Count) \
610
56
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
611
#  else
612
#   define YYCOPY(Dst, Src, Count)              \
613
      do                                        \
614
        {                                       \
615
          YYPTRDIFF_T yyi;                      \
616
          for (yyi = 0; yyi < (Count); yyi++)   \
617
            (Dst)[yyi] = (Src)[yyi];            \
618
        }                                       \
619
      while (0)
620
#  endif
621
# endif
622
#endif /* !YYCOPY_NEEDED */
623
624
/* YYFINAL -- State number of the termination state.  */
625
340k
#define YYFINAL  5
626
/* YYLAST -- Last index in YYTABLE.  */
627
542k
#define YYLAST   248
628
629
/* YYNTOKENS -- Number of terminals.  */
630
176k
#define YYNTOKENS  60
631
/* YYNNTS -- Number of nonterminals.  */
632
#define YYNNTS  54
633
/* YYNRULES -- Number of rules.  */
634
#define YYNRULES  137
635
/* YYNSTATES -- Number of states.  */
636
#define YYNSTATES  238
637
638
0
#define YYUNDEFTOK  2
639
198k
#define YYMAXUTOK   303
640
641
642
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
643
   as returned by yylex, with out-of-bounds checking.  */
644
#define YYTRANSLATE(YYX)                                                \
645
199k
  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
646
647
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
648
   as returned by yylex.  */
649
static const yytype_int8 yytranslate[] =
650
{
651
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
652
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
653
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
654
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
655
      51,    52,     2,    49,    53,    50,    59,     2,     2,     2,
656
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
657
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
658
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
659
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
660
       2,    54,     2,    55,     2,     2,     2,     2,     2,     2,
661
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
662
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
663
       2,     2,     2,    57,    56,    58,     2,     2,     2,     2,
664
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
665
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
666
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
667
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
668
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
669
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
670
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
671
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
672
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
673
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
674
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
675
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
676
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
677
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
678
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
679
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
680
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
681
      45,    46,    47,    48
682
};
683
684
#if _ASN1_YYDEBUG
685
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
686
static const yytype_int16 yyrline[] =
687
{
688
       0,   152,   152,   165,   166,   169,   172,   173,   176,   177,
689
     180,   181,   182,   185,   186,   189,   191,   196,   197,   201,
690
     203,   208,   209,   213,   214,   215,   218,   220,   224,   225,
691
     226,   229,   231,   232,   236,   237,   241,   242,   244,   245,
692
     249,   252,   253,   256,   258,   264,   265,   268,   269,   273,
693
     274,   278,   279,   283,   284,   288,   289,   293,   294,   298,
694
     299,   303,   304,   308,   309,   313,   314,   318,   323,   324,
695
     328,   329,   331,   336,   342,   345,   347,   350,   351,   352,
696
     353,   354,   355,   356,   357,   358,   359,   360,   361,   362,
697
     363,   364,   365,   366,   367,   368,   369,   370,   373,   374,
698
     379,   380,   383,   386,   389,   390,   394,   396,   398,   403,
699
     405,   407,   412,   416,   417,   422,   423,   424,   425,   426,
700
     427,   428,   429,   432,   439,   442,   446,   451,   457,   458,
701
     459,   462,   463,   474,   477,   479,   503,   504
702
};
703
#endif
704
705
#if _ASN1_YYDEBUG || YYERROR_VERBOSE || 1
706
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
707
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
708
static const char *const yytname[] =
709
{
710
  "$end", "error", "$undefined", "\"::=\"", "NUM", "IDENTIFIER",
711
  "OPTIONAL", "INTEGER", "SIZE", "OCTET", "STRING", "SEQUENCE", "BIT",
712
  "UNIVERSAL", "PRIVATE", "APPLICATION", "DEFAULT", "CHOICE", "OF",
713
  "OBJECT", "STR_IDENTIFIER", "BOOLEAN", "ASN1_TRUE", "ASN1_FALSE",
714
  "TOKEN_NULL", "ANY", "DEFINED", "BY", "SET", "EXPLICIT", "IMPLICIT",
715
  "DEFINITIONS", "TAGS", "BEGIN", "END", "UTCTime", "GeneralizedTime",
716
  "GeneralString", "NumericString", "IA5String", "TeletexString",
717
  "PrintableString", "UniversalString", "BMPString", "UTF8String",
718
  "VisibleString", "FROM", "IMPORTS", "ENUMERATED", "'+'", "'-'", "'('",
719
  "')'", "','", "'['", "']'", "'|'", "'{'", "'}'", "'.'", "$accept",
720
  "definitions", "pos_num", "neg_num", "pos_neg_num", "num_identifier",
721
  "int_identifier", "pos_neg_identifier", "constant", "constant_list",
722
  "obj_constant", "obj_constant_list", "class", "tag_type", "tag",
723
  "default", "pos_neg_list", "integer_def", "boolean_def", "Time",
724
  "size_def2", "size_def", "generalstring_def", "numericstring_def",
725
  "ia5string_def", "teletexstring_def", "printablestring_def",
726
  "universalstring_def", "bmpstring_def", "utf8string_def",
727
  "visiblestring_def", "octet_string_def", "bit_element",
728
  "bit_element_list", "bit_string_def", "enumerated_def", "object_def",
729
  "type_assig_right", "type_assig_right_tag",
730
  "type_assig_right_tag_default", "type_assig", "type_assig_list",
731
  "sequence_def", "set_def", "choise_def", "any_def", "known_string",
732
  "type_invalid", "type_def", "constant_def", "type_constant",
733
  "type_constant_list", "definitions_id", "explicit_implicit", YY_NULLPTR
734
};
735
#endif
736
737
# ifdef YYPRINT
738
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
739
   (internal) symbol number NUM (which must be that of a token).  */
740
static const yytype_int16 yytoknum[] =
741
{
742
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
743
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
744
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
745
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
746
     295,   296,   297,   298,   299,   300,   301,   302,   303,    43,
747
      45,    40,    41,    44,    91,    93,   124,   123,   125,    46
748
};
749
# endif
750
751
357k
#define YYPACT_NINF (-140)
752
753
#define yypact_value_is_default(Yyn) \
754
357k
  ((Yyn) == YYPACT_NINF)
755
756
#define YYTABLE_NINF (-12)
757
758
#define yytable_value_is_error(Yyn) \
759
546
  0
760
761
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
762
     STATE-NUM.  */
763
static const yytype_int16 yypact[] =
764
{
765
      41,   -27,    32,    17,     0,  -140,    90,  -140,    19,  -140,
766
    -140,  -140,     3,  -140,  -140,    24,   126,  -140,  -140,    98,
767
      80,   105,  -140,   141,    30,  -140,  -140,  -140,  -140,  -140,
768
    -140,  -140,  -140,   131,  -140,  -140,  -140,  -140,    84,    67,
769
     148,   155,   170,   107,  -140,  -140,     6,    91,   184,    18,
770
     185,   139,   177,  -140,  -140,   172,    36,  -140,  -140,     6,
771
       6,     6,     6,     6,     6,     6,     6,     6,   142,    25,
772
     145,   128,   149,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
773
    -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
774
    -140,  -140,  -140,  -140,   144,    64,   199,   174,   152,   196,
775
    -140,  -140,    26,     6,   128,   200,   189,    43,   200,  -140,
776
     179,   128,   200,   190,  -140,  -140,  -140,  -140,  -140,  -140,
777
    -140,  -140,  -140,   204,   156,  -140,  -140,  -140,   206,  -140,
778
    -140,  -140,    92,   173,  -140,   208,   209,  -140,  -140,  -140,
779
     157,   211,   188,   164,   166,    64,  -140,   -11,  -140,  -140,
780
      67,  -140,    27,   128,   204,  -140,    78,   213,  -140,    97,
781
     128,   168,  -140,   101,  -140,   165,   162,  -140,   218,  -140,
782
     167,    10,     5,  -140,  -140,   173,   169,  -140,    -7,  -140,
783
      64,   171,    26,  -140,    37,  -140,   200,  -140,  -140,   104,
784
    -140,  -140,  -140,  -140,   221,   204,  -140,  -140,   175,   176,
785
    -140,    64,  -140,     7,   197,  -140,   178,   180,  -140,  -140,
786
    -140,    94,  -140,  -140,  -140,   181,  -140,    23,  -140,  -140,
787
     219,   188,  -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
788
     225,   186,   220,   187,  -140,  -140,  -140,  -140
789
};
790
791
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
792
     Performed when YYTABLE does not specify something else to do.  Zero
793
     means the default is an error.  */
794
static const yytype_uint8 yydefact[] =
795
{
796
       0,   135,     0,     0,     0,     1,     0,     8,     9,   134,
797
      19,    21,     0,   136,   137,     0,     0,   133,    22,     0,
798
       0,     0,    20,     0,     0,   120,   119,   121,   117,   118,
799
     122,   115,   116,     0,   129,   128,   130,   131,     0,     0,
800
       0,     0,     0,     0,     2,   132,    75,    36,     0,     0,
801
       0,     0,     0,    40,    97,   113,     0,    41,    42,    47,
802
      49,    51,    53,    55,    57,    59,    61,    63,     0,     0,
803
      28,     0,    77,    79,    80,    83,    84,    85,    86,    87,
804
      88,    89,    90,    91,    81,    82,    78,    93,    98,   124,
805
      92,    96,    94,    95,     0,     0,     0,     0,     0,     0,
806
      45,    76,     0,    65,     0,     0,     0,    70,     0,    74,
807
       0,     0,     0,     0,    48,    50,    52,    54,    56,    58,
808
      60,    62,    64,     0,     0,    23,    24,    25,     0,    29,
809
      30,    99,     0,     0,     3,     0,     0,     6,     7,   127,
810
       0,     0,     0,     0,     0,     0,    17,     0,    66,   107,
811
       0,   104,     0,     0,     0,    71,     0,     0,   110,     0,
812
       0,     0,    68,     0,    26,     0,     3,    12,     0,    34,
813
       0,     0,     0,     4,     5,     0,     0,     9,     0,    46,
814
       0,     0,     0,    37,   100,   103,     0,   106,   108,     0,
815
     112,   114,   109,   111,     0,     0,    73,    27,     5,     0,
816
      38,     0,   126,     0,     0,    43,     0,     0,    15,    18,
817
     102,     0,   101,   105,    72,     0,    69,     0,    35,   125,
818
       0,     0,    16,    14,    32,    33,    13,    31,    67,    10,
819
       0,     0,     0,     0,    11,    39,   123,    44
820
};
821
822
  /* YYPGOTO[NTERM-NUM].  */
823
static const yytype_int16 yypgoto[] =
824
{
825
    -140,  -140,  -140,  -140,  -130,  -139,    14,  -140,    54,  -140,
826
     -12,  -108,   143,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
827
     146,   -43,  -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
828
    -140,  -140,    46,    88,  -140,  -140,  -140,   -70,    93,  -140,
829
      58,   -53,  -140,  -140,  -140,  -140,  -140,  -140,  -140,  -140,
830
     210,  -140,  -140,  -140
831
};
832
833
  /* YYDEFGOTO[NTERM-NUM].  */
834
static const yytype_int16 yydefgoto[] =
835
{
836
      -1,     2,   137,   138,   139,    10,   170,   227,   146,   147,
837
      11,    12,   128,    70,    71,   212,   171,    72,    73,    74,
838
     100,   101,    75,    76,    77,    78,    79,    80,    81,    82,
839
      83,    84,   162,   163,    85,    86,    87,    88,    89,   185,
840
     151,   152,    90,    91,    92,    93,    33,    34,    35,    36,
841
      37,    38,     3,    15
842
};
843
844
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
845
     positive, shift that token.  If negative, reduce the rule whose
846
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
847
static const yytype_int16 yytable[] =
848
{
849
      18,   131,   169,   178,     7,     8,   106,     7,     8,     7,
850
       8,     7,     8,   113,    98,   181,   114,   115,   116,   117,
851
     118,   119,   120,   121,   122,   172,    98,   229,   167,   124,
852
       4,   144,     5,    39,   149,    40,   104,    41,   125,   126,
853
     127,   158,   182,   210,    98,   205,     1,   183,     6,    42,
854
     207,    98,   206,   211,   111,   156,    19,    99,     9,   159,
855
     148,    17,   200,   202,   155,   219,   201,   203,   134,    99,
856
      16,   218,    46,   230,    47,   105,    48,   145,    49,    50,
857
     186,   226,   233,   188,    51,   187,    52,    99,    53,    24,
858
     193,    54,    55,   112,    99,    56,   166,   167,   134,   223,
859
     154,    21,    57,    58,    59,    60,    61,    62,    63,    64,
860
      65,    66,    67,   135,   136,    68,   224,   225,    44,    13,
861
      14,    69,    25,    26,    27,    28,    29,    30,    31,    32,
862
      20,   186,    22,    46,    43,    47,   190,    48,    23,    49,
863
      50,   135,   168,   135,   136,    51,    24,    52,   102,    53,
864
     186,    94,    54,    55,   195,   192,    56,   195,    95,   196,
865
      18,    97,   214,    57,    58,    59,    60,    61,    62,    63,
866
      64,    65,    66,    67,   129,   130,    68,     7,     8,    25,
867
      26,    27,    28,    29,    30,    31,    32,   125,   126,   127,
868
      96,    18,     7,   177,   103,   107,   108,   109,   110,   123,
869
     132,   133,   140,   142,    98,   150,   157,   153,   160,   161,
870
     165,   164,   173,   174,   175,   176,   179,   180,   191,   194,
871
     197,   -10,   198,   208,   204,   215,   199,   220,   232,   234,
872
     236,   231,   222,   228,   -11,   217,   209,   221,   235,   237,
873
     141,   216,   189,   184,   213,   143,     0,     0,    45
874
};
875
876
static const yytype_int16 yycheck[] =
877
{
878
      12,    71,   132,   142,     4,     5,    49,     4,     5,     4,
879
       5,     4,     5,    56,     8,   145,    59,    60,    61,    62,
880
      63,    64,    65,    66,    67,   133,     8,     4,     5,     4,
881
      57,     5,     0,     3,   104,     5,    18,     7,    13,    14,
882
      15,   111,    53,     6,     8,    52,     5,    58,    31,    19,
883
     180,     8,    59,    16,    18,   108,    32,    51,    58,   112,
884
     103,    58,    52,    58,   107,    58,    56,   175,     4,    51,
885
      51,   201,     5,    50,     7,    57,     9,    51,    11,    12,
886
      53,   211,   221,   153,    17,    58,    19,    51,    21,     5,
887
     160,    24,    25,    57,    51,    28,     4,     5,     4,     5,
888
      57,     3,    35,    36,    37,    38,    39,    40,    41,    42,
889
      43,    44,    45,    49,    50,    48,    22,    23,    34,    29,
890
      30,    54,    38,    39,    40,    41,    42,    43,    44,    45,
891
       4,    53,    52,     5,     3,     7,    58,     9,    33,    11,
892
      12,    49,    50,    49,    50,    17,     5,    19,    57,    21,
893
      53,     3,    24,    25,    53,    58,    28,    53,     3,    58,
894
     172,    54,    58,    35,    36,    37,    38,    39,    40,    41,
895
      42,    43,    44,    45,    29,    30,    48,     4,     5,    38,
896
      39,    40,    41,    42,    43,    44,    45,    13,    14,    15,
897
      20,   203,     4,     5,    10,    10,    57,    20,    26,    57,
898
      51,    57,     3,    51,     8,     5,    27,    18,    18,     5,
899
       4,    55,     4,     4,    57,     4,    52,    51,     5,    51,
900
      55,    59,     4,    52,    55,     4,    59,    30,     9,     4,
901
      10,   217,    52,    52,    59,    59,   182,    59,    52,    52,
902
      97,   195,   154,   150,   186,    99,    -1,    -1,    38
903
};
904
905
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
906
     symbol of state STATE-NUM.  */
907
static const yytype_int8 yystos[] =
908
{
909
       0,     5,    61,   112,    57,     0,    31,     4,     5,    58,
910
      65,    70,    71,    29,    30,   113,    51,    58,    70,    32,
911
       4,     3,    52,    33,     5,    38,    39,    40,    41,    42,
912
      43,    44,    45,   106,   107,   108,   109,   110,   111,     3,
913
       5,     7,    19,     3,    34,   110,     5,     7,     9,    11,
914
      12,    17,    19,    21,    24,    25,    28,    35,    36,    37,
915
      38,    39,    40,    41,    42,    43,    44,    45,    48,    54,
916
      73,    74,    77,    78,    79,    82,    83,    84,    85,    86,
917
      87,    88,    89,    90,    91,    94,    95,    96,    97,    98,
918
     102,   103,   104,   105,     3,     3,    20,    54,     8,    51,
919
      80,    81,    57,    10,    18,    57,    81,    10,    57,    20,
920
      26,    18,    57,    81,    81,    81,    81,    81,    81,    81,
921
      81,    81,    81,    57,     4,    13,    14,    15,    72,    29,
922
      30,    97,    51,    57,     4,    49,    50,    62,    63,    64,
923
       3,    72,    51,    80,     5,    51,    68,    69,    81,    97,
924
       5,   100,   101,    18,    57,    81,   101,    27,    97,   101,
925
      18,     5,    92,    93,    55,     4,     4,     5,    50,    64,
926
      66,    76,    71,     4,     4,    57,     4,     5,    65,    52,
927
      51,    64,    53,    58,    98,    99,    53,    58,    97,    93,
928
      58,     5,    58,    97,    51,    53,    58,    55,     4,    59,
929
      52,    56,    58,    71,    55,    52,    59,    64,    52,    68,
930
       6,    16,    75,   100,    58,     4,    92,    59,    64,    58,
931
      30,    59,    52,     5,    22,    23,    64,    67,    52,     4,
932
      50,    66,     9,    65,     4,    52,    10,    52
933
};
934
935
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
936
static const yytype_int8 yyr1[] =
937
{
938
       0,    60,    61,    62,    62,    63,    64,    64,    65,    65,
939
      66,    66,    66,    67,    67,    68,    68,    69,    69,    70,
940
      70,    71,    71,    72,    72,    72,    73,    73,    74,    74,
941
      74,    75,    75,    75,    76,    76,    77,    77,    77,    77,
942
      78,    79,    79,    80,    80,    81,    81,    82,    82,    83,
943
      83,    84,    84,    85,    85,    86,    86,    87,    87,    88,
944
      88,    89,    89,    90,    90,    91,    91,    92,    93,    93,
945
      94,    94,    94,    95,    96,    97,    97,    97,    97,    97,
946
      97,    97,    97,    97,    97,    97,    97,    97,    97,    97,
947
      97,    97,    97,    97,    97,    97,    97,    97,    98,    98,
948
      99,    99,    99,   100,   101,   101,   102,   102,   102,   103,
949
     103,   103,   104,   105,   105,   106,   106,   106,   106,   106,
950
     106,   106,   106,   107,   108,   109,   109,   109,   110,   110,
951
     110,   111,   111,   112,   112,   112,   113,   113
952
};
953
954
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
955
static const yytype_int8 yyr2[] =
956
{
957
       0,     2,     8,     1,     2,     2,     1,     1,     1,     1,
958
       1,     2,     1,     1,     1,     3,     4,     1,     3,     1,
959
       4,     1,     2,     1,     1,     1,     3,     4,     1,     2,
960
       2,     2,     2,     2,     1,     3,     1,     4,     4,     7,
961
       1,     1,     1,     4,     7,     1,     3,     1,     2,     1,
962
       2,     1,     2,     1,     2,     1,     2,     1,     2,     1,
963
       2,     1,     2,     1,     2,     2,     3,     4,     1,     3,
964
       2,     3,     5,     4,     2,     1,     2,     1,     1,     1,
965
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
966
       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
967
       1,     2,     2,     2,     1,     3,     4,     3,     4,     4,
968
       3,     4,     4,     1,     4,     1,     1,     1,     1,     1,
969
       1,     1,     1,     9,     3,     7,     6,     4,     1,     1,
970
       1,     1,     2,     4,     3,     1,     1,     1
971
};
972
973
974
#define yyerrok         (yyerrstatus = 0)
975
#define yyclearin       (yychar = YYEMPTY)
976
369k
#define YYEMPTY         (-2)
977
201k
#define YYEOF           0
978
979
964
#define YYACCEPT        goto yyacceptlab
980
1.29k
#define YYABORT         goto yyabortlab
981
0
#define YYERROR         goto yyerrorlab
982
983
984
#define YYRECOVERING()  (!!yyerrstatus)
985
986
#define YYBACKUP(Token, Value)                                    \
987
  do                                                              \
988
    if (yychar == YYEMPTY)                                        \
989
      {                                                           \
990
        yychar = (Token);                                         \
991
        yylval = (Value);                                         \
992
        YYPOPSTACK (yylen);                                       \
993
        yystate = *yyssp;                                         \
994
        goto yybackup;                                            \
995
      }                                                           \
996
    else                                                          \
997
      {                                                           \
998
        yyerror (YY_("syntax error: cannot back up")); \
999
        YYERROR;                                                  \
1000
      }                                                           \
1001
  while (0)
1002
1003
/* Error token number */
1004
106k
#define YYTERROR        1
1005
#define YYERRCODE       256
1006
1007
1008
1009
/* Enable debugging if requested.  */
1010
#if _ASN1_YYDEBUG
1011
1012
# ifndef YYFPRINTF
1013
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1014
#  define YYFPRINTF fprintf
1015
# endif
1016
1017
# define YYDPRINTF(Args)                        \
1018
do {                                            \
1019
  if (yydebug)                                  \
1020
    YYFPRINTF Args;                             \
1021
} while (0)
1022
1023
/* This macro is provided for backward compatibility. */
1024
#ifndef YY_LOCATION_PRINT
1025
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1026
#endif
1027
1028
1029
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1030
do {                                                                      \
1031
  if (yydebug)                                                            \
1032
    {                                                                     \
1033
      YYFPRINTF (stderr, "%s ", Title);                                   \
1034
      yy_symbol_print (stderr,                                            \
1035
                  Type, Value); \
1036
      YYFPRINTF (stderr, "\n");                                           \
1037
    }                                                                     \
1038
} while (0)
1039
1040
1041
/*-----------------------------------.
1042
| Print this symbol's value on YYO.  |
1043
`-----------------------------------*/
1044
1045
static void
1046
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
1047
{
1048
  FILE *yyoutput = yyo;
1049
  YYUSE (yyoutput);
1050
  if (!yyvaluep)
1051
    return;
1052
# ifdef YYPRINT
1053
  if (yytype < YYNTOKENS)
1054
    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
1055
# endif
1056
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1057
  YYUSE (yytype);
1058
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1059
}
1060
1061
1062
/*---------------------------.
1063
| Print this symbol on YYO.  |
1064
`---------------------------*/
1065
1066
static void
1067
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
1068
{
1069
  YYFPRINTF (yyo, "%s %s (",
1070
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1071
1072
  yy_symbol_value_print (yyo, yytype, yyvaluep);
1073
  YYFPRINTF (yyo, ")");
1074
}
1075
1076
/*------------------------------------------------------------------.
1077
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1078
| TOP (included).                                                   |
1079
`------------------------------------------------------------------*/
1080
1081
static void
1082
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1083
{
1084
  YYFPRINTF (stderr, "Stack now");
1085
  for (; yybottom <= yytop; yybottom++)
1086
    {
1087
      int yybot = *yybottom;
1088
      YYFPRINTF (stderr, " %d", yybot);
1089
    }
1090
  YYFPRINTF (stderr, "\n");
1091
}
1092
1093
# define YY_STACK_PRINT(Bottom, Top)                            \
1094
do {                                                            \
1095
  if (yydebug)                                                  \
1096
    yy_stack_print ((Bottom), (Top));                           \
1097
} while (0)
1098
1099
1100
/*------------------------------------------------.
1101
| Report that the YYRULE is going to be reduced.  |
1102
`------------------------------------------------*/
1103
1104
static void
1105
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
1106
{
1107
  int yylno = yyrline[yyrule];
1108
  int yynrhs = yyr2[yyrule];
1109
  int yyi;
1110
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1111
             yyrule - 1, yylno);
1112
  /* The symbols being reduced.  */
1113
  for (yyi = 0; yyi < yynrhs; yyi++)
1114
    {
1115
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1116
      yy_symbol_print (stderr,
1117
                       yystos[+yyssp[yyi + 1 - yynrhs]],
1118
                       &yyvsp[(yyi + 1) - (yynrhs)]
1119
                                              );
1120
      YYFPRINTF (stderr, "\n");
1121
    }
1122
}
1123
1124
# define YY_REDUCE_PRINT(Rule)          \
1125
do {                                    \
1126
  if (yydebug)                          \
1127
    yy_reduce_print (yyssp, yyvsp, Rule); \
1128
} while (0)
1129
1130
/* Nonzero means print parse trace.  It is left uninitialized so that
1131
   multiple parsers can coexist.  */
1132
int yydebug;
1133
#else /* !_ASN1_YYDEBUG */
1134
# define YYDPRINTF(Args)
1135
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1136
# define YY_STACK_PRINT(Bottom, Top)
1137
# define YY_REDUCE_PRINT(Rule)
1138
#endif /* !_ASN1_YYDEBUG */
1139
1140
1141
/* YYINITDEPTH -- initial size of the parser's stacks.  */
1142
#ifndef YYINITDEPTH
1143
2.26k
# define YYINITDEPTH 200
1144
#endif
1145
1146
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1147
   if the built-in stack extension method is used).
1148
1149
   Do not make this value too large; the results are undefined if
1150
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1151
   evaluated with infinite-precision integer arithmetic.  */
1152
1153
#ifndef YYMAXDEPTH
1154
56
# define YYMAXDEPTH 10000
1155
#endif
1156
1157
1158
#if YYERROR_VERBOSE
1159
1160
# ifndef yystrlen
1161
#  if defined __GLIBC__ && defined _STRING_H
1162
5.29k
#   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1163
#  else
1164
/* Return the length of YYSTR.  */
1165
static YYPTRDIFF_T
1166
yystrlen (const char *yystr)
1167
{
1168
  YYPTRDIFF_T yylen;
1169
  for (yylen = 0; yystr[yylen]; yylen++)
1170
    continue;
1171
  return yylen;
1172
}
1173
#  endif
1174
# endif
1175
1176
# ifndef yystpcpy
1177
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1178
2.88k
#   define yystpcpy stpcpy
1179
#  else
1180
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1181
   YYDEST.  */
1182
static char *
1183
yystpcpy (char *yydest, const char *yysrc)
1184
{
1185
  char *yyd = yydest;
1186
  const char *yys = yysrc;
1187
1188
  while ((*yyd++ = *yys++) != '\0')
1189
    continue;
1190
1191
  return yyd - 1;
1192
}
1193
#  endif
1194
# endif
1195
1196
# ifndef yytnamerr
1197
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1198
   quotes and backslashes, so that it's suitable for yyerror.  The
1199
   heuristic is that double-quoting is unnecessary unless the string
1200
   contains an apostrophe, a comma, or backslash (other than
1201
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1202
   null, do not copy; instead, return the length of what the result
1203
   would have been.  */
1204
static YYPTRDIFF_T
1205
yytnamerr (char *yyres, const char *yystr)
1206
7.03k
{
1207
7.03k
  if (*yystr == '"')
1208
156
    {
1209
156
      YYPTRDIFF_T yyn = 0;
1210
156
      char const *yyp = yystr;
1211
1212
156
      for (;;)
1213
624
        switch (*++yyp)
1214
624
          {
1215
0
          case '\'':
1216
0
          case ',':
1217
0
            goto do_not_strip_quotes;
1218
1219
0
          case '\\':
1220
0
            if (*++yyp != '\\')
1221
0
              goto do_not_strip_quotes;
1222
0
            else
1223
0
              goto append;
1224
1225
0
          append:
1226
468
          default:
1227
468
            if (yyres)
1228
234
              yyres[yyn] = *yyp;
1229
468
            yyn++;
1230
468
            break;
1231
1232
156
          case '"':
1233
156
            if (yyres)
1234
78
              yyres[yyn] = '\0';
1235
156
            return yyn;
1236
624
          }
1237
0
    do_not_strip_quotes: ;
1238
0
    }
1239
1240
6.87k
  if (yyres)
1241
2.88k
    return yystpcpy (yyres, yystr) - yyres;
1242
3.99k
  else
1243
3.99k
    return yystrlen (yystr);
1244
6.87k
}
1245
# endif
1246
1247
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1248
   about the unexpected token YYTOKEN for the state stack whose top is
1249
   YYSSP.
1250
1251
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1252
   not large enough to hold the message.  In that case, also set
1253
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1254
   required number of bytes is too large to store.  */
1255
static int
1256
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1257
                yy_state_t *yyssp, int yytoken)
1258
1.29k
{
1259
1.29k
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1260
  /* Internationalized format string. */
1261
1.29k
  const char *yyformat = YY_NULLPTR;
1262
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1263
     one per "expected"). */
1264
1.29k
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1265
  /* Actual size of YYARG. */
1266
1.29k
  int yycount = 0;
1267
  /* Cumulated lengths of YYARG.  */
1268
1.29k
  YYPTRDIFF_T yysize = 0;
1269
1270
  /* There are many possibilities here to consider:
1271
     - If this state is a consistent state with a default action, then
1272
       the only way this function was invoked is if the default action
1273
       is an error action.  In that case, don't check for expected
1274
       tokens because there are none.
1275
     - The only way there can be no lookahead present (in yychar) is if
1276
       this state is a consistent state with a default action.  Thus,
1277
       detecting the absence of a lookahead is sufficient to determine
1278
       that there is no unexpected or expected token to report.  In that
1279
       case, just report a simple "syntax error".
1280
     - Don't assume there isn't a lookahead just because this state is a
1281
       consistent state with a default action.  There might have been a
1282
       previous inconsistent state, consistent state with a non-default
1283
       action, or user semantic action that manipulated yychar.
1284
     - Of course, the expected token list depends on states to have
1285
       correct lookahead information, and it depends on the parser not
1286
       to perform extra reductions after fetching a lookahead from the
1287
       scanner and before detecting a syntax error.  Thus, state merging
1288
       (from LALR or IELR) and default reductions corrupt the expected
1289
       token list.  However, the list is correct for canonical LR with
1290
       one exception: it will still contain any token that will not be
1291
       accepted due to an error action in a later state.
1292
  */
1293
1.29k
  if (yytoken != YYEMPTY)
1294
1.29k
    {
1295
1.29k
      int yyn = yypact[+*yyssp];
1296
1.29k
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1297
1.29k
      yysize = yysize0;
1298
1.29k
      yyarg[yycount++] = yytname[yytoken];
1299
1.29k
      if (!yypact_value_is_default (yyn))
1300
1.29k
        {
1301
          /* Start YYX at -YYN if negative to avoid negative indexes in
1302
             YYCHECK.  In other words, skip the first -YYN actions for
1303
             this state because they are default actions.  */
1304
1.29k
          int yyxbegin = yyn < 0 ? -yyn : 0;
1305
          /* Stay within bounds of both yycheck and yytname.  */
1306
1.29k
          int yychecklim = YYLAST - yyn + 1;
1307
1.29k
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1308
1.29k
          int yyx;
1309
1310
70.6k
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1311
69.6k
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1312
69.6k
                && !yytable_value_is_error (yytable[yyx + yyn]))
1313
3.05k
              {
1314
3.05k
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1315
279
                  {
1316
279
                    yycount = 1;
1317
279
                    yysize = yysize0;
1318
279
                    break;
1319
279
                  }
1320
2.77k
                yyarg[yycount++] = yytname[yyx];
1321
2.77k
                {
1322
2.77k
                  YYPTRDIFF_T yysize1
1323
2.77k
                    = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1324
2.77k
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1325
2.77k
                    yysize = yysize1;
1326
0
                  else
1327
0
                    return 2;
1328
2.77k
                }
1329
2.77k
              }
1330
1.29k
        }
1331
1.29k
    }
1332
1333
1.29k
  switch (yycount)
1334
1.29k
    {
1335
0
# define YYCASE_(N, S)                      \
1336
1.29k
      case N:                               \
1337
1.29k
        yyformat = S;                       \
1338
1.29k
      break
1339
0
    default: /* Avoid compiler warnings. */
1340
0
      YYCASE_(0, YY_("syntax error"));
1341
279
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1342
544
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1343
324
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1344
125
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1345
1.29k
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1346
1.29k
# undef YYCASE_
1347
1.29k
    }
1348
1349
1.29k
  {
1350
    /* Don't count the "%s"s in the final size, but reserve room for
1351
       the terminator.  */
1352
1.29k
    YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1353
1.29k
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1354
1.29k
      yysize = yysize1;
1355
0
    else
1356
0
      return 2;
1357
1.29k
  }
1358
1359
1.29k
  if (*yymsg_alloc < yysize)
1360
0
    {
1361
0
      *yymsg_alloc = 2 * yysize;
1362
0
      if (! (yysize <= *yymsg_alloc
1363
0
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1364
0
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1365
0
      return 1;
1366
0
    }
1367
1368
  /* Avoid sprintf, as that infringes on the user's name space.
1369
     Don't have undefined behavior even if the translation
1370
     produced a string with the wrong number of "%s"s.  */
1371
1.29k
  {
1372
1.29k
    char *yyp = *yymsg;
1373
1.29k
    int yyi = 0;
1374
51.4k
    while ((*yyp = *yyformat) != '\0')
1375
50.1k
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1376
2.95k
        {
1377
2.95k
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1378
2.95k
          yyformat += 2;
1379
2.95k
        }
1380
47.1k
      else
1381
47.1k
        {
1382
47.1k
          ++yyp;
1383
47.1k
          ++yyformat;
1384
47.1k
        }
1385
1.29k
  }
1386
1.29k
  return 0;
1387
1.29k
}
1388
#endif /* YYERROR_VERBOSE */
1389
1390
/*-----------------------------------------------.
1391
| Release the memory associated to this symbol.  |
1392
`-----------------------------------------------*/
1393
1394
static void
1395
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1396
18.7k
{
1397
18.7k
  YYUSE (yyvaluep);
1398
18.7k
  if (!yymsg)
1399
0
    yymsg = "Deleting";
1400
18.7k
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1401
1402
18.7k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1403
18.7k
  YYUSE (yytype);
1404
18.7k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1405
18.7k
}
1406
1407
1408
1409
1410
/* The lookahead symbol.  */
1411
int yychar;
1412
1413
/* The semantic value of the lookahead symbol.  */
1414
YYSTYPE yylval;
1415
/* Number of syntax errors so far.  */
1416
int yynerrs;
1417
1418
1419
/*----------.
1420
| yyparse.  |
1421
`----------*/
1422
1423
int
1424
yyparse (void)
1425
2.26k
{
1426
2.26k
    yy_state_fast_t yystate;
1427
    /* Number of tokens to shift before error messages enabled.  */
1428
2.26k
    int yyerrstatus;
1429
1430
    /* The stacks and their tools:
1431
       'yyss': related to states.
1432
       'yyvs': related to semantic values.
1433
1434
       Refer to the stacks through separate pointers, to allow yyoverflow
1435
       to reallocate them elsewhere.  */
1436
1437
    /* The state stack.  */
1438
2.26k
    yy_state_t yyssa[YYINITDEPTH];
1439
2.26k
    yy_state_t *yyss;
1440
2.26k
    yy_state_t *yyssp;
1441
1442
    /* The semantic value stack.  */
1443
2.26k
    YYSTYPE yyvsa[YYINITDEPTH];
1444
2.26k
    YYSTYPE *yyvs;
1445
2.26k
    YYSTYPE *yyvsp;
1446
1447
2.26k
    YYPTRDIFF_T yystacksize;
1448
1449
2.26k
  int yyn;
1450
2.26k
  int yyresult;
1451
  /* Lookahead token as an internal (translated) token number.  */
1452
2.26k
  int yytoken = 0;
1453
  /* The variables used to return semantic value and location from the
1454
     action routines.  */
1455
2.26k
  YYSTYPE yyval;
1456
1457
2.26k
#if YYERROR_VERBOSE
1458
  /* Buffer for error messages, and its allocated size.  */
1459
2.26k
  char yymsgbuf[128];
1460
2.26k
  char *yymsg = yymsgbuf;
1461
2.26k
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1462
2.26k
#endif
1463
1464
193k
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1465
1466
  /* The number of symbols on the RHS of the reduced rule.
1467
     Keep to zero when no symbol should be popped.  */
1468
2.26k
  int yylen = 0;
1469
1470
2.26k
  yyssp = yyss = yyssa;
1471
2.26k
  yyvsp = yyvs = yyvsa;
1472
2.26k
  yystacksize = YYINITDEPTH;
1473
1474
2.26k
  YYDPRINTF ((stderr, "Starting parse\n"));
1475
1476
2.26k
  yystate = 0;
1477
2.26k
  yyerrstatus = 0;
1478
2.26k
  yynerrs = 0;
1479
2.26k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1480
2.26k
  goto yysetstate;
1481
1482
1483
/*------------------------------------------------------------.
1484
| yynewstate -- push a new state, which is found in yystate.  |
1485
`------------------------------------------------------------*/
1486
337k
yynewstate:
1487
  /* In all cases, when you get here, the value and location stacks
1488
     have just been pushed.  So pushing a state here evens the stacks.  */
1489
337k
  yyssp++;
1490
1491
1492
/*--------------------------------------------------------------------.
1493
| yysetstate -- set current state (the top of the stack) to yystate.  |
1494
`--------------------------------------------------------------------*/
1495
340k
yysetstate:
1496
340k
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1497
340k
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1498
340k
  YY_IGNORE_USELESS_CAST_BEGIN
1499
340k
  *yyssp = YY_CAST (yy_state_t, yystate);
1500
340k
  YY_IGNORE_USELESS_CAST_END
1501
1502
340k
  if (yyss + yystacksize - 1 <= yyssp)
1503
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1504
    goto yyexhaustedlab;
1505
#else
1506
28
    {
1507
      /* Get the current used size of the three stacks, in elements.  */
1508
28
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1509
1510
# if defined yyoverflow
1511
      {
1512
        /* Give user a chance to reallocate the stack.  Use copies of
1513
           these so that the &'s don't force the real ones into
1514
           memory.  */
1515
        yy_state_t *yyss1 = yyss;
1516
        YYSTYPE *yyvs1 = yyvs;
1517
1518
        /* Each stack pointer address is followed by the size of the
1519
           data in use in that stack, in bytes.  This used to be a
1520
           conditional around just the two extra args, but that might
1521
           be undefined if yyoverflow is a macro.  */
1522
        yyoverflow (YY_("memory exhausted"),
1523
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1524
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1525
                    &yystacksize);
1526
        yyss = yyss1;
1527
        yyvs = yyvs1;
1528
      }
1529
# else /* defined YYSTACK_RELOCATE */
1530
      /* Extend the stack our own way.  */
1531
28
      if (YYMAXDEPTH <= yystacksize)
1532
0
        goto yyexhaustedlab;
1533
28
      yystacksize *= 2;
1534
28
      if (YYMAXDEPTH < yystacksize)
1535
0
        yystacksize = YYMAXDEPTH;
1536
1537
28
      {
1538
28
        yy_state_t *yyss1 = yyss;
1539
28
        union yyalloc *yyptr =
1540
28
          YY_CAST (union yyalloc *,
1541
28
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1542
28
        if (! yyptr)
1543
0
          goto yyexhaustedlab;
1544
28
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1545
28
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1546
28
# undef YYSTACK_RELOCATE
1547
28
        if (yyss1 != yyssa)
1548
11
          YYSTACK_FREE (yyss1);
1549
28
      }
1550
0
# endif
1551
1552
0
      yyssp = yyss + yysize - 1;
1553
28
      yyvsp = yyvs + yysize - 1;
1554
1555
28
      YY_IGNORE_USELESS_CAST_BEGIN
1556
28
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1557
28
                  YY_CAST (long, yystacksize)));
1558
28
      YY_IGNORE_USELESS_CAST_END
1559
1560
28
      if (yyss + yystacksize - 1 <= yyssp)
1561
0
        YYABORT;
1562
28
    }
1563
340k
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1564
1565
340k
  if (yystate == YYFINAL)
1566
964
    YYACCEPT;
1567
1568
339k
  goto yybackup;
1569
1570
1571
/*-----------.
1572
| yybackup.  |
1573
`-----------*/
1574
339k
yybackup:
1575
  /* Do appropriate processing given the current state.  Read a
1576
     lookahead token if we need one and don't already have one.  */
1577
1578
  /* First try to decide what to do without reference to lookahead token.  */
1579
339k
  yyn = yypact[yystate];
1580
339k
  if (yypact_value_is_default (yyn))
1581
140k
    goto yydefault;
1582
1583
  /* Not known => get a lookahead token if don't already have one.  */
1584
1585
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1586
198k
  if (yychar == YYEMPTY)
1587
165k
    {
1588
165k
      YYDPRINTF ((stderr, "Reading a token: "));
1589
165k
      yychar = yylex ();
1590
165k
    }
1591
1592
198k
  if (yychar <= YYEOF)
1593
2.76k
    {
1594
2.76k
      yychar = yytoken = YYEOF;
1595
2.76k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1596
2.76k
    }
1597
195k
  else
1598
195k
    {
1599
195k
      yytoken = YYTRANSLATE (yychar);
1600
195k
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1601
195k
    }
1602
1603
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1604
     detect an error, take that action.  */
1605
198k
  yyn += yytoken;
1606
198k
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1607
34.0k
    goto yydefault;
1608
164k
  yyn = yytable[yyn];
1609
164k
  if (yyn <= 0)
1610
546
    {
1611
546
      if (yytable_value_is_error (yyn))
1612
0
        goto yyerrlab;
1613
546
      yyn = -yyn;
1614
546
      goto yyreduce;
1615
546
    }
1616
1617
  /* Count tokens shifted since error; after three, turn off error
1618
     status.  */
1619
163k
  if (yyerrstatus)
1620
0
    yyerrstatus--;
1621
1622
  /* Shift the lookahead token.  */
1623
163k
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1624
163k
  yystate = yyn;
1625
163k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1626
163k
  *++yyvsp = yylval;
1627
163k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1628
1629
  /* Discard the shifted token.  */
1630
163k
  yychar = YYEMPTY;
1631
163k
  goto yynewstate;
1632
1633
1634
/*-----------------------------------------------------------.
1635
| yydefault -- do the default action for the current state.  |
1636
`-----------------------------------------------------------*/
1637
174k
yydefault:
1638
174k
  yyn = yydefact[yystate];
1639
174k
  if (yyn == 0)
1640
1.29k
    goto yyerrlab;
1641
173k
  goto yyreduce;
1642
1643
1644
/*-----------------------------.
1645
| yyreduce -- do a reduction.  |
1646
`-----------------------------*/
1647
174k
yyreduce:
1648
  /* yyn is the number of a rule to reduce with.  */
1649
174k
  yylen = yyr2[yyn];
1650
1651
  /* If YYLEN is nonzero, implement the default value of the action:
1652
     '$$ = $1'.
1653
1654
     Otherwise, the following line sets YYVAL to garbage.
1655
     This behavior is undocumented and Bison
1656
     users should not rely upon it.  Assigning to YYVAL
1657
     unconditionally makes the parser a bit smaller, and it avoids a
1658
     GCC warning that YYVAL may be used uninitialized.  */
1659
174k
  yyval = yyvsp[1-yylen];
1660
1661
1662
174k
  YY_REDUCE_PRINT (yyn);
1663
174k
  switch (yyn)
1664
174k
    {
1665
964
  case 2:
1666
964
#line 155 "ASN1.y"
1667
964
                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFINITIONS|(yyvsp[-5].constant));
1668
964
                    _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[-7].node)));
1669
964
                    _asn1_set_name((yyvsp[-7].node),"");
1670
964
                    _asn1_set_right((yyvsp[-7].node),(yyvsp[-1].node));
1671
964
                    _asn1_set_down((yyval.node),(yyvsp[-7].node));
1672
1673
964
        p_tree=(yyval.node);
1674
964
        }
1675
964
#line 1676 "ASN1.c"
1676
964
    break;
1677
1678
2.65k
  case 3:
1679
2.65k
#line 165 "ASN1.y"
1680
2.65k
                      {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1681
2.65k
#line 1682 "ASN1.c"
1682
2.65k
    break;
1683
1684
322
  case 4:
1685
322
#line 166 "ASN1.y"
1686
322
                      {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1687
322
#line 1688 "ASN1.c"
1688
322
    break;
1689
1690
946
  case 5:
1691
946
#line 169 "ASN1.y"
1692
946
                      {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));}
1693
946
#line 1694 "ASN1.c"
1694
946
    break;
1695
1696
2.97k
  case 6:
1697
2.97k
#line 172 "ASN1.y"
1698
2.97k
                        {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1699
2.97k
#line 1700 "ASN1.c"
1700
2.97k
    break;
1701
1702
946
  case 7:
1703
946
#line 173 "ASN1.y"
1704
946
                        {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1705
946
#line 1706 "ASN1.c"
1706
946
    break;
1707
1708
1.73k
  case 8:
1709
1.73k
#line 176 "ASN1.y"
1710
1.73k
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1711
1.73k
#line 1712 "ASN1.c"
1712
1.73k
    break;
1713
1714
8.38k
  case 9:
1715
8.38k
#line 177 "ASN1.y"
1716
8.38k
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1717
8.38k
#line 1718 "ASN1.c"
1718
8.38k
    break;
1719
1720
654
  case 10:
1721
654
#line 180 "ASN1.y"
1722
654
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1723
654
#line 1724 "ASN1.c"
1724
654
    break;
1725
1726
209
  case 11:
1727
209
#line 181 "ASN1.y"
1728
209
                                 {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));}
1729
209
#line 1730 "ASN1.c"
1730
209
    break;
1731
1732
414
  case 12:
1733
414
#line 182 "ASN1.y"
1734
414
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1735
414
#line 1736 "ASN1.c"
1736
414
    break;
1737
1738
203
  case 13:
1739
203
#line 185 "ASN1.y"
1740
203
                                     {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1741
203
#line 1742 "ASN1.c"
1742
203
    break;
1743
1744
1.08k
  case 14:
1745
1.08k
#line 186 "ASN1.y"
1746
1.08k
                                     {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1747
1.08k
#line 1748 "ASN1.c"
1748
1.08k
    break;
1749
1750
437
  case 15:
1751
437
#line 189 "ASN1.y"
1752
437
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1753
437
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1754
437
#line 1755 "ASN1.c"
1755
437
    break;
1756
1757
195
  case 16:
1758
195
#line 191 "ASN1.y"
1759
195
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1760
195
                                 _asn1_set_name((yyval.node),(yyvsp[-3].str));
1761
195
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1762
195
#line 1763 "ASN1.c"
1763
195
    break;
1764
1765
245
  case 17:
1766
245
#line 196 "ASN1.y"
1767
245
                                           {(yyval.node)=(yyvsp[0].node);}
1768
245
#line 1769 "ASN1.c"
1769
245
    break;
1770
1771
387
  case 18:
1772
387
#line 197 "ASN1.y"
1773
387
                                           {(yyval.node)=(yyvsp[-2].node);
1774
387
                                            _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
1775
387
#line 1776 "ASN1.c"
1776
387
    break;
1777
1778
6.62k
  case 19:
1779
6.62k
#line 201 "ASN1.y"
1780
6.62k
                                  {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1781
6.62k
                                   _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
1782
6.62k
#line 1783 "ASN1.c"
1783
6.62k
    break;
1784
1785
793
  case 20:
1786
793
#line 203 "ASN1.y"
1787
793
                                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1788
793
                              _asn1_set_name((yyval.node),(yyvsp[-3].str));
1789
793
                                    _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1790
793
#line 1791 "ASN1.c"
1791
793
    break;
1792
1793
2.20k
  case 21:
1794
2.20k
#line 208 "ASN1.y"
1795
2.20k
                                                   {(yyval.node)=(yyvsp[0].node);}
1796
2.20k
#line 1797 "ASN1.c"
1797
2.20k
    break;
1798
1799
5.21k
  case 22:
1800
5.21k
#line 209 "ASN1.y"
1801
5.21k
                                                   {(yyval.node)=(yyvsp[-1].node);
1802
5.21k
                                                    _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));}
1803
5.21k
#line 1804 "ASN1.c"
1804
5.21k
    break;
1805
1806
244
  case 23:
1807
244
#line 213 "ASN1.y"
1808
244
                      {(yyval.constant)=CONST_UNIVERSAL;}
1809
244
#line 1810 "ASN1.c"
1810
244
    break;
1811
1812
1.75k
  case 24:
1813
1.75k
#line 214 "ASN1.y"
1814
1.75k
                      {(yyval.constant)=CONST_PRIVATE;}
1815
1.75k
#line 1816 "ASN1.c"
1816
1.75k
    break;
1817
1818
194
  case 25:
1819
194
#line 215 "ASN1.y"
1820
194
                      {(yyval.constant)=CONST_APPLICATION;}
1821
194
#line 1822 "ASN1.c"
1822
194
    break;
1823
1824
3.58k
  case 26:
1825
3.58k
#line 218 "ASN1.y"
1826
3.58k
                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG);
1827
3.58k
                            _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1828
3.58k
#line 1829 "ASN1.c"
1829
3.58k
    break;
1830
1831
694
  case 27:
1832
694
#line 220 "ASN1.y"
1833
694
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG | (yyvsp[-2].constant));
1834
694
                                _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1835
694
#line 1836 "ASN1.c"
1836
694
    break;
1837
1838
3.71k
  case 28:
1839
3.71k
#line 224 "ASN1.y"
1840
3.71k
                          {(yyval.node)=(yyvsp[0].node);}
1841
3.71k
#line 1842 "ASN1.c"
1842
3.71k
    break;
1843
1844
252
  case 29:
1845
252
#line 225 "ASN1.y"
1846
252
                          {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_EXPLICIT);}
1847
252
#line 1848 "ASN1.c"
1848
252
    break;
1849
1850
319
  case 30:
1851
319
#line 226 "ASN1.y"
1852
319
                          {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_IMPLICIT);}
1853
319
#line 1854 "ASN1.c"
1854
319
    break;
1855
1856
1.29k
  case 31:
1857
1.29k
#line 229 "ASN1.y"
1858
1.29k
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT);
1859
1.29k
                                       _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
1860
1.29k
#line 1861 "ASN1.c"
1861
1.29k
    break;
1862
1863
316
  case 32:
1864
316
#line 231 "ASN1.y"
1865
316
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_TRUE);}
1866
316
#line 1867 "ASN1.c"
1867
316
    break;
1868
1869
194
  case 33:
1870
194
#line 232 "ASN1.y"
1871
194
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_FALSE);}
1872
194
#line 1873 "ASN1.c"
1873
194
    break;
1874
1875
377
  case 36:
1876
377
#line 241 "ASN1.y"
1877
377
                                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);}
1878
377
#line 1879 "ASN1.c"
1879
377
    break;
1880
1881
222
  case 37:
1882
222
#line 242 "ASN1.y"
1883
222
                                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_LIST);
1884
222
                                   _asn1_set_down((yyval.node),(yyvsp[-1].node));}
1885
222
#line 1886 "ASN1.c"
1886
222
    break;
1887
1888
595
  case 38:
1889
595
#line 244 "ASN1.y"
1890
595
                                             {(yyval.node)=(yyvsp[-3].node);}
1891
595
#line 1892 "ASN1.c"
1892
595
    break;
1893
1894
616
  case 39:
1895
616
#line 246 "ASN1.y"
1896
616
                                        {(yyval.node)=(yyvsp[-6].node);}
1897
616
#line 1898 "ASN1.c"
1898
616
    break;
1899
1900
194
  case 40:
1901
194
#line 249 "ASN1.y"
1902
194
                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BOOLEAN);}
1903
194
#line 1904 "ASN1.c"
1904
194
    break;
1905
1906
194
  case 41:
1907
194
#line 252 "ASN1.y"
1908
194
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTC_TIME);}
1909
194
#line 1910 "ASN1.c"
1910
194
    break;
1911
1912
269
  case 42:
1913
269
#line 253 "ASN1.y"
1914
269
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALIZED_TIME);}
1915
269
#line 1916 "ASN1.c"
1916
269
    break;
1917
1918
2.79k
  case 43:
1919
2.79k
#line 256 "ASN1.y"
1920
2.79k
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_1_PARAM);
1921
2.79k
                                _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1922
2.79k
#line 1923 "ASN1.c"
1923
2.79k
    break;
1924
1925
344
  case 44:
1926
344
#line 259 "ASN1.y"
1927
344
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_MIN_MAX);
1928
344
                                _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1);
1929
344
                                      _asn1_set_name((yyval.node),(yyvsp[-1].str));}
1930
344
#line 1931 "ASN1.c"
1931
344
    break;
1932
1933
2.90k
  case 45:
1934
2.90k
#line 264 "ASN1.y"
1935
2.90k
                               {(yyval.node)=(yyvsp[0].node);}
1936
2.90k
#line 1937 "ASN1.c"
1937
2.90k
    break;
1938
1939
233
  case 46:
1940
233
#line 265 "ASN1.y"
1941
233
                               {(yyval.node)=(yyvsp[-1].node);}
1942
233
#line 1943 "ASN1.c"
1943
233
    break;
1944
1945
194
  case 47:
1946
194
#line 268 "ASN1.y"
1947
194
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING);}
1948
194
#line 1949 "ASN1.c"
1949
194
    break;
1950
1951
194
  case 48:
1952
194
#line 269 "ASN1.y"
1953
194
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING|CONST_SIZE);
1954
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1955
194
#line 1956 "ASN1.c"
1956
194
    break;
1957
1958
195
  case 49:
1959
195
#line 273 "ASN1.y"
1960
195
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);}
1961
195
#line 1962 "ASN1.c"
1962
195
    break;
1963
1964
194
  case 50:
1965
194
#line 274 "ASN1.y"
1966
194
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE);
1967
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1968
194
#line 1969 "ASN1.c"
1969
194
    break;
1970
1971
208
  case 51:
1972
208
#line 278 "ASN1.y"
1973
208
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING);}
1974
208
#line 1975 "ASN1.c"
1975
208
    break;
1976
1977
197
  case 52:
1978
197
#line 279 "ASN1.y"
1979
197
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING|CONST_SIZE);
1980
197
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1981
197
#line 1982 "ASN1.c"
1982
197
    break;
1983
1984
223
  case 53:
1985
223
#line 283 "ASN1.y"
1986
223
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING);}
1987
223
#line 1988 "ASN1.c"
1988
223
    break;
1989
1990
195
  case 54:
1991
195
#line 284 "ASN1.y"
1992
195
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING|CONST_SIZE);
1993
195
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1994
195
#line 1995 "ASN1.c"
1995
195
    break;
1996
1997
194
  case 55:
1998
194
#line 288 "ASN1.y"
1999
194
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING);}
2000
194
#line 2001 "ASN1.c"
2001
194
    break;
2002
2003
199
  case 56:
2004
199
#line 289 "ASN1.y"
2005
199
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE);
2006
199
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2007
199
#line 2008 "ASN1.c"
2008
199
    break;
2009
2010
199
  case 57:
2011
199
#line 293 "ASN1.y"
2012
199
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING);}
2013
199
#line 2014 "ASN1.c"
2014
199
    break;
2015
2016
199
  case 58:
2017
199
#line 294 "ASN1.y"
2018
199
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE);
2019
199
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2020
199
#line 2021 "ASN1.c"
2021
199
    break;
2022
2023
266
  case 59:
2024
266
#line 298 "ASN1.y"
2025
266
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING);}
2026
266
#line 2027 "ASN1.c"
2027
266
    break;
2028
2029
202
  case 60:
2030
202
#line 299 "ASN1.y"
2031
202
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING|CONST_SIZE);
2032
202
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2033
202
#line 2034 "ASN1.c"
2034
202
    break;
2035
2036
235
  case 61:
2037
235
#line 303 "ASN1.y"
2038
235
                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING);}
2039
235
#line 2040 "ASN1.c"
2040
235
    break;
2041
2042
269
  case 62:
2043
269
#line 304 "ASN1.y"
2044
269
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING|CONST_SIZE);
2045
269
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2046
269
#line 2047 "ASN1.c"
2047
269
    break;
2048
2049
195
  case 63:
2050
195
#line 308 "ASN1.y"
2051
195
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING);}
2052
195
#line 2053 "ASN1.c"
2053
195
    break;
2054
2055
200
  case 64:
2056
200
#line 309 "ASN1.y"
2057
200
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE);
2058
200
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2059
200
#line 2060 "ASN1.c"
2060
200
    break;
2061
2062
252
  case 65:
2063
252
#line 313 "ASN1.y"
2064
252
                                          {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING);}
2065
252
#line 2066 "ASN1.c"
2066
252
    break;
2067
2068
194
  case 66:
2069
194
#line 314 "ASN1.y"
2070
194
                                          {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING|CONST_SIZE);
2071
194
                                           _asn1_set_down((yyval.node),(yyvsp[0].node));}
2072
194
#line 2073 "ASN1.c"
2073
194
    break;
2074
2075
755
  case 67:
2076
755
#line 318 "ASN1.y"
2077
755
                                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
2078
755
                             _asn1_set_name((yyval.node),(yyvsp[-3].str));
2079
755
                                    _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
2080
755
#line 2081 "ASN1.c"
2081
755
    break;
2082
2083
416
  case 68:
2084
416
#line 323 "ASN1.y"
2085
416
                                  {(yyval.node)=(yyvsp[0].node);}
2086
416
#line 2087 "ASN1.c"
2087
416
    break;
2088
2089
339
  case 69:
2090
339
#line 324 "ASN1.y"
2091
339
                                                      {(yyval.node)=(yyvsp[-2].node);
2092
339
                                                       _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
2093
339
#line 2094 "ASN1.c"
2094
339
    break;
2095
2096
250
  case 70:
2097
250
#line 328 "ASN1.y"
2098
250
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING);}
2099
250
#line 2100 "ASN1.c"
2100
250
    break;
2101
2102
194
  case 71:
2103
194
#line 329 "ASN1.y"
2104
194
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_SIZE);
2105
194
                                      _asn1_set_down((yyval.node),(yyvsp[0].node));}
2106
194
#line 2107 "ASN1.c"
2107
194
    break;
2108
2109
194
  case 72:
2110
194
#line 332 "ASN1.y"
2111
194
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_LIST);
2112
194
                                _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2113
194
#line 2114 "ASN1.c"
2114
194
    break;
2115
2116
207
  case 73:
2117
207
#line 337 "ASN1.y"
2118
207
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ENUMERATED|CONST_LIST);
2119
207
                                _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2120
207
#line 2121 "ASN1.c"
2121
207
    break;
2122
2123
1.37k
  case 74:
2124
1.37k
#line 342 "ASN1.y"
2125
1.37k
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);}
2126
1.37k
#line 2127 "ASN1.c"
2127
1.37k
    break;
2128
2129
5.40k
  case 75:
2130
5.40k
#line 345 "ASN1.y"
2131
5.40k
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER);
2132
5.40k
                                       _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
2133
5.40k
#line 2134 "ASN1.c"
2134
5.40k
    break;
2135
2136
493
  case 76:
2137
493
#line 347 "ASN1.y"
2138
493
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER|CONST_SIZE);
2139
493
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);
2140
493
                                       _asn1_set_down((yyval.node),(yyvsp[0].node));}
2141
493
#line 2142 "ASN1.c"
2142
493
    break;
2143
2144
533
  case 77:
2145
533
#line 350 "ASN1.y"
2146
533
                                      {(yyval.node)=(yyvsp[0].node);}
2147
533
#line 2148 "ASN1.c"
2148
533
    break;
2149
2150
207
  case 78:
2151
207
#line 351 "ASN1.y"
2152
207
                                      {(yyval.node)=(yyvsp[0].node);}
2153
207
#line 2154 "ASN1.c"
2154
207
    break;
2155
2156
194
  case 79:
2157
194
#line 352 "ASN1.y"
2158
194
                                      {(yyval.node)=(yyvsp[0].node);}
2159
194
#line 2160 "ASN1.c"
2160
194
    break;
2161
2162
446
  case 81:
2163
446
#line 354 "ASN1.y"
2164
446
                                      {(yyval.node)=(yyvsp[0].node);}
2165
446
#line 2166 "ASN1.c"
2166
446
    break;
2167
2168
638
  case 82:
2169
638
#line 355 "ASN1.y"
2170
638
                                      {(yyval.node)=(yyvsp[0].node);}
2171
638
#line 2172 "ASN1.c"
2172
638
    break;
2173
2174
388
  case 83:
2175
388
#line 356 "ASN1.y"
2176
388
                                      {(yyval.node)=(yyvsp[0].node);}
2177
388
#line 2178 "ASN1.c"
2178
388
    break;
2179
2180
389
  case 84:
2181
389
#line 357 "ASN1.y"
2182
389
                                      {(yyval.node)=(yyvsp[0].node);}
2183
389
#line 2184 "ASN1.c"
2184
389
    break;
2185
2186
405
  case 85:
2187
405
#line 358 "ASN1.y"
2188
405
                                      {(yyval.node)=(yyvsp[0].node);}
2189
405
#line 2190 "ASN1.c"
2190
405
    break;
2191
2192
418
  case 86:
2193
418
#line 359 "ASN1.y"
2194
418
                                      {(yyval.node)=(yyvsp[0].node);}
2195
418
#line 2196 "ASN1.c"
2196
418
    break;
2197
2198
393
  case 87:
2199
393
#line 360 "ASN1.y"
2200
393
                                      {(yyval.node)=(yyvsp[0].node);}
2201
393
#line 2202 "ASN1.c"
2202
393
    break;
2203
2204
398
  case 88:
2205
398
#line 361 "ASN1.y"
2206
398
                                      {(yyval.node)=(yyvsp[0].node);}
2207
398
#line 2208 "ASN1.c"
2208
398
    break;
2209
2210
468
  case 89:
2211
468
#line 362 "ASN1.y"
2212
468
                                      {(yyval.node)=(yyvsp[0].node);}
2213
468
#line 2214 "ASN1.c"
2214
468
    break;
2215
2216
504
  case 90:
2217
504
#line 363 "ASN1.y"
2218
504
                                      {(yyval.node)=(yyvsp[0].node);}
2219
504
#line 2220 "ASN1.c"
2220
504
    break;
2221
2222
395
  case 91:
2223
395
#line 364 "ASN1.y"
2224
395
                                      {(yyval.node)=(yyvsp[0].node);}
2225
395
#line 2226 "ASN1.c"
2226
395
    break;
2227
2228
666
  case 92:
2229
666
#line 365 "ASN1.y"
2230
666
                                      {(yyval.node)=(yyvsp[0].node);}
2231
666
#line 2232 "ASN1.c"
2232
666
    break;
2233
2234
1.37k
  case 93:
2235
1.37k
#line 366 "ASN1.y"
2236
1.37k
                                      {(yyval.node)=(yyvsp[0].node);}
2237
1.37k
#line 2238 "ASN1.c"
2238
1.37k
    break;
2239
2240
209
  case 94:
2241
209
#line 367 "ASN1.y"
2242
209
                                      {(yyval.node)=(yyvsp[0].node);}
2243
209
#line 2244 "ASN1.c"
2244
209
    break;
2245
2246
825
  case 95:
2247
825
#line 368 "ASN1.y"
2248
825
                                      {(yyval.node)=(yyvsp[0].node);}
2249
825
#line 2250 "ASN1.c"
2250
825
    break;
2251
2252
1.57k
  case 96:
2253
1.57k
#line 369 "ASN1.y"
2254
1.57k
                                      {(yyval.node)=(yyvsp[0].node);}
2255
1.57k
#line 2256 "ASN1.c"
2256
1.57k
    break;
2257
2258
205
  case 97:
2259
205
#line 370 "ASN1.y"
2260
205
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NULL);}
2261
205
#line 2262 "ASN1.c"
2262
205
    break;
2263
2264
13.3k
  case 98:
2265
13.3k
#line 373 "ASN1.y"
2266
13.3k
                                              {(yyval.node)=(yyvsp[0].node);}
2267
13.3k
#line 2268 "ASN1.c"
2268
13.3k
    break;
2269
2270
2.66k
  case 99:
2271
2.66k
#line 374 "ASN1.y"
2272
2.66k
                                              {(yyval.node)=_asn1_mod_type((yyvsp[0].node),CONST_TAG);
2273
2.66k
                                               _asn1_set_right((yyvsp[-1].node),_asn1_get_down((yyval.node)));
2274
2.66k
                                               _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2275
2.66k
#line 2276 "ASN1.c"
2276
2.66k
    break;
2277
2278
12.1k
  case 100:
2279
12.1k
#line 379 "ASN1.y"
2280
12.1k
                                                      {(yyval.node)=(yyvsp[0].node);}
2281
12.1k
#line 2282 "ASN1.c"
2282
12.1k
    break;
2283
2284
1.80k
  case 101:
2285
1.80k
#line 380 "ASN1.y"
2286
1.80k
                                                      {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_DEFAULT);
2287
1.80k
                                                       _asn1_set_right((yyvsp[0].node),_asn1_get_down((yyval.node)));
2288
1.80k
                   _asn1_set_down((yyval.node),(yyvsp[0].node));}
2289
1.80k
#line 2290 "ASN1.c"
2290
1.80k
    break;
2291
2292
261
  case 102:
2293
261
#line 383 "ASN1.y"
2294
261
                                                      {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_OPTION);}
2295
261
#line 2296 "ASN1.c"
2296
261
    break;
2297
2298
14.2k
  case 103:
2299
14.2k
#line 386 "ASN1.y"
2300
14.2k
                                                      {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-1].str));}
2301
14.2k
#line 2302 "ASN1.c"
2302
14.2k
    break;
2303
2304
1.79k
  case 104:
2305
1.79k
#line 389 "ASN1.y"
2306
1.79k
                                               {(yyval.node)=(yyvsp[0].node);}
2307
1.79k
#line 2308 "ASN1.c"
2308
1.79k
    break;
2309
2310
12.4k
  case 105:
2311
12.4k
#line 390 "ASN1.y"
2312
12.4k
                                               {(yyval.node)=(yyvsp[-2].node);
2313
12.4k
                                                _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
2314
12.4k
#line 2315 "ASN1.c"
2315
12.4k
    break;
2316
2317
253
  case 106:
2318
253
#line 394 "ASN1.y"
2319
253
                                             {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE);
2320
253
                                              _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2321
253
#line 2322 "ASN1.c"
2322
253
    break;
2323
2324
206
  case 107:
2325
206
#line 396 "ASN1.y"
2326
206
                                             {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF);
2327
206
                                              _asn1_set_down((yyval.node),(yyvsp[0].node));}
2328
206
#line 2329 "ASN1.c"
2329
206
    break;
2330
2331
207
  case 108:
2332
207
#line 398 "ASN1.y"
2333
207
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE);
2334
207
                                            _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node));
2335
207
                                            _asn1_set_down((yyval.node),(yyvsp[-2].node));}
2336
207
#line 2337 "ASN1.c"
2337
207
    break;
2338
2339
996
  case 109:
2340
996
#line 403 "ASN1.y"
2341
996
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET);
2342
996
                                     _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2343
996
#line 2344 "ASN1.c"
2344
996
    break;
2345
2346
371
  case 110:
2347
371
#line 405 "ASN1.y"
2348
371
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF);
2349
371
                                     _asn1_set_down((yyval.node),(yyvsp[0].node));}
2350
371
#line 2351 "ASN1.c"
2351
371
    break;
2352
2353
204
  case 111:
2354
204
#line 407 "ASN1.y"
2355
204
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF|CONST_SIZE);
2356
204
                                       _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node));
2357
204
                                       _asn1_set_down((yyval.node),(yyvsp[-2].node));}
2358
204
#line 2359 "ASN1.c"
2359
204
    break;
2360
2361
209
  case 112:
2362
209
#line 412 "ASN1.y"
2363
209
                                            {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CHOICE);
2364
209
                                             _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2365
209
#line 2366 "ASN1.c"
2366
209
    break;
2367
2368
624
  case 113:
2369
624
#line 416 "ASN1.y"
2370
624
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY);}
2371
624
#line 2372 "ASN1.c"
2372
624
    break;
2373
2374
201
  case 114:
2375
201
#line 417 "ASN1.y"
2376
201
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY|CONST_DEFINED_BY);
2377
201
                                        _asn1_set_down((yyval.node),_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT));
2378
201
                                  _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[0].str));}
2379
201
#line 2380 "ASN1.c"
2380
201
    break;
2381
2382
210
  case 115:
2383
210
#line 422 "ASN1.y"
2384
210
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2385
210
#line 2386 "ASN1.c"
2386
210
    break;
2387
2388
194
  case 116:
2389
194
#line 423 "ASN1.y"
2390
194
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2391
194
#line 2392 "ASN1.c"
2392
194
    break;
2393
2394
194
  case 117:
2395
194
#line 424 "ASN1.y"
2396
194
                           { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2397
194
#line 2398 "ASN1.c"
2398
194
    break;
2399
2400
69
  case 118:
2401
69
#line 425 "ASN1.y"
2402
69
                           { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2403
69
#line 2404 "ASN1.c"
2404
69
    break;
2405
2406
78
  case 119:
2407
78
#line 426 "ASN1.y"
2408
78
                     { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2409
78
#line 2410 "ASN1.c"
2410
78
    break;
2411
2412
195
  case 120:
2413
195
#line 427 "ASN1.y"
2414
195
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2415
195
#line 2416 "ASN1.c"
2416
195
    break;
2417
2418
69
  case 121:
2419
69
#line 428 "ASN1.y"
2420
69
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2421
69
#line 2422 "ASN1.c"
2422
69
    break;
2423
2424
525
  case 122:
2425
525
#line 429 "ASN1.y"
2426
525
                     { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2427
525
#line 2428 "ASN1.c"
2428
525
    break;
2429
2430
1.47k
  case 123:
2431
1.47k
#line 432 "ASN1.y"
2432
1.47k
                                                                          {
2433
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
2434
  fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n", file_name, line_number, (yyvsp[-8].str));
2435
#endif
2436
1.47k
}
2437
1.47k
#line 2438 "ASN1.c"
2438
1.47k
    break;
2439
2440
1.75k
  case 124:
2441
1.75k
#line 439 "ASN1.y"
2442
1.75k
                                                  { (yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-2].str));}
2443
1.75k
#line 2444 "ASN1.c"
2444
1.75k
    break;
2445
2446
231
  case 125:
2447
231
#line 443 "ASN1.y"
2448
231
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN);
2449
231
                         _asn1_set_name((yyval.node),(yyvsp[-6].str));
2450
231
                         _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2451
231
#line 2452 "ASN1.c"
2452
231
    break;
2453
2454
1.79k
  case 126:
2455
1.79k
#line 447 "ASN1.y"
2456
1.79k
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
2457
1.79k
                         _asn1_set_name((yyval.node),(yyvsp[-5].str));
2458
1.79k
                         _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1);
2459
1.79k
                         _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2460
1.79k
#line 2461 "ASN1.c"
2461
1.79k
    break;
2462
2463
2.06k
  case 127:
2464
2.06k
#line 452 "ASN1.y"
2465
2.06k
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_ASSIGN);
2466
2.06k
                         _asn1_set_name((yyval.node),(yyvsp[-3].str));
2467
2.06k
                         _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
2468
2.06k
#line 2469 "ASN1.c"
2469
2.06k
    break;
2470
2471
1.75k
  case 128:
2472
1.75k
#line 457 "ASN1.y"
2473
1.75k
                              {(yyval.node)=(yyvsp[0].node);}
2474
1.75k
#line 2475 "ASN1.c"
2475
1.75k
    break;
2476
2477
1.47k
  case 129:
2478
1.47k
#line 458 "ASN1.y"
2479
1.47k
                              {(yyval.node)=NULL;}
2480
1.47k
#line 2481 "ASN1.c"
2481
1.47k
    break;
2482
2483
4.08k
  case 130:
2484
4.08k
#line 459 "ASN1.y"
2485
4.08k
                              {(yyval.node)=(yyvsp[0].node);}
2486
4.08k
#line 2487 "ASN1.c"
2487
4.08k
    break;
2488
2489
1.26k
  case 131:
2490
1.26k
#line 462 "ASN1.y"
2491
1.26k
                                        {(yyval.node)=(yyvsp[0].node);}
2492
1.26k
#line 2493 "ASN1.c"
2493
1.26k
    break;
2494
2495
6.06k
  case 132:
2496
6.06k
#line 463 "ASN1.y"
2497
6.06k
                                                         {if (!(yyvsp[-1].node))
2498
831
                                                            {
2499
831
                                                              (yyval.node) = (yyvsp[0].node);
2500
831
                                                            }
2501
5.22k
                                                          else
2502
5.22k
                                                            {
2503
5.22k
                                                              (yyval.node)=(yyvsp[-1].node);
2504
5.22k
                                                              if ((yyvsp[0].node)) _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));
2505
5.22k
                                                            }}
2506
6.06k
#line 2507 "ASN1.c"
2507
6.06k
    break;
2508
2509
61
  case 133:
2510
61
#line 474 "ASN1.y"
2511
61
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2512
61
                                                          _asn1_set_down((yyval.node),(yyvsp[-1].node));
2513
61
                                                          _asn1_set_name((yyval.node),(yyvsp[-3].str));}
2514
61
#line 2515 "ASN1.c"
2515
61
    break;
2516
2517
41
  case 134:
2518
41
#line 477 "ASN1.y"
2519
41
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2520
41
                                                          _asn1_set_name((yyval.node),(yyvsp[-2].str));}
2521
41
#line 2522 "ASN1.c"
2522
41
    break;
2523
2524
1.91k
  case 135:
2525
1.91k
#line 479 "ASN1.y"
2526
1.91k
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2527
1.91k
                                                          _asn1_set_name((yyval.node),(yyvsp[0].str));}
2528
1.91k
#line 2529 "ASN1.c"
2529
1.91k
    break;
2530
2531
376
  case 136:
2532
376
#line 503 "ASN1.y"
2533
376
                               {(yyval.constant)=CONST_EXPLICIT;}
2534
376
#line 2535 "ASN1.c"
2535
376
    break;
2536
2537
1.39k
  case 137:
2538
1.39k
#line 504 "ASN1.y"
2539
1.39k
                               {(yyval.constant)=CONST_IMPLICIT;}
2540
1.39k
#line 2541 "ASN1.c"
2541
1.39k
    break;
2542
2543
2544
0
#line 2545 "ASN1.c"
2545
2546
1.49k
      default: break;
2547
174k
    }
2548
  /* User semantic actions sometimes alter yychar, and that requires
2549
     that yytoken be updated with the new translation.  We take the
2550
     approach of translating immediately before every use of yytoken.
2551
     One alternative is translating here after every semantic action,
2552
     but that translation would be missed if the semantic action invokes
2553
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2554
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2555
     incorrect destructor might then be invoked immediately.  In the
2556
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2557
     to an incorrect destructor call or verbose syntax error message
2558
     before the lookahead is translated.  */
2559
174k
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2560
2561
174k
  YYPOPSTACK (yylen);
2562
174k
  yylen = 0;
2563
174k
  YY_STACK_PRINT (yyss, yyssp);
2564
2565
174k
  *++yyvsp = yyval;
2566
2567
  /* Now 'shift' the result of the reduction.  Determine what state
2568
     that goes to, based on the state we popped back to and the rule
2569
     number reduced by.  */
2570
174k
  {
2571
174k
    const int yylhs = yyr1[yyn] - YYNTOKENS;
2572
174k
    const int yyi = yypgoto[yylhs] + *yyssp;
2573
174k
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2574
174k
               ? yytable[yyi]
2575
174k
               : yydefgoto[yylhs]);
2576
174k
  }
2577
2578
174k
  goto yynewstate;
2579
2580
2581
/*--------------------------------------.
2582
| yyerrlab -- here on detecting error.  |
2583
`--------------------------------------*/
2584
1.29k
yyerrlab:
2585
  /* Make sure we have latest lookahead translation.  See comments at
2586
     user semantic actions for why this is necessary.  */
2587
1.29k
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2588
2589
  /* If not already recovering from an error, report this error.  */
2590
1.29k
  if (!yyerrstatus)
2591
1.29k
    {
2592
1.29k
      ++yynerrs;
2593
#if ! YYERROR_VERBOSE
2594
      yyerror (YY_("syntax error"));
2595
#else
2596
1.29k
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2597
1.29k
                                        yyssp, yytoken)
2598
1.29k
      {
2599
1.29k
        char const *yymsgp = YY_("syntax error");
2600
1.29k
        int yysyntax_error_status;
2601
1.29k
        yysyntax_error_status = YYSYNTAX_ERROR;
2602
1.29k
        if (yysyntax_error_status == 0)
2603
1.29k
          yymsgp = yymsg;
2604
0
        else if (yysyntax_error_status == 1)
2605
0
          {
2606
0
            if (yymsg != yymsgbuf)
2607
0
              YYSTACK_FREE (yymsg);
2608
0
            yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2609
0
            if (!yymsg)
2610
0
              {
2611
0
                yymsg = yymsgbuf;
2612
0
                yymsg_alloc = sizeof yymsgbuf;
2613
0
                yysyntax_error_status = 2;
2614
0
              }
2615
0
            else
2616
0
              {
2617
0
                yysyntax_error_status = YYSYNTAX_ERROR;
2618
0
                yymsgp = yymsg;
2619
0
              }
2620
0
          }
2621
1.29k
        yyerror (yymsgp);
2622
1.29k
        if (yysyntax_error_status == 2)
2623
0
          goto yyexhaustedlab;
2624
1.29k
      }
2625
1.29k
# undef YYSYNTAX_ERROR
2626
1.29k
#endif
2627
1.29k
    }
2628
2629
2630
2631
1.29k
  if (yyerrstatus == 3)
2632
0
    {
2633
      /* If just tried and failed to reuse lookahead token after an
2634
         error, discard it.  */
2635
2636
0
      if (yychar <= YYEOF)
2637
0
        {
2638
          /* Return failure if at end of input.  */
2639
0
          if (yychar == YYEOF)
2640
0
            YYABORT;
2641
0
        }
2642
0
      else
2643
0
        {
2644
0
          yydestruct ("Error: discarding",
2645
0
                      yytoken, &yylval);
2646
0
          yychar = YYEMPTY;
2647
0
        }
2648
0
    }
2649
2650
  /* Else will try to reuse lookahead token after shifting the error
2651
     token.  */
2652
1.29k
  goto yyerrlab1;
2653
2654
2655
/*---------------------------------------------------.
2656
| yyerrorlab -- error raised explicitly by YYERROR.  |
2657
`---------------------------------------------------*/
2658
1.29k
yyerrorlab:
2659
  /* Pacify compilers when the user code never invokes YYERROR and the
2660
     label yyerrorlab therefore never appears in user code.  */
2661
0
  if (0)
2662
0
    YYERROR;
2663
2664
  /* Do not reclaim the symbols of the rule whose action triggered
2665
     this YYERROR.  */
2666
0
  YYPOPSTACK (yylen);
2667
0
  yylen = 0;
2668
0
  YY_STACK_PRINT (yyss, yyssp);
2669
0
  yystate = *yyssp;
2670
0
  goto yyerrlab1;
2671
2672
2673
/*-------------------------------------------------------------.
2674
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2675
`-------------------------------------------------------------*/
2676
1.29k
yyerrlab1:
2677
1.29k
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2678
2679
1.29k
  for (;;)
2680
16.7k
    {
2681
16.7k
      yyn = yypact[yystate];
2682
16.7k
      if (!yypact_value_is_default (yyn))
2683
16.7k
        {
2684
16.7k
          yyn += YYTERROR;
2685
16.7k
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2686
0
            {
2687
0
              yyn = yytable[yyn];
2688
0
              if (0 < yyn)
2689
0
                break;
2690
0
            }
2691
16.7k
        }
2692
2693
      /* Pop the current state because it cannot handle the error token.  */
2694
16.7k
      if (yyssp == yyss)
2695
1.29k
        YYABORT;
2696
2697
2698
15.4k
      yydestruct ("Error: popping",
2699
15.4k
                  yystos[yystate], yyvsp);
2700
15.4k
      YYPOPSTACK (1);
2701
15.4k
      yystate = *yyssp;
2702
15.4k
      YY_STACK_PRINT (yyss, yyssp);
2703
15.4k
    }
2704
2705
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2706
0
  *++yyvsp = yylval;
2707
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
2708
2709
2710
  /* Shift the error token.  */
2711
0
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2712
2713
0
  yystate = yyn;
2714
0
  goto yynewstate;
2715
2716
2717
/*-------------------------------------.
2718
| yyacceptlab -- YYACCEPT comes here.  |
2719
`-------------------------------------*/
2720
964
yyacceptlab:
2721
964
  yyresult = 0;
2722
964
  goto yyreturn;
2723
2724
2725
/*-----------------------------------.
2726
| yyabortlab -- YYABORT comes here.  |
2727
`-----------------------------------*/
2728
1.29k
yyabortlab:
2729
1.29k
  yyresult = 1;
2730
1.29k
  goto yyreturn;
2731
2732
2733
0
#if !defined yyoverflow || YYERROR_VERBOSE
2734
/*-------------------------------------------------.
2735
| yyexhaustedlab -- memory exhaustion comes here.  |
2736
`-------------------------------------------------*/
2737
0
yyexhaustedlab:
2738
0
  yyerror (YY_("memory exhausted"));
2739
0
  yyresult = 2;
2740
  /* Fall through.  */
2741
0
#endif
2742
2743
2744
/*-----------------------------------------------------.
2745
| yyreturn -- parsing is finished, return the result.  |
2746
`-----------------------------------------------------*/
2747
2.26k
yyreturn:
2748
2.26k
  if (yychar != YYEMPTY)
2749
1.29k
    {
2750
      /* Make sure we have latest lookahead translation.  See comments at
2751
         user semantic actions for why this is necessary.  */
2752
1.29k
      yytoken = YYTRANSLATE (yychar);
2753
1.29k
      yydestruct ("Cleanup: discarding lookahead",
2754
1.29k
                  yytoken, &yylval);
2755
1.29k
    }
2756
  /* Do not reclaim the symbols of the rule whose action triggered
2757
     this YYABORT or YYACCEPT.  */
2758
2.26k
  YYPOPSTACK (yylen);
2759
2.26k
  YY_STACK_PRINT (yyss, yyssp);
2760
4.18k
  while (yyssp != yyss)
2761
1.92k
    {
2762
1.92k
      yydestruct ("Cleanup: popping",
2763
1.92k
                  yystos[+*yyssp], yyvsp);
2764
1.92k
      YYPOPSTACK (1);
2765
1.92k
    }
2766
2.26k
#ifndef yyoverflow
2767
2.26k
  if (yyss != yyssa)
2768
17
    YYSTACK_FREE (yyss);
2769
2.26k
#endif
2770
2.26k
#if YYERROR_VERBOSE
2771
2.26k
  if (yymsg != yymsgbuf)
2772
0
    YYSTACK_FREE (yymsg);
2773
2.26k
#endif
2774
2.26k
  return yyresult;
2775
0
}
2776
#line 508 "ASN1.y"
2777
2778
2779
2780
2781
static const char *key_word[] = {
2782
  "::=","OPTIONAL","INTEGER","SIZE","OCTET","STRING",
2783
  "SEQUENCE","BIT","UNIVERSAL","PRIVATE","OPTIONAL",
2784
  "DEFAULT","CHOICE","OF","OBJECT","IDENTIFIER",
2785
  "BOOLEAN","TRUE","FALSE","APPLICATION","ANY","DEFINED",
2786
  "SET","BY","EXPLICIT","IMPLICIT","DEFINITIONS","TAGS",
2787
  "BEGIN","END","UTCTime","GeneralizedTime",
2788
  "GeneralString","FROM","IMPORTS","NULL","ENUMERATED",
2789
  "NumericString", "IA5String", "TeletexString", "PrintableString",
2790
  "UniversalString", "BMPString", "UTF8String", "VisibleString"};
2791
2792
static const int key_word_token[] = {
2793
  ASSIG, OPTIONAL, INTEGER, SIZE, OCTET, STRING, SEQUENCE, BIT, UNIVERSAL,
2794
      PRIVATE, OPTIONAL, DEFAULT, CHOICE, OF, OBJECT, STR_IDENTIFIER,
2795
      BOOLEAN, ASN1_TRUE, ASN1_FALSE, APPLICATION, ANY, DEFINED, SET, BY,
2796
      EXPLICIT, IMPLICIT, DEFINITIONS, TAGS, BEGIN, END, UTCTime,
2797
      GeneralizedTime, GeneralString, FROM, IMPORTS, TOKEN_NULL,
2798
      ENUMERATED, NumericString, IA5String, TeletexString, PrintableString,
2799
      UniversalString, BMPString, UTF8String, VisibleString
2800
};
2801
2802
/*************************************************************/
2803
/*  Function: _asn1_yylex                                    */
2804
/*  Description: looks for tokens in file_asn1 pointer file. */
2805
/*  Return: int                                              */
2806
/*    Token identifier or ASCII code or 0(zero: End Of File) */
2807
/*************************************************************/
2808
static int
2809
_asn1_yylex (void)
2810
165k
{
2811
165k
  int c, counter = 0, k, lastc;
2812
165k
  char string[ASN1_MAX_NAME_SIZE + 1];  /* will contain the next token */
2813
165k
  size_t i;
2814
2815
165k
  while (1)
2816
165k
    {
2817
238k
      while ((c = fgetc (file_asn1)) == ' ' || c == '\t' || c == '\n')
2818
73.0k
        if (c == '\n')
2819
18.2k
          line_number++;
2820
2821
165k
      if (c == EOF)
2822
2.02k
        {
2823
2.02k
          snprintf (last_token, sizeof(last_token), "End Of File");
2824
2.02k
          return 0;
2825
2.02k
        }
2826
2827
163k
      if (c == '(' || c == ')' || c == '[' || c == ']' ||
2828
163k
          c == '{' || c == '}' || c == ',' || c == '.' ||
2829
163k
          c == '+' || c == '|')
2830
51.8k
        {
2831
51.8k
          last_token[0] = c;
2832
51.8k
          last_token[1] = 0;
2833
51.8k
          return c;
2834
51.8k
        }
2835
111k
      if (c == '-')
2836
1.76k
        {                       /* Maybe the first '-' of a comment */
2837
1.76k
          if ((c = fgetc (file_asn1)) != '-')
2838
1.17k
            {
2839
1.17k
              ungetc (c, file_asn1);
2840
1.17k
              last_token[0] = '-';
2841
1.17k
              last_token[1] = 0;
2842
1.17k
              return '-';
2843
1.17k
            }
2844
593
          else
2845
593
            {                   /* Comments */
2846
593
              lastc = 0;
2847
593
              counter = 0;
2848
              /* A comment finishes at the next double hyphen or the end of line */
2849
15.4k
              while ((c = fgetc (file_asn1)) != EOF && c != '\n' &&
2850
15.4k
                     (lastc != '-' || (lastc == '-' && c != '-')))
2851
14.9k
                lastc = c;
2852
593
              if (c == EOF)
2853
33
                {
2854
33
                  snprintf (last_token, sizeof(last_token), "End Of File");
2855
33
                  return 0;
2856
33
                }
2857
560
              else
2858
560
                {
2859
560
                  if (c == '\n')
2860
280
                    line_number++;
2861
560
                  continue;     /* next char, please! (repeat the search) */
2862
560
                }
2863
593
            }
2864
1.76k
        }
2865
109k
      string[counter++] = (char) c;
2866
      /* Till the end of the token */
2867
417k
      while (!
2868
417k
             ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t'
2869
417k
              || c == '\n' || c == '(' || c == ')' || c == '[' || c == ']'
2870
417k
              || c == '{' || c == '}' || c == ',' || c == '.'))
2871
308k
        {
2872
308k
          if (counter >= ASN1_MAX_NAME_SIZE)
2873
2
            {
2874
2
              result_parse = ASN1_NAME_TOO_LONG;
2875
2
              return 0;
2876
2
            }
2877
308k
          string[counter++] = (char) c;
2878
308k
        }
2879
109k
      ungetc (c, file_asn1);
2880
109k
      string[counter] = 0;
2881
109k
      snprintf (last_token, sizeof(last_token), "%s", string);
2882
2883
      /* Is STRING a number? */
2884
131k
      for (k = 0; k < counter; k++)
2885
117k
        if (!c_isdigit ((int)string[k]))
2886
96.0k
          break;
2887
109k
      if (k >= counter)
2888
13.8k
        {
2889
13.8k
          snprintf (yylval.str, sizeof(yylval.str), "%s", string);
2890
13.8k
          return NUM;           /* return the number */
2891
13.8k
        }
2892
2893
      /* Is STRING a keyword? */
2894
2.85M
      for (i = 0; i < (sizeof (key_word) / sizeof (char *)); i++)
2895
2.81M
        if (!strcmp (string, key_word[i]))
2896
51.8k
          return key_word_token[i];
2897
2898
      /* STRING is an IDENTIFIER */
2899
44.1k
      snprintf (yylval.str, sizeof(yylval.str), "%s", string);
2900
44.1k
      return IDENTIFIER;
2901
96.0k
    }
2902
165k
}
2903
2904
/*************************************************************/
2905
/*  Function: _asn1_create_errorDescription                  */
2906
/*  Description: creates a string with the description of the*/
2907
/*    error.                                                 */
2908
/*  Parameters:                                              */
2909
/*    error : error to describe.                             */
2910
/*    error_desc: string that will contain the         */
2911
/*                      description.                         */
2912
/*************************************************************/
2913
static void
2914
_asn1_create_errorDescription (int error, char *error_desc)
2915
1.84k
{
2916
1.84k
  if (error_desc == NULL)
2917
0
    return;
2918
2919
2920
1.84k
  switch (error)
2921
1.84k
    {
2922
0
    case ASN1_FILE_NOT_FOUND:
2923
0
      snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name);
2924
0
      break;
2925
1.29k
    case ASN1_SYNTAX_ERROR:
2926
1.29k
      snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s", last_error);
2927
1.29k
      break;
2928
2
    case ASN1_NAME_TOO_LONG:
2929
2
      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
2930
2
                "%s:%u: name too long (more than %u characters)", file_name,
2931
2
                line_number, (unsigned)ASN1_MAX_NAME_SIZE);
2932
2
      break;
2933
412
    case ASN1_IDENTIFIER_NOT_FOUND:
2934
412
      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
2935
412
                "%s:: identifier '%s' not found", file_name,
2936
412
                _asn1_identifierMissing);
2937
412
      break;
2938
141
    default:
2939
141
      error_desc[0] = 0;
2940
141
      break;
2941
1.84k
    }
2942
2943
1.84k
}
2944
2945
/**
2946
 * asn1_parser2tree:
2947
 * @file: specify the path and the name of file that contains
2948
 *   ASN.1 declarations.
2949
 * @definitions: return the pointer to the structure created from
2950
 *   "file" ASN.1 declarations.
2951
 * @error_desc: return the error description or an empty
2952
 * string if success.
2953
 *
2954
 * Function used to start the parse algorithm.  Creates the structures
2955
 * needed to manage the definitions included in @file file.
2956
 *
2957
 * Returns: %ASN1_SUCCESS if the file has a correct syntax and every
2958
 *   identifier is known, %ASN1_ELEMENT_NOT_EMPTY if @definitions not
2959
 *   %NULL, %ASN1_FILE_NOT_FOUND if an error occurred while
2960
 *   opening @file, %ASN1_SYNTAX_ERROR if the syntax is not
2961
 *   correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an
2962
 *   identifier that is not defined, %ASN1_NAME_TOO_LONG if in the
2963
 *   file there is an identifier with more than %ASN1_MAX_NAME_SIZE
2964
 *   characters.
2965
 **/
2966
int
2967
asn1_parser2tree (const char *file, asn1_node * definitions,
2968
                  char *error_desc)
2969
2.26k
{
2970
2.26k
  if (*definitions != NULL)
2971
0
    {
2972
0
      result_parse = ASN1_ELEMENT_NOT_EMPTY;
2973
0
      goto error;
2974
0
    }
2975
2976
2.26k
  file_name = file;
2977
2978
  /* open the file to parse */
2979
2.26k
  file_asn1 = fopen (file, "r");
2980
2981
2.26k
  if (file_asn1 == NULL)
2982
0
    {
2983
0
      result_parse = ASN1_FILE_NOT_FOUND;
2984
0
      goto error;
2985
0
    }
2986
2987
2.26k
  result_parse = ASN1_SUCCESS;
2988
2989
2.26k
  line_number = 1;
2990
2.26k
  yyparse ();
2991
2992
2.26k
  fclose (file_asn1);
2993
2994
2.26k
  if (result_parse != ASN1_SUCCESS)
2995
1.29k
    goto error;
2996
2997
  /* set IMPLICIT or EXPLICIT property */
2998
964
  _asn1_set_default_tag (p_tree);
2999
  /* set CONST_SET and CONST_NOT_USED */
3000
964
  _asn1_type_set_config (p_tree);
3001
  /* check the identifier definitions */
3002
964
  result_parse = _asn1_check_identifier (p_tree);
3003
964
  if (result_parse != ASN1_SUCCESS)
3004
412
    goto error;
3005
3006
  /* Convert into DER coding the value assign to INTEGER constants */
3007
552
  _asn1_change_integer_value (p_tree);
3008
  /* Expand the IDs of OBJECT IDENTIFIER constants */
3009
552
  result_parse = _asn1_expand_object_id (&e_list, p_tree);
3010
552
  if (result_parse != ASN1_SUCCESS)
3011
141
    goto error;
3012
3013
  /* success */
3014
411
  *definitions = p_tree;
3015
411
  _asn1_delete_list (e_list);
3016
411
  e_list = NULL;
3017
411
  p_tree = NULL;
3018
411
  *error_desc = 0;
3019
411
  return result_parse;
3020
3021
1.84k
error:
3022
1.84k
  _asn1_delete_list_and_nodes (e_list);
3023
1.84k
  e_list = NULL;
3024
1.84k
  p_tree = NULL;
3025
3026
1.84k
  _asn1_create_errorDescription (result_parse, error_desc);
3027
3028
1.84k
  return result_parse;
3029
552
}
3030
3031
/**
3032
 * asn1_parser2array:
3033
 * @inputFileName: specify the path and the name of file that
3034
 *   contains ASN.1 declarations.
3035
 * @outputFileName: specify the path and the name of file that will
3036
 *   contain the C vector definition.
3037
 * @vectorName: specify the name of the C vector.
3038
 * @error_desc: return the error description or an empty
3039
 *   string if success.
3040
 *
3041
 * Function that generates a C structure from an ASN1 file.  Creates a
3042
 * file containing a C vector to use to manage the definitions
3043
 * included in @inputFileName file. If @inputFileName is
3044
 * "/aa/bb/xx.yy" and @outputFileName is %NULL, the file created is
3045
 * "/aa/bb/xx_asn1_tab.c".  If @vectorName is %NULL the vector name
3046
 * will be "xx_asn1_tab".
3047
 *
3048
 * Returns: %ASN1_SUCCESS if the file has a correct syntax and every
3049
 *   identifier is known, %ASN1_FILE_NOT_FOUND if an error occurred
3050
 *   while opening @inputFileName, %ASN1_SYNTAX_ERROR if the syntax is
3051
 *   not correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is
3052
 *   an identifier that is not defined, %ASN1_NAME_TOO_LONG if in the
3053
 *   file there is an identifier with more than %ASN1_MAX_NAME_SIZE
3054
 *   characters.
3055
 **/
3056
int
3057
asn1_parser2array (const char *inputFileName, const char *outputFileName,
3058
                   const char *vectorName, char *error_desc)
3059
0
{
3060
0
  char *file_out_name = NULL;
3061
0
  char *vector_name = NULL;
3062
0
  const char *char_p, *slash_p, *dot_p;
3063
3064
0
  p_tree = NULL;
3065
3066
0
  file_name = inputFileName;
3067
3068
  /* open the file to parse */
3069
0
  file_asn1 = fopen (inputFileName, "r");
3070
3071
0
  if (file_asn1 == NULL)
3072
0
    {
3073
0
      result_parse = ASN1_FILE_NOT_FOUND;
3074
0
      goto error2;
3075
0
    }
3076
3077
0
  result_parse = ASN1_SUCCESS;
3078
3079
0
  line_number = 1;
3080
0
  yyparse ();
3081
3082
0
  fclose (file_asn1);
3083
0
  if (result_parse != ASN1_SUCCESS)
3084
0
    goto error1;
3085
3086
  /* set IMPLICIT or EXPLICIT property */
3087
0
  _asn1_set_default_tag (p_tree);
3088
  /* set CONST_SET and CONST_NOT_USED */
3089
0
  _asn1_type_set_config (p_tree);
3090
  /* check the identifier definitions */
3091
0
  result_parse = _asn1_check_identifier (p_tree);
3092
0
  if (result_parse != ASN1_SUCCESS)
3093
0
    goto error2;
3094
3095
  /* all identifier defined */
3096
  /* searching the last '/' and '.' in inputFileName */
3097
0
  char_p = inputFileName;
3098
0
  slash_p = inputFileName;
3099
0
  while ((char_p = strchr (char_p, '/')))
3100
0
    {
3101
0
      char_p++;
3102
0
      slash_p = char_p;
3103
0
    }
3104
3105
0
  char_p = slash_p;
3106
0
  dot_p = inputFileName + strlen (inputFileName);
3107
3108
0
  while ((char_p = strchr (char_p, '.')))
3109
0
    {
3110
0
      dot_p = char_p;
3111
0
      char_p++;
3112
0
    }
3113
3114
0
  if (outputFileName == NULL)
3115
0
    {
3116
      /* file_out_name = inputFileName + _asn1_tab.c */
3117
0
      file_out_name = malloc (dot_p - inputFileName + 1 +
3118
0
                              sizeof ("_asn1_tab.c")-1);
3119
0
      memcpy (file_out_name, inputFileName,
3120
0
              dot_p - inputFileName);
3121
0
      file_out_name[dot_p - inputFileName] = 0;
3122
0
      strcat (file_out_name, "_asn1_tab.c");
3123
0
    }
3124
0
  else
3125
0
    {
3126
      /* file_out_name = inputFileName */
3127
0
      file_out_name = strdup(outputFileName);
3128
0
    }
3129
3130
0
  if (vectorName == NULL)
3131
0
    {
3132
0
      unsigned len, i;
3133
      /* vector_name = file name + _asn1_tab */
3134
0
      vector_name = malloc (dot_p - slash_p + 1 +
3135
0
                            sizeof("_asn1_tab") - 1);
3136
0
      memcpy (vector_name, slash_p, dot_p - slash_p);
3137
0
      vector_name[dot_p - slash_p] = 0;
3138
0
      strcat (vector_name, "_asn1_tab");
3139
3140
0
      len = strlen(vector_name);
3141
0
      for (i=0;i<len;i++)
3142
0
        {
3143
0
          if (vector_name[i] == '-')
3144
0
          vector_name[i] = '_';
3145
0
        }
3146
0
    }
3147
0
  else
3148
0
    {
3149
      /* vector_name = vectorName */
3150
0
      vector_name = strdup(vectorName);
3151
0
    }
3152
3153
  /* Save structure in a file */
3154
0
  _asn1_create_static_structure (p_tree,
3155
0
                                 file_out_name, vector_name);
3156
3157
0
  free (file_out_name);
3158
0
  free (vector_name);
3159
3160
0
 error1:
3161
0
  _asn1_delete_list_and_nodes (e_list);
3162
0
  e_list = NULL;
3163
3164
0
 error2:
3165
0
  _asn1_create_errorDescription (result_parse, error_desc);
3166
3167
0
  return result_parse;
3168
0
}
3169
3170
/*************************************************************/
3171
/*  Function: _asn1_yyerror                                  */
3172
/*  Description: function called when there are syntax errors*/
3173
/*  Parameters:                                              */
3174
/*    char *s : error description                            */
3175
/*  Return: int                                              */
3176
/*                                                           */
3177
/*************************************************************/
3178
static void
3179
_asn1_yyerror (const char *s)
3180
1.29k
{
3181
  /* Sends the error description to the std_out */
3182
1.29k
  last_error_token[0] = 0;
3183
3184
1.29k
  if (result_parse != ASN1_NAME_TOO_LONG)
3185
1.29k
    {
3186
1.29k
      snprintf (last_error, sizeof(last_error),
3187
1.29k
                "%s:%u: Error: %s near '%s'", file_name,
3188
1.29k
                line_number, s, last_token);
3189
1.29k
      result_parse = ASN1_SYNTAX_ERROR;
3190
1.29k
    }
3191
3192
1.29k
  return;
3193
1.29k
}