1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
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 2, or (at your option)
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.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse asn1p_parse
63 #define yylex asn1p_lex
64 #define yyerror asn1p_error
65 #define yylval asn1p_lval
66 #define yychar asn1p_char
67 #define yydebug asn1p_debug
68 #define yynerrs asn1p_nerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
78 TOK_VBracketLeft = 259,
79 TOK_VBracketRight = 260,
87 TOK_number_negative = 268,
91 TOK_typereference = 272,
92 TOK_capitalreference = 273,
93 TOK_typefieldreference = 274,
94 TOK_valuefieldreference = 275,
96 TOK_ExtValue_BIT_STRING = 277,
98 TOK_ABSTRACT_SYNTAX = 279,
101 TOK_APPLICATION = 282,
112 TOK_COMPONENTS = 293,
113 TOK_CONSTRAINED = 294,
114 TOK_CONTAINING = 295,
116 TOK_DEFINITIONS = 297,
120 TOK_ENCODING_CONTROL = 301,
122 TOK_ENUMERATED = 303,
125 TOK_EXTENSIBILITY = 306,
129 TOK_GeneralizedTime = 310,
130 TOK_GeneralString = 311,
131 TOK_GraphicString = 312,
133 TOK_IDENTIFIER = 314,
139 TOK_INSTRUCTIONS = 320,
141 TOK_ISO646String = 322,
144 TOK_MINUS_INFINITY = 325,
146 TOK_NumericString = 327,
148 TOK_ObjectDescriptor = 329,
154 TOK_PLUS_INFINITY = 335,
156 TOK_PrintableString = 337,
159 TOK_RELATIVE_OID = 340,
167 TOK_TeletexString = 348,
169 TOK_TYPE_IDENTIFIER = 350,
172 TOK_UniversalString = 353,
174 TOK_UTF8String = 355,
175 TOK_VideotexString = 356,
176 TOK_VisibleString = 357,
180 TOK_INTERSECTION = 361,
188 #define TOK_VBracketLeft 259
189 #define TOK_VBracketRight 260
190 #define TOK_whitespace 261
191 #define TOK_opaque 262
192 #define TOK_bstring 263
193 #define TOK_cstring 264
194 #define TOK_hstring 265
195 #define TOK_identifier 266
196 #define TOK_number 267
197 #define TOK_number_negative 268
198 #define TOK_realnumber 269
199 #define TOK_tuple 270
200 #define TOK_quadruple 271
201 #define TOK_typereference 272
202 #define TOK_capitalreference 273
203 #define TOK_typefieldreference 274
204 #define TOK_valuefieldreference 275
205 #define TOK_Literal 276
206 #define TOK_ExtValue_BIT_STRING 277
207 #define TOK_ABSENT 278
208 #define TOK_ABSTRACT_SYNTAX 279
211 #define TOK_APPLICATION 282
212 #define TOK_AUTOMATIC 283
213 #define TOK_BEGIN 284
215 #define TOK_BMPString 286
216 #define TOK_BOOLEAN 287
218 #define TOK_CHARACTER 289
219 #define TOK_CHOICE 290
220 #define TOK_CLASS 291
221 #define TOK_COMPONENT 292
222 #define TOK_COMPONENTS 293
223 #define TOK_CONSTRAINED 294
224 #define TOK_CONTAINING 295
225 #define TOK_DEFAULT 296
226 #define TOK_DEFINITIONS 297
227 #define TOK_DEFINED 298
228 #define TOK_EMBEDDED 299
229 #define TOK_ENCODED 300
230 #define TOK_ENCODING_CONTROL 301
232 #define TOK_ENUMERATED 303
233 #define TOK_EXPLICIT 304
234 #define TOK_EXPORTS 305
235 #define TOK_EXTENSIBILITY 306
236 #define TOK_EXTERNAL 307
237 #define TOK_FALSE 308
239 #define TOK_GeneralizedTime 310
240 #define TOK_GeneralString 311
241 #define TOK_GraphicString 312
242 #define TOK_IA5String 313
243 #define TOK_IDENTIFIER 314
244 #define TOK_IMPLICIT 315
245 #define TOK_IMPLIED 316
246 #define TOK_IMPORTS 317
247 #define TOK_INCLUDES 318
248 #define TOK_INSTANCE 319
249 #define TOK_INSTRUCTIONS 320
250 #define TOK_INTEGER 321
251 #define TOK_ISO646String 322
254 #define TOK_MINUS_INFINITY 325
256 #define TOK_NumericString 327
257 #define TOK_OBJECT 328
258 #define TOK_ObjectDescriptor 329
259 #define TOK_OCTET 330
261 #define TOK_OPTIONAL 332
262 #define TOK_PATTERN 333
264 #define TOK_PLUS_INFINITY 335
265 #define TOK_PRESENT 336
266 #define TOK_PrintableString 337
267 #define TOK_PRIVATE 338
269 #define TOK_RELATIVE_OID 340
270 #define TOK_SEQUENCE 341
273 #define TOK_STRING 344
274 #define TOK_SYNTAX 345
275 #define TOK_T61String 346
277 #define TOK_TeletexString 348
279 #define TOK_TYPE_IDENTIFIER 350
280 #define TOK_UNIQUE 351
281 #define TOK_UNIVERSAL 352
282 #define TOK_UniversalString 353
283 #define TOK_UTCTime 354
284 #define TOK_UTF8String 355
285 #define TOK_VideotexString 356
286 #define TOK_VisibleString 357
289 #define TOK_EXCEPT 360
290 #define TOK_INTERSECTION 361
291 #define TOK_UNION 362
292 #define TOK_TwoDots 363
293 #define TOK_ThreeDots 364
298 /* Copy the first part of user declarations. */
309 #include "asn1parser.h"
311 #define YYPARSE_PARAM param
312 #define YYPARSE_PARAM_TYPE void **
313 #define YYERROR_VERBOSE
315 #define YYFPRINTF prefixed_fprintf
318 * Prefix parser debug with "PARSER: " for easier human eye scanning.
321 __attribute__((format(printf, 2, 3)))
322 prefixed_fprintf(FILE *f, const char *fmt, ...) {
323 static int line_ended = 1;
327 fprintf(f, "PARSER: ");
330 size_t len = strlen(fmt);
331 if(len && fmt[len-1] == '\n') {
334 int ret = vfprintf(f, fmt, ap);
340 static int yyerror(const char *msg);
343 int yyparse(void **param); /* byacc does not produce a prototype */
345 void asn1p_lexer_hack_push_opaque_state(void);
346 void asn1p_lexer_hack_enable_with_syntax(void);
347 void asn1p_lexer_hack_push_encoding_control(void);
348 #define yylineno asn1p_lineno
349 extern int asn1p_lineno;
350 const char *asn1p_parse_debug_filename;
351 #define ASN_FILENAME asn1p_parse_debug_filename
355 * Process directives as <ASN1C:RepresentAsPointer>
357 extern int asn1p_as_pointer;
360 * This temporary variable is used to solve the shortcomings of 1-lookahead
363 static struct AssignedIdentifier *saved_aid;
365 static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
366 static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
368 static asn1p_module_t *currentModule;
369 #define NEW_EXPR() (asn1p_expr_new(yylineno, currentModule))
371 #define checkmem(ptr) do { \
373 return yyerror("Memory failure"); \
376 #define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
377 if(arg1->type != constr_type) { \
379 root = asn1p_constraint_new(yylineno, currentModule); \
381 root->type = constr_type; \
382 __ret = asn1p_constraint_insert(root, \
384 checkmem(__ret == 0); \
390 = asn1p_constraint_insert(root, arg2); \
391 checkmem(__ret == 0); \
396 #error AL_IMPORT DEFINED ELSEWHERE!
398 #define AL_IMPORT(to, where, from, field) \
401 while(TQ_FIRST(&((from)->where))) { \
402 TQ_ADD(&((to)->where), TQ_REMOVE(&((from)->where), field), field); \
404 assert(TQ_FIRST(&((from)->where)) == 0); \
409 /* Enabling traces. */
414 /* Enabling verbose error messages. */
415 #ifdef YYERROR_VERBOSE
416 # undef YYERROR_VERBOSE
417 # define YYERROR_VERBOSE 1
419 # define YYERROR_VERBOSE 0
422 /* Enabling the token table. */
423 #ifndef YYTOKEN_TABLE
424 # define YYTOKEN_TABLE 0
427 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
428 typedef union YYSTYPE
429 #line 115 "asn1p_y.y"
432 asn1p_module_flags_e a_module_flags;
433 asn1p_module_t *a_module;
434 asn1p_expr_type_e a_type; /* ASN.1 Type */
435 asn1p_expr_t *a_expr; /* Constructed collection */
436 asn1p_constraint_t *a_constr; /* Constraint */
437 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
438 asn1p_xports_t *a_xports; /* IMports/EXports */
439 struct AssignedIdentifier a_aid; /* Assigned Identifier */
440 asn1p_oid_t *a_oid; /* Object Identifier */
441 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
442 struct asn1p_type_tag_s a_tag; /* A tag */
443 asn1p_ref_t *a_ref; /* Reference to custom type */
444 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
445 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
446 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
447 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
448 struct asn1p_param_s a_parg; /* A parameter argument */
449 asn1p_paramlist_t *a_plist; /* A pargs list */
450 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
451 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
452 asn1c_integer_t a_int;
461 struct asn1p_type_tag_s tag;
464 /* Line 193 of yacc.c. */
465 #line 465 "asn1p_y.c"
467 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
468 # define YYSTYPE_IS_DECLARED 1
469 # define YYSTYPE_IS_TRIVIAL 1
474 /* Copy the second part of user declarations. */
477 /* Line 216 of yacc.c. */
478 #line 478 "asn1p_y.c"
485 typedef YYTYPE_UINT8 yytype_uint8;
487 typedef unsigned char yytype_uint8;
491 typedef YYTYPE_INT8 yytype_int8;
492 #elif (defined __STDC__ || defined __C99__FUNC__ \
493 || defined __cplusplus || defined _MSC_VER)
494 typedef signed char yytype_int8;
496 typedef short int yytype_int8;
500 typedef YYTYPE_UINT16 yytype_uint16;
502 typedef unsigned short int yytype_uint16;
506 typedef YYTYPE_INT16 yytype_int16;
508 typedef short int yytype_int16;
512 # ifdef __SIZE_TYPE__
513 # define YYSIZE_T __SIZE_TYPE__
514 # elif defined size_t
515 # define YYSIZE_T size_t
516 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
517 || defined __cplusplus || defined _MSC_VER)
518 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
519 # define YYSIZE_T size_t
521 # define YYSIZE_T unsigned int
525 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
528 # if defined YYENABLE_NLS && YYENABLE_NLS
530 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
531 # define YY_(msgid) dgettext ("bison-runtime", msgid)
535 # define YY_(msgid) msgid
539 /* Suppress unused-variable warnings by "using" E. */
540 #if ! defined lint || defined __GNUC__
541 # define YYUSE(e) ((void) (e))
543 # define YYUSE(e) /* empty */
546 /* Identity function, used to suppress warnings about constant conditions. */
550 #if (defined __STDC__ || defined __C99__FUNC__ \
551 || defined __cplusplus || defined _MSC_VER)
564 #if ! defined yyoverflow || YYERROR_VERBOSE
566 /* The parser invokes alloca or malloc; define the necessary symbols. */
568 # ifdef YYSTACK_USE_ALLOCA
569 # if YYSTACK_USE_ALLOCA
571 # define YYSTACK_ALLOC __builtin_alloca
572 # elif defined __BUILTIN_VA_ARG_INCR
573 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
575 # define YYSTACK_ALLOC __alloca
576 # elif defined _MSC_VER
577 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
578 # define alloca _alloca
580 # define YYSTACK_ALLOC alloca
581 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
582 || defined __cplusplus || defined _MSC_VER)
583 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
592 # ifdef YYSTACK_ALLOC
593 /* Pacify GCC's `empty if-body' warning. */
594 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
595 # ifndef YYSTACK_ALLOC_MAXIMUM
596 /* The OS might guarantee only one guard page at the bottom of the stack,
597 and a page size can be as small as 4096 bytes. So we cannot safely
598 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
599 to allow for a few compiler-allocated temporary stack slots. */
600 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
603 # define YYSTACK_ALLOC YYMALLOC
604 # define YYSTACK_FREE YYFREE
605 # ifndef YYSTACK_ALLOC_MAXIMUM
606 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
608 # if (defined __cplusplus && ! defined _STDLIB_H \
609 && ! ((defined YYMALLOC || defined malloc) \
610 && (defined YYFREE || defined free)))
611 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
617 # define YYMALLOC malloc
618 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
619 || defined __cplusplus || defined _MSC_VER)
620 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
625 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
626 || defined __cplusplus || defined _MSC_VER)
627 void free (void *); /* INFRINGES ON USER NAME SPACE */
631 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
634 #if (! defined yyoverflow \
635 && (! defined __cplusplus \
636 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
638 /* A type that is properly aligned for any stack member. */
645 /* The size of the maximum gap between one aligned stack and the next. */
646 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
648 /* The size of an array large to enough to hold all stacks, each with
650 # define YYSTACK_BYTES(N) \
651 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
652 + YYSTACK_GAP_MAXIMUM)
654 /* Copy COUNT objects from FROM to TO. The source and destination do
657 # if defined __GNUC__ && 1 < __GNUC__
658 # define YYCOPY(To, From, Count) \
659 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
661 # define YYCOPY(To, From, Count) \
665 for (yyi = 0; yyi < (Count); yyi++) \
666 (To)[yyi] = (From)[yyi]; \
672 /* Relocate STACK from its old location to the new one. The
673 local variables YYSIZE and YYSTACKSIZE give the old and new number of
674 elements in the stack, and YYPTR gives the new location of the
675 stack. Advance YYPTR to a properly aligned location for the next
677 # define YYSTACK_RELOCATE(Stack) \
680 YYSIZE_T yynewbytes; \
681 YYCOPY (&yyptr->Stack, Stack, yysize); \
682 Stack = &yyptr->Stack; \
683 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
684 yyptr += yynewbytes / sizeof (*yyptr); \
690 /* YYFINAL -- State number of the termination state. */
692 /* YYLAST -- Last index in YYTABLE. */
695 /* YYNTOKENS -- Number of terminals. */
696 #define YYNTOKENS 126
697 /* YYNNTS -- Number of nonterminals. */
699 /* YYNRULES -- Number of rules. */
701 /* YYNRULES -- Number of states. */
702 #define YYNSTATES 522
704 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
706 #define YYMAXUTOK 365
708 #define YYTRANSLATE(YYX) \
709 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
711 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
712 static const yytype_uint8 yytranslate[] =
714 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 122, 2, 2, 2, 2, 2, 2,
718 115, 116, 2, 2, 118, 2, 123, 2, 2, 2,
719 2, 2, 2, 2, 2, 2, 2, 2, 119, 117,
720 124, 2, 2, 2, 125, 2, 2, 2, 2, 2,
721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723 2, 120, 2, 121, 106, 2, 2, 2, 2, 2,
724 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
725 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726 2, 2, 2, 113, 108, 114, 2, 2, 2, 2,
727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
740 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
741 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
742 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
743 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
744 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
745 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
746 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
747 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
748 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
749 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
750 105, 107, 109, 110, 111, 112
754 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
756 static const yytype_uint16 yyprhs[] =
758 0, 0, 3, 6, 8, 10, 13, 14, 24, 25,
759 27, 31, 34, 36, 39, 41, 46, 48, 49, 51,
760 53, 56, 59, 62, 65, 68, 71, 72, 74, 78,
761 80, 83, 85, 87, 89, 90, 94, 96, 97, 99,
762 103, 106, 107, 109, 111, 114, 115, 117, 122, 124,
763 128, 130, 134, 136, 137, 139, 143, 147, 150, 152,
764 156, 158, 162, 164, 168, 173, 175, 180, 184, 188,
765 195, 202, 204, 208, 210, 214, 218, 222, 226, 228,
766 232, 234, 236, 238, 240, 241, 243, 245, 249, 255,
767 259, 262, 266, 268, 270, 274, 277, 279, 281, 287,
768 288, 290, 292, 296, 299, 304, 308, 312, 316, 320,
769 324, 325, 327, 328, 335, 337, 340, 342, 344, 346,
770 350, 352, 356, 360, 362, 365, 368, 371, 375, 376,
771 379, 381, 383, 385, 390, 395, 400, 407, 414, 416,
772 421, 425, 427, 429, 433, 437, 441, 443, 447, 449,
773 451, 453, 455, 459, 463, 465, 470, 472, 474, 475,
774 479, 481, 483, 485, 487, 489, 491, 493, 495, 499,
775 501, 503, 505, 507, 510, 512, 514, 516, 518, 520,
776 523, 526, 528, 530, 533, 536, 538, 540, 542, 544,
777 546, 548, 551, 553, 558, 563, 569, 574, 578, 580,
778 582, 584, 586, 588, 590, 592, 594, 596, 598, 600,
779 602, 604, 606, 608, 610, 612, 614, 615, 617, 618,
780 620, 621, 623, 625, 629, 631, 634, 636, 638, 640,
781 642, 644, 648, 654, 656, 660, 662, 666, 668, 672,
782 674, 678, 680, 684, 686, 688, 690, 692, 694, 696,
783 698, 701, 704, 707, 710, 714, 716, 718, 720, 722,
784 724, 726, 728, 731, 733, 737, 741, 743, 745, 747,
785 751, 757, 759, 763, 767, 768, 770, 772, 774, 776,
786 778, 780, 782, 783, 789, 792, 794, 797, 800, 804,
787 806, 808, 812, 817, 819, 823, 826, 830, 832, 836,
788 837, 839, 841, 844, 846, 850, 852, 854, 858, 863,
789 868, 870, 874, 879, 884, 886, 888, 892, 894, 899,
790 904, 906, 908, 910, 912, 914, 915, 917, 920, 925,
791 926, 928, 930, 932, 933, 935, 937, 939, 941, 942,
795 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
796 static const yytype_int16 yyrhs[] =
798 127, 0, -1, 104, 128, -1, 128, -1, 129, -1,
799 128, 129, -1, -1, 268, 130, 131, 42, 135, 3,
800 29, 138, 47, -1, -1, 132, -1, 113, 133, 114,
801 -1, 113, 114, -1, 134, -1, 133, 134, -1, 270,
802 -1, 270, 115, 12, 116, -1, 12, -1, -1, 136,
803 -1, 137, -1, 136, 137, -1, 49, 92, -1, 60,
804 92, -1, 28, 92, -1, 51, 61, -1, 18, 65,
805 -1, -1, 139, -1, 151, 143, 140, -1, 141, -1,
806 140, 141, -1, 158, -1, 193, -1, 156, -1, -1,
807 46, 18, 142, -1, 204, -1, -1, 144, -1, 62,
808 145, 117, -1, 62, 54, -1, -1, 146, -1, 148,
809 -1, 146, 148, -1, -1, 132, -1, 149, 54, 268,
810 147, -1, 150, -1, 149, 118, 150, -1, 268, -1,
811 268, 113, 114, -1, 270, -1, -1, 152, -1, 50,
812 153, 117, -1, 50, 25, 117, -1, 50, 117, -1,
813 154, -1, 153, 118, 154, -1, 268, -1, 268, 113,
814 114, -1, 270, -1, 113, 214, 114, -1, 268, 178,
815 3, 155, -1, 187, -1, 187, 113, 161, 114, -1,
816 268, 3, 178, -1, 268, 3, 168, -1, 268, 113,
817 159, 114, 3, 178, -1, 268, 113, 159, 114, 3,
818 168, -1, 160, -1, 159, 118, 160, -1, 268, -1,
819 268, 119, 270, -1, 268, 119, 268, -1, 201, 119,
820 270, -1, 201, 119, 268, -1, 162, -1, 161, 118,
821 162, -1, 181, -1, 196, -1, 197, -1, 155, -1,
822 -1, 164, -1, 165, -1, 164, 118, 165, -1, 164,
823 118, 4, 164, 5, -1, 270, 182, 250, -1, 182,
824 250, -1, 38, 76, 182, -1, 177, -1, 167, -1,
825 166, 118, 167, -1, 270, 182, -1, 177, -1, 182,
826 -1, 36, 113, 170, 114, 172, -1, -1, 96, -1,
827 171, -1, 170, 118, 171, -1, 19, 250, -1, 20,
828 178, 169, 250, -1, 20, 191, 250, -1, 20, 192,
829 250, -1, 19, 191, 250, -1, 19, 178, 250, -1,
830 19, 192, 250, -1, -1, 173, -1, -1, 103, 90,
831 113, 174, 175, 114, -1, 176, -1, 175, 176, -1,
832 6, -1, 21, -1, 190, -1, 120, 175, 121, -1,
833 111, -1, 111, 122, 197, -1, 111, 122, 261, -1,
834 179, -1, 263, 181, -1, 157, 208, -1, 185, 208,
835 -1, 263, 184, 208, -1, -1, 183, 185, -1, 186,
836 -1, 157, -1, 203, -1, 35, 113, 166, 114, -1,
837 86, 113, 163, 114, -1, 87, 113, 163, 114, -1,
838 86, 209, 76, 269, 263, 184, -1, 87, 209, 76,
839 269, 263, 184, -1, 26, -1, 26, 43, 33, 270,
840 -1, 64, 76, 187, -1, 17, -1, 18, -1, 17,
841 123, 268, -1, 18, 123, 268, -1, 18, 123, 188,
842 -1, 189, -1, 188, 123, 189, -1, 190, -1, 19,
843 -1, 20, -1, 19, -1, 191, 123, 19, -1, 191,
844 123, 20, -1, 18, -1, 270, 178, 3, 194, -1,
845 196, -1, 197, -1, -1, 113, 195, 199, -1, 71,
846 -1, 53, -1, 94, -1, 261, -1, 262, -1, 198,
847 -1, 228, -1, 272, -1, 268, 123, 270, -1, 9,
848 -1, 15, -1, 16, -1, 200, -1, 199, 7, -1,
849 7, -1, 270, -1, 32, -1, 71, -1, 84, -1,
850 75, 89, -1, 73, 59, -1, 85, -1, 52, -1,
851 44, 79, -1, 34, 89, -1, 99, -1, 55, -1,
852 204, -1, 202, -1, 66, -1, 48, -1, 30, 89,
853 -1, 201, -1, 66, 113, 254, 114, -1, 48, 113,
854 258, 114, -1, 30, 89, 113, 256, 114, -1, 22,
855 113, 252, 114, -1, 22, 113, 114, -1, 31, -1,
856 56, -1, 57, -1, 58, -1, 67, -1, 72, -1,
857 82, -1, 91, -1, 93, -1, 98, -1, 100, -1,
858 101, -1, 102, -1, 74, -1, 108, -1, 109, -1,
859 106, -1, 107, -1, -1, 210, -1, -1, 211, -1,
860 -1, 210, -1, 222, -1, 115, 212, 116, -1, 210,
861 -1, 211, 210, -1, 213, -1, 239, -1, 214, -1,
862 111, -1, 215, -1, 215, 118, 111, -1, 215, 118,
863 111, 118, 215, -1, 216, -1, 25, 105, 219, -1,
864 217, -1, 216, 205, 217, -1, 218, -1, 217, 206,
865 218, -1, 219, -1, 219, 105, 219, -1, 220, -1,
866 115, 215, 116, -1, 227, -1, 229, -1, 221, -1,
867 222, -1, 230, -1, 223, -1, 224, -1, 54, 210,
868 -1, 88, 210, -1, 78, 9, -1, 78, 270, -1,
869 225, 243, 226, -1, 227, -1, 69, -1, 227, -1,
870 68, -1, 194, -1, 8, -1, 10, -1, 63, 178,
871 -1, 180, -1, 103, 37, 231, -1, 103, 38, 232,
872 -1, 210, -1, 233, -1, 234, -1, 113, 235, 114,
873 -1, 113, 111, 118, 235, 114, -1, 236, -1, 235,
874 118, 236, -1, 272, 207, 237, -1, -1, 238, -1,
875 81, -1, 23, -1, 77, -1, 240, -1, 244, -1,
876 242, -1, -1, 39, 33, 113, 241, 199, -1, 40,
877 178, -1, 110, -1, 110, 124, -1, 124, 110, -1,
878 124, 110, 124, -1, 245, -1, 246, -1, 113, 268,
879 114, -1, 245, 113, 247, 114, -1, 248, -1, 247,
880 118, 248, -1, 125, 249, -1, 125, 123, 249, -1,
881 270, -1, 249, 123, 270, -1, -1, 251, -1, 77,
882 -1, 41, 194, -1, 253, -1, 252, 118, 253, -1,
883 270, -1, 255, -1, 254, 118, 255, -1, 270, 115,
884 261, 116, -1, 270, 115, 197, 116, -1, 257, -1,
885 256, 118, 257, -1, 270, 115, 12, 116, -1, 270,
886 115, 197, 116, -1, 259, -1, 260, -1, 259, 118,
887 260, -1, 270, -1, 270, 115, 261, 116, -1, 270,
888 115, 197, 116, -1, 261, -1, 111, -1, 12, -1,
889 13, -1, 14, -1, -1, 264, -1, 265, 267, -1,
890 120, 266, 12, 121, -1, -1, 97, -1, 27, -1,
891 83, -1, -1, 60, -1, 49, -1, 17, -1, 18,
892 -1, -1, 270, -1, 11, -1, 270, -1, 271, -1
895 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
896 static const yytype_uint16 yyrline[] =
898 0, 414, 414, 417, 423, 428, 445, 445, 474, 475,
899 479, 482, 488, 494, 503, 507, 511, 521, 522, 531,
900 534, 543, 546, 549, 552, 556, 577, 578, 587, 600,
901 603, 620, 627, 641, 649, 648, 662, 675, 676, 679,
902 689, 695, 696, 699, 704, 711, 712, 716, 727, 732,
903 739, 745, 751, 761, 762, 774, 777, 780, 788, 793,
904 800, 806, 812, 821, 824, 844, 854, 874, 880, 896,
905 902, 910, 919, 930, 934, 942, 950, 958, 969, 974,
906 981, 982, 990, 998, 1021, 1022, 1025, 1030, 1034, 1042,
907 1049, 1055, 1062, 1068, 1073, 1080, 1085, 1088, 1095, 1105,
908 1106, 1110, 1117, 1127, 1137, 1148, 1158, 1169, 1179, 1190,
909 1202, 1203, 1210, 1209, 1218, 1222, 1229, 1233, 1236, 1240,
910 1246, 1254, 1263, 1274, 1277, 1284, 1307, 1330, 1354, 1361,
911 1380, 1381, 1384, 1385, 1391, 1397, 1403, 1413, 1423, 1429,
912 1441, 1456, 1464, 1472, 1483, 1494, 1516, 1524, 1533, 1537,
913 1542, 1551, 1556, 1561, 1569, 1592, 1602, 1603, 1604, 1604,
914 1612, 1617, 1622, 1627, 1628, 1629, 1630, 1634, 1635, 1653,
915 1657, 1662, 1670, 1679, 1694, 1695, 1701, 1702, 1703, 1704,
916 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1720,
917 1721, 1722, 1726, 1732, 1737, 1742, 1747, 1752, 1761, 1762,
918 1766, 1770, 1771, 1772, 1773, 1774, 1778, 1779, 1780, 1781,
919 1785, 1786, 1793, 1793, 1794, 1794, 1798, 1799, 1803, 1804,
920 1808, 1809, 1810, 1814, 1820, 1821, 1830, 1830, 1832, 1835,
921 1839, 1840, 1846, 1857, 1858, 1864, 1865, 1871, 1872, 1879,
922 1880, 1886, 1887, 1898, 1904, 1910, 1911, 1913, 1914, 1915,
923 1920, 1925, 1930, 1935, 1947, 1956, 1957, 1963, 1964, 1969,
924 1972, 1977, 1985, 1991, 2003, 2006, 2012, 2013, 2013, 2014,
925 2016, 2029, 2034, 2040, 2054, 2055, 2059, 2062, 2065, 2073,
926 2074, 2075, 2080, 2079, 2091, 2100, 2101, 2102, 2103, 2106,
927 2109, 2118, 2134, 2140, 2146, 2160, 2171, 2187, 2190, 2210,
928 2214, 2218, 2222, 2229, 2234, 2240, 2249, 2254, 2261, 2269,
929 2279, 2284, 2291, 2299, 2309, 2324, 2329, 2336, 2343, 2351,
930 2359, 2366, 2377, 2381, 2388, 2419, 2420, 2424, 2431, 2437,
931 2438, 2439, 2440, 2444, 2445, 2446, 2450, 2454, 2462, 2463,
936 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
937 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
938 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
939 static const char *const yytname[] =
941 "$end", "error", "$undefined", "TOK_PPEQ", "TOK_VBracketLeft",
942 "TOK_VBracketRight", "TOK_whitespace", "TOK_opaque", "TOK_bstring",
943 "TOK_cstring", "TOK_hstring", "\"identifier\"", "\"number\"",
944 "\"negative number\"", "TOK_realnumber", "TOK_tuple", "TOK_quadruple",
945 "TOK_typereference", "TOK_capitalreference", "TOK_typefieldreference",
946 "TOK_valuefieldreference", "TOK_Literal", "TOK_ExtValue_BIT_STRING",
947 "TOK_ABSENT", "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY",
948 "TOK_APPLICATION", "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT",
949 "TOK_BMPString", "TOK_BOOLEAN", "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE",
950 "TOK_CLASS", "TOK_COMPONENT", "TOK_COMPONENTS", "TOK_CONSTRAINED",
951 "TOK_CONTAINING", "TOK_DEFAULT", "TOK_DEFINITIONS", "TOK_DEFINED",
952 "TOK_EMBEDDED", "TOK_ENCODED", "TOK_ENCODING_CONTROL", "TOK_END",
953 "TOK_ENUMERATED", "TOK_EXPLICIT", "TOK_EXPORTS", "TOK_EXTENSIBILITY",
954 "TOK_EXTERNAL", "TOK_FALSE", "TOK_FROM", "TOK_GeneralizedTime",
955 "TOK_GeneralString", "TOK_GraphicString", "TOK_IA5String",
956 "TOK_IDENTIFIER", "TOK_IMPLICIT", "TOK_IMPLIED", "TOK_IMPORTS",
957 "TOK_INCLUDES", "TOK_INSTANCE", "TOK_INSTRUCTIONS", "TOK_INTEGER",
958 "TOK_ISO646String", "TOK_MAX", "TOK_MIN", "TOK_MINUS_INFINITY",
959 "TOK_NULL", "TOK_NumericString", "TOK_OBJECT", "TOK_ObjectDescriptor",
960 "TOK_OCTET", "TOK_OF", "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV",
961 "TOK_PLUS_INFINITY", "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE",
962 "TOK_REAL", "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE",
963 "TOK_STRING", "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS",
964 "TOK_TeletexString", "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE",
965 "TOK_UNIVERSAL", "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
966 "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH",
967 "\"UTF-8 byte order mark\"", "TOK_EXCEPT", "'^'", "TOK_INTERSECTION",
968 "'|'", "TOK_UNION", "\"..\"", "\"...\"", "\"concrete TypeDeclaration\"",
969 "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['", "']'", "'!'",
970 "'.'", "'<'", "'@'", "$accept", "ParsedGrammar", "ModuleList",
971 "ModuleDefinition", "@1", "optObjectIdentifier", "ObjectIdentifier",
972 "ObjectIdentifierBody", "ObjectIdentifierElement",
973 "optModuleDefinitionFlags", "ModuleDefinitionFlags",
974 "ModuleDefinitionFlag", "optModuleBody", "ModuleBody", "AssignmentList",
975 "Assignment", "@2", "optImports", "ImportsDefinition",
976 "optImportsBundleSet", "ImportsBundleSet", "AssignedIdentifier",
977 "ImportsBundle", "ImportsList", "ImportsElement", "optExports",
978 "ExportsDefinition", "ExportsBody", "ExportsElement", "ValueSet",
979 "ValueSetTypeAssignment", "DefinedType", "DataTypeReference",
980 "ParameterArgumentList", "ParameterArgumentName", "ActualParameterList",
981 "ActualParameter", "optComponentTypeLists", "ComponentTypeLists",
982 "ComponentType", "AlternativeTypeLists", "AlternativeType",
983 "ObjectClass", "optUNIQUE", "FieldSpec", "ClassField", "optWithSyntax",
984 "WithSyntax", "@3", "WithSyntaxList", "WithSyntaxToken",
985 "ExtensionAndException", "Type", "TaggedType", "DefinedUntaggedType",
986 "UntaggedType", "MaybeIndirectTaggedType", "NSTD_IndirectMarker",
987 "MaybeIndirectTypeDeclaration", "TypeDeclaration",
988 "ConcreteTypeDeclaration", "ComplexTypeReference",
989 "ComplexTypeReferenceAmpList", "ComplexTypeReferenceElement",
990 "PrimitiveFieldReference", "FieldName", "DefinedObjectClass",
991 "ValueAssignment", "Value", "@4", "SimpleValue", "DefinedValue",
992 "RestrictedCharacterStringValue", "Opaque", "OpaqueFirstToken",
993 "BasicTypeId", "BasicTypeId_UniverationCompatible", "BuiltinType",
994 "BasicString", "UnionMark", "IntersectionMark", "optConstraint",
995 "optManyConstraints", "optSizeOrConstraint", "Constraint",
996 "ManyConstraints", "ConstraintSpec", "SubtypeConstraint",
997 "ElementSetSpecs", "ElementSetSpec", "Unions", "Intersections",
998 "IntersectionElements", "Elements", "SubtypeElements",
999 "PermittedAlphabet", "SizeConstraint", "PatternConstraint", "ValueRange",
1000 "LowerEndValue", "UpperEndValue", "SingleValue", "BitStringValue",
1001 "ContainedSubtype", "InnerTypeConstraints", "SingleTypeConstraint",
1002 "MultipleTypeConstraints", "FullSpecification", "PartialSpecification",
1003 "TypeConstraints", "NamedConstraint", "optPresenceConstraint",
1004 "PresenceConstraint", "GeneralConstraint", "UserDefinedConstraint", "@5",
1005 "ContentsConstraint", "ConstraintRangeSpec", "TableConstraint",
1006 "SimpleTableConstraint", "ComponentRelationConstraint", "AtNotationList",
1007 "AtNotationElement", "ComponentIdList", "optMarker", "Marker",
1008 "IdentifierList", "IdentifierElement", "NamedNumberList", "NamedNumber",
1009 "NamedBitList", "NamedBit", "Enumerations", "UniverationList",
1010 "UniverationElement", "SignedNumber", "RealValue", "optTag", "Tag",
1011 "TagTypeValue", "TagClass", "TagPlicit", "TypeRefName", "optIdentifier",
1012 "Identifier", "IdentifierAsReference", "IdentifierAsValue", 0
1017 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1019 static const yytype_uint16 yytoknum[] =
1021 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1022 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1023 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1024 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1025 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1026 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1027 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1028 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1029 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1030 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1031 355, 356, 357, 358, 359, 360, 94, 361, 124, 362,
1032 363, 364, 365, 123, 125, 40, 41, 59, 44, 58,
1033 91, 93, 33, 46, 60, 64
1037 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1038 static const yytype_uint16 yyr1[] =
1040 0, 126, 127, 127, 128, 128, 130, 129, 131, 131,
1041 132, 132, 133, 133, 134, 134, 134, 135, 135, 136,
1042 136, 137, 137, 137, 137, 137, 138, 138, 139, 140,
1043 140, 141, 141, 141, 142, 141, 141, 143, 143, 144,
1044 144, 145, 145, 146, 146, 147, 147, 148, 149, 149,
1045 150, 150, 150, 151, 151, 152, 152, 152, 153, 153,
1046 154, 154, 154, 155, 156, 157, 157, 158, 158, 158,
1047 158, 159, 159, 160, 160, 160, 160, 160, 161, 161,
1048 162, 162, 162, 162, 163, 163, 164, 164, 164, 165,
1049 165, 165, 165, 166, 166, 167, 167, 167, 168, 169,
1050 169, 170, 170, 171, 171, 171, 171, 171, 171, 171,
1051 172, 172, 174, 173, 175, 175, 176, 176, 176, 176,
1052 177, 177, 177, 178, 179, 180, 181, 182, 183, 184,
1053 185, 185, 186, 186, 186, 186, 186, 186, 186, 186,
1054 186, 187, 187, 187, 187, 187, 188, 188, 189, 190,
1055 190, 191, 191, 191, 192, 193, 194, 194, 195, 194,
1056 196, 196, 196, 196, 196, 196, 196, 197, 197, 198,
1057 198, 198, 199, 199, 200, 200, 201, 201, 201, 201,
1058 201, 201, 201, 201, 201, 201, 201, 201, 201, 202,
1059 202, 202, 203, 203, 203, 203, 203, 203, 204, 204,
1060 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
1061 204, 204, 205, 205, 206, 206, 207, 207, 208, 208,
1062 209, 209, 209, 210, 211, 211, 212, 212, 213, 214,
1063 214, 214, 214, 215, 215, 216, 216, 217, 217, 218,
1064 218, 219, 219, 220, 220, 220, 220, 220, 220, 220,
1065 221, 222, 223, 223, 224, 225, 225, 226, 226, 227,
1066 228, 228, 229, 229, 230, 230, 231, 232, 232, 233,
1067 234, 235, 235, 236, 237, 237, 238, 238, 238, 239,
1068 239, 239, 241, 240, 242, 243, 243, 243, 243, 244,
1069 244, 245, 246, 247, 247, 248, 248, 249, 249, 250,
1070 250, 251, 251, 252, 252, 253, 254, 254, 255, 255,
1071 256, 256, 257, 257, 258, 259, 259, 260, 260, 260,
1072 260, 260, 261, 261, 262, 263, 263, 264, 265, 266,
1073 266, 266, 266, 267, 267, 267, 268, 268, 269, 269,
1077 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1078 static const yytype_uint8 yyr2[] =
1080 0, 2, 2, 1, 1, 2, 0, 9, 0, 1,
1081 3, 2, 1, 2, 1, 4, 1, 0, 1, 1,
1082 2, 2, 2, 2, 2, 2, 0, 1, 3, 1,
1083 2, 1, 1, 1, 0, 3, 1, 0, 1, 3,
1084 2, 0, 1, 1, 2, 0, 1, 4, 1, 3,
1085 1, 3, 1, 0, 1, 3, 3, 2, 1, 3,
1086 1, 3, 1, 3, 4, 1, 4, 3, 3, 6,
1087 6, 1, 3, 1, 3, 3, 3, 3, 1, 3,
1088 1, 1, 1, 1, 0, 1, 1, 3, 5, 3,
1089 2, 3, 1, 1, 3, 2, 1, 1, 5, 0,
1090 1, 1, 3, 2, 4, 3, 3, 3, 3, 3,
1091 0, 1, 0, 6, 1, 2, 1, 1, 1, 3,
1092 1, 3, 3, 1, 2, 2, 2, 3, 0, 2,
1093 1, 1, 1, 4, 4, 4, 6, 6, 1, 4,
1094 3, 1, 1, 3, 3, 3, 1, 3, 1, 1,
1095 1, 1, 3, 3, 1, 4, 1, 1, 0, 3,
1096 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
1097 1, 1, 1, 2, 1, 1, 1, 1, 1, 2,
1098 2, 1, 1, 2, 2, 1, 1, 1, 1, 1,
1099 1, 2, 1, 4, 4, 5, 4, 3, 1, 1,
1100 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1101 1, 1, 1, 1, 1, 1, 0, 1, 0, 1,
1102 0, 1, 1, 3, 1, 2, 1, 1, 1, 1,
1103 1, 3, 5, 1, 3, 1, 3, 1, 3, 1,
1104 3, 1, 3, 1, 1, 1, 1, 1, 1, 1,
1105 2, 2, 2, 2, 3, 1, 1, 1, 1, 1,
1106 1, 1, 2, 1, 3, 3, 1, 1, 1, 3,
1107 5, 1, 3, 3, 0, 1, 1, 1, 1, 1,
1108 1, 1, 0, 5, 2, 1, 2, 2, 3, 1,
1109 1, 3, 4, 1, 3, 2, 3, 1, 3, 0,
1110 1, 1, 2, 1, 3, 1, 1, 3, 4, 4,
1111 1, 3, 4, 4, 1, 1, 3, 1, 4, 4,
1112 1, 1, 1, 1, 1, 0, 1, 2, 4, 0,
1113 1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
1117 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1118 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1119 means the default is an error. */
1120 static const yytype_uint16 yydefact[] =
1122 0, 336, 337, 0, 0, 3, 4, 6, 2, 1,
1123 5, 8, 0, 0, 9, 340, 16, 11, 0, 12,
1124 14, 17, 10, 13, 0, 0, 0, 0, 0, 0,
1125 0, 18, 19, 0, 25, 23, 21, 24, 22, 0,
1126 20, 15, 53, 0, 0, 27, 37, 54, 0, 57,
1127 0, 58, 60, 62, 7, 41, 0, 38, 56, 55,
1128 0, 0, 40, 0, 42, 43, 0, 48, 50, 52,
1129 198, 0, 199, 200, 201, 202, 203, 211, 204, 205,
1130 206, 207, 208, 209, 210, 28, 29, 33, 31, 32,
1131 36, 325, 325, 59, 61, 39, 44, 0, 0, 0,
1132 34, 30, 325, 0, 329, 0, 123, 0, 326, 333,
1133 0, 45, 49, 51, 35, 0, 68, 67, 0, 176,
1134 0, 0, 190, 182, 186, 189, 177, 0, 0, 178,
1135 181, 185, 0, 71, 0, 188, 187, 73, 331, 332,
1136 330, 0, 0, 141, 142, 0, 138, 0, 0, 190,
1137 0, 189, 220, 220, 131, 124, 218, 130, 65, 192,
1138 132, 335, 334, 327, 0, 46, 47, 0, 191, 184,
1139 183, 180, 179, 0, 0, 0, 0, 0, 0, 64,
1140 0, 0, 0, 0, 191, 325, 0, 0, 0, 0,
1141 325, 0, 0, 221, 222, 325, 0, 126, 224, 219,
1142 0, 260, 169, 261, 322, 323, 324, 170, 171, 161,
1143 160, 162, 158, 155, 156, 157, 165, 166, 163, 164,
1144 0, 341, 342, 167, 325, 325, 0, 101, 325, 72,
1145 77, 76, 75, 74, 328, 141, 142, 0, 0, 325,
1146 256, 0, 0, 229, 0, 218, 263, 259, 0, 230,
1147 233, 235, 237, 239, 241, 245, 246, 248, 249, 0,
1148 243, 244, 247, 143, 149, 150, 145, 146, 148, 144,
1149 197, 0, 303, 305, 0, 0, 120, 0, 93, 96,
1150 97, 128, 325, 321, 0, 314, 315, 320, 317, 140,
1151 0, 306, 0, 251, 0, 0, 85, 86, 92, 299,
1152 325, 0, 325, 158, 0, 226, 228, 227, 279, 281,
1153 280, 289, 290, 338, 0, 338, 225, 160, 83, 0,
1154 78, 80, 81, 82, 0, 0, 154, 151, 0, 301,
1155 299, 299, 299, 103, 300, 99, 299, 299, 110, 0,
1156 70, 69, 0, 250, 262, 252, 253, 0, 0, 0,
1157 125, 63, 0, 212, 213, 0, 214, 215, 0, 0,
1158 285, 0, 0, 0, 196, 0, 139, 0, 310, 0,
1159 0, 133, 325, 0, 218, 95, 194, 0, 0, 193,
1160 0, 0, 325, 134, 325, 90, 299, 0, 284, 0,
1161 223, 0, 325, 339, 135, 325, 66, 0, 174, 159,
1162 172, 175, 168, 302, 108, 0, 107, 109, 100, 299,
1163 105, 106, 0, 98, 111, 102, 234, 266, 264, 0,
1164 265, 267, 268, 242, 231, 236, 238, 240, 286, 287,
1165 258, 254, 257, 147, 304, 195, 0, 0, 121, 122,
1166 94, 129, 127, 316, 0, 0, 307, 0, 0, 91,
1167 325, 87, 89, 282, 291, 0, 0, 293, 128, 128,
1168 79, 173, 152, 153, 104, 0, 0, 0, 271, 216,
1169 0, 288, 311, 0, 0, 319, 318, 309, 308, 0,
1170 0, 0, 295, 297, 292, 0, 136, 137, 112, 0,
1171 269, 0, 274, 217, 232, 312, 313, 88, 283, 296,
1172 0, 294, 0, 0, 272, 277, 278, 276, 273, 275,
1173 298, 116, 117, 0, 0, 114, 118, 270, 0, 113,
1177 /* YYDEFGOTO[NTERM-NUM]. */
1178 static const yytype_int16 yydefgoto[] =
1180 -1, 4, 5, 6, 11, 13, 14, 18, 19, 30,
1181 31, 32, 44, 45, 85, 86, 114, 56, 57, 63,
1182 64, 166, 65, 66, 67, 46, 47, 50, 51, 318,
1183 87, 245, 88, 132, 133, 319, 320, 295, 296, 297,
1184 277, 278, 116, 409, 226, 227, 413, 414, 502, 514,
1185 515, 298, 105, 106, 246, 321, 299, 373, 374, 156,
1186 157, 158, 266, 267, 516, 331, 332, 89, 247, 324,
1187 214, 215, 216, 399, 400, 159, 135, 160, 136, 355,
1188 358, 492, 197, 192, 198, 199, 304, 305, 248, 249,
1189 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
1190 431, 260, 217, 261, 262, 418, 420, 421, 422, 467,
1191 468, 508, 509, 307, 308, 480, 309, 362, 310, 311,
1192 312, 456, 457, 482, 333, 334, 271, 272, 290, 291,
1193 367, 368, 284, 285, 286, 218, 219, 281, 108, 109,
1194 141, 163, 220, 392, 221, 222, 223
1197 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1199 #define YYPACT_NINF -296
1200 static const yytype_int16 yypact[] =
1202 51, -296, -296, 217, 41, 217, -296, -296, 217, -296,
1203 -296, -63, 53, 43, -296, -296, -296, -296, 70, -296,
1204 -45, 204, -296, -296, 79, 32, 30, 38, 110, 87,
1205 200, 204, -296, 95, -296, -296, -296, -296, -296, 198,
1206 -296, -296, 247, 12, 178, -296, 174, -296, 134, -296,
1207 140, -296, 183, -296, -296, 72, 663, -296, -296, -296,
1208 213, 173, -296, 187, 213, -296, 50, -296, 211, -296,
1209 -296, 293, -296, -296, -296, -296, -296, -296, -296, -296,
1210 -296, -296, -296, -296, -296, 663, -296, -296, -296, -296,
1211 -296, 19, 219, -296, -296, -296, -296, 217, 213, 227,
1212 -296, -296, -2, 817, 68, 340, -296, 740, -296, 120,
1213 356, -63, -296, -296, -296, 249, -296, -296, 272, -296,
1214 274, 285, -296, -296, -296, -296, -296, 307, 278, -296,
1215 -296, -296, 13, -296, 250, -296, -296, 251, -296, -296,
1216 -296, 359, 260, 264, 265, 261, 346, 301, 279, 281,
1217 315, 294, 113, 135, -296, -296, 280, -296, 295, -296,
1218 -296, -296, -296, -296, 510, -296, -296, 290, -296, -296,
1219 -296, -296, -296, 406, 817, 213, 213, 289, 368, -296,
1220 217, 309, 14, 378, 299, 29, 108, 318, 403, 280,
1221 61, 229, 339, -296, -296, 61, 341, -296, -296, 280,
1222 604, -296, -296, -296, -296, -296, -296, -296, -296, -296,
1223 -296, -296, -296, -296, -296, -296, -296, -296, -296, -296,
1224 296, -296, -296, -296, 84, 28, 98, -296, -2, -296,
1225 -296, -296, -296, -296, -296, 264, 265, 311, 280, 219,
1226 -296, 104, 300, -296, 388, 280, -296, -296, 304, 302,
1227 237, 241, -296, 320, -296, -296, -296, -296, -296, -18,
1228 -17, -296, -296, -296, -296, -296, 303, -296, -296, -296,
1229 -296, 138, -296, -296, 403, 403, 305, 167, -296, -296,
1230 -296, -296, 219, -296, 314, 312, -296, -296, 308, -296,
1231 170, -296, 317, -296, 353, 319, 316, -296, -296, -3,
1232 219, 402, 219, 217, 324, -296, -296, -296, -296, -296,
1233 -296, 323, -296, 403, 331, 403, -296, 329, -296, 172,
1234 -296, -296, -296, -296, 282, 403, -296, -296, 510, -296,
1235 -3, 10, -3, -296, -296, 351, 10, -3, 345, 290,
1236 -296, -296, 496, -296, -296, -296, -296, 280, 336, 334,
1237 -296, -296, 342, -296, -296, 496, -296, -296, 496, 496,
1238 328, 344, 262, 330, -296, 403, -296, 181, -296, 343,
1239 248, -296, 29, 740, 280, -296, -296, 108, 248, -296,
1240 403, 248, 219, -296, 24, -296, -3, 347, -296, 349,
1241 -296, 348, 219, -296, -296, 219, -296, 604, -296, 448,
1242 -296, -296, -296, -296, -296, 332, -296, -296, -296, -3,
1243 -296, -296, 371, -296, -296, -296, -296, -296, -296, 25,
1244 -296, -296, -296, -296, 352, 241, -296, -296, -296, 350,
1245 -296, -296, -296, -296, -296, -296, 403, 196, -296, -296,
1246 -296, -296, -296, -296, 361, 362, -296, 364, 369, -296,
1247 42, -296, -296, -296, -296, 22, 188, -296, -296, -296,
1248 -296, -296, -296, -296, -296, 354, 357, 202, -296, 280,
1249 388, -296, -296, 370, 373, -296, -296, -296, -296, 16,
1250 282, 403, 367, -296, -296, 348, -296, -296, -296, 403,
1251 -296, 403, 77, -296, -296, -296, -296, -296, 448, 367,
1252 403, -296, 57, 207, -296, -296, -296, -296, -296, -296,
1253 -296, -296, -296, 57, 36, -296, -296, -296, 39, -296,
1257 /* YYPGOTO[NTERM-NUM]. */
1258 static const yytype_int16 yypgoto[] =
1260 -296, -296, 461, 326, -296, -296, 376, -296, 447, -296,
1261 -296, 441, -296, -296, -296, 399, -296, -296, -296, -296,
1262 -296, -296, 428, -296, 395, -296, -296, -296, 434, 355,
1263 -296, -106, -296, -296, 321, -296, 99, 322, 48, 115,
1264 -296, 128, 287, -296, -296, 163, -296, -296, -296, 3,
1265 -196, -172, -82, -296, -296, 422, -177, -296, -104, 157,
1266 -296, 358, -296, 168, -164, 310, 313, -296, -140, -296,
1267 -191, -188, -296, 52, -296, -76, -296, -296, -24, -296,
1268 -296, -296, -227, 380, -150, -296, -296, -296, 360, -237,
1269 -296, 179, 182, -258, -296, -296, 205, -296, -296, -296,
1270 -296, 175, -296, -296, -296, -296, -296, -296, -296, 47,
1271 55, -296, -296, -296, -296, -296, -296, -296, -296, -296,
1272 -296, -296, 54, 60, -220, -296, -296, 177, -296, 164,
1273 -296, 107, -296, -296, 171, -160, -296, -87, -296, -296,
1274 -296, -296, 11, 232, -12, -296, -295
1277 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1278 positive, shift that token. If negative, reduce the rule which
1279 number is the opposite. If zero, do what YYDEFACT says.
1280 If YYTABLE_NINF, syntax error. */
1281 #define YYTABLE_NINF -300
1282 static const yytype_int16 yytable[] =
1284 20, 154, 193, 193, 107, 107, 20, 349, 280, 322,
1285 110, 7, 323, 279, 7, 107, 7, 268, 350, 7,
1286 117, 497, 102, 15, 213, 15, 287, 134, 450, 1,
1287 2, 53, 90, 15, 115, 15, 15, 48, 328, 293,
1288 15, 9, 511, 69, 92, 511, 326, 327, 53, 316,
1289 12, 328, 69, 15, 52, 264, 265, 512, 264, 265,
1290 512, 90, 294, 511, 15, 16, 68, 91, 1, 2,
1291 24, 52, 15, 92, 329, 68, 264, 265, 512, 385,
1292 294, 15, 16, 15, 416, 21, 69, 329, 343, 1,
1293 2, 33, 360, -255, 154, 138, 91, 34, 134, 294,
1294 505, 427, 326, 327, 97, 375, 361, -255, 111, 68,
1295 404, 406, 407, 345, 137, 15, 410, 411, 104, 15,
1296 204, 205, 35, 386, 469, 328, 62, 173, 270, 49,
1297 36, 174, 103, 405, 384, 276, 466, 107, 107, 104,
1298 276, 107, 330, 335, 104, 481, 341, 442, 104, 104,
1299 519, 139, 107, 276, 506, 3, 513, 344, 507, 513,
1300 521, 329, 104, 231, 233, 140, 452, 17, 98, 161,
1301 273, 37, 276, 282, 288, -84, 292, 513, 300, 38,
1302 162, 104, 438, 300, 22, 137, 230, 232, 403, 464,
1303 444, 263, 269, 447, 469, 280, 469, 417, -299, 268,
1304 279, 189, -299, 39, 104, 449, 322, 15, 473, 323,
1305 439, 41, 338, 1, 2, 107, 339, 287, 445, 283,
1306 388, 448, 25, 189, 15, 54, 190, 42, 191, 346,
1307 1, 2, 26, 494, 1, 2, 55, 201, 202, 203,
1308 15, 204, 205, 206, 207, 208, 235, 236, 195, 474,
1309 191, 58, 364, 27, 237, 28, 365, 59, 60, 15,
1310 204, 205, 366, 369, 29, 1, 2, 154, 301, 302,
1311 201, 202, 203, 15, 204, 205, 206, 207, 208, 1,
1312 2, 371, 209, 238, 379, 372, 396, 94, 380, 398,
1313 397, 154, 239, 15, -26, 435, 61, 43, 240, 436,
1314 210, 393, 484, 393, 95, 458, 485, 241, 459, 224,
1315 225, 100, 401, 402, 389, 209, 490, 189, 520, 493,
1316 491, 517, 520, 211, 99, 491, 1, 2, 264, 265,
1317 430, 10, 242, 210, 10, 143, 144, 347, 348, 104,
1318 243, 113, 303, 142, 244, 353, 354, 356, 357, 264,
1319 265, 462, 463, 273, 486, 487, 211, 194, 194, 164,
1320 282, 168, 167, 169, 170, 288, 171, 172, 292, 175,
1321 176, 177, 300, 178, 182, 212, 201, 202, 203, 15,
1322 204, 205, 206, 207, 208, 235, 236, 180, 181, 183,
1323 184, 187, 185, 237, 186, 191, 201, 202, 203, 15,
1324 204, 205, 206, 207, 208, 235, 236, 188, 200, 228,
1325 234, 274, 275, 237, 15, 313, 342, 315, 351, 325,
1326 352, 209, 238, 378, 369, 359, 363, 370, 376, 382,
1327 377, 239, 381, 383, 384, 387, 391, 240, 300, 210,
1328 390, 209, 238, 483, -177, 394, 241, 408, 412, 419,
1329 423, 239, 428, 424, 429, 461, 189, 240, 437, 210,
1330 453, 465, 211, 454, 8, 23, 241, 488, 401, 483,
1331 470, 242, 40, 455, 471, 489, 189, 475, 476, 243,
1332 477, 212, 211, 244, 101, 478, 495, 165, 510, 496,
1333 500, 242, 96, 112, 93, 229, 460, 179, 479, 451,
1334 440, 212, 415, 244, 201, 202, 203, 15, 204, 205,
1335 206, 207, 208, 235, 236, 340, 518, 314, 201, 202,
1336 203, 15, 204, 205, 206, 207, 208, 1, 2, 155,
1337 441, 433, 498, 196, 425, 336, 503, 432, 337, 501,
1338 426, 499, 434, 472, 446, 289, 504, 395, 443, 209,
1339 238, 306, 0, 0, 0, 0, 0, 0, 0, 239,
1340 0, 0, 0, 209, 0, 240, 0, 210, 0, 0,
1341 0, 0, 0, 0, 241, 0, 0, 0, 0, 0,
1342 0, 210, 0, 0, 189, 0, 0, 0, 0, 0,
1343 211, 0, 0, 0, 0, 0, 0, 0, 0, 242,
1344 0, 0, 0, 0, 211, 0, 0, 0, 0, 212,
1345 0, 244, 201, 202, 203, 15, 204, 205, 206, 207,
1346 208, 235, 236, 212, 0, 0, 145, 0, 0, 0,
1347 146, 0, 0, 0, 147, 70, 119, 0, 120, 148,
1348 0, 0, 0, 0, 0, 0, 0, 0, 121, 0,
1349 0, 0, 149, 0, 0, 0, 123, 209, 0, 124,
1350 72, 73, 74, 0, 0, 0, 0, 0, 150, 0,
1351 151, 75, 0, 0, 15, 317, 76, 127, 77, 128,
1352 1, 2, 0, 0, 0, 0, 78, 0, 129, 130,
1353 152, 153, 0, 0, 70, 79, 0, 80, 211, 0,
1354 0, 0, 81, 131, 82, 83, 84, 0, 0, 71,
1355 0, 0, 0, 0, 0, 0, 0, 178, 0, 72,
1356 73, 74, 0, 0, 0, 0, 0, 0, 0, 0,
1357 75, 0, 0, 0, 0, 76, 0, 77, 0, 0,
1358 0, 0, 0, 0, 0, 78, 0, 0, 0, 0,
1359 0, 0, 0, 0, 79, 0, 80, 143, 144, 0,
1360 0, 81, 145, 82, 83, 84, 146, 0, 0, 0,
1361 147, 70, 119, 0, 120, 148, 0, 0, 0, 0,
1362 0, 0, 0, 0, 121, 0, 0, 0, 149, 0,
1363 0, 0, 123, 0, 0, 124, 72, 73, 74, 0,
1364 0, 0, 0, 0, 150, 0, 151, 75, 0, 0,
1365 0, 126, 76, 127, 77, 128, 0, 0, 0, 0,
1366 0, 0, 78, 0, 129, 130, 152, 153, 0, 0,
1367 0, 79, 0, 80, 1, 2, 0, 0, 81, 131,
1368 82, 83, 84, 0, 0, 0, 0, 118, 70, 119,
1369 0, 120, 0, 0, 0, 0, 0, 0, 0, 0,
1370 0, 121, 0, 0, 0, 122, 0, 0, 0, 123,
1371 0, 0, 124, 72, 73, 74, 0, 0, 0, 0,
1372 0, 0, 0, 125, 75, 0, 0, 0, 126, 76,
1373 127, 77, 128, 0, 0, 0, 0, 0, 0, 78,
1374 0, 129, 130, 0, 0, 0, 0, 0, 79, 0,
1375 80, 0, 0, 0, 0, 81, 131, 82, 83, 84
1378 static const yytype_int16 yycheck[] =
1380 12, 107, 152, 153, 91, 92, 18, 244, 185, 200,
1381 92, 0, 200, 185, 3, 102, 5, 181, 245, 8,
1382 102, 5, 3, 11, 164, 11, 186, 103, 4, 17,
1383 18, 43, 56, 11, 36, 11, 11, 25, 41, 189,
1384 11, 0, 6, 55, 56, 6, 18, 19, 60, 199,
1385 113, 41, 64, 11, 43, 19, 20, 21, 19, 20,
1386 21, 85, 38, 6, 11, 12, 55, 56, 17, 18,
1387 115, 60, 11, 85, 77, 64, 19, 20, 21, 299,
1388 38, 11, 12, 11, 342, 42, 98, 77, 238, 17,
1389 18, 12, 110, 110, 200, 27, 85, 65, 174, 38,
1390 23, 359, 18, 19, 54, 282, 124, 124, 97, 98,
1391 330, 331, 332, 9, 103, 11, 336, 337, 120, 11,
1392 12, 13, 92, 300, 419, 41, 54, 114, 114, 117,
1393 92, 118, 113, 123, 118, 111, 111, 224, 225, 120,
1394 111, 228, 224, 225, 120, 123, 228, 374, 120, 120,
1395 114, 83, 239, 111, 77, 104, 120, 239, 81, 120,
1396 121, 77, 120, 175, 176, 97, 386, 114, 118, 49,
1397 182, 61, 111, 185, 186, 114, 188, 120, 190, 92,
1398 60, 120, 370, 195, 114, 174, 175, 176, 328, 409,
1399 378, 180, 181, 381, 489, 372, 491, 347, 114, 363,
1400 372, 88, 118, 3, 120, 382, 397, 11, 12, 397,
1401 370, 116, 114, 17, 18, 302, 118, 377, 378, 111,
1402 302, 381, 18, 88, 11, 47, 113, 29, 115, 241,
1403 17, 18, 28, 470, 17, 18, 62, 8, 9, 10,
1404 11, 12, 13, 14, 15, 16, 17, 18, 113, 437,
1405 115, 117, 114, 49, 25, 51, 118, 117, 118, 11,
1406 12, 13, 274, 275, 60, 17, 18, 373, 39, 40,
1407 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1408 18, 114, 53, 54, 114, 118, 114, 114, 118, 7,
1409 118, 397, 63, 11, 47, 114, 113, 50, 69, 118,
1410 71, 313, 114, 315, 117, 392, 118, 78, 395, 19,
1411 20, 18, 324, 325, 303, 53, 114, 88, 514, 469,
1412 118, 114, 518, 94, 113, 118, 17, 18, 19, 20,
1413 68, 5, 103, 71, 8, 17, 18, 37, 38, 120,
1414 111, 114, 113, 3, 115, 108, 109, 106, 107, 19,
1415 20, 19, 20, 365, 458, 459, 94, 152, 153, 3,
1416 372, 89, 113, 89, 79, 377, 59, 89, 380, 119,
1417 119, 12, 384, 113, 113, 113, 8, 9, 10, 11,
1418 12, 13, 14, 15, 16, 17, 18, 123, 123, 43,
1419 89, 76, 113, 25, 113, 115, 8, 9, 10, 11,
1420 12, 13, 14, 15, 16, 17, 18, 113, 113, 3,
1421 121, 33, 113, 25, 11, 76, 105, 76, 114, 123,
1422 118, 53, 54, 115, 436, 105, 123, 122, 114, 76,
1423 118, 63, 115, 114, 118, 33, 113, 69, 450, 71,
1424 116, 53, 54, 455, 115, 114, 78, 96, 103, 113,
1425 116, 63, 124, 111, 110, 7, 88, 69, 115, 71,
1426 113, 90, 94, 114, 3, 18, 78, 113, 480, 481,
1427 118, 103, 31, 125, 124, 118, 88, 116, 116, 111,
1428 116, 113, 94, 115, 85, 116, 116, 111, 500, 116,
1429 123, 103, 64, 98, 60, 174, 397, 142, 450, 384,
1430 372, 113, 339, 115, 8, 9, 10, 11, 12, 13,
1431 14, 15, 16, 17, 18, 228, 513, 195, 8, 9,
1432 10, 11, 12, 13, 14, 15, 16, 17, 18, 107,
1433 373, 363, 480, 153, 355, 225, 489, 362, 225, 485,
1434 358, 481, 365, 436, 380, 187, 491, 315, 377, 53,
1435 54, 191, -1, -1, -1, -1, -1, -1, -1, 63,
1436 -1, -1, -1, 53, -1, 69, -1, 71, -1, -1,
1437 -1, -1, -1, -1, 78, -1, -1, -1, -1, -1,
1438 -1, 71, -1, -1, 88, -1, -1, -1, -1, -1,
1439 94, -1, -1, -1, -1, -1, -1, -1, -1, 103,
1440 -1, -1, -1, -1, 94, -1, -1, -1, -1, 113,
1441 -1, 115, 8, 9, 10, 11, 12, 13, 14, 15,
1442 16, 17, 18, 113, -1, -1, 22, -1, -1, -1,
1443 26, -1, -1, -1, 30, 31, 32, -1, 34, 35,
1444 -1, -1, -1, -1, -1, -1, -1, -1, 44, -1,
1445 -1, -1, 48, -1, -1, -1, 52, 53, -1, 55,
1446 56, 57, 58, -1, -1, -1, -1, -1, 64, -1,
1447 66, 67, -1, -1, 11, 71, 72, 73, 74, 75,
1448 17, 18, -1, -1, -1, -1, 82, -1, 84, 85,
1449 86, 87, -1, -1, 31, 91, -1, 93, 94, -1,
1450 -1, -1, 98, 99, 100, 101, 102, -1, -1, 46,
1451 -1, -1, -1, -1, -1, -1, -1, 113, -1, 56,
1452 57, 58, -1, -1, -1, -1, -1, -1, -1, -1,
1453 67, -1, -1, -1, -1, 72, -1, 74, -1, -1,
1454 -1, -1, -1, -1, -1, 82, -1, -1, -1, -1,
1455 -1, -1, -1, -1, 91, -1, 93, 17, 18, -1,
1456 -1, 98, 22, 100, 101, 102, 26, -1, -1, -1,
1457 30, 31, 32, -1, 34, 35, -1, -1, -1, -1,
1458 -1, -1, -1, -1, 44, -1, -1, -1, 48, -1,
1459 -1, -1, 52, -1, -1, 55, 56, 57, 58, -1,
1460 -1, -1, -1, -1, 64, -1, 66, 67, -1, -1,
1461 -1, 71, 72, 73, 74, 75, -1, -1, -1, -1,
1462 -1, -1, 82, -1, 84, 85, 86, 87, -1, -1,
1463 -1, 91, -1, 93, 17, 18, -1, -1, 98, 99,
1464 100, 101, 102, -1, -1, -1, -1, 30, 31, 32,
1465 -1, 34, -1, -1, -1, -1, -1, -1, -1, -1,
1466 -1, 44, -1, -1, -1, 48, -1, -1, -1, 52,
1467 -1, -1, 55, 56, 57, 58, -1, -1, -1, -1,
1468 -1, -1, -1, 66, 67, -1, -1, -1, 71, 72,
1469 73, 74, 75, -1, -1, -1, -1, -1, -1, 82,
1470 -1, 84, 85, -1, -1, -1, -1, -1, 91, -1,
1471 93, -1, -1, -1, -1, 98, 99, 100, 101, 102
1474 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1475 symbol of state STATE-NUM. */
1476 static const yytype_uint16 yystos[] =
1478 0, 17, 18, 104, 127, 128, 129, 268, 128, 0,
1479 129, 130, 113, 131, 132, 11, 12, 114, 133, 134,
1480 270, 42, 114, 134, 115, 18, 28, 49, 51, 60,
1481 135, 136, 137, 12, 65, 92, 92, 61, 92, 3,
1482 137, 116, 29, 50, 138, 139, 151, 152, 25, 117,
1483 153, 154, 268, 270, 47, 62, 143, 144, 117, 117,
1484 118, 113, 54, 145, 146, 148, 149, 150, 268, 270,
1485 31, 46, 56, 57, 58, 67, 72, 74, 82, 91,
1486 93, 98, 100, 101, 102, 140, 141, 156, 158, 193,
1487 204, 268, 270, 154, 114, 117, 148, 54, 118, 113,
1488 18, 141, 3, 113, 120, 178, 179, 263, 264, 265,
1489 178, 268, 150, 114, 142, 36, 168, 178, 30, 32,
1490 34, 44, 48, 52, 55, 66, 71, 73, 75, 84,
1491 85, 99, 159, 160, 201, 202, 204, 268, 27, 83,
1492 97, 266, 3, 17, 18, 22, 26, 30, 35, 48,
1493 64, 66, 86, 87, 157, 181, 185, 186, 187, 201,
1494 203, 49, 60, 267, 3, 132, 147, 113, 89, 89,
1495 79, 59, 89, 114, 118, 119, 119, 12, 113, 155,
1496 123, 123, 113, 43, 89, 113, 113, 76, 113, 88,
1497 113, 115, 209, 210, 222, 113, 209, 208, 210, 211,
1498 113, 8, 9, 10, 12, 13, 14, 15, 16, 53,
1499 71, 94, 113, 194, 196, 197, 198, 228, 261, 262,
1500 268, 270, 271, 272, 19, 20, 170, 171, 3, 160,
1501 268, 270, 268, 270, 121, 17, 18, 25, 54, 63,
1502 69, 78, 103, 111, 115, 157, 180, 194, 214, 215,
1503 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
1504 227, 229, 230, 268, 19, 20, 188, 189, 190, 268,
1505 114, 252, 253, 270, 33, 113, 111, 166, 167, 177,
1506 182, 263, 270, 111, 258, 259, 260, 261, 270, 187,
1507 254, 255, 270, 210, 38, 163, 164, 165, 177, 182,
1508 270, 39, 40, 113, 212, 213, 214, 239, 240, 242,
1509 244, 245, 246, 76, 163, 76, 210, 71, 155, 161,
1510 162, 181, 196, 197, 195, 123, 18, 19, 41, 77,
1511 178, 191, 192, 250, 251, 178, 191, 192, 114, 118,
1512 168, 178, 105, 210, 178, 9, 270, 37, 38, 215,
1513 208, 114, 118, 108, 109, 205, 106, 107, 206, 105,
1514 110, 124, 243, 123, 114, 118, 270, 256, 257, 270,
1515 122, 114, 118, 183, 184, 182, 114, 118, 115, 114,
1516 118, 115, 76, 114, 118, 250, 182, 33, 178, 268,
1517 116, 113, 269, 270, 114, 269, 114, 118, 7, 199,
1518 200, 270, 270, 194, 250, 123, 250, 250, 96, 169,
1519 250, 250, 103, 172, 173, 171, 219, 210, 231, 113,
1520 232, 233, 234, 116, 111, 217, 218, 219, 124, 110,
1521 68, 226, 227, 189, 253, 114, 118, 115, 197, 261,
1522 167, 185, 208, 260, 197, 261, 255, 197, 261, 182,
1523 4, 165, 250, 113, 114, 125, 247, 248, 263, 263,
1524 162, 7, 19, 20, 250, 90, 111, 235, 236, 272,
1525 118, 124, 257, 12, 197, 116, 116, 116, 116, 164,
1526 241, 123, 249, 270, 114, 118, 184, 184, 113, 118,
1527 114, 118, 207, 210, 215, 116, 116, 5, 199, 249,
1528 123, 248, 174, 235, 236, 23, 77, 81, 237, 238,
1529 270, 6, 21, 120, 175, 176, 190, 114, 175, 114,
1533 #define yyerrok (yyerrstatus = 0)
1534 #define yyclearin (yychar = YYEMPTY)
1535 #define YYEMPTY (-2)
1538 #define YYACCEPT goto yyacceptlab
1539 #define YYABORT goto yyabortlab
1540 #define YYERROR goto yyerrorlab
1543 /* Like YYERROR except do call yyerror. This remains here temporarily
1544 to ease the transition to the new meaning of YYERROR, for GCC.
1545 Once GCC version 2 has supplanted version 1, this can go. */
1547 #define YYFAIL goto yyerrlab
1549 #define YYRECOVERING() (!!yyerrstatus)
1551 #define YYBACKUP(Token, Value) \
1553 if (yychar == YYEMPTY && yylen == 1) \
1557 yytoken = YYTRANSLATE (yychar); \
1563 yyerror (YY_("syntax error: cannot back up")); \
1570 #define YYERRCODE 256
1573 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1574 If N is 0, then set CURRENT to the empty location which ends
1575 the previous symbol: RHS[0] (always defined). */
1577 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1578 #ifndef YYLLOC_DEFAULT
1579 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1583 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1584 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1585 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1586 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1590 (Current).first_line = (Current).last_line = \
1591 YYRHSLOC (Rhs, 0).last_line; \
1592 (Current).first_column = (Current).last_column = \
1593 YYRHSLOC (Rhs, 0).last_column; \
1599 /* YY_LOCATION_PRINT -- Print the location on the stream.
1600 This macro was not mandated originally: define only if we know
1601 we won't break user code: when these are the locations we know. */
1603 #ifndef YY_LOCATION_PRINT
1604 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1605 # define YY_LOCATION_PRINT(File, Loc) \
1606 fprintf (File, "%d.%d-%d.%d", \
1607 (Loc).first_line, (Loc).first_column, \
1608 (Loc).last_line, (Loc).last_column)
1610 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1615 /* YYLEX -- calling `yylex' with the right arguments. */
1618 # define YYLEX yylex (YYLEX_PARAM)
1620 # define YYLEX yylex ()
1623 /* Enable debugging if requested. */
1627 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1628 # define YYFPRINTF fprintf
1631 # define YYDPRINTF(Args) \
1637 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1641 YYFPRINTF (stderr, "%s ", Title); \
1642 yy_symbol_print (stderr, \
1644 YYFPRINTF (stderr, "\n"); \
1649 /*--------------------------------.
1650 | Print this symbol on YYOUTPUT. |
1651 `--------------------------------*/
1654 #if (defined __STDC__ || defined __C99__FUNC__ \
1655 || defined __cplusplus || defined _MSC_VER)
1657 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1660 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1663 YYSTYPE const * const yyvaluep;
1669 if (yytype < YYNTOKENS)
1670 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1682 /*--------------------------------.
1683 | Print this symbol on YYOUTPUT. |
1684 `--------------------------------*/
1686 #if (defined __STDC__ || defined __C99__FUNC__ \
1687 || defined __cplusplus || defined _MSC_VER)
1689 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1692 yy_symbol_print (yyoutput, yytype, yyvaluep)
1695 YYSTYPE const * const yyvaluep;
1698 if (yytype < YYNTOKENS)
1699 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1701 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1703 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1704 YYFPRINTF (yyoutput, ")");
1707 /*------------------------------------------------------------------.
1708 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1710 `------------------------------------------------------------------*/
1712 #if (defined __STDC__ || defined __C99__FUNC__ \
1713 || defined __cplusplus || defined _MSC_VER)
1715 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1718 yy_stack_print (bottom, top)
1719 yytype_int16 *bottom;
1723 YYFPRINTF (stderr, "Stack now");
1724 for (; bottom <= top; ++bottom)
1725 YYFPRINTF (stderr, " %d", *bottom);
1726 YYFPRINTF (stderr, "\n");
1729 # define YY_STACK_PRINT(Bottom, Top) \
1732 yy_stack_print ((Bottom), (Top)); \
1736 /*------------------------------------------------.
1737 | Report that the YYRULE is going to be reduced. |
1738 `------------------------------------------------*/
1740 #if (defined __STDC__ || defined __C99__FUNC__ \
1741 || defined __cplusplus || defined _MSC_VER)
1743 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1746 yy_reduce_print (yyvsp, yyrule)
1751 int yynrhs = yyr2[yyrule];
1753 unsigned long int yylno = yyrline[yyrule];
1754 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1756 /* The symbols being reduced. */
1757 for (yyi = 0; yyi < yynrhs; yyi++)
1759 fprintf (stderr, " $%d = ", yyi + 1);
1760 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1761 &(yyvsp[(yyi + 1) - (yynrhs)])
1763 fprintf (stderr, "\n");
1767 # define YY_REDUCE_PRINT(Rule) \
1770 yy_reduce_print (yyvsp, Rule); \
1773 /* Nonzero means print parse trace. It is left uninitialized so that
1774 multiple parsers can coexist. */
1776 #else /* !YYDEBUG */
1777 # define YYDPRINTF(Args)
1778 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1779 # define YY_STACK_PRINT(Bottom, Top)
1780 # define YY_REDUCE_PRINT(Rule)
1781 #endif /* !YYDEBUG */
1784 /* YYINITDEPTH -- initial size of the parser's stacks. */
1786 # define YYINITDEPTH 200
1789 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1790 if the built-in stack extension method is used).
1792 Do not make this value too large; the results are undefined if
1793 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1794 evaluated with infinite-precision integer arithmetic. */
1797 # define YYMAXDEPTH 10000
1805 # if defined __GLIBC__ && defined _STRING_H
1806 # define yystrlen strlen
1808 /* Return the length of YYSTR. */
1809 #if (defined __STDC__ || defined __C99__FUNC__ \
1810 || defined __cplusplus || defined _MSC_VER)
1812 yystrlen (const char *yystr)
1820 for (yylen = 0; yystr[yylen]; yylen++)
1828 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1829 # define yystpcpy stpcpy
1831 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1833 #if (defined __STDC__ || defined __C99__FUNC__ \
1834 || defined __cplusplus || defined _MSC_VER)
1836 yystpcpy (char *yydest, const char *yysrc)
1839 yystpcpy (yydest, yysrc)
1845 const char *yys = yysrc;
1847 while ((*yyd++ = *yys++) != '\0')
1856 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1857 quotes and backslashes, so that it's suitable for yyerror. The
1858 heuristic is that double-quoting is unnecessary unless the string
1859 contains an apostrophe, a comma, or backslash (other than
1860 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1861 null, do not copy; instead, return the length of what the result
1864 yytnamerr (char *yyres, const char *yystr)
1869 char const *yyp = yystr;
1876 goto do_not_strip_quotes;
1880 goto do_not_strip_quotes;
1893 do_not_strip_quotes: ;
1897 return yystrlen (yystr);
1899 return yystpcpy (yyres, yystr) - yyres;
1903 /* Copy into YYRESULT an error message about the unexpected token
1904 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1905 including the terminating null byte. If YYRESULT is null, do not
1906 copy anything; just return the number of bytes that would be
1907 copied. As a special case, return 0 if an ordinary "syntax error"
1908 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1909 size calculation. */
1911 yysyntax_error (char *yyresult, int yystate, int yychar)
1913 int yyn = yypact[yystate];
1915 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1919 int yytype = YYTRANSLATE (yychar);
1920 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1921 YYSIZE_T yysize = yysize0;
1923 int yysize_overflow = 0;
1924 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1925 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1929 /* This is so xgettext sees the translatable formats that are
1930 constructed on the fly. */
1931 YY_("syntax error, unexpected %s");
1932 YY_("syntax error, unexpected %s, expecting %s");
1933 YY_("syntax error, unexpected %s, expecting %s or %s");
1934 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1935 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1939 static char const yyunexpected[] = "syntax error, unexpected %s";
1940 static char const yyexpecting[] = ", expecting %s";
1941 static char const yyor[] = " or %s";
1942 char yyformat[sizeof yyunexpected
1943 + sizeof yyexpecting - 1
1944 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1945 * (sizeof yyor - 1))];
1946 char const *yyprefix = yyexpecting;
1948 /* Start YYX at -YYN if negative to avoid negative indexes in
1950 int yyxbegin = yyn < 0 ? -yyn : 0;
1952 /* Stay within bounds of both yycheck and yytname. */
1953 int yychecklim = YYLAST - yyn + 1;
1954 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1957 yyarg[0] = yytname[yytype];
1958 yyfmt = yystpcpy (yyformat, yyunexpected);
1960 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1961 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1963 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1967 yyformat[sizeof yyunexpected - 1] = '\0';
1970 yyarg[yycount++] = yytname[yyx];
1971 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1972 yysize_overflow |= (yysize1 < yysize);
1974 yyfmt = yystpcpy (yyfmt, yyprefix);
1978 yyf = YY_(yyformat);
1979 yysize1 = yysize + yystrlen (yyf);
1980 yysize_overflow |= (yysize1 < yysize);
1983 if (yysize_overflow)
1984 return YYSIZE_MAXIMUM;
1988 /* Avoid sprintf, as that infringes on the user's name space.
1989 Don't have undefined behavior even if the translation
1990 produced a string with the wrong number of "%s"s. */
1991 char *yyp = yyresult;
1993 while ((*yyp = *yyf) != '\0')
1995 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1997 yyp += yytnamerr (yyp, yyarg[yyi++]);
2010 #endif /* YYERROR_VERBOSE */
2013 /*-----------------------------------------------.
2014 | Release the memory associated to this symbol. |
2015 `-----------------------------------------------*/
2018 #if (defined __STDC__ || defined __C99__FUNC__ \
2019 || defined __cplusplus || defined _MSC_VER)
2021 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2024 yydestruct (yymsg, yytype, yyvaluep)
2034 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2045 /* Prevent warnings from -Wmissing-prototypes. */
2047 #ifdef YYPARSE_PARAM
2048 #if defined __STDC__ || defined __cplusplus
2049 int yyparse (void *YYPARSE_PARAM);
2053 #else /* ! YYPARSE_PARAM */
2054 #if defined __STDC__ || defined __cplusplus
2059 #endif /* ! YYPARSE_PARAM */
2063 /* The look-ahead symbol. */
2066 /* The semantic value of the look-ahead symbol. */
2069 /* Number of syntax errors so far. */
2078 #ifdef YYPARSE_PARAM
2079 #if (defined __STDC__ || defined __C99__FUNC__ \
2080 || defined __cplusplus || defined _MSC_VER)
2082 yyparse (void *YYPARSE_PARAM)
2085 yyparse (YYPARSE_PARAM)
2086 void *YYPARSE_PARAM;
2088 #else /* ! YYPARSE_PARAM */
2089 #if (defined __STDC__ || defined __C99__FUNC__ \
2090 || defined __cplusplus || defined _MSC_VER)
2104 /* Number of tokens to shift before error messages enabled. */
2106 /* Look-ahead token as an internal (translated) token number. */
2109 /* Buffer for error messages, and its allocated size. */
2111 char *yymsg = yymsgbuf;
2112 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2115 /* Three stacks and their tools:
2116 `yyss': related to states,
2117 `yyvs': related to semantic values,
2118 `yyls': related to locations.
2120 Refer to the stacks thru separate pointers, to allow yyoverflow
2121 to reallocate them elsewhere. */
2123 /* The state stack. */
2124 yytype_int16 yyssa[YYINITDEPTH];
2125 yytype_int16 *yyss = yyssa;
2126 yytype_int16 *yyssp;
2128 /* The semantic value stack. */
2129 YYSTYPE yyvsa[YYINITDEPTH];
2130 YYSTYPE *yyvs = yyvsa;
2135 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2137 YYSIZE_T yystacksize = YYINITDEPTH;
2139 /* The variables used to return semantic value and location from the
2144 /* The number of symbols on the RHS of the reduced rule.
2145 Keep to zero when no symbol should be popped. */
2148 YYDPRINTF ((stderr, "Starting parse\n"));
2153 yychar = YYEMPTY; /* Cause a token to be read. */
2155 /* Initialize stack pointers.
2156 Waste one element of value and location stack
2157 so that they stay on the same level as the state stack.
2158 The wasted elements are never initialized. */
2165 /*------------------------------------------------------------.
2166 | yynewstate -- Push a new state, which is found in yystate. |
2167 `------------------------------------------------------------*/
2169 /* In all cases, when you get here, the value and location stacks
2170 have just been pushed. So pushing a state here evens the stacks. */
2176 if (yyss + yystacksize - 1 <= yyssp)
2178 /* Get the current used size of the three stacks, in elements. */
2179 YYSIZE_T yysize = yyssp - yyss + 1;
2183 /* Give user a chance to reallocate the stack. Use copies of
2184 these so that the &'s don't force the real ones into
2186 YYSTYPE *yyvs1 = yyvs;
2187 yytype_int16 *yyss1 = yyss;
2190 /* Each stack pointer address is followed by the size of the
2191 data in use in that stack, in bytes. This used to be a
2192 conditional around just the two extra args, but that might
2193 be undefined if yyoverflow is a macro. */
2194 yyoverflow (YY_("memory exhausted"),
2195 &yyss1, yysize * sizeof (*yyssp),
2196 &yyvs1, yysize * sizeof (*yyvsp),
2203 #else /* no yyoverflow */
2204 # ifndef YYSTACK_RELOCATE
2205 goto yyexhaustedlab;
2207 /* Extend the stack our own way. */
2208 if (YYMAXDEPTH <= yystacksize)
2209 goto yyexhaustedlab;
2211 if (YYMAXDEPTH < yystacksize)
2212 yystacksize = YYMAXDEPTH;
2215 yytype_int16 *yyss1 = yyss;
2216 union yyalloc *yyptr =
2217 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2219 goto yyexhaustedlab;
2220 YYSTACK_RELOCATE (yyss);
2221 YYSTACK_RELOCATE (yyvs);
2223 # undef YYSTACK_RELOCATE
2225 YYSTACK_FREE (yyss1);
2228 #endif /* no yyoverflow */
2230 yyssp = yyss + yysize - 1;
2231 yyvsp = yyvs + yysize - 1;
2234 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2235 (unsigned long int) yystacksize));
2237 if (yyss + yystacksize - 1 <= yyssp)
2241 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2250 /* Do appropriate processing given the current state. Read a
2251 look-ahead token if we need one and don't already have one. */
2253 /* First try to decide what to do without reference to look-ahead token. */
2254 yyn = yypact[yystate];
2255 if (yyn == YYPACT_NINF)
2258 /* Not known => get a look-ahead token if don't already have one. */
2260 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2261 if (yychar == YYEMPTY)
2263 YYDPRINTF ((stderr, "Reading a token: "));
2267 if (yychar <= YYEOF)
2269 yychar = yytoken = YYEOF;
2270 YYDPRINTF ((stderr, "Now at end of input.\n"));
2274 yytoken = YYTRANSLATE (yychar);
2275 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2278 /* If the proper action on seeing token YYTOKEN is to reduce or to
2279 detect an error, take that action. */
2281 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2286 if (yyn == 0 || yyn == YYTABLE_NINF)
2295 /* Count tokens shifted since error; after three, turn off error
2300 /* Shift the look-ahead token. */
2301 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2303 /* Discard the shifted token unless it is eof. */
2304 if (yychar != YYEOF)
2313 /*-----------------------------------------------------------.
2314 | yydefault -- do the default action for the current state. |
2315 `-----------------------------------------------------------*/
2317 yyn = yydefact[yystate];
2323 /*-----------------------------.
2324 | yyreduce -- Do a reduction. |
2325 `-----------------------------*/
2327 /* yyn is the number of a rule to reduce with. */
2330 /* If YYLEN is nonzero, implement the default value of the action:
2333 Otherwise, the following line sets YYVAL to garbage.
2334 This behavior is undocumented and Bison
2335 users should not rely upon it. Assigning to YYVAL
2336 unconditionally makes the parser a bit smaller, and it avoids a
2337 GCC warning that YYVAL may be used uninitialized. */
2338 yyval = yyvsp[1-yylen];
2341 YY_REDUCE_PRINT (yyn);
2345 #line 414 "asn1p_y.y"
2347 *(void **)param = (yyvsp[(2) - (2)].a_grammar);
2352 #line 417 "asn1p_y.y"
2354 *(void **)param = (yyvsp[(1) - (1)].a_grammar);
2359 #line 423 "asn1p_y.y"
2361 (yyval.a_grammar) = asn1p_new();
2362 checkmem((yyval.a_grammar));
2363 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(1) - (1)].a_module), mod_next);
2368 #line 428 "asn1p_y.y"
2370 (yyval.a_grammar) = (yyvsp[(1) - (2)].a_grammar);
2371 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(2) - (2)].a_module), mod_next);
2376 #line 445 "asn1p_y.y"
2377 { currentModule = asn1p_module_new(); }
2381 #line 450 "asn1p_y.y"
2384 (yyval.a_module) = currentModule;
2386 if((yyvsp[(8) - (9)].a_module)) {
2387 asn1p_module_t tmp = *((yyval.a_module));
2388 *((yyval.a_module)) = *((yyvsp[(8) - (9)].a_module));
2389 *((yyvsp[(8) - (9)].a_module)) = tmp;
2390 asn1p_module_free((yyvsp[(8) - (9)].a_module));
2392 /* There's a chance that a module is just plain empty */
2395 (yyval.a_module)->ModuleName = (yyvsp[(1) - (9)].tv_str);
2396 (yyval.a_module)->module_oid = (yyvsp[(3) - (9)].a_oid);
2397 (yyval.a_module)->module_flags = (yyvsp[(5) - (9)].a_module_flags);
2402 #line 474 "asn1p_y.y"
2403 { (yyval.a_oid) = 0; }
2407 #line 475 "asn1p_y.y"
2408 { (yyval.a_oid) = (yyvsp[(1) - (1)].a_oid); }
2412 #line 479 "asn1p_y.y"
2414 (yyval.a_oid) = (yyvsp[(2) - (3)].a_oid);
2419 #line 482 "asn1p_y.y"
2426 #line 488 "asn1p_y.y"
2428 (yyval.a_oid) = asn1p_oid_new();
2429 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(1) - (1)].a_oid_arc));
2430 if((yyvsp[(1) - (1)].a_oid_arc).name)
2431 free((yyvsp[(1) - (1)].a_oid_arc).name);
2436 #line 494 "asn1p_y.y"
2438 (yyval.a_oid) = (yyvsp[(1) - (2)].a_oid);
2439 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(2) - (2)].a_oid_arc));
2440 if((yyvsp[(2) - (2)].a_oid_arc).name)
2441 free((yyvsp[(2) - (2)].a_oid_arc).name);
2446 #line 503 "asn1p_y.y"
2448 (yyval.a_oid_arc).name = (yyvsp[(1) - (1)].tv_str);
2449 (yyval.a_oid_arc).number = -1;
2454 #line 507 "asn1p_y.y"
2456 (yyval.a_oid_arc).name = (yyvsp[(1) - (4)].tv_str);
2457 (yyval.a_oid_arc).number = (yyvsp[(3) - (4)].a_int);
2462 #line 511 "asn1p_y.y"
2464 (yyval.a_oid_arc).name = 0;
2465 (yyval.a_oid_arc).number = (yyvsp[(1) - (1)].a_int);
2470 #line 521 "asn1p_y.y"
2471 { (yyval.a_module_flags) = MSF_NOFLAGS; }
2475 #line 522 "asn1p_y.y"
2477 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
2482 #line 531 "asn1p_y.y"
2484 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
2489 #line 534 "asn1p_y.y"
2491 (yyval.a_module_flags) = (yyvsp[(1) - (2)].a_module_flags) | (yyvsp[(2) - (2)].a_module_flags);
2496 #line 543 "asn1p_y.y"
2498 (yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
2503 #line 546 "asn1p_y.y"
2505 (yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
2510 #line 549 "asn1p_y.y"
2512 (yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
2517 #line 552 "asn1p_y.y"
2519 (yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
2524 #line 556 "asn1p_y.y"
2526 /* X.680Amd1 specifies TAG and XER */
2527 if(strcmp((yyvsp[(1) - (2)].tv_str), "TAG") == 0) {
2528 (yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
2529 } else if(strcmp((yyvsp[(1) - (2)].tv_str), "XER") == 0) {
2530 (yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
2533 "WARNING: %s INSTRUCTIONS at %s:%d: "
2534 "Unrecognized encoding reference\n",
2535 (yyvsp[(1) - (2)].tv_str), ASN_FILENAME, yylineno);
2536 (yyval.a_module_flags) = MSF_unk_INSTRUCTIONS;
2538 free((yyvsp[(1) - (2)].tv_str));
2543 #line 577 "asn1p_y.y"
2544 { (yyval.a_module) = 0; }
2548 #line 578 "asn1p_y.y"
2550 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
2555 #line 587 "asn1p_y.y"
2557 (yyval.a_module) = asn1p_module_new();
2558 AL_IMPORT((yyval.a_module), exports, (yyvsp[(1) - (3)].a_module), xp_next);
2559 AL_IMPORT((yyval.a_module), imports, (yyvsp[(2) - (3)].a_module), xp_next);
2560 asn1p_module_move_members((yyval.a_module), (yyvsp[(3) - (3)].a_module));
2562 asn1p_module_free((yyvsp[(1) - (3)].a_module));
2563 asn1p_module_free((yyvsp[(2) - (3)].a_module));
2564 asn1p_module_free((yyvsp[(3) - (3)].a_module));
2569 #line 600 "asn1p_y.y"
2571 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
2576 #line 603 "asn1p_y.y"
2578 if((yyvsp[(1) - (2)].a_module)) {
2579 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
2581 (yyval.a_module) = (yyvsp[(2) - (2)].a_module);
2584 asn1p_module_move_members((yyval.a_module), (yyvsp[(2) - (2)].a_module));
2585 asn1p_module_free((yyvsp[(2) - (2)].a_module));
2590 #line 620 "asn1p_y.y"
2592 (yyval.a_module) = asn1p_module_new();
2593 checkmem((yyval.a_module));
2594 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2595 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2596 asn1p_module_member_add((yyval.a_module), (yyvsp[(1) - (1)].a_expr));
2601 #line 627 "asn1p_y.y"
2603 (yyval.a_module) = asn1p_module_new();
2604 checkmem((yyval.a_module));
2605 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2606 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2607 asn1p_module_member_add((yyval.a_module), (yyvsp[(1) - (1)].a_expr));
2612 #line 641 "asn1p_y.y"
2614 (yyval.a_module) = asn1p_module_new();
2615 checkmem((yyval.a_module));
2616 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2617 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2618 asn1p_module_member_add((yyval.a_module), (yyvsp[(1) - (1)].a_expr));
2623 #line 649 "asn1p_y.y"
2624 { asn1p_lexer_hack_push_encoding_control(); }
2628 #line 650 "asn1p_y.y"
2631 "WARNING: ENCODING-CONTROL %s "
2632 "specification at %s:%d ignored\n",
2633 (yyvsp[(2) - (3)].tv_str), ASN_FILENAME, yylineno);
2634 free((yyvsp[(2) - (3)].tv_str));
2635 (yyval.a_module) = 0;
2640 #line 662 "asn1p_y.y"
2643 "Attempt to redefine a standard basic string type, "
2644 "please comment out or remove this type redefinition.");
2649 #line 675 "asn1p_y.y"
2650 { (yyval.a_module) = 0; }
2654 #line 679 "asn1p_y.y"
2657 return yyerror("Unterminated IMPORTS FROM, "
2658 "expected semicolon ';'");
2660 (yyval.a_module) = (yyvsp[(2) - (3)].a_module);
2665 #line 689 "asn1p_y.y"
2667 return yyerror("Empty IMPORTS list");
2672 #line 695 "asn1p_y.y"
2673 { (yyval.a_module) = asn1p_module_new(); }
2677 #line 699 "asn1p_y.y"
2679 (yyval.a_module) = asn1p_module_new();
2680 checkmem((yyval.a_module));
2681 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(1) - (1)].a_xports), xp_next);
2686 #line 704 "asn1p_y.y"
2688 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
2689 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(2) - (2)].a_xports), xp_next);
2694 #line 711 "asn1p_y.y"
2695 { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
2699 #line 712 "asn1p_y.y"
2700 { (yyval.a_aid).oid = (yyvsp[(1) - (1)].a_oid); }
2704 #line 716 "asn1p_y.y"
2706 (yyval.a_xports) = (yyvsp[(1) - (4)].a_xports);
2707 (yyval.a_xports)->fromModuleName = (yyvsp[(3) - (4)].tv_str);
2708 (yyval.a_xports)->identifier = (yyvsp[(4) - (4)].a_aid);
2709 /* This stupid thing is used for look-back hack. */
2710 saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
2711 checkmem((yyval.a_xports));
2716 #line 727 "asn1p_y.y"
2718 (yyval.a_xports) = asn1p_xports_new();
2719 checkmem((yyval.a_xports));
2720 TQ_ADD(&((yyval.a_xports)->xp_members), (yyvsp[(1) - (1)].a_expr), next);
2725 #line 732 "asn1p_y.y"
2727 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2728 TQ_ADD(&((yyval.a_xports)->xp_members), (yyvsp[(3) - (3)].a_expr), next);
2733 #line 739 "asn1p_y.y"
2735 (yyval.a_expr) = NEW_EXPR();
2736 checkmem((yyval.a_expr));
2737 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2738 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2743 #line 745 "asn1p_y.y"
2744 { /* Completely equivalent to above */
2745 (yyval.a_expr) = NEW_EXPR();
2746 checkmem((yyval.a_expr));
2747 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2748 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2753 #line 751 "asn1p_y.y"
2755 (yyval.a_expr) = NEW_EXPR();
2756 checkmem((yyval.a_expr));
2757 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2758 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2763 #line 761 "asn1p_y.y"
2764 { (yyval.a_module) = 0; }
2768 #line 762 "asn1p_y.y"
2770 (yyval.a_module) = asn1p_module_new();
2771 checkmem((yyval.a_module));
2772 if((yyvsp[(1) - (1)].a_xports)) {
2773 TQ_ADD(&((yyval.a_module)->exports), (yyvsp[(1) - (1)].a_xports), xp_next);
2775 /* "EXPORTS ALL;" */
2781 #line 774 "asn1p_y.y"
2783 (yyval.a_xports) = (yyvsp[(2) - (3)].a_xports);
2788 #line 777 "asn1p_y.y"
2790 (yyval.a_xports) = 0;
2795 #line 780 "asn1p_y.y"
2797 /* Empty EXPORTS clause effectively prohibits export. */
2798 (yyval.a_xports) = asn1p_xports_new();
2799 checkmem((yyval.a_xports));
2804 #line 788 "asn1p_y.y"
2806 (yyval.a_xports) = asn1p_xports_new();
2807 assert((yyval.a_xports));
2808 TQ_ADD(&((yyval.a_xports)->xp_members), (yyvsp[(1) - (1)].a_expr), next);
2813 #line 793 "asn1p_y.y"
2815 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2816 TQ_ADD(&((yyval.a_xports)->xp_members), (yyvsp[(3) - (3)].a_expr), next);
2821 #line 800 "asn1p_y.y"
2823 (yyval.a_expr) = NEW_EXPR();
2824 checkmem((yyval.a_expr));
2825 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2826 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2831 #line 806 "asn1p_y.y"
2833 (yyval.a_expr) = NEW_EXPR();
2834 checkmem((yyval.a_expr));
2835 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2836 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2841 #line 812 "asn1p_y.y"
2843 (yyval.a_expr) = NEW_EXPR();
2844 checkmem((yyval.a_expr));
2845 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2846 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2851 #line 821 "asn1p_y.y"
2852 { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
2856 #line 824 "asn1p_y.y"
2858 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
2859 assert((yyval.a_expr)->Identifier == 0);
2860 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
2861 (yyval.a_expr)->meta_type = AMT_VALUESET;
2862 (yyval.a_expr)->constraints = (yyvsp[(4) - (4)].a_constr);
2867 #line 844 "asn1p_y.y"
2869 (yyval.a_expr) = NEW_EXPR();
2870 checkmem((yyval.a_expr));
2871 (yyval.a_expr)->reference = (yyvsp[(1) - (1)].a_ref);
2872 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2873 (yyval.a_expr)->meta_type = AMT_TYPEREF;
2878 #line 854 "asn1p_y.y"
2880 (yyval.a_expr) = NEW_EXPR();
2881 checkmem((yyval.a_expr));
2882 (yyval.a_expr)->reference = (yyvsp[(1) - (4)].a_ref);
2883 (yyval.a_expr)->rhs_pspecs = (yyvsp[(3) - (4)].a_expr);
2884 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2885 (yyval.a_expr)->meta_type = AMT_TYPEREF;
2890 #line 874 "asn1p_y.y"
2892 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2893 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2894 assert((yyval.a_expr)->expr_type);
2895 assert((yyval.a_expr)->meta_type);
2900 #line 880 "asn1p_y.y"
2902 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2903 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2904 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
2905 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
2910 #line 896 "asn1p_y.y"
2912 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2913 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2914 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
2919 #line 902 "asn1p_y.y"
2921 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2922 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2923 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
2928 #line 910 "asn1p_y.y"
2931 (yyval.a_plist) = asn1p_paramlist_new(yylineno);
2932 checkmem((yyval.a_plist));
2933 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(1) - (1)].a_parg).governor, (yyvsp[(1) - (1)].a_parg).argument);
2935 asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor);
2936 free((yyvsp[(1) - (1)].a_parg).argument);
2941 #line 919 "asn1p_y.y"
2944 (yyval.a_plist) = (yyvsp[(1) - (3)].a_plist);
2945 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(3) - (3)].a_parg).governor, (yyvsp[(3) - (3)].a_parg).argument);
2947 asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor);
2948 free((yyvsp[(3) - (3)].a_parg).argument);
2953 #line 930 "asn1p_y.y"
2955 (yyval.a_parg).governor = NULL;
2956 (yyval.a_parg).argument = (yyvsp[(1) - (1)].tv_str);
2961 #line 934 "asn1p_y.y"
2964 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
2965 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
2967 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2968 free((yyvsp[(1) - (3)].tv_str));
2973 #line 942 "asn1p_y.y"
2976 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
2977 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
2979 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2980 free((yyvsp[(1) - (3)].tv_str));
2985 #line 950 "asn1p_y.y"
2988 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
2989 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2990 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
2992 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2997 #line 958 "asn1p_y.y"
3000 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
3001 ret = asn1p_ref_add_component((yyval.a_parg).governor,
3002 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
3004 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
3009 #line 969 "asn1p_y.y"
3011 (yyval.a_expr) = NEW_EXPR();
3012 checkmem((yyval.a_expr));
3013 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
3018 #line 974 "asn1p_y.y"
3020 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3021 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
3026 #line 982 "asn1p_y.y"
3028 (yyval.a_expr) = NEW_EXPR();
3029 checkmem((yyval.a_expr));
3030 (yyval.a_expr)->Identifier = strdup("?");
3031 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
3032 (yyval.a_expr)->meta_type = AMT_VALUE;
3033 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
3038 #line 990 "asn1p_y.y"
3040 (yyval.a_expr) = NEW_EXPR();
3041 checkmem((yyval.a_expr));
3042 (yyval.a_expr)->Identifier = strdup("?");
3043 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
3044 (yyval.a_expr)->meta_type = AMT_VALUE;
3045 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
3050 #line 998 "asn1p_y.y"
3052 (yyval.a_expr) = NEW_EXPR();
3053 (yyval.a_expr)->expr_type = A1TC_VALUESET;
3054 (yyval.a_expr)->meta_type = AMT_VALUESET;
3055 (yyval.a_expr)->constraints = (yyvsp[(1) - (1)].a_constr);
3060 #line 1021 "asn1p_y.y"
3061 { (yyval.a_expr) = NEW_EXPR(); }
3065 #line 1022 "asn1p_y.y"
3066 { (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr); }
3070 #line 1025 "asn1p_y.y"
3072 (yyval.a_expr) = NEW_EXPR();
3073 checkmem((yyval.a_expr));
3074 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
3079 #line 1030 "asn1p_y.y"
3081 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3082 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
3087 #line 1034 "asn1p_y.y"
3089 (yyval.a_expr) = (yyvsp[(1) - (5)].a_expr);
3090 (yyvsp[(4) - (5)].a_expr)->meta_type = AMT_TYPE;
3091 (yyvsp[(4) - (5)].a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
3092 (yyvsp[(4) - (5)].a_expr)->marker.flags |= EM_OPTIONAL;
3093 asn1p_expr_add((yyval.a_expr), (yyvsp[(4) - (5)].a_expr));
3098 #line 1042 "asn1p_y.y"
3100 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3101 assert((yyval.a_expr)->Identifier == 0);
3102 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3103 (yyvsp[(3) - (3)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3104 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3109 #line 1049 "asn1p_y.y"
3111 (yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
3112 (yyvsp[(2) - (2)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3113 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
3114 _fixup_anonymous_identifier((yyval.a_expr));
3119 #line 1055 "asn1p_y.y"
3121 (yyval.a_expr) = NEW_EXPR();
3122 checkmem((yyval.a_expr));
3123 (yyval.a_expr)->meta_type = (yyvsp[(3) - (3)].a_expr)->meta_type;
3124 (yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
3125 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
3130 #line 1062 "asn1p_y.y"
3132 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
3137 #line 1068 "asn1p_y.y"
3139 (yyval.a_expr) = NEW_EXPR();
3140 checkmem((yyval.a_expr));
3141 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
3146 #line 1073 "asn1p_y.y"
3148 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3149 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
3154 #line 1080 "asn1p_y.y"
3156 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3157 assert((yyval.a_expr)->Identifier == 0);
3158 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
3163 #line 1085 "asn1p_y.y"
3165 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
3170 #line 1088 "asn1p_y.y"
3172 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
3173 _fixup_anonymous_identifier((yyval.a_expr));
3178 #line 1095 "asn1p_y.y"
3180 (yyval.a_expr) = (yyvsp[(3) - (5)].a_expr);
3181 checkmem((yyval.a_expr));
3182 (yyval.a_expr)->with_syntax = (yyvsp[(5) - (5)].a_wsynt);
3183 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
3184 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
3189 #line 1105 "asn1p_y.y"
3190 { (yyval.a_int) = 0; }
3194 #line 1106 "asn1p_y.y"
3195 { (yyval.a_int) = 1; }
3199 #line 1110 "asn1p_y.y"
3201 (yyval.a_expr) = NEW_EXPR();
3202 checkmem((yyval.a_expr));
3203 (yyval.a_expr)->expr_type = A1TC_CLASSDEF;
3204 (yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
3205 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
3210 #line 1117 "asn1p_y.y"
3212 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3213 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
3218 #line 1127 "asn1p_y.y"
3220 (yyval.a_expr) = NEW_EXPR();
3221 checkmem((yyval.a_expr));
3222 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
3223 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3224 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
3225 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
3230 #line 1137 "asn1p_y.y"
3232 (yyval.a_expr) = NEW_EXPR();
3233 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3234 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3235 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
3236 (yyval.a_expr)->unique = (yyvsp[(3) - (4)].a_int);
3237 (yyval.a_expr)->marker = (yyvsp[(4) - (4)].a_marker);
3238 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (4)].a_expr));
3243 #line 1148 "asn1p_y.y"
3245 (yyval.a_expr) = NEW_EXPR();
3246 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3247 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3248 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
3249 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3250 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3255 #line 1158 "asn1p_y.y"
3257 (yyval.a_expr) = NEW_EXPR();
3258 checkmem((yyval.a_expr));
3259 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3260 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3261 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3262 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
3263 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3268 #line 1169 "asn1p_y.y"
3270 (yyval.a_expr) = NEW_EXPR();
3271 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3272 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3273 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
3274 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3275 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3280 #line 1179 "asn1p_y.y"
3282 (yyval.a_expr) = NEW_EXPR();
3283 checkmem((yyval.a_expr));
3284 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3285 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3286 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
3287 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (3)].a_expr));
3288 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3293 #line 1190 "asn1p_y.y"
3295 (yyval.a_expr) = NEW_EXPR();
3296 checkmem((yyval.a_expr));
3297 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3298 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3299 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3300 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
3301 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3306 #line 1202 "asn1p_y.y"
3307 { (yyval.a_wsynt) = 0; }
3311 #line 1203 "asn1p_y.y"
3313 (yyval.a_wsynt) = (yyvsp[(1) - (1)].a_wsynt);
3318 #line 1210 "asn1p_y.y"
3319 { asn1p_lexer_hack_enable_with_syntax(); }
3323 #line 1212 "asn1p_y.y"
3325 (yyval.a_wsynt) = (yyvsp[(5) - (6)].a_wsynt);
3330 #line 1218 "asn1p_y.y"
3332 (yyval.a_wsynt) = asn1p_wsyntx_new();
3333 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(1) - (1)].a_wchunk), next);
3338 #line 1222 "asn1p_y.y"
3340 (yyval.a_wsynt) = (yyvsp[(1) - (2)].a_wsynt);
3341 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(2) - (2)].a_wchunk), next);
3346 #line 1229 "asn1p_y.y"
3348 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_opaque).buf, 0);
3349 (yyval.a_wchunk)->type = WC_WHITESPACE;
3354 #line 1233 "asn1p_y.y"
3356 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_str), 0);
3361 #line 1236 "asn1p_y.y"
3363 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].a_refcomp).name, 0);
3364 (yyval.a_wchunk)->type = WC_FIELD;
3369 #line 1240 "asn1p_y.y"
3371 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[(2) - (3)].a_wsynt));
3376 #line 1246 "asn1p_y.y"
3378 (yyval.a_expr) = NEW_EXPR();
3379 checkmem((yyval.a_expr));
3380 (yyval.a_expr)->Identifier = strdup("...");
3381 checkmem((yyval.a_expr)->Identifier);
3382 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3383 (yyval.a_expr)->meta_type = AMT_TYPE;
3388 #line 1254 "asn1p_y.y"
3390 (yyval.a_expr) = NEW_EXPR();
3391 checkmem((yyval.a_expr));
3392 (yyval.a_expr)->Identifier = strdup("...");
3393 checkmem((yyval.a_expr)->Identifier);
3394 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3395 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3396 (yyval.a_expr)->meta_type = AMT_TYPE;
3401 #line 1263 "asn1p_y.y"
3403 (yyval.a_expr) = NEW_EXPR();
3404 checkmem((yyval.a_expr));
3405 (yyval.a_expr)->Identifier = strdup("...");
3406 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3407 checkmem((yyval.a_expr)->Identifier);
3408 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3409 (yyval.a_expr)->meta_type = AMT_TYPE;
3414 #line 1277 "asn1p_y.y"
3416 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3417 (yyval.a_expr)->tag = (yyvsp[(1) - (2)].a_tag);
3422 #line 1284 "asn1p_y.y"
3424 (yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
3426 * Outer constraint for SEQUENCE OF and SET OF applies
3427 * to the inner type.
3429 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
3430 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
3431 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
3432 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(2) - (2)].a_constr);
3434 if((yyval.a_expr)->constraints) {
3435 assert(!(yyvsp[(2) - (2)].a_constr));
3436 /* Check this : optManyConstraints is not used ?! */
3437 asn1p_constraint_free((yyvsp[(2) - (2)].a_constr));
3439 (yyval.a_expr)->constraints = (yyvsp[(2) - (2)].a_constr);
3446 #line 1307 "asn1p_y.y"
3448 (yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
3450 * Outer constraint for SEQUENCE OF and SET OF applies
3451 * to the inner type.
3453 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
3454 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
3455 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
3456 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(2) - (2)].a_constr);
3458 if((yyval.a_expr)->constraints) {
3459 assert(!(yyvsp[(2) - (2)].a_constr));
3460 /* Check this : optManyConstraints is not used ?! */
3461 asn1p_constraint_free((yyvsp[(2) - (2)].a_constr));
3463 (yyval.a_expr)->constraints = (yyvsp[(2) - (2)].a_constr);
3470 #line 1330 "asn1p_y.y"
3472 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3473 (yyval.a_expr)->tag = (yyvsp[(1) - (3)].a_tag);
3475 * Outer constraint for SEQUENCE OF and SET OF applies
3476 * to the inner type.
3478 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
3479 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
3480 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
3481 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(3) - (3)].a_constr);
3483 if((yyval.a_expr)->constraints) {
3484 assert(!(yyvsp[(2) - (3)].a_expr));
3485 /* Check this : optManyConstraints is not used ?! */
3486 asn1p_constraint_free((yyvsp[(3) - (3)].a_constr));
3488 (yyval.a_expr)->constraints = (yyvsp[(3) - (3)].a_constr);
3495 #line 1354 "asn1p_y.y"
3497 (yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
3498 asn1p_as_pointer = 0;
3503 #line 1361 "asn1p_y.y"
3505 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3506 (yyval.a_expr)->marker.flags |= (yyvsp[(1) - (2)].a_int);
3508 if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
3509 && ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
3511 "INFO: Directive <ASN1C:RepresentAsPointer> "
3512 "applied to %s at %s:%d\n",
3513 ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
3514 ? ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
3516 ASN_FILENAME, (yyval.a_expr)->_lineno
3523 #line 1385 "asn1p_y.y"
3525 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3526 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3527 (yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
3528 (yyval.a_expr)->meta_type = AMT_TYPE;
3533 #line 1391 "asn1p_y.y"
3535 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3536 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3537 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
3538 (yyval.a_expr)->meta_type = AMT_TYPE;
3543 #line 1397 "asn1p_y.y"
3545 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3546 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3547 (yyval.a_expr)->expr_type = ASN_CONSTR_SET;
3548 (yyval.a_expr)->meta_type = AMT_TYPE;
3553 #line 1403 "asn1p_y.y"
3555 (yyval.a_expr) = NEW_EXPR();
3556 checkmem((yyval.a_expr));
3557 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3558 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
3559 (yyval.a_expr)->meta_type = AMT_TYPE;
3560 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3561 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3562 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
3567 #line 1413 "asn1p_y.y"
3569 (yyval.a_expr) = NEW_EXPR();
3570 checkmem((yyval.a_expr));
3571 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3572 (yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
3573 (yyval.a_expr)->meta_type = AMT_TYPE;
3574 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3575 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3576 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
3581 #line 1423 "asn1p_y.y"
3583 (yyval.a_expr) = NEW_EXPR();
3584 checkmem((yyval.a_expr));
3585 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3586 (yyval.a_expr)->meta_type = AMT_TYPE;
3591 #line 1429 "asn1p_y.y"
3594 (yyval.a_expr) = NEW_EXPR();
3595 checkmem((yyval.a_expr));
3596 (yyval.a_expr)->reference = asn1p_ref_new(yylineno, currentModule);
3597 ret = asn1p_ref_add_component((yyval.a_expr)->reference,
3598 (yyvsp[(4) - (4)].tv_str), RLT_lowercase);
3600 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3601 (yyval.a_expr)->meta_type = AMT_TYPE;
3602 free((yyvsp[(4) - (4)].tv_str));
3607 #line 1441 "asn1p_y.y"
3609 (yyval.a_expr) = NEW_EXPR();
3610 checkmem((yyval.a_expr));
3611 (yyval.a_expr)->reference = (yyvsp[(3) - (3)].a_ref);
3612 (yyval.a_expr)->expr_type = A1TC_INSTANCE;
3613 (yyval.a_expr)->meta_type = AMT_TYPE;
3618 #line 1456 "asn1p_y.y"
3621 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3622 checkmem((yyval.a_ref));
3623 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_UNKNOWN);
3625 free((yyvsp[(1) - (1)].tv_str));
3630 #line 1464 "asn1p_y.y"
3633 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3634 checkmem((yyval.a_ref));
3635 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
3636 free((yyvsp[(1) - (1)].tv_str));
3642 #line 1472 "asn1p_y.y"
3645 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3646 checkmem((yyval.a_ref));
3647 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3649 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
3651 free((yyvsp[(1) - (3)].tv_str));
3652 free((yyvsp[(3) - (3)].tv_str));
3657 #line 1483 "asn1p_y.y"
3660 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3661 checkmem((yyval.a_ref));
3662 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3664 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
3666 free((yyvsp[(1) - (3)].tv_str));
3667 free((yyvsp[(3) - (3)].tv_str));
3672 #line 1494 "asn1p_y.y"
3675 (yyval.a_ref) = (yyvsp[(3) - (3)].a_ref);
3676 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_CAPITALS);
3677 free((yyvsp[(1) - (3)].tv_str));
3680 * Move the last element infront.
3683 struct asn1p_ref_component_s tmp_comp;
3684 tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
3685 memmove(&(yyval.a_ref)->components[1],
3686 &(yyval.a_ref)->components[0],
3687 sizeof((yyval.a_ref)->components[0])
3688 * ((yyval.a_ref)->comp_count - 1));
3689 (yyval.a_ref)->components[0] = tmp_comp;
3695 #line 1516 "asn1p_y.y"
3698 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3699 checkmem((yyval.a_ref));
3700 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].a_refcomp).name, (yyvsp[(1) - (1)].a_refcomp).lex_type);
3701 free((yyvsp[(1) - (1)].a_refcomp).name);
3707 #line 1524 "asn1p_y.y"
3710 (yyval.a_ref) = (yyvsp[(1) - (3)].a_ref);
3711 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].a_refcomp).name, (yyvsp[(3) - (3)].a_refcomp).lex_type);
3712 free((yyvsp[(3) - (3)].a_refcomp).name);
3718 #line 1537 "asn1p_y.y"
3720 (yyval.a_refcomp).lex_type = RLT_AmpUppercase;
3721 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
3726 #line 1542 "asn1p_y.y"
3728 (yyval.a_refcomp).lex_type = RLT_Amplowercase;
3729 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
3734 #line 1551 "asn1p_y.y"
3736 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3737 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_AmpUppercase);
3738 free((yyvsp[(1) - (1)].tv_str));
3743 #line 1556 "asn1p_y.y"
3745 (yyval.a_ref) = (yyval.a_ref);
3746 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_AmpUppercase);
3747 free((yyvsp[(3) - (3)].tv_str));
3752 #line 1561 "asn1p_y.y"
3754 (yyval.a_ref) = (yyval.a_ref);
3755 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_Amplowercase);
3756 free((yyvsp[(3) - (3)].tv_str));
3761 #line 1569 "asn1p_y.y"
3763 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3764 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
3765 free((yyvsp[(1) - (1)].tv_str));
3770 #line 1592 "asn1p_y.y"
3772 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
3773 assert((yyval.a_expr)->Identifier == NULL);
3774 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3775 (yyval.a_expr)->meta_type = AMT_VALUE;
3776 (yyval.a_expr)->value = (yyvsp[(4) - (4)].a_value);
3781 #line 1604 "asn1p_y.y"
3782 { asn1p_lexer_hack_push_opaque_state(); }
3786 #line 1604 "asn1p_y.y"
3788 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(3) - (3)].tv_opaque).buf, (yyvsp[(3) - (3)].tv_opaque).len, 0);
3789 checkmem((yyval.a_value));
3790 (yyval.a_value)->type = ATV_UNPARSED;
3795 #line 1612 "asn1p_y.y"
3797 (yyval.a_value) = asn1p_value_fromint(0);
3798 checkmem((yyval.a_value));
3799 (yyval.a_value)->type = ATV_NULL;
3804 #line 1617 "asn1p_y.y"
3806 (yyval.a_value) = asn1p_value_fromint(0);
3807 checkmem((yyval.a_value));
3808 (yyval.a_value)->type = ATV_FALSE;
3813 #line 1622 "asn1p_y.y"
3815 (yyval.a_value) = asn1p_value_fromint(1);
3816 checkmem((yyval.a_value));
3817 (yyval.a_value)->type = ATV_TRUE;
3822 #line 1635 "asn1p_y.y"
3826 ref = asn1p_ref_new(yylineno, currentModule);
3828 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3830 ret = asn1p_ref_add_component(ref, (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
3832 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3833 checkmem((yyval.a_value));
3834 free((yyvsp[(1) - (3)].tv_str));
3835 free((yyvsp[(3) - (3)].tv_str));
3840 #line 1653 "asn1p_y.y"
3842 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len, 0);
3843 checkmem((yyval.a_value));
3848 #line 1657 "asn1p_y.y"
3850 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3851 checkmem((yyval.a_value));
3852 (yyval.a_value)->type = ATV_TUPLE;
3857 #line 1662 "asn1p_y.y"
3859 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3860 checkmem((yyval.a_value));
3861 (yyval.a_value)->type = ATV_QUADRUPLE;
3866 #line 1670 "asn1p_y.y"
3868 (yyval.tv_opaque).len = (yyvsp[(1) - (1)].tv_opaque).len + 1;
3869 (yyval.tv_opaque).buf = malloc(1 + (yyval.tv_opaque).len + 1);
3870 checkmem((yyval.tv_opaque).buf);
3871 (yyval.tv_opaque).buf[0] = '{';
3872 memcpy((yyval.tv_opaque).buf + 1, (yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len);
3873 (yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
3874 free((yyvsp[(1) - (1)].tv_opaque).buf);
3879 #line 1679 "asn1p_y.y"
3881 int newsize = (yyvsp[(1) - (2)].tv_opaque).len + (yyvsp[(2) - (2)].tv_opaque).len;
3882 char *p = malloc(newsize + 1);
3884 memcpy(p , (yyvsp[(1) - (2)].tv_opaque).buf, (yyvsp[(1) - (2)].tv_opaque).len);
3885 memcpy(p + (yyvsp[(1) - (2)].tv_opaque).len, (yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len);
3887 free((yyvsp[(1) - (2)].tv_opaque).buf);
3888 free((yyvsp[(2) - (2)].tv_opaque).buf);
3889 (yyval.tv_opaque).buf = p;
3890 (yyval.tv_opaque).len = newsize;
3895 #line 1695 "asn1p_y.y"
3897 (yyval.tv_opaque).len = strlen((yyvsp[(1) - (1)].tv_str));
3898 (yyval.tv_opaque).buf = (yyvsp[(1) - (1)].tv_str);
3903 #line 1701 "asn1p_y.y"
3904 { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
3908 #line 1702 "asn1p_y.y"
3909 { (yyval.a_type) = ASN_BASIC_NULL; }
3913 #line 1703 "asn1p_y.y"
3914 { (yyval.a_type) = ASN_BASIC_REAL; }
3918 #line 1704 "asn1p_y.y"
3919 { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
3923 #line 1705 "asn1p_y.y"
3924 { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
3928 #line 1706 "asn1p_y.y"
3929 { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
3933 #line 1707 "asn1p_y.y"
3934 { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
3938 #line 1708 "asn1p_y.y"
3939 { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
3943 #line 1709 "asn1p_y.y"
3944 { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
3948 #line 1710 "asn1p_y.y"
3949 { (yyval.a_type) = ASN_BASIC_UTCTime; }
3953 #line 1711 "asn1p_y.y"
3954 { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
3958 #line 1720 "asn1p_y.y"
3959 { (yyval.a_type) = ASN_BASIC_INTEGER; }
3963 #line 1721 "asn1p_y.y"
3964 { (yyval.a_type) = ASN_BASIC_ENUMERATED; }
3968 #line 1722 "asn1p_y.y"
3969 { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
3973 #line 1726 "asn1p_y.y"
3975 (yyval.a_expr) = NEW_EXPR();
3976 checkmem((yyval.a_expr));
3977 (yyval.a_expr)->expr_type = (yyvsp[(1) - (1)].a_type);
3978 (yyval.a_expr)->meta_type = AMT_TYPE;
3983 #line 1732 "asn1p_y.y"
3985 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3986 (yyval.a_expr)->expr_type = ASN_BASIC_INTEGER;
3987 (yyval.a_expr)->meta_type = AMT_TYPE;
3992 #line 1737 "asn1p_y.y"
3994 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3995 (yyval.a_expr)->expr_type = ASN_BASIC_ENUMERATED;
3996 (yyval.a_expr)->meta_type = AMT_TYPE;
4001 #line 1742 "asn1p_y.y"
4003 (yyval.a_expr) = (yyvsp[(4) - (5)].a_expr);
4004 (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
4005 (yyval.a_expr)->meta_type = AMT_TYPE;
4010 #line 1747 "asn1p_y.y"
4012 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
4013 (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
4014 (yyval.a_expr)->meta_type = AMT_TYPE;
4019 #line 1752 "asn1p_y.y"
4021 (yyval.a_expr) = NEW_EXPR();
4022 checkmem((yyval.a_expr));
4023 (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
4024 (yyval.a_expr)->meta_type = AMT_TYPE;
4029 #line 1761 "asn1p_y.y"
4030 { (yyval.a_type) = ASN_STRING_BMPString; }
4034 #line 1762 "asn1p_y.y"
4036 (yyval.a_type) = ASN_STRING_GeneralString;
4037 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
4042 #line 1766 "asn1p_y.y"
4044 (yyval.a_type) = ASN_STRING_GraphicString;
4045 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
4050 #line 1770 "asn1p_y.y"
4051 { (yyval.a_type) = ASN_STRING_IA5String; }
4055 #line 1771 "asn1p_y.y"
4056 { (yyval.a_type) = ASN_STRING_ISO646String; }
4060 #line 1772 "asn1p_y.y"
4061 { (yyval.a_type) = ASN_STRING_NumericString; }
4065 #line 1773 "asn1p_y.y"
4066 { (yyval.a_type) = ASN_STRING_PrintableString; }
4070 #line 1774 "asn1p_y.y"
4072 (yyval.a_type) = ASN_STRING_T61String;
4073 fprintf(stderr, "WARNING: T61String is not fully supported\n");
4078 #line 1778 "asn1p_y.y"
4079 { (yyval.a_type) = ASN_STRING_TeletexString; }
4083 #line 1779 "asn1p_y.y"
4084 { (yyval.a_type) = ASN_STRING_UniversalString; }
4088 #line 1780 "asn1p_y.y"
4089 { (yyval.a_type) = ASN_STRING_UTF8String; }
4093 #line 1781 "asn1p_y.y"
4095 (yyval.a_type) = ASN_STRING_VideotexString;
4096 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
4101 #line 1785 "asn1p_y.y"
4102 { (yyval.a_type) = ASN_STRING_VisibleString; }
4106 #line 1786 "asn1p_y.y"
4107 { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
4111 #line 1798 "asn1p_y.y"
4112 { (yyval.a_constr) = 0; }
4116 #line 1803 "asn1p_y.y"
4117 { (yyval.a_constr) = 0; }
4121 #line 1808 "asn1p_y.y"
4122 { (yyval.a_constr) = 0; }
4126 #line 1814 "asn1p_y.y"
4128 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(2) - (3)].a_constr), 0);
4133 #line 1821 "asn1p_y.y"
4135 if((yyvsp[(2) - (2)].a_constr)->type == ACT_CA_SET && (yyvsp[(2) - (2)].a_constr)->el_count == 1) {
4136 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (2)].a_constr), (yyvsp[(2) - (2)].a_constr)->elements[0]);
4138 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (2)].a_constr), (yyvsp[(2) - (2)].a_constr));
4144 #line 1835 "asn1p_y.y"
4146 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4147 (yyval.a_constr)->type = ACT_EL_EXT;
4152 #line 1840 "asn1p_y.y"
4154 asn1p_constraint_t *ct;
4155 ct = asn1p_constraint_new(yylineno, currentModule);
4156 ct->type = ACT_EL_EXT;
4157 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
4162 #line 1846 "asn1p_y.y"
4164 asn1p_constraint_t *ct;
4165 ct = asn1p_constraint_new(yylineno, currentModule);
4166 ct->type = ACT_EL_EXT;
4167 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (5)].a_constr), ct);
4168 ct = (yyval.a_constr);
4169 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[(5) - (5)].a_constr));
4174 #line 1858 "asn1p_y.y"
4176 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[(3) - (3)].a_constr), 0);
4181 #line 1865 "asn1p_y.y"
4183 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_UNI, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
4188 #line 1872 "asn1p_y.y"
4190 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_INT, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
4195 #line 1880 "asn1p_y.y"
4197 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_EXC, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
4202 #line 1887 "asn1p_y.y"
4205 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4206 checkmem((yyval.a_constr));
4207 (yyval.a_constr)->type = ACT_CA_SET;
4208 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
4214 #line 1898 "asn1p_y.y"
4216 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4217 checkmem((yyval.a_constr));
4218 (yyval.a_constr)->type = ACT_EL_VALUE;
4219 (yyval.a_constr)->value = (yyvsp[(1) - (1)].a_value);
4224 #line 1904 "asn1p_y.y"
4226 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4227 checkmem((yyval.a_constr));
4228 (yyval.a_constr)->type = ACT_EL_TYPE;
4229 (yyval.a_constr)->containedSubtype = (yyvsp[(1) - (1)].a_value);
4234 #line 1920 "asn1p_y.y"
4236 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_FROM, (yyvsp[(2) - (2)].a_constr), 0);
4241 #line 1925 "asn1p_y.y"
4243 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[(2) - (2)].a_constr), 0);
4248 #line 1930 "asn1p_y.y"
4250 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4251 (yyval.a_constr)->type = ACT_CT_PATTERN;
4252 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len, 0);
4257 #line 1935 "asn1p_y.y"
4260 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4261 (yyval.a_constr)->type = ACT_CT_PATTERN;
4262 ref = asn1p_ref_new(yylineno, currentModule);
4263 asn1p_ref_add_component(ref, (yyvsp[(2) - (2)].tv_str), RLT_lowercase);
4264 (yyval.a_constr)->value = asn1p_value_fromref(ref, 0);
4265 free((yyvsp[(2) - (2)].tv_str));
4270 #line 1947 "asn1p_y.y"
4272 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4273 checkmem((yyval.a_constr));
4274 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4275 (yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
4276 (yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
4281 #line 1957 "asn1p_y.y"
4283 (yyval.a_value) = asn1p_value_fromint(-123);
4284 (yyval.a_value)->type = ATV_MIN;
4289 #line 1964 "asn1p_y.y"
4291 (yyval.a_value) = asn1p_value_fromint(321);
4292 (yyval.a_value)->type = ATV_MAX;
4297 #line 1972 "asn1p_y.y"
4299 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
4300 checkmem((yyval.a_value));
4301 free((yyvsp[(1) - (1)].tv_str));
4306 #line 1977 "asn1p_y.y"
4308 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
4309 checkmem((yyval.a_value));
4310 free((yyvsp[(1) - (1)].tv_str));
4315 #line 1985 "asn1p_y.y"
4317 (yyval.a_value) = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
4318 checkmem((yyval.a_value));
4319 asn1p_expr_free((yyvsp[(2) - (2)].a_expr));
4324 #line 1991 "asn1p_y.y"
4326 (yyval.a_value) = asn1p_value_fromtype((yyvsp[(1) - (1)].a_expr));
4327 checkmem((yyval.a_value));
4328 asn1p_expr_free((yyvsp[(1) - (1)].a_expr));
4333 #line 2003 "asn1p_y.y"
4335 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[(3) - (3)].a_constr), 0);
4340 #line 2006 "asn1p_y.y"
4342 assert((yyvsp[(3) - (3)].a_constr)->type == ACT_CA_CSV);
4343 (yyvsp[(3) - (3)].a_constr)->type = ACT_CT_WCOMPS;
4344 (yyval.a_constr) = (yyvsp[(3) - (3)].a_constr);
4349 #line 2014 "asn1p_y.y"
4350 { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
4354 #line 2016 "asn1p_y.y"
4356 assert((yyvsp[(4) - (5)].a_constr)->type == ACT_CA_CSV);
4357 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4358 (yyval.a_constr)->type = ACT_CA_CSV;
4359 asn1p_constraint_t *ct = asn1p_constraint_new(yylineno, currentModule);
4360 checkmem((yyval.a_constr));
4361 ct->type = ACT_EL_EXT;
4362 asn1p_constraint_insert((yyval.a_constr), ct);
4363 for(unsigned i = 0; i < (yyvsp[(4) - (5)].a_constr)->el_count; i++) {
4364 asn1p_constraint_insert((yyval.a_constr), (yyvsp[(4) - (5)].a_constr)->elements[i]);
4370 #line 2029 "asn1p_y.y"
4372 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4373 (yyval.a_constr)->type = ACT_CA_CSV;
4374 asn1p_constraint_insert((yyval.a_constr), (yyvsp[(1) - (1)].a_constr));
4379 #line 2034 "asn1p_y.y"
4381 (yyval.a_constr) = (yyvsp[(1) - (3)].a_constr);
4382 asn1p_constraint_insert((yyval.a_constr), (yyvsp[(3) - (3)].a_constr));
4387 #line 2040 "asn1p_y.y"
4389 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4390 checkmem((yyval.a_constr));
4391 (yyval.a_constr)->type = ACT_EL_VALUE;
4392 (yyval.a_constr)->value = (yyvsp[(1) - (3)].a_value);
4393 if((yyvsp[(2) - (3)].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
4394 (yyval.a_constr)->presence = (yyvsp[(3) - (3)].a_pres);
4399 #line 2054 "asn1p_y.y"
4400 { (yyval.a_pres) = ACPRES_DEFAULT; }
4404 #line 2055 "asn1p_y.y"
4405 { (yyval.a_pres) = (yyvsp[(1) - (1)].a_pres); }
4409 #line 2059 "asn1p_y.y"
4411 (yyval.a_pres) = ACPRES_PRESENT;
4416 #line 2062 "asn1p_y.y"
4418 (yyval.a_pres) = ACPRES_ABSENT;
4423 #line 2065 "asn1p_y.y"
4425 (yyval.a_pres) = ACPRES_OPTIONAL;
4430 #line 2080 "asn1p_y.y"
4431 { asn1p_lexer_hack_push_opaque_state(); }
4435 #line 2080 "asn1p_y.y"
4437 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4438 checkmem((yyval.a_constr));
4439 (yyval.a_constr)->type = ACT_CT_CTDBY;
4440 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(5) - (5)].tv_opaque).buf, (yyvsp[(5) - (5)].tv_opaque).len, 0);
4441 checkmem((yyval.a_constr)->value);
4442 (yyval.a_constr)->value->type = ATV_UNPARSED;
4447 #line 2091 "asn1p_y.y"
4449 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4450 (yyval.a_constr)->type = ACT_CT_CTNG;
4451 (yyval.a_constr)->value = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
4452 asn1p_expr_free((yyvsp[(2) - (2)].a_expr));
4457 #line 2100 "asn1p_y.y"
4458 { (yyval.a_ctype) = ACT_EL_RANGE; }
4462 #line 2101 "asn1p_y.y"
4463 { (yyval.a_ctype) = ACT_EL_RLRANGE; }
4467 #line 2102 "asn1p_y.y"
4468 { (yyval.a_ctype) = ACT_EL_LLRANGE; }
4472 #line 2103 "asn1p_y.y"
4473 { (yyval.a_ctype) = ACT_EL_ULRANGE; }
4477 #line 2106 "asn1p_y.y"
4479 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4484 #line 2109 "asn1p_y.y"
4486 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4491 #line 2118 "asn1p_y.y"
4493 asn1p_ref_t *ref = asn1p_ref_new(yylineno, currentModule);
4494 asn1p_constraint_t *ct;
4496 ret = asn1p_ref_add_component(ref, (yyvsp[(2) - (3)].tv_str), 0);
4498 ct = asn1p_constraint_new(yylineno, currentModule);
4499 checkmem((yyval.a_constr));
4500 ct->type = ACT_EL_VALUE;
4501 ct->value = asn1p_value_fromref(ref, 0);
4502 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
4503 free((yyvsp[(2) - (3)].tv_str));
4508 #line 2134 "asn1p_y.y"
4510 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, (yyvsp[(1) - (4)].a_constr), (yyvsp[(3) - (4)].a_constr));
4515 #line 2140 "asn1p_y.y"
4517 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4518 checkmem((yyval.a_constr));
4519 (yyval.a_constr)->type = ACT_EL_VALUE;
4520 (yyval.a_constr)->value = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
4525 #line 2146 "asn1p_y.y"
4527 asn1p_constraint_t *ct;
4528 ct = asn1p_constraint_new(yylineno, currentModule);
4530 ct->type = ACT_EL_VALUE;
4531 ct->value = asn1p_value_fromref((yyvsp[(3) - (3)].a_ref), 0);
4532 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
4537 #line 2160 "asn1p_y.y"
4539 char *p = malloc(strlen((yyvsp[(2) - (2)].tv_str)) + 2);
4542 strcpy(p + 1, (yyvsp[(2) - (2)].tv_str));
4543 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
4544 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
4547 free((yyvsp[(2) - (2)].tv_str));
4552 #line 2171 "asn1p_y.y"
4554 char *p = malloc(strlen((yyvsp[(3) - (3)].tv_str)) + 3);
4558 strcpy(p + 2, (yyvsp[(3) - (3)].tv_str));
4559 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
4560 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
4563 free((yyvsp[(3) - (3)].tv_str));
4568 #line 2187 "asn1p_y.y"
4570 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4575 #line 2190 "asn1p_y.y"
4577 int l1 = strlen((yyvsp[(1) - (3)].tv_str));
4578 int l3 = strlen((yyvsp[(3) - (3)].tv_str));
4579 (yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
4580 memcpy((yyval.tv_str), (yyvsp[(1) - (3)].tv_str), l1);
4581 (yyval.tv_str)[l1] = '.';
4582 memcpy((yyval.tv_str) + l1 + 1, (yyvsp[(3) - (3)].tv_str), l3);
4583 (yyval.tv_str)[l1 + 1 + l3] = '\0';
4584 free((yyvsp[(1) - (3)].tv_str));
4585 free((yyvsp[(3) - (3)].tv_str));
4590 #line 2210 "asn1p_y.y"
4592 (yyval.a_marker).flags = EM_NOMARK;
4593 (yyval.a_marker).default_value = 0;
4598 #line 2214 "asn1p_y.y"
4599 { (yyval.a_marker) = (yyvsp[(1) - (1)].a_marker); }
4603 #line 2218 "asn1p_y.y"
4605 (yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
4606 (yyval.a_marker).default_value = 0;
4611 #line 2222 "asn1p_y.y"
4613 (yyval.a_marker).flags = EM_DEFAULT;
4614 (yyval.a_marker).default_value = (yyvsp[(2) - (2)].a_value);
4619 #line 2229 "asn1p_y.y"
4621 (yyval.a_expr) = NEW_EXPR();
4622 checkmem((yyval.a_expr));
4623 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
4628 #line 2234 "asn1p_y.y"
4630 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4631 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
4636 #line 2240 "asn1p_y.y"
4638 (yyval.a_expr) = NEW_EXPR();
4639 checkmem((yyval.a_expr));
4640 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4641 (yyval.a_expr)->meta_type = AMT_VALUE;
4642 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
4647 #line 2249 "asn1p_y.y"
4649 (yyval.a_expr) = NEW_EXPR();
4650 checkmem((yyval.a_expr));
4651 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
4656 #line 2254 "asn1p_y.y"
4658 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4659 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
4664 #line 2261 "asn1p_y.y"
4666 (yyval.a_expr) = NEW_EXPR();
4667 checkmem((yyval.a_expr));
4668 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4669 (yyval.a_expr)->meta_type = AMT_VALUE;
4670 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4671 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4676 #line 2269 "asn1p_y.y"
4678 (yyval.a_expr) = NEW_EXPR();
4679 checkmem((yyval.a_expr));
4680 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4681 (yyval.a_expr)->meta_type = AMT_VALUE;
4682 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4683 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4688 #line 2279 "asn1p_y.y"
4690 (yyval.a_expr) = NEW_EXPR();
4691 checkmem((yyval.a_expr));
4692 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
4697 #line 2284 "asn1p_y.y"
4699 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4700 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
4705 #line 2291 "asn1p_y.y"
4707 (yyval.a_expr) = NEW_EXPR();
4708 checkmem((yyval.a_expr));
4709 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4710 (yyval.a_expr)->meta_type = AMT_VALUE;
4711 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4712 (yyval.a_expr)->value = asn1p_value_fromint((yyvsp[(3) - (4)].a_int));
4717 #line 2299 "asn1p_y.y"
4719 (yyval.a_expr) = NEW_EXPR();
4720 checkmem((yyval.a_expr));
4721 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4722 (yyval.a_expr)->meta_type = AMT_VALUE;
4723 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4724 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4729 #line 2309 "asn1p_y.y"
4731 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
4732 asn1p_expr_t *first_memb = TQ_FIRST(&((yyval.a_expr)->members));
4734 if(first_memb->expr_type == A1TC_EXTENSIBLE) {
4736 "The ENUMERATION cannot start with extension (...).");
4740 "The ENUMERATION list cannot be empty.");
4746 #line 2324 "asn1p_y.y"
4748 (yyval.a_expr) = NEW_EXPR();
4749 checkmem((yyval.a_expr));
4750 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
4755 #line 2329 "asn1p_y.y"
4757 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4758 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
4763 #line 2336 "asn1p_y.y"
4765 (yyval.a_expr) = NEW_EXPR();
4766 checkmem((yyval.a_expr));
4767 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4768 (yyval.a_expr)->meta_type = AMT_VALUE;
4769 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
4774 #line 2343 "asn1p_y.y"
4776 (yyval.a_expr) = NEW_EXPR();
4777 checkmem((yyval.a_expr));
4778 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4779 (yyval.a_expr)->meta_type = AMT_VALUE;
4780 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4781 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4786 #line 2351 "asn1p_y.y"
4788 (yyval.a_expr) = NEW_EXPR();
4789 checkmem((yyval.a_expr));
4790 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4791 (yyval.a_expr)->meta_type = AMT_VALUE;
4792 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4793 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4798 #line 2359 "asn1p_y.y"
4800 (yyval.a_expr) = NEW_EXPR();
4801 checkmem((yyval.a_expr));
4802 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4803 (yyval.a_expr)->meta_type = AMT_VALUE;
4804 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
4809 #line 2366 "asn1p_y.y"
4811 (yyval.a_expr) = NEW_EXPR();
4812 checkmem((yyval.a_expr));
4813 (yyval.a_expr)->Identifier = strdup("...");
4814 checkmem((yyval.a_expr)->Identifier);
4815 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
4816 (yyval.a_expr)->meta_type = AMT_VALUE;
4821 #line 2377 "asn1p_y.y"
4823 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4824 checkmem((yyval.a_value));
4829 #line 2381 "asn1p_y.y"
4831 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4832 checkmem((yyval.a_value));
4837 #line 2388 "asn1p_y.y"
4839 (yyval.a_value) = asn1p_value_fromdouble((yyvsp[(1) - (1)].a_dbl));
4840 checkmem((yyval.a_value));
4845 #line 2419 "asn1p_y.y"
4846 { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
4850 #line 2420 "asn1p_y.y"
4851 { (yyval.a_tag) = (yyvsp[(1) - (1)].a_tag); }
4855 #line 2424 "asn1p_y.y"
4857 (yyval.a_tag) = (yyvsp[(1) - (2)].a_tag);
4858 (yyval.a_tag).tag_mode = (yyvsp[(2) - (2)].a_tag).tag_mode;
4863 #line 2431 "asn1p_y.y"
4865 (yyval.a_tag) = (yyvsp[(2) - (4)].a_tag);
4866 (yyval.a_tag).tag_value = (yyvsp[(3) - (4)].a_int);
4871 #line 2437 "asn1p_y.y"
4872 { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
4876 #line 2438 "asn1p_y.y"
4877 { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
4881 #line 2439 "asn1p_y.y"
4882 { (yyval.a_tag).tag_class = TC_APPLICATION; }
4886 #line 2440 "asn1p_y.y"
4887 { (yyval.a_tag).tag_class = TC_PRIVATE; }
4891 #line 2444 "asn1p_y.y"
4892 { (yyval.a_tag).tag_mode = TM_DEFAULT; }
4896 #line 2445 "asn1p_y.y"
4897 { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
4901 #line 2446 "asn1p_y.y"
4902 { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
4906 #line 2450 "asn1p_y.y"
4908 checkmem((yyvsp[(1) - (1)].tv_str));
4909 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4914 #line 2454 "asn1p_y.y"
4916 checkmem((yyvsp[(1) - (1)].tv_str));
4917 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4922 #line 2462 "asn1p_y.y"
4923 { (yyval.tv_str) = 0; }
4927 #line 2463 "asn1p_y.y"
4929 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4934 #line 2469 "asn1p_y.y"
4936 checkmem((yyvsp[(1) - (1)].tv_str));
4937 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4942 #line 2476 "asn1p_y.y"
4944 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
4945 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
4946 free((yyvsp[(1) - (1)].tv_str));
4951 #line 2483 "asn1p_y.y"
4953 (yyval.a_value) = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
4958 /* Line 1267 of yacc.c. */
4959 #line 4957 "asn1p_y.c"
4962 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4966 YY_STACK_PRINT (yyss, yyssp);
4971 /* Now `shift' the result of the reduction. Determine what state
4972 that goes to, based on the state we popped back to and the rule
4973 number reduced by. */
4977 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4978 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4979 yystate = yytable[yystate];
4981 yystate = yydefgoto[yyn - YYNTOKENS];
4986 /*------------------------------------.
4987 | yyerrlab -- here on detecting error |
4988 `------------------------------------*/
4990 /* If not already recovering from an error, report this error. */
4994 #if ! YYERROR_VERBOSE
4995 yyerror (YY_("syntax error"));
4998 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4999 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5001 YYSIZE_T yyalloc = 2 * yysize;
5002 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5003 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5004 if (yymsg != yymsgbuf)
5005 YYSTACK_FREE (yymsg);
5006 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5008 yymsg_alloc = yyalloc;
5012 yymsg_alloc = sizeof yymsgbuf;
5016 if (0 < yysize && yysize <= yymsg_alloc)
5018 (void) yysyntax_error (yymsg, yystate, yychar);
5023 yyerror (YY_("syntax error"));
5025 goto yyexhaustedlab;
5033 if (yyerrstatus == 3)
5035 /* If just tried and failed to reuse look-ahead token after an
5036 error, discard it. */
5038 if (yychar <= YYEOF)
5040 /* Return failure if at end of input. */
5041 if (yychar == YYEOF)
5046 yydestruct ("Error: discarding",
5052 /* Else will try to reuse look-ahead token after shifting the error
5057 /*---------------------------------------------------.
5058 | yyerrorlab -- error raised explicitly by YYERROR. |
5059 `---------------------------------------------------*/
5062 /* Pacify compilers like GCC when the user code never invokes
5063 YYERROR and the label yyerrorlab therefore never appears in user
5065 if (/*CONSTCOND*/ 0)
5068 /* Do not reclaim the symbols of the rule which action triggered
5072 YY_STACK_PRINT (yyss, yyssp);
5077 /*-------------------------------------------------------------.
5078 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5079 `-------------------------------------------------------------*/
5081 yyerrstatus = 3; /* Each real token shifted decrements this. */
5085 yyn = yypact[yystate];
5086 if (yyn != YYPACT_NINF)
5089 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5097 /* Pop the current state because it cannot handle the error token. */
5102 yydestruct ("Error: popping",
5103 yystos[yystate], yyvsp);
5106 YY_STACK_PRINT (yyss, yyssp);
5115 /* Shift the error token. */
5116 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5122 /*-------------------------------------.
5123 | yyacceptlab -- YYACCEPT comes here. |
5124 `-------------------------------------*/
5129 /*-----------------------------------.
5130 | yyabortlab -- YYABORT comes here. |
5131 `-----------------------------------*/
5137 /*-------------------------------------------------.
5138 | yyexhaustedlab -- memory exhaustion comes here. |
5139 `-------------------------------------------------*/
5141 yyerror (YY_("memory exhausted"));
5147 if (yychar != YYEOF && yychar != YYEMPTY)
5148 yydestruct ("Cleanup: discarding lookahead",
5150 /* Do not reclaim the symbols of the rule which action triggered
5151 this YYABORT or YYACCEPT. */
5153 YY_STACK_PRINT (yyss, yyssp);
5154 while (yyssp != yyss)
5156 yydestruct ("Cleanup: popping",
5157 yystos[*yyssp], yyvsp);
5162 YYSTACK_FREE (yyss);
5165 if (yymsg != yymsgbuf)
5166 YYSTACK_FREE (yymsg);
5168 /* Make sure YYID is used. */
5169 return YYID (yyresult);
5173 #line 2487 "asn1p_y.y"
5178 * Convert Xstring ('0101'B or '5'H) to the binary vector.
5180 static asn1p_value_t *
5181 _convert_bitstring2binary(char *str, int base) {
5187 uint8_t *binary_vector;
5192 assert(str[0] == '\'');
5202 assert(base == 'B' || base == 'H');
5208 assert(str[slen - 1] == base);
5209 assert(str[slen - 2] == '\'');
5211 memlen = slen / (8 / baselen); /* Conservative estimate */
5213 bv_ptr = binary_vector = malloc(memlen + 1);
5220 while(*(++str) != '\'') {
5225 cur_val |= 1 << (7 - (bits % 8));
5229 assert(!"_y UNREACH1");
5230 case ' ': case '\r': case '\n':
5236 case '0': case '1': case '2': case '3': case '4':
5237 case '5': case '6': case '7': case '8': case '9':
5238 cur_val |= (*str - '0') << (4 - (bits % 8));
5240 case 'A': case 'B': case 'C':
5241 case 'D': case 'E': case 'F':
5242 cur_val |= ((*str - 'A') + 10)
5243 << (4 - (bits % 8));
5246 assert(!"_y UNREACH2");
5247 case ' ': case '\r': case '\n':
5254 if((bits % 8) == 0) {
5255 *bv_ptr++ = cur_val;
5261 assert((bv_ptr - binary_vector) <= memlen);
5263 val = asn1p_value_frombits(binary_vector, bits, 0);
5265 free(binary_vector);
5272 * For unnamed types (used in old X.208 compliant modules)
5273 * generate some sort of interim names, to not to force human being to fix
5274 * the specification's compliance to modern ASN.1 standards.
5277 _fixup_anonymous_identifier(asn1p_expr_t *expr) {
5279 assert(expr->Identifier == 0);
5282 * Try to figure out the type name
5283 * without going too much into details
5285 expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
5286 if(expr->reference && expr->reference->comp_count > 0)
5287 expr->Identifier = expr->reference->components[0].name;
5290 "WARNING: Line %d: expected lower-case member identifier, "
5291 "found an unnamed %s.\n"
5292 "WARNING: Obsolete X.208 syntax detected, "
5293 "please give the member a name.\n",
5294 yylineno, expr->Identifier ? expr->Identifier : "type");
5296 if(!expr->Identifier)
5297 expr->Identifier = "unnamed";
5298 expr->Identifier = strdup(expr->Identifier);
5299 assert(expr->Identifier);
5300 /* Make a lowercase identifier from the type name */
5301 for(p = expr->Identifier; *p; p++) {
5303 case 'A' ... 'Z': *p += 32; break;
5304 case ' ': *p = '_'; break;
5305 case '-': *p = '_'; break;
5308 fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
5309 "Name clash may occur later.\n",
5314 yyerror(const char *msg) {
5315 extern char *asn1p_text;
5317 "ASN.1 grammar parse error "
5318 "near %s:%d (token \"%s\"): %s\n",
5319 ASN_FILENAME, yylineno, asn1p_text, msg);