asn1p_y.c 160 KB
Newer Older
Lev Walkin's avatar
Lev Walkin committed
1
/* A Bison parser, made by GNU Bison 2.3.  */
Lev Walkin's avatar
Lev Walkin committed
2

Lev Walkin's avatar
Lev Walkin committed
3 4 5 6 7 8
/* Skeleton implementation for Bison's Yacc-like parsers in C

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
Lev Walkin's avatar
Lev Walkin committed
9
   it under the terms of the GNU General Public License as published by
Lev Walkin's avatar
Lev Walkin committed
10 11 12
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

Lev Walkin's avatar
Lev Walkin committed
13 14 15 16
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
Lev Walkin's avatar
Lev Walkin committed
17

Lev Walkin's avatar
Lev Walkin committed
18
   You should have received a copy of the GNU General Public License
Lev Walkin's avatar
Lev Walkin committed
19 20 21
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.  */
22 23 24 25 26 27 28 29 30 31

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
Lev Walkin's avatar
Lev Walkin committed
32

33 34
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */
Lev Walkin's avatar
Lev Walkin committed
35

36 37
/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */
Lev Walkin's avatar
Lev Walkin committed
38 39 40 41 42 43 44 45 46

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
47 48 49
#define YYBISON 1

/* Bison version.  */
Lev Walkin's avatar
Lev Walkin committed
50
#define YYBISON_VERSION "2.3"
51 52 53

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"
Lev Walkin's avatar
Lev Walkin committed
54 55

/* Pure parsers.  */
56
#define YYPURE 0
Lev Walkin's avatar
Lev Walkin committed
57

Lev Walkin's avatar
Lev Walkin committed
58 59
/* Using locations.  */
#define YYLSP_NEEDED 0
Lev Walkin's avatar
Lev Walkin committed
60

61
/* Substitute the variable and function names.  */
Lev Walkin's avatar
Lev Walkin committed
62 63 64 65 66 67 68
#define yyparse asn1p_parse
#define yylex   asn1p_lex
#define yyerror asn1p_error
#define yylval  asn1p_lval
#define yychar  asn1p_char
#define yydebug asn1p_debug
#define yynerrs asn1p_nerrs
69

Lev Walkin's avatar
Lev Walkin committed
70 71 72 73 74 75 76 77

/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     TOK_PPEQ = 258,
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
     TOK_VBracketLeft = 259,
     TOK_VBracketRight = 260,
     TOK_whitespace = 261,
     TOK_opaque = 262,
     TOK_bstring = 263,
     TOK_cstring = 264,
     TOK_hstring = 265,
     TOK_identifier = 266,
     TOK_number = 267,
     TOK_number_negative = 268,
     TOK_realnumber = 269,
     TOK_tuple = 270,
     TOK_quadruple = 271,
     TOK_typereference = 272,
     TOK_capitalreference = 273,
     TOK_typefieldreference = 274,
     TOK_valuefieldreference = 275,
     TOK_Literal = 276,
Lev Walkin's avatar
Lev Walkin committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
     TOK_ExtValue_BIT_STRING = 277,
     TOK_ABSENT = 278,
     TOK_ABSTRACT_SYNTAX = 279,
     TOK_ALL = 280,
     TOK_ANY = 281,
     TOK_APPLICATION = 282,
     TOK_AUTOMATIC = 283,
     TOK_BEGIN = 284,
     TOK_BIT = 285,
     TOK_BMPString = 286,
     TOK_BOOLEAN = 287,
     TOK_BY = 288,
     TOK_CHARACTER = 289,
     TOK_CHOICE = 290,
     TOK_CLASS = 291,
     TOK_COMPONENT = 292,
     TOK_COMPONENTS = 293,
     TOK_CONSTRAINED = 294,
     TOK_CONTAINING = 295,
     TOK_DEFAULT = 296,
     TOK_DEFINITIONS = 297,
     TOK_DEFINED = 298,
     TOK_EMBEDDED = 299,
     TOK_ENCODED = 300,
     TOK_ENCODING_CONTROL = 301,
     TOK_END = 302,
     TOK_ENUMERATED = 303,
     TOK_EXPLICIT = 304,
     TOK_EXPORTS = 305,
     TOK_EXTENSIBILITY = 306,
     TOK_EXTERNAL = 307,
     TOK_FALSE = 308,
     TOK_FROM = 309,
     TOK_GeneralizedTime = 310,
     TOK_GeneralString = 311,
     TOK_GraphicString = 312,
     TOK_IA5String = 313,
     TOK_IDENTIFIER = 314,
     TOK_IMPLICIT = 315,
     TOK_IMPLIED = 316,
     TOK_IMPORTS = 317,
     TOK_INCLUDES = 318,
     TOK_INSTANCE = 319,
     TOK_INSTRUCTIONS = 320,
     TOK_INTEGER = 321,
     TOK_ISO646String = 322,
     TOK_MAX = 323,
     TOK_MIN = 324,
     TOK_MINUS_INFINITY = 325,
     TOK_NULL = 326,
     TOK_NumericString = 327,
     TOK_OBJECT = 328,
     TOK_ObjectDescriptor = 329,
     TOK_OCTET = 330,
     TOK_OF = 331,
     TOK_OPTIONAL = 332,
     TOK_PATTERN = 333,
     TOK_PDV = 334,
     TOK_PLUS_INFINITY = 335,
     TOK_PRESENT = 336,
     TOK_PrintableString = 337,
     TOK_PRIVATE = 338,
     TOK_REAL = 339,
     TOK_RELATIVE_OID = 340,
     TOK_SEQUENCE = 341,
     TOK_SET = 342,
     TOK_SIZE = 343,
     TOK_STRING = 344,
     TOK_SYNTAX = 345,
     TOK_T61String = 346,
     TOK_TAGS = 347,
     TOK_TeletexString = 348,
     TOK_TRUE = 349,
     TOK_TYPE_IDENTIFIER = 350,
     TOK_UNIQUE = 351,
     TOK_UNIVERSAL = 352,
     TOK_UniversalString = 353,
     TOK_UTCTime = 354,
     TOK_UTF8String = 355,
     TOK_VideotexString = 356,
     TOK_VisibleString = 357,
     TOK_WITH = 358,
     UTF8_BOM = 359,
     TOK_EXCEPT = 360,
     TOK_INTERSECTION = 361,
     TOK_UNION = 362,
     TOK_TwoDots = 363,
     TOK_ThreeDots = 364
Lev Walkin's avatar
Lev Walkin committed
184 185
   };
#endif
186
/* Tokens.  */
Lev Walkin's avatar
Lev Walkin committed
187
#define TOK_PPEQ 258
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
#define TOK_VBracketLeft 259
#define TOK_VBracketRight 260
#define TOK_whitespace 261
#define TOK_opaque 262
#define TOK_bstring 263
#define TOK_cstring 264
#define TOK_hstring 265
#define TOK_identifier 266
#define TOK_number 267
#define TOK_number_negative 268
#define TOK_realnumber 269
#define TOK_tuple 270
#define TOK_quadruple 271
#define TOK_typereference 272
#define TOK_capitalreference 273
#define TOK_typefieldreference 274
#define TOK_valuefieldreference 275
#define TOK_Literal 276
Lev Walkin's avatar
Lev Walkin committed
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
#define TOK_ExtValue_BIT_STRING 277
#define TOK_ABSENT 278
#define TOK_ABSTRACT_SYNTAX 279
#define TOK_ALL 280
#define TOK_ANY 281
#define TOK_APPLICATION 282
#define TOK_AUTOMATIC 283
#define TOK_BEGIN 284
#define TOK_BIT 285
#define TOK_BMPString 286
#define TOK_BOOLEAN 287
#define TOK_BY 288
#define TOK_CHARACTER 289
#define TOK_CHOICE 290
#define TOK_CLASS 291
#define TOK_COMPONENT 292
#define TOK_COMPONENTS 293
#define TOK_CONSTRAINED 294
#define TOK_CONTAINING 295
#define TOK_DEFAULT 296
#define TOK_DEFINITIONS 297
#define TOK_DEFINED 298
#define TOK_EMBEDDED 299
#define TOK_ENCODED 300
#define TOK_ENCODING_CONTROL 301
#define TOK_END 302
#define TOK_ENUMERATED 303
#define TOK_EXPLICIT 304
#define TOK_EXPORTS 305
#define TOK_EXTENSIBILITY 306
#define TOK_EXTERNAL 307
#define TOK_FALSE 308
#define TOK_FROM 309
#define TOK_GeneralizedTime 310
#define TOK_GeneralString 311
#define TOK_GraphicString 312
#define TOK_IA5String 313
#define TOK_IDENTIFIER 314
#define TOK_IMPLICIT 315
#define TOK_IMPLIED 316
#define TOK_IMPORTS 317
#define TOK_INCLUDES 318
#define TOK_INSTANCE 319
#define TOK_INSTRUCTIONS 320
#define TOK_INTEGER 321
#define TOK_ISO646String 322
#define TOK_MAX 323
#define TOK_MIN 324
#define TOK_MINUS_INFINITY 325
#define TOK_NULL 326
#define TOK_NumericString 327
#define TOK_OBJECT 328
#define TOK_ObjectDescriptor 329
#define TOK_OCTET 330
#define TOK_OF 331
#define TOK_OPTIONAL 332
#define TOK_PATTERN 333
#define TOK_PDV 334
#define TOK_PLUS_INFINITY 335
#define TOK_PRESENT 336
#define TOK_PrintableString 337
#define TOK_PRIVATE 338
#define TOK_REAL 339
#define TOK_RELATIVE_OID 340
#define TOK_SEQUENCE 341
#define TOK_SET 342
#define TOK_SIZE 343
#define TOK_STRING 344
#define TOK_SYNTAX 345
#define TOK_T61String 346
#define TOK_TAGS 347
#define TOK_TeletexString 348
#define TOK_TRUE 349
#define TOK_TYPE_IDENTIFIER 350
#define TOK_UNIQUE 351
#define TOK_UNIVERSAL 352
#define TOK_UniversalString 353
#define TOK_UTCTime 354
#define TOK_UTF8String 355
#define TOK_VideotexString 356
#define TOK_VisibleString 357
#define TOK_WITH 358
#define UTF8_BOM 359
#define TOK_EXCEPT 360
#define TOK_INTERSECTION 361
#define TOK_UNION 362
#define TOK_TwoDots 363
#define TOK_ThreeDots 364
Lev Walkin's avatar
Lev Walkin committed
294 295 296 297 298 299 300 301 302 303 304




/* Copy the first part of user declarations.  */
#line 1 "asn1p_y.y"


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Lev Walkin's avatar
Lev Walkin committed
305
#include <stdarg.h>
Lev Walkin's avatar
Lev Walkin committed
306 307 308 309 310 311 312 313
#include <errno.h>
#include <assert.h>

#include "asn1parser.h"

#define YYPARSE_PARAM	param
#define YYPARSE_PARAM_TYPE	void **
#define YYERROR_VERBOSE
Lev Walkin's avatar
Lev Walkin committed
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
#define YYDEBUG 1
#define YYFPRINTF   prefixed_fprintf

/*
 * Prefix parser debug with "PARSER: " for easier human eye scanning.
 */
static int
__attribute__((format(printf, 2, 3)))
prefixed_fprintf(FILE *f, const char *fmt, ...) {
    static int line_ended = 1;
    va_list ap;
    va_start(ap, fmt);
    if(line_ended) {
        fprintf(f, "PARSER: ");
        line_ended = 0;
    }
    size_t len = strlen(fmt);
    if(len && fmt[len-1] == '\n') {
        line_ended = 1;
    }
    int ret = vfprintf(f, fmt, ap);
    va_end(ap);
    return ret;
}
Lev Walkin's avatar
Lev Walkin committed
338 339

int yylex(void);
340 341
static int yyerror(const char *msg);

Lev Walkin's avatar
Lev Walkin committed
342 343 344 345 346 347 348 349
#ifdef	YYBYACC
int yyparse(void **param);	/* byacc does not produce a prototype */
#endif
void asn1p_lexer_hack_push_opaque_state(void);
void asn1p_lexer_hack_enable_with_syntax(void);
void asn1p_lexer_hack_push_encoding_control(void);
#define	yylineno	asn1p_lineno
extern int asn1p_lineno;
350 351
const char *asn1p_parse_debug_filename;
#define ASN_FILENAME asn1p_parse_debug_filename
Lev Walkin's avatar
Lev Walkin committed
352 353 354 355 356 357 358 359 360 361 362

/*
 * Process directives as <ASN1C:RepresentAsPointer>
 */
extern int asn1p_as_pointer;

/*
 * This temporary variable is used to solve the shortcomings of 1-lookahead
 * parser.
 */
static struct AssignedIdentifier *saved_aid;
Lev Walkin's avatar
Lev Walkin committed
363

Lev Walkin's avatar
Lev Walkin committed
364 365 366 367 368 369 370 371 372 373
static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
static void _fixup_anonymous_identifier(asn1p_expr_t *expr);

static asn1p_module_t *currentModule;
#define	NEW_EXPR()	(asn1p_expr_new(yylineno, currentModule))

#define	checkmem(ptr)	do {						\
		if(!(ptr))						\
		return yyerror("Memory failure");			\
	} while(0)
Lev Walkin's avatar
Lev Walkin committed
374

Lev Walkin's avatar
Lev Walkin committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
#define	CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do {		\
		if(arg1->type != constr_type) {				\
			int __ret;					\
			root = asn1p_constraint_new(yylineno, currentModule);	\
			checkmem(root);					\
			root->type = constr_type;			\
			__ret = asn1p_constraint_insert(root,		\
				arg1);					\
			checkmem(__ret == 0);				\
		} else {						\
			root = arg1;					\
		}							\
		if(arg2) {						\
			int __ret					\
			= asn1p_constraint_insert(root, arg2);		\
			checkmem(__ret == 0);				\
		}							\
	} while(0)

#ifdef	AL_IMPORT
#error	AL_IMPORT DEFINED ELSEWHERE!
#endif
#define	AL_IMPORT(to,where,from,field)	do {				\
		if(!(from)) break;					\
		while(TQ_FIRST(&((from)->where))) {			\
			TQ_ADD(&((to)->where),				\
				TQ_REMOVE(&((from)->where), field),	\
				field);					\
		}							\
		assert(TQ_FIRST(&((from)->where)) == 0);		\
	} while(0)



/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

/* Enabling the token table.  */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
Lev Walkin's avatar
Lev Walkin committed
426

427 428
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
429
#line 116 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
430
{
Lev Walkin's avatar
Lev Walkin committed
431 432 433 434 435 436 437 438
	asn1p_t			*a_grammar;
	asn1p_module_flags_e	 a_module_flags;
	asn1p_module_t		*a_module;
	asn1p_expr_type_e	 a_type;	/* ASN.1 Type */
	asn1p_expr_t		*a_expr;	/* Constructed collection */
	asn1p_constraint_t	*a_constr;	/* Constraint */
	enum asn1p_constraint_type_e	a_ctype;/* Constraint type */
	asn1p_xports_t		*a_xports;	/* IMports/EXports */
439
	struct AssignedIdentifier a_aid;	/* Assigned Identifier */
Lev Walkin's avatar
Lev Walkin committed
440 441 442 443 444 445 446 447 448 449
	asn1p_oid_t		*a_oid;		/* Object Identifier */
	asn1p_oid_arc_t		 a_oid_arc;	/* Single OID's arc */
	struct asn1p_type_tag_s	 a_tag;		/* A tag */
	asn1p_ref_t		*a_ref;		/* Reference to custom type */
	asn1p_wsyntx_t		*a_wsynt;	/* WITH SYNTAX contents */
	asn1p_wsyntx_chunk_t	*a_wchunk;	/* WITH SYNTAX chunk */
	struct asn1p_ref_component_s a_refcomp;	/* Component of a reference */
	asn1p_value_t		*a_value;	/* Number, DefinedValue, etc */
	struct asn1p_param_s	 a_parg;	/* A parameter argument */
	asn1p_paramlist_t	*a_plist;	/* A pargs list */
Lev Walkin's avatar
Lev Walkin committed
450
	struct asn1p_expr_marker_s a_marker;	/* OPTIONAL/DEFAULT */
Lev Walkin's avatar
Lev Walkin committed
451
	enum asn1p_constr_pres_e a_pres;	/* PRESENT/ABSENT/OPTIONAL */
452
	asn1c_integer_t		 a_int;
453
	double			 a_dbl;
Lev Walkin's avatar
Lev Walkin committed
454 455 456 457 458 459 460 461 462
	char	*tv_str;
	struct {
		char *buf;
		int len;
	}	tv_opaque;
	struct {
		char *name;
		struct asn1p_type_tag_s tag;
	} tv_nametag;
Lev Walkin's avatar
Lev Walkin committed
463 464
}
/* Line 193 of yacc.c.  */
465
#line 466 "asn1p_y.c"
Lev Walkin's avatar
Lev Walkin committed
466
	YYSTYPE;
467 468
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
Lev Walkin's avatar
Lev Walkin committed
469
# define YYSTYPE_IS_TRIVIAL 1
470
#endif
Lev Walkin's avatar
Lev Walkin committed
471

Lev Walkin's avatar
Lev Walkin committed
472

Lev Walkin's avatar
Lev Walkin committed
473

474
/* Copy the second part of user declarations.  */
Lev Walkin's avatar
Lev Walkin committed
475

Lev Walkin's avatar
Lev Walkin committed
476 477

/* Line 216 of yacc.c.  */
478
#line 479 "asn1p_y.c"
Lev Walkin's avatar
Lev Walkin committed
479

480 481 482
#ifdef short
# undef short
#endif
Lev Walkin's avatar
Lev Walkin committed
483

484 485 486 487 488
#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif
Lev Walkin's avatar
Lev Walkin committed
489

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#elif (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
#else
typedef short int yytype_int8;
#endif

#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif

#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
Lev Walkin's avatar
Lev Walkin committed
520
# else
521 522 523 524 525 526 527 528 529 530
#  define YYSIZE_T unsigned int
# endif
#endif

#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin's avatar
Lev Walkin committed
531
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
532 533 534
#  endif
# endif
# ifndef YY_
Lev Walkin's avatar
Lev Walkin committed
535
#  define YY_(msgid) msgid
536 537 538 539 540
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
Lev Walkin's avatar
Lev Walkin committed
541
# define YYUSE(e) ((void) (e))
542
#else
Lev Walkin's avatar
Lev Walkin committed
543
# define YYUSE(e) /* empty */
544 545 546 547
#endif

/* Identity function, used to suppress warnings about constant conditions.  */
#ifndef lint
Lev Walkin's avatar
Lev Walkin committed
548
# define YYID(n) (n)
549 550 551 552
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static int
Lev Walkin's avatar
Lev Walkin committed
553
YYID (int i)
554 555
#else
static int
Lev Walkin's avatar
Lev Walkin committed
556 557
YYID (i)
    int i;
558 559
#endif
{
Lev Walkin's avatar
Lev Walkin committed
560
  return i;
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
}
#endif

#if ! defined yyoverflow || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
Lev Walkin's avatar
Lev Walkin committed
579
#   else
580
#    define YYSTACK_ALLOC alloca
Lev Walkin's avatar
Lev Walkin committed
581
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
582 583
     || defined __cplusplus || defined _MSC_VER)
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin's avatar
Lev Walkin committed
584 585
#     ifndef _STDLIB_H
#      define _STDLIB_H 1
586
#     endif
Lev Walkin's avatar
Lev Walkin committed
587 588 589 590 591 592
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
593 594 595 596 597 598 599 600 601
   /* Pacify GCC's `empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
Lev Walkin's avatar
Lev Walkin committed
602
# else
603 604 605 606 607
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
Lev Walkin's avatar
Lev Walkin committed
608
#  if (defined __cplusplus && ! defined _STDLIB_H \
609 610
       && ! ((defined YYMALLOC || defined malloc) \
	     && (defined YYFREE || defined free)))
Lev Walkin's avatar
Lev Walkin committed
611
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin's avatar
Lev Walkin committed
612 613
#   ifndef _STDLIB_H
#    define _STDLIB_H 1
614 615 616 617
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
Lev Walkin's avatar
Lev Walkin committed
618
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
619 620 621 622 623 624
     || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
Lev Walkin's avatar
Lev Walkin committed
625
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
626 627 628
     || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
Lev Walkin's avatar
Lev Walkin committed
629 630
#  endif
# endif
631
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Lev Walkin's avatar
Lev Walkin committed
632 633


634 635 636
#if (! defined yyoverflow \
     && (! defined __cplusplus \
	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Lev Walkin's avatar
Lev Walkin committed
637 638 639 640

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
Lev Walkin's avatar
Lev Walkin committed
641 642 643
  yytype_int16 yyss;
  YYSTYPE yyvs;
  };
Lev Walkin's avatar
Lev Walkin committed
644 645

/* The size of the maximum gap between one aligned stack and the next.  */
646
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
Lev Walkin's avatar
Lev Walkin committed
647 648 649 650

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
651 652
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)
Lev Walkin's avatar
Lev Walkin committed
653

Lev Walkin's avatar
Lev Walkin committed
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  YYSIZE_T yyi;				\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (YYID (0))
#  endif
# endif
Lev Walkin's avatar
Lev Walkin committed
671 672 673 674 675 676

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
Lev Walkin's avatar
Lev Walkin committed
677
# define YYSTACK_RELOCATE(Stack)					\
Lev Walkin's avatar
Lev Walkin committed
678 679 680
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
Lev Walkin's avatar
Lev Walkin committed
681 682
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
	Stack = &yyptr->Stack;						\
683
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
Lev Walkin's avatar
Lev Walkin committed
684 685
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
686
    while (YYID (0))
Lev Walkin's avatar
Lev Walkin committed
687

Lev Walkin's avatar
Lev Walkin committed
688
#endif
689

690
/* YYFINAL -- State number of the termination state.  */
Lev Walkin's avatar
Lev Walkin committed
691
#define YYFINAL  9
692
/* YYLAST -- Last index in YYTABLE.  */
693
#define YYLAST   919
Lev Walkin's avatar
Lev Walkin committed
694

695
/* YYNTOKENS -- Number of terminals.  */
696
#define YYNTOKENS  126
697
/* YYNNTS -- Number of nonterminals.  */
698
#define YYNNTS  147
699
/* YYNRULES -- Number of rules.  */
700
#define YYNRULES  342
701
/* YYNRULES -- Number of states.  */
702
#define YYNSTATES  522
Lev Walkin's avatar
Lev Walkin committed
703 704 705

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
706
#define YYMAXUTOK   365
Lev Walkin's avatar
Lev Walkin committed
707

708 709
#define YYTRANSLATE(YYX)						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Lev Walkin's avatar
Lev Walkin committed
710 711

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
712
static const yytype_uint8 yytranslate[] =
Lev Walkin's avatar
Lev Walkin committed
713 714 715 716
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
717 718 719 720
       2,     2,     2,   122,     2,     2,     2,     2,     2,     2,
     115,   116,     2,     2,   118,     2,   123,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   119,   117,
     124,     2,     2,     2,   125,     2,     2,     2,     2,     2,
Lev Walkin's avatar
Lev Walkin committed
721 722
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
723
       2,   120,     2,   121,   106,     2,     2,     2,     2,     2,
Lev Walkin's avatar
Lev Walkin committed
724 725
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
726
       2,     2,     2,   113,   108,   114,     2,     2,     2,     2,
Lev Walkin's avatar
Lev Walkin committed
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
Lev Walkin's avatar
Lev Walkin committed
749
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
750
     105,   107,   109,   110,   111,   112
751
};
Lev Walkin's avatar
Lev Walkin committed
752

