~ubuntu-branches/ubuntu/wily/libservicelog/wily

« back to all changes in this revision

Viewing changes to src/v29_notify_gram.c

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-04-03 19:30:14 UTC
  • Revision ID: package-import@ubuntu.com-20140403193014-w4j3dvho6j1axd6k
Tags: upstream-1.1.14
ImportĀ upstreamĀ versionĀ 1.1.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* A Bison parser, made by GNU Bison 2.3.  */
 
2
 
 
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
 
4
 
 
5
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
6
   Free Software Foundation, Inc.
 
7
 
 
8
   This program is free software; you can redistribute it and/or modify
 
9
   it under the terms of the GNU General Public License as published by
 
10
   the Free Software Foundation; either version 2, or (at your option)
 
11
   any later version.
 
12
 
 
13
   This program is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
   GNU General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
   Boston, MA 02110-1301, USA.  */
 
22
 
 
23
/* As a special exception, you may create a larger work that contains
 
24
   part or all of the Bison parser skeleton and distribute that work
 
25
   under terms of your choice, so long as that work isn't itself a
 
26
   parser generator using the skeleton or a modified version thereof
 
27
   as a parser skeleton.  Alternatively, if you modify or redistribute
 
28
   the parser skeleton itself, you may (at your option) remove this
 
29
   special exception, which will cause the skeleton and the resulting
 
30
   Bison output files to be licensed under the GNU General Public
 
31
   License without this special exception.
 
32
 
 
33
   This special exception was added by the Free Software Foundation in
 
34
   version 2.2 of Bison.  */
 
35
 
 
36
/* C LALR(1) parser skeleton written by Richard Stallman, by
 
37
   simplifying the original so-called "semantic" parser.  */
 
38
 
 
39
/* All symbols defined below should begin with yy or YY, to avoid
 
40
   infringing on user name space.  This should be done even for local
 
41
   variables, as they might otherwise be expanded by user macros.
 
42
   There are some unavoidable exceptions within include files to
 
43
   define necessary library symbols; they are noted "INFRINGES ON
 
44
   USER NAME SPACE" below.  */
 
45
 
 
46
/* Identify Bison output.  */
 
47
#define YYBISON 1
 
48
 
 
49
/* Bison version.  */
 
50
#define YYBISON_VERSION "2.3"
 
51
 
 
52
/* Skeleton name.  */
 
53
#define YYSKELETON_NAME "yacc.c"
 
54
 
 
55
/* Pure parsers.  */
 
56
#define YYPURE 0
 
57
 
 
58
/* Using locations.  */
 
59
#define YYLSP_NEEDED 0
 
60
 
 
61
/* 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
 
69
 
 
70
 
 
71
/* Tokens.  */
 
72
#ifndef YYTOKENTYPE
 
73
# define YYTOKENTYPE
 
74
   /* Put the tokens into the symbol table, so that GDB and other debuggers
 
75
      know about them.  */
 
76
   enum yytokentype {
 
77
     KW_AND = 258,
 
78
     KW_OR = 259,
 
79
     KW_TYPE = 260,
 
80
     KW_SEVERITY = 261,
 
81
     KW_SERVICEABLE = 262,
 
82
     KW_BASIC = 263,
 
83
     KW_OS = 264,
 
84
     KW_RTAS = 265,
 
85
     KW_BMC = 266,
 
86
     KW_ENCLOSURE = 267,
 
87
     KW_FATAL = 268,
 
88
     KW_ERROR = 269,
 
89
     KW_ERROR_LOCAL = 270,
 
90
     KW_WARNING = 271,
 
91
     KW_EVENT = 272,
 
92
     KW_INFO = 273,
 
93
     KW_DEBUG = 274,
 
94
     TK_INT = 275,
 
95
     TK_EQ = 276,
 
96
     TK_NE = 277,
 
97
     TK_GT = 278,
 
98
     TK_GE = 279
 
99
   };
 
100
#endif
 
101
/* Tokens.  */
 
102
#define KW_AND 258
 
103
#define KW_OR 259
 
104
#define KW_TYPE 260
 
105
#define KW_SEVERITY 261
 
106
#define KW_SERVICEABLE 262
 
107
#define KW_BASIC 263
 
108
#define KW_OS 264
 
109
#define KW_RTAS 265
 
110
#define KW_BMC 266
 
111
#define KW_ENCLOSURE 267
 
112
#define KW_FATAL 268
 
113
#define KW_ERROR 269
 
114
#define KW_ERROR_LOCAL 270
 
115
#define KW_WARNING 271
 
116
#define KW_EVENT 272
 
117
#define KW_INFO 273
 
118
#define KW_DEBUG 274
 
119
#define TK_INT 275
 
120
#define TK_EQ 276
 
121
#define TK_NE 277
 
122
#define TK_GT 278
 
123
#define TK_GE 279
 
124
 
 
125
 
 
126
 
 
127
 
 
128
/* Copy the first part of user declarations.  */
 
129
#line 1 "v29_notify_gram.y"
 
130
 
 
131
/**
 
132
 * @file notify_gram.y
 
133
 * @brief yacc grammar for parsing the match member of a v1+ sl_notify struct
 
134
 *
 
135
 * Copyright (C) 2009 IBM Corporation
 
136
 *
 
137
 * We accept only query expressions that can be converted to v0.2.9
 
138
 * sl_notify structs.
 
139
 *
 
140
 * Usage:
 
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.
 
145
 *      }
 
146
 *      v29nfy_gram_fini();
 
147
 *
 
148
 * TODO: Serialize calls to this.
 
149
 *
 
150
 * @author Jim Keniston <jkenisto@us.ibm.com>
 
151
 */
 
152
 
 
153
#include "slog_internal.h"
 
154
#define EXCLUDE_SERVICELOG_COMPAT_DECLS
 
155
#include "../servicelog-1/libservicelog.h"
 
156
#include "v29_notify_gram.h"
 
157
#include <malloc.h>
 
158
#include <assert.h>
 
159
 
 
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);
 
165
 
 
166
#define all_types ((1<<SL_TYPE_OS) | (1<<SL_TYPE_PPC64_RTAS) | (1<<SL_TYPE_PPC64_ENCL))
 
167
 
 
168
extern int yylex(void);
 
169
 
 
170
void
 
171
yyerror(const char *s)
 
172
{
 
173
}
 
174
 
 
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;
 
178
 
 
179
/* We use one or the other, not both. */
 
180
static uint64_t anded_types, ored_types;
 
181
 
 
182
struct parse_node {
 
183
        int nd_type;
 
184
        struct parse_node *nd_left, *nd_right;
 
185
};
 
186
 
 
187
static struct parse_node *
 
188
mk_parse_node(int ndty, struct parse_node *left, struct parse_node *right)
 
189
{
 
190
        struct parse_node *nd = malloc(sizeof(*nd));
 
191
        if (!nd) {
 
192
                (*semantic_errors)++;
 
193
                return NULL;
 
194
        }
 
195
        nd->nd_type = ndty;
 
196
        nd->nd_left = left;
 
197
        nd->nd_right = right;
 
198
        return nd;
 
199
}
 
200
 
 
201
static void
 
202
free_parse_tree(struct parse_node *root)
 
203
{
 
204
        if (!root)
 
205
                return;
 
206
        free_parse_tree(root->nd_left);
 
207
        free_parse_tree(root->nd_right);
 
208
        free(root);
 
209
}
 
210
/*
 
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.
 
213
 */
 
214
static struct parse_node *
 
215
find_type_subtree(struct parse_node *root)
 
216
{
 
217
        struct parse_node *found;
 
218
        if (!root)
 
219
                return NULL;
 
220
        if (root->nd_type  == KW_OR || root->nd_type == TK_EQ)
 
221
                return root;
 
222
        found = find_type_subtree(root->nd_left);
 
223
        if (found)
 
224
                return found;
 
225
        return find_type_subtree(root->nd_right);
 
226
}
 
