Coverage Report

Created: 2026-06-09 06:48

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libtasn1/lib/ASN1.c
Line
Count
Source
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.65k
#define YYSTYPE         _ASN1_YYSTYPE
67
/* Substitute the variable and function names.  */
68
2.41k
#define yyparse         _asn1_yyparse
69
171k
#define yylex           _asn1_yylex
70
1.34k
#define yyerror         _asn1_yyerror
71
#define yydebug         _asn1_yydebug
72
3.75k
#define yynerrs         _asn1_yynerrs
73
292k
#define yylval          _asn1_yylval
74
763k
#define yychar          _asn1_yychar
75
76
/* First part of user prologue.  */
77
#line 1 "ASN1.y"
78
79
/*
80
 * Copyright (C) 2001-2026 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
3.23k
#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
364k
#   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.48k
#   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
14.8k
#define NUM 259
253
45.9k
#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.8k
#  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.13k
  YY_CAST (YYPTRDIFF_T,                                 \
415
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
416
            ? YYPTRDIFF_MAXIMUM                         \
417
            : YY_CAST (YYSIZE_T, -1)))
418
419
162
#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.34k
#  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.3k
# 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
354k
#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
27
#  define YYSTACK_FREE YYFREE
537
#  ifndef YYSTACK_ALLOC_MAXIMUM
538
4.13k
#   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
27
#   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
54
# 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
54
    do                                                                  \
593
54
      {                                                                 \
594
54
        YYPTRDIFF_T yynewbytes;                                         \
595
54
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
596
54
        Stack = &yyptr->Stack_alloc;                                    \
597
54
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
598
54
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
599
54
      }                                                                 \
600
54
    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
54
      __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
354k
#define YYFINAL  5
626
/* YYLAST -- Last index in YYTABLE.  */
627
565k
#define YYLAST   248
628
629
/* YYNTOKENS -- Number of terminals.  */
630
185k
#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
206k
#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
207k
  (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
371k
#define YYPACT_NINF (-140)
752
753
#define yypact_value_is_default(Yyn) \
754
371k
  ((Yyn) == YYPACT_NINF)
755
756
#define YYTABLE_NINF (-12)
757
758
#define yytable_value_is_error(Yyn) \
759
717
  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
383k
#define YYEMPTY         (-2)
977
209k
#define YYEOF           0
978
979
1.07k
#define YYACCEPT        goto yyacceptlab
980
1.34k
#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
108k
#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.41k
# 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
54
# define YYMAXDEPTH 10000
1155
#endif
1156
1157
1158
#if YYERROR_VERBOSE
1159
1160
# ifndef yystrlen
1161
#  if defined __GLIBC__ && defined _STRING_H
1162
5.40k
#   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.93k
#   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.15k
{
1207
7.15k
  if (*yystr == '"')
1208
154
    {
1209
154
      YYPTRDIFF_T yyn = 0;
1210
154
      char const *yyp = yystr;
1211
1212
154
      for (;;)
1213
616
        switch (*++yyp)
1214
616
          {
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
462
          default:
1227
462
            if (yyres)
1228
231
              yyres[yyn] = *yyp;
1229
462
            yyn++;
1230
462
            break;
1231
1232
154
          case '"':
1233
154
            if (yyres)
1234
77
              yyres[yyn] = '\0';
1235
154
            return yyn;
1236
616
          }
1237
0
    do_not_strip_quotes: ;
1238
0
    }
1239
1240
6.99k
  if (yyres)
1241
2.93k
    return yystpcpy (yyres, yystr) - yyres;
1242
4.06k
  else
1243
4.06k
    return yystrlen (yystr);
1244
6.99k
}
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.34k
{
1259
1.34k
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1260
  /* Internationalized format string. */
1261
1.34k
  const char *yyformat = YY_NULLPTR;
1262
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1263
     one per "expected"). */
1264
1.34k
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1265
  /* Actual size of YYARG. */
1266
1.34k
  int yycount = 0;
1267
  /* Cumulated lengths of YYARG.  */
1268
1.34k
  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.34k
  if (yytoken != YYEMPTY)
1294
1.34k
    {
1295
1.34k
      int yyn = yypact[+*yyssp];
1296
1.34k
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1297
1.34k
      yysize = yysize0;
1298
1.34k
      yyarg[yycount++] = yytname[yytoken];
1299
1.34k
      if (!yypact_value_is_default (yyn))
1300
1.34k
        {
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.34k
          int yyxbegin = yyn < 0 ? -yyn : 0;
1305
          /* Stay within bounds of both yycheck and yytname.  */
1306
1.34k
          int yychecklim = YYLAST - yyn + 1;
1307
1.34k
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1308
1.34k
          int yyx;
1309
1310
73.3k
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1311
72.3k
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1312
0
                && !yytable_value_is_error (yytable[yyx + yyn]))
1313
3.08k
              {
1314
3.08k
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1315
282
                  {
1316
282
                    yycount = 1;
1317
282
                    yysize = yysize0;
1318
282
                    break;
1319
282
                  }
1320
2.79k
                yyarg[yycount++] = yytname[yyx];
1321
2.79k
                {
1322
2.79k
                  YYPTRDIFF_T yysize1
1323
2.79k
                    = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1324
2.79k
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1325
2.79k
                    yysize = yysize1;
1326
0
                  else
1327
0
                    return 2;
1328
2.79k
                }
1329
2.79k
              }
1330
1.34k
        }
1331
1.34k
    }
1332
1333
1.34k
  switch (yycount)
1334
1.34k
    {
1335
0
# define YYCASE_(N, S)                      \
1336
1.34k
      case N:                               \
1337
1.34k
        yyformat = S;                       \
1338
1.34k
      break
1339
0
    default: /* Avoid compiler warnings. */
1340
0
      YYCASE_(0, YY_("syntax error"));
1341
282
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1342
602
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1343
321
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1344
118
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1345
1.34k
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1346
1.34k
# undef YYCASE_
1347
1.34k
    }
1348
1349
1.34k
  {
1350
    /* Don't count the "%s"s in the final size, but reserve room for
1351
       the terminator.  */
1352
1.34k
    YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1353
1.34k
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1354
1.34k
      yysize = yysize1;
1355
0
    else
1356
0
      return 2;
1357
1.34k
  }
1358
1359
1.34k
  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.34k
  {
1372
1.34k
    char *yyp = *yymsg;
1373
1.34k
    int yyi = 0;
1374
53.0k
    while ((*yyp = *yyformat) != '\0')
1375
51.6k
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1376
3.01k
        {
1377
3.01k
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1378
3.01k
          yyformat += 2;
1379
3.01k
        }
1380
48.6k
      else
1381
48.6k
        {
1382
48.6k
          ++yyp;
1383
48.6k
          ++yyformat;
1384
48.6k
        }
1385
1.34k
  }
1386
1.34k
  return 0;
