libksba  1.6.0
About: KSBA is a library to make the tasks of working with X.509 certificates, CMS data and related objects more easy.
  Fossies Dox: libksba-1.6.0.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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