227
 
 
228
static int
 
229
count_eq_tests_in_subtree(struct parse_node *root)
 
230
{
 
231
        if (root->nd_type == TK_EQ)
 
232
                return 1;
 
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)++;
 
237
        return 0;
 
238
}
 
239
 
 
240
/*
 
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
 
245
 * correct.
 
246
 *
 
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.
 
251
 *
 
252
 * All tests are represented by leaf nodes: KW_SEVERITY, KW_SERVICEABILITY,
 
253
 * KW_EQ (for type=val), or KW_NE (for type!=val).
 
254
 */
 
255
static void
 
256
validate_parse_tree(struct parse_node *root)
 
257
{
 
258
        if (!root)
 
259
                return;
 
260
        if (nr_serviceability_tests > 1 || nr_severity_tests > 1)
 
261
                goto bad;
 
262
        if (nr_type_eq_tests > 0) {
 
263
                // type=val connected by ORs
 
264
                struct parse_node *type_subtree;
 
265
 
 
266
                if (nr_type_ne_tests > 0)
 
267
                        goto bad;
 
268
                if (nr_or_clauses != nr_type_eq_tests-1)
 
269
                        goto bad;
 
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)
 
273
                        goto bad;
 
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)
 
278
                        goto bad;
 
279
                notify->event_types = anded_types;
 
280
        }
 
281
        free_parse_tree(root);
 
282
        return;
 
283
 
 
284
bad:
 
285
        (*semantic_errors)++;
 
286
        free_parse_tree(root);
 
287
}
 
288
 
 
289
 
 
290
 
 
291
/* Enabling traces.  */
 
292
#ifndef YYDEBUG
 
293
# define YYDEBUG 0
 
294
#endif
 
295
 
 
296
/* Enabling verbose error messages.  */
 
297
#ifdef YYERROR_VERBOSE
 
298
# undef YYERROR_VERBOSE
 
299
# define YYERROR_VERBOSE 1
 
300
#else
 
301
# define YYERROR_VERBOSE 0
 
302
#endif
 
303
 
 
304
/* Enabling the token table.  */
 
305
#ifndef YYTOKEN_TABLE
 
306
# define YYTOKEN_TABLE 0
 
307
#endif
 
308
 
 
309
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 
310
typedef union YYSTYPE
 
311
#line 162 "v29_notify_gram.y"
 
312
{
 
313
        int ival;
 
314
        struct parse_node *pnval;
 
315
}
 
316
/* Line 187 of yacc.c.  */
 
317
#line 318 "v29_notify_gram.c"
 
318
        YYSTYPE;
 
319
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 
320
# define YYSTYPE_IS_DECLARED 1
 
321
# define YYSTYPE_IS_TRIVIAL 1
 
322
#endif
 
323
 
 
324
 
 
325
 
 
326
/* Copy the second part of user declarations.  */
 
327
 
 
328
 
 
329
/* Line 216 of yacc.c.  */
 
330
#line 331 "v29_notify_gram.c"
 
331
 
 
332
#ifdef short
 
333
# undef short
 
334
#endif
 
335
 
 
336
#ifdef YYTYPE_UINT8
 
337
typedef YYTYPE_UINT8 yytype_uint8;
 
338
#else
 
339
typedef unsigned char yytype_uint8;
 
340
#endif
 
341
 
 
342
#ifdef YYTYPE_INT8
 
343
typedef YYTYPE_INT8 yytype_int8;
 
344
#elif (defined __STDC__ || defined __C99__FUNC__ \
 
345
     || defined __cplusplus || defined _MSC_VER)
 
346
typedef signed char yytype_int8;
 
347
#else
 
348
typedef short int yytype_int8;
 
349
#endif
 
350
 
 
351
#ifdef YYTYPE_UINT16
 
352
typedef YYTYPE_UINT16 yytype_uint16;
 
353
#else
 
354
typedef unsigned short int yytype_uint16;
 
355
#endif
 
356
 
 
357
#ifdef YYTYPE_INT16
 
358
typedef YYTYPE_INT16 yytype_int16;
 
359
#else
 
360
typedef short int yytype_int16;
 
361
#endif
 
362
 
 
363
#ifndef YYSIZE_T
 
364
# ifdef __SIZE_TYPE__
 
365
#  define YYSIZE_T __SIZE_TYPE__
 
366
# elif defined size_t
 
367
#  define YYSIZE_T size_t
 
368
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 
369
     || defined __cplusplus || defined _MSC_VER)
 
370
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 
371
#  define YYSIZE_T size_t
 
372
# else
 
373
#  define YYSIZE_T unsigned int
 
374
# endif
 
375
#endif
 
376
 
 
377
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
378
 
 
379
#ifndef YY_
 
380
# if YYENABLE_NLS
 
381
#  if ENABLE_NLS
 
382
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 
383
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 
384
#  endif
 
385
# endif
 
386
# ifndef YY_
 
387
#  define YY_(msgid) msgid
 
388
# endif
 
389
#endif
 
390
 
 
391
/* Suppress unused-variable warnings by "using" E.  */
 
392
#if ! defined lint || defined __GNUC__
 
393
# define YYUSE(e) ((void) (e))
 
394
#else
 
395
# define YYUSE(e) /* empty */
 
396
#endif
 
397
 
 
398
/* Identity function, used to suppress warnings about constant conditions.  */
 
399
#ifndef lint
 
400
# define YYID(n) (n)
 
401
#else
 
402
#if (defined __STDC__ || defined __C99__FUNC__ \
 
403
     || defined __cplusplus || defined _MSC_VER)
 
404
static int
 
405
YYID (int i)
 
406
#else
 
407
static int
 
408
YYID (i)
 
409
    int i;
 
410
#endif
 
411
{
 
412
  return i;
 
413
}
 
414
#endif
 
415
 
 
416
#if ! defined yyoverflow || YYERROR_VERBOSE
 
417
 
 
418
/* The parser invokes alloca or malloc; define the necessary symbols.  */
 
419
 
 
420
# ifdef YYSTACK_USE_ALLOCA
 
421
#  if YYSTACK_USE_ALLOCA
 
422
#   ifdef __GNUC__
 
423
#    define YYSTACK_ALLOC __builtin_alloca
 
424
#   elif defined __BUILTIN_VA_ARG_INCR
 
425
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 
426
#   elif defined _AIX
 
427
#    define YYSTACK_ALLOC __alloca
 
428
#   elif defined _MSC_VER
 
429
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 
430
#    define alloca _alloca
 
431
#   else
 
432
#    define YYSTACK_ALLOC alloca
 
433
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
434
     || defined __cplusplus || defined _MSC_VER)
 
435
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
436
#     ifndef _STDLIB_H
 
437
#      define _STDLIB_H 1
 
438
#     endif
 
439
#    endif
 
440
#   endif
 
441
#  endif
 
442
# endif
 
443
 
 
444
# ifdef YYSTACK_ALLOC
 
445
   /* Pacify GCC's `empty if-body' warning.  */
 
446
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 
447
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
448
    /* The OS might guarantee only one guard page at the bottom of the stack,
 
449
       and a page size can be as small as 4096 bytes.  So we cannot safely
 
450
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 
451
       to allow for a few compiler-allocated temporary stack slots.  */
 
452
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 
453
#  endif
 
454
# else
 
455
#  define YYSTACK_ALLOC YYMALLOC
 
456
#  define YYSTACK_FREE YYFREE
 
457
#  ifndef YYSTACK_ALLOC_MAXIMUM
 
458
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 
459
#  endif
 
460
#  if (defined __cplusplus && ! defined _STDLIB_H \
 
461
       && ! ((defined YYMALLOC || defined malloc) \
 
462
             && (defined YYFREE || defined free)))
 
463
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
464
#   ifndef _STDLIB_H
 
465
#    define _STDLIB_H 1
 
466
#   endif
 
467
#  endif
 
468
#  ifndef YYMALLOC
 