1387
1.34k
}
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.6k
{
1397
18.6k
  YYUSE (yyvaluep);
1398
18.6k
  if (!yymsg)
1399
0
    yymsg = "Deleting";
1400
18.6k
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1401
1402
18.6k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1403
18.6k
  YYUSE (yytype);
1404
18.6k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1405
18.6k
}
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.41k
{
1426
2.41k
    yy_state_fast_t yystate;
1427
    /* Number of tokens to shift before error messages enabled.  */
1428
2.41k
    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.41k
    yy_state_t yyssa[YYINITDEPTH];
1439
2.41k
    yy_state_t *yyss;
1440
2.41k
    yy_state_t *yyssp;
1441
1442
    /* The semantic value stack.  */
1443
2.41k
    YYSTYPE yyvsa[YYINITDEPTH];
1444
2.41k
    YYSTYPE *yyvs;
1445
2.41k
    YYSTYPE *yyvsp;
1446
1447
2.41k
    YYPTRDIFF_T yystacksize;
1448
1449
2.41k
  int yyn;
1450
2.41k
  int yyresult;
1451
  /* Lookahead token as an internal (translated) token number.  */
1452
2.41k
  int yytoken = 0;
1453
  /* The variables used to return semantic value and location from the
1454
     action routines.  */
1455
2.41k
  YYSTYPE yyval;
1456
1457
2.41k
#if YYERROR_VERBOSE
1458
  /* Buffer for error messages, and its allocated size.  */
1459
2.41k
  char yymsgbuf[128];
1460
2.41k
  char *yymsg = yymsgbuf;
1461
2.41k
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1462
2.41k
#endif
1463
1464
202k
#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.41k
  int yylen = 0;
1469
1470
2.41k
  yyssp = yyss = yyssa;
1471
2.41k
  yyvsp = yyvs = yyvsa;
1472
2.41k
  yystacksize = YYINITDEPTH;
1473
1474
2.41k
  YYDPRINTF ((stderr, "Starting parse\n"));
1475
1476
2.41k
  yystate = 0;
1477
2.41k
  yyerrstatus = 0;
1478
2.41k
  yynerrs = 0;
1479
2.41k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1480
2.41k
  goto yysetstate;
1481
1482
1483
/*------------------------------------------------------------.
1484
| yynewstate -- push a new state, which is found in yystate.  |
1485
`------------------------------------------------------------*/
1486
352k
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
352k
  yyssp++;
1490
1491
1492
/*--------------------------------------------------------------------.
1493
| yysetstate -- set current state (the top of the stack) to yystate.  |
1494
`--------------------------------------------------------------------*/
1495
354k
yysetstate:
1496
354k
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1497
354k
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1498
354k
  YY_IGNORE_USELESS_CAST_BEGIN
1499
354k
  *yyssp = YY_CAST (yy_state_t, yystate);
1500
354k
  YY_IGNORE_USELESS_CAST_END
1501
1502
354k
  if (yyss + yystacksize - 1 <= yyssp)
1503
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1504
    goto yyexhaustedlab;
1505
#else
1506
27
    {
1507
      /* Get the current used size of the three stacks, in elements.  */
1508
27
      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
27
      if (YYMAXDEPTH <= yystacksize)
1532
0
        goto yyexhaustedlab;
1533
27
      yystacksize *= 2;
1534
27
      if (YYMAXDEPTH < yystacksize)
1535
0
        yystacksize = YYMAXDEPTH;
1536
1537
27
      {
1538
27
        yy_state_t *yyss1 = yyss;
1539
27
        union yyalloc *yyptr =
1540
27
          YY_CAST (union yyalloc *,
1541
27
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1542
27
        if (! yyptr)
1543
0
          goto yyexhaustedlab;
1544
27
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1545
27
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1546
27
# undef YYSTACK_RELOCATE
1547
27
        if (yyss1 != yyssa)
1548
11
          YYSTACK_FREE (yyss1);
1549
27
      }
1550
0
# endif
1551
1552
0
      yyssp = yyss + yysize - 1;
1553
27
      yyvsp = yyvs + yysize - 1;
1554
1555
27
      YY_IGNORE_USELESS_CAST_BEGIN
1556
27
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1557
27
                  YY_CAST (long, yystacksize)));
1558
27
      YY_IGNORE_USELESS_CAST_END
1559
1560
27
      if (yyss + yystacksize - 1 <= yyssp)
1561
0
        YYABORT;
1562
27
    }
1563
354k
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1564
1565
354k
  if (yystate == YYFINAL)
1566
1.07k
    YYACCEPT;
1567
1568
353k
  goto yybackup;
1569
1570
1571
/*-----------.
1572
| yybackup.  |
1573
`-----------*/
1574
353k
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
353k
  yyn = yypact[yystate];
1580
353k
  if (yypact_value_is_default (yyn))
1581
147k
    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
206k
  if (yychar == YYEMPTY)
1587
171k
    {
1588
171k
      YYDPRINTF ((stderr, "Reading a token: "));
1589
171k
      yychar = yylex ();
1590
171k
    }
1591
1592
206k
  if (yychar <= YYEOF)
1593
2.92k
    {
1594
2.92k
      yychar = yytoken = YYEOF;
1595
2.92k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1596
2.92k
    }
1597
203k
  else
1598
203k
    {
1599
203k
      yytoken = YYTRANSLATE (yychar);
1600
203k
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1601
203k
    }
1602
1603
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1604
     detect an error, take that action.  */
1605
206k
  yyn += yytoken;
1606
206k
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1607
36.1k
    goto yydefault;
1608
170k
  yyn = yytable[yyn];
1609
170k
  if (yyn <= 0)
1610
717
    {
1611
717
      if (yytable_value_is_error (yyn))
1612
0
        goto yyerrlab;
1613
717
      yyn = -yyn;
1614
717
      goto yyreduce;
1615
717
    }
1616
1617
  /* Count tokens shifted since error; after three, turn off error
1618
     status.  */
1619
169k
  if (yyerrstatus)
1620
0
    yyerrstatus--;
1621
1622
  /* Shift the lookahead token.  */
1623
169k
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1624
169k
  yystate = yyn;
1625
169k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1626
169k
  *++yyvsp = yylval;
1627
169k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1628
1629
  /* Discard the shifted token.  */
1630
169k
  yychar = YYEMPTY;
1631
169k
  goto yynewstate;
1632
1633
1634
/*-----------------------------------------------------------.
1635
| yydefault -- do the default action for the current state.  |
1636
`-----------------------------------------------------------*/
1637
183k
yydefault:
1638
183k
  yyn = yydefact[yystate];
1639
183k
  if (yyn == 0)
1640
1.34k
    goto yyerrlab;
1641
181k
  goto yyreduce;
1642
1643
1644
/*-----------------------------.
1645
| yyreduce -- do a reduction.  |
1646
`-----------------------------*/
1647
182k
yyreduce:
1648
  /* yyn is the number of a rule to reduce with.  */
1649
182k
  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
182k
  yyval = yyvsp[1-yylen];
1660
1661
1662
182k
  YY_REDUCE_PRINT (yyn);
1663
182k
  switch (yyn)
1664
182k
    {
1665
1.07k
  case 2:
1666
1.07k
#line 155 "ASN1.y"
1667
1.07k
                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFINITIONS|(yyvsp[-5].constant));
1668
1.07k
                    _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[-7].node)));
1669
1.07k
                    _asn1_set_name((yyvsp[-7].node),"");
1670
1.07k
                    _asn1_set_right((yyvsp[-7].node),(yyvsp[-1].node));
