blob: 86481ff9c17bb8caad3829e4955eabc4b4d5a069 [file] [log] [blame]
vlm7e436752006-03-18 06:53:11 +00001/* A Bison parser, made by GNU Bison 2.1. */
vlmfa67ddc2004-06-03 03:38:44 +00002
vlm7e436752006-03-18 06:53:11 +00003/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
vlmfa67ddc2004-06-03 03:38:44 +00005
vlm7e436752006-03-18 06:53:11 +00006 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
vlmfa67ddc2004-06-03 03:38:44 +000010
vlm7e436752006-03-18 06:53:11 +000011 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
21/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26/* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36/* Identify Bison output. */
37#define YYBISON 1
38
39/* Bison version. */
40#define YYBISON_VERSION "2.1"
41
42/* Skeleton name. */
43#define YYSKELETON_NAME "yacc.c"
44
45/* Pure parsers. */
46#define YYPURE 0
47
48/* Using locations. */
49#define YYLSP_NEEDED 0
50
51/* Substitute the variable and function names. */
vlmfa67ddc2004-06-03 03:38:44 +000052#define yyparse asn1p_parse
vlm7e436752006-03-18 06:53:11 +000053#define yylex asn1p_lex
vlmfa67ddc2004-06-03 03:38:44 +000054#define yyerror asn1p_error
vlm7e436752006-03-18 06:53:11 +000055#define yylval asn1p_lval
56#define yychar asn1p_char
vlmfa67ddc2004-06-03 03:38:44 +000057#define yydebug asn1p_debug
58#define yynerrs asn1p_nerrs
vlmfa67ddc2004-06-03 03:38:44 +000059
vlm7e436752006-03-18 06:53:11 +000060
61/* Tokens. */
62#ifndef YYTOKENTYPE
63# define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
67 TOK_PPEQ = 258,
68 TOK_whitespace = 259,
69 TOK_opaque = 260,
70 TOK_bstring = 261,
71 TOK_cstring = 262,
72 TOK_hstring = 263,
73 TOK_identifier = 264,
74 TOK_number = 265,
75 TOK_tuple = 266,
76 TOK_quadruple = 267,
77 TOK_number_negative = 268,
78 TOK_typereference = 269,
79 TOK_capitalreference = 270,
80 TOK_typefieldreference = 271,
81 TOK_valuefieldreference = 272,
82 TOK_Literal = 273,
83 TOK_ABSENT = 274,
84 TOK_ABSTRACT_SYNTAX = 275,
85 TOK_ALL = 276,
86 TOK_ANY = 277,
87 TOK_APPLICATION = 278,
88 TOK_AUTOMATIC = 279,
89 TOK_BEGIN = 280,
90 TOK_BIT = 281,
91 TOK_BMPString = 282,
92 TOK_BOOLEAN = 283,
93 TOK_BY = 284,
94 TOK_CHARACTER = 285,
95 TOK_CHOICE = 286,
96 TOK_CLASS = 287,
97 TOK_COMPONENT = 288,
98 TOK_COMPONENTS = 289,
99 TOK_CONSTRAINED = 290,
100 TOK_CONTAINING = 291,
101 TOK_DEFAULT = 292,
102 TOK_DEFINITIONS = 293,
103 TOK_DEFINED = 294,
104 TOK_EMBEDDED = 295,
105 TOK_ENCODED = 296,
106 TOK_ENCODING_CONTROL = 297,
107 TOK_END = 298,
108 TOK_ENUMERATED = 299,
109 TOK_EXPLICIT = 300,
110 TOK_EXPORTS = 301,
111 TOK_EXTENSIBILITY = 302,
112 TOK_EXTERNAL = 303,
113 TOK_FALSE = 304,
114 TOK_FROM = 305,
115 TOK_GeneralizedTime = 306,
116 TOK_GeneralString = 307,
117 TOK_GraphicString = 308,
118 TOK_IA5String = 309,
119 TOK_IDENTIFIER = 310,
120 TOK_IMPLICIT = 311,
121 TOK_IMPLIED = 312,
122 TOK_IMPORTS = 313,
123 TOK_INCLUDES = 314,
124 TOK_INSTANCE = 315,
125 TOK_INSTRUCTIONS = 316,
126 TOK_INTEGER = 317,
127 TOK_ISO646String = 318,
128 TOK_MAX = 319,
129 TOK_MIN = 320,
130 TOK_MINUS_INFINITY = 321,
131 TOK_NULL = 322,
132 TOK_NumericString = 323,
133 TOK_OBJECT = 324,
134 TOK_ObjectDescriptor = 325,
135 TOK_OCTET = 326,
136 TOK_OF = 327,
137 TOK_OPTIONAL = 328,
138 TOK_PATTERN = 329,
139 TOK_PDV = 330,
140 TOK_PLUS_INFINITY = 331,
141 TOK_PRESENT = 332,
142 TOK_PrintableString = 333,
143 TOK_PRIVATE = 334,
144 TOK_REAL = 335,
145 TOK_RELATIVE_OID = 336,
146 TOK_SEQUENCE = 337,
147 TOK_SET = 338,
148 TOK_SIZE = 339,
149 TOK_STRING = 340,
150 TOK_SYNTAX = 341,
151 TOK_T61String = 342,
152 TOK_TAGS = 343,
153 TOK_TeletexString = 344,
154 TOK_TRUE = 345,
155 TOK_TYPE_IDENTIFIER = 346,
156 TOK_UNIQUE = 347,
157 TOK_UNIVERSAL = 348,
158 TOK_UniversalString = 349,
159 TOK_UTCTime = 350,
160 TOK_UTF8String = 351,
161 TOK_VideotexString = 352,
162 TOK_VisibleString = 353,
163 TOK_WITH = 354,
164 TOK_EXCEPT = 355,
165 TOK_INTERSECTION = 356,
166 TOK_UNION = 357,
167 TOK_TwoDots = 358,
168 TOK_ThreeDots = 359
169 };
170#endif
171/* Tokens. */
172#define TOK_PPEQ 258
173#define TOK_whitespace 259
174#define TOK_opaque 260
175#define TOK_bstring 261
176#define TOK_cstring 262
177#define TOK_hstring 263
178#define TOK_identifier 264
179#define TOK_number 265
180#define TOK_tuple 266
181#define TOK_quadruple 267
182#define TOK_number_negative 268
183#define TOK_typereference 269
184#define TOK_capitalreference 270
185#define TOK_typefieldreference 271
186#define TOK_valuefieldreference 272
187#define TOK_Literal 273
188#define TOK_ABSENT 274
189#define TOK_ABSTRACT_SYNTAX 275
190#define TOK_ALL 276
191#define TOK_ANY 277
192#define TOK_APPLICATION 278
193#define TOK_AUTOMATIC 279
194#define TOK_BEGIN 280
195#define TOK_BIT 281
196#define TOK_BMPString 282
197#define TOK_BOOLEAN 283
198#define TOK_BY 284
199#define TOK_CHARACTER 285
200#define TOK_CHOICE 286
201#define TOK_CLASS 287
202#define TOK_COMPONENT 288
203#define TOK_COMPONENTS 289
204#define TOK_CONSTRAINED 290
205#define TOK_CONTAINING 291
206#define TOK_DEFAULT 292
207#define TOK_DEFINITIONS 293
208#define TOK_DEFINED 294
209#define TOK_EMBEDDED 295
210#define TOK_ENCODED 296
211#define TOK_ENCODING_CONTROL 297
212#define TOK_END 298
213#define TOK_ENUMERATED 299
214#define TOK_EXPLICIT 300
215#define TOK_EXPORTS 301
216#define TOK_EXTENSIBILITY 302
217#define TOK_EXTERNAL 303
218#define TOK_FALSE 304
219#define TOK_FROM 305
220#define TOK_GeneralizedTime 306
221#define TOK_GeneralString 307
222#define TOK_GraphicString 308
223#define TOK_IA5String 309
224#define TOK_IDENTIFIER 310
225#define TOK_IMPLICIT 311
226#define TOK_IMPLIED 312
227#define TOK_IMPORTS 313
228#define TOK_INCLUDES 314
229#define TOK_INSTANCE 315
230#define TOK_INSTRUCTIONS 316
231#define TOK_INTEGER 317
232#define TOK_ISO646String 318
233#define TOK_MAX 319
234#define TOK_MIN 320
235#define TOK_MINUS_INFINITY 321
236#define TOK_NULL 322
237#define TOK_NumericString 323
238#define TOK_OBJECT 324
239#define TOK_ObjectDescriptor 325
240#define TOK_OCTET 326
241#define TOK_OF 327
242#define TOK_OPTIONAL 328
243#define TOK_PATTERN 329
244#define TOK_PDV 330
245#define TOK_PLUS_INFINITY 331
246#define TOK_PRESENT 332
247#define TOK_PrintableString 333
248#define TOK_PRIVATE 334
249#define TOK_REAL 335
250#define TOK_RELATIVE_OID 336
251#define TOK_SEQUENCE 337
252#define TOK_SET 338
253#define TOK_SIZE 339
254#define TOK_STRING 340
255#define TOK_SYNTAX 341
256#define TOK_T61String 342
257#define TOK_TAGS 343
258#define TOK_TeletexString 344
259#define TOK_TRUE 345
260#define TOK_TYPE_IDENTIFIER 346
261#define TOK_UNIQUE 347
262#define TOK_UNIVERSAL 348
263#define TOK_UniversalString 349
264#define TOK_UTCTime 350
265#define TOK_UTF8String 351
266#define TOK_VideotexString 352
267#define TOK_VisibleString 353
268#define TOK_WITH 354
269#define TOK_EXCEPT 355
270#define TOK_INTERSECTION 356
271#define TOK_UNION 357
272#define TOK_TwoDots 358
273#define TOK_ThreeDots 359
274
275
276
277
278/* Copy the first part of user declarations. */
vlmfa67ddc2004-06-03 03:38:44 +0000279#line 1 "asn1p_y.y"
280
281
282#include <stdlib.h>
283#include <stdio.h>
284#include <string.h>
285#include <errno.h>
286#include <assert.h>
287
288#include "asn1parser.h"
289
290#define YYPARSE_PARAM param
vlm03630c52005-06-07 21:43:32 +0000291#define YYPARSE_PARAM_TYPE void **
vlmfa67ddc2004-06-03 03:38:44 +0000292#define YYERROR_VERBOSE
293
294int yylex(void);
295int yyerror(const char *msg);
vlm03630c52005-06-07 21:43:32 +0000296#ifdef YYBYACC
297int yyparse(void **param); /* byacc does not produce a prototype */
298#endif
vlmfa67ddc2004-06-03 03:38:44 +0000299void asn1p_lexer_hack_push_opaque_state(void);
300void asn1p_lexer_hack_enable_with_syntax(void);
vlm9283dbe2004-08-18 04:59:12 +0000301void asn1p_lexer_hack_push_encoding_control(void);
vlmfa67ddc2004-06-03 03:38:44 +0000302#define yylineno asn1p_lineno
303extern int asn1p_lineno;
304
vlm931aeed2005-08-12 10:09:10 +0000305/*
vlm177a5b62005-09-05 05:17:57 +0000306 * Process directives as <ASN1C:RepresentAsPointer>
vlm066dc102005-08-22 12:23:54 +0000307 */
308extern int asn1p_as_pointer;
vlm066dc102005-08-22 12:23:54 +0000309
310/*
vlm931aeed2005-08-12 10:09:10 +0000311 * This temporary variable is used to solve the shortcomings of 1-lookahead
312 * parser.
313 */
314static struct AssignedIdentifier *saved_aid;
vlmfa67ddc2004-06-03 03:38:44 +0000315
vlm5d89c3d2005-08-13 09:07:11 +0000316static asn1p_value_t *_convert_bitstring2binary(char *str, int base);
317static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
vlmfa67ddc2004-06-03 03:38:44 +0000318
vlm931aeed2005-08-12 10:09:10 +0000319#define checkmem(ptr) do { \
320 if(!(ptr)) \
321 return yyerror("Memory failure"); \
vlmfa67ddc2004-06-03 03:38:44 +0000322 } while(0)
323
vlm931aeed2005-08-12 10:09:10 +0000324#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
325 if(arg1->type != constr_type) { \
326 int __ret; \
327 root = asn1p_constraint_new(yylineno); \
328 checkmem(root); \
329 root->type = constr_type; \
330 __ret = asn1p_constraint_insert(root, \
331 arg1); \
332 checkmem(__ret == 0); \
333 } else { \
334 root = arg1; \
335 } \
336 if(arg2) { \
337 int __ret \
338 = asn1p_constraint_insert(root, arg2); \
339 checkmem(__ret == 0); \
340 } \
vlmfa67ddc2004-06-03 03:38:44 +0000341 } while(0)
342
343
vlm7e436752006-03-18 06:53:11 +0000344
345/* Enabling traces. */
346#ifndef YYDEBUG
347# define YYDEBUG 0
348#endif
349
350/* Enabling verbose error messages. */
351#ifdef YYERROR_VERBOSE
352# undef YYERROR_VERBOSE
353# define YYERROR_VERBOSE 1
354#else
355# define YYERROR_VERBOSE 0
356#endif
357
358/* Enabling the token table. */
359#ifndef YYTOKEN_TABLE
360# define YYTOKEN_TABLE 0
361#endif
362
363#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
vlm177a5b62005-09-05 05:17:57 +0000364#line 72 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +0000365typedef union YYSTYPE {
vlmfa67ddc2004-06-03 03:38:44 +0000366 asn1p_t *a_grammar;
367 asn1p_module_flags_e a_module_flags;
368 asn1p_module_t *a_module;
369 asn1p_expr_type_e a_type; /* ASN.1 Type */
370 asn1p_expr_t *a_expr; /* Constructed collection */
371 asn1p_constraint_t *a_constr; /* Constraint */
372 enum asn1p_constraint_type_e a_ctype;/* Constraint type */
373 asn1p_xports_t *a_xports; /* IMports/EXports */
vlm931aeed2005-08-12 10:09:10 +0000374 struct AssignedIdentifier a_aid; /* Assigned Identifier */
vlmfa67ddc2004-06-03 03:38:44 +0000375 asn1p_oid_t *a_oid; /* Object Identifier */
376 asn1p_oid_arc_t a_oid_arc; /* Single OID's arc */
377 struct asn1p_type_tag_s a_tag; /* A tag */
378 asn1p_ref_t *a_ref; /* Reference to custom type */
379 asn1p_wsyntx_t *a_wsynt; /* WITH SYNTAX contents */
380 asn1p_wsyntx_chunk_t *a_wchunk; /* WITH SYNTAX chunk */
381 struct asn1p_ref_component_s a_refcomp; /* Component of a reference */
382 asn1p_value_t *a_value; /* Number, DefinedValue, etc */
383 struct asn1p_param_s a_parg; /* A parameter argument */
384 asn1p_paramlist_t *a_plist; /* A pargs list */
vlmc94e28f2004-09-15 11:59:51 +0000385 struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
vlmfa67ddc2004-06-03 03:38:44 +0000386 enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
vlmec6acd42004-09-29 13:18:09 +0000387 asn1c_integer_t a_int;
vlmfa67ddc2004-06-03 03:38:44 +0000388 char *tv_str;
389 struct {
390 char *buf;
391 int len;
392 } tv_opaque;
393 struct {
394 char *name;
395 struct asn1p_type_tag_s tag;
396 } tv_nametag;
vlm6a02a8a2004-09-08 00:28:11 +0000397} YYSTYPE;
vlm7e436752006-03-18 06:53:11 +0000398/* Line 196 of yacc.c. */
399#line 400 "asn1p_y.c"
400# define yystype YYSTYPE /* obsolescent; will be withdrawn */
401# define YYSTYPE_IS_DECLARED 1
402# define YYSTYPE_IS_TRIVIAL 1
vlmfa67ddc2004-06-03 03:38:44 +0000403#endif
404
405
406
vlm7e436752006-03-18 06:53:11 +0000407/* Copy the second part of user declarations. */
vlmfa67ddc2004-06-03 03:38:44 +0000408
vlmfa67ddc2004-06-03 03:38:44 +0000409
vlm7e436752006-03-18 06:53:11 +0000410/* Line 219 of yacc.c. */
411#line 412 "asn1p_y.c"
vlmfa67ddc2004-06-03 03:38:44 +0000412
vlm7e436752006-03-18 06:53:11 +0000413#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
414# define YYSIZE_T __SIZE_TYPE__
415#endif
416#if ! defined (YYSIZE_T) && defined (size_t)
417# define YYSIZE_T size_t
418#endif
419#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
420# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
421# define YYSIZE_T size_t
422#endif
423#if ! defined (YYSIZE_T)
424# define YYSIZE_T unsigned int
425#endif
vlmfa67ddc2004-06-03 03:38:44 +0000426
vlm7e436752006-03-18 06:53:11 +0000427#ifndef YY_
428# if YYENABLE_NLS
429# if ENABLE_NLS
430# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
431# define YY_(msgid) dgettext ("bison-runtime", msgid)
432# endif
433# endif
434# ifndef YY_
435# define YY_(msgid) msgid
436# endif
437#endif
438
439#if ! defined (yyoverflow) || YYERROR_VERBOSE
440
441/* The parser invokes alloca or malloc; define the necessary symbols. */
442
443# ifdef YYSTACK_USE_ALLOCA
444# if YYSTACK_USE_ALLOCA
445# ifdef __GNUC__
446# define YYSTACK_ALLOC __builtin_alloca
447# else
448# define YYSTACK_ALLOC alloca
449# if defined (__STDC__) || defined (__cplusplus)
450# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
451# define YYINCLUDED_STDLIB_H
452# endif
453# endif
454# endif
455# endif
456
457# ifdef YYSTACK_ALLOC
458 /* Pacify GCC's `empty if-body' warning. */
459# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
460# ifndef YYSTACK_ALLOC_MAXIMUM
461 /* The OS might guarantee only one guard page at the bottom of the stack,
462 and a page size can be as small as 4096 bytes. So we cannot safely
463 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
464 to allow for a few compiler-allocated temporary stack slots. */
465# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
466# endif
467# else
468# define YYSTACK_ALLOC YYMALLOC
469# define YYSTACK_FREE YYFREE
470# ifndef YYSTACK_ALLOC_MAXIMUM
471# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
472# endif
473# ifdef __cplusplus
474extern "C" {
475# endif
476# ifndef YYMALLOC
477# define YYMALLOC malloc
478# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
479 && (defined (__STDC__) || defined (__cplusplus)))
480void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
481# endif
482# endif
483# ifndef YYFREE
484# define YYFREE free
485# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
486 && (defined (__STDC__) || defined (__cplusplus)))
487void free (void *); /* INFRINGES ON USER NAME SPACE */
488# endif
489# endif
490# ifdef __cplusplus
491}
492# endif
493# endif
494#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
495
496
497#if (! defined (yyoverflow) \
498 && (! defined (__cplusplus) \
499 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
500
501/* A type that is properly aligned for any stack member. */
502union yyalloc
503{
504 short int yyss;
505 YYSTYPE yyvs;
506 };
507
508/* The size of the maximum gap between one aligned stack and the next. */
509# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
510
511/* The size of an array large to enough to hold all stacks, each with
512 N elements. */
513# define YYSTACK_BYTES(N) \
514 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
515 + YYSTACK_GAP_MAXIMUM)
516
517/* Copy COUNT objects from FROM to TO. The source and destination do
518 not overlap. */
519# ifndef YYCOPY
520# if defined (__GNUC__) && 1 < __GNUC__
521# define YYCOPY(To, From, Count) \
522 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
523# else
524# define YYCOPY(To, From, Count) \
525 do \
526 { \
527 YYSIZE_T yyi; \
528 for (yyi = 0; yyi < (Count); yyi++) \
529 (To)[yyi] = (From)[yyi]; \
530 } \
531 while (0)
532# endif
533# endif
534
535/* Relocate STACK from its old location to the new one. The
536 local variables YYSIZE and YYSTACKSIZE give the old and new number of
537 elements in the stack, and YYPTR gives the new location of the
538 stack. Advance YYPTR to a properly aligned location for the next
539 stack. */
540# define YYSTACK_RELOCATE(Stack) \
541 do \
542 { \
543 YYSIZE_T yynewbytes; \
544 YYCOPY (&yyptr->Stack, Stack, yysize); \
545 Stack = &yyptr->Stack; \
546 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
547 yyptr += yynewbytes / sizeof (*yyptr); \
548 } \
549 while (0)
vlmfa67ddc2004-06-03 03:38:44 +0000550
551#endif
552
vlm7e436752006-03-18 06:53:11 +0000553#if defined (__STDC__) || defined (__cplusplus)
554 typedef signed char yysigned_char;
vlmfa67ddc2004-06-03 03:38:44 +0000555#else
vlm7e436752006-03-18 06:53:11 +0000556 typedef short int yysigned_char;
vlmfa67ddc2004-06-03 03:38:44 +0000557#endif
558
vlm7e436752006-03-18 06:53:11 +0000559/* YYFINAL -- State number of the termination state. */
560#define YYFINAL 7
561/* YYLAST -- Last index in YYTABLE. */
562#define YYLAST 757
563
564/* YYNTOKENS -- Number of terminals. */
565#define YYNTOKENS 120
566/* YYNNTS -- Number of nonterminals. */
567#define YYNNTS 107
568/* YYNRULES -- Number of rules. */
569#define YYNRULES 286
570/* YYNRULES -- Number of states. */
571#define YYNSTATES 445
572
573/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
574#define YYUNDEFTOK 2
575#define YYMAXUTOK 359
576
577#define YYTRANSLATE(YYX) \
578 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
579
580/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
581static const unsigned char yytranslate[] =
582{
583 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 116, 2, 2, 2, 2, 2, 2,
587 109, 110, 2, 2, 112, 2, 117, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 113, 111,
589 118, 2, 2, 2, 119, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 114, 2, 115, 101, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 107, 103, 108, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
609 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
610 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
611 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
612 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
613 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
614 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
615 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
616 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
617 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
618 95, 96, 97, 98, 99, 100, 102, 104, 105, 106
619};
620
621#if YYDEBUG
622/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
623 YYRHS. */
624static const unsigned short int yyprhs[] =
625{
626 0, 0, 3, 5, 7, 10, 19, 20, 22, 26,
627 29, 31, 34, 36, 41, 43, 44, 46, 48, 51,
628 54, 57, 60, 63, 66, 67, 69, 71, 74, 76,
629 78, 80, 82, 84, 85, 89, 91, 95, 98, 100,
630 103, 104, 106, 111, 113, 117, 119, 123, 125, 129,
631 133, 136, 138, 142, 144, 148, 150, 151, 158, 160,
632 162, 166, 170, 177, 179, 183, 185, 189, 193, 197,
633 199, 203, 205, 207, 208, 210, 212, 216, 220, 223,
634 227, 229, 231, 235, 238, 240, 242, 248, 249, 251,
635 253, 257, 260, 265, 269, 273, 277, 281, 285, 286,
636 288, 289, 296, 298, 301, 303, 305, 307, 311, 313,
637 317, 321, 325, 326, 329, 331, 336, 341, 346, 353,
638 360, 362, 367, 372, 374, 378, 380, 384, 388, 392,
639 394, 398, 400, 404, 406, 408, 410, 412, 416, 420,
640 422, 427, 431, 432, 436, 438, 440, 442, 444, 446,
641 448, 450, 452, 454, 458, 460, 462, 464, 466, 469,
642 471, 473, 475, 477, 480, 483, 485, 487, 490, 493,
643 495, 497, 499, 501, 503, 506, 508, 511, 513, 515,
644 517, 519, 521, 523, 525, 527, 529, 531, 533, 535,
645 537, 539, 541, 543, 545, 547, 549, 550, 552, 554,
646 559, 563, 568, 570, 574, 580, 582, 586, 590, 594,
647 598, 603, 607, 609, 611, 615, 619, 623, 627, 629,
648 631, 632, 638, 640, 643, 646, 650, 652, 654, 656,
649 658, 660, 662, 664, 666, 670, 676, 678, 682, 684,
650 688, 689, 691, 693, 695, 697, 699, 701, 705, 710,
651 712, 716, 719, 723, 725, 729, 730, 732, 734, 737,
652 740, 744, 746, 750, 752, 757, 762, 764, 766, 768,
653 770, 771, 773, 776, 781, 782, 784, 786, 788, 789,
654 791, 793, 795, 797, 799, 800, 802
655};
656
657/* YYRHS -- A `-1'-separated list of the rules' RHS. */
658static const short int yyrhs[] =
659{
660 121, 0, -1, 122, -1, 123, -1, 122, 123, -1,
661 223, 124, 38, 128, 3, 25, 131, 43, -1, -1,
662 125, -1, 107, 126, 108, -1, 107, 108, -1, 127,
663 -1, 126, 127, -1, 226, -1, 226, 109, 10, 110,
664 -1, 10, -1, -1, 129, -1, 130, -1, 129, 130,
665 -1, 45, 88, -1, 56, 88, -1, 24, 88, -1,
666 47, 57, -1, 15, 61, -1, -1, 132, -1, 133,
667 -1, 132, 133, -1, 135, -1, 141, -1, 147, -1,
668 177, -1, 144, -1, -1, 42, 15, 134, -1, 186,
669 -1, 58, 136, 111, -1, 58, 50, -1, 138, -1,
670 136, 138, -1, -1, 125, -1, 139, 50, 223, 137,
671 -1, 140, -1, 139, 112, 140, -1, 223, -1, 223,
672 107, 108, -1, 226, -1, 46, 142, 111, -1, 46,
673 21, 111, -1, 46, 111, -1, 143, -1, 142, 112,
674 143, -1, 223, -1, 223, 107, 108, -1, 226, -1,
675 -1, 223, 146, 3, 107, 145, 182, -1, 171, -1,
676 183, -1, 223, 3, 167, -1, 223, 3, 157, -1,
677 223, 107, 148, 108, 3, 167, -1, 149, -1, 148,
678 112, 149, -1, 223, -1, 223, 113, 226, -1, 223,
679 113, 223, -1, 183, 113, 226, -1, 151, -1, 150,
680 112, 151, -1, 167, -1, 226, -1, -1, 153, -1,
681 154, -1, 153, 112, 154, -1, 226, 167, 212, -1,
682 167, 212, -1, 34, 72, 167, -1, 166, -1, 156,
683 -1, 155, 112, 156, -1, 226, 167, -1, 166, -1,
684 167, -1, 32, 107, 159, 108, 161, -1, -1, 92,
685 -1, 160, -1, 159, 112, 160, -1, 16, 212, -1,
686 17, 167, 158, 212, -1, 17, 175, 212, -1, 17,
687 176, 212, -1, 16, 175, 212, -1, 16, 167, 212,
688 -1, 16, 176, 212, -1, -1, 162, -1, -1, 99,
689 86, 107, 163, 164, 108, -1, 165, -1, 164, 165,
690 -1, 4, -1, 18, -1, 174, -1, 114, 164, 115,
691 -1, 106, -1, 106, 116, 180, -1, 106, 116, 217,
692 -1, 218, 169, 190, -1, -1, 168, 170, -1, 185,
693 -1, 31, 107, 155, 108, -1, 82, 107, 152, 108,
694 -1, 83, 107, 152, 108, -1, 82, 190, 72, 225,
695 218, 169, -1, 83, 190, 72, 225, 218, 169, -1,
696 22, -1, 22, 39, 29, 226, -1, 223, 107, 150,
697 108, -1, 171, -1, 60, 72, 171, -1, 14, -1,
698 14, 117, 223, -1, 224, 117, 223, -1, 14, 117,
699 226, -1, 224, -1, 224, 117, 172, -1, 173, -1,
700 172, 117, 173, -1, 174, -1, 16, -1, 17, -1,
701 16, -1, 175, 117, 16, -1, 175, 117, 17, -1,
702 15, -1, 226, 146, 3, 178, -1, 226, 113, 178,
703 -1, -1, 107, 179, 182, -1, 67, -1, 49, -1,
704 90, -1, 6, -1, 8, -1, 181, -1, 217, -1,
705 180, -1, 226, -1, 223, 117, 226, -1, 7, -1,
706 11, -1, 12, -1, 5, -1, 182, 5, -1, 28,
707 -1, 67, -1, 80, -1, 184, -1, 71, 85, -1,
708 69, 55, -1, 81, -1, 48, -1, 40, 75, -1,
709 30, 85, -1, 95, -1, 51, -1, 186, -1, 62,
710 -1, 44, -1, 26, 85, -1, 183, -1, 184, 214,
711 -1, 27, -1, 52, -1, 53, -1, 54, -1, 63,
712 -1, 68, -1, 78, -1, 87, -1, 89, -1, 94,
713 -1, 96, -1, 97, -1, 98, -1, 70, -1, 103,
714 -1, 104, -1, 101, -1, 102, -1, 100, -1, -1,
715 191, -1, 192, -1, 84, 109, 193, 110, -1, 109,
716 193, 110, -1, 192, 109, 193, 110, -1, 194, -1,
717 194, 112, 106, -1, 194, 112, 106, 112, 194, -1,
718 195, -1, 21, 100, 195, -1, 194, 187, 195, -1,
719 194, 188, 195, -1, 195, 189, 195, -1, 198, 109,
720 193, 110, -1, 109, 193, 110, -1, 199, -1, 200,
721 -1, 199, 197, 199, -1, 65, 197, 199, -1, 199,
722 197, 64, -1, 65, 197, 64, -1, 206, -1, 201,
723 -1, -1, 35, 29, 107, 196, 182, -1, 105, -1,
724 105, 118, -1, 118, 105, -1, 118, 105, 118, -1,
725 84, -1, 50, -1, 49, -1, 90, -1, 217, -1,
726 181, -1, 226, -1, 223, -1, 99, 33, 192, -1,
727 99, 34, 107, 202, 108, -1, 203, -1, 202, 112,
728 203, -1, 106, -1, 226, 190, 204, -1, -1, 205,
729 -1, 77, -1, 19, -1, 73, -1, 207, -1, 208,
730 -1, 107, 223, 108, -1, 207, 107, 209, 108, -1,
731 210, -1, 209, 112, 210, -1, 119, 211, -1, 119,
732 117, 211, -1, 226, -1, 211, 117, 226, -1, -1,
733 213, -1, 73, -1, 37, 178, -1, 107, 108, -1,
734 107, 215, 108, -1, 216, -1, 215, 112, 216, -1,
735 226, -1, 226, 109, 217, 110, -1, 226, 109, 180,
736 110, -1, 217, -1, 106, -1, 10, -1, 13, -1,
737 -1, 219, -1, 220, 222, -1, 114, 221, 10, 115,
738 -1, -1, 93, -1, 23, -1, 79, -1, -1, 56,
739 -1, 45, -1, 14, -1, 15, -1, 15, -1, -1,
740 226, -1, 9, -1
741};
742
743/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
744static const unsigned short int yyrline[] =
745{
746 0, 322, 322, 328, 333, 350, 375, 376, 380, 383,
747 389, 395, 404, 408, 412, 422, 423, 432, 435, 444,
748 447, 450, 453, 457, 478, 479, 488, 491, 524, 527,
749 536, 543, 556, 564, 563, 577, 590, 600, 606, 611,
750 618, 619, 623, 634, 639, 646, 652, 658, 667, 670,
751 673, 681, 686, 693, 699, 705, 716, 715, 726, 733,
752 751, 757, 773, 783, 792, 803, 807, 814, 821, 832,
753 837, 844, 847, 871, 872, 875, 880, 887, 894, 900,
754 907, 913, 918, 925, 930, 933, 940, 950, 951, 955,
755 962, 972, 982, 993, 1003, 1014, 1024, 1035, 1047, 1048,
756 1055, 1054, 1063, 1067, 1074, 1078, 1081, 1085, 1091, 1099,
757 1108, 1120, 1142, 1149, 1168, 1171, 1177, 1183, 1189, 1199,
758 1209, 1215, 1229, 1253, 1260, 1275, 1283, 1293, 1303, 1313,
759 1321, 1343, 1351, 1360, 1364, 1369, 1378, 1382, 1386, 1393,
760 1413, 1423, 1430, 1430, 1435, 1440, 1445, 1450, 1454, 1458,
761 1461, 1464, 1470, 1481, 1499, 1503, 1508, 1542, 1551, 1566,
762 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576,
763 1577, 1578, 1585, 1586, 1587, 1591, 1597, 1610, 1611, 1615,
764 1619, 1620, 1621, 1622, 1623, 1627, 1628, 1629, 1630, 1634,
765 1635, 1642, 1642, 1643, 1643, 1644, 1647, 1648, 1654, 1657,
766 1667, 1670, 1676, 1679, 1685, 1696, 1699, 1702, 1705, 1708,
767 1714, 1722, 1730, 1736, 1742, 1749, 1757, 1765, 1774, 1777,
768 1781, 1780, 1792, 1793, 1794, 1795, 1799, 1802, 1808, 1813,
769 1818, 1821, 1824, 1838, 1852, 1855, 1861, 1864, 1870, 1876,
770 1890, 1891, 1895, 1898, 1901, 1907, 1910, 1919, 1934, 1940,
771 1946, 1960, 1971, 1987, 1990, 2008, 2012, 2016, 2020, 2043,
772 2047, 2053, 2058, 2065, 2072, 2080, 2088, 2095, 2106, 2110,
773 2141, 2142, 2146, 2153, 2159, 2160, 2161, 2162, 2166, 2167,
774 2168, 2172, 2176, 2184, 2191, 2192, 2198
775};
776#endif
777
778#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
779/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
780 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
781static const char *const yytname[] =
782{
783 "$end", "error", "$undefined", "TOK_PPEQ", "TOK_whitespace",
784 "TOK_opaque", "TOK_bstring", "TOK_cstring", "TOK_hstring",
785 "TOK_identifier", "TOK_number", "TOK_tuple", "TOK_quadruple",
786 "TOK_number_negative", "TOK_typereference", "TOK_capitalreference",
787 "TOK_typefieldreference", "TOK_valuefieldreference", "TOK_Literal",
788 "TOK_ABSENT", "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY",
789 "TOK_APPLICATION", "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT",
790 "TOK_BMPString", "TOK_BOOLEAN", "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE",
791 "TOK_CLASS", "TOK_COMPONENT", "TOK_COMPONENTS", "TOK_CONSTRAINED",
792 "TOK_CONTAINING", "TOK_DEFAULT", "TOK_DEFINITIONS", "TOK_DEFINED",
793 "TOK_EMBEDDED", "TOK_ENCODED", "TOK_ENCODING_CONTROL", "TOK_END",
794 "TOK_ENUMERATED", "TOK_EXPLICIT", "TOK_EXPORTS", "TOK_EXTENSIBILITY",
795 "TOK_EXTERNAL", "TOK_FALSE", "TOK_FROM", "TOK_GeneralizedTime",
796 "TOK_GeneralString", "TOK_GraphicString", "TOK_IA5String",
797 "TOK_IDENTIFIER", "TOK_IMPLICIT", "TOK_IMPLIED", "TOK_IMPORTS",
798 "TOK_INCLUDES", "TOK_INSTANCE", "TOK_INSTRUCTIONS", "TOK_INTEGER",
799 "TOK_ISO646String", "TOK_MAX", "TOK_MIN", "TOK_MINUS_INFINITY",
800 "TOK_NULL", "TOK_NumericString", "TOK_OBJECT", "TOK_ObjectDescriptor",
801 "TOK_OCTET", "TOK_OF", "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV",
802 "TOK_PLUS_INFINITY", "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE",
803 "TOK_REAL", "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE",
804 "TOK_STRING", "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS",
805 "TOK_TeletexString", "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE",
806 "TOK_UNIVERSAL", "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
807 "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH", "TOK_EXCEPT",
808 "'^'", "TOK_INTERSECTION", "'|'", "TOK_UNION", "TOK_TwoDots",
809 "TOK_ThreeDots", "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['",
810 "']'", "'!'", "'.'", "'<'", "'@'", "$accept", "ParsedGrammar",
811 "ModuleList", "ModuleSpecification", "optObjectIdentifier",
812 "ObjectIdentifier", "ObjectIdentifierBody", "ObjectIdentifierElement",
813 "optModuleSpecificationFlags", "ModuleSpecificationFlags",
814 "ModuleSpecificationFlag", "optModuleSpecificationBody",
815 "ModuleSpecificationBody", "ModuleSpecificationElement", "@1",
816 "ImportsDefinition", "ImportsBundleSet", "AssignedIdentifier",
817 "ImportsBundle", "ImportsList", "ImportsElement", "ExportsDefinition",
818 "ExportsBody", "ExportsElement", "ValueSetDefinition", "@2",
819 "DefinedTypeRef", "DataTypeReference", "ParameterArgumentList",
820 "ParameterArgumentName", "ActualParameterList", "ActualParameter",
821 "optComponentTypeLists", "ComponentTypeLists", "ComponentType",
822 "AlternativeTypeLists", "AlternativeType", "ObjectClass", "optUnique",
823 "FieldSpec", "ClassField", "optWithSyntax", "WithSyntax", "@3",
824 "WithSyntaxList", "WithSyntaxToken", "ExtensionAndException", "Type",
825 "NSTD_IndirectMarker", "TypeDeclaration", "TypeDeclarationSet",
826 "ComplexTypeReference", "ComplexTypeReferenceAmpList",
827 "ComplexTypeReferenceElement", "PrimitiveFieldReference", "FieldName",
828 "DefinedObjectClass", "ValueDefinition", "Value", "@4", "DefinedValue",
829 "RestrictedCharacterStringValue", "Opaque", "BasicTypeId",
830 "BasicTypeId_UniverationCompatible", "BasicType", "BasicString", "Union",
831 "Intersection", "Except", "optConstraints", "Constraints",
832 "SetOfConstraints", "ElementSetSpecs", "ElementSetSpec",
833 "ConstraintSubtypeElement", "@5", "ConstraintRangeSpec",
834 "ConstraintSpec", "SingleValue", "ContainedSubtype",
835 "InnerTypeConstraint", "WithComponentsList", "WithComponentsElement",
836 "optPresenceConstraint", "PresenceConstraint", "TableConstraint",
837 "SimpleTableConstraint", "ComponentRelationConstraint", "AtNotationList",
838 "AtNotationElement", "ComponentIdList", "optMarker", "Marker",
839 "UniverationDefinition", "UniverationList", "UniverationElement",
840 "SignedNumber", "optTag", "Tag", "TagTypeValue", "TagClass", "TagPlicit",
841 "TypeRefName", "ObjectClassReference", "optIdentifier", "Identifier", 0
842};
843#endif
844
845# ifdef YYPRINT
846/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
847 token YYLEX-NUM. */
848static const unsigned short int yytoknum[] =
849{
850 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
851 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
852 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
853 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
854 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
855 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
856 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
857 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
858 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
859 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
860 355, 94, 356, 124, 357, 358, 359, 123, 125, 40,
861 41, 59, 44, 58, 91, 93, 33, 46, 60, 64
862};
863# endif
864
865/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
866static const unsigned char yyr1[] =
867{
868 0, 120, 121, 122, 122, 123, 124, 124, 125, 125,
869 126, 126, 127, 127, 127, 128, 128, 129, 129, 130,
870 130, 130, 130, 130, 131, 131, 132, 132, 133, 133,
871 133, 133, 133, 134, 133, 133, 135, 135, 136, 136,
872 137, 137, 138, 139, 139, 140, 140, 140, 141, 141,
873 141, 142, 142, 143, 143, 143, 145, 144, 146, 146,
874 147, 147, 147, 148, 148, 149, 149, 149, 149, 150,
875 150, 151, 151, 152, 152, 153, 153, 154, 154, 154,
876 154, 155, 155, 156, 156, 156, 157, 158, 158, 159,
877 159, 160, 160, 160, 160, 160, 160, 160, 161, 161,
878 163, 162, 164, 164, 165, 165, 165, 165, 166, 166,
879 166, 167, 168, 169, 170, 170, 170, 170, 170, 170,
880 170, 170, 170, 170, 170, 171, 171, 171, 171, 171,
881 171, 172, 172, 173, 174, 174, 175, 175, 175, 176,
882 177, 178, 179, 178, 178, 178, 178, 178, 178, 178,
883 178, 178, 180, 180, 181, 181, 181, 182, 182, 183,
884 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
885 183, 183, 184, 184, 184, 185, 185, 186, 186, 186,
886 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
887 186, 187, 187, 188, 188, 189, 190, 190, 191, 191,
888 192, 192, 193, 193, 193, 194, 194, 194, 194, 194,
889 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
890 196, 195, 197, 197, 197, 197, 198, 198, 199, 199,
891 199, 199, 199, 200, 201, 201, 202, 202, 203, 203,
892 204, 204, 205, 205, 205, 206, 206, 207, 208, 209,
893 209, 210, 210, 211, 211, 212, 212, 213, 213, 214,
894 214, 215, 215, 216, 216, 216, 216, 216, 217, 217,
895 218, 218, 219, 220, 221, 221, 221, 221, 222, 222,
896 222, 223, 223, 224, 225, 225, 226
897};
898
899/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
900static const unsigned char yyr2[] =
901{
902 0, 2, 1, 1, 2, 8, 0, 1, 3, 2,
903 1, 2, 1, 4, 1, 0, 1, 1, 2, 2,
904 2, 2, 2, 2, 0, 1, 1, 2, 1, 1,
905 1, 1, 1, 0, 3, 1, 3, 2, 1, 2,
906 0, 1, 4, 1, 3, 1, 3, 1, 3, 3,
907 2, 1, 3, 1, 3, 1, 0, 6, 1, 1,
908 3, 3, 6, 1, 3, 1, 3, 3, 3, 1,
909 3, 1, 1, 0, 1, 1, 3, 3, 2, 3,
910 1, 1, 3, 2, 1, 1, 5, 0, 1, 1,
911 3, 2, 4, 3, 3, 3, 3, 3, 0, 1,
912 0, 6, 1, 2, 1, 1, 1, 3, 1, 3,
913 3, 3, 0, 2, 1, 4, 4, 4, 6, 6,
914 1, 4, 4, 1, 3, 1, 3, 3, 3, 1,
915 3, 1, 3, 1, 1, 1, 1, 3, 3, 1,
916 4, 3, 0, 3, 1, 1, 1, 1, 1, 1,
917 1, 1, 1, 3, 1, 1, 1, 1, 2, 1,
918 1, 1, 1, 2, 2, 1, 1, 2, 2, 1,
919 1, 1, 1, 1, 2, 1, 2, 1, 1, 1,
920 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
921 1, 1, 1, 1, 1, 1, 0, 1, 1, 4,
922 3, 4, 1, 3, 5, 1, 3, 3, 3, 3,
923 4, 3, 1, 1, 3, 3, 3, 3, 1, 1,
924 0, 5, 1, 2, 2, 3, 1, 1, 1, 1,
925 1, 1, 1, 1, 3, 5, 1, 3, 1, 3,
926 0, 1, 1, 1, 1, 1, 1, 3, 4, 1,
927 3, 2, 3, 1, 3, 0, 1, 1, 2, 2,
928 3, 1, 3, 1, 4, 4, 1, 1, 1, 1,
929 0, 1, 2, 4, 0, 1, 1, 1, 0, 1,
930 1, 1, 1, 1, 0, 1, 1
931};
932
933/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
934 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
935 means the default is an error. */
936static const unsigned short int yydefact[] =
937{
938 0, 281, 282, 0, 2, 3, 6, 1, 4, 0,
939 0, 7, 286, 14, 9, 0, 10, 12, 15, 8,
940 11, 0, 0, 0, 0, 0, 0, 0, 16, 17,
941 0, 23, 21, 19, 22, 20, 0, 18, 13, 24,
942 177, 0, 0, 178, 179, 180, 0, 181, 182, 190,
943 183, 184, 185, 186, 187, 188, 189, 0, 25, 26,
944 28, 29, 32, 30, 31, 35, 0, 0, 33, 0,
945 50, 0, 51, 53, 55, 37, 0, 38, 0, 43,
946 45, 47, 5, 27, 270, 125, 283, 0, 159, 0,
947 0, 173, 166, 170, 172, 160, 0, 0, 161, 165,
948 169, 0, 0, 58, 59, 162, 171, 129, 0, 34,
949 49, 48, 0, 0, 36, 39, 0, 0, 0, 0,
950 274, 61, 60, 112, 271, 278, 0, 174, 168, 167,
951 164, 163, 0, 63, 0, 65, 0, 0, 0, 52,
952 54, 40, 44, 46, 0, 276, 277, 275, 0, 0,
953 196, 280, 279, 272, 126, 128, 0, 0, 0, 0,
954 56, 134, 135, 130, 131, 133, 127, 147, 154, 148,
955 268, 155, 156, 269, 145, 144, 146, 142, 140, 151,
956 149, 150, 0, 152, 41, 42, 270, 270, 0, 89,
957 0, 125, 283, 120, 0, 0, 196, 196, 113, 123,
958 175, 162, 114, 0, 0, 0, 111, 197, 198, 270,
959 64, 68, 67, 66, 0, 0, 0, 0, 0, 139,
960 136, 0, 257, 255, 255, 255, 91, 256, 87, 255,
961 255, 98, 0, 273, 0, 270, 0, 270, 0, 270,
962 0, 0, 176, 270, 0, 0, 0, 228, 227, 0,
963 226, 229, 0, 0, 0, 231, 0, 202, 205, 0,
964 212, 213, 219, 218, 245, 246, 230, 233, 232, 0,
965 62, 157, 57, 132, 143, 153, 141, 258, 96, 0,
966 95, 97, 88, 255, 93, 94, 0, 86, 99, 90,
967 0, 108, 0, 81, 84, 85, 270, 124, 0, 0,
968 74, 75, 80, 255, 270, 284, 0, 284, 267, 259,
969 0, 261, 266, 263, 0, 69, 71, 72, 0, 0,
970 0, 222, 0, 0, 0, 0, 0, 0, 200, 193,
971 194, 191, 192, 0, 0, 0, 195, 0, 0, 0,
972 0, 0, 158, 137, 138, 92, 0, 121, 0, 115,
973 270, 83, 270, 116, 270, 78, 255, 270, 285, 117,
974 270, 260, 0, 0, 122, 270, 199, 206, 220, 223,
975 224, 217, 215, 234, 0, 247, 211, 203, 207, 208,
976 209, 0, 216, 214, 0, 0, 249, 201, 100, 109,
977 110, 152, 82, 79, 76, 77, 112, 112, 262, 0,
978 0, 70, 0, 225, 238, 0, 236, 196, 0, 210,
979 0, 251, 253, 248, 0, 0, 118, 119, 265, 264,
980 221, 235, 0, 240, 204, 252, 0, 250, 104, 105,
981 0, 0, 102, 106, 237, 243, 244, 242, 239, 241,
982 254, 0, 101, 103, 107
983};
984
985/* YYDEFGOTO[NTERM-NUM]. */
986static const short int yydefgoto[] =
987{
988 -1, 3, 4, 5, 10, 11, 15, 16, 27, 28,
989 29, 57, 58, 59, 109, 60, 76, 185, 77, 78,
990 79, 61, 71, 72, 62, 214, 102, 63, 132, 133,
991 314, 315, 299, 300, 301, 292, 293, 121, 283, 188,
992 189, 287, 288, 415, 431, 432, 302, 303, 149, 150,
993 198, 103, 163, 164, 433, 224, 225, 64, 178, 216,
994 179, 255, 272, 104, 105, 202, 106, 334, 335, 337,
995 206, 207, 208, 256, 257, 258, 402, 323, 259, 260,
996 261, 262, 405, 406, 438, 439, 263, 264, 265, 385,
997 386, 411, 226, 227, 242, 310, 311, 266, 123, 124,
998 125, 148, 153, 267, 107, 357, 268
999};
1000
1001/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1002 STATE-NUM. */
1003#define YYPACT_NINF -267
1004static const short int yypact[] =
1005{
1006 203, -267, -267, 16, 203, -267, -54, -267, -267, 15,
1007 -2, -267, -267, -267, -267, 35, -267, -39, 199, -267,
1008 -267, 79, 45, 24, 69, 47, 110, 221, 199, -267,
1009 66, -267, -267, -267, -267, -267, 215, -267, -267, 430,
1010 -267, 230, 43, -267, -267, -267, 201, -267, -267, -267,
1011 -267, -267, -267, -267, -267, -267, -267, 209, 430, -267,
1012 -267, -267, -267, -267, -267, -267, 239, 583, -267, 149,
1013 -267, 173, -267, 155, -267, -267, 51, -267, -19, -267,
1014 157, -267, -267, -267, -12, 153, -267, 183, -267, 187,
1015 205, -267, -267, -267, -267, -267, 219, 226, -267, -267,
1016 -267, 659, 311, -267, -267, -267, -267, 208, 313, -267,
1017 -267, -267, 262, 210, -267, -267, 203, 262, 232, 220,
1018 58, -267, -267, -267, -267, 114, 262, -267, -267, -267,
1019 -267, -267, -24, -267, 225, 231, 244, 307, 171, -267,
1020 -267, -54, -267, -267, 278, -267, -267, -267, 354, 507,
1021 -36, -267, -267, -267, -267, -267, 375, 659, 379, 262,
1022 -267, -267, -267, 272, -267, -267, -267, -267, -267, -267,
1023 -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
1024 -267, -267, 273, 279, -267, -267, 61, 53, 48, -267,
1025 276, 57, 286, 356, 289, 327, 88, 122, -267, -267,
1026 -267, 291, -267, 293, 294, 359, -267, -267, 295, 288,
1027 -267, -267, -267, -267, 400, 326, 400, 379, 171, -267,
1028 -267, 171, -267, 10, 74, 10, -267, -267, 314, 74,
1029 10, 312, 278, -267, 381, 13, 333, 25, 342, 25,
1030 343, 86, -267, 8, 359, 318, 387, -267, -267, -18,
1031 -267, -267, 316, 203, 359, -267, 309, 146, 320, 317,
1032 -18, -267, -267, -267, 321, -267, -267, -267, -267, 359,
1033 -267, -267, 418, -267, 418, -267, -267, -267, -267, 346,
1034 -267, -267, -267, 10, -267, -267, 339, -267, -267, -267,
1035 379, 315, 81, -267, -267, -267, 288, -267, 355, 322,
1036 323, -267, -267, 10, 288, 379, 324, 379, -267, -267,
1037 99, -267, -267, 325, 125, -267, -267, -267, 319, 372,
1038 329, 328, 335, 192, 332, 340, 334, 338, -267, -267,
1039 -267, -267, -267, 344, 372, 372, -267, 372, 359, 348,
1040 336, 341, -267, -267, -267, -267, 345, -267, 290, -267,
1041 13, -267, 288, -267, 1, -267, 10, 288, -267, -267,
1042 288, -267, 65, 290, -267, 8, -267, -267, -267, -267,
1043 347, -267, -267, 295, 12, -267, -267, 349, -267, -267,
1044 -267, 350, -267, -267, -4, 131, -267, -267, -267, -267,
1045 -267, -267, -267, -267, -267, -267, -267, -267, -267, 353,
1046 357, -267, 400, -267, -267, 151, -267, -36, 359, -267,
1047 379, 337, -267, -267, 336, 22, -267, -267, -267, -267,
1048 418, -267, 12, 71, 228, 337, 379, -267, -267, -267,
1049 22, 38, -267, -267, -267, -267, -267, -267, -267, -267,
1050 -267, 11, -267, -267, -267
1051};
1052
1053/* YYPGOTO[NTERM-NUM]. */
1054static const short int yypgoto[] =
1055{
1056 -267, -267, -267, 429, -267, 351, -267, 438, -267, -267,
1057 431, -267, -267, 406, -267, -267, -267, -267, 393, -267,
1058 358, -267, -267, 361, -267, -267, 403, -267, -267, 330,
1059 -267, 109, 238, -267, 124, -267, 130, -267, -267, -267,
1060 253, -267, -267, -267, 56, -241, -226, -77, -267, -20,
1061 -267, -108, -267, 274, -114, 303, 304, -267, -83, -267,
1062 -266, -53, -215, 39, 352, -267, -7, -267, -267, -267,
1063 -194, -267, 170, -183, 87, -22, -267, 236, -267, -260,
1064 -267, -267, -267, 75, -267, -267, -267, -267, -267, -267,
1065 85, 92, -211, -267, -267, -267, 141, -127, -71, -267,
1066 -267, -267, -267, 4, -267, 197, -9
1067};
1068
1069/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1070 positive, shift that token. If negative, reduce the rule which
1071 number is the opposite. If zero, do what YYDEFACT says.
1072 If YYTABLE_NINF, syntax error. */
1073#define YYTABLE_NINF -283
1074static const short int yytable[] =
1075{
1076 17, 274, 238, 240, 6, 12, 17, 122, 6, 294,
1077 12, 181, 278, 280, 281, 428, 7, 12, 284, 285,
1078 119, 12, 12, 165, 12, 13, 428, 161, 162, 429,
1079 67, 116, 65, 74, 12, 298, 18, 81, 161, 162,
1080 429, 199, 428, 66, 12, 13, 73, 221, 204, 67,
1081 80, 65, 12, 9, 161, 162, 429, 1, 2, 298,
1082 12, 318, 66, 372, 69, 1, 2, 81, 219, 220,
1083 21, 327, 345, 205, 12, 170, 219, 220, 173, 383,
1084 80, 145, 389, 222, 156, 180, 341, 321, 157, 30,
1085 435, 181, 355, 117, 181, 12, 170, 399, 221, 173,
1086 322, 165, 120, 74, 34, 135, 31, 291, 81, 223,
1087 228, 221, 32, 410, 312, 120, 73, 155, 404, 291,
1088 141, 80, 120, 14, 294, 430, 444, 120, 297, 183,
1089 154, 291, 270, -73, 222, 276, 430, 146, 277, 120,
1090 134, 166, 182, 19, 436, 395, 442, 222, 437, 211,
1091 213, 147, 430, 203, 70, 381, 231, 33, 295, 151,
1092 232, 135, 114, 212, -281, 180, 316, 120, 180, -255,
1093 152, 308, 204, -255, 126, 120, 38, 167, 168, 169,
1094 12, 170, 171, 172, 173, 1, 2, 420, 200, 349,
1095 443, 279, 308, 350, 309, 237, 134, 205, 35, 168,
1096 443, 12, 170, 171, 172, 173, 204, 361, 275, 183,
1097 12, 362, 183, 423, 22, 1, 2, 1, 2, 351,
1098 174, 390, 182, 23, 36, 182, 296, 356, 304, 239,
1099 304, 205, 313, 364, 317, 312, 400, 365, 175, 413,
1100 39, 247, 84, 414, 24, 68, 25, 329, 330, 331,
1101 332, 75, 82, 85, 86, 26, 371, 326, 333, 421,
1102 110, 176, 113, 422, 118, 87, 40, 88, 127, 89,
1103 126, 12, 128, 295, 130, 393, 1, 2, 177, 90,
1104 129, 347, 251, 91, 111, 112, 396, 92, 316, 397,
1105 93, 43, 44, 45, 186, 187, 358, 367, 358, 12,
1106 170, 94, 47, 173, 1, 2, 95, 48, 96, 49,
1107 97, 131, 378, 379, 136, 380, 138, 50, 140, 98,
1108 99, 1, 2, 161, 162, 137, 51, 144, 52, 329,
1109 330, 331, 332, 53, 100, 54, 55, 56, 158, 391,
1110 143, 296, 161, 162, 159, 304, 101, 85, 86, 324,
1111 325, 160, 182, 313, 391, 168, 317, 12, 170, 171,
1112 172, 173, 343, 344, 190, 407, 168, 182, 12, 170,
1113 171, 172, 173, 1, 2, 412, 416, 417, 209, 168,
1114 245, 12, 170, 171, 172, 173, 1, 2, 12, 215,
1115 217, 233, 218, -282, 246, 234, 235, 247, 241, 236,
1116 243, 412, 120, 244, 269, 271, 282, 246, 247, 248,
1117 290, 286, 382, 407, 305, 307, 320, 440, 319, 328,
1118 336, 247, 248, 342, 249, 346, 338, 352, 340, 366,
1119 353, 348, 359, 8, 363, 354, 368, 249, 251, 12,
1120 370, 205, 375, 250, 1, 2, 369, 374, 376, 251,
1121 377, 387, 388, 20, 426, 384, 250, 40, 252, 37,
1122 409, 408, 251, 418, 83, 403, 253, 419, 254, 115,
1123 108, 252, 41, 139, 401, 142, 42, 306, 394, 253,
1124 392, 254, 43, 44, 45, 289, 441, 210, 46, 273,
1125 229, 230, 184, 47, 373, 424, 339, 434, 48, 427,
1126 49, 201, 425, 398, 360, 0, 0, 0, 50, 0,
1127 0, 0, 0, 0, 0, 0, 0, 51, 0, 52,
1128 0, 191, 192, 0, 53, 0, 54, 55, 56, 193,
1129 0, 0, 0, 87, 40, 88, 0, 89, 194, 0,
1130 0, 0, 0, 0, 0, 0, 0, 90, 0, 0,
1131 0, 91, 0, 0, 0, 92, 0, 0, 93, 43,
1132 44, 45, 0, 0, 0, 0, 0, 195, 0, 94,
1133 47, 0, 0, 0, 95, 48, 96, 49, 97, 0,
1134 0, 0, 0, 0, 0, 50, 0, 98, 99, 196,
1135 197, 0, 0, 0, 51, 0, 52, 85, 86, 0,
1136 0, 53, 100, 54, 55, 56, 0, 0, 0, 87,
1137 40, 88, 0, 89, 0, 0, 0, 0, 0, 0,
1138 0, 0, 0, 90, 0, 0, 0, 91, 0, 0,
1139 0, 92, 0, 0, 93, 43, 44, 45, 0, 0,
1140 0, 0, 0, 0, 0, 94, 47, 0, 0, 0,
1141 95, 48, 96, 49, 97, 0, 0, 0, 0, 0,
1142 0, 50, 0, 98, 99, 0, 0, 0, 0, 0,
1143 51, 0, 52, 1, 2, 0, 0, 53, 100, 54,
1144 55, 56, 0, 0, 0, 87, 40, 88, 0, 89,
1145 0, 0, 0, 0, 0, 0, 0, 0, 0, 90,
1146 0, 0, 0, 91, 0, 0, 0, 92, 0, 0,
1147 93, 43, 44, 45, 0, 0, 0, 0, 0, 0,
1148 0, 94, 47, 0, 0, 0, 95, 48, 96, 49,
1149 97, 0, 0, 0, 0, 0, 0, 50, 0, 98,
1150 99, 0, 0, 0, 0, 0, 51, 0, 52, 0,
1151 0, 0, 0, 53, 100, 54, 55, 56
1152};
1153
1154static const short int yycheck[] =
1155{
1156 9, 216, 196, 197, 0, 9, 15, 84, 4, 235,
1157 9, 138, 223, 224, 225, 4, 0, 9, 229, 230,
1158 32, 9, 9, 137, 9, 10, 4, 16, 17, 18,
1159 39, 50, 39, 42, 9, 34, 38, 46, 16, 17,
1160 18, 149, 4, 39, 9, 10, 42, 37, 84, 58,
1161 46, 58, 9, 107, 16, 17, 18, 14, 15, 34,
1162 9, 244, 58, 323, 21, 14, 15, 76, 15, 16,
1163 109, 254, 283, 109, 9, 10, 15, 16, 13, 339,
1164 76, 23, 348, 73, 108, 138, 269, 105, 112, 10,
1165 19, 218, 303, 112, 221, 9, 10, 363, 37, 13,
1166 118, 215, 114, 112, 57, 101, 61, 106, 117, 186,
1167 187, 37, 88, 117, 241, 114, 112, 126, 106, 106,
1168 116, 117, 114, 108, 350, 114, 115, 114, 236, 138,
1169 126, 106, 209, 108, 73, 218, 114, 79, 221, 114,
1170 101, 137, 138, 108, 73, 356, 108, 73, 77, 158,
1171 159, 93, 114, 149, 111, 338, 108, 88, 235, 45,
1172 112, 157, 111, 159, 107, 218, 243, 114, 221, 108,
1173 56, 106, 84, 112, 117, 114, 110, 6, 7, 8,
1174 9, 10, 11, 12, 13, 14, 15, 402, 149, 108,
1175 431, 117, 106, 112, 108, 107, 157, 109, 88, 7,
1176 441, 9, 10, 11, 12, 13, 84, 108, 217, 218,
1177 9, 112, 221, 407, 15, 14, 15, 14, 15, 296,
1178 49, 348, 218, 24, 3, 221, 235, 304, 237, 107,
1179 239, 109, 241, 108, 243, 362, 363, 112, 67, 108,
1180 25, 49, 3, 112, 45, 15, 47, 101, 102, 103,
1181 104, 50, 43, 14, 15, 56, 64, 253, 112, 108,
1182 111, 90, 107, 112, 107, 26, 27, 28, 85, 30,
1183 117, 9, 85, 350, 55, 352, 14, 15, 107, 40,
1184 75, 290, 90, 44, 111, 112, 357, 48, 365, 360,
1185 51, 52, 53, 54, 16, 17, 305, 319, 307, 9,
1186 10, 62, 63, 13, 14, 15, 67, 68, 69, 70,
1187 71, 85, 334, 335, 3, 337, 3, 78, 108, 80,
1188 81, 14, 15, 16, 17, 117, 87, 107, 89, 101,
1189 102, 103, 104, 94, 95, 96, 97, 98, 113, 348,
1190 108, 350, 16, 17, 113, 354, 107, 14, 15, 33,
1191 34, 107, 348, 362, 363, 7, 365, 9, 10, 11,
1192 12, 13, 16, 17, 10, 374, 7, 363, 9, 10,
1193 11, 12, 13, 14, 15, 384, 396, 397, 3, 7,
1194 21, 9, 10, 11, 12, 13, 14, 15, 9, 117,
1195 117, 115, 113, 107, 35, 39, 107, 49, 107, 72,
1196 107, 410, 114, 109, 109, 5, 92, 35, 49, 50,
1197 29, 99, 64, 422, 72, 72, 29, 426, 100, 110,
1198 100, 49, 50, 5, 65, 86, 109, 72, 107, 110,
1199 108, 116, 108, 4, 109, 112, 107, 65, 90, 9,
1200 105, 109, 108, 84, 14, 15, 118, 107, 110, 90,
1201 106, 110, 107, 15, 117, 119, 84, 27, 99, 28,
1202 110, 112, 90, 110, 58, 118, 107, 110, 109, 76,
1203 67, 99, 42, 112, 365, 117, 46, 239, 354, 107,
1204 350, 109, 52, 53, 54, 232, 430, 157, 58, 215,
1205 187, 187, 141, 63, 324, 408, 260, 422, 68, 414,
1206 70, 149, 410, 362, 307, -1, -1, -1, 78, -1,
1207 -1, -1, -1, -1, -1, -1, -1, 87, -1, 89,
1208 -1, 14, 15, -1, 94, -1, 96, 97, 98, 22,
1209 -1, -1, -1, 26, 27, 28, -1, 30, 31, -1,
1210 -1, -1, -1, -1, -1, -1, -1, 40, -1, -1,
1211 -1, 44, -1, -1, -1, 48, -1, -1, 51, 52,
1212 53, 54, -1, -1, -1, -1, -1, 60, -1, 62,
1213 63, -1, -1, -1, 67, 68, 69, 70, 71, -1,
1214 -1, -1, -1, -1, -1, 78, -1, 80, 81, 82,
1215 83, -1, -1, -1, 87, -1, 89, 14, 15, -1,
1216 -1, 94, 95, 96, 97, 98, -1, -1, -1, 26,
1217 27, 28, -1, 30, -1, -1, -1, -1, -1, -1,
1218 -1, -1, -1, 40, -1, -1, -1, 44, -1, -1,
1219 -1, 48, -1, -1, 51, 52, 53, 54, -1, -1,
1220 -1, -1, -1, -1, -1, 62, 63, -1, -1, -1,
1221 67, 68, 69, 70, 71, -1, -1, -1, -1, -1,
1222 -1, 78, -1, 80, 81, -1, -1, -1, -1, -1,
1223 87, -1, 89, 14, 15, -1, -1, 94, 95, 96,
1224 97, 98, -1, -1, -1, 26, 27, 28, -1, 30,
1225 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
1226 -1, -1, -1, 44, -1, -1, -1, 48, -1, -1,
1227 51, 52, 53, 54, -1, -1, -1, -1, -1, -1,
1228 -1, 62, 63, -1, -1, -1, 67, 68, 69, 70,
1229 71, -1, -1, -1, -1, -1, -1, 78, -1, 80,
1230 81, -1, -1, -1, -1, -1, 87, -1, 89, -1,
1231 -1, -1, -1, 94, 95, 96, 97, 98
1232};
1233
1234/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1235 symbol of state STATE-NUM. */
1236static const unsigned char yystos[] =
1237{
1238 0, 14, 15, 121, 122, 123, 223, 0, 123, 107,
1239 124, 125, 9, 10, 108, 126, 127, 226, 38, 108,
1240 127, 109, 15, 24, 45, 47, 56, 128, 129, 130,
1241 10, 61, 88, 88, 57, 88, 3, 130, 110, 25,
1242 27, 42, 46, 52, 53, 54, 58, 63, 68, 70,
1243 78, 87, 89, 94, 96, 97, 98, 131, 132, 133,
1244 135, 141, 144, 147, 177, 186, 223, 226, 15, 21,
1245 111, 142, 143, 223, 226, 50, 136, 138, 139, 140,
1246 223, 226, 43, 133, 3, 14, 15, 26, 28, 30,
1247 40, 44, 48, 51, 62, 67, 69, 71, 80, 81,
1248 95, 107, 146, 171, 183, 184, 186, 224, 146, 134,
1249 111, 111, 112, 107, 111, 138, 50, 112, 107, 32,
1250 114, 157, 167, 218, 219, 220, 117, 85, 85, 75,
1251 55, 85, 148, 149, 183, 223, 3, 117, 3, 143,
1252 108, 223, 140, 108, 107, 23, 79, 93, 221, 168,
1253 169, 45, 56, 222, 223, 226, 108, 112, 113, 113,
1254 107, 16, 17, 172, 173, 174, 223, 6, 7, 8,
1255 10, 11, 12, 13, 49, 67, 90, 107, 178, 180,
1256 181, 217, 223, 226, 125, 137, 16, 17, 159, 160,
1257 10, 14, 15, 22, 31, 60, 82, 83, 170, 171,
1258 183, 184, 185, 223, 84, 109, 190, 191, 192, 3,
1259 149, 226, 223, 226, 145, 117, 179, 117, 113, 15,
1260 16, 37, 73, 167, 175, 176, 212, 213, 167, 175,
1261 176, 108, 112, 115, 39, 107, 72, 107, 190, 107,
1262 190, 107, 214, 107, 109, 21, 35, 49, 50, 65,
1263 84, 90, 99, 107, 109, 181, 193, 194, 195, 198,
1264 199, 200, 201, 206, 207, 208, 217, 223, 226, 109,
1265 167, 5, 182, 173, 182, 226, 178, 178, 212, 117,
1266 212, 212, 92, 158, 212, 212, 99, 161, 162, 160,
1267 29, 106, 155, 156, 166, 167, 226, 171, 34, 152,
1268 153, 154, 166, 167, 226, 72, 152, 72, 106, 108,
1269 215, 216, 217, 226, 150, 151, 167, 226, 193, 100,
1270 29, 105, 118, 197, 33, 34, 223, 193, 110, 101,
1271 102, 103, 104, 112, 187, 188, 100, 189, 109, 197,
1272 107, 193, 5, 16, 17, 212, 86, 226, 116, 108,
1273 112, 167, 72, 108, 112, 212, 167, 225, 226, 108,
1274 225, 108, 112, 109, 108, 112, 110, 195, 107, 118,
1275 105, 64, 199, 192, 107, 108, 110, 106, 195, 195,
1276 195, 193, 64, 199, 119, 209, 210, 110, 107, 180,
1277 217, 226, 156, 167, 154, 212, 218, 218, 216, 180,
1278 217, 151, 196, 118, 106, 202, 203, 226, 112, 110,
1279 117, 211, 226, 108, 112, 163, 169, 169, 110, 110,
1280 182, 108, 112, 190, 194, 211, 117, 210, 4, 18,
1281 114, 164, 165, 174, 203, 19, 73, 77, 204, 205,
1282 226, 164, 108, 165, 115
1283};
vlmfa67ddc2004-06-03 03:38:44 +00001284
1285#define yyerrok (yyerrstatus = 0)
1286#define yyclearin (yychar = YYEMPTY)
vlm7e436752006-03-18 06:53:11 +00001287#define YYEMPTY (-2)
vlmfa67ddc2004-06-03 03:38:44 +00001288#define YYEOF 0
vlm7e436752006-03-18 06:53:11 +00001289
vlmfa67ddc2004-06-03 03:38:44 +00001290#define YYACCEPT goto yyacceptlab
vlm7e436752006-03-18 06:53:11 +00001291#define YYABORT goto yyabortlab
1292#define YYERROR goto yyerrorlab
1293
1294
1295/* Like YYERROR except do call yyerror. This remains here temporarily
1296 to ease the transition to the new meaning of YYERROR, for GCC.
vlmfa67ddc2004-06-03 03:38:44 +00001297 Once GCC version 2 has supplanted version 1, this can go. */
vlm7e436752006-03-18 06:53:11 +00001298
vlmfa67ddc2004-06-03 03:38:44 +00001299#define YYFAIL goto yyerrlab
vlm7e436752006-03-18 06:53:11 +00001300
vlmfa67ddc2004-06-03 03:38:44 +00001301#define YYRECOVERING() (!!yyerrstatus)
vlm7e436752006-03-18 06:53:11 +00001302
1303#define YYBACKUP(Token, Value) \
vlmfa67ddc2004-06-03 03:38:44 +00001304do \
1305 if (yychar == YYEMPTY && yylen == 1) \
vlm7e436752006-03-18 06:53:11 +00001306 { \
1307 yychar = (Token); \
1308 yylval = (Value); \
1309 yytoken = YYTRANSLATE (yychar); \
vlmfa67ddc2004-06-03 03:38:44 +00001310 YYPOPSTACK; \
1311 goto yybackup; \
1312 } \
1313 else \
vlm7e436752006-03-18 06:53:11 +00001314 { \
1315 yyerror (YY_("syntax error: cannot back up")); \
1316 YYERROR; \
1317 } \
vlmfa67ddc2004-06-03 03:38:44 +00001318while (0)
1319
vlm7e436752006-03-18 06:53:11 +00001320
vlmfa67ddc2004-06-03 03:38:44 +00001321#define YYTERROR 1
1322#define YYERRCODE 256
1323
vlm7e436752006-03-18 06:53:11 +00001324
1325/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1326 If N is 0, then set CURRENT to the empty location which ends
1327 the previous symbol: RHS[0] (always defined). */
1328
1329#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1330#ifndef YYLLOC_DEFAULT
1331# define YYLLOC_DEFAULT(Current, Rhs, N) \
1332 do \
1333 if (N) \
1334 { \
1335 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1336 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1337 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1338 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1339 } \
1340 else \
1341 { \
1342 (Current).first_line = (Current).last_line = \
1343 YYRHSLOC (Rhs, 0).last_line; \
1344 (Current).first_column = (Current).last_column = \
1345 YYRHSLOC (Rhs, 0).last_column; \
1346 } \
1347 while (0)
vlmfa67ddc2004-06-03 03:38:44 +00001348#endif
1349
vlm7e436752006-03-18 06:53:11 +00001350
1351/* YY_LOCATION_PRINT -- Print the location on the stream.
1352 This macro was not mandated originally: define only if we know
1353 we won't break user code: when these are the locations we know. */
1354
1355#ifndef YY_LOCATION_PRINT
1356# if YYLTYPE_IS_TRIVIAL
1357# define YY_LOCATION_PRINT(File, Loc) \
1358 fprintf (File, "%d.%d-%d.%d", \
1359 (Loc).first_line, (Loc).first_column, \
1360 (Loc).last_line, (Loc).last_column)
1361# else
1362# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1363# endif
1364#endif
1365
1366
1367/* YYLEX -- calling `yylex' with the right arguments. */
1368
vlm6a02a8a2004-09-08 00:28:11 +00001369#ifdef YYLEX_PARAM
vlm7e436752006-03-18 06:53:11 +00001370# define YYLEX yylex (YYLEX_PARAM)
vlm6a02a8a2004-09-08 00:28:11 +00001371#else
vlm7e436752006-03-18 06:53:11 +00001372# define YYLEX yylex ()
vlm6a02a8a2004-09-08 00:28:11 +00001373#endif
vlm7e436752006-03-18 06:53:11 +00001374
1375/* Enable debugging if requested. */
1376#if YYDEBUG
1377
1378# ifndef YYFPRINTF
1379# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1380# define YYFPRINTF fprintf
1381# endif
1382
1383# define YYDPRINTF(Args) \
1384do { \
1385 if (yydebug) \
1386 YYFPRINTF Args; \
1387} while (0)
1388
1389# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1390do { \
1391 if (yydebug) \
1392 { \
1393 YYFPRINTF (stderr, "%s ", Title); \
1394 yysymprint (stderr, \
1395 Type, Value); \
1396 YYFPRINTF (stderr, "\n"); \
1397 } \
1398} while (0)
1399
1400/*------------------------------------------------------------------.
1401| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1402| TOP (included). |
1403`------------------------------------------------------------------*/
1404
1405#if defined (__STDC__) || defined (__cplusplus)
1406static void
1407yy_stack_print (short int *bottom, short int *top)
vlm6a02a8a2004-09-08 00:28:11 +00001408#else
vlm7e436752006-03-18 06:53:11 +00001409static void
1410yy_stack_print (bottom, top)
1411 short int *bottom;
1412 short int *top;
vlm6a02a8a2004-09-08 00:28:11 +00001413#endif
vlm7e436752006-03-18 06:53:11 +00001414{
1415 YYFPRINTF (stderr, "Stack now");
1416 for (/* Nothing. */; bottom <= top; ++bottom)
1417 YYFPRINTF (stderr, " %d", *bottom);
1418 YYFPRINTF (stderr, "\n");
1419}
1420
1421# define YY_STACK_PRINT(Bottom, Top) \
1422do { \
1423 if (yydebug) \
1424 yy_stack_print ((Bottom), (Top)); \
1425} while (0)
1426
1427
1428/*------------------------------------------------.
1429| Report that the YYRULE is going to be reduced. |
1430`------------------------------------------------*/
1431
1432#if defined (__STDC__) || defined (__cplusplus)
1433static void
1434yy_reduce_print (int yyrule)
1435#else
1436static void
1437yy_reduce_print (yyrule)
1438 int yyrule;
vlm6a02a8a2004-09-08 00:28:11 +00001439#endif
vlm7e436752006-03-18 06:53:11 +00001440{
1441 int yyi;
1442 unsigned long int yylno = yyrline[yyrule];
1443 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1444 yyrule - 1, yylno);
1445 /* Print the symbols being reduced, and their result. */
1446 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1447 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1448 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
1449}
vlmfa67ddc2004-06-03 03:38:44 +00001450
vlm7e436752006-03-18 06:53:11 +00001451# define YY_REDUCE_PRINT(Rule) \
1452do { \
1453 if (yydebug) \
1454 yy_reduce_print (Rule); \
1455} while (0)
vlmfa67ddc2004-06-03 03:38:44 +00001456
vlm7e436752006-03-18 06:53:11 +00001457/* Nonzero means print parse trace. It is left uninitialized so that
1458 multiple parsers can coexist. */
1459int yydebug;
1460#else /* !YYDEBUG */
1461# define YYDPRINTF(Args)
1462# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1463# define YY_STACK_PRINT(Bottom, Top)
1464# define YY_REDUCE_PRINT(Rule)
1465#endif /* !YYDEBUG */
vlmfa67ddc2004-06-03 03:38:44 +00001466
vlmfa67ddc2004-06-03 03:38:44 +00001467
vlm7e436752006-03-18 06:53:11 +00001468/* YYINITDEPTH -- initial size of the parser's stacks. */
vlmfa67ddc2004-06-03 03:38:44 +00001469#ifndef YYINITDEPTH
vlm7e436752006-03-18 06:53:11 +00001470# define YYINITDEPTH 200
vlmfa67ddc2004-06-03 03:38:44 +00001471#endif
1472
vlm7e436752006-03-18 06:53:11 +00001473/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1474 if the built-in stack extension method is used).
vlmfa67ddc2004-06-03 03:38:44 +00001475
vlm7e436752006-03-18 06:53:11 +00001476 Do not make this value too large; the results are undefined if
1477 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1478 evaluated with infinite-precision integer arithmetic. */
vlmfa67ddc2004-06-03 03:38:44 +00001479
1480#ifndef YYMAXDEPTH
vlm7e436752006-03-18 06:53:11 +00001481# define YYMAXDEPTH 10000
vlmfa67ddc2004-06-03 03:38:44 +00001482#endif
vlm7e436752006-03-18 06:53:11 +00001483
vlmfa67ddc2004-06-03 03:38:44 +00001484
vlmfa67ddc2004-06-03 03:38:44 +00001485
vlm7e436752006-03-18 06:53:11 +00001486#if YYERROR_VERBOSE
vlmfa67ddc2004-06-03 03:38:44 +00001487
vlm7e436752006-03-18 06:53:11 +00001488# ifndef yystrlen
1489# if defined (__GLIBC__) && defined (_STRING_H)
1490# define yystrlen strlen
1491# else
1492/* Return the length of YYSTR. */
1493static YYSIZE_T
1494# if defined (__STDC__) || defined (__cplusplus)
1495yystrlen (const char *yystr)
1496# else
1497yystrlen (yystr)
1498 const char *yystr;
1499# endif
vlm80103492004-09-07 10:39:09 +00001500{
vlm7e436752006-03-18 06:53:11 +00001501 const char *yys = yystr;
vlm80103492004-09-07 10:39:09 +00001502
vlm7e436752006-03-18 06:53:11 +00001503 while (*yys++ != '\0')
1504 continue;
1505
1506 return yys - yystr - 1;
vlm80103492004-09-07 10:39:09 +00001507}
vlm7e436752006-03-18 06:53:11 +00001508# endif
1509# endif
vlm80103492004-09-07 10:39:09 +00001510
vlm7e436752006-03-18 06:53:11 +00001511# ifndef yystpcpy
1512# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1513# define yystpcpy stpcpy
1514# else
1515/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1516 YYDEST. */
1517static char *
1518# if defined (__STDC__) || defined (__cplusplus)
1519yystpcpy (char *yydest, const char *yysrc)
1520# else
1521yystpcpy (yydest, yysrc)
1522 char *yydest;
1523 const char *yysrc;
1524# endif
vlm80103492004-09-07 10:39:09 +00001525{
vlm7e436752006-03-18 06:53:11 +00001526 char *yyd = yydest;
1527 const char *yys = yysrc;
vlm80103492004-09-07 10:39:09 +00001528
vlm7e436752006-03-18 06:53:11 +00001529 while ((*yyd++ = *yys++) != '\0')
1530 continue;
1531
1532 return yyd - 1;
vlm044f7442004-09-04 04:49:21 +00001533}
vlm7e436752006-03-18 06:53:11 +00001534# endif
1535# endif
vlm044f7442004-09-04 04:49:21 +00001536
vlm7e436752006-03-18 06:53:11 +00001537# ifndef yytnamerr
1538/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1539 quotes and backslashes, so that it's suitable for yyerror. The
1540 heuristic is that double-quoting is unnecessary unless the string
1541 contains an apostrophe, a comma, or backslash (other than
1542 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1543 null, do not copy; instead, return the length of what the result
1544 would have been. */
1545static YYSIZE_T
1546yytnamerr (char *yyres, const char *yystr)
1547{
1548 if (*yystr == '"')
1549 {
1550 size_t yyn = 0;
1551 char const *yyp = yystr;
1552
1553 for (;;)
1554 switch (*++yyp)
1555 {
1556 case '\'':
1557 case ',':
1558 goto do_not_strip_quotes;
1559
1560 case '\\':
1561 if (*++yyp != '\\')
1562 goto do_not_strip_quotes;
1563 /* Fall through. */
1564 default:
1565 if (yyres)
1566 yyres[yyn] = *yyp;
1567 yyn++;
1568 break;
1569
1570 case '"':
1571 if (yyres)
1572 yyres[yyn] = '\0';
1573 return yyn;
1574 }
1575 do_not_strip_quotes: ;
1576 }
1577
1578 if (! yyres)
1579 return yystrlen (yystr);
1580
1581 return yystpcpy (yyres, yystr) - yyres;
1582}
1583# endif
1584
1585#endif /* YYERROR_VERBOSE */
1586
vlmfa67ddc2004-06-03 03:38:44 +00001587
vlmfa67ddc2004-06-03 03:38:44 +00001588
vlm7e436752006-03-18 06:53:11 +00001589#if YYDEBUG
1590/*--------------------------------.
1591| Print this symbol on YYOUTPUT. |
1592`--------------------------------*/
vlmfa67ddc2004-06-03 03:38:44 +00001593
vlm7e436752006-03-18 06:53:11 +00001594#if defined (__STDC__) || defined (__cplusplus)
1595static void
1596yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
vlm6a02a8a2004-09-08 00:28:11 +00001597#else
vlm7e436752006-03-18 06:53:11 +00001598static void
1599yysymprint (yyoutput, yytype, yyvaluep)
1600 FILE *yyoutput;
1601 int yytype;
1602 YYSTYPE *yyvaluep;
1603#endif
1604{
1605 /* Pacify ``unused variable'' warnings. */
1606 (void) yyvaluep;
1607
1608 if (yytype < YYNTOKENS)
1609 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1610 else
1611 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1612
1613
1614# ifdef YYPRINT
1615 if (yytype < YYNTOKENS)
1616 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1617# endif
1618 switch (yytype)
1619 {
1620 default:
1621 break;
1622 }
1623 YYFPRINTF (yyoutput, ")");
1624}
1625
1626#endif /* ! YYDEBUG */
1627/*-----------------------------------------------.
1628| Release the memory associated to this symbol. |
1629`-----------------------------------------------*/
1630
1631#if defined (__STDC__) || defined (__cplusplus)
1632static void
1633yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1634#else
1635static void
1636yydestruct (yymsg, yytype, yyvaluep)
1637 const char *yymsg;
1638 int yytype;
1639 YYSTYPE *yyvaluep;
1640#endif
1641{
1642 /* Pacify ``unused variable'' warnings. */
1643 (void) yyvaluep;
1644
1645 if (!yymsg)
1646 yymsg = "Deleting";
1647 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1648
1649 switch (yytype)
1650 {
1651
1652 default:
1653 break;
1654 }
1655}
1656
1657
1658/* Prevent warnings from -Wmissing-prototypes. */
1659
1660#ifdef YYPARSE_PARAM
1661# if defined (__STDC__) || defined (__cplusplus)
1662int yyparse (void *YYPARSE_PARAM);
1663# else
1664int yyparse ();
1665# endif
1666#else /* ! YYPARSE_PARAM */
1667#if defined (__STDC__) || defined (__cplusplus)
vlmfa67ddc2004-06-03 03:38:44 +00001668int yyparse (void);
vlm6a02a8a2004-09-08 00:28:11 +00001669#else
vlm7e436752006-03-18 06:53:11 +00001670int yyparse ();
1671#endif
1672#endif /* ! YYPARSE_PARAM */
1673
1674
1675
1676/* The look-ahead symbol. */
1677int yychar;
1678
1679/* The semantic value of the look-ahead symbol. */
1680YYSTYPE yylval;
1681
1682/* Number of syntax errors so far. */
1683int yynerrs;
1684
1685
1686
1687/*----------.
1688| yyparse. |
1689`----------*/
1690
1691#ifdef YYPARSE_PARAM
1692# if defined (__STDC__) || defined (__cplusplus)
1693int yyparse (void *YYPARSE_PARAM)
1694# else
1695int yyparse (YYPARSE_PARAM)
1696 void *YYPARSE_PARAM;
1697# endif
1698#else /* ! YYPARSE_PARAM */
1699#if defined (__STDC__) || defined (__cplusplus)
1700int
1701yyparse (void)
1702#else
1703int
1704yyparse ()
1705 ;
1706#endif
1707#endif
1708{
1709
1710 int yystate;
1711 int yyn;
1712 int yyresult;
1713 /* Number of tokens to shift before error messages enabled. */
1714 int yyerrstatus;
1715 /* Look-ahead token as an internal (translated) token number. */
1716 int yytoken = 0;
1717
1718 /* Three stacks and their tools:
1719 `yyss': related to states,
1720 `yyvs': related to semantic values,
1721 `yyls': related to locations.
1722
1723 Refer to the stacks thru separate pointers, to allow yyoverflow
1724 to reallocate them elsewhere. */
1725
1726 /* The state stack. */
1727 short int yyssa[YYINITDEPTH];
1728 short int *yyss = yyssa;
1729 short int *yyssp;
1730
1731 /* The semantic value stack. */
1732 YYSTYPE yyvsa[YYINITDEPTH];
1733 YYSTYPE *yyvs = yyvsa;
1734 YYSTYPE *yyvsp;
1735
1736
1737
vlmfa67ddc2004-06-03 03:38:44 +00001738#define YYPOPSTACK (yyvsp--, yyssp--)
vlmfa67ddc2004-06-03 03:38:44 +00001739
vlm7e436752006-03-18 06:53:11 +00001740 YYSIZE_T yystacksize = YYINITDEPTH;
vlmfa67ddc2004-06-03 03:38:44 +00001741
vlm7e436752006-03-18 06:53:11 +00001742 /* The variables used to return semantic value and location from the
1743 action routines. */
1744 YYSTYPE yyval;
vlmfa67ddc2004-06-03 03:38:44 +00001745
vlmfa67ddc2004-06-03 03:38:44 +00001746
vlm7e436752006-03-18 06:53:11 +00001747 /* When reducing, the number of symbols on the RHS of the reduced
1748 rule. */
vlmfa67ddc2004-06-03 03:38:44 +00001749 int yylen;
1750
vlm7e436752006-03-18 06:53:11 +00001751 YYDPRINTF ((stderr, "Starting parse\n"));
vlmfa67ddc2004-06-03 03:38:44 +00001752
1753 yystate = 0;
1754 yyerrstatus = 0;
1755 yynerrs = 0;
1756 yychar = YYEMPTY; /* Cause a token to be read. */
1757
1758 /* Initialize stack pointers.
1759 Waste one element of value and location stack
1760 so that they stay on the same level as the state stack.
1761 The wasted elements are never initialized. */
1762
vlm7e436752006-03-18 06:53:11 +00001763 yyssp = yyss;
vlmfa67ddc2004-06-03 03:38:44 +00001764 yyvsp = yyvs;
vlmfa67ddc2004-06-03 03:38:44 +00001765
vlm7e436752006-03-18 06:53:11 +00001766 goto yysetstate;
vlmfa67ddc2004-06-03 03:38:44 +00001767
vlm7e436752006-03-18 06:53:11 +00001768/*------------------------------------------------------------.
1769| yynewstate -- Push a new state, which is found in yystate. |
1770`------------------------------------------------------------*/
1771 yynewstate:
1772 /* In all cases, when you get here, the value and location stacks
1773 have just been pushed. so pushing a state here evens the stacks.
1774 */
1775 yyssp++;
vlmfa67ddc2004-06-03 03:38:44 +00001776
vlm7e436752006-03-18 06:53:11 +00001777 yysetstate:
1778 *yyssp = yystate;
1779
1780 if (yyss + yystacksize - 1 <= yyssp)
vlmfa67ddc2004-06-03 03:38:44 +00001781 {
vlmfa67ddc2004-06-03 03:38:44 +00001782 /* Get the current used size of the three stacks, in elements. */
vlm7e436752006-03-18 06:53:11 +00001783 YYSIZE_T yysize = yyssp - yyss + 1;
vlmfa67ddc2004-06-03 03:38:44 +00001784
1785#ifdef yyoverflow
vlm7e436752006-03-18 06:53:11 +00001786 {
1787 /* Give user a chance to reallocate the stack. Use copies of
1788 these so that the &'s don't force the real ones into
1789 memory. */
1790 YYSTYPE *yyvs1 = yyvs;
1791 short int *yyss1 = yyss;
vlmfa67ddc2004-06-03 03:38:44 +00001792
vlm7e436752006-03-18 06:53:11 +00001793
1794 /* Each stack pointer address is followed by the size of the
1795 data in use in that stack, in bytes. This used to be a
1796 conditional around just the two extra args, but that might
1797 be undefined if yyoverflow is a macro. */
1798 yyoverflow (YY_("memory exhausted"),
1799 &yyss1, yysize * sizeof (*yyssp),
1800 &yyvs1, yysize * sizeof (*yyvsp),
1801
1802 &yystacksize);
1803
1804 yyss = yyss1;
1805 yyvs = yyvs1;
1806 }
vlmfa67ddc2004-06-03 03:38:44 +00001807#else /* no yyoverflow */
vlm7e436752006-03-18 06:53:11 +00001808# ifndef YYSTACK_RELOCATE
1809 goto yyexhaustedlab;
1810# else
vlmfa67ddc2004-06-03 03:38:44 +00001811 /* Extend the stack our own way. */
vlm7e436752006-03-18 06:53:11 +00001812 if (YYMAXDEPTH <= yystacksize)
1813 goto yyexhaustedlab;
vlmfa67ddc2004-06-03 03:38:44 +00001814 yystacksize *= 2;
vlm7e436752006-03-18 06:53:11 +00001815 if (YYMAXDEPTH < yystacksize)
vlmfa67ddc2004-06-03 03:38:44 +00001816 yystacksize = YYMAXDEPTH;
vlm7e436752006-03-18 06:53:11 +00001817
1818 {
1819 short int *yyss1 = yyss;
1820 union yyalloc *yyptr =
1821 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1822 if (! yyptr)
1823 goto yyexhaustedlab;
1824 YYSTACK_RELOCATE (yyss);
1825 YYSTACK_RELOCATE (yyvs);
1826
1827# undef YYSTACK_RELOCATE
1828 if (yyss1 != yyssa)
1829 YYSTACK_FREE (yyss1);
1830 }
1831# endif
vlmfa67ddc2004-06-03 03:38:44 +00001832#endif /* no yyoverflow */
1833
vlm7e436752006-03-18 06:53:11 +00001834 yyssp = yyss + yysize - 1;
1835 yyvsp = yyvs + yysize - 1;
vlmfa67ddc2004-06-03 03:38:44 +00001836
vlmfa67ddc2004-06-03 03:38:44 +00001837
vlm7e436752006-03-18 06:53:11 +00001838 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1839 (unsigned long int) yystacksize));
1840
1841 if (yyss + yystacksize - 1 <= yyssp)
vlmfa67ddc2004-06-03 03:38:44 +00001842 YYABORT;
1843 }
1844
vlm7e436752006-03-18 06:53:11 +00001845 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
vlmfa67ddc2004-06-03 03:38:44 +00001846
1847 goto yybackup;
vlm7e436752006-03-18 06:53:11 +00001848
1849/*-----------.
1850| yybackup. |
1851`-----------*/
1852yybackup:
vlmfa67ddc2004-06-03 03:38:44 +00001853
1854/* Do appropriate processing given the current state. */
vlm7e436752006-03-18 06:53:11 +00001855/* Read a look-ahead token if we need one and don't already have one. */
vlmfa67ddc2004-06-03 03:38:44 +00001856/* yyresume: */
1857
vlm7e436752006-03-18 06:53:11 +00001858 /* First try to decide what to do without reference to look-ahead token. */
vlmfa67ddc2004-06-03 03:38:44 +00001859
1860 yyn = yypact[yystate];
vlm7e436752006-03-18 06:53:11 +00001861 if (yyn == YYPACT_NINF)
vlmfa67ddc2004-06-03 03:38:44 +00001862 goto yydefault;
1863
vlm7e436752006-03-18 06:53:11 +00001864 /* Not known => get a look-ahead token if don't already have one. */
vlmfa67ddc2004-06-03 03:38:44 +00001865
vlm7e436752006-03-18 06:53:11 +00001866 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
vlmfa67ddc2004-06-03 03:38:44 +00001867 if (yychar == YYEMPTY)
1868 {
vlm7e436752006-03-18 06:53:11 +00001869 YYDPRINTF ((stderr, "Reading a token: "));
vlmfa67ddc2004-06-03 03:38:44 +00001870 yychar = YYLEX;
1871 }
1872
vlm7e436752006-03-18 06:53:11 +00001873 if (yychar <= YYEOF)
vlmfa67ddc2004-06-03 03:38:44 +00001874 {
vlm7e436752006-03-18 06:53:11 +00001875 yychar = yytoken = YYEOF;
1876 YYDPRINTF ((stderr, "Now at end of input.\n"));
vlmfa67ddc2004-06-03 03:38:44 +00001877 }
1878 else
1879 {
vlm7e436752006-03-18 06:53:11 +00001880 yytoken = YYTRANSLATE (yychar);
1881 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
vlmfa67ddc2004-06-03 03:38:44 +00001882 }
1883
vlm7e436752006-03-18 06:53:11 +00001884 /* If the proper action on seeing token YYTOKEN is to reduce or to
1885 detect an error, take that action. */
1886 yyn += yytoken;
1887 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
vlmfa67ddc2004-06-03 03:38:44 +00001888 goto yydefault;
vlmfa67ddc2004-06-03 03:38:44 +00001889 yyn = yytable[yyn];
vlm7e436752006-03-18 06:53:11 +00001890 if (yyn <= 0)
vlmfa67ddc2004-06-03 03:38:44 +00001891 {
vlm7e436752006-03-18 06:53:11 +00001892 if (yyn == 0 || yyn == YYTABLE_NINF)
vlmfa67ddc2004-06-03 03:38:44 +00001893 goto yyerrlab;
1894 yyn = -yyn;
1895 goto yyreduce;
1896 }
vlmfa67ddc2004-06-03 03:38:44 +00001897
1898 if (yyn == YYFINAL)
1899 YYACCEPT;
1900
vlm7e436752006-03-18 06:53:11 +00001901 /* Shift the look-ahead token. */
1902 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
vlmfa67ddc2004-06-03 03:38:44 +00001903
1904 /* Discard the token being shifted unless it is eof. */
1905 if (yychar != YYEOF)
1906 yychar = YYEMPTY;
1907
1908 *++yyvsp = yylval;
vlmfa67ddc2004-06-03 03:38:44 +00001909
vlm7e436752006-03-18 06:53:11 +00001910
1911 /* Count tokens shifted since error; after three, turn off error
1912 status. */
1913 if (yyerrstatus)
1914 yyerrstatus--;
vlmfa67ddc2004-06-03 03:38:44 +00001915
1916 yystate = yyn;
1917 goto yynewstate;
1918
vlm6a02a8a2004-09-08 00:28:11 +00001919
vlm7e436752006-03-18 06:53:11 +00001920/*-----------------------------------------------------------.
1921| yydefault -- do the default action for the current state. |
1922`-----------------------------------------------------------*/
1923yydefault:
vlmfa67ddc2004-06-03 03:38:44 +00001924 yyn = yydefact[yystate];
1925 if (yyn == 0)
1926 goto yyerrlab;
vlm7e436752006-03-18 06:53:11 +00001927 goto yyreduce;
vlmfa67ddc2004-06-03 03:38:44 +00001928
vlm7e436752006-03-18 06:53:11 +00001929
1930/*-----------------------------.
1931| yyreduce -- Do a reduction. |
1932`-----------------------------*/
vlmfa67ddc2004-06-03 03:38:44 +00001933yyreduce:
vlm7e436752006-03-18 06:53:11 +00001934 /* yyn is the number of a rule to reduce with. */
vlmfa67ddc2004-06-03 03:38:44 +00001935 yylen = yyr2[yyn];
vlmfa67ddc2004-06-03 03:38:44 +00001936
vlm7e436752006-03-18 06:53:11 +00001937 /* If YYLEN is nonzero, implement the default value of the action:
1938 `$$ = $1'.
1939
1940 Otherwise, the following line sets YYVAL to garbage.
1941 This behavior is undocumented and Bison
1942 users should not rely upon it. Assigning to YYVAL
1943 unconditionally makes the parser a bit smaller, and it avoids a
1944 GCC warning that YYVAL may be used uninitialized. */
1945 yyval = yyvsp[1-yylen];
1946
1947
1948 YY_REDUCE_PRINT (yyn);
1949 switch (yyn)
vlmfa67ddc2004-06-03 03:38:44 +00001950 {
vlm7e436752006-03-18 06:53:11 +00001951 case 2:
vlm7259fdc2006-03-16 22:39:56 +00001952#line 322 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00001953 {
1954 *(void **)param = (yyvsp[0].a_grammar);
1955 }
1956 break;
vlmfa67ddc2004-06-03 03:38:44 +00001957
vlm7e436752006-03-18 06:53:11 +00001958 case 3:
1959#line 328 "asn1p_y.y"
1960 {
1961 (yyval.a_grammar) = asn1p_new();
1962 checkmem((yyval.a_grammar));
1963 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[0].a_module), mod_next);
1964 }
1965 break;
1966
1967 case 4:
1968#line 333 "asn1p_y.y"
1969 {
1970 (yyval.a_grammar) = (yyvsp[-1].a_grammar);
1971 TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[0].a_module), mod_next);
1972 }
1973 break;
1974
1975 case 5:
1976#line 354 "asn1p_y.y"
1977 {
1978
1979 if((yyvsp[-1].a_module)) {
1980 (yyval.a_module) = (yyvsp[-1].a_module);
vlmfa67ddc2004-06-03 03:38:44 +00001981 } else {
1982 /* There's a chance that a module is just plain empty */
vlm7e436752006-03-18 06:53:11 +00001983 (yyval.a_module) = asn1p_module_new();
vlmfa67ddc2004-06-03 03:38:44 +00001984 }
vlm7e436752006-03-18 06:53:11 +00001985 checkmem((yyval.a_module));
vlmfa67ddc2004-06-03 03:38:44 +00001986
vlm7e436752006-03-18 06:53:11 +00001987 (yyval.a_module)->ModuleName = (yyvsp[-7].tv_str);
1988 (yyval.a_module)->module_oid = (yyvsp[-6].a_oid);
1989 (yyval.a_module)->module_flags = (yyvsp[-4].a_module_flags);
1990 }
1991 break;
1992
1993 case 6:
vlm7259fdc2006-03-16 22:39:56 +00001994#line 375 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00001995 { (yyval.a_oid) = 0; }
1996 break;
1997
1998 case 7:
vlm7259fdc2006-03-16 22:39:56 +00001999#line 376 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002000 { (yyval.a_oid) = (yyvsp[0].a_oid); }
2001 break;
2002
2003 case 8:
vlm7259fdc2006-03-16 22:39:56 +00002004#line 380 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002005 {
2006 (yyval.a_oid) = (yyvsp[-1].a_oid);
2007 }
2008 break;
2009
2010 case 9:
vlm7259fdc2006-03-16 22:39:56 +00002011#line 383 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002012 {
2013 (yyval.a_oid) = 0;
2014 }
2015 break;
2016
2017 case 10:
vlm7259fdc2006-03-16 22:39:56 +00002018#line 389 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002019 {
2020 (yyval.a_oid) = asn1p_oid_new();
2021 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[0].a_oid_arc));
2022 if((yyvsp[0].a_oid_arc).name)
2023 free((yyvsp[0].a_oid_arc).name);
2024 }
2025 break;
2026
2027 case 11:
vlm7259fdc2006-03-16 22:39:56 +00002028#line 395 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002029 {
2030 (yyval.a_oid) = (yyvsp[-1].a_oid);
2031 asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[0].a_oid_arc));
2032 if((yyvsp[0].a_oid_arc).name)
2033 free((yyvsp[0].a_oid_arc).name);
2034 }
2035 break;
2036
2037 case 12:
vlm7259fdc2006-03-16 22:39:56 +00002038#line 404 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002039 { /* iso */
2040 (yyval.a_oid_arc).name = (yyvsp[0].tv_str);
2041 (yyval.a_oid_arc).number = -1;
2042 }
2043 break;
2044
2045 case 13:
vlm7259fdc2006-03-16 22:39:56 +00002046#line 408 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002047 { /* iso(1) */
2048 (yyval.a_oid_arc).name = (yyvsp[-3].tv_str);
2049 (yyval.a_oid_arc).number = (yyvsp[-1].a_int);
2050 }
2051 break;
2052
2053 case 14:
vlm7259fdc2006-03-16 22:39:56 +00002054#line 412 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002055 { /* 1 */
2056 (yyval.a_oid_arc).name = 0;
2057 (yyval.a_oid_arc).number = (yyvsp[0].a_int);
2058 }
2059 break;
2060
2061 case 15:
vlm7259fdc2006-03-16 22:39:56 +00002062#line 422 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002063 { (yyval.a_module_flags) = MSF_NOFLAGS; }
2064 break;
2065
2066 case 16:
vlm7259fdc2006-03-16 22:39:56 +00002067#line 423 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002068 {
2069 (yyval.a_module_flags) = (yyvsp[0].a_module_flags);
2070 }
2071 break;
2072
2073 case 17:
vlm7259fdc2006-03-16 22:39:56 +00002074#line 432 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002075 {
2076 (yyval.a_module_flags) = (yyvsp[0].a_module_flags);
2077 }
2078 break;
2079
2080 case 18:
vlm7259fdc2006-03-16 22:39:56 +00002081#line 435 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002082 {
2083 (yyval.a_module_flags) = (yyvsp[-1].a_module_flags) | (yyvsp[0].a_module_flags);
2084 }
2085 break;
2086
2087 case 19:
vlm7259fdc2006-03-16 22:39:56 +00002088#line 444 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002089 {
2090 (yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
2091 }
2092 break;
2093
2094 case 20:
vlm7259fdc2006-03-16 22:39:56 +00002095#line 447 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002096 {
2097 (yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
2098 }
2099 break;
2100
2101 case 21:
vlm7259fdc2006-03-16 22:39:56 +00002102#line 450 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002103 {
2104 (yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
2105 }
2106 break;
2107
2108 case 22:
vlm7259fdc2006-03-16 22:39:56 +00002109#line 453 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002110 {
2111 (yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
2112 }
2113 break;
2114
2115 case 23:
vlm7259fdc2006-03-16 22:39:56 +00002116#line 457 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002117 {
vlm9283dbe2004-08-18 04:59:12 +00002118 /* X.680Amd1 specifies TAG and XER */
vlm7e436752006-03-18 06:53:11 +00002119 if(strcmp((yyvsp[-1].tv_str), "TAG") == 0) {
2120 (yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
2121 } else if(strcmp((yyvsp[-1].tv_str), "XER") == 0) {
2122 (yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
vlm9283dbe2004-08-18 04:59:12 +00002123 } else {
2124 fprintf(stderr,
2125 "WARNING: %s INSTRUCTIONS at line %d: "
2126 "Unrecognized encoding reference\n",
vlm7e436752006-03-18 06:53:11 +00002127 (yyvsp[-1].tv_str), yylineno);
2128 (yyval.a_module_flags) = MSF_unk_INSTRUCTIONS;
vlm9283dbe2004-08-18 04:59:12 +00002129 }
vlm7e436752006-03-18 06:53:11 +00002130 free((yyvsp[-1].tv_str));
2131 }
2132 break;
2133
2134 case 24:
vlm7259fdc2006-03-16 22:39:56 +00002135#line 478 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002136 { (yyval.a_module) = 0; }
2137 break;
2138
2139 case 25:
vlm7259fdc2006-03-16 22:39:56 +00002140#line 479 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002141 {
2142 (yyval.a_module) = (yyvsp[0].a_module);
2143 }
2144 break;
2145
2146 case 26:
vlm7259fdc2006-03-16 22:39:56 +00002147#line 488 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002148 {
2149 (yyval.a_module) = (yyvsp[0].a_module);
2150 }
2151 break;
2152
2153 case 27:
vlm7259fdc2006-03-16 22:39:56 +00002154#line 491 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002155 {
2156 (yyval.a_module) = (yyvsp[-1].a_module);
vlmfa67ddc2004-06-03 03:38:44 +00002157
vlm9283dbe2004-08-18 04:59:12 +00002158 /* Behave well when one of them is skipped. */
vlm7e436752006-03-18 06:53:11 +00002159 if(!((yyvsp[-1].a_module))) {
2160 if((yyvsp[0].a_module)) (yyval.a_module) = (yyvsp[0].a_module);
vlm9283dbe2004-08-18 04:59:12 +00002161 break;
2162 }
2163
vlmfa67ddc2004-06-03 03:38:44 +00002164#ifdef MY_IMPORT
2165#error MY_IMPORT DEFINED ELSEWHERE!
2166#endif
2167#define MY_IMPORT(foo,field) do { \
vlm7e436752006-03-18 06:53:11 +00002168 while(TQ_FIRST(&((yyvsp[0].a_module)->foo))) { \
2169 TQ_ADD(&((yyval.a_module)->foo), \
2170 TQ_REMOVE(&((yyvsp[0].a_module)->foo), field), \
vlmfa67ddc2004-06-03 03:38:44 +00002171 field); \
vlm97ed7152004-08-13 12:31:09 +00002172 } \
vlm7e436752006-03-18 06:53:11 +00002173 assert(TQ_FIRST(&((yyvsp[0].a_module)->foo)) == 0); \
vlm97ed7152004-08-13 12:31:09 +00002174 } while(0)
vlmfa67ddc2004-06-03 03:38:44 +00002175
2176 MY_IMPORT(imports, xp_next);
2177 MY_IMPORT(exports, xp_next);
2178 MY_IMPORT(members, next);
2179#undef MY_IMPORT
2180
vlm7e436752006-03-18 06:53:11 +00002181 }
2182 break;
2183
2184 case 28:
vlm7259fdc2006-03-16 22:39:56 +00002185#line 524 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002186 {
2187 (yyval.a_module) = (yyvsp[0].a_module);
2188 }
2189 break;
2190
2191 case 29:
vlm7259fdc2006-03-16 22:39:56 +00002192#line 527 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002193 {
2194 (yyval.a_module) = asn1p_module_new();
2195 checkmem((yyval.a_module));
2196 if((yyvsp[0].a_xports)) {
2197 TQ_ADD(&((yyval.a_module)->exports), (yyvsp[0].a_xports), xp_next);
vlmfa67ddc2004-06-03 03:38:44 +00002198 } else {
2199 /* "EXPORTS ALL;" ? */
2200 }
vlm7e436752006-03-18 06:53:11 +00002201 }
2202 break;
2203
2204 case 30:
vlm7259fdc2006-03-16 22:39:56 +00002205#line 536 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002206 {
2207 (yyval.a_module) = asn1p_module_new();
2208 checkmem((yyval.a_module));
2209 assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
2210 assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
2211 TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
2212 }
2213 break;
2214
2215 case 31:
vlm7259fdc2006-03-16 22:39:56 +00002216#line 543 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002217 {
2218 (yyval.a_module) = asn1p_module_new();
2219 checkmem((yyval.a_module));
2220 assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
2221 assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
2222 TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
2223 }
2224 break;
2225
2226 case 32:
vlm7259fdc2006-03-16 22:39:56 +00002227#line 556 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002228 {
2229 (yyval.a_module) = asn1p_module_new();
2230 checkmem((yyval.a_module));
2231 assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
2232 assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
2233 TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
2234 }
2235 break;
2236
2237 case 33:
vlm7259fdc2006-03-16 22:39:56 +00002238#line 564 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002239 { asn1p_lexer_hack_push_encoding_control(); }
2240 break;
2241
2242 case 34:
vlm7259fdc2006-03-16 22:39:56 +00002243#line 565 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002244 {
vlm9283dbe2004-08-18 04:59:12 +00002245 fprintf(stderr,
2246 "WARNING: ENCODING-CONTROL %s "
2247 "specification at line %d ignored\n",
vlm7e436752006-03-18 06:53:11 +00002248 (yyvsp[-1].tv_str), yylineno);
2249 free((yyvsp[-1].tv_str));
2250 (yyval.a_module) = 0;
2251 }
2252 break;
2253
2254 case 35:
vlm7259fdc2006-03-16 22:39:56 +00002255#line 577 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002256 {
vlmfa67ddc2004-06-03 03:38:44 +00002257 return yyerror(
vlm1ac75e72005-11-26 11:21:55 +00002258 "Attempt to redefine a standard basic string type, "
2259 "please comment out or remove this type redefinition.");
vlm7e436752006-03-18 06:53:11 +00002260 }
2261 break;
2262
2263 case 36:
vlm7259fdc2006-03-16 22:39:56 +00002264#line 590 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002265 {
vlm931aeed2005-08-12 10:09:10 +00002266 if(!saved_aid && 0)
2267 return yyerror("Unterminated IMPORTS FROM, "
2268 "expected semicolon ';'");
2269 saved_aid = 0;
vlm7e436752006-03-18 06:53:11 +00002270 (yyval.a_module) = (yyvsp[-1].a_module);
2271 }
2272 break;
2273
2274 case 37:
vlm7259fdc2006-03-16 22:39:56 +00002275#line 600 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002276 {
vlmfa67ddc2004-06-03 03:38:44 +00002277 return yyerror("Empty IMPORTS list");
vlm7e436752006-03-18 06:53:11 +00002278 }
2279 break;
2280
2281 case 38:
vlm7259fdc2006-03-16 22:39:56 +00002282#line 606 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002283 {
2284 (yyval.a_module) = asn1p_module_new();
2285 checkmem((yyval.a_module));
2286 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[0].a_xports), xp_next);
2287 }
2288 break;
2289
2290 case 39:
vlm7259fdc2006-03-16 22:39:56 +00002291#line 611 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002292 {
2293 (yyval.a_module) = (yyvsp[-1].a_module);
2294 TQ_ADD(&((yyval.a_module)->imports), (yyvsp[0].a_xports), xp_next);
2295 }
2296 break;
2297
2298 case 40:
vlm7259fdc2006-03-16 22:39:56 +00002299#line 618 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002300 { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
2301 break;
2302
2303 case 41:
vlm7259fdc2006-03-16 22:39:56 +00002304#line 619 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002305 { (yyval.a_aid).oid = (yyvsp[0].a_oid); }
2306 break;
2307
2308 case 42:
vlm7259fdc2006-03-16 22:39:56 +00002309#line 623 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002310 {
2311 (yyval.a_xports) = (yyvsp[-3].a_xports);
2312 (yyval.a_xports)->fromModuleName = (yyvsp[-1].tv_str);
2313 (yyval.a_xports)->identifier = (yyvsp[0].a_aid);
vlm931aeed2005-08-12 10:09:10 +00002314 /* This stupid thing is used for look-back hack. */
vlm7e436752006-03-18 06:53:11 +00002315 saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
2316 checkmem((yyval.a_xports));
2317 }
2318 break;
2319
2320 case 43:
vlm7259fdc2006-03-16 22:39:56 +00002321#line 634 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002322 {
2323 (yyval.a_xports) = asn1p_xports_new();
2324 checkmem((yyval.a_xports));
2325 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
2326 }
2327 break;
2328
2329 case 44:
vlm7259fdc2006-03-16 22:39:56 +00002330#line 639 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002331 {
2332 (yyval.a_xports) = (yyvsp[-2].a_xports);
2333 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
2334 }
2335 break;
2336
2337 case 45:
vlm7259fdc2006-03-16 22:39:56 +00002338#line 646 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002339 {
2340 (yyval.a_expr) = asn1p_expr_new(yylineno);
2341 checkmem((yyval.a_expr));
2342 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
2343 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2344 }
2345 break;
2346
2347 case 46:
vlm7259fdc2006-03-16 22:39:56 +00002348#line 652 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002349 { /* Completely equivalent to above */
2350 (yyval.a_expr) = asn1p_expr_new(yylineno);
2351 checkmem((yyval.a_expr));
2352 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2353 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2354 }
2355 break;
2356
2357 case 47:
vlm7259fdc2006-03-16 22:39:56 +00002358#line 658 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002359 {
2360 (yyval.a_expr) = asn1p_expr_new(yylineno);
2361 checkmem((yyval.a_expr));
2362 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
2363 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2364 }
2365 break;
2366
2367 case 48:
vlm7259fdc2006-03-16 22:39:56 +00002368#line 667 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002369 {
2370 (yyval.a_xports) = (yyvsp[-1].a_xports);
2371 }
2372 break;
2373
2374 case 49:
vlm7259fdc2006-03-16 22:39:56 +00002375#line 670 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002376 {
2377 (yyval.a_xports) = 0;
2378 }
2379 break;
2380
2381 case 50:
vlm7259fdc2006-03-16 22:39:56 +00002382#line 673 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002383 {
vlmfa67ddc2004-06-03 03:38:44 +00002384 /* Empty EXPORTS clause effectively prohibits export. */
vlm7e436752006-03-18 06:53:11 +00002385 (yyval.a_xports) = asn1p_xports_new();
2386 checkmem((yyval.a_xports));
2387 }
2388 break;
2389
2390 case 51:
vlm7259fdc2006-03-16 22:39:56 +00002391#line 681 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002392 {
2393 (yyval.a_xports) = asn1p_xports_new();
2394 assert((yyval.a_xports));
2395 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
2396 }
2397 break;
2398
2399 case 52:
vlm7259fdc2006-03-16 22:39:56 +00002400#line 686 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002401 {
2402 (yyval.a_xports) = (yyvsp[-2].a_xports);
2403 TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
2404 }
2405 break;
2406
2407 case 53:
vlm7259fdc2006-03-16 22:39:56 +00002408#line 693 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002409 {
2410 (yyval.a_expr) = asn1p_expr_new(yylineno);
2411 checkmem((yyval.a_expr));
2412 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
2413 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2414 }
2415 break;
2416
2417 case 54:
vlm7259fdc2006-03-16 22:39:56 +00002418#line 699 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002419 {
2420 (yyval.a_expr) = asn1p_expr_new(yylineno);
2421 checkmem((yyval.a_expr));
2422 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2423 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2424 }
2425 break;
2426
2427 case 55:
vlm7259fdc2006-03-16 22:39:56 +00002428#line 705 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002429 {
2430 (yyval.a_expr) = asn1p_expr_new(yylineno);
2431 checkmem((yyval.a_expr));
2432 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
2433 (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
2434 }
2435 break;
2436
2437 case 56:
vlm7259fdc2006-03-16 22:39:56 +00002438#line 716 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002439 { asn1p_lexer_hack_push_opaque_state(); }
2440 break;
2441
2442 case 57:
vlm7259fdc2006-03-16 22:39:56 +00002443#line 716 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002444 {
2445 (yyval.a_expr) = (yyvsp[-4].a_expr);
2446 assert((yyval.a_expr)->Identifier == 0);
2447 (yyval.a_expr)->Identifier = (yyvsp[-5].tv_str);
2448 (yyval.a_expr)->meta_type = AMT_VALUESET;
vlm7259fdc2006-03-16 22:39:56 +00002449 /* take care of ValueSet body */
vlm7e436752006-03-18 06:53:11 +00002450 }
2451 break;
2452
2453 case 58:
vlm7259fdc2006-03-16 22:39:56 +00002454#line 726 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002455 {
2456 (yyval.a_expr) = asn1p_expr_new(yylineno);
2457 checkmem((yyval.a_expr));
2458 (yyval.a_expr)->reference = (yyvsp[0].a_ref);
2459 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2460 (yyval.a_expr)->meta_type = AMT_TYPEREF;
2461 }
2462 break;
2463
2464 case 59:
vlm7259fdc2006-03-16 22:39:56 +00002465#line 733 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002466 {
2467 (yyval.a_expr) = asn1p_expr_new(yylineno);
2468 checkmem((yyval.a_expr));
2469 (yyval.a_expr)->expr_type = (yyvsp[0].a_type);
2470 (yyval.a_expr)->meta_type = AMT_TYPE;
2471 }
2472 break;
2473
2474 case 60:
vlm7259fdc2006-03-16 22:39:56 +00002475#line 751 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002476 {
2477 (yyval.a_expr) = (yyvsp[0].a_expr);
2478 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2479 assert((yyval.a_expr)->expr_type);
2480 assert((yyval.a_expr)->meta_type);
2481 }
2482 break;
2483
2484 case 61:
vlm7259fdc2006-03-16 22:39:56 +00002485#line 757 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002486 {
2487 (yyval.a_expr) = (yyvsp[0].a_expr);
2488 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2489 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
2490 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
2491 }
2492 break;
2493
2494 case 62:
vlm7259fdc2006-03-16 22:39:56 +00002495#line 773 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002496 {
2497 (yyval.a_expr) = (yyvsp[0].a_expr);
2498 assert((yyval.a_expr)->Identifier == 0);
2499 (yyval.a_expr)->Identifier = (yyvsp[-5].tv_str);
2500 (yyval.a_expr)->params = (yyvsp[-3].a_plist);
2501 (yyval.a_expr)->meta_type = AMT_PARAMTYPE;
2502 }
2503 break;
2504
2505 case 63:
vlm7259fdc2006-03-16 22:39:56 +00002506#line 783 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002507 {
vlmfa67ddc2004-06-03 03:38:44 +00002508 int ret;
vlm7e436752006-03-18 06:53:11 +00002509 (yyval.a_plist) = asn1p_paramlist_new(yylineno);
2510 checkmem((yyval.a_plist));
2511 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[0].a_parg).governor, (yyvsp[0].a_parg).argument);
vlmfa67ddc2004-06-03 03:38:44 +00002512 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00002513 if((yyvsp[0].a_parg).governor) asn1p_ref_free((yyvsp[0].a_parg).governor);
2514 if((yyvsp[0].a_parg).argument) free((yyvsp[0].a_parg).argument);
2515 }
2516 break;
2517
2518 case 64:
vlm7259fdc2006-03-16 22:39:56 +00002519#line 792 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002520 {
vlmfa67ddc2004-06-03 03:38:44 +00002521 int ret;
vlm7e436752006-03-18 06:53:11 +00002522 (yyval.a_plist) = (yyvsp[-2].a_plist);
2523 ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[0].a_parg).governor, (yyvsp[0].a_parg).argument);
vlmfa67ddc2004-06-03 03:38:44 +00002524 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00002525 if((yyvsp[0].a_parg).governor) asn1p_ref_free((yyvsp[0].a_parg).governor);
2526 if((yyvsp[0].a_parg).argument) free((yyvsp[0].a_parg).argument);
2527 }
2528 break;
2529
2530 case 65:
vlm7259fdc2006-03-16 22:39:56 +00002531#line 803 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002532 {
2533 (yyval.a_parg).governor = NULL;
2534 (yyval.a_parg).argument = (yyvsp[0].tv_str);
2535 }
2536 break;
2537
2538 case 66:
vlm7259fdc2006-03-16 22:39:56 +00002539#line 807 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002540 {
vlmdc7cf042006-03-09 08:49:26 +00002541 int ret;
vlm7e436752006-03-18 06:53:11 +00002542 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2543 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[-2].tv_str), 0);
vlmdc7cf042006-03-09 08:49:26 +00002544 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00002545 (yyval.a_parg).argument = (yyvsp[0].tv_str);
2546 }
2547 break;
2548
2549 case 67:
vlm7259fdc2006-03-16 22:39:56 +00002550#line 814 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002551 {
vlm931aeed2005-08-12 10:09:10 +00002552 int ret;
vlm7e436752006-03-18 06:53:11 +00002553 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2554 ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[-2].tv_str), 0);
vlm931aeed2005-08-12 10:09:10 +00002555 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00002556 (yyval.a_parg).argument = (yyvsp[0].tv_str);
2557 }
2558 break;
2559
2560 case 68:
vlm7259fdc2006-03-16 22:39:56 +00002561#line 821 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002562 {
vlm4053ca52005-02-18 16:34:21 +00002563 int ret;
vlm7e436752006-03-18 06:53:11 +00002564 (yyval.a_parg).governor = asn1p_ref_new(yylineno);
2565 ret = asn1p_ref_add_component((yyval.a_parg).governor,
2566 ASN_EXPR_TYPE2STR((yyvsp[-2].a_type)), 1);
vlmfa67ddc2004-06-03 03:38:44 +00002567 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00002568 (yyval.a_parg).argument = (yyvsp[0].tv_str);
2569 }
2570 break;
2571
2572 case 69:
vlm7259fdc2006-03-16 22:39:56 +00002573#line 832 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002574 {
2575 (yyval.a_expr) = asn1p_expr_new(yylineno);
2576 checkmem((yyval.a_expr));
2577 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2578 }
2579 break;
2580
2581 case 70:
vlm7259fdc2006-03-16 22:39:56 +00002582#line 837 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002583 {
2584 (yyval.a_expr) = (yyvsp[-2].a_expr);
2585 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2586 }
2587 break;
2588
2589 case 71:
vlm7259fdc2006-03-16 22:39:56 +00002590#line 844 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002591 {
2592 (yyval.a_expr) = (yyvsp[0].a_expr);
2593 }
2594 break;
2595
2596 case 72:
vlm7259fdc2006-03-16 22:39:56 +00002597#line 847 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002598 {
2599 (yyval.a_expr) = asn1p_expr_new(yylineno);
2600 checkmem((yyval.a_expr));
2601 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
2602 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
2603 (yyval.a_expr)->meta_type = AMT_VALUE;
2604 }
2605 break;
2606
2607 case 73:
vlm7259fdc2006-03-16 22:39:56 +00002608#line 871 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002609 { (yyval.a_expr) = asn1p_expr_new(yylineno); }
2610 break;
2611
2612 case 74:
vlm7259fdc2006-03-16 22:39:56 +00002613#line 872 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002614 { (yyval.a_expr) = (yyvsp[0].a_expr); }
2615 break;
2616
2617 case 75:
vlm7259fdc2006-03-16 22:39:56 +00002618#line 875 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002619 {
2620 (yyval.a_expr) = asn1p_expr_new(yylineno);
2621 checkmem((yyval.a_expr));
2622 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2623 }
2624 break;
2625
2626 case 76:
vlm7259fdc2006-03-16 22:39:56 +00002627#line 880 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002628 {
2629 (yyval.a_expr) = (yyvsp[-2].a_expr);
2630 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2631 }
2632 break;
2633
2634 case 77:
vlm7259fdc2006-03-16 22:39:56 +00002635#line 887 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002636 {
2637 (yyval.a_expr) = (yyvsp[-1].a_expr);
2638 assert((yyval.a_expr)->Identifier == 0);
2639 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2640 (yyvsp[0].a_marker).flags |= (yyval.a_expr)->marker.flags;
2641 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2642 }
2643 break;
2644
2645 case 78:
vlm7259fdc2006-03-16 22:39:56 +00002646#line 894 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002647 {
2648 (yyval.a_expr) = (yyvsp[-1].a_expr);
2649 (yyvsp[0].a_marker).flags |= (yyval.a_expr)->marker.flags;
2650 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2651 _fixup_anonymous_identifier((yyval.a_expr));
2652 }
2653 break;
2654
2655 case 79:
vlm7259fdc2006-03-16 22:39:56 +00002656#line 900 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002657 {
2658 (yyval.a_expr) = asn1p_expr_new(yylineno);
2659 checkmem((yyval.a_expr));
2660 (yyval.a_expr)->meta_type = (yyvsp[0].a_expr)->meta_type;
2661 (yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
2662 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2663 }
2664 break;
2665
2666 case 80:
vlm7259fdc2006-03-16 22:39:56 +00002667#line 907 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002668 {
2669 (yyval.a_expr) = (yyvsp[0].a_expr);
2670 }
2671 break;
2672
2673 case 81:
vlm7259fdc2006-03-16 22:39:56 +00002674#line 913 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002675 {
2676 (yyval.a_expr) = asn1p_expr_new(yylineno);
2677 checkmem((yyval.a_expr));
2678 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2679 }
2680 break;
2681
2682 case 82:
vlm7259fdc2006-03-16 22:39:56 +00002683#line 918 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002684 {
2685 (yyval.a_expr) = (yyvsp[-2].a_expr);
2686 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2687 }
2688 break;
2689
2690 case 83:
vlm7259fdc2006-03-16 22:39:56 +00002691#line 925 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002692 {
2693 (yyval.a_expr) = (yyvsp[0].a_expr);
2694 assert((yyval.a_expr)->Identifier == 0);
2695 (yyval.a_expr)->Identifier = (yyvsp[-1].tv_str);
2696 }
2697 break;
2698
2699 case 84:
vlm7259fdc2006-03-16 22:39:56 +00002700#line 930 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002701 {
2702 (yyval.a_expr) = (yyvsp[0].a_expr);
2703 }
2704 break;
2705
2706 case 85:
vlm7259fdc2006-03-16 22:39:56 +00002707#line 933 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002708 {
2709 (yyval.a_expr) = (yyvsp[0].a_expr);
2710 _fixup_anonymous_identifier((yyval.a_expr));
2711 }
2712 break;
2713
2714 case 86:
vlm7259fdc2006-03-16 22:39:56 +00002715#line 940 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002716 {
2717 (yyval.a_expr) = (yyvsp[-2].a_expr);
2718 checkmem((yyval.a_expr));
2719 (yyval.a_expr)->with_syntax = (yyvsp[0].a_wsynt);
2720 assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
2721 assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
2722 }
2723 break;
2724
2725 case 87:
vlm7259fdc2006-03-16 22:39:56 +00002726#line 950 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002727 { (yyval.a_int) = 0; }
2728 break;
2729
2730 case 88:
vlm7259fdc2006-03-16 22:39:56 +00002731#line 951 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002732 { (yyval.a_int) = 1; }
2733 break;
2734
2735 case 89:
vlm7259fdc2006-03-16 22:39:56 +00002736#line 955 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002737 {
2738 (yyval.a_expr) = asn1p_expr_new(yylineno);
2739 checkmem((yyval.a_expr));
2740 (yyval.a_expr)->expr_type = A1TC_CLASSDEF;
2741 (yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
2742 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2743 }
2744 break;
2745
2746 case 90:
vlm7259fdc2006-03-16 22:39:56 +00002747#line 962 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002748 {
2749 (yyval.a_expr) = (yyvsp[-2].a_expr);
2750 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
2751 }
2752 break;
2753
2754 case 91:
vlm7259fdc2006-03-16 22:39:56 +00002755#line 972 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002756 {
2757 (yyval.a_expr) = asn1p_expr_new(yylineno);
2758 checkmem((yyval.a_expr));
2759 (yyval.a_expr)->Identifier = (yyvsp[-1].tv_str);
2760 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2761 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
2762 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2763 }
2764 break;
2765
2766 case 92:
vlm7259fdc2006-03-16 22:39:56 +00002767#line 982 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002768 {
2769 (yyval.a_expr) = asn1p_expr_new(yylineno);
2770 (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
2771 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2772 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
2773 (yyval.a_expr)->unique = (yyvsp[-1].a_int);
2774 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2775 asn1p_expr_add((yyval.a_expr), (yyvsp[-2].a_expr));
2776 }
2777 break;
2778
2779 case 93:
vlm7259fdc2006-03-16 22:39:56 +00002780#line 993 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002781 {
2782 (yyval.a_expr) = asn1p_expr_new(yylineno);
2783 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2784 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2785 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
2786 (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
2787 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2788 }
2789 break;
2790
2791 case 94:
vlm7259fdc2006-03-16 22:39:56 +00002792#line 1003 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002793 {
2794 (yyval.a_expr) = asn1p_expr_new(yylineno);
2795 checkmem((yyval.a_expr));
2796 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2797 (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
2798 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2799 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
2800 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2801 }
2802 break;
2803
2804 case 95:
vlm7259fdc2006-03-16 22:39:56 +00002805#line 1014 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002806 {
2807 (yyval.a_expr) = asn1p_expr_new(yylineno);
2808 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2809 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2810 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
2811 (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
2812 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2813 }
2814 break;
2815
2816 case 96:
vlm7259fdc2006-03-16 22:39:56 +00002817#line 1024 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002818 {
2819 (yyval.a_expr) = asn1p_expr_new(yylineno);
2820 checkmem((yyval.a_expr));
2821 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2822 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2823 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
2824 asn1p_expr_add((yyval.a_expr), (yyvsp[-1].a_expr));
2825 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2826 }
2827 break;
2828
2829 case 97:
vlm7259fdc2006-03-16 22:39:56 +00002830#line 1035 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002831 {
2832 (yyval.a_expr) = asn1p_expr_new(yylineno);
2833 checkmem((yyval.a_expr));
2834 (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
2835 (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
2836 (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
2837 (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
2838 (yyval.a_expr)->marker = (yyvsp[0].a_marker);
2839 }
2840 break;
2841
2842 case 98:
vlm7259fdc2006-03-16 22:39:56 +00002843#line 1047 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002844 { (yyval.a_wsynt) = 0; }
2845 break;
2846
2847 case 99:
vlm7259fdc2006-03-16 22:39:56 +00002848#line 1048 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002849 {
2850 (yyval.a_wsynt) = (yyvsp[0].a_wsynt);
2851 }
2852 break;
2853
2854 case 100:
vlm7259fdc2006-03-16 22:39:56 +00002855#line 1055 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002856 { asn1p_lexer_hack_enable_with_syntax(); }
2857 break;
2858
2859 case 101:
vlm7259fdc2006-03-16 22:39:56 +00002860#line 1057 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002861 {
2862 (yyval.a_wsynt) = (yyvsp[-1].a_wsynt);
2863 }
2864 break;
2865
2866 case 102:
vlm7259fdc2006-03-16 22:39:56 +00002867#line 1063 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002868 {
2869 (yyval.a_wsynt) = asn1p_wsyntx_new();
2870 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[0].a_wchunk), next);
2871 }
2872 break;
2873
2874 case 103:
vlm7259fdc2006-03-16 22:39:56 +00002875#line 1067 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002876 {
2877 (yyval.a_wsynt) = (yyvsp[-1].a_wsynt);
2878 TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[0].a_wchunk), next);
2879 }
2880 break;
2881
2882 case 104:
vlm7259fdc2006-03-16 22:39:56 +00002883#line 1074 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002884 {
2885 (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
2886 (yyval.a_wchunk)->type = WC_WHITESPACE;
2887 }
2888 break;
2889
2890 case 105:
vlm7259fdc2006-03-16 22:39:56 +00002891#line 1078 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002892 {
2893 (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].tv_str), strlen((yyvsp[0].tv_str)), 0);
2894 }
2895 break;
2896
2897 case 106:
vlm7259fdc2006-03-16 22:39:56 +00002898#line 1081 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002899 {
2900 (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].a_refcomp).name, strlen((yyvsp[0].a_refcomp).name), 0);
2901 (yyval.a_wchunk)->type = WC_FIELD;
2902 }
2903 break;
2904
2905 case 107:
vlm7259fdc2006-03-16 22:39:56 +00002906#line 1085 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002907 {
2908 (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[-1].a_wsynt));
2909 }
2910 break;
2911
2912 case 108:
vlm7259fdc2006-03-16 22:39:56 +00002913#line 1091 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002914 {
2915 (yyval.a_expr) = asn1p_expr_new(yylineno);
2916 checkmem((yyval.a_expr));
2917 (yyval.a_expr)->Identifier = strdup("...");
2918 checkmem((yyval.a_expr)->Identifier);
2919 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
2920 (yyval.a_expr)->meta_type = AMT_TYPE;
2921 }
2922 break;
2923
2924 case 109:
vlm7259fdc2006-03-16 22:39:56 +00002925#line 1099 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002926 {
2927 (yyval.a_expr) = asn1p_expr_new(yylineno);
2928 checkmem((yyval.a_expr));
2929 (yyval.a_expr)->Identifier = strdup("...");
2930 checkmem((yyval.a_expr)->Identifier);
2931 (yyval.a_expr)->value = (yyvsp[0].a_value);
2932 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
2933 (yyval.a_expr)->meta_type = AMT_TYPE;
2934 }
2935 break;
2936
2937 case 110:
vlm7259fdc2006-03-16 22:39:56 +00002938#line 1108 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002939 {
2940 (yyval.a_expr) = asn1p_expr_new(yylineno);
2941 checkmem((yyval.a_expr));
2942 (yyval.a_expr)->Identifier = strdup("...");
2943 (yyval.a_expr)->value = (yyvsp[0].a_value);
2944 checkmem((yyval.a_expr)->Identifier);
2945 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
2946 (yyval.a_expr)->meta_type = AMT_TYPE;
2947 }
2948 break;
2949
2950 case 111:
vlm7259fdc2006-03-16 22:39:56 +00002951#line 1120 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00002952 {
2953 (yyval.a_expr) = (yyvsp[-1].a_expr);
2954 (yyval.a_expr)->tag = (yyvsp[-2].a_tag);
vlmec8f6812004-08-22 03:19:54 +00002955 /*
2956 * Outer constraint for SEQUENCE OF and SET OF applies
2957 * to the inner type.
2958 */
vlm7e436752006-03-18 06:53:11 +00002959 if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
2960 || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
2961 assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
2962 TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[0].a_constr);
vlmec8f6812004-08-22 03:19:54 +00002963 } else {
vlm7e436752006-03-18 06:53:11 +00002964 if((yyval.a_expr)->constraints) {
2965 assert(!(yyvsp[-1].a_expr));
vlmec8f6812004-08-22 03:19:54 +00002966 } else {
vlm7e436752006-03-18 06:53:11 +00002967 (yyval.a_expr)->constraints = (yyvsp[0].a_constr);
vlmec8f6812004-08-22 03:19:54 +00002968 }
2969 }
vlm7e436752006-03-18 06:53:11 +00002970 }
2971 break;
vlm177a5b62005-09-05 05:17:57 +00002972
vlm7e436752006-03-18 06:53:11 +00002973 case 112:
2974#line 1142 "asn1p_y.y"
2975 {
2976 (yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
2977 asn1p_as_pointer = 0;
2978 }
2979 break;
2980
2981 case 113:
2982#line 1149 "asn1p_y.y"
2983 {
2984 (yyval.a_expr) = (yyvsp[0].a_expr);
2985 (yyval.a_expr)->marker.flags |= (yyvsp[-1].a_int);
2986
2987 if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
2988 && ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
vlm177a5b62005-09-05 05:17:57 +00002989 fprintf(stderr,
2990 "INFO: Directive <ASN1C:RepresentAsPointer> "
2991 "applied to %s at line %d\n",
vlm7e436752006-03-18 06:53:11 +00002992 ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
2993 ? ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
vlm177a5b62005-09-05 05:17:57 +00002994 : "member",
vlm7e436752006-03-18 06:53:11 +00002995 (yyval.a_expr)->_lineno
vlm177a5b62005-09-05 05:17:57 +00002996 );
2997 }
vlm7e436752006-03-18 06:53:11 +00002998 }
2999 break;
3000
3001 case 114:
vlm7259fdc2006-03-16 22:39:56 +00003002#line 1168 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003003 {
3004 (yyval.a_expr) = (yyvsp[0].a_expr);
3005 }
3006 break;
3007
3008 case 115:
vlm7259fdc2006-03-16 22:39:56 +00003009#line 1171 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003010 {
3011 (yyval.a_expr) = (yyvsp[-1].a_expr);
3012 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3013 (yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
3014 (yyval.a_expr)->meta_type = AMT_TYPE;
3015 }
3016 break;
3017
3018 case 116:
vlm7259fdc2006-03-16 22:39:56 +00003019#line 1177 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003020 {
3021 (yyval.a_expr) = (yyvsp[-1].a_expr);
3022 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3023 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
3024 (yyval.a_expr)->meta_type = AMT_TYPE;
3025 }
3026 break;
3027
3028 case 117:
vlm7259fdc2006-03-16 22:39:56 +00003029#line 1183 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003030 {
3031 (yyval.a_expr) = (yyvsp[-1].a_expr);
3032 assert((yyval.a_expr)->expr_type == A1TC_INVALID);
3033 (yyval.a_expr)->expr_type = ASN_CONSTR_SET;
3034 (yyval.a_expr)->meta_type = AMT_TYPE;
3035 }
3036 break;
3037
3038 case 118:
vlm7259fdc2006-03-16 22:39:56 +00003039#line 1189 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003040 {
3041 (yyval.a_expr) = asn1p_expr_new(yylineno);
3042 checkmem((yyval.a_expr));
3043 (yyval.a_expr)->constraints = (yyvsp[-4].a_constr);
3044 (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
3045 (yyval.a_expr)->meta_type = AMT_TYPE;
3046 (yyvsp[0].a_expr)->Identifier = (yyvsp[-2].tv_str);
3047 (yyvsp[0].a_expr)->tag = (yyvsp[-1].a_tag);
3048 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
3049 }
3050 break;
3051
3052 case 119:
vlm7259fdc2006-03-16 22:39:56 +00003053#line 1199 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003054 {
3055 (yyval.a_expr) = asn1p_expr_new(yylineno);
3056 checkmem((yyval.a_expr));
3057 (yyval.a_expr)->constraints = (yyvsp[-4].a_constr);
3058 (yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
3059 (yyval.a_expr)->meta_type = AMT_TYPE;
3060 (yyvsp[0].a_expr)->Identifier = (yyvsp[-2].tv_str);
3061 (yyvsp[0].a_expr)->tag = (yyvsp[-1].a_tag);
3062 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
3063 }
3064 break;
3065
3066 case 120:
vlm7259fdc2006-03-16 22:39:56 +00003067#line 1209 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003068 {
3069 (yyval.a_expr) = asn1p_expr_new(yylineno);
3070 checkmem((yyval.a_expr));
3071 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3072 (yyval.a_expr)->meta_type = AMT_TYPE;
3073 }
3074 break;
3075
3076 case 121:
vlm7259fdc2006-03-16 22:39:56 +00003077#line 1215 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003078 {
vlmec8f6812004-08-22 03:19:54 +00003079 int ret;
vlm7e436752006-03-18 06:53:11 +00003080 (yyval.a_expr) = asn1p_expr_new(yylineno);
3081 checkmem((yyval.a_expr));
3082 (yyval.a_expr)->reference = asn1p_ref_new(yylineno);
3083 ret = asn1p_ref_add_component((yyval.a_expr)->reference,
3084 (yyvsp[0].tv_str), RLT_lowercase);
vlmec8f6812004-08-22 03:19:54 +00003085 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003086 (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
3087 (yyval.a_expr)->meta_type = AMT_TYPE;
3088 }
3089 break;
3090
3091 case 122:
vlm7259fdc2006-03-16 22:39:56 +00003092#line 1229 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003093 {
vlmfa67ddc2004-06-03 03:38:44 +00003094 int ret;
vlm7e436752006-03-18 06:53:11 +00003095 (yyval.a_expr) = (yyvsp[-1].a_expr);
3096 assert((yyval.a_expr)->expr_type == 0);
3097 assert((yyval.a_expr)->meta_type == 0);
3098 assert((yyval.a_expr)->reference == 0);
3099 (yyval.a_expr)->reference = asn1p_ref_new(yylineno);
3100 checkmem((yyval.a_expr)->reference);
3101 ret = asn1p_ref_add_component((yyval.a_expr)->reference, (yyvsp[-3].tv_str), RLT_UNKNOWN);
vlmfa67ddc2004-06-03 03:38:44 +00003102 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003103 free((yyvsp[-3].tv_str));
3104 (yyval.a_expr)->expr_type = A1TC_PARAMETRIZED;
3105 (yyval.a_expr)->meta_type = AMT_TYPE;
3106 }
3107 break;
3108
3109 case 123:
vlm7259fdc2006-03-16 22:39:56 +00003110#line 1253 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003111 {
3112 (yyval.a_expr) = asn1p_expr_new(yylineno);
3113 checkmem((yyval.a_expr));
3114 (yyval.a_expr)->reference = (yyvsp[0].a_ref);
3115 (yyval.a_expr)->expr_type = A1TC_REFERENCE;
3116 (yyval.a_expr)->meta_type = AMT_TYPEREF;
3117 }
3118 break;
3119
3120 case 124:
vlm7259fdc2006-03-16 22:39:56 +00003121#line 1260 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003122 {
3123 (yyval.a_expr) = asn1p_expr_new(yylineno);
3124 checkmem((yyval.a_expr));
3125 (yyval.a_expr)->reference = (yyvsp[0].a_ref);
3126 (yyval.a_expr)->expr_type = A1TC_INSTANCE;
3127 (yyval.a_expr)->meta_type = AMT_TYPE;
3128 }
3129 break;
3130
3131 case 125:
vlm7259fdc2006-03-16 22:39:56 +00003132#line 1275 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003133 {
vlmfa67ddc2004-06-03 03:38:44 +00003134 int ret;
vlm7e436752006-03-18 06:53:11 +00003135 (yyval.a_ref) = asn1p_ref_new(yylineno);
3136 checkmem((yyval.a_ref));
3137 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
vlmfa67ddc2004-06-03 03:38:44 +00003138 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003139 free((yyvsp[0].tv_str));
3140 }
3141 break;
3142
3143 case 126:
vlm7259fdc2006-03-16 22:39:56 +00003144#line 1283 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003145 {
vlm808411d2006-03-14 16:31:37 +00003146 int ret;
vlm7e436752006-03-18 06:53:11 +00003147 (yyval.a_ref) = asn1p_ref_new(yylineno);
3148 checkmem((yyval.a_ref));
3149 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
vlm808411d2006-03-14 16:31:37 +00003150 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003151 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
vlm808411d2006-03-14 16:31:37 +00003152 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003153 free((yyvsp[-2].tv_str));
3154 }
3155 break;
3156
3157 case 127:
vlm7259fdc2006-03-16 22:39:56 +00003158#line 1293 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003159 {
vlm808411d2006-03-14 16:31:37 +00003160 int ret;
vlm7e436752006-03-18 06:53:11 +00003161 (yyval.a_ref) = asn1p_ref_new(yylineno);
3162 checkmem((yyval.a_ref));
3163 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
vlm808411d2006-03-14 16:31:37 +00003164 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003165 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
vlm808411d2006-03-14 16:31:37 +00003166 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003167 free((yyvsp[-2].tv_str));
3168 }
3169 break;
3170
3171 case 128:
vlm7259fdc2006-03-16 22:39:56 +00003172#line 1303 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003173 {
vlmfa67ddc2004-06-03 03:38:44 +00003174 int ret;
vlm7e436752006-03-18 06:53:11 +00003175 (yyval.a_ref) = asn1p_ref_new(yylineno);
3176 checkmem((yyval.a_ref));
3177 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
vlmc94e28f2004-09-15 11:59:51 +00003178 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003179 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_lowercase);
vlmc94e28f2004-09-15 11:59:51 +00003180 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003181 free((yyvsp[-2].tv_str));
3182 }
3183 break;
3184
3185 case 129:
vlm7259fdc2006-03-16 22:39:56 +00003186#line 1313 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003187 {
vlmc94e28f2004-09-15 11:59:51 +00003188 int ret;
vlm7e436752006-03-18 06:53:11 +00003189 (yyval.a_ref) = asn1p_ref_new(yylineno);
3190 checkmem((yyval.a_ref));
3191 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_CAPITALS);
3192 free((yyvsp[0].tv_str));
vlmfa67ddc2004-06-03 03:38:44 +00003193 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003194 }
3195 break;
3196
3197 case 130:
vlm7259fdc2006-03-16 22:39:56 +00003198#line 1321 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003199 {
vlmfa67ddc2004-06-03 03:38:44 +00003200 int ret;
vlm7e436752006-03-18 06:53:11 +00003201 (yyval.a_ref) = (yyvsp[0].a_ref);
3202 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_CAPITALS);
3203 free((yyvsp[-2].tv_str));
vlmfa67ddc2004-06-03 03:38:44 +00003204 checkmem(ret == 0);
3205 /*
3206 * Move the last element infront.
3207 */
3208 {
3209 struct asn1p_ref_component_s tmp_comp;
vlm7e436752006-03-18 06:53:11 +00003210 tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
3211 memmove(&(yyval.a_ref)->components[1],
3212 &(yyval.a_ref)->components[0],
3213 sizeof((yyval.a_ref)->components[0])
3214 * ((yyval.a_ref)->comp_count - 1));
3215 (yyval.a_ref)->components[0] = tmp_comp;
vlmfa67ddc2004-06-03 03:38:44 +00003216 }
vlm7e436752006-03-18 06:53:11 +00003217 }
3218 break;
3219
3220 case 131:
vlm7259fdc2006-03-16 22:39:56 +00003221#line 1343 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003222 {
vlmfa67ddc2004-06-03 03:38:44 +00003223 int ret;
vlm7e436752006-03-18 06:53:11 +00003224 (yyval.a_ref) = asn1p_ref_new(yylineno);
3225 checkmem((yyval.a_ref));
3226 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].a_refcomp).name, (yyvsp[0].a_refcomp).lex_type);
3227 free((yyvsp[0].a_refcomp).name);
vlmfa67ddc2004-06-03 03:38:44 +00003228 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003229 }
3230 break;
3231
3232 case 132:
vlm7259fdc2006-03-16 22:39:56 +00003233#line 1351 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003234 {
vlmfa67ddc2004-06-03 03:38:44 +00003235 int ret;
vlm7e436752006-03-18 06:53:11 +00003236 (yyval.a_ref) = (yyvsp[-2].a_ref);
3237 ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].a_refcomp).name, (yyvsp[0].a_refcomp).lex_type);
3238 free((yyvsp[0].a_refcomp).name);
vlmfa67ddc2004-06-03 03:38:44 +00003239 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003240 }
3241 break;
3242
3243 case 134:
vlm7259fdc2006-03-16 22:39:56 +00003244#line 1364 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003245 {
3246 (yyval.a_refcomp).lex_type = RLT_AmpUppercase;
3247 (yyval.a_refcomp).name = (yyvsp[0].tv_str);
3248 }
3249 break;
3250
3251 case 135:
vlm7259fdc2006-03-16 22:39:56 +00003252#line 1369 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003253 {
3254 (yyval.a_refcomp).lex_type = RLT_Amplowercase;
3255 (yyval.a_refcomp).name = (yyvsp[0].tv_str);
3256 }
3257 break;
3258
3259 case 136:
vlm7259fdc2006-03-16 22:39:56 +00003260#line 1378 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003261 {
3262 (yyval.a_ref) = asn1p_ref_new(yylineno);
3263 asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_AmpUppercase);
3264 }
3265 break;
3266
3267 case 137:
vlm7259fdc2006-03-16 22:39:56 +00003268#line 1382 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003269 {
3270 (yyval.a_ref) = (yyval.a_ref);
3271 asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_AmpUppercase);
3272 }
3273 break;
3274
3275 case 138:
vlm7259fdc2006-03-16 22:39:56 +00003276#line 1386 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003277 {
3278 (yyval.a_ref) = (yyval.a_ref);
3279 asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_Amplowercase);
3280 }
3281 break;
3282
3283 case 139:
vlm7259fdc2006-03-16 22:39:56 +00003284#line 1393 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003285 {
3286 (yyval.a_ref) = asn1p_ref_new(yylineno);
3287 asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_CAPITALS);
3288 }
3289 break;
3290
3291 case 140:
vlm7259fdc2006-03-16 22:39:56 +00003292#line 1413 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003293 {
3294 (yyval.a_expr) = (yyvsp[-2].a_expr);
3295 assert((yyval.a_expr)->Identifier == NULL);
3296 (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
3297 (yyval.a_expr)->meta_type = AMT_VALUE;
3298 (yyval.a_expr)->value = (yyvsp[0].a_value);
3299 }
3300 break;
3301
3302 case 141:
vlm7259fdc2006-03-16 22:39:56 +00003303#line 1423 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003304 {
3305 (yyval.a_value) = asn1p_value_fromint(0);
3306 checkmem((yyval.a_value));
3307 (yyval.a_value)->type = ATV_CHOICE_IDENTIFIER;
3308 (yyval.a_value)->value.choice_identifier.identifier = (yyvsp[-2].tv_str);
3309 (yyval.a_value)->value.choice_identifier.value = (yyvsp[0].a_value);
3310 }
3311 break;
3312
3313 case 142:
vlm7259fdc2006-03-16 22:39:56 +00003314#line 1430 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003315 { asn1p_lexer_hack_push_opaque_state(); }
3316 break;
3317
3318 case 143:
vlm7259fdc2006-03-16 22:39:56 +00003319#line 1430 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003320 {
3321 (yyval.a_value) = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
3322 checkmem((yyval.a_value));
3323 (yyval.a_value)->type = ATV_UNPARSED;
3324 }
3325 break;
3326
3327 case 144:
vlm7259fdc2006-03-16 22:39:56 +00003328#line 1435 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003329 {
3330 (yyval.a_value) = asn1p_value_fromint(0);
3331 checkmem((yyval.a_value));
3332 (yyval.a_value)->type = ATV_NULL;
3333 }
3334 break;
3335
3336 case 145:
vlm7259fdc2006-03-16 22:39:56 +00003337#line 1440 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003338 {
3339 (yyval.a_value) = asn1p_value_fromint(0);
3340 checkmem((yyval.a_value));
3341 (yyval.a_value)->type = ATV_FALSE;
3342 }
3343 break;
3344
3345 case 146:
vlm7259fdc2006-03-16 22:39:56 +00003346#line 1445 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003347 {
3348 (yyval.a_value) = asn1p_value_fromint(0);
3349 checkmem((yyval.a_value));
3350 (yyval.a_value)->type = ATV_TRUE;
3351 }
3352 break;
3353
3354 case 147:
vlm7259fdc2006-03-16 22:39:56 +00003355#line 1450 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003356 {
3357 (yyval.a_value) = _convert_bitstring2binary((yyvsp[0].tv_str), 'B');
3358 checkmem((yyval.a_value));
3359 }
3360 break;
3361
3362 case 148:
vlm7259fdc2006-03-16 22:39:56 +00003363#line 1454 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003364 {
3365 (yyval.a_value) = _convert_bitstring2binary((yyvsp[0].tv_str), 'H');
3366 checkmem((yyval.a_value));
3367 }
3368 break;
3369
3370 case 149:
vlm7259fdc2006-03-16 22:39:56 +00003371#line 1458 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003372 {
3373 (yyval.a_value) = (yyval.a_value);
3374 }
3375 break;
3376
3377 case 150:
vlm7259fdc2006-03-16 22:39:56 +00003378#line 1461 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003379 {
3380 (yyval.a_value) = (yyvsp[0].a_value);
3381 }
3382 break;
3383
3384 case 151:
vlm7259fdc2006-03-16 22:39:56 +00003385#line 1464 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003386 {
3387 (yyval.a_value) = (yyvsp[0].a_value);
3388 }
3389 break;
3390
3391 case 152:
vlm7259fdc2006-03-16 22:39:56 +00003392#line 1470 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003393 {
vlmfa67ddc2004-06-03 03:38:44 +00003394 asn1p_ref_t *ref;
3395 int ret;
3396 ref = asn1p_ref_new(yylineno);
3397 checkmem(ref);
vlm7e436752006-03-18 06:53:11 +00003398 ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
vlmfa67ddc2004-06-03 03:38:44 +00003399 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003400 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3401 checkmem((yyval.a_value));
3402 free((yyvsp[0].tv_str));
3403 }
3404 break;
3405
3406 case 153:
vlm7259fdc2006-03-16 22:39:56 +00003407#line 1481 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003408 {
vlmfa67ddc2004-06-03 03:38:44 +00003409 asn1p_ref_t *ref;
3410 int ret;
3411 ref = asn1p_ref_new(yylineno);
3412 checkmem(ref);
vlm7e436752006-03-18 06:53:11 +00003413 ret = asn1p_ref_add_component(ref, (yyvsp[-2].tv_str), RLT_UNKNOWN);
vlmfa67ddc2004-06-03 03:38:44 +00003414 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003415 ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
vlmfa67ddc2004-06-03 03:38:44 +00003416 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003417 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3418 checkmem((yyval.a_value));
3419 free((yyvsp[-2].tv_str));
3420 free((yyvsp[0].tv_str));
3421 }
3422 break;
3423
3424 case 154:
vlm7259fdc2006-03-16 22:39:56 +00003425#line 1499 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003426 {
3427 (yyval.a_value) = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
3428 checkmem((yyval.a_value));
3429 }
3430 break;
3431
3432 case 155:
vlm7259fdc2006-03-16 22:39:56 +00003433#line 1503 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003434 {
3435 (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
3436 checkmem((yyval.a_value));
3437 (yyval.a_value)->type = ATV_TUPLE;
3438 }
3439 break;
3440
3441 case 156:
vlm7259fdc2006-03-16 22:39:56 +00003442#line 1508 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003443 {
3444 (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
3445 checkmem((yyval.a_value));
3446 (yyval.a_value)->type = ATV_QUADRUPLE;
3447 }
3448 break;
3449
3450 case 157:
vlm7259fdc2006-03-16 22:39:56 +00003451#line 1542 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003452 {
3453 (yyval.tv_opaque).len = (yyvsp[0].tv_opaque).len + 1;
3454 (yyval.tv_opaque).buf = malloc((yyval.tv_opaque).len + 1);
3455 checkmem((yyval.tv_opaque).buf);
3456 (yyval.tv_opaque).buf[0] = '{';
3457 memcpy((yyval.tv_opaque).buf + 1, (yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len);
3458 (yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
3459 free((yyvsp[0].tv_opaque).buf);
3460 }
3461 break;
3462
3463 case 158:
vlm7259fdc2006-03-16 22:39:56 +00003464#line 1551 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003465 {
3466 int newsize = (yyvsp[-1].tv_opaque).len + (yyvsp[0].tv_opaque).len;
vlmfa67ddc2004-06-03 03:38:44 +00003467 char *p = malloc(newsize + 1);
3468 checkmem(p);
vlm7e436752006-03-18 06:53:11 +00003469 memcpy(p , (yyvsp[-1].tv_opaque).buf, (yyvsp[-1].tv_opaque).len);
3470 memcpy(p + (yyvsp[-1].tv_opaque).len, (yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len);
vlmfa67ddc2004-06-03 03:38:44 +00003471 p[newsize] = '\0';
vlm7e436752006-03-18 06:53:11 +00003472 free((yyvsp[-1].tv_opaque).buf);
3473 free((yyvsp[0].tv_opaque).buf);
3474 (yyval.tv_opaque).buf = p;
3475 (yyval.tv_opaque).len = newsize;
3476 }
3477 break;
3478
3479 case 159:
vlm7259fdc2006-03-16 22:39:56 +00003480#line 1566 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003481 { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
3482 break;
3483
3484 case 160:
vlm7259fdc2006-03-16 22:39:56 +00003485#line 1567 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003486 { (yyval.a_type) = ASN_BASIC_NULL; }
3487 break;
3488
3489 case 161:
vlm7259fdc2006-03-16 22:39:56 +00003490#line 1568 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003491 { (yyval.a_type) = ASN_BASIC_REAL; }
3492 break;
3493
3494 case 162:
vlm7259fdc2006-03-16 22:39:56 +00003495#line 1569 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003496 { (yyval.a_type) = (yyvsp[0].a_type); }
3497 break;
3498
3499 case 163:
vlm7259fdc2006-03-16 22:39:56 +00003500#line 1570 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003501 { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
3502 break;
3503
3504 case 164:
vlm7259fdc2006-03-16 22:39:56 +00003505#line 1571 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003506 { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
3507 break;
3508
3509 case 165:
vlm7259fdc2006-03-16 22:39:56 +00003510#line 1572 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003511 { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
3512 break;
3513
3514 case 166:
vlm7259fdc2006-03-16 22:39:56 +00003515#line 1573 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003516 { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
3517 break;
3518
3519 case 167:
vlm7259fdc2006-03-16 22:39:56 +00003520#line 1574 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003521 { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
3522 break;
3523
3524 case 168:
vlm7259fdc2006-03-16 22:39:56 +00003525#line 1575 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003526 { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
3527 break;
3528
3529 case 169:
vlm7259fdc2006-03-16 22:39:56 +00003530#line 1576 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003531 { (yyval.a_type) = ASN_BASIC_UTCTime; }
3532 break;
3533
3534 case 170:
vlm7259fdc2006-03-16 22:39:56 +00003535#line 1577 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003536 { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
3537 break;
3538
3539 case 171:
vlm7259fdc2006-03-16 22:39:56 +00003540#line 1578 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003541 { (yyval.a_type) = (yyvsp[0].a_type); }
3542 break;
3543
3544 case 172:
vlm7259fdc2006-03-16 22:39:56 +00003545#line 1585 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003546 { (yyval.a_type) = ASN_BASIC_INTEGER; }
3547 break;
3548
3549 case 173:
vlm7259fdc2006-03-16 22:39:56 +00003550#line 1586 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003551 { (yyval.a_type) = ASN_BASIC_ENUMERATED; }
3552 break;
3553
3554 case 174:
vlm7259fdc2006-03-16 22:39:56 +00003555#line 1587 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003556 { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
3557 break;
3558
3559 case 175:
vlm7259fdc2006-03-16 22:39:56 +00003560#line 1591 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003561 {
3562 (yyval.a_expr) = asn1p_expr_new(yylineno);
3563 checkmem((yyval.a_expr));
3564 (yyval.a_expr)->expr_type = (yyvsp[0].a_type);
3565 (yyval.a_expr)->meta_type = AMT_TYPE;
3566 }
3567 break;
3568
3569 case 176:
vlm7259fdc2006-03-16 22:39:56 +00003570#line 1597 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003571 {
3572 if((yyvsp[0].a_expr)) {
3573 (yyval.a_expr) = (yyvsp[0].a_expr);
vlmfa67ddc2004-06-03 03:38:44 +00003574 } else {
vlm7e436752006-03-18 06:53:11 +00003575 (yyval.a_expr) = asn1p_expr_new(yylineno);
3576 checkmem((yyval.a_expr));
vlmfa67ddc2004-06-03 03:38:44 +00003577 }
vlm7e436752006-03-18 06:53:11 +00003578 (yyval.a_expr)->expr_type = (yyvsp[-1].a_type);
3579 (yyval.a_expr)->meta_type = AMT_TYPE;
3580 }
3581 break;
3582
3583 case 177:
vlm7259fdc2006-03-16 22:39:56 +00003584#line 1610 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003585 { (yyval.a_type) = ASN_STRING_BMPString; }
3586 break;
3587
3588 case 178:
vlm7259fdc2006-03-16 22:39:56 +00003589#line 1611 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003590 {
3591 (yyval.a_type) = ASN_STRING_GeneralString;
vlmc94e28f2004-09-15 11:59:51 +00003592 fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
vlm7e436752006-03-18 06:53:11 +00003593 }
3594 break;
3595
3596 case 179:
vlm7259fdc2006-03-16 22:39:56 +00003597#line 1615 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003598 {
3599 (yyval.a_type) = ASN_STRING_GraphicString;
vlmc94e28f2004-09-15 11:59:51 +00003600 fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
vlm7e436752006-03-18 06:53:11 +00003601 }
3602 break;
3603
3604 case 180:
vlm7259fdc2006-03-16 22:39:56 +00003605#line 1619 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003606 { (yyval.a_type) = ASN_STRING_IA5String; }
3607 break;
3608
3609 case 181:
vlm7259fdc2006-03-16 22:39:56 +00003610#line 1620 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003611 { (yyval.a_type) = ASN_STRING_ISO646String; }
3612 break;
3613
3614 case 182:
vlm7259fdc2006-03-16 22:39:56 +00003615#line 1621 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003616 { (yyval.a_type) = ASN_STRING_NumericString; }
3617 break;
3618
3619 case 183:
vlm7259fdc2006-03-16 22:39:56 +00003620#line 1622 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003621 { (yyval.a_type) = ASN_STRING_PrintableString; }
3622 break;
3623
3624 case 184:
vlm7259fdc2006-03-16 22:39:56 +00003625#line 1623 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003626 {
3627 (yyval.a_type) = ASN_STRING_T61String;
vlmc94e28f2004-09-15 11:59:51 +00003628 fprintf(stderr, "WARNING: T61String is not fully supported\n");
vlm7e436752006-03-18 06:53:11 +00003629 }
3630 break;
3631
3632 case 185:
vlm7259fdc2006-03-16 22:39:56 +00003633#line 1627 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003634 { (yyval.a_type) = ASN_STRING_TeletexString; }
3635 break;
3636
3637 case 186:
vlm7259fdc2006-03-16 22:39:56 +00003638#line 1628 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003639 { (yyval.a_type) = ASN_STRING_UniversalString; }
3640 break;
3641
3642 case 187:
vlm7259fdc2006-03-16 22:39:56 +00003643#line 1629 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003644 { (yyval.a_type) = ASN_STRING_UTF8String; }
3645 break;
3646
3647 case 188:
vlm7259fdc2006-03-16 22:39:56 +00003648#line 1630 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003649 {
3650 (yyval.a_type) = ASN_STRING_VideotexString;
vlmc94e28f2004-09-15 11:59:51 +00003651 fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
vlm7e436752006-03-18 06:53:11 +00003652 }
3653 break;
3654
3655 case 189:
vlm7259fdc2006-03-16 22:39:56 +00003656#line 1634 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003657 { (yyval.a_type) = ASN_STRING_VisibleString; }
3658 break;
3659
3660 case 190:
vlm7259fdc2006-03-16 22:39:56 +00003661#line 1635 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003662 { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
3663 break;
3664
3665 case 196:
vlm7259fdc2006-03-16 22:39:56 +00003666#line 1647 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003667 { (yyval.a_constr) = 0; }
3668 break;
3669
3670 case 197:
vlm7259fdc2006-03-16 22:39:56 +00003671#line 1648 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003672 {
3673 (yyval.a_constr) = (yyvsp[0].a_constr);
3674 }
3675 break;
3676
3677 case 198:
vlm7259fdc2006-03-16 22:39:56 +00003678#line 1654 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003679 {
3680 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[0].a_constr), 0);
3681 }
3682 break;
3683
3684 case 199:
vlm7259fdc2006-03-16 22:39:56 +00003685#line 1657 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003686 {
vlmfa67ddc2004-06-03 03:38:44 +00003687 /*
3688 * This is a special case, for compatibility purposes.
vlm9283dbe2004-08-18 04:59:12 +00003689 * It goes without parentheses.
vlmfa67ddc2004-06-03 03:38:44 +00003690 */
vlm7e436752006-03-18 06:53:11 +00003691 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[-1].a_constr), 0);
3692 }
3693 break;
3694
3695 case 200:
vlm7259fdc2006-03-16 22:39:56 +00003696#line 1667 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003697 {
3698 (yyval.a_constr) = (yyvsp[-1].a_constr);
3699 }
3700 break;
3701
3702 case 201:
vlm7259fdc2006-03-16 22:39:56 +00003703#line 1670 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003704 {
3705 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[-3].a_constr), (yyvsp[-1].a_constr));
3706 }
3707 break;
3708
3709 case 202:
vlm7259fdc2006-03-16 22:39:56 +00003710#line 1676 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003711 {
3712 (yyval.a_constr) = (yyvsp[0].a_constr);
3713 }
3714 break;
3715
3716 case 203:
vlm7259fdc2006-03-16 22:39:56 +00003717#line 1679 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003718 {
vlmfa67ddc2004-06-03 03:38:44 +00003719 asn1p_constraint_t *ct;
3720 ct = asn1p_constraint_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003721 ct->type = ACT_EL_EXT;
vlm7e436752006-03-18 06:53:11 +00003722 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-2].a_constr), ct);
3723 }
3724 break;
3725
3726 case 204:
vlm7259fdc2006-03-16 22:39:56 +00003727#line 1685 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003728 {
vlmfa67ddc2004-06-03 03:38:44 +00003729 asn1p_constraint_t *ct;
3730 ct = asn1p_constraint_new(yylineno);
vlmfa67ddc2004-06-03 03:38:44 +00003731 ct->type = ACT_EL_EXT;
vlm7e436752006-03-18 06:53:11 +00003732 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-4].a_constr), ct);
3733 ct = (yyval.a_constr);
3734 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[0].a_constr));
3735 }
3736 break;
3737
3738 case 205:
vlm7259fdc2006-03-16 22:39:56 +00003739#line 1696 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003740 {
3741 (yyval.a_constr) = (yyvsp[0].a_constr);
3742 }
3743 break;
3744
3745 case 206:
vlm7259fdc2006-03-16 22:39:56 +00003746#line 1699 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003747 {
3748 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[0].a_constr), 0);
3749 }
3750 break;
3751
3752 case 207:
vlm7259fdc2006-03-16 22:39:56 +00003753#line 1702 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003754 {
3755 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_UNI, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
3756 }
3757 break;
3758
3759 case 208:
vlm7259fdc2006-03-16 22:39:56 +00003760#line 1705 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003761 {
3762 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_INT, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
3763 }
3764 break;
3765
3766 case 209:
vlm7259fdc2006-03-16 22:39:56 +00003767#line 1708 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003768 {
3769 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_EXC, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
3770 }
3771 break;
3772
3773 case 210:
vlm7259fdc2006-03-16 22:39:56 +00003774#line 1714 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003775 {
vlmfa67ddc2004-06-03 03:38:44 +00003776 int ret;
vlm7e436752006-03-18 06:53:11 +00003777 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3778 checkmem((yyval.a_constr));
3779 (yyval.a_constr)->type = (yyvsp[-3].a_ctype);
3780 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
vlmfa67ddc2004-06-03 03:38:44 +00003781 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003782 }
3783 break;
3784
3785 case 211:
vlm7259fdc2006-03-16 22:39:56 +00003786#line 1722 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003787 {
vlm9283dbe2004-08-18 04:59:12 +00003788 int ret;
vlm7e436752006-03-18 06:53:11 +00003789 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3790 checkmem((yyval.a_constr));
3791 (yyval.a_constr)->type = ACT_CA_SET;
3792 ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
vlm9283dbe2004-08-18 04:59:12 +00003793 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003794 }
3795 break;
3796
3797 case 212:
vlm7259fdc2006-03-16 22:39:56 +00003798#line 1730 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003799 {
3800 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3801 checkmem((yyval.a_constr));
3802 (yyval.a_constr)->type = ACT_EL_VALUE;
3803 (yyval.a_constr)->value = (yyvsp[0].a_value);
3804 }
3805 break;
3806
3807 case 213:
vlm7259fdc2006-03-16 22:39:56 +00003808#line 1736 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003809 {
3810 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3811 checkmem((yyval.a_constr));
3812 (yyval.a_constr)->type = ACT_EL_TYPE;
3813 (yyval.a_constr)->containedSubtype = (yyvsp[0].a_value);
3814 }
3815 break;
3816
3817 case 214:
vlm7259fdc2006-03-16 22:39:56 +00003818#line 1742 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003819 {
3820 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3821 checkmem((yyval.a_constr));
3822 (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
3823 (yyval.a_constr)->range_start = (yyvsp[-2].a_value);
3824 (yyval.a_constr)->range_stop = (yyvsp[0].a_value);
3825 }
3826 break;
3827
3828 case 215:
vlm7259fdc2006-03-16 22:39:56 +00003829#line 1749 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003830 {
3831 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3832 checkmem((yyval.a_constr));
3833 (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
3834 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
3835 (yyval.a_constr)->range_stop = (yyvsp[0].a_value);
3836 (yyval.a_constr)->range_start->type = ATV_MIN;
3837 }
3838 break;
3839
3840 case 216:
vlm7259fdc2006-03-16 22:39:56 +00003841#line 1757 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003842 {
3843 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3844 checkmem((yyval.a_constr));
3845 (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
3846 (yyval.a_constr)->range_start = (yyvsp[-2].a_value);
3847 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
3848 (yyval.a_constr)->range_stop->type = ATV_MAX;
3849 }
3850 break;
3851
3852 case 217:
vlm7259fdc2006-03-16 22:39:56 +00003853#line 1765 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003854 {
3855 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3856 checkmem((yyval.a_constr));
3857 (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
3858 (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
3859 (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
3860 (yyval.a_constr)->range_start->type = ATV_MIN;
3861 (yyval.a_constr)->range_stop->type = ATV_MAX;
3862 }
3863 break;
3864
3865 case 218:
vlm7259fdc2006-03-16 22:39:56 +00003866#line 1774 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003867 {
3868 (yyval.a_constr) = (yyvsp[0].a_constr);
3869 }
3870 break;
3871
3872 case 219:
vlm7259fdc2006-03-16 22:39:56 +00003873#line 1777 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003874 {
3875 (yyval.a_constr) = (yyvsp[0].a_constr);
3876 }
3877 break;
3878
3879 case 220:
vlm7259fdc2006-03-16 22:39:56 +00003880#line 1781 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003881 { asn1p_lexer_hack_push_opaque_state(); }
3882 break;
3883
3884 case 221:
vlm7259fdc2006-03-16 22:39:56 +00003885#line 1781 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003886 {
3887 (yyval.a_constr) = asn1p_constraint_new(yylineno);
3888 checkmem((yyval.a_constr));
3889 (yyval.a_constr)->type = ACT_CT_CTDBY;
3890 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
3891 checkmem((yyval.a_constr)->value);
3892 (yyval.a_constr)->value->type = ATV_UNPARSED;
3893 }
3894 break;
3895
3896 case 222:
vlm7259fdc2006-03-16 22:39:56 +00003897#line 1792 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003898 { (yyval.a_ctype) = ACT_EL_RANGE; }
3899 break;
3900
3901 case 223:
vlm7259fdc2006-03-16 22:39:56 +00003902#line 1793 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003903 { (yyval.a_ctype) = ACT_EL_RLRANGE; }
3904 break;
3905
3906 case 224:
vlm7259fdc2006-03-16 22:39:56 +00003907#line 1794 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003908 { (yyval.a_ctype) = ACT_EL_LLRANGE; }
3909 break;
3910
3911 case 225:
vlm7259fdc2006-03-16 22:39:56 +00003912#line 1795 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003913 { (yyval.a_ctype) = ACT_EL_ULRANGE; }
3914 break;
3915
3916 case 226:
vlm7259fdc2006-03-16 22:39:56 +00003917#line 1799 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003918 {
3919 (yyval.a_ctype) = ACT_CT_SIZE;
3920 }
3921 break;
3922
3923 case 227:
vlm7259fdc2006-03-16 22:39:56 +00003924#line 1802 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003925 {
3926 (yyval.a_ctype) = ACT_CT_FROM;
3927 }
3928 break;
3929
3930 case 228:
vlm7259fdc2006-03-16 22:39:56 +00003931#line 1808 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003932 {
3933 (yyval.a_value) = asn1p_value_fromint(0);
3934 checkmem((yyval.a_value));
3935 (yyval.a_value)->type = ATV_FALSE;
3936 }
3937 break;
3938
3939 case 229:
vlm7259fdc2006-03-16 22:39:56 +00003940#line 1813 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003941 {
3942 (yyval.a_value) = asn1p_value_fromint(1);
3943 checkmem((yyval.a_value));
3944 (yyval.a_value)->type = ATV_TRUE;
3945 }
3946 break;
3947
3948 case 230:
vlm7259fdc2006-03-16 22:39:56 +00003949#line 1818 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003950 {
3951 (yyval.a_value) = (yyvsp[0].a_value);
3952 }
3953 break;
3954
3955 case 231:
vlm7259fdc2006-03-16 22:39:56 +00003956#line 1821 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003957 {
3958 (yyval.a_value) = (yyvsp[0].a_value);
3959 }
3960 break;
3961
3962 case 232:
vlm7259fdc2006-03-16 22:39:56 +00003963#line 1824 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003964 {
vlmfa67ddc2004-06-03 03:38:44 +00003965 asn1p_ref_t *ref;
3966 int ret;
3967 ref = asn1p_ref_new(yylineno);
3968 checkmem(ref);
vlm7e436752006-03-18 06:53:11 +00003969 ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
vlmfa67ddc2004-06-03 03:38:44 +00003970 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003971 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3972 checkmem((yyval.a_value));
3973 free((yyvsp[0].tv_str));
3974 }
3975 break;
3976
3977 case 233:
vlm7259fdc2006-03-16 22:39:56 +00003978#line 1838 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003979 {
vlm4053ca52005-02-18 16:34:21 +00003980 asn1p_ref_t *ref;
3981 int ret;
3982 ref = asn1p_ref_new(yylineno);
3983 checkmem(ref);
vlm7e436752006-03-18 06:53:11 +00003984 ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_UNKNOWN);
vlm4053ca52005-02-18 16:34:21 +00003985 checkmem(ret == 0);
vlm7e436752006-03-18 06:53:11 +00003986 (yyval.a_value) = asn1p_value_fromref(ref, 0);
3987 checkmem((yyval.a_value));
3988 free((yyvsp[0].tv_str));
3989 }
3990 break;
3991
3992 case 234:
vlm7259fdc2006-03-16 22:39:56 +00003993#line 1852 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00003994 {
3995 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[0].a_constr), 0);
3996 }
3997 break;
3998
3999 case 235:
vlm7259fdc2006-03-16 22:39:56 +00004000#line 1855 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004001 {
4002 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[-1].a_constr), 0);
4003 }
4004 break;
4005
4006 case 236:
vlm7259fdc2006-03-16 22:39:56 +00004007#line 1861 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004008 {
4009 (yyval.a_constr) = (yyvsp[0].a_constr);
4010 }
4011 break;
4012
4013 case 237:
vlm7259fdc2006-03-16 22:39:56 +00004014#line 1864 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004015 {
4016 CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
4017 }
4018 break;
4019
4020 case 238:
vlm7259fdc2006-03-16 22:39:56 +00004021#line 1870 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004022 {
4023 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4024 checkmem((yyval.a_constr));
4025 (yyval.a_constr)->type = ACT_EL_EXT;
4026 (yyval.a_constr)->value = asn1p_value_frombuf("...", 3, 0);
4027 }
4028 break;
4029
4030 case 239:
vlm7259fdc2006-03-16 22:39:56 +00004031#line 1876 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004032 {
4033 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4034 checkmem((yyval.a_constr));
4035 (yyval.a_constr)->type = ACT_EL_VALUE;
4036 (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[-2].tv_str), strlen((yyvsp[-2].tv_str)), 0);
4037 (yyval.a_constr)->presence = (yyvsp[0].a_pres);
4038 if((yyvsp[-1].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
4039 }
4040 break;
4041
4042 case 240:
vlm7259fdc2006-03-16 22:39:56 +00004043#line 1890 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004044 { (yyval.a_pres) = ACPRES_DEFAULT; }
4045 break;
4046
4047 case 241:
vlm7259fdc2006-03-16 22:39:56 +00004048#line 1891 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004049 { (yyval.a_pres) = (yyvsp[0].a_pres); }
4050 break;
4051
4052 case 242:
vlm7259fdc2006-03-16 22:39:56 +00004053#line 1895 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004054 {
4055 (yyval.a_pres) = ACPRES_PRESENT;
4056 }
4057 break;
4058
4059 case 243:
vlm7259fdc2006-03-16 22:39:56 +00004060#line 1898 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004061 {
4062 (yyval.a_pres) = ACPRES_ABSENT;
4063 }
4064 break;
4065
4066 case 244:
vlm7259fdc2006-03-16 22:39:56 +00004067#line 1901 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004068 {
4069 (yyval.a_pres) = ACPRES_OPTIONAL;
4070 }
4071 break;
4072
4073 case 245:
vlm7259fdc2006-03-16 22:39:56 +00004074#line 1907 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004075 {
4076 (yyval.a_constr) = (yyvsp[0].a_constr);
4077 }
4078 break;
4079
4080 case 246:
vlm7259fdc2006-03-16 22:39:56 +00004081#line 1910 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004082 {
4083 (yyval.a_constr) = (yyvsp[0].a_constr);
4084 }
4085 break;
4086
4087 case 247:
vlm7259fdc2006-03-16 22:39:56 +00004088#line 1919 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004089 {
vlmfa67ddc2004-06-03 03:38:44 +00004090 asn1p_ref_t *ref = asn1p_ref_new(yylineno);
4091 asn1p_constraint_t *ct;
4092 int ret;
vlm7e436752006-03-18 06:53:11 +00004093 ret = asn1p_ref_add_component(ref, (yyvsp[-1].tv_str), 0);
vlmfa67ddc2004-06-03 03:38:44 +00004094 checkmem(ret == 0);
4095 ct = asn1p_constraint_new(yylineno);
vlm7e436752006-03-18 06:53:11 +00004096 checkmem((yyval.a_constr));
vlmfa67ddc2004-06-03 03:38:44 +00004097 ct->type = ACT_EL_VALUE;
4098 ct->value = asn1p_value_fromref(ref, 0);
vlm7e436752006-03-18 06:53:11 +00004099 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
4100 }
4101 break;
4102
4103 case 248:
vlm7259fdc2006-03-16 22:39:56 +00004104#line 1934 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004105 {
4106 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, (yyvsp[-3].a_constr), (yyvsp[-1].a_constr));
4107 }
4108 break;
4109
4110 case 249:
vlm7259fdc2006-03-16 22:39:56 +00004111#line 1940 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004112 {
4113 (yyval.a_constr) = asn1p_constraint_new(yylineno);
4114 checkmem((yyval.a_constr));
4115 (yyval.a_constr)->type = ACT_EL_VALUE;
4116 (yyval.a_constr)->value = asn1p_value_fromref((yyvsp[0].a_ref), 0);
4117 }
4118 break;
4119
4120 case 250:
vlm7259fdc2006-03-16 22:39:56 +00004121#line 1946 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004122 {
vlmfa67ddc2004-06-03 03:38:44 +00004123 asn1p_constraint_t *ct;
4124 ct = asn1p_constraint_new(yylineno);
4125 checkmem(ct);
4126 ct->type = ACT_EL_VALUE;
vlm7e436752006-03-18 06:53:11 +00004127 ct->value = asn1p_value_fromref((yyvsp[0].a_ref), 0);
4128 CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-2].a_constr), ct);
4129 }
4130 break;
4131
4132 case 251:
vlm7259fdc2006-03-16 22:39:56 +00004133#line 1960 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004134 {
4135 char *p = malloc(strlen((yyvsp[0].tv_str)) + 2);
vlmfa67ddc2004-06-03 03:38:44 +00004136 int ret;
4137 *p = '@';
vlm7e436752006-03-18 06:53:11 +00004138 strcpy(p + 1, (yyvsp[0].tv_str));
4139 (yyval.a_ref) = asn1p_ref_new(yylineno);
4140 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
vlmfa67ddc2004-06-03 03:38:44 +00004141 checkmem(ret == 0);
4142 free(p);
vlm7e436752006-03-18 06:53:11 +00004143 free((yyvsp[0].tv_str));
4144 }
4145 break;
4146
4147 case 252:
vlm7259fdc2006-03-16 22:39:56 +00004148#line 1971 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004149 {
4150 char *p = malloc(strlen((yyvsp[0].tv_str)) + 3);
vlmfa67ddc2004-06-03 03:38:44 +00004151 int ret;
4152 p[0] = '@';
4153 p[1] = '.';
vlm7e436752006-03-18 06:53:11 +00004154 strcpy(p + 2, (yyvsp[0].tv_str));
4155 (yyval.a_ref) = asn1p_ref_new(yylineno);
4156 ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
vlmfa67ddc2004-06-03 03:38:44 +00004157 checkmem(ret == 0);
4158 free(p);
vlm7e436752006-03-18 06:53:11 +00004159 free((yyvsp[0].tv_str));
4160 }
4161 break;
4162
4163 case 253:
vlm7259fdc2006-03-16 22:39:56 +00004164#line 1987 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004165 {
4166 (yyval.tv_str) = (yyvsp[0].tv_str);
4167 }
4168 break;
4169
4170 case 254:
vlm7259fdc2006-03-16 22:39:56 +00004171#line 1990 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004172 {
4173 int l1 = strlen((yyvsp[-2].tv_str));
4174 int l3 = strlen((yyvsp[0].tv_str));
4175 (yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
4176 memcpy((yyval.tv_str), (yyvsp[-2].tv_str), l1);
4177 (yyval.tv_str)[l1] = '.';
4178 memcpy((yyval.tv_str) + l1 + 1, (yyvsp[0].tv_str), l3);
4179 (yyval.tv_str)[l1 + 1 + l3] = '\0';
4180 }
4181 break;
4182
4183 case 255:
vlm7259fdc2006-03-16 22:39:56 +00004184#line 2008 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004185 {
4186 (yyval.a_marker).flags = EM_NOMARK;
4187 (yyval.a_marker).default_value = 0;
4188 }
4189 break;
4190
4191 case 256:
vlm7259fdc2006-03-16 22:39:56 +00004192#line 2012 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004193 { (yyval.a_marker) = (yyvsp[0].a_marker); }
4194 break;
4195
4196 case 257:
vlm7259fdc2006-03-16 22:39:56 +00004197#line 2016 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004198 {
4199 (yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
4200 (yyval.a_marker).default_value = 0;
4201 }
4202 break;
4203
4204 case 258:
vlm7259fdc2006-03-16 22:39:56 +00004205#line 2020 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004206 {
4207 (yyval.a_marker).flags = EM_DEFAULT;
4208 (yyval.a_marker).default_value = (yyvsp[0].a_value);
4209 }
4210 break;
4211
4212 case 259:
vlm7259fdc2006-03-16 22:39:56 +00004213#line 2043 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004214 {
4215 (yyval.a_expr) = asn1p_expr_new(yylineno);
4216 checkmem((yyval.a_expr));
4217 }
4218 break;
4219
4220 case 260:
vlm7259fdc2006-03-16 22:39:56 +00004221#line 2047 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004222 {
4223 (yyval.a_expr) = (yyvsp[-1].a_expr);
4224 }
4225 break;
4226
4227 case 261:
vlm7259fdc2006-03-16 22:39:56 +00004228#line 2053 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004229 {
4230 (yyval.a_expr) = asn1p_expr_new(yylineno);
4231 checkmem((yyval.a_expr));
4232 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
4233 }
4234 break;
4235
4236 case 262:
vlm7259fdc2006-03-16 22:39:56 +00004237#line 2058 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004238 {
4239 (yyval.a_expr) = (yyvsp[-2].a_expr);
4240 asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
4241 }
4242 break;
4243
4244 case 263:
vlm7259fdc2006-03-16 22:39:56 +00004245#line 2065 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004246 {
4247 (yyval.a_expr) = asn1p_expr_new(yylineno);
4248 checkmem((yyval.a_expr));
4249 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4250 (yyval.a_expr)->meta_type = AMT_VALUE;
4251 (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
4252 }
4253 break;
4254
4255 case 264:
vlm7259fdc2006-03-16 22:39:56 +00004256#line 2072 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004257 {
4258 (yyval.a_expr) = asn1p_expr_new(yylineno);
4259 checkmem((yyval.a_expr));
4260 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4261 (yyval.a_expr)->meta_type = AMT_VALUE;
4262 (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
4263 (yyval.a_expr)->value = (yyvsp[-1].a_value);
4264 }
4265 break;
4266
4267 case 265:
vlm7259fdc2006-03-16 22:39:56 +00004268#line 2080 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004269 {
4270 (yyval.a_expr) = asn1p_expr_new(yylineno);
4271 checkmem((yyval.a_expr));
4272 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4273 (yyval.a_expr)->meta_type = AMT_VALUE;
4274 (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
4275 (yyval.a_expr)->value = (yyvsp[-1].a_value);
4276 }
4277 break;
4278
4279 case 266:
vlm7259fdc2006-03-16 22:39:56 +00004280#line 2088 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004281 {
4282 (yyval.a_expr) = asn1p_expr_new(yylineno);
4283 checkmem((yyval.a_expr));
4284 (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
4285 (yyval.a_expr)->meta_type = AMT_VALUE;
4286 (yyval.a_expr)->value = (yyvsp[0].a_value);
4287 }
4288 break;
4289
4290 case 267:
vlm7259fdc2006-03-16 22:39:56 +00004291#line 2095 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004292 {
4293 (yyval.a_expr) = asn1p_expr_new(yylineno);
4294 checkmem((yyval.a_expr));
4295 (yyval.a_expr)->Identifier = strdup("...");
4296 checkmem((yyval.a_expr)->Identifier);
4297 (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
4298 (yyval.a_expr)->meta_type = AMT_VALUE;
4299 }
4300 break;
4301
4302 case 268:
vlm7259fdc2006-03-16 22:39:56 +00004303#line 2106 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004304 {
4305 (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
4306 checkmem((yyval.a_value));
4307 }
4308 break;
4309
4310 case 269:
vlm7259fdc2006-03-16 22:39:56 +00004311#line 2110 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004312 {
4313 (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
4314 checkmem((yyval.a_value));
4315 }
4316 break;
4317
4318 case 270:
vlm7259fdc2006-03-16 22:39:56 +00004319#line 2141 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004320 { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
4321 break;
4322
4323 case 271:
vlm7259fdc2006-03-16 22:39:56 +00004324#line 2142 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004325 { (yyval.a_tag) = (yyvsp[0].a_tag); }
4326 break;
4327
4328 case 272:
vlm7259fdc2006-03-16 22:39:56 +00004329#line 2146 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004330 {
4331 (yyval.a_tag) = (yyvsp[-1].a_tag);
4332 (yyval.a_tag).tag_mode = (yyvsp[0].a_tag).tag_mode;
4333 }
4334 break;
4335
4336 case 273:
vlm7259fdc2006-03-16 22:39:56 +00004337#line 2153 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004338 {
4339 (yyval.a_tag) = (yyvsp[-2].a_tag);
4340 (yyval.a_tag).tag_value = (yyvsp[-1].a_int);
4341 }
4342 break;
4343
4344 case 274:
vlm7259fdc2006-03-16 22:39:56 +00004345#line 2159 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004346 { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
4347 break;
4348
4349 case 275:
vlm7259fdc2006-03-16 22:39:56 +00004350#line 2160 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004351 { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
4352 break;
4353
4354 case 276:
vlm7259fdc2006-03-16 22:39:56 +00004355#line 2161 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004356 { (yyval.a_tag).tag_class = TC_APPLICATION; }
4357 break;
4358
4359 case 277:
vlm7259fdc2006-03-16 22:39:56 +00004360#line 2162 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004361 { (yyval.a_tag).tag_class = TC_PRIVATE; }
4362 break;
4363
4364 case 278:
vlm7259fdc2006-03-16 22:39:56 +00004365#line 2166 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004366 { (yyval.a_tag).tag_mode = TM_DEFAULT; }
4367 break;
4368
4369 case 279:
vlm7259fdc2006-03-16 22:39:56 +00004370#line 2167 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004371 { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
4372 break;
4373
4374 case 280:
vlm7259fdc2006-03-16 22:39:56 +00004375#line 2168 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004376 { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
4377 break;
4378
4379 case 281:
vlm7259fdc2006-03-16 22:39:56 +00004380#line 2172 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004381 {
4382 checkmem((yyvsp[0].tv_str));
4383 (yyval.tv_str) = (yyvsp[0].tv_str);
4384 }
4385 break;
4386
4387 case 282:
vlm7259fdc2006-03-16 22:39:56 +00004388#line 2176 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004389 {
4390 checkmem((yyvsp[0].tv_str));
4391 (yyval.tv_str) = (yyvsp[0].tv_str);
4392 }
4393 break;
4394
4395 case 283:
vlm7259fdc2006-03-16 22:39:56 +00004396#line 2184 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004397 {
4398 checkmem((yyvsp[0].tv_str));
4399 (yyval.tv_str) = (yyvsp[0].tv_str);
4400 }
4401 break;
4402
4403 case 284:
vlm7259fdc2006-03-16 22:39:56 +00004404#line 2191 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004405 { (yyval.tv_str) = 0; }
4406 break;
4407
4408 case 285:
vlm7259fdc2006-03-16 22:39:56 +00004409#line 2192 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004410 {
4411 (yyval.tv_str) = (yyvsp[0].tv_str);
4412 }
4413 break;
4414
4415 case 286:
vlm7259fdc2006-03-16 22:39:56 +00004416#line 2198 "asn1p_y.y"
vlm7e436752006-03-18 06:53:11 +00004417 {
4418 checkmem((yyvsp[0].tv_str));
4419 (yyval.tv_str) = (yyvsp[0].tv_str);
4420 }
4421 break;
4422
4423
4424 default: break;
4425 }
4426
4427/* Line 1126 of yacc.c. */
4428#line 4429 "asn1p_y.c"
vlmfa67ddc2004-06-03 03:38:44 +00004429
4430 yyvsp -= yylen;
4431 yyssp -= yylen;
vlmfa67ddc2004-06-03 03:38:44 +00004432
vlm7e436752006-03-18 06:53:11 +00004433
4434 YY_STACK_PRINT (yyss, yyssp);
vlmfa67ddc2004-06-03 03:38:44 +00004435
4436 *++yyvsp = yyval;
4437
vlmfa67ddc2004-06-03 03:38:44 +00004438
vlm7e436752006-03-18 06:53:11 +00004439 /* Now `shift' the result of the reduction. Determine what state
4440 that goes to, based on the state we popped back to and the rule
4441 number reduced by. */
vlmfa67ddc2004-06-03 03:38:44 +00004442
4443 yyn = yyr1[yyn];
4444
vlm7e436752006-03-18 06:53:11 +00004445 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4446 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
vlmfa67ddc2004-06-03 03:38:44 +00004447 yystate = yytable[yystate];
4448 else
vlm7e436752006-03-18 06:53:11 +00004449 yystate = yydefgoto[yyn - YYNTOKENS];
vlmfa67ddc2004-06-03 03:38:44 +00004450
4451 goto yynewstate;
4452
vlmfa67ddc2004-06-03 03:38:44 +00004453
vlm7e436752006-03-18 06:53:11 +00004454/*------------------------------------.
4455| yyerrlab -- here on detecting error |
4456`------------------------------------*/
4457yyerrlab:
4458 /* If not already recovering from an error, report this error. */
4459 if (!yyerrstatus)
vlmfa67ddc2004-06-03 03:38:44 +00004460 {
4461 ++yynerrs;
vlm7e436752006-03-18 06:53:11 +00004462#if YYERROR_VERBOSE
vlmfa67ddc2004-06-03 03:38:44 +00004463 yyn = yypact[yystate];
4464
vlm7e436752006-03-18 06:53:11 +00004465 if (YYPACT_NINF < yyn && yyn < YYLAST)
vlmfa67ddc2004-06-03 03:38:44 +00004466 {
vlm7e436752006-03-18 06:53:11 +00004467 int yytype = YYTRANSLATE (yychar);
4468 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4469 YYSIZE_T yysize = yysize0;
4470 YYSIZE_T yysize1;
4471 int yysize_overflow = 0;
4472 char *yymsg = 0;
4473# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4474 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4475 int yyx;
vlmfa67ddc2004-06-03 03:38:44 +00004476
vlm7e436752006-03-18 06:53:11 +00004477#if 0
4478 /* This is so xgettext sees the translatable formats that are
4479 constructed on the fly. */
4480 YY_("syntax error, unexpected %s");
4481 YY_("syntax error, unexpected %s, expecting %s");
4482 YY_("syntax error, unexpected %s, expecting %s or %s");
4483 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4484 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4485#endif
4486 char *yyfmt;
4487 char const *yyf;
4488 static char const yyunexpected[] = "syntax error, unexpected %s";
4489 static char const yyexpecting[] = ", expecting %s";
4490 static char const yyor[] = " or %s";
4491 char yyformat[sizeof yyunexpected
4492 + sizeof yyexpecting - 1
4493 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4494 * (sizeof yyor - 1))];
4495 char const *yyprefix = yyexpecting;
4496
4497 /* Start YYX at -YYN if negative to avoid negative indexes in
4498 YYCHECK. */
4499 int yyxbegin = yyn < 0 ? -yyn : 0;
4500
4501 /* Stay within bounds of both yycheck and yytname. */
4502 int yychecklim = YYLAST - yyn;
4503 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4504 int yycount = 1;
4505
4506 yyarg[0] = yytname[yytype];
4507 yyfmt = yystpcpy (yyformat, yyunexpected);
4508
4509 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4510 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4511 {
4512 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4513 {
4514 yycount = 1;
4515 yysize = yysize0;
4516 yyformat[sizeof yyunexpected - 1] = '\0';
4517 break;
4518 }
4519 yyarg[yycount++] = yytname[yyx];
4520 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4521 yysize_overflow |= yysize1 < yysize;
4522 yysize = yysize1;
4523 yyfmt = yystpcpy (yyfmt, yyprefix);
4524 yyprefix = yyor;
4525 }
4526
4527 yyf = YY_(yyformat);
4528 yysize1 = yysize + yystrlen (yyf);
4529 yysize_overflow |= yysize1 < yysize;
4530 yysize = yysize1;
4531
4532 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
4533 yymsg = (char *) YYSTACK_ALLOC (yysize);
4534 if (yymsg)
vlmfa67ddc2004-06-03 03:38:44 +00004535 {
vlm7e436752006-03-18 06:53:11 +00004536 /* Avoid sprintf, as that infringes on the user's name space.
4537 Don't have undefined behavior even if the translation
4538 produced a string with the wrong number of "%s"s. */
4539 char *yyp = yymsg;
4540 int yyi = 0;
4541 while ((*yyp = *yyf))
vlmfa67ddc2004-06-03 03:38:44 +00004542 {
vlm7e436752006-03-18 06:53:11 +00004543 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4544 {
4545 yyp += yytnamerr (yyp, yyarg[yyi++]);
4546 yyf += 2;
4547 }
4548 else
4549 {
4550 yyp++;
4551 yyf++;
4552 }
vlmfa67ddc2004-06-03 03:38:44 +00004553 }
vlm7e436752006-03-18 06:53:11 +00004554 yyerror (yymsg);
4555 YYSTACK_FREE (yymsg);
vlmfa67ddc2004-06-03 03:38:44 +00004556 }
4557 else
vlm7e436752006-03-18 06:53:11 +00004558 {
4559 yyerror (YY_("syntax error"));
4560 goto yyexhaustedlab;
4561 }
vlmfa67ddc2004-06-03 03:38:44 +00004562 }
4563 else
4564#endif /* YYERROR_VERBOSE */
vlm7e436752006-03-18 06:53:11 +00004565 yyerror (YY_("syntax error"));
vlmfa67ddc2004-06-03 03:38:44 +00004566 }
vlm6a02a8a2004-09-08 00:28:11 +00004567
vlm7e436752006-03-18 06:53:11 +00004568
vlmfa67ddc2004-06-03 03:38:44 +00004569
4570 if (yyerrstatus == 3)
4571 {
vlm7e436752006-03-18 06:53:11 +00004572 /* If just tried and failed to reuse look-ahead token after an
4573 error, discard it. */
vlmfa67ddc2004-06-03 03:38:44 +00004574
vlm7e436752006-03-18 06:53:11 +00004575 if (yychar <= YYEOF)
4576 {
4577 /* Return failure if at end of input. */
4578 if (yychar == YYEOF)
4579 YYABORT;
4580 }
4581 else
4582 {
4583 yydestruct ("Error: discarding", yytoken, &yylval);
4584 yychar = YYEMPTY;
4585 }
4586 }
4587
4588 /* Else will try to reuse look-ahead token after shifting the error
4589 token. */
4590 goto yyerrlab1;
4591
4592
4593/*---------------------------------------------------.
4594| yyerrorlab -- error raised explicitly by YYERROR. |
4595`---------------------------------------------------*/
4596yyerrorlab:
4597
4598 /* Pacify compilers like GCC when the user code never invokes
4599 YYERROR and the label yyerrorlab therefore never appears in user
4600 code. */
4601 if (0)
4602 goto yyerrorlab;
4603
4604yyvsp -= yylen;
4605 yyssp -= yylen;
4606 yystate = *yyssp;
4607 goto yyerrlab1;
4608
4609
4610/*-------------------------------------------------------------.
4611| yyerrlab1 -- common code for both syntax error and YYERROR. |
4612`-------------------------------------------------------------*/
4613yyerrlab1:
4614 yyerrstatus = 3; /* Each real token shifted decrements this. */
4615
4616 for (;;)
4617 {
4618 yyn = yypact[yystate];
4619 if (yyn != YYPACT_NINF)
4620 {
4621 yyn += YYTERROR;
4622 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4623 {
4624 yyn = yytable[yyn];
4625 if (0 < yyn)
4626 break;
4627 }
4628 }
4629
4630 /* Pop the current state because it cannot handle the error token. */
4631 if (yyssp == yyss)
vlm6a02a8a2004-09-08 00:28:11 +00004632 YYABORT;
vlmfa67ddc2004-06-03 03:38:44 +00004633
vlm6a02a8a2004-09-08 00:28:11 +00004634
vlm7e436752006-03-18 06:53:11 +00004635 yydestruct ("Error: popping", yystos[yystate], yyvsp);
4636 YYPOPSTACK;
4637 yystate = *yyssp;
4638 YY_STACK_PRINT (yyss, yyssp);
vlmfa67ddc2004-06-03 03:38:44 +00004639 }
4640
vlmfa67ddc2004-06-03 03:38:44 +00004641 if (yyn == YYFINAL)
4642 YYACCEPT;
4643
vlmfa67ddc2004-06-03 03:38:44 +00004644 *++yyvsp = yylval;
vlm7e436752006-03-18 06:53:11 +00004645
4646
4647 /* Shift the error token. */
4648 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
vlmfa67ddc2004-06-03 03:38:44 +00004649
4650 yystate = yyn;
4651 goto yynewstate;
4652
vlm80103492004-09-07 10:39:09 +00004653
vlm7e436752006-03-18 06:53:11 +00004654/*-------------------------------------.
4655| yyacceptlab -- YYACCEPT comes here. |
4656`-------------------------------------*/
4657yyacceptlab:
4658 yyresult = 0;
4659 goto yyreturn;
4660
4661/*-----------------------------------.
4662| yyabortlab -- YYABORT comes here. |
4663`-----------------------------------*/
4664yyabortlab:
4665 yyresult = 1;
4666 goto yyreturn;
4667
4668#ifndef yyoverflow
4669/*-------------------------------------------------.
4670| yyexhaustedlab -- memory exhaustion comes here. |
4671`-------------------------------------------------*/
4672yyexhaustedlab:
4673 yyerror (YY_("memory exhausted"));
4674 yyresult = 2;
4675 /* Fall through. */
vlm80103492004-09-07 10:39:09 +00004676#endif
vlm7e436752006-03-18 06:53:11 +00004677
4678yyreturn:
4679 if (yychar != YYEOF && yychar != YYEMPTY)
4680 yydestruct ("Cleanup: discarding lookahead",
4681 yytoken, &yylval);
4682 while (yyssp != yyss)
4683 {
4684 yydestruct ("Cleanup: popping",
4685 yystos[*yyssp], yyvsp);
4686 YYPOPSTACK;
vlm6a02a8a2004-09-08 00:28:11 +00004687 }
vlm7e436752006-03-18 06:53:11 +00004688#ifndef yyoverflow
4689 if (yyss != yyssa)
4690 YYSTACK_FREE (yyss);
4691#endif
4692 return yyresult;
vlmfa67ddc2004-06-03 03:38:44 +00004693}
vlm7e436752006-03-18 06:53:11 +00004694
4695
vlm7259fdc2006-03-16 22:39:56 +00004696#line 2204 "asn1p_y.y"
vlmfa67ddc2004-06-03 03:38:44 +00004697
4698
4699
4700/*
4701 * Convert Xstring ('0101'B or '5'H) to the binary vector.
4702 */
4703static asn1p_value_t *
4704_convert_bitstring2binary(char *str, int base) {
4705 asn1p_value_t *val;
4706 int slen;
4707 int memlen;
4708 int baselen;
4709 int bits;
4710 uint8_t *binary_vector;
4711 uint8_t *bv_ptr;
4712 uint8_t cur_val;
4713
4714 assert(str);
4715 assert(str[0] == '\'');
4716
4717 switch(base) {
4718 case 'B':
4719 baselen = 1;
4720 break;
4721 case 'H':
4722 baselen = 4;
4723 break;
4724 default:
4725 assert(base == 'B' || base == 'H');
4726 errno = EINVAL;
4727 return NULL;
4728 }
4729
4730 slen = strlen(str);
4731 assert(str[slen - 1] == base);
4732 assert(str[slen - 2] == '\'');
4733
4734 memlen = slen / (8 / baselen); /* Conservative estimate */
4735
4736 bv_ptr = binary_vector = malloc(memlen + 1);
4737 if(bv_ptr == NULL)
4738 /* ENOMEM */
4739 return NULL;
4740
4741 cur_val = 0;
4742 bits = 0;
4743 while(*(++str) != '\'') {
4744 switch(baselen) {
4745 case 1:
4746 switch(*str) {
4747 case '1':
4748 cur_val |= 1 << (7 - (bits % 8));
4749 case '0':
4750 break;
4751 default:
4752 assert(!"_y UNREACH1");
4753 case ' ': case '\r': case '\n':
4754 continue;
4755 }
4756 break;
4757 case 4:
4758 switch(*str) {
4759 case '0': case '1': case '2': case '3': case '4':
4760 case '5': case '6': case '7': case '8': case '9':
4761 cur_val |= (*str - '0') << (4 - (bits % 8));
4762 break;
4763 case 'A': case 'B': case 'C':
4764 case 'D': case 'E': case 'F':
4765 cur_val |= ((*str - 'A') + 10)
4766 << (4 - (bits % 8));
4767 break;
4768 default:
4769 assert(!"_y UNREACH2");
4770 case ' ': case '\r': case '\n':
4771 continue;
4772 }
4773 break;
4774 }
4775
4776 bits += baselen;
4777 if((bits % 8) == 0) {
4778 *bv_ptr++ = cur_val;
4779 cur_val = 0;
4780 }
4781 }
4782
4783 *bv_ptr = cur_val;
4784 assert((bv_ptr - binary_vector) <= memlen);
4785
4786 val = asn1p_value_frombits(binary_vector, bits, 0);
4787 if(val == NULL) {
4788 free(binary_vector);
4789 }
4790
4791 return val;
4792}
4793
vlm5d89c3d2005-08-13 09:07:11 +00004794/*
4795 * For unnamed types (used in old X.208 compliant modules)
4796 * generate some sort of interim names, to not to force human being to fix
4797 * the specification's compliance to modern ASN.1 standards.
4798 */
4799static void
4800_fixup_anonymous_identifier(asn1p_expr_t *expr) {
4801 char *p;
4802 assert(expr->Identifier == 0);
4803
4804 /*
4805 * Try to figure out the type name
4806 * without going too much into details
4807 */
4808 expr->Identifier = ASN_EXPR_TYPE2STR(expr->expr_type);
4809 if(expr->reference && expr->reference->comp_count > 0)
4810 expr->Identifier = expr->reference->components[0].name;
4811
4812 fprintf(stderr,
4813 "WARNING: Line %d: expected lower-case member identifier, "
4814 "found an unnamed %s.\n"
4815 "WARNING: Obsolete X.208 syntax detected, "
4816 "please give the member a name.\n",
4817 yylineno, expr->Identifier ? expr->Identifier : "type");
4818
4819 if(!expr->Identifier)
4820 expr->Identifier = "unnamed";
4821 expr->Identifier = strdup(expr->Identifier);
4822 assert(expr->Identifier);
4823 /* Make a lowercase identifier from the type name */
4824 for(p = expr->Identifier; *p; p++) {
4825 switch(*p) {
4826 case 'A' ... 'Z': *p += 32; break;
4827 case ' ': *p = '_'; break;
4828 case '-': *p = '_'; break;
4829 }
4830 }
4831 fprintf(stderr, "NOTE: Assigning temporary identifier \"%s\". "
4832 "Name clash may occur later.\n",
4833 expr->Identifier);
4834}
4835
vlmfa67ddc2004-06-03 03:38:44 +00004836int
4837yyerror(const char *msg) {
vlm808411d2006-03-14 16:31:37 +00004838 extern char *asn1p_text;
vlmfa67ddc2004-06-03 03:38:44 +00004839 fprintf(stderr,
4840 "ASN.1 grammar parse error "
4841 "near line %d (token \"%s\"): %s\n",
vlm39e5ed72004-09-05 10:40:41 +00004842 yylineno, asn1p_text, msg);
vlmfa67ddc2004-06-03 03:38:44 +00004843 return -1;
4844}
4845
vlm7e436752006-03-18 06:53:11 +00004846