469
#   define YYMALLOC malloc
 
470
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
471
     || defined __cplusplus || defined _MSC_VER)
 
472
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 
473
#   endif
 
474
#  endif
 
475
#  ifndef YYFREE
 
476
#   define YYFREE free
 
477
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 
478
     || defined __cplusplus || defined _MSC_VER)
 
479
void free (void *); /* INFRINGES ON USER NAME SPACE */
 
480
#   endif
 
481
#  endif
 
482
# endif
 
483
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
484
 
 
485
 
 
486
#if (! defined yyoverflow \
 
487
     && (! defined __cplusplus \
 
488
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
489
 
 
490
/* A type that is properly aligned for any stack member.  */
 
491
union yyalloc
 
492
{
 
493
  yytype_int16 yyss;
 
494
  YYSTYPE yyvs;
 
495
  };
 
496
 
 
497
/* The size of the maximum gap between one aligned stack and the next.  */
 
498
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 
499
 
 
500
/* The size of an array large to enough to hold all stacks, each with
 
501
   N elements.  */
 
502
# define YYSTACK_BYTES(N) \
 
503
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 
504
      + YYSTACK_GAP_MAXIMUM)
 
505
 
 
506
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
507
   not overlap.  */
 
508
# ifndef YYCOPY
 
509
#  if defined __GNUC__ && 1 < __GNUC__
 
510
#   define YYCOPY(To, From, Count) \
 
511
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
512
#  else
 
513
#   define YYCOPY(To, From, Count)              \
 
514
      do                                        \
 
515
        {                                       \
 
516
          YYSIZE_T yyi;                         \
 
517
          for (yyi = 0; yyi < (Count); yyi++)   \
 
518
            (To)[yyi] = (From)[yyi];            \
 
519
        }                                       \
 
520
      while (YYID (0))
 
521
#  endif
 
522
# endif
 
523
 
 
524
/* Relocate STACK from its old location to the new one.  The
 
525
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 
526
   elements in the stack, and YYPTR gives the new location of the
 
527
   stack.  Advance YYPTR to a properly aligned location for the next
 
528
   stack.  */
 
529
# define YYSTACK_RELOCATE(Stack)                                        \
 
530
    do                                                                  \
 
531
      {                                                                 \
 
532
        YYSIZE_T yynewbytes;                                            \
 
533
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
534
        Stack = &yyptr->Stack;                                          \
 
535
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
536
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
537
      }                                                                 \
 
538
    while (YYID (0))
 
539
 
 
540
#endif
 
541
 
 
542
/* YYFINAL -- State number of the termination state.  */
 
543
#define YYFINAL  21
 
544
/* YYLAST -- Last index in YYTABLE.  */
 
545
#define YYLAST   36
 
546
 
 
547
/* YYNTOKENS -- Number of terminals.  */
 
548
#define YYNTOKENS  27
 
549
/* YYNNTS -- Number of nonterminals.  */
 
550
#define YYNNTS  13
 
551
/* YYNRULES -- Number of rules.  */
 
552
#define YYNRULES  34
 
553
/* YYNRULES -- Number of states.  */
 
554
#define YYNSTATES  48
 
555
 
 
556
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 
557
#define YYUNDEFTOK  2
 
558
#define YYMAXUTOK   279
 
559
 
 
560
#define YYTRANSLATE(YYX)                                                \
 
561
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
562
 
 
563
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 
564
static const yytype_uint8 yytranslate[] =
 
565
{
 
566
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
567
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
568
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
569
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
570
      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
 
594
};
 
595
 
 
596
#if YYDEBUG
 
597
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 
598
   YYRHS.  */
 
599
static const yytype_uint8 yyprhs[] =
 
600
{
 
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,
 
604
      74,    76,    78,    80,    82
 
605
};
 
606
 
 
607
/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 
608
static const yytype_int8 yyrhs[] =
 
609
{
 
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
 
619
};
 
620
 
 
621
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 
622
static const yytype_uint16 yyrline[] =
 
623
{
 
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
 
628
};
 
629
#endif
 
630
 
 
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[] =
 
635
{
 
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
 
644
};
 
645
#endif
 
646
 
 
647
# ifdef YYPRINT
 
648
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 
649
   token YYLEX-NUM.  */
 
650
static const yytype_uint16 yytoknum[] =
 
651
{
 
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
 
655
};
 
656
# endif
 
657
 
 
658
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 
659
static const yytype_uint8 yyr1[] =
 
660
{
 
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,
 
664
      38,    38,    38,    38,    39
 
665
};
 
666
 
 
667
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 
668
static const yytype_uint8 yyr2[] =
 
669
{
 
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,
 
673
       1,     1,     1,     1,     3
 
674
};
 
675
 
 
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[] =
 
680
{
 
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
 
686
};
 
687
 
 
688
/* YYDEFGOTO[NTERM-NUM].  */
 
689
static const yytype_int8 yydefgoto[] =
 
690
{
 
691
      -1,     5,     6,     7,     8,     9,    10,    11,    30,    31,
 
692
      12,    41,    13
 
693
};
 
694
 
 
695
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 
696
   STATE-NUM.  */
 
697
#define YYPACT_NINF -21
 
698
static const yytype_int8 yypact[] =
 
699
{
 
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
 
705
};
 
706
 
 
707
/* YYPGOTO[NTERM-NUM].  */
 
708
static const yytype_int8 yypgoto[] =
 
709
{
 
710
     -21,   -21,   -21,    28,    14,    10,   -21,   -21,    19,   -21,
 
711
     -21,     0,   -21
 
712
};
 
713
 
 
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[] =
 
720
{
 
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
 
725
};
 
726
 
 
727
static const yytype_int8 yycheck[] =
 
728
{
 
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
 
733
};
 
734
 
 
735
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 
736
   symbol of state STATE-NUM.  */
 
737
static const yytype_uint8 yystos[] =
 
738
{
 
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
 
744
};
 
745
 
 
746
#define yyerrok         (yyerrstatus = 0)
 
747
#define yyclearin       (yychar = YYEMPTY)
 
748
#define YYEMPTY         (-2)
 
749
#define YYEOF           0
 
750
 
 
751
#define YYACCEPT        goto yyacceptlab
 
752
#define YYABORT         goto yyabortlab
 
753
#define YYERROR         goto yyerrorlab
 
754
 
 
755
 
 
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.  */
 
759
 
 
760
#define YYFAIL          goto yyerrlab
 
761
 
 
762
#define YYRECOVERING()  (!!yyerrstatus)
 
763
 
 
764
#define YYBACKUP(Token, Value)                                  \
 
765
do                                                              \
 
766
  if (yychar == YYEMPTY && yylen == 1)                          \
 
767
    {                                                           \
 
768
      yychar = (Token);                                         \
 
769
      yylval = (Value);                                         \
 
770
      yytoken = YYTRANSLATE (yychar);                           \
 
771
      YYPOPSTACK (1);                                           \
 
772
      goto yybackup;                                            \
 
773
    }                                                           \
 
774
  else                                                          \
 
775
    {                                                           \
 
776
      yyerror (YY_("syntax error: cannot back up")); \
 
777
      YYERROR;                                                  \
 
778
    }                                                           \
 
779
while (YYID (0))
 
780
 
 
781
 
 
782
#define YYTERROR        1
 
783
#define YYERRCODE       256
 
784
 
 
785
 
 
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).  */
 
789
 
 
790
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
791
#ifndef YYLLOC_DEFAULT
 
792
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 
793
    do                                                                  \
 
794
      if (YYID (N))                                                    \
 
795
        {                                                               \
 
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;       \
 
800
        }                                                               \
 
801
      else                                                              \
 
802
        {                                                               \
 
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;                              \
 
807
        }                                                               \
 
808
    while (YYID (0))
 
809
#endif
 
810
 
 
811
 
 
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.  */
 
815
 
 
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)
 
822
# else
 
823
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
824
# endif
 
825
#endif
 