Lev Walkin's avatar
Lev Walkin committed
753 754 755
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
756
static const yytype_uint16 yyprhs[] =
Lev Walkin's avatar
Lev Walkin committed
757
{
Lev Walkin's avatar
Lev Walkin committed
758 759 760 761 762 763
       0,     0,     3,     6,     8,    10,    13,    14,    24,    25,
      27,    31,    34,    36,    39,    41,    46,    48,    49,    51,
      53,    56,    59,    62,    65,    68,    71,    72,    74,    78,
      80,    83,    85,    87,    89,    90,    94,    96,    97,    99,
     103,   106,   107,   109,   111,   114,   115,   117,   122,   124,
     128,   130,   134,   136,   137,   139,   143,   147,   150,   152,
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792
     156,   158,   162,   164,   168,   173,   175,   180,   184,   188,
     195,   202,   204,   208,   210,   214,   218,   222,   226,   228,
     232,   234,   236,   238,   240,   241,   243,   245,   249,   255,
     259,   262,   266,   268,   270,   274,   277,   279,   281,   287,
     288,   290,   292,   296,   299,   304,   308,   312,   316,   320,
     324,   325,   327,   328,   335,   337,   340,   342,   344,   346,
     350,   352,   356,   360,   362,   365,   368,   371,   375,   376,
     379,   381,   383,   385,   390,   395,   400,   407,   414,   416,
     421,   425,   427,   429,   433,   437,   441,   443,   447,   449,
     451,   453,   455,   459,   463,   465,   470,   472,   474,   475,
     479,   481,   483,   485,   487,   489,   491,   493,   495,   499,
     501,   503,   505,   507,   510,   512,   514,   516,   518,   520,
     523,   526,   528,   530,   533,   536,   538,   540,   542,   544,
     546,   548,   551,   553,   558,   563,   569,   574,   578,   580,
     582,   584,   586,   588,   590,   592,   594,   596,   598,   600,
     602,   604,   606,   608,   610,   612,   614,   615,   617,   618,
     620,   621,   623,   625,   629,   631,   634,   636,   638,   640,
     642,   644,   648,   654,   656,   660,   662,   666,   668,   672,
     674,   678,   680,   684,   686,   688,   690,   692,   694,   696,
     698,   701,   704,   707,   710,   714,   716,   718,   720,   722,
     724,   726,   728,   731,   733,   737,   741,   743,   745,   747,
     751,   757,   759,   763,   767,   768,   770,   772,   774,   776,
     778,   780,   782,   783,   789,   792,   794,   797,   800,   804,
     806,   808,   812,   817,   819,   823,   826,   830,   832,   836,
     837,   839,   841,   844,   846,   850,   852,   854,   858,   863,
     868,   870,   874,   879,   884,   886,   888,   892,   894,   899,
     904,   906,   908,   910,   912,   914,   915,   917,   920,   925,
     926,   928,   930,   932,   933,   935,   937,   939,   941,   942,
     944,   946,   948
793
};
Lev Walkin's avatar
Lev Walkin committed
794

795 796
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
static const yytype_int16 yyrhs[] =
Lev Walkin's avatar
Lev Walkin committed
797
{
798 799 800 801 802 803
     127,     0,    -1,   104,   128,    -1,   128,    -1,   129,    -1,
     128,   129,    -1,    -1,   268,   130,   131,    42,   135,     3,
      29,   138,    47,    -1,    -1,   132,    -1,   113,   133,   114,
      -1,   113,   114,    -1,   134,    -1,   133,   134,    -1,   270,
      -1,   270,   115,    12,   116,    -1,    12,    -1,    -1,   136,
      -1,   137,    -1,   136,   137,    -1,    49,    92,    -1,    60,
Lev Walkin's avatar
Lev Walkin committed
804
      92,    -1,    28,    92,    -1,    51,    61,    -1,    18,    65,
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892
      -1,    -1,   139,    -1,   151,   143,   140,    -1,   141,    -1,
     140,   141,    -1,   158,    -1,   193,    -1,   156,    -1,    -1,
      46,    18,   142,    -1,   204,    -1,    -1,   144,    -1,    62,
     145,   117,    -1,    62,    54,    -1,    -1,   146,    -1,   148,
      -1,   146,   148,    -1,    -1,   132,    -1,   149,    54,   268,
     147,    -1,   150,    -1,   149,   118,   150,    -1,   268,    -1,
     268,   113,   114,    -1,   270,    -1,    -1,   152,    -1,    50,
     153,   117,    -1,    50,    25,   117,    -1,    50,   117,    -1,
     154,    -1,   153,   118,   154,    -1,   268,    -1,   268,   113,
     114,    -1,   270,    -1,   113,   214,   114,    -1,   268,   178,
       3,   155,    -1,   187,    -1,   187,   113,   161,   114,    -1,
     268,     3,   178,    -1,   268,     3,   168,    -1,   268,   113,
     159,   114,     3,   178,    -1,   268,   113,   159,   114,     3,
     168,    -1,   160,    -1,   159,   118,   160,    -1,   268,    -1,
     268,   119,   270,    -1,   268,   119,   268,    -1,   201,   119,
     270,    -1,   201,   119,   268,    -1,   162,    -1,   161,   118,
     162,    -1,   181,    -1,   196,    -1,   197,    -1,   155,    -1,
      -1,   164,    -1,   165,    -1,   164,   118,   165,    -1,   164,
     118,     4,   164,     5,    -1,   270,   182,   250,    -1,   182,
     250,    -1,    38,    76,   182,    -1,   177,    -1,   167,    -1,
     166,   118,   167,    -1,   270,   182,    -1,   177,    -1,   182,
      -1,    36,   113,   170,   114,   172,    -1,    -1,    96,    -1,
     171,    -1,   170,   118,   171,    -1,    19,   250,    -1,    20,
     178,   169,   250,    -1,    20,   191,   250,    -1,    20,   192,
     250,    -1,    19,   191,   250,    -1,    19,   178,   250,    -1,
      19,   192,   250,    -1,    -1,   173,    -1,    -1,   103,    90,
     113,   174,   175,   114,    -1,   176,    -1,   175,   176,    -1,
       6,    -1,    21,    -1,   190,    -1,   120,   175,   121,    -1,
     111,    -1,   111,   122,   197,    -1,   111,   122,   261,    -1,
     179,    -1,   263,   181,    -1,   157,   208,    -1,   185,   208,
      -1,   263,   184,   208,    -1,    -1,   183,   185,    -1,   186,
      -1,   157,    -1,   203,    -1,    35,   113,   166,   114,    -1,
      86,   113,   163,   114,    -1,    87,   113,   163,   114,    -1,
      86,   209,    76,   269,   263,   184,    -1,    87,   209,    76,
     269,   263,   184,    -1,    26,    -1,    26,    43,    33,   270,
      -1,    64,    76,   187,    -1,    17,    -1,    18,    -1,    17,
     123,   268,    -1,    18,   123,   268,    -1,    18,   123,   188,
      -1,   189,    -1,   188,   123,   189,    -1,   190,    -1,    19,
      -1,    20,    -1,    19,    -1,   191,   123,    19,    -1,   191,
     123,    20,    -1,    18,    -1,   270,   178,     3,   194,    -1,
     196,    -1,   197,    -1,    -1,   113,   195,   199,    -1,    71,
      -1,    53,    -1,    94,    -1,   261,    -1,   262,    -1,   198,
      -1,   228,    -1,   272,    -1,   268,   123,   270,    -1,     9,
      -1,    15,    -1,    16,    -1,   200,    -1,   199,     7,    -1,
       7,    -1,   270,    -1,    32,    -1,    71,    -1,    84,    -1,
      75,    89,    -1,    73,    59,    -1,    85,    -1,    52,    -1,
      44,    79,    -1,    34,    89,    -1,    99,    -1,    55,    -1,
     204,    -1,   202,    -1,    66,    -1,    48,    -1,    30,    89,
      -1,   201,    -1,    66,   113,   254,   114,    -1,    48,   113,
     258,   114,    -1,    30,    89,   113,   256,   114,    -1,    22,
     113,   252,   114,    -1,    22,   113,   114,    -1,    31,    -1,
      56,    -1,    57,    -1,    58,    -1,    67,    -1,    72,    -1,
      82,    -1,    91,    -1,    93,    -1,    98,    -1,   100,    -1,
     101,    -1,   102,    -1,    74,    -1,   108,    -1,   109,    -1,
     106,    -1,   107,    -1,    -1,   210,    -1,    -1,   211,    -1,
      -1,   210,    -1,   222,    -1,   115,   212,   116,    -1,   210,
      -1,   211,   210,    -1,   213,    -1,   239,    -1,   214,    -1,
     111,    -1,   215,    -1,   215,   118,   111,    -1,   215,   118,
     111,   118,   215,    -1,   216,    -1,    25,   105,   219,    -1,
     217,    -1,   216,   205,   217,    -1,   218,    -1,   217,   206,
     218,    -1,   219,    -1,   219,   105,   219,    -1,   220,    -1,
     115,   215,   116,    -1,   227,    -1,   229,    -1,   221,    -1,
     222,    -1,   230,    -1,   223,    -1,   224,    -1,    54,   210,
      -1,    88,   210,    -1,    78,     9,    -1,    78,   270,    -1,
     225,   243,   226,    -1,   227,    -1,    69,    -1,   227,    -1,
      68,    -1,   194,    -1,     8,    -1,    10,    -1,    63,   178,
      -1,   180,    -1,   103,    37,   231,    -1,   103,    38,   232,
      -1,   210,    -1,   233,    -1,   234,    -1,   113,   235,   114,
      -1,   113,   111,   118,   235,   114,    -1,   236,    -1,   235,
     118,   236,    -1,   272,   207,   237,    -1,    -1,   238,    -1,
      81,    -1,    23,    -1,    77,    -1,   240,    -1,   244,    -1,
     242,    -1,    -1,    39,    33,   113,   241,   199,    -1,    40,
     178,    -1,   110,    -1,   110,   124,    -1,   124,   110,    -1,
     124,   110,   124,    -1,   245,    -1,   246,    -1,   113,   268,
     114,    -1,   245,   113,   247,   114,    -1,   248,    -1,   247,
     118,   248,    -1,   125,   249,    -1,   125,   123,   249,    -1,
     270,    -1,   249,   123,   270,    -1,    -1,   251,    -1,    77,
      -1,    41,   194,    -1,   253,    -1,   252,   118,   253,    -1,
     270,    -1,   255,    -1,   254,   118,   255,    -1,   270,   115,
     261,   116,    -1,   270,   115,   197,   116,    -1,   257,    -1,
     256,   118,   257,    -1,   270,   115,    12,   116,    -1,   270,
     115,   197,   116,    -1,   259,    -1,   260,    -1,   259,   118,
     260,    -1,   270,    -1,   270,   115,   261,   116,    -1,   270,
     115,   197,   116,    -1,   261,    -1,   111,    -1,    12,    -1,
      13,    -1,    14,    -1,    -1,   264,    -1,   265,   267,    -1,
     120,   266,    12,   121,    -1,    -1,    97,    -1,    27,    -1,
      83,    -1,    -1,    60,    -1,    49,    -1,    17,    -1,    18,
      -1,    -1,   270,    -1,    11,    -1,   270,    -1,   271,    -1
Lev Walkin's avatar
Lev Walkin committed
893
};
Lev Walkin's avatar
Lev Walkin committed
894

Lev Walkin's avatar
Lev Walkin committed
895
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
896
static const yytype_uint16 yyrline[] =
Lev Walkin's avatar
Lev Walkin committed
897
{
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
       0,   415,   415,   418,   424,   429,   446,   446,   475,   476,
     480,   483,   489,   495,   504,   508,   512,   522,   523,   532,
     535,   544,   547,   550,   553,   557,   578,   579,   588,   601,
     604,   621,   628,   642,   650,   649,   663,   676,   677,   680,
     690,   696,   697,   700,   705,   712,   713,   717,   728,   733,
     740,   746,   752,   762,   763,   775,   778,   781,   789,   794,
     801,   807,   813,   822,   825,   845,   855,   875,   881,   897,
     903,   911,   920,   931,   935,   943,   951,   959,   970,   975,
     982,   983,   991,   999,  1022,  1023,  1026,  1031,  1035,  1043,
    1050,  1056,  1063,  1069,  1074,  1081,  1086,  1089,  1096,  1106,
    1107,  1111,  1118,  1128,  1138,  1149,  1159,  1170,  1180,  1191,
    1203,  1204,  1211,  1210,  1219,  1223,  1230,  1234,  1237,  1241,
    1247,  1255,  1264,  1275,  1278,  1285,  1308,  1331,  1355,  1362,
    1381,  1382,  1385,  1386,  1392,  1398,  1404,  1414,  1424,  1430,
    1442,  1457,  1465,  1473,  1484,  1495,  1517,  1525,  1534,  1538,
    1543,  1552,  1557,  1562,  1570,  1593,  1603,  1604,  1605,  1605,
    1613,  1618,  1623,  1628,  1629,  1630,  1631,  1635,  1636,  1654,
    1658,  1663,  1671,  1680,  1695,  1696,  1702,  1703,  1704,  1705,
    1706,  1707,  1708,  1709,  1710,  1711,  1712,  1713,  1714,  1721,
    1722,  1723,  1727,  1733,  1738,  1743,  1748,  1753,  1762,  1763,
    1767,  1771,  1772,  1773,  1774,  1775,  1779,  1780,  1781,  1782,
    1786,  1787,  1794,  1794,  1795,  1795,  1799,  1800,  1804,  1805,
    1809,  1810,  1811,  1815,  1821,  1822,  1831,  1831,  1833,  1836,
    1840,  1841,  1847,  1858,  1859,  1865,  1866,  1872,  1873,  1880,
    1881,  1887,  1888,  1899,  1905,  1911,  1912,  1914,  1915,  1916,
    1921,  1926,  1931,  1936,  1948,  1957,  1958,  1964,  1965,  1970,
    1973,  1978,  1986,  1991,  2002,  2005,  2011,  2012,  2012,  2013,
    2015,  2028,  2033,  2039,  2053,  2054,  2058,  2061,  2064,  2072,
    2073,  2074,  2079,  2078,  2090,  2099,  2100,  2101,  2102,  2105,
    2108,  2117,  2133,  2139,  2145,  2159,  2170,  2186,  2189,  2209,
    2213,  2217,  2221,  2228,  2233,  2239,  2248,  2253,  2260,  2268,
    2278,  2283,  2290,  2298,  2308,  2323,  2328,  2335,  2342,  2350,
    2358,  2365,  2376,  2380,  2387,  2418,  2419,  2423,  2430,  2436,
    2437,  2438,  2439,  2443,  2444,  2445,  2449,  2453,  2461,  2462,
    2468,  2475,  2481
933
};
934
#endif
Lev Walkin's avatar
Lev Walkin committed
935

Lev Walkin's avatar
Lev Walkin committed
936
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
937 938
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
Lev Walkin's avatar
Lev Walkin committed
939 940
static const char *const yytname[] =
{
941 942
  "$end", "error", "$undefined", "TOK_PPEQ", "TOK_VBracketLeft",
  "TOK_VBracketRight", "TOK_whitespace", "TOK_opaque", "TOK_bstring",
Lev Walkin's avatar
Lev Walkin committed
943 944
  "TOK_cstring", "TOK_hstring", "\"identifier\"", "\"number\"",
  "\"negative number\"", "TOK_realnumber", "TOK_tuple", "TOK_quadruple",
945
  "TOK_typereference", "TOK_capitalreference", "TOK_typefieldreference",
Lev Walkin's avatar
Lev Walkin committed
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965
  "TOK_valuefieldreference", "TOK_Literal", "TOK_ExtValue_BIT_STRING",
  "TOK_ABSENT", "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY",
  "TOK_APPLICATION", "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT",
  "TOK_BMPString", "TOK_BOOLEAN", "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE",
  "TOK_CLASS", "TOK_COMPONENT", "TOK_COMPONENTS", "TOK_CONSTRAINED",
  "TOK_CONTAINING", "TOK_DEFAULT", "TOK_DEFINITIONS", "TOK_DEFINED",
  "TOK_EMBEDDED", "TOK_ENCODED", "TOK_ENCODING_CONTROL", "TOK_END",
  "TOK_ENUMERATED", "TOK_EXPLICIT", "TOK_EXPORTS", "TOK_EXTENSIBILITY",
  "TOK_EXTERNAL", "TOK_FALSE", "TOK_FROM", "TOK_GeneralizedTime",
  "TOK_GeneralString", "TOK_GraphicString", "TOK_IA5String",
  "TOK_IDENTIFIER", "TOK_IMPLICIT", "TOK_IMPLIED", "TOK_IMPORTS",
  "TOK_INCLUDES", "TOK_INSTANCE", "TOK_INSTRUCTIONS", "TOK_INTEGER",
  "TOK_ISO646String", "TOK_MAX", "TOK_MIN", "TOK_MINUS_INFINITY",
  "TOK_NULL", "TOK_NumericString", "TOK_OBJECT", "TOK_ObjectDescriptor",
  "TOK_OCTET", "TOK_OF", "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV",
  "TOK_PLUS_INFINITY", "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE",
  "TOK_REAL", "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE",
  "TOK_STRING", "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS",
  "TOK_TeletexString", "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE",
  "TOK_UNIVERSAL", "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
Lev Walkin's avatar
Lev Walkin committed
966 967
  "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH",
  "\"UTF-8 byte order mark\"", "TOK_EXCEPT", "'^'", "TOK_INTERSECTION",
968 969 970 971 972 973 974 975 976 977 978 979
  "'|'", "TOK_UNION", "\"..\"", "\"...\"", "\"concrete TypeDeclaration\"",
  "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['", "']'", "'!'",
  "'.'", "'<'", "'@'", "$accept", "ParsedGrammar", "ModuleList",
  "ModuleDefinition", "@1", "optObjectIdentifier", "ObjectIdentifier",
  "ObjectIdentifierBody", "ObjectIdentifierElement",
  "optModuleDefinitionFlags", "ModuleDefinitionFlags",
  "ModuleDefinitionFlag", "optModuleBody", "ModuleBody", "AssignmentList",
  "Assignment", "@2", "optImports", "ImportsDefinition",
  "optImportsBundleSet", "ImportsBundleSet", "AssignedIdentifier",
  "ImportsBundle", "ImportsList", "ImportsElement", "optExports",
  "ExportsDefinition", "ExportsBody", "ExportsElement", "ValueSet",
  "ValueSetTypeAssignment", "DefinedType", "DataTypeReference",
980 981 982
  "ParameterArgumentList", "ParameterArgumentName", "ActualParameterList",
  "ActualParameter", "optComponentTypeLists", "ComponentTypeLists",
  "ComponentType", "AlternativeTypeLists", "AlternativeType",
Lev Walkin's avatar
Lev Walkin committed
983
  "ObjectClass", "optUNIQUE", "FieldSpec", "ClassField", "optWithSyntax",
Lev Walkin's avatar
Lev Walkin committed
984
  "WithSyntax", "@3", "WithSyntaxList", "WithSyntaxToken",
985 986 987 988
  "ExtensionAndException", "Type", "TaggedType", "DefinedUntaggedType",
  "UntaggedType", "MaybeIndirectTaggedType", "NSTD_IndirectMarker",
  "MaybeIndirectTypeDeclaration", "TypeDeclaration",
  "ConcreteTypeDeclaration", "ComplexTypeReference",
989 990
  "ComplexTypeReferenceAmpList", "ComplexTypeReferenceElement",
  "PrimitiveFieldReference", "FieldName", "DefinedObjectClass",
Lev Walkin's avatar
Lev Walkin committed
991
  "ValueAssignment", "Value", "@4", "SimpleValue", "DefinedValue",
992
  "RestrictedCharacterStringValue", "Opaque", "OpaqueFirstToken",
993
  "BasicTypeId", "BasicTypeId_UniverationCompatible", "BuiltinType",
994 995 996 997
  "BasicString", "UnionMark", "IntersectionMark", "optConstraint",
  "optManyConstraints", "optSizeOrConstraint", "Constraint",
  "ManyConstraints", "ConstraintSpec", "SubtypeConstraint",
  "ElementSetSpecs", "ElementSetSpec", "Unions", "Intersections",
998
  "IntersectionElements", "Elements", "SubtypeElements",
999 1000
  "PermittedAlphabet", "SizeConstraint", "PatternConstraint", "ValueRange",
  "LowerEndValue", "UpperEndValue", "SingleValue", "BitStringValue",
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011
  "ContainedSubtype", "InnerTypeConstraints", "SingleTypeConstraint",
  "MultipleTypeConstraints", "FullSpecification", "PartialSpecification",
  "TypeConstraints", "NamedConstraint", "optPresenceConstraint",
  "PresenceConstraint", "GeneralConstraint", "UserDefinedConstraint", "@5",
  "ContentsConstraint", "ConstraintRangeSpec", "TableConstraint",
  "SimpleTableConstraint", "ComponentRelationConstraint", "AtNotationList",
  "AtNotationElement", "ComponentIdList", "optMarker", "Marker",
  "IdentifierList", "IdentifierElement", "NamedNumberList", "NamedNumber",
  "NamedBitList", "NamedBit", "Enumerations", "UniverationList",
  "UniverationElement", "SignedNumber", "RealValue", "optTag", "Tag",
  "TagTypeValue", "TagClass", "TagPlicit", "TypeRefName", "optIdentifier",
1012
  "Identifier", "IdentifierAsReference", "IdentifierAsValue", 0
1013
};
Lev Walkin's avatar
Lev Walkin committed
1014
#endif
Lev Walkin's avatar
Lev Walkin committed
1015

Lev Walkin's avatar
Lev Walkin committed
1016 1017 1018
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
1019
static const yytype_uint16 yytoknum[] =
Lev Walkin's avatar
Lev Walkin committed
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
Lev Walkin's avatar
Lev Walkin committed
1031
     355,   356,   357,   358,   359,   360,    94,   361,   124,   362,
1032 1033
     363,   364,   365,   123,   125,    40,    41,    59,    44,    58,
      91,    93,    33,    46,    60,    64
Lev Walkin's avatar
Lev Walkin committed
1034
};
Lev Walkin's avatar
Lev Walkin committed
1035 1036 1037
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
Lev Walkin's avatar
Lev Walkin committed
1038
static const yytype_uint16 yyr1[] =
Lev Walkin's avatar
Lev Walkin committed
1039
{
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
       0,   126,   127,   127,   128,   128,   130,   129,   131,   131,
     132,   132,   133,   133,   134,   134,   134,   135,   135,   136,
     136,   137,   137,   137,   137,   137,   138,   138,   139,   140,
     140,   141,   141,   141,   142,   141,   141,   143,   143,   144,
     144,   145,   145,   146,   146,   147,   147,   148,   149,   149,
     150,   150,   150,   151,   151,   152,   152,   152,   153,   153,
     154,   154,   154,   155,   156,   157,   157,   158,   158,   158,
     158,   159,   159,   160,   160,   160,   160,   160,   161,   161,
     162,   162,   162,   162,   163,   163,   164,   164,   164,   165,
     165,   165,   165,   166,   166,   167,   167,   167,   168,   169,
     169,   170,   170,   171,   171,   171,   171,   171,   171,   171,
     172,   172,   174,   173,   175,   175,   176,   176,   176,   176,
     177,   177,   177,   178,   179,   180,   181,   182,   183,   184,
     185,   185,   186,   186,   186,   186,   186,   186,   186,   186,
     186,   187,   187,   187,   187,   187,   188,   188,   189,   190,
     190,   191,   191,   191,   192,   193,   194,   194,   195,   194,
     196,   196,   196,   196,   196,   196,   196,   197,   197,   198,
     198,   198,   199,   199,   200,   200,   201,   201,   201,   201,
     201,   201,   201,   201,   201,   201,   201,   201,   201,   202,
     202,   202,   203,   203,   203,   203,   203,   203,   204,   204,
     204,   204,   204,   204,   204,   204,   204,   204,   204,   204,
     204,   204,   205,   205,   206,   206,   207,   207,   208,   208,
     209,   209,   209,   210,   211,   211,   212,   212,   213,   214,
     214,   214,   214,   215,   215,   216,   216,   217,   217,   218,
     218,   219,   219,   220,   220,   220,   220,   220,   220,   220,
     221,   222,   223,   223,   224,   225,   225,   226,   226,   227,
     228,   228,   229,   229,   230,   230,   231,   232,   232,   233,
     234,   235,   235,   236,   237,   237,   238,   238,   238,   239,
     239,   239,   241,   240,   242,   243,   243,   243,   243,   244,
     244,   245,   246,   247,   247,   248,   248,   249,   249,   250,
     250,   251,   251,   252,   252,   253,   254,   254,   255,   255,
     256,   256,   257,   257,   258,   259,   259,   260,   260,   260,
     260,   260,   261,   261,   262,   263,   263,   264,   265,   266,
     266,   266,   266,   267,   267,   267,   268,   268,   269,   269,
     270,   271,   272
Lev Walkin's avatar
Lev Walkin committed
1075
};
Lev Walkin's avatar
Lev Walkin committed
1076

