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
61
/* Substitute the variable and function names. */
62
#define yyparse v29nfy_parse
63
#define yylex v29nfy_lex
64
#define yyerror v29nfy_error
65
#define yylval v29nfy_lval
66
#define yychar v29nfy_char
67
#define yydebug v29nfy_debug
68
#define yynerrs v29nfy_nerrs
74
/* Put the tokens into the symbol table, so that GDB and other debuggers
105
#define KW_SEVERITY 261
106
#define KW_SERVICEABLE 262
111
#define KW_ENCLOSURE 267
114
#define KW_ERROR_LOCAL 270
115
#define KW_WARNING 271
128
/* Copy the first part of user declarations. */
129
#line 1 "v29_notify_gram.y"
132
* @file notify_gram.y
133
* @brief yacc grammar for parsing the match member of a v1+ sl_notify struct
135
* Copyright (C) 2009 IBM Corporation
137
* We accept only query expressions that can be converted to v0.2.9
141
* v29nfy_gram_init(v1_sl_notify->match, &v29_sl_notify, &semantic_errs);
142
* if (v29nfy_parse() == 0 && semantic_errs == 0) {
143
* *v29_sl_notify_ptr is successfully populated -- the
144
* event_types, severity, and serviceable fields, anyway.
146
* v29nfy_gram_fini();
148
* TODO: Serialize calls to this.
150
* @author Jim Keniston <jkenisto@us.ibm.com>
153
#include "slog_internal.h"
154
#define EXCLUDE_SERVICELOG_COMPAT_DECLS
155
#include "../servicelog-1/libservicelog.h"
156
#include "v29_notify_gram.h"
160
static struct v29_sl_notify *notify;
161
static int *semantic_errors;
162
extern void v29nfy_lex_init(const char *parse_me);
163
extern void v29nfy_lex_fini(void);
164
extern uint32_t convert_type_to_v29(uint32_t v1_type);
166
#define all_types ((1<<SL_TYPE_OS) | (1<<SL_TYPE_PPC64_RTAS) | (1<<SL_TYPE_PPC64_ENCL))
168
extern int yylex(void);
171
yyerror(const char *s)
175
static int nr_and_clauses, nr_or_clauses,
176
nr_type_eq_tests, nr_type_ne_tests,
177
nr_serviceability_tests, nr_severity_tests;
179
/* We use one or the other, not both. */
180
static uint64_t anded_types, ored_types;
184
struct parse_node *nd_left, *nd_right;
187
static struct parse_node *
188
mk_parse_node(int ndty, struct parse_node *left, struct parse_node *right)
190
struct parse_node *nd = malloc(sizeof(*nd));
192
(*semantic_errors)++;
197
nd->nd_right = right;
202
free_parse_tree(struct parse_node *root)
206
free_parse_tree(root->nd_left);
207
free_parse_tree(root->nd_right);
211
* We've determined that the type subtree should be a set of one or more
212
* type=val nodes connected by ORs. Find that subtree.
214
static struct parse_node *
215
find_type_subtree(struct parse_node *root)
217
struct parse_node *found;
220
if (root->nd_type == KW_OR || root->nd_type == TK_EQ)
222
found = find_type_subtree(root->nd_left);
225
return find_type_subtree(root->nd_right);
229
count_eq_tests_in_subtree(struct parse_node *root)
231
if (root->nd_type == TK_EQ)
233
else if (root->nd_type == KW_OR)
234
return (count_eq_tests_in_subtree(root->nd_left)
235
+ count_eq_tests_in_subtree(root->nd_right));
236
(*semantic_errors)++;
241
* The grammar we recognize is
242
* severity_test AND serviceability_test AND type_test
243
* where the order is irrelevant, any or all tests can be omitted, and
244
* parenthesization is anything close to reasonable, so long as it's
247
* type_test is either a sequence of "type = value" terms strung together
248
* with ORs, or a sequence of "type != value" terms strung together with
249
* ANDs. In the latter case, the "type != value" terms can be intermixed
250
* with the severity_test and serviceability_test.
252
* All tests are represented by leaf nodes: KW_SEVERITY, KW_SERVICEABILITY,
253
* KW_EQ (for type=val), or KW_NE (for type!=val).
256
validate_parse_tree(struct parse_node *root)
260
if (nr_serviceability_tests > 1 || nr_severity_tests > 1)
262
if (nr_type_eq_tests > 0) {
263
// type=val connected by ORs
264
struct parse_node *type_subtree;
266
if (nr_type_ne_tests > 0)
268
if (nr_or_clauses != nr_type_eq_tests-1)
270
/* Verify that one subtree has all the ORs and type=val tests.*/
271
type_subtree = find_type_subtree(root);
272
if (count_eq_tests_in_subtree(type_subtree) != nr_type_ne_tests)
274
notify->event_types = ored_types;
275
} else if (nr_type_ne_tests > 0) {
276
// type!=val connected by ANDs
277
if (nr_or_clauses != 0)
279
notify->event_types = anded_types;
281
free_parse_tree(root);
285
(*semantic_errors)++;
286
free_parse_tree(root);
291
/* Enabling traces. */
296
/* Enabling verbose error messages. */
297
#ifdef YYERROR_VERBOSE
298
# undef YYERROR_VERBOSE
299
# define YYERROR_VERBOSE 1
301
# define YYERROR_VERBOSE 0
304
/* Enabling the token table. */
305
#ifndef YYTOKEN_TABLE
306
# define YYTOKEN_TABLE 0
309
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
310
typedef union YYSTYPE
311
#line 162 "v29_notify_gram.y"
314
struct parse_node *pnval;
316
/* Line 187 of yacc.c. */
317
#line 318 "v29_notify_gram.c"
319
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
320
# define YYSTYPE_IS_DECLARED 1
321
# define YYSTYPE_IS_TRIVIAL 1
326
/* Copy the second part of user declarations. */
329
/* Line 216 of yacc.c. */
330
#line 331 "v29_notify_gram.c"
337
typedef YYTYPE_UINT8 yytype_uint8;
339
typedef unsigned char yytype_uint8;
343
typedef YYTYPE_INT8 yytype_int8;
344
#elif (defined __STDC__ || defined __C99__FUNC__ \
345
|| defined __cplusplus || defined _MSC_VER)
346
typedef signed char yytype_int8;
348
typedef short int yytype_int8;
352
typedef YYTYPE_UINT16 yytype_uint16;
354
typedef unsigned short int yytype_uint16;
358
typedef YYTYPE_INT16 yytype_int16;
360
typedef short int yytype_int16;
364
# ifdef __SIZE_TYPE__
365
# define YYSIZE_T __SIZE_TYPE__
366
# elif defined size_t
367
# define YYSIZE_T size_t
368
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
369
|| defined __cplusplus || defined _MSC_VER)
370
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
371
# define YYSIZE_T size_t
373
# define YYSIZE_T unsigned int
377
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
382
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
383
# define YY_(msgid) dgettext ("bison-runtime", msgid)
387
# define YY_(msgid) msgid
391
/* Suppress unused-variable warnings by "using" E. */
392
#if ! defined lint || defined __GNUC__
393
# define YYUSE(e) ((void) (e))
395
# define YYUSE(e) /* empty */
398
/* Identity function, used to suppress warnings about constant conditions. */
402
#if (defined __STDC__ || defined __C99__FUNC__ \
403
|| defined __cplusplus || defined _MSC_VER)
416
#if ! defined yyoverflow || YYERROR_VERBOSE
418
/* The parser invokes alloca or malloc; define the necessary symbols. */
420
# ifdef YYSTACK_USE_ALLOCA
421
# if YYSTACK_USE_ALLOCA
423
# define YYSTACK_ALLOC __builtin_alloca
424
# elif defined __BUILTIN_VA_ARG_INCR
425
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
427
# define YYSTACK_ALLOC __alloca
428
# elif defined _MSC_VER
429
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
430
# define alloca _alloca
432
# define YYSTACK_ALLOC alloca
433
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
434
|| defined __cplusplus || defined _MSC_VER)
435
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
444
# ifdef YYSTACK_ALLOC
445
/* Pacify GCC's `empty if-body' warning. */
446
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
447
# ifndef YYSTACK_ALLOC_MAXIMUM
448
/* The OS might guarantee only one guard page at the bottom of the stack,
449
and a page size can be as small as 4096 bytes. So we cannot safely
450
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
451
to allow for a few compiler-allocated temporary stack slots. */
452
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455
# define YYSTACK_ALLOC YYMALLOC
456
# define YYSTACK_FREE YYFREE
457
# ifndef YYSTACK_ALLOC_MAXIMUM
458
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
460
# if (defined __cplusplus && ! defined _STDLIB_H \
461
&& ! ((defined YYMALLOC || defined malloc) \
462
&& (defined YYFREE || defined free)))
463
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469
# define YYMALLOC malloc
470
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
471
|| defined __cplusplus || defined _MSC_VER)
472
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
477
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478
|| defined __cplusplus || defined _MSC_VER)
479
void free (void *); /* INFRINGES ON USER NAME SPACE */
483
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
486
#if (! defined yyoverflow \
487
&& (! defined __cplusplus \
488
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
490
/* A type that is properly aligned for any stack member. */
497
/* The size of the maximum gap between one aligned stack and the next. */
498
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
500
/* The size of an array large to enough to hold all stacks, each with
502
# define YYSTACK_BYTES(N) \
503
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
504
+ YYSTACK_GAP_MAXIMUM)
506
/* Copy COUNT objects from FROM to TO. The source and destination do
509
# if defined __GNUC__ && 1 < __GNUC__
510
# define YYCOPY(To, From, Count) \
511
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
513
# define YYCOPY(To, From, Count) \
517
for (yyi = 0; yyi < (Count); yyi++) \
518
(To)[yyi] = (From)[yyi]; \
524
/* Relocate STACK from its old location to the new one. The
525
local variables YYSIZE and YYSTACKSIZE give the old and new number of
526
elements in the stack, and YYPTR gives the new location of the
527
stack. Advance YYPTR to a properly aligned location for the next
529
# define YYSTACK_RELOCATE(Stack) \
532
YYSIZE_T yynewbytes; \
533
YYCOPY (&yyptr->Stack, Stack, yysize); \
534
Stack = &yyptr->Stack; \
535
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
536
yyptr += yynewbytes / sizeof (*yyptr); \
542
/* YYFINAL -- State number of the termination state. */
544
/* YYLAST -- Last index in YYTABLE. */
547
/* YYNTOKENS -- Number of terminals. */
549
/* YYNNTS -- Number of nonterminals. */
551
/* YYNRULES -- Number of rules. */
553
/* YYNRULES -- Number of states. */
556
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
558
#define YYMAXUTOK 279
560
#define YYTRANSLATE(YYX) \
561
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
563
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
564
static const yytype_uint8 yytranslate[] =
566
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570
25, 26, 2, 2, 2, 2, 2, 2, 2, 2,
571
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
592
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
593
15, 16, 17, 18, 19, 20, 21, 22, 23, 24
597
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
599
static const yytype_uint8 yyprhs[] =
601
0, 0, 3, 5, 6, 8, 10, 14, 16, 20,
602
22, 26, 28, 30, 32, 36, 40, 42, 44, 46,
603
48, 50, 52, 54, 58, 62, 66, 68, 70, 72,
607
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
608
static const yytype_int8 yyrhs[] =
610
28, 0, -1, 29, -1, -1, 30, -1, 31, -1,
611
30, 4, 31, -1, 32, -1, 31, 3, 32, -1,
612
33, -1, 25, 30, 26, -1, 39, -1, 37, -1,
613
34, -1, 5, 21, 35, -1, 5, 22, 35, -1,
614
36, -1, 20, -1, 8, -1, 9, -1, 10, -1,
615
11, -1, 12, -1, 6, 23, 38, -1, 6, 24,
616
38, -1, 6, 21, 38, -1, 20, -1, 13, -1,
617
14, -1, 15, -1, 16, -1, 17, -1, 18, -1,
618
19, -1, 7, 21, 20, -1
621
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
622
static const yytype_uint16 yyrline[] =
624
0, 180, 180, 183, 184, 187, 188, 194, 195, 201,
625
202, 205, 209, 213, 216, 221, 227, 234, 235, 236,
626
237, 238, 239, 242, 243, 244, 247, 254, 255, 256,
627
257, 258, 259, 260, 263
631
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
632
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
633
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
634
static const char *const yytname[] =
636
"$end", "error", "$undefined", "KW_AND", "KW_OR", "KW_TYPE",
637
"KW_SEVERITY", "KW_SERVICEABLE", "KW_BASIC", "KW_OS", "KW_RTAS",
638
"KW_BMC", "KW_ENCLOSURE", "KW_FATAL", "KW_ERROR", "KW_ERROR_LOCAL",
639
"KW_WARNING", "KW_EVENT", "KW_INFO", "KW_DEBUG", "TK_INT", "TK_EQ",
640
"TK_NE", "TK_GT", "TK_GE", "'('", "')'", "$accept", "query", "qstring",
641
"search_condition", "boolean_term", "boolean_factor",
642
"comparison_predicate", "type_test", "type_value", "v1_type_value",
643
"severity_test", "severity_value", "serviceable_test", 0
648
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
650
static const yytype_uint16 yytoknum[] =
652
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
653
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
654
275, 276, 277, 278, 279, 40, 41
658
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
659
static const yytype_uint8 yyr1[] =
661
0, 27, 28, 29, 29, 30, 30, 31, 31, 32,
662
32, 33, 33, 33, 34, 34, 35, 36, 36, 36,
663
36, 36, 36, 37, 37, 37, 38, 38, 38, 38,
667
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
668
static const yytype_uint8 yyr2[] =
670
0, 2, 1, 0, 1, 1, 3, 1, 3, 1,
671
3, 1, 1, 1, 3, 3, 1, 1, 1, 1,
672
1, 1, 1, 3, 3, 3, 1, 1, 1, 1,
676
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
677
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
678
means the default is an error. */
679
static const yytype_uint8 yydefact[] =
681
3, 0, 0, 0, 0, 0, 2, 4, 5, 7,
682
9, 13, 12, 11, 0, 0, 0, 0, 0, 0,
683
0, 1, 0, 0, 18, 19, 20, 21, 22, 17,
684
14, 16, 15, 27, 28, 29, 30, 31, 32, 33,
685
26, 25, 23, 24, 34, 10, 6, 8
688
/* YYDEFGOTO[NTERM-NUM]. */
689
static const yytype_int8 yydefgoto[] =
691
-1, 5, 6, 7, 8, 9, 10, 11, 30, 31,
695
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
697
#define YYPACT_NINF -21
698
static const yytype_int8 yypact[] =
700
-2, -20, -9, -15, -2, 13, -21, 12, 17, -21,
701
-21, -21, -21, -21, -1, -1, 11, 11, 11, 1,
702
-4, -21, -2, -2, -21, -21, -21, -21, -21, -21,
703
-21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
704
-21, -21, -21, -21, -21, -21, 17, -21
707
/* YYPGOTO[NTERM-NUM]. */
708
static const yytype_int8 yypgoto[] =
710
-21, -21, -21, 28, 14, 10, -21, -21, 19, -21,
714
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
715
positive, shift that token. If negative, reduce the rule which
716
number is the opposite. If zero, do what YYDEFACT says.
717
If YYTABLE_NINF, syntax error. */
718
#define YYTABLE_NINF -1
719
static const yytype_uint8 yytable[] =
721
22, 14, 15, 1, 2, 3, 19, 24, 25, 26,
722
27, 28, 16, 21, 17, 18, 22, 42, 43, 29,
723
23, 44, 45, 4, 33, 34, 35, 36, 37, 38,
724
39, 40, 20, 47, 32, 0, 46
727
static const yytype_int8 yycheck[] =
729
4, 21, 22, 5, 6, 7, 21, 8, 9, 10,
730
11, 12, 21, 0, 23, 24, 4, 17, 18, 20,
731
3, 20, 26, 25, 13, 14, 15, 16, 17, 18,
732
19, 20, 4, 23, 15, -1, 22
735
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
736
symbol of state STATE-NUM. */
737
static const yytype_uint8 yystos[] =
739
0, 5, 6, 7, 25, 28, 29, 30, 31, 32,
740
33, 34, 37, 39, 21, 22, 21, 23, 24, 21,
741
30, 0, 4, 3, 8, 9, 10, 11, 12, 20,
742
35, 36, 35, 13, 14, 15, 16, 17, 18, 19,
743
20, 38, 38, 38, 20, 26, 31, 32
746
#define yyerrok (yyerrstatus = 0)
747
#define yyclearin (yychar = YYEMPTY)
751
#define YYACCEPT goto yyacceptlab
752
#define YYABORT goto yyabortlab
753
#define YYERROR goto yyerrorlab
756
/* Like YYERROR except do call yyerror. This remains here temporarily
757
to ease the transition to the new meaning of YYERROR, for GCC.
758
Once GCC version 2 has supplanted version 1, this can go. */
760
#define YYFAIL goto yyerrlab
762
#define YYRECOVERING() (!!yyerrstatus)
764
#define YYBACKUP(Token, Value) \
766
if (yychar == YYEMPTY && yylen == 1) \
770
yytoken = YYTRANSLATE (yychar); \
776
yyerror (YY_("syntax error: cannot back up")); \
783
#define YYERRCODE 256
786
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
787
If N is 0, then set CURRENT to the empty location which ends
788
the previous symbol: RHS[0] (always defined). */
790
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
791
#ifndef YYLLOC_DEFAULT
792
# define YYLLOC_DEFAULT(Current, Rhs, N) \
796
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
797
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
798
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
799
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
803
(Current).first_line = (Current).last_line = \
804
YYRHSLOC (Rhs, 0).last_line; \
805
(Current).first_column = (Current).last_column = \
806
YYRHSLOC (Rhs, 0).last_column; \
812
/* YY_LOCATION_PRINT -- Print the location on the stream.
813
This macro was not mandated originally: define only if we know
814
we won't break user code: when these are the locations we know. */
816
#ifndef YY_LOCATION_PRINT
817
# if YYLTYPE_IS_TRIVIAL
818
# define YY_LOCATION_PRINT(File, Loc) \
819
fprintf (File, "%d.%d-%d.%d", \
820
(Loc).first_line, (Loc).first_column, \
821
(Loc).last_line, (Loc).last_column)
823
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
828
/* YYLEX -- calling `yylex' with the right arguments. */
831
# define YYLEX yylex (YYLEX_PARAM)
833
# define YYLEX yylex ()
836
/* Enable debugging if requested. */
840
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
841
# define YYFPRINTF fprintf
844
# define YYDPRINTF(Args) \
850
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
854
YYFPRINTF (stderr, "%s ", Title); \
855
yy_symbol_print (stderr, \
857
YYFPRINTF (stderr, "\n"); \
862
/*--------------------------------.
863
| Print this symbol on YYOUTPUT. |
864
`--------------------------------*/
867
#if (defined __STDC__ || defined __C99__FUNC__ \
868
|| defined __cplusplus || defined _MSC_VER)
870
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
873
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
876
YYSTYPE const * const yyvaluep;
882
if (yytype < YYNTOKENS)
883
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
895
/*--------------------------------.
896
| Print this symbol on YYOUTPUT. |
897
`--------------------------------*/
899
#if (defined __STDC__ || defined __C99__FUNC__ \
900
|| defined __cplusplus || defined _MSC_VER)
902
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
905
yy_symbol_print (yyoutput, yytype, yyvaluep)
908
YYSTYPE const * const yyvaluep;
911
if (yytype < YYNTOKENS)
912
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
914
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
916
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
917
YYFPRINTF (yyoutput, ")");
920
/*------------------------------------------------------------------.
921
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
923
`------------------------------------------------------------------*/
925
#if (defined __STDC__ || defined __C99__FUNC__ \
926
|| defined __cplusplus || defined _MSC_VER)
928
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
931
yy_stack_print (bottom, top)
932
yytype_int16 *bottom;
936
YYFPRINTF (stderr, "Stack now");
937
for (; bottom <= top; ++bottom)
938
YYFPRINTF (stderr, " %d", *bottom);
939
YYFPRINTF (stderr, "\n");
942
# define YY_STACK_PRINT(Bottom, Top) \
945
yy_stack_print ((Bottom), (Top)); \
949
/*------------------------------------------------.
950
| Report that the YYRULE is going to be reduced. |
951
`------------------------------------------------*/
953
#if (defined __STDC__ || defined __C99__FUNC__ \
954
|| defined __cplusplus || defined _MSC_VER)
956
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
959
yy_reduce_print (yyvsp, yyrule)
964
int yynrhs = yyr2[yyrule];
966
unsigned long int yylno = yyrline[yyrule];
967
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
969
/* The symbols being reduced. */
970
for (yyi = 0; yyi < yynrhs; yyi++)
972
fprintf (stderr, " $%d = ", yyi + 1);
973
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
974
&(yyvsp[(yyi + 1) - (yynrhs)])
976
fprintf (stderr, "\n");
980
# define YY_REDUCE_PRINT(Rule) \
983
yy_reduce_print (yyvsp, Rule); \
986
/* Nonzero means print parse trace. It is left uninitialized so that
987
multiple parsers can coexist. */
990
# define YYDPRINTF(Args)
991
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
992
# define YY_STACK_PRINT(Bottom, Top)
993
# define YY_REDUCE_PRINT(Rule)
994
#endif /* !YYDEBUG */
997
/* YYINITDEPTH -- initial size of the parser's stacks. */
999
# define YYINITDEPTH 200
1002
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1003
if the built-in stack extension method is used).
1005
Do not make this value too large; the results are undefined if
1006
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1007
evaluated with infinite-precision integer arithmetic. */
1010
# define YYMAXDEPTH 10000
1018
# if defined __GLIBC__ && defined _STRING_H
1019
# define yystrlen strlen
1021
/* Return the length of YYSTR. */
1022
#if (defined __STDC__ || defined __C99__FUNC__ \
1023
|| defined __cplusplus || defined _MSC_VER)
1025
yystrlen (const char *yystr)
1033
for (yylen = 0; yystr[yylen]; yylen++)
1041
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1042
# define yystpcpy stpcpy
1044
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1046
#if (defined __STDC__ || defined __C99__FUNC__ \
1047
|| defined __cplusplus || defined _MSC_VER)
1049
yystpcpy (char *yydest, const char *yysrc)
1052
yystpcpy (yydest, yysrc)
1058
const char *yys = yysrc;
1060
while ((*yyd++ = *yys++) != '\0')
1069
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1070
quotes and backslashes, so that it's suitable for yyerror. The
1071
heuristic is that double-quoting is unnecessary unless the string
1072
contains an apostrophe, a comma, or backslash (other than
1073
backslash-backslash). YYSTR is taken from yytname. If YYRES is
1074
null, do not copy; instead, return the length of what the result
1077
yytnamerr (char *yyres, const char *yystr)
1082
char const *yyp = yystr;
1089
goto do_not_strip_quotes;
1093
goto do_not_strip_quotes;
1106
do_not_strip_quotes: ;
1110
return yystrlen (yystr);
1112
return yystpcpy (yyres, yystr) - yyres;
1116
/* Copy into YYRESULT an error message about the unexpected token
1117
YYCHAR while in state YYSTATE. Return the number of bytes copied,
1118
including the terminating null byte. If YYRESULT is null, do not
1119
copy anything; just return the number of bytes that would be
1120
copied. As a special case, return 0 if an ordinary "syntax error"
1121
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1122
size calculation. */
1124
yysyntax_error (char *yyresult, int yystate, int yychar)
1126
int yyn = yypact[yystate];
1128
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1132
int yytype = YYTRANSLATE (yychar);
1133
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1134
YYSIZE_T yysize = yysize0;
1136
int yysize_overflow = 0;
1137
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1138
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1142
/* This is so xgettext sees the translatable formats that are
1143
constructed on the fly. */
1144
YY_("syntax error, unexpected %s");
1145
YY_("syntax error, unexpected %s, expecting %s");
1146
YY_("syntax error, unexpected %s, expecting %s or %s");
1147
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1148
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1152
static char const yyunexpected[] = "syntax error, unexpected %s";
1153
static char const yyexpecting[] = ", expecting %s";
1154
static char const yyor[] = " or %s";
1155
char yyformat[sizeof yyunexpected
1156
+ sizeof yyexpecting - 1
1157
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1158
* (sizeof yyor - 1))];
1159
char const *yyprefix = yyexpecting;
1161
/* Start YYX at -YYN if negative to avoid negative indexes in
1163
int yyxbegin = yyn < 0 ? -yyn : 0;
1165
/* Stay within bounds of both yycheck and yytname. */
1166
int yychecklim = YYLAST - yyn + 1;
1167
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1170
yyarg[0] = yytname[yytype];
1171
yyfmt = yystpcpy (yyformat, yyunexpected);
1173
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1174
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1176
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1180
yyformat[sizeof yyunexpected - 1] = '\0';
1183
yyarg[yycount++] = yytname[yyx];
1184
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1185
yysize_overflow |= (yysize1 < yysize);
1187
yyfmt = yystpcpy (yyfmt, yyprefix);
1191
yyf = YY_(yyformat);
1192
yysize1 = yysize + yystrlen (yyf);
1193
yysize_overflow |= (yysize1 < yysize);
1196
if (yysize_overflow)
1197
return YYSIZE_MAXIMUM;
1201
/* Avoid sprintf, as that infringes on the user's name space.
1202
Don't have undefined behavior even if the translation
1203
produced a string with the wrong number of "%s"s. */
1204
char *yyp = yyresult;
1206
while ((*yyp = *yyf) != '\0')
1208
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1210
yyp += yytnamerr (yyp, yyarg[yyi++]);
1223
#endif /* YYERROR_VERBOSE */
1226
/*-----------------------------------------------.
1227
| Release the memory associated to this symbol. |
1228
`-----------------------------------------------*/
1231
#if (defined __STDC__ || defined __C99__FUNC__ \
1232
|| defined __cplusplus || defined _MSC_VER)
1234
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1237
yydestruct (yymsg, yytype, yyvaluep)
1247
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1258
/* Prevent warnings from -Wmissing-prototypes. */
1260
#ifdef YYPARSE_PARAM
1261
#if defined __STDC__ || defined __cplusplus
1262
int yyparse (void *YYPARSE_PARAM);
1266
#else /* ! YYPARSE_PARAM */
1267
#if defined __STDC__ || defined __cplusplus
1272
#endif /* ! YYPARSE_PARAM */
1276
/* The look-ahead symbol. */
1279
/* The semantic value of the look-ahead symbol. */
1282
/* Number of syntax errors so far. */
1291
#ifdef YYPARSE_PARAM
1292
#if (defined __STDC__ || defined __C99__FUNC__ \
1293
|| defined __cplusplus || defined _MSC_VER)
1295
yyparse (void *YYPARSE_PARAM)
1298
yyparse (YYPARSE_PARAM)
1299
void *YYPARSE_PARAM;
1301
#else /* ! YYPARSE_PARAM */
1302
#if (defined __STDC__ || defined __C99__FUNC__ \
1303
|| defined __cplusplus || defined _MSC_VER)
1317
/* Number of tokens to shift before error messages enabled. */
1319
/* Look-ahead token as an internal (translated) token number. */
1322
/* Buffer for error messages, and its allocated size. */
1324
char *yymsg = yymsgbuf;
1325
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1328
/* Three stacks and their tools:
1329
`yyss': related to states,
1330
`yyvs': related to semantic values,
1331
`yyls': related to locations.
1333
Refer to the stacks thru separate pointers, to allow yyoverflow
1334
to reallocate them elsewhere. */
1336
/* The state stack. */
1337
yytype_int16 yyssa[YYINITDEPTH];
1338
yytype_int16 *yyss = yyssa;
1339
yytype_int16 *yyssp;
1341
/* The semantic value stack. */
1342
YYSTYPE yyvsa[YYINITDEPTH];
1343
YYSTYPE *yyvs = yyvsa;
1348
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1350
YYSIZE_T yystacksize = YYINITDEPTH;
1352
/* The variables used to return semantic value and location from the
1357
/* The number of symbols on the RHS of the reduced rule.
1358
Keep to zero when no symbol should be popped. */
1361
YYDPRINTF ((stderr, "Starting parse\n"));
1366
yychar = YYEMPTY; /* Cause a token to be read. */
1368
/* Initialize stack pointers.
1369
Waste one element of value and location stack
1370
so that they stay on the same level as the state stack.
1371
The wasted elements are never initialized. */
1378
/*------------------------------------------------------------.
1379
| yynewstate -- Push a new state, which is found in yystate. |
1380
`------------------------------------------------------------*/
1382
/* In all cases, when you get here, the value and location stacks
1383
have just been pushed. So pushing a state here evens the stacks. */
1389
if (yyss + yystacksize - 1 <= yyssp)
1391
/* Get the current used size of the three stacks, in elements. */
1392
YYSIZE_T yysize = yyssp - yyss + 1;
1396
/* Give user a chance to reallocate the stack. Use copies of
1397
these so that the &'s don't force the real ones into
1399
YYSTYPE *yyvs1 = yyvs;
1400
yytype_int16 *yyss1 = yyss;
1403
/* Each stack pointer address is followed by the size of the
1404
data in use in that stack, in bytes. This used to be a
1405
conditional around just the two extra args, but that might
1406
be undefined if yyoverflow is a macro. */
1407
yyoverflow (YY_("memory exhausted"),
1408
&yyss1, yysize * sizeof (*yyssp),
1409
&yyvs1, yysize * sizeof (*yyvsp),
1416
#else /* no yyoverflow */
1417
# ifndef YYSTACK_RELOCATE
1418
goto yyexhaustedlab;
1420
/* Extend the stack our own way. */
1421
if (YYMAXDEPTH <= yystacksize)
1422
goto yyexhaustedlab;
1424
if (YYMAXDEPTH < yystacksize)
1425
yystacksize = YYMAXDEPTH;
1428
yytype_int16 *yyss1 = yyss;
1429
union yyalloc *yyptr =
1430
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1432
goto yyexhaustedlab;
1433
YYSTACK_RELOCATE (yyss);
1434
YYSTACK_RELOCATE (yyvs);
1436
# undef YYSTACK_RELOCATE
1438
YYSTACK_FREE (yyss1);
1441
#endif /* no yyoverflow */
1443
yyssp = yyss + yysize - 1;
1444
yyvsp = yyvs + yysize - 1;
1447
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1448
(unsigned long int) yystacksize));
1450
if (yyss + yystacksize - 1 <= yyssp)
1454
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1463
/* Do appropriate processing given the current state. Read a
1464
look-ahead token if we need one and don't already have one. */
1466
/* First try to decide what to do without reference to look-ahead token. */
1467
yyn = yypact[yystate];
1468
if (yyn == YYPACT_NINF)
1471
/* Not known => get a look-ahead token if don't already have one. */
1473
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1474
if (yychar == YYEMPTY)
1476
YYDPRINTF ((stderr, "Reading a token: "));
1480
if (yychar <= YYEOF)
1482
yychar = yytoken = YYEOF;
1483
YYDPRINTF ((stderr, "Now at end of input.\n"));
1487
yytoken = YYTRANSLATE (yychar);
1488
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1491
/* If the proper action on seeing token YYTOKEN is to reduce or to
1492
detect an error, take that action. */
1494
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1499
if (yyn == 0 || yyn == YYTABLE_NINF)
1508
/* Count tokens shifted since error; after three, turn off error
1513
/* Shift the look-ahead token. */
1514
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1516
/* Discard the shifted token unless it is eof. */
1517
if (yychar != YYEOF)
1526
/*-----------------------------------------------------------.
1527
| yydefault -- do the default action for the current state. |
1528
`-----------------------------------------------------------*/
1530
yyn = yydefact[yystate];
1536
/*-----------------------------.
1537
| yyreduce -- Do a reduction. |
1538
`-----------------------------*/
1540
/* yyn is the number of a rule to reduce with. */
1543
/* If YYLEN is nonzero, implement the default value of the action:
1546
Otherwise, the following line sets YYVAL to garbage.
1547
This behavior is undocumented and Bison
1548
users should not rely upon it. Assigning to YYVAL
1549
unconditionally makes the parser a bit smaller, and it avoids a
1550
GCC warning that YYVAL may be used uninitialized. */
1551
yyval = yyvsp[1-yylen];
1554
YY_REDUCE_PRINT (yyn);
1558
#line 180 "v29_notify_gram.y"
1559
{ validate_parse_tree((yyvsp[(1) - (1)].pnval)); }
1563
#line 183 "v29_notify_gram.y"
1564
{ (yyval.pnval) = NULL; }
1568
#line 188 "v29_notify_gram.y"
1571
(yyval.pnval) = mk_parse_node((yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].pnval), (yyvsp[(3) - (3)].pnval));
1576
#line 195 "v29_notify_gram.y"
1579
(yyval.pnval) = mk_parse_node((yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].pnval), (yyvsp[(3) - (3)].pnval));
1584
#line 202 "v29_notify_gram.y"
1585
{ (yyval.pnval) = (yyvsp[(2) - (3)].pnval); }
1589
#line 205 "v29_notify_gram.y"
1591
(yyval.pnval) = mk_parse_node(KW_SERVICEABLE, NULL, NULL);
1592
nr_serviceability_tests++;
1597
#line 209 "v29_notify_gram.y"
1599
(yyval.pnval) = mk_parse_node(KW_SEVERITY, NULL, NULL);
1600
nr_severity_tests++;
1605
#line 216 "v29_notify_gram.y"
1607
(yyval.pnval) = mk_parse_node(TK_EQ, NULL, NULL);
1609
ored_types |= (1 << (yyvsp[(3) - (3)].ival));
1614
#line 221 "v29_notify_gram.y"
1616
(yyval.pnval) = mk_parse_node(TK_NE, NULL, NULL);
1618
anded_types &= ~(1 << (yyvsp[(3) - (3)].ival));
1623
#line 227 "v29_notify_gram.y"
1625
(yyval.ival) = convert_type_to_v29((yyvsp[(1) - (1)].ival));
1626
if ((yyval.ival) == 0)
1627
(*semantic_errors)++;
1632
#line 235 "v29_notify_gram.y"
1633
{ (yyval.ival) = SL_TYPE_BASIC; }
1637
#line 236 "v29_notify_gram.y"
1638
{ (yyval.ival) = SL_TYPE_OS; }
1642
#line 237 "v29_notify_gram.y"
1643
{ (yyval.ival) = SL_TYPE_RTAS; }
1647
#line 238 "v29_notify_gram.y"
1648
{ (yyval.ival) = SL_TYPE_BMC; }
1652
#line 239 "v29_notify_gram.y"
1653
{ (yyval.ival) = SL_TYPE_ENCLOSURE; }
1657
#line 242 "v29_notify_gram.y"
1658
{ notify->severity = 1+(yyvsp[(3) - (3)].ival); }
1662
#line 243 "v29_notify_gram.y"
1663
{ notify->severity = (yyvsp[(3) - (3)].ival); }
1667
#line 244 "v29_notify_gram.y"
1668
{ notify->severity = (yyvsp[(3) - (3)].ival); }
1672
#line 247 "v29_notify_gram.y"
1674
if ((yyvsp[(1) - (1)].ival) < SL_SEV_DEBUG || SL_SEV_FATAL < (yyvsp[(1) - (1)].ival)) {
1675
(*semantic_errors)++;
1676
(yyval.ival) = SL_SEV_FATAL;
1678
(yyval.ival) = (yyvsp[(1) - (1)].ival);
1683
#line 254 "v29_notify_gram.y"
1684
{ (yyval.ival) = SL_SEV_FATAL; }
1688
#line 255 "v29_notify_gram.y"
1689
{ (yyval.ival) = SL_SEV_ERROR; }
1693
#line 256 "v29_notify_gram.y"
1694
{ (yyval.ival) = SL_SEV_ERROR_LOCAL; }
1698
#line 257 "v29_notify_gram.y"
1699
{ (yyval.ival) = SL_SEV_WARNING; }
1703
#line 258 "v29_notify_gram.y"
1704
{ (yyval.ival) = SL_SEV_EVENT; }
1708
#line 259 "v29_notify_gram.y"
1709
{ (yyval.ival) = SL_SEV_INFO; }
1713
#line 260 "v29_notify_gram.y"
1714
{ (yyval.ival) = SL_SEV_DEBUG; }
1718
#line 263 "v29_notify_gram.y"
1720
if ((yyvsp[(3) - (3)].ival) != 0 && (yyvsp[(3) - (3)].ival) != 1) {
1721
(*semantic_errors)++;
1722
notify->serviceable_event = SL_QUERY_ALL;
1723
} else if ((yyvsp[(3) - (3)].ival) == 0)
1724
notify->serviceable_event = SL_QUERY_NO;
1726
notify->serviceable_event = SL_QUERY_YES;
1731
/* Line 1267 of yacc.c. */
1732
#line 1733 "v29_notify_gram.c"
1735
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1739
YY_STACK_PRINT (yyss, yyssp);
1744
/* Now `shift' the result of the reduction. Determine what state
1745
that goes to, based on the state we popped back to and the rule
1746
number reduced by. */
1750
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1751
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1752
yystate = yytable[yystate];
1754
yystate = yydefgoto[yyn - YYNTOKENS];
1759
/*------------------------------------.
1760
| yyerrlab -- here on detecting error |
1761
`------------------------------------*/
1763
/* If not already recovering from an error, report this error. */
1767
#if ! YYERROR_VERBOSE
1768
yyerror (YY_("syntax error"));
1771
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1772
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1774
YYSIZE_T yyalloc = 2 * yysize;
1775
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1776
yyalloc = YYSTACK_ALLOC_MAXIMUM;
1777
if (yymsg != yymsgbuf)
1778
YYSTACK_FREE (yymsg);
1779
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1781
yymsg_alloc = yyalloc;
1785
yymsg_alloc = sizeof yymsgbuf;
1789
if (0 < yysize && yysize <= yymsg_alloc)
1791
(void) yysyntax_error (yymsg, yystate, yychar);
1796
yyerror (YY_("syntax error"));
1798
goto yyexhaustedlab;
1806
if (yyerrstatus == 3)
1808
/* If just tried and failed to reuse look-ahead token after an
1809
error, discard it. */
1811
if (yychar <= YYEOF)
1813
/* Return failure if at end of input. */
1814
if (yychar == YYEOF)
1819
yydestruct ("Error: discarding",
1825
/* Else will try to reuse look-ahead token after shifting the error
1830
/*---------------------------------------------------.
1831
| yyerrorlab -- error raised explicitly by YYERROR. |
1832
`---------------------------------------------------*/
1835
/* Pacify compilers like GCC when the user code never invokes
1836
YYERROR and the label yyerrorlab therefore never appears in user
1838
if (/*CONSTCOND*/ 0)
1841
/* Do not reclaim the symbols of the rule which action triggered
1845
YY_STACK_PRINT (yyss, yyssp);
1850
/*-------------------------------------------------------------.
1851
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1852
`-------------------------------------------------------------*/
1854
yyerrstatus = 3; /* Each real token shifted decrements this. */
1858
yyn = yypact[yystate];
1859
if (yyn != YYPACT_NINF)
1862
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1870
/* Pop the current state because it cannot handle the error token. */
1875
yydestruct ("Error: popping",
1876
yystos[yystate], yyvsp);
1879
YY_STACK_PRINT (yyss, yyssp);
1888
/* Shift the error token. */
1889
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1895
/*-------------------------------------.
1896
| yyacceptlab -- YYACCEPT comes here. |
1897
`-------------------------------------*/
1902
/*-----------------------------------.
1903
| yyabortlab -- YYABORT comes here. |
1904
`-----------------------------------*/
1910
/*-------------------------------------------------.
1911
| yyexhaustedlab -- memory exhaustion comes here. |
1912
`-------------------------------------------------*/
1914
yyerror (YY_("memory exhausted"));
1920
if (yychar != YYEOF && yychar != YYEMPTY)
1921
yydestruct ("Cleanup: discarding lookahead",
1923
/* Do not reclaim the symbols of the rule which action triggered
1924
this YYABORT or YYACCEPT. */
1926
YY_STACK_PRINT (yyss, yyssp);
1927
while (yyssp != yyss)
1929
yydestruct ("Cleanup: popping",
1930
yystos[*yyssp], yyvsp);
1935
YYSTACK_FREE (yyss);
1938
if (yymsg != yymsgbuf)
1939
YYSTACK_FREE (yymsg);
1941
/* Make sure YYID is used. */
1942
return YYID (yyresult);
1946
#line 273 "v29_notify_gram.y"
1950
v29nfy_gram_init(const char *v1_match, struct v29_sl_notify *nfy,
1955
nfy->event_types = all_types;
1956
nfy->serviceable_event = SL_QUERY_ALL;
1959
assert(semantic_errs);
1960
semantic_errors = semantic_errs;
1961
(*semantic_errors) = 0;
1965
nr_type_eq_tests = 0;
1966
nr_type_ne_tests = 0;
1967
nr_serviceability_tests = 0;
1968
nr_severity_tests = 0;
1970
anded_types = all_types;
1973
v29nfy_lex_init(v1_match);
1978
v29nfy_gram_fini(void)