826
 
 
827
 
 
828
/* YYLEX -- calling `yylex' with the right arguments.  */
 
829
 
 
830
#ifdef YYLEX_PARAM
 
831
# define YYLEX yylex (YYLEX_PARAM)
 
832
#else
 
833
# define YYLEX yylex ()
 
834
#endif
 
835
 
 
836
/* Enable debugging if requested.  */
 
837
#if YYDEBUG
 
838
 
 
839
# ifndef YYFPRINTF
 
840
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 
841
#  define YYFPRINTF fprintf
 
842
# endif
 
843
 
 
844
# define YYDPRINTF(Args)                        \
 
845
do {                                            \
 
846
  if (yydebug)                                  \
 
847
    YYFPRINTF Args;                             \
 
848
} while (YYID (0))
 
849
 
 
850
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 
851
do {                                                                      \
 
852
  if (yydebug)                                                            \
 
853
    {                                                                     \
 
854
      YYFPRINTF (stderr, "%s ", Title);                                   \
 
855
      yy_symbol_print (stderr,                                            \
 
856
                  Type, Value); \
 
857
      YYFPRINTF (stderr, "\n");                                           \
 
858
    }                                                                     \
 
859
} while (YYID (0))
 
860
 
 
861
 
 
862
/*--------------------------------.
 
863
| Print this symbol on YYOUTPUT.  |
 
864
`--------------------------------*/
 
865
 
 
866
/*ARGSUSED*/
 
867
#if (defined __STDC__ || defined __C99__FUNC__ \
 
868
     || defined __cplusplus || defined _MSC_VER)
 
869
static void
 
870
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
871
#else
 
872
static void
 
873
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 
874
    FILE *yyoutput;
 
875
    int yytype;
 
876
    YYSTYPE const * const yyvaluep;
 
877
#endif
 
878
{
 
879
  if (!yyvaluep)
 
880
    return;
 
881
# ifdef YYPRINT
 
882
  if (yytype < YYNTOKENS)
 
883
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 
884
# else
 
885
  YYUSE (yyoutput);
 
886
# endif
 
887
  switch (yytype)
 
888
    {
 
889
      default:
 
890
        break;
 
891
    }
 
892
}
 
893
 
 
894
 
 
895
/*--------------------------------.
 
896
| Print this symbol on YYOUTPUT.  |
 
897
`--------------------------------*/
 
898
 
 
899
#if (defined __STDC__ || defined __C99__FUNC__ \
 
900
     || defined __cplusplus || defined _MSC_VER)
 
901
static void
 
902
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 
903
#else
 
904
static void
 
905
yy_symbol_print (yyoutput, yytype, yyvaluep)
 
906
    FILE *yyoutput;
 
907
    int yytype;
 
908
    YYSTYPE const * const yyvaluep;
 
909
#endif
 
910
{
 
911
  if (yytype < YYNTOKENS)
 
912
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 
913
  else
 
914
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
915
 
 
916
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 
917
  YYFPRINTF (yyoutput, ")");
 
918
}
 
919
 
 
920
/*------------------------------------------------------------------.
 
921
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 
922
| TOP (included).                                                   |
 
923
`------------------------------------------------------------------*/
 
924
 
 
925
#if (defined __STDC__ || defined __C99__FUNC__ \
 
926
     || defined __cplusplus || defined _MSC_VER)
 
927
static void
 
928
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 
929
#else
 
930
static void
 
931
yy_stack_print (bottom, top)
 
932
    yytype_int16 *bottom;
 
933
    yytype_int16 *top;
 
934
#endif
 
935
{
 
936
  YYFPRINTF (stderr, "Stack now");
 
937
  for (; bottom <= top; ++bottom)
 
938
    YYFPRINTF (stderr, " %d", *bottom);
 
939
  YYFPRINTF (stderr, "\n");
 
940
}
 
941
 
 
942
# define YY_STACK_PRINT(Bottom, Top)                            \
 
943
do {                                                            \
 
944
  if (yydebug)                                                  \
 
945
    yy_stack_print ((Bottom), (Top));                           \
 
946
} while (YYID (0))
 
947
 
 
948
 
 
949
/*------------------------------------------------.
 
950
| Report that the YYRULE is going to be reduced.  |
 
951
`------------------------------------------------*/
 
952
 
 
953
#if (defined __STDC__ || defined __C99__FUNC__ \
 
954
     || defined __cplusplus || defined _MSC_VER)
 
955
static void
 
956
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 
957
#else
 
958
static void
 
959
yy_reduce_print (yyvsp, yyrule)
 
960
    YYSTYPE *yyvsp;
 
961
    int yyrule;
 
962
#endif
 
963
{
 
964
  int yynrhs = yyr2[yyrule];
 
965
  int yyi;
 
966
  unsigned long int yylno = yyrline[yyrule];
 
967
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 
968
             yyrule - 1, yylno);
 
969
  /* The symbols being reduced.  */
 
970
  for (yyi = 0; yyi < yynrhs; yyi++)
 
971
    {
 
972
      fprintf (stderr, "   $%d = ", yyi + 1);
 
973
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 
974
                       &(yyvsp[(yyi + 1) - (yynrhs)])
 
975
                                       );
 
976
      fprintf (stderr, "\n");
 
977
    }
 
978
}
 
979
 
 
980
# define YY_REDUCE_PRINT(Rule)          \
 
981
do {                                    \
 
982
  if (yydebug)                          \
 
983
    yy_reduce_print (yyvsp, Rule); \
 
984
} while (YYID (0))
 
985
 
 
986
/* Nonzero means print parse trace.  It is left uninitialized so that
 
987
   multiple parsers can coexist.  */
 
988
int yydebug;
 
989
#else /* !YYDEBUG */
 
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 */
 
995
 
 
996
 
 
997
/* YYINITDEPTH -- initial size of the parser's stacks.  */
 
998
#ifndef YYINITDEPTH
 
999
# define YYINITDEPTH 200
 
1000
#endif
 
1001
 
 
1002
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 
1003
   if the built-in stack extension method is used).
 
1004
 
 
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.  */
 
1008
 
 
1009
#ifndef YYMAXDEPTH
 
1010
# define YYMAXDEPTH 10000
 
1011
#endif
 
1012
 
 
1013
 
 
1014
 
 
1015
#if YYERROR_VERBOSE
 
1016
 
 
1017
# ifndef yystrlen
 
1018
#  if defined __GLIBC__ && defined _STRING_H
 
1019
#   define yystrlen strlen
 
1020
#  else
 
1021
/* Return the length of YYSTR.  */
 
1022
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1023
     || defined __cplusplus || defined _MSC_VER)
 
1024
static YYSIZE_T
 
1025
yystrlen (const char *yystr)
 
1026
#else
 
1027
static YYSIZE_T
 
1028
yystrlen (yystr)
 
1029
    const char *yystr;
 
1030
#endif
 
1031
{
 
1032
  YYSIZE_T yylen;
 
1033
  for (yylen = 0; yystr[yylen]; yylen++)
 
1034
    continue;
 
1035
  return yylen;
 
1036
}
 
1037
#  endif
 
1038
# endif
 
1039
 
 
1040
# ifndef yystpcpy
 
1041
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 
1042
#   define yystpcpy stpcpy
 
1043
#  else
 
1044
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 
1045
   YYDEST.  */
 
1046
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1047
     || defined __cplusplus || defined _MSC_VER)
 
1048
static char *
 
1049
yystpcpy (char *yydest, const char *yysrc)
 
1050
#else
 
1051
static char *
 
1052
yystpcpy (yydest, yysrc)
 
1053
    char *yydest;
 
1054
    const char *yysrc;
 
1055
#endif
 
1056
{
 
1057
  char *yyd = yydest;
 
1058
  const char *yys = yysrc;
 
1059
 
 
1060
  while ((*yyd++ = *yys++) != '\0')
 
1061
    continue;
 
1062
 
 
1063
  return yyd - 1;
 
1064
}
 