Lev Walkin's avatar
Lev Walkin committed
1077
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
1078
static const yytype_uint8 yyr2[] =
Lev Walkin's avatar
Lev Walkin committed
1079
{
Lev Walkin's avatar
Lev Walkin committed
1080 1081 1082 1083 1084 1085
       0,     2,     2,     1,     1,     2,     0,     9,     0,     1,
       3,     2,     1,     2,     1,     4,     1,     0,     1,     1,
       2,     2,     2,     2,     2,     2,     0,     1,     3,     1,
       2,     1,     1,     1,     0,     3,     1,     0,     1,     3,
       2,     0,     1,     1,     2,     0,     1,     4,     1,     3,
       1,     3,     1,     0,     1,     3,     3,     2,     1,     3,
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
       1,     3,     1,     3,     4,     1,     4,     3,     3,     6,
       6,     1,     3,     1,     3,     3,     3,     3,     1,     3,
       1,     1,     1,     1,     0,     1,     1,     3,     5,     3,
       2,     3,     1,     1,     3,     2,     1,     1,     5,     0,
       1,     1,     3,     2,     4,     3,     3,     3,     3,     3,
       0,     1,     0,     6,     1,     2,     1,     1,     1,     3,
       1,     3,     3,     1,     2,     2,     2,     3,     0,     2,
       1,     1,     1,     4,     4,     4,     6,     6,     1,     4,
       3,     1,     1,     3,     3,     3,     1,     3,     1,     1,
       1,     1,     3,     3,     1,     4,     1,     1,     0,     3,
       1,     1,     1,     1,     1,     1,     1,     1,     3,     1,
       1,     1,     1,     2,     1,     1,     1,     1,     1,     2,
       2,     1,     1,     2,     2,     1,     1,     1,     1,     1,
       1,     2,     1,     4,     4,     5,     4,     3,     1,     1,
Lev Walkin's avatar
Lev Walkin committed
1100
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
       1,     1,     1,     1,     1,     1,     0,     1,     0,     1,
       0,     1,     1,     3,     1,     2,     1,     1,     1,     1,
       1,     3,     5,     1,     3,     1,     3,     1,     3,     1,
       3,     1,     3,     1,     1,     1,     1,     1,     1,     1,
       2,     2,     2,     2,     3,     1,     1,     1,     1,     1,
       1,     1,     2,     1,     3,     3,     1,     1,     1,     3,
       5,     1,     3,     3,     0,     1,     1,     1,     1,     1,
       1,     1,     0,     5,     2,     1,     2,     2,     3,     1,
       1,     3,     4,     1,     3,     2,     3,     1,     3,     0,
       1,     1,     2,     1,     3,     1,     1,     3,     4,     4,
       1,     3,     4,     4,     1,     1,     3,     1,     4,     4,
       1,     1,     1,     1,     1,     0,     1,     2,     4,     0,
       1,     1,     1,     0,     1,     1,     1,     1,     0,     1,
       1,     1,     1
Lev Walkin's avatar
Lev Walkin committed
1115
};
Lev Walkin's avatar
Lev Walkin committed
1116

Lev Walkin's avatar
Lev Walkin committed
1117 1118
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
Lev Walkin's avatar
Lev Walkin committed
1119
   means the default is an error.  */
1120
static const yytype_uint16 yydefact[] =
Lev Walkin's avatar
Lev Walkin committed
1121
{
1122 1123
       0,   336,   337,     0,     0,     3,     4,     6,     2,     1,
       5,     8,     0,     0,     9,   340,    16,    11,     0,    12,
Lev Walkin's avatar
Lev Walkin committed
1124 1125 1126 1127 1128
      14,    17,    10,    13,     0,     0,     0,     0,     0,     0,
       0,    18,    19,     0,    25,    23,    21,    24,    22,     0,
      20,    15,    53,     0,     0,    27,    37,    54,     0,    57,
       0,    58,    60,    62,     7,    41,     0,    38,    56,    55,
       0,     0,    40,     0,    42,    43,     0,    48,    50,    52,
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174
     198,     0,   199,   200,   201,   202,   203,   211,   204,   205,
     206,   207,   208,   209,   210,    28,    29,    33,    31,    32,
      36,   325,   325,    59,    61,    39,    44,     0,     0,     0,
      34,    30,   325,     0,   329,     0,   123,     0,   326,   333,
       0,    45,    49,    51,    35,     0,    68,    67,     0,   176,
       0,     0,   190,   182,   186,   189,   177,     0,     0,   178,
     181,   185,     0,    71,     0,   188,   187,    73,   331,   332,
     330,     0,     0,   141,   142,     0,   138,     0,     0,   190,
       0,   189,   220,   220,   131,   124,   218,   130,    65,   192,
     132,   335,   334,   327,     0,    46,    47,     0,   191,   184,
     183,   180,   179,     0,     0,     0,     0,     0,     0,    64,
       0,     0,     0,     0,   191,   325,     0,     0,     0,     0,
     325,     0,     0,   221,   222,   325,     0,   126,   224,   219,
       0,   260,   169,   261,   322,   323,   324,   170,   171,   161,
     160,   162,   158,   155,   156,   157,   165,   166,   163,   164,
       0,   341,   342,   167,   325,   325,     0,   101,   325,    72,
      77,    76,    75,    74,   328,   141,   142,     0,     0,   325,
     256,     0,     0,   229,     0,   218,   263,   259,     0,   230,
     233,   235,   237,   239,   241,   245,   246,   248,   249,     0,
     243,   244,   247,   143,   149,   150,   145,   146,   148,   144,
     197,     0,   303,   305,     0,     0,   120,     0,    93,    96,
      97,   128,   325,   321,     0,   314,   315,   320,   317,   140,
       0,   306,     0,   251,     0,     0,    85,    86,    92,   299,
     325,     0,   325,   158,     0,   226,   228,   227,   279,   281,
     280,   289,   290,   338,     0,   338,   225,   160,    83,     0,
      78,    80,    81,    82,     0,     0,   154,   151,     0,   301,
     299,   299,   299,   103,   300,    99,   299,   299,   110,     0,
      70,    69,     0,   250,   262,   252,   253,     0,     0,     0,
     125,    63,     0,   212,   213,     0,   214,   215,     0,     0,
     285,     0,     0,     0,   196,     0,   139,     0,   310,     0,
       0,   133,   325,     0,   218,    95,   194,     0,     0,   193,
       0,     0,   325,   134,   325,    90,   299,     0,   284,     0,
     223,     0,   325,   339,   135,   325,    66,     0,   174,   159,
     172,   175,   168,   302,   108,     0,   107,   109,   100,   299,
     105,   106,     0,    98,   111,   102,   234,   266,   264,     0,
     265,   267,   268,   242,   231,   236,   238,   240,   286,   287,
     258,   254,   257,   147,   304,   195,     0,     0,   121,   122,
      94,   129,   127,   316,     0,     0,   307,     0,     0,    91,
     325,    87,    89,   282,   291,     0,     0,   293,   128,   128,
      79,   173,   152,   153,   104,     0,     0,     0,   271,   216,
       0,   288,   311,     0,     0,   319,   318,   309,   308,     0,
       0,     0,   295,   297,   292,     0,   136,   137,   112,     0,
     269,     0,   274,   217,   232,   312,   313,    88,   283,   296,
       0,   294,     0,     0,   272,   277,   278,   276,   273,   275,
     298,   116,   117,     0,     0,   114,   118,   270,     0,   113,
     115,   119
Lev Walkin's avatar
Lev Walkin committed
1175
};
Lev Walkin's avatar
Lev Walkin committed
1176

1177 1178
/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
Lev Walkin's avatar
Lev Walkin committed
1179
{
Lev Walkin's avatar
Lev Walkin committed
1180
      -1,     4,     5,     6,    11,    13,    14,    18,    19,    30,
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
      31,    32,    44,    45,    85,    86,   114,    56,    57,    63,
      64,   166,    65,    66,    67,    46,    47,    50,    51,   318,
      87,   245,    88,   132,   133,   319,   320,   295,   296,   297,
     277,   278,   116,   409,   226,   227,   413,   414,   502,   514,
     515,   298,   105,   106,   246,   321,   299,   373,   374,   156,
     157,   158,   266,   267,   516,   331,   332,    89,   247,   324,
     214,   215,   216,   399,   400,   159,   135,   160,   136,   355,
     358,   492,   197,   192,   198,   199,   304,   305,   248,   249,
     250,   251,   252,   253,   254,   255,   256,   257,   258,   259,
     431,   260,   217,   261,   262,   418,   420,   421,   422,   467,
     468,   508,   509,   307,   308,   480,   309,   362,   310,   311,
     312,   456,   457,   482,   333,   334,   271,   272,   290,   291,
     367,   368,   284,   285,   286,   218,   219,   281,   108,   109,
     141,   163,   220,   392,   221,   222,   223
Lev Walkin's avatar
Lev Walkin committed
1195
};
1196

Lev Walkin's avatar
Lev Walkin committed
1197 1198
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
1199
#define YYPACT_NINF -296
1200
static const yytype_int16 yypact[] =
Lev Walkin's avatar
Lev Walkin committed
1201
{
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254
      51,  -296,  -296,   217,    41,   217,  -296,  -296,   217,  -296,
    -296,   -63,    53,    43,  -296,  -296,  -296,  -296,    70,  -296,
     -45,   204,  -296,  -296,    79,    32,    30,    38,   110,    87,
     200,   204,  -296,    95,  -296,  -296,  -296,  -296,  -296,   198,
    -296,  -296,   247,    12,   178,  -296,   174,  -296,   134,  -296,
     140,  -296,   183,  -296,  -296,    72,   663,  -296,  -296,  -296,
     213,   173,  -296,   187,   213,  -296,    50,  -296,   211,  -296,
    -296,   293,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,
    -296,  -296,  -296,  -296,  -296,   663,  -296,  -296,  -296,  -296,
    -296,    19,   219,  -296,  -296,  -296,  -296,   217,   213,   227,
    -296,  -296,    -2,   817,    68,   340,  -296,   740,  -296,   120,
     356,   -63,  -296,  -296,  -296,   249,  -296,  -296,   272,  -296,
     274,   285,  -296,  -296,  -296,  -296,  -296,   307,   278,  -296,
    -296,  -296,    13,  -296,   250,  -296,  -296,   251,  -296,  -296,
    -296,   359,   260,   264,   265,   261,   346,   301,   279,   281,
     315,   294,   113,   135,  -296,  -296,   280,  -296,   295,  -296,
    -296,  -296,  -296,  -296,   510,  -296,  -296,   290,  -296,  -296,
    -296,  -296,  -296,   406,   817,   213,   213,   289,   368,  -296,
     217,   309,    14,   378,   299,    29,   108,   318,   403,   280,
      61,   229,   339,  -296,  -296,    61,   341,  -296,  -296,   280,
     604,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,
    -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,
     296,  -296,  -296,  -296,    84,    28,    98,  -296,    -2,  -296,
    -296,  -296,  -296,  -296,  -296,   264,   265,   311,   280,   219,
    -296,   104,   300,  -296,   388,   280,  -296,  -296,   304,   302,
     237,   241,  -296,   320,  -296,  -296,  -296,  -296,  -296,   -18,
     -17,  -296,  -296,  -296,  -296,  -296,   303,  -296,  -296,  -296,
    -296,   138,  -296,  -296,   403,   403,   305,   167,  -296,  -296,
    -296,  -296,   219,  -296,   314,   312,  -296,  -296,   308,  -296,
     170,  -296,   317,  -296,   353,   319,   316,  -296,  -296,    -3,
     219,   402,   219,   217,   324,  -296,  -296,  -296,  -296,  -296,
    -296,   323,  -296,   403,   331,   403,  -296,   329,  -296,   172,
    -296,  -296,  -296,  -296,   282,   403,  -296,  -296,   510,  -296,
      -3,    10,    -3,  -296,  -296,   351,    10,    -3,   345,   290,
    -296,  -296,   496,  -296,  -296,  -296,  -296,   280,   336,   334,
    -296,  -296,   342,  -296,  -296,   496,  -296,  -296,   496,   496,
     328,   344,   262,   330,  -296,   403,  -296,   181,  -296,   343,
     248,  -296,    29,   740,   280,  -296,  -296,   108,   248,  -296,
     403,   248,   219,  -296,    24,  -296,    -3,   347,  -296,   349,
    -296,   348,   219,  -296,  -296,   219,  -296,   604,  -296,   448,
    -296,  -296,  -296,  -296,  -296,   332,  -296,  -296,  -296,    -3,
    -296,  -296,   371,  -296,  -296,  -296,  -296,  -296,  -296,    25,
    -296,  -296,  -296,  -296,   352,   241,  -296,  -296,  -296,   350,
    -296,  -296,  -296,  -296,  -296,  -296,   403,   196,  -296,  -296,
    -296,  -296,  -296,  -296,   361,   362,  -296,   364,   369,  -296,
      42,  -296,  -296,  -296,  -296,    22,   188,  -296,  -296,  -296,
    -296,  -296,  -296,  -296,  -296,   354,   357,   202,  -296,   280,
     388,  -296,  -296,   370,   373,  -296,  -296,  -296,  -296,    16,
     282,   403,   367,  -296,  -296,   348,  -296,  -296,  -296,   403,
    -296,   403,    77,  -296,  -296,  -296,  -296,  -296,   448,   367,
     403,  -296,    57,   207,  -296,  -296,  -296,  -296,  -296,  -296,
    -296,  -296,  -296,    57,    36,  -296,  -296,  -296,    39,  -296,
    -296,  -296
1255
};
1256

Lev Walkin's avatar
Lev Walkin committed
1257
/* YYPGOTO[NTERM-NUM].  */
1258
static const yytype_int16 yypgoto[] =
Lev Walkin's avatar
Lev Walkin committed
1259
{
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274
    -296,  -296,   461,   326,  -296,  -296,   376,  -296,   447,  -296,
    -296,   441,  -296,  -296,  -296,   399,  -296,  -296,  -296,  -296,
    -296,  -296,   428,  -296,   395,  -296,  -296,  -296,   434,   355,
    -296,  -106,  -296,  -296,   321,  -296,    99,   322,    48,   115,
    -296,   128,   287,  -296,  -296,   163,  -296,  -296,  -296,     3,
    -196,  -172,   -82,  -296,  -296,   422,  -177,  -296,  -104,   157,
    -296,   358,  -296,   168,  -164,   310,   313,  -296,  -140,  -296,
    -191,  -188,  -296,    52,  -296,   -76,  -296,  -296,   -24,  -296,
    -296,  -296,  -227,   380,  -150,  -296,  -296,  -296,   360,  -237,
    -296,   179,   182,  -258,  -296,  -296,   205,  -296,  -296,  -296,
    -296,   175,  -296,  -296,  -296,  -296,  -296,  -296,  -296,    47,
      55,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,  -296,
    -296,  -296,    54,    60,  -220,  -296,  -296,   177,  -296,   164,
    -296,   107,  -296,  -296,   171,  -160,  -296,   -87,  -296,  -296,
    -296,  -296,    11,   232,   -12,  -296,  -295
Lev Walkin's avatar
Lev Walkin committed
1275
};
Lev Walkin's avatar
Lev Walkin committed
1276

Lev Walkin's avatar
Lev Walkin committed
1277 1278
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
Lev Walkin's avatar
Lev Walkin committed
1279 1280
   number is the opposite.  If zero, do what YYDEFACT says.
   If YYTABLE_NINF, syntax error.  */
1281
#define YYTABLE_NINF -300
1282
static const yytype_int16 yytable[] =
Lev Walkin's avatar
Lev Walkin committed
1283
{
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375
      20,   154,   193,   193,   107,   107,    20,   349,   280,   322,
     110,     7,   323,   279,     7,   107,     7,   268,   350,     7,
     117,   497,   102,    15,   213,    15,   287,   134,   450,     1,
       2,    53,    90,    15,   115,    15,    15,    48,   328,   293,
      15,     9,   511,    69,    92,   511,   326,   327,    53,   316,
      12,   328,    69,    15,    52,   264,   265,   512,   264,   265,
     512,    90,   294,   511,    15,    16,    68,    91,     1,     2,
      24,    52,    15,    92,   329,    68,   264,   265,   512,   385,
     294,    15,    16,    15,   416,    21,    69,   329,   343,     1,
       2,    33,   360,  -255,   154,   138,    91,    34,   134,   294,
     505,   427,   326,   327,    97,   375,   361,  -255,   111,    68,
     404,   406,   407,   345,   137,    15,   410,   411,   104,    15,
     204,   205,    35,   386,   469,   328,    62,   173,   270,    49,
      36,   174,   103,   405,   384,   276,   466,   107,   107,   104,
     276,   107,   330,   335,   104,   481,   341,   442,   104,   104,
     519,   139,   107,   276,   506,     3,   513,   344,   507,   513,
     521,   329,   104,   231,   233,   140,   452,    17,    98,   161,
     273,    37,   276,   282,   288,   -84,   292,   513,   300,    38,
     162,   104,   438,   300,    22,   137,   230,   232,   403,   464,
     444,   263,   269,   447,   469,   280,   469,   417,  -299,   268,
     279,   189,  -299,    39,   104,   449,   322,    15,   473,   323,
     439,    41,   338,     1,     2,   107,   339,   287,   445,   283,
     388,   448,    25,   189,    15,    54,   190,    42,   191,   346,
       1,     2,    26,   494,     1,     2,    55,   201,   202,   203,
      15,   204,   205,   206,   207,   208,   235,   236,   195,   474,
     191,    58,   364,    27,   237,    28,   365,    59,    60,    15,
     204,   205,   366,   369,    29,     1,     2,   154,   301,   302,
     201,   202,   203,    15,   204,   205,   206,   207,   208,     1,
       2,   371,   209,   238,   379,   372,   396,    94,   380,   398,
     397,   154,   239,    15,   -26,   435,    61,    43,   240,   436,
     210,   393,   484,   393,    95,   458,   485,   241,   459,   224,
     225,   100,   401,   402,   389,   209,   490,   189,   520,   493,
     491,   517,   520,   211,    99,   491,     1,     2,   264,   265,
     430,    10,   242,   210,    10,   143,   144,   347,   348,   104,
     243,   113,   303,   142,   244,   353,   354,   356,   357,   264,
     265,   462,   463,   273,   486,   487,   211,   194,   194,   164,
     282,   168,   167,   169,   170,   288,   171,   172,   292,   175,
     176,   177,   300,   178,   182,   212,   201,   202,   203,    15,
     204,   205,   206,   207,   208,   235,   236,   180,   181,   183,
     184,   187,   185,   237,   186,   191,   201,   202,   203,    15,
     204,   205,   206,   207,   208,   235,   236,   188,   200,   228,
     234,   274,   275,   237,    15,   313,   342,   315,   351,   325,
     352,   209,   238,   378,   369,   359,   363,   370,   376,   382,
     377,   239,   381,   383,   384,   387,   391,   240,   300,   210,
     390,   209,   238,   483,  -177,   394,   241,   408,   412,   419,
     423,   239,   428,   424,   429,   461,   189,   240,   437,   210,
     453,   465,   211,   454,     8,    23,   241,   488,   401,   483,
     470,   242,    40,   455,   471,   489,   189,   475,   476,   243,
     477,   212,   211,   244,   101,   478,   495,   165,   510,   496,
     500,   242,    96,   112,    93,   229,   460,   179,   479,   451,
     440,   212,   415,   244,   201,   202,   203,    15,   204,   205,
     206,   207,   208,   235,   236,   340,   518,   314,   201,   202,
     203,    15,   204,   205,   206,   207,   208,     1,     2,   155,
     441,   433,   498,   196,   425,   336,   503,   432,   337,   501,
     426,   499,   434,   472,   446,   289,   504,   395,   443,   209,
     238,   306,     0,     0,     0,     0,     0,     0,     0,   239,
       0,     0,     0,   209,     0,   240,     0,   210,     0,     0,
       0,     0,     0,     0,   241,     0,     0,     0,     0,     0,
       0,   210,     0,     0,   189,     0,     0,     0,     0,     0,
     211,     0,     0,     0,     0,     0,     0,     0,     0,   242,
       0,     0,     0,     0,   211,     0,     0,     0,     0,   212,
       0,   244,   201,   202,   203,    15,   204,   205,   206,   207,
     208,   235,   236,   212,     0,     0,   145,     0,     0,     0,
     146,     0,     0,     0,   147,    70,   119,     0,   120,   148,
       0,     0,     0,     0,     0,     0,     0,     0,   121,     0,
       0,     0,   149,     0,     0,     0,   123,   209,     0,   124,
      72,    73,    74,     0,     0,     0,     0,     0,   150,     0,
     151,    75,     0,     0,    15,   317,    76,   127,    77,   128,
       1,     2,     0,     0,     0,     0,    78,     0,   129,   130,
     152,   153,     0,     0,    70,    79,     0,    80,   211,     0,
       0,     0,    81,   131,    82,    83,    84,     0,     0,    71,
       0,     0,     0,     0,     0,     0,     0,   178,     0,    72,
      73,    74,     0,     0,     0,     0,     0,     0,     0,     0,
      75,     0,     0,     0,     0,    76,     0,    77,     0,     0,
       0,     0,     0,     0,     0,    78,     0,     0,     0,     0,
       0,     0,     0,     0,    79,     0,    80,   143,   144,     0,
       0,    81,   145,    82,    83,    84,   146,     0,     0,     0,
     147,    70,   119,     0,   120,   148,     0,     0,     0,     0,
       0,     0,     0,     0,   121,     0,     0,     0,   149,     0,
       0,     0,   123,     0,     0,   124,    72,    73,    74,     0,
       0,     0,     0,     0,   150,     0,   151,    75,     0,     0,
       0,   126,    76,   127,    77,   128,     0,     0,     0,     0,
       0,     0,    78,     0,   129,   130,   152,   153,     0,     0,
       0,    79,     0,    80,     1,     2,     0,     0,    81,   131,
      82,    83,    84,     0,     0,     0,     0,   118,    70,   119,
       0,   120,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   121,     0,     0,     0,   122,     0,     0,     0,   123,
       0,     0,   124,    72,    73,    74,     0,     0,     0,     0,
       0,     0,     0,   125,    75,     0,     0,     0,   126,    76,
     127,    77,   128,     0,     0,     0,     0,     0,     0,    78,
       0,   129,   130,     0,     0,     0,     0,     0,    79,     0,
      80,     0,     0,     0,     0,    81,   131,    82,    83,    84
Lev Walkin's avatar
Lev Walkin committed
1376
};
1377

1378
static const yytype_int16 yycheck[] =
Lev Walkin's avatar
Lev Walkin committed
1379
{
1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
      12,   107,   152,   153,    91,    92,    18,   244,   185,   200,
      92,     0,   200,   185,     3,   102,     5,   181,   245,     8,
     102,     5,     3,    11,   164,    11,   186,   103,     4,    17,
      18,    43,    56,    11,    36,    11,    11,    25,    41,   189,
      11,     0,     6,    55,    56,     6,    18,    19,    60,   199,
     113,    41,    64,    11,    43,    19,    20,    21,    19,    20,
      21,    85,    38,     6,    11,    12,    55,    56,    17,    18,
     115,    60,    11,    85,    77,    64,    19,    20,    21,   299,
      38,    11,    12,    11,   342,    42,    98,    77,   238,    17,
      18,    12,   110,   110,   200,    27,    85,    65,   174,    38,
      23,   359,    18,    19,    54,   282,   124,   124,    97,    98,
     330,   331,   332,     9,   103,    11,   336,   337,   120,    11,
      12,    13,    92,   300,   419,    41,    54,   114,   114,   117,
      92,   118,   113,   123,   118,   111,   111,   224,   225,   120,
     111,   228,   224,   225,   120,   123,   228,   374,   120,   120,
     114,    83,   239,   111,    77,   104,   120,   239,    81,   120,
     121,    77,   120,   175,   176,    97,   386,   114,   118,    49,
     182,    61,   111,   185,   186,   114,   188,   120,   190,    92,
      60,   120,   370,   195,   114,   174,   175,   176,   328,   409,
     378,   180,   181,   381,   489,   372,   491,   347,   114,   363,
     372,    88,   118,     3,   120,   382,   397,    11,    12,   397,
     370,   116,   114,    17,    18,   302,   118,   377,   378,   111,
     302,   381,    18,    88,    11,    47,   113,    29,   115,   241,
      17,    18,    28,   470,    17,    18,    62,     8,     9,    10,
      11,    12,    13,    14,    15,    16,    17,    18,   113,   437,
     115,   117,   114,    49,    25,    51,   118,   117,   118,    11,
      12,    13,   274,   275,    60,    17,    18,   373,    39,    40,
       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
      18,   114,    53,    54,   114,   118,   114,   114,   118,     7,
     118,   397,    63,    11,    47,   114,   113,    50,    69,   118,
      71,   313,   114,   315,   117,   392,   118,    78,   395,    19,
      20,    18,   324,   325,   303,    53,   114,    88,   514,   469,
     118,   114,   518,    94,   113,   118,    17,    18,    19,    20,
      68,     5,   103,    71,     8,    17,    18,    37,    38,   120,
     111,   114,   113,     3,   115,   108,   109,   106,   107,    19,
      20,    19,    20,   365,   458,   459,    94,   152,   153,     3,
     372,    89,   113,    89,    79,   377,    59,    89,   380,   119,
     119,    12,   384,   113,   113,   113,     8,     9,    10,    11,
      12,    13,    14,    15,    16,    17,    18,   123,   123,    43,
      89,    76,   113,    25,   113,   115,     8,     9,    10,    11,
      12,    13,    14,    15,    16,    17,    18,   113,   113,     3,
     121,    33,   113,    25,    11,    76,   105,    76,   114,   123,
     118,    53,    54,   115,   436,   105,   123,   122,   114,    76,
     118,    63,   115,   114,   118,    33,   113,    69,   450,    71,
     116,    53,    54,   455,   115,   114,    78,    96,   103,   113,
     116,    63,   124,   111,   110,     7,    88,    69,   115,    71,
     113,    90,    94,   114,     3,    18,    78,   113,   480,   481,
     118,   103,    31,   125,   124,   118,    88,   116,   116,   111,
     116,   113,    94,   115,    85,   116,   116,   111,   500,   116,
     123,   103,    64,    98,    60,   174,   397,   142,   450,   384,
     372,   113,   339,   115,     8,     9,    10,    11,    12,    13,
      14,    15,    16,    17,    18,   228,   513,   195,     8,     9,
      10,    11,    12,    13,    14,    15,    16,    17,    18,   107,
     373,   363,   480,   153,   355,   225,   489,   362,   225,   485,
     358,   481,   365,   436,   380,   187,   491,   315,   377,    53,
      54,   191,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    63,
      -1,    -1,    -1,    53,    -1,    69,    -1,    71,    -1,    -1,
      -1,    -1,    -1,    -1,    78,    -1,    -1,    -1,    -1,    -1,
      -1,    71,    -1,    -1,    88,    -1,    -1,    -1,    -1,    -1,
      94,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   103,
      -1,    -1,    -1,    -1,    94,    -1,    -1,    -1,    -1,   113,
      -1,   115,     8,     9,    10,    11,    12,    13,    14,    15,
      16,    17,    18,   113,    -1,    -1,    22,    -1,    -1,    -1,
      26,    -1,    -1,    -1,    30,    31,    32,    -1,    34,    35,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    44,    -1,
      -1,    -1,    48,    -1,    -1,    -1,    52,    53,    -1,    55,
      56,    57,    58,    -1,    -1,    -1,    -1,    -1,    64,    -1,
      66,    67,    -1,    -1,    11,    71,    72,    73,    74,    75,
      17,    18,    -1,    -1,    -1,    -1,    82,    -1,    84,    85,
      86,    87,    -1,    -1,    31,    91,    -1,    93,    94,    -1,
      -1,    -1,    98,    99,   100,   101,   102,    -1,    -1,    46,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,   113,    -1,    56,
      57,    58,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      67,    -1,    -1,    -1,    -1,    72,    -1,    74,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    82,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    91,    -1,    93,    17,    18,    -1,
      -1,    98,    22,   100,   101,   102,    26,    -1,    -1,    -1,
      30,    31,    32,    -1,    34,    35,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    44,    -1,    -1,    -1,    48,    -1,
      -1,    -1,    52,    -1,    -1,    55,    56,    57,    58,    -1,
      -1,    -1,    -1,    -1,    64,    -1,    66,    67,    -1,    -1,
      -1,    71,    72,    73,    74,    75,    -1,    -1,    -1,    -1,
      -1,    -1,    82,    -1,    84,    85,    86,    87,    -1,    -1,
      -1,    91,    -1,    93,    17,    18,    -1,    -1,    98,    99,
     100,   101,   102,    -1,    -1,    -1,    -1,    30,    31,    32,
      -1,    34,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    44,    -1,    -1,    -1,    48,    -1,    -1,    -1,    52,
      -1,    -1,    55,    56,    57,    58,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    66,    67,    -1,    -1,    -1,    71,    72,
      73,    74,    75,    -1,    -1,    -1,    -1,    -1,    -1,    82,
      -1,    84,    85,    -1,    -1,    -1,    -1,    -1,    91,    -1,
      93,    -1,    -1,    -1,    -1,    98,    99,   100,   101,   102
Lev Walkin's avatar
Lev Walkin committed
1472
};
1473

