xref: /netbsd-src/external/gpl3/binutils.old/dist/binutils/mcparse.c (revision e992f068c547fd6e84b3f104dc2340adcc955732)
1 /* A Bison parser, made by GNU Bison 3.8.2.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6    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 3 of the License, or
11    (at your option) 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, see <https://www.gnu.org/licenses/>.  */
20 
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30 
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35    simplifying the original so-called "semantic" parser.  */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38    especially those whose name start with YY_ or yy_.  They are
39    private implementation details that can be changed or removed.  */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42    infringing on user name space.  This should be done even for local
43    variables, as they might otherwise be expanded by user macros.
44    There are some unavoidable exceptions within include files to
45    define necessary library symbols; they are noted "INFRINGES ON
46    USER NAME SPACE" below.  */
47 
48 /* Identify Bison output, and Bison version.  */
49 #define YYBISON 30802
50 
51 /* Bison version string.  */
52 #define YYBISON_VERSION "3.8.2"
53 
54 /* Skeleton name.  */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers.  */
58 #define YYPURE 0
59 
60 /* Push parsers.  */
61 #define YYPUSH 0
62 
63 /* Pull parsers.  */
64 #define YYPULL 1
65 
66 
67 
68 
69 /* First part of user prologue.  */
70 #line 1 "mcparse.y"
71  /* mcparse.y -- parser for Windows mc files
72   Copyright (C) 2007-2022 Free Software Foundation, Inc.
73 
74   Parser for Windows mc files
75   Written by Kai Tietz, Onevision.
76 
77   This file is part of GNU Binutils.
78 
79   This program is free software; you can redistribute it and/or modify
80   it under the terms of the GNU General Public License as published by
81   the Free Software Foundation; either version 3 of the License, or
82   (at your option) any later version.
83 
84   This program is distributed in the hope that it will be useful,
85   but WITHOUT ANY WARRANTY; without even the implied warranty of
86   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
87   GNU General Public License for more details.
88 
89   You should have received a copy of the GNU General Public License
90   along with this program; if not, write to the Free Software
91   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
92   02110-1301, USA.  */
93 
94 /* This is a parser for Windows rc files.  It is based on the parser
95    by Gunther Ebert <gunther.ebert@ixos-leipzig.de>.  */
96 
97 #include "sysdep.h"
98 #include "bfd.h"
99 #include "bucomm.h"
100 #include "libiberty.h"
101 #include "windmc.h"
102 #include "safe-ctype.h"
103 
104 static rc_uint_type mc_last_id = 0;
105 static rc_uint_type mc_sefa_val = 0;
106 static unichar *mc_last_symbol = NULL;
107 static const mc_keyword *mc_cur_severity = NULL;
108 static const mc_keyword *mc_cur_facility = NULL;
109 static mc_node *cur_node = NULL;
110 
111 
112 #line 113 "mcparse.c"
113 
114 # ifndef YY_CAST
115 #  ifdef __cplusplus
116 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
117 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
118 #  else
119 #   define YY_CAST(Type, Val) ((Type) (Val))
120 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
121 #  endif
122 # endif
123 # ifndef YY_NULLPTR
124 #  if defined __cplusplus
125 #   if 201103L <= __cplusplus
126 #    define YY_NULLPTR nullptr
127 #   else
128 #    define YY_NULLPTR 0
129 #   endif
130 #  else
131 #   define YY_NULLPTR ((void*)0)
132 #  endif
133 # endif
134 
135 /* Use api.header.include to #include this header
136    instead of duplicating it here.  */
137 #ifndef YY_YY_MCPARSE_H_INCLUDED
138 # define YY_YY_MCPARSE_H_INCLUDED
139 /* Debug traces.  */
140 #ifndef YYDEBUG
141 # define YYDEBUG 0
142 #endif
143 #if YYDEBUG
144 extern int yydebug;
145 #endif
146 
147 /* Token kinds.  */
148 #ifndef YYTOKENTYPE
149 # define YYTOKENTYPE
150   enum yytokentype
151   {
152     YYEMPTY = -2,
153     YYEOF = 0,                     /* "end of file"  */
154     YYerror = 256,                 /* error  */
155     YYUNDEF = 257,                 /* "invalid token"  */
156     NL = 258,                      /* NL  */
157     MCIDENT = 259,                 /* MCIDENT  */
158     MCFILENAME = 260,              /* MCFILENAME  */
159     MCLINE = 261,                  /* MCLINE  */
160     MCCOMMENT = 262,               /* MCCOMMENT  */
161     MCTOKEN = 263,                 /* MCTOKEN  */
162     MCENDLINE = 264,               /* MCENDLINE  */
163     MCLANGUAGENAMES = 265,         /* MCLANGUAGENAMES  */
164     MCFACILITYNAMES = 266,         /* MCFACILITYNAMES  */
165     MCSEVERITYNAMES = 267,         /* MCSEVERITYNAMES  */
166     MCOUTPUTBASE = 268,            /* MCOUTPUTBASE  */
167     MCMESSAGEIDTYPEDEF = 269,      /* MCMESSAGEIDTYPEDEF  */
168     MCLANGUAGE = 270,              /* MCLANGUAGE  */
169     MCMESSAGEID = 271,             /* MCMESSAGEID  */
170     MCSEVERITY = 272,              /* MCSEVERITY  */
171     MCFACILITY = 273,              /* MCFACILITY  */
172     MCSYMBOLICNAME = 274,          /* MCSYMBOLICNAME  */
173     MCNUMBER = 275                 /* MCNUMBER  */
174   };
175   typedef enum yytokentype yytoken_kind_t;
176 #endif
177 /* Token kinds.  */
178 #define YYEMPTY -2
179 #define YYEOF 0
180 #define YYerror 256
181 #define YYUNDEF 257
182 #define NL 258
183 #define MCIDENT 259
184 #define MCFILENAME 260
185 #define MCLINE 261
186 #define MCCOMMENT 262
187 #define MCTOKEN 263
188 #define MCENDLINE 264
189 #define MCLANGUAGENAMES 265
190 #define MCFACILITYNAMES 266
191 #define MCSEVERITYNAMES 267
192 #define MCOUTPUTBASE 268
193 #define MCMESSAGEIDTYPEDEF 269
194 #define MCLANGUAGE 270
195 #define MCMESSAGEID 271
196 #define MCSEVERITY 272
197 #define MCFACILITY 273
198 #define MCSYMBOLICNAME 274
199 #define MCNUMBER 275
200 
201 /* Value type.  */
202 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
203 union YYSTYPE
204 {
205 #line 44 "mcparse.y"
206 
207   rc_uint_type ival;
208   unichar *ustr;
209   const mc_keyword *tok;
210   mc_node *nod;
211 
212 #line 213 "mcparse.c"
213 
214 };
215 typedef union YYSTYPE YYSTYPE;
216 # define YYSTYPE_IS_TRIVIAL 1
217 # define YYSTYPE_IS_DECLARED 1
218 #endif
219 
220 
221 extern YYSTYPE yylval;
222 
223 
224 int yyparse (void);
225 
226 
227 #endif /* !YY_YY_MCPARSE_H_INCLUDED  */
228 /* Symbol kind.  */
229 enum yysymbol_kind_t
230 {
231   YYSYMBOL_YYEMPTY = -2,
232   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
233   YYSYMBOL_YYerror = 1,                    /* error  */
234   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
235   YYSYMBOL_NL = 3,                         /* NL  */
236   YYSYMBOL_MCIDENT = 4,                    /* MCIDENT  */
237   YYSYMBOL_MCFILENAME = 5,                 /* MCFILENAME  */
238   YYSYMBOL_MCLINE = 6,                     /* MCLINE  */
239   YYSYMBOL_MCCOMMENT = 7,                  /* MCCOMMENT  */
240   YYSYMBOL_MCTOKEN = 8,                    /* MCTOKEN  */
241   YYSYMBOL_MCENDLINE = 9,                  /* MCENDLINE  */
242   YYSYMBOL_MCLANGUAGENAMES = 10,           /* MCLANGUAGENAMES  */
243   YYSYMBOL_MCFACILITYNAMES = 11,           /* MCFACILITYNAMES  */
244   YYSYMBOL_MCSEVERITYNAMES = 12,           /* MCSEVERITYNAMES  */
245   YYSYMBOL_MCOUTPUTBASE = 13,              /* MCOUTPUTBASE  */
246   YYSYMBOL_MCMESSAGEIDTYPEDEF = 14,        /* MCMESSAGEIDTYPEDEF  */
247   YYSYMBOL_MCLANGUAGE = 15,                /* MCLANGUAGE  */
248   YYSYMBOL_MCMESSAGEID = 16,               /* MCMESSAGEID  */
249   YYSYMBOL_MCSEVERITY = 17,                /* MCSEVERITY  */
250   YYSYMBOL_MCFACILITY = 18,                /* MCFACILITY  */
251   YYSYMBOL_MCSYMBOLICNAME = 19,            /* MCSYMBOLICNAME  */
252   YYSYMBOL_MCNUMBER = 20,                  /* MCNUMBER  */
253   YYSYMBOL_21_ = 21,                       /* '='  */
254   YYSYMBOL_22_ = 22,                       /* '('  */
255   YYSYMBOL_23_ = 23,                       /* ')'  */
256   YYSYMBOL_24_ = 24,                       /* ':'  */
257   YYSYMBOL_25_ = 25,                       /* '+'  */
258   YYSYMBOL_YYACCEPT = 26,                  /* $accept  */
259   YYSYMBOL_input = 27,                     /* input  */
260   YYSYMBOL_entities = 28,                  /* entities  */
261   YYSYMBOL_entity = 29,                    /* entity  */
262   YYSYMBOL_global_section = 30,            /* global_section  */
263   YYSYMBOL_severitymaps = 31,              /* severitymaps  */
264   YYSYMBOL_severitymap = 32,               /* severitymap  */
265   YYSYMBOL_facilitymaps = 33,              /* facilitymaps  */
266   YYSYMBOL_facilitymap = 34,               /* facilitymap  */
267   YYSYMBOL_langmaps = 35,                  /* langmaps  */
268   YYSYMBOL_langmap = 36,                   /* langmap  */
269   YYSYMBOL_alias_name = 37,                /* alias_name  */
270   YYSYMBOL_message = 38,                   /* message  */
271   YYSYMBOL_39_1 = 39,                      /* $@1  */
272   YYSYMBOL_id = 40,                        /* id  */
273   YYSYMBOL_vid = 41,                       /* vid  */
274   YYSYMBOL_sefasy_def = 42,                /* sefasy_def  */
275   YYSYMBOL_severity = 43,                  /* severity  */
276   YYSYMBOL_facility = 44,                  /* facility  */
277   YYSYMBOL_symbol = 45,                    /* symbol  */
278   YYSYMBOL_lang_entities = 46,             /* lang_entities  */
279   YYSYMBOL_lang_entity = 47,               /* lang_entity  */
280   YYSYMBOL_lines = 48,                     /* lines  */
281   YYSYMBOL_comments = 49,                  /* comments  */
282   YYSYMBOL_lang = 50,                      /* lang  */
283   YYSYMBOL_token = 51,                     /* token  */
284   YYSYMBOL_lex_want_nl = 52,               /* lex_want_nl  */
285   YYSYMBOL_lex_want_line = 53,             /* lex_want_line  */
286   YYSYMBOL_lex_want_filename = 54          /* lex_want_filename  */
287 };
288 typedef enum yysymbol_kind_t yysymbol_kind_t;
289 
290 
291 
292 
293 #ifdef short
294 # undef short
295 #endif
296 
297 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
298    <limits.h> and (if available) <stdint.h> are included
299    so that the code can choose integer types of a good width.  */
300 
301 #ifndef __PTRDIFF_MAX__
302 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
303 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
304 #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
305 #  define YY_STDINT_H
306 # endif
307 #endif
308 
309 /* Narrow types that promote to a signed type and that can represent a
310    signed or unsigned integer of at least N bits.  In tables they can
311    save space and decrease cache pressure.  Promoting to a signed type
312    helps avoid bugs in integer arithmetic.  */
313 
314 #ifdef __INT_LEAST8_MAX__
315 typedef __INT_LEAST8_TYPE__ yytype_int8;
316 #elif defined YY_STDINT_H
317 typedef int_least8_t yytype_int8;
318 #else
319 typedef signed char yytype_int8;
320 #endif
321 
322 #ifdef __INT_LEAST16_MAX__
323 typedef __INT_LEAST16_TYPE__ yytype_int16;
324 #elif defined YY_STDINT_H
325 typedef int_least16_t yytype_int16;
326 #else
327 typedef short yytype_int16;
328 #endif
329 
330 /* Work around bug in HP-UX 11.23, which defines these macros
331    incorrectly for preprocessor constants.  This workaround can likely
332    be removed in 2023, as HPE has promised support for HP-UX 11.23
333    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
334    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
335 #ifdef __hpux
336 # undef UINT_LEAST8_MAX
337 # undef UINT_LEAST16_MAX
338 # define UINT_LEAST8_MAX 255
339 # define UINT_LEAST16_MAX 65535
340 #endif
341 
342 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
343 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
344 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
345        && UINT_LEAST8_MAX <= INT_MAX)
346 typedef uint_least8_t yytype_uint8;
347 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
348 typedef unsigned char yytype_uint8;
349 #else
350 typedef short yytype_uint8;
351 #endif
352 
353 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
354 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
355 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
356        && UINT_LEAST16_MAX <= INT_MAX)
357 typedef uint_least16_t yytype_uint16;
358 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
359 typedef unsigned short yytype_uint16;
360 #else
361 typedef int yytype_uint16;
362 #endif
363 
364 #ifndef YYPTRDIFF_T
365 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
366 #  define YYPTRDIFF_T __PTRDIFF_TYPE__
367 #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
368 # elif defined PTRDIFF_MAX
369 #  ifndef ptrdiff_t
370 #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
371 #  endif
372 #  define YYPTRDIFF_T ptrdiff_t
373 #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
374 # else
375 #  define YYPTRDIFF_T long
376 #  define YYPTRDIFF_MAXIMUM LONG_MAX
377 # endif
378 #endif
379 
380 #ifndef YYSIZE_T
381 # ifdef __SIZE_TYPE__
382 #  define YYSIZE_T __SIZE_TYPE__
383 # elif defined size_t
384 #  define YYSIZE_T size_t
385 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
386 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
387 #  define YYSIZE_T size_t
388 # else
389 #  define YYSIZE_T unsigned
390 # endif
391 #endif
392 
393 #define YYSIZE_MAXIMUM                                  \
394   YY_CAST (YYPTRDIFF_T,                                 \
395            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
396             ? YYPTRDIFF_MAXIMUM                         \
397             : YY_CAST (YYSIZE_T, -1)))
398 
399 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
400 
401 
402 /* Stored state numbers (used for stacks). */
403 typedef yytype_int8 yy_state_t;
404 
405 /* State numbers in computations.  */
406 typedef int yy_state_fast_t;
407 
408 #ifndef YY_
409 # if defined YYENABLE_NLS && YYENABLE_NLS
410 #  if ENABLE_NLS
411 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
412 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
413 #  endif
414 # endif
415 # ifndef YY_
416 #  define YY_(Msgid) Msgid
417 # endif
418 #endif
419 
420 
421 #ifndef YY_ATTRIBUTE_PURE
422 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
423 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
424 # else
425 #  define YY_ATTRIBUTE_PURE
426 # endif
427 #endif
428 
429 #ifndef YY_ATTRIBUTE_UNUSED
430 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
431 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
432 # else
433 #  define YY_ATTRIBUTE_UNUSED
434 # endif
435 #endif
436 
437 /* Suppress unused-variable warnings by "using" E.  */
438 #if ! defined lint || defined __GNUC__
439 # define YY_USE(E) ((void) (E))
440 #else
441 # define YY_USE(E) /* empty */
442 #endif
443 
444 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
445 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
446 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
447 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
448     _Pragma ("GCC diagnostic push")                                     \
449     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
450 # else
451 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
452     _Pragma ("GCC diagnostic push")                                     \
453     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
454     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
455 # endif
456 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
457     _Pragma ("GCC diagnostic pop")
458 #else
459 # define YY_INITIAL_VALUE(Value) Value
460 #endif
461 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
462 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
463 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
464 #endif
465 #ifndef YY_INITIAL_VALUE
466 # define YY_INITIAL_VALUE(Value) /* Nothing. */
467 #endif
468 
469 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
470 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
471     _Pragma ("GCC diagnostic push")                            \
472     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
473 # define YY_IGNORE_USELESS_CAST_END            \
474     _Pragma ("GCC diagnostic pop")
475 #endif
476 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
477 # define YY_IGNORE_USELESS_CAST_BEGIN
478 # define YY_IGNORE_USELESS_CAST_END
479 #endif
480 
481 
482 #define YY_ASSERT(E) ((void) (0 && (E)))
483 
484 #if !defined yyoverflow
485 
486 /* The parser invokes alloca or malloc; define the necessary symbols.  */
487 
488 # ifdef YYSTACK_USE_ALLOCA
489 #  if YYSTACK_USE_ALLOCA
490 #   ifdef __GNUC__
491 #    define YYSTACK_ALLOC __builtin_alloca
492 #   elif defined __BUILTIN_VA_ARG_INCR
493 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
494 #   elif defined _AIX
495 #    define YYSTACK_ALLOC __alloca
496 #   elif defined _MSC_VER
497 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
498 #    define alloca _alloca
499 #   else
500 #    define YYSTACK_ALLOC alloca
501 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
502 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
503       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
504 #     ifndef EXIT_SUCCESS
505 #      define EXIT_SUCCESS 0
506 #     endif
507 #    endif
508 #   endif
509 #  endif
510 # endif
511 
512 # ifdef YYSTACK_ALLOC
513    /* Pacify GCC's 'empty if-body' warning.  */
514 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
515 #  ifndef YYSTACK_ALLOC_MAXIMUM
516     /* The OS might guarantee only one guard page at the bottom of the stack,
517        and a page size can be as small as 4096 bytes.  So we cannot safely
518        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
519        to allow for a few compiler-allocated temporary stack slots.  */
520 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
521 #  endif
522 # else
523 #  define YYSTACK_ALLOC YYMALLOC
524 #  define YYSTACK_FREE YYFREE
525 #  ifndef YYSTACK_ALLOC_MAXIMUM
526 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
527 #  endif
528 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
529        && ! ((defined YYMALLOC || defined malloc) \
530              && (defined YYFREE || defined free)))
531 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
532 #   ifndef EXIT_SUCCESS
533 #    define EXIT_SUCCESS 0
534 #   endif
535 #  endif
536 #  ifndef YYMALLOC
537 #   define YYMALLOC malloc
538 #   if ! defined malloc && ! defined EXIT_SUCCESS
539 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
540 #   endif
541 #  endif
542 #  ifndef YYFREE
543 #   define YYFREE free
544 #   if ! defined free && ! defined EXIT_SUCCESS
545 void free (void *); /* INFRINGES ON USER NAME SPACE */
546 #   endif
547 #  endif
548 # endif
549 #endif /* !defined yyoverflow */
550 
551 #if (! defined yyoverflow \
552      && (! defined __cplusplus \
553          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
554 
555 /* A type that is properly aligned for any stack member.  */
556 union yyalloc
557 {
558   yy_state_t yyss_alloc;
559   YYSTYPE yyvs_alloc;
560 };
561 
562 /* The size of the maximum gap between one aligned stack and the next.  */
563 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
564 
565 /* The size of an array large to enough to hold all stacks, each with
566    N elements.  */
567 # define YYSTACK_BYTES(N) \
568      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
569       + YYSTACK_GAP_MAXIMUM)
570 
571 # define YYCOPY_NEEDED 1
572 
573 /* Relocate STACK from its old location to the new one.  The
574    local variables YYSIZE and YYSTACKSIZE give the old and new number of
575    elements in the stack, and YYPTR gives the new location of the
576    stack.  Advance YYPTR to a properly aligned location for the next
577    stack.  */
578 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
579     do                                                                  \
580       {                                                                 \
581         YYPTRDIFF_T yynewbytes;                                         \
582         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
583         Stack = &yyptr->Stack_alloc;                                    \
584         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
585         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
586       }                                                                 \
587     while (0)
588 
589 #endif
590 
591 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
592 /* Copy COUNT objects from SRC to DST.  The source and destination do
593    not overlap.  */
594 # ifndef YYCOPY
595 #  if defined __GNUC__ && 1 < __GNUC__
596 #   define YYCOPY(Dst, Src, Count) \
597       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
598 #  else
599 #   define YYCOPY(Dst, Src, Count)              \
600       do                                        \
601         {                                       \
602           YYPTRDIFF_T yyi;                      \
603           for (yyi = 0; yyi < (Count); yyi++)   \
604             (Dst)[yyi] = (Src)[yyi];            \
605         }                                       \
606       while (0)
607 #  endif
608 # endif
609 #endif /* !YYCOPY_NEEDED */
610 
611 /* YYFINAL -- State number of the termination state.  */
612 #define YYFINAL  3
613 /* YYLAST -- Last index in YYTABLE.  */
614 #define YYLAST   114
615 
616 /* YYNTOKENS -- Number of terminals.  */
617 #define YYNTOKENS  26
618 /* YYNNTS -- Number of nonterminals.  */
619 #define YYNNTS  29
620 /* YYNRULES -- Number of rules.  */
621 #define YYNRULES  82
622 /* YYNSTATES -- Number of states.  */
623 #define YYNSTATES  125
624 
625 /* YYMAXUTOK -- Last valid token kind.  */
626 #define YYMAXUTOK   275
627 
628 
629 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
630    as returned by yylex, with out-of-bounds checking.  */
631 #define YYTRANSLATE(YYX)                                \
632   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
633    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
634    : YYSYMBOL_YYUNDEF)
635 
636 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
637    as returned by yylex.  */
638 static const yytype_int8 yytranslate[] =
639 {
640        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
641        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
642        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
643        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
644       22,    23,     2,    25,     2,     2,     2,     2,     2,     2,
645        2,     2,     2,     2,     2,     2,     2,     2,    24,     2,
646        2,    21,     2,     2,     2,     2,     2,     2,     2,     2,
647        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
648        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
649        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
650        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
651        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
652        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
653        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
654        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
655        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
656        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
657        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
658        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
659        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
660        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
661        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
662        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
663        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
664        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
665        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
666        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
667       15,    16,    17,    18,    19,    20
668 };
669 
670 #if YYDEBUG
671 /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
672 static const yytype_int16 yyrline[] =
673 {
674        0,    66,    66,    69,    71,    73,    74,    75,    80,    84,
675       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
676       95,    96,   102,   106,   110,   117,   118,   119,   123,   127,
677      128,   132,   133,   134,   138,   142,   143,   147,   148,   149,
678      153,   157,   158,   159,   160,   165,   168,   172,   177,   176,
679      190,   191,   192,   196,   199,   203,   207,   212,   219,   225,
680      231,   239,   247,   255,   262,   263,   267,   277,   281,   293,
681      294,   297,   298,   312,   316,   321,   326,   331,   338,   339,
682      343,   347,   351
683 };
684 #endif
685 
686 /** Accessing symbol of state STATE.  */
687 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
688 
689 #if YYDEBUG || 0
690 /* The user-facing name of the symbol whose (internal) number is
691    YYSYMBOL.  No bounds checking.  */
692 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
693 
694 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
695    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
696 static const char *const yytname[] =
697 {
698   "\"end of file\"", "error", "\"invalid token\"", "NL", "MCIDENT",
699   "MCFILENAME", "MCLINE", "MCCOMMENT", "MCTOKEN", "MCENDLINE",
700   "MCLANGUAGENAMES", "MCFACILITYNAMES", "MCSEVERITYNAMES", "MCOUTPUTBASE",
701   "MCMESSAGEIDTYPEDEF", "MCLANGUAGE", "MCMESSAGEID", "MCSEVERITY",
702   "MCFACILITY", "MCSYMBOLICNAME", "MCNUMBER", "'='", "'('", "')'", "':'",
703   "'+'", "$accept", "input", "entities", "entity", "global_section",
704   "severitymaps", "severitymap", "facilitymaps", "facilitymap", "langmaps",
705   "langmap", "alias_name", "message", "$@1", "id", "vid", "sefasy_def",
706   "severity", "facility", "symbol", "lang_entities", "lang_entity",
707   "lines", "comments", "lang", "token", "lex_want_nl", "lex_want_line",
708   "lex_want_filename", YY_NULLPTR
709 };
710 
711 static const char *
yysymbol_name(yysymbol_kind_t yysymbol)712 yysymbol_name (yysymbol_kind_t yysymbol)
713 {
714   return yytname[yysymbol];
715 }
716 #endif
717 
718 #define YYPACT_NINF (-34)
719 
720 #define yypact_value_is_default(Yyn) \
721   ((Yyn) == YYPACT_NINF)
722 
723 #define YYTABLE_NINF (-83)
724 
725 #define yytable_value_is_error(Yyn) \
726   0
727 
728 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
729    STATE-NUM.  */
730 static const yytype_int8 yypact[] =
731 {
732      -34,    62,    70,   -34,   -34,   -34,    15,    22,    30,   -15,
733       34,    37,   -34,   -34,   -34,   -34,    56,   -34,    10,   -34,
734       12,   -34,    20,    25,   -34,    52,   -34,     0,    80,   -34,
735      -34,    71,   -34,    84,   -34,    86,   -34,   -34,   -34,   -34,
736      -34,    45,   -34,     1,    68,    74,    76,   -34,   -34,   -34,
737      -34,   -34,   -34,     4,   -34,    38,   -34,     6,   -34,    39,
738      -34,    29,   -34,    40,   -34,   -34,    93,    94,    99,    43,
739       76,   -34,   -34,   -34,   -34,   -34,   -34,    46,   -34,   -34,
740      -34,   -34,    47,   -34,   -34,   -34,   -34,    49,   -34,   -34,
741      -34,   -34,    83,   -34,     3,   -34,     2,   -34,    81,   -34,
742       81,    92,   -34,   -34,    48,   -34,    82,    72,   -34,   -34,
743      -34,   104,   105,   108,   -34,   -34,   -34,    73,   -34,   -34,
744      -34,   -34,   -34,   -34,   -34
745 };
746 
747 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
748    Performed when YYTABLE does not specify something else to do.  Zero
749    means the default is an error.  */
750 static const yytype_int8 yydefact[] =
751 {
752        3,     0,     0,     1,     8,    71,     0,     0,     0,     0,
753        0,     0,     4,     5,     6,    57,     7,    16,     0,    20,
754        0,    12,     0,     0,    24,     0,    52,     0,    48,    72,
755       15,     0,    19,     0,    11,     0,    21,    23,    22,    51,
756       54,     0,    50,     0,     0,     0,     0,    58,    59,    60,
757       39,    78,    79,     0,    37,     0,    33,     0,    31,     0,
758       27,     0,    25,     0,    56,    55,     0,     0,     0,     0,
759       49,    64,    81,    14,    13,    38,    44,     0,    18,    17,
760       32,    36,     0,    10,     9,    26,    30,     0,    61,    62,
761       63,    77,     0,    65,     0,    43,     0,    35,    45,    29,
762       45,     0,    69,    67,     0,    42,     0,     0,    34,    28,
763       76,    78,    79,     0,    70,    68,    66,     0,    47,    46,
764       74,    73,    75,    41,    40
765 };
766 
767 /* YYPGOTO[NTERM-NUM].  */
768 static const yytype_int8 yypgoto[] =
769 {
770      -34,   -34,   -34,   -34,   -34,   -34,    50,   -34,    53,   -34,
771       59,    13,   -34,   -34,   -34,   -34,   -34,   -34,   -34,   -34,
772      -34,    44,   -34,   -34,   -34,   -33,   -34,   -34,   -34
773 };
774 
775 /* YYDEFGOTO[NTERM-NUM].  */
776 static const yytype_int8 yydefgoto[] =
777 {
778        0,     1,     2,    12,    13,    61,    62,    57,    58,    53,
779       54,   108,    14,    46,    15,    42,    28,    47,    48,    49,
780       70,    71,   104,    16,    72,    55,    92,    94,   106
781 };
782 
783 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
784    positive, shift that token.  If negative, reduce the rule whose
785    number is the opposite.  If YYTABLE_NINF, syntax error.  */
786 static const yytype_int8 yytable[] =
787 {
788       59,    39,    63,   105,   102,    73,    23,    78,    51,   103,
789       51,    30,    52,    32,    52,   -53,    17,   -53,   -53,   -53,
790       40,    34,    66,    19,    59,    41,   -82,    74,    63,    79,
791       83,    21,    31,    51,    33,    24,    18,    52,    26,    76,
792       81,    86,    35,    20,    91,    36,    64,    95,    97,   114,
793       99,    22,    84,    37,   115,    25,    38,   116,    27,    77,
794       82,    87,     3,    29,   -80,    65,    96,    98,   113,   100,
795       -2,     4,    50,   118,   123,    51,   119,     5,   124,    52,
796        6,     7,     8,     9,    10,    56,    11,    60,    51,    67,
797       51,    69,    52,   110,    52,    68,   111,    43,    44,    45,
798      112,    88,    89,    90,   101,   107,   117,   120,   121,   122,
799       80,    85,    75,   109,    93
800 };
801 
802 static const yytype_int8 yycheck[] =
803 {
804       33,     1,    35,     1,     1,     1,    21,     1,     4,     6,
805        4,     1,     8,     1,     8,    15,     1,    17,    18,    19,
806       20,     1,    21,     1,    57,    25,    24,    23,    61,    23,
807        1,     1,    22,     4,    22,     1,    21,     8,     1,     1,
808        1,     1,    22,    21,     1,    20,     1,     1,     1,     1,
809        1,    21,    23,     1,     6,    21,     4,     9,    21,    21,
810       21,    21,     0,     7,    21,    20,    20,    20,   101,    20,
811        0,     1,     1,     1,     1,     4,     4,     7,     5,     8,
812       10,    11,    12,    13,    14,     1,    16,     1,     4,    21,
813        4,    15,     8,     1,     8,    21,     4,    17,    18,    19,
814        8,     8,     8,     4,    21,    24,    24,     3,     3,     1,
815       57,    61,    53,   100,    70
816 };
817 
818 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
819    state STATE-NUM.  */
820 static const yytype_int8 yystos[] =
821 {
822        0,    27,    28,     0,     1,     7,    10,    11,    12,    13,
823       14,    16,    29,    30,    38,    40,    49,     1,    21,     1,
824       21,     1,    21,    21,     1,    21,     1,    21,    42,     7,
825        1,    22,     1,    22,     1,    22,    20,     1,     4,     1,
826       20,    25,    41,    17,    18,    19,    39,    43,    44,    45,
827        1,     4,     8,    35,    36,    51,     1,    33,    34,    51,
828        1,    31,    32,    51,     1,    20,    21,    21,    21,    15,
829       46,    47,    50,     1,    23,    36,     1,    21,     1,    23,
830       34,     1,    21,     1,    23,    32,     1,    21,     8,     8,
831        4,     1,    52,    47,    53,     1,    20,     1,    20,     1,
832       20,    21,     1,     6,    48,     1,    54,    24,    37,    37,
833        1,     4,     8,    51,     1,     6,     9,    24,     1,     4,
834        3,     3,     1,     1,     5
835 };
836 
837 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
838 static const yytype_int8 yyr1[] =
839 {
840        0,    26,    27,    28,    28,    29,    29,    29,    29,    30,
841       30,    30,    30,    30,    30,    30,    30,    30,    30,    30,
842       30,    30,    30,    30,    30,    31,    31,    31,    32,    32,
843       32,    33,    33,    33,    34,    34,    34,    35,    35,    35,
844       36,    36,    36,    36,    36,    37,    37,    37,    39,    38,
845       40,    40,    40,    41,    41,    41,    41,    42,    42,    42,
846       42,    43,    44,    45,    46,    46,    47,    48,    48,    48,
847       48,    49,    49,    50,    50,    50,    50,    50,    51,    51,
848       52,    53,    54
849 };
850 
851 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
852 static const yytype_int8 yyr2[] =
853 {
854        0,     2,     1,     0,     2,     1,     1,     1,     1,     5,
855        5,     3,     2,     5,     5,     3,     2,     5,     5,     3,
856        2,     3,     3,     3,     2,     1,     2,     1,     4,     3,
857        2,     1,     2,     1,     4,     3,     2,     1,     2,     1,
858        6,     6,     4,     3,     2,     0,     2,     2,     0,     4,
859        3,     3,     2,     0,     1,     2,     2,     0,     2,     2,
860        2,     3,     3,     3,     1,     2,     4,     1,     2,     1,
861        2,     1,     2,     5,     5,     5,     4,     2,     1,     1,
862        0,     0,     0
863 };
864 
865 
866 enum { YYENOMEM = -2 };
867 
868 #define yyerrok         (yyerrstatus = 0)
869 #define yyclearin       (yychar = YYEMPTY)
870 
871 #define YYACCEPT        goto yyacceptlab
872 #define YYABORT         goto yyabortlab
873 #define YYERROR         goto yyerrorlab
874 #define YYNOMEM         goto yyexhaustedlab
875 
876 
877 #define YYRECOVERING()  (!!yyerrstatus)
878 
879 #define YYBACKUP(Token, Value)                                    \
880   do                                                              \
881     if (yychar == YYEMPTY)                                        \
882       {                                                           \
883         yychar = (Token);                                         \
884         yylval = (Value);                                         \
885         YYPOPSTACK (yylen);                                       \
886         yystate = *yyssp;                                         \
887         goto yybackup;                                            \
888       }                                                           \
889     else                                                          \
890       {                                                           \
891         yyerror (YY_("syntax error: cannot back up")); \
892         YYERROR;                                                  \
893       }                                                           \
894   while (0)
895 
896 /* Backward compatibility with an undocumented macro.
897    Use YYerror or YYUNDEF. */
898 #define YYERRCODE YYUNDEF
899 
900 
901 /* Enable debugging if requested.  */
902 #if YYDEBUG
903 
904 # ifndef YYFPRINTF
905 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
906 #  define YYFPRINTF fprintf
907 # endif
908 
909 # define YYDPRINTF(Args)                        \
910 do {                                            \
911   if (yydebug)                                  \
912     YYFPRINTF Args;                             \
913 } while (0)
914 
915 
916 
917 
918 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
919 do {                                                                      \
920   if (yydebug)                                                            \
921     {                                                                     \
922       YYFPRINTF (stderr, "%s ", Title);                                   \
923       yy_symbol_print (stderr,                                            \
924                   Kind, Value); \
925       YYFPRINTF (stderr, "\n");                                           \
926     }                                                                     \
927 } while (0)
928 
929 
930 /*-----------------------------------.
931 | Print this symbol's value on YYO.  |
932 `-----------------------------------*/
933 
934 static void
yy_symbol_value_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)935 yy_symbol_value_print (FILE *yyo,
936                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
937 {
938   FILE *yyoutput = yyo;
939   YY_USE (yyoutput);
940   if (!yyvaluep)
941     return;
942   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
943   YY_USE (yykind);
944   YY_IGNORE_MAYBE_UNINITIALIZED_END
945 }
946 
947 
948 /*---------------------------.
949 | Print this symbol on YYO.  |
950 `---------------------------*/
951 
952 static void
yy_symbol_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)953 yy_symbol_print (FILE *yyo,
954                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
955 {
956   YYFPRINTF (yyo, "%s %s (",
957              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
958 
959   yy_symbol_value_print (yyo, yykind, yyvaluep);
960   YYFPRINTF (yyo, ")");
961 }
962 
963 /*------------------------------------------------------------------.
964 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
965 | TOP (included).                                                   |
966 `------------------------------------------------------------------*/
967 
968 static void
yy_stack_print(yy_state_t * yybottom,yy_state_t * yytop)969 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
970 {
971   YYFPRINTF (stderr, "Stack now");
972   for (; yybottom <= yytop; yybottom++)
973     {
974       int yybot = *yybottom;
975       YYFPRINTF (stderr, " %d", yybot);
976     }
977   YYFPRINTF (stderr, "\n");
978 }
979 
980 # define YY_STACK_PRINT(Bottom, Top)                            \
981 do {                                                            \
982   if (yydebug)                                                  \
983     yy_stack_print ((Bottom), (Top));                           \
984 } while (0)
985 
986 
987 /*------------------------------------------------.
988 | Report that the YYRULE is going to be reduced.  |
989 `------------------------------------------------*/
990 
991 static void
yy_reduce_print(yy_state_t * yyssp,YYSTYPE * yyvsp,int yyrule)992 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
993                  int yyrule)
994 {
995   int yylno = yyrline[yyrule];
996   int yynrhs = yyr2[yyrule];
997   int yyi;
998   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
999              yyrule - 1, yylno);
1000   /* The symbols being reduced.  */
1001   for (yyi = 0; yyi < yynrhs; yyi++)
1002     {
1003       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1004       yy_symbol_print (stderr,
1005                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1006                        &yyvsp[(yyi + 1) - (yynrhs)]);
1007       YYFPRINTF (stderr, "\n");
1008     }
1009 }
1010 
1011 # define YY_REDUCE_PRINT(Rule)          \
1012 do {                                    \
1013   if (yydebug)                          \
1014     yy_reduce_print (yyssp, yyvsp, Rule); \
1015 } while (0)
1016 
1017 /* Nonzero means print parse trace.  It is left uninitialized so that
1018    multiple parsers can coexist.  */
1019 int yydebug;
1020 #else /* !YYDEBUG */
1021 # define YYDPRINTF(Args) ((void) 0)
1022 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1023 # define YY_STACK_PRINT(Bottom, Top)
1024 # define YY_REDUCE_PRINT(Rule)
1025 #endif /* !YYDEBUG */
1026 
1027 
1028 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1029 #ifndef YYINITDEPTH
1030 # define YYINITDEPTH 200
1031 #endif
1032 
1033 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1034    if the built-in stack extension method is used).
1035 
1036    Do not make this value too large; the results are undefined if
1037    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1038    evaluated with infinite-precision integer arithmetic.  */
1039 
1040 #ifndef YYMAXDEPTH
1041 # define YYMAXDEPTH 10000
1042 #endif
1043 
1044 
1045 
1046 
1047 
1048 
1049 /*-----------------------------------------------.
1050 | Release the memory associated to this symbol.  |
1051 `-----------------------------------------------*/
1052 
1053 static void
yydestruct(const char * yymsg,yysymbol_kind_t yykind,YYSTYPE * yyvaluep)1054 yydestruct (const char *yymsg,
1055             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1056 {
1057   YY_USE (yyvaluep);
1058   if (!yymsg)
1059     yymsg = "Deleting";
1060   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1061 
1062   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1063   YY_USE (yykind);
1064   YY_IGNORE_MAYBE_UNINITIALIZED_END
1065 }
1066 
1067 
1068 /* Lookahead token kind.  */
1069 int yychar;
1070 
1071 /* The semantic value of the lookahead symbol.  */
1072 YYSTYPE yylval;
1073 /* Number of syntax errors so far.  */
1074 int yynerrs;
1075 
1076 
1077 
1078 
1079 /*----------.
1080 | yyparse.  |
1081 `----------*/
1082 
1083 int
yyparse(void)1084 yyparse (void)
1085 {
1086     yy_state_fast_t yystate = 0;
1087     /* Number of tokens to shift before error messages enabled.  */
1088     int yyerrstatus = 0;
1089 
1090     /* Refer to the stacks through separate pointers, to allow yyoverflow
1091        to reallocate them elsewhere.  */
1092 
1093     /* Their size.  */
1094     YYPTRDIFF_T yystacksize = YYINITDEPTH;
1095 
1096     /* The state stack: array, bottom, top.  */
1097     yy_state_t yyssa[YYINITDEPTH];
1098     yy_state_t *yyss = yyssa;
1099     yy_state_t *yyssp = yyss;
1100 
1101     /* The semantic value stack: array, bottom, top.  */
1102     YYSTYPE yyvsa[YYINITDEPTH];
1103     YYSTYPE *yyvs = yyvsa;
1104     YYSTYPE *yyvsp = yyvs;
1105 
1106   int yyn;
1107   /* The return value of yyparse.  */
1108   int yyresult;
1109   /* Lookahead symbol kind.  */
1110   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1111   /* The variables used to return semantic value and location from the
1112      action routines.  */
1113   YYSTYPE yyval;
1114 
1115 
1116 
1117 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1118 
1119   /* The number of symbols on the RHS of the reduced rule.
1120      Keep to zero when no symbol should be popped.  */
1121   int yylen = 0;
1122 
1123   YYDPRINTF ((stderr, "Starting parse\n"));
1124 
1125   yychar = YYEMPTY; /* Cause a token to be read.  */
1126 
1127   goto yysetstate;
1128 
1129 
1130 /*------------------------------------------------------------.
1131 | yynewstate -- push a new state, which is found in yystate.  |
1132 `------------------------------------------------------------*/
1133 yynewstate:
1134   /* In all cases, when you get here, the value and location stacks
1135      have just been pushed.  So pushing a state here evens the stacks.  */
1136   yyssp++;
1137 
1138 
1139 /*--------------------------------------------------------------------.
1140 | yysetstate -- set current state (the top of the stack) to yystate.  |
1141 `--------------------------------------------------------------------*/
1142 yysetstate:
1143   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1144   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1145   YY_IGNORE_USELESS_CAST_BEGIN
1146   *yyssp = YY_CAST (yy_state_t, yystate);
1147   YY_IGNORE_USELESS_CAST_END
1148   YY_STACK_PRINT (yyss, yyssp);
1149 
1150   if (yyss + yystacksize - 1 <= yyssp)
1151 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1152     YYNOMEM;
1153 #else
1154     {
1155       /* Get the current used size of the three stacks, in elements.  */
1156       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1157 
1158 # if defined yyoverflow
1159       {
1160         /* Give user a chance to reallocate the stack.  Use copies of
1161            these so that the &'s don't force the real ones into
1162            memory.  */
1163         yy_state_t *yyss1 = yyss;
1164         YYSTYPE *yyvs1 = yyvs;
1165 
1166         /* Each stack pointer address is followed by the size of the
1167            data in use in that stack, in bytes.  This used to be a
1168            conditional around just the two extra args, but that might
1169            be undefined if yyoverflow is a macro.  */
1170         yyoverflow (YY_("memory exhausted"),
1171                     &yyss1, yysize * YYSIZEOF (*yyssp),
1172                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1173                     &yystacksize);
1174         yyss = yyss1;
1175         yyvs = yyvs1;
1176       }
1177 # else /* defined YYSTACK_RELOCATE */
1178       /* Extend the stack our own way.  */
1179       if (YYMAXDEPTH <= yystacksize)
1180         YYNOMEM;
1181       yystacksize *= 2;
1182       if (YYMAXDEPTH < yystacksize)
1183         yystacksize = YYMAXDEPTH;
1184 
1185       {
1186         yy_state_t *yyss1 = yyss;
1187         union yyalloc *yyptr =
1188           YY_CAST (union yyalloc *,
1189                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1190         if (! yyptr)
1191           YYNOMEM;
1192         YYSTACK_RELOCATE (yyss_alloc, yyss);
1193         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1194 #  undef YYSTACK_RELOCATE
1195         if (yyss1 != yyssa)
1196           YYSTACK_FREE (yyss1);
1197       }
1198 # endif
1199 
1200       yyssp = yyss + yysize - 1;
1201       yyvsp = yyvs + yysize - 1;
1202 
1203       YY_IGNORE_USELESS_CAST_BEGIN
1204       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1205                   YY_CAST (long, yystacksize)));
1206       YY_IGNORE_USELESS_CAST_END
1207 
1208       if (yyss + yystacksize - 1 <= yyssp)
1209         YYABORT;
1210     }
1211 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1212 
1213 
1214   if (yystate == YYFINAL)
1215     YYACCEPT;
1216 
1217   goto yybackup;
1218 
1219 
1220 /*-----------.
1221 | yybackup.  |
1222 `-----------*/
1223 yybackup:
1224   /* Do appropriate processing given the current state.  Read a
1225      lookahead token if we need one and don't already have one.  */
1226 
1227   /* First try to decide what to do without reference to lookahead token.  */
1228   yyn = yypact[yystate];
1229   if (yypact_value_is_default (yyn))
1230     goto yydefault;
1231 
1232   /* Not known => get a lookahead token if don't already have one.  */
1233 
1234   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1235   if (yychar == YYEMPTY)
1236     {
1237       YYDPRINTF ((stderr, "Reading a token\n"));
1238       yychar = yylex ();
1239     }
1240 
1241   if (yychar <= YYEOF)
1242     {
1243       yychar = YYEOF;
1244       yytoken = YYSYMBOL_YYEOF;
1245       YYDPRINTF ((stderr, "Now at end of input.\n"));
1246     }
1247   else if (yychar == YYerror)
1248     {
1249       /* The scanner already issued an error message, process directly
1250          to error recovery.  But do not keep the error token as
1251          lookahead, it is too special and may lead us to an endless
1252          loop in error recovery. */
1253       yychar = YYUNDEF;
1254       yytoken = YYSYMBOL_YYerror;
1255       goto yyerrlab1;
1256     }
1257   else
1258     {
1259       yytoken = YYTRANSLATE (yychar);
1260       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1261     }
1262 
1263   /* If the proper action on seeing token YYTOKEN is to reduce or to
1264      detect an error, take that action.  */
1265   yyn += yytoken;
1266   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1267     goto yydefault;
1268   yyn = yytable[yyn];
1269   if (yyn <= 0)
1270     {
1271       if (yytable_value_is_error (yyn))
1272         goto yyerrlab;
1273       yyn = -yyn;
1274       goto yyreduce;
1275     }
1276 
1277   /* Count tokens shifted since error; after three, turn off error
1278      status.  */
1279   if (yyerrstatus)
1280     yyerrstatus--;
1281 
1282   /* Shift the lookahead token.  */
1283   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1284   yystate = yyn;
1285   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1286   *++yyvsp = yylval;
1287   YY_IGNORE_MAYBE_UNINITIALIZED_END
1288 
1289   /* Discard the shifted token.  */
1290   yychar = YYEMPTY;
1291   goto yynewstate;
1292 
1293 
1294 /*-----------------------------------------------------------.
1295 | yydefault -- do the default action for the current state.  |
1296 `-----------------------------------------------------------*/
1297 yydefault:
1298   yyn = yydefact[yystate];
1299   if (yyn == 0)
1300     goto yyerrlab;
1301   goto yyreduce;
1302 
1303 
1304 /*-----------------------------.
1305 | yyreduce -- do a reduction.  |
1306 `-----------------------------*/
1307 yyreduce:
1308   /* yyn is the number of a rule to reduce with.  */
1309   yylen = yyr2[yyn];
1310 
1311   /* If YYLEN is nonzero, implement the default value of the action:
1312      '$$ = $1'.
1313 
1314      Otherwise, the following line sets YYVAL to garbage.
1315      This behavior is undocumented and Bison
1316      users should not rely upon it.  Assigning to YYVAL
1317      unconditionally makes the parser a bit smaller, and it avoids a
1318      GCC warning that YYVAL may be used uninitialized.  */
1319   yyval = yyvsp[1-yylen];
1320 
1321 
1322   YY_REDUCE_PRINT (yyn);
1323   switch (yyn)
1324     {
1325   case 7: /* entity: comments  */
1326 #line 76 "mcparse.y"
1327           {
1328 	    cur_node = mc_add_node ();
1329 	    cur_node->user_text = (yyvsp[0].ustr);
1330 	  }
1331 #line 1332 "mcparse.c"
1332     break;
1333 
1334   case 8: /* entity: error  */
1335 #line 80 "mcparse.y"
1336                 { mc_fatal ("syntax error"); }
1337 #line 1338 "mcparse.c"
1338     break;
1339 
1340   case 10: /* global_section: MCSEVERITYNAMES '=' '(' severitymaps error  */
1341 #line 85 "mcparse.y"
1342                                                      { mc_fatal ("missing ')' in SeverityNames"); }
1343 #line 1344 "mcparse.c"
1344     break;
1345 
1346   case 11: /* global_section: MCSEVERITYNAMES '=' error  */
1347 #line 86 "mcparse.y"
1348                                     { mc_fatal ("missing '(' in SeverityNames"); }
1349 #line 1350 "mcparse.c"
1350     break;
1351 
1352   case 12: /* global_section: MCSEVERITYNAMES error  */
1353 #line 87 "mcparse.y"
1354                                 { mc_fatal ("missing '=' for SeverityNames"); }
1355 #line 1356 "mcparse.c"
1356     break;
1357 
1358   case 14: /* global_section: MCLANGUAGENAMES '=' '(' langmaps error  */
1359 #line 89 "mcparse.y"
1360                                                  { mc_fatal ("missing ')' in LanguageNames"); }
1361 #line 1362 "mcparse.c"
1362     break;
1363 
1364   case 15: /* global_section: MCLANGUAGENAMES '=' error  */
1365 #line 90 "mcparse.y"
1366                                     { mc_fatal ("missing '(' in LanguageNames"); }
1367 #line 1368 "mcparse.c"
1368     break;
1369 
1370   case 16: /* global_section: MCLANGUAGENAMES error  */
1371 #line 91 "mcparse.y"
1372                                 { mc_fatal ("missing '=' for LanguageNames"); }
1373 #line 1374 "mcparse.c"
1374     break;
1375 
1376   case 18: /* global_section: MCFACILITYNAMES '=' '(' facilitymaps error  */
1377 #line 93 "mcparse.y"
1378                                                      { mc_fatal ("missing ')' in FacilityNames"); }
1379 #line 1380 "mcparse.c"
1380     break;
1381 
1382   case 19: /* global_section: MCFACILITYNAMES '=' error  */
1383 #line 94 "mcparse.y"
1384                                     { mc_fatal ("missing '(' in FacilityNames"); }
1385 #line 1386 "mcparse.c"
1386     break;
1387 
1388   case 20: /* global_section: MCFACILITYNAMES error  */
1389 #line 95 "mcparse.y"
1390                                 { mc_fatal ("missing '=' for FacilityNames"); }
1391 #line 1392 "mcparse.c"
1392     break;
1393 
1394   case 21: /* global_section: MCOUTPUTBASE '=' MCNUMBER  */
1395 #line 97 "mcparse.y"
1396           {
1397 	    if ((yyvsp[0].ival) != 10 && (yyvsp[0].ival) != 16)
1398 	      mc_fatal ("OutputBase allows 10 or 16 as value");
1399 	    mcset_out_values_are_decimal = ((yyvsp[0].ival) == 10 ? 1 : 0);
1400 	  }
1401 #line 1402 "mcparse.c"
1402     break;
1403 
1404   case 22: /* global_section: MCMESSAGEIDTYPEDEF '=' MCIDENT  */
1405 #line 103 "mcparse.y"
1406           {
1407 	    mcset_msg_id_typedef = (yyvsp[0].ustr);
1408 	  }
1409 #line 1410 "mcparse.c"
1410     break;
1411 
1412   case 23: /* global_section: MCMESSAGEIDTYPEDEF '=' error  */
1413 #line 107 "mcparse.y"
1414           {
1415 	    mc_fatal ("MessageIdTypedef expects an identifier");
1416 	  }
1417 #line 1418 "mcparse.c"
1418     break;
1419 
1420   case 24: /* global_section: MCMESSAGEIDTYPEDEF error  */
1421 #line 111 "mcparse.y"
1422           {
1423 	    mc_fatal ("missing '=' for MessageIdTypedef");
1424 	  }
1425 #line 1426 "mcparse.c"
1426     break;
1427 
1428   case 27: /* severitymaps: error  */
1429 #line 119 "mcparse.y"
1430                 { mc_fatal ("severity ident missing"); }
1431 #line 1432 "mcparse.c"
1432     break;
1433 
1434   case 28: /* severitymap: token '=' MCNUMBER alias_name  */
1435 #line 124 "mcparse.y"
1436           {
1437 	    mc_add_keyword ((yyvsp[-3].ustr), MCTOKEN, "severity", (yyvsp[-1].ival), (yyvsp[0].ustr));
1438 	  }
1439 #line 1440 "mcparse.c"
1440     break;
1441 
1442   case 29: /* severitymap: token '=' error  */
1443 #line 127 "mcparse.y"
1444                           { mc_fatal ("severity number missing"); }
1445 #line 1446 "mcparse.c"
1446     break;
1447 
1448   case 30: /* severitymap: token error  */
1449 #line 128 "mcparse.y"
1450                       { mc_fatal ("severity missing '='"); }
1451 #line 1452 "mcparse.c"
1452     break;
1453 
1454   case 33: /* facilitymaps: error  */
1455 #line 134 "mcparse.y"
1456                 { mc_fatal ("missing ident in FacilityNames"); }
1457 #line 1458 "mcparse.c"
1458     break;
1459 
1460   case 34: /* facilitymap: token '=' MCNUMBER alias_name  */
1461 #line 139 "mcparse.y"
1462           {
1463 	    mc_add_keyword ((yyvsp[-3].ustr), MCTOKEN, "facility", (yyvsp[-1].ival), (yyvsp[0].ustr));
1464 	  }
1465 #line 1466 "mcparse.c"
1466     break;
1467 
1468   case 35: /* facilitymap: token '=' error  */
1469 #line 142 "mcparse.y"
1470                           { mc_fatal ("facility number missing"); }
1471 #line 1472 "mcparse.c"
1472     break;
1473 
1474   case 36: /* facilitymap: token error  */
1475 #line 143 "mcparse.y"
1476                       { mc_fatal ("facility missing '='"); }
1477 #line 1478 "mcparse.c"
1478     break;
1479 
1480   case 39: /* langmaps: error  */
1481 #line 149 "mcparse.y"
1482                 { mc_fatal ("missing ident in LanguageNames"); }
1483 #line 1484 "mcparse.c"
1484     break;
1485 
1486   case 40: /* langmap: token '=' MCNUMBER lex_want_filename ':' MCFILENAME  */
1487 #line 154 "mcparse.y"
1488           {
1489 	    mc_add_keyword ((yyvsp[-5].ustr), MCTOKEN, "language", (yyvsp[-3].ival), (yyvsp[0].ustr));
1490 	  }
1491 #line 1492 "mcparse.c"
1492     break;
1493 
1494   case 41: /* langmap: token '=' MCNUMBER lex_want_filename ':' error  */
1495 #line 157 "mcparse.y"
1496                                                          { mc_fatal ("missing filename in LanguageNames"); }
1497 #line 1498 "mcparse.c"
1498     break;
1499 
1500   case 42: /* langmap: token '=' MCNUMBER error  */
1501 #line 158 "mcparse.y"
1502                                    { mc_fatal ("missing ':' in LanguageNames"); }
1503 #line 1504 "mcparse.c"
1504     break;
1505 
1506   case 43: /* langmap: token '=' error  */
1507 #line 159 "mcparse.y"
1508                           { mc_fatal ("missing language code in LanguageNames"); }
1509 #line 1510 "mcparse.c"
1510     break;
1511 
1512   case 44: /* langmap: token error  */
1513 #line 160 "mcparse.y"
1514                       { mc_fatal ("missing '=' for LanguageNames"); }
1515 #line 1516 "mcparse.c"
1516     break;
1517 
1518   case 45: /* alias_name: %empty  */
1519 #line 165 "mcparse.y"
1520           {
1521 	    (yyval.ustr) = NULL;
1522 	  }
1523 #line 1524 "mcparse.c"
1524     break;
1525 
1526   case 46: /* alias_name: ':' MCIDENT  */
1527 #line 169 "mcparse.y"
1528           {
1529 	    (yyval.ustr) = (yyvsp[0].ustr);
1530 	  }
1531 #line 1532 "mcparse.c"
1532     break;
1533 
1534   case 47: /* alias_name: ':' error  */
1535 #line 172 "mcparse.y"
1536                     { mc_fatal ("illegal token in identifier"); (yyval.ustr) = NULL; }
1537 #line 1538 "mcparse.c"
1538     break;
1539 
1540   case 48: /* $@1: %empty  */
1541 #line 177 "mcparse.y"
1542           {
1543 	    cur_node = mc_add_node ();
1544 	    cur_node->symbol = mc_last_symbol;
1545 	    cur_node->facility = mc_cur_facility;
1546 	    cur_node->severity = mc_cur_severity;
1547 	    cur_node->id = ((yyvsp[-1].ival) & 0xffffUL);
1548 	    cur_node->vid = ((yyvsp[-1].ival) & 0xffffUL) | mc_sefa_val;
1549 	    cur_node->id_typecast = mcset_msg_id_typedef;
1550 	    mc_last_id = (yyvsp[-1].ival);
1551 	  }
1552 #line 1553 "mcparse.c"
1553     break;
1554 
1555   case 50: /* id: MCMESSAGEID '=' vid  */
1556 #line 190 "mcparse.y"
1557                               { (yyval.ival) = (yyvsp[0].ival); }
1558 #line 1559 "mcparse.c"
1559     break;
1560 
1561   case 51: /* id: MCMESSAGEID '=' error  */
1562 #line 191 "mcparse.y"
1563                                 { mc_fatal ("missing number in MessageId"); (yyval.ival) = 0; }
1564 #line 1565 "mcparse.c"
1565     break;
1566 
1567   case 52: /* id: MCMESSAGEID error  */
1568 #line 192 "mcparse.y"
1569                             { mc_fatal ("missing '=' for MessageId"); (yyval.ival) = 0; }
1570 #line 1571 "mcparse.c"
1571     break;
1572 
1573   case 53: /* vid: %empty  */
1574 #line 196 "mcparse.y"
1575           {
1576 	    (yyval.ival) = ++mc_last_id;
1577 	  }
1578 #line 1579 "mcparse.c"
1579     break;
1580 
1581   case 54: /* vid: MCNUMBER  */
1582 #line 200 "mcparse.y"
1583           {
1584 	    (yyval.ival) = (yyvsp[0].ival);
1585 	  }
1586 #line 1587 "mcparse.c"
1587     break;
1588 
1589   case 55: /* vid: '+' MCNUMBER  */
1590 #line 204 "mcparse.y"
1591           {
1592 	    (yyval.ival) = mc_last_id + (yyvsp[0].ival);
1593 	  }
1594 #line 1595 "mcparse.c"
1595     break;
1596 
1597   case 56: /* vid: '+' error  */
1598 #line 207 "mcparse.y"
1599                     { mc_fatal ("missing number after MessageId '+'"); }
1600 #line 1601 "mcparse.c"
1601     break;
1602 
1603   case 57: /* sefasy_def: %empty  */
1604 #line 212 "mcparse.y"
1605           {
1606 	    (yyval.ival) = 0;
1607 	    mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29;
1608 	    mc_last_symbol = NULL;
1609 	    mc_cur_severity = NULL;
1610 	    mc_cur_facility = NULL;
1611 	  }
1612 #line 1613 "mcparse.c"
1613     break;
1614 
1615   case 58: /* sefasy_def: sefasy_def severity  */
1616 #line 220 "mcparse.y"
1617           {
1618 	    if ((yyvsp[-1].ival) & 1)
1619 	      mc_warn (_("duplicate definition of Severity"));
1620 	    (yyval.ival) = (yyvsp[-1].ival) | 1;
1621 	  }
1622 #line 1623 "mcparse.c"
1623     break;
1624 
1625   case 59: /* sefasy_def: sefasy_def facility  */
1626 #line 226 "mcparse.y"
1627           {
1628 	    if ((yyvsp[-1].ival) & 2)
1629 	      mc_warn (_("duplicate definition of Facility"));
1630 	    (yyval.ival) = (yyvsp[-1].ival) | 2;
1631 	  }
1632 #line 1633 "mcparse.c"
1633     break;
1634 
1635   case 60: /* sefasy_def: sefasy_def symbol  */
1636 #line 232 "mcparse.y"
1637           {
1638 	    if ((yyvsp[-1].ival) & 4)
1639 	      mc_warn (_("duplicate definition of SymbolicName"));
1640 	    (yyval.ival) = (yyvsp[-1].ival) | 4;
1641 	  }
1642 #line 1643 "mcparse.c"
1643     break;
1644 
1645   case 61: /* severity: MCSEVERITY '=' MCTOKEN  */
1646 #line 240 "mcparse.y"
1647           {
1648 	    mc_sefa_val &= ~ (0x3UL << 30);
1649 	    mc_sefa_val |= (((yyvsp[0].tok)->nval & 0x3UL) << 30);
1650 	    mc_cur_severity = (yyvsp[0].tok);
1651 	  }
1652 #line 1653 "mcparse.c"
1653     break;
1654 
1655   case 62: /* facility: MCFACILITY '=' MCTOKEN  */
1656 #line 248 "mcparse.y"
1657           {
1658 	    mc_sefa_val &= ~ (0xfffUL << 16);
1659 	    mc_sefa_val |= (((yyvsp[0].tok)->nval & 0xfffUL) << 16);
1660 	    mc_cur_facility = (yyvsp[0].tok);
1661 	  }
1662 #line 1663 "mcparse.c"
1663     break;
1664 
1665   case 63: /* symbol: MCSYMBOLICNAME '=' MCIDENT  */
1666 #line 256 "mcparse.y"
1667         {
1668 	  mc_last_symbol = (yyvsp[0].ustr);
1669 	}
1670 #line 1671 "mcparse.c"
1671     break;
1672 
1673   case 66: /* lang_entity: lang lex_want_line lines MCENDLINE  */
1674 #line 268 "mcparse.y"
1675           {
1676 	    mc_node_lang *h;
1677 	    h = mc_add_node_lang (cur_node, (yyvsp[-3].tok), cur_node->vid);
1678 	    h->message = (yyvsp[-1].ustr);
1679 	    if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length)
1680 	      mc_warn ("message length to long");
1681 	  }
1682 #line 1683 "mcparse.c"
1683     break;
1684 
1685   case 67: /* lines: MCLINE  */
1686 #line 278 "mcparse.y"
1687           {
1688 	    (yyval.ustr) = (yyvsp[0].ustr);
1689 	  }
1690 #line 1691 "mcparse.c"
1691     break;
1692 
1693   case 68: /* lines: lines MCLINE  */
1694 #line 282 "mcparse.y"
1695           {
1696 	    unichar *h;
1697 	    rc_uint_type l1,l2;
1698 	    l1 = unichar_len ((yyvsp[-1].ustr));
1699 	    l2 = unichar_len ((yyvsp[0].ustr));
1700 	    h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
1701 	    if (l1) memcpy (h, (yyvsp[-1].ustr), l1 * sizeof (unichar));
1702 	    if (l2) memcpy (&h[l1], (yyvsp[0].ustr), l2 * sizeof (unichar));
1703 	    h[l1 + l2] = 0;
1704 	    (yyval.ustr) = h;
1705 	  }
1706 #line 1707 "mcparse.c"
1707     break;
1708 
1709   case 69: /* lines: error  */
1710 #line 293 "mcparse.y"
1711                 { mc_fatal ("missing end of message text"); (yyval.ustr) = NULL; }
1712 #line 1713 "mcparse.c"
1713     break;
1714 
1715   case 70: /* lines: lines error  */
1716 #line 294 "mcparse.y"
1717                       { mc_fatal ("missing end of message text"); (yyval.ustr) = (yyvsp[-1].ustr); }
1718 #line 1719 "mcparse.c"
1719     break;
1720 
1721   case 71: /* comments: MCCOMMENT  */
1722 #line 297 "mcparse.y"
1723                     { (yyval.ustr) = (yyvsp[0].ustr); }
1724 #line 1725 "mcparse.c"
1725     break;
1726 
1727   case 72: /* comments: comments MCCOMMENT  */
1728 #line 299 "mcparse.y"
1729           {
1730 	    unichar *h;
1731 	    rc_uint_type l1,l2;
1732 	    l1 = unichar_len ((yyvsp[-1].ustr));
1733 	    l2 = unichar_len ((yyvsp[0].ustr));
1734 	    h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
1735 	    if (l1) memcpy (h, (yyvsp[-1].ustr), l1 * sizeof (unichar));
1736 	    if (l2) memcpy (&h[l1], (yyvsp[0].ustr), l2 * sizeof (unichar));
1737 	    h[l1 + l2] = 0;
1738 	    (yyval.ustr) = h;
1739 	  }
1740 #line 1741 "mcparse.c"
1741     break;
1742 
1743   case 73: /* lang: MCLANGUAGE lex_want_nl '=' MCTOKEN NL  */
1744 #line 313 "mcparse.y"
1745           {
1746 	    (yyval.tok) = (yyvsp[-1].tok);
1747 	  }
1748 #line 1749 "mcparse.c"
1749     break;
1750 
1751   case 74: /* lang: MCLANGUAGE lex_want_nl '=' MCIDENT NL  */
1752 #line 317 "mcparse.y"
1753           {
1754 	    (yyval.tok) = NULL;
1755 	    mc_fatal (_("undeclared language identifier"));
1756 	  }
1757 #line 1758 "mcparse.c"
1758     break;
1759 
1760   case 75: /* lang: MCLANGUAGE lex_want_nl '=' token error  */
1761 #line 322 "mcparse.y"
1762           {
1763 	    (yyval.tok) = NULL;
1764 	    mc_fatal ("missing newline after Language");
1765 	  }
1766 #line 1767 "mcparse.c"
1767     break;
1768 
1769   case 76: /* lang: MCLANGUAGE lex_want_nl '=' error  */
1770 #line 327 "mcparse.y"
1771           {
1772 	    (yyval.tok) = NULL;
1773 	    mc_fatal ("missing ident for Language");
1774 	  }
1775 #line 1776 "mcparse.c"
1776     break;
1777 
1778   case 77: /* lang: MCLANGUAGE error  */
1779 #line 332 "mcparse.y"
1780           {
1781 	    (yyval.tok) = NULL;
1782 	    mc_fatal ("missing '=' for Language");
1783 	  }
1784 #line 1785 "mcparse.c"
1785     break;
1786 
1787   case 78: /* token: MCIDENT  */
1788 #line 338 "mcparse.y"
1789                 { (yyval.ustr) = (yyvsp[0].ustr); }
1790 #line 1791 "mcparse.c"
1791     break;
1792 
1793   case 79: /* token: MCTOKEN  */
1794 #line 339 "mcparse.y"
1795                    { (yyval.ustr) = (yyvsp[0].tok)->usz; }
1796 #line 1797 "mcparse.c"
1797     break;
1798 
1799   case 80: /* lex_want_nl: %empty  */
1800 #line 343 "mcparse.y"
1801                         { mclex_want_nl = 1; }
1802 #line 1803 "mcparse.c"
1803     break;
1804 
1805   case 81: /* lex_want_line: %empty  */
1806 #line 347 "mcparse.y"
1807                         { mclex_want_line = 1; }
1808 #line 1809 "mcparse.c"
1809     break;
1810 
1811   case 82: /* lex_want_filename: %empty  */
1812 #line 351 "mcparse.y"
1813                         { mclex_want_filename = 1; }
1814 #line 1815 "mcparse.c"
1815     break;
1816 
1817 
1818 #line 1819 "mcparse.c"
1819 
1820       default: break;
1821     }
1822   /* User semantic actions sometimes alter yychar, and that requires
1823      that yytoken be updated with the new translation.  We take the
1824      approach of translating immediately before every use of yytoken.
1825      One alternative is translating here after every semantic action,
1826      but that translation would be missed if the semantic action invokes
1827      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1828      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1829      incorrect destructor might then be invoked immediately.  In the
1830      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1831      to an incorrect destructor call or verbose syntax error message
1832      before the lookahead is translated.  */
1833   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1834 
1835   YYPOPSTACK (yylen);
1836   yylen = 0;
1837 
1838   *++yyvsp = yyval;
1839 
1840   /* Now 'shift' the result of the reduction.  Determine what state
1841      that goes to, based on the state we popped back to and the rule
1842      number reduced by.  */
1843   {
1844     const int yylhs = yyr1[yyn] - YYNTOKENS;
1845     const int yyi = yypgoto[yylhs] + *yyssp;
1846     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1847                ? yytable[yyi]
1848                : yydefgoto[yylhs]);
1849   }
1850 
1851   goto yynewstate;
1852 
1853 
1854 /*--------------------------------------.
1855 | yyerrlab -- here on detecting error.  |
1856 `--------------------------------------*/
1857 yyerrlab:
1858   /* Make sure we have latest lookahead translation.  See comments at
1859      user semantic actions for why this is necessary.  */
1860   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1861   /* If not already recovering from an error, report this error.  */
1862   if (!yyerrstatus)
1863     {
1864       ++yynerrs;
1865       yyerror (YY_("syntax error"));
1866     }
1867 
1868   if (yyerrstatus == 3)
1869     {
1870       /* If just tried and failed to reuse lookahead token after an
1871          error, discard it.  */
1872 
1873       if (yychar <= YYEOF)
1874         {
1875           /* Return failure if at end of input.  */
1876           if (yychar == YYEOF)
1877             YYABORT;
1878         }
1879       else
1880         {
1881           yydestruct ("Error: discarding",
1882                       yytoken, &yylval);
1883           yychar = YYEMPTY;
1884         }
1885     }
1886 
1887   /* Else will try to reuse lookahead token after shifting the error
1888      token.  */
1889   goto yyerrlab1;
1890 
1891 
1892 /*---------------------------------------------------.
1893 | yyerrorlab -- error raised explicitly by YYERROR.  |
1894 `---------------------------------------------------*/
1895 yyerrorlab:
1896   /* Pacify compilers when the user code never invokes YYERROR and the
1897      label yyerrorlab therefore never appears in user code.  */
1898   if (0)
1899     YYERROR;
1900   ++yynerrs;
1901 
1902   /* Do not reclaim the symbols of the rule whose action triggered
1903      this YYERROR.  */
1904   YYPOPSTACK (yylen);
1905   yylen = 0;
1906   YY_STACK_PRINT (yyss, yyssp);
1907   yystate = *yyssp;
1908   goto yyerrlab1;
1909 
1910 
1911 /*-------------------------------------------------------------.
1912 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1913 `-------------------------------------------------------------*/
1914 yyerrlab1:
1915   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1916 
1917   /* Pop stack until we find a state that shifts the error token.  */
1918   for (;;)
1919     {
1920       yyn = yypact[yystate];
1921       if (!yypact_value_is_default (yyn))
1922         {
1923           yyn += YYSYMBOL_YYerror;
1924           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1925             {
1926               yyn = yytable[yyn];
1927               if (0 < yyn)
1928                 break;
1929             }
1930         }
1931 
1932       /* Pop the current state because it cannot handle the error token.  */
1933       if (yyssp == yyss)
1934         YYABORT;
1935 
1936 
1937       yydestruct ("Error: popping",
1938                   YY_ACCESSING_SYMBOL (yystate), yyvsp);
1939       YYPOPSTACK (1);
1940       yystate = *yyssp;
1941       YY_STACK_PRINT (yyss, yyssp);
1942     }
1943 
1944   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1945   *++yyvsp = yylval;
1946   YY_IGNORE_MAYBE_UNINITIALIZED_END
1947 
1948 
1949   /* Shift the error token.  */
1950   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1951 
1952   yystate = yyn;
1953   goto yynewstate;
1954 
1955 
1956 /*-------------------------------------.
1957 | yyacceptlab -- YYACCEPT comes here.  |
1958 `-------------------------------------*/
1959 yyacceptlab:
1960   yyresult = 0;
1961   goto yyreturnlab;
1962 
1963 
1964 /*-----------------------------------.
1965 | yyabortlab -- YYABORT comes here.  |
1966 `-----------------------------------*/
1967 yyabortlab:
1968   yyresult = 1;
1969   goto yyreturnlab;
1970 
1971 
1972 /*-----------------------------------------------------------.
1973 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1974 `-----------------------------------------------------------*/
1975 yyexhaustedlab:
1976   yyerror (YY_("memory exhausted"));
1977   yyresult = 2;
1978   goto yyreturnlab;
1979 
1980 
1981 /*----------------------------------------------------------.
1982 | yyreturnlab -- parsing is finished, clean up and return.  |
1983 `----------------------------------------------------------*/
1984 yyreturnlab:
1985   if (yychar != YYEMPTY)
1986     {
1987       /* Make sure we have latest lookahead translation.  See comments at
1988          user semantic actions for why this is necessary.  */
1989       yytoken = YYTRANSLATE (yychar);
1990       yydestruct ("Cleanup: discarding lookahead",
1991                   yytoken, &yylval);
1992     }
1993   /* Do not reclaim the symbols of the rule whose action triggered
1994      this YYABORT or YYACCEPT.  */
1995   YYPOPSTACK (yylen);
1996   YY_STACK_PRINT (yyss, yyssp);
1997   while (yyssp != yyss)
1998     {
1999       yydestruct ("Cleanup: popping",
2000                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
2001       YYPOPSTACK (1);
2002     }
2003 #ifndef yyoverflow
2004   if (yyss != yyssa)
2005     YYSTACK_FREE (yyss);
2006 #endif
2007 
2008   return yyresult;
2009 }
2010 
2011 #line 354 "mcparse.y"
2012 
2013 
2014 /* Something else.  */
2015