1065
#  endif
 
1066
# endif
 
1067
 
 
1068
# ifndef yytnamerr
 
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
 
1075
   would have been.  */
 
1076
static YYSIZE_T
 
1077
yytnamerr (char *yyres, const char *yystr)
 
1078
{
 
1079
  if (*yystr == '"')
 
1080
    {
 
1081
      YYSIZE_T yyn = 0;
 
1082
      char const *yyp = yystr;
 
1083
 
 
1084
      for (;;)
 
1085
        switch (*++yyp)
 
1086
          {
 
1087
          case '\'':
 
1088
          case ',':
 
1089
            goto do_not_strip_quotes;
 
1090
 
 
1091
          case '\\':
 
1092
            if (*++yyp != '\\')
 
1093
              goto do_not_strip_quotes;
 
1094
            /* Fall through.  */
 
1095
          default:
 
1096
            if (yyres)
 
1097
              yyres[yyn] = *yyp;
 
1098
            yyn++;
 
1099
            break;
 
1100
 
 
1101
          case '"':
 
1102
            if (yyres)
 
1103
              yyres[yyn] = '\0';
 
1104
            return yyn;
 
1105
          }
 
1106
    do_not_strip_quotes: ;
 
1107
    }
 
1108
 
 
1109
  if (! yyres)
 
1110
    return yystrlen (yystr);
 
1111
 
 
1112
  return yystpcpy (yyres, yystr) - yyres;
 
1113
}
 
1114
# endif
 
1115
 
 
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.  */
 
1123
static YYSIZE_T
 
1124
yysyntax_error (char *yyresult, int yystate, int yychar)
 
1125
{
 
1126
  int yyn = yypact[yystate];
 
1127
 
 
1128
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 
1129
    return 0;
 
1130
  else
 
1131
    {
 
1132
      int yytype = YYTRANSLATE (yychar);
 
1133
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 
1134
      YYSIZE_T yysize = yysize0;
 
1135
      YYSIZE_T yysize1;
 
1136
      int yysize_overflow = 0;
 
1137
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 
1138
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 
1139
      int yyx;
 
1140
 
 
1141
# if 0
 
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");
 
1149
# endif
 
1150
      char *yyfmt;
 
1151
      char const *yyf;
 
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;
 
1160
 
 
1161
      /* Start YYX at -YYN if negative to avoid negative indexes in
 
1162
         YYCHECK.  */
 
1163
      int yyxbegin = yyn < 0 ? -yyn : 0;
 
1164
 
 
1165
      /* Stay within bounds of both yycheck and yytname.  */
 
1166
      int yychecklim = YYLAST - yyn + 1;
 
1167
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
1168
      int yycount = 1;
 
1169
 
 
1170
      yyarg[0] = yytname[yytype];
 
1171
      yyfmt = yystpcpy (yyformat, yyunexpected);
 
1172
 
 
1173
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
1174
        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
1175
          {
 
1176
            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 
1177
              {
 
1178
                yycount = 1;
 
1179
                yysize = yysize0;
 
1180
                yyformat[sizeof yyunexpected - 1] = '\0';
 
1181
                break;
 
1182
              }
 
1183
            yyarg[yycount++] = yytname[yyx];
 
1184
            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
1185
            yysize_overflow |= (yysize1 < yysize);
 
1186
            yysize = yysize1;
 
1187
            yyfmt = yystpcpy (yyfmt, yyprefix);
 
1188
            yyprefix = yyor;
 
1189
          }
 
1190
 
 
1191
      yyf = YY_(yyformat);
 
1192
      yysize1 = yysize + yystrlen (yyf);
 
1193
      yysize_overflow |= (yysize1 < yysize);
 
1194
      yysize = yysize1;
 
1195
 
 
1196
      if (yysize_overflow)
 
1197
        return YYSIZE_MAXIMUM;
 
1198
 
 
1199
      if (yyresult)
 
1200
        {
 
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;
 
1205
          int yyi = 0;
 
1206
          while ((*yyp = *yyf) != '\0')
 
1207
            {
 
1208
              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
 
1209
                {
 
1210
                  yyp += yytnamerr (yyp, yyarg[yyi++]);
 
1211
                  yyf += 2;
 
1212
                }
 
1213
              else
 
1214
                {
 
1215
                  yyp++;
 
1216
                  yyf++;
 
1217
                }
 
1218
            }
 
1219
        }
 
1220
      return yysize;
 
1221
    }
 
1222
}
 
1223
#endif /* YYERROR_VERBOSE */
 
1224
 
 
1225
 
 
1226
/*-----------------------------------------------.
 
1227
| Release the memory associated to this symbol.  |
 
1228
`-----------------------------------------------*/
 
1229
 
 
1230
/*ARGSUSED*/
 
1231
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1232
     || defined __cplusplus || defined _MSC_VER)
 
1233
static void
 
1234
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
1235
#else
 
1236
static void
 
1237
yydestruct (yymsg, yytype, yyvaluep)
 
1238
    const char *yymsg;
 
1239
    int yytype;
 
1240
    YYSTYPE *yyvaluep;
 
1241
#endif
 
1242
{
 
1243
  YYUSE (yyvaluep);
 
1244
 
 
1245
  if (!yymsg)
 
1246
    yymsg = "Deleting";
 
1247
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
1248
 
 
1249
  switch (yytype)
 
1250
    {
 
1251
 
 
1252
      default:
 
1253
        break;
 
1254
    }
 
1255
}
 
1256
 
 
1257
 
 
1258
/* Prevent warnings from -Wmissing-prototypes.  */
 
1259
 
 
1260
#ifdef YYPARSE_PARAM
 
1261
#if defined __STDC__ || defined __cplusplus
 
1262
int yyparse (void *YYPARSE_PARAM);
 
1263
#else
 
1264
int yyparse ();
 
1265
#endif
 
1266
#else /* ! YYPARSE_PARAM */
 
1267
#if defined __STDC__ || defined __cplusplus
 
1268
int yyparse (void);
 
1269
#else
 
1270
int yyparse ();
 
1271
#endif
 
1272
#endif /* ! YYPARSE_PARAM */
 
1273
 
 
1274
 
 
1275
 
 
1276
/* The look-ahead symbol.  */
 
1277
int yychar;
 
1278
 
 
1279
/* The semantic value of the look-ahead symbol.  */
 
1280
YYSTYPE yylval;
 
1281
 
 
1282
/* Number of syntax errors so far.  */
 
1283
int yynerrs;
 
1284
 
 
1285
 
 
1286
 
 
1287
/*----------.
 
1288
| yyparse.  |
 
1289
`----------*/
 
1290
 
 
1291
#ifdef YYPARSE_PARAM
 
1292
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1293
     || defined __cplusplus || defined _MSC_VER)
 
1294
int
 
1295
yyparse (void *YYPARSE_PARAM)
 
1296
#else
 
1297
int
 
1298
yyparse (YYPARSE_PARAM)
 
1299
    void *YYPARSE_PARAM;
 
1300
#endif
 
1301
#else /* ! YYPARSE_PARAM */
 
1302
#if (defined __STDC__ || defined __C99__FUNC__ \
 
1303
     || defined __cplusplus || defined _MSC_VER)
 
1304
int
 
1305
yyparse (void)
 
1306
#else
 
1307
int
 
1308
yyparse ()
 
1309
 
 
1310
#endif
 
1311
#endif
 
