1 | /* A Bison parser, made by GNU Bison 2.3. */
|
---|
2 |
|
---|
3 | /* Skeleton implementation for Bison's Yacc-like parsers in C
|
---|
4 |
|
---|
5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
---|
6 | Free Software Foundation, Inc.
|
---|
7 |
|
---|
8 | This program is free software; you can redistribute it and/or modify
|
---|
9 | it under the terms of the GNU General Public License as published by
|
---|
10 | the Free Software Foundation; either version 2, or (at your option)
|
---|
11 | any later version.
|
---|
12 |
|
---|
13 | This program is distributed in the hope that it will be useful,
|
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | GNU General Public License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License
|
---|
19 | along with this program; if not, write to the Free Software
|
---|
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
21 | Boston, MA 02110-1301, USA. */
|
---|
22 |
|
---|
23 | /* As a special exception, you may create a larger work that contains
|
---|
24 | part or all of the Bison parser skeleton and distribute that work
|
---|
25 | under terms of your choice, so long as that work isn't itself a
|
---|
26 | parser generator using the skeleton or a modified version thereof
|
---|
27 | as a parser skeleton. Alternatively, if you modify or redistribute
|
---|
28 | the parser skeleton itself, you may (at your option) remove this
|
---|
29 | special exception, which will cause the skeleton and the resulting
|
---|
30 | Bison output files to be licensed under the GNU General Public
|
---|
31 | License without this special exception.
|
---|
32 |
|
---|
33 | This special exception was added by the Free Software Foundation in
|
---|
34 | version 2.2 of Bison. */
|
---|
35 |
|
---|
36 | /* C LALR(1) parser skeleton written by Richard Stallman, by
|
---|
37 | simplifying the original so-called "semantic" parser. */
|
---|
38 |
|
---|
39 | /* All symbols defined below should begin with yy or YY, to avoid
|
---|
40 | infringing on user name space. This should be done even for local
|
---|
41 | variables, as they might otherwise be expanded by user macros.
|
---|
42 | There are some unavoidable exceptions within include files to
|
---|
43 | define necessary library symbols; they are noted "INFRINGES ON
|
---|
44 | USER NAME SPACE" below. */
|
---|
45 |
|
---|
46 | /* Identify Bison output. */
|
---|
47 | #define YYBISON 1
|
---|
48 |
|
---|
49 | /* Bison version. */
|
---|
50 | #define YYBISON_VERSION "2.3"
|
---|
51 |
|
---|
52 | /* Skeleton name. */
|
---|
53 | #define YYSKELETON_NAME "yacc.c"
|
---|
54 |
|
---|
55 | /* Pure parsers. */
|
---|
56 | #define YYPURE 0
|
---|
57 |
|
---|
58 | /* Using locations. */
|
---|
59 | #define YYLSP_NEEDED 0
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 | /* Tokens. */
|
---|
64 | #ifndef YYTOKENTYPE
|
---|
65 | # define YYTOKENTYPE
|
---|
66 | /* Put the tokens into the symbol table, so that GDB and other debuggers
|
---|
67 | know about them. */
|
---|
68 | enum yytokentype {
|
---|
69 | kw_ABSENT = 258,
|
---|
70 | kw_ABSTRACT_SYNTAX = 259,
|
---|
71 | kw_ALL = 260,
|
---|
72 | kw_APPLICATION = 261,
|
---|
73 | kw_AUTOMATIC = 262,
|
---|
74 | kw_BEGIN = 263,
|
---|
75 | kw_BIT = 264,
|
---|
76 | kw_BMPString = 265,
|
---|
77 | kw_BOOLEAN = 266,
|
---|
78 | kw_BY = 267,
|
---|
79 | kw_CHARACTER = 268,
|
---|
80 | kw_CHOICE = 269,
|
---|
81 | kw_CLASS = 270,
|
---|
82 | kw_COMPONENT = 271,
|
---|
83 | kw_COMPONENTS = 272,
|
---|
84 | kw_CONSTRAINED = 273,
|
---|
85 | kw_CONTAINING = 274,
|
---|
86 | kw_DEFAULT = 275,
|
---|
87 | kw_DEFINITIONS = 276,
|
---|
88 | kw_EMBEDDED = 277,
|
---|
89 | kw_ENCODED = 278,
|
---|
90 | kw_END = 279,
|
---|
91 | kw_ENUMERATED = 280,
|
---|
92 | kw_EXCEPT = 281,
|
---|
93 | kw_EXPLICIT = 282,
|
---|
94 | kw_EXPORTS = 283,
|
---|
95 | kw_EXTENSIBILITY = 284,
|
---|
96 | kw_EXTERNAL = 285,
|
---|
97 | kw_FALSE = 286,
|
---|
98 | kw_FROM = 287,
|
---|
99 | kw_GeneralString = 288,
|
---|
100 | kw_GeneralizedTime = 289,
|
---|
101 | kw_GraphicString = 290,
|
---|
102 | kw_IA5String = 291,
|
---|
103 | kw_IDENTIFIER = 292,
|
---|
104 | kw_IMPLICIT = 293,
|
---|
105 | kw_IMPLIED = 294,
|
---|
106 | kw_IMPORTS = 295,
|
---|
107 | kw_INCLUDES = 296,
|
---|
108 | kw_INSTANCE = 297,
|
---|
109 | kw_INTEGER = 298,
|
---|
110 | kw_INTERSECTION = 299,
|
---|
111 | kw_ISO646String = 300,
|
---|
112 | kw_MAX = 301,
|
---|
113 | kw_MIN = 302,
|
---|
114 | kw_MINUS_INFINITY = 303,
|
---|
115 | kw_NULL = 304,
|
---|
116 | kw_NumericString = 305,
|
---|
117 | kw_OBJECT = 306,
|
---|
118 | kw_OCTET = 307,
|
---|
119 | kw_OF = 308,
|
---|
120 | kw_OPTIONAL = 309,
|
---|
121 | kw_ObjectDescriptor = 310,
|
---|
122 | kw_PATTERN = 311,
|
---|
123 | kw_PDV = 312,
|
---|
124 | kw_PLUS_INFINITY = 313,
|
---|
125 | kw_PRESENT = 314,
|
---|
126 | kw_PRIVATE = 315,
|
---|
127 | kw_PrintableString = 316,
|
---|
128 | kw_REAL = 317,
|
---|
129 | kw_RELATIVE_OID = 318,
|
---|
130 | kw_SEQUENCE = 319,
|
---|
131 | kw_SET = 320,
|
---|
132 | kw_SIZE = 321,
|
---|
133 | kw_STRING = 322,
|
---|
134 | kw_SYNTAX = 323,
|
---|
135 | kw_T61String = 324,
|
---|
136 | kw_TAGS = 325,
|
---|
137 | kw_TRUE = 326,
|
---|
138 | kw_TYPE_IDENTIFIER = 327,
|
---|
139 | kw_TeletexString = 328,
|
---|
140 | kw_UNION = 329,
|
---|
141 | kw_UNIQUE = 330,
|
---|
142 | kw_UNIVERSAL = 331,
|
---|
143 | kw_UTCTime = 332,
|
---|
144 | kw_UTF8String = 333,
|
---|
145 | kw_UniversalString = 334,
|
---|
146 | kw_VideotexString = 335,
|
---|
147 | kw_VisibleString = 336,
|
---|
148 | kw_WITH = 337,
|
---|
149 | RANGE = 338,
|
---|
150 | EEQUAL = 339,
|
---|
151 | ELLIPSIS = 340,
|
---|
152 | IDENTIFIER = 341,
|
---|
153 | referencename = 342,
|
---|
154 | STRING = 343,
|
---|
155 | NUMBER = 344
|
---|
156 | };
|
---|
157 | #endif
|
---|
158 | /* Tokens. */
|
---|
159 | #define kw_ABSENT 258
|
---|
160 | #define kw_ABSTRACT_SYNTAX 259
|
---|
161 | #define kw_ALL 260
|
---|
162 | #define kw_APPLICATION 261
|
---|
163 | #define kw_AUTOMATIC 262
|
---|
164 | #define kw_BEGIN 263
|
---|
165 | #define kw_BIT 264
|
---|
166 | #define kw_BMPString 265
|
---|
167 | #define kw_BOOLEAN 266
|
---|
168 | #define kw_BY 267
|
---|
169 | #define kw_CHARACTER 268
|
---|
170 | #define kw_CHOICE 269
|
---|
171 | #define kw_CLASS 270
|
---|
172 | #define kw_COMPONENT 271
|
---|
173 | #define kw_COMPONENTS 272
|
---|
174 | #define kw_CONSTRAINED 273
|
---|
175 | #define kw_CONTAINING 274
|
---|
176 | #define kw_DEFAULT 275
|
---|
177 | #define kw_DEFINITIONS 276
|
---|
178 | #define kw_EMBEDDED 277
|
---|
179 | #define kw_ENCODED 278
|
---|
180 | #define kw_END 279
|
---|
181 | #define kw_ENUMERATED 280
|
---|
182 | #define kw_EXCEPT 281
|
---|
183 | #define kw_EXPLICIT 282
|
---|
184 | #define kw_EXPORTS 283
|
---|
185 | #define kw_EXTENSIBILITY 284
|
---|
186 | #define kw_EXTERNAL 285
|
---|
187 | #define kw_FALSE 286
|
---|
188 | #define kw_FROM 287
|
---|
189 | #define kw_GeneralString 288
|
---|
190 | #define kw_GeneralizedTime 289
|
---|
191 | #define kw_GraphicString 290
|
---|
192 | #define kw_IA5String 291
|
---|
193 | #define kw_IDENTIFIER 292
|
---|
194 | #define kw_IMPLICIT 293
|
---|
195 | #define kw_IMPLIED 294
|
---|
196 | #define kw_IMPORTS 295
|
---|
197 | #define kw_INCLUDES 296
|
---|
198 | #define kw_INSTANCE 297
|
---|
199 | #define kw_INTEGER 298
|
---|
200 | #define kw_INTERSECTION 299
|
---|
201 | #define kw_ISO646String 300
|
---|
202 | #define kw_MAX 301
|
---|
203 | #define kw_MIN 302
|
---|
204 | #define kw_MINUS_INFINITY 303
|
---|
205 | #define kw_NULL 304
|
---|
206 | #define kw_NumericString 305
|
---|
207 | #define kw_OBJECT 306
|
---|
208 | #define kw_OCTET 307
|
---|
209 | #define kw_OF 308
|
---|
210 | #define kw_OPTIONAL 309
|
---|
211 | #define kw_ObjectDescriptor 310
|
---|
212 | #define kw_PATTERN 311
|
---|
213 | #define kw_PDV 312
|
---|
214 | #define kw_PLUS_INFINITY 313
|
---|
215 | #define kw_PRESENT 314
|
---|
216 | #define kw_PRIVATE 315
|
---|
217 | #define kw_PrintableString 316
|
---|
218 | #define kw_REAL 317
|
---|
219 | #define kw_RELATIVE_OID 318
|
---|
220 | #define kw_SEQUENCE 319
|
---|
221 | #define kw_SET 320
|
---|
222 | #define kw_SIZE 321
|
---|
223 | #define kw_STRING 322
|
---|
224 | #define kw_SYNTAX 323
|
---|
225 | #define kw_T61String 324
|
---|
226 | #define kw_TAGS 325
|
---|
227 | #define kw_TRUE 326
|
---|
228 | #define kw_TYPE_IDENTIFIER 327
|
---|
229 | #define kw_TeletexString 328
|
---|
230 | #define kw_UNION 329
|
---|
231 | #define kw_UNIQUE 330
|
---|
232 | #define kw_UNIVERSAL 331
|
---|
233 | #define kw_UTCTime 332
|
---|
234 | #define kw_UTF8String 333
|
---|
235 | #define kw_UniversalString 334
|
---|
236 | #define kw_VideotexString 335
|
---|
237 | #define kw_VisibleString 336
|
---|
238 | #define kw_WITH 337
|
---|
239 | #define RANGE 338
|
---|
240 | #define EEQUAL 339
|
---|
241 | #define ELLIPSIS 340
|
---|
242 | #define IDENTIFIER 341
|
---|
243 | #define referencename 342
|
---|
244 | #define STRING 343
|
---|
245 | #define NUMBER 344
|
---|
246 |
|
---|
247 |
|
---|
248 |
|
---|
249 |
|
---|
250 | /* Copy the first part of user declarations. */
|
---|
251 | #line 36 "heimdal/lib/asn1/asn1parse.y"
|
---|
252 |
|
---|
253 |
|
---|
254 | #include <config.h>
|
---|
255 |
|
---|
256 | #include <stdio.h>
|
---|
257 | #include <stdlib.h>
|
---|
258 | #include <string.h>
|
---|
259 | #include "symbol.h"
|
---|
260 | #include "lex.h"
|
---|
261 | #include "gen_locl.h"
|
---|
262 | #include "der.h"
|
---|
263 |
|
---|
264 | RCSID("$Id$");
|
---|
265 |
|
---|
266 | static Type *new_type (Typetype t);
|
---|
267 | static struct constraint_spec *new_constraint_spec(enum ctype);
|
---|
268 | static Type *new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype);
|
---|
269 | void yyerror (const char *);
|
---|
270 | static struct objid *new_objid(const char *label, int value);
|
---|
271 | static void add_oid_to_tail(struct objid *, struct objid *);
|
---|
272 | static void fix_labels(Symbol *s);
|
---|
273 |
|
---|
274 | struct string_list {
|
---|
275 | char *string;
|
---|
276 | struct string_list *next;
|
---|
277 | };
|
---|
278 |
|
---|
279 |
|
---|
280 |
|
---|
281 | /* Enabling traces. */
|
---|
282 | #ifndef YYDEBUG
|
---|
283 | # define YYDEBUG 0
|
---|
284 | #endif
|
---|
285 |
|
---|
286 | /* Enabling verbose error messages. */
|
---|
287 | #ifdef YYERROR_VERBOSE
|
---|
288 | # undef YYERROR_VERBOSE
|
---|
289 | # define YYERROR_VERBOSE 1
|
---|
290 | #else
|
---|
291 | # define YYERROR_VERBOSE 0
|
---|
292 | #endif
|
---|
293 |
|
---|
294 | /* Enabling the token table. */
|
---|
295 | #ifndef YYTOKEN_TABLE
|
---|
296 | # define YYTOKEN_TABLE 0
|
---|
297 | #endif
|
---|
298 |
|
---|
299 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
---|
300 | typedef union YYSTYPE
|
---|
301 | #line 65 "heimdal/lib/asn1/asn1parse.y"
|
---|
302 | {
|
---|
303 | int constant;
|
---|
304 | struct value *value;
|
---|
305 | struct range *range;
|
---|
306 | char *name;
|
---|
307 | Type *type;
|
---|
308 | Member *member;
|
---|
309 | struct objid *objid;
|
---|
310 | char *defval;
|
---|
311 | struct string_list *sl;
|
---|
312 | struct tagtype tag;
|
---|
313 | struct memhead *members;
|
---|
314 | struct constraint_spec *constraint_spec;
|
---|
315 | }
|
---|
316 | /* Line 187 of yacc.c. */
|
---|
317 | #line 318 "heimdal/lib/asn1/asn1parse.y"
|
---|
318 | YYSTYPE;
|
---|
319 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
---|
320 | # define YYSTYPE_IS_DECLARED 1
|
---|
321 | # define YYSTYPE_IS_TRIVIAL 1
|
---|
322 | #endif
|
---|
323 |
|
---|
324 |
|
---|
325 |
|
---|
326 | /* Copy the second part of user declarations. */
|
---|
327 |
|
---|
328 |
|
---|
329 | /* Line 216 of yacc.c. */
|
---|
330 | #line 331 "heimdal/lib/asn1/asn1parse.y"
|
---|
331 |
|
---|
332 | #ifdef short
|
---|
333 | # undef short
|
---|
334 | #endif
|
---|
335 |
|
---|
336 | #ifdef YYTYPE_UINT8
|
---|
337 | typedef YYTYPE_UINT8 yytype_uint8;
|
---|
338 | #else
|
---|
339 | typedef unsigned char yytype_uint8;
|
---|
340 | #endif
|
---|
341 |
|
---|
342 | #ifdef YYTYPE_INT8
|
---|
343 | typedef YYTYPE_INT8 yytype_int8;
|
---|
344 | #elif (defined __STDC__ || defined __C99__FUNC__ \
|
---|
345 | || defined __cplusplus || defined _MSC_VER)
|
---|
346 | typedef signed char yytype_int8;
|
---|
347 | #else
|
---|
348 | typedef short int yytype_int8;
|
---|
349 | #endif
|
---|
350 |
|
---|
351 | #ifdef YYTYPE_UINT16
|
---|
352 | typedef YYTYPE_UINT16 yytype_uint16;
|
---|
353 | #else
|
---|
354 | typedef unsigned short int yytype_uint16;
|
---|
355 | #endif
|
---|
356 |
|
---|
357 | #ifdef YYTYPE_INT16
|
---|
358 | typedef YYTYPE_INT16 yytype_int16;
|
---|
359 | #else
|
---|
360 | typedef short int yytype_int16;
|
---|
361 | #endif
|
---|
362 |
|
---|
363 | #ifndef YYSIZE_T
|
---|
364 | # ifdef __SIZE_TYPE__
|
---|
365 | # define YYSIZE_T __SIZE_TYPE__
|
---|
366 | # elif defined size_t
|
---|
367 | # define YYSIZE_T size_t
|
---|
368 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
|
---|
369 | || defined __cplusplus || defined _MSC_VER)
|
---|
370 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
---|
371 | # define YYSIZE_T size_t
|
---|
372 | # else
|
---|
373 | # define YYSIZE_T unsigned int
|
---|
374 | # endif
|
---|
375 | #endif
|
---|
376 |
|
---|
377 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
|
---|
378 |
|
---|
379 | #ifndef YY_
|
---|
380 | # if YYENABLE_NLS
|
---|
381 | # if ENABLE_NLS
|
---|
382 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
---|
383 | # define YY_(msgid) dgettext ("bison-runtime", msgid)
|
---|
384 | # endif
|
---|
385 | # endif
|
---|
386 | # ifndef YY_
|
---|
387 | # define YY_(msgid) msgid
|
---|
388 | # endif
|
---|
389 | #endif
|
---|
390 |
|
---|
391 | /* Suppress unused-variable warnings by "using" E. */
|
---|
392 | #if ! defined lint || defined __GNUC__
|
---|
393 | # define YYUSE(e) ((void) (e))
|
---|
394 | #else
|
---|
395 | # define YYUSE(e) /* empty */
|
---|
396 | #endif
|
---|
397 |
|
---|
398 | /* Identity function, used to suppress warnings about constant conditions. */
|
---|
399 | #ifndef lint
|
---|
400 | # define YYID(n) (n)
|
---|
401 | #else
|
---|
402 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
403 | || defined __cplusplus || defined _MSC_VER)
|
---|
404 | static int
|
---|
405 | YYID (int i)
|
---|
406 | #else
|
---|
407 | static int
|
---|
408 | YYID (i)
|
---|
409 | int i;
|
---|
410 | #endif
|
---|
411 | {
|
---|
412 | return i;
|
---|
413 | }
|
---|
414 | #endif
|
---|
415 |
|
---|
416 | #if ! defined yyoverflow || YYERROR_VERBOSE
|
---|
417 |
|
---|
418 | /* The parser invokes alloca or malloc; define the necessary symbols. */
|
---|
419 |
|
---|
420 | # ifdef YYSTACK_USE_ALLOCA
|
---|
421 | # if YYSTACK_USE_ALLOCA
|
---|
422 | # ifdef __GNUC__
|
---|
423 | # define YYSTACK_ALLOC __builtin_alloca
|
---|
424 | # elif defined __BUILTIN_VA_ARG_INCR
|
---|
425 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
|
---|
426 | # elif defined _AIX
|
---|
427 | # define YYSTACK_ALLOC __alloca
|
---|
428 | # elif defined _MSC_VER
|
---|
429 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
|
---|
430 | # define alloca _alloca
|
---|
431 | # else
|
---|
432 | # define YYSTACK_ALLOC alloca
|
---|
433 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
---|
434 | || defined __cplusplus || defined _MSC_VER)
|
---|
435 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
---|
436 | # ifndef _STDLIB_H
|
---|
437 | # define _STDLIB_H 1
|
---|
438 | # endif
|
---|
439 | # endif
|
---|
440 | # endif
|
---|
441 | # endif
|
---|
442 | # endif
|
---|
443 |
|
---|
444 | # ifdef YYSTACK_ALLOC
|
---|
445 | /* Pacify GCC's `empty if-body' warning. */
|
---|
446 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
|
---|
447 | # ifndef YYSTACK_ALLOC_MAXIMUM
|
---|
448 | /* The OS might guarantee only one guard page at the bottom of the stack,
|
---|
449 | and a page size can be as small as 4096 bytes. So we cannot safely
|
---|
450 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
|
---|
451 | to allow for a few compiler-allocated temporary stack slots. */
|
---|
452 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
|
---|
453 | # endif
|
---|
454 | # else
|
---|
455 | # define YYSTACK_ALLOC YYMALLOC
|
---|
456 | # define YYSTACK_FREE YYFREE
|
---|
457 | # ifndef YYSTACK_ALLOC_MAXIMUM
|
---|
458 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
|
---|
459 | # endif
|
---|
460 | # if (defined __cplusplus && ! defined _STDLIB_H \
|
---|
461 | && ! ((defined YYMALLOC || defined malloc) \
|
---|
462 | && (defined YYFREE || defined free)))
|
---|
463 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
---|
464 | # ifndef _STDLIB_H
|
---|
465 | # define _STDLIB_H 1
|
---|
466 | # endif
|
---|
467 | # endif
|
---|
468 | # ifndef YYMALLOC
|
---|
469 | # define YYMALLOC malloc
|
---|
470 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
---|
471 | || defined __cplusplus || defined _MSC_VER)
|
---|
472 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
|
---|
473 | # endif
|
---|
474 | # endif
|
---|
475 | # ifndef YYFREE
|
---|
476 | # define YYFREE free
|
---|
477 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
---|
478 | || defined __cplusplus || defined _MSC_VER)
|
---|
479 | void free (void *); /* INFRINGES ON USER NAME SPACE */
|
---|
480 | # endif
|
---|
481 | # endif
|
---|
482 | # endif
|
---|
483 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
|
---|
484 |
|
---|
485 |
|
---|
486 | #if (! defined yyoverflow \
|
---|
487 | && (! defined __cplusplus \
|
---|
488 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
---|
489 |
|
---|
490 | /* A type that is properly aligned for any stack member. */
|
---|
491 | union yyalloc
|
---|
492 | {
|
---|
493 | yytype_int16 yyss;
|
---|
494 | YYSTYPE yyvs;
|
---|
495 | };
|
---|
496 |
|
---|
497 | /* The size of the maximum gap between one aligned stack and the next. */
|
---|
498 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
|
---|
499 |
|
---|
500 | /* The size of an array large to enough to hold all stacks, each with
|
---|
501 | N elements. */
|
---|
502 | # define YYSTACK_BYTES(N) \
|
---|
503 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
|
---|
504 | + YYSTACK_GAP_MAXIMUM)
|
---|
505 |
|
---|
506 | /* Copy COUNT objects from FROM to TO. The source and destination do
|
---|
507 | not overlap. */
|
---|
508 | # ifndef YYCOPY
|
---|
509 | # if defined __GNUC__ && 1 < __GNUC__
|
---|
510 | # define YYCOPY(To, From, Count) \
|
---|
511 | __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
---|
512 | # else
|
---|
513 | # define YYCOPY(To, From, Count) \
|
---|
514 | do \
|
---|
515 | { \
|
---|
516 | YYSIZE_T yyi; \
|
---|
517 | for (yyi = 0; yyi < (Count); yyi++) \
|
---|
518 | (To)[yyi] = (From)[yyi]; \
|
---|
519 | } \
|
---|
520 | while (YYID (0))
|
---|
521 | # endif
|
---|
522 | # endif
|
---|
523 |
|
---|
524 | /* Relocate STACK from its old location to the new one. The
|
---|
525 | local variables YYSIZE and YYSTACKSIZE give the old and new number of
|
---|
526 | elements in the stack, and YYPTR gives the new location of the
|
---|
527 | stack. Advance YYPTR to a properly aligned location for the next
|
---|
528 | stack. */
|
---|
529 | # define YYSTACK_RELOCATE(Stack) \
|
---|
530 | do \
|
---|
531 | { \
|
---|
532 | YYSIZE_T yynewbytes; \
|
---|
533 | YYCOPY (&yyptr->Stack, Stack, yysize); \
|
---|
534 | Stack = &yyptr->Stack; \
|
---|
535 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
|
---|
536 | yyptr += yynewbytes / sizeof (*yyptr); \
|
---|
537 | } \
|
---|
538 | while (YYID (0))
|
---|
539 |
|
---|
540 | #endif
|
---|
541 |
|
---|
542 | /* YYFINAL -- State number of the termination state. */
|
---|
543 | #define YYFINAL 6
|
---|
544 | /* YYLAST -- Last index in YYTABLE. */
|
---|
545 | #define YYLAST 195
|
---|
546 |
|
---|
547 | /* YYNTOKENS -- Number of terminals. */
|
---|
548 | #define YYNTOKENS 98
|
---|
549 | /* YYNNTS -- Number of nonterminals. */
|
---|
550 | #define YYNNTS 68
|
---|
551 | /* YYNRULES -- Number of rules. */
|
---|
552 | #define YYNRULES 136
|
---|
553 | /* YYNRULES -- Number of states. */
|
---|
554 | #define YYNSTATES 214
|
---|
555 |
|
---|
556 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
---|
557 | #define YYUNDEFTOK 2
|
---|
558 | #define YYMAXUTOK 344
|
---|
559 |
|
---|
560 | #define YYTRANSLATE(YYX) \
|
---|
561 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
---|
562 |
|
---|
563 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
---|
564 | static const yytype_uint8 yytranslate[] =
|
---|
565 | {
|
---|
566 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
567 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
568 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
569 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
570 | 92, 93, 2, 2, 91, 2, 2, 2, 2, 2,
|
---|
571 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 90,
|
---|
572 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
573 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
574 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
575 | 2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
|
---|
576 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
577 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
578 | 2, 2, 2, 94, 2, 95, 2, 2, 2, 2,
|
---|
579 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
580 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
581 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
582 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
583 | 2, 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, 2, 2, 2, 2, 2, 2, 2,
|
---|
587 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
588 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
589 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
590 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
---|
591 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
|
---|
592 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
---|
593 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
---|
594 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
---|
595 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
|
---|
596 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
|
---|
597 | 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
---|
598 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
|
---|
599 | 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
|
---|
600 | 85, 86, 87, 88, 89
|
---|
601 | };
|
---|
602 |
|
---|
603 | #if YYDEBUG
|
---|
604 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
---|
605 | YYRHS. */
|
---|
606 | static const yytype_uint16 yyprhs[] =
|
---|
607 | {
|
---|
608 | 0, 0, 3, 13, 16, 19, 22, 23, 26, 27,
|
---|
609 | 30, 31, 35, 36, 38, 39, 41, 44, 49, 51,
|
---|
610 | 54, 56, 58, 62, 64, 68, 70, 72, 74, 76,
|
---|
611 | 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
|
---|
612 | 98, 100, 102, 104, 110, 116, 122, 126, 128, 131,
|
---|
613 | 136, 138, 142, 146, 151, 156, 158, 161, 167, 170,
|
---|
614 | 174, 176, 177, 180, 185, 189, 194, 199, 203, 207,
|
---|
615 | 212, 214, 216, 218, 220, 222, 225, 229, 231, 233,
|
---|
616 | 235, 238, 242, 248, 253, 257, 262, 263, 265, 267,
|
---|
617 | 269, 270, 272, 274, 279, 281, 283, 285, 287, 289,
|
---|
618 | 291, 293, 295, 297, 301, 305, 308, 310, 313, 317,
|
---|
619 | 319, 323, 328, 330, 331, 335, 336, 339, 344, 346,
|
---|
620 | 348, 350, 352, 354, 356, 358, 360, 362, 364, 366,
|
---|
621 | 368, 370, 372, 374, 376, 378, 380
|
---|
622 | };
|
---|
623 |
|
---|
624 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
---|
625 | static const yytype_int16 yyrhs[] =
|
---|
626 | {
|
---|
627 | 99, 0, -1, 86, 151, 21, 100, 101, 84, 8,
|
---|
628 | 102, 24, -1, 27, 70, -1, 38, 70, -1, 7,
|
---|
629 | 70, -1, -1, 29, 39, -1, -1, 103, 107, -1,
|
---|
630 | -1, 40, 104, 90, -1, -1, 105, -1, -1, 106,
|
---|
631 | -1, 105, 106, -1, 109, 32, 86, 151, -1, 108,
|
---|
632 | -1, 108, 107, -1, 110, -1, 143, -1, 86, 91,
|
---|
633 | 109, -1, 86, -1, 86, 84, 111, -1, 112, -1,
|
---|
634 | 130, -1, 133, -1, 120, -1, 113, -1, 144, -1,
|
---|
635 | 129, -1, 118, -1, 115, -1, 123, -1, 121, -1,
|
---|
636 | 122, -1, 125, -1, 126, -1, 127, -1, 128, -1,
|
---|
637 | 139, -1, 11, -1, 92, 155, 83, 155, 93, -1,
|
---|
638 | 92, 155, 83, 46, 93, -1, 92, 47, 83, 155,
|
---|
639 | 93, -1, 92, 155, 93, -1, 43, -1, 43, 114,
|
---|
640 | -1, 43, 94, 116, 95, -1, 117, -1, 116, 91,
|
---|
641 | 117, -1, 116, 91, 85, -1, 86, 92, 163, 93,
|
---|
642 | -1, 25, 94, 119, 95, -1, 116, -1, 9, 67,
|
---|
643 | -1, 9, 67, 94, 149, 95, -1, 51, 37, -1,
|
---|
644 | 52, 67, 124, -1, 49, -1, -1, 66, 114, -1,
|
---|
645 | 64, 94, 146, 95, -1, 64, 94, 95, -1, 64,
|
---|
646 | 124, 53, 111, -1, 65, 94, 146, 95, -1, 65,
|
---|
647 | 94, 95, -1, 65, 53, 111, -1, 14, 94, 146,
|
---|
648 | 95, -1, 131, -1, 132, -1, 86, -1, 34, -1,
|
---|
649 | 77, -1, 111, 134, -1, 92, 135, 93, -1, 136,
|
---|
650 | -1, 137, -1, 138, -1, 19, 111, -1, 23, 12,
|
---|
651 | 155, -1, 19, 111, 23, 12, 155, -1, 18, 12,
|
---|
652 | 94, 95, -1, 140, 142, 111, -1, 96, 141, 89,
|
---|
653 | 97, -1, -1, 76, -1, 6, -1, 60, -1, -1,
|
---|
654 | 27, -1, 38, -1, 86, 111, 84, 155, -1, 145,
|
---|
655 | -1, 33, -1, 78, -1, 61, -1, 81, -1, 36,
|
---|
656 | -1, 10, -1, 79, -1, 148, -1, 146, 91, 148,
|
---|
657 | -1, 146, 91, 85, -1, 86, 111, -1, 147, -1,
|
---|
658 | 147, 54, -1, 147, 20, 155, -1, 150, -1, 149,
|
---|
659 | 91, 150, -1, 86, 92, 89, 93, -1, 152, -1,
|
---|
660 | -1, 94, 153, 95, -1, -1, 154, 153, -1, 86,
|
---|
661 | 92, 89, 93, -1, 86, -1, 89, -1, 156, -1,
|
---|
662 | 157, -1, 161, -1, 160, -1, 162, -1, 165, -1,
|
---|
663 | 164, -1, 158, -1, 159, -1, 86, -1, 88, -1,
|
---|
664 | 71, -1, 31, -1, 163, -1, 89, -1, 49, -1,
|
---|
665 | 152, -1
|
---|
666 | };
|
---|
667 |
|
---|
668 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
---|
669 | static const yytype_uint16 yyrline[] =
|
---|
670 | {
|
---|
671 | 0, 233, 233, 240, 241, 243, 245, 248, 250, 253,
|
---|
672 | 254, 257, 258, 261, 262, 265, 266, 269, 280, 281,
|
---|
673 | 284, 285, 288, 294, 302, 312, 313, 314, 317, 318,
|
---|
674 | 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
|
---|
675 | 329, 330, 333, 340, 350, 358, 366, 377, 382, 388,
|
---|
676 | 396, 402, 407, 411, 424, 432, 435, 442, 450, 456,
|
---|
677 | 465, 473, 474, 479, 485, 493, 502, 508, 516, 524,
|
---|
678 | 531, 532, 535, 546, 551, 558, 574, 580, 583, 584,
|
---|
679 | 587, 593, 601, 611, 617, 630, 639, 642, 646, 650,
|
---|
680 | 657, 660, 664, 671, 682, 685, 690, 695, 700, 705,
|
---|
681 | 710, 715, 723, 729, 734, 745, 756, 762, 768, 776,
|
---|
682 | 782, 789, 802, 803, 806, 813, 816, 827, 831, 842,
|
---|
683 | 848, 849, 852, 853, 854, 855, 856, 859, 862, 865,
|
---|
684 | 876, 884, 890, 898, 906, 909, 914
|
---|
685 | };
|
---|
686 | #endif
|
---|
687 |
|
---|
688 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
---|
689 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
---|
690 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
---|
691 | static const char *const yytname[] =
|
---|
692 | {
|
---|
693 | "$end", "error", "$undefined", "kw_ABSENT", "kw_ABSTRACT_SYNTAX",
|
---|
694 | "kw_ALL", "kw_APPLICATION", "kw_AUTOMATIC", "kw_BEGIN", "kw_BIT",
|
---|
695 | "kw_BMPString", "kw_BOOLEAN", "kw_BY", "kw_CHARACTER", "kw_CHOICE",
|
---|
696 | "kw_CLASS", "kw_COMPONENT", "kw_COMPONENTS", "kw_CONSTRAINED",
|
---|
697 | "kw_CONTAINING", "kw_DEFAULT", "kw_DEFINITIONS", "kw_EMBEDDED",
|
---|
698 | "kw_ENCODED", "kw_END", "kw_ENUMERATED", "kw_EXCEPT", "kw_EXPLICIT",
|
---|
699 | "kw_EXPORTS", "kw_EXTENSIBILITY", "kw_EXTERNAL", "kw_FALSE", "kw_FROM",
|
---|
700 | "kw_GeneralString", "kw_GeneralizedTime", "kw_GraphicString",
|
---|
701 | "kw_IA5String", "kw_IDENTIFIER", "kw_IMPLICIT", "kw_IMPLIED",
|
---|
702 | "kw_IMPORTS", "kw_INCLUDES", "kw_INSTANCE", "kw_INTEGER",
|
---|
703 | "kw_INTERSECTION", "kw_ISO646String", "kw_MAX", "kw_MIN",
|
---|
704 | "kw_MINUS_INFINITY", "kw_NULL", "kw_NumericString", "kw_OBJECT",
|
---|
705 | "kw_OCTET", "kw_OF", "kw_OPTIONAL", "kw_ObjectDescriptor", "kw_PATTERN",
|
---|
706 | "kw_PDV", "kw_PLUS_INFINITY", "kw_PRESENT", "kw_PRIVATE",
|
---|
707 | "kw_PrintableString", "kw_REAL", "kw_RELATIVE_OID", "kw_SEQUENCE",
|
---|
708 | "kw_SET", "kw_SIZE", "kw_STRING", "kw_SYNTAX", "kw_T61String", "kw_TAGS",
|
---|
709 | "kw_TRUE", "kw_TYPE_IDENTIFIER", "kw_TeletexString", "kw_UNION",
|
---|
710 | "kw_UNIQUE", "kw_UNIVERSAL", "kw_UTCTime", "kw_UTF8String",
|
---|
711 | "kw_UniversalString", "kw_VideotexString", "kw_VisibleString", "kw_WITH",
|
---|
712 | "RANGE", "EEQUAL", "ELLIPSIS", "IDENTIFIER", "referencename", "STRING",
|
---|
713 | "NUMBER", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'",
|
---|
714 | "$accept", "ModuleDefinition", "TagDefault", "ExtensionDefault",
|
---|
715 | "ModuleBody", "Imports", "SymbolsImported", "SymbolsFromModuleList",
|
---|
716 | "SymbolsFromModule", "AssignmentList", "Assignment", "referencenames",
|
---|
717 | "TypeAssignment", "Type", "BuiltinType", "BooleanType", "range",
|
---|
718 | "IntegerType", "NamedNumberList", "NamedNumber", "EnumeratedType",
|
---|
719 | "Enumerations", "BitStringType", "ObjectIdentifierType",
|
---|
720 | "OctetStringType", "NullType", "size", "SequenceType", "SequenceOfType",
|
---|
721 | "SetType", "SetOfType", "ChoiceType", "ReferencedType", "DefinedType",
|
---|
722 | "UsefulType", "ConstrainedType", "Constraint", "ConstraintSpec",
|
---|
723 | "GeneralConstraint", "ContentsConstraint", "UserDefinedConstraint",
|
---|
724 | "TaggedType", "Tag", "Class", "tagenv", "ValueAssignment",
|
---|
725 | "CharacterStringType", "RestrictedCharactedStringType",
|
---|
726 | "ComponentTypeList", "NamedType", "ComponentType", "NamedBitList",
|
---|
727 | "NamedBit", "objid_opt", "objid", "objid_list", "objid_element", "Value",
|
---|
728 | "BuiltinValue", "ReferencedValue", "DefinedValue", "Valuereference",
|
---|
729 | "CharacterStringValue", "BooleanValue", "IntegerValue", "SignedNumber",
|
---|
730 | "NullValue", "ObjectIdentifierValue", 0
|
---|
731 | };
|
---|
732 | #endif
|
---|
733 |
|
---|
734 | # ifdef YYPRINT
|
---|
735 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
|
---|
736 | token YYLEX-NUM. */
|
---|
737 | static const yytype_uint16 yytoknum[] =
|
---|
738 | {
|
---|
739 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
---|
740 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
---|
741 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
---|
742 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
|
---|
743 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
|
---|
744 | 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
|
---|
745 | 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
|
---|
746 | 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
|
---|
747 | 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
|
---|
748 | 59, 44, 40, 41, 123, 125, 91, 93
|
---|
749 | };
|
---|
750 | # endif
|
---|
751 |
|
---|
752 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
---|
753 | static const yytype_uint8 yyr1[] =
|
---|
754 | {
|
---|
755 | 0, 98, 99, 100, 100, 100, 100, 101, 101, 102,
|
---|
756 | 102, 103, 103, 104, 104, 105, 105, 106, 107, 107,
|
---|
757 | 108, 108, 109, 109, 110, 111, 111, 111, 112, 112,
|
---|
758 | 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
|
---|
759 | 112, 112, 113, 114, 114, 114, 114, 115, 115, 115,
|
---|
760 | 116, 116, 116, 117, 118, 119, 120, 120, 121, 122,
|
---|
761 | 123, 124, 124, 125, 125, 126, 127, 127, 128, 129,
|
---|
762 | 130, 130, 131, 132, 132, 133, 134, 135, 136, 136,
|
---|
763 | 137, 137, 137, 138, 139, 140, 141, 141, 141, 141,
|
---|
764 | 142, 142, 142, 143, 144, 145, 145, 145, 145, 145,
|
---|
765 | 145, 145, 146, 146, 146, 147, 148, 148, 148, 149,
|
---|
766 | 149, 150, 151, 151, 152, 153, 153, 154, 154, 154,
|
---|
767 | 155, 155, 156, 156, 156, 156, 156, 157, 158, 159,
|
---|
768 | 160, 161, 161, 162, 163, 164, 165
|
---|
769 | };
|
---|
770 |
|
---|
771 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
---|
772 | static const yytype_uint8 yyr2[] =
|
---|
773 | {
|
---|
774 | 0, 2, 9, 2, 2, 2, 0, 2, 0, 2,
|
---|
775 | 0, 3, 0, 1, 0, 1, 2, 4, 1, 2,
|
---|
776 | 1, 1, 3, 1, 3, 1, 1, 1, 1, 1,
|
---|
777 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
778 | 1, 1, 1, 5, 5, 5, 3, 1, 2, 4,
|
---|
779 | 1, 3, 3, 4, 4, 1, 2, 5, 2, 3,
|
---|
780 | 1, 0, 2, 4, 3, 4, 4, 3, 3, 4,
|
---|
781 | 1, 1, 1, 1, 1, 2, 3, 1, 1, 1,
|
---|
782 | 2, 3, 5, 4, 3, 4, 0, 1, 1, 1,
|
---|
783 | 0, 1, 1, 4, 1, 1, 1, 1, 1, 1,
|
---|
784 | 1, 1, 1, 3, 3, 2, 1, 2, 3, 1,
|
---|
785 | 3, 4, 1, 0, 3, 0, 2, 4, 1, 1,
|
---|
786 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
787 | 1, 1, 1, 1, 1, 1, 1
|
---|
788 | };
|
---|
789 |
|
---|
790 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
---|
791 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero
|
---|
792 | means the default is an error. */
|
---|
793 | static const yytype_uint8 yydefact[] =
|
---|
794 | {
|
---|
795 | 0, 113, 0, 115, 0, 112, 1, 118, 119, 0,
|
---|
796 | 115, 6, 0, 114, 116, 0, 0, 0, 8, 0,
|
---|
797 | 5, 3, 4, 0, 0, 117, 7, 0, 10, 14,
|
---|
798 | 0, 0, 23, 0, 13, 15, 0, 2, 0, 9,
|
---|
799 | 18, 20, 21, 0, 11, 16, 0, 0, 100, 42,
|
---|
800 | 0, 0, 95, 73, 99, 47, 60, 0, 0, 97,
|
---|
801 | 61, 0, 74, 96, 101, 98, 0, 72, 86, 0,
|
---|
802 | 25, 29, 33, 32, 28, 35, 36, 34, 37, 38,
|
---|
803 | 39, 40, 31, 26, 70, 71, 27, 41, 90, 30,
|
---|
804 | 94, 19, 22, 113, 56, 0, 0, 0, 0, 48,
|
---|
805 | 58, 61, 0, 0, 0, 0, 0, 24, 88, 89,
|
---|
806 | 87, 0, 0, 0, 75, 91, 92, 0, 17, 0,
|
---|
807 | 0, 0, 106, 102, 0, 55, 50, 0, 132, 0,
|
---|
808 | 135, 131, 129, 130, 134, 136, 0, 120, 121, 127,
|
---|
809 | 128, 123, 122, 124, 133, 126, 125, 0, 59, 62,
|
---|
810 | 64, 0, 0, 68, 67, 0, 0, 93, 0, 0,
|
---|
811 | 0, 0, 77, 78, 79, 84, 0, 0, 109, 105,
|
---|
812 | 0, 69, 0, 107, 0, 0, 54, 0, 0, 46,
|
---|
813 | 49, 63, 65, 66, 85, 0, 80, 0, 76, 0,
|
---|
814 | 0, 57, 104, 103, 108, 0, 52, 51, 0, 0,
|
---|
815 | 0, 0, 0, 81, 0, 110, 53, 45, 44, 43,
|
---|
816 | 83, 0, 111, 82
|
---|
817 | };
|
---|
818 |
|
---|
819 | /* YYDEFGOTO[NTERM-NUM]. */
|
---|
820 | static const yytype_int16 yydefgoto[] =
|
---|
821 | {
|
---|
822 | -1, 2, 18, 24, 30, 31, 33, 34, 35, 39,
|
---|
823 | 40, 36, 41, 69, 70, 71, 99, 72, 125, 126,
|
---|
824 | 73, 127, 74, 75, 76, 77, 104, 78, 79, 80,
|
---|
825 | 81, 82, 83, 84, 85, 86, 114, 161, 162, 163,
|
---|
826 | 164, 87, 88, 111, 117, 42, 89, 90, 121, 122,
|
---|
827 | 123, 167, 168, 4, 135, 9, 10, 136, 137, 138,
|
---|
828 | 139, 140, 141, 142, 143, 144, 145, 146
|
---|
829 | };
|
---|
830 |
|
---|
831 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
---|
832 | STATE-NUM. */
|
---|
833 | #define YYPACT_NINF -113
|
---|
834 | static const yytype_int16 yypact[] =
|
---|
835 | {
|
---|
836 | -74, -67, 38, -69, 23, -113, -113, -44, -113, -41,
|
---|
837 | -69, 4, -26, -113, -113, -3, 1, 10, 52, -10,
|
---|
838 | -113, -113, -113, 45, 13, -113, -113, 77, -35, 15,
|
---|
839 | 64, 19, 17, 20, 15, -113, 85, -113, 25, -113,
|
---|
840 | 19, -113, -113, 15, -113, -113, 27, 47, -113, -113,
|
---|
841 | 26, 29, -113, -113, -113, -30, -113, 89, 61, -113,
|
---|
842 | -57, -47, -113, -113, -113, -113, 82, -113, -4, -68,
|
---|
843 | -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
|
---|
844 | -113, -113, -113, -113, -113, -113, -113, -113, -17, -113,
|
---|
845 | -113, -113, -113, -67, 35, 33, 46, 51, 46, -113,
|
---|
846 | -113, 69, 44, -73, 88, 82, -72, 56, -113, -113,
|
---|
847 | -113, 49, 93, 7, -113, -113, -113, 82, -113, 58,
|
---|
848 | 82, -76, -13, -113, 57, 59, -113, 60, -113, 68,
|
---|
849 | -113, -113, -113, -113, -113, -113, -75, -113, -113, -113,
|
---|
850 | -113, -113, -113, -113, -113, -113, -113, -63, -113, -113,
|
---|
851 | -113, -62, 82, 56, -113, -46, 65, -113, 141, 82,
|
---|
852 | 142, 63, -113, -113, -113, 56, 66, -38, -113, 56,
|
---|
853 | -16, -113, 93, -113, 76, -7, -113, 93, 81, -113,
|
---|
854 | -113, -113, 56, -113, -113, 72, -19, 93, -113, 83,
|
---|
855 | 58, -113, -113, -113, -113, 78, -113, -113, 80, 84,
|
---|
856 | 87, 62, 162, -113, 90, -113, -113, -113, -113, -113,
|
---|
857 | -113, 93, -113, -113
|
---|
858 | };
|
---|
859 |
|
---|
860 | /* YYPGOTO[NTERM-NUM]. */
|
---|
861 | static const yytype_int16 yypgoto[] =
|
---|
862 | {
|
---|
863 | -113, -113, -113, -113, -113, -113, -113, -113, 150, 136,
|
---|
864 | -113, 143, -113, -65, -113, -113, 86, -113, 91, 16,
|
---|
865 | -113, -113, -113, -113, -113, -113, 92, -113, -113, -113,
|
---|
866 | -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
|
---|
867 | -113, -113, -113, -113, -113, -113, -113, -113, -60, -113,
|
---|
868 | 22, -113, -5, 97, 2, 184, -113, -112, -113, -113,
|
---|
869 | -113, -113, -113, -113, -113, 21, -113, -113
|
---|
870 | };
|
---|
871 |
|
---|
872 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
---|
873 | positive, shift that token. If negative, reduce the rule which
|
---|
874 | number is the opposite. If zero, do what YYDEFACT says.
|
---|
875 | If YYTABLE_NINF, syntax error. */
|
---|
876 | #define YYTABLE_NINF -13
|
---|
877 | static const yytype_int16 yytable[] =
|
---|
878 | {
|
---|
879 | 157, 107, 108, 5, 202, 29, 105, 172, 178, 102,
|
---|
880 | 115, 15, 1, 120, 120, 170, 112, 7, 179, 171,
|
---|
881 | 8, 116, 150, 154, 113, 158, 159, 3, 175, 170,
|
---|
882 | 160, 16, 180, 181, 47, 48, 49, 103, 6, 50,
|
---|
883 | 153, 173, 17, 151, 11, 170, 155, 106, 12, 183,
|
---|
884 | 51, -12, 165, 190, 13, 169, 109, 191, 52, 53,
|
---|
885 | 194, 54, 97, 19, 98, 198, 200, 20, 55, 192,
|
---|
886 | 120, 21, 110, 113, 56, 203, 57, 58, 196, 124,
|
---|
887 | 22, 23, 128, 25, 26, 28, 59, 182, 37, 60,
|
---|
888 | 61, 47, 48, 49, 186, 5, 50, 27, 129, 213,
|
---|
889 | 130, 32, 62, 63, 64, 38, 65, 51, 43, 66,
|
---|
890 | 44, 67, 128, 93, 94, 52, 53, 46, 54, 120,
|
---|
891 | 95, 68, 131, 96, 128, 55, 100, 199, 101, 119,
|
---|
892 | 130, 56, 124, 57, 58, 102, 97, 132, 156, 133,
|
---|
893 | 134, 152, 130, 59, 166, 3, 60, 61, 113, 174,
|
---|
894 | 175, 177, 131, 185, 187, 176, 188, 210, 189, 62,
|
---|
895 | 63, 64, 184, 65, 131, 134, 201, 132, 67, 133,
|
---|
896 | 134, 206, 204, 207, 211, 3, 91, 208, 68, 132,
|
---|
897 | 209, 133, 134, 212, 45, 205, 92, 3, 149, 147,
|
---|
898 | 118, 197, 193, 148, 14, 195
|
---|
899 | };
|
---|
900 |
|
---|
901 | static const yytype_uint8 yycheck[] =
|
---|
902 | {
|
---|
903 | 112, 66, 6, 1, 23, 40, 53, 20, 83, 66,
|
---|
904 | 27, 7, 86, 86, 86, 91, 84, 86, 93, 95,
|
---|
905 | 89, 38, 95, 95, 92, 18, 19, 94, 91, 91,
|
---|
906 | 23, 27, 95, 95, 9, 10, 11, 94, 0, 14,
|
---|
907 | 105, 54, 38, 103, 21, 91, 106, 94, 92, 95,
|
---|
908 | 25, 86, 117, 91, 95, 120, 60, 95, 33, 34,
|
---|
909 | 172, 36, 92, 89, 94, 177, 178, 70, 43, 85,
|
---|
910 | 86, 70, 76, 92, 49, 187, 51, 52, 85, 86,
|
---|
911 | 70, 29, 31, 93, 39, 8, 61, 152, 24, 64,
|
---|
912 | 65, 9, 10, 11, 159, 93, 14, 84, 47, 211,
|
---|
913 | 49, 86, 77, 78, 79, 86, 81, 25, 91, 84,
|
---|
914 | 90, 86, 31, 86, 67, 33, 34, 32, 36, 86,
|
---|
915 | 94, 96, 71, 94, 31, 43, 37, 46, 67, 94,
|
---|
916 | 49, 49, 86, 51, 52, 66, 92, 86, 89, 88,
|
---|
917 | 89, 53, 49, 61, 86, 94, 64, 65, 92, 92,
|
---|
918 | 91, 83, 71, 12, 12, 95, 93, 95, 92, 77,
|
---|
919 | 78, 79, 97, 81, 71, 89, 94, 86, 86, 88,
|
---|
920 | 89, 93, 89, 93, 12, 94, 40, 93, 96, 86,
|
---|
921 | 93, 88, 89, 93, 34, 190, 43, 94, 102, 98,
|
---|
922 | 93, 175, 170, 101, 10, 174
|
---|
923 | };
|
---|
924 |
|
---|
925 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
---|
926 | symbol of state STATE-NUM. */
|
---|
927 | static const yytype_uint8 yystos[] =
|
---|
928 | {
|
---|
929 | 0, 86, 99, 94, 151, 152, 0, 86, 89, 153,
|
---|
930 | 154, 21, 92, 95, 153, 7, 27, 38, 100, 89,
|
---|
931 | 70, 70, 70, 29, 101, 93, 39, 84, 8, 40,
|
---|
932 | 102, 103, 86, 104, 105, 106, 109, 24, 86, 107,
|
---|
933 | 108, 110, 143, 91, 90, 106, 32, 9, 10, 11,
|
---|
934 | 14, 25, 33, 34, 36, 43, 49, 51, 52, 61,
|
---|
935 | 64, 65, 77, 78, 79, 81, 84, 86, 96, 111,
|
---|
936 | 112, 113, 115, 118, 120, 121, 122, 123, 125, 126,
|
---|
937 | 127, 128, 129, 130, 131, 132, 133, 139, 140, 144,
|
---|
938 | 145, 107, 109, 86, 67, 94, 94, 92, 94, 114,
|
---|
939 | 37, 67, 66, 94, 124, 53, 94, 111, 6, 60,
|
---|
940 | 76, 141, 84, 92, 134, 27, 38, 142, 151, 94,
|
---|
941 | 86, 146, 147, 148, 86, 116, 117, 119, 31, 47,
|
---|
942 | 49, 71, 86, 88, 89, 152, 155, 156, 157, 158,
|
---|
943 | 159, 160, 161, 162, 163, 164, 165, 116, 124, 114,
|
---|
944 | 95, 146, 53, 111, 95, 146, 89, 155, 18, 19,
|
---|
945 | 23, 135, 136, 137, 138, 111, 86, 149, 150, 111,
|
---|
946 | 91, 95, 20, 54, 92, 91, 95, 83, 83, 93,
|
---|
947 | 95, 95, 111, 95, 97, 12, 111, 12, 93, 92,
|
---|
948 | 91, 95, 85, 148, 155, 163, 85, 117, 155, 46,
|
---|
949 | 155, 94, 23, 155, 89, 150, 93, 93, 93, 93,
|
---|
950 | 95, 12, 93, 155
|
---|
951 | };
|
---|
952 |
|
---|
953 | #define yyerrok (yyerrstatus = 0)
|
---|
954 | #define yyclearin (yychar = YYEMPTY)
|
---|
955 | #define YYEMPTY (-2)
|
---|
956 | #define YYEOF 0
|
---|
957 |
|
---|
958 | #define YYACCEPT goto yyacceptlab
|
---|
959 | #define YYABORT goto yyabortlab
|
---|
960 | #define YYERROR goto yyerrorlab
|
---|
961 |
|
---|
962 |
|
---|
963 | /* Like YYERROR except do call yyerror. This remains here temporarily
|
---|
964 | to ease the transition to the new meaning of YYERROR, for GCC.
|
---|
965 | Once GCC version 2 has supplanted version 1, this can go. */
|
---|
966 |
|
---|
967 | #define YYFAIL goto yyerrlab
|
---|
968 |
|
---|
969 | #define YYRECOVERING() (!!yyerrstatus)
|
---|
970 |
|
---|
971 | #define YYBACKUP(Token, Value) \
|
---|
972 | do \
|
---|
973 | if (yychar == YYEMPTY && yylen == 1) \
|
---|
974 | { \
|
---|
975 | yychar = (Token); \
|
---|
976 | yylval = (Value); \
|
---|
977 | yytoken = YYTRANSLATE (yychar); \
|
---|
978 | YYPOPSTACK (1); \
|
---|
979 | goto yybackup; \
|
---|
980 | } \
|
---|
981 | else \
|
---|
982 | { \
|
---|
983 | yyerror (YY_("syntax error: cannot back up")); \
|
---|
984 | YYERROR; \
|
---|
985 | } \
|
---|
986 | while (YYID (0))
|
---|
987 |
|
---|
988 |
|
---|
989 | #define YYTERROR 1
|
---|
990 | #define YYERRCODE 256
|
---|
991 |
|
---|
992 |
|
---|
993 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
---|
994 | If N is 0, then set CURRENT to the empty location which ends
|
---|
995 | the previous symbol: RHS[0] (always defined). */
|
---|
996 |
|
---|
997 | #define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
---|
998 | #ifndef YYLLOC_DEFAULT
|
---|
999 | # define YYLLOC_DEFAULT(Current, Rhs, N) \
|
---|
1000 | do \
|
---|
1001 | if (YYID (N)) \
|
---|
1002 | { \
|
---|
1003 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
---|
1004 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
---|
1005 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
---|
1006 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
---|
1007 | } \
|
---|
1008 | else \
|
---|
1009 | { \
|
---|
1010 | (Current).first_line = (Current).last_line = \
|
---|
1011 | YYRHSLOC (Rhs, 0).last_line; \
|
---|
1012 | (Current).first_column = (Current).last_column = \
|
---|
1013 | YYRHSLOC (Rhs, 0).last_column; \
|
---|
1014 | } \
|
---|
1015 | while (YYID (0))
|
---|
1016 | #endif
|
---|
1017 |
|
---|
1018 |
|
---|
1019 | /* YY_LOCATION_PRINT -- Print the location on the stream.
|
---|
1020 | This macro was not mandated originally: define only if we know
|
---|
1021 | we won't break user code: when these are the locations we know. */
|
---|
1022 |
|
---|
1023 | #ifndef YY_LOCATION_PRINT
|
---|
1024 | # if YYLTYPE_IS_TRIVIAL
|
---|
1025 | # define YY_LOCATION_PRINT(File, Loc) \
|
---|
1026 | fprintf (File, "%d.%d-%d.%d", \
|
---|
1027 | (Loc).first_line, (Loc).first_column, \
|
---|
1028 | (Loc).last_line, (Loc).last_column)
|
---|
1029 | # else
|
---|
1030 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
---|
1031 | # endif
|
---|
1032 | #endif
|
---|
1033 |
|
---|
1034 |
|
---|
1035 | /* YYLEX -- calling `yylex' with the right arguments. */
|
---|
1036 |
|
---|
1037 | #ifdef YYLEX_PARAM
|
---|
1038 | # define YYLEX yylex (YYLEX_PARAM)
|
---|
1039 | #else
|
---|
1040 | # define YYLEX yylex ()
|
---|
1041 | #endif
|
---|
1042 |
|
---|
1043 | /* Enable debugging if requested. */
|
---|
1044 | #if YYDEBUG
|
---|
1045 |
|
---|
1046 | # ifndef YYFPRINTF
|
---|
1047 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
|
---|
1048 | # define YYFPRINTF fprintf
|
---|
1049 | # endif
|
---|
1050 |
|
---|
1051 | # define YYDPRINTF(Args) \
|
---|
1052 | do { \
|
---|
1053 | if (yydebug) \
|
---|
1054 | YYFPRINTF Args; \
|
---|
1055 | } while (YYID (0))
|
---|
1056 |
|
---|
1057 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
---|
1058 | do { \
|
---|
1059 | if (yydebug) \
|
---|
1060 | { \
|
---|
1061 | YYFPRINTF (stderr, "%s ", Title); \
|
---|
1062 | yy_symbol_print (stderr, \
|
---|
1063 | Type, Value); \
|
---|
1064 | YYFPRINTF (stderr, "\n"); \
|
---|
1065 | } \
|
---|
1066 | } while (YYID (0))
|
---|
1067 |
|
---|
1068 |
|
---|
1069 | /*--------------------------------.
|
---|
1070 | | Print this symbol on YYOUTPUT. |
|
---|
1071 | `--------------------------------*/
|
---|
1072 |
|
---|
1073 | /*ARGSUSED*/
|
---|
1074 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1075 | || defined __cplusplus || defined _MSC_VER)
|
---|
1076 | static void
|
---|
1077 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
---|
1078 | #else
|
---|
1079 | static void
|
---|
1080 | yy_symbol_value_print (yyoutput, yytype, yyvaluep)
|
---|
1081 | FILE *yyoutput;
|
---|
1082 | int yytype;
|
---|
1083 | YYSTYPE const * const yyvaluep;
|
---|
1084 | #endif
|
---|
1085 | {
|
---|
1086 | if (!yyvaluep)
|
---|
1087 | return;
|
---|
1088 | # ifdef YYPRINT
|
---|
1089 | if (yytype < YYNTOKENS)
|
---|
1090 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
---|
1091 | # else
|
---|
1092 | YYUSE (yyoutput);
|
---|
1093 | # endif
|
---|
1094 | switch (yytype)
|
---|
1095 | {
|
---|
1096 | default:
|
---|
1097 | break;
|
---|
1098 | }
|
---|
1099 | }
|
---|
1100 |
|
---|
1101 |
|
---|
1102 | /*--------------------------------.
|
---|
1103 | | Print this symbol on YYOUTPUT. |
|
---|
1104 | `--------------------------------*/
|
---|
1105 |
|
---|
1106 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1107 | || defined __cplusplus || defined _MSC_VER)
|
---|
1108 | static void
|
---|
1109 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
---|
1110 | #else
|
---|
1111 | static void
|
---|
1112 | yy_symbol_print (yyoutput, yytype, yyvaluep)
|
---|
1113 | FILE *yyoutput;
|
---|
1114 | int yytype;
|
---|
1115 | YYSTYPE const * const yyvaluep;
|
---|
1116 | #endif
|
---|
1117 | {
|
---|
1118 | if (yytype < YYNTOKENS)
|
---|
1119 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
---|
1120 | else
|
---|
1121 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
---|
1122 |
|
---|
1123 | yy_symbol_value_print (yyoutput, yytype, yyvaluep);
|
---|
1124 | YYFPRINTF (yyoutput, ")");
|
---|
1125 | }
|
---|
1126 |
|
---|
1127 | /*------------------------------------------------------------------.
|
---|
1128 | | yy_stack_print -- Print the state stack from its BOTTOM up to its |
|
---|
1129 | | TOP (included). |
|
---|
1130 | `------------------------------------------------------------------*/
|
---|
1131 |
|
---|
1132 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1133 | || defined __cplusplus || defined _MSC_VER)
|
---|
1134 | static void
|
---|
1135 | yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
|
---|
1136 | #else
|
---|
1137 | static void
|
---|
1138 | yy_stack_print (bottom, top)
|
---|
1139 | yytype_int16 *bottom;
|
---|
1140 | yytype_int16 *top;
|
---|
1141 | #endif
|
---|
1142 | {
|
---|
1143 | YYFPRINTF (stderr, "Stack now");
|
---|
1144 | for (; bottom <= top; ++bottom)
|
---|
1145 | YYFPRINTF (stderr, " %d", *bottom);
|
---|
1146 | YYFPRINTF (stderr, "\n");
|
---|
1147 | }
|
---|
1148 |
|
---|
1149 | # define YY_STACK_PRINT(Bottom, Top) \
|
---|
1150 | do { \
|
---|
1151 | if (yydebug) \
|
---|
1152 | yy_stack_print ((Bottom), (Top)); \
|
---|
1153 | } while (YYID (0))
|
---|
1154 |
|
---|
1155 |
|
---|
1156 | /*------------------------------------------------.
|
---|
1157 | | Report that the YYRULE is going to be reduced. |
|
---|
1158 | `------------------------------------------------*/
|
---|
1159 |
|
---|
1160 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1161 | || defined __cplusplus || defined _MSC_VER)
|
---|
1162 | static void
|
---|
1163 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
|
---|
1164 | #else
|
---|
1165 | static void
|
---|
1166 | yy_reduce_print (yyvsp, yyrule)
|
---|
1167 | YYSTYPE *yyvsp;
|
---|
1168 | int yyrule;
|
---|
1169 | #endif
|
---|
1170 | {
|
---|
1171 | int yynrhs = yyr2[yyrule];
|
---|
1172 | int yyi;
|
---|
1173 | unsigned long int yylno = yyrline[yyrule];
|
---|
1174 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
---|
1175 | yyrule - 1, yylno);
|
---|
1176 | /* The symbols being reduced. */
|
---|
1177 | for (yyi = 0; yyi < yynrhs; yyi++)
|
---|
1178 | {
|
---|
1179 | fprintf (stderr, " $%d = ", yyi + 1);
|
---|
1180 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
---|
1181 | &(yyvsp[(yyi + 1) - (yynrhs)])
|
---|
1182 | );
|
---|
1183 | fprintf (stderr, "\n");
|
---|
1184 | }
|
---|
1185 | }
|
---|
1186 |
|
---|
1187 | # define YY_REDUCE_PRINT(Rule) \
|
---|
1188 | do { \
|
---|
1189 | if (yydebug) \
|
---|
1190 | yy_reduce_print (yyvsp, Rule); \
|
---|
1191 | } while (YYID (0))
|
---|
1192 |
|
---|
1193 | /* Nonzero means print parse trace. It is left uninitialized so that
|
---|
1194 | multiple parsers can coexist. */
|
---|
1195 | int yydebug;
|
---|
1196 | #else /* !YYDEBUG */
|
---|
1197 | # define YYDPRINTF(Args)
|
---|
1198 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
---|
1199 | # define YY_STACK_PRINT(Bottom, Top)
|
---|
1200 | # define YY_REDUCE_PRINT(Rule)
|
---|
1201 | #endif /* !YYDEBUG */
|
---|
1202 |
|
---|
1203 |
|
---|
1204 | /* YYINITDEPTH -- initial size of the parser's stacks. */
|
---|
1205 | #ifndef YYINITDEPTH
|
---|
1206 | # define YYINITDEPTH 200
|
---|
1207 | #endif
|
---|
1208 |
|
---|
1209 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
|
---|
1210 | if the built-in stack extension method is used).
|
---|
1211 |
|
---|
1212 | Do not make this value too large; the results are undefined if
|
---|
1213 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
|
---|
1214 | evaluated with infinite-precision integer arithmetic. */
|
---|
1215 |
|
---|
1216 | #ifndef YYMAXDEPTH
|
---|
1217 | # define YYMAXDEPTH 10000
|
---|
1218 | #endif
|
---|
1219 |
|
---|
1220 | |
---|
1221 |
|
---|
1222 |
|
---|
1223 | #if YYERROR_VERBOSE
|
---|
1224 |
|
---|
1225 | # ifndef yystrlen
|
---|
1226 | # if defined __GLIBC__ && defined _STRING_H
|
---|
1227 | # define yystrlen strlen
|
---|
1228 | # else
|
---|
1229 | /* Return the length of YYSTR. */
|
---|
1230 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1231 | || defined __cplusplus || defined _MSC_VER)
|
---|
1232 | static YYSIZE_T
|
---|
1233 | yystrlen (const char *yystr)
|
---|
1234 | #else
|
---|
1235 | static YYSIZE_T
|
---|
1236 | yystrlen (yystr)
|
---|
1237 | const char *yystr;
|
---|
1238 | #endif
|
---|
1239 | {
|
---|
1240 | YYSIZE_T yylen;
|
---|
1241 | for (yylen = 0; yystr[yylen]; yylen++)
|
---|
1242 | continue;
|
---|
1243 | return yylen;
|
---|
1244 | }
|
---|
1245 | # endif
|
---|
1246 | # endif
|
---|
1247 |
|
---|
1248 | # ifndef yystpcpy
|
---|
1249 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
|
---|
1250 | # define yystpcpy stpcpy
|
---|
1251 | # else
|
---|
1252 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
|
---|
1253 | YYDEST. */
|
---|
1254 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1255 | || defined __cplusplus || defined _MSC_VER)
|
---|
1256 | static char *
|
---|
1257 | yystpcpy (char *yydest, const char *yysrc)
|
---|
1258 | #else
|
---|
1259 | static char *
|
---|
1260 | yystpcpy (yydest, yysrc)
|
---|
1261 | char *yydest;
|
---|
1262 | const char *yysrc;
|
---|
1263 | #endif
|
---|
1264 | {
|
---|
1265 | char *yyd = yydest;
|
---|
1266 | const char *yys = yysrc;
|
---|
1267 |
|
---|
1268 | while ((*yyd++ = *yys++) != '\0')
|
---|
1269 | continue;
|
---|
1270 |
|
---|
1271 | return yyd - 1;
|
---|
1272 | }
|
---|
1273 | # endif
|
---|
1274 | # endif
|
---|
1275 |
|
---|
1276 | # ifndef yytnamerr
|
---|
1277 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
|
---|
1278 | quotes and backslashes, so that it's suitable for yyerror. The
|
---|
1279 | heuristic is that double-quoting is unnecessary unless the string
|
---|
1280 | contains an apostrophe, a comma, or backslash (other than
|
---|
1281 | backslash-backslash). YYSTR is taken from yytname. If YYRES is
|
---|
1282 | null, do not copy; instead, return the length of what the result
|
---|
1283 | would have been. */
|
---|
1284 | static YYSIZE_T
|
---|
1285 | yytnamerr (char *yyres, const char *yystr)
|
---|
1286 | {
|
---|
1287 | if (*yystr == '"')
|
---|
1288 | {
|
---|
1289 | YYSIZE_T yyn = 0;
|
---|
1290 | char const *yyp = yystr;
|
---|
1291 |
|
---|
1292 | for (;;)
|
---|
1293 | switch (*++yyp)
|
---|
1294 | {
|
---|
1295 | case '\'':
|
---|
1296 | case ',':
|
---|
1297 | goto do_not_strip_quotes;
|
---|
1298 |
|
---|
1299 | case '\\':
|
---|
1300 | if (*++yyp != '\\')
|
---|
1301 | goto do_not_strip_quotes;
|
---|
1302 | /* Fall through. */
|
---|
1303 | default:
|
---|
1304 | if (yyres)
|
---|
1305 | yyres[yyn] = *yyp;
|
---|
1306 | yyn++;
|
---|
1307 | break;
|
---|
1308 |
|
---|
1309 | case '"':
|
---|
1310 | if (yyres)
|
---|
1311 | yyres[yyn] = '\0';
|
---|
1312 | return yyn;
|
---|
1313 | }
|
---|
1314 | do_not_strip_quotes: ;
|
---|
1315 | }
|
---|
1316 |
|
---|
1317 | if (! yyres)
|
---|
1318 | return yystrlen (yystr);
|
---|
1319 |
|
---|
1320 | return yystpcpy (yyres, yystr) - yyres;
|
---|
1321 | }
|
---|
1322 | # endif
|
---|
1323 |
|
---|
1324 | /* Copy into YYRESULT an error message about the unexpected token
|
---|
1325 | YYCHAR while in state YYSTATE. Return the number of bytes copied,
|
---|
1326 | including the terminating null byte. If YYRESULT is null, do not
|
---|
1327 | copy anything; just return the number of bytes that would be
|
---|
1328 | copied. As a special case, return 0 if an ordinary "syntax error"
|
---|
1329 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during
|
---|
1330 | size calculation. */
|
---|
1331 | static YYSIZE_T
|
---|
1332 | yysyntax_error (char *yyresult, int yystate, int yychar)
|
---|
1333 | {
|
---|
1334 | int yyn = yypact[yystate];
|
---|
1335 |
|
---|
1336 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
|
---|
1337 | return 0;
|
---|
1338 | else
|
---|
1339 | {
|
---|
1340 | int yytype = YYTRANSLATE (yychar);
|
---|
1341 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
|
---|
1342 | YYSIZE_T yysize = yysize0;
|
---|
1343 | YYSIZE_T yysize1;
|
---|
1344 | int yysize_overflow = 0;
|
---|
1345 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
---|
1346 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
---|
1347 | int yyx;
|
---|
1348 |
|
---|
1349 | # if 0
|
---|
1350 | /* This is so xgettext sees the translatable formats that are
|
---|
1351 | constructed on the fly. */
|
---|
1352 | YY_("syntax error, unexpected %s");
|
---|
1353 | YY_("syntax error, unexpected %s, expecting %s");
|
---|
1354 | YY_("syntax error, unexpected %s, expecting %s or %s");
|
---|
1355 | YY_("syntax error, unexpected %s, expecting %s or %s or %s");
|
---|
1356 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
|
---|
1357 | # endif
|
---|
1358 | char *yyfmt;
|
---|
1359 | char const *yyf;
|
---|
1360 | static char const yyunexpected[] = "syntax error, unexpected %s";
|
---|
1361 | static char const yyexpecting[] = ", expecting %s";
|
---|
1362 | static char const yyor[] = " or %s";
|
---|
1363 | char yyformat[sizeof yyunexpected
|
---|
1364 | + sizeof yyexpecting - 1
|
---|
1365 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
---|
1366 | * (sizeof yyor - 1))];
|
---|
1367 | char const *yyprefix = yyexpecting;
|
---|
1368 |
|
---|
1369 | /* Start YYX at -YYN if negative to avoid negative indexes in
|
---|
1370 | YYCHECK. */
|
---|
1371 | int yyxbegin = yyn < 0 ? -yyn : 0;
|
---|
1372 |
|
---|
1373 | /* Stay within bounds of both yycheck and yytname. */
|
---|
1374 | int yychecklim = YYLAST - yyn + 1;
|
---|
1375 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
---|
1376 | int yycount = 1;
|
---|
1377 |
|
---|
1378 | yyarg[0] = yytname[yytype];
|
---|
1379 | yyfmt = yystpcpy (yyformat, yyunexpected);
|
---|
1380 |
|
---|
1381 | for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
---|
1382 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
---|
1383 | {
|
---|
1384 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
---|
1385 | {
|
---|
1386 | yycount = 1;
|
---|
1387 | yysize = yysize0;
|
---|
1388 | yyformat[sizeof yyunexpected - 1] = '\0';
|
---|
1389 | break;
|
---|
1390 | }
|
---|
1391 | yyarg[yycount++] = yytname[yyx];
|
---|
1392 | yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
---|
1393 | yysize_overflow |= (yysize1 < yysize);
|
---|
1394 | yysize = yysize1;
|
---|
1395 | yyfmt = yystpcpy (yyfmt, yyprefix);
|
---|
1396 | yyprefix = yyor;
|
---|
1397 | }
|
---|
1398 |
|
---|
1399 | yyf = YY_(yyformat);
|
---|
1400 | yysize1 = yysize + yystrlen (yyf);
|
---|
1401 | yysize_overflow |= (yysize1 < yysize);
|
---|
1402 | yysize = yysize1;
|
---|
1403 |
|
---|
1404 | if (yysize_overflow)
|
---|
1405 | return YYSIZE_MAXIMUM;
|
---|
1406 |
|
---|
1407 | if (yyresult)
|
---|
1408 | {
|
---|
1409 | /* Avoid sprintf, as that infringes on the user's name space.
|
---|
1410 | Don't have undefined behavior even if the translation
|
---|
1411 | produced a string with the wrong number of "%s"s. */
|
---|
1412 | char *yyp = yyresult;
|
---|
1413 | int yyi = 0;
|
---|
1414 | while ((*yyp = *yyf) != '\0')
|
---|
1415 | {
|
---|
1416 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
---|
1417 | {
|
---|
1418 | yyp += yytnamerr (yyp, yyarg[yyi++]);
|
---|
1419 | yyf += 2;
|
---|
1420 | }
|
---|
1421 | else
|
---|
1422 | {
|
---|
1423 | yyp++;
|
---|
1424 | yyf++;
|
---|
1425 | }
|
---|
1426 | }
|
---|
1427 | }
|
---|
1428 | return yysize;
|
---|
1429 | }
|
---|
1430 | }
|
---|
1431 | #endif /* YYERROR_VERBOSE */
|
---|
1432 | |
---|
1433 |
|
---|
1434 |
|
---|
1435 | /*-----------------------------------------------.
|
---|
1436 | | Release the memory associated to this symbol. |
|
---|
1437 | `-----------------------------------------------*/
|
---|
1438 |
|
---|
1439 | /*ARGSUSED*/
|
---|
1440 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1441 | || defined __cplusplus || defined _MSC_VER)
|
---|
1442 | static void
|
---|
1443 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
|
---|
1444 | #else
|
---|
1445 | static void
|
---|
1446 | yydestruct (yymsg, yytype, yyvaluep)
|
---|
1447 | const char *yymsg;
|
---|
1448 | int yytype;
|
---|
1449 | YYSTYPE *yyvaluep;
|
---|
1450 | #endif
|
---|
1451 | {
|
---|
1452 | YYUSE (yyvaluep);
|
---|
1453 |
|
---|
1454 | if (!yymsg)
|
---|
1455 | yymsg = "Deleting";
|
---|
1456 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
---|
1457 |
|
---|
1458 | switch (yytype)
|
---|
1459 | {
|
---|
1460 |
|
---|
1461 | default:
|
---|
1462 | break;
|
---|
1463 | }
|
---|
1464 | }
|
---|
1465 | |
---|
1466 |
|
---|
1467 |
|
---|
1468 | /* Prevent warnings from -Wmissing-prototypes. */
|
---|
1469 |
|
---|
1470 | #ifdef YYPARSE_PARAM
|
---|
1471 | #if defined __STDC__ || defined __cplusplus
|
---|
1472 | int yyparse (void *YYPARSE_PARAM);
|
---|
1473 | #else
|
---|
1474 | int yyparse ();
|
---|
1475 | #endif
|
---|
1476 | #else /* ! YYPARSE_PARAM */
|
---|
1477 | #if defined __STDC__ || defined __cplusplus
|
---|
1478 | int yyparse (void);
|
---|
1479 | #else
|
---|
1480 | int yyparse ();
|
---|
1481 | #endif
|
---|
1482 | #endif /* ! YYPARSE_PARAM */
|
---|
1483 |
|
---|
1484 |
|
---|
1485 |
|
---|
1486 | /* The look-ahead symbol. */
|
---|
1487 | int yychar;
|
---|
1488 |
|
---|
1489 | /* The semantic value of the look-ahead symbol. */
|
---|
1490 | YYSTYPE yylval;
|
---|
1491 |
|
---|
1492 | /* Number of syntax errors so far. */
|
---|
1493 | int yynerrs;
|
---|
1494 |
|
---|
1495 |
|
---|
1496 |
|
---|
1497 | /*----------.
|
---|
1498 | | yyparse. |
|
---|
1499 | `----------*/
|
---|
1500 |
|
---|
1501 | #ifdef YYPARSE_PARAM
|
---|
1502 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1503 | || defined __cplusplus || defined _MSC_VER)
|
---|
1504 | int
|
---|
1505 | yyparse (void *YYPARSE_PARAM)
|
---|
1506 | #else
|
---|
1507 | int
|
---|
1508 | yyparse (YYPARSE_PARAM)
|
---|
1509 | void *YYPARSE_PARAM;
|
---|
1510 | #endif
|
---|
1511 | #else /* ! YYPARSE_PARAM */
|
---|
1512 | #if (defined __STDC__ || defined __C99__FUNC__ \
|
---|
1513 | || defined __cplusplus || defined _MSC_VER)
|
---|
1514 | int
|
---|
1515 | yyparse (void)
|
---|
1516 | #else
|
---|
1517 | int
|
---|
1518 | yyparse ()
|
---|
1519 |
|
---|
1520 | #endif
|
---|
1521 | #endif
|
---|
1522 | {
|
---|
1523 |
|
---|
1524 | int yystate;
|
---|
1525 | int yyn;
|
---|
1526 | int yyresult;
|
---|
1527 | /* Number of tokens to shift before error messages enabled. */
|
---|
1528 | int yyerrstatus;
|
---|
1529 | /* Look-ahead token as an internal (translated) token number. */
|
---|
1530 | int yytoken = 0;
|
---|
1531 | #if YYERROR_VERBOSE
|
---|
1532 | /* Buffer for error messages, and its allocated size. */
|
---|
1533 | char yymsgbuf[128];
|
---|
1534 | char *yymsg = yymsgbuf;
|
---|
1535 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
|
---|
1536 | #endif
|
---|
1537 |
|
---|
1538 | /* Three stacks and their tools:
|
---|
1539 | `yyss': related to states,
|
---|
1540 | `yyvs': related to semantic values,
|
---|
1541 | `yyls': related to locations.
|
---|
1542 |
|
---|
1543 | Refer to the stacks thru separate pointers, to allow yyoverflow
|
---|
1544 | to reallocate them elsewhere. */
|
---|
1545 |
|
---|
1546 | /* The state stack. */
|
---|
1547 | yytype_int16 yyssa[YYINITDEPTH];
|
---|
1548 | yytype_int16 *yyss = yyssa;
|
---|
1549 | yytype_int16 *yyssp;
|
---|
1550 |
|
---|
1551 | /* The semantic value stack. */
|
---|
1552 | YYSTYPE yyvsa[YYINITDEPTH];
|
---|
1553 | YYSTYPE *yyvs = yyvsa;
|
---|
1554 | YYSTYPE *yyvsp;
|
---|
1555 |
|
---|
1556 |
|
---|
1557 |
|
---|
1558 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
|
---|
1559 |
|
---|
1560 | YYSIZE_T yystacksize = YYINITDEPTH;
|
---|
1561 |
|
---|
1562 | /* The variables used to return semantic value and location from the
|
---|
1563 | action routines. */
|
---|
1564 | YYSTYPE yyval;
|
---|
1565 |
|
---|
1566 |
|
---|
1567 | /* The number of symbols on the RHS of the reduced rule.
|
---|
1568 | Keep to zero when no symbol should be popped. */
|
---|
1569 | int yylen = 0;
|
---|
1570 |
|
---|
1571 | YYDPRINTF ((stderr, "Starting parse\n"));
|
---|
1572 |
|
---|
1573 | yystate = 0;
|
---|
1574 | yyerrstatus = 0;
|
---|
1575 | yynerrs = 0;
|
---|
1576 | yychar = YYEMPTY; /* Cause a token to be read. */
|
---|
1577 |
|
---|
1578 | /* Initialize stack pointers.
|
---|
1579 | Waste one element of value and location stack
|
---|
1580 | so that they stay on the same level as the state stack.
|
---|
1581 | The wasted elements are never initialized. */
|
---|
1582 |
|
---|
1583 | yyssp = yyss;
|
---|
1584 | yyvsp = yyvs;
|
---|
1585 |
|
---|
1586 | goto yysetstate;
|
---|
1587 |
|
---|
1588 | /*------------------------------------------------------------.
|
---|
1589 | | yynewstate -- Push a new state, which is found in yystate. |
|
---|
1590 | `------------------------------------------------------------*/
|
---|
1591 | yynewstate:
|
---|
1592 | /* In all cases, when you get here, the value and location stacks
|
---|
1593 | have just been pushed. So pushing a state here evens the stacks. */
|
---|
1594 | yyssp++;
|
---|
1595 |
|
---|
1596 | yysetstate:
|
---|
1597 | *yyssp = yystate;
|
---|
1598 |
|
---|
1599 | if (yyss + yystacksize - 1 <= yyssp)
|
---|
1600 | {
|
---|
1601 | /* Get the current used size of the three stacks, in elements. */
|
---|
1602 | YYSIZE_T yysize = yyssp - yyss + 1;
|
---|
1603 |
|
---|
1604 | #ifdef yyoverflow
|
---|
1605 | {
|
---|
1606 | /* Give user a chance to reallocate the stack. Use copies of
|
---|
1607 | these so that the &'s don't force the real ones into
|
---|
1608 | memory. */
|
---|
1609 | YYSTYPE *yyvs1 = yyvs;
|
---|
1610 | yytype_int16 *yyss1 = yyss;
|
---|
1611 |
|
---|
1612 |
|
---|
1613 | /* Each stack pointer address is followed by the size of the
|
---|
1614 | data in use in that stack, in bytes. This used to be a
|
---|
1615 | conditional around just the two extra args, but that might
|
---|
1616 | be undefined if yyoverflow is a macro. */
|
---|
1617 | yyoverflow (YY_("memory exhausted"),
|
---|
1618 | &yyss1, yysize * sizeof (*yyssp),
|
---|
1619 | &yyvs1, yysize * sizeof (*yyvsp),
|
---|
1620 |
|
---|
1621 | &yystacksize);
|
---|
1622 |
|
---|
1623 | yyss = yyss1;
|
---|
1624 | yyvs = yyvs1;
|
---|
1625 | }
|
---|
1626 | #else /* no yyoverflow */
|
---|
1627 | # ifndef YYSTACK_RELOCATE
|
---|
1628 | goto yyexhaustedlab;
|
---|
1629 | # else
|
---|
1630 | /* Extend the stack our own way. */
|
---|
1631 | if (YYMAXDEPTH <= yystacksize)
|
---|
1632 | goto yyexhaustedlab;
|
---|
1633 | yystacksize *= 2;
|
---|
1634 | if (YYMAXDEPTH < yystacksize)
|
---|
1635 | yystacksize = YYMAXDEPTH;
|
---|
1636 |
|
---|
1637 | {
|
---|
1638 | yytype_int16 *yyss1 = yyss;
|
---|
1639 | union yyalloc *yyptr =
|
---|
1640 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
---|
1641 | if (! yyptr)
|
---|
1642 | goto yyexhaustedlab;
|
---|
1643 | YYSTACK_RELOCATE (yyss);
|
---|
1644 | YYSTACK_RELOCATE (yyvs);
|
---|
1645 |
|
---|
1646 | # undef YYSTACK_RELOCATE
|
---|
1647 | if (yyss1 != yyssa)
|
---|
1648 | YYSTACK_FREE (yyss1);
|
---|
1649 | }
|
---|
1650 | # endif
|
---|
1651 | #endif /* no yyoverflow */
|
---|
1652 |
|
---|
1653 | yyssp = yyss + yysize - 1;
|
---|
1654 | yyvsp = yyvs + yysize - 1;
|
---|
1655 |
|
---|
1656 |
|
---|
1657 | YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
---|
1658 | (unsigned long int) yystacksize));
|
---|
1659 |
|
---|
1660 | if (yyss + yystacksize - 1 <= yyssp)
|
---|
1661 | YYABORT;
|
---|
1662 | }
|
---|
1663 |
|
---|
1664 | YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
---|
1665 |
|
---|
1666 | goto yybackup;
|
---|
1667 |
|
---|
1668 | /*-----------.
|
---|
1669 | | yybackup. |
|
---|
1670 | `-----------*/
|
---|
1671 | yybackup:
|
---|
1672 |
|
---|
1673 | /* Do appropriate processing given the current state. Read a
|
---|
1674 | look-ahead token if we need one and don't already have one. */
|
---|
1675 |
|
---|
1676 | /* First try to decide what to do without reference to look-ahead token. */
|
---|
1677 | yyn = yypact[yystate];
|
---|
1678 | if (yyn == YYPACT_NINF)
|
---|
1679 | goto yydefault;
|
---|
1680 |
|
---|
1681 | /* Not known => get a look-ahead token if don't already have one. */
|
---|
1682 |
|
---|
1683 | /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
|
---|
1684 | if (yychar == YYEMPTY)
|
---|
1685 | {
|
---|
1686 | YYDPRINTF ((stderr, "Reading a token: "));
|
---|
1687 | yychar = YYLEX;
|
---|
1688 | }
|
---|
1689 |
|
---|
1690 | if (yychar <= YYEOF)
|
---|
1691 | {
|
---|
1692 | yychar = yytoken = YYEOF;
|
---|
1693 | YYDPRINTF ((stderr, "Now at end of input.\n"));
|
---|
1694 | }
|
---|
1695 | else
|
---|
1696 | {
|
---|
1697 | yytoken = YYTRANSLATE (yychar);
|
---|
1698 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
---|
1699 | }
|
---|
1700 |
|
---|
1701 | /* If the proper action on seeing token YYTOKEN is to reduce or to
|
---|
1702 | detect an error, take that action. */
|
---|
1703 | yyn += yytoken;
|
---|
1704 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
|
---|
1705 | goto yydefault;
|
---|
1706 | yyn = yytable[yyn];
|
---|
1707 | if (yyn <= 0)
|
---|
1708 | {
|
---|
1709 | if (yyn == 0 || yyn == YYTABLE_NINF)
|
---|
1710 | goto yyerrlab;
|
---|
1711 | yyn = -yyn;
|
---|
1712 | goto yyreduce;
|
---|
1713 | }
|
---|
1714 |
|
---|
1715 | if (yyn == YYFINAL)
|
---|
1716 | YYACCEPT;
|
---|
1717 |
|
---|
1718 | /* Count tokens shifted since error; after three, turn off error
|
---|
1719 | status. */
|
---|
1720 | if (yyerrstatus)
|
---|
1721 | yyerrstatus--;
|
---|
1722 |
|
---|
1723 | /* Shift the look-ahead token. */
|
---|
1724 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
---|
1725 |
|
---|
1726 | /* Discard the shifted token unless it is eof. */
|
---|
1727 | if (yychar != YYEOF)
|
---|
1728 | yychar = YYEMPTY;
|
---|
1729 |
|
---|
1730 | yystate = yyn;
|
---|
1731 | *++yyvsp = yylval;
|
---|
1732 |
|
---|
1733 | goto yynewstate;
|
---|
1734 |
|
---|
1735 |
|
---|
1736 | /*-----------------------------------------------------------.
|
---|
1737 | | yydefault -- do the default action for the current state. |
|
---|
1738 | `-----------------------------------------------------------*/
|
---|
1739 | yydefault:
|
---|
1740 | yyn = yydefact[yystate];
|
---|
1741 | if (yyn == 0)
|
---|
1742 | goto yyerrlab;
|
---|
1743 | goto yyreduce;
|
---|
1744 |
|
---|
1745 |
|
---|
1746 | /*-----------------------------.
|
---|
1747 | | yyreduce -- Do a reduction. |
|
---|
1748 | `-----------------------------*/
|
---|
1749 | yyreduce:
|
---|
1750 | /* yyn is the number of a rule to reduce with. */
|
---|
1751 | yylen = yyr2[yyn];
|
---|
1752 |
|
---|
1753 | /* If YYLEN is nonzero, implement the default value of the action:
|
---|
1754 | `$$ = $1'.
|
---|
1755 |
|
---|
1756 | Otherwise, the following line sets YYVAL to garbage.
|
---|
1757 | This behavior is undocumented and Bison
|
---|
1758 | users should not rely upon it. Assigning to YYVAL
|
---|
1759 | unconditionally makes the parser a bit smaller, and it avoids a
|
---|
1760 | GCC warning that YYVAL may be used uninitialized. */
|
---|
1761 | yyval = yyvsp[1-yylen];
|
---|
1762 |
|
---|
1763 |
|
---|
1764 | YY_REDUCE_PRINT (yyn);
|
---|
1765 | switch (yyn)
|
---|
1766 | {
|
---|
1767 | case 2:
|
---|
1768 | #line 235 "heimdal/lib/asn1/asn1parse.y"
|
---|
1769 | {
|
---|
1770 | checkundefined();
|
---|
1771 | }
|
---|
1772 | break;
|
---|
1773 |
|
---|
1774 | case 4:
|
---|
1775 | #line 242 "heimdal/lib/asn1/asn1parse.y"
|
---|
1776 | { error_message("implicit tagging is not supported"); }
|
---|
1777 | break;
|
---|
1778 |
|
---|
1779 | case 5:
|
---|
1780 | #line 244 "heimdal/lib/asn1/asn1parse.y"
|
---|
1781 | { error_message("automatic tagging is not supported"); }
|
---|
1782 | break;
|
---|
1783 |
|
---|
1784 | case 7:
|
---|
1785 | #line 249 "heimdal/lib/asn1/asn1parse.y"
|
---|
1786 | { error_message("no extensibility options supported"); }
|
---|
1787 | break;
|
---|
1788 |
|
---|
1789 | case 17:
|
---|
1790 | #line 270 "heimdal/lib/asn1/asn1parse.y"
|
---|
1791 | {
|
---|
1792 | struct string_list *sl;
|
---|
1793 | for(sl = (yyvsp[(1) - (4)].sl); sl != NULL; sl = sl->next) {
|
---|
1794 | Symbol *s = addsym(sl->string);
|
---|
1795 | s->stype = Stype;
|
---|
1796 | }
|
---|
1797 | add_import((yyvsp[(3) - (4)].name));
|
---|
1798 | }
|
---|
1799 | break;
|
---|
1800 |
|
---|
1801 | case 22:
|
---|
1802 | #line 289 "heimdal/lib/asn1/asn1parse.y"
|
---|
1803 | {
|
---|
1804 | (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
|
---|
1805 | (yyval.sl)->string = (yyvsp[(1) - (3)].name);
|
---|
1806 | (yyval.sl)->next = (yyvsp[(3) - (3)].sl);
|
---|
1807 | }
|
---|
1808 | break;
|
---|
1809 |
|
---|
1810 | case 23:
|
---|
1811 | #line 295 "heimdal/lib/asn1/asn1parse.y"
|
---|
1812 | {
|
---|
1813 | (yyval.sl) = emalloc(sizeof(*(yyval.sl)));
|
---|
1814 | (yyval.sl)->string = (yyvsp[(1) - (1)].name);
|
---|
1815 | (yyval.sl)->next = NULL;
|
---|
1816 | }
|
---|
1817 | break;
|
---|
1818 |
|
---|
1819 | case 24:
|
---|
1820 | #line 303 "heimdal/lib/asn1/asn1parse.y"
|
---|
1821 | {
|
---|
1822 | Symbol *s = addsym ((yyvsp[(1) - (3)].name));
|
---|
1823 | s->stype = Stype;
|
---|
1824 | s->type = (yyvsp[(3) - (3)].type);
|
---|
1825 | fix_labels(s);
|
---|
1826 | generate_type (s);
|
---|
1827 | }
|
---|
1828 | break;
|
---|
1829 |
|
---|
1830 | case 42:
|
---|
1831 | #line 334 "heimdal/lib/asn1/asn1parse.y"
|
---|
1832 | {
|
---|
1833 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Boolean,
|
---|
1834 | TE_EXPLICIT, new_type(TBoolean));
|
---|
1835 | }
|
---|
1836 | break;
|
---|
1837 |
|
---|
1838 | case 43:
|
---|
1839 | #line 341 "heimdal/lib/asn1/asn1parse.y"
|
---|
1840 | {
|
---|
1841 | if((yyvsp[(2) - (5)].value)->type != integervalue)
|
---|
1842 | error_message("Non-integer used in first part of range");
|
---|
1843 | if((yyvsp[(2) - (5)].value)->type != integervalue)
|
---|
1844 | error_message("Non-integer in second part of range");
|
---|
1845 | (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
|
---|
1846 | (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
|
---|
1847 | (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
|
---|
1848 | }
|
---|
1849 | break;
|
---|
1850 |
|
---|
1851 | case 44:
|
---|
1852 | #line 351 "heimdal/lib/asn1/asn1parse.y"
|
---|
1853 | {
|
---|
1854 | if((yyvsp[(2) - (5)].value)->type != integervalue)
|
---|
1855 | error_message("Non-integer in first part of range");
|
---|
1856 | (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
|
---|
1857 | (yyval.range)->min = (yyvsp[(2) - (5)].value)->u.integervalue;
|
---|
1858 | (yyval.range)->max = (yyvsp[(2) - (5)].value)->u.integervalue - 1;
|
---|
1859 | }
|
---|
1860 | break;
|
---|
1861 |
|
---|
1862 | case 45:
|
---|
1863 | #line 359 "heimdal/lib/asn1/asn1parse.y"
|
---|
1864 | {
|
---|
1865 | if((yyvsp[(4) - (5)].value)->type != integervalue)
|
---|
1866 | error_message("Non-integer in second part of range");
|
---|
1867 | (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
|
---|
1868 | (yyval.range)->min = (yyvsp[(4) - (5)].value)->u.integervalue + 2;
|
---|
1869 | (yyval.range)->max = (yyvsp[(4) - (5)].value)->u.integervalue;
|
---|
1870 | }
|
---|
1871 | break;
|
---|
1872 |
|
---|
1873 | case 46:
|
---|
1874 | #line 367 "heimdal/lib/asn1/asn1parse.y"
|
---|
1875 | {
|
---|
1876 | if((yyvsp[(2) - (3)].value)->type != integervalue)
|
---|
1877 | error_message("Non-integer used in limit");
|
---|
1878 | (yyval.range) = ecalloc(1, sizeof(*(yyval.range)));
|
---|
1879 | (yyval.range)->min = (yyvsp[(2) - (3)].value)->u.integervalue;
|
---|
1880 | (yyval.range)->max = (yyvsp[(2) - (3)].value)->u.integervalue;
|
---|
1881 | }
|
---|
1882 | break;
|
---|
1883 |
|
---|
1884 | case 47:
|
---|
1885 | #line 378 "heimdal/lib/asn1/asn1parse.y"
|
---|
1886 | {
|
---|
1887 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer,
|
---|
1888 | TE_EXPLICIT, new_type(TInteger));
|
---|
1889 | }
|
---|
1890 | break;
|
---|
1891 |
|
---|
1892 | case 48:
|
---|
1893 | #line 383 "heimdal/lib/asn1/asn1parse.y"
|
---|
1894 | {
|
---|
1895 | (yyval.type) = new_type(TInteger);
|
---|
1896 | (yyval.type)->range = (yyvsp[(2) - (2)].range);
|
---|
1897 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
|
---|
1898 | }
|
---|
1899 | break;
|
---|
1900 |
|
---|
1901 | case 49:
|
---|
1902 | #line 389 "heimdal/lib/asn1/asn1parse.y"
|
---|
1903 | {
|
---|
1904 | (yyval.type) = new_type(TInteger);
|
---|
1905 | (yyval.type)->members = (yyvsp[(3) - (4)].members);
|
---|
1906 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Integer, TE_EXPLICIT, (yyval.type));
|
---|
1907 | }
|
---|
1908 | break;
|
---|
1909 |
|
---|
1910 | case 50:
|
---|
1911 | #line 397 "heimdal/lib/asn1/asn1parse.y"
|
---|
1912 | {
|
---|
1913 | (yyval.members) = emalloc(sizeof(*(yyval.members)));
|
---|
1914 | ASN1_TAILQ_INIT((yyval.members));
|
---|
1915 | ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
|
---|
1916 | }
|
---|
1917 | break;
|
---|
1918 |
|
---|
1919 | case 51:
|
---|
1920 | #line 403 "heimdal/lib/asn1/asn1parse.y"
|
---|
1921 | {
|
---|
1922 | ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
|
---|
1923 | (yyval.members) = (yyvsp[(1) - (3)].members);
|
---|
1924 | }
|
---|
1925 | break;
|
---|
1926 |
|
---|
1927 | case 52:
|
---|
1928 | #line 408 "heimdal/lib/asn1/asn1parse.y"
|
---|
1929 | { (yyval.members) = (yyvsp[(1) - (3)].members); }
|
---|
1930 | break;
|
---|
1931 |
|
---|
1932 | case 53:
|
---|
1933 | #line 412 "heimdal/lib/asn1/asn1parse.y"
|
---|
1934 | {
|
---|
1935 | (yyval.member) = emalloc(sizeof(*(yyval.member)));
|
---|
1936 | (yyval.member)->name = (yyvsp[(1) - (4)].name);
|
---|
1937 | (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
|
---|
1938 | output_name ((yyval.member)->gen_name);
|
---|
1939 | (yyval.member)->val = (yyvsp[(3) - (4)].constant);
|
---|
1940 | (yyval.member)->optional = 0;
|
---|
1941 | (yyval.member)->ellipsis = 0;
|
---|
1942 | (yyval.member)->type = NULL;
|
---|
1943 | }
|
---|
1944 | break;
|
---|
1945 |
|
---|
1946 | case 54:
|
---|
1947 | #line 425 "heimdal/lib/asn1/asn1parse.y"
|
---|
1948 | {
|
---|
1949 | (yyval.type) = new_type(TInteger);
|
---|
1950 | (yyval.type)->members = (yyvsp[(3) - (4)].members);
|
---|
1951 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Enumerated, TE_EXPLICIT, (yyval.type));
|
---|
1952 | }
|
---|
1953 | break;
|
---|
1954 |
|
---|
1955 | case 56:
|
---|
1956 | #line 436 "heimdal/lib/asn1/asn1parse.y"
|
---|
1957 | {
|
---|
1958 | (yyval.type) = new_type(TBitString);
|
---|
1959 | (yyval.type)->members = emalloc(sizeof(*(yyval.type)->members));
|
---|
1960 | ASN1_TAILQ_INIT((yyval.type)->members);
|
---|
1961 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
|
---|
1962 | }
|
---|
1963 | break;
|
---|
1964 |
|
---|
1965 | case 57:
|
---|
1966 | #line 443 "heimdal/lib/asn1/asn1parse.y"
|
---|
1967 | {
|
---|
1968 | (yyval.type) = new_type(TBitString);
|
---|
1969 | (yyval.type)->members = (yyvsp[(4) - (5)].members);
|
---|
1970 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_BitString, TE_EXPLICIT, (yyval.type));
|
---|
1971 | }
|
---|
1972 | break;
|
---|
1973 |
|
---|
1974 | case 58:
|
---|
1975 | #line 451 "heimdal/lib/asn1/asn1parse.y"
|
---|
1976 | {
|
---|
1977 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_OID,
|
---|
1978 | TE_EXPLICIT, new_type(TOID));
|
---|
1979 | }
|
---|
1980 | break;
|
---|
1981 |
|
---|
1982 | case 59:
|
---|
1983 | #line 457 "heimdal/lib/asn1/asn1parse.y"
|
---|
1984 | {
|
---|
1985 | Type *t = new_type(TOctetString);
|
---|
1986 | t->range = (yyvsp[(3) - (3)].range);
|
---|
1987 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_OctetString,
|
---|
1988 | TE_EXPLICIT, t);
|
---|
1989 | }
|
---|
1990 | break;
|
---|
1991 |
|
---|
1992 | case 60:
|
---|
1993 | #line 466 "heimdal/lib/asn1/asn1parse.y"
|
---|
1994 | {
|
---|
1995 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Null,
|
---|
1996 | TE_EXPLICIT, new_type(TNull));
|
---|
1997 | }
|
---|
1998 | break;
|
---|
1999 |
|
---|
2000 | case 61:
|
---|
2001 | #line 473 "heimdal/lib/asn1/asn1parse.y"
|
---|
2002 | { (yyval.range) = NULL; }
|
---|
2003 | break;
|
---|
2004 |
|
---|
2005 | case 62:
|
---|
2006 | #line 475 "heimdal/lib/asn1/asn1parse.y"
|
---|
2007 | { (yyval.range) = (yyvsp[(2) - (2)].range); }
|
---|
2008 | break;
|
---|
2009 |
|
---|
2010 | case 63:
|
---|
2011 | #line 480 "heimdal/lib/asn1/asn1parse.y"
|
---|
2012 | {
|
---|
2013 | (yyval.type) = new_type(TSequence);
|
---|
2014 | (yyval.type)->members = (yyvsp[(3) - (4)].members);
|
---|
2015 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
|
---|
2016 | }
|
---|
2017 | break;
|
---|
2018 |
|
---|
2019 | case 64:
|
---|
2020 | #line 486 "heimdal/lib/asn1/asn1parse.y"
|
---|
2021 | {
|
---|
2022 | (yyval.type) = new_type(TSequence);
|
---|
2023 | (yyval.type)->members = NULL;
|
---|
2024 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
|
---|
2025 | }
|
---|
2026 | break;
|
---|
2027 |
|
---|
2028 | case 65:
|
---|
2029 | #line 494 "heimdal/lib/asn1/asn1parse.y"
|
---|
2030 | {
|
---|
2031 | (yyval.type) = new_type(TSequenceOf);
|
---|
2032 | (yyval.type)->range = (yyvsp[(2) - (4)].range);
|
---|
2033 | (yyval.type)->subtype = (yyvsp[(4) - (4)].type);
|
---|
2034 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Sequence, TE_EXPLICIT, (yyval.type));
|
---|
2035 | }
|
---|
2036 | break;
|
---|
2037 |
|
---|
2038 | case 66:
|
---|
2039 | #line 503 "heimdal/lib/asn1/asn1parse.y"
|
---|
2040 | {
|
---|
2041 | (yyval.type) = new_type(TSet);
|
---|
2042 | (yyval.type)->members = (yyvsp[(3) - (4)].members);
|
---|
2043 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
|
---|
2044 | }
|
---|
2045 | break;
|
---|
2046 |
|
---|
2047 | case 67:
|
---|
2048 | #line 509 "heimdal/lib/asn1/asn1parse.y"
|
---|
2049 | {
|
---|
2050 | (yyval.type) = new_type(TSet);
|
---|
2051 | (yyval.type)->members = NULL;
|
---|
2052 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
|
---|
2053 | }
|
---|
2054 | break;
|
---|
2055 |
|
---|
2056 | case 68:
|
---|
2057 | #line 517 "heimdal/lib/asn1/asn1parse.y"
|
---|
2058 | {
|
---|
2059 | (yyval.type) = new_type(TSetOf);
|
---|
2060 | (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
|
---|
2061 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_Set, TE_EXPLICIT, (yyval.type));
|
---|
2062 | }
|
---|
2063 | break;
|
---|
2064 |
|
---|
2065 | case 69:
|
---|
2066 | #line 525 "heimdal/lib/asn1/asn1parse.y"
|
---|
2067 | {
|
---|
2068 | (yyval.type) = new_type(TChoice);
|
---|
2069 | (yyval.type)->members = (yyvsp[(3) - (4)].members);
|
---|
2070 | }
|
---|
2071 | break;
|
---|
2072 |
|
---|
2073 | case 72:
|
---|
2074 | #line 536 "heimdal/lib/asn1/asn1parse.y"
|
---|
2075 | {
|
---|
2076 | Symbol *s = addsym((yyvsp[(1) - (1)].name));
|
---|
2077 | (yyval.type) = new_type(TType);
|
---|
2078 | if(s->stype != Stype && s->stype != SUndefined)
|
---|
2079 | error_message ("%s is not a type\n", (yyvsp[(1) - (1)].name));
|
---|
2080 | else
|
---|
2081 | (yyval.type)->symbol = s;
|
---|
2082 | }
|
---|
2083 | break;
|
---|
2084 |
|
---|
2085 | case 73:
|
---|
2086 | #line 547 "heimdal/lib/asn1/asn1parse.y"
|
---|
2087 | {
|
---|
2088 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralizedTime,
|
---|
2089 | TE_EXPLICIT, new_type(TGeneralizedTime));
|
---|
2090 | }
|
---|
2091 | break;
|
---|
2092 |
|
---|
2093 | case 74:
|
---|
2094 | #line 552 "heimdal/lib/asn1/asn1parse.y"
|
---|
2095 | {
|
---|
2096 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTCTime,
|
---|
2097 | TE_EXPLICIT, new_type(TUTCTime));
|
---|
2098 | }
|
---|
2099 | break;
|
---|
2100 |
|
---|
2101 | case 75:
|
---|
2102 | #line 559 "heimdal/lib/asn1/asn1parse.y"
|
---|
2103 | {
|
---|
2104 | /* if (Constraint.type == contentConstrant) {
|
---|
2105 | assert(Constraint.u.constraint.type == octetstring|bitstring-w/o-NamedBitList); // remember to check type reference too
|
---|
2106 | if (Constraint.u.constraint.type) {
|
---|
2107 | assert((Constraint.u.constraint.type.length % 8) == 0);
|
---|
2108 | }
|
---|
2109 | }
|
---|
2110 | if (Constraint.u.constraint.encoding) {
|
---|
2111 | type == der-oid|ber-oid
|
---|
2112 | }
|
---|
2113 | */
|
---|
2114 | }
|
---|
2115 | break;
|
---|
2116 |
|
---|
2117 | case 76:
|
---|
2118 | #line 575 "heimdal/lib/asn1/asn1parse.y"
|
---|
2119 | {
|
---|
2120 | (yyval.constraint_spec) = (yyvsp[(2) - (3)].constraint_spec);
|
---|
2121 | }
|
---|
2122 | break;
|
---|
2123 |
|
---|
2124 | case 80:
|
---|
2125 | #line 588 "heimdal/lib/asn1/asn1parse.y"
|
---|
2126 | {
|
---|
2127 | (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
|
---|
2128 | (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (2)].type);
|
---|
2129 | (yyval.constraint_spec)->u.content.encoding = NULL;
|
---|
2130 | }
|
---|
2131 | break;
|
---|
2132 |
|
---|
2133 | case 81:
|
---|
2134 | #line 594 "heimdal/lib/asn1/asn1parse.y"
|
---|
2135 | {
|
---|
2136 | if ((yyvsp[(3) - (3)].value)->type != objectidentifiervalue)
|
---|
2137 | error_message("Non-OID used in ENCODED BY constraint");
|
---|
2138 | (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
|
---|
2139 | (yyval.constraint_spec)->u.content.type = NULL;
|
---|
2140 | (yyval.constraint_spec)->u.content.encoding = (yyvsp[(3) - (3)].value);
|
---|
2141 | }
|
---|
2142 | break;
|
---|
2143 |
|
---|
2144 | case 82:
|
---|
2145 | #line 602 "heimdal/lib/asn1/asn1parse.y"
|
---|
2146 | {
|
---|
2147 | if ((yyvsp[(5) - (5)].value)->type != objectidentifiervalue)
|
---|
2148 | error_message("Non-OID used in ENCODED BY constraint");
|
---|
2149 | (yyval.constraint_spec) = new_constraint_spec(CT_CONTENTS);
|
---|
2150 | (yyval.constraint_spec)->u.content.type = (yyvsp[(2) - (5)].type);
|
---|
2151 | (yyval.constraint_spec)->u.content.encoding = (yyvsp[(5) - (5)].value);
|
---|
2152 | }
|
---|
2153 | break;
|
---|
2154 |
|
---|
2155 | case 83:
|
---|
2156 | #line 612 "heimdal/lib/asn1/asn1parse.y"
|
---|
2157 | {
|
---|
2158 | (yyval.constraint_spec) = new_constraint_spec(CT_USER);
|
---|
2159 | }
|
---|
2160 | break;
|
---|
2161 |
|
---|
2162 | case 84:
|
---|
2163 | #line 618 "heimdal/lib/asn1/asn1parse.y"
|
---|
2164 | {
|
---|
2165 | (yyval.type) = new_type(TTag);
|
---|
2166 | (yyval.type)->tag = (yyvsp[(1) - (3)].tag);
|
---|
2167 | (yyval.type)->tag.tagenv = (yyvsp[(2) - (3)].constant);
|
---|
2168 | if((yyvsp[(3) - (3)].type)->type == TTag && (yyvsp[(2) - (3)].constant) == TE_IMPLICIT) {
|
---|
2169 | (yyval.type)->subtype = (yyvsp[(3) - (3)].type)->subtype;
|
---|
2170 | free((yyvsp[(3) - (3)].type));
|
---|
2171 | } else
|
---|
2172 | (yyval.type)->subtype = (yyvsp[(3) - (3)].type);
|
---|
2173 | }
|
---|
2174 | break;
|
---|
2175 |
|
---|
2176 | case 85:
|
---|
2177 | #line 631 "heimdal/lib/asn1/asn1parse.y"
|
---|
2178 | {
|
---|
2179 | (yyval.tag).tagclass = (yyvsp[(2) - (4)].constant);
|
---|
2180 | (yyval.tag).tagvalue = (yyvsp[(3) - (4)].constant);
|
---|
2181 | (yyval.tag).tagenv = TE_EXPLICIT;
|
---|
2182 | }
|
---|
2183 | break;
|
---|
2184 |
|
---|
2185 | case 86:
|
---|
2186 | #line 639 "heimdal/lib/asn1/asn1parse.y"
|
---|
2187 | {
|
---|
2188 | (yyval.constant) = ASN1_C_CONTEXT;
|
---|
2189 | }
|
---|
2190 | break;
|
---|
2191 |
|
---|
2192 | case 87:
|
---|
2193 | #line 643 "heimdal/lib/asn1/asn1parse.y"
|
---|
2194 | {
|
---|
2195 | (yyval.constant) = ASN1_C_UNIV;
|
---|
2196 | }
|
---|
2197 | break;
|
---|
2198 |
|
---|
2199 | case 88:
|
---|
2200 | #line 647 "heimdal/lib/asn1/asn1parse.y"
|
---|
2201 | {
|
---|
2202 | (yyval.constant) = ASN1_C_APPL;
|
---|
2203 | }
|
---|
2204 | break;
|
---|
2205 |
|
---|
2206 | case 89:
|
---|
2207 | #line 651 "heimdal/lib/asn1/asn1parse.y"
|
---|
2208 | {
|
---|
2209 | (yyval.constant) = ASN1_C_PRIVATE;
|
---|
2210 | }
|
---|
2211 | break;
|
---|
2212 |
|
---|
2213 | case 90:
|
---|
2214 | #line 657 "heimdal/lib/asn1/asn1parse.y"
|
---|
2215 | {
|
---|
2216 | (yyval.constant) = TE_EXPLICIT;
|
---|
2217 | }
|
---|
2218 | break;
|
---|
2219 |
|
---|
2220 | case 91:
|
---|
2221 | #line 661 "heimdal/lib/asn1/asn1parse.y"
|
---|
2222 | {
|
---|
2223 | (yyval.constant) = TE_EXPLICIT;
|
---|
2224 | }
|
---|
2225 | break;
|
---|
2226 |
|
---|
2227 | case 92:
|
---|
2228 | #line 665 "heimdal/lib/asn1/asn1parse.y"
|
---|
2229 | {
|
---|
2230 | (yyval.constant) = TE_IMPLICIT;
|
---|
2231 | }
|
---|
2232 | break;
|
---|
2233 |
|
---|
2234 | case 93:
|
---|
2235 | #line 672 "heimdal/lib/asn1/asn1parse.y"
|
---|
2236 | {
|
---|
2237 | Symbol *s;
|
---|
2238 | s = addsym ((yyvsp[(1) - (4)].name));
|
---|
2239 |
|
---|
2240 | s->stype = SValue;
|
---|
2241 | s->value = (yyvsp[(4) - (4)].value);
|
---|
2242 | generate_constant (s);
|
---|
2243 | }
|
---|
2244 | break;
|
---|
2245 |
|
---|
2246 | case 95:
|
---|
2247 | #line 686 "heimdal/lib/asn1/asn1parse.y"
|
---|
2248 | {
|
---|
2249 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_GeneralString,
|
---|
2250 | TE_EXPLICIT, new_type(TGeneralString));
|
---|
2251 | }
|
---|
2252 | break;
|
---|
2253 |
|
---|
2254 | case 96:
|
---|
2255 | #line 691 "heimdal/lib/asn1/asn1parse.y"
|
---|
2256 | {
|
---|
2257 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_UTF8String,
|
---|
2258 | TE_EXPLICIT, new_type(TUTF8String));
|
---|
2259 | }
|
---|
2260 | break;
|
---|
2261 |
|
---|
2262 | case 97:
|
---|
2263 | #line 696 "heimdal/lib/asn1/asn1parse.y"
|
---|
2264 | {
|
---|
2265 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_PrintableString,
|
---|
2266 | TE_EXPLICIT, new_type(TPrintableString));
|
---|
2267 | }
|
---|
2268 | break;
|
---|
2269 |
|
---|
2270 | case 98:
|
---|
2271 | #line 701 "heimdal/lib/asn1/asn1parse.y"
|
---|
2272 | {
|
---|
2273 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_VisibleString,
|
---|
2274 | TE_EXPLICIT, new_type(TVisibleString));
|
---|
2275 | }
|
---|
2276 | break;
|
---|
2277 |
|
---|
2278 | case 99:
|
---|
2279 | #line 706 "heimdal/lib/asn1/asn1parse.y"
|
---|
2280 | {
|
---|
2281 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_IA5String,
|
---|
2282 | TE_EXPLICIT, new_type(TIA5String));
|
---|
2283 | }
|
---|
2284 | break;
|
---|
2285 |
|
---|
2286 | case 100:
|
---|
2287 | #line 711 "heimdal/lib/asn1/asn1parse.y"
|
---|
2288 | {
|
---|
2289 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_BMPString,
|
---|
2290 | TE_EXPLICIT, new_type(TBMPString));
|
---|
2291 | }
|
---|
2292 | break;
|
---|
2293 |
|
---|
2294 | case 101:
|
---|
2295 | #line 716 "heimdal/lib/asn1/asn1parse.y"
|
---|
2296 | {
|
---|
2297 | (yyval.type) = new_tag(ASN1_C_UNIV, UT_UniversalString,
|
---|
2298 | TE_EXPLICIT, new_type(TUniversalString));
|
---|
2299 | }
|
---|
2300 | break;
|
---|
2301 |
|
---|
2302 | case 102:
|
---|
2303 | #line 724 "heimdal/lib/asn1/asn1parse.y"
|
---|
2304 | {
|
---|
2305 | (yyval.members) = emalloc(sizeof(*(yyval.members)));
|
---|
2306 | ASN1_TAILQ_INIT((yyval.members));
|
---|
2307 | ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
|
---|
2308 | }
|
---|
2309 | break;
|
---|
2310 |
|
---|
2311 | case 103:
|
---|
2312 | #line 730 "heimdal/lib/asn1/asn1parse.y"
|
---|
2313 | {
|
---|
2314 | ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
|
---|
2315 | (yyval.members) = (yyvsp[(1) - (3)].members);
|
---|
2316 | }
|
---|
2317 | break;
|
---|
2318 |
|
---|
2319 | case 104:
|
---|
2320 | #line 735 "heimdal/lib/asn1/asn1parse.y"
|
---|
2321 | {
|
---|
2322 | struct member *m = ecalloc(1, sizeof(*m));
|
---|
2323 | m->name = estrdup("...");
|
---|
2324 | m->gen_name = estrdup("asn1_ellipsis");
|
---|
2325 | m->ellipsis = 1;
|
---|
2326 | ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), m, members);
|
---|
2327 | (yyval.members) = (yyvsp[(1) - (3)].members);
|
---|
2328 | }
|
---|
2329 | break;
|
---|
2330 |
|
---|
2331 | case 105:
|
---|
2332 | #line 746 "heimdal/lib/asn1/asn1parse.y"
|
---|
2333 | {
|
---|
2334 | (yyval.member) = emalloc(sizeof(*(yyval.member)));
|
---|
2335 | (yyval.member)->name = (yyvsp[(1) - (2)].name);
|
---|
2336 | (yyval.member)->gen_name = estrdup((yyvsp[(1) - (2)].name));
|
---|
2337 | output_name ((yyval.member)->gen_name);
|
---|
2338 | (yyval.member)->type = (yyvsp[(2) - (2)].type);
|
---|
2339 | (yyval.member)->ellipsis = 0;
|
---|
2340 | }
|
---|
2341 | break;
|
---|
2342 |
|
---|
2343 | case 106:
|
---|
2344 | #line 757 "heimdal/lib/asn1/asn1parse.y"
|
---|
2345 | {
|
---|
2346 | (yyval.member) = (yyvsp[(1) - (1)].member);
|
---|
2347 | (yyval.member)->optional = 0;
|
---|
2348 | (yyval.member)->defval = NULL;
|
---|
2349 | }
|
---|
2350 | break;
|
---|
2351 |
|
---|
2352 | case 107:
|
---|
2353 | #line 763 "heimdal/lib/asn1/asn1parse.y"
|
---|
2354 | {
|
---|
2355 | (yyval.member) = (yyvsp[(1) - (2)].member);
|
---|
2356 | (yyval.member)->optional = 1;
|
---|
2357 | (yyval.member)->defval = NULL;
|
---|
2358 | }
|
---|
2359 | break;
|
---|
2360 |
|
---|
2361 | case 108:
|
---|
2362 | #line 769 "heimdal/lib/asn1/asn1parse.y"
|
---|
2363 | {
|
---|
2364 | (yyval.member) = (yyvsp[(1) - (3)].member);
|
---|
2365 | (yyval.member)->optional = 0;
|
---|
2366 | (yyval.member)->defval = (yyvsp[(3) - (3)].value);
|
---|
2367 | }
|
---|
2368 | break;
|
---|
2369 |
|
---|
2370 | case 109:
|
---|
2371 | #line 777 "heimdal/lib/asn1/asn1parse.y"
|
---|
2372 | {
|
---|
2373 | (yyval.members) = emalloc(sizeof(*(yyval.members)));
|
---|
2374 | ASN1_TAILQ_INIT((yyval.members));
|
---|
2375 | ASN1_TAILQ_INSERT_HEAD((yyval.members), (yyvsp[(1) - (1)].member), members);
|
---|
2376 | }
|
---|
2377 | break;
|
---|
2378 |
|
---|
2379 | case 110:
|
---|
2380 | #line 783 "heimdal/lib/asn1/asn1parse.y"
|
---|
2381 | {
|
---|
2382 | ASN1_TAILQ_INSERT_TAIL((yyvsp[(1) - (3)].members), (yyvsp[(3) - (3)].member), members);
|
---|
2383 | (yyval.members) = (yyvsp[(1) - (3)].members);
|
---|
2384 | }
|
---|
2385 | break;
|
---|
2386 |
|
---|
2387 | case 111:
|
---|
2388 | #line 790 "heimdal/lib/asn1/asn1parse.y"
|
---|
2389 | {
|
---|
2390 | (yyval.member) = emalloc(sizeof(*(yyval.member)));
|
---|
2391 | (yyval.member)->name = (yyvsp[(1) - (4)].name);
|
---|
2392 | (yyval.member)->gen_name = estrdup((yyvsp[(1) - (4)].name));
|
---|
2393 | output_name ((yyval.member)->gen_name);
|
---|
2394 | (yyval.member)->val = (yyvsp[(3) - (4)].constant);
|
---|
2395 | (yyval.member)->optional = 0;
|
---|
2396 | (yyval.member)->ellipsis = 0;
|
---|
2397 | (yyval.member)->type = NULL;
|
---|
2398 | }
|
---|
2399 | break;
|
---|
2400 |
|
---|
2401 | case 113:
|
---|
2402 | #line 803 "heimdal/lib/asn1/asn1parse.y"
|
---|
2403 | { (yyval.objid) = NULL; }
|
---|
2404 | break;
|
---|
2405 |
|
---|
2406 | case 114:
|
---|
2407 | #line 807 "heimdal/lib/asn1/asn1parse.y"
|
---|
2408 | {
|
---|
2409 | (yyval.objid) = (yyvsp[(2) - (3)].objid);
|
---|
2410 | }
|
---|
2411 | break;
|
---|
2412 |
|
---|
2413 | case 115:
|
---|
2414 | #line 813 "heimdal/lib/asn1/asn1parse.y"
|
---|
2415 | {
|
---|
2416 | (yyval.objid) = NULL;
|
---|
2417 | }
|
---|
2418 | break;
|
---|
2419 |
|
---|
2420 | case 116:
|
---|
2421 | #line 817 "heimdal/lib/asn1/asn1parse.y"
|
---|
2422 | {
|
---|
2423 | if ((yyvsp[(2) - (2)].objid)) {
|
---|
2424 | (yyval.objid) = (yyvsp[(2) - (2)].objid);
|
---|
2425 | add_oid_to_tail((yyvsp[(2) - (2)].objid), (yyvsp[(1) - (2)].objid));
|
---|
2426 | } else {
|
---|
2427 | (yyval.objid) = (yyvsp[(1) - (2)].objid);
|
---|
2428 | }
|
---|
2429 | }
|
---|
2430 | break;
|
---|
2431 |
|
---|
2432 | case 117:
|
---|
2433 | #line 828 "heimdal/lib/asn1/asn1parse.y"
|
---|
2434 | {
|
---|
2435 | (yyval.objid) = new_objid((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].constant));
|
---|
2436 | }
|
---|
2437 | break;
|
---|
2438 |
|
---|
2439 | case 118:
|
---|
2440 | #line 832 "heimdal/lib/asn1/asn1parse.y"
|
---|
2441 | {
|
---|
2442 | Symbol *s = addsym((yyvsp[(1) - (1)].name));
|
---|
2443 | if(s->stype != SValue ||
|
---|
2444 | s->value->type != objectidentifiervalue) {
|
---|
2445 | error_message("%s is not an object identifier\n",
|
---|
2446 | s->name);
|
---|
2447 | exit(1);
|
---|
2448 | }
|
---|
2449 | (yyval.objid) = s->value->u.objectidentifiervalue;
|
---|
2450 | }
|
---|
2451 | break;
|
---|
2452 |
|
---|
2453 | case 119:
|
---|
2454 | #line 843 "heimdal/lib/asn1/asn1parse.y"
|
---|
2455 | {
|
---|
2456 | (yyval.objid) = new_objid(NULL, (yyvsp[(1) - (1)].constant));
|
---|
2457 | }
|
---|
2458 | break;
|
---|
2459 |
|
---|
2460 | case 129:
|
---|
2461 | #line 866 "heimdal/lib/asn1/asn1parse.y"
|
---|
2462 | {
|
---|
2463 | Symbol *s = addsym((yyvsp[(1) - (1)].name));
|
---|
2464 | if(s->stype != SValue)
|
---|
2465 | error_message ("%s is not a value\n",
|
---|
2466 | s->name);
|
---|
2467 | else
|
---|
2468 | (yyval.value) = s->value;
|
---|
2469 | }
|
---|
2470 | break;
|
---|
2471 |
|
---|
2472 | case 130:
|
---|
2473 | #line 877 "heimdal/lib/asn1/asn1parse.y"
|
---|
2474 | {
|
---|
2475 | (yyval.value) = emalloc(sizeof(*(yyval.value)));
|
---|
2476 | (yyval.value)->type = stringvalue;
|
---|
2477 | (yyval.value)->u.stringvalue = (yyvsp[(1) - (1)].name);
|
---|
2478 | }
|
---|
2479 | break;
|
---|
2480 |
|
---|
2481 | case 131:
|
---|
2482 | #line 885 "heimdal/lib/asn1/asn1parse.y"
|
---|
2483 | {
|
---|
2484 | (yyval.value) = emalloc(sizeof(*(yyval.value)));
|
---|
2485 | (yyval.value)->type = booleanvalue;
|
---|
2486 | (yyval.value)->u.booleanvalue = 0;
|
---|
2487 | }
|
---|
2488 | break;
|
---|
2489 |
|
---|
2490 | case 132:
|
---|
2491 | #line 891 "heimdal/lib/asn1/asn1parse.y"
|
---|
2492 | {
|
---|
2493 | (yyval.value) = emalloc(sizeof(*(yyval.value)));
|
---|
2494 | (yyval.value)->type = booleanvalue;
|
---|
2495 | (yyval.value)->u.booleanvalue = 0;
|
---|
2496 | }
|
---|
2497 | break;
|
---|
2498 |
|
---|
2499 | case 133:
|
---|
2500 | #line 899 "heimdal/lib/asn1/asn1parse.y"
|
---|
2501 | {
|
---|
2502 | (yyval.value) = emalloc(sizeof(*(yyval.value)));
|
---|
2503 | (yyval.value)->type = integervalue;
|
---|
2504 | (yyval.value)->u.integervalue = (yyvsp[(1) - (1)].constant);
|
---|
2505 | }
|
---|
2506 | break;
|
---|
2507 |
|
---|
2508 | case 135:
|
---|
2509 | #line 910 "heimdal/lib/asn1/asn1parse.y"
|
---|
2510 | {
|
---|
2511 | }
|
---|
2512 | break;
|
---|
2513 |
|
---|
2514 | case 136:
|
---|
2515 | #line 915 "heimdal/lib/asn1/asn1parse.y"
|
---|
2516 | {
|
---|
2517 | (yyval.value) = emalloc(sizeof(*(yyval.value)));
|
---|
2518 | (yyval.value)->type = objectidentifiervalue;
|
---|
2519 | (yyval.value)->u.objectidentifiervalue = (yyvsp[(1) - (1)].objid);
|
---|
2520 | }
|
---|
2521 | break;
|
---|
2522 |
|
---|
2523 |
|
---|
2524 | /* Line 1267 of yacc.c. */
|
---|
2525 | #line 2523 "heimdal/lib/asn1/asn1parse.y"
|
---|
2526 | default: break;
|
---|
2527 | }
|
---|
2528 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
---|
2529 |
|
---|
2530 | YYPOPSTACK (yylen);
|
---|
2531 | yylen = 0;
|
---|
2532 | YY_STACK_PRINT (yyss, yyssp);
|
---|
2533 |
|
---|
2534 | *++yyvsp = yyval;
|
---|
2535 |
|
---|
2536 |
|
---|
2537 | /* Now `shift' the result of the reduction. Determine what state
|
---|
2538 | that goes to, based on the state we popped back to and the rule
|
---|
2539 | number reduced by. */
|
---|
2540 |
|
---|
2541 | yyn = yyr1[yyn];
|
---|
2542 |
|
---|
2543 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
|
---|
2544 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
|
---|
2545 | yystate = yytable[yystate];
|
---|
2546 | else
|
---|
2547 | yystate = yydefgoto[yyn - YYNTOKENS];
|
---|
2548 |
|
---|
2549 | goto yynewstate;
|
---|
2550 |
|
---|
2551 |
|
---|
2552 | /*------------------------------------.
|
---|
2553 | | yyerrlab -- here on detecting error |
|
---|
2554 | `------------------------------------*/
|
---|
2555 | yyerrlab:
|
---|
2556 | /* If not already recovering from an error, report this error. */
|
---|
2557 | if (!yyerrstatus)
|
---|
2558 | {
|
---|
2559 | ++yynerrs;
|
---|
2560 | #if ! YYERROR_VERBOSE
|
---|
2561 | yyerror (YY_("syntax error"));
|
---|
2562 | #else
|
---|
2563 | {
|
---|
2564 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
---|
2565 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
---|
2566 | {
|
---|
2567 | YYSIZE_T yyalloc = 2 * yysize;
|
---|
2568 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
---|
2569 | yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
---|
2570 | if (yymsg != yymsgbuf)
|
---|
2571 | YYSTACK_FREE (yymsg);
|
---|
2572 | yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
---|
2573 | if (yymsg)
|
---|
2574 | yymsg_alloc = yyalloc;
|
---|
2575 | else
|
---|
2576 | {
|
---|
2577 | yymsg = yymsgbuf;
|
---|
2578 | yymsg_alloc = sizeof yymsgbuf;
|
---|
2579 | }
|
---|
2580 | }
|
---|
2581 |
|
---|
2582 | if (0 < yysize && yysize <= yymsg_alloc)
|
---|
2583 | {
|
---|
2584 | (void) yysyntax_error (yymsg, yystate, yychar);
|
---|
2585 | yyerror (yymsg);
|
---|
2586 | }
|
---|
2587 | else
|
---|
2588 | {
|
---|
2589 | yyerror (YY_("syntax error"));
|
---|
2590 | if (yysize != 0)
|
---|
2591 | goto yyexhaustedlab;
|
---|
2592 | }
|
---|
2593 | }
|
---|
2594 | #endif
|
---|
2595 | }
|
---|
2596 |
|
---|
2597 |
|
---|
2598 |
|
---|
2599 | if (yyerrstatus == 3)
|
---|
2600 | {
|
---|
2601 | /* If just tried and failed to reuse look-ahead token after an
|
---|
2602 | error, discard it. */
|
---|
2603 |
|
---|
2604 | if (yychar <= YYEOF)
|
---|
2605 | {
|
---|
2606 | /* Return failure if at end of input. */
|
---|
2607 | if (yychar == YYEOF)
|
---|
2608 | YYABORT;
|
---|
2609 | }
|
---|
2610 | else
|
---|
2611 | {
|
---|
2612 | yydestruct ("Error: discarding",
|
---|
2613 | yytoken, &yylval);
|
---|
2614 | yychar = YYEMPTY;
|
---|
2615 | }
|
---|
2616 | }
|
---|
2617 |
|
---|
2618 | /* Else will try to reuse look-ahead token after shifting the error
|
---|
2619 | token. */
|
---|
2620 | goto yyerrlab1;
|
---|
2621 |
|
---|
2622 |
|
---|
2623 | /*---------------------------------------------------.
|
---|
2624 | | yyerrorlab -- error raised explicitly by YYERROR. |
|
---|
2625 | `---------------------------------------------------*/
|
---|
2626 | yyerrorlab:
|
---|
2627 |
|
---|
2628 | /* Pacify compilers like GCC when the user code never invokes
|
---|
2629 | YYERROR and the label yyerrorlab therefore never appears in user
|
---|
2630 | code. */
|
---|
2631 | if (/*CONSTCOND*/ 0)
|
---|
2632 | goto yyerrorlab;
|
---|
2633 |
|
---|
2634 | /* Do not reclaim the symbols of the rule which action triggered
|
---|
2635 | this YYERROR. */
|
---|
2636 | YYPOPSTACK (yylen);
|
---|
2637 | yylen = 0;
|
---|
2638 | YY_STACK_PRINT (yyss, yyssp);
|
---|
2639 | yystate = *yyssp;
|
---|
2640 | goto yyerrlab1;
|
---|
2641 |
|
---|
2642 |
|
---|
2643 | /*-------------------------------------------------------------.
|
---|
2644 | | yyerrlab1 -- common code for both syntax error and YYERROR. |
|
---|
2645 | `-------------------------------------------------------------*/
|
---|
2646 | yyerrlab1:
|
---|
2647 | yyerrstatus = 3; /* Each real token shifted decrements this. */
|
---|
2648 |
|
---|
2649 | for (;;)
|
---|
2650 | {
|
---|
2651 | yyn = yypact[yystate];
|
---|
2652 | if (yyn != YYPACT_NINF)
|
---|
2653 | {
|
---|
2654 | yyn += YYTERROR;
|
---|
2655 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
|
---|
2656 | {
|
---|
2657 | yyn = yytable[yyn];
|
---|
2658 | if (0 < yyn)
|
---|
2659 | break;
|
---|
2660 | }
|
---|
2661 | }
|
---|
2662 |
|
---|
2663 | /* Pop the current state because it cannot handle the error token. */
|
---|
2664 | if (yyssp == yyss)
|
---|
2665 | YYABORT;
|
---|
2666 |
|
---|
2667 |
|
---|
2668 | yydestruct ("Error: popping",
|
---|
2669 | yystos[yystate], yyvsp);
|
---|
2670 | YYPOPSTACK (1);
|
---|
2671 | yystate = *yyssp;
|
---|
2672 | YY_STACK_PRINT (yyss, yyssp);
|
---|
2673 | }
|
---|
2674 |
|
---|
2675 | if (yyn == YYFINAL)
|
---|
2676 | YYACCEPT;
|
---|
2677 |
|
---|
2678 | *++yyvsp = yylval;
|
---|
2679 |
|
---|
2680 |
|
---|
2681 | /* Shift the error token. */
|
---|
2682 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
|
---|
2683 |
|
---|
2684 | yystate = yyn;
|
---|
2685 | goto yynewstate;
|
---|
2686 |
|
---|
2687 |
|
---|
2688 | /*-------------------------------------.
|
---|
2689 | | yyacceptlab -- YYACCEPT comes here. |
|
---|
2690 | `-------------------------------------*/
|
---|
2691 | yyacceptlab:
|
---|
2692 | yyresult = 0;
|
---|
2693 | goto yyreturn;
|
---|
2694 |
|
---|
2695 | /*-----------------------------------.
|
---|
2696 | | yyabortlab -- YYABORT comes here. |
|
---|
2697 | `-----------------------------------*/
|
---|
2698 | yyabortlab:
|
---|
2699 | yyresult = 1;
|
---|
2700 | goto yyreturn;
|
---|
2701 |
|
---|
2702 | #ifndef yyoverflow
|
---|
2703 | /*-------------------------------------------------.
|
---|
2704 | | yyexhaustedlab -- memory exhaustion comes here. |
|
---|
2705 | `-------------------------------------------------*/
|
---|
2706 | yyexhaustedlab:
|
---|
2707 | yyerror (YY_("memory exhausted"));
|
---|
2708 | yyresult = 2;
|
---|
2709 | /* Fall through. */
|
---|
2710 | #endif
|
---|
2711 |
|
---|
2712 | yyreturn:
|
---|
2713 | if (yychar != YYEOF && yychar != YYEMPTY)
|
---|
2714 | yydestruct ("Cleanup: discarding lookahead",
|
---|
2715 | yytoken, &yylval);
|
---|
2716 | /* Do not reclaim the symbols of the rule which action triggered
|
---|
2717 | this YYABORT or YYACCEPT. */
|
---|
2718 | YYPOPSTACK (yylen);
|
---|
2719 | YY_STACK_PRINT (yyss, yyssp);
|
---|
2720 | while (yyssp != yyss)
|
---|
2721 | {
|
---|
2722 | yydestruct ("Cleanup: popping",
|
---|
2723 | yystos[*yyssp], yyvsp);
|
---|
2724 | YYPOPSTACK (1);
|
---|
2725 | }
|
---|
2726 | #ifndef yyoverflow
|
---|
2727 | if (yyss != yyssa)
|
---|
2728 | YYSTACK_FREE (yyss);
|
---|
2729 | #endif
|
---|
2730 | #if YYERROR_VERBOSE
|
---|
2731 | if (yymsg != yymsgbuf)
|
---|
2732 | YYSTACK_FREE (yymsg);
|
---|
2733 | #endif
|
---|
2734 | /* Make sure YYID is used. */
|
---|
2735 | return YYID (yyresult);
|
---|
2736 | }
|
---|
2737 |
|
---|
2738 |
|
---|
2739 | #line 922 "heimdal/lib/asn1/asn1parse.y"
|
---|
2740 |
|
---|
2741 |
|
---|
2742 | void
|
---|
2743 | yyerror (const char *s)
|
---|
2744 | {
|
---|
2745 | error_message ("%s\n", s);
|
---|
2746 | }
|
---|
2747 |
|
---|
2748 | static Type *
|
---|
2749 | new_tag(int tagclass, int tagvalue, int tagenv, Type *oldtype)
|
---|
2750 | {
|
---|
2751 | Type *t;
|
---|
2752 | if(oldtype->type == TTag && oldtype->tag.tagenv == TE_IMPLICIT) {
|
---|
2753 | t = oldtype;
|
---|
2754 | oldtype = oldtype->subtype; /* XXX */
|
---|
2755 | } else
|
---|
2756 | t = new_type (TTag);
|
---|
2757 |
|
---|
2758 | t->tag.tagclass = tagclass;
|
---|
2759 | t->tag.tagvalue = tagvalue;
|
---|
2760 | t->tag.tagenv = tagenv;
|
---|
2761 | t->subtype = oldtype;
|
---|
2762 | return t;
|
---|
2763 | }
|
---|
2764 |
|
---|
2765 | static struct objid *
|
---|
2766 | new_objid(const char *label, int value)
|
---|
2767 | {
|
---|
2768 | struct objid *s;
|
---|
2769 | s = emalloc(sizeof(*s));
|
---|
2770 | s->label = label;
|
---|
2771 | s->value = value;
|
---|
2772 | s->next = NULL;
|
---|
2773 | return s;
|
---|
2774 | }
|
---|
2775 |
|
---|
2776 | static void
|
---|
2777 | add_oid_to_tail(struct objid *head, struct objid *tail)
|
---|
2778 | {
|
---|
2779 | struct objid *o;
|
---|
2780 | o = head;
|
---|
2781 | while (o->next)
|
---|
2782 | o = o->next;
|
---|
2783 | o->next = tail;
|
---|
2784 | }
|
---|
2785 |
|
---|
2786 | static Type *
|
---|
2787 | new_type (Typetype tt)
|
---|
2788 | {
|
---|
2789 | Type *t = ecalloc(1, sizeof(*t));
|
---|
2790 | t->type = tt;
|
---|
2791 | return t;
|
---|
2792 | }
|
---|
2793 |
|
---|
2794 | static struct constraint_spec *
|
---|
2795 | new_constraint_spec(enum ctype ct)
|
---|
2796 | {
|
---|
2797 | struct constraint_spec *c = ecalloc(1, sizeof(*c));
|
---|
2798 | c->ctype = ct;
|
---|
2799 | return c;
|
---|
2800 | }
|
---|
2801 |
|
---|
2802 | static void fix_labels2(Type *t, const char *prefix);
|
---|
2803 | static void fix_labels1(struct memhead *members, const char *prefix)
|
---|
2804 | {
|
---|
2805 | Member *m;
|
---|
2806 |
|
---|
2807 | if(members == NULL)
|
---|
2808 | return;
|
---|
2809 | ASN1_TAILQ_FOREACH(m, members, members) {
|
---|
2810 | asprintf(&m->label, "%s_%s", prefix, m->gen_name);
|
---|
2811 | if (m->label == NULL)
|
---|
2812 | errx(1, "malloc");
|
---|
2813 | if(m->type != NULL)
|
---|
2814 | fix_labels2(m->type, m->label);
|
---|
2815 | }
|
---|
2816 | }
|
---|
2817 |
|
---|
2818 | static void fix_labels2(Type *t, const char *prefix)
|
---|
2819 | {
|
---|
2820 | for(; t; t = t->subtype)
|
---|
2821 | fix_labels1(t->members, prefix);
|
---|
2822 | }
|
---|
2823 |
|
---|
2824 | static void
|
---|
2825 | fix_labels(Symbol *s)
|
---|
2826 | {
|
---|
2827 | char *p;
|
---|
2828 | asprintf(&p, "choice_%s", s->gen_name);
|
---|
2829 | if (p == NULL)
|
---|
2830 | errx(1, "malloc");
|
---|
2831 | fix_labels2(s->type, p);
|
---|
2832 | free(p);
|
---|
2833 | }
|
---|
2834 |
|
---|