Lev Walkin's avatar
Lev Walkin committed
1474 1475
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
Lev Walkin's avatar
Lev Walkin committed
1476
static const yytype_uint16 yystos[] =
Lev Walkin's avatar
Lev Walkin committed
1477
{
1478 1479 1480 1481 1482 1483 1484
       0,    17,    18,   104,   127,   128,   129,   268,   128,     0,
     129,   130,   113,   131,   132,    11,    12,   114,   133,   134,
     270,    42,   114,   134,   115,    18,    28,    49,    51,    60,
     135,   136,   137,    12,    65,    92,    92,    61,    92,     3,
     137,   116,    29,    50,   138,   139,   151,   152,    25,   117,
     153,   154,   268,   270,    47,    62,   143,   144,   117,   117,
     118,   113,    54,   145,   146,   148,   149,   150,   268,   270,
Lev Walkin's avatar
Lev Walkin committed
1485
      31,    46,    56,    57,    58,    67,    72,    74,    82,    91,
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530
      93,    98,   100,   101,   102,   140,   141,   156,   158,   193,
     204,   268,   270,   154,   114,   117,   148,    54,   118,   113,
      18,   141,     3,   113,   120,   178,   179,   263,   264,   265,
     178,   268,   150,   114,   142,    36,   168,   178,    30,    32,
      34,    44,    48,    52,    55,    66,    71,    73,    75,    84,
      85,    99,   159,   160,   201,   202,   204,   268,    27,    83,
      97,   266,     3,    17,    18,    22,    26,    30,    35,    48,
      64,    66,    86,    87,   157,   181,   185,   186,   187,   201,
     203,    49,    60,   267,     3,   132,   147,   113,    89,    89,
      79,    59,    89,   114,   118,   119,   119,    12,   113,   155,
     123,   123,   113,    43,    89,   113,   113,    76,   113,    88,
     113,   115,   209,   210,   222,   113,   209,   208,   210,   211,
     113,     8,     9,    10,    12,    13,    14,    15,    16,    53,
      71,    94,   113,   194,   196,   197,   198,   228,   261,   262,
     268,   270,   271,   272,    19,    20,   170,   171,     3,   160,
     268,   270,   268,   270,   121,    17,    18,    25,    54,    63,
      69,    78,   103,   111,   115,   157,   180,   194,   214,   215,
     216,   217,   218,   219,   220,   221,   222,   223,   224,   225,
     227,   229,   230,   268,    19,    20,   188,   189,   190,   268,
     114,   252,   253,   270,    33,   113,   111,   166,   167,   177,
     182,   263,   270,   111,   258,   259,   260,   261,   270,   187,
     254,   255,   270,   210,    38,   163,   164,   165,   177,   182,
     270,    39,    40,   113,   212,   213,   214,   239,   240,   242,
     244,   245,   246,    76,   163,    76,   210,    71,   155,   161,
     162,   181,   196,   197,   195,   123,    18,    19,    41,    77,
     178,   191,   192,   250,   251,   178,   191,   192,   114,   118,
     168,   178,   105,   210,   178,     9,   270,    37,    38,   215,
     208,   114,   118,   108,   109,   205,   106,   107,   206,   105,
     110,   124,   243,   123,   114,   118,   270,   256,   257,   270,
     122,   114,   118,   183,   184,   182,   114,   118,   115,   114,
     118,   115,    76,   114,   118,   250,   182,    33,   178,   268,
     116,   113,   269,   270,   114,   269,   114,   118,     7,   199,
     200,   270,   270,   194,   250,   123,   250,   250,    96,   169,
     250,   250,   103,   172,   173,   171,   219,   210,   231,   113,
     232,   233,   234,   116,   111,   217,   218,   219,   124,   110,
      68,   226,   227,   189,   253,   114,   118,   115,   197,   261,
     167,   185,   208,   260,   197,   261,   255,   197,   261,   182,
       4,   165,   250,   113,   114,   125,   247,   248,   263,   263,
     162,     7,    19,    20,   250,    90,   111,   235,   236,   272,
     118,   124,   257,    12,   197,   116,   116,   116,   116,   164,
     241,   123,   249,   270,   114,   118,   184,   184,   113,   118,
     114,   118,   207,   210,   215,   116,   116,     5,   199,   249,
     123,   248,   174,   235,   236,    23,    77,    81,   237,   238,
     270,     6,    21,   120,   175,   176,   190,   114,   175,   114,
     176,   121
Lev Walkin's avatar
Lev Walkin committed
1531
};
1532

Lev Walkin's avatar
Lev Walkin committed
1533 1534
#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
1535
#define YYEMPTY		(-2)
Lev Walkin's avatar
Lev Walkin committed
1536
#define YYEOF		0
Lev Walkin's avatar
Lev Walkin committed
1537

Lev Walkin's avatar
Lev Walkin committed
1538
#define YYACCEPT	goto yyacceptlab
Lev Walkin's avatar
Lev Walkin committed
1539
#define YYABORT		goto yyabortlab
1540 1541
#define YYERROR		goto yyerrorlab

Lev Walkin's avatar
Lev Walkin committed
1542 1543 1544

/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
Lev Walkin's avatar
Lev Walkin committed
1545
   Once GCC version 2 has supplanted version 1, this can go.  */
Lev Walkin's avatar
Lev Walkin committed
1546

Lev Walkin's avatar
Lev Walkin committed
1547
#define YYFAIL		goto yyerrlab
Lev Walkin's avatar
Lev Walkin committed
1548

Lev Walkin's avatar
Lev Walkin committed
1549
#define YYRECOVERING()  (!!yyerrstatus)
Lev Walkin's avatar
Lev Walkin committed
1550

Lev Walkin's avatar
Lev Walkin committed
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562
#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yytoken = YYTRANSLATE (yychar);				\
      YYPOPSTACK (1);						\
      goto yybackup;						\
    }								\
  else								\
    {								\
1563
      yyerror (YY_("syntax error: cannot back up")); \
Lev Walkin's avatar
Lev Walkin committed
1564 1565
      YYERROR;							\
    }								\
1566 1567
while (YYID (0))

Lev Walkin's avatar
Lev Walkin committed
1568

Lev Walkin's avatar
Lev Walkin committed
1569 1570 1571
#define YYTERROR	1
#define YYERRCODE	256

Lev Walkin's avatar
Lev Walkin committed
1572

Lev Walkin's avatar
Lev Walkin committed
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)				\
    do									\
      if (YYID (N))                                                    \
	{								\
	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
	}								\
      else								\
	{								\
	  (Current).first_line   = (Current).last_line   =		\
	    YYRHSLOC (Rhs, 0).last_line;				\
	  (Current).first_column = (Current).last_column =		\
	    YYRHSLOC (Rhs, 0).last_column;				\
	}								\
    while (YYID (0))
#endif


/* YY_LOCATION_PRINT -- Print the location on the stream.
   This macro was not mandated originally: define only if we know
   we won't break user code: when these are the locations we know.  */

1603
#ifndef YY_LOCATION_PRINT
Lev Walkin's avatar
Lev Walkin committed
1604 1605 1606 1607 1608 1609 1610 1611
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
#  define YY_LOCATION_PRINT(File, Loc)			\
     fprintf (File, "%d.%d-%d.%d",			\
	      (Loc).first_line, (Loc).first_column,	\
	      (Loc).last_line,  (Loc).last_column)
# else
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
Lev Walkin's avatar
Lev Walkin committed
1612
#endif
Lev Walkin's avatar
Lev Walkin committed
1613

1614

Lev Walkin's avatar
Lev Walkin committed
1615
/* YYLEX -- calling `yylex' with the right arguments.  */
Lev Walkin's avatar
Lev Walkin committed
1616

1617 1618 1619 1620 1621
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif
Lev Walkin's avatar
Lev Walkin committed
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
} while (YYID (0))

# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
do {									  \
  if (yydebug)								  \
    {									  \
      YYFPRINTF (stderr, "%s ", Title);					  \
      yy_symbol_print (stderr,						  \
		  Type, Value); \
      YYFPRINTF (stderr, "\n");						  \
    }									  \
} while (YYID (0))


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (!yyvaluep)
    return;
# ifdef YYPRINT
  if (yytype < YYNTOKENS)
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
  YYUSE (yyoutput);
# endif
Lev Walkin's avatar
Lev Walkin committed
1674 1675 1676 1677 1678
  switch (yytype)
    {
      default:
	break;
    }
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714
}


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (yytype < YYNTOKENS)
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  else
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);

  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  YYFPRINTF (yyoutput, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
Lev Walkin's avatar
Lev Walkin committed
1715
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1716 1717
#else
static void
Lev Walkin's avatar
Lev Walkin committed
1718 1719 1720
yy_stack_print (bottom, top)
    yytype_int16 *bottom;
    yytype_int16 *top;
1721 1722 1723
#endif
{
  YYFPRINTF (stderr, "Stack now");
Lev Walkin's avatar
Lev Walkin committed
1724 1725
  for (; bottom <= top; ++bottom)
    YYFPRINTF (stderr, " %d", *bottom);
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)				\
do {								\
  if (yydebug)							\
    yy_stack_print ((Bottom), (Top));				\
} while (YYID (0))


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
yy_reduce_print (yyvsp, yyrule)
    YYSTYPE *yyvsp;
    int yyrule;
#endif
{
  int yynrhs = yyr2[yyrule];
  int yyi;
  unsigned long int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
	     yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
Lev Walkin's avatar
Lev Walkin committed
1759
      fprintf (stderr, "   $%d = ", yyi + 1);
1760 1761 1762
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
		       &(yyvsp[(yyi + 1) - (yynrhs)])
		       		       );
Lev Walkin's avatar
Lev Walkin committed
1763
      fprintf (stderr, "\n");
1764 1765 1766 1767 1768 1769 1770 1771 1772
    }
}

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))

Lev Walkin's avatar
Lev Walkin committed
1773 1774 1775 1776 1777
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
1778 1779 1780
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
Lev Walkin's avatar
Lev Walkin committed
1781 1782
#endif /* !YYDEBUG */

1783

Lev Walkin's avatar
Lev Walkin committed
1784 1785 1786
/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
Lev Walkin's avatar
Lev Walkin committed
1787 1788
#endif

Lev Walkin's avatar
Lev Walkin committed
1789 1790
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).
Lev Walkin's avatar
Lev Walkin committed
1791

Lev Walkin's avatar
Lev Walkin committed
1792
   Do not make this value too large; the results are undefined if
1793
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Lev Walkin's avatar
Lev Walkin committed
1794
   evaluated with infinite-precision integer arithmetic.  */
Lev Walkin's avatar
Lev Walkin committed
1795

Lev Walkin's avatar
Lev Walkin committed
1796 1797
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
Lev Walkin's avatar
Lev Walkin committed
1798 1799
#endif

Lev Walkin's avatar
Lev Walkin committed
1800

Lev Walkin's avatar
Lev Walkin committed
1801

Lev Walkin's avatar
Lev Walkin committed
1802
#if YYERROR_VERBOSE
Lev Walkin's avatar
Lev Walkin committed
1803

Lev Walkin's avatar
Lev Walkin committed
1804
# ifndef yystrlen
1805
#  if defined __GLIBC__ && defined _STRING_H
Lev Walkin's avatar
Lev Walkin committed
1806 1807 1808
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
1809 1810
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
Lev Walkin's avatar
Lev Walkin committed
1811 1812
static YYSIZE_T
yystrlen (const char *yystr)
1813 1814
#else
static YYSIZE_T
Lev Walkin's avatar
Lev Walkin committed
1815
yystrlen (yystr)
1816 1817
    const char *yystr;
#endif
Lev Walkin's avatar
Lev Walkin committed
1818
{
1819 1820
  YYSIZE_T yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
Lev Walkin's avatar
Lev Walkin committed
1821
    continue;
1822
  return yylen;
Lev Walkin's avatar
Lev Walkin committed
1823 1824 1825 1826 1827
}
#  endif
# endif

# ifndef yystpcpy
1828
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Lev Walkin's avatar
Lev Walkin committed
1829 1830 1831 1832
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
1833 1834
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
Lev Walkin's avatar
Lev Walkin committed
1835 1836
static char *
yystpcpy (char *yydest, const char *yysrc)
1837 1838
#else
static char *
Lev Walkin's avatar
Lev Walkin committed
1839
yystpcpy (yydest, yysrc)
1840 1841 1842
    char *yydest;
    const char *yysrc;
#endif
Lev Walkin's avatar
Lev Walkin committed
1843
{
1844 1845
  char *yyd = yydest;
  const char *yys = yysrc;
Lev Walkin's avatar
Lev Walkin committed
1846 1847 1848 1849 1850 1851 1852 1853

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif
Lev Walkin's avatar
Lev Walkin committed
1854

1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894
# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
   quotes and backslashes, so that it's suitable for yyerror.  The
   heuristic is that double-quoting is unnecessary unless the string
   contains an apostrophe, a comma, or backslash (other than
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
   null, do not copy; instead, return the length of what the result
   would have been.  */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      YYSIZE_T yyn = 0;
      char const *yyp = yystr;

      for (;;)
	switch (*++yyp)
	  {
	  case '\'':
	  case ',':
	    goto do_not_strip_quotes;

	  case '\\':
	    if (*++yyp != '\\')
	      goto do_not_strip_quotes;
	    /* Fall through.  */
	  default:
	    if (yyres)
	      yyres[yyn] = *yyp;
	    yyn++;
	    break;

	  case '"':
	    if (yyres)
	      yyres[yyn] = '\0';
	    return yyn;
	  }
    do_not_strip_quotes: ;
    }
Lev Walkin's avatar
Lev Walkin committed
1895

1896 1897
  if (! yyres)
    return yystrlen (yystr);
Lev Walkin's avatar
Lev Walkin committed
1898

1899 1900 1901
  return yystpcpy (yyres, yystr) - yyres;
}
# endif
Lev Walkin's avatar
Lev Walkin committed
1902

Lev Walkin's avatar
Lev Walkin committed
1903 1904 1905 1906 1907 1908 1909 1910 1911
/* Copy into YYRESULT an error message about the unexpected token
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
   including the terminating null byte.  If YYRESULT is null, do not
   copy anything; just return the number of bytes that would be
   copied.  As a special case, return 0 if an ordinary "syntax error"
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
   size calculation.  */
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
1912
{
Lev Walkin's avatar
Lev Walkin committed
1913
  int yyn = yypact[yystate];
1914

Lev Walkin's avatar
Lev Walkin committed
1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
    return 0;
  else
    {
      int yytype = YYTRANSLATE (yychar);
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
      YYSIZE_T yysize = yysize0;
      YYSIZE_T yysize1;
      int yysize_overflow = 0;
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
      int yyx;

# if 0
      /* This is so xgettext sees the translatable formats that are
	 constructed on the fly.  */
      YY_("syntax error, unexpected %s");
      YY_("syntax error, unexpected %s, expecting %s");
      YY_("syntax error, unexpected %s, expecting %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
# endif
      char *yyfmt;
      char const *yyf;
      static char const yyunexpected[] = "syntax error, unexpected %s";
      static char const yyexpecting[] = ", expecting %s";
      static char const yyor[] = " or %s";
      char yyformat[sizeof yyunexpected
		    + sizeof yyexpecting - 1
		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
		       * (sizeof yyor - 1))];
      char const *yyprefix = yyexpecting;

      /* Start YYX at -YYN if negative to avoid negative indexes in
	 YYCHECK.  */
      int yyxbegin = yyn < 0 ? -yyn : 0;

      /* Stay within bounds of both yycheck and yytname.  */
      int yychecklim = YYLAST - yyn + 1;
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
      int yycount = 1;

      yyarg[0] = yytname[yytype];
      yyfmt = yystpcpy (yyformat, yyunexpected);

      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
	  {
	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
	      {
		yycount = 1;
		yysize = yysize0;
		yyformat[sizeof yyunexpected - 1] = '\0';
		break;
	      }
	    yyarg[yycount++] = yytname[yyx];
	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
	    yysize_overflow |= (yysize1 < yysize);
	    yysize = yysize1;
	    yyfmt = yystpcpy (yyfmt, yyprefix);
	    yyprefix = yyor;
	  }
1977

Lev Walkin's avatar
Lev Walkin committed
1978 1979 1980 1981
      yyf = YY_(yyformat);
      yysize1 = yysize + yystrlen (yyf);
      yysize_overflow |= (yysize1 < yysize);
      yysize = yysize1;
1982

Lev Walkin's avatar
Lev Walkin committed
1983 1984
      if (yysize_overflow)
	return YYSIZE_MAXIMUM;
1985

Lev Walkin's avatar
Lev Walkin committed
1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008
      if (yyresult)
	{
	  /* Avoid sprintf, as that infringes on the user's name space.
	     Don't have undefined behavior even if the translation
	     produced a string with the wrong number of "%s"s.  */
	  char *yyp = yyresult;
	  int yyi = 0;
	  while ((*yyp = *yyf) != '\0')
	    {
	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
		{
		  yyp += yytnamerr (yyp, yyarg[yyi++]);
		  yyf += 2;
		}
	      else
		{
		  yyp++;
		  yyf++;
		}
	    }
	}
      return yysize;
    }
Lev Walkin's avatar
Lev Walkin committed
2009
}
2010
#endif /* YYERROR_VERBOSE */
Lev Walkin's avatar
Lev Walkin committed
2011

Lev Walkin's avatar
Lev Walkin committed
2012

Lev Walkin's avatar
Lev Walkin committed
2013 2014 2015 2016
/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

2017 2018 2019
/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
Lev Walkin's avatar
Lev Walkin committed
2020
static void
2021
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Lev Walkin's avatar
Lev Walkin committed
2022
#else
2023 2024 2025
static void
yydestruct (yymsg, yytype, yyvaluep)
    const char *yymsg;
Lev Walkin's avatar
Lev Walkin committed
2026
    int yytype;
2027
    YYSTYPE *yyvaluep;
Lev Walkin's avatar
Lev Walkin committed
2028
#endif
Lev Walkin's avatar
Lev Walkin committed
2029
{
2030 2031 2032 2033 2034
  YYUSE (yyvaluep);

  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
Lev Walkin's avatar
Lev Walkin committed
2035

Lev Walkin's avatar
Lev Walkin committed
2036 2037
  switch (yytype)
    {
Lev Walkin's avatar
Lev Walkin committed
2038

Lev Walkin's avatar
Lev Walkin committed
2039 2040 2041 2042 2043
      default:
	break;
    }
}

Lev Walkin's avatar
Lev Walkin committed
2044

Lev Walkin's avatar
Lev Walkin committed
2045
/* Prevent warnings from -Wmissing-prototypes.  */
Lev Walkin's avatar
Lev Walkin committed
2046

Lev Walkin's avatar
Lev Walkin committed
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
2060

Lev Walkin's avatar
Lev Walkin committed
2061

2062

Lev Walkin's avatar
Lev Walkin committed
2063 2064
/* The look-ahead symbol.  */
int yychar;
2065

Lev Walkin's avatar
Lev Walkin committed
2066 2067
/* The semantic value of the look-ahead symbol.  */
YYSTYPE yylval;
Lev Walkin's avatar
Lev Walkin committed
2068

2069
/* Number of syntax errors so far.  */
Lev Walkin's avatar
Lev Walkin committed
2070 2071
int yynerrs;

Lev Walkin's avatar
Lev Walkin committed
2072

Lev Walkin's avatar
Lev Walkin committed
2073

2074 2075 2076 2077 2078 2079 2080
/*----------.
| yyparse.  |
`----------*/

#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
2081
int
2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098
yyparse (void *YYPARSE_PARAM)
#else
int
yyparse (YYPARSE_PARAM)
    void *YYPARSE_PARAM;
#endif
#else /* ! YYPARSE_PARAM */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()