1312
{
 
1313
  
 
1314
  int yystate;
 
1315
  int yyn;
 
1316
  int yyresult;
 
1317
  /* Number of tokens to shift before error messages enabled.  */
 
1318
  int yyerrstatus;
 
1319
  /* Look-ahead token as an internal (translated) token number.  */
 
1320
  int yytoken = 0;
 
1321
#if YYERROR_VERBOSE
 
1322
  /* Buffer for error messages, and its allocated size.  */
 
1323
  char yymsgbuf[128];
 
1324
  char *yymsg = yymsgbuf;
 
1325
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 
1326
#endif
 
1327
 
 
1328
  /* Three stacks and their tools:
 
1329
     `yyss': related to states,
 
1330
     `yyvs': related to semantic values,
 
1331
     `yyls': related to locations.
 
1332
 
 
1333
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1334
     to reallocate them elsewhere.  */
 
1335
 
 
1336
  /* The state stack.  */
 
1337
  yytype_int16 yyssa[YYINITDEPTH];
 
1338
  yytype_int16 *yyss = yyssa;
 
1339
  yytype_int16 *yyssp;
 
1340
 
 
1341
  /* The semantic value stack.  */
 
1342
  YYSTYPE yyvsa[YYINITDEPTH];
 
1343
  YYSTYPE *yyvs = yyvsa;
 
1344
  YYSTYPE *yyvsp;
 
1345
 
 
1346
 
 
1347
 
 
1348
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
1349
 
 
1350
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1351
 
 
1352
  /* The variables used to return semantic value and location from the
 
1353
     action routines.  */
 
1354
  YYSTYPE yyval;
 
1355
 
 
1356
 
 
1357
  /* The number of symbols on the RHS of the reduced rule.
 
1358
     Keep to zero when no symbol should be popped.  */
 
1359
  int yylen = 0;
 
1360
 
 
1361
  YYDPRINTF ((stderr, "Starting parse\n"));
 
1362
 
 
1363
  yystate = 0;
 
1364
  yyerrstatus = 0;
 
1365
  yynerrs = 0;
 
1366
  yychar = YYEMPTY;             /* Cause a token to be read.  */
 
1367
 
 
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.  */
 
1372
 
 
1373
  yyssp = yyss;
 
1374
  yyvsp = yyvs;
 
1375
 
 
1376
  goto yysetstate;
 
1377
 
 
1378
/*------------------------------------------------------------.
 
1379
| yynewstate -- Push a new state, which is found in yystate.  |
 
1380
`------------------------------------------------------------*/
 
1381
 yynewstate:
 
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.  */
 
1384
  yyssp++;
 
1385
 
 
1386
 yysetstate:
 
1387
  *yyssp = yystate;
 
1388
 
 
1389
  if (yyss + yystacksize - 1 <= yyssp)
 
1390
    {
 
1391
      /* Get the current used size of the three stacks, in elements.  */
 
1392
      YYSIZE_T yysize = yyssp - yyss + 1;
 
1393
 
 
1394
#ifdef yyoverflow
 
1395
      {
 
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
 
1398
           memory.  */
 
1399
        YYSTYPE *yyvs1 = yyvs;
 
1400
        yytype_int16 *yyss1 = yyss;
 
1401
 
 
1402
 
 
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),
 
1410
 
 
1411
                    &yystacksize);
 
1412
 
 
1413
        yyss = yyss1;
 
1414
        yyvs = yyvs1;
 
1415
      }
 
1416
#else /* no yyoverflow */
 
1417
# ifndef YYSTACK_RELOCATE
 
1418
      goto yyexhaustedlab;
 
1419
# else
 
1420
      /* Extend the stack our own way.  */
 
1421
      if (YYMAXDEPTH <= yystacksize)
 
1422
        goto yyexhaustedlab;
 
1423
      yystacksize *= 2;
 
1424
      if (YYMAXDEPTH < yystacksize)
 
1425
        yystacksize = YYMAXDEPTH;
 
1426
 
 
1427
      {
 
1428
        yytype_int16 *yyss1 = yyss;
 
1429
        union yyalloc *yyptr =
 
1430
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 
1431
        if (! yyptr)
 
1432
          goto yyexhaustedlab;
 
1433
        YYSTACK_RELOCATE (yyss);
 
1434
        YYSTACK_RELOCATE (yyvs);
 
1435
 
 
1436
#  undef YYSTACK_RELOCATE
 
1437
        if (yyss1 != yyssa)
 
1438
          YYSTACK_FREE (yyss1);
 
1439
      }
 
1440
# endif
 
1441
#endif /* no yyoverflow */
 
1442
 
 
1443
      yyssp = yyss + yysize - 1;
 
1444
      yyvsp = yyvs + yysize - 1;
 
1445
 
 
1446
 
 
1447
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 
1448
                  (unsigned long int) yystacksize));
 
1449
 
 
1450
      if (yyss + yystacksize - 1 <= yyssp)
 
1451
        YYABORT;
 
1452
    }
 
1453
 
 
1454
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
1455
 
 
1456
  goto yybackup;
 
1457
 
 
1458
/*-----------.
 
1459
| yybackup.  |
 
1460
`-----------*/
 
1461
yybackup:
 
1462
 
 
1463
  /* Do appropriate processing given the current state.  Read a
 
1464
     look-ahead token if we need one and don't already have one.  */
 
1465
 
 
1466
  /* First try to decide what to do without reference to look-ahead token.  */
 
1467
  yyn = yypact[yystate];
 
1468
  if (yyn == YYPACT_NINF)
 
1469
    goto yydefault;
 
1470
 
 
1471
  /* Not known => get a look-ahead token if don't already have one.  */
 
1472
 
 
1473
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
 
1474
  if (yychar == YYEMPTY)
 
1475
    {
 
1476
      YYDPRINTF ((stderr, "Reading a token: "));
 
1477
      yychar = YYLEX;
 
1478
    }
 
1479
 
 
1480
  if (yychar <= YYEOF)
 
1481
    {
 
1482
      yychar = yytoken = YYEOF;
 
1483
      YYDPRINTF ((stderr, "Now at end of input.\n"));
 
1484
    }
 
1485
  else
 
1486
    {
 
1487
      yytoken = YYTRANSLATE (yychar);
 
1488
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 
1489
    }
 
1490
 
 
1491
  /* If the proper action on seeing token YYTOKEN is to reduce or to
 
1492
     detect an error, take that action.  */
 
1493
  yyn += yytoken;
 
1494
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 
1495
    goto yydefault;
 
1496
  yyn = yytable[yyn];
 
1497
  if (yyn <= 0)
 
1498
    {
 
1499
      if (yyn == 0 || yyn == YYTABLE_NINF)
 
1500
        goto yyerrlab;
 
1501
      yyn = -yyn;
 
1502
      goto yyreduce;
 
1503
    }
 
1504
 
 
1505
  if (yyn == YYFINAL)
 
1506
    YYACCEPT;
 
1507
 
 
1508
  /* Count tokens shifted since error; after three, turn off error
 
1509
     status.  */
 
1510
  if (yyerrstatus)
 
1511
    yyerrstatus--;
 
1512
 
 
1513
  /* Shift the look-ahead token.  */
 
1514
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
1515
 
 
1516
  /* Discard the shifted token unless it is eof.  */
 
1517
  if (yychar != YYEOF)
 
1518
    yychar = YYEMPTY;
 
1519
 
 
1520
  yystate = yyn;
 
1521
  *++yyvsp = yylval;
 
1522
 
 
1523
  goto yynewstate;
 
1524
 
 
1525
 
 
1526
/*-----------------------------------------------------------.
 
1527
| yydefault -- do the default action for the current state.  |
 
1528
`-----------------------------------------------------------*/
 
1529
yydefault:
 
1530
  yyn = yydefact[yystate];
 
1531
  if (yyn == 0)
 
1532
    goto yyerrlab;
 
1533
  goto yyreduce;
 
1534
 
 
1535
 
 
1536
/*-----------------------------.
 
1537
| yyreduce -- Do a reduction.  |
 
1538
`-----------------------------*/
 
1539
yyreduce:
 
1540
  /* yyn is the number of a rule to reduce with.  */
 
1541
  yylen = yyr2[yyn];
 