1671
1.07k
                    _asn1_set_down((yyval.node),(yyvsp[-7].node));
1672
1673
1.07k
        p_tree=(yyval.node);
1674
1.07k
        }
1675
1.07k
#line 1676 "ASN1.c"
1676
1.07k
    break;
1677
1678
2.61k
  case 3:
1679
2.61k
#line 165 "ASN1.y"
1680
2.61k
                      {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1681
2.61k
#line 1682 "ASN1.c"
1682
2.61k
    break;
1683
1684
248
  case 4:
1685
248
#line 166 "ASN1.y"
1686
248
                      {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1687
248
#line 1688 "ASN1.c"
1688
248
    break;
1689
1690
865
  case 5:
1691
865
#line 169 "ASN1.y"
1692
865
                      {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));}
1693
865
#line 1694 "ASN1.c"
1694
865
    break;
1695
1696
2.86k
  case 6:
1697
2.86k
#line 172 "ASN1.y"
1698
2.86k
                        {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1699
2.86k
#line 1700 "ASN1.c"
1700
2.86k
    break;
1701
1702
865
  case 7:
1703
865
#line 173 "ASN1.y"
1704
865
                        {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1705
865
#line 1706 "ASN1.c"
1706
865
    break;
1707
1708
2.44k
  case 8:
1709
2.44k
#line 176 "ASN1.y"
1710
2.44k
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1711
2.44k
#line 1712 "ASN1.c"
1712
2.44k
    break;
1713
1714
10.0k
  case 9:
1715
10.0k
#line 177 "ASN1.y"
1716
10.0k
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1717
10.0k
#line 1718 "ASN1.c"
1718
10.0k
    break;
1719
1720
897
  case 10:
1721
897
#line 180 "ASN1.y"
1722
897
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1723
897
#line 1724 "ASN1.c"
1724
897
    break;
1725
1726
332
  case 11:
1727
332
#line 181 "ASN1.y"
1728
332
                                 {SAFE_COPY((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[0].str));}
1729
332
#line 1730 "ASN1.c"
1730
332
    break;
1731
1732
410
  case 12:
1733
410
#line 182 "ASN1.y"
1734
410
                                 {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1735
410
#line 1736 "ASN1.c"
1736
410
    break;
1737
1738
194
  case 13:
1739
194
#line 185 "ASN1.y"
1740
194
                                     {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1741
194
#line 1742 "ASN1.c"
1742
194
    break;
1743
1744
1.10k
  case 14:
1745
1.10k
#line 186 "ASN1.y"
1746
1.10k
                                     {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[0].str));}
1747
1.10k
#line 1748 "ASN1.c"
1748
1.10k
    break;
1749
1750
484
  case 15:
1751
484
#line 189 "ASN1.y"
1752
484
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1753
484
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1754
484
#line 1755 "ASN1.c"
1755
484
    break;
1756
1757
178
  case 16:
1758
178
#line 191 "ASN1.y"
1759
178
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1760
178
                                 _asn1_set_name((yyval.node),(yyvsp[-3].str));
1761
178
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1762
178
#line 1763 "ASN1.c"
1763
178
    break;
1764
1765
244
  case 17:
1766
244
#line 196 "ASN1.y"
1767
244
                                           {(yyval.node)=(yyvsp[0].node);}
1768
244
#line 1769 "ASN1.c"
1769
244
    break;
1770
1771
418
  case 18:
1772
418
#line 197 "ASN1.y"
1773
418
                                           {(yyval.node)=(yyvsp[-2].node);
1774
418
                                            _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
1775
418
#line 1776 "ASN1.c"
1776
418
    break;
1777
1778
9.27k
  case 19:
1779
9.27k
#line 201 "ASN1.y"
1780
9.27k
                                  {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1781
9.27k
                                   _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
1782
9.27k
#line 1783 "ASN1.c"
1783
9.27k
    break;
1784
1785
647
  case 20:
1786
647
#line 203 "ASN1.y"
1787
647
                                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
1788
647
                              _asn1_set_name((yyval.node),(yyvsp[-3].str));
1789
647
                                    _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1790
647
#line 1791 "ASN1.c"
1791
647
    break;
1792
1793
2.42k
  case 21:
1794
2.42k
#line 208 "ASN1.y"
1795
2.42k
                                                   {(yyval.node)=(yyvsp[0].node);}
1796
2.42k
#line 1797 "ASN1.c"
1797
2.42k
    break;
1798
1799
7.50k
  case 22:
1800
7.50k
#line 209 "ASN1.y"
1801
7.50k
                                                   {(yyval.node)=(yyvsp[-1].node);
1802
7.50k
                                                    _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));}
1803
7.50k
#line 1804 "ASN1.c"
1804
7.50k
    break;
1805
1806
194
  case 23:
1807
194
#line 213 "ASN1.y"
1808
194
                      {(yyval.constant)=CONST_UNIVERSAL;}
1809
194
#line 1810 "ASN1.c"
1810
194
    break;
1811
1812
2.24k
  case 24:
1813
2.24k
#line 214 "ASN1.y"
1814
2.24k
                      {(yyval.constant)=CONST_PRIVATE;}
1815
2.24k
#line 1816 "ASN1.c"
1816
2.24k
    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.49k
  case 26:
1825
3.49k
#line 218 "ASN1.y"
1826
3.49k
                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG);
1827
3.49k
                            _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1828
3.49k
#line 1829 "ASN1.c"
1829
3.49k
    break;
1830
1831
634
  case 27:
1832
634
#line 220 "ASN1.y"
1833
634
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TAG | (yyvsp[-2].constant));
1834
634
                                _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1835
634
#line 1836 "ASN1.c"
1836
634
    break;
1837
1838
3.37k
  case 28:
1839
3.37k
#line 224 "ASN1.y"
1840
3.37k
                          {(yyval.node)=(yyvsp[0].node);}
1841
3.37k
#line 1842 "ASN1.c"
1842
3.37k
    break;
1843
1844
388
  case 29:
1845
388
#line 225 "ASN1.y"
1846
388
                          {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_EXPLICIT);}
1847
388
#line 1848 "ASN1.c"
1848
388
    break;
1849
1850
357
  case 30:
1851
357
#line 226 "ASN1.y"
1852
357
                          {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_IMPLICIT);}
1853
357
#line 1854 "ASN1.c"
1854
357
    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
313
  case 32:
1864
313
#line 231 "ASN1.y"
1865
313
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_TRUE);}
1866
313
#line 1867 "ASN1.c"
1867
313
    break;
1868
1869
178
  case 33:
1870
178
#line 232 "ASN1.y"
1871
178
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_DEFAULT|CONST_FALSE);}
1872
178
#line 1873 "ASN1.c"
1873
178
    break;
1874
1875
483
  case 36:
1876
483
#line 241 "ASN1.y"
1877
483
                                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER);}
1878
483
#line 1879 "ASN1.c"
1879
483
    break;
1880
1881
221
  case 37:
1882
221
#line 242 "ASN1.y"
1883
221
                                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_LIST);
1884
221
                                   _asn1_set_down((yyval.node),(yyvsp[-1].node));}
1885
221
#line 1886 "ASN1.c"
1886
221
    break;
