blob: 11acfae5531ed41203bde59e50aa47d954b3a676 [file] [log] [blame]
Lev Walkin0e90aa02013-03-19 16:17:13 -07001/* A Bison parser, made by GNU Bison 2.3. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002
Lev Walkin0e90aa02013-03-19 16:17:13 -07003/* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
Lev Walkinf15320b2004-06-03 03:38:44 +00007
Lev Walkin418298d2006-07-13 08:24:20 +00008 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
Lev Walkinf15320b2004-06-03 03:38:44 +000012
Lev Walkin418298d2006-07-13 08:24:20 +000013 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
Lev Walkin0e90aa02013-03-19 16:17:13 -070020 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
Lev Walkin418298d2006-07-13 08:24:20 +000022
Lev Walkin0e90aa02013-03-19 16:17:13 -070023/* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
Lev Walkin418298d2006-07-13 08:24:20 +000032
Lev Walkin0e90aa02013-03-19 16:17:13 -070033 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
35
36/* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
Lev Walkin418298d2006-07-13 08:24:20 +000038
39/* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
45
46/* Identify Bison output. */
Lev Walkin0e90aa02013-03-19 16:17:13 -070047#define YYBISON 1
48
49/* Bison version. */
50#define YYBISON_VERSION "2.3"
51
52/* Skeleton name. */
53#define YYSKELETON_NAME "yacc.c"
Lev Walkin418298d2006-07-13 08:24:20 +000054
55/* Pure parsers. */
Lev Walkin0e90aa02013-03-19 16:17:13 -070056#define YYPURE 0
Lev Walkin418298d2006-07-13 08:24:20 +000057
58/* Using locations. */
59#define YYLSP_NEEDED 0
60
Lev Walkin0e90aa02013-03-19 16:17:13 -070061/* Substitute the variable and function names. */
Lev Walkinf15320b2004-06-03 03:38:44 +000062#define yyparse asn1p_parse
Lev Walkin418298d2006-07-13 08:24:20 +000063#define yylex asn1p_lex
Lev Walkinf15320b2004-06-03 03:38:44 +000064#define yyerror asn1p_error
Lev Walkin418298d2006-07-13 08:24:20 +000065#define yylval asn1p_lval
66#define yychar asn1p_char
Lev Walkinf15320b2004-06-03 03:38:44 +000067#define yydebug asn1p_debug
68#define yynerrs asn1p_nerrs
Lev Walkinf15320b2004-06-03 03:38:44 +000069
Lev Walkin418298d2006-07-13 08:24:20 +000070
71/* Tokens. */
72#ifndef YYTOKENTYPE
73# define YYTOKENTYPE
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
75 know about them. */
76 enum yytokentype {
77 TOK_PPEQ = 258,
Lev Walkin0e90aa02013-03-19 16:17:13 -070078 TOK_VBracketLeft = 259,
79 TOK_VBracketRight = 260,
80 TOK_whitespace = 261,
81 TOK_opaque = 262,
82 TOK_bstring = 263,
83 TOK_cstring = 264,
84 TOK_hstring = 265,
85 TOK_identifier = 266,
86 TOK_number = 267,
87 TOK_number_negative = 268,
88 TOK_realnumber = 269,
89 TOK_tuple = 270,
90 TOK_quadruple = 271,
91 TOK_typereference = 272,
92 TOK_capitalreference = 273,
93 TOK_typefieldreference = 274,
94 TOK_valuefieldreference = 275,
95 TOK_Literal = 276,
96 TOK_ABSENT = 277,
97 TOK_ABSTRACT_SYNTAX = 278,
98 TOK_ALL = 279,
99 TOK_ANY = 280,
100 TOK_APPLICATION = 281,
101 TOK_AUTOMATIC = 282,
102 TOK_BEGIN = 283,
103 TOK_BIT = 284,
104 TOK_BMPString = 285,
105 TOK_BOOLEAN = 286,
106 TOK_BY = 287,
107 TOK_CHARACTER = 288,
108 TOK_CHOICE = 289,
109 TOK_CLASS = 290,
110 TOK_COMPONENT = 291,
111 TOK_COMPONENTS = 292,
112 TOK_CONSTRAINED = 293,
113 TOK_CONTAINING = 294,
114 TOK_DEFAULT = 295,
115 TOK_DEFINITIONS = 296,
116 TOK_DEFINED = 297,
117 TOK_EMBEDDED = 298,
118 TOK_ENCODED = 299,
119 TOK_ENCODING_CONTROL = 300,
120 TOK_END = 301,
121 TOK_ENUMERATED = 302,
122 TOK_EXPLICIT = 303,
123 TOK_EXPORTS = 304,
124 TOK_EXTENSIBILITY = 305,
125 TOK_EXTERNAL = 306,
126 TOK_FALSE = 307,
127 TOK_FROM = 308,
128 TOK_GeneralizedTime = 309,
129 TOK_GeneralString = 310,
130 TOK_GraphicString = 311,
131 TOK_IA5String = 312,
132 TOK_IDENTIFIER = 313,
133 TOK_IMPLICIT = 314,
134 TOK_IMPLIED = 315,
135 TOK_IMPORTS = 316,
136 TOK_INCLUDES = 317,
137 TOK_INSTANCE = 318,
138 TOK_INSTRUCTIONS = 319,
139 TOK_INTEGER = 320,
140 TOK_ISO646String = 321,
141 TOK_MAX = 322,
142 TOK_MIN = 323,
143 TOK_MINUS_INFINITY = 324,
144 TOK_NULL = 325,
145 TOK_NumericString = 326,
146 TOK_OBJECT = 327,
147 TOK_ObjectDescriptor = 328,
148 TOK_OCTET = 329,
149 TOK_OF = 330,
150 TOK_OPTIONAL = 331,
151 TOK_PATTERN = 332,
152 TOK_PDV = 333,
153 TOK_PLUS_INFINITY = 334,
154 TOK_PRESENT = 335,
155 TOK_PrintableString = 336,
156 TOK_PRIVATE = 337,
157 TOK_REAL = 338,
158 TOK_RELATIVE_OID = 339,
159 TOK_SEQUENCE = 340,
160 TOK_SET = 341,
161 TOK_SIZE = 342,
162 TOK_STRING = 343,
163 TOK_SYNTAX = 344,
164 TOK_T61String = 345,
165 TOK_TAGS = 346,
166 TOK_TeletexString = 347,
167 TOK_TRUE = 348,
168 TOK_TYPE_IDENTIFIER = 349,
169 TOK_UNIQUE = 350,
170 TOK_UNIVERSAL = 351,
171 TOK_UniversalString = 352,
172 TOK_UTCTime = 353,
173 TOK_UTF8String = 354,
174 TOK_VideotexString = 355,
175 TOK_VisibleString = 356,
176 TOK_WITH = 357,
177 TOK_EXCEPT = 358,
178 TOK_INTERSECTION = 359,
179 TOK_UNION = 360,
180 TOK_TwoDots = 361,
181 TOK_ThreeDots = 362
Lev Walkin418298d2006-07-13 08:24:20 +0000182 };
183#endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700184/* Tokens. */
Lev Walkin418298d2006-07-13 08:24:20 +0000185#define TOK_PPEQ 258
Lev Walkin0e90aa02013-03-19 16:17:13 -0700186#define TOK_VBracketLeft 259
187#define TOK_VBracketRight 260
188#define TOK_whitespace 261
189#define TOK_opaque 262
190#define TOK_bstring 263
191#define TOK_cstring 264
192#define TOK_hstring 265
193#define TOK_identifier 266
194#define TOK_number 267
195#define TOK_number_negative 268
196#define TOK_realnumber 269
197#define TOK_tuple 270
198#define TOK_quadruple 271
199#define TOK_typereference 272
200#define TOK_capitalreference 273
201#define TOK_typefieldreference 274
202#define TOK_valuefieldreference 275
203#define TOK_Literal 276
204#define TOK_ABSENT 277
205#define TOK_ABSTRACT_SYNTAX 278
206#define TOK_ALL 279
207#define TOK_ANY 280
208#define TOK_APPLICATION 281
209#define TOK_AUTOMATIC 282
210#define TOK_BEGIN 283
211#define TOK_BIT 284
212#define TOK_BMPString 285
213#define TOK_BOOLEAN 286
214#define TOK_BY 287
215#define TOK_CHARACTER 288
216#define TOK_CHOICE 289
217#define TOK_CLASS 290
218#define TOK_COMPONENT 291
219#define TOK_COMPONENTS 292
220#define TOK_CONSTRAINED 293
221#define TOK_CONTAINING 294
222#define TOK_DEFAULT 295
223#define TOK_DEFINITIONS 296
224#define TOK_DEFINED 297
225#define TOK_EMBEDDED 298
226#define TOK_ENCODED 299
227#define TOK_ENCODING_CONTROL 300
228#define TOK_END 301
229#define TOK_ENUMERATED 302
230#define TOK_EXPLICIT 303
231#define TOK_EXPORTS 304
232#define TOK_EXTENSIBILITY 305
233#define TOK_EXTERNAL 306
234#define TOK_FALSE 307
235#define TOK_FROM 308
236#define TOK_GeneralizedTime 309
237#define TOK_GeneralString 310
238#define TOK_GraphicString 311
239#define TOK_IA5String 312
240#define TOK_IDENTIFIER 313
241#define TOK_IMPLICIT 314
242#define TOK_IMPLIED 315
243#define TOK_IMPORTS 316
244#define TOK_INCLUDES 317
245#define TOK_INSTANCE 318
246#define TOK_INSTRUCTIONS 319
247#define TOK_INTEGER 320
248#define TOK_ISO646String 321
249#define TOK_MAX 322
250#define TOK_MIN 323
251#define TOK_MINUS_INFINITY 324
252#define TOK_NULL 325
253#define TOK_NumericString 326
254#define TOK_OBJECT 327
255#define TOK_ObjectDescriptor 328
256#define TOK_OCTET 329
257#define TOK_OF 330
258#define TOK_OPTIONAL 331
259#define TOK_PATTERN 332
260#define TOK_PDV 333
261#define TOK_PLUS_INFINITY 334
262#define TOK_PRESENT 335
263#define TOK_PrintableString 336
264#define TOK_PRIVATE 337
265#define TOK_REAL 338
266#define TOK_RELATIVE_OID 339
267#define TOK_SEQUENCE 340
268#define TOK_SET 341
269#define TOK_SIZE 342
270#define TOK_STRING 343
271#define TOK_SYNTAX 344
272#define TOK_T61String 345
273#define TOK_TAGS 346
274#define TOK_TeletexString 347
275#define TOK_TRUE 348
276#define TOK_TYPE_IDENTIFIER 349
277#define TOK_UNIQUE 350
278#define TOK_UNIVERSAL 351
279#define TOK_UniversalString 352
280#define TOK_UTCTime 353
281#define TOK_UTF8String 354
282#define TOK_VideotexString 355
283#define TOK_VisibleString 356
284#define TOK_WITH 357
285#define TOK_EXCEPT 358
286#define TOK_INTERSECTION 359
287#define TOK_UNION 360
288#define TOK_TwoDots 361
289#define TOK_ThreeDots 362
Lev Walkin418298d2006-07-13 08:24:20 +0000290
291
292
293
294/* Copy the first part of user declarations. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000295#line 1 "asn1p_y.y"
296
297
298#include <stdlib.h>
299#include <stdio.h>
300#include <string.h>
301#include <errno.h>
302#include <assert.h>
303
304#include "asn1parser.h"
305
306#define YYPARSE_PARAM param
Lev Walkin4a4bdf72005-06-07 21:43:32 +0000307#define YYPARSE_PARAM_TYPE void **
Lev Walkinf15320b2004-06-03 03:38:44 +0000308#define YYERROR_VERBOSE
309
310int yylex(void);
311int yyerror(const char *msg);
Lev Walkin4a4bdf72005-06-07 21:43:32 +0000312#ifdef YYBYACC
313int yyparse(void **param); /* byacc does not produce a prototype */
314#endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000315void asn1p_lexer_hack_push_opaque_state(void);
316void asn1p_lexer_hack_enable_with_syntax(void);
Lev Walkinf59d0752004-08-18 04:59:12 +0000317void asn1p_lexer_hack_push_encoding_control(void);
Lev Walkinf15320b2004-06-03 03:38:44 +0000318#define yylineno asn1p_lineno
319extern int asn1p_lineno;
320
Lev Walkinb36317c2005-08-12 10:09:10 +0000321/*
Lev Walkinef625402005-09-05 05:17:57 +0000322 * Process directives as <ASN1C:RepresentAsPointer>
Lev Walkin4696c742005-08-22 12:23:54 +0000323 */
324extern int asn1p_as_pointer;
Lev Walkin4696c742005-08-22 12:23:54 +0000325
326/*
Lev Walkinb36317c2005-08-12 10:09:10 +0000327 * This temporary variable is used to solve the shortcomings of 1-lookahead
328 * parser.
329 */
330static struct AssignedIdentifier *saved_aid;
Lev Walkinf15320b2004-06-03 03:38:44 +0000331
Lev Walkin2e9bd5c2005-08-13 09:07:11 +0000332static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
333static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
Lev Walkinf15320b2004-06-03 03:38:44 +0000334
Lev Walkina9532f42006-09-17 04:52:50 +0000335static asn1p_module_t *currentModule;
336#define NEW_EXPR() (asn1p_expr_new(yylineno, currentModule))
337
Lev Walkinb36317c2005-08-12 10:09:10 +0000338#define checkmem(ptr) do { \
339 if(!(ptr)) \
340 return yyerror("Memory failure"); \
Lev Walkinf15320b2004-06-03 03:38:44 +0000341 } while(0)
342
Lev Walkinb36317c2005-08-12 10:09:10 +0000343#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
344 if(arg1->type != constr_type) { \
345 int __ret; \
346 root = asn1p_constraint_new(yylineno); \
347 checkmem(root); \
348 root->type = constr_type; \
349 __ret = asn1p_constraint_insert(root, \
350 arg1); \
351 checkmem(__ret == 0); \
352 } else { \
353 root = arg1; \
354 } \
355 if(arg2) { \
356 int __ret \
357 = asn1p_constraint_insert(root, arg2); \
358 checkmem(__ret == 0); \
359 } \
Lev Walkinf15320b2004-06-03 03:38:44 +0000360 } while(0)
361
Lev Walkin866bd7f2006-09-14 10:35:20 +0000362#ifdef AL_IMPORT
363#error AL_IMPORT DEFINED ELSEWHERE!
364#endif
365#define AL_IMPORT(to,where,from,field) do { \
366 if(!(from)) break; \
367 while(TQ_FIRST(&((from)->where))) { \
368 TQ_ADD(&((to)->where), \
369 TQ_REMOVE(&((from)->where), field), \
370 field); \
371 } \
372 assert(TQ_FIRST(&((from)->where)) == 0); \
373 } while(0)
374
Lev Walkinf15320b2004-06-03 03:38:44 +0000375
Lev Walkin418298d2006-07-13 08:24:20 +0000376
377/* Enabling traces. */
378#ifndef YYDEBUG
379# define YYDEBUG 0
380#endif
381
382/* Enabling verbose error messages. */
383#ifdef YYERROR_VERBOSE
384# undef YYERROR_VERBOSE
385# define YYERROR_VERBOSE 1
386#else
387# define YYERROR_VERBOSE 0
388#endif
389
Lev Walkin0e90aa02013-03-19 16:17:13 -0700390/* Enabling the token table. */
391#ifndef YYTOKEN_TABLE
392# define YYTOKEN_TABLE 0
393#endif
394
395#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
396typedef union YYSTYPE
Lev Walkina9532f42006-09-17 04:52:50 +0000397#line 88 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -0700398{
Lev Walkinf15320b2004-06-03 03:38:44 +0000399 asn1p_t *a_grammar;
400 asn1p_module_flags_e a_module_flags;
401 asn1p_module_t *a_module;
402 asn1p_expr_type_e a_type; /* ASN.1 Type */
403 asn1p_expr_t *a_expr; /* Constructed collection */
404 asn1p_constraint_t *a_constr; /* Constraint */
405 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
406 asn1p_xports_t *a_xports; /* IMports/EXports */
Lev Walkinb36317c2005-08-12 10:09:10 +0000407 struct AssignedIdentifier a_aid; /* Assigned Identifier */
Lev Walkinf15320b2004-06-03 03:38:44 +0000408 asn1p_oid_t *a_oid; /* Object Identifier */
409 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
410 struct asn1p_type_tag_s a_tag; /* A tag */
411 asn1p_ref_t *a_ref; /* Reference to custom type */
412 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
413 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
414 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
415 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
416 struct asn1p_param_s a_parg; /* A parameter argument */
417 asn1p_paramlist_t *a_plist; /* A pargs list */
Lev Walkin9c974182004-09-15 11:59:51 +0000418 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
Lev Walkinf15320b2004-06-03 03:38:44 +0000419 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
Lev Walkind21c5052004-09-29 13:18:09 +0000420 asn1c_integer_t a_int;
Lev Walkinadf863f2006-09-05 16:18:34 +0000421 double a_dbl;
Lev Walkinf15320b2004-06-03 03:38:44 +0000422 char *tv_str;
423 struct {
424 char *buf;
425 int len;
426 } tv_opaque;
427 struct {
428 char *name;
429 struct asn1p_type_tag_s tag;
430 } tv_nametag;
Lev Walkin0e90aa02013-03-19 16:17:13 -0700431}
432/* Line 193 of yacc.c. */
Lev Walkina964e032017-03-26 03:48:06 -0700433#line 434 "asn1p_y.c"
Lev Walkin0e90aa02013-03-19 16:17:13 -0700434 YYSTYPE;
435# define yystype YYSTYPE /* obsolescent; will be withdrawn */
436# define YYSTYPE_IS_DECLARED 1
Lev Walkin418298d2006-07-13 08:24:20 +0000437# define YYSTYPE_IS_TRIVIAL 1
Lev Walkinf15320b2004-06-03 03:38:44 +0000438#endif
439
Lev Walkin0e90aa02013-03-19 16:17:13 -0700440
Lev Walkin418298d2006-07-13 08:24:20 +0000441
442/* Copy the second part of user declarations. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000443
444
Lev Walkin0e90aa02013-03-19 16:17:13 -0700445/* Line 216 of yacc.c. */
Lev Walkina964e032017-03-26 03:48:06 -0700446#line 447 "asn1p_y.c"
Lev Walkinf15320b2004-06-03 03:38:44 +0000447
Lev Walkin0e90aa02013-03-19 16:17:13 -0700448#ifdef short
449# undef short
450#endif
451
452#ifdef YYTYPE_UINT8
453typedef YYTYPE_UINT8 yytype_uint8;
454#else
455typedef unsigned char yytype_uint8;
456#endif
457
458#ifdef YYTYPE_INT8
459typedef YYTYPE_INT8 yytype_int8;
460#elif (defined __STDC__ || defined __C99__FUNC__ \
461 || defined __cplusplus || defined _MSC_VER)
462typedef signed char yytype_int8;
463#else
464typedef short int yytype_int8;
465#endif
466
467#ifdef YYTYPE_UINT16
468typedef YYTYPE_UINT16 yytype_uint16;
469#else
470typedef unsigned short int yytype_uint16;
471#endif
472
473#ifdef YYTYPE_INT16
474typedef YYTYPE_INT16 yytype_int16;
475#else
476typedef short int yytype_int16;
477#endif
478
479#ifndef YYSIZE_T
480# ifdef __SIZE_TYPE__
481# define YYSIZE_T __SIZE_TYPE__
482# elif defined size_t
483# define YYSIZE_T size_t
484# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
485 || defined __cplusplus || defined _MSC_VER)
486# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
487# define YYSIZE_T size_t
488# else
489# define YYSIZE_T unsigned int
490# endif
491#endif
492
493#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
494
495#ifndef YY_
496# if defined YYENABLE_NLS && YYENABLE_NLS
497# if ENABLE_NLS
498# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
499# define YY_(msgid) dgettext ("bison-runtime", msgid)
500# endif
501# endif
502# ifndef YY_
503# define YY_(msgid) msgid
504# endif
505#endif
506
507/* Suppress unused-variable warnings by "using" E. */
508#if ! defined lint || defined __GNUC__
509# define YYUSE(e) ((void) (e))
510#else
511# define YYUSE(e) /* empty */
512#endif
513
514/* Identity function, used to suppress warnings about constant conditions. */
515#ifndef lint
516# define YYID(n) (n)
517#else
518#if (defined __STDC__ || defined __C99__FUNC__ \
519 || defined __cplusplus || defined _MSC_VER)
520static int
521YYID (int i)
522#else
523static int
524YYID (i)
525 int i;
526#endif
527{
528 return i;
529}
530#endif
531
532#if ! defined yyoverflow || YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +0000533
Lev Walkin418298d2006-07-13 08:24:20 +0000534/* The parser invokes alloca or malloc; define the necessary symbols. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000535
Lev Walkin0e90aa02013-03-19 16:17:13 -0700536# ifdef YYSTACK_USE_ALLOCA
537# if YYSTACK_USE_ALLOCA
538# ifdef __GNUC__
539# define YYSTACK_ALLOC __builtin_alloca
540# elif defined __BUILTIN_VA_ARG_INCR
541# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
542# elif defined _AIX
543# define YYSTACK_ALLOC __alloca
544# elif defined _MSC_VER
545# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
546# define alloca _alloca
Lev Walkin418298d2006-07-13 08:24:20 +0000547# else
Lev Walkin0e90aa02013-03-19 16:17:13 -0700548# define YYSTACK_ALLOC alloca
549# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
550 || defined __cplusplus || defined _MSC_VER)
551# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
552# ifndef _STDLIB_H
553# define _STDLIB_H 1
554# endif
Lev Walkin418298d2006-07-13 08:24:20 +0000555# endif
556# endif
557# endif
558# endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000559
Lev Walkin418298d2006-07-13 08:24:20 +0000560# ifdef YYSTACK_ALLOC
Lev Walkin0e90aa02013-03-19 16:17:13 -0700561 /* Pacify GCC's `empty if-body' warning. */
562# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
563# ifndef YYSTACK_ALLOC_MAXIMUM
564 /* The OS might guarantee only one guard page at the bottom of the stack,
565 and a page size can be as small as 4096 bytes. So we cannot safely
566 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
567 to allow for a few compiler-allocated temporary stack slots. */
568# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
Lev Walkin418298d2006-07-13 08:24:20 +0000569# endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700570# else
571# define YYSTACK_ALLOC YYMALLOC
572# define YYSTACK_FREE YYFREE
573# ifndef YYSTACK_ALLOC_MAXIMUM
574# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
575# endif
576# if (defined __cplusplus && ! defined _STDLIB_H \
577 && ! ((defined YYMALLOC || defined malloc) \
578 && (defined YYFREE || defined free)))
579# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
580# ifndef _STDLIB_H
581# define _STDLIB_H 1
582# endif
583# endif
584# ifndef YYMALLOC
585# define YYMALLOC malloc
586# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
587 || defined __cplusplus || defined _MSC_VER)
588void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
589# endif
590# endif
591# ifndef YYFREE
592# define YYFREE free
593# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
594 || defined __cplusplus || defined _MSC_VER)
595void free (void *); /* INFRINGES ON USER NAME SPACE */
596# endif
597# endif
Lev Walkin418298d2006-07-13 08:24:20 +0000598# endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700599#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Lev Walkin418298d2006-07-13 08:24:20 +0000600
601
Lev Walkin0e90aa02013-03-19 16:17:13 -0700602#if (! defined yyoverflow \
603 && (! defined __cplusplus \
604 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Lev Walkin418298d2006-07-13 08:24:20 +0000605
606/* A type that is properly aligned for any stack member. */
607union yyalloc
608{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700609 yytype_int16 yyss;
Lev Walkin418298d2006-07-13 08:24:20 +0000610 YYSTYPE yyvs;
611 };
612
613/* The size of the maximum gap between one aligned stack and the next. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700614# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
Lev Walkin418298d2006-07-13 08:24:20 +0000615
616/* The size of an array large to enough to hold all stacks, each with
617 N elements. */
618# define YYSTACK_BYTES(N) \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700619 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
620 + YYSTACK_GAP_MAXIMUM)
Lev Walkin418298d2006-07-13 08:24:20 +0000621
622/* Copy COUNT objects from FROM to TO. The source and destination do
623 not overlap. */
624# ifndef YYCOPY
Lev Walkin0e90aa02013-03-19 16:17:13 -0700625# if defined __GNUC__ && 1 < __GNUC__
Lev Walkin418298d2006-07-13 08:24:20 +0000626# define YYCOPY(To, From, Count) \
627 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
628# else
629# define YYCOPY(To, From, Count) \
630 do \
631 { \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700632 YYSIZE_T yyi; \
Lev Walkin418298d2006-07-13 08:24:20 +0000633 for (yyi = 0; yyi < (Count); yyi++) \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700634 (To)[yyi] = (From)[yyi]; \
Lev Walkin418298d2006-07-13 08:24:20 +0000635 } \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700636 while (YYID (0))
Lev Walkin418298d2006-07-13 08:24:20 +0000637# endif
638# endif
639
640/* Relocate STACK from its old location to the new one. The
641 local variables YYSIZE and YYSTACKSIZE give the old and new number of
642 elements in the stack, and YYPTR gives the new location of the
643 stack. Advance YYPTR to a properly aligned location for the next
644 stack. */
645# define YYSTACK_RELOCATE(Stack) \
646 do \
647 { \
648 YYSIZE_T yynewbytes; \
649 YYCOPY (&yyptr->Stack, Stack, yysize); \
650 Stack = &yyptr->Stack; \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700651 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
Lev Walkin418298d2006-07-13 08:24:20 +0000652 yyptr += yynewbytes / sizeof (*yyptr); \
653 } \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700654 while (YYID (0))
Lev Walkinf15320b2004-06-03 03:38:44 +0000655
656#endif
657
Lev Walkin0e90aa02013-03-19 16:17:13 -0700658/* YYFINAL -- State number of the termination state. */
Lev Walkin418298d2006-07-13 08:24:20 +0000659#define YYFINAL 7
Lev Walkin0e90aa02013-03-19 16:17:13 -0700660/* YYLAST -- Last index in YYTABLE. */
661#define YYLAST 793
Lev Walkin418298d2006-07-13 08:24:20 +0000662
Lev Walkin0e90aa02013-03-19 16:17:13 -0700663/* YYNTOKENS -- Number of terminals. */
664#define YYNTOKENS 123
665/* YYNNTS -- Number of nonterminals. */
Lev Walkin1c8d5aa2006-10-27 05:37:39 +0000666#define YYNNTS 122
Lev Walkin0e90aa02013-03-19 16:17:13 -0700667/* YYNRULES -- Number of rules. */
668#define YYNRULES 313
669/* YYNRULES -- Number of states. */
670#define YYNSTATES 473
Lev Walkin418298d2006-07-13 08:24:20 +0000671
672/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
673#define YYUNDEFTOK 2
Lev Walkin0e90aa02013-03-19 16:17:13 -0700674#define YYMAXUTOK 362
Lev Walkin418298d2006-07-13 08:24:20 +0000675
Lev Walkin0e90aa02013-03-19 16:17:13 -0700676#define YYTRANSLATE(YYX) \
677 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Lev Walkin418298d2006-07-13 08:24:20 +0000678
679/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700680static const yytype_uint8 yytranslate[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000681{
682 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700685 2, 2, 2, 119, 2, 2, 2, 2, 2, 2,
686 112, 113, 2, 2, 115, 2, 120, 2, 2, 2,
687 2, 2, 2, 2, 2, 2, 2, 2, 116, 114,
688 121, 2, 2, 2, 122, 2, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700691 2, 117, 2, 118, 104, 2, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700694 2, 2, 2, 110, 106, 111, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
704 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
707 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
708 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
709 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
710 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
711 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
712 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
713 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
714 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
715 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
716 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700717 95, 96, 97, 98, 99, 100, 101, 102, 103, 105,
718 107, 108, 109
Lev Walkin418298d2006-07-13 08:24:20 +0000719};
720
721#if YYDEBUG
722/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
723 YYRHS. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700724static const yytype_uint16 yyprhs[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000725{
Lev Walkina9532f42006-09-17 04:52:50 +0000726 0, 0, 3, 5, 7, 10, 11, 21, 22, 24,
727 28, 31, 33, 36, 38, 43, 45, 46, 48, 50,
728 53, 56, 59, 62, 65, 68, 69, 71, 75, 77,
729 80, 82, 84, 86, 87, 91, 93, 94, 96, 100,
Lev Walkin4a4543f2006-10-13 12:37:39 +0000730 103, 104, 106, 108, 111, 112, 114, 119, 121, 125,
731 127, 131, 133, 134, 136, 140, 144, 147, 149, 153,
732 155, 159, 161, 165, 170, 172, 174, 179, 183, 187,
733 194, 201, 203, 207, 209, 213, 217, 221, 225, 227,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700734 231, 233, 235, 237, 239, 240, 242, 244, 248, 254,
735 258, 261, 265, 267, 269, 273, 276, 278, 280, 286,
736 287, 289, 291, 295, 298, 303, 307, 311, 315, 319,
737 323, 324, 326, 327, 334, 336, 339, 341, 343, 345,
738 349, 351, 355, 359, 363, 364, 367, 369, 374, 379,
739 384, 391, 398, 400, 405, 409, 411, 415, 419, 423,
740 425, 429, 431, 435, 437, 439, 441, 443, 447, 451,
741 453, 458, 460, 462, 466, 467, 471, 473, 475, 477,
742 479, 481, 483, 485, 487, 491, 493, 495, 497, 499,
743 502, 504, 506, 508, 510, 513, 516, 518, 520, 523,
744 526, 528, 530, 532, 534, 536, 539, 541, 544, 546,
745 548, 550, 552, 554, 556, 558, 560, 562, 564, 566,
746 568, 570, 572, 574, 576, 578, 580, 581, 583, 585,
747 587, 592, 596, 601, 603, 605, 609, 615, 617, 619,
748 623, 625, 629, 631, 635, 637, 641, 646, 650, 652,
749 654, 658, 662, 666, 670, 672, 674, 677, 680, 682,
750 684, 686, 688, 690, 692, 694, 696, 698, 700, 702,
751 706, 712, 714, 718, 720, 724, 725, 727, 729, 731,
752 733, 735, 737, 739, 740, 746, 749, 751, 754, 757,
753 761, 763, 765, 769, 774, 776, 780, 783, 787, 789,
754 793, 794, 796, 798, 801, 804, 808, 810, 814, 816,
755 821, 826, 828, 830, 832, 834, 836, 838, 839, 841,
756 844, 849, 850, 852, 854, 856, 857, 859, 861, 863,
757 865, 867, 868, 870
Lev Walkin418298d2006-07-13 08:24:20 +0000758};
759
Lev Walkin0e90aa02013-03-19 16:17:13 -0700760/* YYRHS -- A `-1'-separated list of the rules' RHS. */
761static const yytype_int16 yyrhs[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000762{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700763 124, 0, -1, 125, -1, 126, -1, 125, 126, -1,
764 -1, 241, 127, 128, 41, 132, 3, 28, 135, 46,
765 -1, -1, 129, -1, 110, 130, 111, -1, 110, 111,
766 -1, 131, -1, 130, 131, -1, 244, -1, 244, 112,
767 12, 113, -1, 12, -1, -1, 133, -1, 134, -1,
768 133, 134, -1, 48, 91, -1, 59, 91, -1, 27,
769 91, -1, 50, 60, -1, 18, 64, -1, -1, 136,
770 -1, 148, 140, 137, -1, 138, -1, 137, 138, -1,
771 155, -1, 185, -1, 153, -1, -1, 45, 18, 139,
772 -1, 195, -1, -1, 141, -1, 61, 142, 114, -1,
773 61, 53, -1, -1, 143, -1, 145, -1, 143, 145,
774 -1, -1, 129, -1, 146, 53, 241, 144, -1, 147,
775 -1, 146, 115, 147, -1, 241, -1, 241, 110, 111,
776 -1, 244, -1, -1, 149, -1, 49, 150, 114, -1,
777 49, 24, 114, -1, 49, 114, -1, 151, -1, 150,
778 115, 151, -1, 241, -1, 241, 110, 111, -1, 244,
779 -1, 110, 202, 111, -1, 241, 154, 3, 152, -1,
780 194, -1, 179, -1, 179, 110, 158, 111, -1, 241,
781 3, 175, -1, 241, 3, 165, -1, 241, 110, 156,
782 111, 3, 175, -1, 241, 110, 156, 111, 3, 165,
783 -1, 157, -1, 156, 115, 157, -1, 241, -1, 241,
784 116, 244, -1, 241, 116, 241, -1, 192, 116, 244,
785 -1, 192, 116, 241, -1, 159, -1, 158, 115, 159,
786 -1, 175, -1, 188, -1, 244, -1, 152, -1, -1,
787 161, -1, 162, -1, 161, 115, 162, -1, 161, 115,
788 4, 161, 5, -1, 244, 175, 229, -1, 175, 229,
789 -1, 37, 75, 175, -1, 174, -1, 164, -1, 163,
790 115, 164, -1, 244, 175, -1, 174, -1, 175, -1,
791 35, 110, 167, 111, 169, -1, -1, 95, -1, 168,
792 -1, 167, 115, 168, -1, 19, 229, -1, 20, 175,
793 166, 229, -1, 20, 183, 229, -1, 20, 184, 229,
794 -1, 19, 183, 229, -1, 19, 175, 229, -1, 19,
795 184, 229, -1, -1, 170, -1, -1, 102, 89, 110,
796 171, 172, 111, -1, 173, -1, 172, 173, -1, 6,
797 -1, 21, -1, 182, -1, 117, 172, 118, -1, 109,
798 -1, 109, 119, 189, -1, 109, 119, 234, -1, 236,
799 177, 198, -1, -1, 176, 178, -1, 154, -1, 34,
800 110, 163, 111, -1, 85, 110, 160, 111, -1, 86,
801 110, 160, 111, -1, 85, 198, 75, 243, 236, 177,
802 -1, 86, 198, 75, 243, 236, 177, -1, 25, -1,
803 25, 42, 32, 244, -1, 63, 75, 179, -1, 17,
804 -1, 17, 120, 241, -1, 242, 120, 241, -1, 17,
805 120, 244, -1, 242, -1, 242, 120, 180, -1, 181,
806 -1, 180, 120, 181, -1, 182, -1, 19, -1, 20,
807 -1, 19, -1, 183, 120, 19, -1, 183, 120, 20,
808 -1, 18, -1, 244, 175, 3, 186, -1, 188, -1,
809 189, -1, 244, 116, 186, -1, -1, 110, 187, 191,
810 -1, 70, -1, 52, -1, 93, -1, 8, -1, 10,
811 -1, 190, -1, 234, -1, 244, -1, 241, 120, 244,
812 -1, 9, -1, 15, -1, 16, -1, 7, -1, 191,
813 7, -1, 31, -1, 70, -1, 83, -1, 193, -1,
814 74, 88, -1, 72, 58, -1, 84, -1, 51, -1,
815 43, 78, -1, 33, 88, -1, 98, -1, 54, -1,
816 195, -1, 65, -1, 47, -1, 29, 88, -1, 192,
817 -1, 193, 231, -1, 30, -1, 55, -1, 56, -1,
818 57, -1, 66, -1, 71, -1, 81, -1, 90, -1,
819 92, -1, 97, -1, 99, -1, 100, -1, 101, -1,
820 73, -1, 106, -1, 107, -1, 104, -1, 105, -1,
821 -1, 199, -1, 200, -1, 201, -1, 87, 112, 202,
822 113, -1, 112, 202, 113, -1, 201, 112, 202, 113,
823 -1, 109, -1, 203, -1, 203, 115, 109, -1, 203,
824 115, 109, 115, 203, -1, 218, -1, 204, -1, 24,
825 103, 207, -1, 205, -1, 204, 196, 205, -1, 206,
826 -1, 205, 197, 206, -1, 207, -1, 207, 103, 207,
827 -1, 209, 112, 202, 113, -1, 112, 202, 113, -1,
828 210, -1, 212, -1, 210, 222, 210, -1, 68, 222,
829 210, -1, 210, 222, 67, -1, 68, 222, 67, -1,
830 213, -1, 208, -1, 77, 9, -1, 77, 244, -1,
831 87, -1, 53, -1, 52, -1, 93, -1, 235, -1,
832 190, -1, 211, -1, 244, -1, 8, -1, 10, -1,
833 241, -1, 102, 36, 201, -1, 102, 37, 110, 214,
834 111, -1, 215, -1, 214, 115, 215, -1, 109, -1,
835 244, 198, 216, -1, -1, 217, -1, 80, -1, 22,
836 -1, 76, -1, 219, -1, 223, -1, 221, -1, -1,
837 38, 32, 110, 220, 191, -1, 39, 175, -1, 108,
838 -1, 108, 121, -1, 121, 108, -1, 121, 108, 121,
839 -1, 224, -1, 225, -1, 110, 241, 111, -1, 224,
840 110, 226, 111, -1, 227, -1, 226, 115, 227, -1,
841 122, 228, -1, 122, 120, 228, -1, 244, -1, 228,
842 120, 244, -1, -1, 230, -1, 76, -1, 40, 186,
843 -1, 110, 111, -1, 110, 232, 111, -1, 233, -1,
844 232, 115, 233, -1, 244, -1, 244, 112, 234, 113,
845 -1, 244, 112, 189, 113, -1, 234, -1, 109, -1,
846 12, -1, 13, -1, 234, -1, 14, -1, -1, 237,
847 -1, 238, 240, -1, 117, 239, 12, 118, -1, -1,
848 96, -1, 26, -1, 82, -1, -1, 59, -1, 48,
849 -1, 17, -1, 18, -1, 18, -1, -1, 244, -1,
850 11, -1
Lev Walkin418298d2006-07-13 08:24:20 +0000851};
852
853/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700854static const yytype_uint16 yyrline[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000855{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700856 0, 357, 357, 363, 368, 385, 385, 414, 415, 419,
857 422, 428, 434, 443, 447, 451, 461, 462, 471, 474,
858 483, 486, 489, 492, 496, 517, 518, 527, 536, 539,
859 555, 562, 575, 583, 582, 596, 609, 610, 613, 623,
860 629, 630, 633, 638, 645, 646, 650, 661, 666, 673,
861 679, 685, 695, 696, 708, 711, 714, 722, 727, 734,
862 740, 746, 755, 758, 768, 781, 791, 811, 817, 833,
863 839, 847, 856, 867, 871, 878, 885, 893, 904, 909,
864 916, 919, 927, 938, 961, 962, 965, 970, 974, 981,
865 988, 994, 1001, 1007, 1012, 1019, 1024, 1027, 1034, 1044,
866 1045, 1049, 1056, 1066, 1076, 1087, 1097, 1108, 1118, 1129,
867 1141, 1142, 1149, 1148, 1157, 1161, 1168, 1172, 1175, 1179,
868 1185, 1193, 1202, 1214, 1236, 1243, 1262, 1265, 1271, 1277,
869 1283, 1293, 1303, 1309, 1320, 1335, 1343, 1353, 1363, 1373,
870 1381, 1403, 1411, 1420, 1424, 1429, 1438, 1442, 1446, 1453,
871 1473, 1483, 1484, 1485, 1492, 1492, 1497, 1505, 1510, 1515,
872 1519, 1523, 1526, 1532, 1543, 1561, 1565, 1570, 1578, 1587,
873 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611,
874 1612, 1613, 1614, 1621, 1622, 1623, 1627, 1633, 1646, 1647,
875 1651, 1655, 1656, 1657, 1658, 1659, 1663, 1664, 1665, 1666,
876 1670, 1671, 1678, 1678, 1679, 1679, 1682, 1683, 1689, 1693,
877 1696, 1706, 1709, 1715, 1719, 1722, 1728, 1736, 1742, 1743,
878 1749, 1750, 1756, 1757, 1764, 1765, 1771, 1779, 1787, 1793,
879 1799, 1806, 1814, 1822, 1831, 1834, 1840, 1845, 1856, 1859,
880 1865, 1870, 1875, 1876, 1877, 1878, 1892, 1896, 1903, 1917,
881 1920, 1926, 1929, 1935, 1941, 1955, 1956, 1960, 1963, 1966,
882 1974, 1975, 1976, 1981, 1980, 1992, 2000, 2001, 2002, 2003,
883 2006, 2009, 2018, 2033, 2039, 2045, 2059, 2070, 2086, 2089,
884 2107, 2111, 2115, 2119, 2142, 2146, 2152, 2157, 2164, 2171,
885 2179, 2187, 2194, 2205, 2209, 2216, 2217, 2248, 2249, 2253,
886 2260, 2266, 2267, 2268, 2269, 2273, 2274, 2275, 2279, 2283,
887 2291, 2298, 2299, 2305
Lev Walkin418298d2006-07-13 08:24:20 +0000888};
889#endif
890
Lev Walkin0e90aa02013-03-19 16:17:13 -0700891#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
892/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
893 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
Lev Walkin418298d2006-07-13 08:24:20 +0000894static const char *const yytname[] =
895{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700896 "$end", "error", "$undefined", "TOK_PPEQ", "TOK_VBracketLeft",
897 "TOK_VBracketRight", "TOK_whitespace", "TOK_opaque", "TOK_bstring",
898 "TOK_cstring", "TOK_hstring", "TOK_identifier", "TOK_number",
899 "TOK_number_negative", "TOK_realnumber", "TOK_tuple", "TOK_quadruple",
900 "TOK_typereference", "TOK_capitalreference", "TOK_typefieldreference",
901 "TOK_valuefieldreference", "TOK_Literal", "TOK_ABSENT",
902 "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY", "TOK_APPLICATION",
903 "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT", "TOK_BMPString", "TOK_BOOLEAN",
904 "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE", "TOK_CLASS", "TOK_COMPONENT",
905 "TOK_COMPONENTS", "TOK_CONSTRAINED", "TOK_CONTAINING", "TOK_DEFAULT",
906 "TOK_DEFINITIONS", "TOK_DEFINED", "TOK_EMBEDDED", "TOK_ENCODED",
907 "TOK_ENCODING_CONTROL", "TOK_END", "TOK_ENUMERATED", "TOK_EXPLICIT",
908 "TOK_EXPORTS", "TOK_EXTENSIBILITY", "TOK_EXTERNAL", "TOK_FALSE",
909 "TOK_FROM", "TOK_GeneralizedTime", "TOK_GeneralString",
910 "TOK_GraphicString", "TOK_IA5String", "TOK_IDENTIFIER", "TOK_IMPLICIT",
911 "TOK_IMPLIED", "TOK_IMPORTS", "TOK_INCLUDES", "TOK_INSTANCE",
912 "TOK_INSTRUCTIONS", "TOK_INTEGER", "TOK_ISO646String", "TOK_MAX",
913 "TOK_MIN", "TOK_MINUS_INFINITY", "TOK_NULL", "TOK_NumericString",
914 "TOK_OBJECT", "TOK_ObjectDescriptor", "TOK_OCTET", "TOK_OF",
915 "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV", "TOK_PLUS_INFINITY",
916 "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE", "TOK_REAL",
917 "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE", "TOK_STRING",
918 "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS", "TOK_TeletexString",
919 "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE", "TOK_UNIVERSAL",
920 "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
921 "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH", "TOK_EXCEPT",
922 "'^'", "TOK_INTERSECTION", "'|'", "TOK_UNION", "TOK_TwoDots",
923 "TOK_ThreeDots", "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['",
924 "']'", "'!'", "'.'", "'<'", "'@'", "$accept", "ParsedGrammar",
925 "ModuleList", "ModuleDefinition", "@1", "optObjectIdentifier",
926 "ObjectIdentifier", "ObjectIdentifierBody", "ObjectIdentifierElement",
927 "optModuleDefinitionFlags", "ModuleDefinitionFlags",
928 "ModuleDefinitionFlag", "optModuleBody", "ModuleBody", "AssignmentList",
929 "Assignment", "@2", "optImports", "ImportsDefinition",
930 "optImportsBundleSet", "ImportsBundleSet", "AssignedIdentifier",
931 "ImportsBundle", "ImportsList", "ImportsElement", "optExports",
932 "ExportsDefinition", "ExportsBody", "ExportsElement", "ValueSet",
933 "ValueSetTypeAssignment", "DefinedType", "DataTypeReference",
934 "ParameterArgumentList", "ParameterArgumentName", "ActualParameterList",
935 "ActualParameter", "optComponentTypeLists", "ComponentTypeLists",
936 "ComponentType", "AlternativeTypeLists", "AlternativeType",
937 "ObjectClass", "optUnique", "FieldSpec", "ClassField", "optWithSyntax",
938 "WithSyntax", "@3", "WithSyntaxList", "WithSyntaxToken",
939 "ExtensionAndException", "Type", "NSTD_IndirectMarker",
940 "TypeDeclaration", "TypeDeclarationSet", "ComplexTypeReference",
941 "ComplexTypeReferenceAmpList", "ComplexTypeReferenceElement",
942 "PrimitiveFieldReference", "FieldName", "DefinedObjectClass",
943 "ValueAssignment", "Value", "@4", "SimpleValue", "DefinedValue",
944 "RestrictedCharacterStringValue", "Opaque", "BasicTypeId",
945 "BasicTypeId_UniverationCompatible", "BasicType", "BasicString",
946 "UnionMark", "IntersectionMark", "optConstraints", "Constraint",
947 "SubtypeConstraint", "SetOfConstraints", "ElementSetSpecs",
948 "ElementSetSpec", "Unions", "Intersections", "IntersectionElements",
949 "ConstraintSubtypeElement", "PatternConstraint", "ConstraintSpec",
950 "SingleValue", "BitStringValue", "ContainedSubtype",
951 "InnerTypeConstraint", "WithComponentsList", "WithComponentsElement",
952 "optPresenceConstraint", "PresenceConstraint", "GeneralConstraint",
953 "UserDefinedConstraint", "@5", "ContentsConstraint",
954 "ConstraintRangeSpec", "TableConstraint", "SimpleTableConstraint",
955 "ComponentRelationConstraint", "AtNotationList", "AtNotationElement",
956 "ComponentIdList", "optMarker", "Marker", "UniverationDefinition",
957 "UniverationList", "UniverationElement", "SignedNumber", "RealValue",
958 "optTag", "Tag", "TagTypeValue", "TagClass", "TagPlicit", "TypeRefName",
Lev Walkinadf863f2006-09-05 16:18:34 +0000959 "ObjectClassReference", "optIdentifier", "Identifier", 0
Lev Walkin418298d2006-07-13 08:24:20 +0000960};
961#endif
962
963# ifdef YYPRINT
964/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
965 token YYLEX-NUM. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700966static const yytype_uint16 yytoknum[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000967{
968 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
969 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
970 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
971 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
972 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
973 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
974 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
975 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
976 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
977 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Lev Walkin0e90aa02013-03-19 16:17:13 -0700978 355, 356, 357, 358, 94, 359, 124, 360, 361, 362,
979 123, 125, 40, 41, 59, 44, 58, 91, 93, 33,
980 46, 60, 64
Lev Walkin418298d2006-07-13 08:24:20 +0000981};
982# endif
983
984/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700985static const yytype_uint8 yyr1[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000986{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700987 0, 123, 124, 125, 125, 127, 126, 128, 128, 129,
988 129, 130, 130, 131, 131, 131, 132, 132, 133, 133,
989 134, 134, 134, 134, 134, 135, 135, 136, 137, 137,
990 138, 138, 138, 139, 138, 138, 140, 140, 141, 141,
991 142, 142, 143, 143, 144, 144, 145, 146, 146, 147,
992 147, 147, 148, 148, 149, 149, 149, 150, 150, 151,
993 151, 151, 152, 153, 154, 154, 154, 155, 155, 155,
994 155, 156, 156, 157, 157, 157, 157, 157, 158, 158,
995 159, 159, 159, 159, 160, 160, 161, 161, 161, 162,
996 162, 162, 162, 163, 163, 164, 164, 164, 165, 166,
997 166, 167, 167, 168, 168, 168, 168, 168, 168, 168,
998 169, 169, 171, 170, 172, 172, 173, 173, 173, 173,
999 174, 174, 174, 175, 176, 177, 178, 178, 178, 178,
1000 178, 178, 178, 178, 178, 179, 179, 179, 179, 179,
1001 179, 180, 180, 181, 182, 182, 183, 183, 183, 184,
1002 185, 186, 186, 186, 187, 186, 186, 188, 188, 188,
1003 188, 188, 188, 189, 189, 190, 190, 190, 191, 191,
1004 192, 192, 192, 192, 192, 192, 192, 192, 192, 192,
1005 192, 192, 192, 193, 193, 193, 194, 194, 195, 195,
1006 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
1007 195, 195, 196, 196, 197, 197, 198, 198, 199, 200,
1008 200, 201, 201, 202, 202, 202, 202, 202, 203, 203,
1009 204, 204, 205, 205, 206, 206, 207, 207, 207, 207,
1010 207, 207, 207, 207, 207, 207, 208, 208, 209, 209,
1011 210, 210, 210, 210, 210, 210, 211, 211, 212, 213,
1012 213, 214, 214, 215, 215, 216, 216, 217, 217, 217,
1013 218, 218, 218, 220, 219, 221, 222, 222, 222, 222,
1014 223, 223, 224, 225, 226, 226, 227, 227, 228, 228,
1015 229, 229, 230, 230, 231, 231, 232, 232, 233, 233,
1016 233, 233, 233, 234, 234, 235, 235, 236, 236, 237,
1017 238, 239, 239, 239, 239, 240, 240, 240, 241, 241,
1018 242, 243, 243, 244
Lev Walkin418298d2006-07-13 08:24:20 +00001019};
1020
1021/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001022static const yytype_uint8 yyr2[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001023{
Lev Walkina9532f42006-09-17 04:52:50 +00001024 0, 2, 1, 1, 2, 0, 9, 0, 1, 3,
1025 2, 1, 2, 1, 4, 1, 0, 1, 1, 2,
1026 2, 2, 2, 2, 2, 0, 1, 3, 1, 2,
1027 1, 1, 1, 0, 3, 1, 0, 1, 3, 2,
Lev Walkin4a4543f2006-10-13 12:37:39 +00001028 0, 1, 1, 2, 0, 1, 4, 1, 3, 1,
1029 3, 1, 0, 1, 3, 3, 2, 1, 3, 1,
1030 3, 1, 3, 4, 1, 1, 4, 3, 3, 6,
1031 6, 1, 3, 1, 3, 3, 3, 3, 1, 3,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001032 1, 1, 1, 1, 0, 1, 1, 3, 5, 3,
1033 2, 3, 1, 1, 3, 2, 1, 1, 5, 0,
1034 1, 1, 3, 2, 4, 3, 3, 3, 3, 3,
1035 0, 1, 0, 6, 1, 2, 1, 1, 1, 3,
1036 1, 3, 3, 3, 0, 2, 1, 4, 4, 4,
1037 6, 6, 1, 4, 3, 1, 3, 3, 3, 1,
1038 3, 1, 3, 1, 1, 1, 1, 3, 3, 1,
1039 4, 1, 1, 3, 0, 3, 1, 1, 1, 1,
1040 1, 1, 1, 1, 3, 1, 1, 1, 1, 2,
1041 1, 1, 1, 1, 2, 2, 1, 1, 2, 2,
1042 1, 1, 1, 1, 1, 2, 1, 2, 1, 1,
Lev Walkin418298d2006-07-13 08:24:20 +00001043 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001044 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
1045 4, 3, 4, 1, 1, 3, 5, 1, 1, 3,
1046 1, 3, 1, 3, 1, 3, 4, 3, 1, 1,
1047 3, 3, 3, 3, 1, 1, 2, 2, 1, 1,
1048 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1049 5, 1, 3, 1, 3, 0, 1, 1, 1, 1,
1050 1, 1, 1, 0, 5, 2, 1, 2, 2, 3,
1051 1, 1, 3, 4, 1, 3, 2, 3, 1, 3,
1052 0, 1, 1, 2, 2, 3, 1, 3, 1, 4,
1053 4, 1, 1, 1, 1, 1, 1, 0, 1, 2,
1054 4, 0, 1, 1, 1, 0, 1, 1, 1, 1,
1055 1, 0, 1, 1
Lev Walkin418298d2006-07-13 08:24:20 +00001056};
1057
1058/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1059 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1060 means the default is an error. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001061static const yytype_uint16 yydefact[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001062{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001063 0, 308, 309, 0, 2, 3, 5, 1, 4, 7,
1064 0, 0, 8, 313, 15, 10, 0, 11, 13, 16,
Lev Walkina9532f42006-09-17 04:52:50 +00001065 9, 12, 0, 0, 0, 0, 0, 0, 0, 17,
1066 18, 0, 24, 22, 20, 23, 21, 0, 19, 14,
Lev Walkin4a4543f2006-10-13 12:37:39 +00001067 52, 0, 0, 26, 36, 53, 0, 56, 0, 57,
1068 59, 61, 6, 40, 0, 37, 55, 54, 0, 0,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001069 39, 0, 41, 42, 0, 47, 49, 51, 188, 0,
1070 189, 190, 191, 192, 193, 201, 194, 195, 196, 197,
1071 198, 199, 200, 27, 28, 32, 30, 31, 35, 0,
1072 297, 58, 60, 38, 43, 0, 0, 0, 33, 29,
1073 297, 135, 310, 0, 170, 0, 0, 184, 177, 181,
1074 183, 171, 0, 0, 172, 176, 180, 0, 0, 65,
1075 186, 173, 64, 182, 139, 301, 0, 124, 298, 305,
1076 44, 48, 50, 34, 0, 68, 67, 0, 185, 179,
1077 178, 175, 174, 0, 71, 0, 173, 73, 0, 297,
1078 0, 187, 0, 303, 304, 302, 0, 0, 0, 206,
1079 307, 306, 299, 45, 46, 0, 136, 138, 0, 0,
1080 0, 0, 0, 63, 159, 165, 160, 293, 294, 166,
1081 167, 157, 158, 83, 0, 78, 80, 81, 161, 162,
1082 82, 292, 284, 0, 286, 291, 288, 144, 145, 140,
1083 141, 143, 137, 0, 156, 154, 150, 151, 152, 0,
1084 163, 132, 0, 0, 206, 206, 126, 125, 0, 0,
1085 123, 207, 208, 209, 297, 297, 0, 101, 297, 72,
1086 77, 76, 75, 74, 246, 247, 296, 0, 0, 297,
1087 240, 239, 0, 0, 238, 241, 0, 213, 0, 0,
1088 243, 0, 214, 218, 220, 222, 224, 235, 0, 228,
1089 244, 229, 234, 217, 260, 262, 261, 270, 271, 295,
1090 242, 248, 245, 66, 297, 285, 0, 0, 0, 300,
1091 0, 0, 0, 0, 297, 0, 297, 0, 297, 0,
1092 0, 0, 0, 149, 146, 0, 282, 280, 280, 280,
1093 103, 281, 99, 280, 280, 110, 0, 70, 69, 0,
1094 0, 265, 266, 0, 0, 236, 237, 0, 0, 0,
1095 0, 62, 0, 202, 203, 0, 204, 205, 0, 0,
1096 0, 0, 0, 79, 287, 0, 0, 163, 142, 168,
1097 155, 164, 153, 0, 120, 0, 93, 96, 97, 297,
1098 134, 0, 0, 85, 86, 92, 280, 297, 311, 0,
1099 311, 0, 211, 0, 283, 108, 0, 107, 109, 100,
1100 280, 105, 106, 0, 98, 111, 102, 219, 263, 267,
1101 268, 233, 231, 249, 0, 272, 227, 215, 221, 223,
1102 225, 0, 232, 230, 0, 0, 274, 290, 289, 169,
1103 133, 0, 127, 297, 95, 297, 128, 297, 90, 280,
1104 297, 312, 129, 297, 210, 212, 147, 148, 104, 0,
1105 0, 269, 253, 0, 251, 206, 0, 226, 0, 276,
1106 278, 273, 0, 121, 122, 94, 91, 297, 87, 89,
1107 124, 124, 112, 264, 250, 0, 255, 216, 277, 0,
1108 275, 0, 130, 131, 0, 252, 258, 259, 257, 254,
1109 256, 279, 88, 116, 117, 0, 0, 114, 118, 0,
1110 113, 115, 119
Lev Walkin418298d2006-07-13 08:24:20 +00001111};
1112
Lev Walkin0e90aa02013-03-19 16:17:13 -07001113/* YYDEFGOTO[NTERM-NUM]. */
1114static const yytype_int16 yydefgoto[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001115{
Lev Walkina9532f42006-09-17 04:52:50 +00001116 -1, 3, 4, 5, 9, 11, 12, 16, 17, 28,
Lev Walkinc6ab03c2006-10-21 05:54:49 +00001117 29, 30, 42, 43, 83, 84, 133, 54, 55, 61,
1118 62, 164, 63, 64, 65, 44, 45, 48, 49, 183,
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00001119 85, 118, 86, 143, 144, 184, 185, 352, 353, 354,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001120 345, 346, 135, 370, 226, 227, 374, 375, 454, 466,
1121 467, 355, 356, 158, 159, 217, 119, 199, 200, 468,
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00001122 298, 299, 87, 206, 280, 207, 208, 250, 340, 120,
1123 121, 122, 123, 325, 328, 220, 221, 222, 223, 251,
1124 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001125 262, 423, 424, 459, 460, 263, 264, 420, 265, 314,
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00001126 266, 267, 268, 395, 396, 429, 300, 301, 151, 193,
1127 194, 269, 270, 127, 128, 129, 156, 162, 271, 124,
1128 410, 272
Lev Walkin418298d2006-07-13 08:24:20 +00001129};
1130
1131/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1132 STATE-NUM. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001133#define YYPACT_NINF -276
1134static const yytype_int16 yypact[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001135{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001136 223, -276, -276, 28, 223, -276, -276, -276, -276, -61,
1137 13, 25, -276, -276, -276, -276, 42, -276, -56, 229,
1138 -276, -276, 90, 54, 32, 64, 129, 79, 193, 229,
1139 -276, 104, -276, -276, -276, -276, -276, 197, -276, -276,
1140 133, 66, 185, -276, 191, -276, 144, -276, 154, -276,
1141 176, -276, -276, 196, 524, -276, -276, -276, 237, 149,
1142 -276, 177, 237, -276, -26, -276, 189, -276, -276, 291,
1143 -276, -276, -276, -276, -276, -276, -276, -276, -276, -276,
1144 -276, -276, -276, 524, -276, -276, -276, -276, -276, 272,
1145 200, -276, -276, -276, -276, 223, 237, 209, -276, -276,
1146 -18, 202, -276, 247, -276, 253, 269, -276, -276, -276,
1147 -276, -276, 296, 261, -276, -276, -276, 692, 356, 255,
1148 -276, 258, -276, -276, 243, 77, 372, -276, -276, 184,
1149 -61, -276, -276, -276, 266, -276, -276, 237, -276, -276,
1150 -276, -276, -276, -64, -276, 262, -276, 263, 267, 99,
1151 84, -276, 294, -276, -276, -276, 368, 211, 616, -57,
1152 -276, -276, -276, -276, -276, 288, -276, -276, 378, 692,
1153 237, 237, 399, -276, -276, -276, -276, -276, -276, -276,
1154 -276, -276, -276, -276, 150, -276, -276, -276, -276, -276,
1155 -276, -276, -276, 169, -276, -276, 271, -276, -276, 265,
1156 -276, -276, -276, 268, -276, -276, -276, -276, -276, 270,
1157 273, 345, 278, 317, 78, 124, -276, -276, 282, 399,
1158 -276, -276, -276, 283, 219, 46, 181, -276, -18, -276,
1159 -276, -276, -276, -276, -276, -276, -276, 293, 366, 200,
1160 -276, -276, 63, 199, -276, -276, 295, -276, 223, 399,
1161 -276, 289, 284, 218, 235, -276, 298, -276, 290, 63,
1162 -276, -276, -276, -276, -276, -276, -276, 309, -276, -276,
1163 -276, -276, -276, -276, 99, -276, 69, 233, 332, -276,
1164 396, 393, 211, 373, 49, 340, 8, 346, 8, 347,
1165 399, 307, 399, -276, -276, 211, -276, -8, 110, -8,
1166 -276, -276, 329, 110, -8, 323, 288, -276, -276, 550,
1167 316, -276, 308, 320, 190, -276, -276, 318, 321, 322,
1168 319, -276, 325, -276, -276, 550, -276, -276, 550, 550,
1169 399, 432, 314, -276, -276, 336, 337, -276, -276, -276,
1170 457, -276, -276, 393, 349, 182, -276, -276, -276, 200,
1171 -276, 390, 355, 357, -276, -276, -8, 200, 393, 359,
1172 393, 358, -276, 360, -276, -276, 341, -276, -276, -276,
1173 -8, -276, -276, 385, -276, -276, -276, -276, -276, -276,
1174 354, -276, -276, 283, 74, -276, -276, 362, 235, -276,
1175 -276, 365, -276, -276, 0, 183, -276, -276, -276, -276,
1176 -276, 233, -276, 49, -276, 200, -276, 4, -276, -8,
1177 200, -276, -276, 200, -276, -276, -276, -276, -276, 369,
1178 396, -276, -276, 195, -276, -57, 445, -276, 393, 361,
1179 -276, -276, 314, -276, -276, -276, -276, 68, -276, -276,
1180 -276, -276, -276, 457, -276, 74, 159, -276, 361, 393,
1181 -276, 11, -276, -276, 55, -276, -276, -276, -276, -276,
1182 -276, -276, -276, -276, -276, 55, 17, -276, -276, 51,
1183 -276, -276, -276
Lev Walkin418298d2006-07-13 08:24:20 +00001184};
1185
1186/* YYPGOTO[NTERM-NUM]. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001187static const yytype_int16 yypgoto[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001188{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001189 -276, -276, -276, 476, -276, -276, 352, -276, 467, -276,
1190 -276, 456, -276, -276, -276, 404, -276, -276, -276, -276,
1191 -276, -276, 426, -276, 394, -276, -276, -276, 431, 343,
1192 -276, 335, -276, -276, 326, -276, 220, 208, 65, 93,
1193 -276, 100, 276, -276, -276, 201, -276, -276, -276, 40,
1194 -275, -270, -87, -276, -74, -276, 221, -276, 232, -148,
1195 287, 292, -276, -166, -276, -142, -265, -139, 94, -91,
1196 -75, -276, 15, -276, -276, -213, -276, -276, 198, -199,
1197 92, -276, 194, 188, -165, -276, -276, -227, -276, -276,
1198 -276, -276, 75, -276, -276, -276, -276, -276, -276, 264,
1199 -276, -276, -276, -276, 89, 96, -264, -276, -276, -276,
1200 250, -128, -276, -195, -276, -276, -276, -276, 5, -276,
1201 167, -10
Lev Walkin418298d2006-07-13 08:24:20 +00001202};
1203
1204/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1205 positive, shift that token. If negative, reduce the rule which
1206 number is the opposite. If zero, do what YYDEFACT says.
Lev Walkin0e90aa02013-03-19 16:17:13 -07001207 If YYTABLE_NINF, syntax error. */
1208#define YYTABLE_NINF -281
1209static const yytype_int16 yytable[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001210{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001211 18, 287, 289, 126, 201, 6, 18, 187, 437, 6,
1212 188, 13, 335, 136, 347, 13, 462, 134, 188, 13,
1213 291, 189, 195, 463, 13, 14, 145, 95, 7, 189,
1214 218, 51, 295, 365, 367, 368, 197, 198, 464, 371,
1215 372, 351, 146, 67, 90, 351, 50, 168, 51, 10,
1216 320, 169, 67, 13, 14, 219, 22, 463, 66, 89,
1217 13, 463, 186, 50, 293, 294, 19, 66, 296, 88,
1218 197, 198, 464, 90, 197, 198, 464, 13, 145, 13,
1219 13, 177, 178, 1, 2, 13, 67, 382, 89, 96,
1220 46, 361, 408, 363, 146, 13, 177, 178, 88, 125,
1221 130, 66, 31, 153, 393, 351, 418, 174, 175, 176,
1222 13, 177, 178, 344, 179, 180, 342, 344, 32, -84,
1223 428, 125, 147, 33, 15, 125, 407, 167, 470, 364,
1224 201, 391, 187, 347, 465, 188, 433, 297, 302, 190,
1225 196, 308, 166, 188, 377, 439, 189, 210, 195, 336,
1226 295, 181, 311, 20, 189, 34, 188, 202, 344, 154,
1227 231, 233, 209, 125, 390, 218, 125, 189, 465, 472,
1228 36, 312, 465, 155, 147, 230, 232, 344, 191, -25,
1229 47, 456, 41, 422, 313, 125, 296, 186, 286, 35,
1230 219, 471, 182, 191, 471, 192, 37, 348, 234, 175,
1231 235, 13, 177, 178, 236, 179, 180, 13, 315, 172,
1232 13, 218, 446, 1, 2, 440, 125, 39, 441, 174,
1233 175, 176, 13, 177, 178, 40, 179, 180, 1, 2,
1234 366, 52, 160, 316, 288, 457, 219, 293, 294, 458,
1235 1, 2, 240, 161, 13, 177, 178, 23, 13, 60,
1236 1, 2, 53, 319, 1, 2, 24, 381, 56, 295,
1237 92, 273, 404, 181, 190, 274, 196, 337, 57, 58,
1238 409, 341, 210, 434, 349, 100, 357, 25, 357, 26,
1239 275, 204, 209, 245, 276, 210, 59, 209, 27, 101,
1240 102, 93, 305, 402, 431, 296, 306, 403, 432, 97,
1241 209, 103, 68, 104, 182, 105, 444, 224, 225, 98,
1242 445, 1, 2, 197, 198, 106, 348, 125, 436, 107,
1243 132, 205, 137, 108, 323, 324, 109, 70, 71, 72,
1244 -280, 317, 318, 400, -280, 138, 125, 110, 73, 326,
1245 327, 139, 111, 74, 112, 75, 113, 140, 411, 142,
1246 411, 197, 198, 76, 141, 114, 115, 101, 102, 148,
1247 416, 417, 77, 152, 78, 149, 452, 453, 150, 79,
1248 116, 80, 81, 82, 425, 157, 165, 172, 170, 171,
1249 203, 228, 117, 277, 430, 278, 279, 283, 284, 282,
1250 281, 337, 285, 349, 290, 292, 309, 357, 310, 322,
1251 321, 329, 330, 339, 13, 343, 209, 234, 175, 235,
1252 13, 177, 178, 236, 179, 180, 1, 2, 430, 332,
1253 362, 358, 360, 237, 369, 373, 378, 357, 380, 379,
1254 219, 384, 386, 385, 387, 425, 394, 238, 239, 461,
1255 234, 175, 235, 13, 177, 178, 236, 179, 180, 397,
1256 398, 240, 241, 234, 175, 235, 13, 177, 178, 236,
1257 179, 180, 1, 2, 399, 405, 406, 242, 401, 237,
1258 412, 414, 407, 415, 419, 421, 243, 426, 427, 442,
1259 8, 449, 163, 21, 240, 38, 244, 99, 94, 91,
1260 131, 173, 245, 216, 333, 229, 359, 240, 241, 392,
1261 438, 246, 451, 435, 307, 469, 350, 376, 247, 248,
1262 338, 249, 303, 242, 443, 383, 389, 304, 447, 388,
1263 455, 450, 243, 331, 448, 245, 334, 413, 0, 0,
1264 0, 0, 244, 0, 0, 13, 0, 0, 245, 0,
1265 0, 1, 2, 0, 0, 0, 0, 246, 0, 0,
1266 0, 0, 0, 0, 68, 0, 0, 249, 234, 175,
1267 235, 13, 177, 178, 236, 179, 180, 1, 2, 69,
1268 0, 0, 0, 0, 0, 0, 0, 0, 0, 70,
1269 71, 72, 0, 0, 0, 0, 0, 0, 0, 0,
1270 73, 0, 0, 0, 0, 74, 0, 75, 0, 0,
1271 0, 0, 240, 241, 0, 76, 0, 0, 0, 0,
1272 0, 0, 0, 0, 77, 0, 78, 0, 242, 0,
1273 0, 79, 0, 80, 81, 82, 0, 243, 0, 0,
1274 0, 0, 0, 101, 102, 0, 0, 244, 0, 0,
1275 0, 211, 0, 245, 0, 103, 68, 104, 0, 105,
1276 212, 0, 246, 0, 0, 0, 0, 0, 0, 106,
1277 0, 0, 249, 107, 0, 0, 0, 108, 0, 0,
1278 109, 70, 71, 72, 0, 0, 0, 0, 0, 213,
1279 0, 110, 73, 0, 0, 0, 111, 74, 112, 75,
1280 113, 0, 0, 0, 0, 0, 0, 76, 0, 114,
1281 115, 214, 215, 0, 0, 0, 77, 0, 78, 1,
1282 2, 0, 0, 79, 116, 80, 81, 82, 0, 0,
1283 0, 103, 68, 104, 0, 105, 0, 0, 0, 0,
1284 0, 0, 0, 0, 0, 106, 0, 0, 0, 107,
1285 0, 0, 0, 108, 0, 0, 109, 70, 71, 72,
1286 0, 0, 0, 0, 0, 0, 0, 110, 73, 0,
1287 0, 0, 111, 74, 112, 75, 113, 0, 0, 0,
1288 0, 0, 0, 76, 0, 114, 115, 0, 0, 0,
1289 0, 0, 77, 0, 78, 0, 0, 0, 0, 79,
1290 116, 80, 81, 82
Lev Walkin418298d2006-07-13 08:24:20 +00001291};
1292
Lev Walkin0e90aa02013-03-19 16:17:13 -07001293static const yytype_int16 yycheck[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001294{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001295 10, 214, 215, 90, 152, 0, 16, 149, 4, 4,
1296 149, 11, 277, 100, 284, 11, 5, 35, 157, 11,
1297 219, 149, 150, 6, 11, 12, 117, 53, 0, 157,
1298 87, 41, 40, 297, 298, 299, 19, 20, 21, 303,
1299 304, 37, 117, 53, 54, 37, 41, 111, 58, 110,
1300 249, 115, 62, 11, 12, 112, 112, 6, 53, 54,
1301 11, 6, 149, 58, 18, 19, 41, 62, 76, 54,
1302 19, 20, 21, 83, 19, 20, 21, 11, 169, 11,
1303 11, 12, 13, 17, 18, 11, 96, 314, 83, 115,
1304 24, 290, 356, 292, 169, 11, 12, 13, 83, 117,
1305 95, 96, 12, 26, 331, 37, 370, 8, 9, 10,
1306 11, 12, 13, 109, 15, 16, 282, 109, 64, 111,
1307 120, 117, 117, 91, 111, 117, 115, 137, 111, 295,
1308 278, 330, 274, 403, 117, 274, 401, 224, 225, 149,
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00001309 150, 228, 137, 282, 309, 409, 274, 157, 276, 277,
Lev Walkin0e90aa02013-03-19 16:17:13 -07001310 40, 52, 239, 111, 282, 91, 295, 152, 109, 82,
1311 170, 171, 157, 117, 329, 87, 117, 295, 117, 118,
1312 91, 108, 117, 96, 169, 170, 171, 109, 109, 46,
1313 114, 22, 49, 109, 121, 117, 76, 274, 110, 60,
1314 112, 466, 93, 109, 469, 111, 3, 284, 8, 9,
1315 10, 11, 12, 13, 14, 15, 16, 11, 9, 110,
1316 11, 87, 425, 17, 18, 410, 117, 113, 413, 8,
1317 9, 10, 11, 12, 13, 28, 15, 16, 17, 18,
1318 120, 46, 48, 243, 110, 76, 112, 18, 19, 80,
1319 17, 18, 52, 59, 11, 12, 13, 18, 11, 53,
1320 17, 18, 61, 248, 17, 18, 27, 67, 114, 40,
1321 111, 111, 349, 52, 274, 115, 276, 277, 114, 115,
1322 357, 281, 282, 401, 284, 3, 286, 48, 288, 50,
1323 111, 70, 277, 93, 115, 295, 110, 282, 59, 17,
1324 18, 114, 111, 111, 111, 76, 115, 115, 115, 110,
1325 295, 29, 30, 31, 93, 33, 111, 19, 20, 18,
1326 115, 17, 18, 19, 20, 43, 403, 117, 405, 47,
1327 111, 110, 120, 51, 106, 107, 54, 55, 56, 57,
1328 111, 36, 37, 343, 115, 88, 117, 65, 66, 104,
1329 105, 88, 70, 71, 72, 73, 74, 78, 358, 88,
1330 360, 19, 20, 81, 58, 83, 84, 17, 18, 3,
1331 19, 20, 90, 120, 92, 110, 440, 441, 110, 97,
1332 98, 99, 100, 101, 384, 3, 110, 110, 116, 116,
1333 12, 3, 110, 112, 394, 120, 118, 42, 110, 116,
1334 120, 401, 75, 403, 112, 112, 103, 407, 32, 115,
1335 111, 103, 112, 7, 11, 32, 401, 8, 9, 10,
1336 11, 12, 13, 14, 15, 16, 17, 18, 428, 110,
1337 113, 75, 75, 24, 95, 102, 110, 437, 108, 121,
1338 112, 110, 113, 111, 109, 445, 122, 38, 39, 449,
1339 8, 9, 10, 11, 12, 13, 14, 15, 16, 113,
1340 113, 52, 53, 8, 9, 10, 11, 12, 13, 14,
1341 15, 16, 17, 18, 7, 75, 111, 68, 119, 24,
1342 111, 113, 115, 113, 89, 121, 77, 115, 113, 110,
1343 4, 120, 130, 16, 52, 29, 87, 83, 62, 58,
1344 96, 148, 93, 158, 274, 169, 288, 52, 53, 67,
1345 407, 102, 437, 403, 228, 465, 285, 306, 109, 110,
1346 278, 112, 225, 68, 420, 317, 328, 225, 426, 325,
1347 445, 432, 77, 259, 428, 93, 276, 360, -1, -1,
1348 -1, -1, 87, -1, -1, 11, -1, -1, 93, -1,
1349 -1, 17, 18, -1, -1, -1, -1, 102, -1, -1,
1350 -1, -1, -1, -1, 30, -1, -1, 112, 8, 9,
1351 10, 11, 12, 13, 14, 15, 16, 17, 18, 45,
1352 -1, -1, -1, -1, -1, -1, -1, -1, -1, 55,
1353 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
1354 66, -1, -1, -1, -1, 71, -1, 73, -1, -1,
1355 -1, -1, 52, 53, -1, 81, -1, -1, -1, -1,
1356 -1, -1, -1, -1, 90, -1, 92, -1, 68, -1,
1357 -1, 97, -1, 99, 100, 101, -1, 77, -1, -1,
1358 -1, -1, -1, 17, 18, -1, -1, 87, -1, -1,
1359 -1, 25, -1, 93, -1, 29, 30, 31, -1, 33,
1360 34, -1, 102, -1, -1, -1, -1, -1, -1, 43,
1361 -1, -1, 112, 47, -1, -1, -1, 51, -1, -1,
1362 54, 55, 56, 57, -1, -1, -1, -1, -1, 63,
1363 -1, 65, 66, -1, -1, -1, 70, 71, 72, 73,
1364 74, -1, -1, -1, -1, -1, -1, 81, -1, 83,
1365 84, 85, 86, -1, -1, -1, 90, -1, 92, 17,
1366 18, -1, -1, 97, 98, 99, 100, 101, -1, -1,
1367 -1, 29, 30, 31, -1, 33, -1, -1, -1, -1,
1368 -1, -1, -1, -1, -1, 43, -1, -1, -1, 47,
1369 -1, -1, -1, 51, -1, -1, 54, 55, 56, 57,
1370 -1, -1, -1, -1, -1, -1, -1, 65, 66, -1,
1371 -1, -1, 70, 71, 72, 73, 74, -1, -1, -1,
1372 -1, -1, -1, 81, -1, 83, 84, -1, -1, -1,
1373 -1, -1, 90, -1, 92, -1, -1, -1, -1, 97,
1374 98, 99, 100, 101
Lev Walkin418298d2006-07-13 08:24:20 +00001375};
1376
1377/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1378 symbol of state STATE-NUM. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001379static const yytype_uint8 yystos[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001380{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001381 0, 17, 18, 124, 125, 126, 241, 0, 126, 127,
1382 110, 128, 129, 11, 12, 111, 130, 131, 244, 41,
1383 111, 131, 112, 18, 27, 48, 50, 59, 132, 133,
1384 134, 12, 64, 91, 91, 60, 91, 3, 134, 113,
1385 28, 49, 135, 136, 148, 149, 24, 114, 150, 151,
1386 241, 244, 46, 61, 140, 141, 114, 114, 115, 110,
1387 53, 142, 143, 145, 146, 147, 241, 244, 30, 45,
1388 55, 56, 57, 66, 71, 73, 81, 90, 92, 97,
1389 99, 100, 101, 137, 138, 153, 155, 185, 195, 241,
1390 244, 151, 111, 114, 145, 53, 115, 110, 18, 138,
1391 3, 17, 18, 29, 31, 33, 43, 47, 51, 54,
1392 65, 70, 72, 74, 83, 84, 98, 110, 154, 179,
1393 192, 193, 194, 195, 242, 117, 175, 236, 237, 238,
1394 241, 147, 111, 139, 35, 165, 175, 120, 88, 88,
1395 78, 58, 88, 156, 157, 192, 193, 241, 3, 110,
1396 110, 231, 120, 26, 82, 96, 239, 3, 176, 177,
1397 48, 59, 240, 129, 144, 110, 241, 244, 111, 115,
1398 116, 116, 110, 152, 8, 9, 10, 12, 13, 15,
1399 16, 52, 93, 152, 158, 159, 175, 188, 190, 234,
1400 244, 109, 111, 232, 233, 234, 244, 19, 20, 180,
1401 181, 182, 241, 12, 70, 110, 186, 188, 189, 241,
1402 244, 25, 34, 63, 85, 86, 154, 178, 87, 112,
1403 198, 199, 200, 201, 19, 20, 167, 168, 3, 157,
1404 241, 244, 241, 244, 8, 10, 14, 24, 38, 39,
1405 52, 53, 68, 77, 87, 93, 102, 109, 110, 112,
1406 190, 202, 203, 204, 205, 206, 207, 208, 209, 210,
1407 211, 212, 213, 218, 219, 221, 223, 224, 225, 234,
1408 235, 241, 244, 111, 115, 111, 115, 112, 120, 118,
1409 187, 120, 116, 42, 110, 75, 110, 198, 110, 198,
1410 112, 202, 112, 18, 19, 40, 76, 175, 183, 184,
1411 229, 230, 175, 183, 184, 111, 115, 165, 175, 103,
1412 32, 175, 108, 121, 222, 9, 244, 36, 37, 241,
1413 202, 111, 115, 106, 107, 196, 104, 105, 197, 103,
1414 112, 222, 110, 159, 233, 189, 234, 244, 181, 7,
1415 191, 244, 186, 32, 109, 163, 164, 174, 175, 244,
1416 179, 37, 160, 161, 162, 174, 175, 244, 75, 160,
1417 75, 202, 113, 202, 186, 229, 120, 229, 229, 95,
1418 166, 229, 229, 102, 169, 170, 168, 207, 110, 121,
1419 108, 67, 210, 201, 110, 111, 113, 109, 205, 206,
1420 207, 202, 67, 210, 122, 226, 227, 113, 113, 7,
1421 244, 119, 111, 115, 175, 75, 111, 115, 229, 175,
1422 243, 244, 111, 243, 113, 113, 19, 20, 229, 89,
1423 220, 121, 109, 214, 215, 244, 115, 113, 120, 228,
1424 244, 111, 115, 189, 234, 164, 175, 4, 162, 229,
1425 236, 236, 110, 191, 111, 115, 198, 203, 228, 120,
1426 227, 161, 177, 177, 171, 215, 22, 76, 80, 216,
1427 217, 244, 5, 6, 21, 117, 172, 173, 182, 172,
1428 111, 173, 118
Lev Walkin418298d2006-07-13 08:24:20 +00001429};
1430
Lev Walkinf15320b2004-06-03 03:38:44 +00001431#define yyerrok (yyerrstatus = 0)
1432#define yyclearin (yychar = YYEMPTY)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001433#define YYEMPTY (-2)
Lev Walkinf15320b2004-06-03 03:38:44 +00001434#define YYEOF 0
Lev Walkin418298d2006-07-13 08:24:20 +00001435
Lev Walkinf15320b2004-06-03 03:38:44 +00001436#define YYACCEPT goto yyacceptlab
Lev Walkin418298d2006-07-13 08:24:20 +00001437#define YYABORT goto yyabortlab
Lev Walkin0e90aa02013-03-19 16:17:13 -07001438#define YYERROR goto yyerrorlab
1439
Lev Walkin418298d2006-07-13 08:24:20 +00001440
1441/* Like YYERROR except do call yyerror. This remains here temporarily
1442 to ease the transition to the new meaning of YYERROR, for GCC.
Lev Walkinf15320b2004-06-03 03:38:44 +00001443 Once GCC version 2 has supplanted version 1, this can go. */
Lev Walkin418298d2006-07-13 08:24:20 +00001444
Lev Walkinf15320b2004-06-03 03:38:44 +00001445#define YYFAIL goto yyerrlab
Lev Walkin418298d2006-07-13 08:24:20 +00001446
Lev Walkinf15320b2004-06-03 03:38:44 +00001447#define YYRECOVERING() (!!yyerrstatus)
Lev Walkin418298d2006-07-13 08:24:20 +00001448
1449#define YYBACKUP(Token, Value) \
Lev Walkinf15320b2004-06-03 03:38:44 +00001450do \
1451 if (yychar == YYEMPTY && yylen == 1) \
Lev Walkin418298d2006-07-13 08:24:20 +00001452 { \
1453 yychar = (Token); \
1454 yylval = (Value); \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001455 yytoken = YYTRANSLATE (yychar); \
1456 YYPOPSTACK (1); \
Lev Walkinf15320b2004-06-03 03:38:44 +00001457 goto yybackup; \
1458 } \
1459 else \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001460 { \
1461 yyerror (YY_("syntax error: cannot back up")); \
Lev Walkin418298d2006-07-13 08:24:20 +00001462 YYERROR; \
1463 } \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001464while (YYID (0))
1465
Lev Walkinf15320b2004-06-03 03:38:44 +00001466
1467#define YYTERROR 1
1468#define YYERRCODE 256
1469
Lev Walkin418298d2006-07-13 08:24:20 +00001470
Lev Walkin0e90aa02013-03-19 16:17:13 -07001471/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1472 If N is 0, then set CURRENT to the empty location which ends
1473 the previous symbol: RHS[0] (always defined). */
1474
1475#define YYRHSLOC(Rhs, K) ((Rhs)[K])
Lev Walkin418298d2006-07-13 08:24:20 +00001476#ifndef YYLLOC_DEFAULT
Lev Walkin0e90aa02013-03-19 16:17:13 -07001477# define YYLLOC_DEFAULT(Current, Rhs, N) \
1478 do \
1479 if (YYID (N)) \
1480 { \
1481 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1482 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1483 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1484 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1485 } \
1486 else \
1487 { \
1488 (Current).first_line = (Current).last_line = \
1489 YYRHSLOC (Rhs, 0).last_line; \
1490 (Current).first_column = (Current).last_column = \
1491 YYRHSLOC (Rhs, 0).last_column; \
1492 } \
1493 while (YYID (0))
Lev Walkinf15320b2004-06-03 03:38:44 +00001494#endif
1495
Lev Walkin0e90aa02013-03-19 16:17:13 -07001496
1497/* YY_LOCATION_PRINT -- Print the location on the stream.
1498 This macro was not mandated originally: define only if we know
1499 we won't break user code: when these are the locations we know. */
1500
1501#ifndef YY_LOCATION_PRINT
1502# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1503# define YY_LOCATION_PRINT(File, Loc) \
1504 fprintf (File, "%d.%d-%d.%d", \
1505 (Loc).first_line, (Loc).first_column, \
1506 (Loc).last_line, (Loc).last_column)
1507# else
1508# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1509# endif
1510#endif
1511
1512
Lev Walkin418298d2006-07-13 08:24:20 +00001513/* YYLEX -- calling `yylex' with the right arguments. */
Lev Walkinfb872bd2006-03-18 06:53:11 +00001514
Lev Walkin0e90aa02013-03-19 16:17:13 -07001515#ifdef YYLEX_PARAM
1516# define YYLEX yylex (YYLEX_PARAM)
1517#else
1518# define YYLEX yylex ()
1519#endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00001520
Lev Walkin418298d2006-07-13 08:24:20 +00001521/* Enable debugging if requested. */
1522#if YYDEBUG
Lev Walkinfb872bd2006-03-18 06:53:11 +00001523
Lev Walkin418298d2006-07-13 08:24:20 +00001524# ifndef YYFPRINTF
1525# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1526# define YYFPRINTF fprintf
1527# endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00001528
Lev Walkin418298d2006-07-13 08:24:20 +00001529# define YYDPRINTF(Args) \
1530do { \
1531 if (yydebug) \
1532 YYFPRINTF Args; \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001533} while (YYID (0))
1534
1535# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1536do { \
1537 if (yydebug) \
1538 { \
1539 YYFPRINTF (stderr, "%s ", Title); \
1540 yy_symbol_print (stderr, \
1541 Type, Value); \
1542 YYFPRINTF (stderr, "\n"); \
1543 } \
1544} while (YYID (0))
1545
1546
1547/*--------------------------------.
1548| Print this symbol on YYOUTPUT. |
1549`--------------------------------*/
1550
1551/*ARGSUSED*/
1552#if (defined __STDC__ || defined __C99__FUNC__ \
1553 || defined __cplusplus || defined _MSC_VER)
1554static void
1555yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1556#else
1557static void
1558yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1559 FILE *yyoutput;
1560 int yytype;
1561 YYSTYPE const * const yyvaluep;
1562#endif
1563{
1564 if (!yyvaluep)
1565 return;
1566# ifdef YYPRINT
1567 if (yytype < YYNTOKENS)
1568 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1569# else
1570 YYUSE (yyoutput);
1571# endif
1572 switch (yytype)
1573 {
1574 default:
1575 break;
1576 }
1577}
1578
1579
1580/*--------------------------------.
1581| Print this symbol on YYOUTPUT. |
1582`--------------------------------*/
1583
1584#if (defined __STDC__ || defined __C99__FUNC__ \
1585 || defined __cplusplus || defined _MSC_VER)
1586static void
1587yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1588#else
1589static void
1590yy_symbol_print (yyoutput, yytype, yyvaluep)
1591 FILE *yyoutput;
1592 int yytype;
1593 YYSTYPE const * const yyvaluep;
1594#endif
1595{
1596 if (yytype < YYNTOKENS)
1597 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1598 else
1599 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1600
1601 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1602 YYFPRINTF (yyoutput, ")");
1603}
1604
1605/*------------------------------------------------------------------.
1606| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1607| TOP (included). |
1608`------------------------------------------------------------------*/
1609
1610#if (defined __STDC__ || defined __C99__FUNC__ \
1611 || defined __cplusplus || defined _MSC_VER)
1612static void
1613yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1614#else
1615static void
1616yy_stack_print (bottom, top)
1617 yytype_int16 *bottom;
1618 yytype_int16 *top;
1619#endif
1620{
1621 YYFPRINTF (stderr, "Stack now");
1622 for (; bottom <= top; ++bottom)
1623 YYFPRINTF (stderr, " %d", *bottom);
1624 YYFPRINTF (stderr, "\n");
1625}
1626
1627# define YY_STACK_PRINT(Bottom, Top) \
1628do { \
1629 if (yydebug) \
1630 yy_stack_print ((Bottom), (Top)); \
1631} while (YYID (0))
1632
1633
1634/*------------------------------------------------.
1635| Report that the YYRULE is going to be reduced. |
1636`------------------------------------------------*/
1637
1638#if (defined __STDC__ || defined __C99__FUNC__ \
1639 || defined __cplusplus || defined _MSC_VER)
1640static void
1641yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1642#else
1643static void
1644yy_reduce_print (yyvsp, yyrule)
1645 YYSTYPE *yyvsp;
1646 int yyrule;
1647#endif
1648{
1649 int yynrhs = yyr2[yyrule];
1650 int yyi;
1651 unsigned long int yylno = yyrline[yyrule];
1652 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1653 yyrule - 1, yylno);
1654 /* The symbols being reduced. */
1655 for (yyi = 0; yyi < yynrhs; yyi++)
1656 {
1657 fprintf (stderr, " $%d = ", yyi + 1);
1658 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1659 &(yyvsp[(yyi + 1) - (yynrhs)])
1660 );
1661 fprintf (stderr, "\n");
1662 }
1663}
1664
1665# define YY_REDUCE_PRINT(Rule) \
1666do { \
1667 if (yydebug) \
1668 yy_reduce_print (yyvsp, Rule); \
1669} while (YYID (0))
1670
Lev Walkin418298d2006-07-13 08:24:20 +00001671/* Nonzero means print parse trace. It is left uninitialized so that
1672 multiple parsers can coexist. */
1673int yydebug;
1674#else /* !YYDEBUG */
1675# define YYDPRINTF(Args)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001676# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1677# define YY_STACK_PRINT(Bottom, Top)
1678# define YY_REDUCE_PRINT(Rule)
Lev Walkin418298d2006-07-13 08:24:20 +00001679#endif /* !YYDEBUG */
Lev Walkinfb872bd2006-03-18 06:53:11 +00001680
Lev Walkin0e90aa02013-03-19 16:17:13 -07001681
Lev Walkin418298d2006-07-13 08:24:20 +00001682/* YYINITDEPTH -- initial size of the parser's stacks. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001683#ifndef YYINITDEPTH
Lev Walkin418298d2006-07-13 08:24:20 +00001684# define YYINITDEPTH 200
Lev Walkinf15320b2004-06-03 03:38:44 +00001685#endif
1686
Lev Walkin418298d2006-07-13 08:24:20 +00001687/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1688 if the built-in stack extension method is used).
1689
1690 Do not make this value too large; the results are undefined if
Lev Walkin0e90aa02013-03-19 16:17:13 -07001691 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Lev Walkin418298d2006-07-13 08:24:20 +00001692 evaluated with infinite-precision integer arithmetic. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001693
Lev Walkinf15320b2004-06-03 03:38:44 +00001694#ifndef YYMAXDEPTH
Lev Walkin418298d2006-07-13 08:24:20 +00001695# define YYMAXDEPTH 10000
Lev Walkinf15320b2004-06-03 03:38:44 +00001696#endif
Lev Walkin418298d2006-07-13 08:24:20 +00001697
Lev Walkinf15320b2004-06-03 03:38:44 +00001698
Lev Walkinf15320b2004-06-03 03:38:44 +00001699
Lev Walkin418298d2006-07-13 08:24:20 +00001700#if YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +00001701
Lev Walkin418298d2006-07-13 08:24:20 +00001702# ifndef yystrlen
Lev Walkin0e90aa02013-03-19 16:17:13 -07001703# if defined __GLIBC__ && defined _STRING_H
Lev Walkin418298d2006-07-13 08:24:20 +00001704# define yystrlen strlen
1705# else
1706/* Return the length of YYSTR. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001707#if (defined __STDC__ || defined __C99__FUNC__ \
1708 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001709static YYSIZE_T
Lev Walkin418298d2006-07-13 08:24:20 +00001710yystrlen (const char *yystr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001711#else
1712static YYSIZE_T
Lev Walkin418298d2006-07-13 08:24:20 +00001713yystrlen (yystr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001714 const char *yystr;
1715#endif
Lev Walkina00d6b32006-03-21 03:40:38 +00001716{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001717 YYSIZE_T yylen;
1718 for (yylen = 0; yystr[yylen]; yylen++)
Lev Walkin418298d2006-07-13 08:24:20 +00001719 continue;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001720 return yylen;
Lev Walkin418298d2006-07-13 08:24:20 +00001721}
1722# endif
1723# endif
1724
1725# ifndef yystpcpy
Lev Walkin0e90aa02013-03-19 16:17:13 -07001726# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Lev Walkin418298d2006-07-13 08:24:20 +00001727# define yystpcpy stpcpy
1728# else
1729/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1730 YYDEST. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001731#if (defined __STDC__ || defined __C99__FUNC__ \
1732 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001733static char *
Lev Walkin418298d2006-07-13 08:24:20 +00001734yystpcpy (char *yydest, const char *yysrc)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001735#else
1736static char *
Lev Walkin418298d2006-07-13 08:24:20 +00001737yystpcpy (yydest, yysrc)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001738 char *yydest;
1739 const char *yysrc;
1740#endif
Lev Walkin418298d2006-07-13 08:24:20 +00001741{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001742 char *yyd = yydest;
1743 const char *yys = yysrc;
Lev Walkin418298d2006-07-13 08:24:20 +00001744
1745 while ((*yyd++ = *yys++) != '\0')
1746 continue;
1747
1748 return yyd - 1;
1749}
1750# endif
1751# endif
1752
Lev Walkin0e90aa02013-03-19 16:17:13 -07001753# ifndef yytnamerr
1754/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1755 quotes and backslashes, so that it's suitable for yyerror. The
1756 heuristic is that double-quoting is unnecessary unless the string
1757 contains an apostrophe, a comma, or backslash (other than
1758 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1759 null, do not copy; instead, return the length of what the result
1760 would have been. */
1761static YYSIZE_T
1762yytnamerr (char *yyres, const char *yystr)
Lev Walkin418298d2006-07-13 08:24:20 +00001763{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001764 if (*yystr == '"')
Lev Walkin418298d2006-07-13 08:24:20 +00001765 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07001766 YYSIZE_T yyn = 0;
1767 char const *yyp = yystr;
Lev Walkin418298d2006-07-13 08:24:20 +00001768
Lev Walkin0e90aa02013-03-19 16:17:13 -07001769 for (;;)
1770 switch (*++yyp)
1771 {
1772 case '\'':
1773 case ',':
1774 goto do_not_strip_quotes;
1775
1776 case '\\':
1777 if (*++yyp != '\\')
1778 goto do_not_strip_quotes;
1779 /* Fall through. */
1780 default:
1781 if (yyres)
1782 yyres[yyn] = *yyp;
1783 yyn++;
1784 break;
1785
1786 case '"':
1787 if (yyres)
1788 yyres[yyn] = '\0';
1789 return yyn;
1790 }
1791 do_not_strip_quotes: ;
Lev Walkin418298d2006-07-13 08:24:20 +00001792 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07001793
1794 if (! yyres)
1795 return yystrlen (yystr);
1796
1797 return yystpcpy (yyres, yystr) - yyres;
Lev Walkin418298d2006-07-13 08:24:20 +00001798}
Lev Walkin0e90aa02013-03-19 16:17:13 -07001799# endif
Lev Walkin418298d2006-07-13 08:24:20 +00001800
Lev Walkin0e90aa02013-03-19 16:17:13 -07001801/* Copy into YYRESULT an error message about the unexpected token
1802 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1803 including the terminating null byte. If YYRESULT is null, do not
1804 copy anything; just return the number of bytes that would be
1805 copied. As a special case, return 0 if an ordinary "syntax error"
1806 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1807 size calculation. */
1808static YYSIZE_T
1809yysyntax_error (char *yyresult, int yystate, int yychar)
1810{
1811 int yyn = yypact[yystate];
1812
1813 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1814 return 0;
1815 else
1816 {
1817 int yytype = YYTRANSLATE (yychar);
1818 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1819 YYSIZE_T yysize = yysize0;
1820 YYSIZE_T yysize1;
1821 int yysize_overflow = 0;
1822 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1823 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1824 int yyx;
1825
1826# if 0
1827 /* This is so xgettext sees the translatable formats that are
1828 constructed on the fly. */
1829 YY_("syntax error, unexpected %s");
1830 YY_("syntax error, unexpected %s, expecting %s");
1831 YY_("syntax error, unexpected %s, expecting %s or %s");
1832 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1833 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1834# endif
1835 char *yyfmt;
1836 char const *yyf;
1837 static char const yyunexpected[] = "syntax error, unexpected %s";
1838 static char const yyexpecting[] = ", expecting %s";
1839 static char const yyor[] = " or %s";
1840 char yyformat[sizeof yyunexpected
1841 + sizeof yyexpecting - 1
1842 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1843 * (sizeof yyor - 1))];
1844 char const *yyprefix = yyexpecting;
1845
1846 /* Start YYX at -YYN if negative to avoid negative indexes in
1847 YYCHECK. */
1848 int yyxbegin = yyn < 0 ? -yyn : 0;
1849
1850 /* Stay within bounds of both yycheck and yytname. */
1851 int yychecklim = YYLAST - yyn + 1;
1852 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1853 int yycount = 1;
1854
1855 yyarg[0] = yytname[yytype];
1856 yyfmt = yystpcpy (yyformat, yyunexpected);
1857
1858 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1859 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1860 {
1861 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1862 {
1863 yycount = 1;
1864 yysize = yysize0;
1865 yyformat[sizeof yyunexpected - 1] = '\0';
1866 break;
1867 }
1868 yyarg[yycount++] = yytname[yyx];
1869 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1870 yysize_overflow |= (yysize1 < yysize);
1871 yysize = yysize1;
1872 yyfmt = yystpcpy (yyfmt, yyprefix);
1873 yyprefix = yyor;
1874 }
1875
1876 yyf = YY_(yyformat);
1877 yysize1 = yysize + yystrlen (yyf);
1878 yysize_overflow |= (yysize1 < yysize);
1879 yysize = yysize1;
1880
1881 if (yysize_overflow)
1882 return YYSIZE_MAXIMUM;
1883
1884 if (yyresult)
1885 {
1886 /* Avoid sprintf, as that infringes on the user's name space.
1887 Don't have undefined behavior even if the translation
1888 produced a string with the wrong number of "%s"s. */
1889 char *yyp = yyresult;
1890 int yyi = 0;
1891 while ((*yyp = *yyf) != '\0')
1892 {
1893 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1894 {
1895 yyp += yytnamerr (yyp, yyarg[yyi++]);
1896 yyf += 2;
1897 }
1898 else
1899 {
1900 yyp++;
1901 yyf++;
1902 }
1903 }
1904 }
1905 return yysize;
1906 }
1907}
1908#endif /* YYERROR_VERBOSE */
1909
Lev Walkin418298d2006-07-13 08:24:20 +00001910
1911/*-----------------------------------------------.
1912| Release the memory associated to this symbol. |
1913`-----------------------------------------------*/
1914
Lev Walkin0e90aa02013-03-19 16:17:13 -07001915/*ARGSUSED*/
1916#if (defined __STDC__ || defined __C99__FUNC__ \
1917 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001918static void
Lev Walkin0e90aa02013-03-19 16:17:13 -07001919yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Lev Walkin418298d2006-07-13 08:24:20 +00001920#else
Lev Walkin0e90aa02013-03-19 16:17:13 -07001921static void
1922yydestruct (yymsg, yytype, yyvaluep)
1923 const char *yymsg;
Lev Walkin418298d2006-07-13 08:24:20 +00001924 int yytype;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001925 YYSTYPE *yyvaluep;
Lev Walkin418298d2006-07-13 08:24:20 +00001926#endif
1927{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001928 YYUSE (yyvaluep);
1929
1930 if (!yymsg)
1931 yymsg = "Deleting";
1932 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
Lev Walkin418298d2006-07-13 08:24:20 +00001933
1934 switch (yytype)
1935 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07001936
Lev Walkin418298d2006-07-13 08:24:20 +00001937 default:
Lev Walkin0e90aa02013-03-19 16:17:13 -07001938 break;
Lev Walkin418298d2006-07-13 08:24:20 +00001939 }
Lev Walkina00d6b32006-03-21 03:40:38 +00001940}
Lev Walkinfb872bd2006-03-18 06:53:11 +00001941
1942
Lev Walkin0e90aa02013-03-19 16:17:13 -07001943/* Prevent warnings from -Wmissing-prototypes. */
Lev Walkinfb872bd2006-03-18 06:53:11 +00001944
1945#ifdef YYPARSE_PARAM
Lev Walkin0e90aa02013-03-19 16:17:13 -07001946#if defined __STDC__ || defined __cplusplus
1947int yyparse (void *YYPARSE_PARAM);
1948#else
1949int yyparse ();
Lev Walkinfb872bd2006-03-18 06:53:11 +00001950#endif
Lev Walkin0e90aa02013-03-19 16:17:13 -07001951#else /* ! YYPARSE_PARAM */
1952#if defined __STDC__ || defined __cplusplus
1953int yyparse (void);
1954#else
1955int yyparse ();
1956#endif
1957#endif /* ! YYPARSE_PARAM */
Lev Walkin418298d2006-07-13 08:24:20 +00001958
1959
Lev Walkin0e90aa02013-03-19 16:17:13 -07001960
1961/* The look-ahead symbol. */
Lev Walkin418298d2006-07-13 08:24:20 +00001962int yychar;
1963
Lev Walkin0e90aa02013-03-19 16:17:13 -07001964/* The semantic value of the look-ahead symbol. */
Lev Walkin418298d2006-07-13 08:24:20 +00001965YYSTYPE yylval;
1966
Lev Walkin0e90aa02013-03-19 16:17:13 -07001967/* Number of syntax errors so far. */
Lev Walkin418298d2006-07-13 08:24:20 +00001968int yynerrs;
1969
Lev Walkinfb872bd2006-03-18 06:53:11 +00001970
Lev Walkin0e90aa02013-03-19 16:17:13 -07001971
1972/*----------.
1973| yyparse. |
1974`----------*/
1975
1976#ifdef YYPARSE_PARAM
1977#if (defined __STDC__ || defined __C99__FUNC__ \
1978 || defined __cplusplus || defined _MSC_VER)
Lev Walkinfb872bd2006-03-18 06:53:11 +00001979int
Lev Walkin0e90aa02013-03-19 16:17:13 -07001980yyparse (void *YYPARSE_PARAM)
1981#else
1982int
1983yyparse (YYPARSE_PARAM)
1984 void *YYPARSE_PARAM;
1985#endif
1986#else /* ! YYPARSE_PARAM */
1987#if (defined __STDC__ || defined __C99__FUNC__ \
1988 || defined __cplusplus || defined _MSC_VER)
1989int
1990yyparse (void)
1991#else
1992int
1993yyparse ()
1994
1995#endif
1996#endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00001997{
Lev Walkin418298d2006-07-13 08:24:20 +00001998
Lev Walkin0e90aa02013-03-19 16:17:13 -07001999 int yystate;
2000 int yyn;
Lev Walkin418298d2006-07-13 08:24:20 +00002001 int yyresult;
2002 /* Number of tokens to shift before error messages enabled. */
2003 int yyerrstatus;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002004 /* Look-ahead token as an internal (translated) token number. */
2005 int yytoken = 0;
2006#if YYERROR_VERBOSE
2007 /* Buffer for error messages, and its allocated size. */
2008 char yymsgbuf[128];
2009 char *yymsg = yymsgbuf;
2010 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2011#endif
Lev Walkin418298d2006-07-13 08:24:20 +00002012
2013 /* Three stacks and their tools:
2014 `yyss': related to states,
2015 `yyvs': related to semantic values,
2016 `yyls': related to locations.
2017
2018 Refer to the stacks thru separate pointers, to allow yyoverflow
2019 to reallocate them elsewhere. */
2020
2021 /* The state stack. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002022 yytype_int16 yyssa[YYINITDEPTH];
2023 yytype_int16 *yyss = yyssa;
2024 yytype_int16 *yyssp;
Lev Walkin418298d2006-07-13 08:24:20 +00002025
2026 /* The semantic value stack. */
2027 YYSTYPE yyvsa[YYINITDEPTH];
2028 YYSTYPE *yyvs = yyvsa;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002029 YYSTYPE *yyvsp;
Lev Walkinfb872bd2006-03-18 06:53:11 +00002030
Lev Walkinfb872bd2006-03-18 06:53:11 +00002031
Lev Walkinfb872bd2006-03-18 06:53:11 +00002032
Lev Walkin0e90aa02013-03-19 16:17:13 -07002033#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
Lev Walkinf15320b2004-06-03 03:38:44 +00002034
Lev Walkin418298d2006-07-13 08:24:20 +00002035 YYSIZE_T yystacksize = YYINITDEPTH;
Lev Walkinf15320b2004-06-03 03:38:44 +00002036
Lev Walkin418298d2006-07-13 08:24:20 +00002037 /* The variables used to return semantic value and location from the
2038 action routines. */
2039 YYSTYPE yyval;
Lev Walkinf15320b2004-06-03 03:38:44 +00002040
Lev Walkinf15320b2004-06-03 03:38:44 +00002041
Lev Walkin0e90aa02013-03-19 16:17:13 -07002042 /* The number of symbols on the RHS of the reduced rule.
2043 Keep to zero when no symbol should be popped. */
2044 int yylen = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00002045
Lev Walkin418298d2006-07-13 08:24:20 +00002046 YYDPRINTF ((stderr, "Starting parse\n"));
Lev Walkinf15320b2004-06-03 03:38:44 +00002047
2048 yystate = 0;
2049 yyerrstatus = 0;
2050 yynerrs = 0;
2051 yychar = YYEMPTY; /* Cause a token to be read. */
2052
2053 /* Initialize stack pointers.
2054 Waste one element of value and location stack
2055 so that they stay on the same level as the state stack.
2056 The wasted elements are never initialized. */
2057
Lev Walkin418298d2006-07-13 08:24:20 +00002058 yyssp = yyss;
Lev Walkinf15320b2004-06-03 03:38:44 +00002059 yyvsp = yyvs;
Lev Walkinf15320b2004-06-03 03:38:44 +00002060
Lev Walkin418298d2006-07-13 08:24:20 +00002061 goto yysetstate;
Lev Walkinf15320b2004-06-03 03:38:44 +00002062
Lev Walkin418298d2006-07-13 08:24:20 +00002063/*------------------------------------------------------------.
2064| yynewstate -- Push a new state, which is found in yystate. |
2065`------------------------------------------------------------*/
2066 yynewstate:
2067 /* In all cases, when you get here, the value and location stacks
Lev Walkin0e90aa02013-03-19 16:17:13 -07002068 have just been pushed. So pushing a state here evens the stacks. */
Lev Walkin418298d2006-07-13 08:24:20 +00002069 yyssp++;
2070
2071 yysetstate:
2072 *yyssp = yystate;
Lev Walkinf15320b2004-06-03 03:38:44 +00002073
Lev Walkin0e90aa02013-03-19 16:17:13 -07002074 if (yyss + yystacksize - 1 <= yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00002075 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002076 /* Get the current used size of the three stacks, in elements. */
Lev Walkin418298d2006-07-13 08:24:20 +00002077 YYSIZE_T yysize = yyssp - yyss + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00002078
2079#ifdef yyoverflow
Lev Walkin418298d2006-07-13 08:24:20 +00002080 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002081 /* Give user a chance to reallocate the stack. Use copies of
Lev Walkin418298d2006-07-13 08:24:20 +00002082 these so that the &'s don't force the real ones into
2083 memory. */
2084 YYSTYPE *yyvs1 = yyvs;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002085 yytype_int16 *yyss1 = yyss;
Lev Walkinf15320b2004-06-03 03:38:44 +00002086
Lev Walkin418298d2006-07-13 08:24:20 +00002087
2088 /* Each stack pointer address is followed by the size of the
2089 data in use in that stack, in bytes. This used to be a
2090 conditional around just the two extra args, but that might
2091 be undefined if yyoverflow is a macro. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002092 yyoverflow (YY_("memory exhausted"),
Lev Walkin418298d2006-07-13 08:24:20 +00002093 &yyss1, yysize * sizeof (*yyssp),
2094 &yyvs1, yysize * sizeof (*yyvsp),
2095
2096 &yystacksize);
2097
2098 yyss = yyss1;
2099 yyvs = yyvs1;
2100 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002101#else /* no yyoverflow */
Lev Walkin418298d2006-07-13 08:24:20 +00002102# ifndef YYSTACK_RELOCATE
Lev Walkin0e90aa02013-03-19 16:17:13 -07002103 goto yyexhaustedlab;
Lev Walkin418298d2006-07-13 08:24:20 +00002104# else
Lev Walkinf15320b2004-06-03 03:38:44 +00002105 /* Extend the stack our own way. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002106 if (YYMAXDEPTH <= yystacksize)
2107 goto yyexhaustedlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00002108 yystacksize *= 2;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002109 if (YYMAXDEPTH < yystacksize)
Lev Walkinf15320b2004-06-03 03:38:44 +00002110 yystacksize = YYMAXDEPTH;
Lev Walkin418298d2006-07-13 08:24:20 +00002111
2112 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002113 yytype_int16 *yyss1 = yyss;
Lev Walkin418298d2006-07-13 08:24:20 +00002114 union yyalloc *yyptr =
2115 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2116 if (! yyptr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07002117 goto yyexhaustedlab;
Lev Walkin418298d2006-07-13 08:24:20 +00002118 YYSTACK_RELOCATE (yyss);
2119 YYSTACK_RELOCATE (yyvs);
2120
2121# undef YYSTACK_RELOCATE
2122 if (yyss1 != yyssa)
2123 YYSTACK_FREE (yyss1);
2124 }
2125# endif
Lev Walkinf15320b2004-06-03 03:38:44 +00002126#endif /* no yyoverflow */
2127
Lev Walkin418298d2006-07-13 08:24:20 +00002128 yyssp = yyss + yysize - 1;
2129 yyvsp = yyvs + yysize - 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00002130
Lev Walkin418298d2006-07-13 08:24:20 +00002131
2132 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2133 (unsigned long int) yystacksize));
Lev Walkinf15320b2004-06-03 03:38:44 +00002134
Lev Walkin0e90aa02013-03-19 16:17:13 -07002135 if (yyss + yystacksize - 1 <= yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00002136 YYABORT;
2137 }
2138
Lev Walkin418298d2006-07-13 08:24:20 +00002139 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Lev Walkinf15320b2004-06-03 03:38:44 +00002140
2141 goto yybackup;
Lev Walkin418298d2006-07-13 08:24:20 +00002142
2143/*-----------.
2144| yybackup. |
2145`-----------*/
2146yybackup:
Lev Walkinf15320b2004-06-03 03:38:44 +00002147
Lev Walkin0e90aa02013-03-19 16:17:13 -07002148 /* Do appropriate processing given the current state. Read a
2149 look-ahead token if we need one and don't already have one. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002150
Lev Walkin0e90aa02013-03-19 16:17:13 -07002151 /* First try to decide what to do without reference to look-ahead token. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002152 yyn = yypact[yystate];
Lev Walkin418298d2006-07-13 08:24:20 +00002153 if (yyn == YYPACT_NINF)
Lev Walkinf15320b2004-06-03 03:38:44 +00002154 goto yydefault;
2155
Lev Walkin0e90aa02013-03-19 16:17:13 -07002156 /* Not known => get a look-ahead token if don't already have one. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002157
Lev Walkin0e90aa02013-03-19 16:17:13 -07002158 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002159 if (yychar == YYEMPTY)
2160 {
Lev Walkin418298d2006-07-13 08:24:20 +00002161 YYDPRINTF ((stderr, "Reading a token: "));
Lev Walkinf15320b2004-06-03 03:38:44 +00002162 yychar = YYLEX;
2163 }
2164
Lev Walkin0e90aa02013-03-19 16:17:13 -07002165 if (yychar <= YYEOF)
Lev Walkinf15320b2004-06-03 03:38:44 +00002166 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002167 yychar = yytoken = YYEOF;
Lev Walkin418298d2006-07-13 08:24:20 +00002168 YYDPRINTF ((stderr, "Now at end of input.\n"));
Lev Walkinf15320b2004-06-03 03:38:44 +00002169 }
2170 else
2171 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002172 yytoken = YYTRANSLATE (yychar);
2173 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Lev Walkinf15320b2004-06-03 03:38:44 +00002174 }
2175
Lev Walkin0e90aa02013-03-19 16:17:13 -07002176 /* If the proper action on seeing token YYTOKEN is to reduce or to
Lev Walkin418298d2006-07-13 08:24:20 +00002177 detect an error, take that action. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002178 yyn += yytoken;
2179 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Lev Walkinf15320b2004-06-03 03:38:44 +00002180 goto yydefault;
Lev Walkinf15320b2004-06-03 03:38:44 +00002181 yyn = yytable[yyn];
Lev Walkin418298d2006-07-13 08:24:20 +00002182 if (yyn <= 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00002183 {
Lev Walkin418298d2006-07-13 08:24:20 +00002184 if (yyn == 0 || yyn == YYTABLE_NINF)
Lev Walkinf15320b2004-06-03 03:38:44 +00002185 goto yyerrlab;
2186 yyn = -yyn;
2187 goto yyreduce;
2188 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002189
2190 if (yyn == YYFINAL)
2191 YYACCEPT;
2192
Lev Walkin418298d2006-07-13 08:24:20 +00002193 /* Count tokens shifted since error; after three, turn off error
2194 status. */
2195 if (yyerrstatus)
2196 yyerrstatus--;
Lev Walkinf15320b2004-06-03 03:38:44 +00002197
Lev Walkin0e90aa02013-03-19 16:17:13 -07002198 /* Shift the look-ahead token. */
2199 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2200
2201 /* Discard the shifted token unless it is eof. */
2202 if (yychar != YYEOF)
2203 yychar = YYEMPTY;
2204
Lev Walkinf15320b2004-06-03 03:38:44 +00002205 yystate = yyn;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002206 *++yyvsp = yylval;
2207
Lev Walkinf15320b2004-06-03 03:38:44 +00002208 goto yynewstate;
2209
Lev Walkina00d6b32006-03-21 03:40:38 +00002210
Lev Walkin418298d2006-07-13 08:24:20 +00002211/*-----------------------------------------------------------.
2212| yydefault -- do the default action for the current state. |
2213`-----------------------------------------------------------*/
2214yydefault:
Lev Walkinf15320b2004-06-03 03:38:44 +00002215 yyn = yydefact[yystate];
2216 if (yyn == 0)
2217 goto yyerrlab;
Lev Walkin418298d2006-07-13 08:24:20 +00002218 goto yyreduce;
Lev Walkinf15320b2004-06-03 03:38:44 +00002219
Lev Walkin418298d2006-07-13 08:24:20 +00002220
2221/*-----------------------------.
2222| yyreduce -- Do a reduction. |
2223`-----------------------------*/
Lev Walkinf15320b2004-06-03 03:38:44 +00002224yyreduce:
Lev Walkin418298d2006-07-13 08:24:20 +00002225 /* yyn is the number of a rule to reduce with. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002226 yylen = yyr2[yyn];
Lev Walkinf15320b2004-06-03 03:38:44 +00002227
Lev Walkin418298d2006-07-13 08:24:20 +00002228 /* If YYLEN is nonzero, implement the default value of the action:
2229 `$$ = $1'.
2230
2231 Otherwise, the following line sets YYVAL to garbage.
2232 This behavior is undocumented and Bison
2233 users should not rely upon it. Assigning to YYVAL
2234 unconditionally makes the parser a bit smaller, and it avoids a
2235 GCC warning that YYVAL may be used uninitialized. */
2236 yyval = yyvsp[1-yylen];
2237
2238
Lev Walkin0e90aa02013-03-19 16:17:13 -07002239 YY_REDUCE_PRINT (yyn);
Lev Walkin418298d2006-07-13 08:24:20 +00002240 switch (yyn)
2241 {
2242 case 2:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002243#line 357 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002244 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002245 *(void **)param = (yyvsp[(1) - (1)].a_grammar);
Lev Walkin418298d2006-07-13 08:24:20 +00002246 }
2247 break;
2248
2249 case 3:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002250#line 363 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002251 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002252 (yyval.a_grammar) = asn1p_new();
2253 checkmem((yyval.a_grammar));
2254 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(1) - (1)].a_module), mod_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002255 }
2256 break;
2257
2258 case 4:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002259#line 368 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002260 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002261 (yyval.a_grammar) = (yyvsp[(1) - (2)].a_grammar);
2262 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(2) - (2)].a_module), mod_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002263 }
2264 break;
2265
2266 case 5:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002267#line 385 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002268 { currentModule = asn1p_module_new(); }
2269 break;
2270
2271 case 6:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002272#line 390 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002273 {
Lev Walkinfb872bd2006-03-18 06:53:11 +00002274
Lev Walkin0e90aa02013-03-19 16:17:13 -07002275 (yyval.a_module) = currentModule;
Lev Walkina9532f42006-09-17 04:52:50 +00002276
Lev Walkin0e90aa02013-03-19 16:17:13 -07002277 if((yyvsp[(8) - (9)].a_module)) {
2278 asn1p_module_t tmp = *((yyval.a_module));
2279 *((yyval.a_module)) = *((yyvsp[(8) - (9)].a_module));
2280 *((yyvsp[(8) - (9)].a_module)) = tmp;
2281 asn1p_module_free((yyvsp[(8) - (9)].a_module));
Lev Walkinf15320b2004-06-03 03:38:44 +00002282 } else {
2283 /* There's a chance that a module is just plain empty */
Lev Walkinf15320b2004-06-03 03:38:44 +00002284 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002285
Lev Walkin0e90aa02013-03-19 16:17:13 -07002286 (yyval.a_module)->ModuleName = (yyvsp[(1) - (9)].tv_str);
2287 (yyval.a_module)->module_oid = (yyvsp[(3) - (9)].a_oid);
2288 (yyval.a_module)->module_flags = (yyvsp[(5) - (9)].a_module_flags);
Lev Walkin418298d2006-07-13 08:24:20 +00002289 }
2290 break;
2291
Lev Walkina9532f42006-09-17 04:52:50 +00002292 case 7:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002293#line 414 "asn1p_y.y"
2294 { (yyval.a_oid) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00002295 break;
2296
Lev Walkina9532f42006-09-17 04:52:50 +00002297 case 8:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002298#line 415 "asn1p_y.y"
2299 { (yyval.a_oid) = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin418298d2006-07-13 08:24:20 +00002300 break;
2301
Lev Walkina9532f42006-09-17 04:52:50 +00002302 case 9:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002303#line 419 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002304 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002305 (yyval.a_oid) = (yyvsp[(2) - (3)].a_oid);
Lev Walkin418298d2006-07-13 08:24:20 +00002306 }
2307 break;
2308
Lev Walkina9532f42006-09-17 04:52:50 +00002309 case 10:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002310#line 422 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002311 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002312 (yyval.a_oid) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002313 }
2314 break;
2315
Lev Walkina9532f42006-09-17 04:52:50 +00002316 case 11:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002317#line 428 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002318 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002319 (yyval.a_oid) = asn1p_oid_new();
2320 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(1) - (1)].a_oid_arc));
Lev Walkina964e032017-03-26 03:48:06 -07002321 if((yyvsp[(1) - (1)].a_oid_arc).name)
2322 free((yyvsp[(1) - (1)].a_oid_arc).name);
Lev Walkin418298d2006-07-13 08:24:20 +00002323 }
2324 break;
2325
Lev Walkina9532f42006-09-17 04:52:50 +00002326 case 12:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002327#line 434 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002328 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002329 (yyval.a_oid) = (yyvsp[(1) - (2)].a_oid);
2330 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(2) - (2)].a_oid_arc));
Lev Walkina964e032017-03-26 03:48:06 -07002331 if((yyvsp[(2) - (2)].a_oid_arc).name)
2332 free((yyvsp[(2) - (2)].a_oid_arc).name);
Lev Walkin418298d2006-07-13 08:24:20 +00002333 }
2334 break;
2335
Lev Walkina9532f42006-09-17 04:52:50 +00002336 case 13:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002337#line 443 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002338 { /* iso */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002339 (yyval.a_oid_arc).name = (yyvsp[(1) - (1)].tv_str);
2340 (yyval.a_oid_arc).number = -1;
Lev Walkin418298d2006-07-13 08:24:20 +00002341 }
2342 break;
2343
Lev Walkina9532f42006-09-17 04:52:50 +00002344 case 14:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002345#line 447 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002346 { /* iso(1) */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002347 (yyval.a_oid_arc).name = (yyvsp[(1) - (4)].tv_str);
2348 (yyval.a_oid_arc).number = (yyvsp[(3) - (4)].a_int);
Lev Walkin418298d2006-07-13 08:24:20 +00002349 }
2350 break;
2351
Lev Walkina9532f42006-09-17 04:52:50 +00002352 case 15:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002353#line 451 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002354 { /* 1 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002355 (yyval.a_oid_arc).name = 0;
2356 (yyval.a_oid_arc).number = (yyvsp[(1) - (1)].a_int);
Lev Walkin418298d2006-07-13 08:24:20 +00002357 }
2358 break;
2359
Lev Walkina9532f42006-09-17 04:52:50 +00002360 case 16:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002361#line 461 "asn1p_y.y"
2362 { (yyval.a_module_flags) = MSF_NOFLAGS; }
Lev Walkin418298d2006-07-13 08:24:20 +00002363 break;
2364
Lev Walkin418298d2006-07-13 08:24:20 +00002365 case 17:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002366#line 462 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002367 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002368 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
Lev Walkin418298d2006-07-13 08:24:20 +00002369 }
2370 break;
2371
2372 case 18:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002373#line 471 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002374 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002375 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
Lev Walkina9532f42006-09-17 04:52:50 +00002376 }
2377 break;
2378
2379 case 19:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002380#line 474 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002381 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002382 (yyval.a_module_flags) = (yyvsp[(1) - (2)].a_module_flags) | (yyvsp[(2) - (2)].a_module_flags);
Lev Walkin418298d2006-07-13 08:24:20 +00002383 }
2384 break;
2385
Lev Walkina9532f42006-09-17 04:52:50 +00002386 case 20:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002387#line 483 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002388 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002389 (yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002390 }
2391 break;
2392
Lev Walkina9532f42006-09-17 04:52:50 +00002393 case 21:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002394#line 486 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002395 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002396 (yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002397 }
2398 break;
2399
Lev Walkina9532f42006-09-17 04:52:50 +00002400 case 22:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002401#line 489 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002402 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002403 (yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002404 }
2405 break;
2406
Lev Walkina9532f42006-09-17 04:52:50 +00002407 case 23:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002408#line 492 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002409 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002410 (yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
Lev Walkin418298d2006-07-13 08:24:20 +00002411 }
2412 break;
2413
Lev Walkina9532f42006-09-17 04:52:50 +00002414 case 24:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002415#line 496 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002416 {
Lev Walkinf59d0752004-08-18 04:59:12 +00002417 /* X.680Amd1 specifies TAG and XER */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002418 if(strcmp((yyvsp[(1) - (2)].tv_str), "TAG") == 0) {
2419 (yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
2420 } else if(strcmp((yyvsp[(1) - (2)].tv_str), "XER") == 0) {
2421 (yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
Lev Walkinf59d0752004-08-18 04:59:12 +00002422 } else {
2423 fprintf(stderr,
2424 "WARNING: %s INSTRUCTIONS at line %d: "
2425 "Unrecognized encoding reference\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07002426 (yyvsp[(1) - (2)].tv_str), yylineno);
2427 (yyval.a_module_flags) = MSF_unk_INSTRUCTIONS;
Lev Walkinf59d0752004-08-18 04:59:12 +00002428 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07002429 free((yyvsp[(1) - (2)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00002430 }
2431 break;
2432
Lev Walkina9532f42006-09-17 04:52:50 +00002433 case 25:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002434#line 517 "asn1p_y.y"
2435 { (yyval.a_module) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00002436 break;
2437
Lev Walkina9532f42006-09-17 04:52:50 +00002438 case 26:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002439#line 518 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002440 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002441 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002442 }
2443 break;
2444
Lev Walkina9532f42006-09-17 04:52:50 +00002445 case 27:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002446#line 527 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002447 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002448 (yyval.a_module) = asn1p_module_new();
2449 AL_IMPORT((yyval.a_module), exports, (yyvsp[(1) - (3)].a_module), xp_next);
2450 AL_IMPORT((yyval.a_module), imports, (yyvsp[(2) - (3)].a_module), xp_next);
2451 AL_IMPORT((yyval.a_module), members, (yyvsp[(3) - (3)].a_module), next);
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002452
2453 asn1p_module_free((yyvsp[(1) - (3)].a_module));
2454 asn1p_module_free((yyvsp[(2) - (3)].a_module));
2455 asn1p_module_free((yyvsp[(3) - (3)].a_module));
Lev Walkin418298d2006-07-13 08:24:20 +00002456 }
2457 break;
2458
Lev Walkina9532f42006-09-17 04:52:50 +00002459 case 28:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002460#line 536 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002461 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002462 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002463 }
2464 break;
2465
Lev Walkina9532f42006-09-17 04:52:50 +00002466 case 29:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002467#line 539 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002468 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002469 if((yyvsp[(1) - (2)].a_module)) {
2470 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002471 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002472 (yyval.a_module) = (yyvsp[(2) - (2)].a_module);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002473 break;
2474 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07002475 AL_IMPORT((yyval.a_module), members, (yyvsp[(2) - (2)].a_module), next);
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002476
2477 asn1p_module_free((yyvsp[(2) - (2)].a_module));
Lev Walkin866bd7f2006-09-14 10:35:20 +00002478 }
2479 break;
2480
Lev Walkin418298d2006-07-13 08:24:20 +00002481 case 30:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002482#line 555 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002483 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002484 (yyval.a_module) = asn1p_module_new();
2485 checkmem((yyval.a_module));
2486 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2487 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2488 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002489 }
2490 break;
2491
2492 case 31:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002493#line 562 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002494 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002495 (yyval.a_module) = asn1p_module_new();
2496 checkmem((yyval.a_module));
2497 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2498 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2499 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002500 }
2501 break;
2502
2503 case 32:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002504#line 575 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002505 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002506 (yyval.a_module) = asn1p_module_new();
2507 checkmem((yyval.a_module));
2508 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2509 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2510 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkina9532f42006-09-17 04:52:50 +00002511 }
Lev Walkin418298d2006-07-13 08:24:20 +00002512 break;
2513
Lev Walkin866bd7f2006-09-14 10:35:20 +00002514 case 33:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002515#line 583 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002516 { asn1p_lexer_hack_push_encoding_control(); }
2517 break;
2518
2519 case 34:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002520#line 584 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002521 {
Lev Walkinf59d0752004-08-18 04:59:12 +00002522 fprintf(stderr,
2523 "WARNING: ENCODING-CONTROL %s "
2524 "specification at line %d ignored\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07002525 (yyvsp[(2) - (3)].tv_str), yylineno);
2526 free((yyvsp[(2) - (3)].tv_str));
2527 (yyval.a_module) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002528 }
2529 break;
2530
Lev Walkina9532f42006-09-17 04:52:50 +00002531 case 35:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002532#line 596 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002533 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002534 return yyerror(
Lev Walkin70853052005-11-26 11:21:55 +00002535 "Attempt to redefine a standard basic string type, "
2536 "please comment out or remove this type redefinition.");
Lev Walkin418298d2006-07-13 08:24:20 +00002537 }
2538 break;
2539
Lev Walkina9532f42006-09-17 04:52:50 +00002540 case 36:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002541#line 609 "asn1p_y.y"
2542 { (yyval.a_module) = 0; }
Lev Walkin866bd7f2006-09-14 10:35:20 +00002543 break;
2544
Lev Walkina9532f42006-09-17 04:52:50 +00002545 case 38:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002546#line 613 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002547 {
Lev Walkinb36317c2005-08-12 10:09:10 +00002548 if(!saved_aid && 0)
2549 return yyerror("Unterminated IMPORTS FROM, "
2550 "expected semicolon ';'");
2551 saved_aid = 0;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002552 (yyval.a_module) = (yyvsp[(2) - (3)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002553 }
2554 break;
2555
Lev Walkina9532f42006-09-17 04:52:50 +00002556 case 39:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002557#line 623 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002558 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002559 return yyerror("Empty IMPORTS list");
Lev Walkin418298d2006-07-13 08:24:20 +00002560 }
2561 break;
2562
Lev Walkina9532f42006-09-17 04:52:50 +00002563 case 40:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002564#line 629 "asn1p_y.y"
2565 { (yyval.a_module) = asn1p_module_new(); }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002566 break;
2567
2568 case 42:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002569#line 633 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002570 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002571 (yyval.a_module) = asn1p_module_new();
2572 checkmem((yyval.a_module));
2573 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002574 }
2575 break;
2576
Lev Walkin4a4543f2006-10-13 12:37:39 +00002577 case 43:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002578#line 638 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002579 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002580 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
2581 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(2) - (2)].a_xports), xp_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002582 }
2583 break;
2584
Lev Walkin4a4543f2006-10-13 12:37:39 +00002585 case 44:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002586#line 645 "asn1p_y.y"
2587 { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
Lev Walkin418298d2006-07-13 08:24:20 +00002588 break;
2589
Lev Walkin4a4543f2006-10-13 12:37:39 +00002590 case 45:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002591#line 646 "asn1p_y.y"
2592 { (yyval.a_aid).oid = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin418298d2006-07-13 08:24:20 +00002593 break;
2594
Lev Walkin4a4543f2006-10-13 12:37:39 +00002595 case 46:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002596#line 650 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002597 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002598 (yyval.a_xports) = (yyvsp[(1) - (4)].a_xports);
2599 (yyval.a_xports)->fromModuleName = (yyvsp[(3) - (4)].tv_str);
2600 (yyval.a_xports)->identifier = (yyvsp[(4) - (4)].a_aid);
Lev Walkinb36317c2005-08-12 10:09:10 +00002601 /* This stupid thing is used for look-back hack. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002602 saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
2603 checkmem((yyval.a_xports));
Lev Walkin418298d2006-07-13 08:24:20 +00002604 }
2605 break;
2606
Lev Walkin4a4543f2006-10-13 12:37:39 +00002607 case 47:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002608#line 661 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002609 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002610 (yyval.a_xports) = asn1p_xports_new();
2611 checkmem((yyval.a_xports));
2612 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002613 }
2614 break;
2615
Lev Walkin4a4543f2006-10-13 12:37:39 +00002616 case 48:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002617#line 666 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002618 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002619 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2620 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002621 }
2622 break;
2623
Lev Walkina9532f42006-09-17 04:52:50 +00002624 case 49:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002625#line 673 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002626 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002627 (yyval.a_expr) = NEW_EXPR();
2628 checkmem((yyval.a_expr));
2629 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2630 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin418298d2006-07-13 08:24:20 +00002631 }
2632 break;
2633
Lev Walkina9532f42006-09-17 04:52:50 +00002634 case 50:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002635#line 679 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002636 { /* Completely equivalent to above */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002637 (yyval.a_expr) = NEW_EXPR();
2638 checkmem((yyval.a_expr));
2639 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2640 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002641 }
Lev Walkin866bd7f2006-09-14 10:35:20 +00002642 break;
2643
Lev Walkina9532f42006-09-17 04:52:50 +00002644 case 51:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002645#line 685 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002646 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002647 (yyval.a_expr) = NEW_EXPR();
2648 checkmem((yyval.a_expr));
2649 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2650 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002651 }
2652 break;
2653
2654 case 52:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002655#line 695 "asn1p_y.y"
2656 { (yyval.a_module) = 0; }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002657 break;
2658
2659 case 53:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002660#line 696 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002661 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002662 (yyval.a_module) = asn1p_module_new();
2663 checkmem((yyval.a_module));
2664 if((yyvsp[(1) - (1)].a_xports)) {
2665 TQ_ADD(&((yyval.a_module)->exports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002666 } else {
2667 /* "EXPORTS ALL;" */
2668 }
2669 }
2670 break;
2671
Lev Walkin4a4543f2006-10-13 12:37:39 +00002672 case 54:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002673#line 708 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002674 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002675 (yyval.a_xports) = (yyvsp[(2) - (3)].a_xports);
Lev Walkin418298d2006-07-13 08:24:20 +00002676 }
2677 break;
2678
Lev Walkin4a4543f2006-10-13 12:37:39 +00002679 case 55:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002680#line 711 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002681 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002682 (yyval.a_xports) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002683 }
2684 break;
2685
Lev Walkin4a4543f2006-10-13 12:37:39 +00002686 case 56:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002687#line 714 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002688 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002689 /* Empty EXPORTS clause effectively prohibits export. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002690 (yyval.a_xports) = asn1p_xports_new();
2691 checkmem((yyval.a_xports));
Lev Walkin418298d2006-07-13 08:24:20 +00002692 }
2693 break;
2694
Lev Walkin4a4543f2006-10-13 12:37:39 +00002695 case 57:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002696#line 722 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002697 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002698 (yyval.a_xports) = asn1p_xports_new();
2699 assert((yyval.a_xports));
2700 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002701 }
2702 break;
2703
Lev Walkin4a4543f2006-10-13 12:37:39 +00002704 case 58:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002705#line 727 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002706 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002707 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2708 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002709 }
2710 break;
2711
Lev Walkina9532f42006-09-17 04:52:50 +00002712 case 59:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002713#line 734 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002714 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002715 (yyval.a_expr) = NEW_EXPR();
2716 checkmem((yyval.a_expr));
2717 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2718 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin418298d2006-07-13 08:24:20 +00002719 }
2720 break;
2721
Lev Walkina9532f42006-09-17 04:52:50 +00002722 case 60:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002723#line 740 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002724 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002725 (yyval.a_expr) = NEW_EXPR();
2726 checkmem((yyval.a_expr));
2727 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2728 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002729 }
Lev Walkin418298d2006-07-13 08:24:20 +00002730 break;
2731
Lev Walkina9532f42006-09-17 04:52:50 +00002732 case 61:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002733#line 746 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002734 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002735 (yyval.a_expr) = NEW_EXPR();
2736 checkmem((yyval.a_expr));
2737 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2738 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002739 }
2740 break;
2741
2742 case 62:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002743#line 755 "asn1p_y.y"
2744 { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002745 break;
2746
2747 case 63:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002748#line 758 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002749 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002750 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
2751 assert((yyval.a_expr)->Identifier == 0);
2752 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
2753 (yyval.a_expr)->meta_type = AMT_VALUESET;
2754 (yyval.a_expr)->constraints = (yyvsp[(4) - (4)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00002755 }
2756 break;
2757
Lev Walkin4a4543f2006-10-13 12:37:39 +00002758 case 64:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002759#line 768 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002760 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002761 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00002762 }
2763 break;
2764
Lev Walkin4a4543f2006-10-13 12:37:39 +00002765 case 65:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002766#line 781 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002767 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002768 (yyval.a_expr) = NEW_EXPR();
2769 checkmem((yyval.a_expr));
2770 (yyval.a_expr)->reference = (yyvsp[(1) - (1)].a_ref);
2771 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2772 (yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin418298d2006-07-13 08:24:20 +00002773 }
2774 break;
2775
Lev Walkin4a4543f2006-10-13 12:37:39 +00002776 case 66:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002777#line 791 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002778 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002779 (yyval.a_expr) = NEW_EXPR();
2780 checkmem((yyval.a_expr));
2781 (yyval.a_expr)->reference = (yyvsp[(1) - (4)].a_ref);
2782 (yyval.a_expr)->rhs_pspecs = (yyvsp[(3) - (4)].a_expr);
2783 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2784 (yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin418298d2006-07-13 08:24:20 +00002785 }
2786 break;
2787
Lev Walkin4a4543f2006-10-13 12:37:39 +00002788 case 67:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002789#line 811 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002790 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002791 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2792 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2793 assert((yyval.a_expr)->expr_type);
2794 assert((yyval.a_expr)->meta_type);
Lev Walkin418298d2006-07-13 08:24:20 +00002795 }
2796 break;
2797
Lev Walkin4a4543f2006-10-13 12:37:39 +00002798 case 68:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002799#line 817 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002800 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002801 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2802 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2803 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
2804 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
Lev Walkin418298d2006-07-13 08:24:20 +00002805 }
2806 break;
2807
Lev Walkina9532f42006-09-17 04:52:50 +00002808 case 69:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002809#line 833 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002810 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002811 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2812 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2813 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002814 }
2815 break;
2816
2817 case 70:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002818#line 839 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002819 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002820 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2821 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2822 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002823 }
2824 break;
2825
2826 case 71:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002827#line 847 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002828 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002829 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002830 (yyval.a_plist) = asn1p_paramlist_new(yylineno);
2831 checkmem((yyval.a_plist));
2832 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(1) - (1)].a_parg).governor, (yyvsp[(1) - (1)].a_parg).argument);
Lev Walkinf15320b2004-06-03 03:38:44 +00002833 checkmem(ret == 0);
Lev Walkina964e032017-03-26 03:48:06 -07002834 asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor);
Markus Elfringf3d18612016-03-15 08:35:24 +01002835 free((yyvsp[(1) - (1)].a_parg).argument);
Lev Walkin418298d2006-07-13 08:24:20 +00002836 }
2837 break;
2838
Lev Walkin4a4543f2006-10-13 12:37:39 +00002839 case 72:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002840#line 856 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002841 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002842 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002843 (yyval.a_plist) = (yyvsp[(1) - (3)].a_plist);
2844 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[(3) - (3)].a_parg).governor, (yyvsp[(3) - (3)].a_parg).argument);
Lev Walkinf15320b2004-06-03 03:38:44 +00002845 checkmem(ret == 0);
Lev Walkina964e032017-03-26 03:48:06 -07002846 asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor);
Markus Elfringf3d18612016-03-15 08:35:24 +01002847 free((yyvsp[(3) - (3)].a_parg).argument);
Lev Walkin418298d2006-07-13 08:24:20 +00002848 }
2849 break;
2850
Lev Walkin4a4543f2006-10-13 12:37:39 +00002851 case 73:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002852#line 867 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002853 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002854 (yyval.a_parg).governor = NULL;
2855 (yyval.a_parg).argument = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00002856 }
2857 break;
2858
Lev Walkin866bd7f2006-09-14 10:35:20 +00002859 case 74:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002860#line 871 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002861 {
2862 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002863 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2864 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002865 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002866 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002867 }
2868 break;
2869
2870 case 75:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002871#line 878 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002872 {
2873 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002874 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2875 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002876 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002877 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002878 }
2879 break;
2880
2881 case 76:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002882#line 885 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002883 {
Lev Walkina9532f42006-09-17 04:52:50 +00002884 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002885 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2886 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2887 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
Lev Walkina9532f42006-09-17 04:52:50 +00002888 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002889 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkina9532f42006-09-17 04:52:50 +00002890 }
2891 break;
2892
Lev Walkin4a4543f2006-10-13 12:37:39 +00002893 case 77:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002894#line 893 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002895 {
2896 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002897 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2898 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2899 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002900 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002901 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002902 }
2903 break;
2904
2905 case 78:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002906#line 904 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002907 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002908 (yyval.a_expr) = NEW_EXPR();
2909 checkmem((yyval.a_expr));
2910 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002911 }
2912 break;
2913
Lev Walkin4a4543f2006-10-13 12:37:39 +00002914 case 79:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002915#line 909 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002916 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002917 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
2918 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002919 }
2920 break;
2921
Lev Walkin4a4543f2006-10-13 12:37:39 +00002922 case 80:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002923#line 916 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002924 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002925 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00002926 }
2927 break;
2928
Lev Walkin4a4543f2006-10-13 12:37:39 +00002929 case 81:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002930#line 919 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002931 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002932 (yyval.a_expr) = NEW_EXPR();
2933 checkmem((yyval.a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002934 (yyval.a_expr)->Identifier = strdup("?");
Lev Walkin0e90aa02013-03-19 16:17:13 -07002935 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2936 (yyval.a_expr)->meta_type = AMT_VALUE;
2937 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00002938 }
2939 break;
2940
Lev Walkin4a4543f2006-10-13 12:37:39 +00002941 case 82:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002942#line 927 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002943 {
Lev Walkina00d6b32006-03-21 03:40:38 +00002944 asn1p_ref_t *ref;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002945 (yyval.a_expr) = NEW_EXPR();
2946 checkmem((yyval.a_expr));
2947 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2948 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2949 (yyval.a_expr)->meta_type = AMT_VALUE;
Lev Walkina00d6b32006-03-21 03:40:38 +00002950 ref = asn1p_ref_new(yylineno);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002951 asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
2952 (yyval.a_expr)->value = asn1p_value_fromref(ref, 0);
Lev Walkin418298d2006-07-13 08:24:20 +00002953 }
2954 break;
2955
Lev Walkin4a4543f2006-10-13 12:37:39 +00002956 case 83:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002957#line 938 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002958 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002959 (yyval.a_expr) = NEW_EXPR();
2960 (yyval.a_expr)->expr_type = A1TC_VALUESET;
2961 (yyval.a_expr)->meta_type = AMT_VALUESET;
2962 (yyval.a_expr)->constraints = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00002963 }
2964 break;
2965
Lev Walkin4a4543f2006-10-13 12:37:39 +00002966 case 84:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002967#line 961 "asn1p_y.y"
2968 { (yyval.a_expr) = NEW_EXPR(); }
Lev Walkin418298d2006-07-13 08:24:20 +00002969 break;
2970
Lev Walkin4a4543f2006-10-13 12:37:39 +00002971 case 85:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002972#line 962 "asn1p_y.y"
2973 { (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr); }
Lev Walkina9532f42006-09-17 04:52:50 +00002974 break;
2975
Lev Walkin4a4543f2006-10-13 12:37:39 +00002976 case 86:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002977#line 965 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002978 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002979 (yyval.a_expr) = NEW_EXPR();
2980 checkmem((yyval.a_expr));
2981 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002982 }
2983 break;
2984
Lev Walkin4a4543f2006-10-13 12:37:39 +00002985 case 87:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002986#line 970 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002987 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002988 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
2989 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002990 }
2991 break;
2992
Lev Walkin4a4543f2006-10-13 12:37:39 +00002993 case 88:
Lev Walkin0e90aa02013-03-19 16:17:13 -07002994#line 974 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002995 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002996 (yyval.a_expr) = (yyvsp[(1) - (5)].a_expr);
2997 asn1p_expr_add_many((yyval.a_expr), (yyvsp[(4) - (5)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002998 asn1p_expr_free((yyvsp[(4) - (5)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002999 }
3000 break;
3001
Lev Walkin4a4543f2006-10-13 12:37:39 +00003002 case 89:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003003#line 981 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003004 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003005 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3006 assert((yyval.a_expr)->Identifier == 0);
3007 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3008 (yyvsp[(3) - (3)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3009 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003010 }
3011 break;
3012
Lev Walkin4a4543f2006-10-13 12:37:39 +00003013 case 90:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003014#line 988 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003015 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003016 (yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
3017 (yyvsp[(2) - (2)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3018 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
3019 _fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003020 }
3021 break;
3022
Lev Walkin4a4543f2006-10-13 12:37:39 +00003023 case 91:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003024#line 994 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003025 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003026 (yyval.a_expr) = NEW_EXPR();
3027 checkmem((yyval.a_expr));
3028 (yyval.a_expr)->meta_type = (yyvsp[(3) - (3)].a_expr)->meta_type;
3029 (yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
3030 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003031 }
3032 break;
3033
Lev Walkin4a4543f2006-10-13 12:37:39 +00003034 case 92:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003035#line 1001 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003036 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003037 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003038 }
3039 break;
3040
Lev Walkin4a4543f2006-10-13 12:37:39 +00003041 case 93:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003042#line 1007 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003043 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003044 (yyval.a_expr) = NEW_EXPR();
3045 checkmem((yyval.a_expr));
3046 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003047 }
3048 break;
3049
Lev Walkin4a4543f2006-10-13 12:37:39 +00003050 case 94:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003051#line 1012 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003052 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003053 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3054 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003055 }
3056 break;
3057
Lev Walkin4a4543f2006-10-13 12:37:39 +00003058 case 95:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003059#line 1019 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003060 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003061 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3062 assert((yyval.a_expr)->Identifier == 0);
3063 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003064 }
3065 break;
3066
Lev Walkin4a4543f2006-10-13 12:37:39 +00003067 case 96:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003068#line 1024 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003069 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003070 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003071 }
3072 break;
3073
Lev Walkin4a4543f2006-10-13 12:37:39 +00003074 case 97:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003075#line 1027 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003076 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003077 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
3078 _fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003079 }
3080 break;
3081
Lev Walkin4a4543f2006-10-13 12:37:39 +00003082 case 98:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003083#line 1034 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003084 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003085 (yyval.a_expr) = (yyvsp[(3) - (5)].a_expr);
3086 checkmem((yyval.a_expr));
3087 (yyval.a_expr)->with_syntax = (yyvsp[(5) - (5)].a_wsynt);
3088 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
3089 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
Lev Walkin418298d2006-07-13 08:24:20 +00003090 }
3091 break;
3092
Lev Walkin0e90aa02013-03-19 16:17:13 -07003093 case 99:
3094#line 1044 "asn1p_y.y"
3095 { (yyval.a_int) = 0; }
3096 break;
3097
3098 case 100:
3099#line 1045 "asn1p_y.y"
3100 { (yyval.a_int) = 1; }
3101 break;
3102
Lev Walkin4a4543f2006-10-13 12:37:39 +00003103 case 101:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003104#line 1049 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003105 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003106 (yyval.a_expr) = NEW_EXPR();
3107 checkmem((yyval.a_expr));
3108 (yyval.a_expr)->expr_type = A1TC_CLASSDEF;
3109 (yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
3110 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003111 }
3112 break;
3113
Lev Walkin4a4543f2006-10-13 12:37:39 +00003114 case 102:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003115#line 1056 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003116 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003117 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3118 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003119 }
3120 break;
3121
Lev Walkin4a4543f2006-10-13 12:37:39 +00003122 case 103:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003123#line 1066 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003124 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003125 (yyval.a_expr) = NEW_EXPR();
3126 checkmem((yyval.a_expr));
3127 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
3128 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3129 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
3130 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003131 }
3132 break;
3133
Lev Walkin4a4543f2006-10-13 12:37:39 +00003134 case 104:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003135#line 1076 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003136 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003137 (yyval.a_expr) = NEW_EXPR();
3138 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3139 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3140 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
3141 (yyval.a_expr)->unique = (yyvsp[(3) - (4)].a_int);
3142 (yyval.a_expr)->marker = (yyvsp[(4) - (4)].a_marker);
3143 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (4)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003144 }
3145 break;
3146
Lev Walkin4a4543f2006-10-13 12:37:39 +00003147 case 105:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003148#line 1087 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003149 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003150 (yyval.a_expr) = NEW_EXPR();
3151 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3152 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3153 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
3154 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3155 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003156 }
3157 break;
3158
Lev Walkin4a4543f2006-10-13 12:37:39 +00003159 case 106:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003160#line 1097 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003161 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003162 (yyval.a_expr) = NEW_EXPR();
3163 checkmem((yyval.a_expr));
3164 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3165 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3166 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3167 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
3168 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003169 }
3170 break;
3171
Lev Walkin4a4543f2006-10-13 12:37:39 +00003172 case 107:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003173#line 1108 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003174 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003175 (yyval.a_expr) = NEW_EXPR();
3176 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3177 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3178 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
3179 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3180 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003181 }
3182 break;
3183
Lev Walkin4a4543f2006-10-13 12:37:39 +00003184 case 108:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003185#line 1118 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003186 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003187 (yyval.a_expr) = NEW_EXPR();
3188 checkmem((yyval.a_expr));
3189 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3190 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3191 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
3192 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (3)].a_expr));
3193 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003194 }
3195 break;
3196
Lev Walkin4a4543f2006-10-13 12:37:39 +00003197 case 109:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003198#line 1129 "asn1p_y.y"
3199 {
3200 (yyval.a_expr) = NEW_EXPR();
3201 checkmem((yyval.a_expr));
3202 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3203 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3204 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3205 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
3206 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3207 }
Lev Walkin418298d2006-07-13 08:24:20 +00003208 break;
3209
Lev Walkin4a4543f2006-10-13 12:37:39 +00003210 case 110:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003211#line 1141 "asn1p_y.y"
3212 { (yyval.a_wsynt) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00003213 break;
3214
Lev Walkin4a4543f2006-10-13 12:37:39 +00003215 case 111:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003216#line 1142 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003217 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003218 (yyval.a_wsynt) = (yyvsp[(1) - (1)].a_wsynt);
Lev Walkin418298d2006-07-13 08:24:20 +00003219 }
3220 break;
3221
Lev Walkin0e90aa02013-03-19 16:17:13 -07003222 case 112:
3223#line 1149 "asn1p_y.y"
3224 { asn1p_lexer_hack_enable_with_syntax(); }
3225 break;
3226
Lev Walkin4a4543f2006-10-13 12:37:39 +00003227 case 113:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003228#line 1151 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003229 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003230 (yyval.a_wsynt) = (yyvsp[(5) - (6)].a_wsynt);
Lev Walkin418298d2006-07-13 08:24:20 +00003231 }
3232 break;
3233
Lev Walkin4a4543f2006-10-13 12:37:39 +00003234 case 114:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003235#line 1157 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003236 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003237 (yyval.a_wsynt) = asn1p_wsyntx_new();
3238 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(1) - (1)].a_wchunk), next);
Lev Walkin418298d2006-07-13 08:24:20 +00003239 }
3240 break;
3241
Lev Walkin4a4543f2006-10-13 12:37:39 +00003242 case 115:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003243#line 1161 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003244 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003245 (yyval.a_wsynt) = (yyvsp[(1) - (2)].a_wsynt);
3246 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(2) - (2)].a_wchunk), next);
Lev Walkin418298d2006-07-13 08:24:20 +00003247 }
3248 break;
3249
Lev Walkin4a4543f2006-10-13 12:37:39 +00003250 case 116:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003251#line 1168 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003252 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003253 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_opaque).buf, 0);
3254 (yyval.a_wchunk)->type = WC_WHITESPACE;
Lev Walkin418298d2006-07-13 08:24:20 +00003255 }
3256 break;
3257
Lev Walkin4a4543f2006-10-13 12:37:39 +00003258 case 117:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003259#line 1172 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003260 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003261 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_str), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003262 }
3263 break;
3264
Lev Walkin4a4543f2006-10-13 12:37:39 +00003265 case 118:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003266#line 1175 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003267 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003268 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].a_refcomp).name, 0);
3269 (yyval.a_wchunk)->type = WC_FIELD;
Lev Walkin418298d2006-07-13 08:24:20 +00003270 }
3271 break;
3272
Lev Walkina9532f42006-09-17 04:52:50 +00003273 case 119:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003274#line 1179 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00003275 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003276 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[(2) - (3)].a_wsynt));
Lev Walkin866bd7f2006-09-14 10:35:20 +00003277 }
3278 break;
3279
Lev Walkina9532f42006-09-17 04:52:50 +00003280 case 120:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003281#line 1185 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003282 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003283 (yyval.a_expr) = NEW_EXPR();
3284 checkmem((yyval.a_expr));
3285 (yyval.a_expr)->Identifier = strdup("...");
3286 checkmem((yyval.a_expr)->Identifier);
3287 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3288 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00003289 }
3290 break;
3291
3292 case 121:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003293#line 1193 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003294 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003295 (yyval.a_expr) = NEW_EXPR();
3296 checkmem((yyval.a_expr));
3297 (yyval.a_expr)->Identifier = strdup("...");
3298 checkmem((yyval.a_expr)->Identifier);
3299 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3300 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3301 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00003302 }
3303 break;
3304
3305 case 122:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003306#line 1202 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003307 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003308 (yyval.a_expr) = NEW_EXPR();
3309 checkmem((yyval.a_expr));
3310 (yyval.a_expr)->Identifier = strdup("...");
3311 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3312 checkmem((yyval.a_expr)->Identifier);
3313 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3314 (yyval.a_expr)->meta_type = AMT_TYPE;
3315 }
3316 break;
3317
3318 case 123:
3319#line 1214 "asn1p_y.y"
3320 {
3321 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3322 (yyval.a_expr)->tag = (yyvsp[(1) - (3)].a_tag);
Lev Walkin070a52d2004-08-22 03:19:54 +00003323 /*
3324 * Outer constraint for SEQUENCE OF and SET OF applies
3325 * to the inner type.
3326 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07003327 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
3328 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
3329 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
3330 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(3) - (3)].a_constr);
Lev Walkin070a52d2004-08-22 03:19:54 +00003331 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003332 if((yyval.a_expr)->constraints) {
3333 assert(!(yyvsp[(2) - (3)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08003334 /* Check this : optConstraints is not used ?! */
3335 asn1p_constraint_free((yyvsp[(3) - (3)].a_constr));
Lev Walkin070a52d2004-08-22 03:19:54 +00003336 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003337 (yyval.a_expr)->constraints = (yyvsp[(3) - (3)].a_constr);
Lev Walkin070a52d2004-08-22 03:19:54 +00003338 }
3339 }
Lev Walkin418298d2006-07-13 08:24:20 +00003340 }
3341 break;
3342
Lev Walkin0e90aa02013-03-19 16:17:13 -07003343 case 124:
3344#line 1236 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003345 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003346 (yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
Lev Walkinfb872bd2006-03-18 06:53:11 +00003347 asn1p_as_pointer = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00003348 }
3349 break;
3350
Lev Walkin0e90aa02013-03-19 16:17:13 -07003351 case 125:
3352#line 1243 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003353 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003354 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3355 (yyval.a_expr)->marker.flags |= (yyvsp[(1) - (2)].a_int);
Lev Walkinfb872bd2006-03-18 06:53:11 +00003356
Lev Walkin0e90aa02013-03-19 16:17:13 -07003357 if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
3358 && ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
Lev Walkinef625402005-09-05 05:17:57 +00003359 fprintf(stderr,
3360 "INFO: Directive <ASN1C:RepresentAsPointer> "
3361 "applied to %s at line %d\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07003362 ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
3363 ? ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
Lev Walkinef625402005-09-05 05:17:57 +00003364 : "member",
Lev Walkin0e90aa02013-03-19 16:17:13 -07003365 (yyval.a_expr)->_lineno
Lev Walkinef625402005-09-05 05:17:57 +00003366 );
3367 }
Lev Walkin418298d2006-07-13 08:24:20 +00003368 }
3369 break;
3370
Lev Walkin4a4543f2006-10-13 12:37:39 +00003371 case 126:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003372#line 1262 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003373 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003374 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003375 }
3376 break;
3377
Lev Walkin4a4543f2006-10-13 12:37:39 +00003378 case 127:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003379#line 1265 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003380 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003381 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3382 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3383 (yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
3384 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003385 }
3386 break;
3387
Lev Walkin4a4543f2006-10-13 12:37:39 +00003388 case 128:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003389#line 1271 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003390 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003391 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3392 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3393 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
3394 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003395 }
3396 break;
3397
Lev Walkin4a4543f2006-10-13 12:37:39 +00003398 case 129:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003399#line 1277 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003400 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003401 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3402 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3403 (yyval.a_expr)->expr_type = ASN_CONSTR_SET;
3404 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003405 }
3406 break;
3407
Lev Walkin4a4543f2006-10-13 12:37:39 +00003408 case 130:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003409#line 1283 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003410 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003411 (yyval.a_expr) = NEW_EXPR();
3412 checkmem((yyval.a_expr));
3413 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3414 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
3415 (yyval.a_expr)->meta_type = AMT_TYPE;
3416 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3417 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3418 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003419 }
3420 break;
3421
Lev Walkin4a4543f2006-10-13 12:37:39 +00003422 case 131:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003423#line 1293 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003424 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003425 (yyval.a_expr) = NEW_EXPR();
3426 checkmem((yyval.a_expr));
3427 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3428 (yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
3429 (yyval.a_expr)->meta_type = AMT_TYPE;
3430 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3431 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3432 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003433 }
3434 break;
3435
Lev Walkin4a4543f2006-10-13 12:37:39 +00003436 case 132:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003437#line 1303 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003438 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003439 (yyval.a_expr) = NEW_EXPR();
3440 checkmem((yyval.a_expr));
3441 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3442 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003443 }
3444 break;
3445
Lev Walkin4a4543f2006-10-13 12:37:39 +00003446 case 133:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003447#line 1309 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003448 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003449 int ret;
3450 (yyval.a_expr) = NEW_EXPR();
3451 checkmem((yyval.a_expr));
3452 (yyval.a_expr)->reference = asn1p_ref_new(yylineno);
3453 ret = asn1p_ref_add_component((yyval.a_expr)->reference,
3454 (yyvsp[(4) - (4)].tv_str), RLT_lowercase);
3455 checkmem(ret == 0);
3456 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3457 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003458 }
3459 break;
3460
Lev Walkin4a4543f2006-10-13 12:37:39 +00003461 case 134:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003462#line 1320 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003463 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003464 (yyval.a_expr) = NEW_EXPR();
3465 checkmem((yyval.a_expr));
3466 (yyval.a_expr)->reference = (yyvsp[(3) - (3)].a_ref);
3467 (yyval.a_expr)->expr_type = A1TC_INSTANCE;
3468 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003469 }
3470 break;
3471
Lev Walkina9532f42006-09-17 04:52:50 +00003472 case 135:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003473#line 1335 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003474 {
3475 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003476 (yyval.a_ref) = asn1p_ref_new(yylineno);
3477 checkmem((yyval.a_ref));
3478 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_UNKNOWN);
Lev Walkin4a4543f2006-10-13 12:37:39 +00003479 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003480 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin4a4543f2006-10-13 12:37:39 +00003481 }
3482 break;
3483
3484 case 136:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003485#line 1343 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003486 {
3487 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003488 (yyval.a_ref) = asn1p_ref_new(yylineno);
3489 checkmem((yyval.a_ref));
3490 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin4a4543f2006-10-13 12:37:39 +00003491 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003492 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin4a4543f2006-10-13 12:37:39 +00003493 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003494 free((yyvsp[(1) - (3)].tv_str));
Lev Walkin4a4543f2006-10-13 12:37:39 +00003495 }
3496 break;
3497
3498 case 137:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003499#line 1353 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003500 {
Lev Walkin9d542d22006-03-14 16:31:37 +00003501 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003502 (yyval.a_ref) = asn1p_ref_new(yylineno);
3503 checkmem((yyval.a_ref));
3504 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9d542d22006-03-14 16:31:37 +00003505 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003506 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9d542d22006-03-14 16:31:37 +00003507 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003508 free((yyvsp[(1) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003509 }
3510 break;
3511
Lev Walkin4a4543f2006-10-13 12:37:39 +00003512 case 138:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003513#line 1363 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003514 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003515 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003516 (yyval.a_ref) = asn1p_ref_new(yylineno);
3517 checkmem((yyval.a_ref));
3518 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9c974182004-09-15 11:59:51 +00003519 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003520 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
3521 checkmem(ret == 0);
3522 free((yyvsp[(1) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003523 }
3524 break;
3525
Lev Walkin4a4543f2006-10-13 12:37:39 +00003526 case 139:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003527#line 1373 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003528 {
Lev Walkin9c974182004-09-15 11:59:51 +00003529 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003530 (yyval.a_ref) = asn1p_ref_new(yylineno);
3531 checkmem((yyval.a_ref));
3532 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
3533 free((yyvsp[(1) - (1)].tv_str));
3534 checkmem(ret == 0);
3535 }
3536 break;
3537
3538 case 140:
3539#line 1381 "asn1p_y.y"
3540 {
3541 int ret;
3542 (yyval.a_ref) = (yyvsp[(3) - (3)].a_ref);
3543 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_CAPITALS);
3544 free((yyvsp[(1) - (3)].tv_str));
Lev Walkinf15320b2004-06-03 03:38:44 +00003545 checkmem(ret == 0);
3546 /*
3547 * Move the last element infront.
3548 */
3549 {
3550 struct asn1p_ref_component_s tmp_comp;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003551 tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
3552 memmove(&(yyval.a_ref)->components[1],
3553 &(yyval.a_ref)->components[0],
3554 sizeof((yyval.a_ref)->components[0])
3555 * ((yyval.a_ref)->comp_count - 1));
3556 (yyval.a_ref)->components[0] = tmp_comp;
Lev Walkinf15320b2004-06-03 03:38:44 +00003557 }
Lev Walkin418298d2006-07-13 08:24:20 +00003558 }
3559 break;
3560
Lev Walkin4a4543f2006-10-13 12:37:39 +00003561 case 141:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003562#line 1403 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003563 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003564 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003565 (yyval.a_ref) = asn1p_ref_new(yylineno);
3566 checkmem((yyval.a_ref));
3567 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].a_refcomp).name, (yyvsp[(1) - (1)].a_refcomp).lex_type);
3568 free((yyvsp[(1) - (1)].a_refcomp).name);
Lev Walkinf15320b2004-06-03 03:38:44 +00003569 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003570 }
3571 break;
3572
Lev Walkin0e90aa02013-03-19 16:17:13 -07003573 case 142:
3574#line 1411 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003575 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003576 int ret;
3577 (yyval.a_ref) = (yyvsp[(1) - (3)].a_ref);
3578 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].a_refcomp).name, (yyvsp[(3) - (3)].a_refcomp).lex_type);
3579 free((yyvsp[(3) - (3)].a_refcomp).name);
3580 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003581 }
3582 break;
3583
Lev Walkin4a4543f2006-10-13 12:37:39 +00003584 case 144:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003585#line 1424 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003586 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003587 (yyval.a_refcomp).lex_type = RLT_AmpUppercase;
3588 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003589 }
3590 break;
3591
Lev Walkin4a4543f2006-10-13 12:37:39 +00003592 case 145:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003593#line 1429 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003594 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003595 (yyval.a_refcomp).lex_type = RLT_Amplowercase;
3596 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003597 }
3598 break;
3599
Lev Walkin4a4543f2006-10-13 12:37:39 +00003600 case 146:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003601#line 1438 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003602 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003603 (yyval.a_ref) = asn1p_ref_new(yylineno);
3604 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_AmpUppercase);
Lev Walkin418298d2006-07-13 08:24:20 +00003605 }
3606 break;
3607
Lev Walkin4a4543f2006-10-13 12:37:39 +00003608 case 147:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003609#line 1442 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003610 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003611 (yyval.a_ref) = (yyval.a_ref);
3612 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_AmpUppercase);
Lev Walkin418298d2006-07-13 08:24:20 +00003613 }
3614 break;
3615
Lev Walkin4a4543f2006-10-13 12:37:39 +00003616 case 148:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003617#line 1446 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003618 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003619 (yyval.a_ref) = (yyval.a_ref);
3620 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_Amplowercase);
Lev Walkin418298d2006-07-13 08:24:20 +00003621 }
3622 break;
3623
Lev Walkin4a4543f2006-10-13 12:37:39 +00003624 case 149:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003625#line 1453 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003626 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003627 (yyval.a_ref) = asn1p_ref_new(yylineno);
3628 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
Lev Walkin418298d2006-07-13 08:24:20 +00003629 }
3630 break;
3631
Lev Walkin0e90aa02013-03-19 16:17:13 -07003632 case 150:
3633#line 1473 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003634 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003635 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
3636 assert((yyval.a_expr)->Identifier == NULL);
3637 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3638 (yyval.a_expr)->meta_type = AMT_VALUE;
3639 (yyval.a_expr)->value = (yyvsp[(4) - (4)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003640 }
3641 break;
3642
Lev Walkin4a4543f2006-10-13 12:37:39 +00003643 case 153:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003644#line 1485 "asn1p_y.y"
3645 {
3646 (yyval.a_value) = asn1p_value_fromint(0);
3647 checkmem((yyval.a_value));
3648 (yyval.a_value)->type = ATV_CHOICE_IDENTIFIER;
3649 (yyval.a_value)->value.choice_identifier.identifier = (yyvsp[(1) - (3)].tv_str);
3650 (yyval.a_value)->value.choice_identifier.value = (yyvsp[(3) - (3)].a_value);
3651 }
Lev Walkin418298d2006-07-13 08:24:20 +00003652 break;
3653
Lev Walkin4a4543f2006-10-13 12:37:39 +00003654 case 154:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003655#line 1492 "asn1p_y.y"
3656 { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin418298d2006-07-13 08:24:20 +00003657 break;
3658
Lev Walkin4a4543f2006-10-13 12:37:39 +00003659 case 155:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003660#line 1492 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003661 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003662 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(3) - (3)].tv_opaque).buf, (yyvsp[(3) - (3)].tv_opaque).len, 0);
3663 checkmem((yyval.a_value));
3664 (yyval.a_value)->type = ATV_UNPARSED;
Lev Walkin418298d2006-07-13 08:24:20 +00003665 }
3666 break;
3667
Lev Walkin4a4543f2006-10-13 12:37:39 +00003668 case 156:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003669#line 1497 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003670 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003671 (yyval.a_value) = asn1p_value_fromint(0);
3672 checkmem((yyval.a_value));
3673 (yyval.a_value)->type = ATV_NULL;
Lev Walkin418298d2006-07-13 08:24:20 +00003674 }
3675 break;
3676
Lev Walkin4a4543f2006-10-13 12:37:39 +00003677 case 157:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003678#line 1505 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003679 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003680 (yyval.a_value) = asn1p_value_fromint(0);
3681 checkmem((yyval.a_value));
3682 (yyval.a_value)->type = ATV_FALSE;
Lev Walkin418298d2006-07-13 08:24:20 +00003683 }
3684 break;
3685
Lev Walkin4a4543f2006-10-13 12:37:39 +00003686 case 158:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003687#line 1510 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003688 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003689 (yyval.a_value) = asn1p_value_fromint(0);
3690 checkmem((yyval.a_value));
3691 (yyval.a_value)->type = ATV_TRUE;
Lev Walkin418298d2006-07-13 08:24:20 +00003692 }
3693 break;
3694
Lev Walkin4a4543f2006-10-13 12:37:39 +00003695 case 159:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003696#line 1515 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003697 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003698 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
3699 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00003700 }
3701 break;
3702
Lev Walkin4a4543f2006-10-13 12:37:39 +00003703 case 160:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003704#line 1519 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003705 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003706 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
3707 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00003708 }
3709 break;
3710
Lev Walkin4a4543f2006-10-13 12:37:39 +00003711 case 161:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003712#line 1523 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003713 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003714 (yyval.a_value) = (yyval.a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003715 }
3716 break;
3717
Lev Walkin4a4543f2006-10-13 12:37:39 +00003718 case 162:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003719#line 1526 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003720 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003721 (yyval.a_value) = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003722 }
3723 break;
3724
Lev Walkin4a4543f2006-10-13 12:37:39 +00003725 case 163:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003726#line 1532 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003727 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003728 asn1p_ref_t *ref;
3729 int ret;
3730 ref = asn1p_ref_new(yylineno);
3731 checkmem(ref);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003732 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
Lev Walkinf15320b2004-06-03 03:38:44 +00003733 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003734 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3735 checkmem((yyval.a_value));
3736 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003737 }
3738 break;
3739
Lev Walkin4a4543f2006-10-13 12:37:39 +00003740 case 164:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003741#line 1543 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003742 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003743 asn1p_ref_t *ref;
3744 int ret;
3745 ref = asn1p_ref_new(yylineno);
3746 checkmem(ref);
3747 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3748 checkmem(ret == 0);
3749 ret = asn1p_ref_add_component(ref, (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
3750 checkmem(ret == 0);
3751 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3752 checkmem((yyval.a_value));
3753 free((yyvsp[(1) - (3)].tv_str));
3754 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003755 }
3756 break;
3757
Lev Walkin4a4543f2006-10-13 12:37:39 +00003758 case 165:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003759#line 1561 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003760 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003761 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len, 0);
3762 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00003763 }
3764 break;
3765
Lev Walkin4a4543f2006-10-13 12:37:39 +00003766 case 166:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00003767#line 1565 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003768 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003769 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3770 checkmem((yyval.a_value));
3771 (yyval.a_value)->type = ATV_TUPLE;
Lev Walkin418298d2006-07-13 08:24:20 +00003772 }
3773 break;
3774
Lev Walkin4a4543f2006-10-13 12:37:39 +00003775 case 167:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003776#line 1570 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003777 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003778 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3779 checkmem((yyval.a_value));
3780 (yyval.a_value)->type = ATV_QUADRUPLE;
Lev Walkin418298d2006-07-13 08:24:20 +00003781 }
3782 break;
3783
Lev Walkin4a4543f2006-10-13 12:37:39 +00003784 case 168:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003785#line 1578 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003786 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003787 (yyval.tv_opaque).len = (yyvsp[(1) - (1)].tv_opaque).len + 1;
3788 (yyval.tv_opaque).buf = malloc((yyval.tv_opaque).len + 1);
3789 checkmem((yyval.tv_opaque).buf);
3790 (yyval.tv_opaque).buf[0] = '{';
3791 memcpy((yyval.tv_opaque).buf + 1, (yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len);
3792 (yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
3793 free((yyvsp[(1) - (1)].tv_opaque).buf);
Lev Walkin418298d2006-07-13 08:24:20 +00003794 }
3795 break;
3796
Lev Walkin4a4543f2006-10-13 12:37:39 +00003797 case 169:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003798#line 1587 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003799 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003800 int newsize = (yyvsp[(1) - (2)].tv_opaque).len + (yyvsp[(2) - (2)].tv_opaque).len;
3801 char *p = malloc(newsize + 1);
3802 checkmem(p);
3803 memcpy(p , (yyvsp[(1) - (2)].tv_opaque).buf, (yyvsp[(1) - (2)].tv_opaque).len);
3804 memcpy(p + (yyvsp[(1) - (2)].tv_opaque).len, (yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len);
3805 p[newsize] = '\0';
3806 free((yyvsp[(1) - (2)].tv_opaque).buf);
3807 free((yyvsp[(2) - (2)].tv_opaque).buf);
3808 (yyval.tv_opaque).buf = p;
3809 (yyval.tv_opaque).len = newsize;
Lev Walkin418298d2006-07-13 08:24:20 +00003810 }
3811 break;
3812
Lev Walkin0e90aa02013-03-19 16:17:13 -07003813 case 170:
3814#line 1602 "asn1p_y.y"
3815 { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
3816 break;
3817
3818 case 171:
3819#line 1603 "asn1p_y.y"
3820 { (yyval.a_type) = ASN_BASIC_NULL; }
3821 break;
3822
3823 case 172:
3824#line 1604 "asn1p_y.y"
3825 { (yyval.a_type) = ASN_BASIC_REAL; }
3826 break;
3827
3828 case 173:
3829#line 1605 "asn1p_y.y"
3830 { (yyval.a_type) = (yyvsp[(1) - (1)].a_type); }
3831 break;
3832
3833 case 174:
3834#line 1606 "asn1p_y.y"
3835 { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
3836 break;
3837
3838 case 175:
3839#line 1607 "asn1p_y.y"
3840 { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
3841 break;
3842
3843 case 176:
3844#line 1608 "asn1p_y.y"
3845 { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
3846 break;
3847
3848 case 177:
3849#line 1609 "asn1p_y.y"
3850 { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
3851 break;
3852
3853 case 178:
3854#line 1610 "asn1p_y.y"
3855 { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
3856 break;
3857
3858 case 179:
3859#line 1611 "asn1p_y.y"
3860 { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
3861 break;
3862
3863 case 180:
3864#line 1612 "asn1p_y.y"
3865 { (yyval.a_type) = ASN_BASIC_UTCTime; }
3866 break;
3867
3868 case 181:
3869#line 1613 "asn1p_y.y"
3870 { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
3871 break;
3872
3873 case 182:
3874#line 1614 "asn1p_y.y"
3875 { (yyval.a_type) = (yyvsp[(1) - (1)].a_type); }
3876 break;
3877
3878 case 183:
3879#line 1621 "asn1p_y.y"
3880 { (yyval.a_type) = ASN_BASIC_INTEGER; }
3881 break;
3882
3883 case 184:
3884#line 1622 "asn1p_y.y"
3885 { (yyval.a_type) = ASN_BASIC_ENUMERATED; }
3886 break;
3887
3888 case 185:
3889#line 1623 "asn1p_y.y"
3890 { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
3891 break;
3892
Lev Walkin4a4543f2006-10-13 12:37:39 +00003893 case 186:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003894#line 1627 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003895 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003896 (yyval.a_expr) = NEW_EXPR();
3897 checkmem((yyval.a_expr));
3898 (yyval.a_expr)->expr_type = (yyvsp[(1) - (1)].a_type);
3899 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003900 }
3901 break;
3902
Lev Walkin4a4543f2006-10-13 12:37:39 +00003903 case 187:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003904#line 1633 "asn1p_y.y"
3905 {
3906 if((yyvsp[(2) - (2)].a_expr)) {
3907 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3908 } else {
3909 (yyval.a_expr) = NEW_EXPR();
3910 checkmem((yyval.a_expr));
3911 }
3912 (yyval.a_expr)->expr_type = (yyvsp[(1) - (2)].a_type);
3913 (yyval.a_expr)->meta_type = AMT_TYPE;
3914 }
Lev Walkin418298d2006-07-13 08:24:20 +00003915 break;
3916
Lev Walkin4a4543f2006-10-13 12:37:39 +00003917 case 188:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003918#line 1646 "asn1p_y.y"
3919 { (yyval.a_type) = ASN_STRING_BMPString; }
3920 break;
3921
3922 case 189:
3923#line 1647 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003924 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003925 (yyval.a_type) = ASN_STRING_GeneralString;
Lev Walkin9c974182004-09-15 11:59:51 +00003926 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003927 }
3928 break;
3929
Lev Walkin0e90aa02013-03-19 16:17:13 -07003930 case 190:
3931#line 1651 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003932 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003933 (yyval.a_type) = ASN_STRING_GraphicString;
Lev Walkin9c974182004-09-15 11:59:51 +00003934 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003935 }
3936 break;
3937
Lev Walkin4a4543f2006-10-13 12:37:39 +00003938 case 191:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003939#line 1655 "asn1p_y.y"
3940 { (yyval.a_type) = ASN_STRING_IA5String; }
Lev Walkin418298d2006-07-13 08:24:20 +00003941 break;
3942
Lev Walkin4a4543f2006-10-13 12:37:39 +00003943 case 192:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003944#line 1656 "asn1p_y.y"
3945 { (yyval.a_type) = ASN_STRING_ISO646String; }
Lev Walkin418298d2006-07-13 08:24:20 +00003946 break;
3947
Lev Walkin4a4543f2006-10-13 12:37:39 +00003948 case 193:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003949#line 1657 "asn1p_y.y"
3950 { (yyval.a_type) = ASN_STRING_NumericString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003951 break;
3952
Lev Walkin4a4543f2006-10-13 12:37:39 +00003953 case 194:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003954#line 1658 "asn1p_y.y"
3955 { (yyval.a_type) = ASN_STRING_PrintableString; }
3956 break;
3957
3958 case 195:
3959#line 1659 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003960 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003961 (yyval.a_type) = ASN_STRING_T61String;
Lev Walkin9c974182004-09-15 11:59:51 +00003962 fprintf(stderr, "WARNING: T61String is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003963 }
3964 break;
3965
Lev Walkin4a4543f2006-10-13 12:37:39 +00003966 case 196:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003967#line 1663 "asn1p_y.y"
3968 { (yyval.a_type) = ASN_STRING_TeletexString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003969 break;
3970
Lev Walkin4a4543f2006-10-13 12:37:39 +00003971 case 197:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003972#line 1664 "asn1p_y.y"
3973 { (yyval.a_type) = ASN_STRING_UniversalString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003974 break;
3975
Lev Walkin4a4543f2006-10-13 12:37:39 +00003976 case 198:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003977#line 1665 "asn1p_y.y"
3978 { (yyval.a_type) = ASN_STRING_UTF8String; }
3979 break;
3980
3981 case 199:
3982#line 1666 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003983 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003984 (yyval.a_type) = ASN_STRING_VideotexString;
Lev Walkin9c974182004-09-15 11:59:51 +00003985 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003986 }
3987 break;
3988
Lev Walkin4a4543f2006-10-13 12:37:39 +00003989 case 200:
Lev Walkin0e90aa02013-03-19 16:17:13 -07003990#line 1670 "asn1p_y.y"
3991 { (yyval.a_type) = ASN_STRING_VisibleString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003992 break;
3993
Lev Walkin0e90aa02013-03-19 16:17:13 -07003994 case 201:
3995#line 1671 "asn1p_y.y"
3996 { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
Lev Walkin418298d2006-07-13 08:24:20 +00003997 break;
3998
Lev Walkin4a4543f2006-10-13 12:37:39 +00003999 case 206:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004000#line 1682 "asn1p_y.y"
4001 { (yyval.a_constr) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00004002 break;
4003
Lev Walkin0e90aa02013-03-19 16:17:13 -07004004 case 207:
4005#line 1683 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004006 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004007 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004008 }
4009 break;
4010
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004011 case 209:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004012#line 1693 "asn1p_y.y"
4013 {
4014 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (1)].a_constr), 0);
4015 }
4016 break;
4017
4018 case 210:
4019#line 1696 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004020 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004021 /*
4022 * This is a special case, for compatibility purposes.
Lev Walkinf59d0752004-08-18 04:59:12 +00004023 * It goes without parentheses.
Lev Walkinf15320b2004-06-03 03:38:44 +00004024 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07004025 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[(3) - (4)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004026 }
4027 break;
4028
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004029 case 211:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004030#line 1706 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004031 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004032 (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004033 }
4034 break;
4035
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004036 case 212:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004037#line 1709 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004038 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004039 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (4)].a_constr), (yyvsp[(3) - (4)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004040 }
4041 break;
4042
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004043 case 213:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004044#line 1715 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004045 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004046 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4047 (yyval.a_constr)->type = ACT_EL_EXT;
Lev Walkin418298d2006-07-13 08:24:20 +00004048 }
4049 break;
4050
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004051 case 214:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004052#line 1719 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004053 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004054 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004055 }
4056 break;
4057
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004058 case 215:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004059#line 1722 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004060 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004061 asn1p_constraint_t *ct;
4062 ct = asn1p_constraint_new(yylineno);
Lev Walkinf15320b2004-06-03 03:38:44 +00004063 ct->type = ACT_EL_EXT;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004064 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
Lev Walkin418298d2006-07-13 08:24:20 +00004065 }
4066 break;
4067
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004068 case 216:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004069#line 1728 "asn1p_y.y"
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004070 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004071 asn1p_constraint_t *ct;
4072 ct = asn1p_constraint_new(yylineno);
4073 ct->type = ACT_EL_EXT;
4074 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (5)].a_constr), ct);
4075 ct = (yyval.a_constr);
4076 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[(5) - (5)].a_constr));
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004077 }
4078 break;
4079
Lev Walkin0e90aa02013-03-19 16:17:13 -07004080 case 217:
4081#line 1736 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004082 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004083 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004084 }
4085 break;
4086
Lev Walkin0e90aa02013-03-19 16:17:13 -07004087 case 219:
4088#line 1743 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004089 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004090 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004091 }
4092 break;
4093
Lev Walkin0e90aa02013-03-19 16:17:13 -07004094 case 221:
4095#line 1750 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004096 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004097 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_UNI, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004098 }
4099 break;
4100
Lev Walkin0e90aa02013-03-19 16:17:13 -07004101 case 223:
4102#line 1757 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004103 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004104 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_INT, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004105 }
4106 break;
4107
Lev Walkin4a4543f2006-10-13 12:37:39 +00004108 case 225:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004109#line 1765 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004110 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004111 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_EXC, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004112 }
4113 break;
4114
Lev Walkin4a4543f2006-10-13 12:37:39 +00004115 case 226:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004116#line 1771 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004117 {
Lev Walkinf59d0752004-08-18 04:59:12 +00004118 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004119 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4120 checkmem((yyval.a_constr));
4121 (yyval.a_constr)->type = (yyvsp[(1) - (4)].a_ctype);
4122 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(3) - (4)].a_constr));
Lev Walkinf59d0752004-08-18 04:59:12 +00004123 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004124 }
4125 break;
4126
Lev Walkin4a4543f2006-10-13 12:37:39 +00004127 case 227:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004128#line 1779 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004129 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004130 int ret;
4131 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4132 checkmem((yyval.a_constr));
4133 (yyval.a_constr)->type = ACT_CA_SET;
4134 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
4135 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004136 }
4137 break;
4138
Lev Walkin4a4543f2006-10-13 12:37:39 +00004139 case 228:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004140#line 1787 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004141 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004142 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4143 checkmem((yyval.a_constr));
4144 (yyval.a_constr)->type = ACT_EL_VALUE;
4145 (yyval.a_constr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004146 }
4147 break;
4148
Lev Walkinf1727152006-09-21 01:50:37 +00004149 case 229:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004150#line 1793 "asn1p_y.y"
Lev Walkinf1727152006-09-21 01:50:37 +00004151 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004152 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4153 checkmem((yyval.a_constr));
4154 (yyval.a_constr)->type = ACT_EL_TYPE;
4155 (yyval.a_constr)->containedSubtype = (yyvsp[(1) - (1)].a_value);
Lev Walkinf1727152006-09-21 01:50:37 +00004156 }
4157 break;
4158
4159 case 230:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004160#line 1799 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004161 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004162 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4163 checkmem((yyval.a_constr));
4164 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4165 (yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
4166 (yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004167 }
4168 break;
4169
4170 case 231:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004171#line 1806 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004172 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004173 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4174 checkmem((yyval.a_constr));
4175 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4176 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
4177 (yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
4178 (yyval.a_constr)->range_start->type = ATV_MIN;
Lev Walkin4a4543f2006-10-13 12:37:39 +00004179 }
4180 break;
4181
4182 case 232:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004183#line 1814 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00004184 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004185 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4186 checkmem((yyval.a_constr));
4187 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4188 (yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
4189 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
4190 (yyval.a_constr)->range_stop->type = ATV_MAX;
Lev Walkina9532f42006-09-17 04:52:50 +00004191 }
4192 break;
4193
Lev Walkin4a4543f2006-10-13 12:37:39 +00004194 case 233:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004195#line 1822 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00004196 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004197 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4198 checkmem((yyval.a_constr));
4199 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4200 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
4201 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
4202 (yyval.a_constr)->range_start->type = ATV_MIN;
4203 (yyval.a_constr)->range_stop->type = ATV_MAX;
Lev Walkin866bd7f2006-09-14 10:35:20 +00004204 }
4205 break;
4206
Lev Walkin4a4543f2006-10-13 12:37:39 +00004207 case 234:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004208#line 1831 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004209 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004210 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004211 }
4212 break;
4213
Lev Walkin4a4543f2006-10-13 12:37:39 +00004214 case 235:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004215#line 1834 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004216 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004217 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004218 }
4219 break;
4220
Lev Walkin4a4543f2006-10-13 12:37:39 +00004221 case 236:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004222#line 1840 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004223 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004224 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4225 (yyval.a_constr)->type = ACT_CT_PATTERN;
4226 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len, 0);
Lev Walkin5c541f12006-10-18 18:40:14 +00004227 }
4228 break;
4229
4230 case 237:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004231#line 1845 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004232 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004233 asn1p_ref_t *ref;
4234 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4235 (yyval.a_constr)->type = ACT_CT_PATTERN;
4236 ref = asn1p_ref_new(yylineno);
4237 asn1p_ref_add_component(ref, (yyvsp[(2) - (2)].tv_str), RLT_lowercase);
4238 (yyval.a_constr)->value = asn1p_value_fromref(ref, 0);
Lev Walkin5c541f12006-10-18 18:40:14 +00004239 }
4240 break;
4241
4242 case 238:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004243#line 1856 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004244 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004245 (yyval.a_ctype) = ACT_CT_SIZE;
Lev Walkin5c541f12006-10-18 18:40:14 +00004246 }
4247 break;
4248
4249 case 239:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004250#line 1859 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004251 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004252 (yyval.a_ctype) = ACT_CT_FROM;
Lev Walkin418298d2006-07-13 08:24:20 +00004253 }
4254 break;
4255
Lev Walkin5c541f12006-10-18 18:40:14 +00004256 case 240:
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004257#line 1865 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004258 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004259 (yyval.a_value) = asn1p_value_fromint(0);
4260 checkmem((yyval.a_value));
4261 (yyval.a_value)->type = ATV_FALSE;
Lev Walkin418298d2006-07-13 08:24:20 +00004262 }
4263 break;
4264
Lev Walkin0e90aa02013-03-19 16:17:13 -07004265 case 241:
4266#line 1870 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004267 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004268 (yyval.a_value) = asn1p_value_fromint(1);
4269 checkmem((yyval.a_value));
4270 (yyval.a_value)->type = ATV_TRUE;
Lev Walkin418298d2006-07-13 08:24:20 +00004271 }
4272 break;
4273
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004274 case 245:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004275#line 1878 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004276 {
Lev Walkinc8092cb2005-02-18 16:34:21 +00004277 asn1p_ref_t *ref;
4278 int ret;
4279 ref = asn1p_ref_new(yylineno);
4280 checkmem(ref);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004281 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
Lev Walkinc8092cb2005-02-18 16:34:21 +00004282 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004283 (yyval.a_value) = asn1p_value_fromref(ref, 0);
4284 checkmem((yyval.a_value));
4285 free((yyvsp[(1) - (1)].tv_str));
4286 }
4287 break;
4288
4289 case 246:
4290#line 1892 "asn1p_y.y"
4291 {
4292 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
4293 checkmem((yyval.a_value));
4294 }
4295 break;
4296
4297 case 247:
4298#line 1896 "asn1p_y.y"
4299 {
4300 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
4301 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00004302 }
4303 break;
4304
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004305 case 248:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004306#line 1903 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004307 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004308 asn1p_ref_t *ref;
4309 int ret;
4310 ref = asn1p_ref_new(yylineno);
4311 checkmem(ref);
4312 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_UNKNOWN);
4313 checkmem(ret == 0);
4314 (yyval.a_value) = asn1p_value_fromref(ref, 0);
4315 checkmem((yyval.a_value));
4316 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004317 }
4318 break;
4319
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004320 case 249:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004321#line 1917 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004322 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004323 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004324 }
4325 break;
4326
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004327 case 250:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004328#line 1920 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004329 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004330 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[(4) - (5)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004331 }
4332 break;
4333
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004334 case 251:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004335#line 1926 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004336 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004337 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004338 }
4339 break;
4340
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004341 case 252:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004342#line 1929 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004343 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004344 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[(1) - (3)].a_constr), (yyvsp[(3) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004345 }
4346 break;
4347
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004348 case 253:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004349#line 1935 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004350 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004351 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4352 checkmem((yyval.a_constr));
4353 (yyval.a_constr)->type = ACT_EL_EXT;
4354 (yyval.a_constr)->value = asn1p_value_frombuf("...", 3, 1);
Lev Walkin418298d2006-07-13 08:24:20 +00004355 }
4356 break;
4357
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004358 case 254:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004359#line 1941 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004360 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004361 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4362 checkmem((yyval.a_constr));
4363 (yyval.a_constr)->type = ACT_EL_VALUE;
4364 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(1) - (3)].tv_str), strlen((yyvsp[(1) - (3)].tv_str)), 0);
4365 (yyval.a_constr)->presence = (yyvsp[(3) - (3)].a_pres);
4366 if((yyvsp[(2) - (3)].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004367 }
4368 break;
4369
Lev Walkin0e90aa02013-03-19 16:17:13 -07004370 case 255:
4371#line 1955 "asn1p_y.y"
4372 { (yyval.a_pres) = ACPRES_DEFAULT; }
4373 break;
4374
4375 case 256:
4376#line 1956 "asn1p_y.y"
4377 { (yyval.a_pres) = (yyvsp[(1) - (1)].a_pres); }
4378 break;
4379
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004380 case 257:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004381#line 1960 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004382 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004383 (yyval.a_pres) = ACPRES_PRESENT;
Lev Walkin418298d2006-07-13 08:24:20 +00004384 }
4385 break;
4386
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004387 case 258:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004388#line 1963 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004389 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004390 (yyval.a_pres) = ACPRES_ABSENT;
Lev Walkin418298d2006-07-13 08:24:20 +00004391 }
4392 break;
4393
Lev Walkin0e90aa02013-03-19 16:17:13 -07004394 case 259:
4395#line 1966 "asn1p_y.y"
4396 {
4397 (yyval.a_pres) = ACPRES_OPTIONAL;
4398 }
Lev Walkina9532f42006-09-17 04:52:50 +00004399 break;
4400
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004401 case 263:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004402#line 1981 "asn1p_y.y"
4403 { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin418298d2006-07-13 08:24:20 +00004404 break;
4405
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004406 case 264:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004407#line 1981 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00004408 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004409 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4410 checkmem((yyval.a_constr));
4411 (yyval.a_constr)->type = ACT_CT_CTDBY;
4412 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(5) - (5)].tv_opaque).buf, (yyvsp[(5) - (5)].tv_opaque).len, 0);
4413 checkmem((yyval.a_constr)->value);
4414 (yyval.a_constr)->value->type = ATV_UNPARSED;
Lev Walkina9532f42006-09-17 04:52:50 +00004415 }
4416 break;
4417
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004418 case 265:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004419#line 1992 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004420 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004421 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4422 (yyval.a_constr)->type = ACT_CT_CTNG;
4423 (yyval.a_constr)->value = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08004424 asn1p_expr_free((yyvsp[(2) - (2)].a_expr));
Lev Walkin4a4543f2006-10-13 12:37:39 +00004425 }
4426 break;
4427
Lev Walkin0e90aa02013-03-19 16:17:13 -07004428 case 266:
4429#line 2000 "asn1p_y.y"
4430 { (yyval.a_ctype) = ACT_EL_RANGE; }
4431 break;
4432
4433 case 267:
4434#line 2001 "asn1p_y.y"
4435 { (yyval.a_ctype) = ACT_EL_RLRANGE; }
4436 break;
4437
4438 case 268:
4439#line 2002 "asn1p_y.y"
4440 { (yyval.a_ctype) = ACT_EL_LLRANGE; }
4441 break;
4442
4443 case 269:
4444#line 2003 "asn1p_y.y"
4445 { (yyval.a_ctype) = ACT_EL_ULRANGE; }
4446 break;
4447
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004448 case 270:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004449#line 2006 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004450 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004451 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004452 }
4453 break;
4454
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004455 case 271:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004456#line 2009 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004457 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004458 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004459 }
4460 break;
4461
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004462 case 272:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004463#line 2018 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004464 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004465 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
4466 asn1p_constraint_t *ct;
4467 int ret;
4468 ret = asn1p_ref_add_component(ref, (yyvsp[(2) - (3)].tv_str), 0);
4469 checkmem(ret == 0);
4470 ct = asn1p_constraint_new(yylineno);
4471 checkmem((yyval.a_constr));
4472 ct->type = ACT_EL_VALUE;
4473 ct->value = asn1p_value_fromref(ref, 0);
4474 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004475 }
4476 break;
4477
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004478 case 273:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004479#line 2033 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004480 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004481 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, (yyvsp[(1) - (4)].a_constr), (yyvsp[(3) - (4)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004482 }
4483 break;
4484
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004485 case 274:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004486#line 2039 "asn1p_y.y"
4487 {
4488 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4489 checkmem((yyval.a_constr));
4490 (yyval.a_constr)->type = ACT_EL_VALUE;
4491 (yyval.a_constr)->value = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
4492 }
4493 break;
4494
4495 case 275:
4496#line 2045 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004497 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004498 asn1p_constraint_t *ct;
4499 ct = asn1p_constraint_new(yylineno);
4500 checkmem(ct);
4501 ct->type = ACT_EL_VALUE;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004502 ct->value = asn1p_value_fromref((yyvsp[(3) - (3)].a_ref), 0);
4503 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
Lev Walkin418298d2006-07-13 08:24:20 +00004504 }
4505 break;
4506
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004507 case 276:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004508#line 2059 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004509 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004510 char *p = malloc(strlen((yyvsp[(2) - (2)].tv_str)) + 2);
Lev Walkinf15320b2004-06-03 03:38:44 +00004511 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004512 *p = '@';
4513 strcpy(p + 1, (yyvsp[(2) - (2)].tv_str));
4514 (yyval.a_ref) = asn1p_ref_new(yylineno);
4515 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
Lev Walkinf15320b2004-06-03 03:38:44 +00004516 checkmem(ret == 0);
4517 free(p);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004518 free((yyvsp[(2) - (2)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004519 }
4520 break;
4521
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004522 case 277:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004523#line 2070 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004524 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004525 char *p = malloc(strlen((yyvsp[(3) - (3)].tv_str)) + 3);
4526 int ret;
4527 p[0] = '@';
4528 p[1] = '.';
4529 strcpy(p + 2, (yyvsp[(3) - (3)].tv_str));
4530 (yyval.a_ref) = asn1p_ref_new(yylineno);
4531 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
4532 checkmem(ret == 0);
4533 free(p);
4534 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004535 }
4536 break;
4537
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004538 case 278:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004539#line 2086 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004540 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004541 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00004542 }
4543 break;
4544
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004545 case 279:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004546#line 2089 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004547 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004548 int l1 = strlen((yyvsp[(1) - (3)].tv_str));
4549 int l3 = strlen((yyvsp[(3) - (3)].tv_str));
4550 (yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
4551 memcpy((yyval.tv_str), (yyvsp[(1) - (3)].tv_str), l1);
4552 (yyval.tv_str)[l1] = '.';
4553 memcpy((yyval.tv_str) + l1 + 1, (yyvsp[(3) - (3)].tv_str), l3);
4554 (yyval.tv_str)[l1 + 1 + l3] = '\0';
Lev Walkin418298d2006-07-13 08:24:20 +00004555 }
4556 break;
4557
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004558 case 280:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004559#line 2107 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004560 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004561 (yyval.a_marker).flags = EM_NOMARK;
4562 (yyval.a_marker).default_value = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00004563 }
4564 break;
4565
Lev Walkin0e90aa02013-03-19 16:17:13 -07004566 case 281:
4567#line 2111 "asn1p_y.y"
4568 { (yyval.a_marker) = (yyvsp[(1) - (1)].a_marker); }
4569 break;
4570
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004571 case 282:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004572#line 2115 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004573 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004574 (yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
4575 (yyval.a_marker).default_value = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00004576 }
4577 break;
4578
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004579 case 283:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004580#line 2119 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004581 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004582 (yyval.a_marker).flags = EM_DEFAULT;
4583 (yyval.a_marker).default_value = (yyvsp[(2) - (2)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004584 }
4585 break;
4586
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004587 case 284:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004588#line 2142 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004589 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004590 (yyval.a_expr) = NEW_EXPR();
4591 checkmem((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004592 }
4593 break;
4594
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004595 case 285:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004596#line 2146 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004597 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004598 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00004599 }
4600 break;
4601
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004602 case 286:
4603#line 2152 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004604 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004605 (yyval.a_expr) = NEW_EXPR();
4606 checkmem((yyval.a_expr));
4607 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004608 }
4609 break;
4610
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004611 case 287:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004612#line 2157 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004613 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004614 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4615 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004616 }
4617 break;
4618
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004619 case 288:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004620#line 2164 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004621 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004622 (yyval.a_expr) = NEW_EXPR();
4623 checkmem((yyval.a_expr));
4624 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4625 (yyval.a_expr)->meta_type = AMT_VALUE;
4626 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004627 }
4628 break;
4629
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004630 case 289:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004631#line 2171 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004632 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004633 (yyval.a_expr) = NEW_EXPR();
4634 checkmem((yyval.a_expr));
4635 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4636 (yyval.a_expr)->meta_type = AMT_VALUE;
4637 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4638 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004639 }
4640 break;
4641
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004642 case 290:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004643#line 2179 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004644 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004645 (yyval.a_expr) = NEW_EXPR();
4646 checkmem((yyval.a_expr));
4647 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4648 (yyval.a_expr)->meta_type = AMT_VALUE;
4649 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4650 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004651 }
4652 break;
4653
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004654 case 291:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004655#line 2187 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004656 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004657 (yyval.a_expr) = NEW_EXPR();
4658 checkmem((yyval.a_expr));
4659 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4660 (yyval.a_expr)->meta_type = AMT_VALUE;
4661 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004662 }
4663 break;
4664
Lev Walkin5c541f12006-10-18 18:40:14 +00004665 case 292:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004666#line 2194 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004667 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004668 (yyval.a_expr) = NEW_EXPR();
4669 checkmem((yyval.a_expr));
4670 (yyval.a_expr)->Identifier = strdup("...");
4671 checkmem((yyval.a_expr)->Identifier);
4672 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
4673 (yyval.a_expr)->meta_type = AMT_VALUE;
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004674 }
4675 break;
4676
4677 case 293:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004678#line 2205 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004679 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004680 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4681 checkmem((yyval.a_value));
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004682 }
4683 break;
4684
Lev Walkin0e90aa02013-03-19 16:17:13 -07004685 case 294:
4686#line 2209 "asn1p_y.y"
Lev Walkinadf863f2006-09-05 16:18:34 +00004687 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004688 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4689 checkmem((yyval.a_value));
Lev Walkinadf863f2006-09-05 16:18:34 +00004690 }
Lev Walkin418298d2006-07-13 08:24:20 +00004691 break;
4692
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004693 case 296:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004694#line 2217 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004695 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004696 (yyval.a_value) = asn1p_value_fromdouble((yyvsp[(1) - (1)].a_dbl));
4697 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00004698 }
4699 break;
4700
Lev Walkin0e90aa02013-03-19 16:17:13 -07004701 case 297:
4702#line 2248 "asn1p_y.y"
4703 { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
4704 break;
4705
4706 case 298:
4707#line 2249 "asn1p_y.y"
4708 { (yyval.a_tag) = (yyvsp[(1) - (1)].a_tag); }
4709 break;
4710
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004711 case 299:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004712#line 2253 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004713 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004714 (yyval.a_tag) = (yyvsp[(1) - (2)].a_tag);
4715 (yyval.a_tag).tag_mode = (yyvsp[(2) - (2)].a_tag).tag_mode;
Lev Walkin418298d2006-07-13 08:24:20 +00004716 }
4717 break;
4718
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004719 case 300:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004720#line 2260 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004721 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004722 (yyval.a_tag) = (yyvsp[(2) - (4)].a_tag);
4723 (yyval.a_tag).tag_value = (yyvsp[(3) - (4)].a_int);
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004724 }
Lev Walkin5c541f12006-10-18 18:40:14 +00004725 break;
4726
Lev Walkin0e90aa02013-03-19 16:17:13 -07004727 case 301:
4728#line 2266 "asn1p_y.y"
4729 { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
4730 break;
4731
4732 case 302:
4733#line 2267 "asn1p_y.y"
4734 { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
4735 break;
4736
4737 case 303:
4738#line 2268 "asn1p_y.y"
4739 { (yyval.a_tag).tag_class = TC_APPLICATION; }
4740 break;
4741
4742 case 304:
4743#line 2269 "asn1p_y.y"
4744 { (yyval.a_tag).tag_class = TC_PRIVATE; }
4745 break;
4746
4747 case 305:
4748#line 2273 "asn1p_y.y"
4749 { (yyval.a_tag).tag_mode = TM_DEFAULT; }
4750 break;
4751
4752 case 306:
4753#line 2274 "asn1p_y.y"
4754 { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
4755 break;
4756
4757 case 307:
4758#line 2275 "asn1p_y.y"
4759 { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
4760 break;
4761
Lev Walkin5c541f12006-10-18 18:40:14 +00004762 case 308:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004763#line 2279 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004764 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004765 checkmem((yyvsp[(1) - (1)].tv_str));
4766 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin5c541f12006-10-18 18:40:14 +00004767 }
4768 break;
4769
4770 case 309:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004771#line 2283 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004772 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004773 checkmem((yyvsp[(1) - (1)].tv_str));
4774 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004775 }
4776 break;
4777
4778 case 310:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004779#line 2291 "asn1p_y.y"
4780 {
4781 checkmem((yyvsp[(1) - (1)].tv_str));
4782 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4783 }
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004784 break;
4785
4786 case 311:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004787#line 2298 "asn1p_y.y"
4788 { (yyval.tv_str) = 0; }
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004789 break;
4790
4791 case 312:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004792#line 2299 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00004793 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004794 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4795 }
4796 break;
4797
4798 case 313:
4799#line 2305 "asn1p_y.y"
4800 {
4801 checkmem((yyvsp[(1) - (1)].tv_str));
4802 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin866bd7f2006-09-14 10:35:20 +00004803 }
4804 break;
4805
Lev Walkin418298d2006-07-13 08:24:20 +00004806
Lev Walkin0e90aa02013-03-19 16:17:13 -07004807/* Line 1267 of yacc.c. */
Lev Walkina964e032017-03-26 03:48:06 -07004808#line 4799 "asn1p_y.c"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004809 default: break;
Lev Walkin418298d2006-07-13 08:24:20 +00004810 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07004811 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Lev Walkin418298d2006-07-13 08:24:20 +00004812
Lev Walkin0e90aa02013-03-19 16:17:13 -07004813 YYPOPSTACK (yylen);
4814 yylen = 0;
4815 YY_STACK_PRINT (yyss, yyssp);
Lev Walkinf15320b2004-06-03 03:38:44 +00004816
4817 *++yyvsp = yyval;
4818
Lev Walkinf15320b2004-06-03 03:38:44 +00004819
Lev Walkin418298d2006-07-13 08:24:20 +00004820 /* Now `shift' the result of the reduction. Determine what state
4821 that goes to, based on the state we popped back to and the rule
4822 number reduced by. */
Lev Walkinf15320b2004-06-03 03:38:44 +00004823
4824 yyn = yyr1[yyn];
4825
Lev Walkin418298d2006-07-13 08:24:20 +00004826 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4827 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00004828 yystate = yytable[yystate];
4829 else
Lev Walkin418298d2006-07-13 08:24:20 +00004830 yystate = yydefgoto[yyn - YYNTOKENS];
Lev Walkinf15320b2004-06-03 03:38:44 +00004831
4832 goto yynewstate;
4833
Lev Walkinf15320b2004-06-03 03:38:44 +00004834
Lev Walkin418298d2006-07-13 08:24:20 +00004835/*------------------------------------.
4836| yyerrlab -- here on detecting error |
4837`------------------------------------*/
4838yyerrlab:
4839 /* If not already recovering from an error, report this error. */
4840 if (!yyerrstatus)
Lev Walkinf15320b2004-06-03 03:38:44 +00004841 {
4842 ++yynerrs;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004843#if ! YYERROR_VERBOSE
4844 yyerror (YY_("syntax error"));
4845#else
4846 {
4847 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4848 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4849 {
4850 YYSIZE_T yyalloc = 2 * yysize;
4851 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4852 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4853 if (yymsg != yymsgbuf)
Lev Walkin418298d2006-07-13 08:24:20 +00004854 YYSTACK_FREE (yymsg);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004855 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4856 if (yymsg)
4857 yymsg_alloc = yyalloc;
4858 else
4859 {
4860 yymsg = yymsgbuf;
4861 yymsg_alloc = sizeof yymsgbuf;
4862 }
4863 }
4864
4865 if (0 < yysize && yysize <= yymsg_alloc)
4866 {
4867 (void) yysyntax_error (yymsg, yystate, yychar);
4868 yyerror (yymsg);
4869 }
4870 else
4871 {
4872 yyerror (YY_("syntax error"));
4873 if (yysize != 0)
4874 goto yyexhaustedlab;
4875 }
4876 }
4877#endif
4878 }
4879
4880
4881
4882 if (yyerrstatus == 3)
4883 {
4884 /* If just tried and failed to reuse look-ahead token after an
4885 error, discard it. */
4886
4887 if (yychar <= YYEOF)
4888 {
4889 /* Return failure if at end of input. */
4890 if (yychar == YYEOF)
4891 YYABORT;
Lev Walkinf15320b2004-06-03 03:38:44 +00004892 }
4893 else
Lev Walkin0e90aa02013-03-19 16:17:13 -07004894 {
4895 yydestruct ("Error: discarding",
4896 yytoken, &yylval);
4897 yychar = YYEMPTY;
4898 }
Lev Walkinf15320b2004-06-03 03:38:44 +00004899 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07004900
4901 /* Else will try to reuse look-ahead token after shifting the error
4902 token. */
Lev Walkina00d6b32006-03-21 03:40:38 +00004903 goto yyerrlab1;
Lev Walkinf15320b2004-06-03 03:38:44 +00004904
Lev Walkin418298d2006-07-13 08:24:20 +00004905
Lev Walkin0e90aa02013-03-19 16:17:13 -07004906/*---------------------------------------------------.
4907| yyerrorlab -- error raised explicitly by YYERROR. |
4908`---------------------------------------------------*/
4909yyerrorlab:
4910
4911 /* Pacify compilers like GCC when the user code never invokes
4912 YYERROR and the label yyerrorlab therefore never appears in user
4913 code. */
4914 if (/*CONSTCOND*/ 0)
4915 goto yyerrorlab;
4916
4917 /* Do not reclaim the symbols of the rule which action triggered
4918 this YYERROR. */
4919 YYPOPSTACK (yylen);
4920 yylen = 0;
4921 YY_STACK_PRINT (yyss, yyssp);
4922 yystate = *yyssp;
4923 goto yyerrlab1;
4924
4925
4926/*-------------------------------------------------------------.
4927| yyerrlab1 -- common code for both syntax error and YYERROR. |
4928`-------------------------------------------------------------*/
Lev Walkin418298d2006-07-13 08:24:20 +00004929yyerrlab1:
Lev Walkin418298d2006-07-13 08:24:20 +00004930 yyerrstatus = 3; /* Each real token shifted decrements this. */
Lev Walkina00d6b32006-03-21 03:40:38 +00004931
Lev Walkin418298d2006-07-13 08:24:20 +00004932 for (;;)
Lev Walkina00d6b32006-03-21 03:40:38 +00004933 {
Lev Walkin418298d2006-07-13 08:24:20 +00004934 yyn = yypact[yystate];
4935 if (yyn != YYPACT_NINF)
4936 {
4937 yyn += YYTERROR;
4938 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4939 {
4940 yyn = yytable[yyn];
4941 if (0 < yyn)
4942 break;
4943 }
4944 }
4945
4946 /* Pop the current state because it cannot handle the error token. */
4947 if (yyssp == yyss)
4948 YYABORT;
4949
Lev Walkin418298d2006-07-13 08:24:20 +00004950
Lev Walkin0e90aa02013-03-19 16:17:13 -07004951 yydestruct ("Error: popping",
4952 yystos[yystate], yyvsp);
4953 YYPOPSTACK (1);
4954 yystate = *yyssp;
4955 YY_STACK_PRINT (yyss, yyssp);
Lev Walkina00d6b32006-03-21 03:40:38 +00004956 }
Lev Walkina00d6b32006-03-21 03:40:38 +00004957
Lev Walkinf15320b2004-06-03 03:38:44 +00004958 if (yyn == YYFINAL)
4959 YYACCEPT;
4960
Lev Walkinf15320b2004-06-03 03:38:44 +00004961 *++yyvsp = yylval;
Lev Walkin418298d2006-07-13 08:24:20 +00004962
Lev Walkinf15320b2004-06-03 03:38:44 +00004963
Lev Walkin0e90aa02013-03-19 16:17:13 -07004964 /* Shift the error token. */
4965 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4966
Lev Walkinf15320b2004-06-03 03:38:44 +00004967 yystate = yyn;
4968 goto yynewstate;
4969
Lev Walkina00d6b32006-03-21 03:40:38 +00004970
Lev Walkin418298d2006-07-13 08:24:20 +00004971/*-------------------------------------.
4972| yyacceptlab -- YYACCEPT comes here. |
4973`-------------------------------------*/
4974yyacceptlab:
4975 yyresult = 0;
4976 goto yyreturn;
4977
4978/*-----------------------------------.
4979| yyabortlab -- YYABORT comes here. |
4980`-----------------------------------*/
4981yyabortlab:
4982 yyresult = 1;
4983 goto yyreturn;
4984
4985#ifndef yyoverflow
Lev Walkin0e90aa02013-03-19 16:17:13 -07004986/*-------------------------------------------------.
4987| yyexhaustedlab -- memory exhaustion comes here. |
4988`-------------------------------------------------*/
4989yyexhaustedlab:
4990 yyerror (YY_("memory exhausted"));
Lev Walkin418298d2006-07-13 08:24:20 +00004991 yyresult = 2;
4992 /* Fall through. */
Lev Walkina00d6b32006-03-21 03:40:38 +00004993#endif
Lev Walkin418298d2006-07-13 08:24:20 +00004994
4995yyreturn:
Lev Walkin0e90aa02013-03-19 16:17:13 -07004996 if (yychar != YYEOF && yychar != YYEMPTY)
4997 yydestruct ("Cleanup: discarding lookahead",
4998 yytoken, &yylval);
4999 /* Do not reclaim the symbols of the rule which action triggered
5000 this YYABORT or YYACCEPT. */
5001 YYPOPSTACK (yylen);
5002 YY_STACK_PRINT (yyss, yyssp);
5003 while (yyssp != yyss)
5004 {
5005 yydestruct ("Cleanup: popping",
5006 yystos[*yyssp], yyvsp);
5007 YYPOPSTACK (1);
5008 }
Lev Walkin418298d2006-07-13 08:24:20 +00005009#ifndef yyoverflow
5010 if (yyss != yyssa)
5011 YYSTACK_FREE (yyss);
5012#endif
Lev Walkin0e90aa02013-03-19 16:17:13 -07005013#if YYERROR_VERBOSE
5014 if (yymsg != yymsgbuf)
5015 YYSTACK_FREE (yymsg);
5016#endif
5017 /* Make sure YYID is used. */
5018 return YYID (yyresult);
Lev Walkinf15320b2004-06-03 03:38:44 +00005019}
Lev Walkin418298d2006-07-13 08:24:20 +00005020
5021
Lev Walkin0e90aa02013-03-19 16:17:13 -07005022#line 2311 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +00005023
5024
5025
5026/*
5027 * Convert Xstring ('0101'B or '5'H) to the binary vector.
5028 */
5029static asn1p_value_t *
5030_convert_bitstring2binary(char *str, int base) {
5031 asn1p_value_t *val;
5032 int slen;
5033 int memlen;
5034 int baselen;
5035 int bits;
5036 uint8_t *binary_vector;
5037 uint8_t *bv_ptr;
5038 uint8_t cur_val;
5039
5040 assert(str);
5041 assert(str[0] == '\'');
5042
5043 switch(base) {
5044 case 'B':
5045 baselen = 1;
5046 break;
5047 case 'H':
5048 baselen = 4;
5049 break;
5050 default:
5051 assert(base == 'B' || base == 'H');
5052 errno = EINVAL;
5053 return NULL;
5054 }
5055
5056 slen = strlen(str);
5057 assert(str[slen - 1] == base);
5058 assert(str[slen - 2] == '\'');
5059
5060 memlen = slen / (8 / baselen); /* Conservative estimate */
5061
5062 bv_ptr = binary_vector = malloc(memlen + 1);
5063 if(bv_ptr == NULL)
5064 /* ENOMEM */
5065 return NULL;
5066
5067 cur_val = 0;
5068 bits = 0;
5069 while(*(++str) != '\'') {
5070 switch(baselen) {
5071 case 1:
5072 switch(*str) {
5073 case '1':
5074 cur_val |= 1 << (7 - (bits % 8));
5075 case '0':
5076 break;
5077 default:
5078 assert(!"_y UNREACH1");
5079 case ' ': case '\r': case '\n':
5080 continue;
5081 }
5082 break;
5083 case 4:
5084 switch(*str) {
5085 case '0': case '1': case '2': case '3': case '4':
5086 case '5': case '6': case '7': case '8': case '9':
5087 cur_val |= (*str - '0') << (4 - (bits % 8));
5088 break;
5089 case 'A': case 'B': case 'C':
5090 case 'D': case 'E': case 'F':
5091 cur_val |= ((*str - 'A') + 10)
5092 << (4 - (bits % 8));
5093 break;
5094 default:
5095 assert(!"_y UNREACH2");
5096 case ' ': case '\r': case '\n':
5097 continue;
5098 }
5099 break;
5100 }
5101
5102 bits += baselen;
5103 if((bits % 8) == 0) {
5104 *bv_ptr++ = cur_val;
5105 cur_val = 0;
5106 }
5107 }
5108
5109 *bv_ptr = cur_val;
5110 assert((bv_ptr - binary_vector) <= memlen);
5111
5112 val = asn1p_value_frombits(binary_vector, bits, 0);
5113 if(val == NULL) {
5114 free(binary_vector);
5115 }
5116
5117 return val;
5118}
5119
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00005120/*
5121 * For unnamed types (used in old X.208 compliant modules)
5122 * generate some sort of interim names, to not to force human being to fix
5123 * the specification's compliance to modern ASN.1 standards.
5124 */
5125static void
5126_fixup_anonymous_identifier(asn1p_expr_t *expr) {
5127 char *p;
5128 assert(expr->Identifier == 0);
5129
5130 /*
5131 * Try to figure out the type name
5132 * without going too much into details
5133 */
5134 expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
5135 if(expr->reference && expr->reference->comp_count > 0)
5136 expr->Identifier = expr->reference->components[0].name;
5137
5138 fprintf(stderr,
5139 "WARNING: Line %d: expected lower-case member identifier, "
5140 "found an unnamed %s.\n"
5141 "WARNING: Obsolete X.208 syntax detected, "
5142 "please give the member a name.\n",
5143 yylineno, expr->Identifier ? expr->Identifier : "type");
5144
5145 if(!expr->Identifier)
5146 expr->Identifier = "unnamed";
5147 expr->Identifier = strdup(expr->Identifier);
5148 assert(expr->Identifier);
5149 /* Make a lowercase identifier from the type name */
5150 for(p = expr->Identifier; *p; p++) {
5151 switch(*p) {
5152 case 'A' ... 'Z': *p += 32; break;
5153 case ' ': *p = '_'; break;
5154 case '-': *p = '_'; break;
5155 }
5156 }
5157 fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
5158 "Name clash may occur later.\n",
5159 expr->Identifier);
5160}
5161
Lev Walkinf15320b2004-06-03 03:38:44 +00005162int
5163yyerror(const char *msg) {
Lev Walkin9d542d22006-03-14 16:31:37 +00005164 extern char *asn1p_text;
Lev Walkinf15320b2004-06-03 03:38:44 +00005165 fprintf(stderr,
5166 "ASN.1 grammar parse error "
5167 "near line %d (token \"%s\"): %s\n",
Lev Walkinceb20e72004-09-05 10:40:41 +00005168 yylineno, asn1p_text, msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00005169 return -1;
5170}
5171
Lev Walkin418298d2006-07-13 08:24:20 +00005172