1542
 
 
1543
  /* If YYLEN is nonzero, implement the default value of the action:
 
1544
     `$$ = $1'.
 
1545
 
 
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];
 
1552
 
 
1553
 
 
1554
  YY_REDUCE_PRINT (yyn);
 
1555
  switch (yyn)
 
1556
    {
 
1557
        case 2:
 
1558
#line 180 "v29_notify_gram.y"
 
1559
    { validate_parse_tree((yyvsp[(1) - (1)].pnval)); }
 
1560
    break;
 
1561
 
 
1562
  case 3:
 
1563
#line 183 "v29_notify_gram.y"
 
1564
    { (yyval.pnval) = NULL; }
 
1565
    break;
 
1566
 
 
1567
  case 6:
 
1568
#line 188 "v29_notify_gram.y"
 
1569
    {
 
1570
                                nr_or_clauses++;
 
1571
                                (yyval.pnval) = mk_parse_node((yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].pnval), (yyvsp[(3) - (3)].pnval));
 
1572
                        }
 
1573
    break;
 
1574
 
 
1575
  case 8:
 
1576
#line 195 "v29_notify_gram.y"
 
1577
    {
 
1578
                                nr_and_clauses++;
 
1579
                                (yyval.pnval) = mk_parse_node((yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].pnval), (yyvsp[(3) - (3)].pnval));
 
1580
                        }
 
1581
    break;
 
1582
 
 
1583
  case 10:
 
1584
#line 202 "v29_notify_gram.y"
 
1585
    { (yyval.pnval) = (yyvsp[(2) - (3)].pnval); }
 
1586
    break;
 
1587
 
 
1588
  case 11:
 
1589
#line 205 "v29_notify_gram.y"
 
1590
    {
 
1591
                                (yyval.pnval) = mk_parse_node(KW_SERVICEABLE, NULL, NULL);
 
1592
                                nr_serviceability_tests++;
 
1593
                        }
 
1594
    break;
 
1595
 
 
1596
  case 12:
 
1597
#line 209 "v29_notify_gram.y"
 
1598
    {
 
1599
                                (yyval.pnval) = mk_parse_node(KW_SEVERITY, NULL, NULL);
 
1600
                                nr_severity_tests++;
 
1601
                        }
 
1602
    break;
 
1603
 
 
1604
  case 14:
 
1605
#line 216 "v29_notify_gram.y"
 
1606
    {
 
1607
                                (yyval.pnval) = mk_parse_node(TK_EQ, NULL, NULL);
 
1608
                                nr_type_eq_tests++;
 
1609
                                ored_types |= (1 << (yyvsp[(3) - (3)].ival));
 
1610
                        }
 
1611
    break;
 
1612
 
 
1613
  case 15:
 
1614
#line 221 "v29_notify_gram.y"
 
1615
    {
 
1616
                                (yyval.pnval) = mk_parse_node(TK_NE, NULL, NULL);
 
1617
                                nr_type_ne_tests++;
 
1618
                                anded_types &= ~(1 << (yyvsp[(3) - (3)].ival));
 
1619
                        }
 
1620
    break;
 
1621
 
 
1622
  case 16:
 
1623
#line 227 "v29_notify_gram.y"
 
1624
    {
 
1625
                                (yyval.ival) = convert_type_to_v29((yyvsp[(1) - (1)].ival));
 
1626
                                if ((yyval.ival) == 0)
 
1627
                                        (*semantic_errors)++;
 
1628
                        }
 
1629
    break;
 
1630
 
 
1631
  case 18:
 
1632
#line 235 "v29_notify_gram.y"
 
1633
    { (yyval.ival) = SL_TYPE_BASIC; }
 
1634
    break;
 
1635
 
 
1636
  case 19:
 
1637
#line 236 "v29_notify_gram.y"
 
1638
    { (yyval.ival) = SL_TYPE_OS; }
 
1639
    break;
 
1640
 
 
1641
  case 20:
 
1642
#line 237 "v29_notify_gram.y"
 
1643
    { (yyval.ival) = SL_TYPE_RTAS; }
 
1644
    break;
 
1645
 
 
1646
  case 21:
 
1647
#line 238 "v29_notify_gram.y"
 
1648
    { (yyval.ival) = SL_TYPE_BMC; }
 
1649
    break;
 
1650
 
 
1651
  case 22:
 
1652
#line 239 "v29_notify_gram.y"
 
1653
    { (yyval.ival) = SL_TYPE_ENCLOSURE; }
 
1654
    break;
 
1655
 
 
1656
  case 23:
 
1657
#line 242 "v29_notify_gram.y"
 
1658
    { notify->severity = 1+(yyvsp[(3) - (3)].ival); }
 
1659
    break;
 
1660
 
 
1661
  case 24:
 
1662
#line 243 "v29_notify_gram.y"
 
1663
    { notify->severity = (yyvsp[(3) - (3)].ival); }
 
1664
    break;
 
1665
 
 
1666
  case 25:
 
1667
#line 244 "v29_notify_gram.y"
 
1668
    { notify->severity = (yyvsp[(3) - (3)].ival); }
 
1669
    break;
 
1670
 
 
1671
  case 26:
 
1672
#line 247 "v29_notify_gram.y"
 
1673
    {
 
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;
 
1677
                                } else
 
1678
                                        (yyval.ival) = (yyvsp[(1) - (1)].ival);
 
1679
                        }
 
1680
    break;
 
1681
 
 
1682
  case 27:
 
1683
#line 254 "v29_notify_gram.y"
 
1684
    { (yyval.ival) = SL_SEV_FATAL; }
 
1685
    break;
 
1686
 
 
1687
  case 28:
 
1688
#line 255 "v29_notify_gram.y"
 
1689
    { (yyval.ival) = SL_SEV_ERROR; }
 
1690
    break;
 
1691
 
 
1692
  case 29:
 
1693
#line 256 "v29_notify_gram.y"
 
1694
    { (yyval.ival) = SL_SEV_ERROR_LOCAL; }
 
1695
    break;
 
1696
 
 
1697
  case 30:
 
1698
#line 257 "v29_notify_gram.y"
 
1699
    { (yyval.ival) = SL_SEV_WARNING; }
 
1700
    break;
 
1701
 
 
1702
  case 31:
 
1703
#line 258 "v29_notify_gram.y"
 
1704
    { (yyval.ival) = SL_SEV_EVENT; }
 
1705
    break;
 
1706
 
 
1707
  case 32:
 
1708
#line 259 "v29_notify_gram.y"
 
1709
    { (yyval.ival) = SL_SEV_INFO; }
 
1710
    break;
 
1711
 
 
1712
  case 33:
 
1713
#line 260 "v29_notify_gram.y"
 
1714
    { (yyval.ival) = SL_SEV_DEBUG; }
 
1715
    break;
 
1716
 
 
1717
  case 34:
 
1718
#line 263 "v29_notify_gram.y"
 
1719
    {
 
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;
 
1725
                                else
 
1726
                                        notify->serviceable_event = SL_QUERY_YES;
 
1727
                        }
 
1728
    break;
 
1729
 
 
1730
 
 
1731
/* Line 1267 of yacc.c.  */
 
1732
#line 1733 "v29_notify_gram.c"
 
1733
      default: break;
 
1734
    }
 
1735
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
1736
 
 
1737
  YYPOPSTACK (yylen);
 
1738
  yylen = 0;
 
1739
  YY_STACK_PRINT (yyss, yyssp);
 
1740
 
 
1741
  *++yyvsp = yyval;
 
1742
 
 
1743
 
 
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.  */
 
1747
 
 
1748
  yyn = yyr1[yyn];
 
1749
 
 
1750
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 
1751
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 
1752
    yystate = yytable[yystate];
 
1753
  else
 
1754
    yystate = yydefgoto[yyn - YYNTOKENS];
 
1755
 
 
1756
  goto yynewstate;
 
1757
 
 
1758
 
 
1759
/*------------------------------------.
 
1760
| yyerrlab -- here on detecting error |
 
1761
`------------------------------------*/
 
1762
yyerrlab:
 
1763
  /* If not already recovering from an error, report this error.  */
 