1887
1888
633
  case 38:
1889
633
#line 244 "ASN1.y"
1890
633
                                             {(yyval.node)=(yyvsp[-3].node);}
1891
633
#line 1892 "ASN1.c"
1892
633
    break;
1893
1894
794
  case 39:
1895
794
#line 246 "ASN1.y"
1896
794
                                        {(yyval.node)=(yyvsp[-6].node);}
1897
794
#line 1898 "ASN1.c"
1898
794
    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
202
  case 42:
1913
202
#line 253 "ASN1.y"
1914
202
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALIZED_TIME);}
1915
202
#line 1916 "ASN1.c"
1916
202
    break;
1917
1918
2.81k
  case 43:
1919
2.81k
#line 256 "ASN1.y"
1920
2.81k
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_1_PARAM);
1921
2.81k
                                _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
1922
2.81k
#line 1923 "ASN1.c"
1923
2.81k
    break;
1924
1925
196
  case 44:
1926
196
#line 259 "ASN1.y"
1927
196
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SIZE|CONST_MIN_MAX);
1928
196
                                _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1);
1929
196
                                      _asn1_set_name((yyval.node),(yyvsp[-1].str));}
1930
196
#line 1931 "ASN1.c"
1931
196
    break;
1932
1933
2.81k
  case 45:
1934
2.81k
#line 264 "ASN1.y"
1935
2.81k
                               {(yyval.node)=(yyvsp[0].node);}
1936
2.81k
#line 1937 "ASN1.c"
1937
2.81k
    break;
1938
1939
196
  case 46:
1940
196
#line 265 "ASN1.y"
1941
196
                               {(yyval.node)=(yyvsp[-1].node);}
1942
196
#line 1943 "ASN1.c"
1943
196
    break;
1944
1945
207
  case 47:
1946
207
#line 268 "ASN1.y"
1947
207
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING);}
1948
207
#line 1949 "ASN1.c"
1949
207
    break;
1950
1951
212
  case 48:
1952
212
#line 269 "ASN1.y"
1953
212
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_GENERALSTRING|CONST_SIZE);
1954
212
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1955
212
#line 1956 "ASN1.c"
1956
212
    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
195
  case 51:
1972
195
#line 278 "ASN1.y"
1973
195
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING);}
1974
195
#line 1975 "ASN1.c"
1975
195
    break;
1976
1977
194
  case 52:
1978
194
#line 279 "ASN1.y"
1979
194
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IA5_STRING|CONST_SIZE);
1980
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1981
194
#line 1982 "ASN1.c"
1982
194
    break;
1983
1984
198
  case 53:
1985
198
#line 283 "ASN1.y"
1986
198
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING);}
1987
198
#line 1988 "ASN1.c"
1988
198
    break;
1989
1990
196
  case 54:
1991
196
#line 284 "ASN1.y"
1992
196
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_TELETEX_STRING|CONST_SIZE);
1993
196
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
1994
196
#line 1995 "ASN1.c"
1995
196
    break;
1996
1997
178
  case 55:
1998
178
#line 288 "ASN1.y"
1999
178
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING);}
2000
178
#line 2001 "ASN1.c"
2001
178
    break;
2002
2003
194
  case 56:
2004
194
#line 289 "ASN1.y"
2005
194
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE);
2006
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2007
194
#line 2008 "ASN1.c"
2008
194
    break;
2009
2010
194
  case 57:
2011
194
#line 293 "ASN1.y"
2012
194
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING);}
2013
194
#line 2014 "ASN1.c"
2014
194
    break;
2015
2016
71
  case 58:
2017
71
#line 294 "ASN1.y"
2018
71
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE);
2019
71
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2020
71
#line 2021 "ASN1.c"
2021
71
    break;
2022
2023
195
  case 59:
2024
195
#line 298 "ASN1.y"
2025
195
                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING);}
2026
195
#line 2027 "ASN1.c"
2027
195
    break;
2028
2029
194
  case 60:
2030
194
#line 299 "ASN1.y"
2031
194
                                     {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BMP_STRING|CONST_SIZE);
2032
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2033
194
#line 2034 "ASN1.c"
2034
194
    break;
2035
2036
194
  case 61:
2037
194
#line 303 "ASN1.y"
2038
194
                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING);}
2039
194
#line 2040 "ASN1.c"
2040
194
    break;
2041
2042
194
  case 62:
2043
194
#line 304 "ASN1.y"
2044
194
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_UTF8_STRING|CONST_SIZE);
2045
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2046
194
#line 2047 "ASN1.c"
2047
194
    break;
2048
2049
70
  case 63:
2050
70
#line 308 "ASN1.y"
2051
70
                                 {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING);}
2052
70
#line 2053 "ASN1.c"
2053
70
    break;
2054
2055
194
  case 64:
2056
194
#line 309 "ASN1.y"
2057
194
                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE);
2058
194
            _asn1_set_down((yyval.node),(yyvsp[0].node));}
2059
194
#line 2060 "ASN1.c"
2060
194
    break;
2061
2062
304
  case 65:
2063
304
#line 313 "ASN1.y"
2064
304
                                          {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OCTET_STRING);}
2065
304
#line 2066 "ASN1.c"
2066
304
    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
664
  case 67:
2076
664
#line 318 "ASN1.y"
2077
664
                                   {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT);
2078
664
                             _asn1_set_name((yyval.node),(yyvsp[-3].str));
2079
664
                                    _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);}
2080
664
#line 2081 "ASN1.c"
2081
664
    break;
2082
2083
417
  case 68:
2084
417
#line 323 "ASN1.y"
2085
417
                                  {(yyval.node)=(yyvsp[0].node);}
2086
417
#line 2087 "ASN1.c"
2087
417
    break;
2088
2089
247
  case 69:
2090
247
#line 324 "ASN1.y"
2091
247
                                                      {(yyval.node)=(yyvsp[-2].node);
2092
247
                                                       _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
2093
247
#line 2094 "ASN1.c"
2094
247
    break;
2095
2096
198
  case 70:
2097
198
#line 328 "ASN1.y"
2098
198
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING);}
2099
198
#line 2100 "ASN1.c"
2100
198
    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
204
  case 72:
2110
204
#line 332 "ASN1.y"
2111
204
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_BIT_STRING|CONST_LIST);
2112
204
                                _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2113
204
#line 2114 "ASN1.c"
2114
204
    break;
2115
2116
197
  case 73:
2117
197
#line 337 "ASN1.y"
2118
197
                               {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ENUMERATED|CONST_LIST);
2119
197
                                _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2120
197
#line 2121 "ASN1.c"
2121
197
    break;
2122
2123
1.27k
  case 74:
2124
1.27k
#line 342 "ASN1.y"
2125
1.27k
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);}
2126
1.27k
#line 2127 "ASN1.c"
2127
1.27k
    break;
2128
2129
5.61k
  case 75:
2130
5.61k
#line 345 "ASN1.y"
2131
5.61k
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER);
2132
5.61k
                                       _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
2133
5.61k
#line 2134 "ASN1.c"
2134
5.61k
    break;
2135
2136
574
  case 76:
2137
574
#line 347 "ASN1.y"
2138
574
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_IDENTIFIER|CONST_SIZE);
2139
574
                                       _asn1_set_value((yyval.node),(yyvsp[-1].str),strlen((yyvsp[-1].str))+1);
2140
574
                                       _asn1_set_down((yyval.node),(yyvsp[0].node));}
2141
574
#line 2142 "ASN1.c"
2142
574
    break;
2143
2144
628
  case 77:
2145
628
#line 350 "ASN1.y"
2146
628
                                      {(yyval.node)=(yyvsp[0].node);}
2147
628
#line 2148 "ASN1.c"
2148
628
    break;
2149
2150
197
  case 78:
2151
197
#line 351 "ASN1.y"
2152
197
                                      {(yyval.node)=(yyvsp[0].node);}
2153
197
#line 2154 "ASN1.c"
2154
197
    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
498
  case 81:
2163
498
#line 354 "ASN1.y"
2164
498
                                      {(yyval.node)=(yyvsp[0].node);}
2165
498
#line 2166 "ASN1.c"
2166
498
    break;
2167
2168
596
  case 82:
2169
596
#line 355 "ASN1.y"
2170
596
                                      {(yyval.node)=(yyvsp[0].node);}
2171
596
#line 2172 "ASN1.c"
2172
596
    break;
2173
2174
419
  case 83:
2175
419
#line 356 "ASN1.y"
2176
419
                                      {(yyval.node)=(yyvsp[0].node);}
2177
419
#line 2178 "ASN1.c"
2178
419
    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
389
  case 85:
2187
389
#line 358 "ASN1.y"
2188
389
                                      {(yyval.node)=(yyvsp[0].node);}
2189
389
#line 2190 "ASN1.c"
2190
389
    break;
2191
2192
394
  case 86:
2193
394
#line 359 "ASN1.y"
2194
394
                                      {(yyval.node)=(yyvsp[0].node);}
2195
394
#line 2196 "ASN1.c"
2196
394
    break;
2197
2198
372
  case 87:
2199
372
#line 360 "ASN1.y"
2200
372
                                      {(yyval.node)=(yyvsp[0].node);}
2201
372
#line 2202 "ASN1.c"
2202
372
    break;
2203
2204
265
  case 88:
2205
265
#line 361 "ASN1.y"
2206
265
                                      {(yyval.node)=(yyvsp[0].node);}
2207
265
#line 2208 "ASN1.c"
2208
265
    break;
2209
2210
389
  case 89:
2211
389
#line 362 "ASN1.y"
2212
389
                                      {(yyval.node)=(yyvsp[0].node);}
2213
389
#line 2214 "ASN1.c"
2214
389
    break;
2215
2216
388
  case 90:
2217
388
#line 363 "ASN1.y"
2218
388
                                      {(yyval.node)=(yyvsp[0].node);}
2219
388
#line 2220 "ASN1.c"
2220
388
    break;
2221
2222
264
  case 91:
2223
264
#line 364 "ASN1.y"
2224
264
                                      {(yyval.node)=(yyvsp[0].node);}
2225
264
#line 2226 "ASN1.c"
2226
264
    break;
2227
2228
590
  case 92:
2229
590
#line 365 "ASN1.y"
2230
590
                                      {(yyval.node)=(yyvsp[0].node);}
2231
590
#line 2232 "ASN1.c"
2232
590
    break;
2233
2234
1.27k
  case 93:
2235
1.27k
#line 366 "ASN1.y"
2236
1.27k
                                      {(yyval.node)=(yyvsp[0].node);}
2237
1.27k
#line 2238 "ASN1.c"
2238
1.27k
    break;
2239
2240
194
  case 94:
2241
194
#line 367 "ASN1.y"
2242
194
                                      {(yyval.node)=(yyvsp[0].node);}
2243
194
#line 2244 "ASN1.c"
2244
194
    break;
2245
2246
821
  case 95:
2247
821
#line 368 "ASN1.y"
2248
821
                                      {(yyval.node)=(yyvsp[0].node);}
2249
821
#line 2250 "ASN1.c"
2250
821
    break;
2251
2252
1.79k
  case 96:
2253
1.79k
#line 369 "ASN1.y"
2254
1.79k
                                      {(yyval.node)=(yyvsp[0].node);}
2255
1.79k
#line 2256 "ASN1.c"
2256
1.79k
    break;
2257
2258
198
  case 97:
2259
198
#line 370 "ASN1.y"
2260
198
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_NULL);}
2261
198
#line 2262 "ASN1.c"
2262
198
    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.51k
  case 99:
2271
2.51k
#line 374 "ASN1.y"
2272
2.51k
                                              {(yyval.node)=_asn1_mod_type((yyvsp[0].node),CONST_TAG);
2273
2.51k
                                               _asn1_set_right((yyvsp[-1].node),_asn1_get_down((yyval.node)));
2274
2.51k
                                               _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2275
2.51k
#line 2276 "ASN1.c"
2276
2.51k
    break;
2277
2278
12.2k
  case 100:
2279
12.2k
#line 379 "ASN1.y"
2280
12.2k
                                                      {(yyval.node)=(yyvsp[0].node);}
2281
12.2k
#line 2282 "ASN1.c"
2282
12.2k
    break;
2283
2284
1.78k
  case 101:
2285
1.78k
#line 380 "ASN1.y"
2286
1.78k
                                                      {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_DEFAULT);
2287
1.78k
                                                       _asn1_set_right((yyvsp[0].node),_asn1_get_down((yyval.node)));
2288
1.78k
                   _asn1_set_down((yyval.node),(yyvsp[0].node));}
2289
1.78k
#line 2290 "ASN1.c"
2290
1.78k
    break;
2291
2292
194
  case 102:
2293
194
#line 383 "ASN1.y"
2294
194
                                                      {(yyval.node)=_asn1_mod_type((yyvsp[-1].node),CONST_OPTION);}
2295
194
#line 2296 "ASN1.c"
2296
194
    break;
2297
2298
14.1k
  case 103:
2299
14.1k
#line 386 "ASN1.y"
2300
14.1k
                                                      {(yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-1].str));}
2301
14.1k
#line 2302 "ASN1.c"
2302
14.1k
    break;
2303
2304
1.92k
  case 104:
2305
1.92k
#line 389 "ASN1.y"
2306
1.92k
                                               {(yyval.node)=(yyvsp[0].node);}
2307
1.92k
#line 2308 "ASN1.c"
2308
1.92k
    break;
2309
2310
12.2k
  case 105:
2311
12.2k
#line 390 "ASN1.y"
2312
12.2k
                                               {(yyval.node)=(yyvsp[-2].node);
2313
12.2k
                                                _asn1_set_right(_asn1_get_last_right((yyvsp[-2].node)),(yyvsp[0].node));}
2314
12.2k
#line 2315 "ASN1.c"
2315
12.2k
    break;
2316
2317
197
  case 106:
2318
197
#line 394 "ASN1.y"
2319
197
                                             {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE);
2320
197
                                              _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2321
197
#line 2322 "ASN1.c"
2322
197
    break;
2323
2324
199
  case 107:
2325
199
#line 396 "ASN1.y"
2326
199
                                             {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF);