#endif
#endif
2099
{
Lev Walkin's avatar
Lev Walkin committed
2100 2101
  
  int yystate;
2102
  int yyn;
Lev Walkin's avatar
Lev Walkin committed
2103
  int yyresult;
Lev Walkin's avatar
Lev Walkin committed
2104 2105 2106
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Look-ahead token as an internal (translated) token number.  */
2107 2108 2109 2110 2111 2112 2113
  int yytoken = 0;
#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
Lev Walkin's avatar
Lev Walkin committed
2114

Lev Walkin's avatar
Lev Walkin committed
2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134
  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack.  */
  yytype_int16 yyssa[YYINITDEPTH];
  yytype_int16 *yyss = yyssa;
  yytype_int16 *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  YYSTYPE *yyvsp;



2135
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
Lev Walkin's avatar
Lev Walkin committed
2136

Lev Walkin's avatar
Lev Walkin committed
2137 2138 2139 2140 2141 2142 2143
  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;


2144 2145 2146
  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;
Lev Walkin's avatar
Lev Walkin committed
2147

Lev Walkin's avatar
Lev Walkin committed
2148
  YYDPRINTF ((stderr, "Starting parse\n"));
Lev Walkin's avatar
Lev Walkin committed
2149 2150 2151 2152

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
Lev Walkin's avatar
Lev Walkin committed
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;

Lev Walkin's avatar
Lev Walkin committed
2163
  goto yysetstate;
Lev Walkin's avatar
Lev Walkin committed
2164

Lev Walkin's avatar
Lev Walkin committed
2165 2166 2167 2168 2169
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* 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.  */
Lev Walkin's avatar
Lev Walkin committed
2171 2172 2173 2174
  yyssp++;

 yysetstate:
  *yyssp = yystate;
Lev Walkin's avatar
Lev Walkin committed
2175

2176
  if (yyss + yystacksize - 1 <= yyssp)
Lev Walkin's avatar
Lev Walkin committed
2177
    {
Lev Walkin's avatar
Lev Walkin committed
2178
      /* Get the current used size of the three stacks, in elements.  */
Lev Walkin's avatar
Lev Walkin committed
2179
      YYSIZE_T yysize = yyssp - yyss + 1;
Lev Walkin's avatar
Lev Walkin committed
2180 2181

#ifdef yyoverflow
Lev Walkin's avatar
Lev Walkin committed
2182
      {
2183
	/* Give user a chance to reallocate the stack.  Use copies of
Lev Walkin's avatar
Lev Walkin committed
2184 2185 2186
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
2187
	yytype_int16 *yyss1 = yyss;
Lev Walkin's avatar
Lev Walkin committed
2188

Lev Walkin's avatar
Lev Walkin committed
2189

Lev Walkin's avatar
Lev Walkin committed
2190 2191 2192 2193
	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
2194
	yyoverflow (YY_("memory exhausted"),
Lev Walkin's avatar
Lev Walkin committed
2195 2196
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
Lev Walkin's avatar
Lev Walkin committed
2197

Lev Walkin's avatar
Lev Walkin committed
2198 2199 2200 2201 2202
		    &yystacksize);

	yyss = yyss1;
	yyvs = yyvs1;
      }
Lev Walkin's avatar
Lev Walkin committed
2203
#else /* no yyoverflow */
Lev Walkin's avatar
Lev Walkin committed
2204
# ifndef YYSTACK_RELOCATE
2205
      goto yyexhaustedlab;
Lev Walkin's avatar
Lev Walkin committed
2206
# else
Lev Walkin's avatar
Lev Walkin committed
2207
      /* Extend the stack our own way.  */
2208 2209
      if (YYMAXDEPTH <= yystacksize)
	goto yyexhaustedlab;
Lev Walkin's avatar
Lev Walkin committed
2210
      yystacksize *= 2;
2211
      if (YYMAXDEPTH < yystacksize)
Lev Walkin's avatar
Lev Walkin committed
2212
	yystacksize = YYMAXDEPTH;
Lev Walkin's avatar
Lev Walkin committed
2213 2214

      {
2215
	yytype_int16 *yyss1 = yyss;
Lev Walkin's avatar
Lev Walkin committed
2216 2217 2218
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
2219
	  goto yyexhaustedlab;
Lev Walkin's avatar
Lev Walkin committed
2220 2221 2222
	YYSTACK_RELOCATE (yyss);
	YYSTACK_RELOCATE (yyvs);

Lev Walkin's avatar
Lev Walkin committed
2223 2224 2225 2226 2227
#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
Lev Walkin's avatar
Lev Walkin committed
2228 2229
#endif /* no yyoverflow */

Lev Walkin's avatar
Lev Walkin committed
2230 2231
      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
Lev Walkin's avatar
Lev Walkin committed
2232

Lev Walkin's avatar
Lev Walkin committed
2233

Lev Walkin's avatar
Lev Walkin committed
2234 2235
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));
Lev Walkin's avatar
Lev Walkin committed
2236

2237
      if (yyss + yystacksize - 1 <= yyssp)
Lev Walkin's avatar
Lev Walkin committed
2238 2239 2240
	YYABORT;
    }

Lev Walkin's avatar
Lev Walkin committed
2241
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Lev Walkin's avatar
Lev Walkin committed
2242 2243

  goto yybackup;
Lev Walkin's avatar
Lev Walkin committed
2244 2245 2246 2247 2248

/*-----------.
| yybackup.  |
`-----------*/
yybackup:
Lev Walkin's avatar
Lev Walkin committed
2249

2250
  /* Do appropriate processing given the current state.  Read a
Lev Walkin's avatar
Lev Walkin committed
2251
     look-ahead token if we need one and don't already have one.  */
Lev Walkin's avatar
Lev Walkin committed
2252

Lev Walkin's avatar
Lev Walkin committed
2253
  /* First try to decide what to do without reference to look-ahead token.  */
Lev Walkin's avatar
Lev Walkin committed
2254
  yyn = yypact[yystate];
Lev Walkin's avatar
Lev Walkin committed
2255
  if (yyn == YYPACT_NINF)
Lev Walkin's avatar
Lev Walkin committed
2256 2257
    goto yydefault;

Lev Walkin's avatar
Lev Walkin committed
2258
  /* Not known => get a look-ahead token if don't already have one.  */
Lev Walkin's avatar
Lev Walkin committed
2259

Lev Walkin's avatar
Lev Walkin committed
2260
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
Lev Walkin's avatar
Lev Walkin committed
2261 2262
  if (yychar == YYEMPTY)
    {
Lev Walkin's avatar
Lev Walkin committed
2263
      YYDPRINTF ((stderr, "Reading a token: "));
Lev Walkin's avatar
Lev Walkin committed
2264 2265 2266
      yychar = YYLEX;
    }

2267
  if (yychar <= YYEOF)
Lev Walkin's avatar
Lev Walkin committed
2268
    {
2269
      yychar = yytoken = YYEOF;
Lev Walkin's avatar
Lev Walkin committed
2270
      YYDPRINTF ((stderr, "Now at end of input.\n"));
Lev Walkin's avatar
Lev Walkin committed
2271 2272 2273
    }
  else
    {
2274 2275
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Lev Walkin's avatar
Lev Walkin committed
2276 2277
    }

2278
  /* If the proper action on seeing token YYTOKEN is to reduce or to
Lev Walkin's avatar
Lev Walkin committed
2279
     detect an error, take that action.  */
2280 2281
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Lev Walkin's avatar
Lev Walkin committed
2282 2283
    goto yydefault;
  yyn = yytable[yyn];
Lev Walkin's avatar
Lev Walkin committed
2284
  if (yyn <= 0)
Lev Walkin's avatar
Lev Walkin committed
2285
    {
Lev Walkin's avatar
Lev Walkin committed
2286 2287
      if (yyn == 0 || yyn == YYTABLE_NINF)
	goto yyerrlab;
Lev Walkin's avatar
Lev Walkin committed
2288 2289 2290 2291
      yyn = -yyn;
      goto yyreduce;
    }

Lev Walkin's avatar
Lev Walkin committed
2292 2293 2294
  if (yyn == YYFINAL)
    YYACCEPT;

Lev Walkin's avatar
Lev Walkin committed
2295 2296 2297 2298
  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;
Lev Walkin's avatar
Lev Walkin committed
2299

Lev Walkin's avatar
Lev Walkin committed
2300
  /* Shift the look-ahead token.  */
2301 2302
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

Lev Walkin's avatar
Lev Walkin committed
2303 2304 2305
  /* Discard the shifted token unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;
2306

Lev Walkin's avatar
Lev Walkin committed
2307
  yystate = yyn;
2308 2309
  *++yyvsp = yylval;

Lev Walkin's avatar
Lev Walkin committed
2310 2311
  goto yynewstate;

2312

Lev Walkin's avatar
Lev Walkin committed
2313 2314 2315 2316
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
Lev Walkin's avatar
Lev Walkin committed
2317 2318 2319
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
Lev Walkin's avatar
Lev Walkin committed
2320
  goto yyreduce;
Lev Walkin's avatar
Lev Walkin committed
2321

Lev Walkin's avatar
Lev Walkin committed
2322 2323 2324 2325

/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
Lev Walkin's avatar
Lev Walkin committed
2326
yyreduce:
Lev Walkin's avatar
Lev Walkin committed
2327
  /* yyn is the number of a rule to reduce with.  */
Lev Walkin's avatar
Lev Walkin committed
2328 2329
  yylen = yyr2[yyn];

Lev Walkin's avatar
Lev Walkin committed
2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340
  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


2341
  YY_REDUCE_PRINT (yyn);
Lev Walkin's avatar
Lev Walkin committed
2342 2343 2344
  switch (yyn)
    {
        case 2:
2345
#line 415 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2346
    {
Lev Walkin's avatar
Lev Walkin committed
2347
		*(void **)param = (yyvsp[(2) - (2)].a_grammar);
Lev Walkin's avatar
Lev Walkin committed
2348 2349 2350 2351
	}
    break;

  case 3:
2352
#line 418 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2353 2354 2355 2356 2357 2358
    {
		*(void **)param = (yyvsp[(1) - (1)].a_grammar);
	}
    break;

  case 4:
2359
#line 424 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2360
    {
2361 2362 2363
		(yyval.a_grammar) = asn1p_new();
		checkmem((yyval.a_grammar));
		TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(1) - (1)].a_module), mod_next);
Lev Walkin's avatar
Lev Walkin committed
2364 2365 2366
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2367
  case 5:
2368
#line 429 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2369
    {
2370 2371
		(yyval.a_grammar) = (yyvsp[(1) - (2)].a_grammar);
		TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(2) - (2)].a_module), mod_next);
Lev Walkin's avatar
Lev Walkin committed
2372 2373 2374
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2375
  case 6:
2376
#line 446 "asn1p_y.y"
2377 2378 2379
    { currentModule = asn1p_module_new(); }
    break;

Lev Walkin's avatar
Lev Walkin committed
2380
  case 7:
2381
#line 451 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2382
    {
Lev Walkin's avatar
Lev Walkin committed
2383

2384
		(yyval.a_module) = currentModule;
2385

2386 2387 2388 2389 2390
		if((yyvsp[(8) - (9)].a_module)) {
			asn1p_module_t tmp = *((yyval.a_module));
			*((yyval.a_module)) = *((yyvsp[(8) - (9)].a_module));
			*((yyvsp[(8) - (9)].a_module)) = tmp;
			asn1p_module_free((yyvsp[(8) - (9)].a_module));
Lev Walkin's avatar
Lev Walkin committed
2391 2392 2393
		} else {
			/* There's a chance that a module is just plain empty */
		}
2394

2395 2396 2397
		(yyval.a_module)->ModuleName = (yyvsp[(1) - (9)].tv_str);
		(yyval.a_module)->module_oid = (yyvsp[(3) - (9)].a_oid);
		(yyval.a_module)->module_flags = (yyvsp[(5) - (9)].a_module_flags);
Lev Walkin's avatar
Lev Walkin committed
2398 2399 2400
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2401
  case 8:
2402
#line 475 "asn1p_y.y"
2403
    { (yyval.a_oid) = 0; }
Lev Walkin's avatar
Lev Walkin committed
2404 2405
    break;

Lev Walkin's avatar
Lev Walkin committed
2406
  case 9:
2407
#line 476 "asn1p_y.y"
2408
    { (yyval.a_oid) = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin's avatar
Lev Walkin committed
2409 2410
    break;

Lev Walkin's avatar
Lev Walkin committed
2411
  case 10:
2412
#line 480 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2413
    {
2414
		(yyval.a_oid) = (yyvsp[(2) - (3)].a_oid);
Lev Walkin's avatar
Lev Walkin committed
2415 2416 2417
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2418
  case 11:
2419
#line 483 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2420
    {
2421
		(yyval.a_oid) = 0;
Lev Walkin's avatar
Lev Walkin committed
2422 2423 2424
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2425
  case 12:
2426
#line 489 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2427
    {
2428 2429
		(yyval.a_oid) = asn1p_oid_new();
		asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(1) - (1)].a_oid_arc));
2430 2431
		if((yyvsp[(1) - (1)].a_oid_arc).name)
			free((yyvsp[(1) - (1)].a_oid_arc).name);
Lev Walkin's avatar
Lev Walkin committed
2432 2433 2434
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2435
  case 13:
2436
#line 495 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2437
    {
2438 2439
		(yyval.a_oid) = (yyvsp[(1) - (2)].a_oid);
		asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(2) - (2)].a_oid_arc));
2440 2441
		if((yyvsp[(2) - (2)].a_oid_arc).name)
			free((yyvsp[(2) - (2)].a_oid_arc).name);
Lev Walkin's avatar
Lev Walkin committed
2442 2443 2444
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2445
  case 14:
2446
#line 504 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2447
    {					/* iso */
2448 2449
		(yyval.a_oid_arc).name = (yyvsp[(1) - (1)].tv_str);
		(yyval.a_oid_arc).number = -1;
Lev Walkin's avatar
Lev Walkin committed
2450 2451 2452
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2453
  case 15:
2454
#line 508 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2455
    {		/* iso(1) */
2456 2457
		(yyval.a_oid_arc).name = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_oid_arc).number = (yyvsp[(3) - (4)].a_int);
Lev Walkin's avatar
Lev Walkin committed
2458 2459 2460
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2461
  case 16:
2462
#line 512 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2463
    {					/* 1 */
2464 2465
		(yyval.a_oid_arc).name = 0;
		(yyval.a_oid_arc).number = (yyvsp[(1) - (1)].a_int);
Lev Walkin's avatar
Lev Walkin committed
2466 2467 2468
	}
    break;

2469
  case 17:
2470
#line 522 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2471
    { (yyval.a_module_flags) = MSF_NOFLAGS; }
Lev Walkin's avatar
Lev Walkin committed
2472 2473
    break;

2474
  case 18:
2475
#line 523 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2476
    {
2477
		(yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
Lev Walkin's avatar
Lev Walkin committed
2478 2479 2480
	}
    break;

2481
  case 19:
2482
#line 532 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2483
    {
Lev Walkin's avatar
Lev Walkin committed
2484
		(yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
Lev Walkin's avatar
Lev Walkin committed
2485 2486 2487
	}
    break;

2488
  case 20:
2489
#line 535 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2490
    {
Lev Walkin's avatar
Lev Walkin committed
2491
		(yyval.a_module_flags) = (yyvsp[(1) - (2)].a_module_flags) | (yyvsp[(2) - (2)].a_module_flags);
Lev Walkin's avatar
Lev Walkin committed
2492 2493 2494
	}
    break;

2495
  case 21:
2496
#line 544 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2497
    {
Lev Walkin's avatar
Lev Walkin committed
2498
		(yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
Lev Walkin's avatar
Lev Walkin committed
2499 2500 2501
	}
    break;

2502
  case 22:
2503
#line 547 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2504
    {
Lev Walkin's avatar
Lev Walkin committed
2505
		(yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
Lev Walkin's avatar
Lev Walkin committed
2506 2507 2508
	}
    break;

2509
  case 23:
2510
#line 550 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2511
    {
Lev Walkin's avatar
Lev Walkin committed
2512
		(yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
Lev Walkin's avatar
Lev Walkin committed
2513 2514 2515
	}
    break;

2516
  case 24:
2517
#line 553 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2518 2519 2520 2521 2522 2523
    {
		(yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
	}
    break;

  case 25:
2524
#line 557 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2525
    {
2526
		/* X.680Amd1 specifies TAG and XER */
2527 2528 2529 2530
		if(strcmp((yyvsp[(1) - (2)].tv_str), "TAG") == 0) {
		 	(yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
		} else if(strcmp((yyvsp[(1) - (2)].tv_str), "XER") == 0) {
		 	(yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
2531 2532
		} else {
			fprintf(stderr,
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;
2537
		}
2538
		free((yyvsp[(1) - (2)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
2539 2540 2541
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2542
  case 26:
2543
#line 578 "asn1p_y.y"
2544
    { (yyval.a_module) = 0; }
Lev Walkin's avatar
Lev Walkin committed
2545 2546
    break;

Lev Walkin's avatar
Lev Walkin committed
2547
  case 27:
2548
#line 579 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2549
    {
2550
		(yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin's avatar
Lev Walkin committed
2551 2552 2553
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2554
  case 28:
2555
#line 588 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2556
    {
2557 2558 2559 2560
		(yyval.a_module) = asn1p_module_new();
		AL_IMPORT((yyval.a_module), exports, (yyvsp[(1) - (3)].a_module), xp_next);
		AL_IMPORT((yyval.a_module), imports, (yyvsp[(2) - (3)].a_module), xp_next);
		AL_IMPORT((yyval.a_module), members, (yyvsp[(3) - (3)].a_module), next);
2561 2562 2563 2564

		asn1p_module_free((yyvsp[(1) - (3)].a_module));
		asn1p_module_free((yyvsp[(2) - (3)].a_module));
		asn1p_module_free((yyvsp[(3) - (3)].a_module));
Lev Walkin's avatar
Lev Walkin committed
2565 2566 2567
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2568
  case 29:
2569
#line 601 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2570
    {
2571
		(yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin's avatar
Lev Walkin committed
2572 2573 2574
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2575
  case 30:
2576
#line 604 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2577
    {
2578 2579
		if((yyvsp[(1) - (2)].a_module)) {
			(yyval.a_module) = (yyvsp[(1) - (2)].a_module);
Lev Walkin's avatar
Lev Walkin committed
2580
		} else {
2581
			(yyval.a_module) = (yyvsp[(2) - (2)].a_module);
Lev Walkin's avatar
Lev Walkin committed
2582
			break;
Lev Walkin's avatar
Lev Walkin committed
2583
		}
2584
		AL_IMPORT((yyval.a_module), members, (yyvsp[(2) - (2)].a_module), next);
2585
		asn1p_module_free((yyvsp[(2) - (2)].a_module));
Lev Walkin's avatar
Lev Walkin committed
2586 2587 2588
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2589
  case 31:
2590
#line 621 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2591
    {
2592 2593 2594 2595 2596
		(yyval.a_module) = asn1p_module_new();
		checkmem((yyval.a_module));
		assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
		assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
		TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2597 2598 2599
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2600
  case 32:
2601
#line 628 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2602
    {
2603 2604 2605 2606 2607
		(yyval.a_module) = asn1p_module_new();
		checkmem((yyval.a_module));
		assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
		assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
		TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2608 2609 2610
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2611
  case 33:
2612
#line 642 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2613
    {
2614 2615 2616 2617 2618
		(yyval.a_module) = asn1p_module_new();
		checkmem((yyval.a_module));
		assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
		assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
		TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2619 2620 2621
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2622
  case 34:
2623
#line 650 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2624 2625 2626
    { asn1p_lexer_hack_push_encoding_control(); }
    break;

Lev Walkin's avatar
Lev Walkin committed
2627
  case 35:
2628
#line 651 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2629
    {
2630 2631
		fprintf(stderr,
			"WARNING: ENCODING-CONTROL %s "
2632 2633
			"specification at %s:%d ignored\n",
			(yyvsp[(2) - (3)].tv_str), ASN_FILENAME, yylineno);
2634 2635
		free((yyvsp[(2) - (3)].tv_str));
		(yyval.a_module) = 0;
Lev Walkin's avatar
Lev Walkin committed
2636 2637 2638
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2639
  case 36:
2640
#line 663 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2641
    {
Lev Walkin's avatar
Lev Walkin committed
2642
		return yyerror(
Lev Walkin's avatar
Lev Walkin committed
2643 2644
			"Attempt to redefine a standard basic string type, "
			"please comment out or remove this type redefinition.");
Lev Walkin's avatar
Lev Walkin committed
2645 2646 2647
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2648
  case 37:
2649
#line 676 "asn1p_y.y"
2650
    { (yyval.a_module) = 0; }
Lev Walkin's avatar
Lev Walkin committed
2651 2652
    break;

Lev Walkin's avatar
Lev Walkin committed
2653
  case 39:
2654
#line 680 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2655
    {
2656 2657 2658 2659
		if(!saved_aid && 0)
			return yyerror("Unterminated IMPORTS FROM, "
					"expected semicolon ';'");
		saved_aid = 0;
2660
		(yyval.a_module) = (yyvsp[(2) - (3)].a_module);
Lev Walkin's avatar
Lev Walkin committed
2661 2662 2663
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2664
  case 40:
2665
#line 690 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2666
    {
Lev Walkin's avatar
Lev Walkin committed
2667
		return yyerror("Empty IMPORTS list");
Lev Walkin's avatar
Lev Walkin committed
2668 2669 2670
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2671
  case 41:
2672
#line 696 "asn1p_y.y"
2673
    { (yyval.a_module) = asn1p_module_new(); }
2674 2675
    break;

Lev Walkin's avatar
Lev Walkin committed
2676
  case 43:
2677
#line 700 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2678
    {
2679 2680 2681
		(yyval.a_module) = asn1p_module_new();
		checkmem((yyval.a_module));
		TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin's avatar
Lev Walkin committed
2682 2683 2684
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2685
  case 44:
2686
#line 705 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2687
    {
2688 2689
		(yyval.a_module) = (yyvsp[(1) - (2)].a_module);
		TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(2) - (2)].a_xports), xp_next);
Lev Walkin's avatar
Lev Walkin committed
2690 2691 2692
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2693
  case 45:
2694
#line 712 "asn1p_y.y"
2695
    { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
Lev Walkin's avatar
Lev Walkin committed
2696 2697
    break;

Lev Walkin's avatar
Lev Walkin committed
2698
  case 46:
2699
#line 713 "asn1p_y.y"
2700
    { (yyval.a_aid).oid = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin's avatar
Lev Walkin committed
2701 2702
    break;

Lev Walkin's avatar
Lev Walkin committed
2703
  case 47:
2704
#line 717 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2705
    {
2706 2707 2708
		(yyval.a_xports) = (yyvsp[(1) - (4)].a_xports);
		(yyval.a_xports)->fromModuleName = (yyvsp[(3) - (4)].tv_str);
		(yyval.a_xports)->identifier = (yyvsp[(4) - (4)].a_aid);
2709
		/* This stupid thing is used for look-back hack. */
2710 2711
		saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
		checkmem((yyval.a_xports));
Lev Walkin's avatar
Lev Walkin committed
2712 2713 2714
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2715
  case 48:
2716
#line 728 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2717
    {
2718 2719 2720
		(yyval.a_xports) = asn1p_xports_new();
		checkmem((yyval.a_xports));
		TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2721 2722 2723
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2724
  case 49:
2725
#line 733 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2726
    {
2727 2728
		(yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
		TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2729 2730 2731
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2732
  case 50:
2733
#line 740 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2734
    {
2735 2736 2737 2738
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin's avatar
Lev Walkin committed
2739 2740 2741
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2742
  case 51:
2743
#line 746 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2744
    {		/* Completely equivalent to above */
2745 2746 2747 2748
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin's avatar
Lev Walkin committed
2749 2750 2751
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2752
  case 52:
2753
#line 752 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2754
    {
2755 2756 2757 2758
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin's avatar
Lev Walkin committed
2759 2760 2761
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2762
  case 53:
2763
#line 762 "asn1p_y.y"
2764
    { (yyval.a_module) = 0; }
Lev Walkin's avatar
Lev Walkin committed
2765 2766
    break;

Lev Walkin's avatar
Lev Walkin committed
2767
  case 54:
2768
#line 763 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2769
    {
2770 2771 2772 2773
		(yyval.a_module) = asn1p_module_new();
		checkmem((yyval.a_module));
		if((yyvsp[(1) - (1)].a_xports)) {
			TQ_ADD(&((yyval.a_module)->exports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin's avatar
Lev Walkin committed
2774 2775 2776 2777 2778 2779
		} else {
			/* "EXPORTS ALL;" */
		}
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2780
  case 55:
2781
#line 775 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2782
    {
2783
		(yyval.a_xports) = (yyvsp[(2) - (3)].a_xports);
Lev Walkin's avatar
Lev Walkin committed
2784 2785 2786
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2787
  case 56:
2788
#line 778 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2789
    {
2790
		(yyval.a_xports) = 0;
Lev Walkin's avatar
Lev Walkin committed
2791 2792 2793
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2794
  case 57:
2795
#line 781 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2796
    {
Lev Walkin's avatar
Lev Walkin committed
2797
		/* Empty EXPORTS clause effectively prohibits export. */
2798 2799
		(yyval.a_xports) = asn1p_xports_new();
		checkmem((yyval.a_xports));
Lev Walkin's avatar
Lev Walkin committed
2800 2801 2802
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2803
  case 58:
2804
#line 789 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2805
    {
2806 2807 2808
		(yyval.a_xports) = asn1p_xports_new();
		assert((yyval.a_xports));
		TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2809 2810 2811
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2812
  case 59:
2813
#line 794 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2814
    {
2815 2816
		(yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
		TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin's avatar
Lev Walkin committed
2817 2818 2819
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2820
  case 60:
2821
#line 801 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2822
    {
2823 2824 2825 2826
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin's avatar
Lev Walkin committed
2827 2828 2829
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2830
  case 61:
2831
#line 807 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2832
    {
2833 2834 2835 2836
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin's avatar
Lev Walkin committed
2837 2838 2839
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2840
  case 62:
2841
#line 813 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2842
    {
2843 2844 2845 2846
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
		(yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin's avatar
Lev Walkin committed
2847 2848 2849
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2850
  case 63:
2851
#line 822 "asn1p_y.y"
2852
    { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
Lev Walkin's avatar
Lev Walkin committed
2853 2854
    break;

Lev Walkin's avatar
Lev Walkin committed
2855
  case 64:
2856
#line 825 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2857
    {
2858 2859 2860 2861 2862
		(yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
		assert((yyval.a_expr)->Identifier == 0);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->meta_type = AMT_VALUESET;
		(yyval.a_expr)->constraints = (yyvsp[(4) - (4)].a_constr);
Lev Walkin's avatar
Lev Walkin committed
2863 2864 2865
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
2866
  case 65:
2867
#line 845 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2868
    {
2869 2870 2871 2872 2873
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->reference = (yyvsp[(1) - (1)].a_ref);
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
		(yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin's avatar
Lev Walkin committed
2874 2875 2876
	}
    break;

2877 2878
  case 66:
#line 855 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2879
    {
2880 2881 2882 2883 2884 2885
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->reference = (yyvsp[(1) - (4)].a_ref);
		(yyval.a_expr)->rhs_pspecs = (yyvsp[(3) - (4)].a_expr);
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
		(yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin's avatar
Lev Walkin committed
2886 2887 2888
	}
    break;

2889 2890
  case 67:
#line 875 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2891
    {
2892 2893 2894 2895
		(yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		assert((yyval.a_expr)->expr_type);
		assert((yyval.a_expr)->meta_type);
Lev Walkin's avatar
Lev Walkin committed
2896 2897 2898
	}
    break;

2899 2900
  case 68:
#line 881 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2901
    {
2902 2903 2904 2905
		(yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
		assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
Lev Walkin's avatar
Lev Walkin committed
2906 2907 2908
	}
    break;

2909 2910
  case 69:
#line 897 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2911
    {
2912 2913 2914
		(yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
		(yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
Lev Walkin's avatar
Lev Walkin committed
2915 2916 2917
	}
    break;

2918 2919
  case 70:
#line 903 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2920
    {
2921 2922 2923
		(yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
		(yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
Lev Walkin's avatar
Lev Walkin committed
2924 2925 2926
	}
    break;

2927 2928
  case 71:
#line 911 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2929
    {
Lev Walkin's avatar
Lev Walkin committed
2930
		int ret;
2931 2932 2933
		(yyval.a_plist) = asn1p_paramlist_new(yylineno);
		checkmem((yyval.a_plist));
		ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(1) - (1)].a_parg).governor, (yyvsp[(1) - (1)].a_parg).argument);
Lev Walkin's avatar
Lev Walkin committed
2934
		checkmem(ret == 0);
2935
		asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor);
2936
		free((yyvsp[(1) - (1)].a_parg).argument);
Lev Walkin's avatar
Lev Walkin committed
2937 2938 2939
	}
    break;

2940 2941
  case 72:
#line 920 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2942
    {
Lev Walkin's avatar
Lev Walkin committed
2943
		int ret;
2944 2945
		(yyval.a_plist) = (yyvsp[(1) - (3)].a_plist);
		ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(3) - (3)].a_parg).governor, (yyvsp[(3) - (3)].a_parg).argument);
Lev Walkin's avatar
Lev Walkin committed
2946
		checkmem(ret == 0);
2947
		asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor);
2948
		free((yyvsp[(3) - (3)].a_parg).argument);
Lev Walkin's avatar
Lev Walkin committed
2949 2950 2951
	}
    break;

2952 2953
  case 73:
#line 931 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2954
    {
2955 2956
		(yyval.a_parg).governor = NULL;
		(yyval.a_parg).argument = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
2957 2958 2959
	}
    break;

2960 2961
  case 74:
#line 935 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2962
    {
Lev Walkin's avatar
Lev Walkin committed
2963
		int ret;
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);
Lev Walkin's avatar
Lev Walkin committed
2966
		checkmem(ret == 0);
2967
		(yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2968
		free((yyvsp[(1) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
2969 2970 2971
	}
    break;

2972 2973
  case 75:
#line 943 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2974
    {
Lev Walkin's avatar
Lev Walkin committed
2975
		int ret;
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);
Lev Walkin's avatar
Lev Walkin committed
2978
		checkmem(ret == 0);
2979
		(yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2980
		free((yyvsp[(1) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
2981 2982 2983
	}
    break;

2984 2985
  case 76:
#line 951 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2986
    {
Lev Walkin's avatar
Lev Walkin committed
2987
		int ret;
2988
		(yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
2989 2990
		ret = asn1p_ref_add_component((yyval.a_parg).governor,
			ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
Lev Walkin's avatar
Lev Walkin committed
2991
		checkmem(ret == 0);
2992
		(yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
2993 2994 2995
	}
    break;

2996 2997
  case 77:
#line 959 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
2998
    {
Lev Walkin's avatar
Lev Walkin committed
2999
		int ret;
3000
		(yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
3001 3002
		ret = asn1p_ref_add_component((yyval.a_parg).governor,
			ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
Lev Walkin's avatar
Lev Walkin committed
3003
		checkmem(ret == 0);
3004
		(yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
3005 3006 3007
	}
    break;

3008 3009
  case 78:
#line 970 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3010
    {
3011 3012 3013
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3014 3015 3016
	}
    break;

3017 3018
  case 79:
#line 975 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3019
    {
3020 3021
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3022 3023 3024
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
3025
  case 81:
3026
#line 983 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3027
    {
3028 3029
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
3030
		(yyval.a_expr)->Identifier = strdup("?");
3031 3032 3033
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin's avatar
Lev Walkin committed
3034 3035 3036
	}
    break;

3037 3038
  case 82:
#line 991 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3039
    {
3040 3041
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
3042
		(yyval.a_expr)->Identifier = strdup("?");
3043 3044
		(yyval.a_expr)->expr_type = A1TC_REFERENCE;
		(yyval.a_expr)->meta_type = AMT_VALUE;
3045
		(yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin's avatar
Lev Walkin committed
3046 3047 3048
	}
    break;

3049 3050
  case 83:
#line 999 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3051
    {
3052 3053 3054 3055
		(yyval.a_expr) = NEW_EXPR();
		(yyval.a_expr)->expr_type = A1TC_VALUESET;
		(yyval.a_expr)->meta_type = AMT_VALUESET;
		(yyval.a_expr)->constraints = (yyvsp[(1) - (1)].a_constr);
Lev Walkin's avatar
Lev Walkin committed
3056 3057 3058
	}
    break;

3059 3060
  case 84:
#line 1022 "asn1p_y.y"
3061
    { (yyval.a_expr) = NEW_EXPR(); }
Lev Walkin's avatar
Lev Walkin committed
3062 3063
    break;

3064 3065
  case 85:
#line 1023 "asn1p_y.y"
3066
    { (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr); }
Lev Walkin's avatar
Lev Walkin committed
3067 3068
    break;

3069 3070
  case 86:
#line 1026 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3071
    {
3072 3073 3074
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3075 3076 3077
	}
    break;

3078 3079
  case 87:
#line 1031 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3080
    {
3081 3082
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3083 3084 3085
	}
    break;

3086 3087
  case 88:
#line 1035 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3088
    {
3089
		(yyval.a_expr) = (yyvsp[(1) - (5)].a_expr);
3090
		asn1p_expr_add_many((yyval.a_expr), (yyvsp[(4) - (5)].a_expr));
3091
		asn1p_expr_free((yyvsp[(4) - (5)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3092 3093 3094
	}
    break;

3095 3096
  case 89:
#line 1043 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3097
    {
3098 3099 3100 3101 3102
		(yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
		assert((yyval.a_expr)->Identifier == 0);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyvsp[(3) - (3)].a_marker).flags |= (yyval.a_expr)->marker.flags;
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3103 3104 3105
	}
    break;

3106 3107
  case 90:
#line 1050 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3108
    {
3109 3110 3111 3112
		(yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
		(yyvsp[(2) - (2)].a_marker).flags |= (yyval.a_expr)->marker.flags;
		(yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
		_fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin's avatar
Lev Walkin committed
3113 3114 3115
	}
    break;

3116 3117
  case 91:
#line 1056 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3118
    {
3119 3120 3121 3122 3123
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->meta_type = (yyvsp[(3) - (3)].a_expr)->meta_type;
		(yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3124 3125 3126
	}
    break;

3127 3128
  case 92:
#line 1063 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3129
    {
3130
		(yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin's avatar
Lev Walkin committed
3131 3132 3133
	}
    break;

3134 3135
  case 93:
#line 1069 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3136
    {
3137 3138 3139
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3140 3141 3142
	}
    break;

3143 3144
  case 94:
#line 1074 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3145
    {
3146 3147
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3148 3149 3150
	}
    break;

3151 3152
  case 95:
#line 1081 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3153
    {
3154 3155 3156
		(yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
		assert((yyval.a_expr)->Identifier == 0);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
3157 3158 3159
	}
    break;

3160 3161
  case 96:
#line 1086 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3162
    {
3163
		(yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin's avatar
Lev Walkin committed
3164 3165 3166
	}
    break;

3167 3168
  case 97:
#line 1089 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3169
    {
3170 3171
		(yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
		_fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin's avatar
Lev Walkin committed
3172 3173 3174
	}
    break;

3175 3176
  case 98:
#line 1096 "asn1p_y.y"
3177 3178 3179 3180 3181 3182 3183
    {
		(yyval.a_expr) = (yyvsp[(3) - (5)].a_expr);
		checkmem((yyval.a_expr));
		(yyval.a_expr)->with_syntax = (yyvsp[(5) - (5)].a_wsynt);
		assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
		assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
	}
Lev Walkin's avatar
Lev Walkin committed
3184 3185
    break;

3186 3187
  case 99:
#line 1106 "asn1p_y.y"
3188
    { (yyval.a_int) = 0; }
Lev Walkin's avatar
Lev Walkin committed
3189 3190
    break;

3191 3192
  case 100:
#line 1107 "asn1p_y.y"
3193
    { (yyval.a_int) = 1; }
Lev Walkin's avatar
Lev Walkin committed
3194 3195
    break;

3196 3197
  case 101:
#line 1111 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3198
    {
3199 3200 3201 3202 3203
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_CLASSDEF;
		(yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3204 3205 3206
	}
    break;

3207 3208
  case 102:
#line 1118 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3209
    {
3210 3211
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3212 3213 3214
	}
    break;

3215 3216
  case 103:
#line 1128 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3217
    {
3218 3219 3220 3221 3222 3223
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS;	/* TypeFieldSpec */
		(yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3224 3225 3226
	}
    break;

3227 3228
  case 104:
#line 1138 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3229
    {
3230 3231 3232 3233 3234 3235 3236
		(yyval.a_expr) = NEW_EXPR();
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS;	/* FixedTypeValueFieldSpec */
		(yyval.a_expr)->unique = (yyvsp[(3) - (4)].a_int);
		(yyval.a_expr)->marker = (yyvsp[(4) - (4)].a_marker);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (4)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3237 3238 3239
	}
    break;

3240 3241
  case 105:
#line 1149 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3242
    {
3243 3244 3245 3246 3247 3248
		(yyval.a_expr) = NEW_EXPR();
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
		(yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3249 3250 3251
	}
    break;

3252 3253
  case 106:
#line 1159 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3254
    {
3255 3256 3257 3258 3259 3260 3261
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3262 3263 3264
	}
    break;

3265 3266
  case 107:
#line 1170 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3267
    {
3268 3269 3270 3271 3272 3273
		(yyval.a_expr) = NEW_EXPR();
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
		(yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3274 3275 3276
	}
    break;

3277 3278
  case 108:
#line 1180 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3279
    {
3280 3281 3282 3283 3284 3285 3286
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
		asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (3)].a_expr));
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin's avatar
Lev Walkin committed
3287 3288 3289
	}
    break;

3290 3291
  case 109:
#line 1191 "asn1p_y.y"
3292 3293 3294 3295 3296 3297 3298 3299 3300
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
		(yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
		(yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
		(yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
		(yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
	}
Lev Walkin's avatar
Lev Walkin committed
3301 3302
    break;

3303 3304
  case 110:
#line 1203 "asn1p_y.y"
3305
    { (yyval.a_wsynt) = 0; }
Lev Walkin's avatar
Lev Walkin committed
3306 3307
    break;

3308 3309
  case 111:
#line 1204 "asn1p_y.y"
3310 3311 3312
    {
		(yyval.a_wsynt) = (yyvsp[(1) - (1)].a_wsynt);
	}
Lev Walkin's avatar
Lev Walkin committed
3313 3314
    break;

3315 3316
  case 112:
#line 1211 "asn1p_y.y"
3317
    { asn1p_lexer_hack_enable_with_syntax(); }
Lev Walkin's avatar
Lev Walkin committed
3318 3319
    break;

3320 3321
  case 113:
#line 1213 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3322
    {
3323
		(yyval.a_wsynt) = (yyvsp[(5) - (6)].a_wsynt);
Lev Walkin's avatar
Lev Walkin committed
3324 3325 3326
	}
    break;

3327 3328
  case 114:
#line 1219 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3329
    {
3330 3331
		(yyval.a_wsynt) = asn1p_wsyntx_new();
		TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(1) - (1)].a_wchunk), next);
Lev Walkin's avatar
Lev Walkin committed
3332 3333 3334
	}
    break;

3335 3336
  case 115:
#line 1223 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3337
    {
3338 3339
		(yyval.a_wsynt) = (yyvsp[(1) - (2)].a_wsynt);
		TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(2) - (2)].a_wchunk), next);
Lev Walkin's avatar
Lev Walkin committed
3340 3341 3342
	}
    break;

3343 3344
  case 116:
#line 1230 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3345
    {
3346 3347
		(yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_opaque).buf, 0);
		(yyval.a_wchunk)->type = WC_WHITESPACE;
Lev Walkin's avatar
Lev Walkin committed
3348 3349 3350
	}
    break;

3351 3352
  case 117:
#line 1234 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3353
    {
3354
		(yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_str), 0);
Lev Walkin's avatar
Lev Walkin committed
3355 3356 3357
	}
    break;

3358 3359
  case 118:
#line 1237 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3360
    {
3361 3362
		(yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].a_refcomp).name, 0);
		(yyval.a_wchunk)->type = WC_FIELD;
Lev Walkin's avatar
Lev Walkin committed
3363 3364 3365
	}
    break;

3366 3367
  case 119:
#line 1241 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3368
    {
3369
		(yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[(2) - (3)].a_wsynt));
Lev Walkin's avatar
Lev Walkin committed
3370 3371 3372
	}
    break;

3373 3374
  case 120:
#line 1247 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3375
    {
3376 3377 3378 3379 3380 3381
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = strdup("...");
		checkmem((yyval.a_expr)->Identifier);
		(yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3382 3383 3384
	}
    break;

3385 3386
  case 121:
#line 1255 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3387
    {
3388 3389 3390 3391 3392 3393 3394
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = strdup("...");
		checkmem((yyval.a_expr)->Identifier);
		(yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
		(yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3395 3396 3397
	}
    break;

3398 3399
  case 122:
#line 1264 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3400
    {
3401 3402 3403 3404 3405 3406 3407 3408 3409 3410
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = strdup("...");
		(yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
		checkmem((yyval.a_expr)->Identifier);
		(yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
3411
  case 124:
3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
#line 1278 "asn1p_y.y"
    {
        (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
        (yyval.a_expr)->tag = (yyvsp[(1) - (2)].a_tag);
    }
    break;

  case 125:
#line 1285 "asn1p_y.y"
    {
		(yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
		/*
		 * Outer constraint for SEQUENCE OF and SET OF applies
		 * to the inner type.
		 */
		if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
		|| (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
			assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
			TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(2) - (2)].a_constr);
		} else {
			if((yyval.a_expr)->constraints) {
				assert(!(yyvsp[(2) - (2)].a_constr));
				/* Check this : optManyConstraints is not used ?! */
				asn1p_constraint_free((yyvsp[(2) - (2)].a_constr));
			} else {
				(yyval.a_expr)->constraints = (yyvsp[(2) - (2)].a_constr);
			}
		}
	}
    break;

  case 126:
#line 1308 "asn1p_y.y"
    {
		(yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
		/*
		 * Outer constraint for SEQUENCE OF and SET OF applies
		 * to the inner type.
		 */
		if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
		|| (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
			assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
			TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(2) - (2)].a_constr);
		} else {
			if((yyval.a_expr)->constraints) {
				assert(!(yyvsp[(2) - (2)].a_constr));
				/* Check this : optManyConstraints is not used ?! */
				asn1p_constraint_free((yyvsp[(2) - (2)].a_constr));
			} else {
				(yyval.a_expr)->constraints = (yyvsp[(2) - (2)].a_constr);
			}
		}
	}
    break;

  case 127:
#line 1331 "asn1p_y.y"
3469 3470 3471
    {
		(yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
		(yyval.a_expr)->tag = (yyvsp[(1) - (3)].a_tag);
3472 3473 3474 3475
		/*
		 * Outer constraint for SEQUENCE OF and SET OF applies
		 * to the inner type.
		 */
3476 3477 3478 3479
		if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
		|| (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
			assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
			TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(3) - (3)].a_constr);
3480
		} else {
3481 3482
			if((yyval.a_expr)->constraints) {
				assert(!(yyvsp[(2) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3483
				/* Check this : optManyConstraints is not used ?! */
3484
				asn1p_constraint_free((yyvsp[(3) - (3)].a_constr));
3485
			} else {
3486
				(yyval.a_expr)->constraints = (yyvsp[(3) - (3)].a_constr);
3487 3488
			}
		}
Lev Walkin's avatar
Lev Walkin committed
3489 3490 3491
	}
    break;

3492 3493
  case 128:
#line 1355 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3494
    {
3495
		(yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
3496
		asn1p_as_pointer = 0;
Lev Walkin's avatar
Lev Walkin committed
3497 3498 3499
	}
    break;

3500 3501
  case 129:
#line 1362 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3502
    {
3503
        (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3504
		(yyval.a_expr)->marker.flags |= (yyvsp[(1) - (2)].a_int);
3505

3506 3507
		if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
		&& ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
3508 3509
			fprintf(stderr,
				"INFO: Directive <ASN1C:RepresentAsPointer> "
3510
				"applied to %s at %s:%d\n",
3511 3512
				ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
					?  ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
3513
					: "member",
3514
				ASN_FILENAME, (yyval.a_expr)->_lineno
3515 3516
			);
		}
3517
    }
Lev Walkin's avatar
Lev Walkin committed
3518 3519
    break;

3520 3521
  case 133:
#line 1386 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3522
    {
3523 3524 3525 3526
		(yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
		assert((yyval.a_expr)->expr_type == A1TC_INVALID);
		(yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3527 3528 3529
	}
    break;

3530 3531
  case 134:
#line 1392 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3532
    {
3533 3534 3535 3536
		(yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
		assert((yyval.a_expr)->expr_type == A1TC_INVALID);
		(yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3537 3538 3539
	}
    break;

3540 3541
  case 135:
#line 1398 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3542
    {
3543 3544 3545 3546
		(yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
		assert((yyval.a_expr)->expr_type == A1TC_INVALID);
		(yyval.a_expr)->expr_type = ASN_CONSTR_SET;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3547 3548 3549
	}
    break;

3550 3551
  case 136:
#line 1404 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3552
    {
3553 3554 3555 3556 3557 3558 3559 3560
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
		(yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
		(yyval.a_expr)->meta_type = AMT_TYPE;
		(yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
		(yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3561 3562 3563
	}
    break;

3564 3565
  case 137:
#line 1414 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3566
    {
3567 3568 3569 3570 3571 3572 3573 3574
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
		(yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
		(yyval.a_expr)->meta_type = AMT_TYPE;
		(yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
		(yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
3575 3576 3577
	}
    break;

3578 3579
  case 138:
#line 1424 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3580
    {
3581 3582 3583 3584
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = ASN_TYPE_ANY;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3585 3586 3587
	}
    break;

3588 3589
  case 139:
#line 1430 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3590
    {
3591 3592 3593
		int ret;
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
3594
		(yyval.a_expr)->reference = asn1p_ref_new(yylineno, currentModule);
3595 3596 3597 3598 3599
		ret = asn1p_ref_add_component((yyval.a_expr)->reference,
			(yyvsp[(4) - (4)].tv_str), RLT_lowercase);
		checkmem(ret == 0);
		(yyval.a_expr)->expr_type = ASN_TYPE_ANY;
		(yyval.a_expr)->meta_type = AMT_TYPE;
3600
		free((yyvsp[(4) - (4)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3601 3602 3603
	}
    break;

3604 3605
  case 140:
#line 1442 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3606
    {
3607 3608 3609 3610 3611
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->reference = (yyvsp[(3) - (3)].a_ref);
		(yyval.a_expr)->expr_type = A1TC_INSTANCE;
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3612 3613 3614
	}
    break;

3615 3616
  case 141:
#line 1457 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3617
    {
Lev Walkin's avatar
Lev Walkin committed
3618
		int ret;
3619
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3620 3621
		checkmem((yyval.a_ref));
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_UNKNOWN);
Lev Walkin's avatar
Lev Walkin committed
3622
		checkmem(ret == 0);
3623
		free((yyvsp[(1) - (1)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3624 3625 3626
	}
    break;

3627 3628
  case 142:
#line 1465 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3629
    {
Lev Walkin's avatar
Lev Walkin committed
3630
		int ret;
3631
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3632
		checkmem((yyval.a_ref));
3633 3634
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
		free((yyvsp[(1) - (1)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3635
		checkmem(ret == 0);
Lev Walkin's avatar
Lev Walkin committed
3636 3637 3638
	}
    break;

3639 3640
  case 143:
#line 1473 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3641
    {
Lev Walkin's avatar
Lev Walkin committed
3642
		int ret;
3643
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3644 3645
		checkmem((yyval.a_ref));
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin's avatar
Lev Walkin committed
3646
		checkmem(ret == 0);
3647
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin's avatar
Lev Walkin committed
3648
		checkmem(ret == 0);
3649
		free((yyvsp[(1) - (3)].tv_str));
3650
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3651 3652 3653
	}
    break;

3654 3655
  case 144:
#line 1484 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3656
    {
Lev Walkin's avatar
Lev Walkin committed
3657
		int ret;
3658
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3659 3660 3661
		checkmem((yyval.a_ref));
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
		checkmem(ret == 0);
3662
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin's avatar
Lev Walkin committed
3663
		checkmem(ret == 0);
3664
		free((yyvsp[(1) - (3)].tv_str));
3665
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3666 3667 3668
	}
    break;

3669 3670
  case 145:
#line 1495 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3671
    {
Lev Walkin's avatar
Lev Walkin committed
3672
		int ret;
3673 3674 3675
		(yyval.a_ref) = (yyvsp[(3) - (3)].a_ref);
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_CAPITALS);
		free((yyvsp[(1) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3676
		checkmem(ret == 0);
3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688
		/*
		 * Move the last element infront.
		 */
		{
			struct asn1p_ref_component_s tmp_comp;
			tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
			memmove(&(yyval.a_ref)->components[1],
				&(yyval.a_ref)->components[0],
				sizeof((yyval.a_ref)->components[0])
				* ((yyval.a_ref)->comp_count - 1));
			(yyval.a_ref)->components[0] = tmp_comp;
		}
Lev Walkin's avatar
Lev Walkin committed
3689 3690 3691
	}
    break;

3692 3693
  case 146:
#line 1517 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3694
    {
Lev Walkin's avatar
Lev Walkin committed
3695
		int ret;
3696
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3697 3698 3699
		checkmem((yyval.a_ref));
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].a_refcomp).name, (yyvsp[(1) - (1)].a_refcomp).lex_type);
		free((yyvsp[(1) - (1)].a_refcomp).name);
Lev Walkin's avatar
Lev Walkin committed
3700
		checkmem(ret == 0);
Lev Walkin's avatar
Lev Walkin committed
3701 3702 3703
	}
    break;

3704 3705
  case 147:
#line 1525 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3706
    {
3707 3708 3709 3710 3711
		int ret;
		(yyval.a_ref) = (yyvsp[(1) - (3)].a_ref);
		ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].a_refcomp).name, (yyvsp[(3) - (3)].a_refcomp).lex_type);
		free((yyvsp[(3) - (3)].a_refcomp).name);
		checkmem(ret == 0);
Lev Walkin's avatar
Lev Walkin committed
3712 3713 3714
	}
    break;

3715 3716
  case 149:
#line 1538 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3717
    {
3718 3719
		(yyval.a_refcomp).lex_type = RLT_AmpUppercase;
		(yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
3720 3721 3722
	}
    break;

3723 3724
  case 150:
#line 1543 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3725
    {
3726 3727
		(yyval.a_refcomp).lex_type = RLT_Amplowercase;
		(yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
3728 3729 3730
	}
    break;

3731 3732
  case 151:
#line 1552 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3733
    {
3734
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3735
		asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_AmpUppercase);
3736
		free((yyvsp[(1) - (1)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3737 3738 3739
	}
    break;

3740 3741
  case 152:
#line 1557 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3742
    {
3743 3744
		(yyval.a_ref) = (yyval.a_ref);
		asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_AmpUppercase);
3745
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3746 3747 3748
	}
    break;

3749 3750
  case 153:
#line 1562 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3751
    {
3752 3753
		(yyval.a_ref) = (yyval.a_ref);
		asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_Amplowercase);
3754
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3755 3756 3757
	}
    break;

3758 3759
  case 154:
#line 1570 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3760
    {
3761
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3762
		asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
3763
		free((yyvsp[(1) - (1)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3764 3765 3766
	}
    break;

3767 3768
  case 155:
#line 1593 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3769
    {
3770 3771 3772 3773 3774
		(yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
		assert((yyval.a_expr)->Identifier == NULL);
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->value = (yyvsp[(4) - (4)].a_value);
Lev Walkin's avatar
Lev Walkin committed
3775 3776 3777
	}
    break;

3778 3779
  case 158:
#line 1605 "asn1p_y.y"
3780
    { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin's avatar
Lev Walkin committed
3781 3782
    break;

3783 3784
  case 159:
#line 1605 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3785
    {
3786 3787 3788
		(yyval.a_value) = asn1p_value_frombuf((yyvsp[(3) - (3)].tv_opaque).buf, (yyvsp[(3) - (3)].tv_opaque).len, 0);
		checkmem((yyval.a_value));
		(yyval.a_value)->type = ATV_UNPARSED;
Lev Walkin's avatar
Lev Walkin committed
3789 3790 3791
	}
    break;

3792 3793
  case 160:
#line 1613 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3794
    {
3795 3796 3797
		(yyval.a_value) = asn1p_value_fromint(0);
		checkmem((yyval.a_value));
		(yyval.a_value)->type = ATV_NULL;
Lev Walkin's avatar
Lev Walkin committed
3798 3799 3800
	}
    break;

3801 3802
  case 161:
#line 1618 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3803
    {
3804 3805 3806
		(yyval.a_value) = asn1p_value_fromint(0);
		checkmem((yyval.a_value));
		(yyval.a_value)->type = ATV_FALSE;
Lev Walkin's avatar
Lev Walkin committed
3807 3808 3809
	}
    break;

Lev Walkin's avatar
Lev Walkin committed
3810
  case 162:
3811
#line 1623 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3812
    {
3813
		(yyval.a_value) = asn1p_value_fromint(1);
3814
		checkmem((yyval.a_value));
3815
		(yyval.a_value)->type = ATV_TRUE;
Lev Walkin's avatar
Lev Walkin committed
3816 3817 3818
	}
    break;

3819 3820
  case 168:
#line 1636 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3821
    {
3822 3823
		asn1p_ref_t *ref;
		int ret;
3824
		ref = asn1p_ref_new(yylineno, currentModule);
3825 3826 3827 3828 3829 3830 3831 3832 3833
		checkmem(ref);
		ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
		checkmem(ret == 0);
		ret = asn1p_ref_add_component(ref, (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
		checkmem(ret == 0);
		(yyval.a_value) = asn1p_value_fromref(ref, 0);
		checkmem((yyval.a_value));
		free((yyvsp[(1) - (3)].tv_str));
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
3834 3835 3836
	}
    break;

3837 3838
  case 169:
#line 1654 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3839
    {
3840 3841
		(yyval.a_value) = asn1p_value_frombuf((yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len, 0);
		checkmem((yyval.a_value));
Lev Walkin's avatar
Lev Walkin committed
3842 3843 3844
	}
    break;

3845 3846
  case 170:
#line 1658 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3847
    {
3848 3849 3850
		(yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
		checkmem((yyval.a_value));
		(yyval.a_value)->type = ATV_TUPLE;
Lev Walkin's avatar
Lev Walkin committed
3851 3852 3853
	}
    break;

3854 3855
  case 171:
#line 1663 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3856
    {
3857 3858 3859
		(yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
		checkmem((yyval.a_value));
		(yyval.a_value)->type = ATV_QUADRUPLE;
Lev Walkin's avatar
Lev Walkin committed
3860 3861 3862
	}
    break;

3863 3864
  case 172:
#line 1671 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3865
    {
3866
		(yyval.tv_opaque).len = (yyvsp[(1) - (1)].tv_opaque).len + 1;
3867
		(yyval.tv_opaque).buf = malloc(1 + (yyval.tv_opaque).len + 1);
3868 3869 3870 3871 3872
		checkmem((yyval.tv_opaque).buf);
		(yyval.tv_opaque).buf[0] = '{';
		memcpy((yyval.tv_opaque).buf + 1, (yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len);
		(yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
		free((yyvsp[(1) - (1)].tv_opaque).buf);
3873
    }
Lev Walkin's avatar
Lev Walkin committed
3874 3875
    break;

3876 3877
  case 173:
#line 1680 "asn1p_y.y"
3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889
    {
		int newsize = (yyvsp[(1) - (2)].tv_opaque).len + (yyvsp[(2) - (2)].tv_opaque).len;
		char *p = malloc(newsize + 1);
		checkmem(p);
		memcpy(p         , (yyvsp[(1) - (2)].tv_opaque).buf, (yyvsp[(1) - (2)].tv_opaque).len);
		memcpy(p + (yyvsp[(1) - (2)].tv_opaque).len, (yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len);
		p[newsize] = '\0';
		free((yyvsp[(1) - (2)].tv_opaque).buf);
		free((yyvsp[(2) - (2)].tv_opaque).buf);
		(yyval.tv_opaque).buf = p;
		(yyval.tv_opaque).len = newsize;
	}
Lev Walkin's avatar
Lev Walkin committed
3890 3891
    break;

3892 3893
  case 175:
#line 1696 "asn1p_y.y"
3894 3895 3896 3897 3898 3899
    {
        (yyval.tv_opaque).len = strlen((yyvsp[(1) - (1)].tv_str));
        (yyval.tv_opaque).buf = (yyvsp[(1) - (1)].tv_str);
    }
    break;

3900 3901
  case 176:
#line 1702 "asn1p_y.y"
3902
    { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
Lev Walkin's avatar
Lev Walkin committed
3903 3904
    break;

3905 3906
  case 177:
#line 1703 "asn1p_y.y"
3907
    { (yyval.a_type) = ASN_BASIC_NULL; }
Lev Walkin's avatar
Lev Walkin committed
3908 3909
    break;

3910 3911
  case 178:
#line 1704 "asn1p_y.y"
3912
    { (yyval.a_type) = ASN_BASIC_REAL; }
Lev Walkin's avatar
Lev Walkin committed
3913 3914
    break;

3915 3916
  case 179:
#line 1705 "asn1p_y.y"
3917
    { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
Lev Walkin's avatar
Lev Walkin committed
3918 3919
    break;

3920 3921
  case 180:
#line 1706 "asn1p_y.y"
3922
    { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
Lev Walkin's avatar
Lev Walkin committed
3923 3924
    break;

3925 3926
  case 181:
#line 1707 "asn1p_y.y"
3927
    { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
Lev Walkin's avatar
Lev Walkin committed
3928 3929
    break;

3930 3931
  case 182:
#line 1708 "asn1p_y.y"
3932
    { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
Lev Walkin's avatar
Lev Walkin committed
3933 3934
    break;

3935 3936
  case 183:
#line 1709 "asn1p_y.y"
3937
    { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
Lev Walkin's avatar
Lev Walkin committed
3938 3939
    break;

3940 3941
  case 184:
#line 1710 "asn1p_y.y"
3942
    { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
Lev Walkin's avatar
Lev Walkin committed
3943 3944
    break;

3945 3946
  case 185:
#line 1711 "asn1p_y.y"
3947
    { (yyval.a_type) = ASN_BASIC_UTCTime; }
Lev Walkin's avatar
Lev Walkin committed
3948 3949
    break;

3950 3951
  case 186:
#line 1712 "asn1p_y.y"
3952
    { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
Lev Walkin's avatar
Lev Walkin committed
3953 3954
    break;

3955 3956
  case 189:
#line 1721 "asn1p_y.y"
3957
    { (yyval.a_type) = ASN_BASIC_INTEGER; }
Lev Walkin's avatar
Lev Walkin committed
3958 3959
    break;

3960 3961
  case 190:
#line 1722 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3962
    { (yyval.a_type) = ASN_BASIC_INTEGER; }
Lev Walkin's avatar
Lev Walkin committed
3963 3964
    break;

3965 3966
  case 191:
#line 1723 "asn1p_y.y"
3967 3968 3969
    { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
    break;

3970 3971
  case 192:
#line 1727 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3972
    {
3973 3974 3975 3976
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = (yyvsp[(1) - (1)].a_type);
		(yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin's avatar
Lev Walkin committed
3977 3978 3979
	}
    break;

3980 3981
  case 193:
#line 1733 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3982
    {
Lev Walkin's avatar
Lev Walkin committed
3983 3984 3985 3986
        (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
        (yyval.a_expr)->expr_type = ASN_BASIC_INTEGER;
        (yyval.a_expr)->meta_type = AMT_TYPE;
    }
Lev Walkin's avatar
Lev Walkin committed
3987 3988
    break;

3989 3990
  case 194:
#line 1738 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
3991 3992 3993 3994 3995
    {
        (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
        (yyval.a_expr)->expr_type = ASN_BASIC_ENUMERATED;
        (yyval.a_expr)->meta_type = AMT_TYPE;
    }
Lev Walkin's avatar
Lev Walkin committed
3996 3997
    break;

3998 3999
  case 195:
#line 1743 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4000 4001 4002 4003 4004 4005 4006
    {
        (yyval.a_expr) = (yyvsp[(4) - (5)].a_expr);
        (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
        (yyval.a_expr)->meta_type = AMT_TYPE;
    }
    break;

4007 4008
  case 196:
#line 1748 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4009 4010 4011 4012 4013 4014 4015
    {
        (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
        (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
        (yyval.a_expr)->meta_type = AMT_TYPE;
    }
    break;

4016 4017
  case 197:
#line 1753 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4018 4019 4020 4021 4022 4023 4024 4025
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
        (yyval.a_expr)->expr_type = ASN_BASIC_BIT_STRING;
        (yyval.a_expr)->meta_type = AMT_TYPE;
    }
    break;

4026 4027
  case 198:
#line 1762 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4028 4029 4030
    { (yyval.a_type) = ASN_STRING_BMPString; }
    break;

4031 4032
  case 199:
#line 1763 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4033
    {
4034
		(yyval.a_type) = ASN_STRING_GeneralString;
Lev Walkin's avatar
Lev Walkin committed
4035
		fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
Lev Walkin's avatar
Lev Walkin committed
4036 4037 4038
	}
    break;

4039 4040
  case 200:
#line 1767 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4041
    {
4042
		(yyval.a_type) = ASN_STRING_GraphicString;
Lev Walkin's avatar
Lev Walkin committed
4043
		fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
Lev Walkin's avatar
Lev Walkin committed
4044 4045 4046
	}
    break;

4047 4048
  case 201:
#line 1771 "asn1p_y.y"
4049
    { (yyval.a_type) = ASN_STRING_IA5String; }
Lev Walkin's avatar
Lev Walkin committed
4050 4051
    break;

4052 4053
  case 202:
#line 1772 "asn1p_y.y"
4054
    { (yyval.a_type) = ASN_STRING_ISO646String; }
Lev Walkin's avatar
Lev Walkin committed
4055 4056
    break;

4057 4058
  case 203:
#line 1773 "asn1p_y.y"
4059
    { (yyval.a_type) = ASN_STRING_NumericString; }
Lev Walkin's avatar
Lev Walkin committed
4060 4061
    break;

4062 4063
  case 204:
#line 1774 "asn1p_y.y"
4064
    { (yyval.a_type) = ASN_STRING_PrintableString; }
Lev Walkin's avatar
Lev Walkin committed
4065 4066
    break;

4067 4068
  case 205:
#line 1775 "asn1p_y.y"
4069 4070 4071 4072
    {
		(yyval.a_type) = ASN_STRING_T61String;
		fprintf(stderr, "WARNING: T61String is not fully supported\n");
	}
Lev Walkin's avatar
Lev Walkin committed
4073 4074
    break;

4075 4076
  case 206:
#line 1779 "asn1p_y.y"
4077
    { (yyval.a_type) = ASN_STRING_TeletexString; }
Lev Walkin's avatar
Lev Walkin committed
4078 4079
    break;

4080 4081
  case 207:
#line 1780 "asn1p_y.y"
4082
    { (yyval.a_type) = ASN_STRING_UniversalString; }
Lev Walkin's avatar
Lev Walkin committed
4083 4084
    break;

4085 4086
  case 208:
#line 1781 "asn1p_y.y"
4087
    { (yyval.a_type) = ASN_STRING_UTF8String; }
Lev Walkin's avatar
Lev Walkin committed
4088 4089
    break;

4090 4091
  case 209:
#line 1782 "asn1p_y.y"
4092 4093 4094 4095
    {
		(yyval.a_type) = ASN_STRING_VideotexString;
		fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
	}
Lev Walkin's avatar
Lev Walkin committed
4096 4097
    break;

4098 4099
  case 210:
#line 1786 "asn1p_y.y"
4100
    { (yyval.a_type) = ASN_STRING_VisibleString; }
Lev Walkin's avatar
Lev Walkin committed
4101 4102
    break;

4103 4104
  case 211:
#line 1787 "asn1p_y.y"
4105
    { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
Lev Walkin's avatar
Lev Walkin committed
4106 4107
    break;

4108 4109
  case 216:
#line 1799 "asn1p_y.y"
4110
    { (yyval.a_constr) = 0; }
Lev Walkin's avatar
Lev Walkin committed
4111 4112
    break;

4113 4114
  case 218:
#line 1804 "asn1p_y.y"
4115
    { (yyval.a_constr) = 0; }
Lev Walkin's avatar
Lev Walkin committed
4116 4117
    break;

4118 4119
  case 220:
#line 1809 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4120
    { (yyval.a_constr) = 0; }
Lev Walkin's avatar
Lev Walkin committed
4121 4122
    break;

4123 4124
  case 223:
#line 1815 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4125
    {
Lev Walkin's avatar
Lev Walkin committed
4126
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(2) - (3)].a_constr), 0);
4127
    }
Lev Walkin's avatar
Lev Walkin committed
4128 4129
    break;

4130 4131
  case 225:
#line 1822 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4132
    {
Lev Walkin's avatar
Lev Walkin committed
4133 4134 4135 4136 4137
        if((yyvsp[(2) - (2)].a_constr)->type == ACT_CA_SET && (yyvsp[(2) - (2)].a_constr)->el_count == 1) {
            CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (2)].a_constr), (yyvsp[(2) - (2)].a_constr)->elements[0]);
        } else {
            CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (2)].a_constr), (yyvsp[(2) - (2)].a_constr));
        }
Lev Walkin's avatar
Lev Walkin committed
4138 4139 4140
	}
    break;

4141 4142
  case 229:
#line 1836 "asn1p_y.y"
4143 4144 4145 4146 4147 4148
    {
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
		(yyval.a_constr)->type = ACT_EL_EXT;
	}
    break;

4149 4150
  case 231:
#line 1841 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4151
    {
Lev Walkin's avatar
Lev Walkin committed
4152 4153 4154 4155 4156
       asn1p_constraint_t *ct;
       ct = asn1p_constraint_new(yylineno, currentModule);
       ct->type = ACT_EL_EXT;
       CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
   }
4157 4158
    break;

4159 4160
  case 232:
#line 1847 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4161
    {
Lev Walkin's avatar
Lev Walkin committed
4162 4163 4164 4165 4166 4167 4168
       asn1p_constraint_t *ct;
       ct = asn1p_constraint_new(yylineno, currentModule);
       ct->type = ACT_EL_EXT;
       CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (5)].a_constr), ct);
       ct = (yyval.a_constr);
       CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[(5) - (5)].a_constr));
   }
Lev Walkin's avatar
Lev Walkin committed
4169 4170
    break;

4171 4172
  case 234:
#line 1859 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4173
    {
Lev Walkin's avatar
Lev Walkin committed
4174
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin's avatar
Lev Walkin committed
4175 4176 4177
	}
    break;

4178 4179
  case 236:
#line 1866 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4180
    {
Lev Walkin's avatar
Lev Walkin committed
4181
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_UNI, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin's avatar
Lev Walkin committed
4182 4183 4184
	}
    break;

4185 4186
  case 238:
#line 1873 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4187
    {
Lev Walkin's avatar
Lev Walkin committed
4188
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_INT, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin's avatar
Lev Walkin committed
4189 4190 4191
	}
    break;

4192 4193
  case 240:
#line 1881 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4194
    {
Lev Walkin's avatar
Lev Walkin committed
4195
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_EXC, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin's avatar
Lev Walkin committed
4196 4197 4198
	}
    break;

4199 4200
  case 242:
#line 1888 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4201
    {
Lev Walkin's avatar
Lev Walkin committed
4202 4203 4204 4205 4206 4207 4208
        int ret;
        (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
        checkmem((yyval.a_constr));
        (yyval.a_constr)->type = ACT_CA_SET;
        ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
        checkmem(ret == 0);
    }
Lev Walkin's avatar
Lev Walkin committed
4209 4210
    break;

4211 4212
  case 243:
#line 1899 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4213
    {
4214
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4215 4216 4217
		checkmem((yyval.a_constr));
		(yyval.a_constr)->type = ACT_EL_VALUE;
		(yyval.a_constr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4218 4219 4220
	}
    break;

4221 4222
  case 244:
#line 1905 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4223
    {
4224
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4225 4226 4227
		checkmem((yyval.a_constr));
		(yyval.a_constr)->type = ACT_EL_TYPE;
		(yyval.a_constr)->containedSubtype = (yyvsp[(1) - (1)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4228 4229 4230
	}
    break;

4231 4232
  case 250:
#line 1921 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4233
    {
Lev Walkin's avatar
Lev Walkin committed
4234
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_FROM, (yyvsp[(2) - (2)].a_constr), 0);
Lev Walkin's avatar
Lev Walkin committed
4235 4236 4237
	}
    break;

4238 4239
  case 251:
#line 1926 "asn1p_y.y"
4240
    {
Lev Walkin's avatar
Lev Walkin committed
4241
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[(2) - (2)].a_constr), 0);
4242 4243 4244
	}
    break;

4245 4246
  case 252:
#line 1931 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4247
    {
4248
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4249 4250
		(yyval.a_constr)->type = ACT_CT_PATTERN;
		(yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len, 0);
Lev Walkin's avatar
Lev Walkin committed
4251 4252 4253
	}
    break;

4254 4255
  case 253:
#line 1936 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4256
    {
4257
		asn1p_ref_t *ref;
4258
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4259
		(yyval.a_constr)->type = ACT_CT_PATTERN;
4260
		ref = asn1p_ref_new(yylineno, currentModule);
4261 4262
		asn1p_ref_add_component(ref, (yyvsp[(2) - (2)].tv_str), RLT_lowercase);
		(yyval.a_constr)->value = asn1p_value_fromref(ref, 0);
4263
		free((yyvsp[(2) - (2)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
4264 4265 4266
	}
    break;

4267 4268
  case 254:
#line 1948 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4269
    {
Lev Walkin's avatar
Lev Walkin committed
4270 4271 4272 4273 4274 4275
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
		checkmem((yyval.a_constr));
		(yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
		(yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
		(yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
    }
Lev Walkin's avatar
Lev Walkin committed
4276 4277
    break;

4278 4279
  case 256:
#line 1958 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4280
    {
Lev Walkin's avatar
Lev Walkin committed
4281 4282 4283
		(yyval.a_value) = asn1p_value_fromint(-123);
		(yyval.a_value)->type = ATV_MIN;
    }
Lev Walkin's avatar
Lev Walkin committed
4284 4285
    break;

4286 4287
  case 258:
#line 1965 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4288 4289 4290 4291 4292 4293
    {
		(yyval.a_value) = asn1p_value_fromint(321);
		(yyval.a_value)->type = ATV_MAX;
    }
    break;

4294 4295
  case 260:
#line 1973 "asn1p_y.y"
4296
    {
4297 4298
		(yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
		checkmem((yyval.a_value));
4299
		free((yyvsp[(1) - (1)].tv_str));
4300 4301 4302
	}
    break;

4303 4304
  case 261:
#line 1978 "asn1p_y.y"
4305
    {
4306 4307
		(yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
		checkmem((yyval.a_value));
4308
		free((yyvsp[(1) - (1)].tv_str));
4309 4310 4311
	}
    break;

4312 4313
  case 262:
#line 1986 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4314
    {
Lev Walkin's avatar
Lev Walkin committed
4315
		(yyval.a_value) = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
4316
		checkmem((yyval.a_value));
4317
    }
Lev Walkin's avatar
Lev Walkin committed
4318 4319
    break;

4320 4321 4322 4323 4324 4325
  case 263:
#line 1991 "asn1p_y.y"
    {
		(yyval.a_value) = asn1p_value_fromtype((yyvsp[(1) - (1)].a_expr));
		checkmem((yyval.a_value));
    }
Lev Walkin's avatar
Lev Walkin committed
4326 4327
    break;

4328 4329
  case 264:
#line 2002 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4330
    {
4331
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin's avatar
Lev Walkin committed
4332 4333 4334
	}
    break;

4335 4336
  case 265:
#line 2005 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4337
    {
4338 4339 4340
        assert((yyvsp[(3) - (3)].a_constr)->type == ACT_CA_CSV);
        (yyvsp[(3) - (3)].a_constr)->type = ACT_CT_WCOMPS;
        (yyval.a_constr) = (yyvsp[(3) - (3)].a_constr);
Lev Walkin's avatar
Lev Walkin committed
4341 4342 4343
	}
    break;

4344 4345
  case 269:
#line 2013 "asn1p_y.y"
4346 4347 4348
    { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
    break;

4349 4350
  case 270:
#line 2015 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4351
    {
4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362
        assert((yyvsp[(4) - (5)].a_constr)->type == ACT_CA_CSV);
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
        (yyval.a_constr)->type = ACT_CA_CSV;
		asn1p_constraint_t *ct = asn1p_constraint_new(yylineno, currentModule);
		checkmem((yyval.a_constr));
		ct->type = ACT_EL_EXT;
        asn1p_constraint_insert((yyval.a_constr), ct);
        for(unsigned i = 0; i < (yyvsp[(4) - (5)].a_constr)->el_count; i++) {
            asn1p_constraint_insert((yyval.a_constr), (yyvsp[(4) - (5)].a_constr)->elements[i]);
        }
    }
Lev Walkin's avatar
Lev Walkin committed
4363 4364
    break;

4365 4366
  case 271:
#line 2028 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4367
    {
4368 4369 4370 4371
        (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
        (yyval.a_constr)->type = ACT_CA_CSV;
        asn1p_constraint_insert((yyval.a_constr), (yyvsp[(1) - (1)].a_constr));
    }
Lev Walkin's avatar
Lev Walkin committed
4372 4373
    break;

4374 4375
  case 272:
#line 2033 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4376
    {
4377 4378
        (yyval.a_constr) = (yyvsp[(1) - (3)].a_constr);
        asn1p_constraint_insert((yyval.a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin's avatar
Lev Walkin committed
4379 4380 4381
	}
    break;

4382 4383
  case 273:
#line 2039 "asn1p_y.y"
4384
    {
4385 4386 4387 4388 4389 4390 4391
        (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
        checkmem((yyval.a_constr));
        (yyval.a_constr)->type = ACT_EL_VALUE;
        (yyval.a_constr)->value = (yyvsp[(1) - (3)].a_value);
        if((yyvsp[(2) - (3)].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
        (yyval.a_constr)->presence = (yyvsp[(3) - (3)].a_pres);
    }
Lev Walkin's avatar
Lev Walkin committed
4392 4393
    break;

4394 4395
  case 274:
#line 2053 "asn1p_y.y"
4396
    { (yyval.a_pres) = ACPRES_DEFAULT; }
Lev Walkin's avatar
Lev Walkin committed
4397 4398
    break;

4399 4400
  case 275:
#line 2054 "asn1p_y.y"
4401
    { (yyval.a_pres) = (yyvsp[(1) - (1)].a_pres); }
Lev Walkin's avatar
Lev Walkin committed
4402 4403
    break;

4404 4405
  case 276:
#line 2058 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4406
    {
4407
		(yyval.a_pres) = ACPRES_PRESENT;
Lev Walkin's avatar
Lev Walkin committed
4408 4409 4410
	}
    break;

4411 4412
  case 277:
#line 2061 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4413
    {
4414
		(yyval.a_pres) = ACPRES_ABSENT;
Lev Walkin's avatar
Lev Walkin committed
4415 4416 4417
	}
    break;

4418 4419
  case 278:
#line 2064 "asn1p_y.y"
4420 4421 4422
    {
		(yyval.a_pres) = ACPRES_OPTIONAL;
	}
4423 4424
    break;

4425 4426
  case 282:
#line 2079 "asn1p_y.y"
4427
    { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin's avatar
Lev Walkin committed
4428 4429
    break;

4430 4431
  case 283:
#line 2079 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4432
    {
4433
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4434 4435 4436 4437 4438
		checkmem((yyval.a_constr));
		(yyval.a_constr)->type = ACT_CT_CTDBY;
		(yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(5) - (5)].tv_opaque).buf, (yyvsp[(5) - (5)].tv_opaque).len, 0);
		checkmem((yyval.a_constr)->value);
		(yyval.a_constr)->value->type = ATV_UNPARSED;
Lev Walkin's avatar
Lev Walkin committed
4439 4440 4441
	}
    break;

4442 4443
  case 284:
#line 2090 "asn1p_y.y"
4444
    {
4445
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4446 4447
		(yyval.a_constr)->type = ACT_CT_CTNG;
		(yyval.a_constr)->value = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
4448
		asn1p_expr_free((yyvsp[(2) - (2)].a_expr));
4449
	}
4450 4451
    break;

4452 4453
  case 285:
#line 2099 "asn1p_y.y"
4454
    { (yyval.a_ctype) = ACT_EL_RANGE; }
4455 4456
    break;

4457 4458
  case 286:
#line 2100 "asn1p_y.y"
4459
    { (yyval.a_ctype) = ACT_EL_RLRANGE; }
4460 4461
    break;

4462 4463
  case 287:
#line 2101 "asn1p_y.y"
4464
    { (yyval.a_ctype) = ACT_EL_LLRANGE; }
4465 4466
    break;

4467 4468
  case 288:
#line 2102 "asn1p_y.y"
4469
    { (yyval.a_ctype) = ACT_EL_ULRANGE; }
4470 4471
    break;

4472 4473
  case 289:
#line 2105 "asn1p_y.y"
4474
    {
4475
		(yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4476 4477 4478
	}
    break;

4479 4480
  case 290:
#line 2108 "asn1p_y.y"
4481 4482 4483 4484 4485
    {
		(yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
	}
    break;

4486 4487
  case 291:
#line 2117 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4488
    {
4489
		asn1p_ref_t *ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkin's avatar
Lev Walkin committed
4490 4491
		asn1p_constraint_t *ct;
		int ret;
4492
		ret = asn1p_ref_add_component(ref, (yyvsp[(2) - (3)].tv_str), 0);
Lev Walkin's avatar
Lev Walkin committed
4493
		checkmem(ret == 0);
4494
		ct = asn1p_constraint_new(yylineno, currentModule);
4495
		checkmem((yyval.a_constr));
Lev Walkin's avatar
Lev Walkin committed
4496 4497
		ct->type = ACT_EL_VALUE;
		ct->value = asn1p_value_fromref(ref, 0);
4498
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
4499
		free((yyvsp[(2) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
4500 4501 4502
	}
    break;

4503 4504
  case 292:
#line 2133 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4505
    {
4506
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, (yyvsp[(1) - (4)].a_constr), (yyvsp[(3) - (4)].a_constr));
Lev Walkin's avatar
Lev Walkin committed
4507 4508 4509
	}
    break;

4510 4511
  case 293:
#line 2139 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4512
    {
4513
		(yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4514 4515 4516
		checkmem((yyval.a_constr));
		(yyval.a_constr)->type = ACT_EL_VALUE;
		(yyval.a_constr)->value = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
Lev Walkin's avatar
Lev Walkin committed
4517 4518 4519
	}
    break;

4520 4521
  case 294:
#line 2145 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4522
    {
Lev Walkin's avatar
Lev Walkin committed
4523
		asn1p_constraint_t *ct;
4524
		ct = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin's avatar
Lev Walkin committed
4525 4526
		checkmem(ct);
		ct->type = ACT_EL_VALUE;
4527 4528
		ct->value = asn1p_value_fromref((yyvsp[(3) - (3)].a_ref), 0);
		CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
Lev Walkin's avatar
Lev Walkin committed
4529 4530 4531
	}
    break;

4532 4533
  case 295:
#line 2159 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4534
    {
4535
		char *p = malloc(strlen((yyvsp[(2) - (2)].tv_str)) + 2);
Lev Walkin's avatar
Lev Walkin committed
4536 4537
		int ret;
		*p = '@';
4538
		strcpy(p + 1, (yyvsp[(2) - (2)].tv_str));
4539
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
4540
		ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
Lev Walkin's avatar
Lev Walkin committed
4541 4542
		checkmem(ret == 0);
		free(p);
4543
		free((yyvsp[(2) - (2)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
4544 4545 4546
	}
    break;

4547 4548
  case 296:
#line 2170 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4549
    {
4550
		char *p = malloc(strlen((yyvsp[(3) - (3)].tv_str)) + 3);
Lev Walkin's avatar
Lev Walkin committed
4551 4552 4553
		int ret;
		p[0] = '@';
		p[1] = '.';
4554
		strcpy(p + 2, (yyvsp[(3) - (3)].tv_str));
4555
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
4556
		ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
Lev Walkin's avatar
Lev Walkin committed
4557 4558
		checkmem(ret == 0);
		free(p);
4559
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
4560 4561 4562
	}
    break;

4563 4564
  case 297:
#line 2186 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4565
    {
4566
		(yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
4567 4568 4569
	}
    break;

4570 4571
  case 298:
#line 2189 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4572
    {
4573 4574 4575 4576 4577 4578 4579
		int l1 = strlen((yyvsp[(1) - (3)].tv_str));
		int l3 = strlen((yyvsp[(3) - (3)].tv_str));
		(yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
		memcpy((yyval.tv_str), (yyvsp[(1) - (3)].tv_str), l1);
		(yyval.tv_str)[l1] = '.';
		memcpy((yyval.tv_str) + l1 + 1, (yyvsp[(3) - (3)].tv_str), l3);
		(yyval.tv_str)[l1 + 1 + l3] = '\0';
4580 4581
		free((yyvsp[(1) - (3)].tv_str));
		free((yyvsp[(3) - (3)].tv_str));
Lev Walkin's avatar
Lev Walkin committed
4582 4583 4584
	}
    break;

4585 4586
  case 299:
#line 2209 "asn1p_y.y"
4587 4588 4589 4590
    {
		(yyval.a_marker).flags = EM_NOMARK;
		(yyval.a_marker).default_value = 0;
	}
Lev Walkin's avatar
Lev Walkin committed
4591 4592
    break;

4593 4594
  case 300:
#line 2213 "asn1p_y.y"
4595
    { (yyval.a_marker) = (yyvsp[(1) - (1)].a_marker); }
Lev Walkin's avatar
Lev Walkin committed
4596 4597
    break;

4598 4599
  case 301:
#line 2217 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4600
    {
4601 4602
		(yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
		(yyval.a_marker).default_value = 0;
Lev Walkin's avatar
Lev Walkin committed
4603 4604 4605
	}
    break;

4606 4607
  case 302:
#line 2221 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4608
    {
4609 4610
		(yyval.a_marker).flags = EM_DEFAULT;
		(yyval.a_marker).default_value = (yyvsp[(2) - (2)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4611 4612 4613
	}
    break;

4614 4615
  case 303:
#line 2228 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4616
    {
4617 4618
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
Lev Walkin's avatar
Lev Walkin committed
4619 4620 4621 4622
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
    }
    break;

4623 4624
  case 304:
#line 2233 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4625 4626 4627 4628 4629 4630
    {
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
    }
    break;

4631 4632
  case 305:
#line 2239 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4633 4634 4635 4636 4637 4638 4639 4640 4641
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
    }
    break;

4642 4643
  case 306:
#line 2248 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4644 4645 4646 4647
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
4648 4649 4650
	}
    break;

4651 4652
  case 307:
#line 2253 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4653
    {
Lev Walkin's avatar
Lev Walkin committed
4654 4655
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
4656 4657 4658
	}
    break;

4659 4660
  case 308:
#line 2260 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4661 4662 4663 4664 4665 4666 4667 4668 4669 4670
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
	}
    break;

4671 4672
  case 309:
#line 2268 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4673 4674 4675 4676 4677 4678 4679 4680 4681 4682
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
	}
    break;

4683 4684
  case 310:
#line 2278 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4685
    {
4686 4687 4688
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
4689 4690 4691
	}
    break;

4692 4693
  case 311:
#line 2283 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4694
    {
4695 4696
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin's avatar
Lev Walkin committed
4697 4698 4699
	}
    break;

4700 4701
  case 312:
#line 2290 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4702 4703 4704 4705 4706 4707 4708 4709 4710 4711
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = asn1p_value_fromint((yyvsp[(3) - (4)].a_int));
	}
    break;

4712 4713
  case 313:
#line 2298 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4714 4715 4716 4717 4718 4719 4720 4721 4722 4723
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
	}
    break;

4724 4725
  case 314:
#line 2308 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740
    {
		(yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
        asn1p_expr_t *first_memb = TQ_FIRST(&((yyval.a_expr)->members));
        if(first_memb) {
            if(first_memb->expr_type == A1TC_EXTENSIBLE) {
                return yyerror(
                    "The ENUMERATION cannot start with extension (...).");
            }
        } else {
            return yyerror(
                "The ENUMERATION list cannot be empty.");
        }
    }
    break;

4741 4742
  case 315:
#line 2323 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4743 4744 4745 4746 4747 4748 4749
    {
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
	}
    break;

4750 4751
  case 316:
#line 2328 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4752 4753 4754 4755 4756 4757
    {
		(yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
		asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
	}
    break;

4758 4759
  case 317:
#line 2335 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4760
    {
4761 4762 4763 4764 4765
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
4766 4767 4768
	}
    break;

4769 4770
  case 318:
#line 2342 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4771
    {
4772 4773 4774 4775 4776 4777
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4778 4779 4780
	}
    break;

4781 4782
  case 319:
#line 2350 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4783
    {
4784 4785 4786 4787 4788 4789
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
		(yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4790 4791 4792
	}
    break;

4793 4794
  case 320:
#line 2358 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4795
    {
4796 4797 4798 4799 4800
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
		(yyval.a_expr)->meta_type = AMT_VALUE;
		(yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin's avatar
Lev Walkin committed
4801 4802 4803
	}
    break;

4804 4805
  case 321:
#line 2365 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4806
    {
4807 4808 4809 4810 4811 4812
		(yyval.a_expr) = NEW_EXPR();
		checkmem((yyval.a_expr));
		(yyval.a_expr)->Identifier = strdup("...");
		checkmem((yyval.a_expr)->Identifier);
		(yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
		(yyval.a_expr)->meta_type = AMT_VALUE;
Lev Walkin's avatar
Lev Walkin committed
4813 4814 4815
	}
    break;

4816 4817
  case 322:
#line 2376 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4818
    {
4819 4820
		(yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
		checkmem((yyval.a_value));
Lev Walkin's avatar
Lev Walkin committed
4821 4822 4823
	}
    break;

4824 4825
  case 323:
#line 2380 "asn1p_y.y"
4826
    {
4827 4828
		(yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
		checkmem((yyval.a_value));
4829 4830 4831
	}
    break;

4832 4833
  case 324:
#line 2387 "asn1p_y.y"
4834 4835 4836 4837
    {
		(yyval.a_value) = asn1p_value_fromdouble((yyvsp[(1) - (1)].a_dbl));
		checkmem((yyval.a_value));
	}
Lev Walkin's avatar
Lev Walkin committed
4838 4839
    break;

4840 4841
  case 325:
#line 2418 "asn1p_y.y"
4842
    { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
Lev Walkin's avatar
Lev Walkin committed
4843 4844
    break;

4845 4846
  case 326:
#line 2419 "asn1p_y.y"
4847
    { (yyval.a_tag) = (yyvsp[(1) - (1)].a_tag); }
Lev Walkin's avatar
Lev Walkin committed
4848 4849
    break;

4850 4851
  case 327:
#line 2423 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4852
    {
4853 4854
		(yyval.a_tag) = (yyvsp[(1) - (2)].a_tag);
		(yyval.a_tag).tag_mode = (yyvsp[(2) - (2)].a_tag).tag_mode;
Lev Walkin's avatar
Lev Walkin committed
4855 4856 4857
	}
    break;

4858 4859
  case 328:
#line 2430 "asn1p_y.y"
4860 4861 4862 4863
    {
		(yyval.a_tag) = (yyvsp[(2) - (4)].a_tag);
		(yyval.a_tag).tag_value = (yyvsp[(3) - (4)].a_int);
	}
Lev Walkin's avatar
Lev Walkin committed
4864 4865
    break;

4866 4867
  case 329:
#line 2436 "asn1p_y.y"
4868
    { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
Lev Walkin's avatar
Lev Walkin committed
4869 4870
    break;

4871 4872
  case 330:
#line 2437 "asn1p_y.y"
4873
    { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
Lev Walkin's avatar
Lev Walkin committed
4874 4875
    break;

4876 4877
  case 331:
#line 2438 "asn1p_y.y"
4878
    { (yyval.a_tag).tag_class = TC_APPLICATION; }
Lev Walkin's avatar
Lev Walkin committed
4879 4880
    break;

4881 4882
  case 332:
#line 2439 "asn1p_y.y"
4883
    { (yyval.a_tag).tag_class = TC_PRIVATE; }
Lev Walkin's avatar
Lev Walkin committed
4884 4885
    break;

4886 4887
  case 333:
#line 2443 "asn1p_y.y"
4888
    { (yyval.a_tag).tag_mode = TM_DEFAULT; }
Lev Walkin's avatar
Lev Walkin committed
4889 4890
    break;

4891 4892
  case 334:
#line 2444 "asn1p_y.y"
4893
    { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
Lev Walkin's avatar
Lev Walkin committed
4894 4895
    break;

4896 4897
  case 335:
#line 2445 "asn1p_y.y"
4898
    { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
Lev Walkin's avatar
Lev Walkin committed
4899 4900
    break;

4901 4902
  case 336:
#line 2449 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4903
    {
4904 4905
		checkmem((yyvsp[(1) - (1)].tv_str));
		(yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
4906 4907 4908
	}
    break;

4909 4910
  case 337:
#line 2453 "asn1p_y.y"
4911 4912 4913 4914
    {
		checkmem((yyvsp[(1) - (1)].tv_str));
		(yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
	}
Lev Walkin's avatar
Lev Walkin committed
4915 4916
    break;

4917 4918
  case 338:
#line 2461 "asn1p_y.y"
4919 4920 4921
    { (yyval.tv_str) = 0; }
    break;

4922 4923
  case 339:
#line 2462 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4924
    {
4925
		(yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
4926 4927 4928
	}
    break;

4929 4930
  case 340:
#line 2468 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
4931
    {
4932 4933
		checkmem((yyvsp[(1) - (1)].tv_str));
		(yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin's avatar
Lev Walkin committed
4934 4935 4936
	}
    break;

4937 4938
  case 341:
#line 2475 "asn1p_y.y"
4939 4940 4941 4942 4943 4944
    {
		(yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
		asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
    }
    break;

4945 4946
  case 342:
#line 2481 "asn1p_y.y"
4947 4948 4949 4950 4951
    {
		(yyval.a_value) = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
    }
    break;

Lev Walkin's avatar
Lev Walkin committed
4952

Lev Walkin's avatar
Lev Walkin committed
4953
/* Line 1267 of yacc.c.  */
4954
#line 4955 "asn1p_y.c"
4955
      default: break;
Lev Walkin's avatar
Lev Walkin committed
4956
    }
4957
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Lev Walkin's avatar
Lev Walkin committed
4958

4959 4960 4961
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
Lev Walkin's avatar
Lev Walkin committed
4962 4963 4964

  *++yyvsp = yyval;

Lev Walkin's avatar
Lev Walkin committed
4965

Lev Walkin's avatar
Lev Walkin committed
4966 4967 4968
  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
Lev Walkin's avatar
Lev Walkin committed
4969 4970 4971

  yyn = yyr1[yyn];

Lev Walkin's avatar
Lev Walkin committed
4972 4973
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkin's avatar
Lev Walkin committed
4974 4975
    yystate = yytable[yystate];
  else
Lev Walkin's avatar
Lev Walkin committed
4976
    yystate = yydefgoto[yyn - YYNTOKENS];
Lev Walkin's avatar
Lev Walkin committed
4977 4978 4979 4980

  goto yynewstate;


Lev Walkin's avatar
Lev Walkin committed
4981 4982 4983 4984 4985 4986
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
Lev Walkin's avatar
Lev Walkin committed
4987 4988
    {
      ++yynerrs;
4989 4990 4991 4992
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
      {
Lev Walkin's avatar
Lev Walkin committed
4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021
	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
	  {
	    YYSIZE_T yyalloc = 2 * yysize;
	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
	    if (yymsg != yymsgbuf)
	      YYSTACK_FREE (yymsg);
	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
	    if (yymsg)
	      yymsg_alloc = yyalloc;
	    else
	      {
		yymsg = yymsgbuf;
		yymsg_alloc = sizeof yymsgbuf;
	      }
	  }

	if (0 < yysize && yysize <= yymsg_alloc)
	  {
	    (void) yysyntax_error (yymsg, yystate, yychar);
	    yyerror (yymsg);
	  }
	else
	  {
	    yyerror (YY_("syntax error"));
	    if (yysize != 0)
	      goto yyexhaustedlab;
	  }
5022 5023
      }
#endif
Lev Walkin's avatar
Lev Walkin committed
5024
    }
5025

Lev Walkin's avatar
Lev Walkin committed
5026

5027

Lev Walkin's avatar
Lev Walkin committed
5028 5029
  if (yyerrstatus == 3)
    {
Lev Walkin's avatar
Lev Walkin committed
5030
      /* If just tried and failed to reuse look-ahead token after an
Lev Walkin's avatar
Lev Walkin committed
5031
	 error, discard it.  */
5032

5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044
      if (yychar <= YYEOF)
	{
	  /* Return failure if at end of input.  */
	  if (yychar == YYEOF)
	    YYABORT;
	}
      else
	{
	  yydestruct ("Error: discarding",
		      yytoken, &yylval);
	  yychar = YYEMPTY;
	}
Lev Walkin's avatar
Lev Walkin committed
5045 5046
    }

Lev Walkin's avatar
Lev Walkin committed
5047
  /* Else will try to reuse look-ahead token after shifting the error
Lev Walkin's avatar
Lev Walkin committed
5048
     token.  */
5049 5050
  goto yyerrlab1;

Lev Walkin's avatar
Lev Walkin committed
5051

5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075
/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  /* Do not reclaim the symbols of the rule which action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
Lev Walkin's avatar
Lev Walkin committed
5076
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
Lev Walkin's avatar
Lev Walkin committed
5077

Lev Walkin's avatar
Lev Walkin committed
5078 5079 5080
  for (;;)
    {
      yyn = yypact[yystate];
Lev Walkin's avatar
Lev Walkin committed
5081
      if (yyn != YYPACT_NINF)
Lev Walkin's avatar
Lev Walkin committed
5082 5083 5084 5085 5086 5087 5088 5089 5090
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}
Lev Walkin's avatar
Lev Walkin committed
5091

Lev Walkin's avatar
Lev Walkin committed
5092 5093 5094
      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;
Lev Walkin's avatar
Lev Walkin committed
5095 5096


5097 5098 5099 5100 5101
      yydestruct ("Error: popping",
		  yystos[yystate], yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
Lev Walkin's avatar
Lev Walkin committed
5102 5103
    }

Lev Walkin's avatar
Lev Walkin committed
5104 5105 5106
  if (yyn == YYFINAL)
    YYACCEPT;

5107
  *++yyvsp = yylval;
Lev Walkin's avatar
Lev Walkin committed
5108

Lev Walkin's avatar
Lev Walkin committed
5109

5110 5111 5112
  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

Lev Walkin's avatar
Lev Walkin committed
5113 5114 5115
  yystate = yyn;
  goto yynewstate;

Lev Walkin's avatar
Lev Walkin committed
5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130

/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

Lev Walkin's avatar
Lev Walkin committed
5131
#ifndef yyoverflow
5132 5133 5134 5135 5136
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
Lev Walkin's avatar
Lev Walkin committed
5137 5138
  yyresult = 2;
  /* Fall through.  */
Lev Walkin's avatar
Lev Walkin committed
5139 5140
#endif

Lev Walkin's avatar
Lev Walkin committed
5141
yyreturn:
Lev Walkin's avatar
Lev Walkin committed
5142 5143 5144
  if (yychar != YYEOF && yychar != YYEMPTY)
     yydestruct ("Cleanup: discarding lookahead",
		 yytoken, &yylval);
5145 5146 5147 5148 5149 5150 5151 5152 5153 5154
  /* Do not reclaim the symbols of the rule which action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
		  yystos[*yyssp], yyvsp);
      YYPOPSTACK (1);
    }
Lev Walkin's avatar
Lev Walkin committed
5155 5156 5157
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
Lev Walkin's avatar
Lev Walkin committed
5158
#endif
5159 5160 5161 5162 5163 5164
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  /* Make sure YYID is used.  */
  return YYID (yyresult);
Lev Walkin's avatar
Lev Walkin committed
5165
}
Lev Walkin's avatar
Lev Walkin committed
5166 5167


5168
#line 2485 "asn1p_y.y"
Lev Walkin's avatar
Lev Walkin committed
5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265



/*
 * Convert Xstring ('0101'B or '5'H) to the binary vector.
 */
static asn1p_value_t *
_convert_bitstring2binary(char *str, int base) {
	asn1p_value_t *val;
	int slen;
	int memlen;
	int baselen;
	int bits;
	uint8_t *binary_vector;
	uint8_t *bv_ptr;
	uint8_t cur_val;

	assert(str);
	assert(str[0] == '\'');

	switch(base) {
	case 'B':
		baselen = 1;
		break;
	case 'H':
		baselen = 4;
		break;
	default:
		assert(base == 'B' || base == 'H');
		errno = EINVAL;
		return NULL;
	}

	slen = strlen(str);
	assert(str[slen - 1] == base);
	assert(str[slen - 2] == '\'');

	memlen = slen / (8 / baselen);	/* Conservative estimate */

	bv_ptr = binary_vector = malloc(memlen + 1);
	if(bv_ptr == NULL)
		/* ENOMEM */
		return NULL;

	cur_val = 0;
	bits = 0;
	while(*(++str) != '\'') {
		switch(baselen) {
		case 1:
			switch(*str) {
			case '1':
				cur_val |= 1 << (7 - (bits % 8));
			case '0':
				break;
			default:
				assert(!"_y UNREACH1");
			case ' ': case '\r': case '\n':
				continue;
			}
			break;
		case 4:
			switch(*str) {
			case '0': case '1': case '2': case '3': case '4':
			case '5': case '6': case '7': case '8': case '9':
				cur_val |= (*str - '0') << (4 - (bits % 8));
				break;
			case 'A': case 'B': case 'C':
			case 'D': case 'E': case 'F':
				cur_val |= ((*str - 'A') + 10)
					<< (4 - (bits % 8));
				break;
			default:
				assert(!"_y UNREACH2");
			case ' ': case '\r': case '\n':
				continue;
			}
			break;
		}

		bits += baselen;
		if((bits % 8) == 0) {
			*bv_ptr++ = cur_val;
			cur_val = 0;
		}
	}

	*bv_ptr = cur_val;
	assert((bv_ptr - binary_vector) <= memlen);

	val = asn1p_value_frombits(binary_vector, bits, 0);
	if(val == NULL) {
		free(binary_vector);
	}

	return val;
}

Lev Walkin's avatar
Lev Walkin committed
5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307
/*
 * For unnamed types (used in old X.208 compliant modules)
 * generate some sort of interim names, to not to force human being to fix
 * the specification's compliance to modern ASN.1 standards.
 */
static void
_fixup_anonymous_identifier(asn1p_expr_t *expr) {
	char *p;
	assert(expr->Identifier == 0);

	/*
	 * Try to figure out the type name
	 * without going too much into details
	 */
	expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
	if(expr->reference && expr->reference->comp_count > 0)
		expr->Identifier = expr->reference->components[0].name;

	fprintf(stderr,
		"WARNING: Line %d: expected lower-case member identifier, "
		"found an unnamed %s.\n"
		"WARNING: Obsolete X.208 syntax detected, "
		"please give the member a name.\n",
		yylineno, expr->Identifier ? expr->Identifier : "type");

	if(!expr->Identifier)
		expr->Identifier = "unnamed";
	expr->Identifier = strdup(expr->Identifier);
	assert(expr->Identifier);
	/* Make a lowercase identifier from the type name */
	for(p = expr->Identifier; *p; p++) {
		switch(*p) {
		case 'A' ... 'Z': *p += 32; break;
		case ' ': *p = '_'; break;
		case '-': *p = '_'; break;
		}
	}
	fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
			"Name clash may occur later.\n",
		expr->Identifier);
}

5308
static int
Lev Walkin's avatar
Lev Walkin committed
5309
yyerror(const char *msg) {
Lev Walkin's avatar
Lev Walkin committed
5310
	extern char *asn1p_text;
Lev Walkin's avatar
Lev Walkin committed
5311 5312
	fprintf(stderr,
		"ASN.1 grammar parse error "
5313 5314
		"near %s:%d (token \"%s\"): %s\n",
		ASN_FILENAME, yylineno, asn1p_text, msg);
Lev Walkin's avatar
Lev Walkin committed
5315 5316 5317
	return -1;
}

Lev Walkin's avatar
Lev Walkin committed
5318