1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
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)
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.
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. */
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.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
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. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
76 MCLANGUAGENAMES
= 265,
77 MCFACILITYNAMES
= 266,
78 MCSEVERITYNAMES
= 267,
80 MCMESSAGEIDTYPEDEF
= 269,
92 #define MCFILENAME 260
97 #define MCLANGUAGENAMES 265
98 #define MCFACILITYNAMES 266
99 #define MCSEVERITYNAMES 267
100 #define MCOUTPUTBASE 268
101 #define MCMESSAGEIDTYPEDEF 269
102 #define MCLANGUAGE 270
103 #define MCMESSAGEID 271
104 #define MCSEVERITY 272
105 #define MCFACILITY 273
106 #define MCSYMBOLICNAME 274
112 /* Copy the first part of user declarations. */
114 /* mcparse.y -- parser for Windows mc files
116 Free Software Foundation, Inc.
118 Parser for Windows mc files
119 Written by Kai Tietz, Onevision.
121 This file is part of GNU Binutils.
123 This program is free software; you can redistribute it and/or modify
124 it under the terms of the GNU General Public License as published by
125 the Free Software Foundation; either version 3 of the License, or
126 (at your option) any later version.
128 This program is distributed in the hope that it will be useful,
129 but WITHOUT ANY WARRANTY; without even the implied warranty of
130 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
131 GNU General Public License for more details.
133 You should have received a copy of the GNU General Public License
134 along with this program; if not, write to the Free Software
135 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
138 /* This is a parser for Windows rc files. It is based on the parser
139 by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
144 #include "libiberty.h"
146 #include "safe-ctype.h"
148 static rc_uint_type mc_last_id
= 0;
149 static rc_uint_type mc_sefa_val
= 0;
150 static unichar
*mc_last_symbol
= NULL
;
151 static const mc_keyword
*mc_cur_severity
= NULL
;
152 static const mc_keyword
*mc_cur_facility
= NULL
;
153 static mc_node
*cur_node
= NULL
;
157 /* Enabling traces. */
162 /* Enabling verbose error messages. */
163 #ifdef YYERROR_VERBOSE
164 # undef YYERROR_VERBOSE
165 # define YYERROR_VERBOSE 1
167 # define YYERROR_VERBOSE 0
170 /* Enabling the token table. */
171 #ifndef YYTOKEN_TABLE
172 # define YYTOKEN_TABLE 0
175 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
176 typedef union YYSTYPE
181 const mc_keyword
*tok
;
184 /* Line 187 of yacc.c. */
185 #line 186 "mcparse.c"
187 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
188 # define YYSTYPE_IS_DECLARED 1
189 # define YYSTYPE_IS_TRIVIAL 1
194 /* Copy the second part of user declarations. */
197 /* Line 216 of yacc.c. */
198 #line 199 "mcparse.c"
205 typedef YYTYPE_UINT8 yytype_uint8
;
207 typedef unsigned char yytype_uint8
;
211 typedef YYTYPE_INT8 yytype_int8
;
212 #elif (defined __STDC__ || defined __C99__FUNC__ \
213 || defined __cplusplus || defined _MSC_VER)
214 typedef signed char yytype_int8
;
216 typedef short int yytype_int8
;
220 typedef YYTYPE_UINT16 yytype_uint16
;
222 typedef unsigned short int yytype_uint16
;
226 typedef YYTYPE_INT16 yytype_int16
;
228 typedef short int yytype_int16
;
232 # ifdef __SIZE_TYPE__
233 # define YYSIZE_T __SIZE_TYPE__
234 # elif defined size_t
235 # define YYSIZE_T size_t
236 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
237 || defined __cplusplus || defined _MSC_VER)
238 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
239 # define YYSIZE_T size_t
241 # define YYSIZE_T unsigned int
245 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
250 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
251 # define YY_(msgid) dgettext ("bison-runtime", msgid)
255 # define YY_(msgid) msgid
259 /* Suppress unused-variable warnings by "using" E. */
260 #if ! defined lint || defined __GNUC__
261 # define YYUSE(e) ((void) (e))
263 # define YYUSE(e) /* empty */
266 /* Identity function, used to suppress warnings about constant conditions. */
270 #if (defined __STDC__ || defined __C99__FUNC__ \
271 || defined __cplusplus || defined _MSC_VER)
284 #if ! defined yyoverflow || YYERROR_VERBOSE
286 /* The parser invokes alloca or malloc; define the necessary symbols. */
288 # ifdef YYSTACK_USE_ALLOCA
289 # if YYSTACK_USE_ALLOCA
291 # define YYSTACK_ALLOC __builtin_alloca
292 # elif defined __BUILTIN_VA_ARG_INCR
293 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
295 # define YYSTACK_ALLOC __alloca
296 # elif defined _MSC_VER
297 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
298 # define alloca _alloca
300 # define YYSTACK_ALLOC alloca
301 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
302 || defined __cplusplus || defined _MSC_VER)
303 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
312 # ifdef YYSTACK_ALLOC
313 /* Pacify GCC's `empty if-body' warning. */
314 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
315 # ifndef YYSTACK_ALLOC_MAXIMUM
316 /* The OS might guarantee only one guard page at the bottom of the stack,
317 and a page size can be as small as 4096 bytes. So we cannot safely
318 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
319 to allow for a few compiler-allocated temporary stack slots. */
320 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
323 # define YYSTACK_ALLOC YYMALLOC
324 # define YYSTACK_FREE YYFREE
325 # ifndef YYSTACK_ALLOC_MAXIMUM
326 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
328 # if (defined __cplusplus && ! defined _STDLIB_H \
329 && ! ((defined YYMALLOC || defined malloc) \
330 && (defined YYFREE || defined free)))
331 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 # define YYMALLOC malloc
338 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
339 || defined __cplusplus || defined _MSC_VER)
340 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
345 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
346 || defined __cplusplus || defined _MSC_VER)
347 void free (void *); /* INFRINGES ON USER NAME SPACE */
351 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
354 #if (! defined yyoverflow \
355 && (! defined __cplusplus \
356 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
358 /* A type that is properly aligned for any stack member. */
365 /* The size of the maximum gap between one aligned stack and the next. */
366 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
368 /* The size of an array large to enough to hold all stacks, each with
370 # define YYSTACK_BYTES(N) \
371 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
372 + YYSTACK_GAP_MAXIMUM)
374 /* Copy COUNT objects from FROM to TO. The source and destination do
377 # if defined __GNUC__ && 1 < __GNUC__
378 # define YYCOPY(To, From, Count) \
379 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
381 # define YYCOPY(To, From, Count) \
385 for (yyi = 0; yyi < (Count); yyi++) \
386 (To)[yyi] = (From)[yyi]; \
392 /* Relocate STACK from its old location to the new one. The
393 local variables YYSIZE and YYSTACKSIZE give the old and new number of
394 elements in the stack, and YYPTR gives the new location of the
395 stack. Advance YYPTR to a properly aligned location for the next
397 # define YYSTACK_RELOCATE(Stack) \
400 YYSIZE_T yynewbytes; \
401 YYCOPY (&yyptr->Stack, Stack, yysize); \
402 Stack = &yyptr->Stack; \
403 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404 yyptr += yynewbytes / sizeof (*yyptr); \
410 /* YYFINAL -- State number of the termination state. */
412 /* YYLAST -- Last index in YYTABLE. */
415 /* YYNTOKENS -- Number of terminals. */
417 /* YYNNTS -- Number of nonterminals. */
419 /* YYNRULES -- Number of rules. */
421 /* YYNRULES -- Number of states. */
422 #define YYNSTATES 125
424 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
426 #define YYMAXUTOK 275
428 #define YYTRANSLATE(YYX) \
429 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
431 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
432 static const yytype_uint8 yytranslate
[] =
434 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 22, 23, 2, 25, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 24, 2,
440 2, 21, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
460 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
461 15, 16, 17, 18, 19, 20
465 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
467 static const yytype_uint16 yyprhs
[] =
469 0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
470 23, 29, 33, 36, 42, 48, 52, 55, 61, 67,
471 71, 74, 78, 82, 86, 89, 91, 94, 96, 101,
472 105, 108, 110, 113, 115, 120, 124, 127, 129, 132,
473 134, 141, 148, 153, 157, 160, 161, 164, 167, 168,
474 173, 177, 181, 184, 185, 187, 190, 193, 194, 197,
475 200, 203, 207, 211, 215, 217, 220, 225, 227, 230,
476 232, 235, 237, 240, 246, 252, 258, 263, 266, 268,
480 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
481 static const yytype_int8 yyrhs
[] =
483 27, 0, -1, 28, -1, -1, 28, 29, -1, 30,
484 -1, 38, -1, 49, -1, 1, -1, 12, 21, 22,
485 31, 23, -1, 12, 21, 22, 31, 1, -1, 12,
486 21, 1, -1, 12, 1, -1, 10, 21, 22, 35,
487 23, -1, 10, 21, 22, 35, 1, -1, 10, 21,
488 1, -1, 10, 1, -1, 11, 21, 22, 33, 23,
489 -1, 11, 21, 22, 33, 1, -1, 11, 21, 1,
490 -1, 11, 1, -1, 13, 21, 20, -1, 14, 21,
491 4, -1, 14, 21, 1, -1, 14, 1, -1, 32,
492 -1, 31, 32, -1, 1, -1, 51, 21, 20, 37,
493 -1, 51, 21, 1, -1, 51, 1, -1, 34, -1,
494 33, 34, -1, 1, -1, 51, 21, 20, 37, -1,
495 51, 21, 1, -1, 51, 1, -1, 36, -1, 35,
496 36, -1, 1, -1, 51, 21, 20, 54, 24, 5,
497 -1, 51, 21, 20, 54, 24, 1, -1, 51, 21,
498 20, 1, -1, 51, 21, 1, -1, 51, 1, -1,
499 -1, 24, 4, -1, 24, 1, -1, -1, 40, 42,
500 39, 46, -1, 16, 21, 41, -1, 16, 21, 1,
501 -1, 16, 1, -1, -1, 20, -1, 25, 20, -1,
502 25, 1, -1, -1, 42, 43, -1, 42, 44, -1,
503 42, 45, -1, 17, 21, 8, -1, 18, 21, 8,
504 -1, 19, 21, 4, -1, 47, -1, 46, 47, -1,
505 50, 53, 48, 9, -1, 6, -1, 48, 6, -1,
506 1, -1, 48, 1, -1, 7, -1, 49, 7, -1,
507 15, 52, 21, 8, 3, -1, 15, 52, 21, 4,
508 3, -1, 15, 52, 21, 51, 1, -1, 15, 52,
509 21, 1, -1, 15, 1, -1, 4, -1, 8, -1,
513 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
514 static const yytype_uint16 yyrline
[] =
516 0, 67, 67, 70, 72, 74, 75, 76, 81, 85,
517 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
518 96, 97, 103, 107, 111, 118, 119, 120, 124, 128,
519 129, 133, 134, 135, 139, 143, 144, 148, 149, 150,
520 154, 158, 159, 160, 161, 166, 169, 173, 178, 177,
521 190, 191, 192, 196, 199, 203, 207, 212, 219, 225,
522 231, 239, 247, 255, 262, 263, 267, 277, 281, 293,
523 294, 297, 298, 312, 316, 321, 326, 331, 338, 339,
528 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
529 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
530 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
531 static const char *const yytname
[] =
533 "$end", "error", "$undefined", "NL", "MCIDENT", "MCFILENAME", "MCLINE",
534 "MCCOMMENT", "MCTOKEN", "MCENDLINE", "MCLANGUAGENAMES",
535 "MCFACILITYNAMES", "MCSEVERITYNAMES", "MCOUTPUTBASE",
536 "MCMESSAGEIDTYPEDEF", "MCLANGUAGE", "MCMESSAGEID", "MCSEVERITY",
537 "MCFACILITY", "MCSYMBOLICNAME", "MCNUMBER", "'='", "'('", "')'", "':'",
538 "'+'", "$accept", "input", "entities", "entity", "global_section",
539 "severitymaps", "severitymap", "facilitymaps", "facilitymap", "langmaps",
540 "langmap", "alias_name", "message", "@1", "id", "vid", "sefasy_def",
541 "severity", "facility", "symbol", "lang_entities", "lang_entity",
542 "lines", "comments", "lang", "token", "lex_want_nl", "lex_want_line",
543 "lex_want_filename", 0
548 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
550 static const yytype_uint16 yytoknum
[] =
552 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
553 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
554 275, 61, 40, 41, 58, 43
558 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
559 static const yytype_uint8 yyr1
[] =
561 0, 26, 27, 28, 28, 29, 29, 29, 29, 30,
562 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
563 30, 30, 30, 30, 30, 31, 31, 31, 32, 32,
564 32, 33, 33, 33, 34, 34, 34, 35, 35, 35,
565 36, 36, 36, 36, 36, 37, 37, 37, 39, 38,
566 40, 40, 40, 41, 41, 41, 41, 42, 42, 42,
567 42, 43, 44, 45, 46, 46, 47, 48, 48, 48,
568 48, 49, 49, 50, 50, 50, 50, 50, 51, 51,
572 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
573 static const yytype_uint8 yyr2
[] =
575 0, 2, 1, 0, 2, 1, 1, 1, 1, 5,
576 5, 3, 2, 5, 5, 3, 2, 5, 5, 3,
577 2, 3, 3, 3, 2, 1, 2, 1, 4, 3,
578 2, 1, 2, 1, 4, 3, 2, 1, 2, 1,
579 6, 6, 4, 3, 2, 0, 2, 2, 0, 4,
580 3, 3, 2, 0, 1, 2, 2, 0, 2, 2,
581 2, 3, 3, 3, 1, 2, 4, 1, 2, 1,
582 2, 1, 2, 5, 5, 5, 4, 2, 1, 1,
586 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
587 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
588 means the default is an error. */
589 static const yytype_uint8 yydefact
[] =
591 3, 0, 0, 1, 8, 71, 0, 0, 0, 0,
592 0, 0, 4, 5, 6, 57, 7, 16, 0, 20,
593 0, 12, 0, 0, 24, 0, 52, 0, 48, 72,
594 15, 0, 19, 0, 11, 0, 21, 23, 22, 51,
595 54, 0, 50, 0, 0, 0, 0, 58, 59, 60,
596 39, 78, 79, 0, 37, 0, 33, 0, 31, 0,
597 27, 0, 25, 0, 56, 55, 0, 0, 0, 0,
598 49, 64, 81, 14, 13, 38, 44, 0, 18, 17,
599 32, 36, 0, 10, 9, 26, 30, 0, 61, 62,
600 63, 77, 0, 65, 0, 43, 0, 35, 45, 29,
601 45, 0, 69, 67, 0, 42, 0, 0, 34, 28,
602 76, 78, 79, 0, 70, 68, 66, 0, 47, 46,
606 /* YYDEFGOTO[NTERM-NUM]. */
607 static const yytype_int8 yydefgoto
[] =
609 -1, 1, 2, 12, 13, 61, 62, 57, 58, 53,
610 54, 108, 14, 46, 15, 42, 28, 47, 48, 49,
611 70, 71, 104, 16, 72, 55, 92, 94, 106
614 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
616 #define YYPACT_NINF -34
617 static const yytype_int8 yypact
[] =
619 -34, 62, 70, -34, -34, -34, 15, 22, 30, -15,
620 34, 37, -34, -34, -34, -34, 56, -34, 10, -34,
621 12, -34, 20, 25, -34, 52, -34, 0, 80, -34,
622 -34, 71, -34, 84, -34, 86, -34, -34, -34, -34,
623 -34, 45, -34, 1, 68, 74, 76, -34, -34, -34,
624 -34, -34, -34, 4, -34, 38, -34, 6, -34, 39,
625 -34, 29, -34, 40, -34, -34, 93, 94, 99, 43,
626 76, -34, -34, -34, -34, -34, -34, 46, -34, -34,
627 -34, -34, 47, -34, -34, -34, -34, 49, -34, -34,
628 -34, -34, 83, -34, 3, -34, 2, -34, 81, -34,
629 81, 92, -34, -34, 48, -34, 82, 72, -34, -34,
630 -34, 104, 105, 108, -34, -34, -34, 73, -34, -34,
631 -34, -34, -34, -34, -34
634 /* YYPGOTO[NTERM-NUM]. */
635 static const yytype_int8 yypgoto
[] =
637 -34, -34, -34, -34, -34, -34, 50, -34, 53, -34,
638 59, 13, -34, -34, -34, -34, -34, -34, -34, -34,
639 -34, 44, -34, -34, -34, -33, -34, -34, -34
642 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
643 positive, shift that token. If negative, reduce the rule which
644 number is the opposite. If zero, do what YYDEFACT says.
645 If YYTABLE_NINF, syntax error. */
646 #define YYTABLE_NINF -83
647 static const yytype_int8 yytable
[] =
649 59, 39, 63, 105, 102, 73, 23, 78, 51, 103,
650 51, 30, 52, 32, 52, -53, 17, -53, -53, -53,
651 40, 34, 66, 19, 59, 41, -82, 74, 63, 79,
652 83, 21, 31, 51, 33, 24, 18, 52, 26, 76,
653 81, 86, 35, 20, 91, 36, 64, 95, 97, 114,
654 99, 22, 84, 37, 115, 25, 38, 116, 27, 77,
655 82, 87, 3, 29, -80, 65, 96, 98, 113, 100,
656 -2, 4, 50, 118, 123, 51, 119, 5, 124, 52,
657 6, 7, 8, 9, 10, 56, 11, 60, 51, 67,
658 51, 69, 52, 110, 52, 68, 111, 43, 44, 45,
659 112, 88, 89, 90, 101, 107, 117, 120, 121, 122,
663 static const yytype_uint8 yycheck
[] =
665 33, 1, 35, 1, 1, 1, 21, 1, 4, 6,
666 4, 1, 8, 1, 8, 15, 1, 17, 18, 19,
667 20, 1, 21, 1, 57, 25, 24, 23, 61, 23,
668 1, 1, 22, 4, 22, 1, 21, 8, 1, 1,
669 1, 1, 22, 21, 1, 20, 1, 1, 1, 1,
670 1, 21, 23, 1, 6, 21, 4, 9, 21, 21,
671 21, 21, 0, 7, 21, 20, 20, 20, 101, 20,
672 0, 1, 1, 1, 1, 4, 4, 7, 5, 8,
673 10, 11, 12, 13, 14, 1, 16, 1, 4, 21,
674 4, 15, 8, 1, 8, 21, 4, 17, 18, 19,
675 8, 8, 8, 4, 21, 24, 24, 3, 3, 1,
679 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
680 symbol of state STATE-NUM. */
681 static const yytype_uint8 yystos
[] =
683 0, 27, 28, 0, 1, 7, 10, 11, 12, 13,
684 14, 16, 29, 30, 38, 40, 49, 1, 21, 1,
685 21, 1, 21, 21, 1, 21, 1, 21, 42, 7,
686 1, 22, 1, 22, 1, 22, 20, 1, 4, 1,
687 20, 25, 41, 17, 18, 19, 39, 43, 44, 45,
688 1, 4, 8, 35, 36, 51, 1, 33, 34, 51,
689 1, 31, 32, 51, 1, 20, 21, 21, 21, 15,
690 46, 47, 50, 1, 23, 36, 1, 21, 1, 23,
691 34, 1, 21, 1, 23, 32, 1, 21, 8, 8,
692 4, 1, 52, 47, 53, 1, 20, 1, 20, 1,
693 20, 21, 1, 6, 48, 1, 54, 24, 37, 37,
694 1, 4, 8, 51, 1, 6, 9, 24, 1, 4,
698 #define yyerrok (yyerrstatus = 0)
699 #define yyclearin (yychar = YYEMPTY)
703 #define YYACCEPT goto yyacceptlab
704 #define YYABORT goto yyabortlab
705 #define YYERROR goto yyerrorlab
708 /* Like YYERROR except do call yyerror. This remains here temporarily
709 to ease the transition to the new meaning of YYERROR, for GCC.
710 Once GCC version 2 has supplanted version 1, this can go. */
712 #define YYFAIL goto yyerrlab
714 #define YYRECOVERING() (!!yyerrstatus)
716 #define YYBACKUP(Token, Value) \
718 if (yychar == YYEMPTY && yylen == 1) \
722 yytoken = YYTRANSLATE (yychar); \
728 yyerror (YY_("syntax error: cannot back up")); \
735 #define YYERRCODE 256
738 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
739 If N is 0, then set CURRENT to the empty location which ends
740 the previous symbol: RHS[0] (always defined). */
742 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
743 #ifndef YYLLOC_DEFAULT
744 # define YYLLOC_DEFAULT(Current, Rhs, N) \
748 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
749 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
750 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
751 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
755 (Current).first_line = (Current).last_line = \
756 YYRHSLOC (Rhs, 0).last_line; \
757 (Current).first_column = (Current).last_column = \
758 YYRHSLOC (Rhs, 0).last_column; \
764 /* YY_LOCATION_PRINT -- Print the location on the stream.
765 This macro was not mandated originally: define only if we know
766 we won't break user code: when these are the locations we know. */
768 #ifndef YY_LOCATION_PRINT
769 # if YYLTYPE_IS_TRIVIAL
770 # define YY_LOCATION_PRINT(File, Loc) \
771 fprintf (File, "%d.%d-%d.%d", \
772 (Loc).first_line, (Loc).first_column, \
773 (Loc).last_line, (Loc).last_column)
775 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
780 /* YYLEX -- calling `yylex' with the right arguments. */
783 # define YYLEX yylex (YYLEX_PARAM)
785 # define YYLEX yylex ()
788 /* Enable debugging if requested. */
792 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
793 # define YYFPRINTF fprintf
796 # define YYDPRINTF(Args) \
802 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
806 YYFPRINTF (stderr, "%s ", Title); \
807 yy_symbol_print (stderr, \
809 YYFPRINTF (stderr, "\n"); \
814 /*--------------------------------.
815 | Print this symbol on YYOUTPUT. |
816 `--------------------------------*/
819 #if (defined __STDC__ || defined __C99__FUNC__ \
820 || defined __cplusplus || defined _MSC_VER)
822 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
825 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
828 YYSTYPE
const * const yyvaluep
;
834 if (yytype
< YYNTOKENS
)
835 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
847 /*--------------------------------.
848 | Print this symbol on YYOUTPUT. |
849 `--------------------------------*/
851 #if (defined __STDC__ || defined __C99__FUNC__ \
852 || defined __cplusplus || defined _MSC_VER)
854 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
857 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
860 YYSTYPE
const * const yyvaluep
;
863 if (yytype
< YYNTOKENS
)
864 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
866 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
868 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
869 YYFPRINTF (yyoutput
, ")");
872 /*------------------------------------------------------------------.
873 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
875 `------------------------------------------------------------------*/
877 #if (defined __STDC__ || defined __C99__FUNC__ \
878 || defined __cplusplus || defined _MSC_VER)
880 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
883 yy_stack_print (bottom
, top
)
884 yytype_int16
*bottom
;
888 YYFPRINTF (stderr
, "Stack now");
889 for (; bottom
<= top
; ++bottom
)
890 YYFPRINTF (stderr
, " %d", *bottom
);
891 YYFPRINTF (stderr
, "\n");
894 # define YY_STACK_PRINT(Bottom, Top) \
897 yy_stack_print ((Bottom), (Top)); \
901 /*------------------------------------------------.
902 | Report that the YYRULE is going to be reduced. |
903 `------------------------------------------------*/
905 #if (defined __STDC__ || defined __C99__FUNC__ \
906 || defined __cplusplus || defined _MSC_VER)
908 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
911 yy_reduce_print (yyvsp
, yyrule
)
916 int yynrhs
= yyr2
[yyrule
];
918 unsigned long int yylno
= yyrline
[yyrule
];
919 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
921 /* The symbols being reduced. */
922 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
924 fprintf (stderr
, " $%d = ", yyi
+ 1);
925 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
926 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
928 fprintf (stderr
, "\n");
932 # define YY_REDUCE_PRINT(Rule) \
935 yy_reduce_print (yyvsp, Rule); \
938 /* Nonzero means print parse trace. It is left uninitialized so that
939 multiple parsers can coexist. */
942 # define YYDPRINTF(Args)
943 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
944 # define YY_STACK_PRINT(Bottom, Top)
945 # define YY_REDUCE_PRINT(Rule)
946 #endif /* !YYDEBUG */
949 /* YYINITDEPTH -- initial size of the parser's stacks. */
951 # define YYINITDEPTH 200
954 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
955 if the built-in stack extension method is used).
957 Do not make this value too large; the results are undefined if
958 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
959 evaluated with infinite-precision integer arithmetic. */
962 # define YYMAXDEPTH 10000
970 # if defined __GLIBC__ && defined _STRING_H
971 # define yystrlen strlen
973 /* Return the length of YYSTR. */
974 #if (defined __STDC__ || defined __C99__FUNC__ \
975 || defined __cplusplus || defined _MSC_VER)
977 yystrlen (const char *yystr
)
985 for (yylen
= 0; yystr
[yylen
]; yylen
++)
993 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
994 # define yystpcpy stpcpy
996 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
998 #if (defined __STDC__ || defined __C99__FUNC__ \
999 || defined __cplusplus || defined _MSC_VER)
1001 yystpcpy (char *yydest
, const char *yysrc
)
1004 yystpcpy (yydest
, yysrc
)
1010 const char *yys
= yysrc
;
1012 while ((*yyd
++ = *yys
++) != '\0')
1021 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1022 quotes and backslashes, so that it's suitable for yyerror. The
1023 heuristic is that double-quoting is unnecessary unless the string
1024 contains an apostrophe, a comma, or backslash (other than
1025 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1026 null, do not copy; instead, return the length of what the result
1029 yytnamerr (char *yyres
, const char *yystr
)
1034 char const *yyp
= yystr
;
1041 goto do_not_strip_quotes
;
1045 goto do_not_strip_quotes
;
1058 do_not_strip_quotes
: ;
1062 return yystrlen (yystr
);
1064 return yystpcpy (yyres
, yystr
) - yyres
;
1068 /* Copy into YYRESULT an error message about the unexpected token
1069 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1070 including the terminating null byte. If YYRESULT is null, do not
1071 copy anything; just return the number of bytes that would be
1072 copied. As a special case, return 0 if an ordinary "syntax error"
1073 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1074 size calculation. */
1076 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1078 int yyn
= yypact
[yystate
];
1080 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1084 int yytype
= YYTRANSLATE (yychar
);
1085 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1086 YYSIZE_T yysize
= yysize0
;
1088 int yysize_overflow
= 0;
1089 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1090 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1094 /* This is so xgettext sees the translatable formats that are
1095 constructed on the fly. */
1096 YY_("syntax error, unexpected %s");
1097 YY_("syntax error, unexpected %s, expecting %s");
1098 YY_("syntax error, unexpected %s, expecting %s or %s");
1099 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1100 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1104 static char const yyunexpected
[] = "syntax error, unexpected %s";
1105 static char const yyexpecting
[] = ", expecting %s";
1106 static char const yyor
[] = " or %s";
1107 char yyformat
[sizeof yyunexpected
1108 + sizeof yyexpecting
- 1
1109 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1110 * (sizeof yyor
- 1))];
1111 char const *yyprefix
= yyexpecting
;
1113 /* Start YYX at -YYN if negative to avoid negative indexes in
1115 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1117 /* Stay within bounds of both yycheck and yytname. */
1118 int yychecklim
= YYLAST
- yyn
+ 1;
1119 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1122 yyarg
[0] = yytname
[yytype
];
1123 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1125 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1126 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1128 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1132 yyformat
[sizeof yyunexpected
- 1] = '\0';
1135 yyarg
[yycount
++] = yytname
[yyx
];
1136 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1137 yysize_overflow
|= (yysize1
< yysize
);
1139 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1143 yyf
= YY_(yyformat
);
1144 yysize1
= yysize
+ yystrlen (yyf
);
1145 yysize_overflow
|= (yysize1
< yysize
);
1148 if (yysize_overflow
)
1149 return YYSIZE_MAXIMUM
;
1153 /* Avoid sprintf, as that infringes on the user's name space.
1154 Don't have undefined behavior even if the translation
1155 produced a string with the wrong number of "%s"s. */
1156 char *yyp
= yyresult
;
1158 while ((*yyp
= *yyf
) != '\0')
1160 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1162 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1175 #endif /* YYERROR_VERBOSE */
1178 /*-----------------------------------------------.
1179 | Release the memory associated to this symbol. |
1180 `-----------------------------------------------*/
1183 #if (defined __STDC__ || defined __C99__FUNC__ \
1184 || defined __cplusplus || defined _MSC_VER)
1186 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1189 yydestruct (yymsg
, yytype
, yyvaluep
)
1199 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1210 /* Prevent warnings from -Wmissing-prototypes. */
1212 #ifdef YYPARSE_PARAM
1213 #if defined __STDC__ || defined __cplusplus
1214 int yyparse (void *YYPARSE_PARAM
);
1218 #else /* ! YYPARSE_PARAM */
1219 #if defined __STDC__ || defined __cplusplus
1224 #endif /* ! YYPARSE_PARAM */
1228 /* The look-ahead symbol. */
1231 /* The semantic value of the look-ahead symbol. */
1234 /* Number of syntax errors so far. */
1243 #ifdef YYPARSE_PARAM
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yyparse (void *YYPARSE_PARAM
)
1250 yyparse (YYPARSE_PARAM
)
1251 void *YYPARSE_PARAM
;
1253 #else /* ! YYPARSE_PARAM */
1254 #if (defined __STDC__ || defined __C99__FUNC__ \
1255 || defined __cplusplus || defined _MSC_VER)
1269 /* Number of tokens to shift before error messages enabled. */
1271 /* Look-ahead token as an internal (translated) token number. */
1274 /* Buffer for error messages, and its allocated size. */
1276 char *yymsg
= yymsgbuf
;
1277 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1280 /* Three stacks and their tools:
1281 `yyss': related to states,
1282 `yyvs': related to semantic values,
1283 `yyls': related to locations.
1285 Refer to the stacks thru separate pointers, to allow yyoverflow
1286 to reallocate them elsewhere. */
1288 /* The state stack. */
1289 yytype_int16 yyssa
[YYINITDEPTH
];
1290 yytype_int16
*yyss
= yyssa
;
1291 yytype_int16
*yyssp
;
1293 /* The semantic value stack. */
1294 YYSTYPE yyvsa
[YYINITDEPTH
];
1295 YYSTYPE
*yyvs
= yyvsa
;
1300 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1302 YYSIZE_T yystacksize
= YYINITDEPTH
;
1304 /* The variables used to return semantic value and location from the
1309 /* The number of symbols on the RHS of the reduced rule.
1310 Keep to zero when no symbol should be popped. */
1313 YYDPRINTF ((stderr
, "Starting parse\n"));
1318 yychar
= YYEMPTY
; /* Cause a token to be read. */
1320 /* Initialize stack pointers.
1321 Waste one element of value and location stack
1322 so that they stay on the same level as the state stack.
1323 The wasted elements are never initialized. */
1330 /*------------------------------------------------------------.
1331 | yynewstate -- Push a new state, which is found in yystate. |
1332 `------------------------------------------------------------*/
1334 /* In all cases, when you get here, the value and location stacks
1335 have just been pushed. So pushing a state here evens the stacks. */
1341 if (yyss
+ yystacksize
- 1 <= yyssp
)
1343 /* Get the current used size of the three stacks, in elements. */
1344 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1348 /* Give user a chance to reallocate the stack. Use copies of
1349 these so that the &'s don't force the real ones into
1351 YYSTYPE
*yyvs1
= yyvs
;
1352 yytype_int16
*yyss1
= yyss
;
1355 /* Each stack pointer address is followed by the size of the
1356 data in use in that stack, in bytes. This used to be a
1357 conditional around just the two extra args, but that might
1358 be undefined if yyoverflow is a macro. */
1359 yyoverflow (YY_("memory exhausted"),
1360 &yyss1
, yysize
* sizeof (*yyssp
),
1361 &yyvs1
, yysize
* sizeof (*yyvsp
),
1368 #else /* no yyoverflow */
1369 # ifndef YYSTACK_RELOCATE
1370 goto yyexhaustedlab
;
1372 /* Extend the stack our own way. */
1373 if (YYMAXDEPTH
<= yystacksize
)
1374 goto yyexhaustedlab
;
1376 if (YYMAXDEPTH
< yystacksize
)
1377 yystacksize
= YYMAXDEPTH
;
1380 yytype_int16
*yyss1
= yyss
;
1381 union yyalloc
*yyptr
=
1382 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1384 goto yyexhaustedlab
;
1385 YYSTACK_RELOCATE (yyss
);
1386 YYSTACK_RELOCATE (yyvs
);
1388 # undef YYSTACK_RELOCATE
1390 YYSTACK_FREE (yyss1
);
1393 #endif /* no yyoverflow */
1395 yyssp
= yyss
+ yysize
- 1;
1396 yyvsp
= yyvs
+ yysize
- 1;
1399 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1400 (unsigned long int) yystacksize
));
1402 if (yyss
+ yystacksize
- 1 <= yyssp
)
1406 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1415 /* Do appropriate processing given the current state. Read a
1416 look-ahead token if we need one and don't already have one. */
1418 /* First try to decide what to do without reference to look-ahead token. */
1419 yyn
= yypact
[yystate
];
1420 if (yyn
== YYPACT_NINF
)
1423 /* Not known => get a look-ahead token if don't already have one. */
1425 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1426 if (yychar
== YYEMPTY
)
1428 YYDPRINTF ((stderr
, "Reading a token: "));
1432 if (yychar
<= YYEOF
)
1434 yychar
= yytoken
= YYEOF
;
1435 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1439 yytoken
= YYTRANSLATE (yychar
);
1440 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1443 /* If the proper action on seeing token YYTOKEN is to reduce or to
1444 detect an error, take that action. */
1446 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1451 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1460 /* Count tokens shifted since error; after three, turn off error
1465 /* Shift the look-ahead token. */
1466 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1468 /* Discard the shifted token unless it is eof. */
1469 if (yychar
!= YYEOF
)
1478 /*-----------------------------------------------------------.
1479 | yydefault -- do the default action for the current state. |
1480 `-----------------------------------------------------------*/
1482 yyn
= yydefact
[yystate
];
1488 /*-----------------------------.
1489 | yyreduce -- Do a reduction. |
1490 `-----------------------------*/
1492 /* yyn is the number of a rule to reduce with. */
1495 /* If YYLEN is nonzero, implement the default value of the action:
1498 Otherwise, the following line sets YYVAL to garbage.
1499 This behavior is undocumented and Bison
1500 users should not rely upon it. Assigning to YYVAL
1501 unconditionally makes the parser a bit smaller, and it avoids a
1502 GCC warning that YYVAL may be used uninitialized. */
1503 yyval
= yyvsp
[1-yylen
];
1506 YY_REDUCE_PRINT (yyn
);
1510 #line 77 "mcparse.y"
1512 cur_node
= mc_add_node ();
1513 cur_node
->user_text
= (yyvsp
[(1) - (1)].ustr
);
1518 #line 81 "mcparse.y"
1519 { mc_fatal ("syntax error"); }
1523 #line 86 "mcparse.y"
1524 { mc_fatal ("missing ')' in SeverityNames"); }
1528 #line 87 "mcparse.y"
1529 { mc_fatal ("missing '(' in SeverityNames"); }
1533 #line 88 "mcparse.y"
1534 { mc_fatal ("missing '=' for SeverityNames"); }
1538 #line 90 "mcparse.y"
1539 { mc_fatal ("missing ')' in LanguageNames"); }
1543 #line 91 "mcparse.y"
1544 { mc_fatal ("missing '(' in LanguageNames"); }
1548 #line 92 "mcparse.y"
1549 { mc_fatal ("missing '=' for LanguageNames"); }
1553 #line 94 "mcparse.y"
1554 { mc_fatal ("missing ')' in FacilityNames"); }
1558 #line 95 "mcparse.y"
1559 { mc_fatal ("missing '(' in FacilityNames"); }
1563 #line 96 "mcparse.y"
1564 { mc_fatal ("missing '=' for FacilityNames"); }
1568 #line 98 "mcparse.y"
1570 if ((yyvsp
[(3) - (3)].ival
) != 10 && (yyvsp
[(3) - (3)].ival
) != 16)
1571 mc_fatal ("OutputBase allows 10 or 16 as value");
1572 mcset_out_values_are_decimal
= ((yyvsp
[(3) - (3)].ival
) == 10 ? 1 : 0);
1577 #line 104 "mcparse.y"
1579 mcset_msg_id_typedef
= (yyvsp
[(3) - (3)].ustr
);
1584 #line 108 "mcparse.y"
1586 mc_fatal ("MessageIdTypedef expects an identifier");
1591 #line 112 "mcparse.y"
1593 mc_fatal ("missing '=' for MessageIdTypedef");
1598 #line 120 "mcparse.y"
1599 { mc_fatal ("severity ident missing"); }
1603 #line 125 "mcparse.y"
1605 mc_add_keyword ((yyvsp
[(1) - (4)].ustr
), MCTOKEN
, "severity", (yyvsp
[(3) - (4)].ival
), (yyvsp
[(4) - (4)].ustr
));
1610 #line 128 "mcparse.y"
1611 { mc_fatal ("severity number missing"); }
1615 #line 129 "mcparse.y"
1616 { mc_fatal ("severity missing '='"); }
1620 #line 135 "mcparse.y"
1621 { mc_fatal ("missing ident in FacilityNames"); }
1625 #line 140 "mcparse.y"
1627 mc_add_keyword ((yyvsp
[(1) - (4)].ustr
), MCTOKEN
, "facility", (yyvsp
[(3) - (4)].ival
), (yyvsp
[(4) - (4)].ustr
));
1632 #line 143 "mcparse.y"
1633 { mc_fatal ("facility number missing"); }
1637 #line 144 "mcparse.y"
1638 { mc_fatal ("facility missing '='"); }
1642 #line 150 "mcparse.y"
1643 { mc_fatal ("missing ident in LanguageNames"); }
1647 #line 155 "mcparse.y"
1649 mc_add_keyword ((yyvsp
[(1) - (6)].ustr
), MCTOKEN
, "language", (yyvsp
[(3) - (6)].ival
), (yyvsp
[(6) - (6)].ustr
));
1654 #line 158 "mcparse.y"
1655 { mc_fatal ("missing filename in LanguageNames"); }
1659 #line 159 "mcparse.y"
1660 { mc_fatal ("missing ':' in LanguageNames"); }
1664 #line 160 "mcparse.y"
1665 { mc_fatal ("missing language code in LanguageNames"); }
1669 #line 161 "mcparse.y"
1670 { mc_fatal ("missing '=' for LanguageNames"); }
1674 #line 166 "mcparse.y"
1676 (yyval
.ustr
) = NULL
;
1681 #line 170 "mcparse.y"
1683 (yyval
.ustr
) = (yyvsp
[(2) - (2)].ustr
);
1688 #line 173 "mcparse.y"
1689 { mc_fatal ("illegal token in identifier"); (yyval
.ustr
) = NULL
; }
1693 #line 178 "mcparse.y"
1695 cur_node
= mc_add_node ();
1696 cur_node
->symbol
= mc_last_symbol
;
1697 cur_node
->facility
= mc_cur_facility
;
1698 cur_node
->severity
= mc_cur_severity
;
1699 cur_node
->id
= ((yyvsp
[(1) - (2)].ival
) & 0xffffUL
);
1700 cur_node
->vid
= ((yyvsp
[(1) - (2)].ival
) & 0xffffUL
) | mc_sefa_val
;
1701 mc_last_id
= (yyvsp
[(1) - (2)].ival
);
1706 #line 190 "mcparse.y"
1707 { (yyval
.ival
) = (yyvsp
[(3) - (3)].ival
); }
1711 #line 191 "mcparse.y"
1712 { mc_fatal ("missing number in MessageId"); (yyval
.ival
) = 0; }
1716 #line 192 "mcparse.y"
1717 { mc_fatal ("missing '=' for MessageId"); (yyval
.ival
) = 0; }
1721 #line 196 "mcparse.y"
1723 (yyval
.ival
) = ++mc_last_id
;
1728 #line 200 "mcparse.y"
1730 (yyval
.ival
) = (yyvsp
[(1) - (1)].ival
);
1735 #line 204 "mcparse.y"
1737 (yyval
.ival
) = mc_last_id
+ (yyvsp
[(2) - (2)].ival
);
1742 #line 207 "mcparse.y"
1743 { mc_fatal ("missing number after MessageId '+'"); }
1747 #line 212 "mcparse.y"
1750 mc_sefa_val
= (mcset_custom_bit
? 1 : 0) << 29;
1751 mc_last_symbol
= NULL
;
1752 mc_cur_severity
= NULL
;
1753 mc_cur_facility
= NULL
;
1758 #line 220 "mcparse.y"
1760 if ((yyvsp
[(1) - (2)].ival
) & 1)
1761 mc_warn (_("duplicate definition of Severity"));
1762 (yyval
.ival
) = (yyvsp
[(1) - (2)].ival
) | 1;
1767 #line 226 "mcparse.y"
1769 if ((yyvsp
[(1) - (2)].ival
) & 2)
1770 mc_warn (_("duplicate definition of Facility"));
1771 (yyval
.ival
) = (yyvsp
[(1) - (2)].ival
) | 2;
1776 #line 232 "mcparse.y"
1778 if ((yyvsp
[(1) - (2)].ival
) & 4)
1779 mc_warn (_("duplicate definition of SymbolicName"));
1780 (yyval
.ival
) = (yyvsp
[(1) - (2)].ival
) | 4;
1785 #line 240 "mcparse.y"
1787 mc_sefa_val
&= ~ (0x3UL
<< 30);
1788 mc_sefa_val
|= (((yyvsp
[(3) - (3)].tok
)->nval
& 0x3UL
) << 30);
1789 mc_cur_severity
= (yyvsp
[(3) - (3)].tok
);
1794 #line 248 "mcparse.y"
1796 mc_sefa_val
&= ~ (0xfffUL
<< 16);
1797 mc_sefa_val
|= (((yyvsp
[(3) - (3)].tok
)->nval
& 0xfffUL
) << 16);
1798 mc_cur_facility
= (yyvsp
[(3) - (3)].tok
);
1803 #line 256 "mcparse.y"
1805 mc_last_symbol
= (yyvsp
[(3) - (3)].ustr
);
1810 #line 268 "mcparse.y"
1813 h
= mc_add_node_lang (cur_node
, (yyvsp
[(1) - (4)].tok
), cur_node
->vid
);
1814 h
->message
= (yyvsp
[(3) - (4)].ustr
);
1815 if (mcset_max_message_length
!= 0 && unichar_len (h
->message
) > mcset_max_message_length
)
1816 mc_warn ("message length to long");
1821 #line 278 "mcparse.y"
1823 (yyval
.ustr
) = (yyvsp
[(1) - (1)].ustr
);
1828 #line 282 "mcparse.y"
1832 l1
= unichar_len ((yyvsp
[(1) - (2)].ustr
));
1833 l2
= unichar_len ((yyvsp
[(2) - (2)].ustr
));
1834 h
= (unichar
*) res_alloc ((l1
+ l2
+ 1) * sizeof (unichar
));
1835 if (l1
) memcpy (h
, (yyvsp
[(1) - (2)].ustr
), l1
* sizeof (unichar
));
1836 if (l2
) memcpy (&h
[l1
], (yyvsp
[(2) - (2)].ustr
), l2
* sizeof (unichar
));
1843 #line 293 "mcparse.y"
1844 { mc_fatal ("missing end of message text"); (yyval
.ustr
) = NULL
; }
1848 #line 294 "mcparse.y"
1849 { mc_fatal ("missing end of message text"); (yyval
.ustr
) = (yyvsp
[(1) - (2)].ustr
); }
1853 #line 297 "mcparse.y"
1854 { (yyval
.ustr
) = (yyvsp
[(1) - (1)].ustr
); }
1858 #line 299 "mcparse.y"
1862 l1
= unichar_len ((yyvsp
[(1) - (2)].ustr
));
1863 l2
= unichar_len ((yyvsp
[(2) - (2)].ustr
));
1864 h
= (unichar
*) res_alloc ((l1
+ l2
+ 1) * sizeof (unichar
));
1865 if (l1
) memcpy (h
, (yyvsp
[(1) - (2)].ustr
), l1
* sizeof (unichar
));
1866 if (l2
) memcpy (&h
[l1
], (yyvsp
[(2) - (2)].ustr
), l2
* sizeof (unichar
));
1873 #line 313 "mcparse.y"
1875 (yyval
.tok
) = (yyvsp
[(4) - (5)].tok
);
1880 #line 317 "mcparse.y"
1883 mc_fatal (_("undeclared language identifier"));
1888 #line 322 "mcparse.y"
1891 mc_fatal ("missing newline after Language");
1896 #line 327 "mcparse.y"
1899 mc_fatal ("missing ident for Language");
1904 #line 332 "mcparse.y"
1907 mc_fatal ("missing '=' for Language");
1912 #line 338 "mcparse.y"
1913 { (yyval
.ustr
) = (yyvsp
[(1) - (1)].ustr
); }
1917 #line 339 "mcparse.y"
1918 { (yyval
.ustr
) = (yyvsp
[(1) - (1)].tok
)->usz
; }
1922 #line 343 "mcparse.y"
1923 { mclex_want_nl
= 1; }
1927 #line 347 "mcparse.y"
1928 { mclex_want_line
= 1; }
1932 #line 351 "mcparse.y"
1933 { mclex_want_filename
= 1; }
1937 /* Line 1267 of yacc.c. */
1938 #line 1939 "mcparse.c"
1941 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1945 YY_STACK_PRINT (yyss
, yyssp
);
1950 /* Now `shift' the result of the reduction. Determine what state
1951 that goes to, based on the state we popped back to and the rule
1952 number reduced by. */
1956 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1957 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1958 yystate
= yytable
[yystate
];
1960 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1965 /*------------------------------------.
1966 | yyerrlab -- here on detecting error |
1967 `------------------------------------*/
1969 /* If not already recovering from an error, report this error. */
1973 #if ! YYERROR_VERBOSE
1974 yyerror (YY_("syntax error"));
1977 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
1978 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
1980 YYSIZE_T yyalloc
= 2 * yysize
;
1981 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
1982 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
1983 if (yymsg
!= yymsgbuf
)
1984 YYSTACK_FREE (yymsg
);
1985 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
1987 yymsg_alloc
= yyalloc
;
1991 yymsg_alloc
= sizeof yymsgbuf
;
1995 if (0 < yysize
&& yysize
<= yymsg_alloc
)
1997 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2002 yyerror (YY_("syntax error"));
2004 goto yyexhaustedlab
;
2012 if (yyerrstatus
== 3)
2014 /* If just tried and failed to reuse look-ahead token after an
2015 error, discard it. */
2017 if (yychar
<= YYEOF
)
2019 /* Return failure if at end of input. */
2020 if (yychar
== YYEOF
)
2025 yydestruct ("Error: discarding",
2031 /* Else will try to reuse look-ahead token after shifting the error
2036 /*---------------------------------------------------.
2037 | yyerrorlab -- error raised explicitly by YYERROR. |
2038 `---------------------------------------------------*/
2041 /* Pacify compilers like GCC when the user code never invokes
2042 YYERROR and the label yyerrorlab therefore never appears in user
2044 if (/*CONSTCOND*/ 0)
2047 /* Do not reclaim the symbols of the rule which action triggered
2051 YY_STACK_PRINT (yyss
, yyssp
);
2056 /*-------------------------------------------------------------.
2057 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2058 `-------------------------------------------------------------*/
2060 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2064 yyn
= yypact
[yystate
];
2065 if (yyn
!= YYPACT_NINF
)
2068 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2076 /* Pop the current state because it cannot handle the error token. */
2081 yydestruct ("Error: popping",
2082 yystos
[yystate
], yyvsp
);
2085 YY_STACK_PRINT (yyss
, yyssp
);
2094 /* Shift the error token. */
2095 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2101 /*-------------------------------------.
2102 | yyacceptlab -- YYACCEPT comes here. |
2103 `-------------------------------------*/
2108 /*-----------------------------------.
2109 | yyabortlab -- YYABORT comes here. |
2110 `-----------------------------------*/
2116 /*-------------------------------------------------.
2117 | yyexhaustedlab -- memory exhaustion comes here. |
2118 `-------------------------------------------------*/
2120 yyerror (YY_("memory exhausted"));
2126 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2127 yydestruct ("Cleanup: discarding lookahead",
2129 /* Do not reclaim the symbols of the rule which action triggered
2130 this YYABORT or YYACCEPT. */
2132 YY_STACK_PRINT (yyss
, yyssp
);
2133 while (yyssp
!= yyss
)
2135 yydestruct ("Cleanup: popping",
2136 yystos
[*yyssp
], yyvsp
);
2141 YYSTACK_FREE (yyss
);
2144 if (yymsg
!= yymsgbuf
)
2145 YYSTACK_FREE (yymsg
);
2147 /* Make sure YYID is used. */
2148 return YYID (yyresult
);
2152 #line 354 "mcparse.y"
2155 /* Something else. */