2327
199
                                              _asn1_set_down((yyval.node),(yyvsp[0].node));}
2328
199
#line 2329 "ASN1.c"
2329
199
    break;
2330
2331
194
  case 108:
2332
194
#line 398 "ASN1.y"
2333
194
                                           {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE);
2334
194
                                            _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node));
2335
194
                                            _asn1_set_down((yyval.node),(yyvsp[-2].node));}
2336
194
#line 2337 "ASN1.c"
2337
194
    break;
2338
2339
1.21k
  case 109:
2340
1.21k
#line 403 "ASN1.y"
2341
1.21k
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET);
2342
1.21k
                                     _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2343
1.21k
#line 2344 "ASN1.c"
2344
1.21k
    break;
2345
2346
374
  case 110:
2347
374
#line 405 "ASN1.y"
2348
374
                                    {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF);
2349
374
                                     _asn1_set_down((yyval.node),(yyvsp[0].node));}
2350
374
#line 2351 "ASN1.c"
2351
374
    break;
2352
2353
206
  case 111:
2354
206
#line 407 "ASN1.y"
2355
206
                                      {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_SET_OF|CONST_SIZE);
2356
206
                                       _asn1_set_right((yyvsp[-2].node),(yyvsp[0].node));
2357
206
                                       _asn1_set_down((yyval.node),(yyvsp[-2].node));}
2358
206
#line 2359 "ASN1.c"
2359
206
    break;
2360
2361
194
  case 112:
2362
194
#line 412 "ASN1.y"
2363
194
                                            {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_CHOICE);
2364
194
                                             _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2365
194
#line 2366 "ASN1.c"
2366
194
    break;
2367
2368
627
  case 113:
2369
627
#line 416 "ASN1.y"
2370
627
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY);}
2371
627
#line 2372 "ASN1.c"
2372
627
    break;
2373
2374
194
  case 114:
2375
194
#line 417 "ASN1.y"
2376
194
                                       {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_ANY|CONST_DEFINED_BY);
2377
194
                                        _asn1_set_down((yyval.node),_asn1_add_static_node(&e_list, ASN1_ETYPE_CONSTANT));
2378
194
                                  _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[0].str));}
2379
194
#line 2380 "ASN1.c"
2380
194
    break;
2381
2382
253
  case 115:
2383
253
#line 422 "ASN1.y"
2384
253
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2385
253
#line 2386 "ASN1.c"
2386
253
    break;
2387
2388
213
  case 116:
2389
213
#line 423 "ASN1.y"
2390
213
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2391
213
#line 2392 "ASN1.c"
2392
213
    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
307
  case 118:
2401
307
#line 425 "ASN1.y"
2402
307
                           { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2403
307
#line 2404 "ASN1.c"
2404
307
    break;
2405
2406
204
  case 119:
2407
204
#line 426 "ASN1.y"
2408
204
                     { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2409
204
#line 2410 "ASN1.c"
2410
204
    break;
2411
2412
194
  case 120:
2413
194
#line 427 "ASN1.y"
2414
194
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2415
194
#line 2416 "ASN1.c"
2416
194
    break;
2417
2418
194
  case 121:
2419
194
#line 428 "ASN1.y"
2420
194
                         { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2421
194
#line 2422 "ASN1.c"
2422
194
    break;
2423
2424
478
  case 122:
2425
478
#line 429 "ASN1.y"
2426
478
                     { SAFE_COPY((yyval.str),sizeof((yyval.str)),"%s",last_token); }
2427
478
#line 2428 "ASN1.c"
2428
478
    break;
2429
2430
1.97k
  case 123:
2431
1.97k
#line 432 "ASN1.y"
2432
1.97k
                                                                          {
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.97k
}
2437
1.97k
#line 2438 "ASN1.c"
2438
1.97k
    break;
2439
2440
1.68k
  case 124:
2441
1.68k
#line 439 "ASN1.y"
2442
1.68k
                                                  { (yyval.node)=_asn1_set_name((yyvsp[0].node),(yyvsp[-2].str));}
2443
1.68k
#line 2444 "ASN1.c"
2444
1.68k
    break;
2445
2446
199
  case 125:
2447
199
#line 443 "ASN1.y"
2448
199
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN);
2449
199
                         _asn1_set_name((yyval.node),(yyvsp[-6].str));
2450
199
                         _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2451
199
#line 2452 "ASN1.c"
2452
199
    break;
2453
2454
2.03k
  case 126:
2455
2.03k
#line 447 "ASN1.y"
2456
2.03k
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
2457
2.03k
                         _asn1_set_name((yyval.node),(yyvsp[-5].str));
2458
2.03k
                         _asn1_set_value((yyval.node),(yyvsp[-4].str),strlen((yyvsp[-4].str))+1);
2459
2.03k
                         _asn1_set_down((yyval.node),(yyvsp[-1].node));}
2460
2.03k
#line 2461 "ASN1.c"
2461
2.03k
    break;
2462
2463
1.84k
  case 127:
2464
1.84k
#line 452 "ASN1.y"
2465
1.84k
                        {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_INTEGER|CONST_ASSIGN);
2466
1.84k
                         _asn1_set_name((yyval.node),(yyvsp[-3].str));
2467
1.84k
                         _asn1_set_value((yyval.node),(yyvsp[0].str),strlen((yyvsp[0].str))+1);}
2468
1.84k
#line 2469 "ASN1.c"
2469
1.84k
    break;
2470
2471
1.68k
  case 128:
2472
1.68k
#line 457 "ASN1.y"
2473
1.68k
                              {(yyval.node)=(yyvsp[0].node);}
2474
1.68k
#line 2475 "ASN1.c"
2475
1.68k
    break;
2476
2477
1.97k
  case 129:
2478
1.97k
#line 458 "ASN1.y"
2479
1.97k
                              {(yyval.node)=NULL;}
2480
1.97k
#line 2481 "ASN1.c"
2481
1.97k
    break;
2482
2483
4.07k
  case 130:
2484
4.07k
#line 459 "ASN1.y"
2485
4.07k
                              {(yyval.node)=(yyvsp[0].node);}
2486
4.07k
#line 2487 "ASN1.c"
2487
4.07k
    break;
2488
2489
1.37k
  case 131:
2490
1.37k
#line 462 "ASN1.y"
2491
1.37k
                                        {(yyval.node)=(yyvsp[0].node);}
2492
1.37k
#line 2493 "ASN1.c"
2493
1.37k
    break;
2494
2495
6.35k
  case 132:
2496
6.35k
#line 463 "ASN1.y"
2497
6.35k
                                                         {if (!(yyvsp[-1].node))
2498
646
                                                            {
2499
646
                                                              (yyval.node) = (yyvsp[0].node);
2500
646
                                                            }
2501
5.70k
                                                          else
2502
5.70k
                                                            {
2503
5.70k
                                                              (yyval.node)=(yyvsp[-1].node);
2504
5.70k
                                                              if ((yyvsp[0].node)) _asn1_set_right(_asn1_get_last_right((yyvsp[-1].node)),(yyvsp[0].node));
2505
5.70k
                                                            }}
2506
6.35k
#line 2507 "ASN1.c"
2507
6.35k
    break;
2508
2509
78
  case 133:
2510
78
#line 474 "ASN1.y"
2511
78
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2512
78
                                                          _asn1_set_down((yyval.node),(yyvsp[-1].node));
2513
78
                                                          _asn1_set_name((yyval.node),(yyvsp[-3].str));}
2514
78
#line 2515 "ASN1.c"
2515
78
    break;
2516
2517
14
  case 134:
2518
14
#line 477 "ASN1.y"
2519
14
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2520
14
                                                          _asn1_set_name((yyval.node),(yyvsp[-2].str));}
2521
14
#line 2522 "ASN1.c"
2522
14
    break;
2523
2524
2.08k
  case 135:
2525
2.08k
#line 479 "ASN1.y"
2526
2.08k
                                                         {(yyval.node)=_asn1_add_static_node(&e_list, ASN1_ETYPE_OBJECT_ID);
2527
2.08k
                                                          _asn1_set_name((yyval.node),(yyvsp[0].str));}
2528
2.08k
#line 2529 "ASN1.c"
2529
2.08k
    break;
2530
2531
395
  case 136:
2532
395
#line 503 "ASN1.y"
2533
395
                               {(yyval.constant)=CONST_EXPLICIT;}
2534
395
#line 2535 "ASN1.c"
2535
395
    break;
2536
2537
1.49k
  case 137:
2538
1.49k
#line 504 "ASN1.y"
2539
1.49k
                               {(yyval.constant)=CONST_IMPLICIT;}
2540
1.49k
#line 2541 "ASN1.c"
2541
1.49k
    break;
2542
2543
2544
0
#line 2545 "ASN1.c"
2545
2546
1.42k
      default: break;
2547
182k
    }
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
182k
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2560
2561
182k
  YYPOPSTACK (yylen);
2562
182k
  yylen = 0;
2563
182k
  YY_STACK_PRINT (yyss, yyssp);
2564
2565
182k
  *++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
182k
  {
2571
182k
    const int yylhs = yyr1[yyn] - YYNTOKENS;
2572
182k
    const int yyi = yypgoto[yylhs] + *yyssp;
2573
182k
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2574
182k
               ? yytable[yyi]
2575
182k
               : yydefgoto[yylhs]);
2576
182k
  }
2577
2578
182k
  goto yynewstate;
2579
2580
2581
/*--------------------------------------.
2582
| yyerrlab -- here on detecting error.  |
2583
`--------------------------------------*/
2584
1.34k
yyerrlab:
2585
  /* Make sure we have latest lookahead translation.  See comments at
2586
     user semantic actions for why this is necessary.  */
2587
1.34k
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2588
2589
  /* If not already recovering from an error, report this error.  */
2590
1.34k
  if (!yyerrstatus)
2591
1.34k
    {
2592
1.34k
      ++yynerrs;
2593
#if ! YYERROR_VERBOSE
2594
      yyerror (YY_("syntax error"));
2595
#else
2596
1.34k
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2597
1.34k
                                        yyssp, yytoken)
2598
1.34k
      {
2599
1.34k
        char const *yymsgp = YY_("syntax error");
2600
1.34k
        int yysyntax_error_status;
2601
1.34k
        yysyntax_error_status = YYSYNTAX_ERROR;
2602
1.34k
        if (yysyntax_error_status == 0)
2603
1.34k
          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.34k
        yyerror (yymsgp);
2622
1.34k
        if (yysyntax_error_status == 2)
2623
0
          goto yyexhaustedlab;
2624
1.34k
      }
2625
1.34k
# undef YYSYNTAX_ERROR
2626
1.34k
#endif
2627
1.34k
    }
2628
2629
2630
2631
1.34k
  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.34k
  goto yyerrlab1;
2653
2654
2655
/*---------------------------------------------------.
2656
| yyerrorlab -- error raised explicitly by YYERROR.  |
2657
`---------------------------------------------------*/
2658
1.34k
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.34k
yyerrlab1:
2677
1.34k
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2678
2679
1.34k
  for (;;)
2680
16.5k
    {
2681
16.5k
      yyn = yypact[yystate];
2682
16.5k
      if (!yypact_value_is_default (yyn))
2683
16.5k
        {
2684
16.5k
          yyn += YYTERROR;
2685
16.5k
          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.5k
        }
2692
2693
      /* Pop the current state because it cannot handle the error token.  */
2694
16.5k
      if (yyssp == yyss)
2695
1.34k
        YYABORT;
2696
2697
2698
15.1k
      yydestruct ("Error: popping",
2699
15.1k
                  yystos[yystate], yyvsp);
2700
15.1k
      YYPOPSTACK (1);
2701
15.1k
      yystate = *yyssp;
2702
15.1k
      YY_STACK_PRINT (yyss, yyssp);
2703
15.1k
    }
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
1.07k
yyacceptlab:
2721
1.07k
  yyresult = 0;
2722
1.07k
  goto yyreturn;
2723
2724
2725
/*-----------------------------------.
2726
| yyabortlab -- YYABORT comes here.  |
2727
`-----------------------------------*/
2728
1.34k
yyabortlab:
2729
1.34k
  yyresult = 1;
2730
1.34k
  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.41k
yyreturn:
2748
2.41k
  if (yychar != YYEMPTY)
2749
1.34k
    {
2750
      /* Make sure we have latest lookahead translation.  See comments at
2751
         user semantic actions for why this is necessary.  */
2752
1.34k
      yytoken = YYTRANSLATE (yychar);
2753
1.34k
      yydestruct ("Cleanup: discarding lookahead",
2754
1.34k
                  yytoken, &yylval);
2755
1.34k
    }
2756
  /* Do not reclaim the symbols of the rule whose action triggered
2757
     this YYABORT or YYACCEPT.  */
2758
2.41k
  YYPOPSTACK (yylen);
2759
2.41k
  YY_STACK_PRINT (yyss, yyssp);
2760
4.56k
  while (yyssp != yyss)
2761
2.14k
    {
2762
2.14k
      yydestruct ("Cleanup: popping",
2763
2.14k
                  yystos[+*yyssp], yyvsp);
2764
2.14k
      YYPOPSTACK (1);
2765
2.14k
    }
2766
2.41k
#ifndef yyoverflow
2767
2.41k
  if (yyss != yyssa)
2768
16
    YYSTACK_FREE (yyss);
2769
2.41k
#endif
2770
2.41k
#if YYERROR_VERBOSE
2771
2.41k
  if (yymsg != yymsgbuf)
2772
0
    YYSTACK_FREE (yymsg);
2773
2.41k
#endif
2774
2.41k
  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