1764
  if (!yyerrstatus)
 
1765
    {
 
1766
      ++yynerrs;
 
1767
#if ! YYERROR_VERBOSE
 
1768
      yyerror (YY_("syntax error"));
 
1769
#else
 
1770
      {
 
1771
        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
 
1772
        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
 
1773
          {
 
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);
 
1780
            if (yymsg)
 
1781
              yymsg_alloc = yyalloc;
 
1782
            else
 
1783
              {
 
1784
                yymsg = yymsgbuf;
 
1785
                yymsg_alloc = sizeof yymsgbuf;
 
1786
              }
 
1787
          }
 
1788
 
 
1789
        if (0 < yysize && yysize <= yymsg_alloc)
 
1790
          {
 
1791
            (void) yysyntax_error (yymsg, yystate, yychar);
 
1792
            yyerror (yymsg);
 
1793
          }
 
1794
        else
 
1795
          {
 
1796
            yyerror (YY_("syntax error"));
 
1797
            if (yysize != 0)
 
1798
              goto yyexhaustedlab;
 
1799
          }
 
1800
      }
 
1801
#endif
 
1802
    }
 
1803
 
 
1804
 
 
1805
 
 
1806
  if (yyerrstatus == 3)
 
1807
    {
 
1808
      /* If just tried and failed to reuse look-ahead token after an
 
1809
         error, discard it.  */
 
1810
 
 
1811
      if (yychar <= YYEOF)
 
1812
        {
 
1813
          /* Return failure if at end of input.  */
 
1814
          if (yychar == YYEOF)
 
1815
            YYABORT;
 
1816
        }
 
1817
      else
 
1818
        {
 
1819
          yydestruct ("Error: discarding",
 
1820
                      yytoken, &yylval);
 
1821
          yychar = YYEMPTY;
 
1822
        }
 
1823
    }
 
1824
 
 
1825
  /* Else will try to reuse look-ahead token after shifting the error
 
1826
     token.  */
 
1827
  goto yyerrlab1;
 
1828
 
 
1829
 
 
1830
/*---------------------------------------------------.
 
1831
| yyerrorlab -- error raised explicitly by YYERROR.  |
 
1832
`---------------------------------------------------*/
 
1833
yyerrorlab:
 
1834
 
 
1835
  /* Pacify compilers like GCC when the user code never invokes
 
1836
     YYERROR and the label yyerrorlab therefore never appears in user
 
1837
     code.  */
 
1838
  if (/*CONSTCOND*/ 0)
 
1839
     goto yyerrorlab;
 
1840
 
 
1841
  /* Do not reclaim the symbols of the rule which action triggered
 
1842
     this YYERROR.  */
 
1843
  YYPOPSTACK (yylen);
 
1844
  yylen = 0;
 
1845
  YY_STACK_PRINT (yyss, yyssp);
 
1846
  yystate = *yyssp;
 
1847
  goto yyerrlab1;
 
1848
 
 
1849
 
 
1850
/*-------------------------------------------------------------.
 
1851
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
 
1852
`-------------------------------------------------------------*/
 
1853
yyerrlab1:
 
1854
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
1855
 
 
1856
  for (;;)
 
1857
    {
 
1858
      yyn = yypact[yystate];
 
1859
      if (yyn != YYPACT_NINF)
 
1860
        {
 
1861
          yyn += YYTERROR;
 
1862
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 
1863
            {
 
1864
              yyn = yytable[yyn];
 
1865
              if (0 < yyn)
 
1866
                break;
 
1867
            }
 
1868
        }
 
1869
 
 
1870
      /* Pop the current state because it cannot handle the error token.  */
 
1871
      if (yyssp == yyss)
 
1872
        YYABORT;
 
1873
 
 
1874
 
 
1875
      yydestruct ("Error: popping",
 
1876
                  yystos[yystate], yyvsp);
 
1877
      YYPOPSTACK (1);
 
1878
      yystate = *yyssp;
 
1879
      YY_STACK_PRINT (yyss, yyssp);
 
1880
    }
 
1881
 
 
1882
  if (yyn == YYFINAL)
 
1883
    YYACCEPT;
 
1884
 
 
1885
  *++yyvsp = yylval;
 
1886
 
 
1887
 
 
1888
  /* Shift the error token.  */
 
1889
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
1890
 
 
1891
  yystate = yyn;
 
1892
  goto yynewstate;
 
1893
 
 
1894
 
 
1895
/*-------------------------------------.
 
1896
| yyacceptlab -- YYACCEPT comes here.  |
 
1897
`-------------------------------------*/
 
1898
yyacceptlab:
 
1899
  yyresult = 0;
 
1900
  goto yyreturn;
 
1901
 
 
1902
/*-----------------------------------.
 
1903
| yyabortlab -- YYABORT comes here.  |
 
1904
`-----------------------------------*/
 
1905
yyabortlab:
 
1906
  yyresult = 1;
 
1907
  goto yyreturn;
 
1908
 
 
1909
#ifndef yyoverflow
 
1910
/*-------------------------------------------------.
 
1911
| yyexhaustedlab -- memory exhaustion comes here.  |
 
1912
`-------------------------------------------------*/
 
1913
yyexhaustedlab:
 
1914
  yyerror (YY_("memory exhausted"));
 
1915
  yyresult = 2;
 
1916
  /* Fall through.  */
 
1917
#endif
 
1918
 
 
1919
yyreturn:
 
1920
  if (yychar != YYEOF && yychar != YYEMPTY)
 
1921
     yydestruct ("Cleanup: discarding lookahead",
 
1922
                 yytoken, &yylval);
 
1923
  /* Do not reclaim the symbols of the rule which action triggered
 
1924
     this YYABORT or YYACCEPT.  */
 
1925
  YYPOPSTACK (yylen);
 
1926
  YY_STACK_PRINT (yyss, yyssp);
 
1927
  while (yyssp != yyss)
 
1928
    {
 
1929
      yydestruct ("Cleanup: popping",
 
1930
                  yystos[*yyssp], yyvsp);
 
1931
      YYPOPSTACK (1);
 
1932
    }
 
1933
#ifndef yyoverflow
 
1934
  if (yyss != yyssa)
 
1935
    YYSTACK_FREE (yyss);
 
1936
#endif
 
1937
#if YYERROR_VERBOSE
 
1938
  if (yymsg != yymsgbuf)
 
1939
    YYSTACK_FREE (yymsg);
 
1940
#endif
 
1941
  /* Make sure YYID is used.  */
 
1942
  return YYID (yyresult);
 
1943
}
 
1944
 
 
1945
 
 
1946
#line 273 "v29_notify_gram.y"
 
1947
 
 
1948
 
 
1949
void
 
1950
v29nfy_gram_init(const char *v1_match, struct v29_sl_notify *nfy,
 
1951
                                                        int *semantic_errs)
 
1952
{
 
1953
        assert(nfy);
 
1954
        notify = nfy;
 
1955
        nfy->event_types = all_types;
 
1956
        nfy->serviceable_event = SL_QUERY_ALL;
 
1957
        nfy->severity = 1;
 
1958
        if (v1_match) {
 
1959
                assert(semantic_errs);
 
1960
                semantic_errors = semantic_errs;
 
1961
                (*semantic_errors) = 0;
 
1962
 
 
1963
                nr_and_clauses = 0;
 
1964
                nr_or_clauses = 0;
 
1965
                nr_type_eq_tests = 0;
 
1966
                nr_type_ne_tests = 0;
 
1967
                nr_serviceability_tests = 0;
 
1968
                nr_severity_tests = 0;
 
1969
 
 
1970
                anded_types = all_types;
 
1971
                ored_types = 0;
 
1972
 
 
1973
                v29nfy_lex_init(v1_match);
 
1974
        }
 
1975
}
 
1976
 
 
1977
void
 
1978
v29nfy_gram_fini(void)
 
1979
{
 
1980
        v29nfy_lex_fini();
 
1981
}
 
1982