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
115 Copyright (C) 2007-2014 Free Software Foundation, Inc.
117 Parser for Windows mc files
118 Written by Kai Tietz, Onevision.
120 This file is part of GNU Binutils.
122 This program is free software; you can redistribute it and/or modify
123 it under the terms of the GNU General Public License as published by
124 the Free Software Foundation; either version 3 of the License, or
125 (at your option) any later version.
127 This program is distributed in the hope that it will be useful,
128 but WITHOUT ANY WARRANTY; without even the implied warranty of
129 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130 GNU General Public License for more details.
132 You should have received a copy of the GNU General Public License
133 along with this program; if not, write to the Free Software
134 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
137 /* This is a parser for Windows rc files. It is based on the parser
138 by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
143 #include "libiberty.h"
145 #include "safe-ctype.h"
147 static rc_uint_type mc_last_id = 0;
148 static rc_uint_type mc_sefa_val = 0;
149 static unichar *mc_last_symbol = NULL;
150 static const mc_keyword *mc_cur_severity = NULL;
151 static const mc_keyword *mc_cur_facility = NULL;
152 static mc_node *cur_node = NULL;
156 /* Enabling traces. */
161 /* Enabling verbose error messages. */
162 #ifdef YYERROR_VERBOSE
163 # undef YYERROR_VERBOSE
164 # define YYERROR_VERBOSE 1
166 # define YYERROR_VERBOSE 0
169 /* Enabling the token table. */
170 #ifndef YYTOKEN_TABLE
171 # define YYTOKEN_TABLE 0
174 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
175 typedef union YYSTYPE
180 const mc_keyword *tok;
183 /* Line 193 of yacc.c. */
184 #line 185 "mcparse.c"
186 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
187 # define YYSTYPE_IS_DECLARED 1
188 # define YYSTYPE_IS_TRIVIAL 1
193 /* Copy the second part of user declarations. */
196 /* Line 216 of yacc.c. */
197 #line 198 "mcparse.c"
204 typedef YYTYPE_UINT8 yytype_uint8;
206 typedef unsigned char yytype_uint8;
210 typedef YYTYPE_INT8 yytype_int8;
211 #elif (defined __STDC__ || defined __C99__FUNC__ \
212 || defined __cplusplus || defined _MSC_VER)
213 typedef signed char yytype_int8;
215 typedef short int yytype_int8;
219 typedef YYTYPE_UINT16 yytype_uint16;
221 typedef unsigned short int yytype_uint16;
225 typedef YYTYPE_INT16 yytype_int16;
227 typedef short int yytype_int16;
231 # ifdef __SIZE_TYPE__
232 # define YYSIZE_T __SIZE_TYPE__
233 # elif defined size_t
234 # define YYSIZE_T size_t
235 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
236 || defined __cplusplus || defined _MSC_VER)
237 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
238 # define YYSIZE_T size_t
240 # define YYSIZE_T unsigned int
244 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
247 # if defined YYENABLE_NLS && YYENABLE_NLS
249 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
250 # define YY_(msgid) dgettext ("bison-runtime", msgid)
254 # define YY_(msgid) msgid
258 /* Suppress unused-variable warnings by "using" E. */
259 #if ! defined lint || defined __GNUC__
260 # define YYUSE(e) ((void) (e))
262 # define YYUSE(e) /* empty */
265 /* Identity function, used to suppress warnings about constant conditions. */
269 #if (defined __STDC__ || defined __C99__FUNC__ \
270 || defined __cplusplus || defined _MSC_VER)
283 #if ! defined yyoverflow || YYERROR_VERBOSE
285 /* The parser invokes alloca or malloc; define the necessary symbols. */
287 # ifdef YYSTACK_USE_ALLOCA
288 # if YYSTACK_USE_ALLOCA
290 # define YYSTACK_ALLOC __builtin_alloca
291 # elif defined __BUILTIN_VA_ARG_INCR
292 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
294 # define YYSTACK_ALLOC __alloca
295 # elif defined _MSC_VER
296 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
297 # define alloca _alloca
299 # define YYSTACK_ALLOC alloca
300 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
301 || defined __cplusplus || defined _MSC_VER)
302 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311 # ifdef YYSTACK_ALLOC
312 /* Pacify GCC's `empty if-body' warning. */
313 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
314 # ifndef YYSTACK_ALLOC_MAXIMUM
315 /* The OS might guarantee only one guard page at the bottom of the stack,
316 and a page size can be as small as 4096 bytes. So we cannot safely
317 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
318 to allow for a few compiler-allocated temporary stack slots. */
319 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
322 # define YYSTACK_ALLOC YYMALLOC
323 # define YYSTACK_FREE YYFREE
324 # ifndef YYSTACK_ALLOC_MAXIMUM
325 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
327 # if (defined __cplusplus && ! defined _STDLIB_H \
328 && ! ((defined YYMALLOC || defined malloc) \
329 && (defined YYFREE || defined free)))
330 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
336 # define YYMALLOC malloc
337 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
338 || defined __cplusplus || defined _MSC_VER)
339 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
344 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
345 || defined __cplusplus || defined _MSC_VER)
346 void free (void *); /* INFRINGES ON USER NAME SPACE */
350 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
353 #if (! defined yyoverflow \
354 && (! defined __cplusplus \
355 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
357 /* A type that is properly aligned for any stack member. */
364 /* The size of the maximum gap between one aligned stack and the next. */
365 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
367 /* The size of an array large to enough to hold all stacks, each with
369 # define YYSTACK_BYTES(N) \
370 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
371 + YYSTACK_GAP_MAXIMUM)
373 /* Copy COUNT objects from FROM to TO. The source and destination do
376 # if defined __GNUC__ && 1 < __GNUC__
377 # define YYCOPY(To, From, Count) \
378 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
380 # define YYCOPY(To, From, Count) \
384 for (yyi = 0; yyi < (Count); yyi++) \
385 (To)[yyi] = (From)[yyi]; \
391 /* Relocate STACK from its old location to the new one. The
392 local variables YYSIZE and YYSTACKSIZE give the old and new number of
393 elements in the stack, and YYPTR gives the new location of the
394 stack. Advance YYPTR to a properly aligned location for the next
396 # define YYSTACK_RELOCATE(Stack) \
399 YYSIZE_T yynewbytes; \
400 YYCOPY (&yyptr->Stack, Stack, yysize); \
401 Stack = &yyptr->Stack; \
402 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
403 yyptr += yynewbytes / sizeof (*yyptr); \
409 /* YYFINAL -- State number of the termination state. */
411 /* YYLAST -- Last index in YYTABLE. */
414 /* YYNTOKENS -- Number of terminals. */
416 /* YYNNTS -- Number of nonterminals. */
418 /* YYNRULES -- Number of rules. */
420 /* YYNRULES -- Number of states. */
421 #define YYNSTATES 125
423 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
425 #define YYMAXUTOK 275
427 #define YYTRANSLATE(YYX) \
428 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
430 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
431 static const yytype_uint8 yytranslate[] =
433 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 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 22, 23, 2, 25, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 24, 2,
439 2, 21, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 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, 1, 2, 3, 4,
459 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
460 15, 16, 17, 18, 19, 20
464 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
466 static const yytype_uint16 yyprhs[] =
468 0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
469 23, 29, 33, 36, 42, 48, 52, 55, 61, 67,
470 71, 74, 78, 82, 86, 89, 91, 94, 96, 101,
471 105, 108, 110, 113, 115, 120, 124, 127, 129, 132,
472 134, 141, 148, 153, 157, 160, 161, 164, 167, 168,
473 173, 177, 181, 184, 185, 187, 190, 193, 194, 197,
474 200, 203, 207, 211, 215, 217, 220, 225, 227, 230,
475 232, 235, 237, 240, 246, 252, 258, 263, 266, 268,
479 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
480 static const yytype_int8 yyrhs[] =
482 27, 0, -1, 28, -1, -1, 28, 29, -1, 30,
483 -1, 38, -1, 49, -1, 1, -1, 12, 21, 22,
484 31, 23, -1, 12, 21, 22, 31, 1, -1, 12,
485 21, 1, -1, 12, 1, -1, 10, 21, 22, 35,
486 23, -1, 10, 21, 22, 35, 1, -1, 10, 21,
487 1, -1, 10, 1, -1, 11, 21, 22, 33, 23,
488 -1, 11, 21, 22, 33, 1, -1, 11, 21, 1,
489 -1, 11, 1, -1, 13, 21, 20, -1, 14, 21,
490 4, -1, 14, 21, 1, -1, 14, 1, -1, 32,
491 -1, 31, 32, -1, 1, -1, 51, 21, 20, 37,
492 -1, 51, 21, 1, -1, 51, 1, -1, 34, -1,
493 33, 34, -1, 1, -1, 51, 21, 20, 37, -1,
494 51, 21, 1, -1, 51, 1, -1, 36, -1, 35,
495 36, -1, 1, -1, 51, 21, 20, 54, 24, 5,
496 -1, 51, 21, 20, 54, 24, 1, -1, 51, 21,
497 20, 1, -1, 51, 21, 1, -1, 51, 1, -1,
498 -1, 24, 4, -1, 24, 1, -1, -1, 40, 42,
499 39, 46, -1, 16, 21, 41, -1, 16, 21, 1,
500 -1, 16, 1, -1, -1, 20, -1, 25, 20, -1,
501 25, 1, -1, -1, 42, 43, -1, 42, 44, -1,
502 42, 45, -1, 17, 21, 8, -1, 18, 21, 8,
503 -1, 19, 21, 4, -1, 47, -1, 46, 47, -1,
504 50, 53, 48, 9, -1, 6, -1, 48, 6, -1,
505 1, -1, 48, 1, -1, 7, -1, 49, 7, -1,
506 15, 52, 21, 8, 3, -1, 15, 52, 21, 4,
507 3, -1, 15, 52, 21, 51, 1, -1, 15, 52,
508 21, 1, -1, 15, 1, -1, 4, -1, 8, -1,
512 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
513 static const yytype_uint16 yyrline[] =
515 0, 66, 66, 69, 71, 73, 74, 75, 80, 84,
516 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
517 95, 96, 102, 106, 110, 117, 118, 119, 123, 127,
518 128, 132, 133, 134, 138, 142, 143, 147, 148, 149,
519 153, 157, 158, 159, 160, 165, 168, 172, 177, 176,
520 189, 190, 191, 195, 198, 202, 206, 211, 218, 224,
521 230, 238, 246, 254, 261, 262, 266, 276, 280, 292,
522 293, 296, 297, 311, 315, 320, 325, 330, 337, 338,
527 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
528 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
529 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
530 static const char *const yytname[] =
532 "$end", "error", "$undefined", "NL", "MCIDENT", "MCFILENAME", "MCLINE",
533 "MCCOMMENT", "MCTOKEN", "MCENDLINE", "MCLANGUAGENAMES",
534 "MCFACILITYNAMES", "MCSEVERITYNAMES", "MCOUTPUTBASE",
535 "MCMESSAGEIDTYPEDEF", "MCLANGUAGE", "MCMESSAGEID", "MCSEVERITY",
536 "MCFACILITY", "MCSYMBOLICNAME", "MCNUMBER", "'='", "'('", "')'", "':'",
537 "'+'", "$accept", "input", "entities", "entity", "global_section",
538 "severitymaps", "severitymap", "facilitymaps", "facilitymap", "langmaps",
539 "langmap", "alias_name", "message", "@1", "id", "vid", "sefasy_def",
540 "severity", "facility", "symbol", "lang_entities", "lang_entity",
541 "lines", "comments", "lang", "token", "lex_want_nl", "lex_want_line",
542 "lex_want_filename", 0
547 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
549 static const yytype_uint16 yytoknum[] =
551 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
552 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
553 275, 61, 40, 41, 58, 43
557 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
558 static const yytype_uint8 yyr1[] =
560 0, 26, 27, 28, 28, 29, 29, 29, 29, 30,
561 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
562 30, 30, 30, 30, 30, 31, 31, 31, 32, 32,
563 32, 33, 33, 33, 34, 34, 34, 35, 35, 35,
564 36, 36, 36, 36, 36, 37, 37, 37, 39, 38,
565 40, 40, 40, 41, 41, 41, 41, 42, 42, 42,
566 42, 43, 44, 45, 46, 46, 47, 48, 48, 48,
567 48, 49, 49, 50, 50, 50, 50, 50, 51, 51,
571 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
572 static const yytype_uint8 yyr2[] =
574 0, 2, 1, 0, 2, 1, 1, 1, 1, 5,
575 5, 3, 2, 5, 5, 3, 2, 5, 5, 3,
576 2, 3, 3, 3, 2, 1, 2, 1, 4, 3,
577 2, 1, 2, 1, 4, 3, 2, 1, 2, 1,
578 6, 6, 4, 3, 2, 0, 2, 2, 0, 4,
579 3, 3, 2, 0, 1, 2, 2, 0, 2, 2,
580 2, 3, 3, 3, 1, 2, 4, 1, 2, 1,
581 2, 1, 2, 5, 5, 5, 4, 2, 1, 1,
585 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
586 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
587 means the default is an error. */
588 static const yytype_uint8 yydefact[] =
590 3, 0, 0, 1, 8, 71, 0, 0, 0, 0,
591 0, 0, 4, 5, 6, 57, 7, 16, 0, 20,
592 0, 12, 0, 0, 24, 0, 52, 0, 48, 72,
593 15, 0, 19, 0, 11, 0, 21, 23, 22, 51,
594 54, 0, 50, 0, 0, 0, 0, 58, 59, 60,
595 39, 78, 79, 0, 37, 0, 33, 0, 31, 0,
596 27, 0, 25, 0, 56, 55, 0, 0, 0, 0,
597 49, 64, 81, 14, 13, 38, 44, 0, 18, 17,
598 32, 36, 0, 10, 9, 26, 30, 0, 61, 62,
599 63, 77, 0, 65, 0, 43, 0, 35, 45, 29,
600 45, 0, 69, 67, 0, 42, 0, 0, 34, 28,
601 76, 78, 79, 0, 70, 68, 66, 0, 47, 46,
605 /* YYDEFGOTO[NTERM-NUM]. */
606 static const yytype_int8 yydefgoto[] =
608 -1, 1, 2, 12, 13, 61, 62, 57, 58, 53,
609 54, 108, 14, 46, 15, 42, 28, 47, 48, 49,
610 70, 71, 104, 16, 72, 55, 92, 94, 106
613 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
615 #define YYPACT_NINF -34
616 static const yytype_int8 yypact[] =
618 -34, 62, 70, -34, -34, -34, 15, 22, 30, -15,
619 34, 37, -34, -34, -34, -34, 56, -34, 10, -34,
620 12, -34, 20, 25, -34, 52, -34, 0, 80, -34,
621 -34, 71, -34, 84, -34, 86, -34, -34, -34, -34,
622 -34, 45, -34, 1, 68, 74, 76, -34, -34, -34,
623 -34, -34, -34, 4, -34, 38, -34, 6, -34, 39,
624 -34, 29, -34, 40, -34, -34, 93, 94, 99, 43,
625 76, -34, -34, -34, -34, -34, -34, 46, -34, -34,
626 -34, -34, 47, -34, -34, -34, -34, 49, -34, -34,
627 -34, -34, 83, -34, 3, -34, 2, -34, 81, -34,
628 81, 92, -34, -34, 48, -34, 82, 72, -34, -34,
629 -34, 104, 105, 108, -34, -34, -34, 73, -34, -34,
630 -34, -34, -34, -34, -34
633 /* YYPGOTO[NTERM-NUM]. */
634 static const yytype_int8 yypgoto[] =
636 -34, -34, -34, -34, -34, -34, 50, -34, 53, -34,
637 59, 13, -34, -34, -34, -34, -34, -34, -34, -34,
638 -34, 44, -34, -34, -34, -33, -34, -34, -34
641 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
642 positive, shift that token. If negative, reduce the rule which
643 number is the opposite. If zero, do what YYDEFACT says.
644 If YYTABLE_NINF, syntax error. */
645 #define YYTABLE_NINF -83
646 static const yytype_int8 yytable[] =
648 59, 39, 63, 105, 102, 73, 23, 78, 51, 103,
649 51, 30, 52, 32, 52, -53, 17, -53, -53, -53,
650 40, 34, 66, 19, 59, 41, -82, 74, 63, 79,
651 83, 21, 31, 51, 33, 24, 18, 52, 26, 76,
652 81, 86, 35, 20, 91, 36, 64, 95, 97, 114,
653 99, 22, 84, 37, 115, 25, 38, 116, 27, 77,
654 82, 87, 3, 29, -80, 65, 96, 98, 113, 100,
655 -2, 4, 50, 118, 123, 51, 119, 5, 124, 52,
656 6, 7, 8, 9, 10, 56, 11, 60, 51, 67,
657 51, 69, 52, 110, 52, 68, 111, 43, 44, 45,
658 112, 88, 89, 90, 101, 107, 117, 120, 121, 122,
662 static const yytype_uint8 yycheck[] =
664 33, 1, 35, 1, 1, 1, 21, 1, 4, 6,
665 4, 1, 8, 1, 8, 15, 1, 17, 18, 19,
666 20, 1, 21, 1, 57, 25, 24, 23, 61, 23,
667 1, 1, 22, 4, 22, 1, 21, 8, 1, 1,
668 1, 1, 22, 21, 1, 20, 1, 1, 1, 1,
669 1, 21, 23, 1, 6, 21, 4, 9, 21, 21,
670 21, 21, 0, 7, 21, 20, 20, 20, 101, 20,
671 0, 1, 1, 1, 1, 4, 4, 7, 5, 8,
672 10, 11, 12, 13, 14, 1, 16, 1, 4, 21,
673 4, 15, 8, 1, 8, 21, 4, 17, 18, 19,
674 8, 8, 8, 4, 21, 24, 24, 3, 3, 1,
678 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
679 symbol of state STATE-NUM. */
680 static const yytype_uint8 yystos[] =
682 0, 27, 28, 0, 1, 7, 10, 11, 12, 13,
683 14, 16, 29, 30, 38, 40, 49, 1, 21, 1,
684 21, 1, 21, 21, 1, 21, 1, 21, 42, 7,
685 1, 22, 1, 22, 1, 22, 20, 1, 4, 1,
686 20, 25, 41, 17, 18, 19, 39, 43, 44, 45,
687 1, 4, 8, 35, 36, 51, 1, 33, 34, 51,
688 1, 31, 32, 51, 1, 20, 21, 21, 21, 15,
689 46, 47, 50, 1, 23, 36, 1, 21, 1, 23,
690 34, 1, 21, 1, 23, 32, 1, 21, 8, 8,
691 4, 1, 52, 47, 53, 1, 20, 1, 20, 1,
692 20, 21, 1, 6, 48, 1, 54, 24, 37, 37,
693 1, 4, 8, 51, 1, 6, 9, 24, 1, 4,
697 #define yyerrok (yyerrstatus = 0)
698 #define yyclearin (yychar = YYEMPTY)
702 #define YYACCEPT goto yyacceptlab
703 #define YYABORT goto yyabortlab
704 #define YYERROR goto yyerrorlab
707 /* Like YYERROR except do call yyerror. This remains here temporarily
708 to ease the transition to the new meaning of YYERROR, for GCC.
709 Once GCC version 2 has supplanted version 1, this can go. */
711 #define YYFAIL goto yyerrlab
713 #define YYRECOVERING() (!!yyerrstatus)
715 #define YYBACKUP(Token, Value) \
717 if (yychar == YYEMPTY && yylen == 1) \
721 yytoken = YYTRANSLATE (yychar); \
727 yyerror (YY_("syntax error: cannot back up")); \
734 #define YYERRCODE 256
737 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
738 If N is 0, then set CURRENT to the empty location which ends
739 the previous symbol: RHS[0] (always defined). */
741 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
742 #ifndef YYLLOC_DEFAULT
743 # define YYLLOC_DEFAULT(Current, Rhs, N) \
747 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
748 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
749 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
750 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
754 (Current).first_line = (Current).last_line = \
755 YYRHSLOC (Rhs, 0).last_line; \
756 (Current).first_column = (Current).last_column = \
757 YYRHSLOC (Rhs, 0).last_column; \
763 /* YY_LOCATION_PRINT -- Print the location on the stream.
764 This macro was not mandated originally: define only if we know
765 we won't break user code: when these are the locations we know. */
767 #ifndef YY_LOCATION_PRINT
768 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
769 # define YY_LOCATION_PRINT(File, Loc) \
770 fprintf (File, "%d.%d-%d.%d", \
771 (Loc).first_line, (Loc).first_column, \
772 (Loc).last_line, (Loc).last_column)
774 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
779 /* YYLEX -- calling `yylex' with the right arguments. */
782 # define YYLEX yylex (YYLEX_PARAM)
784 # define YYLEX yylex ()
787 /* Enable debugging if requested. */
791 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
792 # define YYFPRINTF fprintf
795 # define YYDPRINTF(Args) \
801 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
805 YYFPRINTF (stderr, "%s ", Title); \
806 yy_symbol_print (stderr, \
808 YYFPRINTF (stderr, "\n"); \
813 /*--------------------------------.
814 | Print this symbol on YYOUTPUT. |
815 `--------------------------------*/
818 #if (defined __STDC__ || defined __C99__FUNC__ \
819 || defined __cplusplus || defined _MSC_VER)
821 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
824 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
827 YYSTYPE const * const yyvaluep;
833 if (yytype < YYNTOKENS)
834 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
846 /*--------------------------------.
847 | Print this symbol on YYOUTPUT. |
848 `--------------------------------*/
850 #if (defined __STDC__ || defined __C99__FUNC__ \
851 || defined __cplusplus || defined _MSC_VER)
853 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
856 yy_symbol_print (yyoutput, yytype, yyvaluep)
859 YYSTYPE const * const yyvaluep;
862 if (yytype < YYNTOKENS)
863 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
865 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
867 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
868 YYFPRINTF (yyoutput, ")");
871 /*------------------------------------------------------------------.
872 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
874 `------------------------------------------------------------------*/
876 #if (defined __STDC__ || defined __C99__FUNC__ \
877 || defined __cplusplus || defined _MSC_VER)
879 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
882 yy_stack_print (bottom, top)
883 yytype_int16 *bottom;
887 YYFPRINTF (stderr, "Stack now");
888 for (; bottom <= top; ++bottom)
889 YYFPRINTF (stderr, " %d", *bottom);
890 YYFPRINTF (stderr, "\n");
893 # define YY_STACK_PRINT(Bottom, Top) \
896 yy_stack_print ((Bottom), (Top)); \
900 /*------------------------------------------------.
901 | Report that the YYRULE is going to be reduced. |
902 `------------------------------------------------*/
904 #if (defined __STDC__ || defined __C99__FUNC__ \
905 || defined __cplusplus || defined _MSC_VER)
907 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
910 yy_reduce_print (yyvsp, yyrule)
915 int yynrhs = yyr2[yyrule];
917 unsigned long int yylno = yyrline[yyrule];
918 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
920 /* The symbols being reduced. */
921 for (yyi = 0; yyi < yynrhs; yyi++)
923 fprintf (stderr, " $%d = ", yyi + 1);
924 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
925 &(yyvsp[(yyi + 1) - (yynrhs)])
927 fprintf (stderr, "\n");
931 # define YY_REDUCE_PRINT(Rule) \
934 yy_reduce_print (yyvsp, Rule); \
937 /* Nonzero means print parse trace. It is left uninitialized so that
938 multiple parsers can coexist. */
941 # define YYDPRINTF(Args)
942 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
943 # define YY_STACK_PRINT(Bottom, Top)
944 # define YY_REDUCE_PRINT(Rule)
945 #endif /* !YYDEBUG */
948 /* YYINITDEPTH -- initial size of the parser's stacks. */
950 # define YYINITDEPTH 200
953 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
954 if the built-in stack extension method is used).
956 Do not make this value too large; the results are undefined if
957 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
958 evaluated with infinite-precision integer arithmetic. */
961 # define YYMAXDEPTH 10000
969 # if defined __GLIBC__ && defined _STRING_H
970 # define yystrlen strlen
972 /* Return the length of YYSTR. */
973 #if (defined __STDC__ || defined __C99__FUNC__ \
974 || defined __cplusplus || defined _MSC_VER)
976 yystrlen (const char *yystr)
984 for (yylen = 0; yystr[yylen]; yylen++)
992 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
993 # define yystpcpy stpcpy
995 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
997 #if (defined __STDC__ || defined __C99__FUNC__ \
998 || defined __cplusplus || defined _MSC_VER)
1000 yystpcpy (char *yydest, const char *yysrc)
1003 yystpcpy (yydest, yysrc)
1009 const char *yys = yysrc;
1011 while ((*yyd++ = *yys++) != '\0')
1020 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1021 quotes and backslashes, so that it's suitable for yyerror. The
1022 heuristic is that double-quoting is unnecessary unless the string
1023 contains an apostrophe, a comma, or backslash (other than
1024 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1025 null, do not copy; instead, return the length of what the result
1028 yytnamerr (char *yyres, const char *yystr)
1033 char const *yyp = yystr;
1040 goto do_not_strip_quotes;
1044 goto do_not_strip_quotes;
1057 do_not_strip_quotes: ;
1061 return yystrlen (yystr);
1063 return yystpcpy (yyres, yystr) - yyres;
1067 /* Copy into YYRESULT an error message about the unexpected token
1068 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1069 including the terminating null byte. If YYRESULT is null, do not
1070 copy anything; just return the number of bytes that would be
1071 copied. As a special case, return 0 if an ordinary "syntax error"
1072 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1073 size calculation. */
1075 yysyntax_error (char *yyresult, int yystate, int yychar)
1077 int yyn = yypact[yystate];
1079 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1083 int yytype = YYTRANSLATE (yychar);
1084 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1085 YYSIZE_T yysize = yysize0;
1087 int yysize_overflow = 0;
1088 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1089 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1093 /* This is so xgettext sees the translatable formats that are
1094 constructed on the fly. */
1095 YY_("syntax error, unexpected %s");
1096 YY_("syntax error, unexpected %s, expecting %s");
1097 YY_("syntax error, unexpected %s, expecting %s or %s");
1098 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1099 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1103 static char const yyunexpected[] = "syntax error, unexpected %s";
1104 static char const yyexpecting[] = ", expecting %s";
1105 static char const yyor[] = " or %s";
1106 char yyformat[sizeof yyunexpected
1107 + sizeof yyexpecting - 1
1108 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1109 * (sizeof yyor - 1))];
1110 char const *yyprefix = yyexpecting;
1112 /* Start YYX at -YYN if negative to avoid negative indexes in
1114 int yyxbegin = yyn < 0 ? -yyn : 0;
1116 /* Stay within bounds of both yycheck and yytname. */
1117 int yychecklim = YYLAST - yyn + 1;
1118 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1121 yyarg[0] = yytname[yytype];
1122 yyfmt = yystpcpy (yyformat, yyunexpected);
1124 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1125 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1127 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1131 yyformat[sizeof yyunexpected - 1] = '\0';
1134 yyarg[yycount++] = yytname[yyx];
1135 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1136 yysize_overflow |= (yysize1 < yysize);
1138 yyfmt = yystpcpy (yyfmt, yyprefix);
1142 yyf = YY_(yyformat);
1143 yysize1 = yysize + yystrlen (yyf);
1144 yysize_overflow |= (yysize1 < yysize);
1147 if (yysize_overflow)
1148 return YYSIZE_MAXIMUM;
1152 /* Avoid sprintf, as that infringes on the user's name space.
1153 Don't have undefined behavior even if the translation
1154 produced a string with the wrong number of "%s"s. */
1155 char *yyp = yyresult;
1157 while ((*yyp = *yyf) != '\0')
1159 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1161 yyp += yytnamerr (yyp, yyarg[yyi++]);
1174 #endif /* YYERROR_VERBOSE */
1177 /*-----------------------------------------------.
1178 | Release the memory associated to this symbol. |
1179 `-----------------------------------------------*/
1182 #if (defined __STDC__ || defined __C99__FUNC__ \
1183 || defined __cplusplus || defined _MSC_VER)
1185 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1188 yydestruct (yymsg, yytype, yyvaluep)
1198 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1209 /* Prevent warnings from -Wmissing-prototypes. */
1211 #ifdef YYPARSE_PARAM
1212 #if defined __STDC__ || defined __cplusplus
1213 int yyparse (void *YYPARSE_PARAM);
1217 #else /* ! YYPARSE_PARAM */
1218 #if defined __STDC__ || defined __cplusplus
1223 #endif /* ! YYPARSE_PARAM */
1227 /* The look-ahead symbol. */
1230 /* The semantic value of the look-ahead symbol. */
1233 /* Number of syntax errors so far. */
1242 #ifdef YYPARSE_PARAM
1243 #if (defined __STDC__ || defined __C99__FUNC__ \
1244 || defined __cplusplus || defined _MSC_VER)
1246 yyparse (void *YYPARSE_PARAM)
1249 yyparse (YYPARSE_PARAM)
1250 void *YYPARSE_PARAM;
1252 #else /* ! YYPARSE_PARAM */
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1268 /* Number of tokens to shift before error messages enabled. */
1270 /* Look-ahead token as an internal (translated) token number. */
1273 /* Buffer for error messages, and its allocated size. */
1275 char *yymsg = yymsgbuf;
1276 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1279 /* Three stacks and their tools:
1280 `yyss': related to states,
1281 `yyvs': related to semantic values,
1282 `yyls': related to locations.
1284 Refer to the stacks thru separate pointers, to allow yyoverflow
1285 to reallocate them elsewhere. */
1287 /* The state stack. */
1288 yytype_int16 yyssa[YYINITDEPTH];
1289 yytype_int16 *yyss = yyssa;
1290 yytype_int16 *yyssp;
1292 /* The semantic value stack. */
1293 YYSTYPE yyvsa[YYINITDEPTH];
1294 YYSTYPE *yyvs = yyvsa;
1299 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1301 YYSIZE_T yystacksize = YYINITDEPTH;
1303 /* The variables used to return semantic value and location from the
1308 /* The number of symbols on the RHS of the reduced rule.
1309 Keep to zero when no symbol should be popped. */
1312 YYDPRINTF ((stderr, "Starting parse\n"));
1317 yychar = YYEMPTY; /* Cause a token to be read. */
1319 /* Initialize stack pointers.
1320 Waste one element of value and location stack
1321 so that they stay on the same level as the state stack.
1322 The wasted elements are never initialized. */
1329 /*------------------------------------------------------------.
1330 | yynewstate -- Push a new state, which is found in yystate. |
1331 `------------------------------------------------------------*/
1333 /* In all cases, when you get here, the value and location stacks
1334 have just been pushed. So pushing a state here evens the stacks. */
1340 if (yyss + yystacksize - 1 <= yyssp)
1342 /* Get the current used size of the three stacks, in elements. */
1343 YYSIZE_T yysize = yyssp - yyss + 1;
1347 /* Give user a chance to reallocate the stack. Use copies of
1348 these so that the &'s don't force the real ones into
1350 YYSTYPE *yyvs1 = yyvs;
1351 yytype_int16 *yyss1 = yyss;
1354 /* Each stack pointer address is followed by the size of the
1355 data in use in that stack, in bytes. This used to be a
1356 conditional around just the two extra args, but that might
1357 be undefined if yyoverflow is a macro. */
1358 yyoverflow (YY_("memory exhausted"),
1359 &yyss1, yysize * sizeof (*yyssp),
1360 &yyvs1, yysize * sizeof (*yyvsp),
1367 #else /* no yyoverflow */
1368 # ifndef YYSTACK_RELOCATE
1369 goto yyexhaustedlab;
1371 /* Extend the stack our own way. */
1372 if (YYMAXDEPTH <= yystacksize)
1373 goto yyexhaustedlab;
1375 if (YYMAXDEPTH < yystacksize)
1376 yystacksize = YYMAXDEPTH;
1379 yytype_int16 *yyss1 = yyss;
1380 union yyalloc *yyptr =
1381 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1383 goto yyexhaustedlab;
1384 YYSTACK_RELOCATE (yyss);
1385 YYSTACK_RELOCATE (yyvs);
1387 # undef YYSTACK_RELOCATE
1389 YYSTACK_FREE (yyss1);
1392 #endif /* no yyoverflow */
1394 yyssp = yyss + yysize - 1;
1395 yyvsp = yyvs + yysize - 1;
1398 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1399 (unsigned long int) yystacksize));
1401 if (yyss + yystacksize - 1 <= yyssp)
1405 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1414 /* Do appropriate processing given the current state. Read a
1415 look-ahead token if we need one and don't already have one. */
1417 /* First try to decide what to do without reference to look-ahead token. */
1418 yyn = yypact[yystate];
1419 if (yyn == YYPACT_NINF)
1422 /* Not known => get a look-ahead token if don't already have one. */
1424 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1425 if (yychar == YYEMPTY)
1427 YYDPRINTF ((stderr, "Reading a token: "));
1431 if (yychar <= YYEOF)
1433 yychar = yytoken = YYEOF;
1434 YYDPRINTF ((stderr, "Now at end of input.\n"));
1438 yytoken = YYTRANSLATE (yychar);
1439 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1442 /* If the proper action on seeing token YYTOKEN is to reduce or to
1443 detect an error, take that action. */
1445 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1450 if (yyn == 0 || yyn == YYTABLE_NINF)
1459 /* Count tokens shifted since error; after three, turn off error
1464 /* Shift the look-ahead token. */
1465 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1467 /* Discard the shifted token unless it is eof. */
1468 if (yychar != YYEOF)
1477 /*-----------------------------------------------------------.
1478 | yydefault -- do the default action for the current state. |
1479 `-----------------------------------------------------------*/
1481 yyn = yydefact[yystate];
1487 /*-----------------------------.
1488 | yyreduce -- Do a reduction. |
1489 `-----------------------------*/
1491 /* yyn is the number of a rule to reduce with. */
1494 /* If YYLEN is nonzero, implement the default value of the action:
1497 Otherwise, the following line sets YYVAL to garbage.
1498 This behavior is undocumented and Bison
1499 users should not rely upon it. Assigning to YYVAL
1500 unconditionally makes the parser a bit smaller, and it avoids a
1501 GCC warning that YYVAL may be used uninitialized. */
1502 yyval = yyvsp[1-yylen];
1505 YY_REDUCE_PRINT (yyn);
1509 #line 76 "mcparse.y"
1511 cur_node = mc_add_node ();
1512 cur_node->user_text = (yyvsp[(1) - (1)].ustr);
1517 #line 80 "mcparse.y"
1518 { mc_fatal ("syntax error"); }
1522 #line 85 "mcparse.y"
1523 { mc_fatal ("missing ')' in SeverityNames"); }
1527 #line 86 "mcparse.y"
1528 { mc_fatal ("missing '(' in SeverityNames"); }
1532 #line 87 "mcparse.y"
1533 { mc_fatal ("missing '=' for SeverityNames"); }
1537 #line 89 "mcparse.y"
1538 { mc_fatal ("missing ')' in LanguageNames"); }
1542 #line 90 "mcparse.y"
1543 { mc_fatal ("missing '(' in LanguageNames"); }
1547 #line 91 "mcparse.y"
1548 { mc_fatal ("missing '=' for LanguageNames"); }
1552 #line 93 "mcparse.y"
1553 { mc_fatal ("missing ')' in FacilityNames"); }
1557 #line 94 "mcparse.y"
1558 { mc_fatal ("missing '(' in FacilityNames"); }
1562 #line 95 "mcparse.y"
1563 { mc_fatal ("missing '=' for FacilityNames"); }
1567 #line 97 "mcparse.y"
1569 if ((yyvsp[(3) - (3)].ival) != 10 && (yyvsp[(3) - (3)].ival) != 16)
1570 mc_fatal ("OutputBase allows 10 or 16 as value");
1571 mcset_out_values_are_decimal = ((yyvsp[(3) - (3)].ival) == 10 ? 1 : 0);
1576 #line 103 "mcparse.y"
1578 mcset_msg_id_typedef = (yyvsp[(3) - (3)].ustr);
1583 #line 107 "mcparse.y"
1585 mc_fatal ("MessageIdTypedef expects an identifier");
1590 #line 111 "mcparse.y"
1592 mc_fatal ("missing '=' for MessageIdTypedef");
1597 #line 119 "mcparse.y"
1598 { mc_fatal ("severity ident missing"); }
1602 #line 124 "mcparse.y"
1604 mc_add_keyword ((yyvsp[(1) - (4)].ustr), MCTOKEN, "severity", (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ustr));
1609 #line 127 "mcparse.y"
1610 { mc_fatal ("severity number missing"); }
1614 #line 128 "mcparse.y"
1615 { mc_fatal ("severity missing '='"); }
1619 #line 134 "mcparse.y"
1620 { mc_fatal ("missing ident in FacilityNames"); }
1624 #line 139 "mcparse.y"
1626 mc_add_keyword ((yyvsp[(1) - (4)].ustr), MCTOKEN, "facility", (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ustr));
1631 #line 142 "mcparse.y"
1632 { mc_fatal ("facility number missing"); }
1636 #line 143 "mcparse.y"
1637 { mc_fatal ("facility missing '='"); }
1641 #line 149 "mcparse.y"
1642 { mc_fatal ("missing ident in LanguageNames"); }
1646 #line 154 "mcparse.y"
1648 mc_add_keyword ((yyvsp[(1) - (6)].ustr), MCTOKEN, "language", (yyvsp[(3) - (6)].ival), (yyvsp[(6) - (6)].ustr));
1653 #line 157 "mcparse.y"
1654 { mc_fatal ("missing filename in LanguageNames"); }
1658 #line 158 "mcparse.y"
1659 { mc_fatal ("missing ':' in LanguageNames"); }
1663 #line 159 "mcparse.y"
1664 { mc_fatal ("missing language code in LanguageNames"); }
1668 #line 160 "mcparse.y"
1669 { mc_fatal ("missing '=' for LanguageNames"); }
1673 #line 165 "mcparse.y"
1675 (yyval.ustr) = NULL;
1680 #line 169 "mcparse.y"
1682 (yyval.ustr) = (yyvsp[(2) - (2)].ustr);
1687 #line 172 "mcparse.y"
1688 { mc_fatal ("illegal token in identifier"); (yyval.ustr) = NULL; }
1692 #line 177 "mcparse.y"
1694 cur_node = mc_add_node ();
1695 cur_node->symbol = mc_last_symbol;
1696 cur_node->facility = mc_cur_facility;
1697 cur_node->severity = mc_cur_severity;
1698 cur_node->id = ((yyvsp[(1) - (2)].ival) & 0xffffUL);
1699 cur_node->vid = ((yyvsp[(1) - (2)].ival) & 0xffffUL) | mc_sefa_val;
1700 mc_last_id = (yyvsp[(1) - (2)].ival);
1705 #line 189 "mcparse.y"
1706 { (yyval.ival) = (yyvsp[(3) - (3)].ival); }
1710 #line 190 "mcparse.y"
1711 { mc_fatal ("missing number in MessageId"); (yyval.ival) = 0; }
1715 #line 191 "mcparse.y"
1716 { mc_fatal ("missing '=' for MessageId"); (yyval.ival) = 0; }
1720 #line 195 "mcparse.y"
1722 (yyval.ival) = ++mc_last_id;
1727 #line 199 "mcparse.y"
1729 (yyval.ival) = (yyvsp[(1) - (1)].ival);
1734 #line 203 "mcparse.y"
1736 (yyval.ival) = mc_last_id + (yyvsp[(2) - (2)].ival);
1741 #line 206 "mcparse.y"
1742 { mc_fatal ("missing number after MessageId '+'"); }
1746 #line 211 "mcparse.y"
1749 mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29;
1750 mc_last_symbol = NULL;
1751 mc_cur_severity = NULL;
1752 mc_cur_facility = NULL;
1757 #line 219 "mcparse.y"
1759 if ((yyvsp[(1) - (2)].ival) & 1)
1760 mc_warn (_("duplicate definition of Severity"));
1761 (yyval.ival) = (yyvsp[(1) - (2)].ival) | 1;
1766 #line 225 "mcparse.y"
1768 if ((yyvsp[(1) - (2)].ival) & 2)
1769 mc_warn (_("duplicate definition of Facility"));
1770 (yyval.ival) = (yyvsp[(1) - (2)].ival) | 2;
1775 #line 231 "mcparse.y"
1777 if ((yyvsp[(1) - (2)].ival) & 4)
1778 mc_warn (_("duplicate definition of SymbolicName"));
1779 (yyval.ival) = (yyvsp[(1) - (2)].ival) | 4;
1784 #line 239 "mcparse.y"
1786 mc_sefa_val &= ~ (0x3UL << 30);
1787 mc_sefa_val |= (((yyvsp[(3) - (3)].tok)->nval & 0x3UL) << 30);
1788 mc_cur_severity = (yyvsp[(3) - (3)].tok);
1793 #line 247 "mcparse.y"
1795 mc_sefa_val &= ~ (0xfffUL << 16);
1796 mc_sefa_val |= (((yyvsp[(3) - (3)].tok)->nval & 0xfffUL) << 16);
1797 mc_cur_facility = (yyvsp[(3) - (3)].tok);
1802 #line 255 "mcparse.y"
1804 mc_last_symbol = (yyvsp[(3) - (3)].ustr);
1809 #line 267 "mcparse.y"
1812 h = mc_add_node_lang (cur_node, (yyvsp[(1) - (4)].tok), cur_node->vid);
1813 h->message = (yyvsp[(3) - (4)].ustr);
1814 if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length)
1815 mc_warn ("message length to long");
1820 #line 277 "mcparse.y"
1822 (yyval.ustr) = (yyvsp[(1) - (1)].ustr);
1827 #line 281 "mcparse.y"
1831 l1 = unichar_len ((yyvsp[(1) - (2)].ustr));
1832 l2 = unichar_len ((yyvsp[(2) - (2)].ustr));
1833 h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
1834 if (l1) memcpy (h, (yyvsp[(1) - (2)].ustr), l1 * sizeof (unichar));
1835 if (l2) memcpy (&h[l1], (yyvsp[(2) - (2)].ustr), l2 * sizeof (unichar));
1842 #line 292 "mcparse.y"
1843 { mc_fatal ("missing end of message text"); (yyval.ustr) = NULL; }
1847 #line 293 "mcparse.y"
1848 { mc_fatal ("missing end of message text"); (yyval.ustr) = (yyvsp[(1) - (2)].ustr); }
1852 #line 296 "mcparse.y"
1853 { (yyval.ustr) = (yyvsp[(1) - (1)].ustr); }
1857 #line 298 "mcparse.y"
1861 l1 = unichar_len ((yyvsp[(1) - (2)].ustr));
1862 l2 = unichar_len ((yyvsp[(2) - (2)].ustr));
1863 h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
1864 if (l1) memcpy (h, (yyvsp[(1) - (2)].ustr), l1 * sizeof (unichar));
1865 if (l2) memcpy (&h[l1], (yyvsp[(2) - (2)].ustr), l2 * sizeof (unichar));
1872 #line 312 "mcparse.y"
1874 (yyval.tok) = (yyvsp[(4) - (5)].tok);
1879 #line 316 "mcparse.y"
1882 mc_fatal (_("undeclared language identifier"));
1887 #line 321 "mcparse.y"
1890 mc_fatal ("missing newline after Language");
1895 #line 326 "mcparse.y"
1898 mc_fatal ("missing ident for Language");
1903 #line 331 "mcparse.y"
1906 mc_fatal ("missing '=' for Language");
1911 #line 337 "mcparse.y"
1912 { (yyval.ustr) = (yyvsp[(1) - (1)].ustr); }
1916 #line 338 "mcparse.y"
1917 { (yyval.ustr) = (yyvsp[(1) - (1)].tok)->usz; }
1921 #line 342 "mcparse.y"
1922 { mclex_want_nl = 1; }
1926 #line 346 "mcparse.y"
1927 { mclex_want_line = 1; }
1931 #line 350 "mcparse.y"
1932 { mclex_want_filename = 1; }
1936 /* Line 1267 of yacc.c. */
1937 #line 1938 "mcparse.c"
1940 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1944 YY_STACK_PRINT (yyss, yyssp);
1949 /* Now `shift' the result of the reduction. Determine what state
1950 that goes to, based on the state we popped back to and the rule
1951 number reduced by. */
1955 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1956 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1957 yystate = yytable[yystate];
1959 yystate = yydefgoto[yyn - YYNTOKENS];
1964 /*------------------------------------.
1965 | yyerrlab -- here on detecting error |
1966 `------------------------------------*/
1968 /* If not already recovering from an error, report this error. */
1972 #if ! YYERROR_VERBOSE
1973 yyerror (YY_("syntax error"));
1976 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1977 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1979 YYSIZE_T yyalloc = 2 * yysize;
1980 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1981 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1982 if (yymsg != yymsgbuf)
1983 YYSTACK_FREE (yymsg);
1984 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1986 yymsg_alloc = yyalloc;
1990 yymsg_alloc = sizeof yymsgbuf;
1994 if (0 < yysize && yysize <= yymsg_alloc)
1996 (void) yysyntax_error (yymsg, yystate, yychar);
2001 yyerror (YY_("syntax error"));
2003 goto yyexhaustedlab;
2011 if (yyerrstatus == 3)
2013 /* If just tried and failed to reuse look-ahead token after an
2014 error, discard it. */
2016 if (yychar <= YYEOF)
2018 /* Return failure if at end of input. */
2019 if (yychar == YYEOF)
2024 yydestruct ("Error: discarding",
2030 /* Else will try to reuse look-ahead token after shifting the error
2035 /*---------------------------------------------------.
2036 | yyerrorlab -- error raised explicitly by YYERROR. |
2037 `---------------------------------------------------*/
2040 /* Pacify compilers like GCC when the user code never invokes
2041 YYERROR and the label yyerrorlab therefore never appears in user
2043 if (/*CONSTCOND*/ 0)
2046 /* Do not reclaim the symbols of the rule which action triggered
2050 YY_STACK_PRINT (yyss, yyssp);
2055 /*-------------------------------------------------------------.
2056 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2057 `-------------------------------------------------------------*/
2059 yyerrstatus = 3; /* Each real token shifted decrements this. */
2063 yyn = yypact[yystate];
2064 if (yyn != YYPACT_NINF)
2067 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2075 /* Pop the current state because it cannot handle the error token. */
2080 yydestruct ("Error: popping",
2081 yystos[yystate], yyvsp);
2084 YY_STACK_PRINT (yyss, yyssp);
2093 /* Shift the error token. */
2094 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2100 /*-------------------------------------.
2101 | yyacceptlab -- YYACCEPT comes here. |
2102 `-------------------------------------*/
2107 /*-----------------------------------.
2108 | yyabortlab -- YYABORT comes here. |
2109 `-----------------------------------*/
2115 /*-------------------------------------------------.
2116 | yyexhaustedlab -- memory exhaustion comes here. |
2117 `-------------------------------------------------*/
2119 yyerror (YY_("memory exhausted"));
2125 if (yychar != YYEOF && yychar != YYEMPTY)
2126 yydestruct ("Cleanup: discarding lookahead",
2128 /* Do not reclaim the symbols of the rule which action triggered
2129 this YYABORT or YYACCEPT. */
2131 YY_STACK_PRINT (yyss, yyssp);
2132 while (yyssp != yyss)
2134 yydestruct ("Cleanup: popping",
2135 yystos[*yyssp], yyvsp);
2140 YYSTACK_FREE (yyss);
2143 if (yymsg != yymsgbuf)
2144 YYSTACK_FREE (yymsg);
2146 /* Make sure YYID is used. */
2147 return YYID (yyresult);
2151 #line 353 "mcparse.y"
2154 /* Something else. */