171k
{
2811
171k
  int c, counter = 0, k, lastc;
2812
171k
  char string[ASN1_MAX_NAME_SIZE + 1];  /* will contain the next token */
2813
171k
  size_t i;
2814
2815
171k
  while (1)
2816
171k
    {
2817
243k
      while ((c = fgetc (file_asn1)) == ' ' || c == '\t' || c == '\n')
2818
72.0k
        if (c == '\n')
2819
20.0k
          line_number++;
2820
2821
171k
      if (c == EOF)
2822
2.16k
        {
2823
2.16k
          snprintf (last_token, sizeof(last_token), "End Of File");
2824
2.16k
          return 0;
2825
2.16k
        }
2826
2827
169k
      if (c == '(' || c == ')' || c == '[' || c == ']' ||
2828
143k
          c == '{' || c == '}' || c == ',' || c == '.' ||
2829
117k
          c == '+' || c == '|')
2830
52.4k
        {
2831
52.4k
          last_token[0] = c;
2832
52.4k
          last_token[1] = 0;
2833
52.4k
          return c;
2834
52.4k
        }
2835
117k
      if (c == '-')
2836
1.83k
        {                       /* Maybe the first '-' of a comment */
2837
1.83k
          if ((c = fgetc (file_asn1)) != '-')
2838
1.22k
            {
2839
1.22k
              ungetc (c, file_asn1);
2840
1.22k
              last_token[0] = '-';
2841
1.22k
              last_token[1] = 0;
2842
1.22k
              return '-';
2843
1.22k
            }
2844
608
          else
2845
608
            {                   /* Comments */
2846
608
              lastc = 0;
2847
608
              counter = 0;
2848
              /* A comment finishes at the next double hyphen or the end of line */
2849
2.64k
              while ((c = fgetc (file_asn1)) != EOF && c != '\n' &&
2850
2.35k
                     (lastc != '-' || (lastc == '-' && c != '-')))
2851
2.04k
                lastc = c;
2852
608
              if (c == EOF)
2853
44
                {
2854
44
                  snprintf (last_token, sizeof(last_token), "End Of File");
2855
44
                  return 0;
2856
44
                }
2857
564
              else
2858
564
                {
2859
564
                  if (c == '\n')
2860
249
                    line_number++;
2861
564
                  continue;     /* next char, please! (repeat the search) */
2862
564
                }
2863
608
            }
2864
1.83k
        }
2865
115k
      string[counter++] = (char) c;
2866
      /* Till the end of the token */
2867
427k
      while (!
2868
427k
             ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t'
2869
375k
              || c == '\n' || c == '(' || c == ')' || c == '[' || c == ']'
2870
331k
              || c == '{' || c == '}' || c == ',' || c == '.'))
2871
312k
        {
2872
312k
          if (counter >= ASN1_MAX_NAME_SIZE)
2873
2
            {
2874
2
              result_parse = ASN1_NAME_TOO_LONG;
2875
2
              return 0;
2876
2
            }
2877
312k
          string[counter++] = (char) c;
2878
312k
        }
2879
115k
      ungetc (c, file_asn1);
2880
115k
      string[counter] = 0;
2881
115k
      snprintf (last_token, sizeof(last_token), "%s", string);
2882
2883
      /* Is STRING a number? */
2884
136k
      for (k = 0; k < counter; k++)
2885
122k
        if (!c_isdigit ((int)string[k]))
2886
100k
          break;
2887
115k
      if (k >= counter)
2888
14.8k
        {
2889
14.8k
          snprintf (yylval.str, sizeof(yylval.str), "%s", string);
2890
14.8k
          return NUM;           /* return the number */
2891
14.8k
        }
2892
2893
      /* Is STRING a keyword? */
2894
2.97M
      for (i = 0; i < (sizeof (key_word) / sizeof (char *)); i++)
2895
2.92M
        if (!strcmp (string, key_word[i]))
2896
54.4k
          return key_word_token[i];
2897
2898
      /* STRING is an IDENTIFIER */
2899
45.9k
      snprintf (yylval.str, sizeof(yylval.str), "%s", string);
2900
45.9k
      return IDENTIFIER;
2901
100k
    }
2902
171k
}
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.99k
{
2916
1.99k
  if (error_desc == NULL)
2917
0
    return;
2918
2919
2920
1.99k
  switch (error)
2921
1.99k
    {
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.33k
    case ASN1_SYNTAX_ERROR:
2926
1.33k
      snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s", last_error);
2927
1.33k
      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
494
    case ASN1_IDENTIFIER_NOT_FOUND:
2934
494
      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
2935
494
                "%s:: identifier '%s' not found", file_name,
2936
494
                _asn1_identifierMissing);
2937
494
      break;
2938
156
    default:
2939
156
      error_desc[0] = 0;
2940
156
      break;
2941
1.99k
    }
2942
2943
1.99k
}
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.41k
{
2970
2.41k
  if (*definitions != NULL)
2971
0
    {
2972
0
      result_parse = ASN1_ELEMENT_NOT_EMPTY;
2973
0
      goto error;
2974
0
    }
2975
2976
2.41k
  file_name = file;
2977
2978
  /* open the file to parse */
2979
2.41k
  file_asn1 = fopen (file, "r");
2980
2981
2.41k
  if (file_asn1 == NULL)
2982
0
    {
2983
0
      result_parse = ASN1_FILE_NOT_FOUND;
2984
0
      goto error;
2985
0
    }
2986
2987
2.41k
  result_parse = ASN1_SUCCESS;
2988
2989
2.41k
  line_number = 1;
2990
2.41k
  yyparse ();
2991
2992
2.41k
  fclose (file_asn1);
2993
2994
2.41k
  if (result_parse != ASN1_SUCCESS)
2995
1.34k
    goto error;
2996
2997
  /* set IMPLICIT or EXPLICIT property */
2998
1.07k
  _asn1_set_default_tag (p_tree);
2999
  /* set CONST_SET and CONST_NOT_USED */
3000
1.07k
  _asn1_type_set_config (p_tree);
3001
  /* check the identifier definitions */
3002
1.07k
  result_parse = _asn1_check_identifier (p_tree);
3003
1.07k
  if (result_parse != ASN1_SUCCESS)
3004
494
    goto error;
3005
3006
  /* Convert into DER coding the value assign to INTEGER constants */
3007
579
  _asn1_change_integer_value (p_tree);
3008
  /* Expand the IDs of OBJECT IDENTIFIER constants */
3009
579
  result_parse = _asn1_expand_object_id (&e_list, p_tree);
3010
579
  if (result_parse != ASN1_SUCCESS)
3011
156
    goto error;
3012
3013
  /* success */
3014
423
  *definitions = p_tree;
3015
423
  _asn1_delete_list (e_list);
3016
423
  e_list = NULL;
3017
423
  p_tree = NULL;
3018
423
  *error_desc = 0;
3019
423
  return result_parse;
3020
3021
1.99k
error:
3022
1.99k
  _asn1_delete_list_and_nodes (e_list);
3023
1.99k
  e_list = NULL;
3024
1.99k
  p_tree = NULL;
3025
3026
1.99k
  _asn1_create_errorDescription (result_parse, error_desc);
3027
3028
1.99k
  return result_parse;
3029
579
}
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.34k
{
3181
  /* Sends the error description to the std_out */
3182
1.34k
  last_error_token[0] = 0;
3183
3184
1.34k
  if (result_parse != ASN1_NAME_TOO_LONG)
3185
1.33k
    {
3186
1.33k
      snprintf (last_error, sizeof(last_error),
3187
1.33k
                "%s:%u: Error: %s near '%s'", file_name,
3188
1.33k
                line_number, s, last_token);
3189
1.33k
      result_parse = ASN1_SYNTAX_ERROR;
3190
1.33k
    }
3191
3192
1.34k
  return;
3193
1.34k
}