blob: 60860afcf2dbdb3c0bc4afaa346d5335ebb1d587 [file] [log] [blame]
Lev Walkin752e9732017-08-04 02:06:22 -07001/* A Bison parser, made by GNU Bison 2.3. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002
Lev Walkin752e9732017-08-04 02:06:22 -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.
7
8 This program is free software; you can redistribute it and/or modify
Lev Walkin418298d2006-07-13 08:24:20 +00009 it under the terms of the GNU General Public License as published by
Lev Walkin752e9732017-08-04 02:06:22 -070010 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
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.
Lev Walkin752e9732017-08-04 02:06:22 -070017
Lev Walkin418298d2006-07-13 08:24:20 +000018 You should have received a copy of the GNU General Public License
Lev Walkin752e9732017-08-04 02:06:22 -070019 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
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 Walkin752e9732017-08-04 02:06:22 -070032
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. */
Lev Walkin752e9732017-08-04 02:06:22 -070050#define YYBISON_VERSION "2.3"
Lev Walkin0e90aa02013-03-19 16:17:13 -070051
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
Lev Walkin752e9732017-08-04 02:06:22 -070058/* Using locations. */
59#define YYLSP_NEEDED 0
Lev Walkin418298d2006-07-13 08:24:20 +000060
Lev Walkin0e90aa02013-03-19 16:17:13 -070061/* Substitute the variable and function names. */
Lev Walkin752e9732017-08-04 02:06:22 -070062#define yyparse asn1p_parse
63#define yylex asn1p_lex
64#define yyerror asn1p_error
65#define yylval asn1p_lval
66#define yychar asn1p_char
67#define yydebug asn1p_debug
68#define yynerrs asn1p_nerrs
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,
Lev Walkin752e9732017-08-04 02:06:22 -0700177 UTF8_BOM = 358,
178 TOK_EXCEPT = 359,
179 TOK_INTERSECTION = 360,
180 TOK_UNION = 361,
181 TOK_TwoDots = 362,
182 TOK_ThreeDots = 363
Lev Walkin418298d2006-07-13 08:24:20 +0000183 };
184#endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700185/* Tokens. */
Lev Walkin418298d2006-07-13 08:24:20 +0000186#define TOK_PPEQ 258
Lev Walkin0e90aa02013-03-19 16:17:13 -0700187#define TOK_VBracketLeft 259
188#define TOK_VBracketRight 260
189#define TOK_whitespace 261
190#define TOK_opaque 262
191#define TOK_bstring 263
192#define TOK_cstring 264
193#define TOK_hstring 265
194#define TOK_identifier 266
195#define TOK_number 267
196#define TOK_number_negative 268
197#define TOK_realnumber 269
198#define TOK_tuple 270
199#define TOK_quadruple 271
200#define TOK_typereference 272
201#define TOK_capitalreference 273
202#define TOK_typefieldreference 274
203#define TOK_valuefieldreference 275
204#define TOK_Literal 276
205#define TOK_ABSENT 277
206#define TOK_ABSTRACT_SYNTAX 278
207#define TOK_ALL 279
208#define TOK_ANY 280
209#define TOK_APPLICATION 281
210#define TOK_AUTOMATIC 282
211#define TOK_BEGIN 283
212#define TOK_BIT 284
213#define TOK_BMPString 285
214#define TOK_BOOLEAN 286
215#define TOK_BY 287
216#define TOK_CHARACTER 288
217#define TOK_CHOICE 289
218#define TOK_CLASS 290
219#define TOK_COMPONENT 291
220#define TOK_COMPONENTS 292
221#define TOK_CONSTRAINED 293
222#define TOK_CONTAINING 294
223#define TOK_DEFAULT 295
224#define TOK_DEFINITIONS 296
225#define TOK_DEFINED 297
226#define TOK_EMBEDDED 298
227#define TOK_ENCODED 299
228#define TOK_ENCODING_CONTROL 300
229#define TOK_END 301
230#define TOK_ENUMERATED 302
231#define TOK_EXPLICIT 303
232#define TOK_EXPORTS 304
233#define TOK_EXTENSIBILITY 305
234#define TOK_EXTERNAL 306
235#define TOK_FALSE 307
236#define TOK_FROM 308
237#define TOK_GeneralizedTime 309
238#define TOK_GeneralString 310
239#define TOK_GraphicString 311
240#define TOK_IA5String 312
241#define TOK_IDENTIFIER 313
242#define TOK_IMPLICIT 314
243#define TOK_IMPLIED 315
244#define TOK_IMPORTS 316
245#define TOK_INCLUDES 317
246#define TOK_INSTANCE 318
247#define TOK_INSTRUCTIONS 319
248#define TOK_INTEGER 320
249#define TOK_ISO646String 321
250#define TOK_MAX 322
251#define TOK_MIN 323
252#define TOK_MINUS_INFINITY 324
253#define TOK_NULL 325
254#define TOK_NumericString 326
255#define TOK_OBJECT 327
256#define TOK_ObjectDescriptor 328
257#define TOK_OCTET 329
258#define TOK_OF 330
259#define TOK_OPTIONAL 331
260#define TOK_PATTERN 332
261#define TOK_PDV 333
262#define TOK_PLUS_INFINITY 334
263#define TOK_PRESENT 335
264#define TOK_PrintableString 336
265#define TOK_PRIVATE 337
266#define TOK_REAL 338
267#define TOK_RELATIVE_OID 339
268#define TOK_SEQUENCE 340
269#define TOK_SET 341
270#define TOK_SIZE 342
271#define TOK_STRING 343
272#define TOK_SYNTAX 344
273#define TOK_T61String 345
274#define TOK_TAGS 346
275#define TOK_TeletexString 347
276#define TOK_TRUE 348
277#define TOK_TYPE_IDENTIFIER 349
278#define TOK_UNIQUE 350
279#define TOK_UNIVERSAL 351
280#define TOK_UniversalString 352
281#define TOK_UTCTime 353
282#define TOK_UTF8String 354
283#define TOK_VideotexString 355
284#define TOK_VisibleString 356
285#define TOK_WITH 357
Lev Walkin752e9732017-08-04 02:06:22 -0700286#define UTF8_BOM 358
287#define TOK_EXCEPT 359
288#define TOK_INTERSECTION 360
289#define TOK_UNION 361
290#define TOK_TwoDots 362
291#define TOK_ThreeDots 363
Lev Walkin418298d2006-07-13 08:24:20 +0000292
293
294
Lev Walkin752e9732017-08-04 02:06:22 -0700295
296/* Copy the first part of user declarations. */
297#line 1 "asn1p_y.y"
298
299
300#include <stdlib.h>
301#include <stdio.h>
302#include <string.h>
303#include <errno.h>
304#include <assert.h>
305
306#include "asn1parser.h"
307
308#define YYPARSE_PARAM param
309#define YYPARSE_PARAM_TYPE void **
310#define YYERROR_VERBOSE
311
312int yylex(void);
313int yyerror(const char *msg);
314#ifdef YYBYACC
315int yyparse(void **param); /* byacc does not produce a prototype */
316#endif
317void asn1p_lexer_hack_push_opaque_state(void);
318void asn1p_lexer_hack_enable_with_syntax(void);
319void asn1p_lexer_hack_push_encoding_control(void);
320#define yylineno asn1p_lineno
321extern int asn1p_lineno;
322
323/*
324 * Process directives as <ASN1C:RepresentAsPointer>
325 */
326extern int asn1p_as_pointer;
327
328/*
329 * This temporary variable is used to solve the shortcomings of 1-lookahead
330 * parser.
331 */
332static struct AssignedIdentifier *saved_aid;
333
334static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
335static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
336
337static asn1p_module_t *currentModule;
338#define NEW_EXPR() (asn1p_expr_new(yylineno, currentModule))
339
340#define checkmem(ptr) do { \
341 if(!(ptr)) \
342 return yyerror("Memory failure"); \
343 } while(0)
344
345#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
346 if(arg1->type != constr_type) { \
347 int __ret; \
348 root = asn1p_constraint_new(yylineno, currentModule); \
349 checkmem(root); \
350 root->type = constr_type; \
351 __ret = asn1p_constraint_insert(root, \
352 arg1); \
353 checkmem(__ret == 0); \
354 } else { \
355 root = arg1; \
356 } \
357 if(arg2) { \
358 int __ret \
359 = asn1p_constraint_insert(root, arg2); \
360 checkmem(__ret == 0); \
361 } \
362 } while(0)
363
364#ifdef AL_IMPORT
365#error AL_IMPORT DEFINED ELSEWHERE!
366#endif
367#define AL_IMPORT(to,where,from,field) do { \
368 if(!(from)) break; \
369 while(TQ_FIRST(&((from)->where))) { \
370 TQ_ADD(&((to)->where), \
371 TQ_REMOVE(&((from)->where), field), \
372 field); \
373 } \
374 assert(TQ_FIRST(&((from)->where)) == 0); \
375 } while(0)
376
377
378
379/* Enabling traces. */
380#ifndef YYDEBUG
381# define YYDEBUG 0
382#endif
383
384/* Enabling verbose error messages. */
385#ifdef YYERROR_VERBOSE
386# undef YYERROR_VERBOSE
387# define YYERROR_VERBOSE 1
388#else
389# define YYERROR_VERBOSE 0
390#endif
391
392/* Enabling the token table. */
393#ifndef YYTOKEN_TABLE
394# define YYTOKEN_TABLE 0
395#endif
396
Lev Walkin0e90aa02013-03-19 16:17:13 -0700397#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
398typedef union YYSTYPE
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +0800399#line 88 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -0700400{
Lev Walkinf15320b2004-06-03 03:38:44 +0000401 asn1p_t *a_grammar;
402 asn1p_module_flags_e a_module_flags;
403 asn1p_module_t *a_module;
404 asn1p_expr_type_e a_type; /* ASN.1 Type */
405 asn1p_expr_t *a_expr; /* Constructed collection */
406 asn1p_constraint_t *a_constr; /* Constraint */
407 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
408 asn1p_xports_t *a_xports; /* IMports/EXports */
Lev Walkinb36317c2005-08-12 10:09:10 +0000409 struct AssignedIdentifier a_aid; /* Assigned Identifier */
Lev Walkinf15320b2004-06-03 03:38:44 +0000410 asn1p_oid_t *a_oid; /* Object Identifier */
411 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
412 struct asn1p_type_tag_s a_tag; /* A tag */
413 asn1p_ref_t *a_ref; /* Reference to custom type */
414 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
415 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
416 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
417 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
418 struct asn1p_param_s a_parg; /* A parameter argument */
419 asn1p_paramlist_t *a_plist; /* A pargs list */
Lev Walkin9c974182004-09-15 11:59:51 +0000420 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
Lev Walkinf15320b2004-06-03 03:38:44 +0000421 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
Lev Walkind21c5052004-09-29 13:18:09 +0000422 asn1c_integer_t a_int;
Lev Walkinadf863f2006-09-05 16:18:34 +0000423 double a_dbl;
Lev Walkinf15320b2004-06-03 03:38:44 +0000424 char *tv_str;
425 struct {
426 char *buf;
427 int len;
428 } tv_opaque;
429 struct {
430 char *name;
431 struct asn1p_type_tag_s tag;
432 } tv_nametag;
Lev Walkin752e9732017-08-04 02:06:22 -0700433}
434/* Line 193 of yacc.c. */
435#line 436 "asn1p_y.c"
436 YYSTYPE;
Lev Walkin0e90aa02013-03-19 16:17:13 -0700437# define yystype YYSTYPE /* obsolescent; will be withdrawn */
438# define YYSTYPE_IS_DECLARED 1
Lev Walkin752e9732017-08-04 02:06:22 -0700439# define YYSTYPE_IS_TRIVIAL 1
Lev Walkinf15320b2004-06-03 03:38:44 +0000440#endif
441
Lev Walkin0e90aa02013-03-19 16:17:13 -0700442
Lev Walkin418298d2006-07-13 08:24:20 +0000443
444/* Copy the second part of user declarations. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000445
Lev Walkin752e9732017-08-04 02:06:22 -0700446
447/* Line 216 of yacc.c. */
448#line 449 "asn1p_y.c"
Lev Walkinf15320b2004-06-03 03:38:44 +0000449
Lev Walkin0e90aa02013-03-19 16:17:13 -0700450#ifdef short
451# undef short
452#endif
453
454#ifdef YYTYPE_UINT8
455typedef YYTYPE_UINT8 yytype_uint8;
456#else
457typedef unsigned char yytype_uint8;
458#endif
459
460#ifdef YYTYPE_INT8
461typedef YYTYPE_INT8 yytype_int8;
462#elif (defined __STDC__ || defined __C99__FUNC__ \
463 || defined __cplusplus || defined _MSC_VER)
464typedef signed char yytype_int8;
465#else
466typedef short int yytype_int8;
467#endif
468
469#ifdef YYTYPE_UINT16
470typedef YYTYPE_UINT16 yytype_uint16;
471#else
472typedef unsigned short int yytype_uint16;
473#endif
474
475#ifdef YYTYPE_INT16
476typedef YYTYPE_INT16 yytype_int16;
477#else
478typedef short int yytype_int16;
479#endif
480
481#ifndef YYSIZE_T
482# ifdef __SIZE_TYPE__
483# define YYSIZE_T __SIZE_TYPE__
484# elif defined size_t
485# define YYSIZE_T size_t
486# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
488# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
489# define YYSIZE_T size_t
490# else
491# define YYSIZE_T unsigned int
492# endif
493#endif
494
495#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
496
497#ifndef YY_
498# if defined YYENABLE_NLS && YYENABLE_NLS
499# if ENABLE_NLS
500# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin752e9732017-08-04 02:06:22 -0700501# define YY_(msgid) dgettext ("bison-runtime", msgid)
Lev Walkin0e90aa02013-03-19 16:17:13 -0700502# endif
503# endif
504# ifndef YY_
Lev Walkin752e9732017-08-04 02:06:22 -0700505# define YY_(msgid) msgid
Lev Walkin0e90aa02013-03-19 16:17:13 -0700506# endif
507#endif
508
509/* Suppress unused-variable warnings by "using" E. */
510#if ! defined lint || defined __GNUC__
Lev Walkin752e9732017-08-04 02:06:22 -0700511# define YYUSE(e) ((void) (e))
Lev Walkin0e90aa02013-03-19 16:17:13 -0700512#else
Lev Walkin752e9732017-08-04 02:06:22 -0700513# define YYUSE(e) /* empty */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700514#endif
515
516/* Identity function, used to suppress warnings about constant conditions. */
517#ifndef lint
Lev Walkin752e9732017-08-04 02:06:22 -0700518# define YYID(n) (n)
Lev Walkin0e90aa02013-03-19 16:17:13 -0700519#else
520#if (defined __STDC__ || defined __C99__FUNC__ \
521 || defined __cplusplus || defined _MSC_VER)
522static int
Lev Walkin752e9732017-08-04 02:06:22 -0700523YYID (int i)
Lev Walkin0e90aa02013-03-19 16:17:13 -0700524#else
525static int
Lev Walkin752e9732017-08-04 02:06:22 -0700526YYID (i)
527 int i;
Lev Walkin0e90aa02013-03-19 16:17:13 -0700528#endif
529{
Lev Walkin752e9732017-08-04 02:06:22 -0700530 return i;
Lev Walkin0e90aa02013-03-19 16:17:13 -0700531}
532#endif
533
534#if ! defined yyoverflow || YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +0000535
Lev Walkin418298d2006-07-13 08:24:20 +0000536/* The parser invokes alloca or malloc; define the necessary symbols. */
Lev Walkinf15320b2004-06-03 03:38:44 +0000537
Lev Walkin0e90aa02013-03-19 16:17:13 -0700538# ifdef YYSTACK_USE_ALLOCA
539# if YYSTACK_USE_ALLOCA
540# ifdef __GNUC__
541# define YYSTACK_ALLOC __builtin_alloca
542# elif defined __BUILTIN_VA_ARG_INCR
543# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
544# elif defined _AIX
545# define YYSTACK_ALLOC __alloca
546# elif defined _MSC_VER
547# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
548# define alloca _alloca
Lev Walkin418298d2006-07-13 08:24:20 +0000549# else
Lev Walkin0e90aa02013-03-19 16:17:13 -0700550# define YYSTACK_ALLOC alloca
Lev Walkin752e9732017-08-04 02:06:22 -0700551# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700552 || defined __cplusplus || defined _MSC_VER)
553# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin752e9732017-08-04 02:06:22 -0700554# ifndef _STDLIB_H
555# define _STDLIB_H 1
Lev Walkin0e90aa02013-03-19 16:17:13 -0700556# endif
Lev Walkin418298d2006-07-13 08:24:20 +0000557# endif
558# endif
559# endif
560# endif
Lev Walkinf15320b2004-06-03 03:38:44 +0000561
Lev Walkin418298d2006-07-13 08:24:20 +0000562# ifdef YYSTACK_ALLOC
Lev Walkin0e90aa02013-03-19 16:17:13 -0700563 /* Pacify GCC's `empty if-body' warning. */
564# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
565# ifndef YYSTACK_ALLOC_MAXIMUM
566 /* The OS might guarantee only one guard page at the bottom of the stack,
567 and a page size can be as small as 4096 bytes. So we cannot safely
568 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
569 to allow for a few compiler-allocated temporary stack slots. */
570# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
Lev Walkin418298d2006-07-13 08:24:20 +0000571# endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700572# else
573# define YYSTACK_ALLOC YYMALLOC
574# define YYSTACK_FREE YYFREE
575# ifndef YYSTACK_ALLOC_MAXIMUM
576# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
577# endif
Lev Walkin752e9732017-08-04 02:06:22 -0700578# if (defined __cplusplus && ! defined _STDLIB_H \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700579 && ! ((defined YYMALLOC || defined malloc) \
580 && (defined YYFREE || defined free)))
581# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Lev Walkin752e9732017-08-04 02:06:22 -0700582# ifndef _STDLIB_H
583# define _STDLIB_H 1
Lev Walkin0e90aa02013-03-19 16:17:13 -0700584# endif
585# endif
586# ifndef YYMALLOC
587# define YYMALLOC malloc
Lev Walkin752e9732017-08-04 02:06:22 -0700588# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700589 || defined __cplusplus || defined _MSC_VER)
590void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
591# endif
592# endif
593# ifndef YYFREE
594# define YYFREE free
Lev Walkin752e9732017-08-04 02:06:22 -0700595# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700596 || defined __cplusplus || defined _MSC_VER)
597void free (void *); /* INFRINGES ON USER NAME SPACE */
598# endif
599# endif
Lev Walkin418298d2006-07-13 08:24:20 +0000600# endif
Lev Walkin0e90aa02013-03-19 16:17:13 -0700601#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Lev Walkin418298d2006-07-13 08:24:20 +0000602
603
Lev Walkin0e90aa02013-03-19 16:17:13 -0700604#if (! defined yyoverflow \
605 && (! defined __cplusplus \
606 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Lev Walkin418298d2006-07-13 08:24:20 +0000607
608/* A type that is properly aligned for any stack member. */
609union yyalloc
610{
Lev Walkin752e9732017-08-04 02:06:22 -0700611 yytype_int16 yyss;
612 YYSTYPE yyvs;
613 };
Lev Walkin418298d2006-07-13 08:24:20 +0000614
615/* The size of the maximum gap between one aligned stack and the next. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700616# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
Lev Walkin418298d2006-07-13 08:24:20 +0000617
618/* The size of an array large to enough to hold all stacks, each with
619 N elements. */
620# define YYSTACK_BYTES(N) \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700621 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
622 + YYSTACK_GAP_MAXIMUM)
Lev Walkin418298d2006-07-13 08:24:20 +0000623
Lev Walkin752e9732017-08-04 02:06:22 -0700624/* Copy COUNT objects from FROM to TO. The source and destination do
625 not overlap. */
626# ifndef YYCOPY
627# if defined __GNUC__ && 1 < __GNUC__
628# define YYCOPY(To, From, Count) \
629 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
630# else
631# define YYCOPY(To, From, Count) \
632 do \
633 { \
634 YYSIZE_T yyi; \
635 for (yyi = 0; yyi < (Count); yyi++) \
636 (To)[yyi] = (From)[yyi]; \
637 } \
638 while (YYID (0))
639# endif
640# endif
Lev Walkin418298d2006-07-13 08:24:20 +0000641
642/* Relocate STACK from its old location to the new one. The
643 local variables YYSIZE and YYSTACKSIZE give the old and new number of
644 elements in the stack, and YYPTR gives the new location of the
645 stack. Advance YYPTR to a properly aligned location for the next
646 stack. */
Lev Walkin752e9732017-08-04 02:06:22 -0700647# define YYSTACK_RELOCATE(Stack) \
Lev Walkin418298d2006-07-13 08:24:20 +0000648 do \
649 { \
650 YYSIZE_T yynewbytes; \
Lev Walkin752e9732017-08-04 02:06:22 -0700651 YYCOPY (&yyptr->Stack, Stack, yysize); \
652 Stack = &yyptr->Stack; \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700653 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
Lev Walkin418298d2006-07-13 08:24:20 +0000654 yyptr += yynewbytes / sizeof (*yyptr); \
655 } \
Lev Walkin0e90aa02013-03-19 16:17:13 -0700656 while (YYID (0))
Lev Walkinf15320b2004-06-03 03:38:44 +0000657
658#endif
659
Lev Walkin0e90aa02013-03-19 16:17:13 -0700660/* YYFINAL -- State number of the termination state. */
Lev Walkin752e9732017-08-04 02:06:22 -0700661#define YYFINAL 9
Lev Walkin0e90aa02013-03-19 16:17:13 -0700662/* YYLAST -- Last index in YYTABLE. */
Lev Walkin752e9732017-08-04 02:06:22 -0700663#define YYLAST 812
Lev Walkin418298d2006-07-13 08:24:20 +0000664
Lev Walkin0e90aa02013-03-19 16:17:13 -0700665/* YYNTOKENS -- Number of terminals. */
Lev Walkin752e9732017-08-04 02:06:22 -0700666#define YYNTOKENS 124
Lev Walkin0e90aa02013-03-19 16:17:13 -0700667/* YYNNTS -- Number of nonterminals. */
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +0800668#define YYNNTS 124
Lev Walkin0e90aa02013-03-19 16:17:13 -0700669/* YYNRULES -- Number of rules. */
Lev Walkin752e9732017-08-04 02:06:22 -0700670#define YYNRULES 317
Lev Walkin0e90aa02013-03-19 16:17:13 -0700671/* YYNRULES -- Number of states. */
Lev Walkin752e9732017-08-04 02:06:22 -0700672#define YYNSTATES 479
Lev Walkin418298d2006-07-13 08:24:20 +0000673
674/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
675#define YYUNDEFTOK 2
Lev Walkin752e9732017-08-04 02:06:22 -0700676#define YYMAXUTOK 363
Lev Walkin418298d2006-07-13 08:24:20 +0000677
Lev Walkin0e90aa02013-03-19 16:17:13 -0700678#define YYTRANSLATE(YYX) \
679 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Lev Walkin418298d2006-07-13 08:24:20 +0000680
681/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700682static const yytype_uint8 yytranslate[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000683{
684 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin752e9732017-08-04 02:06:22 -0700687 2, 2, 2, 120, 2, 2, 2, 2, 2, 2,
688 113, 114, 2, 2, 116, 2, 121, 2, 2, 2,
689 2, 2, 2, 2, 2, 2, 2, 2, 117, 115,
690 122, 2, 2, 2, 123, 2, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin752e9732017-08-04 02:06:22 -0700693 2, 118, 2, 119, 105, 2, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Lev Walkin752e9732017-08-04 02:06:22 -0700696 2, 2, 2, 111, 107, 112, 2, 2, 2, 2,
Lev Walkin418298d2006-07-13 08:24:20 +0000697 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, 2, 2, 2, 2,
708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
709 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
710 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
711 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
712 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
713 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
714 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
715 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
716 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
717 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
718 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Lev Walkin752e9732017-08-04 02:06:22 -0700719 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
720 106, 108, 109, 110
Lev Walkin418298d2006-07-13 08:24:20 +0000721};
722
723#if YYDEBUG
724/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
725 YYRHS. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700726static const yytype_uint16 yyprhs[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000727{
Lev Walkin752e9732017-08-04 02:06:22 -0700728 0, 0, 3, 6, 8, 10, 13, 14, 24, 25,
729 27, 31, 34, 36, 39, 41, 46, 48, 49, 51,
730 53, 56, 59, 62, 65, 68, 71, 72, 74, 78,
731 80, 83, 85, 87, 89, 90, 94, 96, 97, 99,
732 103, 106, 107, 109, 111, 114, 115, 117, 122, 124,
733 128, 130, 134, 136, 137, 139, 143, 147, 150, 152,
734 156, 158, 162, 164, 168, 173, 175, 177, 182, 186,
735 190, 197, 204, 206, 210, 212, 216, 220, 224, 228,
736 230, 234, 236, 238, 240, 242, 243, 245, 247, 251,
737 257, 261, 264, 268, 270, 272, 276, 279, 281, 283,
738 289, 290, 292, 294, 298, 301, 306, 310, 314, 318,
739 322, 326, 327, 329, 330, 337, 339, 342, 344, 346,
740 348, 352, 354, 358, 362, 366, 367, 370, 372, 377,
741 382, 387, 394, 401, 403, 408, 412, 414, 418, 422,
742 426, 428, 432, 434, 438, 440, 442, 444, 446, 450,
743 454, 456, 461, 463, 465, 469, 470, 474, 476, 478,
744 480, 482, 484, 486, 488, 490, 494, 496, 498, 500,
745 502, 505, 507, 509, 511, 513, 516, 519, 521, 523,
746 526, 529, 531, 533, 535, 537, 539, 542, 544, 547,
747 549, 551, 553, 555, 557, 559, 561, 563, 565, 567,
748 569, 571, 573, 575, 577, 579, 581, 583, 584, 586,
749 588, 590, 595, 599, 604, 606, 608, 610, 612, 616,
750 622, 624, 628, 630, 634, 636, 640, 642, 646, 651,
751 655, 657, 659, 663, 667, 671, 675, 677, 679, 680,
752 684, 687, 690, 692, 694, 696, 698, 700, 702, 704,
753 706, 708, 710, 712, 716, 722, 724, 728, 730, 734,
754 735, 737, 739, 741, 743, 745, 747, 749, 750, 756,
755 759, 761, 764, 767, 771, 773, 775, 779, 784, 786,
756 790, 793, 797, 799, 803, 804, 806, 808, 811, 814,
757 818, 820, 824, 826, 831, 836, 838, 840, 842, 844,
758 846, 848, 849, 851, 854, 859, 860, 862, 864, 866,
759 867, 869, 871, 873, 875, 877, 878, 880
Lev Walkin418298d2006-07-13 08:24:20 +0000760};
761
Lev Walkin0e90aa02013-03-19 16:17:13 -0700762/* YYRHS -- A `-1'-separated list of the rules' RHS. */
763static const yytype_int16 yyrhs[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000764{
Lev Walkin752e9732017-08-04 02:06:22 -0700765 125, 0, -1, 103, 126, -1, 126, -1, 127, -1,
766 126, 127, -1, -1, 244, 128, 129, 41, 133, 3,
767 28, 136, 46, -1, -1, 130, -1, 111, 131, 112,
768 -1, 111, 112, -1, 132, -1, 131, 132, -1, 247,
769 -1, 247, 113, 12, 114, -1, 12, -1, -1, 134,
770 -1, 135, -1, 134, 135, -1, 48, 91, -1, 59,
771 91, -1, 27, 91, -1, 50, 60, -1, 18, 64,
772 -1, -1, 137, -1, 149, 141, 138, -1, 139, -1,
773 138, 139, -1, 156, -1, 186, -1, 154, -1, -1,
774 45, 18, 140, -1, 196, -1, -1, 142, -1, 61,
775 143, 115, -1, 61, 53, -1, -1, 144, -1, 146,
776 -1, 144, 146, -1, -1, 130, -1, 147, 53, 244,
777 145, -1, 148, -1, 147, 116, 148, -1, 244, -1,
778 244, 111, 112, -1, 247, -1, -1, 150, -1, 49,
779 151, 115, -1, 49, 24, 115, -1, 49, 115, -1,
780 152, -1, 151, 116, 152, -1, 244, -1, 244, 111,
781 112, -1, 247, -1, 111, 204, 112, -1, 244, 155,
782 3, 153, -1, 195, -1, 180, -1, 180, 111, 159,
783 112, -1, 244, 3, 176, -1, 244, 3, 166, -1,
784 244, 111, 157, 112, 3, 176, -1, 244, 111, 157,
785 112, 3, 166, -1, 158, -1, 157, 116, 158, -1,
786 244, -1, 244, 117, 247, -1, 244, 117, 244, -1,
787 193, 117, 247, -1, 193, 117, 244, -1, 160, -1,
788 159, 116, 160, -1, 176, -1, 189, -1, 247, -1,
789 153, -1, -1, 162, -1, 163, -1, 162, 116, 163,
790 -1, 162, 116, 4, 162, 5, -1, 247, 176, 232,
791 -1, 176, 232, -1, 37, 75, 176, -1, 175, -1,
792 165, -1, 164, 116, 165, -1, 247, 176, -1, 175,
793 -1, 176, -1, 35, 111, 168, 112, 170, -1, -1,
794 95, -1, 169, -1, 168, 116, 169, -1, 19, 232,
795 -1, 20, 176, 167, 232, -1, 20, 184, 232, -1,
796 20, 185, 232, -1, 19, 184, 232, -1, 19, 176,
797 232, -1, 19, 185, 232, -1, -1, 171, -1, -1,
798 102, 89, 111, 172, 173, 112, -1, 174, -1, 173,
799 174, -1, 6, -1, 21, -1, 183, -1, 118, 173,
800 119, -1, 110, -1, 110, 120, 190, -1, 110, 120,
801 237, -1, 239, 178, 199, -1, -1, 177, 179, -1,
802 155, -1, 34, 111, 164, 112, -1, 85, 111, 161,
803 112, -1, 86, 111, 161, 112, -1, 85, 199, 75,
804 246, 239, 178, -1, 86, 199, 75, 246, 239, 178,
805 -1, 25, -1, 25, 42, 32, 247, -1, 63, 75,
806 180, -1, 17, -1, 17, 121, 244, -1, 245, 121,
807 244, -1, 17, 121, 247, -1, 245, -1, 245, 121,
808 181, -1, 182, -1, 181, 121, 182, -1, 183, -1,
809 19, -1, 20, -1, 19, -1, 184, 121, 19, -1,
810 184, 121, 20, -1, 18, -1, 247, 176, 3, 187,
811 -1, 189, -1, 190, -1, 247, 117, 187, -1, -1,
812 111, 188, 192, -1, 70, -1, 52, -1, 93, -1,
813 8, -1, 10, -1, 191, -1, 237, -1, 247, -1,
814 244, 121, 247, -1, 9, -1, 15, -1, 16, -1,
815 7, -1, 192, 7, -1, 31, -1, 70, -1, 83,
816 -1, 194, -1, 74, 88, -1, 72, 58, -1, 84,
817 -1, 51, -1, 43, 78, -1, 33, 88, -1, 98,
818 -1, 54, -1, 196, -1, 65, -1, 47, -1, 29,
819 88, -1, 193, -1, 194, 234, -1, 30, -1, 55,
820 -1, 56, -1, 57, -1, 66, -1, 71, -1, 81,
821 -1, 90, -1, 92, -1, 97, -1, 99, -1, 100,
822 -1, 101, -1, 73, -1, 107, -1, 108, -1, 105,
823 -1, 106, -1, -1, 200, -1, 201, -1, 202, -1,
824 87, 113, 203, 114, -1, 113, 203, 114, -1, 202,
825 113, 203, 114, -1, 204, -1, 221, -1, 110, -1,
826 205, -1, 205, 116, 110, -1, 205, 116, 110, 116,
827 205, -1, 206, -1, 24, 104, 209, -1, 207, -1,
828 206, 197, 207, -1, 208, -1, 207, 198, 208, -1,
829 209, -1, 209, 104, 209, -1, 212, 113, 204, 114,
830 -1, 113, 204, 114, -1, 213, -1, 215, -1, 213,
831 225, 213, -1, 68, 225, 213, -1, 213, 225, 67,
832 -1, 68, 225, 67, -1, 216, -1, 211, -1, -1,
833 111, 210, 192, -1, 77, 9, -1, 77, 247, -1,
834 87, -1, 53, -1, 52, -1, 93, -1, 238, -1,
835 191, -1, 214, -1, 247, -1, 8, -1, 10, -1,
836 180, -1, 102, 36, 202, -1, 102, 37, 111, 217,
837 112, -1, 218, -1, 217, 116, 218, -1, 110, -1,
838 247, 199, 219, -1, -1, 220, -1, 80, -1, 22,
839 -1, 76, -1, 222, -1, 226, -1, 224, -1, -1,
840 38, 32, 111, 223, 192, -1, 39, 176, -1, 109,
841 -1, 109, 122, -1, 122, 109, -1, 122, 109, 122,
842 -1, 227, -1, 228, -1, 111, 244, 112, -1, 227,
843 111, 229, 112, -1, 230, -1, 229, 116, 230, -1,
844 123, 231, -1, 123, 121, 231, -1, 247, -1, 231,
845 121, 247, -1, -1, 233, -1, 76, -1, 40, 187,
846 -1, 111, 112, -1, 111, 235, 112, -1, 236, -1,
847 235, 116, 236, -1, 247, -1, 247, 113, 237, 114,
848 -1, 247, 113, 190, 114, -1, 237, -1, 110, -1,
849 12, -1, 13, -1, 237, -1, 14, -1, -1, 240,
850 -1, 241, 243, -1, 118, 242, 12, 119, -1, -1,
851 96, -1, 26, -1, 82, -1, -1, 59, -1, 48,
852 -1, 17, -1, 18, -1, 18, -1, -1, 247, -1,
853 11, -1
Lev Walkin418298d2006-07-13 08:24:20 +0000854};
855
856/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700857static const yytype_uint16 yyrline[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000858{
Lev Walkin752e9732017-08-04 02:06:22 -0700859 0, 358, 358, 361, 367, 372, 389, 389, 418, 419,
860 423, 426, 432, 438, 447, 451, 455, 465, 466, 475,
861 478, 487, 490, 493, 496, 500, 521, 522, 531, 544,
Lev Walkine700b202017-08-06 23:21:32 -0700862 547, 564, 571, 585, 593, 592, 606, 619, 620, 623,
863 633, 639, 640, 643, 648, 655, 656, 660, 671, 676,
864 683, 689, 695, 705, 706, 718, 721, 724, 732, 737,
865 744, 750, 756, 765, 768, 778, 791, 801, 821, 827,
866 843, 849, 857, 866, 877, 881, 889, 897, 905, 916,
867 921, 928, 931, 939, 950, 973, 974, 977, 982, 986,
868 994, 1001, 1007, 1014, 1020, 1025, 1032, 1037, 1040, 1047,
869 1057, 1058, 1062, 1069, 1079, 1089, 1100, 1110, 1121, 1131,
870 1142, 1154, 1155, 1162, 1161, 1170, 1174, 1181, 1185, 1188,
871 1192, 1198, 1206, 1215, 1227, 1251, 1258, 1277, 1280, 1286,
872 1292, 1298, 1308, 1318, 1324, 1336, 1351, 1359, 1370, 1381,
873 1392, 1400, 1422, 1430, 1439, 1443, 1448, 1457, 1462, 1467,
874 1475, 1498, 1508, 1509, 1510, 1517, 1517, 1522, 1530, 1535,
875 1540, 1545, 1550, 1553, 1559, 1570, 1588, 1592, 1597, 1605,
876 1614, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637,
877 1638, 1639, 1640, 1641, 1648, 1649, 1650, 1654, 1660, 1673,
878 1674, 1678, 1682, 1683, 1684, 1685, 1686, 1690, 1691, 1692,
879 1693, 1697, 1698, 1705, 1705, 1706, 1706, 1709, 1710, 1716,
880 1720, 1723, 1733, 1736, 1742, 1745, 1751, 1755, 1758, 1764,
881 1775, 1776, 1782, 1783, 1789, 1790, 1797, 1798, 1804, 1812,
882 1820, 1826, 1832, 1839, 1847, 1855, 1864, 1867, 1870, 1870,
883 1880, 1885, 1897, 1900, 1906, 1911, 1916, 1917, 1918, 1919,
884 1933, 1938, 1946, 1966, 1969, 1975, 1978, 1984, 1990, 2004,
885 2005, 2009, 2012, 2015, 2023, 2024, 2025, 2030, 2029, 2041,
886 2050, 2051, 2052, 2053, 2056, 2059, 2068, 2084, 2090, 2096,
887 2110, 2121, 2137, 2140, 2160, 2164, 2168, 2172, 2195, 2199,
888 2205, 2210, 2217, 2224, 2232, 2240, 2247, 2258, 2262, 2269,
889 2270, 2301, 2302, 2306, 2313, 2319, 2320, 2321, 2322, 2326,
890 2327, 2328, 2332, 2336, 2344, 2351, 2352, 2358
Lev Walkin418298d2006-07-13 08:24:20 +0000891};
892#endif
893
Lev Walkin752e9732017-08-04 02:06:22 -0700894#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
Lev Walkin0e90aa02013-03-19 16:17:13 -0700895/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
896 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
Lev Walkin418298d2006-07-13 08:24:20 +0000897static const char *const yytname[] =
898{
Lev Walkin0e90aa02013-03-19 16:17:13 -0700899 "$end", "error", "$undefined", "TOK_PPEQ", "TOK_VBracketLeft",
900 "TOK_VBracketRight", "TOK_whitespace", "TOK_opaque", "TOK_bstring",
901 "TOK_cstring", "TOK_hstring", "TOK_identifier", "TOK_number",
902 "TOK_number_negative", "TOK_realnumber", "TOK_tuple", "TOK_quadruple",
903 "TOK_typereference", "TOK_capitalreference", "TOK_typefieldreference",
904 "TOK_valuefieldreference", "TOK_Literal", "TOK_ABSENT",
905 "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY", "TOK_APPLICATION",
906 "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT", "TOK_BMPString", "TOK_BOOLEAN",
907 "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE", "TOK_CLASS", "TOK_COMPONENT",
908 "TOK_COMPONENTS", "TOK_CONSTRAINED", "TOK_CONTAINING", "TOK_DEFAULT",
909 "TOK_DEFINITIONS", "TOK_DEFINED", "TOK_EMBEDDED", "TOK_ENCODED",
910 "TOK_ENCODING_CONTROL", "TOK_END", "TOK_ENUMERATED", "TOK_EXPLICIT",
911 "TOK_EXPORTS", "TOK_EXTENSIBILITY", "TOK_EXTERNAL", "TOK_FALSE",
912 "TOK_FROM", "TOK_GeneralizedTime", "TOK_GeneralString",
913 "TOK_GraphicString", "TOK_IA5String", "TOK_IDENTIFIER", "TOK_IMPLICIT",
914 "TOK_IMPLIED", "TOK_IMPORTS", "TOK_INCLUDES", "TOK_INSTANCE",
915 "TOK_INSTRUCTIONS", "TOK_INTEGER", "TOK_ISO646String", "TOK_MAX",
916 "TOK_MIN", "TOK_MINUS_INFINITY", "TOK_NULL", "TOK_NumericString",
917 "TOK_OBJECT", "TOK_ObjectDescriptor", "TOK_OCTET", "TOK_OF",
918 "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV", "TOK_PLUS_INFINITY",
919 "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE", "TOK_REAL",
920 "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE", "TOK_STRING",
921 "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS", "TOK_TeletexString",
922 "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE", "TOK_UNIVERSAL",
923 "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
Lev Walkin752e9732017-08-04 02:06:22 -0700924 "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH",
925 "\"UTF-8 byte order mark\"", "TOK_EXCEPT", "'^'", "TOK_INTERSECTION",
926 "'|'", "TOK_UNION", "TOK_TwoDots", "TOK_ThreeDots", "'{'", "'}'", "'('",
927 "')'", "';'", "','", "':'", "'['", "']'", "'!'", "'.'", "'<'", "'@'",
928 "$accept", "ParsedGrammar", "ModuleList", "ModuleDefinition", "@1",
929 "optObjectIdentifier", "ObjectIdentifier", "ObjectIdentifierBody",
930 "ObjectIdentifierElement", "optModuleDefinitionFlags",
931 "ModuleDefinitionFlags", "ModuleDefinitionFlag", "optModuleBody",
932 "ModuleBody", "AssignmentList", "Assignment", "@2", "optImports",
933 "ImportsDefinition", "optImportsBundleSet", "ImportsBundleSet",
934 "AssignedIdentifier", "ImportsBundle", "ImportsList", "ImportsElement",
935 "optExports", "ExportsDefinition", "ExportsBody", "ExportsElement",
936 "ValueSet", "ValueSetTypeAssignment", "DefinedType", "DataTypeReference",
Lev Walkin0e90aa02013-03-19 16:17:13 -0700937 "ParameterArgumentList", "ParameterArgumentName", "ActualParameterList",
938 "ActualParameter", "optComponentTypeLists", "ComponentTypeLists",
939 "ComponentType", "AlternativeTypeLists", "AlternativeType",
940 "ObjectClass", "optUnique", "FieldSpec", "ClassField", "optWithSyntax",
Lev Walkin752e9732017-08-04 02:06:22 -0700941 "WithSyntax", "@3", "WithSyntaxList", "WithSyntaxToken",
Lev Walkin0e90aa02013-03-19 16:17:13 -0700942 "ExtensionAndException", "Type", "NSTD_IndirectMarker",
943 "TypeDeclaration", "TypeDeclarationSet", "ComplexTypeReference",
944 "ComplexTypeReferenceAmpList", "ComplexTypeReferenceElement",
945 "PrimitiveFieldReference", "FieldName", "DefinedObjectClass",
Lev Walkin752e9732017-08-04 02:06:22 -0700946 "ValueAssignment", "Value", "@4", "SimpleValue", "DefinedValue",
Lev Walkin0e90aa02013-03-19 16:17:13 -0700947 "RestrictedCharacterStringValue", "Opaque", "BasicTypeId",
948 "BasicTypeId_UniverationCompatible", "BasicType", "BasicString",
949 "UnionMark", "IntersectionMark", "optConstraints", "Constraint",
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +0800950 "SubtypeConstraint", "SetOfConstraints", "ConstraintSpecs",
951 "ElementSetSpecs", "ElementSetSpec", "Unions", "Intersections",
Lev Walkin752e9732017-08-04 02:06:22 -0700952 "IntersectionElements", "ConstraintSubtypeElement", "@5",
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +0800953 "PatternConstraint", "ConstraintSpec", "SingleValue", "BitStringValue",
954 "ContainedSubtype", "InnerTypeConstraint", "WithComponentsList",
955 "WithComponentsElement", "optPresenceConstraint", "PresenceConstraint",
Lev Walkin752e9732017-08-04 02:06:22 -0700956 "GeneralConstraint", "UserDefinedConstraint", "@6", "ContentsConstraint",
957 "ConstraintRangeSpec", "TableConstraint", "SimpleTableConstraint",
958 "ComponentRelationConstraint", "AtNotationList", "AtNotationElement",
959 "ComponentIdList", "optMarker", "Marker", "UniverationDefinition",
960 "UniverationList", "UniverationElement", "SignedNumber", "RealValue",
961 "optTag", "Tag", "TagTypeValue", "TagClass", "TagPlicit", "TypeRefName",
962 "ObjectClassReference", "optIdentifier", "Identifier", 0
Lev Walkin418298d2006-07-13 08:24:20 +0000963};
964#endif
965
966# ifdef YYPRINT
967/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
968 token YYLEX-NUM. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700969static const yytype_uint16 yytoknum[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000970{
971 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
972 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
973 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
974 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
975 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
976 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
977 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
978 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
979 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
980 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Lev Walkin752e9732017-08-04 02:06:22 -0700981 355, 356, 357, 358, 359, 94, 360, 124, 361, 362,
982 363, 123, 125, 40, 41, 59, 44, 58, 91, 93,
983 33, 46, 60, 64
Lev Walkin418298d2006-07-13 08:24:20 +0000984};
985# endif
986
987/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Lev Walkin0e90aa02013-03-19 16:17:13 -0700988static const yytype_uint8 yyr1[] =
Lev Walkin418298d2006-07-13 08:24:20 +0000989{
Lev Walkin752e9732017-08-04 02:06:22 -0700990 0, 124, 125, 125, 126, 126, 128, 127, 129, 129,
991 130, 130, 131, 131, 132, 132, 132, 133, 133, 134,
992 134, 135, 135, 135, 135, 135, 136, 136, 137, 138,
993 138, 139, 139, 139, 140, 139, 139, 141, 141, 142,
994 142, 143, 143, 144, 144, 145, 145, 146, 147, 147,
995 148, 148, 148, 149, 149, 150, 150, 150, 151, 151,
996 152, 152, 152, 153, 154, 155, 155, 155, 156, 156,
997 156, 156, 157, 157, 158, 158, 158, 158, 158, 159,
998 159, 160, 160, 160, 160, 161, 161, 162, 162, 162,
999 163, 163, 163, 163, 164, 164, 165, 165, 165, 166,
1000 167, 167, 168, 168, 169, 169, 169, 169, 169, 169,
1001 169, 170, 170, 172, 171, 173, 173, 174, 174, 174,
1002 174, 175, 175, 175, 176, 177, 178, 179, 179, 179,
1003 179, 179, 179, 179, 179, 179, 180, 180, 180, 180,
1004 180, 180, 181, 181, 182, 183, 183, 184, 184, 184,
1005 185, 186, 187, 187, 187, 188, 187, 187, 189, 189,
1006 189, 189, 189, 189, 190, 190, 191, 191, 191, 192,
1007 192, 193, 193, 193, 193, 193, 193, 193, 193, 193,
1008 193, 193, 193, 193, 194, 194, 194, 195, 195, 196,
1009 196, 196, 196, 196, 196, 196, 196, 196, 196, 196,
1010 196, 196, 196, 197, 197, 198, 198, 199, 199, 200,
1011 201, 201, 202, 202, 203, 203, 204, 204, 204, 204,
1012 205, 205, 206, 206, 207, 207, 208, 208, 209, 209,
1013 209, 209, 209, 209, 209, 209, 209, 209, 210, 209,
1014 211, 211, 212, 212, 213, 213, 213, 213, 213, 213,
1015 214, 214, 215, 216, 216, 217, 217, 218, 218, 219,
1016 219, 220, 220, 220, 221, 221, 221, 223, 222, 224,
1017 225, 225, 225, 225, 226, 226, 227, 228, 229, 229,
1018 230, 230, 231, 231, 232, 232, 233, 233, 234, 234,
1019 235, 235, 236, 236, 236, 236, 236, 237, 237, 238,
1020 238, 239, 239, 240, 241, 242, 242, 242, 242, 243,
1021 243, 243, 244, 244, 245, 246, 246, 247
Lev Walkin418298d2006-07-13 08:24:20 +00001022};
1023
1024/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001025static const yytype_uint8 yyr2[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001026{
Lev Walkin752e9732017-08-04 02:06:22 -07001027 0, 2, 2, 1, 1, 2, 0, 9, 0, 1,
1028 3, 2, 1, 2, 1, 4, 1, 0, 1, 1,
1029 2, 2, 2, 2, 2, 2, 0, 1, 3, 1,
1030 2, 1, 1, 1, 0, 3, 1, 0, 1, 3,
1031 2, 0, 1, 1, 2, 0, 1, 4, 1, 3,
1032 1, 3, 1, 0, 1, 3, 3, 2, 1, 3,
1033 1, 3, 1, 3, 4, 1, 1, 4, 3, 3,
1034 6, 6, 1, 3, 1, 3, 3, 3, 3, 1,
1035 3, 1, 1, 1, 1, 0, 1, 1, 3, 5,
1036 3, 2, 3, 1, 1, 3, 2, 1, 1, 5,
1037 0, 1, 1, 3, 2, 4, 3, 3, 3, 3,
1038 3, 0, 1, 0, 6, 1, 2, 1, 1, 1,
1039 3, 1, 3, 3, 3, 0, 2, 1, 4, 4,
1040 4, 6, 6, 1, 4, 3, 1, 3, 3, 3,
1041 1, 3, 1, 3, 1, 1, 1, 1, 3, 3,
1042 1, 4, 1, 1, 3, 0, 3, 1, 1, 1,
1043 1, 1, 1, 1, 1, 3, 1, 1, 1, 1,
1044 2, 1, 1, 1, 1, 2, 2, 1, 1, 2,
1045 2, 1, 1, 1, 1, 1, 2, 1, 2, 1,
Lev Walkin418298d2006-07-13 08:24:20 +00001046 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Lev Walkin752e9732017-08-04 02:06:22 -07001047 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,
1048 1, 4, 3, 4, 1, 1, 1, 1, 3, 5,
1049 1, 3, 1, 3, 1, 3, 1, 3, 4, 3,
1050 1, 1, 3, 3, 3, 3, 1, 1, 0, 3,
1051 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1052 1, 1, 1, 3, 5, 1, 3, 1, 3, 0,
1053 1, 1, 1, 1, 1, 1, 1, 0, 5, 2,
1054 1, 2, 2, 3, 1, 1, 3, 4, 1, 3,
1055 2, 3, 1, 3, 0, 1, 1, 2, 2, 3,
1056 1, 3, 1, 4, 4, 1, 1, 1, 1, 1,
1057 1, 0, 1, 2, 4, 0, 1, 1, 1, 0,
1058 1, 1, 1, 1, 1, 0, 1, 1
Lev Walkin418298d2006-07-13 08:24:20 +00001059};
1060
Lev Walkin752e9732017-08-04 02:06:22 -07001061/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1062 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
Lev Walkin418298d2006-07-13 08:24:20 +00001063 means the default is an error. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001064static const yytype_uint16 yydefact[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001065{
Lev Walkin752e9732017-08-04 02:06:22 -07001066 0, 312, 313, 0, 0, 3, 4, 6, 2, 1,
1067 5, 8, 0, 0, 9, 317, 16, 11, 0, 12,
1068 14, 17, 10, 13, 0, 0, 0, 0, 0, 0,
1069 0, 18, 19, 0, 25, 23, 21, 24, 22, 0,
1070 20, 15, 53, 0, 0, 27, 37, 54, 0, 57,
1071 0, 58, 60, 62, 7, 41, 0, 38, 56, 55,
1072 0, 0, 40, 0, 42, 43, 0, 48, 50, 52,
1073 189, 0, 190, 191, 192, 193, 194, 202, 195, 196,
1074 197, 198, 199, 200, 201, 28, 29, 33, 31, 32,
1075 36, 0, 301, 59, 61, 39, 44, 0, 0, 0,
1076 34, 30, 301, 136, 314, 0, 171, 0, 0, 185,
1077 178, 182, 184, 172, 0, 0, 173, 177, 181, 0,
1078 0, 66, 187, 174, 65, 183, 140, 305, 0, 125,
1079 302, 309, 45, 49, 51, 35, 0, 69, 68, 0,
1080 186, 180, 179, 176, 175, 0, 72, 0, 174, 74,
1081 0, 301, 0, 188, 0, 307, 308, 306, 0, 0,
1082 0, 207, 311, 310, 303, 46, 47, 0, 137, 139,
1083 0, 0, 0, 0, 0, 64, 160, 166, 161, 297,
1084 298, 167, 168, 158, 159, 84, 0, 79, 81, 82,
1085 162, 163, 83, 296, 288, 0, 290, 295, 292, 145,
1086 146, 141, 142, 144, 138, 0, 157, 155, 151, 152,
1087 153, 0, 164, 133, 0, 0, 207, 207, 127, 126,
1088 0, 0, 124, 208, 209, 210, 301, 301, 0, 102,
1089 301, 73, 78, 77, 76, 75, 250, 251, 300, 0,
1090 244, 243, 0, 0, 242, 245, 0, 216, 238, 0,
1091 252, 247, 0, 217, 220, 222, 224, 226, 237, 0,
1092 230, 248, 231, 236, 299, 246, 249, 67, 301, 289,
1093 0, 0, 0, 304, 0, 0, 0, 0, 301, 0,
1094 301, 0, 301, 0, 0, 0, 301, 238, 0, 214,
1095 215, 264, 266, 265, 274, 275, 0, 150, 147, 0,
1096 286, 284, 284, 284, 104, 285, 100, 284, 284, 111,
1097 0, 71, 70, 0, 270, 0, 0, 240, 241, 0,
1098 0, 0, 0, 63, 0, 203, 204, 0, 205, 206,
1099 0, 0, 0, 0, 80, 291, 0, 0, 164, 143,
1100 169, 156, 165, 154, 0, 121, 0, 94, 97, 98,
1101 301, 135, 0, 0, 86, 87, 93, 284, 301, 315,
1102 0, 315, 0, 0, 269, 0, 212, 0, 0, 287,
1103 109, 0, 108, 110, 101, 284, 106, 107, 0, 99,
1104 112, 103, 221, 271, 272, 235, 233, 253, 0, 239,
1105 229, 218, 223, 225, 227, 0, 234, 232, 294, 293,
1106 170, 134, 0, 128, 301, 96, 301, 129, 301, 91,
1107 284, 301, 316, 130, 301, 211, 267, 276, 0, 0,
1108 278, 213, 148, 149, 105, 0, 273, 257, 0, 255,
1109 207, 0, 228, 122, 123, 95, 92, 301, 88, 90,
1110 125, 125, 0, 0, 280, 282, 277, 0, 113, 254,
1111 0, 259, 219, 0, 131, 132, 268, 281, 0, 279,
1112 0, 256, 262, 263, 261, 258, 260, 89, 283, 117,
1113 118, 0, 0, 115, 119, 0, 114, 116, 120
Lev Walkin418298d2006-07-13 08:24:20 +00001114};
1115
Lev Walkin0e90aa02013-03-19 16:17:13 -07001116/* YYDEFGOTO[NTERM-NUM]. */
1117static const yytype_int16 yydefgoto[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001118{
Lev Walkin752e9732017-08-04 02:06:22 -07001119 -1, 4, 5, 6, 11, 13, 14, 18, 19, 30,
1120 31, 32, 44, 45, 85, 86, 135, 56, 57, 63,
1121 64, 166, 65, 66, 67, 46, 47, 50, 51, 185,
1122 87, 120, 88, 145, 146, 186, 187, 353, 354, 355,
1123 346, 347, 137, 375, 228, 229, 379, 380, 460, 472,
1124 473, 356, 357, 160, 161, 219, 250, 201, 202, 474,
1125 302, 303, 89, 208, 274, 209, 210, 251, 341, 122,
1126 123, 124, 125, 327, 330, 222, 223, 224, 225, 288,
1127 289, 253, 254, 255, 256, 257, 321, 258, 259, 260,
1128 261, 262, 263, 428, 429, 465, 466, 290, 291, 442,
1129 292, 316, 293, 294, 295, 419, 420, 444, 304, 305,
1130 153, 195, 196, 264, 265, 129, 130, 131, 158, 164,
1131 211, 126, 411, 266
Lev Walkin418298d2006-07-13 08:24:20 +00001132};
1133
1134/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1135 STATE-NUM. */
Lev Walkin752e9732017-08-04 02:06:22 -07001136#define YYPACT_NINF -312
Lev Walkin0e90aa02013-03-19 16:17:13 -07001137static const yytype_int16 yypact[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001138{
Lev Walkin752e9732017-08-04 02:06:22 -07001139 97, -312, -312, 275, 72, 275, -312, -312, 275, -312,
1140 -312, 1, 39, 62, -312, -312, -312, -312, 83, -312,
1141 51, 343, -312, -312, 159, 134, 144, 169, 154, 174,
1142 247, 343, -312, 171, -312, -312, -312, -312, -312, 245,
1143 -312, -312, 187, 52, 237, -312, 240, -312, 191, -312,
1144 2, -312, 202, -312, -312, 185, 558, -312, -312, -312,
1145 228, 208, -312, 211, 228, -312, -8, -312, 258, -312,
1146 -312, 357, -312, -312, -312, -312, -312, -312, -312, -312,
1147 -312, -312, -312, -312, -312, 558, -312, -312, -312, -312,
1148 -312, 224, 230, -312, -312, -312, -312, 275, 228, 265,
1149 -312, -312, -11, 262, -312, 290, -312, 291, 306, -312,
1150 -312, -312, -312, -312, 327, 298, -312, -312, -312, 711,
1151 384, 277, -312, 278, -312, -312, 279, 155, 395, -312,
1152 -312, 181, 1, -312, -312, -312, 288, -312, -312, 228,
1153 -312, -312, -312, -312, -312, -75, -312, 284, -312, 286,
1154 293, 69, 80, -312, 292, -312, -312, -312, 393, 584,
1155 635, 104, -312, -312, -312, -312, -312, 299, -312, -312,
1156 404, 711, 228, 228, 448, -312, -312, -312, -312, -312,
1157 -312, -312, -312, -312, -312, -312, 100, -312, -312, -312,
1158 -312, -312, -312, -312, -312, 118, -312, -312, 295, -312,
1159 -312, 296, -312, -312, -312, 297, -312, -312, -312, -312,
1160 -312, 300, 301, 367, 302, 336, 98, 161, -312, -312,
1161 307, 342, -312, -312, -312, 309, 92, 47, 131, -312,
1162 -11, -312, -312, -312, -312, -312, -312, -312, -312, 308,
1163 -312, -312, -13, 173, -312, -312, 294, -312, -312, 448,
1164 -312, -312, 303, 310, 229, 257, -312, 320, -312, 314,
1165 -13, -312, -312, -312, -312, -312, -312, -312, 69, -312,
1166 45, 316, 345, -312, 407, 417, 584, 398, 6, 350,
1167 76, 358, 76, 359, 342, 400, 230, 275, 322, -312,
1168 -312, -312, -312, -312, 326, -312, 342, -312, -312, 584,
1169 -312, 129, 123, 129, -312, -312, 344, 123, 129, 338,
1170 299, -312, -312, 496, 319, 333, 210, -312, -312, 332,
1171 337, 407, 329, -312, 339, -312, -312, 496, -312, -312,
1172 496, 496, 448, 330, -312, -312, 340, 353, -312, -312,
1173 -312, 440, -312, -312, 417, 331, 170, -312, -312, -312,
1174 230, -312, 375, 356, 354, -312, -312, 129, 230, 417,
1175 361, 417, 355, 360, -312, 362, -312, 365, 376, -312,
1176 -312, 352, -312, -312, -312, 129, -312, -312, 386, -312,
1177 -312, -312, -312, -312, 369, -312, -312, 309, 19, 440,
1178 -312, 373, 257, -312, -312, 378, -312, -312, -312, -312,
1179 -312, -312, 316, -312, 6, -312, 230, -312, 38, -312,
1180 129, 230, -312, -312, 230, -312, -312, -312, 9, 172,
1181 -312, -312, -312, -312, -312, 383, -312, -312, 188, -312,
1182 104, 469, -312, -312, -312, -312, -312, 60, -312, -312,
1183 -312, -312, 407, 417, 374, -312, -312, 365, -312, -312,
1184 19, 152, -312, 41, -312, -312, 440, 374, 417, -312,
1185 15, -312, -312, -312, -312, -312, -312, -312, -312, -312,
1186 -312, 15, 8, -312, -312, 34, -312, -312, -312
Lev Walkin418298d2006-07-13 08:24:20 +00001187};
1188
1189/* YYPGOTO[NTERM-NUM]. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001190static const yytype_int16 yypgoto[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001191{
Lev Walkin752e9732017-08-04 02:06:22 -07001192 -312, -312, 473, 117, -312, -312, 364, -312, 479, -312,
1193 -312, 467, -312, -312, -312, 414, -312, -312, -312, -312,
1194 -312, -312, 438, -312, 405, -312, -312, -312, 455, 368,
1195 -312, 363, -312, -312, 346, -312, 251, 238, 87, 119,
1196 -312, 122, 304, -312, -312, 218, -312, -312, -312, 58,
1197 -223, -255, -89, -312, -67, -312, -86, -312, 259, -138,
1198 305, 311, -312, -93, -312, -133, -256, -140, -311, -81,
1199 -52, -312, -24, -312, -312, -215, -312, -312, 214, -83,
1200 -166, 99, -312, 209, 212, -225, -312, -312, -312, -294,
1201 -312, -312, -312, -312, 89, -312, -312, -312, -312, -312,
1202 -312, 280, -312, -312, -312, -312, 96, 101, -203, -312,
1203 -312, -312, 281, -126, -312, -112, -312, -312, -312, -312,
1204 4, -312, 184, -12
Lev Walkin418298d2006-07-13 08:24:20 +00001205};
1206
1207/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1208 positive, shift that token. If negative, reduce the rule which
Lev Walkin752e9732017-08-04 02:06:22 -07001209 number is the opposite. If zero, do what YYDEFACT says.
1210 If YYTABLE_NINF, syntax error. */
1211#define YYTABLE_NINF -285
Lev Walkin0e90aa02013-03-19 16:17:13 -07001212static const yytype_int16 yytable[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001213{
Lev Walkin752e9732017-08-04 02:06:22 -07001214 20, 281, 283, 128, 7, 121, 20, 7, 252, 7,
1215 389, 190, 7, 138, 469, 336, 203, 15, 189, 190,
1216 15, 469, 386, 348, 136, 191, 197, 199, 200, 470,
1217 15, 53, 90, 191, 199, 200, 470, 170, 147, 397,
1218 469, 171, 437, 69, 92, 97, 467, 52, 53, 15,
1219 15, 16, 69, 199, 200, 470, 15, 179, 180, 68,
1220 91, 90, 188, 15, 52, 297, 298, 148, 68, 1,
1221 2, 15, 9, 92, 121, 352, 48, 176, 177, 178,
1222 15, 179, 180, 322, 181, 182, 69, 15, 382, 91,
1223 147, 15, 179, 180, 15, 16, 314, 352, 370, 372,
1224 373, 132, 68, 21, 376, 377, 394, 127, 98, 315,
1225 297, 298, 12, 352, 1, 2, 345, 59, 60, 148,
1226 476, 183, 10, 149, 127, 10, 471, 169, 190, 427,
1227 443, 456, 299, 471, 203, 189, 190, 301, 306, 192,
1228 198, 312, 191, 168, 197, 337, 433, 212, 345, 348,
1229 191, 17, 471, 478, 409, 193, 127, 408, 204, 190,
1230 233, 235, 184, 299, 24, 127, 395, 49, 300, 299,
1231 345, 33, 424, 191, 462, 149, 232, 234, 127, 188,
1232 174, 155, 317, 343, 15, 220, 345, 127, -85, 349,
1233 193, 220, 194, 351, 127, 22, 15, 364, 34, 300,
1234 3, 362, 1, 2, -284, 300, 369, 439, -284, 280,
1235 127, 221, 267, 368, 37, 451, 268, 221, 236, 177,
1236 237, 15, 179, 180, 238, 181, 182, 102, 463, 162,
1237 269, 318, 464, -26, 270, 35, 43, 156, 62, 15,
1238 163, 103, 104, 309, 371, 1, 2, 310, 220, 477,
1239 39, 157, 477, 105, 70, 106, 192, 107, 198, 338,
1240 36, 405, 240, 342, 212, 38, 350, 108, 358, 410,
1241 358, 109, 282, 42, 221, 110, 434, 385, 111, 72,
1242 73, 74, 403, 54, 446, 41, 404, 212, 447, 112,
1243 75, 365, 1, 2, 113, 76, 114, 77, 115, 440,
1244 449, 55, 441, 245, 450, 78, 58, 116, 117, 1,
1245 2, 199, 200, 61, 79, 349, 80, 436, 226, 227,
1246 94, 81, 118, 82, 83, 84, 95, 15, 179, 180,
1247 319, 320, 401, 1, 2, 119, 325, 326, 236, 177,
1248 237, 15, 179, 180, 238, 181, 182, 412, 127, 412,
1249 236, 177, 237, 15, 179, 180, 238, 181, 182, 103,
1250 104, 25, 328, 329, 199, 200, 239, 103, 104, 99,
1251 26, 422, 423, 454, 455, 100, 430, 134, 140, 141,
1252 285, 286, 240, 139, 142, 143, 144, 150, 151, 152,
1253 338, 27, 350, 28, 240, 241, 358, 396, 159, 167,
1254 154, 172, 29, 173, 174, 205, 445, 230, 271, 277,
1255 242, 279, 313, 278, 340, 323, 273, 272, 276, 243,
1256 284, 275, 296, 245, 331, 358, 324, 332, 15, 244,
1257 344, 445, 363, 359, 361, 245, 366, 367, 430, 374,
1258 378, 383, 384, 390, 246, 221, 468, 400, 388, 391,
1259 406, 402, 247, 287, 398, 249, 236, 177, 237, 15,
1260 179, 180, 238, 181, 182, 103, 104, 399, 407, 415,
1261 408, 416, 239, 413, 417, 425, 8, 236, 177, 237,
1262 15, 179, 180, 238, 181, 182, 103, 104, 418, 431,
1263 421, 426, 432, 239, 448, 458, 165, 23, 40, 101,
1264 240, 241, 96, 133, 236, 177, 237, 15, 179, 180,
1265 238, 181, 182, 103, 104, 93, 242, 231, 175, 334,
1266 360, 240, 241, 218, 453, 243, 435, 438, 381, 475,
1267 452, 339, 307, 387, 311, 244, 392, 242, 308, 461,
1268 333, 245, 393, 459, 457, 414, 243, 0, 240, 241,
1269 246, 335, 0, 0, 0, 0, 244, 0, 247, 248,
1270 0, 249, 245, 0, 242, 0, 0, 0, 0, 15,
1271 0, 246, 0, 243, 0, 1, 2, 0, 0, 0,
1272 248, 0, 249, 244, 0, 0, 0, 0, 70, 245,
1273 0, 0, 176, 177, 178, 15, 179, 180, 246, 181,
1274 182, 1, 2, 71, 0, 0, 0, 248, 0, 249,
1275 0, 0, 0, 72, 73, 74, 0, 0, 0, 0,
1276 0, 0, 0, 0, 75, 0, 0, 0, 0, 76,
1277 0, 77, 0, 0, 0, 0, 183, 0, 0, 78,
1278 0, 0, 0, 0, 0, 0, 0, 0, 79, 0,
1279 80, 0, 103, 104, 206, 81, 0, 82, 83, 84,
1280 213, 0, 0, 0, 105, 70, 106, 0, 107, 214,
1281 0, 0, 0, 0, 0, 0, 0, 184, 108, 0,
1282 0, 0, 109, 0, 0, 0, 110, 0, 0, 111,
1283 72, 73, 74, 0, 0, 207, 0, 0, 215, 0,
1284 112, 75, 0, 0, 0, 113, 76, 114, 77, 115,
1285 0, 0, 0, 0, 0, 0, 78, 0, 116, 117,
1286 216, 217, 0, 0, 0, 79, 0, 80, 1, 2,
1287 0, 0, 81, 118, 82, 83, 84, 0, 0, 0,
1288 105, 70, 106, 0, 107, 0, 0, 0, 0, 0,
1289 0, 0, 0, 0, 108, 0, 0, 0, 109, 0,
1290 0, 0, 110, 0, 0, 111, 72, 73, 74, 0,
1291 0, 0, 0, 0, 0, 0, 112, 75, 0, 0,
1292 0, 113, 76, 114, 77, 115, 0, 0, 0, 0,
1293 0, 0, 78, 0, 116, 117, 0, 0, 0, 0,
1294 0, 79, 0, 80, 0, 0, 0, 0, 81, 118,
1295 82, 83, 84
Lev Walkin418298d2006-07-13 08:24:20 +00001296};
1297
Lev Walkin0e90aa02013-03-19 16:17:13 -07001298static const yytype_int16 yycheck[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001299{
Lev Walkin752e9732017-08-04 02:06:22 -07001300 12, 216, 217, 92, 0, 91, 18, 3, 174, 5,
1301 321, 151, 8, 102, 6, 271, 154, 11, 151, 159,
1302 11, 6, 316, 278, 35, 151, 152, 19, 20, 21,
1303 11, 43, 56, 159, 19, 20, 21, 112, 119, 333,
1304 6, 116, 4, 55, 56, 53, 5, 43, 60, 11,
1305 11, 12, 64, 19, 20, 21, 11, 12, 13, 55,
1306 56, 85, 151, 11, 60, 18, 19, 119, 64, 17,
1307 18, 11, 0, 85, 160, 37, 24, 8, 9, 10,
1308 11, 12, 13, 249, 15, 16, 98, 11, 313, 85,
1309 171, 11, 12, 13, 11, 12, 109, 37, 301, 302,
1310 303, 97, 98, 41, 307, 308, 331, 118, 116, 122,
1311 18, 19, 111, 37, 17, 18, 110, 115, 116, 171,
1312 112, 52, 5, 119, 118, 8, 118, 139, 268, 110,
1313 121, 442, 40, 118, 272, 268, 276, 226, 227, 151,
1314 152, 230, 268, 139, 270, 271, 402, 159, 110, 404,
1315 276, 112, 118, 119, 357, 110, 118, 116, 154, 299,
1316 172, 173, 93, 40, 113, 118, 332, 115, 76, 40,
1317 110, 12, 375, 299, 22, 171, 172, 173, 118, 268,
1318 111, 26, 9, 276, 11, 87, 110, 118, 112, 278,
1319 110, 87, 112, 279, 118, 112, 11, 286, 64, 76,
1320 103, 284, 17, 18, 112, 76, 299, 410, 116, 111,
1321 118, 113, 112, 296, 60, 430, 116, 113, 8, 9,
1322 10, 11, 12, 13, 14, 15, 16, 3, 76, 48,
1323 112, 243, 80, 46, 116, 91, 49, 82, 53, 11,
1324 59, 17, 18, 112, 121, 17, 18, 116, 87, 472,
1325 3, 96, 475, 29, 30, 31, 268, 33, 270, 271,
1326 91, 350, 52, 275, 276, 91, 278, 43, 280, 358,
1327 282, 47, 111, 28, 113, 51, 402, 67, 54, 55,
1328 56, 57, 112, 46, 112, 114, 116, 299, 116, 65,
1329 66, 287, 17, 18, 70, 71, 72, 73, 74, 411,
1330 112, 61, 414, 93, 116, 81, 115, 83, 84, 17,
1331 18, 19, 20, 111, 90, 404, 92, 406, 19, 20,
1332 112, 97, 98, 99, 100, 101, 115, 11, 12, 13,
1333 36, 37, 344, 17, 18, 111, 107, 108, 8, 9,
1334 10, 11, 12, 13, 14, 15, 16, 359, 118, 361,
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08001335 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
Lev Walkin752e9732017-08-04 02:06:22 -07001336 18, 18, 105, 106, 19, 20, 24, 17, 18, 111,
1337 27, 19, 20, 440, 441, 18, 388, 112, 88, 88,
1338 38, 39, 52, 121, 78, 58, 88, 3, 111, 111,
1339 402, 48, 404, 50, 52, 53, 408, 67, 3, 111,
1340 121, 117, 59, 117, 111, 12, 418, 3, 113, 42,
1341 68, 75, 104, 111, 7, 112, 119, 121, 117, 77,
1342 113, 121, 113, 93, 104, 437, 116, 113, 11, 87,
1343 32, 443, 32, 75, 75, 93, 114, 111, 450, 95,
1344 102, 122, 109, 114, 102, 113, 458, 7, 111, 110,
1345 75, 120, 110, 111, 114, 113, 8, 9, 10, 11,
1346 12, 13, 14, 15, 16, 17, 18, 114, 112, 114,
1347 116, 111, 24, 112, 112, 89, 3, 8, 9, 10,
1348 11, 12, 13, 14, 15, 16, 17, 18, 123, 116,
1349 114, 122, 114, 24, 111, 121, 132, 18, 31, 85,
1350 52, 53, 64, 98, 8, 9, 10, 11, 12, 13,
1351 14, 15, 16, 17, 18, 60, 68, 171, 150, 268,
1352 282, 52, 53, 160, 437, 77, 404, 408, 310, 471,
1353 431, 272, 227, 319, 230, 87, 327, 68, 227, 450,
1354 260, 93, 330, 447, 443, 361, 77, -1, 52, 53,
1355 102, 270, -1, -1, -1, -1, 87, -1, 110, 111,
1356 -1, 113, 93, -1, 68, -1, -1, -1, -1, 11,
1357 -1, 102, -1, 77, -1, 17, 18, -1, -1, -1,
1358 111, -1, 113, 87, -1, -1, -1, -1, 30, 93,
1359 -1, -1, 8, 9, 10, 11, 12, 13, 102, 15,
1360 16, 17, 18, 45, -1, -1, -1, 111, -1, 113,
1361 -1, -1, -1, 55, 56, 57, -1, -1, -1, -1,
1362 -1, -1, -1, -1, 66, -1, -1, -1, -1, 71,
1363 -1, 73, -1, -1, -1, -1, 52, -1, -1, 81,
1364 -1, -1, -1, -1, -1, -1, -1, -1, 90, -1,
1365 92, -1, 17, 18, 70, 97, -1, 99, 100, 101,
1366 25, -1, -1, -1, 29, 30, 31, -1, 33, 34,
1367 -1, -1, -1, -1, -1, -1, -1, 93, 43, -1,
1368 -1, -1, 47, -1, -1, -1, 51, -1, -1, 54,
1369 55, 56, 57, -1, -1, 111, -1, -1, 63, -1,
1370 65, 66, -1, -1, -1, 70, 71, 72, 73, 74,
1371 -1, -1, -1, -1, -1, -1, 81, -1, 83, 84,
1372 85, 86, -1, -1, -1, 90, -1, 92, 17, 18,
1373 -1, -1, 97, 98, 99, 100, 101, -1, -1, -1,
1374 29, 30, 31, -1, 33, -1, -1, -1, -1, -1,
1375 -1, -1, -1, -1, 43, -1, -1, -1, 47, -1,
1376 -1, -1, 51, -1, -1, 54, 55, 56, 57, -1,
1377 -1, -1, -1, -1, -1, -1, 65, 66, -1, -1,
1378 -1, 70, 71, 72, 73, 74, -1, -1, -1, -1,
1379 -1, -1, 81, -1, 83, 84, -1, -1, -1, -1,
1380 -1, 90, -1, 92, -1, -1, -1, -1, 97, 98,
1381 99, 100, 101
Lev Walkin418298d2006-07-13 08:24:20 +00001382};
1383
1384/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1385 symbol of state STATE-NUM. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001386static const yytype_uint8 yystos[] =
Lev Walkin418298d2006-07-13 08:24:20 +00001387{
Lev Walkin752e9732017-08-04 02:06:22 -07001388 0, 17, 18, 103, 125, 126, 127, 244, 126, 0,
1389 127, 128, 111, 129, 130, 11, 12, 112, 131, 132,
1390 247, 41, 112, 132, 113, 18, 27, 48, 50, 59,
1391 133, 134, 135, 12, 64, 91, 91, 60, 91, 3,
1392 135, 114, 28, 49, 136, 137, 149, 150, 24, 115,
1393 151, 152, 244, 247, 46, 61, 141, 142, 115, 115,
1394 116, 111, 53, 143, 144, 146, 147, 148, 244, 247,
1395 30, 45, 55, 56, 57, 66, 71, 73, 81, 90,
1396 92, 97, 99, 100, 101, 138, 139, 154, 156, 186,
1397 196, 244, 247, 152, 112, 115, 146, 53, 116, 111,
1398 18, 139, 3, 17, 18, 29, 31, 33, 43, 47,
1399 51, 54, 65, 70, 72, 74, 83, 84, 98, 111,
1400 155, 180, 193, 194, 195, 196, 245, 118, 176, 239,
1401 240, 241, 244, 148, 112, 140, 35, 166, 176, 121,
1402 88, 88, 78, 58, 88, 157, 158, 193, 194, 244,
1403 3, 111, 111, 234, 121, 26, 82, 96, 242, 3,
1404 177, 178, 48, 59, 243, 130, 145, 111, 244, 247,
1405 112, 116, 117, 117, 111, 153, 8, 9, 10, 12,
1406 13, 15, 16, 52, 93, 153, 159, 160, 176, 189,
1407 191, 237, 247, 110, 112, 235, 236, 237, 247, 19,
1408 20, 181, 182, 183, 244, 12, 70, 111, 187, 189,
1409 190, 244, 247, 25, 34, 63, 85, 86, 155, 179,
1410 87, 113, 199, 200, 201, 202, 19, 20, 168, 169,
1411 3, 158, 244, 247, 244, 247, 8, 10, 14, 24,
1412 52, 53, 68, 77, 87, 93, 102, 110, 111, 113,
1413 180, 191, 204, 205, 206, 207, 208, 209, 211, 212,
1414 213, 214, 215, 216, 237, 238, 247, 112, 116, 112,
1415 116, 113, 121, 119, 188, 121, 117, 42, 111, 75,
1416 111, 199, 111, 199, 113, 38, 39, 111, 203, 204,
1417 221, 222, 224, 226, 227, 228, 113, 18, 19, 40,
1418 76, 176, 184, 185, 232, 233, 176, 184, 185, 112,
1419 116, 166, 176, 104, 109, 122, 225, 9, 247, 36,
1420 37, 210, 204, 112, 116, 107, 108, 197, 105, 106,
1421 198, 104, 113, 225, 160, 236, 190, 237, 247, 182,
1422 7, 192, 247, 187, 32, 110, 164, 165, 175, 176,
1423 247, 180, 37, 161, 162, 163, 175, 176, 247, 75,
1424 161, 75, 203, 32, 176, 244, 114, 111, 203, 187,
1425 232, 121, 232, 232, 95, 167, 232, 232, 102, 170,
1426 171, 169, 209, 122, 109, 67, 213, 202, 111, 192,
1427 114, 110, 207, 208, 209, 204, 67, 213, 114, 114,
1428 7, 247, 120, 112, 116, 176, 75, 112, 116, 232,
1429 176, 246, 247, 112, 246, 114, 111, 112, 123, 229,
1430 230, 114, 19, 20, 232, 89, 122, 110, 217, 218,
1431 247, 116, 114, 190, 237, 165, 176, 4, 163, 232,
1432 239, 239, 223, 121, 231, 247, 112, 116, 111, 112,
1433 116, 199, 205, 162, 178, 178, 192, 231, 121, 230,
1434 172, 218, 22, 76, 80, 219, 220, 5, 247, 6,
1435 21, 118, 173, 174, 183, 173, 112, 174, 119
Lev Walkin418298d2006-07-13 08:24:20 +00001436};
1437
Lev Walkinf15320b2004-06-03 03:38:44 +00001438#define yyerrok (yyerrstatus = 0)
1439#define yyclearin (yychar = YYEMPTY)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001440#define YYEMPTY (-2)
Lev Walkinf15320b2004-06-03 03:38:44 +00001441#define YYEOF 0
Lev Walkin418298d2006-07-13 08:24:20 +00001442
Lev Walkinf15320b2004-06-03 03:38:44 +00001443#define YYACCEPT goto yyacceptlab
Lev Walkin418298d2006-07-13 08:24:20 +00001444#define YYABORT goto yyabortlab
Lev Walkin0e90aa02013-03-19 16:17:13 -07001445#define YYERROR goto yyerrorlab
1446
Lev Walkin418298d2006-07-13 08:24:20 +00001447
1448/* Like YYERROR except do call yyerror. This remains here temporarily
1449 to ease the transition to the new meaning of YYERROR, for GCC.
Lev Walkin752e9732017-08-04 02:06:22 -07001450 Once GCC version 2 has supplanted version 1, this can go. */
Lev Walkin418298d2006-07-13 08:24:20 +00001451
Lev Walkinf15320b2004-06-03 03:38:44 +00001452#define YYFAIL goto yyerrlab
Lev Walkin418298d2006-07-13 08:24:20 +00001453
Lev Walkinf15320b2004-06-03 03:38:44 +00001454#define YYRECOVERING() (!!yyerrstatus)
Lev Walkin418298d2006-07-13 08:24:20 +00001455
Lev Walkin752e9732017-08-04 02:06:22 -07001456#define YYBACKUP(Token, Value) \
1457do \
1458 if (yychar == YYEMPTY && yylen == 1) \
1459 { \
1460 yychar = (Token); \
1461 yylval = (Value); \
1462 yytoken = YYTRANSLATE (yychar); \
1463 YYPOPSTACK (1); \
1464 goto yybackup; \
1465 } \
1466 else \
1467 { \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001468 yyerror (YY_("syntax error: cannot back up")); \
Lev Walkin418298d2006-07-13 08:24:20 +00001469 YYERROR; \
1470 } \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001471while (YYID (0))
1472
Lev Walkin752e9732017-08-04 02:06:22 -07001473
Lev Walkinf15320b2004-06-03 03:38:44 +00001474#define YYTERROR 1
1475#define YYERRCODE 256
1476
Lev Walkin418298d2006-07-13 08:24:20 +00001477
Lev Walkin752e9732017-08-04 02:06:22 -07001478/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1479 If N is 0, then set CURRENT to the empty location which ends
1480 the previous symbol: RHS[0] (always defined). */
1481
1482#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1483#ifndef YYLLOC_DEFAULT
1484# define YYLLOC_DEFAULT(Current, Rhs, N) \
1485 do \
1486 if (YYID (N)) \
1487 { \
1488 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1489 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1490 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1491 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1492 } \
1493 else \
1494 { \
1495 (Current).first_line = (Current).last_line = \
1496 YYRHSLOC (Rhs, 0).last_line; \
1497 (Current).first_column = (Current).last_column = \
1498 YYRHSLOC (Rhs, 0).last_column; \
1499 } \
1500 while (YYID (0))
1501#endif
1502
1503
1504/* YY_LOCATION_PRINT -- Print the location on the stream.
1505 This macro was not mandated originally: define only if we know
1506 we won't break user code: when these are the locations we know. */
1507
Lev Walkin0e90aa02013-03-19 16:17:13 -07001508#ifndef YY_LOCATION_PRINT
Lev Walkin752e9732017-08-04 02:06:22 -07001509# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1510# define YY_LOCATION_PRINT(File, Loc) \
1511 fprintf (File, "%d.%d-%d.%d", \
1512 (Loc).first_line, (Loc).first_column, \
1513 (Loc).last_line, (Loc).last_column)
1514# else
1515# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1516# endif
Lev Walkin0e90aa02013-03-19 16:17:13 -07001517#endif
1518
1519
Lev Walkin418298d2006-07-13 08:24:20 +00001520/* YYLEX -- calling `yylex' with the right arguments. */
Lev Walkin752e9732017-08-04 02:06:22 -07001521
Lev Walkin0e90aa02013-03-19 16:17:13 -07001522#ifdef YYLEX_PARAM
1523# define YYLEX yylex (YYLEX_PARAM)
1524#else
1525# define YYLEX yylex ()
1526#endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00001527
Lev Walkin418298d2006-07-13 08:24:20 +00001528/* Enable debugging if requested. */
1529#if YYDEBUG
Lev Walkinfb872bd2006-03-18 06:53:11 +00001530
Lev Walkin418298d2006-07-13 08:24:20 +00001531# ifndef YYFPRINTF
1532# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1533# define YYFPRINTF fprintf
1534# endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00001535
Lev Walkin418298d2006-07-13 08:24:20 +00001536# define YYDPRINTF(Args) \
1537do { \
1538 if (yydebug) \
1539 YYFPRINTF Args; \
Lev Walkin0e90aa02013-03-19 16:17:13 -07001540} while (YYID (0))
1541
1542# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1543do { \
1544 if (yydebug) \
1545 { \
1546 YYFPRINTF (stderr, "%s ", Title); \
1547 yy_symbol_print (stderr, \
1548 Type, Value); \
1549 YYFPRINTF (stderr, "\n"); \
1550 } \
1551} while (YYID (0))
1552
1553
1554/*--------------------------------.
1555| Print this symbol on YYOUTPUT. |
1556`--------------------------------*/
1557
1558/*ARGSUSED*/
1559#if (defined __STDC__ || defined __C99__FUNC__ \
1560 || defined __cplusplus || defined _MSC_VER)
1561static void
1562yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1563#else
1564static void
1565yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1566 FILE *yyoutput;
1567 int yytype;
1568 YYSTYPE const * const yyvaluep;
1569#endif
1570{
1571 if (!yyvaluep)
1572 return;
1573# ifdef YYPRINT
1574 if (yytype < YYNTOKENS)
1575 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1576# else
1577 YYUSE (yyoutput);
1578# endif
Lev Walkin752e9732017-08-04 02:06:22 -07001579 switch (yytype)
1580 {
1581 default:
1582 break;
1583 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07001584}
1585
1586
1587/*--------------------------------.
1588| Print this symbol on YYOUTPUT. |
1589`--------------------------------*/
1590
1591#if (defined __STDC__ || defined __C99__FUNC__ \
1592 || defined __cplusplus || defined _MSC_VER)
1593static void
1594yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1595#else
1596static void
1597yy_symbol_print (yyoutput, yytype, yyvaluep)
1598 FILE *yyoutput;
1599 int yytype;
1600 YYSTYPE const * const yyvaluep;
1601#endif
1602{
1603 if (yytype < YYNTOKENS)
1604 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1605 else
1606 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1607
1608 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1609 YYFPRINTF (yyoutput, ")");
1610}
1611
1612/*------------------------------------------------------------------.
1613| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1614| TOP (included). |
1615`------------------------------------------------------------------*/
1616
1617#if (defined __STDC__ || defined __C99__FUNC__ \
1618 || defined __cplusplus || defined _MSC_VER)
1619static void
Lev Walkin752e9732017-08-04 02:06:22 -07001620yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001621#else
1622static void
Lev Walkin752e9732017-08-04 02:06:22 -07001623yy_stack_print (bottom, top)
1624 yytype_int16 *bottom;
1625 yytype_int16 *top;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001626#endif
1627{
1628 YYFPRINTF (stderr, "Stack now");
Lev Walkin752e9732017-08-04 02:06:22 -07001629 for (; bottom <= top; ++bottom)
1630 YYFPRINTF (stderr, " %d", *bottom);
Lev Walkin0e90aa02013-03-19 16:17:13 -07001631 YYFPRINTF (stderr, "\n");
1632}
1633
1634# define YY_STACK_PRINT(Bottom, Top) \
1635do { \
1636 if (yydebug) \
1637 yy_stack_print ((Bottom), (Top)); \
1638} while (YYID (0))
1639
1640
1641/*------------------------------------------------.
1642| Report that the YYRULE is going to be reduced. |
1643`------------------------------------------------*/
1644
1645#if (defined __STDC__ || defined __C99__FUNC__ \
1646 || defined __cplusplus || defined _MSC_VER)
1647static void
1648yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1649#else
1650static void
1651yy_reduce_print (yyvsp, yyrule)
1652 YYSTYPE *yyvsp;
1653 int yyrule;
1654#endif
1655{
1656 int yynrhs = yyr2[yyrule];
1657 int yyi;
1658 unsigned long int yylno = yyrline[yyrule];
1659 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1660 yyrule - 1, yylno);
1661 /* The symbols being reduced. */
1662 for (yyi = 0; yyi < yynrhs; yyi++)
1663 {
Lev Walkin752e9732017-08-04 02:06:22 -07001664 fprintf (stderr, " $%d = ", yyi + 1);
Lev Walkin0e90aa02013-03-19 16:17:13 -07001665 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1666 &(yyvsp[(yyi + 1) - (yynrhs)])
1667 );
Lev Walkin752e9732017-08-04 02:06:22 -07001668 fprintf (stderr, "\n");
Lev Walkin0e90aa02013-03-19 16:17:13 -07001669 }
1670}
1671
1672# define YY_REDUCE_PRINT(Rule) \
1673do { \
1674 if (yydebug) \
1675 yy_reduce_print (yyvsp, Rule); \
1676} while (YYID (0))
1677
Lev Walkin418298d2006-07-13 08:24:20 +00001678/* Nonzero means print parse trace. It is left uninitialized so that
1679 multiple parsers can coexist. */
1680int yydebug;
1681#else /* !YYDEBUG */
1682# define YYDPRINTF(Args)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001683# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1684# define YY_STACK_PRINT(Bottom, Top)
1685# define YY_REDUCE_PRINT(Rule)
Lev Walkin418298d2006-07-13 08:24:20 +00001686#endif /* !YYDEBUG */
Lev Walkinfb872bd2006-03-18 06:53:11 +00001687
Lev Walkin0e90aa02013-03-19 16:17:13 -07001688
Lev Walkin418298d2006-07-13 08:24:20 +00001689/* YYINITDEPTH -- initial size of the parser's stacks. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001690#ifndef YYINITDEPTH
Lev Walkin418298d2006-07-13 08:24:20 +00001691# define YYINITDEPTH 200
Lev Walkinf15320b2004-06-03 03:38:44 +00001692#endif
1693
Lev Walkin418298d2006-07-13 08:24:20 +00001694/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1695 if the built-in stack extension method is used).
1696
1697 Do not make this value too large; the results are undefined if
Lev Walkin0e90aa02013-03-19 16:17:13 -07001698 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Lev Walkin418298d2006-07-13 08:24:20 +00001699 evaluated with infinite-precision integer arithmetic. */
Lev Walkinf15320b2004-06-03 03:38:44 +00001700
Lev Walkinf15320b2004-06-03 03:38:44 +00001701#ifndef YYMAXDEPTH
Lev Walkin418298d2006-07-13 08:24:20 +00001702# define YYMAXDEPTH 10000
Lev Walkinf15320b2004-06-03 03:38:44 +00001703#endif
Lev Walkin418298d2006-07-13 08:24:20 +00001704
Lev Walkin752e9732017-08-04 02:06:22 -07001705
Lev Walkinf15320b2004-06-03 03:38:44 +00001706
Lev Walkin418298d2006-07-13 08:24:20 +00001707#if YYERROR_VERBOSE
Lev Walkinf15320b2004-06-03 03:38:44 +00001708
Lev Walkin418298d2006-07-13 08:24:20 +00001709# ifndef yystrlen
Lev Walkin0e90aa02013-03-19 16:17:13 -07001710# if defined __GLIBC__ && defined _STRING_H
Lev Walkin418298d2006-07-13 08:24:20 +00001711# define yystrlen strlen
1712# else
1713/* Return the length of YYSTR. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001714#if (defined __STDC__ || defined __C99__FUNC__ \
1715 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001716static YYSIZE_T
Lev Walkin418298d2006-07-13 08:24:20 +00001717yystrlen (const char *yystr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001718#else
1719static YYSIZE_T
Lev Walkin418298d2006-07-13 08:24:20 +00001720yystrlen (yystr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001721 const char *yystr;
1722#endif
Lev Walkina00d6b32006-03-21 03:40:38 +00001723{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001724 YYSIZE_T yylen;
1725 for (yylen = 0; yystr[yylen]; yylen++)
Lev Walkin418298d2006-07-13 08:24:20 +00001726 continue;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001727 return yylen;
Lev Walkin418298d2006-07-13 08:24:20 +00001728}
1729# endif
1730# endif
1731
1732# ifndef yystpcpy
Lev Walkin0e90aa02013-03-19 16:17:13 -07001733# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Lev Walkin418298d2006-07-13 08:24:20 +00001734# define yystpcpy stpcpy
1735# else
1736/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1737 YYDEST. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07001738#if (defined __STDC__ || defined __C99__FUNC__ \
1739 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001740static char *
Lev Walkin418298d2006-07-13 08:24:20 +00001741yystpcpy (char *yydest, const char *yysrc)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001742#else
1743static char *
Lev Walkin418298d2006-07-13 08:24:20 +00001744yystpcpy (yydest, yysrc)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001745 char *yydest;
1746 const char *yysrc;
1747#endif
Lev Walkin418298d2006-07-13 08:24:20 +00001748{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001749 char *yyd = yydest;
1750 const char *yys = yysrc;
Lev Walkin418298d2006-07-13 08:24:20 +00001751
1752 while ((*yyd++ = *yys++) != '\0')
1753 continue;
1754
1755 return yyd - 1;
1756}
1757# endif
1758# endif
1759
Lev Walkin0e90aa02013-03-19 16:17:13 -07001760# ifndef yytnamerr
1761/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1762 quotes and backslashes, so that it's suitable for yyerror. The
1763 heuristic is that double-quoting is unnecessary unless the string
1764 contains an apostrophe, a comma, or backslash (other than
1765 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1766 null, do not copy; instead, return the length of what the result
1767 would have been. */
1768static YYSIZE_T
1769yytnamerr (char *yyres, const char *yystr)
Lev Walkin418298d2006-07-13 08:24:20 +00001770{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001771 if (*yystr == '"')
Lev Walkin418298d2006-07-13 08:24:20 +00001772 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07001773 YYSIZE_T yyn = 0;
1774 char const *yyp = yystr;
Lev Walkin418298d2006-07-13 08:24:20 +00001775
Lev Walkin0e90aa02013-03-19 16:17:13 -07001776 for (;;)
1777 switch (*++yyp)
1778 {
1779 case '\'':
1780 case ',':
1781 goto do_not_strip_quotes;
1782
1783 case '\\':
1784 if (*++yyp != '\\')
1785 goto do_not_strip_quotes;
1786 /* Fall through. */
1787 default:
1788 if (yyres)
1789 yyres[yyn] = *yyp;
1790 yyn++;
1791 break;
1792
1793 case '"':
1794 if (yyres)
1795 yyres[yyn] = '\0';
1796 return yyn;
1797 }
1798 do_not_strip_quotes: ;
Lev Walkin418298d2006-07-13 08:24:20 +00001799 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07001800
1801 if (! yyres)
1802 return yystrlen (yystr);
1803
1804 return yystpcpy (yyres, yystr) - yyres;
Lev Walkin418298d2006-07-13 08:24:20 +00001805}
Lev Walkin0e90aa02013-03-19 16:17:13 -07001806# endif
Lev Walkin418298d2006-07-13 08:24:20 +00001807
Lev Walkin752e9732017-08-04 02:06:22 -07001808/* Copy into YYRESULT an error message about the unexpected token
1809 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1810 including the terminating null byte. If YYRESULT is null, do not
1811 copy anything; just return the number of bytes that would be
1812 copied. As a special case, return 0 if an ordinary "syntax error"
1813 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1814 size calculation. */
1815static YYSIZE_T
1816yysyntax_error (char *yyresult, int yystate, int yychar)
Lev Walkin0e90aa02013-03-19 16:17:13 -07001817{
Lev Walkin752e9732017-08-04 02:06:22 -07001818 int yyn = yypact[yystate];
Lev Walkin0e90aa02013-03-19 16:17:13 -07001819
Lev Walkin752e9732017-08-04 02:06:22 -07001820 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1821 return 0;
1822 else
Lev Walkin0e90aa02013-03-19 16:17:13 -07001823 {
Lev Walkin752e9732017-08-04 02:06:22 -07001824 int yytype = YYTRANSLATE (yychar);
1825 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1826 YYSIZE_T yysize = yysize0;
1827 YYSIZE_T yysize1;
1828 int yysize_overflow = 0;
1829 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1830 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1831 int yyx;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001832
Lev Walkin752e9732017-08-04 02:06:22 -07001833# if 0
1834 /* This is so xgettext sees the translatable formats that are
1835 constructed on the fly. */
1836 YY_("syntax error, unexpected %s");
1837 YY_("syntax error, unexpected %s, expecting %s");
1838 YY_("syntax error, unexpected %s, expecting %s or %s");
1839 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1840 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1841# endif
1842 char *yyfmt;
1843 char const *yyf;
1844 static char const yyunexpected[] = "syntax error, unexpected %s";
1845 static char const yyexpecting[] = ", expecting %s";
1846 static char const yyor[] = " or %s";
1847 char yyformat[sizeof yyunexpected
1848 + sizeof yyexpecting - 1
1849 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1850 * (sizeof yyor - 1))];
1851 char const *yyprefix = yyexpecting;
1852
1853 /* Start YYX at -YYN if negative to avoid negative indexes in
1854 YYCHECK. */
1855 int yyxbegin = yyn < 0 ? -yyn : 0;
1856
1857 /* Stay within bounds of both yycheck and yytname. */
1858 int yychecklim = YYLAST - yyn + 1;
1859 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1860 int yycount = 1;
1861
1862 yyarg[0] = yytname[yytype];
1863 yyfmt = yystpcpy (yyformat, yyunexpected);
1864
1865 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1866 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1867 {
1868 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1869 {
1870 yycount = 1;
1871 yysize = yysize0;
1872 yyformat[sizeof yyunexpected - 1] = '\0';
1873 break;
1874 }
1875 yyarg[yycount++] = yytname[yyx];
1876 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1877 yysize_overflow |= (yysize1 < yysize);
1878 yysize = yysize1;
1879 yyfmt = yystpcpy (yyfmt, yyprefix);
1880 yyprefix = yyor;
1881 }
1882
1883 yyf = YY_(yyformat);
1884 yysize1 = yysize + yystrlen (yyf);
1885 yysize_overflow |= (yysize1 < yysize);
1886 yysize = yysize1;
1887
1888 if (yysize_overflow)
1889 return YYSIZE_MAXIMUM;
1890
1891 if (yyresult)
1892 {
1893 /* Avoid sprintf, as that infringes on the user's name space.
1894 Don't have undefined behavior even if the translation
1895 produced a string with the wrong number of "%s"s. */
1896 char *yyp = yyresult;
1897 int yyi = 0;
1898 while ((*yyp = *yyf) != '\0')
1899 {
1900 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1901 {
1902 yyp += yytnamerr (yyp, yyarg[yyi++]);
1903 yyf += 2;
1904 }
1905 else
1906 {
1907 yyp++;
1908 yyf++;
1909 }
1910 }
1911 }
1912 return yysize;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001913 }
1914}
1915#endif /* YYERROR_VERBOSE */
Lev Walkin752e9732017-08-04 02:06:22 -07001916
Lev Walkin418298d2006-07-13 08:24:20 +00001917
1918/*-----------------------------------------------.
1919| Release the memory associated to this symbol. |
1920`-----------------------------------------------*/
1921
Lev Walkin0e90aa02013-03-19 16:17:13 -07001922/*ARGSUSED*/
1923#if (defined __STDC__ || defined __C99__FUNC__ \
1924 || defined __cplusplus || defined _MSC_VER)
Lev Walkin418298d2006-07-13 08:24:20 +00001925static void
Lev Walkin0e90aa02013-03-19 16:17:13 -07001926yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Lev Walkin418298d2006-07-13 08:24:20 +00001927#else
Lev Walkin0e90aa02013-03-19 16:17:13 -07001928static void
1929yydestruct (yymsg, yytype, yyvaluep)
1930 const char *yymsg;
Lev Walkin418298d2006-07-13 08:24:20 +00001931 int yytype;
Lev Walkin0e90aa02013-03-19 16:17:13 -07001932 YYSTYPE *yyvaluep;
Lev Walkin418298d2006-07-13 08:24:20 +00001933#endif
1934{
Lev Walkin0e90aa02013-03-19 16:17:13 -07001935 YYUSE (yyvaluep);
1936
1937 if (!yymsg)
1938 yymsg = "Deleting";
1939 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
Lev Walkin418298d2006-07-13 08:24:20 +00001940
Lev Walkin752e9732017-08-04 02:06:22 -07001941 switch (yytype)
1942 {
1943
1944 default:
1945 break;
1946 }
Lev Walkina00d6b32006-03-21 03:40:38 +00001947}
Lev Walkin752e9732017-08-04 02:06:22 -07001948
1949
1950/* Prevent warnings from -Wmissing-prototypes. */
1951
1952#ifdef YYPARSE_PARAM
1953#if defined __STDC__ || defined __cplusplus
1954int yyparse (void *YYPARSE_PARAM);
1955#else
1956int yyparse ();
1957#endif
1958#else /* ! YYPARSE_PARAM */
1959#if defined __STDC__ || defined __cplusplus
1960int yyparse (void);
1961#else
1962int yyparse ();
1963#endif
1964#endif /* ! YYPARSE_PARAM */
Lev Walkin418298d2006-07-13 08:24:20 +00001965
1966
Lev Walkin0e90aa02013-03-19 16:17:13 -07001967
Lev Walkin752e9732017-08-04 02:06:22 -07001968/* The look-ahead symbol. */
Lev Walkin418298d2006-07-13 08:24:20 +00001969int yychar;
1970
Lev Walkin752e9732017-08-04 02:06:22 -07001971/* The semantic value of the look-ahead symbol. */
1972YYSTYPE yylval;
Lev Walkin418298d2006-07-13 08:24:20 +00001973
Lev Walkin0e90aa02013-03-19 16:17:13 -07001974/* Number of syntax errors so far. */
Lev Walkin418298d2006-07-13 08:24:20 +00001975int yynerrs;
1976
Lev Walkinfb872bd2006-03-18 06:53:11 +00001977
Lev Walkin752e9732017-08-04 02:06:22 -07001978
Lev Walkin0e90aa02013-03-19 16:17:13 -07001979/*----------.
1980| yyparse. |
1981`----------*/
1982
1983#ifdef YYPARSE_PARAM
1984#if (defined __STDC__ || defined __C99__FUNC__ \
1985 || defined __cplusplus || defined _MSC_VER)
Lev Walkinfb872bd2006-03-18 06:53:11 +00001986int
Lev Walkin0e90aa02013-03-19 16:17:13 -07001987yyparse (void *YYPARSE_PARAM)
1988#else
1989int
1990yyparse (YYPARSE_PARAM)
1991 void *YYPARSE_PARAM;
1992#endif
1993#else /* ! YYPARSE_PARAM */
1994#if (defined __STDC__ || defined __C99__FUNC__ \
1995 || defined __cplusplus || defined _MSC_VER)
1996int
1997yyparse (void)
1998#else
1999int
2000yyparse ()
2001
2002#endif
2003#endif
Lev Walkinfb872bd2006-03-18 06:53:11 +00002004{
Lev Walkin752e9732017-08-04 02:06:22 -07002005
2006 int yystate;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002007 int yyn;
Lev Walkin418298d2006-07-13 08:24:20 +00002008 int yyresult;
Lev Walkin752e9732017-08-04 02:06:22 -07002009 /* Number of tokens to shift before error messages enabled. */
2010 int yyerrstatus;
2011 /* Look-ahead token as an internal (translated) token number. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002012 int yytoken = 0;
2013#if YYERROR_VERBOSE
2014 /* Buffer for error messages, and its allocated size. */
2015 char yymsgbuf[128];
2016 char *yymsg = yymsgbuf;
2017 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2018#endif
Lev Walkin418298d2006-07-13 08:24:20 +00002019
Lev Walkin752e9732017-08-04 02:06:22 -07002020 /* Three stacks and their tools:
2021 `yyss': related to states,
2022 `yyvs': related to semantic values,
2023 `yyls': related to locations.
2024
2025 Refer to the stacks thru separate pointers, to allow yyoverflow
2026 to reallocate them elsewhere. */
2027
2028 /* The state stack. */
2029 yytype_int16 yyssa[YYINITDEPTH];
2030 yytype_int16 *yyss = yyssa;
2031 yytype_int16 *yyssp;
2032
2033 /* The semantic value stack. */
2034 YYSTYPE yyvsa[YYINITDEPTH];
2035 YYSTYPE *yyvs = yyvsa;
2036 YYSTYPE *yyvsp;
2037
2038
2039
Lev Walkin0e90aa02013-03-19 16:17:13 -07002040#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
Lev Walkinf15320b2004-06-03 03:38:44 +00002041
Lev Walkin752e9732017-08-04 02:06:22 -07002042 YYSIZE_T yystacksize = YYINITDEPTH;
2043
2044 /* The variables used to return semantic value and location from the
2045 action routines. */
2046 YYSTYPE yyval;
2047
2048
Lev Walkin0e90aa02013-03-19 16:17:13 -07002049 /* The number of symbols on the RHS of the reduced rule.
2050 Keep to zero when no symbol should be popped. */
2051 int yylen = 0;
Lev Walkinf15320b2004-06-03 03:38:44 +00002052
Lev Walkin418298d2006-07-13 08:24:20 +00002053 YYDPRINTF ((stderr, "Starting parse\n"));
Lev Walkinf15320b2004-06-03 03:38:44 +00002054
2055 yystate = 0;
2056 yyerrstatus = 0;
2057 yynerrs = 0;
Lev Walkin752e9732017-08-04 02:06:22 -07002058 yychar = YYEMPTY; /* Cause a token to be read. */
2059
2060 /* Initialize stack pointers.
2061 Waste one element of value and location stack
2062 so that they stay on the same level as the state stack.
2063 The wasted elements are never initialized. */
2064
2065 yyssp = yyss;
2066 yyvsp = yyvs;
2067
Lev Walkin418298d2006-07-13 08:24:20 +00002068 goto yysetstate;
Lev Walkinf15320b2004-06-03 03:38:44 +00002069
Lev Walkin418298d2006-07-13 08:24:20 +00002070/*------------------------------------------------------------.
2071| yynewstate -- Push a new state, which is found in yystate. |
2072`------------------------------------------------------------*/
2073 yynewstate:
2074 /* In all cases, when you get here, the value and location stacks
Lev Walkin0e90aa02013-03-19 16:17:13 -07002075 have just been pushed. So pushing a state here evens the stacks. */
Lev Walkin418298d2006-07-13 08:24:20 +00002076 yyssp++;
2077
2078 yysetstate:
2079 *yyssp = yystate;
Lev Walkinf15320b2004-06-03 03:38:44 +00002080
Lev Walkin0e90aa02013-03-19 16:17:13 -07002081 if (yyss + yystacksize - 1 <= yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00002082 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002083 /* Get the current used size of the three stacks, in elements. */
Lev Walkin418298d2006-07-13 08:24:20 +00002084 YYSIZE_T yysize = yyssp - yyss + 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00002085
2086#ifdef yyoverflow
Lev Walkin418298d2006-07-13 08:24:20 +00002087 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002088 /* Give user a chance to reallocate the stack. Use copies of
Lev Walkin418298d2006-07-13 08:24:20 +00002089 these so that the &'s don't force the real ones into
2090 memory. */
2091 YYSTYPE *yyvs1 = yyvs;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002092 yytype_int16 *yyss1 = yyss;
Lev Walkinf15320b2004-06-03 03:38:44 +00002093
Lev Walkin752e9732017-08-04 02:06:22 -07002094
Lev Walkin418298d2006-07-13 08:24:20 +00002095 /* Each stack pointer address is followed by the size of the
2096 data in use in that stack, in bytes. This used to be a
2097 conditional around just the two extra args, but that might
2098 be undefined if yyoverflow is a macro. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002099 yyoverflow (YY_("memory exhausted"),
Lev Walkin418298d2006-07-13 08:24:20 +00002100 &yyss1, yysize * sizeof (*yyssp),
2101 &yyvs1, yysize * sizeof (*yyvsp),
Lev Walkin752e9732017-08-04 02:06:22 -07002102
Lev Walkin418298d2006-07-13 08:24:20 +00002103 &yystacksize);
2104
2105 yyss = yyss1;
2106 yyvs = yyvs1;
2107 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002108#else /* no yyoverflow */
Lev Walkin418298d2006-07-13 08:24:20 +00002109# ifndef YYSTACK_RELOCATE
Lev Walkin0e90aa02013-03-19 16:17:13 -07002110 goto yyexhaustedlab;
Lev Walkin418298d2006-07-13 08:24:20 +00002111# else
Lev Walkinf15320b2004-06-03 03:38:44 +00002112 /* Extend the stack our own way. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002113 if (YYMAXDEPTH <= yystacksize)
2114 goto yyexhaustedlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00002115 yystacksize *= 2;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002116 if (YYMAXDEPTH < yystacksize)
Lev Walkinf15320b2004-06-03 03:38:44 +00002117 yystacksize = YYMAXDEPTH;
Lev Walkin418298d2006-07-13 08:24:20 +00002118
2119 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002120 yytype_int16 *yyss1 = yyss;
Lev Walkin418298d2006-07-13 08:24:20 +00002121 union yyalloc *yyptr =
2122 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2123 if (! yyptr)
Lev Walkin0e90aa02013-03-19 16:17:13 -07002124 goto yyexhaustedlab;
Lev Walkin752e9732017-08-04 02:06:22 -07002125 YYSTACK_RELOCATE (yyss);
2126 YYSTACK_RELOCATE (yyvs);
2127
Lev Walkin418298d2006-07-13 08:24:20 +00002128# undef YYSTACK_RELOCATE
2129 if (yyss1 != yyssa)
2130 YYSTACK_FREE (yyss1);
2131 }
2132# endif
Lev Walkinf15320b2004-06-03 03:38:44 +00002133#endif /* no yyoverflow */
2134
Lev Walkin418298d2006-07-13 08:24:20 +00002135 yyssp = yyss + yysize - 1;
2136 yyvsp = yyvs + yysize - 1;
Lev Walkinf15320b2004-06-03 03:38:44 +00002137
Lev Walkin752e9732017-08-04 02:06:22 -07002138
Lev Walkin418298d2006-07-13 08:24:20 +00002139 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2140 (unsigned long int) yystacksize));
Lev Walkinf15320b2004-06-03 03:38:44 +00002141
Lev Walkin0e90aa02013-03-19 16:17:13 -07002142 if (yyss + yystacksize - 1 <= yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00002143 YYABORT;
2144 }
2145
Lev Walkin418298d2006-07-13 08:24:20 +00002146 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
Lev Walkinf15320b2004-06-03 03:38:44 +00002147
2148 goto yybackup;
Lev Walkin418298d2006-07-13 08:24:20 +00002149
2150/*-----------.
2151| yybackup. |
2152`-----------*/
2153yybackup:
Lev Walkinf15320b2004-06-03 03:38:44 +00002154
Lev Walkin0e90aa02013-03-19 16:17:13 -07002155 /* Do appropriate processing given the current state. Read a
Lev Walkin752e9732017-08-04 02:06:22 -07002156 look-ahead token if we need one and don't already have one. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002157
Lev Walkin752e9732017-08-04 02:06:22 -07002158 /* First try to decide what to do without reference to look-ahead token. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002159 yyn = yypact[yystate];
Lev Walkin752e9732017-08-04 02:06:22 -07002160 if (yyn == YYPACT_NINF)
Lev Walkinf15320b2004-06-03 03:38:44 +00002161 goto yydefault;
2162
Lev Walkin752e9732017-08-04 02:06:22 -07002163 /* Not known => get a look-ahead token if don't already have one. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002164
Lev Walkin752e9732017-08-04 02:06:22 -07002165 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002166 if (yychar == YYEMPTY)
2167 {
Lev Walkin418298d2006-07-13 08:24:20 +00002168 YYDPRINTF ((stderr, "Reading a token: "));
Lev Walkinf15320b2004-06-03 03:38:44 +00002169 yychar = YYLEX;
2170 }
2171
Lev Walkin0e90aa02013-03-19 16:17:13 -07002172 if (yychar <= YYEOF)
Lev Walkinf15320b2004-06-03 03:38:44 +00002173 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002174 yychar = yytoken = YYEOF;
Lev Walkin418298d2006-07-13 08:24:20 +00002175 YYDPRINTF ((stderr, "Now at end of input.\n"));
Lev Walkinf15320b2004-06-03 03:38:44 +00002176 }
2177 else
2178 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002179 yytoken = YYTRANSLATE (yychar);
2180 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Lev Walkinf15320b2004-06-03 03:38:44 +00002181 }
2182
Lev Walkin0e90aa02013-03-19 16:17:13 -07002183 /* If the proper action on seeing token YYTOKEN is to reduce or to
Lev Walkin418298d2006-07-13 08:24:20 +00002184 detect an error, take that action. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002185 yyn += yytoken;
2186 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
Lev Walkinf15320b2004-06-03 03:38:44 +00002187 goto yydefault;
Lev Walkinf15320b2004-06-03 03:38:44 +00002188 yyn = yytable[yyn];
Lev Walkin418298d2006-07-13 08:24:20 +00002189 if (yyn <= 0)
Lev Walkinf15320b2004-06-03 03:38:44 +00002190 {
Lev Walkin752e9732017-08-04 02:06:22 -07002191 if (yyn == 0 || yyn == YYTABLE_NINF)
2192 goto yyerrlab;
Lev Walkinf15320b2004-06-03 03:38:44 +00002193 yyn = -yyn;
2194 goto yyreduce;
2195 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002196
Lev Walkin752e9732017-08-04 02:06:22 -07002197 if (yyn == YYFINAL)
2198 YYACCEPT;
2199
Lev Walkin418298d2006-07-13 08:24:20 +00002200 /* Count tokens shifted since error; after three, turn off error
2201 status. */
2202 if (yyerrstatus)
2203 yyerrstatus--;
Lev Walkinf15320b2004-06-03 03:38:44 +00002204
Lev Walkin752e9732017-08-04 02:06:22 -07002205 /* Shift the look-ahead token. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002206 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2207
Lev Walkin752e9732017-08-04 02:06:22 -07002208 /* Discard the shifted token unless it is eof. */
2209 if (yychar != YYEOF)
2210 yychar = YYEMPTY;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002211
Lev Walkinf15320b2004-06-03 03:38:44 +00002212 yystate = yyn;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002213 *++yyvsp = yylval;
2214
Lev Walkinf15320b2004-06-03 03:38:44 +00002215 goto yynewstate;
2216
Lev Walkina00d6b32006-03-21 03:40:38 +00002217
Lev Walkin418298d2006-07-13 08:24:20 +00002218/*-----------------------------------------------------------.
2219| yydefault -- do the default action for the current state. |
2220`-----------------------------------------------------------*/
2221yydefault:
Lev Walkinf15320b2004-06-03 03:38:44 +00002222 yyn = yydefact[yystate];
2223 if (yyn == 0)
2224 goto yyerrlab;
Lev Walkin418298d2006-07-13 08:24:20 +00002225 goto yyreduce;
Lev Walkinf15320b2004-06-03 03:38:44 +00002226
Lev Walkin418298d2006-07-13 08:24:20 +00002227
2228/*-----------------------------.
2229| yyreduce -- Do a reduction. |
2230`-----------------------------*/
Lev Walkinf15320b2004-06-03 03:38:44 +00002231yyreduce:
Lev Walkin418298d2006-07-13 08:24:20 +00002232 /* yyn is the number of a rule to reduce with. */
Lev Walkinf15320b2004-06-03 03:38:44 +00002233 yylen = yyr2[yyn];
Lev Walkinf15320b2004-06-03 03:38:44 +00002234
Lev Walkin418298d2006-07-13 08:24:20 +00002235 /* If YYLEN is nonzero, implement the default value of the action:
2236 `$$ = $1'.
2237
2238 Otherwise, the following line sets YYVAL to garbage.
2239 This behavior is undocumented and Bison
2240 users should not rely upon it. Assigning to YYVAL
2241 unconditionally makes the parser a bit smaller, and it avoids a
2242 GCC warning that YYVAL may be used uninitialized. */
2243 yyval = yyvsp[1-yylen];
2244
2245
Lev Walkin0e90aa02013-03-19 16:17:13 -07002246 YY_REDUCE_PRINT (yyn);
Lev Walkin418298d2006-07-13 08:24:20 +00002247 switch (yyn)
2248 {
2249 case 2:
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002250#line 358 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002251 {
Lev Walkin752e9732017-08-04 02:06:22 -07002252 *(void **)param = (yyvsp[(2) - (2)].a_grammar);
2253 }
2254 break;
2255
2256 case 3:
2257#line 361 "asn1p_y.y"
2258 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002259 *(void **)param = (yyvsp[(1) - (1)].a_grammar);
Lev Walkin418298d2006-07-13 08:24:20 +00002260 }
2261 break;
2262
Lev Walkin752e9732017-08-04 02:06:22 -07002263 case 4:
2264#line 367 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002265 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002266 (yyval.a_grammar) = asn1p_new();
2267 checkmem((yyval.a_grammar));
2268 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(1) - (1)].a_module), mod_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002269 }
2270 break;
2271
Lev Walkin752e9732017-08-04 02:06:22 -07002272 case 5:
2273#line 372 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002274 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002275 (yyval.a_grammar) = (yyvsp[(1) - (2)].a_grammar);
2276 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[(2) - (2)].a_module), mod_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002277 }
2278 break;
2279
Lev Walkin752e9732017-08-04 02:06:22 -07002280 case 6:
2281#line 389 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002282 { currentModule = asn1p_module_new(); }
2283 break;
2284
Lev Walkin752e9732017-08-04 02:06:22 -07002285 case 7:
2286#line 394 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002287 {
Lev Walkinfb872bd2006-03-18 06:53:11 +00002288
Lev Walkin0e90aa02013-03-19 16:17:13 -07002289 (yyval.a_module) = currentModule;
Lev Walkina9532f42006-09-17 04:52:50 +00002290
Lev Walkin0e90aa02013-03-19 16:17:13 -07002291 if((yyvsp[(8) - (9)].a_module)) {
2292 asn1p_module_t tmp = *((yyval.a_module));
2293 *((yyval.a_module)) = *((yyvsp[(8) - (9)].a_module));
2294 *((yyvsp[(8) - (9)].a_module)) = tmp;
2295 asn1p_module_free((yyvsp[(8) - (9)].a_module));
Lev Walkinf15320b2004-06-03 03:38:44 +00002296 } else {
2297 /* There's a chance that a module is just plain empty */
Lev Walkinf15320b2004-06-03 03:38:44 +00002298 }
Lev Walkinf15320b2004-06-03 03:38:44 +00002299
Lev Walkin0e90aa02013-03-19 16:17:13 -07002300 (yyval.a_module)->ModuleName = (yyvsp[(1) - (9)].tv_str);
2301 (yyval.a_module)->module_oid = (yyvsp[(3) - (9)].a_oid);
2302 (yyval.a_module)->module_flags = (yyvsp[(5) - (9)].a_module_flags);
Lev Walkin418298d2006-07-13 08:24:20 +00002303 }
2304 break;
2305
Lev Walkin752e9732017-08-04 02:06:22 -07002306 case 8:
2307#line 418 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002308 { (yyval.a_oid) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00002309 break;
2310
Lev Walkin752e9732017-08-04 02:06:22 -07002311 case 9:
2312#line 419 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002313 { (yyval.a_oid) = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin418298d2006-07-13 08:24:20 +00002314 break;
2315
Lev Walkin752e9732017-08-04 02:06:22 -07002316 case 10:
2317#line 423 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002318 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002319 (yyval.a_oid) = (yyvsp[(2) - (3)].a_oid);
Lev Walkin418298d2006-07-13 08:24:20 +00002320 }
2321 break;
2322
Lev Walkin752e9732017-08-04 02:06:22 -07002323 case 11:
2324#line 426 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002325 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002326 (yyval.a_oid) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002327 }
2328 break;
2329
Lev Walkin752e9732017-08-04 02:06:22 -07002330 case 12:
2331#line 432 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002332 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002333 (yyval.a_oid) = asn1p_oid_new();
2334 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(1) - (1)].a_oid_arc));
Lev Walkina964e032017-03-26 03:48:06 -07002335 if((yyvsp[(1) - (1)].a_oid_arc).name)
2336 free((yyvsp[(1) - (1)].a_oid_arc).name);
Lev Walkin418298d2006-07-13 08:24:20 +00002337 }
2338 break;
2339
Lev Walkin752e9732017-08-04 02:06:22 -07002340 case 13:
2341#line 438 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002342 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002343 (yyval.a_oid) = (yyvsp[(1) - (2)].a_oid);
2344 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[(2) - (2)].a_oid_arc));
Lev Walkina964e032017-03-26 03:48:06 -07002345 if((yyvsp[(2) - (2)].a_oid_arc).name)
2346 free((yyvsp[(2) - (2)].a_oid_arc).name);
Lev Walkin418298d2006-07-13 08:24:20 +00002347 }
2348 break;
2349
Lev Walkin752e9732017-08-04 02:06:22 -07002350 case 14:
2351#line 447 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002352 { /* iso */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002353 (yyval.a_oid_arc).name = (yyvsp[(1) - (1)].tv_str);
2354 (yyval.a_oid_arc).number = -1;
Lev Walkin418298d2006-07-13 08:24:20 +00002355 }
2356 break;
2357
Lev Walkin752e9732017-08-04 02:06:22 -07002358 case 15:
2359#line 451 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002360 { /* iso(1) */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002361 (yyval.a_oid_arc).name = (yyvsp[(1) - (4)].tv_str);
2362 (yyval.a_oid_arc).number = (yyvsp[(3) - (4)].a_int);
Lev Walkin418298d2006-07-13 08:24:20 +00002363 }
2364 break;
2365
Lev Walkin752e9732017-08-04 02:06:22 -07002366 case 16:
2367#line 455 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002368 { /* 1 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002369 (yyval.a_oid_arc).name = 0;
2370 (yyval.a_oid_arc).number = (yyvsp[(1) - (1)].a_int);
Lev Walkin418298d2006-07-13 08:24:20 +00002371 }
2372 break;
2373
Lev Walkin752e9732017-08-04 02:06:22 -07002374 case 17:
2375#line 465 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002376 { (yyval.a_module_flags) = MSF_NOFLAGS; }
Lev Walkin418298d2006-07-13 08:24:20 +00002377 break;
2378
Lev Walkin418298d2006-07-13 08:24:20 +00002379 case 18:
Lev Walkin752e9732017-08-04 02:06:22 -07002380#line 466 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002381 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002382 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
Lev Walkina9532f42006-09-17 04:52:50 +00002383 }
2384 break;
2385
2386 case 19:
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002387#line 475 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002388 {
Lev Walkin752e9732017-08-04 02:06:22 -07002389 (yyval.a_module_flags) = (yyvsp[(1) - (1)].a_module_flags);
2390 }
2391 break;
2392
2393 case 20:
2394#line 478 "asn1p_y.y"
2395 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002396 (yyval.a_module_flags) = (yyvsp[(1) - (2)].a_module_flags) | (yyvsp[(2) - (2)].a_module_flags);
Lev Walkin418298d2006-07-13 08:24:20 +00002397 }
2398 break;
2399
Lev Walkin752e9732017-08-04 02:06:22 -07002400 case 21:
2401#line 487 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002402 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002403 (yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002404 }
2405 break;
2406
Lev Walkin752e9732017-08-04 02:06:22 -07002407 case 22:
2408#line 490 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002409 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002410 (yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002411 }
2412 break;
2413
Lev Walkin752e9732017-08-04 02:06:22 -07002414 case 23:
2415#line 493 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002416 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002417 (yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
Lev Walkin418298d2006-07-13 08:24:20 +00002418 }
2419 break;
2420
Lev Walkin752e9732017-08-04 02:06:22 -07002421 case 24:
2422#line 496 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002423 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002424 (yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
Lev Walkin418298d2006-07-13 08:24:20 +00002425 }
2426 break;
2427
Lev Walkin752e9732017-08-04 02:06:22 -07002428 case 25:
2429#line 500 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002430 {
Lev Walkinf59d0752004-08-18 04:59:12 +00002431 /* X.680Amd1 specifies TAG and XER */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002432 if(strcmp((yyvsp[(1) - (2)].tv_str), "TAG") == 0) {
2433 (yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
2434 } else if(strcmp((yyvsp[(1) - (2)].tv_str), "XER") == 0) {
2435 (yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
Lev Walkinf59d0752004-08-18 04:59:12 +00002436 } else {
2437 fprintf(stderr,
2438 "WARNING: %s INSTRUCTIONS at line %d: "
2439 "Unrecognized encoding reference\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07002440 (yyvsp[(1) - (2)].tv_str), yylineno);
2441 (yyval.a_module_flags) = MSF_unk_INSTRUCTIONS;
Lev Walkinf59d0752004-08-18 04:59:12 +00002442 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07002443 free((yyvsp[(1) - (2)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00002444 }
2445 break;
2446
Lev Walkin752e9732017-08-04 02:06:22 -07002447 case 26:
2448#line 521 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002449 { (yyval.a_module) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00002450 break;
2451
Lev Walkin752e9732017-08-04 02:06:22 -07002452 case 27:
2453#line 522 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002454 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002455 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002456 }
2457 break;
2458
Lev Walkin752e9732017-08-04 02:06:22 -07002459 case 28:
2460#line 531 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002461 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002462 (yyval.a_module) = asn1p_module_new();
2463 AL_IMPORT((yyval.a_module), exports, (yyvsp[(1) - (3)].a_module), xp_next);
2464 AL_IMPORT((yyval.a_module), imports, (yyvsp[(2) - (3)].a_module), xp_next);
2465 AL_IMPORT((yyval.a_module), members, (yyvsp[(3) - (3)].a_module), next);
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002466
2467 asn1p_module_free((yyvsp[(1) - (3)].a_module));
2468 asn1p_module_free((yyvsp[(2) - (3)].a_module));
2469 asn1p_module_free((yyvsp[(3) - (3)].a_module));
Lev Walkin418298d2006-07-13 08:24:20 +00002470 }
2471 break;
2472
Lev Walkin752e9732017-08-04 02:06:22 -07002473 case 29:
2474#line 544 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002475 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002476 (yyval.a_module) = (yyvsp[(1) - (1)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002477 }
2478 break;
2479
Lev Walkin752e9732017-08-04 02:06:22 -07002480 case 30:
2481#line 547 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002482 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002483 if((yyvsp[(1) - (2)].a_module)) {
2484 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002485 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002486 (yyval.a_module) = (yyvsp[(2) - (2)].a_module);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002487 break;
2488 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07002489 AL_IMPORT((yyval.a_module), members, (yyvsp[(2) - (2)].a_module), next);
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002490 asn1p_module_free((yyvsp[(2) - (2)].a_module));
Lev Walkin866bd7f2006-09-14 10:35:20 +00002491 }
2492 break;
2493
Lev Walkin418298d2006-07-13 08:24:20 +00002494 case 31:
Lev Walkin752e9732017-08-04 02:06:22 -07002495#line 564 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002496 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002497 (yyval.a_module) = asn1p_module_new();
2498 checkmem((yyval.a_module));
2499 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2500 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2501 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002502 }
2503 break;
2504
2505 case 32:
Lev Walkin752e9732017-08-04 02:06:22 -07002506#line 571 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002507 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002508 (yyval.a_module) = asn1p_module_new();
2509 checkmem((yyval.a_module));
2510 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2511 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2512 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkina9532f42006-09-17 04:52:50 +00002513 }
Lev Walkin418298d2006-07-13 08:24:20 +00002514 break;
2515
Lev Walkin866bd7f2006-09-14 10:35:20 +00002516 case 33:
Lev Walkine700b202017-08-06 23:21:32 -07002517#line 585 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07002518 {
2519 (yyval.a_module) = asn1p_module_new();
2520 checkmem((yyval.a_module));
2521 assert((yyvsp[(1) - (1)].a_expr)->expr_type != A1TC_INVALID);
2522 assert((yyvsp[(1) - (1)].a_expr)->meta_type != AMT_INVALID);
2523 TQ_ADD(&((yyval.a_module)->members), (yyvsp[(1) - (1)].a_expr), next);
2524 }
Lev Walkina9532f42006-09-17 04:52:50 +00002525 break;
2526
2527 case 34:
Lev Walkine700b202017-08-06 23:21:32 -07002528#line 593 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07002529 { asn1p_lexer_hack_push_encoding_control(); }
2530 break;
2531
2532 case 35:
Lev Walkine700b202017-08-06 23:21:32 -07002533#line 594 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002534 {
Lev Walkinf59d0752004-08-18 04:59:12 +00002535 fprintf(stderr,
2536 "WARNING: ENCODING-CONTROL %s "
2537 "specification at line %d ignored\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07002538 (yyvsp[(2) - (3)].tv_str), yylineno);
2539 free((yyvsp[(2) - (3)].tv_str));
2540 (yyval.a_module) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002541 }
2542 break;
2543
Lev Walkin752e9732017-08-04 02:06:22 -07002544 case 36:
Lev Walkine700b202017-08-06 23:21:32 -07002545#line 606 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002546 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002547 return yyerror(
Lev Walkin70853052005-11-26 11:21:55 +00002548 "Attempt to redefine a standard basic string type, "
2549 "please comment out or remove this type redefinition.");
Lev Walkin418298d2006-07-13 08:24:20 +00002550 }
2551 break;
2552
Lev Walkin752e9732017-08-04 02:06:22 -07002553 case 37:
Lev Walkine700b202017-08-06 23:21:32 -07002554#line 619 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002555 { (yyval.a_module) = 0; }
Lev Walkin866bd7f2006-09-14 10:35:20 +00002556 break;
2557
Lev Walkin752e9732017-08-04 02:06:22 -07002558 case 39:
Lev Walkine700b202017-08-06 23:21:32 -07002559#line 623 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002560 {
Lev Walkinb36317c2005-08-12 10:09:10 +00002561 if(!saved_aid && 0)
2562 return yyerror("Unterminated IMPORTS FROM, "
2563 "expected semicolon ';'");
2564 saved_aid = 0;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002565 (yyval.a_module) = (yyvsp[(2) - (3)].a_module);
Lev Walkin418298d2006-07-13 08:24:20 +00002566 }
2567 break;
2568
Lev Walkin752e9732017-08-04 02:06:22 -07002569 case 40:
Lev Walkine700b202017-08-06 23:21:32 -07002570#line 633 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002571 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002572 return yyerror("Empty IMPORTS list");
Lev Walkin418298d2006-07-13 08:24:20 +00002573 }
2574 break;
2575
Lev Walkin752e9732017-08-04 02:06:22 -07002576 case 41:
Lev Walkine700b202017-08-06 23:21:32 -07002577#line 639 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002578 { (yyval.a_module) = asn1p_module_new(); }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002579 break;
2580
Lev Walkin752e9732017-08-04 02:06:22 -07002581 case 43:
Lev Walkine700b202017-08-06 23:21:32 -07002582#line 643 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002583 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002584 (yyval.a_module) = asn1p_module_new();
2585 checkmem((yyval.a_module));
2586 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002587 }
2588 break;
2589
Lev Walkin752e9732017-08-04 02:06:22 -07002590 case 44:
Lev Walkine700b202017-08-06 23:21:32 -07002591#line 648 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002592 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002593 (yyval.a_module) = (yyvsp[(1) - (2)].a_module);
2594 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[(2) - (2)].a_xports), xp_next);
Lev Walkin418298d2006-07-13 08:24:20 +00002595 }
2596 break;
2597
Lev Walkin752e9732017-08-04 02:06:22 -07002598 case 45:
Lev Walkine700b202017-08-06 23:21:32 -07002599#line 655 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002600 { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
Lev Walkin418298d2006-07-13 08:24:20 +00002601 break;
2602
Lev Walkin752e9732017-08-04 02:06:22 -07002603 case 46:
Lev Walkine700b202017-08-06 23:21:32 -07002604#line 656 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002605 { (yyval.a_aid).oid = (yyvsp[(1) - (1)].a_oid); }
Lev Walkin418298d2006-07-13 08:24:20 +00002606 break;
2607
Lev Walkin752e9732017-08-04 02:06:22 -07002608 case 47:
Lev Walkine700b202017-08-06 23:21:32 -07002609#line 660 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002610 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002611 (yyval.a_xports) = (yyvsp[(1) - (4)].a_xports);
2612 (yyval.a_xports)->fromModuleName = (yyvsp[(3) - (4)].tv_str);
2613 (yyval.a_xports)->identifier = (yyvsp[(4) - (4)].a_aid);
Lev Walkinb36317c2005-08-12 10:09:10 +00002614 /* This stupid thing is used for look-back hack. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002615 saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
2616 checkmem((yyval.a_xports));
Lev Walkin418298d2006-07-13 08:24:20 +00002617 }
2618 break;
2619
Lev Walkin752e9732017-08-04 02:06:22 -07002620 case 48:
Lev Walkine700b202017-08-06 23:21:32 -07002621#line 671 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002622 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002623 (yyval.a_xports) = asn1p_xports_new();
2624 checkmem((yyval.a_xports));
2625 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002626 }
2627 break;
2628
Lev Walkin752e9732017-08-04 02:06:22 -07002629 case 49:
Lev Walkine700b202017-08-06 23:21:32 -07002630#line 676 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002631 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002632 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2633 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002634 }
2635 break;
2636
Lev Walkin752e9732017-08-04 02:06:22 -07002637 case 50:
Lev Walkine700b202017-08-06 23:21:32 -07002638#line 683 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002639 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002640 (yyval.a_expr) = NEW_EXPR();
2641 checkmem((yyval.a_expr));
2642 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2643 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin418298d2006-07-13 08:24:20 +00002644 }
2645 break;
2646
Lev Walkin752e9732017-08-04 02:06:22 -07002647 case 51:
Lev Walkine700b202017-08-06 23:21:32 -07002648#line 689 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002649 { /* Completely equivalent to above */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002650 (yyval.a_expr) = NEW_EXPR();
2651 checkmem((yyval.a_expr));
2652 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2653 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002654 }
Lev Walkin866bd7f2006-09-14 10:35:20 +00002655 break;
2656
Lev Walkin752e9732017-08-04 02:06:22 -07002657 case 52:
Lev Walkine700b202017-08-06 23:21:32 -07002658#line 695 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002659 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002660 (yyval.a_expr) = NEW_EXPR();
2661 checkmem((yyval.a_expr));
2662 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2663 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002664 }
2665 break;
2666
Lev Walkin752e9732017-08-04 02:06:22 -07002667 case 53:
Lev Walkine700b202017-08-06 23:21:32 -07002668#line 705 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002669 { (yyval.a_module) = 0; }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002670 break;
2671
Lev Walkin752e9732017-08-04 02:06:22 -07002672 case 54:
Lev Walkine700b202017-08-06 23:21:32 -07002673#line 706 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002674 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002675 (yyval.a_module) = asn1p_module_new();
2676 checkmem((yyval.a_module));
2677 if((yyvsp[(1) - (1)].a_xports)) {
2678 TQ_ADD(&((yyval.a_module)->exports), (yyvsp[(1) - (1)].a_xports), xp_next);
Lev Walkin866bd7f2006-09-14 10:35:20 +00002679 } else {
2680 /* "EXPORTS ALL;" */
2681 }
2682 }
2683 break;
2684
Lev Walkin752e9732017-08-04 02:06:22 -07002685 case 55:
Lev Walkine700b202017-08-06 23:21:32 -07002686#line 718 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002687 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002688 (yyval.a_xports) = (yyvsp[(2) - (3)].a_xports);
Lev Walkin418298d2006-07-13 08:24:20 +00002689 }
2690 break;
2691
Lev Walkin752e9732017-08-04 02:06:22 -07002692 case 56:
Lev Walkine700b202017-08-06 23:21:32 -07002693#line 721 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002694 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002695 (yyval.a_xports) = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00002696 }
2697 break;
2698
Lev Walkin752e9732017-08-04 02:06:22 -07002699 case 57:
Lev Walkine700b202017-08-06 23:21:32 -07002700#line 724 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002701 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002702 /* Empty EXPORTS clause effectively prohibits export. */
Lev Walkin0e90aa02013-03-19 16:17:13 -07002703 (yyval.a_xports) = asn1p_xports_new();
2704 checkmem((yyval.a_xports));
Lev Walkin418298d2006-07-13 08:24:20 +00002705 }
2706 break;
2707
Lev Walkin752e9732017-08-04 02:06:22 -07002708 case 58:
Lev Walkine700b202017-08-06 23:21:32 -07002709#line 732 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002710 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002711 (yyval.a_xports) = asn1p_xports_new();
2712 assert((yyval.a_xports));
2713 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(1) - (1)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002714 }
2715 break;
2716
Lev Walkin752e9732017-08-04 02:06:22 -07002717 case 59:
Lev Walkine700b202017-08-06 23:21:32 -07002718#line 737 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002719 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002720 (yyval.a_xports) = (yyvsp[(1) - (3)].a_xports);
2721 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[(3) - (3)].a_expr), next);
Lev Walkin418298d2006-07-13 08:24:20 +00002722 }
2723 break;
2724
Lev Walkin752e9732017-08-04 02:06:22 -07002725 case 60:
Lev Walkine700b202017-08-06 23:21:32 -07002726#line 744 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002727 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002728 (yyval.a_expr) = NEW_EXPR();
2729 checkmem((yyval.a_expr));
2730 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2731 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin418298d2006-07-13 08:24:20 +00002732 }
2733 break;
2734
Lev Walkin752e9732017-08-04 02:06:22 -07002735 case 61:
Lev Walkine700b202017-08-06 23:21:32 -07002736#line 750 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002737 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002738 (yyval.a_expr) = NEW_EXPR();
2739 checkmem((yyval.a_expr));
2740 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2741 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002742 }
Lev Walkin418298d2006-07-13 08:24:20 +00002743 break;
2744
Lev Walkin752e9732017-08-04 02:06:22 -07002745 case 62:
Lev Walkine700b202017-08-06 23:21:32 -07002746#line 756 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002747 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002748 (yyval.a_expr) = NEW_EXPR();
2749 checkmem((yyval.a_expr));
2750 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2751 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
Lev Walkin4a4543f2006-10-13 12:37:39 +00002752 }
2753 break;
2754
Lev Walkin752e9732017-08-04 02:06:22 -07002755 case 63:
Lev Walkine700b202017-08-06 23:21:32 -07002756#line 765 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002757 { (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr); }
Lev Walkin4a4543f2006-10-13 12:37:39 +00002758 break;
2759
Lev Walkin752e9732017-08-04 02:06:22 -07002760 case 64:
Lev Walkine700b202017-08-06 23:21:32 -07002761#line 768 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002762 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002763 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
2764 assert((yyval.a_expr)->Identifier == 0);
2765 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
2766 (yyval.a_expr)->meta_type = AMT_VALUESET;
2767 (yyval.a_expr)->constraints = (yyvsp[(4) - (4)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00002768 }
2769 break;
2770
Lev Walkin752e9732017-08-04 02:06:22 -07002771 case 65:
Lev Walkine700b202017-08-06 23:21:32 -07002772#line 778 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002773 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002774 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00002775 }
2776 break;
2777
Lev Walkin752e9732017-08-04 02:06:22 -07002778 case 66:
Lev Walkine700b202017-08-06 23:21:32 -07002779#line 791 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002780 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002781 (yyval.a_expr) = NEW_EXPR();
2782 checkmem((yyval.a_expr));
2783 (yyval.a_expr)->reference = (yyvsp[(1) - (1)].a_ref);
2784 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2785 (yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin418298d2006-07-13 08:24:20 +00002786 }
2787 break;
2788
Lev Walkin752e9732017-08-04 02:06:22 -07002789 case 67:
Lev Walkine700b202017-08-06 23:21:32 -07002790#line 801 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002791 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002792 (yyval.a_expr) = NEW_EXPR();
2793 checkmem((yyval.a_expr));
2794 (yyval.a_expr)->reference = (yyvsp[(1) - (4)].a_ref);
2795 (yyval.a_expr)->rhs_pspecs = (yyvsp[(3) - (4)].a_expr);
2796 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2797 (yyval.a_expr)->meta_type = AMT_TYPEREF;
Lev Walkin418298d2006-07-13 08:24:20 +00002798 }
2799 break;
2800
Lev Walkin752e9732017-08-04 02:06:22 -07002801 case 68:
Lev Walkine700b202017-08-06 23:21:32 -07002802#line 821 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002803 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002804 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2805 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2806 assert((yyval.a_expr)->expr_type);
2807 assert((yyval.a_expr)->meta_type);
Lev Walkin418298d2006-07-13 08:24:20 +00002808 }
2809 break;
2810
Lev Walkin752e9732017-08-04 02:06:22 -07002811 case 69:
Lev Walkine700b202017-08-06 23:21:32 -07002812#line 827 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002813 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002814 (yyval.a_expr) = (yyvsp[(3) - (3)].a_expr);
2815 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
2816 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
2817 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
Lev Walkin418298d2006-07-13 08:24:20 +00002818 }
2819 break;
2820
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002821 case 70:
Lev Walkine700b202017-08-06 23:21:32 -07002822#line 843 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002823 {
2824 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2825 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2826 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
2827 }
2828 break;
2829
Lev Walkin4a4543f2006-10-13 12:37:39 +00002830 case 71:
Lev Walkine700b202017-08-06 23:21:32 -07002831#line 849 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07002832 {
2833 (yyval.a_expr) = (yyvsp[(6) - (6)].a_expr);
2834 (yyval.a_expr)->Identifier = (yyvsp[(1) - (6)].tv_str);
2835 (yyval.a_expr)->lhs_params = (yyvsp[(3) - (6)].a_plist);
2836 }
2837 break;
2838
2839 case 72:
Lev Walkine700b202017-08-06 23:21:32 -07002840#line 857 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00002841 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002842 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002843 (yyval.a_plist) = asn1p_paramlist_new(yylineno);
2844 checkmem((yyval.a_plist));
2845 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 +00002846 checkmem(ret == 0);
Lev Walkina964e032017-03-26 03:48:06 -07002847 asn1p_ref_free((yyvsp[(1) - (1)].a_parg).governor);
Markus Elfringf3d18612016-03-15 08:35:24 +01002848 free((yyvsp[(1) - (1)].a_parg).argument);
Lev Walkin418298d2006-07-13 08:24:20 +00002849 }
2850 break;
2851
Lev Walkin752e9732017-08-04 02:06:22 -07002852 case 73:
Lev Walkine700b202017-08-06 23:21:32 -07002853#line 866 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002854 {
Lev Walkinf15320b2004-06-03 03:38:44 +00002855 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002856 (yyval.a_plist) = (yyvsp[(1) - (3)].a_plist);
2857 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 +00002858 checkmem(ret == 0);
Lev Walkina964e032017-03-26 03:48:06 -07002859 asn1p_ref_free((yyvsp[(3) - (3)].a_parg).governor);
Markus Elfringf3d18612016-03-15 08:35:24 +01002860 free((yyvsp[(3) - (3)].a_parg).argument);
Lev Walkin418298d2006-07-13 08:24:20 +00002861 }
2862 break;
2863
Lev Walkin752e9732017-08-04 02:06:22 -07002864 case 74:
Lev Walkine700b202017-08-06 23:21:32 -07002865#line 877 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002866 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002867 (yyval.a_parg).governor = NULL;
2868 (yyval.a_parg).argument = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00002869 }
2870 break;
2871
Lev Walkin866bd7f2006-09-14 10:35:20 +00002872 case 75:
Lev Walkine700b202017-08-06 23:21:32 -07002873#line 881 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002874 {
2875 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002876 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002877 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002878 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002879 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002880 free((yyvsp[(1) - (3)].tv_str));
Lev Walkin4a4543f2006-10-13 12:37:39 +00002881 }
2882 break;
2883
2884 case 76:
Lev Walkine700b202017-08-06 23:21:32 -07002885#line 889 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002886 {
Lev Walkina9532f42006-09-17 04:52:50 +00002887 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002888 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
Lev Walkin752e9732017-08-04 02:06:22 -07002889 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[(1) - (3)].tv_str), 0);
Lev Walkina9532f42006-09-17 04:52:50 +00002890 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002891 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin752e9732017-08-04 02:06:22 -07002892 free((yyvsp[(1) - (3)].tv_str));
Lev Walkina9532f42006-09-17 04:52:50 +00002893 }
2894 break;
2895
Lev Walkin4a4543f2006-10-13 12:37:39 +00002896 case 77:
Lev Walkine700b202017-08-06 23:21:32 -07002897#line 897 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00002898 {
2899 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002900 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002901 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2902 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002903 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002904 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
Lev Walkin4a4543f2006-10-13 12:37:39 +00002905 }
2906 break;
2907
2908 case 78:
Lev Walkine700b202017-08-06 23:21:32 -07002909#line 905 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07002910 {
2911 int ret;
2912 (yyval.a_parg).governor = asn1p_ref_new(yylineno, currentModule);
2913 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2914 ASN_EXPR_TYPE2STR((yyvsp[(1) - (3)].a_type)), 1);
2915 checkmem(ret == 0);
2916 (yyval.a_parg).argument = (yyvsp[(3) - (3)].tv_str);
2917 }
2918 break;
2919
2920 case 79:
Lev Walkine700b202017-08-06 23:21:32 -07002921#line 916 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00002922 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002923 (yyval.a_expr) = NEW_EXPR();
2924 checkmem((yyval.a_expr));
2925 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002926 }
2927 break;
2928
Lev Walkin752e9732017-08-04 02:06:22 -07002929 case 80:
Lev Walkine700b202017-08-06 23:21:32 -07002930#line 921 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002931 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002932 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
2933 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002934 }
2935 break;
2936
Lev Walkin752e9732017-08-04 02:06:22 -07002937 case 81:
Lev Walkine700b202017-08-06 23:21:32 -07002938#line 928 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002939 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002940 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00002941 }
2942 break;
2943
Lev Walkin752e9732017-08-04 02:06:22 -07002944 case 82:
Lev Walkine700b202017-08-06 23:21:32 -07002945#line 931 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002946 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002947 (yyval.a_expr) = NEW_EXPR();
2948 checkmem((yyval.a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08002949 (yyval.a_expr)->Identifier = strdup("?");
Lev Walkin0e90aa02013-03-19 16:17:13 -07002950 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2951 (yyval.a_expr)->meta_type = AMT_VALUE;
2952 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00002953 }
2954 break;
2955
Lev Walkin752e9732017-08-04 02:06:22 -07002956 case 83:
Lev Walkine700b202017-08-06 23:21:32 -07002957#line 939 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002958 {
Lev Walkina00d6b32006-03-21 03:40:38 +00002959 asn1p_ref_t *ref;
Lev Walkin0e90aa02013-03-19 16:17:13 -07002960 (yyval.a_expr) = NEW_EXPR();
2961 checkmem((yyval.a_expr));
2962 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
2963 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2964 (yyval.a_expr)->meta_type = AMT_VALUE;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08002965 ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07002966 asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
2967 (yyval.a_expr)->value = asn1p_value_fromref(ref, 0);
Lev Walkin418298d2006-07-13 08:24:20 +00002968 }
2969 break;
2970
Lev Walkin752e9732017-08-04 02:06:22 -07002971 case 84:
Lev Walkine700b202017-08-06 23:21:32 -07002972#line 950 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002973 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002974 (yyval.a_expr) = NEW_EXPR();
2975 (yyval.a_expr)->expr_type = A1TC_VALUESET;
2976 (yyval.a_expr)->meta_type = AMT_VALUESET;
2977 (yyval.a_expr)->constraints = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00002978 }
2979 break;
2980
Lev Walkin752e9732017-08-04 02:06:22 -07002981 case 85:
Lev Walkine700b202017-08-06 23:21:32 -07002982#line 973 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002983 { (yyval.a_expr) = NEW_EXPR(); }
Lev Walkin418298d2006-07-13 08:24:20 +00002984 break;
2985
Lev Walkin752e9732017-08-04 02:06:22 -07002986 case 86:
Lev Walkine700b202017-08-06 23:21:32 -07002987#line 974 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07002988 { (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr); }
Lev Walkina9532f42006-09-17 04:52:50 +00002989 break;
2990
Lev Walkin752e9732017-08-04 02:06:22 -07002991 case 87:
Lev Walkine700b202017-08-06 23:21:32 -07002992#line 977 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00002993 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07002994 (yyval.a_expr) = NEW_EXPR();
2995 checkmem((yyval.a_expr));
2996 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00002997 }
2998 break;
2999
Lev Walkin752e9732017-08-04 02:06:22 -07003000 case 88:
Lev Walkine700b202017-08-06 23:21:32 -07003001#line 982 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003002 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003003 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3004 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003005 }
3006 break;
3007
Lev Walkin752e9732017-08-04 02:06:22 -07003008 case 89:
Lev Walkine700b202017-08-06 23:21:32 -07003009#line 986 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003010 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003011 (yyval.a_expr) = (yyvsp[(1) - (5)].a_expr);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003012 asn1p_expr_add_many((yyval.a_expr), (yyvsp[(4) - (5)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08003013 asn1p_expr_free((yyvsp[(4) - (5)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003014 }
3015 break;
3016
Lev Walkin752e9732017-08-04 02:06:22 -07003017 case 90:
Lev Walkine700b202017-08-06 23:21:32 -07003018#line 994 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003019 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003020 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3021 assert((yyval.a_expr)->Identifier == 0);
3022 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3023 (yyvsp[(3) - (3)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3024 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003025 }
3026 break;
3027
Lev Walkin752e9732017-08-04 02:06:22 -07003028 case 91:
Lev Walkine700b202017-08-06 23:21:32 -07003029#line 1001 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003030 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003031 (yyval.a_expr) = (yyvsp[(1) - (2)].a_expr);
3032 (yyvsp[(2) - (2)].a_marker).flags |= (yyval.a_expr)->marker.flags;
3033 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
3034 _fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003035 }
3036 break;
3037
Lev Walkin752e9732017-08-04 02:06:22 -07003038 case 92:
Lev Walkine700b202017-08-06 23:21:32 -07003039#line 1007 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003040 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003041 (yyval.a_expr) = NEW_EXPR();
3042 checkmem((yyval.a_expr));
3043 (yyval.a_expr)->meta_type = (yyvsp[(3) - (3)].a_expr)->meta_type;
3044 (yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
3045 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003046 }
3047 break;
3048
Lev Walkin752e9732017-08-04 02:06:22 -07003049 case 93:
Lev Walkine700b202017-08-06 23:21:32 -07003050#line 1014 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003051 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003052 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003053 }
3054 break;
3055
Lev Walkin752e9732017-08-04 02:06:22 -07003056 case 94:
Lev Walkine700b202017-08-06 23:21:32 -07003057#line 1020 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003058 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003059 (yyval.a_expr) = NEW_EXPR();
3060 checkmem((yyval.a_expr));
3061 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003062 }
3063 break;
3064
Lev Walkin752e9732017-08-04 02:06:22 -07003065 case 95:
Lev Walkine700b202017-08-06 23:21:32 -07003066#line 1025 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003067 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003068 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3069 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003070 }
3071 break;
3072
Lev Walkin752e9732017-08-04 02:06:22 -07003073 case 96:
Lev Walkine700b202017-08-06 23:21:32 -07003074#line 1032 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003075 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003076 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3077 assert((yyval.a_expr)->Identifier == 0);
3078 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003079 }
3080 break;
3081
Lev Walkin752e9732017-08-04 02:06:22 -07003082 case 97:
Lev Walkine700b202017-08-06 23:21:32 -07003083#line 1037 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003084 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003085 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003086 }
3087 break;
3088
Lev Walkin752e9732017-08-04 02:06:22 -07003089 case 98:
Lev Walkine700b202017-08-06 23:21:32 -07003090#line 1040 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003091 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003092 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
3093 _fixup_anonymous_identifier((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003094 }
3095 break;
3096
Lev Walkin752e9732017-08-04 02:06:22 -07003097 case 99:
Lev Walkine700b202017-08-06 23:21:32 -07003098#line 1047 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003099 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003100 (yyval.a_expr) = (yyvsp[(3) - (5)].a_expr);
3101 checkmem((yyval.a_expr));
3102 (yyval.a_expr)->with_syntax = (yyvsp[(5) - (5)].a_wsynt);
3103 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
3104 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
Lev Walkin418298d2006-07-13 08:24:20 +00003105 }
3106 break;
3107
Lev Walkin752e9732017-08-04 02:06:22 -07003108 case 100:
Lev Walkine700b202017-08-06 23:21:32 -07003109#line 1057 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003110 { (yyval.a_int) = 0; }
3111 break;
3112
Lev Walkin752e9732017-08-04 02:06:22 -07003113 case 101:
Lev Walkine700b202017-08-06 23:21:32 -07003114#line 1058 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003115 { (yyval.a_int) = 1; }
3116 break;
3117
Lev Walkin752e9732017-08-04 02:06:22 -07003118 case 102:
Lev Walkine700b202017-08-06 23:21:32 -07003119#line 1062 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003120 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003121 (yyval.a_expr) = NEW_EXPR();
3122 checkmem((yyval.a_expr));
3123 (yyval.a_expr)->expr_type = A1TC_CLASSDEF;
3124 (yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
3125 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003126 }
3127 break;
3128
Lev Walkin752e9732017-08-04 02:06:22 -07003129 case 103:
Lev Walkine700b202017-08-06 23:21:32 -07003130#line 1069 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003131 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003132 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
3133 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003134 }
3135 break;
3136
Lev Walkin752e9732017-08-04 02:06:22 -07003137 case 104:
Lev Walkine700b202017-08-06 23:21:32 -07003138#line 1079 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003139 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003140 (yyval.a_expr) = NEW_EXPR();
3141 checkmem((yyval.a_expr));
3142 (yyval.a_expr)->Identifier = (yyvsp[(1) - (2)].tv_str);
3143 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3144 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
3145 (yyval.a_expr)->marker = (yyvsp[(2) - (2)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003146 }
3147 break;
3148
Lev Walkin752e9732017-08-04 02:06:22 -07003149 case 105:
Lev Walkine700b202017-08-06 23:21:32 -07003150#line 1089 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003151 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003152 (yyval.a_expr) = NEW_EXPR();
3153 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3154 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3155 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
3156 (yyval.a_expr)->unique = (yyvsp[(3) - (4)].a_int);
3157 (yyval.a_expr)->marker = (yyvsp[(4) - (4)].a_marker);
3158 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (4)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003159 }
3160 break;
3161
Lev Walkin752e9732017-08-04 02:06:22 -07003162 case 106:
Lev Walkine700b202017-08-06 23:21:32 -07003163#line 1100 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003164 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003165 (yyval.a_expr) = NEW_EXPR();
3166 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3167 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3168 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
3169 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3170 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003171 }
3172 break;
3173
Lev Walkin752e9732017-08-04 02:06:22 -07003174 case 107:
Lev Walkine700b202017-08-06 23:21:32 -07003175#line 1110 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003176 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003177 (yyval.a_expr) = NEW_EXPR();
3178 checkmem((yyval.a_expr));
3179 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3180 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3181 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3182 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
3183 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003184 }
3185 break;
3186
Lev Walkin752e9732017-08-04 02:06:22 -07003187 case 108:
Lev Walkine700b202017-08-06 23:21:32 -07003188#line 1121 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003189 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003190 (yyval.a_expr) = NEW_EXPR();
3191 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3192 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3193 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
3194 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3195 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003196 }
3197 break;
3198
Lev Walkin752e9732017-08-04 02:06:22 -07003199 case 109:
Lev Walkine700b202017-08-06 23:21:32 -07003200#line 1131 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003201 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003202 (yyval.a_expr) = NEW_EXPR();
3203 checkmem((yyval.a_expr));
3204 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3205 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3206 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
3207 asn1p_expr_add((yyval.a_expr), (yyvsp[(2) - (3)].a_expr));
3208 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
Lev Walkin418298d2006-07-13 08:24:20 +00003209 }
3210 break;
3211
Lev Walkin752e9732017-08-04 02:06:22 -07003212 case 110:
Lev Walkine700b202017-08-06 23:21:32 -07003213#line 1142 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003214 {
3215 (yyval.a_expr) = NEW_EXPR();
3216 checkmem((yyval.a_expr));
3217 (yyval.a_expr)->Identifier = (yyvsp[(1) - (3)].tv_str);
3218 (yyval.a_expr)->reference = (yyvsp[(2) - (3)].a_ref);
3219 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
3220 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
3221 (yyval.a_expr)->marker = (yyvsp[(3) - (3)].a_marker);
3222 }
Lev Walkin418298d2006-07-13 08:24:20 +00003223 break;
3224
Lev Walkin752e9732017-08-04 02:06:22 -07003225 case 111:
Lev Walkine700b202017-08-06 23:21:32 -07003226#line 1154 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003227 { (yyval.a_wsynt) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00003228 break;
3229
Lev Walkin752e9732017-08-04 02:06:22 -07003230 case 112:
Lev Walkine700b202017-08-06 23:21:32 -07003231#line 1155 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003232 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003233 (yyval.a_wsynt) = (yyvsp[(1) - (1)].a_wsynt);
Lev Walkin418298d2006-07-13 08:24:20 +00003234 }
3235 break;
3236
Lev Walkin752e9732017-08-04 02:06:22 -07003237 case 113:
Lev Walkine700b202017-08-06 23:21:32 -07003238#line 1162 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003239 { asn1p_lexer_hack_enable_with_syntax(); }
3240 break;
3241
Lev Walkin752e9732017-08-04 02:06:22 -07003242 case 114:
Lev Walkine700b202017-08-06 23:21:32 -07003243#line 1164 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003244 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003245 (yyval.a_wsynt) = (yyvsp[(5) - (6)].a_wsynt);
Lev Walkin418298d2006-07-13 08:24:20 +00003246 }
3247 break;
3248
Lev Walkin752e9732017-08-04 02:06:22 -07003249 case 115:
Lev Walkine700b202017-08-06 23:21:32 -07003250#line 1170 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003251 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003252 (yyval.a_wsynt) = asn1p_wsyntx_new();
3253 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(1) - (1)].a_wchunk), next);
Lev Walkin418298d2006-07-13 08:24:20 +00003254 }
3255 break;
3256
Lev Walkin752e9732017-08-04 02:06:22 -07003257 case 116:
Lev Walkine700b202017-08-06 23:21:32 -07003258#line 1174 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003259 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003260 (yyval.a_wsynt) = (yyvsp[(1) - (2)].a_wsynt);
3261 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[(2) - (2)].a_wchunk), next);
Lev Walkin418298d2006-07-13 08:24:20 +00003262 }
3263 break;
3264
Lev Walkin752e9732017-08-04 02:06:22 -07003265 case 117:
Lev Walkine700b202017-08-06 23:21:32 -07003266#line 1181 "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)].tv_opaque).buf, 0);
3269 (yyval.a_wchunk)->type = WC_WHITESPACE;
Lev Walkin418298d2006-07-13 08:24:20 +00003270 }
3271 break;
3272
Lev Walkin752e9732017-08-04 02:06:22 -07003273 case 118:
Lev Walkine700b202017-08-06 23:21:32 -07003274#line 1185 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003275 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003276 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].tv_str), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003277 }
3278 break;
3279
Lev Walkin752e9732017-08-04 02:06:22 -07003280 case 119:
Lev Walkine700b202017-08-06 23:21:32 -07003281#line 1188 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003282 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003283 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromstring((yyvsp[(1) - (1)].a_refcomp).name, 0);
3284 (yyval.a_wchunk)->type = WC_FIELD;
Lev Walkin418298d2006-07-13 08:24:20 +00003285 }
3286 break;
3287
Lev Walkin752e9732017-08-04 02:06:22 -07003288 case 120:
Lev Walkine700b202017-08-06 23:21:32 -07003289#line 1192 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00003290 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003291 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[(2) - (3)].a_wsynt));
Lev Walkin866bd7f2006-09-14 10:35:20 +00003292 }
3293 break;
3294
Lev Walkin4a4543f2006-10-13 12:37:39 +00003295 case 121:
Lev Walkine700b202017-08-06 23:21:32 -07003296#line 1198 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003297 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003298 (yyval.a_expr) = NEW_EXPR();
3299 checkmem((yyval.a_expr));
3300 (yyval.a_expr)->Identifier = strdup("...");
3301 checkmem((yyval.a_expr)->Identifier);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003302 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3303 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin4a4543f2006-10-13 12:37:39 +00003304 }
3305 break;
3306
3307 case 122:
Lev Walkine700b202017-08-06 23:21:32 -07003308#line 1206 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003309 {
3310 (yyval.a_expr) = NEW_EXPR();
3311 checkmem((yyval.a_expr));
3312 (yyval.a_expr)->Identifier = strdup("...");
3313 checkmem((yyval.a_expr)->Identifier);
3314 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3315 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3316 (yyval.a_expr)->meta_type = AMT_TYPE;
3317 }
3318 break;
3319
3320 case 123:
Lev Walkine700b202017-08-06 23:21:32 -07003321#line 1215 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003322 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003323 (yyval.a_expr) = NEW_EXPR();
3324 checkmem((yyval.a_expr));
3325 (yyval.a_expr)->Identifier = strdup("...");
3326 (yyval.a_expr)->value = (yyvsp[(3) - (3)].a_value);
3327 checkmem((yyval.a_expr)->Identifier);
3328 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
3329 (yyval.a_expr)->meta_type = AMT_TYPE;
3330 }
3331 break;
3332
Lev Walkin752e9732017-08-04 02:06:22 -07003333 case 124:
Lev Walkine700b202017-08-06 23:21:32 -07003334#line 1227 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003335 {
3336 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
3337 (yyval.a_expr)->tag = (yyvsp[(1) - (3)].a_tag);
Lev Walkin070a52d2004-08-22 03:19:54 +00003338 /*
3339 * Outer constraint for SEQUENCE OF and SET OF applies
3340 * to the inner type.
3341 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07003342 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
3343 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
3344 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
3345 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[(3) - (3)].a_constr);
Lev Walkin070a52d2004-08-22 03:19:54 +00003346 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003347 if((yyval.a_expr)->constraints) {
3348 assert(!(yyvsp[(2) - (3)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08003349 /* Check this : optConstraints is not used ?! */
3350 asn1p_constraint_free((yyvsp[(3) - (3)].a_constr));
Lev Walkin070a52d2004-08-22 03:19:54 +00003351 } else {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003352 (yyval.a_expr)->constraints = (yyvsp[(3) - (3)].a_constr);
Lev Walkin070a52d2004-08-22 03:19:54 +00003353 }
3354 }
Lev Walkin418298d2006-07-13 08:24:20 +00003355 }
3356 break;
3357
Lev Walkin752e9732017-08-04 02:06:22 -07003358 case 125:
Lev Walkine700b202017-08-06 23:21:32 -07003359#line 1251 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003360 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003361 (yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
Lev Walkinfb872bd2006-03-18 06:53:11 +00003362 asn1p_as_pointer = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00003363 }
3364 break;
3365
Lev Walkin752e9732017-08-04 02:06:22 -07003366 case 126:
Lev Walkine700b202017-08-06 23:21:32 -07003367#line 1258 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003368 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003369 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3370 (yyval.a_expr)->marker.flags |= (yyvsp[(1) - (2)].a_int);
Lev Walkinfb872bd2006-03-18 06:53:11 +00003371
Lev Walkin0e90aa02013-03-19 16:17:13 -07003372 if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
3373 && ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
Lev Walkinef625402005-09-05 05:17:57 +00003374 fprintf(stderr,
3375 "INFO: Directive <ASN1C:RepresentAsPointer> "
3376 "applied to %s at line %d\n",
Lev Walkin0e90aa02013-03-19 16:17:13 -07003377 ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
3378 ? ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
Lev Walkinef625402005-09-05 05:17:57 +00003379 : "member",
Lev Walkin0e90aa02013-03-19 16:17:13 -07003380 (yyval.a_expr)->_lineno
Lev Walkinef625402005-09-05 05:17:57 +00003381 );
3382 }
Lev Walkin418298d2006-07-13 08:24:20 +00003383 }
3384 break;
3385
Lev Walkin752e9732017-08-04 02:06:22 -07003386 case 127:
Lev Walkine700b202017-08-06 23:21:32 -07003387#line 1277 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003388 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003389 (yyval.a_expr) = (yyvsp[(1) - (1)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00003390 }
3391 break;
3392
Lev Walkin752e9732017-08-04 02:06:22 -07003393 case 128:
Lev Walkine700b202017-08-06 23:21:32 -07003394#line 1280 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003395 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003396 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3397 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3398 (yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
3399 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003400 }
3401 break;
3402
Lev Walkin752e9732017-08-04 02:06:22 -07003403 case 129:
Lev Walkine700b202017-08-06 23:21:32 -07003404#line 1286 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003405 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003406 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3407 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3408 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
3409 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003410 }
3411 break;
3412
Lev Walkin752e9732017-08-04 02:06:22 -07003413 case 130:
Lev Walkine700b202017-08-06 23:21:32 -07003414#line 1292 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003415 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003416 (yyval.a_expr) = (yyvsp[(3) - (4)].a_expr);
3417 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3418 (yyval.a_expr)->expr_type = ASN_CONSTR_SET;
3419 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003420 }
3421 break;
3422
Lev Walkin752e9732017-08-04 02:06:22 -07003423 case 131:
Lev Walkine700b202017-08-06 23:21:32 -07003424#line 1298 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003425 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003426 (yyval.a_expr) = NEW_EXPR();
3427 checkmem((yyval.a_expr));
3428 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3429 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
3430 (yyval.a_expr)->meta_type = AMT_TYPE;
3431 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3432 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3433 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003434 }
3435 break;
3436
Lev Walkin752e9732017-08-04 02:06:22 -07003437 case 132:
Lev Walkine700b202017-08-06 23:21:32 -07003438#line 1308 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003439 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003440 (yyval.a_expr) = NEW_EXPR();
3441 checkmem((yyval.a_expr));
3442 (yyval.a_expr)->constraints = (yyvsp[(2) - (6)].a_constr);
3443 (yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
3444 (yyval.a_expr)->meta_type = AMT_TYPE;
3445 (yyvsp[(6) - (6)].a_expr)->Identifier = (yyvsp[(4) - (6)].tv_str);
3446 (yyvsp[(6) - (6)].a_expr)->tag = (yyvsp[(5) - (6)].a_tag);
3447 asn1p_expr_add((yyval.a_expr), (yyvsp[(6) - (6)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00003448 }
3449 break;
3450
Lev Walkin752e9732017-08-04 02:06:22 -07003451 case 133:
Lev Walkine700b202017-08-06 23:21:32 -07003452#line 1318 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003453 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003454 (yyval.a_expr) = NEW_EXPR();
3455 checkmem((yyval.a_expr));
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 Walkin752e9732017-08-04 02:06:22 -07003461 case 134:
Lev Walkine700b202017-08-06 23:21:32 -07003462#line 1324 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003463 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003464 int ret;
3465 (yyval.a_expr) = NEW_EXPR();
3466 checkmem((yyval.a_expr));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003467 (yyval.a_expr)->reference = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003468 ret = asn1p_ref_add_component((yyval.a_expr)->reference,
3469 (yyvsp[(4) - (4)].tv_str), RLT_lowercase);
3470 checkmem(ret == 0);
3471 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3472 (yyval.a_expr)->meta_type = AMT_TYPE;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003473 free((yyvsp[(4) - (4)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003474 }
3475 break;
3476
Lev Walkin752e9732017-08-04 02:06:22 -07003477 case 135:
Lev Walkine700b202017-08-06 23:21:32 -07003478#line 1336 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003479 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003480 (yyval.a_expr) = NEW_EXPR();
3481 checkmem((yyval.a_expr));
3482 (yyval.a_expr)->reference = (yyvsp[(3) - (3)].a_ref);
3483 (yyval.a_expr)->expr_type = A1TC_INSTANCE;
3484 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003485 }
3486 break;
3487
Lev Walkin752e9732017-08-04 02:06:22 -07003488 case 136:
Lev Walkine700b202017-08-06 23:21:32 -07003489#line 1351 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00003490 {
3491 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003492 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003493 checkmem((yyval.a_ref));
3494 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_UNKNOWN);
Lev Walkin4a4543f2006-10-13 12:37:39 +00003495 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003496 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin4a4543f2006-10-13 12:37:39 +00003497 }
3498 break;
3499
Lev Walkin4a4543f2006-10-13 12:37:39 +00003500 case 137:
Lev Walkine700b202017-08-06 23:21:32 -07003501#line 1359 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003502 {
Lev Walkin9d542d22006-03-14 16:31:37 +00003503 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003504 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003505 checkmem((yyval.a_ref));
3506 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9d542d22006-03-14 16:31:37 +00003507 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003508 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9d542d22006-03-14 16:31:37 +00003509 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003510 free((yyvsp[(1) - (3)].tv_str));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003511 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003512 }
3513 break;
3514
Lev Walkin4a4543f2006-10-13 12:37:39 +00003515 case 138:
Lev Walkine700b202017-08-06 23:21:32 -07003516#line 1370 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003517 {
3518 int ret;
3519 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
3520 checkmem((yyval.a_ref));
3521 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3522 checkmem(ret == 0);
3523 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_UNKNOWN);
3524 checkmem(ret == 0);
3525 free((yyvsp[(1) - (3)].tv_str));
3526 free((yyvsp[(3) - (3)].tv_str));
3527 }
3528 break;
3529
3530 case 139:
Lev Walkine700b202017-08-06 23:21:32 -07003531#line 1381 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003532 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003533 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003534 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003535 checkmem((yyval.a_ref));
3536 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
Lev Walkin9c974182004-09-15 11:59:51 +00003537 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003538 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
3539 checkmem(ret == 0);
3540 free((yyvsp[(1) - (3)].tv_str));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003541 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003542 }
3543 break;
3544
Lev Walkin752e9732017-08-04 02:06:22 -07003545 case 140:
Lev Walkine700b202017-08-06 23:21:32 -07003546#line 1392 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003547 {
Lev Walkin9c974182004-09-15 11:59:51 +00003548 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003549 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003550 checkmem((yyval.a_ref));
3551 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
3552 free((yyvsp[(1) - (1)].tv_str));
3553 checkmem(ret == 0);
3554 }
3555 break;
3556
Lev Walkin752e9732017-08-04 02:06:22 -07003557 case 141:
Lev Walkine700b202017-08-06 23:21:32 -07003558#line 1400 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003559 {
3560 int ret;
3561 (yyval.a_ref) = (yyvsp[(3) - (3)].a_ref);
3562 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (3)].tv_str), RLT_CAPITALS);
3563 free((yyvsp[(1) - (3)].tv_str));
Lev Walkinf15320b2004-06-03 03:38:44 +00003564 checkmem(ret == 0);
3565 /*
3566 * Move the last element infront.
3567 */
3568 {
3569 struct asn1p_ref_component_s tmp_comp;
Lev Walkin0e90aa02013-03-19 16:17:13 -07003570 tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
3571 memmove(&(yyval.a_ref)->components[1],
3572 &(yyval.a_ref)->components[0],
3573 sizeof((yyval.a_ref)->components[0])
3574 * ((yyval.a_ref)->comp_count - 1));
3575 (yyval.a_ref)->components[0] = tmp_comp;
Lev Walkinf15320b2004-06-03 03:38:44 +00003576 }
Lev Walkin418298d2006-07-13 08:24:20 +00003577 }
3578 break;
3579
Lev Walkin752e9732017-08-04 02:06:22 -07003580 case 142:
Lev Walkine700b202017-08-06 23:21:32 -07003581#line 1422 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003582 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003583 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003584 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003585 checkmem((yyval.a_ref));
3586 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].a_refcomp).name, (yyvsp[(1) - (1)].a_refcomp).lex_type);
3587 free((yyvsp[(1) - (1)].a_refcomp).name);
Lev Walkinf15320b2004-06-03 03:38:44 +00003588 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003589 }
3590 break;
3591
Lev Walkin752e9732017-08-04 02:06:22 -07003592 case 143:
Lev Walkine700b202017-08-06 23:21:32 -07003593#line 1430 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003594 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003595 int ret;
3596 (yyval.a_ref) = (yyvsp[(1) - (3)].a_ref);
3597 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].a_refcomp).name, (yyvsp[(3) - (3)].a_refcomp).lex_type);
3598 free((yyvsp[(3) - (3)].a_refcomp).name);
3599 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00003600 }
3601 break;
3602
Lev Walkin752e9732017-08-04 02:06:22 -07003603 case 145:
Lev Walkine700b202017-08-06 23:21:32 -07003604#line 1443 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003605 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003606 (yyval.a_refcomp).lex_type = RLT_AmpUppercase;
3607 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003608 }
3609 break;
3610
Lev Walkin752e9732017-08-04 02:06:22 -07003611 case 146:
Lev Walkine700b202017-08-06 23:21:32 -07003612#line 1448 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003613 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003614 (yyval.a_refcomp).lex_type = RLT_Amplowercase;
3615 (yyval.a_refcomp).name = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00003616 }
3617 break;
3618
Lev Walkin752e9732017-08-04 02:06:22 -07003619 case 147:
Lev Walkine700b202017-08-06 23:21:32 -07003620#line 1457 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003621 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003622 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003623 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_AmpUppercase);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003624 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003625 }
3626 break;
3627
Lev Walkin752e9732017-08-04 02:06:22 -07003628 case 148:
Lev Walkine700b202017-08-06 23:21:32 -07003629#line 1462 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003630 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003631 (yyval.a_ref) = (yyval.a_ref);
3632 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_AmpUppercase);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003633 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003634 }
3635 break;
3636
Lev Walkin752e9732017-08-04 02:06:22 -07003637 case 149:
Lev Walkine700b202017-08-06 23:21:32 -07003638#line 1467 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003639 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003640 (yyval.a_ref) = (yyval.a_ref);
3641 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(3) - (3)].tv_str), RLT_Amplowercase);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003642 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003643 }
3644 break;
3645
Lev Walkin752e9732017-08-04 02:06:22 -07003646 case 150:
Lev Walkine700b202017-08-06 23:21:32 -07003647#line 1475 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003648 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003649 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003650 asn1p_ref_add_component((yyval.a_ref), (yyvsp[(1) - (1)].tv_str), RLT_CAPITALS);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003651 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003652 }
3653 break;
3654
Lev Walkin752e9732017-08-04 02:06:22 -07003655 case 151:
Lev Walkine700b202017-08-06 23:21:32 -07003656#line 1498 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003657 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003658 (yyval.a_expr) = (yyvsp[(2) - (4)].a_expr);
3659 assert((yyval.a_expr)->Identifier == NULL);
3660 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
3661 (yyval.a_expr)->meta_type = AMT_VALUE;
3662 (yyval.a_expr)->value = (yyvsp[(4) - (4)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003663 }
3664 break;
3665
Lev Walkin752e9732017-08-04 02:06:22 -07003666 case 154:
Lev Walkine700b202017-08-06 23:21:32 -07003667#line 1510 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003668 {
3669 (yyval.a_value) = asn1p_value_fromint(0);
3670 checkmem((yyval.a_value));
3671 (yyval.a_value)->type = ATV_CHOICE_IDENTIFIER;
3672 (yyval.a_value)->value.choice_identifier.identifier = (yyvsp[(1) - (3)].tv_str);
3673 (yyval.a_value)->value.choice_identifier.value = (yyvsp[(3) - (3)].a_value);
3674 }
Lev Walkin418298d2006-07-13 08:24:20 +00003675 break;
3676
Lev Walkin752e9732017-08-04 02:06:22 -07003677 case 155:
Lev Walkine700b202017-08-06 23:21:32 -07003678#line 1517 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003679 { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin418298d2006-07-13 08:24:20 +00003680 break;
3681
Lev Walkin752e9732017-08-04 02:06:22 -07003682 case 156:
Lev Walkine700b202017-08-06 23:21:32 -07003683#line 1517 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003684 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003685 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(3) - (3)].tv_opaque).buf, (yyvsp[(3) - (3)].tv_opaque).len, 0);
3686 checkmem((yyval.a_value));
3687 (yyval.a_value)->type = ATV_UNPARSED;
Lev Walkin418298d2006-07-13 08:24:20 +00003688 }
3689 break;
3690
Lev Walkin752e9732017-08-04 02:06:22 -07003691 case 157:
Lev Walkine700b202017-08-06 23:21:32 -07003692#line 1522 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003693 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003694 (yyval.a_value) = asn1p_value_fromint(0);
3695 checkmem((yyval.a_value));
3696 (yyval.a_value)->type = ATV_NULL;
Lev Walkin418298d2006-07-13 08:24:20 +00003697 }
3698 break;
3699
Lev Walkin752e9732017-08-04 02:06:22 -07003700 case 158:
Lev Walkine700b202017-08-06 23:21:32 -07003701#line 1530 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003702 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003703 (yyval.a_value) = asn1p_value_fromint(0);
3704 checkmem((yyval.a_value));
3705 (yyval.a_value)->type = ATV_FALSE;
Lev Walkin418298d2006-07-13 08:24:20 +00003706 }
3707 break;
3708
Lev Walkin752e9732017-08-04 02:06:22 -07003709 case 159:
Lev Walkine700b202017-08-06 23:21:32 -07003710#line 1535 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003711 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003712 (yyval.a_value) = asn1p_value_fromint(0);
3713 checkmem((yyval.a_value));
3714 (yyval.a_value)->type = ATV_TRUE;
Lev Walkin418298d2006-07-13 08:24:20 +00003715 }
3716 break;
3717
Lev Walkin752e9732017-08-04 02:06:22 -07003718 case 160:
Lev Walkine700b202017-08-06 23:21:32 -07003719#line 1540 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003720 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003721 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
3722 checkmem((yyval.a_value));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003723 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003724 }
3725 break;
3726
Lev Walkin752e9732017-08-04 02:06:22 -07003727 case 161:
Lev Walkine700b202017-08-06 23:21:32 -07003728#line 1545 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003729 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003730 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
3731 checkmem((yyval.a_value));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003732 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003733 }
3734 break;
3735
Lev Walkin752e9732017-08-04 02:06:22 -07003736 case 162:
Lev Walkine700b202017-08-06 23:21:32 -07003737#line 1550 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003738 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003739 (yyval.a_value) = (yyval.a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003740 }
3741 break;
3742
Lev Walkin752e9732017-08-04 02:06:22 -07003743 case 163:
Lev Walkine700b202017-08-06 23:21:32 -07003744#line 1553 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003745 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003746 (yyval.a_value) = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00003747 }
3748 break;
3749
Lev Walkin752e9732017-08-04 02:06:22 -07003750 case 164:
Lev Walkine700b202017-08-06 23:21:32 -07003751#line 1559 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003752 {
Lev Walkinf15320b2004-06-03 03:38:44 +00003753 asn1p_ref_t *ref;
3754 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003755 ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkinf15320b2004-06-03 03:38:44 +00003756 checkmem(ref);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003757 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
Lev Walkinf15320b2004-06-03 03:38:44 +00003758 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003759 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3760 checkmem((yyval.a_value));
3761 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003762 }
3763 break;
3764
Lev Walkin752e9732017-08-04 02:06:22 -07003765 case 165:
Lev Walkine700b202017-08-06 23:21:32 -07003766#line 1570 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003767 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003768 asn1p_ref_t *ref;
3769 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08003770 ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07003771 checkmem(ref);
3772 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (3)].tv_str), RLT_UNKNOWN);
3773 checkmem(ret == 0);
3774 ret = asn1p_ref_add_component(ref, (yyvsp[(3) - (3)].tv_str), RLT_lowercase);
3775 checkmem(ret == 0);
3776 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3777 checkmem((yyval.a_value));
3778 free((yyvsp[(1) - (3)].tv_str));
3779 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00003780 }
3781 break;
3782
Lev Walkin752e9732017-08-04 02:06:22 -07003783 case 166:
Lev Walkine700b202017-08-06 23:21:32 -07003784#line 1588 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003785 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003786 (yyval.a_value) = asn1p_value_frombuf((yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len, 0);
3787 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00003788 }
3789 break;
3790
Lev Walkin752e9732017-08-04 02:06:22 -07003791 case 167:
Lev Walkine700b202017-08-06 23:21:32 -07003792#line 1592 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003793 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003794 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3795 checkmem((yyval.a_value));
3796 (yyval.a_value)->type = ATV_TUPLE;
Lev Walkin418298d2006-07-13 08:24:20 +00003797 }
3798 break;
3799
Lev Walkin752e9732017-08-04 02:06:22 -07003800 case 168:
Lev Walkine700b202017-08-06 23:21:32 -07003801#line 1597 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003802 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003803 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
3804 checkmem((yyval.a_value));
3805 (yyval.a_value)->type = ATV_QUADRUPLE;
Lev Walkin418298d2006-07-13 08:24:20 +00003806 }
3807 break;
3808
Lev Walkin752e9732017-08-04 02:06:22 -07003809 case 169:
Lev Walkine700b202017-08-06 23:21:32 -07003810#line 1605 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003811 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003812 (yyval.tv_opaque).len = (yyvsp[(1) - (1)].tv_opaque).len + 1;
3813 (yyval.tv_opaque).buf = malloc((yyval.tv_opaque).len + 1);
3814 checkmem((yyval.tv_opaque).buf);
3815 (yyval.tv_opaque).buf[0] = '{';
3816 memcpy((yyval.tv_opaque).buf + 1, (yyvsp[(1) - (1)].tv_opaque).buf, (yyvsp[(1) - (1)].tv_opaque).len);
3817 (yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
3818 free((yyvsp[(1) - (1)].tv_opaque).buf);
Lev Walkin418298d2006-07-13 08:24:20 +00003819 }
3820 break;
3821
Lev Walkin752e9732017-08-04 02:06:22 -07003822 case 170:
Lev Walkine700b202017-08-06 23:21:32 -07003823#line 1614 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003824 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003825 int newsize = (yyvsp[(1) - (2)].tv_opaque).len + (yyvsp[(2) - (2)].tv_opaque).len;
3826 char *p = malloc(newsize + 1);
3827 checkmem(p);
3828 memcpy(p , (yyvsp[(1) - (2)].tv_opaque).buf, (yyvsp[(1) - (2)].tv_opaque).len);
3829 memcpy(p + (yyvsp[(1) - (2)].tv_opaque).len, (yyvsp[(2) - (2)].tv_opaque).buf, (yyvsp[(2) - (2)].tv_opaque).len);
3830 p[newsize] = '\0';
3831 free((yyvsp[(1) - (2)].tv_opaque).buf);
3832 free((yyvsp[(2) - (2)].tv_opaque).buf);
3833 (yyval.tv_opaque).buf = p;
3834 (yyval.tv_opaque).len = newsize;
Lev Walkin418298d2006-07-13 08:24:20 +00003835 }
3836 break;
3837
Lev Walkin752e9732017-08-04 02:06:22 -07003838 case 171:
Lev Walkine700b202017-08-06 23:21:32 -07003839#line 1629 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003840 { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
3841 break;
3842
Lev Walkin752e9732017-08-04 02:06:22 -07003843 case 172:
Lev Walkine700b202017-08-06 23:21:32 -07003844#line 1630 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003845 { (yyval.a_type) = ASN_BASIC_NULL; }
3846 break;
3847
Lev Walkin752e9732017-08-04 02:06:22 -07003848 case 173:
Lev Walkine700b202017-08-06 23:21:32 -07003849#line 1631 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003850 { (yyval.a_type) = ASN_BASIC_REAL; }
3851 break;
3852
Lev Walkin0e90aa02013-03-19 16:17:13 -07003853 case 174:
Lev Walkine700b202017-08-06 23:21:32 -07003854#line 1632 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003855 { (yyval.a_type) = (yyvsp[(1) - (1)].a_type); }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003856 break;
3857
3858 case 175:
Lev Walkine700b202017-08-06 23:21:32 -07003859#line 1633 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003860 { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003861 break;
3862
3863 case 176:
Lev Walkine700b202017-08-06 23:21:32 -07003864#line 1634 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003865 { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003866 break;
3867
3868 case 177:
Lev Walkine700b202017-08-06 23:21:32 -07003869#line 1635 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003870 { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003871 break;
3872
3873 case 178:
Lev Walkine700b202017-08-06 23:21:32 -07003874#line 1636 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003875 { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003876 break;
3877
3878 case 179:
Lev Walkine700b202017-08-06 23:21:32 -07003879#line 1637 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003880 { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003881 break;
3882
3883 case 180:
Lev Walkine700b202017-08-06 23:21:32 -07003884#line 1638 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003885 { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003886 break;
3887
3888 case 181:
Lev Walkine700b202017-08-06 23:21:32 -07003889#line 1639 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003890 { (yyval.a_type) = ASN_BASIC_UTCTime; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003891 break;
3892
3893 case 182:
Lev Walkine700b202017-08-06 23:21:32 -07003894#line 1640 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003895 { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003896 break;
3897
3898 case 183:
Lev Walkine700b202017-08-06 23:21:32 -07003899#line 1641 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003900 { (yyval.a_type) = (yyvsp[(1) - (1)].a_type); }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003901 break;
3902
3903 case 184:
Lev Walkine700b202017-08-06 23:21:32 -07003904#line 1648 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003905 { (yyval.a_type) = ASN_BASIC_INTEGER; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003906 break;
3907
3908 case 185:
Lev Walkine700b202017-08-06 23:21:32 -07003909#line 1649 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003910 { (yyval.a_type) = ASN_BASIC_ENUMERATED; }
Lev Walkin0e90aa02013-03-19 16:17:13 -07003911 break;
3912
Lev Walkin4a4543f2006-10-13 12:37:39 +00003913 case 186:
Lev Walkine700b202017-08-06 23:21:32 -07003914#line 1650 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07003915 { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
3916 break;
3917
3918 case 187:
Lev Walkine700b202017-08-06 23:21:32 -07003919#line 1654 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003920 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003921 (yyval.a_expr) = NEW_EXPR();
3922 checkmem((yyval.a_expr));
3923 (yyval.a_expr)->expr_type = (yyvsp[(1) - (1)].a_type);
3924 (yyval.a_expr)->meta_type = AMT_TYPE;
Lev Walkin418298d2006-07-13 08:24:20 +00003925 }
3926 break;
3927
Lev Walkin752e9732017-08-04 02:06:22 -07003928 case 188:
Lev Walkine700b202017-08-06 23:21:32 -07003929#line 1660 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003930 {
3931 if((yyvsp[(2) - (2)].a_expr)) {
3932 (yyval.a_expr) = (yyvsp[(2) - (2)].a_expr);
3933 } else {
3934 (yyval.a_expr) = NEW_EXPR();
3935 checkmem((yyval.a_expr));
3936 }
3937 (yyval.a_expr)->expr_type = (yyvsp[(1) - (2)].a_type);
3938 (yyval.a_expr)->meta_type = AMT_TYPE;
3939 }
Lev Walkin418298d2006-07-13 08:24:20 +00003940 break;
3941
Lev Walkin752e9732017-08-04 02:06:22 -07003942 case 189:
Lev Walkine700b202017-08-06 23:21:32 -07003943#line 1673 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003944 { (yyval.a_type) = ASN_STRING_BMPString; }
3945 break;
3946
Lev Walkin752e9732017-08-04 02:06:22 -07003947 case 190:
Lev Walkine700b202017-08-06 23:21:32 -07003948#line 1674 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003949 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003950 (yyval.a_type) = ASN_STRING_GeneralString;
Lev Walkin9c974182004-09-15 11:59:51 +00003951 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003952 }
3953 break;
3954
Lev Walkin752e9732017-08-04 02:06:22 -07003955 case 191:
Lev Walkine700b202017-08-06 23:21:32 -07003956#line 1678 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003957 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003958 (yyval.a_type) = ASN_STRING_GraphicString;
Lev Walkin9c974182004-09-15 11:59:51 +00003959 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003960 }
3961 break;
3962
Lev Walkin752e9732017-08-04 02:06:22 -07003963 case 192:
Lev Walkine700b202017-08-06 23:21:32 -07003964#line 1682 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003965 { (yyval.a_type) = ASN_STRING_IA5String; }
Lev Walkin418298d2006-07-13 08:24:20 +00003966 break;
3967
Lev Walkin752e9732017-08-04 02:06:22 -07003968 case 193:
Lev Walkine700b202017-08-06 23:21:32 -07003969#line 1683 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003970 { (yyval.a_type) = ASN_STRING_ISO646String; }
Lev Walkin418298d2006-07-13 08:24:20 +00003971 break;
3972
Lev Walkin752e9732017-08-04 02:06:22 -07003973 case 194:
Lev Walkine700b202017-08-06 23:21:32 -07003974#line 1684 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003975 { (yyval.a_type) = ASN_STRING_NumericString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003976 break;
3977
Lev Walkin752e9732017-08-04 02:06:22 -07003978 case 195:
Lev Walkine700b202017-08-06 23:21:32 -07003979#line 1685 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003980 { (yyval.a_type) = ASN_STRING_PrintableString; }
3981 break;
3982
Lev Walkin752e9732017-08-04 02:06:22 -07003983 case 196:
Lev Walkine700b202017-08-06 23:21:32 -07003984#line 1686 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00003985 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07003986 (yyval.a_type) = ASN_STRING_T61String;
Lev Walkin9c974182004-09-15 11:59:51 +00003987 fprintf(stderr, "WARNING: T61String is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00003988 }
3989 break;
3990
Lev Walkin752e9732017-08-04 02:06:22 -07003991 case 197:
Lev Walkine700b202017-08-06 23:21:32 -07003992#line 1690 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003993 { (yyval.a_type) = ASN_STRING_TeletexString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003994 break;
3995
Lev Walkin752e9732017-08-04 02:06:22 -07003996 case 198:
Lev Walkine700b202017-08-06 23:21:32 -07003997#line 1691 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07003998 { (yyval.a_type) = ASN_STRING_UniversalString; }
Lev Walkin418298d2006-07-13 08:24:20 +00003999 break;
4000
Lev Walkin752e9732017-08-04 02:06:22 -07004001 case 199:
Lev Walkine700b202017-08-06 23:21:32 -07004002#line 1692 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004003 { (yyval.a_type) = ASN_STRING_UTF8String; }
4004 break;
4005
Lev Walkin752e9732017-08-04 02:06:22 -07004006 case 200:
Lev Walkine700b202017-08-06 23:21:32 -07004007#line 1693 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004008 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004009 (yyval.a_type) = ASN_STRING_VideotexString;
Lev Walkin9c974182004-09-15 11:59:51 +00004010 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
Lev Walkin418298d2006-07-13 08:24:20 +00004011 }
4012 break;
4013
Lev Walkin752e9732017-08-04 02:06:22 -07004014 case 201:
Lev Walkine700b202017-08-06 23:21:32 -07004015#line 1697 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004016 { (yyval.a_type) = ASN_STRING_VisibleString; }
Lev Walkin418298d2006-07-13 08:24:20 +00004017 break;
4018
Lev Walkin752e9732017-08-04 02:06:22 -07004019 case 202:
Lev Walkine700b202017-08-06 23:21:32 -07004020#line 1698 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004021 { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
Lev Walkin418298d2006-07-13 08:24:20 +00004022 break;
4023
Lev Walkin752e9732017-08-04 02:06:22 -07004024 case 207:
Lev Walkine700b202017-08-06 23:21:32 -07004025#line 1709 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004026 { (yyval.a_constr) = 0; }
Lev Walkin418298d2006-07-13 08:24:20 +00004027 break;
4028
Lev Walkin752e9732017-08-04 02:06:22 -07004029 case 208:
Lev Walkine700b202017-08-06 23:21:32 -07004030#line 1710 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004031 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004032 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004033 }
4034 break;
4035
Lev Walkin752e9732017-08-04 02:06:22 -07004036 case 210:
Lev Walkine700b202017-08-06 23:21:32 -07004037#line 1720 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004038 {
4039 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[(1) - (1)].a_constr), 0);
4040 }
4041 break;
4042
Lev Walkin752e9732017-08-04 02:06:22 -07004043 case 211:
Lev Walkine700b202017-08-06 23:21:32 -07004044#line 1723 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004045 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004046 /*
4047 * This is a special case, for compatibility purposes.
Lev Walkinf59d0752004-08-18 04:59:12 +00004048 * It goes without parentheses.
Lev Walkinf15320b2004-06-03 03:38:44 +00004049 */
Lev Walkin0e90aa02013-03-19 16:17:13 -07004050 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[(3) - (4)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004051 }
4052 break;
4053
Lev Walkin752e9732017-08-04 02:06:22 -07004054 case 212:
Lev Walkine700b202017-08-06 23:21:32 -07004055#line 1733 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004056 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004057 (yyval.a_constr) = (yyvsp[(2) - (3)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004058 }
4059 break;
4060
Lev Walkin752e9732017-08-04 02:06:22 -07004061 case 213:
Lev Walkine700b202017-08-06 23:21:32 -07004062#line 1736 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004063 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004064 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 +00004065 }
4066 break;
4067
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004068 case 214:
Lev Walkine700b202017-08-06 23:21:32 -07004069#line 1742 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004070 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004071 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004072 }
4073 break;
4074
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004075 case 215:
Lev Walkine700b202017-08-06 23:21:32 -07004076#line 1745 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004077 {
4078 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4079 }
4080 break;
4081
4082 case 216:
Lev Walkine700b202017-08-06 23:21:32 -07004083#line 1751 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004084 {
4085 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4086 (yyval.a_constr)->type = ACT_EL_EXT;
4087 }
4088 break;
4089
Lev Walkin752e9732017-08-04 02:06:22 -07004090 case 217:
Lev Walkine700b202017-08-06 23:21:32 -07004091#line 1755 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004092 {
4093 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4094 }
4095 break;
4096
Lev Walkin752e9732017-08-04 02:06:22 -07004097 case 218:
Lev Walkine700b202017-08-06 23:21:32 -07004098#line 1758 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004099 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004100 asn1p_constraint_t *ct;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004101 ct = asn1p_constraint_new(yylineno, currentModule);
Lev Walkinf15320b2004-06-03 03:38:44 +00004102 ct->type = ACT_EL_EXT;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004103 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
Lev Walkin418298d2006-07-13 08:24:20 +00004104 }
4105 break;
4106
Lev Walkin752e9732017-08-04 02:06:22 -07004107 case 219:
Lev Walkine700b202017-08-06 23:21:32 -07004108#line 1764 "asn1p_y.y"
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004109 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004110 asn1p_constraint_t *ct;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004111 ct = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004112 ct->type = ACT_EL_EXT;
4113 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (5)].a_constr), ct);
4114 ct = (yyval.a_constr);
4115 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[(5) - (5)].a_constr));
Lev Walkinc6ab03c2006-10-21 05:54:49 +00004116 }
4117 break;
4118
Lev Walkin752e9732017-08-04 02:06:22 -07004119 case 221:
Lev Walkine700b202017-08-06 23:21:32 -07004120#line 1776 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004121 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004122 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004123 }
4124 break;
4125
Lev Walkin752e9732017-08-04 02:06:22 -07004126 case 223:
Lev Walkine700b202017-08-06 23:21:32 -07004127#line 1783 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004128 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004129 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 +00004130 }
4131 break;
4132
Lev Walkin752e9732017-08-04 02:06:22 -07004133 case 225:
Lev Walkine700b202017-08-06 23:21:32 -07004134#line 1790 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004135 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004136 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 +00004137 }
4138 break;
4139
Lev Walkin752e9732017-08-04 02:06:22 -07004140 case 227:
Lev Walkine700b202017-08-06 23:21:32 -07004141#line 1798 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004142 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004143 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 +00004144 }
4145 break;
4146
Lev Walkin752e9732017-08-04 02:06:22 -07004147 case 228:
Lev Walkine700b202017-08-06 23:21:32 -07004148#line 1804 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004149 {
Lev Walkinf59d0752004-08-18 04:59:12 +00004150 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004151 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004152 checkmem((yyval.a_constr));
4153 (yyval.a_constr)->type = (yyvsp[(1) - (4)].a_ctype);
4154 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(3) - (4)].a_constr));
Lev Walkinf59d0752004-08-18 04:59:12 +00004155 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004156 }
4157 break;
4158
Lev Walkin752e9732017-08-04 02:06:22 -07004159 case 229:
Lev Walkine700b202017-08-06 23:21:32 -07004160#line 1812 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004161 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004162 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004163 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004164 checkmem((yyval.a_constr));
4165 (yyval.a_constr)->type = ACT_CA_SET;
4166 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
4167 checkmem(ret == 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004168 }
4169 break;
4170
Lev Walkin752e9732017-08-04 02:06:22 -07004171 case 230:
Lev Walkine700b202017-08-06 23:21:32 -07004172#line 1820 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004173 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004174 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004175 checkmem((yyval.a_constr));
4176 (yyval.a_constr)->type = ACT_EL_VALUE;
4177 (yyval.a_constr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004178 }
4179 break;
4180
Lev Walkin752e9732017-08-04 02:06:22 -07004181 case 231:
Lev Walkine700b202017-08-06 23:21:32 -07004182#line 1826 "asn1p_y.y"
Lev Walkinf1727152006-09-21 01:50:37 +00004183 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004184 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004185 checkmem((yyval.a_constr));
4186 (yyval.a_constr)->type = ACT_EL_TYPE;
4187 (yyval.a_constr)->containedSubtype = (yyvsp[(1) - (1)].a_value);
Lev Walkinf1727152006-09-21 01:50:37 +00004188 }
4189 break;
4190
Lev Walkin752e9732017-08-04 02:06:22 -07004191 case 232:
Lev Walkine700b202017-08-06 23:21:32 -07004192#line 1832 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004193 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004194 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004195 checkmem((yyval.a_constr));
4196 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4197 (yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
4198 (yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004199 }
4200 break;
4201
Lev Walkin4a4543f2006-10-13 12:37:39 +00004202 case 233:
Lev Walkine700b202017-08-06 23:21:32 -07004203#line 1839 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004204 {
4205 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4206 checkmem((yyval.a_constr));
4207 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4208 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
4209 (yyval.a_constr)->range_stop = (yyvsp[(3) - (3)].a_value);
4210 (yyval.a_constr)->range_start->type = ATV_MIN;
4211 }
4212 break;
4213
4214 case 234:
Lev Walkine700b202017-08-06 23:21:32 -07004215#line 1847 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00004216 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004217 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004218 checkmem((yyval.a_constr));
4219 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004220 (yyval.a_constr)->range_start = (yyvsp[(1) - (3)].a_value);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004221 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004222 (yyval.a_constr)->range_stop->type = ATV_MAX;
Lev Walkin866bd7f2006-09-14 10:35:20 +00004223 }
4224 break;
4225
Lev Walkin4a4543f2006-10-13 12:37:39 +00004226 case 235:
Lev Walkine700b202017-08-06 23:21:32 -07004227#line 1855 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004228 {
Lev Walkin752e9732017-08-04 02:06:22 -07004229 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4230 checkmem((yyval.a_constr));
4231 (yyval.a_constr)->type = (yyvsp[(2) - (3)].a_ctype);
4232 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
4233 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
4234 (yyval.a_constr)->range_start->type = ATV_MIN;
4235 (yyval.a_constr)->range_stop->type = ATV_MAX;
Lev Walkin418298d2006-07-13 08:24:20 +00004236 }
4237 break;
4238
Lev Walkin4a4543f2006-10-13 12:37:39 +00004239 case 236:
Lev Walkine700b202017-08-06 23:21:32 -07004240#line 1864 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004241 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004242 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4243 }
4244 break;
4245
4246 case 237:
Lev Walkine700b202017-08-06 23:21:32 -07004247#line 1867 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004248 {
4249 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4250 }
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004251 break;
4252
4253 case 238:
Lev Walkine700b202017-08-06 23:21:32 -07004254#line 1870 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004255 { asn1p_lexer_hack_push_opaque_state(); }
4256 break;
4257
4258 case 239:
Lev Walkine700b202017-08-06 23:21:32 -07004259#line 1870 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004260 {
4261 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
4262 checkmem((yyval.a_constr));
4263 (yyval.a_constr)->type = ACT_EL_VALUE;
4264 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(3) - (3)].tv_opaque).buf, (yyvsp[(3) - (3)].tv_opaque).len, 0);
4265 (yyval.a_constr)->value->type = ATV_UNPARSED;
4266 }
4267 break;
4268
Lev Walkin752e9732017-08-04 02:06:22 -07004269 case 240:
Lev Walkine700b202017-08-06 23:21:32 -07004270#line 1880 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004271 {
4272 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004273 (yyval.a_constr)->type = ACT_CT_PATTERN;
4274 (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 +00004275 }
4276 break;
4277
Lev Walkin752e9732017-08-04 02:06:22 -07004278 case 241:
Lev Walkine700b202017-08-06 23:21:32 -07004279#line 1885 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004280 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004281 asn1p_ref_t *ref;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004282 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004283 (yyval.a_constr)->type = ACT_CT_PATTERN;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004284 ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004285 asn1p_ref_add_component(ref, (yyvsp[(2) - (2)].tv_str), RLT_lowercase);
4286 (yyval.a_constr)->value = asn1p_value_fromref(ref, 0);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004287 free((yyvsp[(2) - (2)].tv_str));
Lev Walkin5c541f12006-10-18 18:40:14 +00004288 }
4289 break;
4290
Lev Walkin752e9732017-08-04 02:06:22 -07004291 case 242:
Lev Walkine700b202017-08-06 23:21:32 -07004292#line 1897 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004293 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004294 (yyval.a_ctype) = ACT_CT_SIZE;
Lev Walkin5c541f12006-10-18 18:40:14 +00004295 }
4296 break;
4297
Lev Walkin752e9732017-08-04 02:06:22 -07004298 case 243:
Lev Walkine700b202017-08-06 23:21:32 -07004299#line 1900 "asn1p_y.y"
Lev Walkin5c541f12006-10-18 18:40:14 +00004300 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004301 (yyval.a_ctype) = ACT_CT_FROM;
Lev Walkin418298d2006-07-13 08:24:20 +00004302 }
4303 break;
4304
Lev Walkin752e9732017-08-04 02:06:22 -07004305 case 244:
Lev Walkine700b202017-08-06 23:21:32 -07004306#line 1906 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004307 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004308 (yyval.a_value) = asn1p_value_fromint(0);
4309 checkmem((yyval.a_value));
4310 (yyval.a_value)->type = ATV_FALSE;
Lev Walkin418298d2006-07-13 08:24:20 +00004311 }
4312 break;
4313
Lev Walkin752e9732017-08-04 02:06:22 -07004314 case 245:
Lev Walkine700b202017-08-06 23:21:32 -07004315#line 1911 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004316 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004317 (yyval.a_value) = asn1p_value_fromint(1);
4318 checkmem((yyval.a_value));
4319 (yyval.a_value)->type = ATV_TRUE;
Lev Walkin418298d2006-07-13 08:24:20 +00004320 }
4321 break;
4322
Lev Walkin752e9732017-08-04 02:06:22 -07004323 case 249:
Lev Walkine700b202017-08-06 23:21:32 -07004324#line 1919 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004325 {
Lev Walkinc8092cb2005-02-18 16:34:21 +00004326 asn1p_ref_t *ref;
4327 int ret;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004328 ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkinc8092cb2005-02-18 16:34:21 +00004329 checkmem(ref);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004330 ret = asn1p_ref_add_component(ref, (yyvsp[(1) - (1)].tv_str), RLT_lowercase);
Lev Walkinc8092cb2005-02-18 16:34:21 +00004331 checkmem(ret == 0);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004332 (yyval.a_value) = asn1p_value_fromref(ref, 0);
4333 checkmem((yyval.a_value));
4334 free((yyvsp[(1) - (1)].tv_str));
4335 }
4336 break;
4337
Lev Walkin752e9732017-08-04 02:06:22 -07004338 case 250:
Lev Walkine700b202017-08-06 23:21:32 -07004339#line 1933 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004340 {
4341 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'B');
4342 checkmem((yyval.a_value));
Lev Walkin0e90aa02013-03-19 16:17:13 -07004343 free((yyvsp[(1) - (1)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004344 }
4345 break;
4346
Lev Walkin752e9732017-08-04 02:06:22 -07004347 case 251:
Lev Walkine700b202017-08-06 23:21:32 -07004348#line 1938 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004349 {
4350 (yyval.a_value) = _convert_bitstring2binary((yyvsp[(1) - (1)].tv_str), 'H');
4351 checkmem((yyval.a_value));
4352 free((yyvsp[(1) - (1)].tv_str));
4353 }
4354 break;
4355
Lev Walkin752e9732017-08-04 02:06:22 -07004356 case 252:
Lev Walkine700b202017-08-06 23:21:32 -07004357#line 1946 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004358 {
4359 (yyval.a_value) = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
4360 checkmem((yyval.a_value));
4361 }
4362 break;
4363
Lev Walkin752e9732017-08-04 02:06:22 -07004364 case 253:
Lev Walkine700b202017-08-06 23:21:32 -07004365#line 1966 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004366 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004367 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[(3) - (3)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004368 }
4369 break;
4370
Lev Walkin752e9732017-08-04 02:06:22 -07004371 case 254:
Lev Walkine700b202017-08-06 23:21:32 -07004372#line 1969 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004373 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004374 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[(4) - (5)].a_constr), 0);
Lev Walkin418298d2006-07-13 08:24:20 +00004375 }
4376 break;
4377
Lev Walkin752e9732017-08-04 02:06:22 -07004378 case 255:
Lev Walkine700b202017-08-06 23:21:32 -07004379#line 1975 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004380 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004381 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004382 }
4383 break;
4384
Lev Walkin752e9732017-08-04 02:06:22 -07004385 case 256:
Lev Walkine700b202017-08-06 23:21:32 -07004386#line 1978 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004387 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004388 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 +00004389 }
4390 break;
4391
Lev Walkin752e9732017-08-04 02:06:22 -07004392 case 257:
Lev Walkine700b202017-08-06 23:21:32 -07004393#line 1984 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004394 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004395 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004396 checkmem((yyval.a_constr));
4397 (yyval.a_constr)->type = ACT_EL_EXT;
4398 (yyval.a_constr)->value = asn1p_value_frombuf("...", 3, 1);
Lev Walkin418298d2006-07-13 08:24:20 +00004399 }
4400 break;
4401
Lev Walkin752e9732017-08-04 02:06:22 -07004402 case 258:
Lev Walkine700b202017-08-06 23:21:32 -07004403#line 1990 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004404 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004405 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004406 checkmem((yyval.a_constr));
4407 (yyval.a_constr)->type = ACT_EL_VALUE;
4408 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(1) - (3)].tv_str), strlen((yyvsp[(1) - (3)].tv_str)), 0);
4409 (yyval.a_constr)->presence = (yyvsp[(3) - (3)].a_pres);
4410 if((yyvsp[(2) - (3)].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[(2) - (3)].a_constr));
Lev Walkin418298d2006-07-13 08:24:20 +00004411 }
4412 break;
4413
Lev Walkin752e9732017-08-04 02:06:22 -07004414 case 259:
Lev Walkine700b202017-08-06 23:21:32 -07004415#line 2004 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004416 { (yyval.a_pres) = ACPRES_DEFAULT; }
4417 break;
4418
Lev Walkin752e9732017-08-04 02:06:22 -07004419 case 260:
Lev Walkine700b202017-08-06 23:21:32 -07004420#line 2005 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004421 { (yyval.a_pres) = (yyvsp[(1) - (1)].a_pres); }
4422 break;
4423
Lev Walkin752e9732017-08-04 02:06:22 -07004424 case 261:
Lev Walkine700b202017-08-06 23:21:32 -07004425#line 2009 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004426 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004427 (yyval.a_pres) = ACPRES_PRESENT;
Lev Walkin418298d2006-07-13 08:24:20 +00004428 }
4429 break;
4430
Lev Walkin752e9732017-08-04 02:06:22 -07004431 case 262:
Lev Walkine700b202017-08-06 23:21:32 -07004432#line 2012 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004433 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004434 (yyval.a_pres) = ACPRES_ABSENT;
Lev Walkin418298d2006-07-13 08:24:20 +00004435 }
4436 break;
4437
Lev Walkin752e9732017-08-04 02:06:22 -07004438 case 263:
Lev Walkine700b202017-08-06 23:21:32 -07004439#line 2015 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004440 {
4441 (yyval.a_pres) = ACPRES_OPTIONAL;
4442 }
Lev Walkina9532f42006-09-17 04:52:50 +00004443 break;
4444
Lev Walkin752e9732017-08-04 02:06:22 -07004445 case 267:
Lev Walkine700b202017-08-06 23:21:32 -07004446#line 2030 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004447 { asn1p_lexer_hack_push_opaque_state(); }
Lev Walkin418298d2006-07-13 08:24:20 +00004448 break;
4449
Lev Walkin752e9732017-08-04 02:06:22 -07004450 case 268:
Lev Walkine700b202017-08-06 23:21:32 -07004451#line 2030 "asn1p_y.y"
Lev Walkina9532f42006-09-17 04:52:50 +00004452 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004453 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004454 checkmem((yyval.a_constr));
4455 (yyval.a_constr)->type = ACT_CT_CTDBY;
4456 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[(5) - (5)].tv_opaque).buf, (yyvsp[(5) - (5)].tv_opaque).len, 0);
4457 checkmem((yyval.a_constr)->value);
4458 (yyval.a_constr)->value->type = ATV_UNPARSED;
Lev Walkina9532f42006-09-17 04:52:50 +00004459 }
4460 break;
4461
Lev Walkin752e9732017-08-04 02:06:22 -07004462 case 269:
Lev Walkine700b202017-08-06 23:21:32 -07004463#line 2041 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004464 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004465 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004466 (yyval.a_constr)->type = ACT_CT_CTNG;
4467 (yyval.a_constr)->value = asn1p_value_fromtype((yyvsp[(2) - (2)].a_expr));
Bi-Ruei, Chiu3dcf05b2017-05-04 21:45:05 +08004468 asn1p_expr_free((yyvsp[(2) - (2)].a_expr));
Lev Walkin4a4543f2006-10-13 12:37:39 +00004469 }
4470 break;
4471
Lev Walkin752e9732017-08-04 02:06:22 -07004472 case 270:
Lev Walkine700b202017-08-06 23:21:32 -07004473#line 2050 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004474 { (yyval.a_ctype) = ACT_EL_RANGE; }
4475 break;
4476
Lev Walkin752e9732017-08-04 02:06:22 -07004477 case 271:
Lev Walkine700b202017-08-06 23:21:32 -07004478#line 2051 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004479 { (yyval.a_ctype) = ACT_EL_RLRANGE; }
4480 break;
4481
Lev Walkin752e9732017-08-04 02:06:22 -07004482 case 272:
Lev Walkine700b202017-08-06 23:21:32 -07004483#line 2052 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004484 { (yyval.a_ctype) = ACT_EL_LLRANGE; }
4485 break;
4486
Lev Walkin752e9732017-08-04 02:06:22 -07004487 case 273:
Lev Walkine700b202017-08-06 23:21:32 -07004488#line 2053 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004489 { (yyval.a_ctype) = ACT_EL_ULRANGE; }
4490 break;
4491
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004492 case 274:
Lev Walkine700b202017-08-06 23:21:32 -07004493#line 2056 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004494 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004495 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
Lev Walkin418298d2006-07-13 08:24:20 +00004496 }
4497 break;
4498
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004499 case 275:
Lev Walkine700b202017-08-06 23:21:32 -07004500#line 2059 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004501 {
4502 (yyval.a_constr) = (yyvsp[(1) - (1)].a_constr);
4503 }
4504 break;
4505
4506 case 276:
Lev Walkine700b202017-08-06 23:21:32 -07004507#line 2068 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004508 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004509 asn1p_ref_t *ref = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004510 asn1p_constraint_t *ct;
4511 int ret;
4512 ret = asn1p_ref_add_component(ref, (yyvsp[(2) - (3)].tv_str), 0);
4513 checkmem(ret == 0);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004514 ct = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004515 checkmem((yyval.a_constr));
4516 ct->type = ACT_EL_VALUE;
4517 ct->value = asn1p_value_fromref(ref, 0);
4518 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004519 free((yyvsp[(2) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004520 }
4521 break;
4522
Lev Walkin752e9732017-08-04 02:06:22 -07004523 case 277:
Lev Walkine700b202017-08-06 23:21:32 -07004524#line 2084 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004525 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004526 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 +00004527 }
4528 break;
4529
Lev Walkin752e9732017-08-04 02:06:22 -07004530 case 278:
Lev Walkine700b202017-08-06 23:21:32 -07004531#line 2090 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004532 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004533 (yyval.a_constr) = asn1p_constraint_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004534 checkmem((yyval.a_constr));
4535 (yyval.a_constr)->type = ACT_EL_VALUE;
4536 (yyval.a_constr)->value = asn1p_value_fromref((yyvsp[(1) - (1)].a_ref), 0);
4537 }
4538 break;
4539
Lev Walkin752e9732017-08-04 02:06:22 -07004540 case 279:
Lev Walkine700b202017-08-06 23:21:32 -07004541#line 2096 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004542 {
Lev Walkinf15320b2004-06-03 03:38:44 +00004543 asn1p_constraint_t *ct;
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004544 ct = asn1p_constraint_new(yylineno, currentModule);
Lev Walkinf15320b2004-06-03 03:38:44 +00004545 checkmem(ct);
4546 ct->type = ACT_EL_VALUE;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004547 ct->value = asn1p_value_fromref((yyvsp[(3) - (3)].a_ref), 0);
4548 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[(1) - (3)].a_constr), ct);
Lev Walkin418298d2006-07-13 08:24:20 +00004549 }
4550 break;
4551
Lev Walkin752e9732017-08-04 02:06:22 -07004552 case 280:
Lev Walkine700b202017-08-06 23:21:32 -07004553#line 2110 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004554 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004555 char *p = malloc(strlen((yyvsp[(2) - (2)].tv_str)) + 2);
Lev Walkinf15320b2004-06-03 03:38:44 +00004556 int ret;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004557 *p = '@';
4558 strcpy(p + 1, (yyvsp[(2) - (2)].tv_str));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004559 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004560 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
Lev Walkinf15320b2004-06-03 03:38:44 +00004561 checkmem(ret == 0);
4562 free(p);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004563 free((yyvsp[(2) - (2)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004564 }
4565 break;
4566
Lev Walkin752e9732017-08-04 02:06:22 -07004567 case 281:
Lev Walkine700b202017-08-06 23:21:32 -07004568#line 2121 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004569 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004570 char *p = malloc(strlen((yyvsp[(3) - (3)].tv_str)) + 3);
4571 int ret;
4572 p[0] = '@';
4573 p[1] = '.';
4574 strcpy(p + 2, (yyvsp[(3) - (3)].tv_str));
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004575 (yyval.a_ref) = asn1p_ref_new(yylineno, currentModule);
Lev Walkin0e90aa02013-03-19 16:17:13 -07004576 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
4577 checkmem(ret == 0);
4578 free(p);
4579 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004580 }
4581 break;
4582
Lev Walkin752e9732017-08-04 02:06:22 -07004583 case 282:
Lev Walkine700b202017-08-06 23:21:32 -07004584#line 2137 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004585 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004586 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin418298d2006-07-13 08:24:20 +00004587 }
4588 break;
4589
Lev Walkin752e9732017-08-04 02:06:22 -07004590 case 283:
Lev Walkine700b202017-08-06 23:21:32 -07004591#line 2140 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004592 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004593 int l1 = strlen((yyvsp[(1) - (3)].tv_str));
4594 int l3 = strlen((yyvsp[(3) - (3)].tv_str));
4595 (yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
4596 memcpy((yyval.tv_str), (yyvsp[(1) - (3)].tv_str), l1);
4597 (yyval.tv_str)[l1] = '.';
4598 memcpy((yyval.tv_str) + l1 + 1, (yyvsp[(3) - (3)].tv_str), l3);
4599 (yyval.tv_str)[l1 + 1 + l3] = '\0';
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004600 free((yyvsp[(1) - (3)].tv_str));
4601 free((yyvsp[(3) - (3)].tv_str));
Lev Walkin418298d2006-07-13 08:24:20 +00004602 }
4603 break;
4604
Lev Walkin752e9732017-08-04 02:06:22 -07004605 case 284:
Lev Walkine700b202017-08-06 23:21:32 -07004606#line 2160 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004607 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004608 (yyval.a_marker).flags = EM_NOMARK;
4609 (yyval.a_marker).default_value = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00004610 }
4611 break;
4612
Lev Walkin752e9732017-08-04 02:06:22 -07004613 case 285:
Lev Walkine700b202017-08-06 23:21:32 -07004614#line 2164 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004615 { (yyval.a_marker) = (yyvsp[(1) - (1)].a_marker); }
4616 break;
4617
Lev Walkin752e9732017-08-04 02:06:22 -07004618 case 286:
Lev Walkine700b202017-08-06 23:21:32 -07004619#line 2168 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004620 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004621 (yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
4622 (yyval.a_marker).default_value = 0;
Lev Walkin418298d2006-07-13 08:24:20 +00004623 }
4624 break;
4625
Lev Walkin752e9732017-08-04 02:06:22 -07004626 case 287:
Lev Walkine700b202017-08-06 23:21:32 -07004627#line 2172 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004628 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004629 (yyval.a_marker).flags = EM_DEFAULT;
4630 (yyval.a_marker).default_value = (yyvsp[(2) - (2)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004631 }
4632 break;
4633
Lev Walkin752e9732017-08-04 02:06:22 -07004634 case 288:
Lev Walkine700b202017-08-06 23:21:32 -07004635#line 2195 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004636 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004637 (yyval.a_expr) = NEW_EXPR();
4638 checkmem((yyval.a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004639 }
4640 break;
4641
Lev Walkin752e9732017-08-04 02:06:22 -07004642 case 289:
Lev Walkine700b202017-08-06 23:21:32 -07004643#line 2199 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004644 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004645 (yyval.a_expr) = (yyvsp[(2) - (3)].a_expr);
Lev Walkin418298d2006-07-13 08:24:20 +00004646 }
4647 break;
4648
Lev Walkin752e9732017-08-04 02:06:22 -07004649 case 290:
Lev Walkine700b202017-08-06 23:21:32 -07004650#line 2205 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004651 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004652 (yyval.a_expr) = NEW_EXPR();
4653 checkmem((yyval.a_expr));
4654 asn1p_expr_add((yyval.a_expr), (yyvsp[(1) - (1)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004655 }
4656 break;
4657
Lev Walkin752e9732017-08-04 02:06:22 -07004658 case 291:
Lev Walkine700b202017-08-06 23:21:32 -07004659#line 2210 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004660 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004661 (yyval.a_expr) = (yyvsp[(1) - (3)].a_expr);
4662 asn1p_expr_add((yyval.a_expr), (yyvsp[(3) - (3)].a_expr));
Lev Walkin418298d2006-07-13 08:24:20 +00004663 }
4664 break;
4665
Lev Walkin752e9732017-08-04 02:06:22 -07004666 case 292:
Lev Walkine700b202017-08-06 23:21:32 -07004667#line 2217 "asn1p_y.y"
Lev Walkin4a4543f2006-10-13 12:37:39 +00004668 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004669 (yyval.a_expr) = NEW_EXPR();
4670 checkmem((yyval.a_expr));
4671 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4672 (yyval.a_expr)->meta_type = AMT_VALUE;
4673 (yyval.a_expr)->Identifier = (yyvsp[(1) - (1)].tv_str);
Lev Walkin4a4543f2006-10-13 12:37:39 +00004674 }
4675 break;
4676
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004677 case 293:
Lev Walkine700b202017-08-06 23:21:32 -07004678#line 2224 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004679 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004680 (yyval.a_expr) = NEW_EXPR();
4681 checkmem((yyval.a_expr));
4682 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4683 (yyval.a_expr)->meta_type = AMT_VALUE;
4684 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4685 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004686 }
4687 break;
4688
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004689 case 294:
Lev Walkine700b202017-08-06 23:21:32 -07004690#line 2232 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004691 {
4692 (yyval.a_expr) = NEW_EXPR();
4693 checkmem((yyval.a_expr));
4694 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4695 (yyval.a_expr)->meta_type = AMT_VALUE;
4696 (yyval.a_expr)->Identifier = (yyvsp[(1) - (4)].tv_str);
4697 (yyval.a_expr)->value = (yyvsp[(3) - (4)].a_value);
4698 }
4699 break;
4700
4701 case 295:
Lev Walkine700b202017-08-06 23:21:32 -07004702#line 2240 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004703 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004704 (yyval.a_expr) = NEW_EXPR();
4705 checkmem((yyval.a_expr));
4706 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4707 (yyval.a_expr)->meta_type = AMT_VALUE;
4708 (yyval.a_expr)->value = (yyvsp[(1) - (1)].a_value);
Lev Walkin418298d2006-07-13 08:24:20 +00004709 }
4710 break;
4711
Lev Walkin752e9732017-08-04 02:06:22 -07004712 case 296:
Lev Walkine700b202017-08-06 23:21:32 -07004713#line 2247 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004714 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004715 (yyval.a_expr) = NEW_EXPR();
4716 checkmem((yyval.a_expr));
4717 (yyval.a_expr)->Identifier = strdup("...");
4718 checkmem((yyval.a_expr)->Identifier);
4719 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
4720 (yyval.a_expr)->meta_type = AMT_VALUE;
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004721 }
4722 break;
4723
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004724 case 297:
Lev Walkine700b202017-08-06 23:21:32 -07004725#line 2258 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004726 {
4727 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4728 checkmem((yyval.a_value));
4729 }
4730 break;
4731
Lev Walkin752e9732017-08-04 02:06:22 -07004732 case 298:
Lev Walkine700b202017-08-06 23:21:32 -07004733#line 2262 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004734 {
4735 (yyval.a_value) = asn1p_value_fromint((yyvsp[(1) - (1)].a_int));
4736 checkmem((yyval.a_value));
4737 }
4738 break;
4739
4740 case 300:
Lev Walkine700b202017-08-06 23:21:32 -07004741#line 2270 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004742 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004743 (yyval.a_value) = asn1p_value_fromdouble((yyvsp[(1) - (1)].a_dbl));
4744 checkmem((yyval.a_value));
Lev Walkin418298d2006-07-13 08:24:20 +00004745 }
4746 break;
4747
Lev Walkin752e9732017-08-04 02:06:22 -07004748 case 301:
Lev Walkine700b202017-08-06 23:21:32 -07004749#line 2301 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004750 { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
4751 break;
4752
Lev Walkin752e9732017-08-04 02:06:22 -07004753 case 302:
Lev Walkine700b202017-08-06 23:21:32 -07004754#line 2302 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004755 { (yyval.a_tag) = (yyvsp[(1) - (1)].a_tag); }
4756 break;
4757
Lev Walkin752e9732017-08-04 02:06:22 -07004758 case 303:
Lev Walkine700b202017-08-06 23:21:32 -07004759#line 2306 "asn1p_y.y"
Lev Walkin418298d2006-07-13 08:24:20 +00004760 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004761 (yyval.a_tag) = (yyvsp[(1) - (2)].a_tag);
4762 (yyval.a_tag).tag_mode = (yyvsp[(2) - (2)].a_tag).tag_mode;
Lev Walkin418298d2006-07-13 08:24:20 +00004763 }
4764 break;
4765
Lev Walkin752e9732017-08-04 02:06:22 -07004766 case 304:
Lev Walkine700b202017-08-06 23:21:32 -07004767#line 2313 "asn1p_y.y"
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004768 {
Lev Walkin0e90aa02013-03-19 16:17:13 -07004769 (yyval.a_tag) = (yyvsp[(2) - (4)].a_tag);
4770 (yyval.a_tag).tag_value = (yyvsp[(3) - (4)].a_int);
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004771 }
Lev Walkin5c541f12006-10-18 18:40:14 +00004772 break;
4773
Lev Walkin752e9732017-08-04 02:06:22 -07004774 case 305:
Lev Walkine700b202017-08-06 23:21:32 -07004775#line 2319 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004776 { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
4777 break;
4778
Lev Walkin752e9732017-08-04 02:06:22 -07004779 case 306:
Lev Walkine700b202017-08-06 23:21:32 -07004780#line 2320 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004781 { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
4782 break;
4783
Lev Walkin752e9732017-08-04 02:06:22 -07004784 case 307:
Lev Walkine700b202017-08-06 23:21:32 -07004785#line 2321 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004786 { (yyval.a_tag).tag_class = TC_APPLICATION; }
4787 break;
4788
Lev Walkin752e9732017-08-04 02:06:22 -07004789 case 308:
Lev Walkine700b202017-08-06 23:21:32 -07004790#line 2322 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004791 { (yyval.a_tag).tag_class = TC_PRIVATE; }
4792 break;
4793
Lev Walkin752e9732017-08-04 02:06:22 -07004794 case 309:
Lev Walkine700b202017-08-06 23:21:32 -07004795#line 2326 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004796 { (yyval.a_tag).tag_mode = TM_DEFAULT; }
4797 break;
4798
Lev Walkin752e9732017-08-04 02:06:22 -07004799 case 310:
Lev Walkine700b202017-08-06 23:21:32 -07004800#line 2327 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004801 { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
4802 break;
4803
Lev Walkin752e9732017-08-04 02:06:22 -07004804 case 311:
Lev Walkine700b202017-08-06 23:21:32 -07004805#line 2328 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004806 { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
4807 break;
4808
Lev Walkin1c8d5aa2006-10-27 05:37:39 +00004809 case 312:
Lev Walkine700b202017-08-06 23:21:32 -07004810#line 2332 "asn1p_y.y"
Lev Walkin866bd7f2006-09-14 10:35:20 +00004811 {
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004812 checkmem((yyvsp[(1) - (1)].tv_str));
Lev Walkin0e90aa02013-03-19 16:17:13 -07004813 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4814 }
4815 break;
4816
4817 case 313:
Lev Walkine700b202017-08-06 23:21:32 -07004818#line 2336 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004819 {
4820 checkmem((yyvsp[(1) - (1)].tv_str));
4821 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4822 }
4823 break;
4824
4825 case 314:
Lev Walkine700b202017-08-06 23:21:32 -07004826#line 2344 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004827 {
4828 checkmem((yyvsp[(1) - (1)].tv_str));
4829 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4830 }
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004831 break;
4832
4833 case 315:
Lev Walkine700b202017-08-06 23:21:32 -07004834#line 2351 "asn1p_y.y"
Lev Walkin752e9732017-08-04 02:06:22 -07004835 { (yyval.tv_str) = 0; }
4836 break;
4837
4838 case 316:
Lev Walkine700b202017-08-06 23:21:32 -07004839#line 2352 "asn1p_y.y"
Bi-Ruei, Chiu80fd3062017-05-07 21:00:51 +08004840 {
4841 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
4842 }
4843 break;
4844
Lev Walkin752e9732017-08-04 02:06:22 -07004845 case 317:
Lev Walkine700b202017-08-06 23:21:32 -07004846#line 2358 "asn1p_y.y"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004847 {
4848 checkmem((yyvsp[(1) - (1)].tv_str));
4849 (yyval.tv_str) = (yyvsp[(1) - (1)].tv_str);
Lev Walkin866bd7f2006-09-14 10:35:20 +00004850 }
4851 break;
4852
Lev Walkin418298d2006-07-13 08:24:20 +00004853
Lev Walkin752e9732017-08-04 02:06:22 -07004854/* Line 1267 of yacc.c. */
4855#line 4856 "asn1p_y.c"
Lev Walkin0e90aa02013-03-19 16:17:13 -07004856 default: break;
Lev Walkin418298d2006-07-13 08:24:20 +00004857 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07004858 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Lev Walkin418298d2006-07-13 08:24:20 +00004859
Lev Walkin0e90aa02013-03-19 16:17:13 -07004860 YYPOPSTACK (yylen);
4861 yylen = 0;
4862 YY_STACK_PRINT (yyss, yyssp);
Lev Walkinf15320b2004-06-03 03:38:44 +00004863
4864 *++yyvsp = yyval;
4865
Lev Walkin752e9732017-08-04 02:06:22 -07004866
Lev Walkin418298d2006-07-13 08:24:20 +00004867 /* Now `shift' the result of the reduction. Determine what state
4868 that goes to, based on the state we popped back to and the rule
4869 number reduced by. */
Lev Walkinf15320b2004-06-03 03:38:44 +00004870
4871 yyn = yyr1[yyn];
4872
Lev Walkin418298d2006-07-13 08:24:20 +00004873 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4874 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
Lev Walkinf15320b2004-06-03 03:38:44 +00004875 yystate = yytable[yystate];
4876 else
Lev Walkin418298d2006-07-13 08:24:20 +00004877 yystate = yydefgoto[yyn - YYNTOKENS];
Lev Walkinf15320b2004-06-03 03:38:44 +00004878
4879 goto yynewstate;
4880
Lev Walkinf15320b2004-06-03 03:38:44 +00004881
Lev Walkin418298d2006-07-13 08:24:20 +00004882/*------------------------------------.
4883| yyerrlab -- here on detecting error |
4884`------------------------------------*/
4885yyerrlab:
4886 /* If not already recovering from an error, report this error. */
4887 if (!yyerrstatus)
Lev Walkinf15320b2004-06-03 03:38:44 +00004888 {
4889 ++yynerrs;
Lev Walkin0e90aa02013-03-19 16:17:13 -07004890#if ! YYERROR_VERBOSE
4891 yyerror (YY_("syntax error"));
4892#else
4893 {
Lev Walkin752e9732017-08-04 02:06:22 -07004894 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4895 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4896 {
4897 YYSIZE_T yyalloc = 2 * yysize;
4898 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4899 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4900 if (yymsg != yymsgbuf)
4901 YYSTACK_FREE (yymsg);
4902 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4903 if (yymsg)
4904 yymsg_alloc = yyalloc;
4905 else
4906 {
4907 yymsg = yymsgbuf;
4908 yymsg_alloc = sizeof yymsgbuf;
4909 }
4910 }
4911
4912 if (0 < yysize && yysize <= yymsg_alloc)
4913 {
4914 (void) yysyntax_error (yymsg, yystate, yychar);
4915 yyerror (yymsg);
4916 }
4917 else
4918 {
4919 yyerror (YY_("syntax error"));
4920 if (yysize != 0)
4921 goto yyexhaustedlab;
4922 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07004923 }
4924#endif
4925 }
4926
4927
4928
4929 if (yyerrstatus == 3)
4930 {
Lev Walkin752e9732017-08-04 02:06:22 -07004931 /* If just tried and failed to reuse look-ahead token after an
Lev Walkin0e90aa02013-03-19 16:17:13 -07004932 error, discard it. */
4933
4934 if (yychar <= YYEOF)
4935 {
4936 /* Return failure if at end of input. */
4937 if (yychar == YYEOF)
4938 YYABORT;
Lev Walkinf15320b2004-06-03 03:38:44 +00004939 }
4940 else
Lev Walkin0e90aa02013-03-19 16:17:13 -07004941 {
4942 yydestruct ("Error: discarding",
4943 yytoken, &yylval);
4944 yychar = YYEMPTY;
4945 }
Lev Walkinf15320b2004-06-03 03:38:44 +00004946 }
Lev Walkin0e90aa02013-03-19 16:17:13 -07004947
Lev Walkin752e9732017-08-04 02:06:22 -07004948 /* Else will try to reuse look-ahead token after shifting the error
Lev Walkin0e90aa02013-03-19 16:17:13 -07004949 token. */
Lev Walkina00d6b32006-03-21 03:40:38 +00004950 goto yyerrlab1;
Lev Walkinf15320b2004-06-03 03:38:44 +00004951
Lev Walkin418298d2006-07-13 08:24:20 +00004952
Lev Walkin0e90aa02013-03-19 16:17:13 -07004953/*---------------------------------------------------.
4954| yyerrorlab -- error raised explicitly by YYERROR. |
4955`---------------------------------------------------*/
4956yyerrorlab:
4957
4958 /* Pacify compilers like GCC when the user code never invokes
4959 YYERROR and the label yyerrorlab therefore never appears in user
4960 code. */
4961 if (/*CONSTCOND*/ 0)
4962 goto yyerrorlab;
4963
4964 /* Do not reclaim the symbols of the rule which action triggered
4965 this YYERROR. */
4966 YYPOPSTACK (yylen);
4967 yylen = 0;
4968 YY_STACK_PRINT (yyss, yyssp);
4969 yystate = *yyssp;
4970 goto yyerrlab1;
4971
4972
4973/*-------------------------------------------------------------.
4974| yyerrlab1 -- common code for both syntax error and YYERROR. |
4975`-------------------------------------------------------------*/
Lev Walkin418298d2006-07-13 08:24:20 +00004976yyerrlab1:
Lev Walkin418298d2006-07-13 08:24:20 +00004977 yyerrstatus = 3; /* Each real token shifted decrements this. */
Lev Walkina00d6b32006-03-21 03:40:38 +00004978
Lev Walkin418298d2006-07-13 08:24:20 +00004979 for (;;)
Lev Walkina00d6b32006-03-21 03:40:38 +00004980 {
Lev Walkin418298d2006-07-13 08:24:20 +00004981 yyn = yypact[yystate];
Lev Walkin752e9732017-08-04 02:06:22 -07004982 if (yyn != YYPACT_NINF)
Lev Walkin418298d2006-07-13 08:24:20 +00004983 {
4984 yyn += YYTERROR;
4985 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4986 {
4987 yyn = yytable[yyn];
4988 if (0 < yyn)
4989 break;
4990 }
4991 }
4992
4993 /* Pop the current state because it cannot handle the error token. */
4994 if (yyssp == yyss)
4995 YYABORT;
4996
Lev Walkin418298d2006-07-13 08:24:20 +00004997
Lev Walkin0e90aa02013-03-19 16:17:13 -07004998 yydestruct ("Error: popping",
4999 yystos[yystate], yyvsp);
5000 YYPOPSTACK (1);
5001 yystate = *yyssp;
5002 YY_STACK_PRINT (yyss, yyssp);
Lev Walkina00d6b32006-03-21 03:40:38 +00005003 }
Lev Walkina00d6b32006-03-21 03:40:38 +00005004
Lev Walkin752e9732017-08-04 02:06:22 -07005005 if (yyn == YYFINAL)
5006 YYACCEPT;
5007
Lev Walkinf15320b2004-06-03 03:38:44 +00005008 *++yyvsp = yylval;
Lev Walkin418298d2006-07-13 08:24:20 +00005009
Lev Walkinf15320b2004-06-03 03:38:44 +00005010
Lev Walkin0e90aa02013-03-19 16:17:13 -07005011 /* Shift the error token. */
5012 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5013
Lev Walkinf15320b2004-06-03 03:38:44 +00005014 yystate = yyn;
5015 goto yynewstate;
5016
Lev Walkina00d6b32006-03-21 03:40:38 +00005017
Lev Walkin418298d2006-07-13 08:24:20 +00005018/*-------------------------------------.
5019| yyacceptlab -- YYACCEPT comes here. |
5020`-------------------------------------*/
5021yyacceptlab:
5022 yyresult = 0;
5023 goto yyreturn;
5024
5025/*-----------------------------------.
5026| yyabortlab -- YYABORT comes here. |
5027`-----------------------------------*/
5028yyabortlab:
5029 yyresult = 1;
5030 goto yyreturn;
5031
Lev Walkin752e9732017-08-04 02:06:22 -07005032#ifndef yyoverflow
Lev Walkin0e90aa02013-03-19 16:17:13 -07005033/*-------------------------------------------------.
5034| yyexhaustedlab -- memory exhaustion comes here. |
5035`-------------------------------------------------*/
5036yyexhaustedlab:
5037 yyerror (YY_("memory exhausted"));
Lev Walkin418298d2006-07-13 08:24:20 +00005038 yyresult = 2;
5039 /* Fall through. */
Lev Walkina00d6b32006-03-21 03:40:38 +00005040#endif
Lev Walkin418298d2006-07-13 08:24:20 +00005041
5042yyreturn:
Lev Walkin752e9732017-08-04 02:06:22 -07005043 if (yychar != YYEOF && yychar != YYEMPTY)
5044 yydestruct ("Cleanup: discarding lookahead",
5045 yytoken, &yylval);
Lev Walkin0e90aa02013-03-19 16:17:13 -07005046 /* Do not reclaim the symbols of the rule which action triggered
5047 this YYABORT or YYACCEPT. */
5048 YYPOPSTACK (yylen);
5049 YY_STACK_PRINT (yyss, yyssp);
5050 while (yyssp != yyss)
5051 {
5052 yydestruct ("Cleanup: popping",
5053 yystos[*yyssp], yyvsp);
5054 YYPOPSTACK (1);
5055 }
Lev Walkin418298d2006-07-13 08:24:20 +00005056#ifndef yyoverflow
5057 if (yyss != yyssa)
5058 YYSTACK_FREE (yyss);
5059#endif
Lev Walkin0e90aa02013-03-19 16:17:13 -07005060#if YYERROR_VERBOSE
5061 if (yymsg != yymsgbuf)
5062 YYSTACK_FREE (yymsg);
5063#endif
5064 /* Make sure YYID is used. */
5065 return YYID (yyresult);
Lev Walkinf15320b2004-06-03 03:38:44 +00005066}
Lev Walkin418298d2006-07-13 08:24:20 +00005067
5068
Lev Walkine700b202017-08-06 23:21:32 -07005069#line 2364 "asn1p_y.y"
Lev Walkinf15320b2004-06-03 03:38:44 +00005070
5071
5072
5073/*
5074 * Convert Xstring ('0101'B or '5'H) to the binary vector.
5075 */
5076static asn1p_value_t *
5077_convert_bitstring2binary(char *str, int base) {
5078 asn1p_value_t *val;
5079 int slen;
5080 int memlen;
5081 int baselen;
5082 int bits;
5083 uint8_t *binary_vector;
5084 uint8_t *bv_ptr;
5085 uint8_t cur_val;
5086
5087 assert(str);
5088 assert(str[0] == '\'');
5089
5090 switch(base) {
5091 case 'B':
5092 baselen = 1;
5093 break;
5094 case 'H':
5095 baselen = 4;
5096 break;
5097 default:
5098 assert(base == 'B' || base == 'H');
5099 errno = EINVAL;
5100 return NULL;
5101 }
5102
5103 slen = strlen(str);
5104 assert(str[slen - 1] == base);
5105 assert(str[slen - 2] == '\'');
5106
5107 memlen = slen / (8 / baselen); /* Conservative estimate */
5108
5109 bv_ptr = binary_vector = malloc(memlen + 1);
5110 if(bv_ptr == NULL)
5111 /* ENOMEM */
5112 return NULL;
5113
5114 cur_val = 0;
5115 bits = 0;
5116 while(*(++str) != '\'') {
5117 switch(baselen) {
5118 case 1:
5119 switch(*str) {
5120 case '1':
5121 cur_val |= 1 << (7 - (bits % 8));
5122 case '0':
5123 break;
5124 default:
5125 assert(!"_y UNREACH1");
5126 case ' ': case '\r': case '\n':
5127 continue;
5128 }
5129 break;
5130 case 4:
5131 switch(*str) {
5132 case '0': case '1': case '2': case '3': case '4':
5133 case '5': case '6': case '7': case '8': case '9':
5134 cur_val |= (*str - '0') << (4 - (bits % 8));
5135 break;
5136 case 'A': case 'B': case 'C':
5137 case 'D': case 'E': case 'F':
5138 cur_val |= ((*str - 'A') + 10)
5139 << (4 - (bits % 8));
5140 break;
5141 default:
5142 assert(!"_y UNREACH2");
5143 case ' ': case '\r': case '\n':
5144 continue;
5145 }
5146 break;
5147 }
5148
5149 bits += baselen;
5150 if((bits % 8) == 0) {
5151 *bv_ptr++ = cur_val;
5152 cur_val = 0;
5153 }
5154 }
5155
5156 *bv_ptr = cur_val;
5157 assert((bv_ptr - binary_vector) <= memlen);
5158
5159 val = asn1p_value_frombits(binary_vector, bits, 0);
5160 if(val == NULL) {
5161 free(binary_vector);
5162 }
5163
5164 return val;
5165}
5166
Lev Walkin2e9bd5c2005-08-13 09:07:11 +00005167/*
5168 * For unnamed types (used in old X.208 compliant modules)
5169 * generate some sort of interim names, to not to force human being to fix
5170 * the specification's compliance to modern ASN.1 standards.
5171 */
5172static void
5173_fixup_anonymous_identifier(asn1p_expr_t *expr) {
5174 char *p;
5175 assert(expr->Identifier == 0);
5176
5177 /*
5178 * Try to figure out the type name
5179 * without going too much into details
5180 */
5181 expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
5182 if(expr->reference && expr->reference->comp_count > 0)
5183 expr->Identifier = expr->reference->components[0].name;
5184
5185 fprintf(stderr,
5186 "WARNING: Line %d: expected lower-case member identifier, "
5187 "found an unnamed %s.\n"
5188 "WARNING: Obsolete X.208 syntax detected, "
5189 "please give the member a name.\n",
5190 yylineno, expr->Identifier ? expr->Identifier : "type");
5191
5192 if(!expr->Identifier)
5193 expr->Identifier = "unnamed";
5194 expr->Identifier = strdup(expr->Identifier);
5195 assert(expr->Identifier);
5196 /* Make a lowercase identifier from the type name */
5197 for(p = expr->Identifier; *p; p++) {
5198 switch(*p) {
5199 case 'A' ... 'Z': *p += 32; break;
5200 case ' ': *p = '_'; break;
5201 case '-': *p = '_'; break;
5202 }
5203 }
5204 fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
5205 "Name clash may occur later.\n",
5206 expr->Identifier);
5207}
5208
Lev Walkinf15320b2004-06-03 03:38:44 +00005209int
5210yyerror(const char *msg) {
Lev Walkin9d542d22006-03-14 16:31:37 +00005211 extern char *asn1p_text;
Lev Walkinf15320b2004-06-03 03:38:44 +00005212 fprintf(stderr,
5213 "ASN.1 grammar parse error "
5214 "near line %d (token \"%s\"): %s\n",
Lev Walkinceb20e72004-09-05 10:40:41 +00005215 yylineno, asn1p_text, msg);
Lev Walkinf15320b2004-06-03 03:38:44 +00005216 return -1;
5217}
5218
Lev Walkin752e9732017-08-04 02:06:22 -07005219