/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
   Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
   especially those whose name start with YY_ or yy_.  They are
   private implementation details that can be changed or removed.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output, and Bison version.  */
#define YYBISON 30802

/* Bison version string.  */
#define YYBISON_VERSION "3.8.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 26 "src/p.y"

/* Turn off unreachable code warnings for the entire generated parser */
#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunreachable-code"
#endif

/*
 * DESCRIPTION
 *   Simple context-free grammar for parsing the control file.
 *
 */

#include "config.h"

#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif

#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif

#ifdef HAVE_PWD_H
#include <pwd.h>
#endif

#ifdef HAVE_GRP_H
#include <grp.h>
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif

#ifdef HAVE_TIME_H
#include <time.h>
#endif

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

#ifdef HAVE_ASM_PARAM_H
#include <asm/param.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif

#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif

#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif

#ifdef HAVE_NETINET_IP_ICMP_H
#include <netinet/ip_icmp.h>
#endif

#ifdef HAVE_REGEX_H
#include <regex.h>
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#ifdef HAVE_OPENSSL
#include <openssl/ssl.h>
#endif

#include "monit.h"
#include "protocol.h"
#include "engine.h"
#include "alert.h"
#include "device.h"
#include "processor.h"
#include "md5.h"
#include "sha1.h"
#include "sha256.h"
#include "checksum.h"
#include "ProcessTree.h"
#include "process_sysdep.h"

// libmonit
#include "system/Time.h"
#include "io/File.h"
#include "util/Str.h"
#include "thread/Thread.h"


/* ------------------------------------------------------------- Definitions */


struct precedence_t {
        bool daemon;
        bool logfile;
        bool pidfile;
        bool idfile;
        bool statefile;
};

struct rate_t {
        unsigned int count;
        unsigned int cycles;
};

/* yacc interface */
void  yyerror(const char *,...) __attribute__((format (printf, 1, 2)));
void  yyerror2(const char *,...) __attribute__((format (printf, 1, 2)));
void  yywarning(const char *,...) __attribute__((format (printf, 1, 2)));
void  yywarning2(const char *,...) __attribute__((format (printf, 1, 2)));

/* lexer interface */
int yylex(void);
extern FILE *yyin;
extern int lineno;
extern int arglineno;
extern char *yytext;
extern char *argyytext;
extern char *currentfile;
extern char *argcurrentfile;
extern int buffer_stack_ptr;

/* Local variables */
static int cfg_errflag = 0;
static Service_T tail = NULL;
static Service_T current = NULL;
static Request_T urlrequest = NULL;
static command_t command = NULL;
static command_t command1 = NULL;
static command_t command2 = NULL;
static Service_T depend_list = NULL;
static struct Uid_T uidset = {};
static struct Gid_T gidset = {};
static struct Pid_T pidset = {};
static struct Pid_T ppidset = {};
static struct FsFlag_T fsflagset = {};
static struct NonExist_T nonexistset = {};
static struct Exist_T existset = {};
static struct Status_T statusset = {};
static struct Perm_T permset = {};
static struct Size_T sizeset = {};
static struct NLink_T nlinkset = {};
static struct Uptime_T uptimeset = {};
static struct ResponseTime_T responsetimeset = {};
static struct LinkStatus_T linkstatusset = {};
static struct LinkSpeed_T linkspeedset = {};
static struct LinkSaturation_T linksaturationset = {};
static struct Bandwidth_T bandwidthset = {};
static struct Match_T matchset = {};
static struct Icmp_T icmpset = {};
static struct Mail_T mailset = {};
static struct SslOptions_T sslset = {};
static struct Port_T portset = {};
static struct MailServer_T mailserverset = {};
static struct Mmonit_T mmonitset = {};
static struct FileSystem_T filesystemset = {};
static struct Resource_T resourceset = {};
static struct Checksum_T checksumset = {};
static struct Timestamp_T timestampset = {};
static struct ActionRate_T actionrateset = {};
static struct precedence_t ihp = {false, false, false, false, false};
static struct rate_t rate = {1, 1};
static struct rate_t rate1 = {1, 1};
static struct rate_t rate2 = {1, 1};
static char * htpasswd_file = NULL;
static unsigned int repeat = 0;
static unsigned int repeat1 = 0;
static unsigned int repeat2 = 0;
static unsigned int timeout = 0;
static Digest_Type digesttype = Digest_Cleartext;

#define BITMAP_MAX (sizeof(long long) * 8)


/* -------------------------------------------------------------- Prototypes */

static void  preparse(void);
static void  postparse(void);
static bool _parseOutgoingAddress(char *ip, Outgoing_T *outgoing);
static void  addmail(char *, Mail_T, Mail_T *);
static Service_T createservice(Service_Type, char *, char *, State_Type (*)(Service_T));
static void  addservice(Service_T);
static void  adddependant(char *);
static void  addservicegroup(char *);
static void  addhostgroup(char *name);
static void  addport(Port_T *, Port_T);
static void  addhttpheader(Port_T, char *);
static void  addresource(Resource_T);
static void  addtimestamp(Timestamp_T);
static void  addactionrate(ActionRate_T);
static void  addsize(Size_T);
static void  addnlink(NLink_T);
static void  adduptime(Uptime_T);
static void  addpid(Pid_T);
static void  addppid(Pid_T);
static void  addfsflag(FsFlag_T);
static void  addnonexist(NonExist_T);
static void  addexist(Exist_T);
static void  addlinkstatus(Service_T, LinkStatus_T);
static void  addlinkspeed(Service_T, LinkSpeed_T);
static void  addlinksaturation(Service_T, LinkSaturation_T);
static void  addbandwidth(Bandwidth_T *, Bandwidth_T);
static void  addfilesystem(FileSystem_T);
static void  addicmp(Icmp_T);
static void  addgeneric(Port_T, char*, char*);
static void  addcommand(int, unsigned);
static void  addargument(char *);
static void  addmmonit(Mmonit_T);
static void  addmailserver(MailServer_T);
static bool addcredentials(char *, char *, Digest_Type, bool);
#ifdef HAVE_LIBPAM
static void  addpamauth(char *, int);
#endif
static void  addhtpasswdentry(char *, char *, Digest_Type);
static uid_t get_uid(char *, uid_t);
static gid_t get_gid(char *, gid_t);
static void  addchecksum(Checksum_T);
static void  addperm(Perm_T);
static void  addmatch(Match_T, int, int);
static void  addmatchpath(Match_T, Action_Type);
static void  addoutputchange(bool, Action_Type, Action_Type);
static void  addstatus(Status_T);
static Uid_T adduid(Uid_T);
static Gid_T addgid(Gid_T);
static void  addeuid(uid_t);
static void  addegid(gid_t);
static void  addeventaction(EventAction_T *, Action_Type, Action_Type);
static void  prepare_urlrequest(URL_T U);
static void  seturlrequest(int, char *);
static void  setlogfile(char *);
static void  setpidfile(char *);
static void  setidfile(char *);
static void  setstatefile(char *);
static void  reset_sslset(void);
static void  reset_mailset(void);
static void  reset_mailserverset(void);
static void  reset_mmonitset(void);
static void  reset_portset(void);
static void  reset_resourceset(void);
static void  reset_timestampset(void);
static void  reset_actionrateset(void);
static void  reset_sizeset(void);
static void  reset_nlinkset(void);
static void  reset_uptimeset(void);
static void  reset_responsetimeset(void);
static void  reset_pidset(void);
static void  reset_ppidset(void);
static void  reset_fsflagset(void);
static void  reset_nonexistset(void);
static void  reset_existset(void);
static void  reset_linkstatusset(void);
static void  reset_linkspeedset(void);
static void  reset_linksaturationset(void);
static void  reset_bandwidthset(void);
static void  reset_checksumset(void);
static void  reset_permset(void);
static void  reset_uidset(void);
static void  reset_gidset(void);
static void  reset_statusset(void);
static void  reset_filesystemset(void);
static void  reset_icmpset(void);
static void  reset_rateset(struct rate_t *);
static void  check_name(char *);
static int   check_perm(int);
static void  check_exec(char *);
static int   cleanup_hash_string(char *);
static void  check_depend(void);
static void  setsyslog(char *);
static command_t copycommand(command_t);
static int verifyMaxForward(int);
static void _setPEM(char **store, char *path, const char *description, bool isFile);
static void _setSSLOptions(SslOptions_T options);
#ifdef HAVE_OPENSSL
static void _setSSLVersion(short version);
#endif
static void _unsetSSLVersion(short version);
static void addsecurityattribute(char *, StringOperator_Type, Action_Type, Action_Type);
static void addfiledescriptors(Operator_Type, bool, long long, float, Action_Type, Action_Type);
static void _sanityCheckEveryStatement(Service_T s);

static void  yydeprecated(const char *s, ...) __attribute__((format (printf, 1, 2)));

// For debug purpose only
#ifdef HAVE_YYDEBUG
int yydebug = 1;
#endif


#line 398 "src/y.tab.c"

# ifndef YY_CAST
#  ifdef __cplusplus
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
#  else
#   define YY_CAST(Type, Val) ((Type) (Val))
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
#  endif
# endif
# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

#include "y.tab.h"
/* Symbol kind.  */
enum yysymbol_kind_t
{
  YYSYMBOL_YYEMPTY = -2,
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
  YYSYMBOL_YYerror = 1,                    /* error  */
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
  YYSYMBOL_IF = 3,                         /* IF  */
  YYSYMBOL_ELSE = 4,                       /* ELSE  */
  YYSYMBOL_THEN = 5,                       /* THEN  */
  YYSYMBOL_FAILED = 6,                     /* FAILED  */
  YYSYMBOL_SET = 7,                        /* SET  */
  YYSYMBOL_LOG = 8,                        /* LOG  */
  YYSYMBOL_LOGFILE = 9,                    /* LOGFILE  */
  YYSYMBOL_FACILITY = 10,                  /* FACILITY  */
  YYSYMBOL_DAEMON = 11,                    /* DAEMON  */
  YYSYMBOL_SYSLOG = 12,                    /* SYSLOG  */
  YYSYMBOL_MAILSERVER = 13,                /* MAILSERVER  */
  YYSYMBOL_HTTPD = 14,                     /* HTTPD  */
  YYSYMBOL_ALLOW = 15,                     /* ALLOW  */
  YYSYMBOL_REJECTOPT = 16,                 /* REJECTOPT  */
  YYSYMBOL_ADDRESS = 17,                   /* ADDRESS  */
  YYSYMBOL_INIT = 18,                      /* INIT  */
  YYSYMBOL_TERMINAL = 19,                  /* TERMINAL  */
  YYSYMBOL_BATCH = 20,                     /* BATCH  */
  YYSYMBOL_READONLY = 21,                  /* READONLY  */
  YYSYMBOL_CLEARTEXT = 22,                 /* CLEARTEXT  */
  YYSYMBOL_MD5HASH = 23,                   /* MD5HASH  */
  YYSYMBOL_SHA1HASH = 24,                  /* SHA1HASH  */
  YYSYMBOL_SHA256HASH = 25,                /* SHA256HASH  */
  YYSYMBOL_CRYPT = 26,                     /* CRYPT  */
  YYSYMBOL_DELAY = 27,                     /* DELAY  */
  YYSYMBOL_PEMFILE = 28,                   /* PEMFILE  */
  YYSYMBOL_PEMKEY = 29,                    /* PEMKEY  */
  YYSYMBOL_PEMCHAIN = 30,                  /* PEMCHAIN  */
  YYSYMBOL_ENABLE = 31,                    /* ENABLE  */
  YYSYMBOL_DISABLE = 32,                   /* DISABLE  */
  YYSYMBOL_SSLTOKEN = 33,                  /* SSLTOKEN  */
  YYSYMBOL_CIPHER = 34,                    /* CIPHER  */
  YYSYMBOL_CLIENTPEMFILE = 35,             /* CLIENTPEMFILE  */
  YYSYMBOL_ALLOWSELFCERTIFICATION = 36,    /* ALLOWSELFCERTIFICATION  */
  YYSYMBOL_SELFSIGNED = 37,                /* SELFSIGNED  */
  YYSYMBOL_VERIFY = 38,                    /* VERIFY  */
  YYSYMBOL_CERTIFICATE = 39,               /* CERTIFICATE  */
  YYSYMBOL_CACERTIFICATEFILE = 40,         /* CACERTIFICATEFILE  */
  YYSYMBOL_CACERTIFICATEPATH = 41,         /* CACERTIFICATEPATH  */
  YYSYMBOL_VALID = 42,                     /* VALID  */
  YYSYMBOL_INTERFACE = 43,                 /* INTERFACE  */
  YYSYMBOL_LINK = 44,                      /* LINK  */
  YYSYMBOL_PACKET = 45,                    /* PACKET  */
  YYSYMBOL_BYTEIN = 46,                    /* BYTEIN  */
  YYSYMBOL_BYTEOUT = 47,                   /* BYTEOUT  */
  YYSYMBOL_PACKETIN = 48,                  /* PACKETIN  */
  YYSYMBOL_PACKETOUT = 49,                 /* PACKETOUT  */
  YYSYMBOL_SPEED = 50,                     /* SPEED  */
  YYSYMBOL_SATURATION = 51,                /* SATURATION  */
  YYSYMBOL_UPLOAD = 52,                    /* UPLOAD  */
  YYSYMBOL_DOWNLOAD = 53,                  /* DOWNLOAD  */
  YYSYMBOL_TOTAL = 54,                     /* TOTAL  */
  YYSYMBOL_UP = 55,                        /* UP  */
  YYSYMBOL_DOWN = 56,                      /* DOWN  */
  YYSYMBOL_IDFILE = 57,                    /* IDFILE  */
  YYSYMBOL_STATEFILE = 58,                 /* STATEFILE  */
  YYSYMBOL_SEND = 59,                      /* SEND  */
  YYSYMBOL_EXPECT = 60,                    /* EXPECT  */
  YYSYMBOL_CYCLE = 61,                     /* CYCLE  */
  YYSYMBOL_COUNT = 62,                     /* COUNT  */
  YYSYMBOL_REMINDER = 63,                  /* REMINDER  */
  YYSYMBOL_REPEAT = 64,                    /* REPEAT  */
  YYSYMBOL_LIMITS = 65,                    /* LIMITS  */
  YYSYMBOL_SENDEXPECTBUFFER = 66,          /* SENDEXPECTBUFFER  */
  YYSYMBOL_EXPECTBUFFER = 67,              /* EXPECTBUFFER  */
  YYSYMBOL_FILECONTENTBUFFER = 68,         /* FILECONTENTBUFFER  */
  YYSYMBOL_HTTPCONTENTBUFFER = 69,         /* HTTPCONTENTBUFFER  */
  YYSYMBOL_PROGRAMOUTPUT = 70,             /* PROGRAMOUTPUT  */
  YYSYMBOL_NETWORKTIMEOUT = 71,            /* NETWORKTIMEOUT  */
  YYSYMBOL_PROGRAMTIMEOUT = 72,            /* PROGRAMTIMEOUT  */
  YYSYMBOL_STARTTIMEOUT = 73,              /* STARTTIMEOUT  */
  YYSYMBOL_STOPTIMEOUT = 74,               /* STOPTIMEOUT  */
  YYSYMBOL_RESTARTTIMEOUT = 75,            /* RESTARTTIMEOUT  */
  YYSYMBOL_EXECTIMEOUT = 76,               /* EXECTIMEOUT  */
  YYSYMBOL_PIDFILE = 77,                   /* PIDFILE  */
  YYSYMBOL_START = 78,                     /* START  */
  YYSYMBOL_STOP = 79,                      /* STOP  */
  YYSYMBOL_PATHTOK = 80,                   /* PATHTOK  */
  YYSYMBOL_RSAKEY = 81,                    /* RSAKEY  */
  YYSYMBOL_HOST = 82,                      /* HOST  */
  YYSYMBOL_HOSTNAME = 83,                  /* HOSTNAME  */
  YYSYMBOL_PORT = 84,                      /* PORT  */
  YYSYMBOL_IPV4 = 85,                      /* IPV4  */
  YYSYMBOL_IPV6 = 86,                      /* IPV6  */
  YYSYMBOL_TYPE = 87,                      /* TYPE  */
  YYSYMBOL_UDP = 88,                       /* UDP  */
  YYSYMBOL_TCP = 89,                       /* TCP  */
  YYSYMBOL_TCPSSL = 90,                    /* TCPSSL  */
  YYSYMBOL_PROTOCOL = 91,                  /* PROTOCOL  */
  YYSYMBOL_CONNECTION = 92,                /* CONNECTION  */
  YYSYMBOL_ALERT = 93,                     /* ALERT  */
  YYSYMBOL_NOALERT = 94,                   /* NOALERT  */
  YYSYMBOL_MAILFORMAT = 95,                /* MAILFORMAT  */
  YYSYMBOL_UNIXSOCKET = 96,                /* UNIXSOCKET  */
  YYSYMBOL_SIGNATURE = 97,                 /* SIGNATURE  */
  YYSYMBOL_TIMEOUT = 98,                   /* TIMEOUT  */
  YYSYMBOL_RETRY = 99,                     /* RETRY  */
  YYSYMBOL_RESTART = 100,                  /* RESTART  */
  YYSYMBOL_CHECKSUM = 101,                 /* CHECKSUM  */
  YYSYMBOL_EVERY = 102,                    /* EVERY  */
  YYSYMBOL_NOTEVERY = 103,                 /* NOTEVERY  */
  YYSYMBOL_DEFAULT = 104,                  /* DEFAULT  */
  YYSYMBOL_HTTP = 105,                     /* HTTP  */
  YYSYMBOL_HTTPS = 106,                    /* HTTPS  */
  YYSYMBOL_APACHESTATUS = 107,             /* APACHESTATUS  */
  YYSYMBOL_FTP = 108,                      /* FTP  */
  YYSYMBOL_SMTP = 109,                     /* SMTP  */
  YYSYMBOL_SMTPS = 110,                    /* SMTPS  */
  YYSYMBOL_POP = 111,                      /* POP  */
  YYSYMBOL_POPS = 112,                     /* POPS  */
  YYSYMBOL_IMAP = 113,                     /* IMAP  */
  YYSYMBOL_IMAPS = 114,                    /* IMAPS  */
  YYSYMBOL_CLAMAV = 115,                   /* CLAMAV  */
  YYSYMBOL_NNTP = 116,                     /* NNTP  */
  YYSYMBOL_NTP3 = 117,                     /* NTP3  */
  YYSYMBOL_MYSQL = 118,                    /* MYSQL  */
  YYSYMBOL_MYSQLS = 119,                   /* MYSQLS  */
  YYSYMBOL_DNS = 120,                      /* DNS  */
  YYSYMBOL_WEBSOCKET = 121,                /* WEBSOCKET  */
  YYSYMBOL_MQTT = 122,                     /* MQTT  */
  YYSYMBOL_SSH = 123,                      /* SSH  */
  YYSYMBOL_DWP = 124,                      /* DWP  */
  YYSYMBOL_LDAP2 = 125,                    /* LDAP2  */
  YYSYMBOL_LDAP3 = 126,                    /* LDAP3  */
  YYSYMBOL_RDATE = 127,                    /* RDATE  */
  YYSYMBOL_RSYNC = 128,                    /* RSYNC  */
  YYSYMBOL_TNS = 129,                      /* TNS  */
  YYSYMBOL_PGSQL = 130,                    /* PGSQL  */
  YYSYMBOL_POSTFIXPOLICY = 131,            /* POSTFIXPOLICY  */
  YYSYMBOL_SIP = 132,                      /* SIP  */
  YYSYMBOL_LMTP = 133,                     /* LMTP  */
  YYSYMBOL_GPS = 134,                      /* GPS  */
  YYSYMBOL_RADIUS = 135,                   /* RADIUS  */
  YYSYMBOL_MEMCACHE = 136,                 /* MEMCACHE  */
  YYSYMBOL_REDIS = 137,                    /* REDIS  */
  YYSYMBOL_MONGODB = 138,                  /* MONGODB  */
  YYSYMBOL_SIEVE = 139,                    /* SIEVE  */
  YYSYMBOL_SPAMASSASSIN = 140,             /* SPAMASSASSIN  */
  YYSYMBOL_FAIL2BAN = 141,                 /* FAIL2BAN  */
  YYSYMBOL_STRING = 142,                   /* STRING  */
  YYSYMBOL_PATH = 143,                     /* PATH  */
  YYSYMBOL_MAILADDR = 144,                 /* MAILADDR  */
  YYSYMBOL_MAILFROM = 145,                 /* MAILFROM  */
  YYSYMBOL_MAILREPLYTO = 146,              /* MAILREPLYTO  */
  YYSYMBOL_MAILSUBJECT = 147,              /* MAILSUBJECT  */
  YYSYMBOL_MAILBODY = 148,                 /* MAILBODY  */
  YYSYMBOL_SERVICENAME = 149,              /* SERVICENAME  */
  YYSYMBOL_STRINGNAME = 150,               /* STRINGNAME  */
  YYSYMBOL_HOSTGROUPNAME = 151,            /* HOSTGROUPNAME  */
  YYSYMBOL_NUMBER = 152,                   /* NUMBER  */
  YYSYMBOL_PERCENT = 153,                  /* PERCENT  */
  YYSYMBOL_LOGLIMIT = 154,                 /* LOGLIMIT  */
  YYSYMBOL_CLOSELIMIT = 155,               /* CLOSELIMIT  */
  YYSYMBOL_DNSLIMIT = 156,                 /* DNSLIMIT  */
  YYSYMBOL_KEEPALIVELIMIT = 157,           /* KEEPALIVELIMIT  */
  YYSYMBOL_REPLYLIMIT = 158,               /* REPLYLIMIT  */
  YYSYMBOL_REQUESTLIMIT = 159,             /* REQUESTLIMIT  */
  YYSYMBOL_STARTLIMIT = 160,               /* STARTLIMIT  */
  YYSYMBOL_WAITLIMIT = 161,                /* WAITLIMIT  */
  YYSYMBOL_GRACEFULLIMIT = 162,            /* GRACEFULLIMIT  */
  YYSYMBOL_CLEANUPLIMIT = 163,             /* CLEANUPLIMIT  */
  YYSYMBOL_REAL = 164,                     /* REAL  */
  YYSYMBOL_CHECKPROC = 165,                /* CHECKPROC  */
  YYSYMBOL_CHECKFILESYS = 166,             /* CHECKFILESYS  */
  YYSYMBOL_CHECKFILE = 167,                /* CHECKFILE  */
  YYSYMBOL_CHECKDIR = 168,                 /* CHECKDIR  */
  YYSYMBOL_CHECKHOST = 169,                /* CHECKHOST  */
  YYSYMBOL_CHECKSYSTEM = 170,              /* CHECKSYSTEM  */
  YYSYMBOL_CHECKFIFO = 171,                /* CHECKFIFO  */
  YYSYMBOL_CHECKPROGRAM = 172,             /* CHECKPROGRAM  */
  YYSYMBOL_CHECKNET = 173,                 /* CHECKNET  */
  YYSYMBOL_THREADS = 174,                  /* THREADS  */
  YYSYMBOL_CHILDREN = 175,                 /* CHILDREN  */
  YYSYMBOL_METHOD = 176,                   /* METHOD  */
  YYSYMBOL_GET = 177,                      /* GET  */
  YYSYMBOL_HEAD = 178,                     /* HEAD  */
  YYSYMBOL_STATUS = 179,                   /* STATUS  */
  YYSYMBOL_ORIGIN = 180,                   /* ORIGIN  */
  YYSYMBOL_VERSIONOPT = 181,               /* VERSIONOPT  */
  YYSYMBOL_READ = 182,                     /* READ  */
  YYSYMBOL_WRITE = 183,                    /* WRITE  */
  YYSYMBOL_OPERATION = 184,                /* OPERATION  */
  YYSYMBOL_SERVICETIME = 185,              /* SERVICETIME  */
  YYSYMBOL_DISK = 186,                     /* DISK  */
  YYSYMBOL_RESOURCE = 187,                 /* RESOURCE  */
  YYSYMBOL_MEMORY = 188,                   /* MEMORY  */
  YYSYMBOL_TOTALMEMORY = 189,              /* TOTALMEMORY  */
  YYSYMBOL_LOADAVG1 = 190,                 /* LOADAVG1  */
  YYSYMBOL_LOADAVG5 = 191,                 /* LOADAVG5  */
  YYSYMBOL_LOADAVG15 = 192,                /* LOADAVG15  */
  YYSYMBOL_SWAP = 193,                     /* SWAP  */
  YYSYMBOL_MODE = 194,                     /* MODE  */
  YYSYMBOL_ACTIVE = 195,                   /* ACTIVE  */
  YYSYMBOL_PASSIVE = 196,                  /* PASSIVE  */
  YYSYMBOL_MANUAL = 197,                   /* MANUAL  */
  YYSYMBOL_ONREBOOT = 198,                 /* ONREBOOT  */
  YYSYMBOL_NOSTART = 199,                  /* NOSTART  */
  YYSYMBOL_LASTSTATE = 200,                /* LASTSTATE  */
  YYSYMBOL_CORE = 201,                     /* CORE  */
  YYSYMBOL_CPU = 202,                      /* CPU  */
  YYSYMBOL_TOTALCPU = 203,                 /* TOTALCPU  */
  YYSYMBOL_CPUUSER = 204,                  /* CPUUSER  */
  YYSYMBOL_CPUSYSTEM = 205,                /* CPUSYSTEM  */
  YYSYMBOL_CPUWAIT = 206,                  /* CPUWAIT  */
  YYSYMBOL_CPUNICE = 207,                  /* CPUNICE  */
  YYSYMBOL_CPUHARDIRQ = 208,               /* CPUHARDIRQ  */
  YYSYMBOL_CPUSOFTIRQ = 209,               /* CPUSOFTIRQ  */
  YYSYMBOL_CPUSTEAL = 210,                 /* CPUSTEAL  */
  YYSYMBOL_CPUGUEST = 211,                 /* CPUGUEST  */
  YYSYMBOL_CPUGUESTNICE = 212,             /* CPUGUESTNICE  */
  YYSYMBOL_GROUP = 213,                    /* GROUP  */
  YYSYMBOL_REQUEST = 214,                  /* REQUEST  */
  YYSYMBOL_DEPENDS = 215,                  /* DEPENDS  */
  YYSYMBOL_BASEDIR = 216,                  /* BASEDIR  */
  YYSYMBOL_SLOT = 217,                     /* SLOT  */
  YYSYMBOL_EVENTQUEUE = 218,               /* EVENTQUEUE  */
  YYSYMBOL_SECRET = 219,                   /* SECRET  */
  YYSYMBOL_HOSTHEADER = 220,               /* HOSTHEADER  */
  YYSYMBOL_UID = 221,                      /* UID  */
  YYSYMBOL_EUID = 222,                     /* EUID  */
  YYSYMBOL_GID = 223,                      /* GID  */
  YYSYMBOL_MMONIT = 224,                   /* MMONIT  */
  YYSYMBOL_INSTANCE = 225,                 /* INSTANCE  */
  YYSYMBOL_USERNAME = 226,                 /* USERNAME  */
  YYSYMBOL_PASSWORD = 227,                 /* PASSWORD  */
  YYSYMBOL_DATABASE = 228,                 /* DATABASE  */
  YYSYMBOL_TIME = 229,                     /* TIME  */
  YYSYMBOL_ATIME = 230,                    /* ATIME  */
  YYSYMBOL_CTIME = 231,                    /* CTIME  */
  YYSYMBOL_MTIME = 232,                    /* MTIME  */
  YYSYMBOL_CHANGED = 233,                  /* CHANGED  */
  YYSYMBOL_MILLISECOND = 234,              /* MILLISECOND  */
  YYSYMBOL_SECOND = 235,                   /* SECOND  */
  YYSYMBOL_MINUTE = 236,                   /* MINUTE  */
  YYSYMBOL_HOUR = 237,                     /* HOUR  */
  YYSYMBOL_DAY = 238,                      /* DAY  */
  YYSYMBOL_MONTH = 239,                    /* MONTH  */
  YYSYMBOL_SSLV2 = 240,                    /* SSLV2  */
  YYSYMBOL_SSLV3 = 241,                    /* SSLV3  */
  YYSYMBOL_TLSV1 = 242,                    /* TLSV1  */
  YYSYMBOL_TLSV11 = 243,                   /* TLSV11  */
  YYSYMBOL_TLSV12 = 244,                   /* TLSV12  */
  YYSYMBOL_TLSV13 = 245,                   /* TLSV13  */
  YYSYMBOL_CERTMD5 = 246,                  /* CERTMD5  */
  YYSYMBOL_AUTO = 247,                     /* AUTO  */
  YYSYMBOL_NOSSLV2 = 248,                  /* NOSSLV2  */
  YYSYMBOL_NOSSLV3 = 249,                  /* NOSSLV3  */
  YYSYMBOL_NOTLSV1 = 250,                  /* NOTLSV1  */
  YYSYMBOL_NOTLSV11 = 251,                 /* NOTLSV11  */
  YYSYMBOL_NOTLSV12 = 252,                 /* NOTLSV12  */
  YYSYMBOL_NOTLSV13 = 253,                 /* NOTLSV13  */
  YYSYMBOL_BYTE = 254,                     /* BYTE  */
  YYSYMBOL_KILOBYTE = 255,                 /* KILOBYTE  */
  YYSYMBOL_MEGABYTE = 256,                 /* MEGABYTE  */
  YYSYMBOL_GIGABYTE = 257,                 /* GIGABYTE  */
  YYSYMBOL_INODE = 258,                    /* INODE  */
  YYSYMBOL_SPACE = 259,                    /* SPACE  */
  YYSYMBOL_TFREE = 260,                    /* TFREE  */
  YYSYMBOL_PERMISSION = 261,               /* PERMISSION  */
  YYSYMBOL_SIZE = 262,                     /* SIZE  */
  YYSYMBOL_NOT = 263,                      /* NOT  */
  YYSYMBOL_IGNORE = 264,                   /* IGNORE  */
  YYSYMBOL_ACTION = 265,                   /* ACTION  */
  YYSYMBOL_UPTIME = 266,                   /* UPTIME  */
  YYSYMBOL_RESPONSETIME = 267,             /* RESPONSETIME  */
  YYSYMBOL_REGEXMATCH = 268,               /* REGEXMATCH  */
  YYSYMBOL_REGEXNOMATCH = 269,             /* REGEXNOMATCH  */
  YYSYMBOL_EXEC = 270,                     /* EXEC  */
  YYSYMBOL_UNMONITOR = 271,                /* UNMONITOR  */
  YYSYMBOL_PING = 272,                     /* PING  */
  YYSYMBOL_PING4 = 273,                    /* PING4  */
  YYSYMBOL_PING6 = 274,                    /* PING6  */
  YYSYMBOL_ICMP = 275,                     /* ICMP  */
  YYSYMBOL_ICMPECHO = 276,                 /* ICMPECHO  */
  YYSYMBOL_NONEXIST = 277,                 /* NONEXIST  */
  YYSYMBOL_EXIST = 278,                    /* EXIST  */
  YYSYMBOL_INVALID = 279,                  /* INVALID  */
  YYSYMBOL_DATA = 280,                     /* DATA  */
  YYSYMBOL_RECOVERED = 281,                /* RECOVERED  */
  YYSYMBOL_PASSED = 282,                   /* PASSED  */
  YYSYMBOL_SUCCEEDED = 283,                /* SUCCEEDED  */
  YYSYMBOL_URL = 284,                      /* URL  */
  YYSYMBOL_CONTENT = 285,                  /* CONTENT  */
  YYSYMBOL_PID = 286,                      /* PID  */
  YYSYMBOL_PPID = 287,                     /* PPID  */
  YYSYMBOL_FSFLAG = 288,                   /* FSFLAG  */
  YYSYMBOL_REGISTER = 289,                 /* REGISTER  */
  YYSYMBOL_CREDENTIALS = 290,              /* CREDENTIALS  */
  YYSYMBOL_URLOBJECT = 291,                /* URLOBJECT  */
  YYSYMBOL_ADDRESSOBJECT = 292,            /* ADDRESSOBJECT  */
  YYSYMBOL_TARGET = 293,                   /* TARGET  */
  YYSYMBOL_TIMESPEC = 294,                 /* TIMESPEC  */
  YYSYMBOL_HTTPHEADER = 295,               /* HTTPHEADER  */
  YYSYMBOL_MAXFORWARD = 296,               /* MAXFORWARD  */
  YYSYMBOL_FIPS = 297,                     /* FIPS  */
  YYSYMBOL_SECURITY = 298,                 /* SECURITY  */
  YYSYMBOL_ATTRIBUTE = 299,                /* ATTRIBUTE  */
  YYSYMBOL_FILEDESCRIPTORS = 300,          /* FILEDESCRIPTORS  */
  YYSYMBOL_HARDLINK = 301,                 /* HARDLINK  */
  YYSYMBOL_PAGEIN = 302,                   /* PAGEIN  */
  YYSYMBOL_PAGEOUT = 303,                  /* PAGEOUT  */
  YYSYMBOL_GREATER = 304,                  /* GREATER  */
  YYSYMBOL_GREATEROREQUAL = 305,           /* GREATEROREQUAL  */
  YYSYMBOL_LESS = 306,                     /* LESS  */
  YYSYMBOL_LESSOREQUAL = 307,              /* LESSOREQUAL  */
  YYSYMBOL_EQUAL = 308,                    /* EQUAL  */
  YYSYMBOL_NOTEQUAL = 309,                 /* NOTEQUAL  */
  YYSYMBOL_310_ = 310,                     /* '{'  */
  YYSYMBOL_311_ = 311,                     /* '}'  */
  YYSYMBOL_312_ = 312,                     /* ':'  */
  YYSYMBOL_313_ = 313,                     /* '['  */
  YYSYMBOL_314_ = 314,                     /* ']'  */
  YYSYMBOL_315_ = 315,                     /* '@'  */
  YYSYMBOL_YYACCEPT = 316,                 /* $accept  */
  YYSYMBOL_cfgfile = 317,                  /* cfgfile  */
  YYSYMBOL_statement_list = 318,           /* statement_list  */
  YYSYMBOL_statement = 319,                /* statement  */
  YYSYMBOL_optproclist = 320,              /* optproclist  */
  YYSYMBOL_optproc = 321,                  /* optproc  */
  YYSYMBOL_optfilelist = 322,              /* optfilelist  */
  YYSYMBOL_optfile = 323,                  /* optfile  */
  YYSYMBOL_optfilesyslist = 324,           /* optfilesyslist  */
  YYSYMBOL_optfilesys = 325,               /* optfilesys  */
  YYSYMBOL_optdirlist = 326,               /* optdirlist  */
  YYSYMBOL_optdir = 327,                   /* optdir  */
  YYSYMBOL_opthostlist = 328,              /* opthostlist  */
  YYSYMBOL_opthost = 329,                  /* opthost  */
  YYSYMBOL_optnetlist = 330,               /* optnetlist  */
  YYSYMBOL_optnet = 331,                   /* optnet  */
  YYSYMBOL_optsystemlist = 332,            /* optsystemlist  */
  YYSYMBOL_optsystem = 333,                /* optsystem  */
  YYSYMBOL_optfifolist = 334,              /* optfifolist  */
  YYSYMBOL_optfifo = 335,                  /* optfifo  */
  YYSYMBOL_optprogramlist = 336,           /* optprogramlist  */
  YYSYMBOL_optprogram = 337,               /* optprogram  */
  YYSYMBOL_setalert = 338,                 /* setalert  */
  YYSYMBOL_setdaemon = 339,                /* setdaemon  */
  YYSYMBOL_setterminal = 340,              /* setterminal  */
  YYSYMBOL_startdelay = 341,               /* startdelay  */
  YYSYMBOL_setinit = 342,                  /* setinit  */
  YYSYMBOL_setonreboot = 343,              /* setonreboot  */
  YYSYMBOL_setexpectbuffer = 344,          /* setexpectbuffer  */
  YYSYMBOL_setlimits = 345,                /* setlimits  */
  YYSYMBOL_limitlist = 346,                /* limitlist  */
  YYSYMBOL_limit = 347,                    /* limit  */
  YYSYMBOL_setfips = 348,                  /* setfips  */
  YYSYMBOL_setlog = 349,                   /* setlog  */
  YYSYMBOL_logtoken = 350,                 /* logtoken  */
  YYSYMBOL_seteventqueue = 351,            /* seteventqueue  */
  YYSYMBOL_setidfile = 352,                /* setidfile  */
  YYSYMBOL_setstatefile = 353,             /* setstatefile  */
  YYSYMBOL_setpid = 354,                   /* setpid  */
  YYSYMBOL_setmmonits = 355,               /* setmmonits  */
  YYSYMBOL_mmonitlist = 356,               /* mmonitlist  */
  YYSYMBOL_mmonit = 357,                   /* mmonit  */
  YYSYMBOL_mmonitoptlist = 358,            /* mmonitoptlist  */
  YYSYMBOL_mmonitopt = 359,                /* mmonitopt  */
  YYSYMBOL_credentials = 360,              /* credentials  */
  YYSYMBOL_setssl = 361,                   /* setssl  */
  YYSYMBOL_ssl = 362,                      /* ssl  */
  YYSYMBOL_ssloptionlist = 363,            /* ssloptionlist  */
  YYSYMBOL_ssloption = 364,                /* ssloption  */
  YYSYMBOL_sslexpire = 365,                /* sslexpire  */
  YYSYMBOL_expireoperator = 366,           /* expireoperator  */
  YYSYMBOL_sslchecksum = 367,              /* sslchecksum  */
  YYSYMBOL_checksumoperator = 368,         /* checksumoperator  */
  YYSYMBOL_sslversionlist = 369,           /* sslversionlist  */
  YYSYMBOL_sslversion = 370,               /* sslversion  */
  YYSYMBOL_certmd5 = 371,                  /* certmd5  */
  YYSYMBOL_setmailservers = 372,           /* setmailservers  */
  YYSYMBOL_setmailformat = 373,            /* setmailformat  */
  YYSYMBOL_mailserverlist = 374,           /* mailserverlist  */
  YYSYMBOL_mailserver = 375,               /* mailserver  */
  YYSYMBOL_mailserveroptlist = 376,        /* mailserveroptlist  */
  YYSYMBOL_mailserveropt = 377,            /* mailserveropt  */
  YYSYMBOL_sethttpd = 378,                 /* sethttpd  */
  YYSYMBOL_httpdlist = 379,                /* httpdlist  */
  YYSYMBOL_httpdoption = 380,              /* httpdoption  */
  YYSYMBOL_pemfile = 381,                  /* pemfile  */
  YYSYMBOL_clientpemfile = 382,            /* clientpemfile  */
  YYSYMBOL_allowselfcert = 383,            /* allowselfcert  */
  YYSYMBOL_httpdport = 384,                /* httpdport  */
  YYSYMBOL_httpdsocket = 385,              /* httpdsocket  */
  YYSYMBOL_httpdsocketoptionlist = 386,    /* httpdsocketoptionlist  */
  YYSYMBOL_httpdsocketoption = 387,        /* httpdsocketoption  */
  YYSYMBOL_sigenable = 388,                /* sigenable  */
  YYSYMBOL_sigdisable = 389,               /* sigdisable  */
  YYSYMBOL_signature = 390,                /* signature  */
  YYSYMBOL_bindaddress = 391,              /* bindaddress  */
  YYSYMBOL_allow = 392,                    /* allow  */
  YYSYMBOL_393_1 = 393,                    /* $@1  */
  YYSYMBOL_394_2 = 394,                    /* $@2  */
  YYSYMBOL_395_3 = 395,                    /* $@3  */
  YYSYMBOL_396_4 = 396,                    /* $@4  */
  YYSYMBOL_allowuserlist = 397,            /* allowuserlist  */
  YYSYMBOL_allowuser = 398,                /* allowuser  */
  YYSYMBOL_readonly = 399,                 /* readonly  */
  YYSYMBOL_checkproc = 400,                /* checkproc  */
  YYSYMBOL_checkfile = 401,                /* checkfile  */
  YYSYMBOL_checkfilesys = 402,             /* checkfilesys  */
  YYSYMBOL_checkdir = 403,                 /* checkdir  */
  YYSYMBOL_checkhost = 404,                /* checkhost  */
  YYSYMBOL_checknet = 405,                 /* checknet  */
  YYSYMBOL_checksystem = 406,              /* checksystem  */
  YYSYMBOL_checkfifo = 407,                /* checkfifo  */
  YYSYMBOL_checkprogram = 408,             /* checkprogram  */
  YYSYMBOL_start = 409,                    /* start  */
  YYSYMBOL_stop = 410,                     /* stop  */
  YYSYMBOL_restart = 411,                  /* restart  */
  YYSYMBOL_argumentlist = 412,             /* argumentlist  */
  YYSYMBOL_useroptionlist = 413,           /* useroptionlist  */
  YYSYMBOL_argument = 414,                 /* argument  */
  YYSYMBOL_useroption = 415,               /* useroption  */
  YYSYMBOL_username = 416,                 /* username  */
  YYSYMBOL_password = 417,                 /* password  */
  YYSYMBOL_database = 418,                 /* database  */
  YYSYMBOL_hostname = 419,                 /* hostname  */
  YYSYMBOL_connection = 420,               /* connection  */
  YYSYMBOL_connectionoptlist = 421,        /* connectionoptlist  */
  YYSYMBOL_connectionopt = 422,            /* connectionopt  */
  YYSYMBOL_connectionurl = 423,            /* connectionurl  */
  YYSYMBOL_connectionurloptlist = 424,     /* connectionurloptlist  */
  YYSYMBOL_connectionurlopt = 425,         /* connectionurlopt  */
  YYSYMBOL_connectionunix = 426,           /* connectionunix  */
  YYSYMBOL_connectionuxoptlist = 427,      /* connectionuxoptlist  */
  YYSYMBOL_connectionuxopt = 428,          /* connectionuxopt  */
  YYSYMBOL_icmp = 429,                     /* icmp  */
  YYSYMBOL_icmpoptlist = 430,              /* icmpoptlist  */
  YYSYMBOL_icmpopt = 431,                  /* icmpopt  */
  YYSYMBOL_host = 432,                     /* host  */
  YYSYMBOL_port = 433,                     /* port  */
  YYSYMBOL_unixsocket = 434,               /* unixsocket  */
  YYSYMBOL_ip = 435,                       /* ip  */
  YYSYMBOL_type = 436,                     /* type  */
  YYSYMBOL_typeoptlist = 437,              /* typeoptlist  */
  YYSYMBOL_typeopt = 438,                  /* typeopt  */
  YYSYMBOL_outgoing = 439,                 /* outgoing  */
  YYSYMBOL_protocol = 440,                 /* protocol  */
  YYSYMBOL_sendexpect = 441,               /* sendexpect  */
  YYSYMBOL_websocketlist = 442,            /* websocketlist  */
  YYSYMBOL_websocket = 443,                /* websocket  */
  YYSYMBOL_smtplist = 444,                 /* smtplist  */
  YYSYMBOL_smtp = 445,                     /* smtp  */
  YYSYMBOL_mqttlist = 446,                 /* mqttlist  */
  YYSYMBOL_mqtt = 447,                     /* mqtt  */
  YYSYMBOL_mysqllist = 448,                /* mysqllist  */
  YYSYMBOL_mysql = 449,                    /* mysql  */
  YYSYMBOL_postgresqllist = 450,           /* postgresqllist  */
  YYSYMBOL_postgresql = 451,               /* postgresql  */
  YYSYMBOL_siplist = 452,                  /* siplist  */
  YYSYMBOL_sip = 453,                      /* sip  */
  YYSYMBOL_httplist = 454,                 /* httplist  */
  YYSYMBOL_http = 455,                     /* http  */
  YYSYMBOL_status = 456,                   /* status  */
  YYSYMBOL_method = 457,                   /* method  */
  YYSYMBOL_request = 458,                  /* request  */
  YYSYMBOL_responsesum = 459,              /* responsesum  */
  YYSYMBOL_hostheader = 460,               /* hostheader  */
  YYSYMBOL_httpheaderlist = 461,           /* httpheaderlist  */
  YYSYMBOL_secret = 462,                   /* secret  */
  YYSYMBOL_radiuslist = 463,               /* radiuslist  */
  YYSYMBOL_radius = 464,                   /* radius  */
  YYSYMBOL_apache_stat_list = 465,         /* apache_stat_list  */
  YYSYMBOL_apache_stat = 466,              /* apache_stat  */
  YYSYMBOL_exist = 467,                    /* exist  */
  YYSYMBOL_pid = 468,                      /* pid  */
  YYSYMBOL_ppid = 469,                     /* ppid  */
  YYSYMBOL_uptime = 470,                   /* uptime  */
  YYSYMBOL_responsetime = 471,             /* responsetime  */
  YYSYMBOL_icmpcount = 472,                /* icmpcount  */
  YYSYMBOL_icmpsize = 473,                 /* icmpsize  */
  YYSYMBOL_icmptimeout = 474,              /* icmptimeout  */
  YYSYMBOL_icmpoutgoing = 475,             /* icmpoutgoing  */
  YYSYMBOL_stoptimeout = 476,              /* stoptimeout  */
  YYSYMBOL_starttimeout = 477,             /* starttimeout  */
  YYSYMBOL_restarttimeout = 478,           /* restarttimeout  */
  YYSYMBOL_programtimeout = 479,           /* programtimeout  */
  YYSYMBOL_nettimeout = 480,               /* nettimeout  */
  YYSYMBOL_connectiontimeout = 481,        /* connectiontimeout  */
  YYSYMBOL_retry = 482,                    /* retry  */
  YYSYMBOL_actionrate = 483,               /* actionrate  */
  YYSYMBOL_urloption = 484,                /* urloption  */
  YYSYMBOL_urloperator = 485,              /* urloperator  */
  YYSYMBOL_alert = 486,                    /* alert  */
  YYSYMBOL_alertmail = 487,                /* alertmail  */
  YYSYMBOL_noalertmail = 488,              /* noalertmail  */
  YYSYMBOL_eventoptionlist = 489,          /* eventoptionlist  */
  YYSYMBOL_eventoption = 490,              /* eventoption  */
  YYSYMBOL_formatlist = 491,               /* formatlist  */
  YYSYMBOL_formatoptionlist = 492,         /* formatoptionlist  */
  YYSYMBOL_formatoption = 493,             /* formatoption  */
  YYSYMBOL_every = 494,                    /* every  */
  YYSYMBOL_mode = 495,                     /* mode  */
  YYSYMBOL_onreboot = 496,                 /* onreboot  */
  YYSYMBOL_group = 497,                    /* group  */
  YYSYMBOL_hostgrouplist = 498,            /* hostgrouplist  */
  YYSYMBOL_depend = 499,                   /* depend  */
  YYSYMBOL_dependlist = 500,               /* dependlist  */
  YYSYMBOL_dependant = 501,                /* dependant  */
  YYSYMBOL_statusvalue = 502,              /* statusvalue  */
  YYSYMBOL_resourceprocess = 503,          /* resourceprocess  */
  YYSYMBOL_resourceprocesslist = 504,      /* resourceprocesslist  */
  YYSYMBOL_resourceprocessopt = 505,       /* resourceprocessopt  */
  YYSYMBOL_resourcesystem = 506,           /* resourcesystem  */
  YYSYMBOL_resourcesystemlist = 507,       /* resourcesystemlist  */
  YYSYMBOL_resourcesystemopt = 508,        /* resourcesystemopt  */
  YYSYMBOL_resourcecpuproc = 509,          /* resourcecpuproc  */
  YYSYMBOL_resourcecpu = 510,              /* resourcecpu  */
  YYSYMBOL_resourcecpuid = 511,            /* resourcecpuid  */
  YYSYMBOL_resourcemem = 512,              /* resourcemem  */
  YYSYMBOL_resourcememproc = 513,          /* resourcememproc  */
  YYSYMBOL_resourceswap = 514,             /* resourceswap  */
  YYSYMBOL_resourcepage = 515,             /* resourcepage  */
  YYSYMBOL_resourcethreads = 516,          /* resourcethreads  */
  YYSYMBOL_resourcechild = 517,            /* resourcechild  */
  YYSYMBOL_resourceload = 518,             /* resourceload  */
  YYSYMBOL_resourceloadavg = 519,          /* resourceloadavg  */
  YYSYMBOL_coremultiplier = 520,           /* coremultiplier  */
  YYSYMBOL_resourceread = 521,             /* resourceread  */
  YYSYMBOL_resourcewrite = 522,            /* resourcewrite  */
  YYSYMBOL_value = 523,                    /* value  */
  YYSYMBOL_timestamptype = 524,            /* timestamptype  */
  YYSYMBOL_timestamp = 525,                /* timestamp  */
  YYSYMBOL_operator = 526,                 /* operator  */
  YYSYMBOL_time = 527,                     /* time  */
  YYSYMBOL_totaltime = 528,                /* totaltime  */
  YYSYMBOL_currenttime = 529,              /* currenttime  */
  YYSYMBOL_exectimeout = 530,              /* exectimeout  */
  YYSYMBOL_repeat = 531,                   /* repeat  */
  YYSYMBOL_action = 532,                   /* action  */
  YYSYMBOL_action1 = 533,                  /* action1  */
  YYSYMBOL_action2 = 534,                  /* action2  */
  YYSYMBOL_rateXcycles = 535,              /* rateXcycles  */
  YYSYMBOL_rateXYcycles = 536,             /* rateXYcycles  */
  YYSYMBOL_rate1 = 537,                    /* rate1  */
  YYSYMBOL_rate2 = 538,                    /* rate2  */
  YYSYMBOL_recovery_success = 539,         /* recovery_success  */
  YYSYMBOL_recovery_failure = 540,         /* recovery_failure  */
  YYSYMBOL_checksum = 541,                 /* checksum  */
  YYSYMBOL_hashtype = 542,                 /* hashtype  */
  YYSYMBOL_inode = 543,                    /* inode  */
  YYSYMBOL_space = 544,                    /* space  */
  YYSYMBOL_read = 545,                     /* read  */
  YYSYMBOL_write = 546,                    /* write  */
  YYSYMBOL_servicetime = 547,              /* servicetime  */
  YYSYMBOL_fsflag = 548,                   /* fsflag  */
  YYSYMBOL_unit = 549,                     /* unit  */
  YYSYMBOL_permission = 550,               /* permission  */
  YYSYMBOL_programmatch = 551,             /* programmatch  */
  YYSYMBOL_match = 552,                    /* match  */
  YYSYMBOL_matchflagnot = 553,             /* matchflagnot  */
  YYSYMBOL_size = 554,                     /* size  */
  YYSYMBOL_hardlink = 555,                 /* hardlink  */
  YYSYMBOL_uid = 556,                      /* uid  */
  YYSYMBOL_euid = 557,                     /* euid  */
  YYSYMBOL_secattr = 558,                  /* secattr  */
  YYSYMBOL_secattr_operator = 559,         /* secattr_operator  */
  YYSYMBOL_secattr_value = 560,            /* secattr_value  */
  YYSYMBOL_filedescriptorssystem = 561,    /* filedescriptorssystem  */
  YYSYMBOL_filedescriptorsprocess = 562,   /* filedescriptorsprocess  */
  YYSYMBOL_filedescriptorsprocesstotal = 563, /* filedescriptorsprocesstotal  */
  YYSYMBOL_gid = 564,                      /* gid  */
  YYSYMBOL_linkstatus = 565,               /* linkstatus  */
  YYSYMBOL_linkspeed = 566,                /* linkspeed  */
  YYSYMBOL_linksaturation = 567,           /* linksaturation  */
  YYSYMBOL_upload = 568,                   /* upload  */
  YYSYMBOL_download = 569,                 /* download  */
  YYSYMBOL_icmptype = 570,                 /* icmptype  */
  YYSYMBOL_reminder = 571                  /* reminder  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;




#ifdef short
# undef short
#endif

/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
   <limits.h> and (if available) <stdint.h> are included
   so that the code can choose integer types of a good width.  */

#ifndef __PTRDIFF_MAX__
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
#  define YY_STDINT_H
# endif
#endif

/* Narrow types that promote to a signed type and that can represent a
   signed or unsigned integer of at least N bits.  In tables they can
   save space and decrease cache pressure.  Promoting to a signed type
   helps avoid bugs in integer arithmetic.  */

#ifdef __INT_LEAST8_MAX__
typedef __INT_LEAST8_TYPE__ yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef __INT_LEAST16_MAX__
typedef __INT_LEAST16_TYPE__ yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif

/* Work around bug in HP-UX 11.23, which defines these macros
   incorrectly for preprocessor constants.  This workaround can likely
   be removed in 2023, as HPE has promised support for HP-UX 11.23
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif

#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif

#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif

#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
# elif defined PTRDIFF_MAX
#  ifndef ptrdiff_t
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYPTRDIFF_T ptrdiff_t
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
# endif
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM                                  \
  YY_CAST (YYPTRDIFF_T,                                 \
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
            ? YYPTRDIFF_MAXIMUM                         \
            : YY_CAST (YYSIZE_T, -1)))

#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 yy_state_t;

/* State numbers in computations.  */
typedef int yy_state_fast_t;

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif


#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
#  define YY_ATTRIBUTE_PURE
# endif
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
#  define YY_ATTRIBUTE_UNUSED
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YY_USE(E) ((void) (E))
#else
# define YY_USE(E) /* empty */
#endif

/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif

#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
    _Pragma ("GCC diagnostic push")                            \
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END            \
    _Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if !defined yyoverflow

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* !defined yyoverflow */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yy_state_t yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYPTRDIFF_T yynewbytes;                                         \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYPTRDIFF_T yyi;                      \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  71
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   2078

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  316
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  256
/* YYNRULES -- Number of rules.  */
#define YYNRULES  865
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  1689

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   564


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                \
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
   : YYSYMBOL_YYUNDEF)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_int16 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   312,     2,
       2,     2,     2,     2,   315,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,   313,     2,   314,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   310,     2,   311,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
     135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
     165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
     185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
     195,   196,   197,   198,   199,   200,   201,   202,   203,   204,
     205,   206,   207,   208,   209,   210,   211,   212,   213,   214,
     215,   216,   217,   218,   219,   220,   221,   222,   223,   224,
     225,   226,   227,   228,   229,   230,   231,   232,   233,   234,
     235,   236,   237,   238,   239,   240,   241,   242,   243,   244,
     245,   246,   247,   248,   249,   250,   251,   252,   253,   254,
     255,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,   411,   411,   412,   415,   416,   419,   420,   421,   422,
     423,   424,   425,   426,   427,   428,   429,   430,   431,   432,
     433,   434,   435,   436,   437,   438,   439,   440,   441,   442,
     443,   444,   445,   448,   449,   452,   453,   454,   455,   456,
     457,   458,   459,   460,   461,   462,   463,   464,   465,   466,
     467,   468,   469,   470,   471,   472,   473,   474,   475,   478,
     479,   482,   483,   484,   485,   486,   487,   488,   489,   490,
     491,   492,   493,   494,   495,   496,   497,   498,   499,   500,
     503,   504,   507,   508,   509,   510,   511,   512,   513,   514,
     515,   516,   517,   518,   519,   520,   521,   522,   523,   524,
     525,   526,   529,   530,   533,   534,   535,   536,   537,   538,
     539,   540,   541,   542,   543,   544,   545,   546,   547,   548,
     551,   552,   555,   556,   557,   558,   559,   560,   561,   562,
     563,   564,   565,   566,   567,   570,   571,   574,   575,   576,
     577,   578,   579,   580,   581,   582,   583,   584,   585,   586,
     587,   588,   591,   592,   595,   596,   597,   598,   599,   600,
     601,   602,   603,   604,   605,   606,   607,   610,   611,   614,
     615,   616,   617,   618,   619,   620,   621,   622,   623,   624,
     625,   626,   627,   628,   629,   632,   633,   636,   637,   638,
     639,   640,   641,   642,   643,   644,   645,   646,   647,   650,
     654,   657,   663,   677,   682,   685,   690,   695,   698,   701,
     706,   712,   715,   716,   719,   730,   737,   748,   759,   765,
     771,   777,   783,   789,   795,   801,   807,   813,   819,   825,
     833,   838,   862,   865,   871,   872,   877,   880,   884,   890,
     900,   910,   920,   923,   924,   927,   933,   934,   937,   943,
     944,   945,   946,   947,   950,   951,   956,   961,   964,   967,
     968,   971,   975,   979,   983,   987,   990,   994,   997,  1000,
    1003,  1006,  1009,  1014,  1020,  1021,  1024,  1041,  1048,  1057,
    1058,  1061,  1062,  1065,  1073,  1076,  1084,  1087,  1094,  1097,
    1104,  1107,  1114,  1117,  1124,  1127,  1138,  1148,  1154,  1169,
    1170,  1173,  1182,  1193,  1194,  1197,  1200,  1203,  1204,  1205,
    1206,  1209,  1236,  1237,  1240,  1241,  1242,  1243,  1244,  1245,
    1246,  1247,  1248,  1252,  1259,  1266,  1273,  1280,  1286,  1287,
    1290,  1295,  1300,  1304,  1308,  1312,  1317,  1318,  1321,  1322,
    1325,  1328,  1333,  1342,  1345,  1353,  1357,  1361,  1365,  1369,
    1369,  1376,  1376,  1383,  1383,  1390,  1390,  1397,  1404,  1405,
    1408,  1414,  1417,  1422,  1425,  1428,  1435,  1444,  1449,  1452,
    1457,  1462,  1467,  1475,  1481,  1496,  1501,  1507,  1515,  1518,
    1523,  1526,  1532,  1535,  1540,  1541,  1544,  1545,  1548,  1551,
    1556,  1560,  1564,  1567,  1572,  1575,  1580,  1585,  1590,  1593,
    1598,  1608,  1618,  1619,  1622,  1623,  1624,  1625,  1626,  1627,
    1628,  1629,  1630,  1631,  1632,  1633,  1636,  1644,  1654,  1655,
    1658,  1659,  1660,  1661,  1662,  1663,  1666,  1673,  1682,  1683,
    1686,  1687,  1688,  1689,  1690,  1691,  1694,  1703,  1711,  1719,
    1727,  1736,  1744,  1752,  1762,  1763,  1766,  1767,  1768,  1769,
    1770,  1773,  1776,  1781,  1786,  1792,  1795,  1800,  1803,  1808,
    1813,  1814,  1817,  1818,  1821,  1826,  1829,  1832,  1835,  1838,
    1841,  1844,  1847,  1850,  1853,  1858,  1861,  1866,  1869,  1872,
    1875,  1878,  1881,  1884,  1887,  1891,  1894,  1898,  1901,  1904,
    1909,  1912,  1915,  1918,  1921,  1924,  1927,  1930,  1933,  1938,
    1941,  1944,  1947,  1952,  1960,  1970,  1971,  1974,  1977,  1980,
    1983,  1988,  1989,  1992,  1995,  2000,  2001,  2004,  2007,  2012,
    2013,  2016,  2019,  2022,  2038,  2044,  2050,  2058,  2059,  2062,
    2065,  2068,  2073,  2074,  2077,  2080,  2083,  2088,  2089,  2092,
    2095,  2098,  2099,  2100,  2101,  2102,  2103,  2106,  2116,  2119,
    2124,  2128,  2134,  2139,  2145,  2146,  2151,  2156,  2157,  2160,
    2165,  2166,  2169,  2172,  2175,  2178,  2182,  2186,  2190,  2194,
    2198,  2202,  2206,  2210,  2214,  2220,  2224,  2231,  2237,  2243,
    2251,  2255,  2261,  2266,  2276,  2284,  2289,  2292,  2300,  2303,
    2311,  2314,  2322,  2325,  2333,  2336,  2344,  2352,  2357,  2363,
    2371,  2377,  2378,  2381,  2385,  2388,  2392,  2397,  2400,  2403,
    2404,  2407,  2408,  2409,  2410,  2411,  2412,  2413,  2414,  2415,
    2416,  2417,  2418,  2419,  2420,  2421,  2422,  2423,  2424,  2425,
    2426,  2427,  2428,  2429,  2430,  2431,  2432,  2433,  2434,  2435,
    2436,  2439,  2440,  2443,  2444,  2447,  2448,  2449,  2450,  2453,
    2459,  2468,  2478,  2481,  2484,  2490,  2493,  2497,  2502,  2508,
    2509,  2515,  2518,  2519,  2522,  2525,  2532,  2541,  2547,  2548,
    2551,  2552,  2553,  2554,  2555,  2556,  2557,  2560,  2566,  2567,
    2570,  2571,  2572,  2573,  2574,  2577,  2582,  2589,  2596,  2602,
    2608,  2614,  2620,  2626,  2632,  2638,  2644,  2650,  2655,  2660,
    2667,  2672,  2677,  2682,  2689,  2694,  2701,  2706,  2713,  2720,
    2727,  2747,  2748,  2749,  2752,  2753,  2757,  2762,  2767,  2774,
    2779,  2784,  2791,  2792,  2795,  2796,  2797,  2798,  2801,  2808,
    2816,  2817,  2818,  2819,  2820,  2821,  2822,  2823,  2826,  2827,
    2828,  2829,  2830,  2831,  2834,  2835,  2836,  2838,  2839,  2842,
    2845,  2853,  2856,  2859,  2867,  2870,  2873,  2877,  2880,  2883,
    2886,  2889,  2894,  2907,  2920,  2930,  2942,  2943,  2948,  2955,
    2956,  2961,  2968,  2971,  2974,  2977,  2980,  2985,  2988,  2991,
    2996,  3000,  3007,  3013,  3014,  3015,  3016,  3019,  3026,  3033,
    3040,  3049,  3056,  3063,  3070,  3079,  3086,  3095,  3102,  3111,
    3118,  3127,  3133,  3134,  3135,  3136,  3137,  3140,  3145,  3152,
    3159,  3162,  3167,  3175,  3182,  3190,  3198,  3206,  3213,  3221,
    3230,  3233,  3239,  3245,  3252,  3258,  3266,  3272,  3279,  3285,
    3292,  3295,  3300,  3303,  3306,  3309,  3314,  3317,  3322,  3328,
    3336,  3342,  3350,  3358,  3364,  3371,  3376,  3381,  3388,  3393,
    3401,  3409,  3417,  3425,  3433,  3441,  3451,  3459,  3467,  3475,
    3483,  3491,  3501,  3504,  3505,  3506
};
#endif

/** Accessing symbol of state STATE.  */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])

#if YYDEBUG || 0
/* The user-facing name of the symbol whose (internal) number is
   YYSYMBOL.  No bounds checking.  */
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;

/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "\"end of file\"", "error", "\"invalid token\"", "IF", "ELSE", "THEN",
  "FAILED", "SET", "LOG", "LOGFILE", "FACILITY", "DAEMON", "SYSLOG",
  "MAILSERVER", "HTTPD", "ALLOW", "REJECTOPT", "ADDRESS", "INIT",
  "TERMINAL", "BATCH", "READONLY", "CLEARTEXT", "MD5HASH", "SHA1HASH",
  "SHA256HASH", "CRYPT", "DELAY", "PEMFILE", "PEMKEY", "PEMCHAIN",
  "ENABLE", "DISABLE", "SSLTOKEN", "CIPHER", "CLIENTPEMFILE",
  "ALLOWSELFCERTIFICATION", "SELFSIGNED", "VERIFY", "CERTIFICATE",
  "CACERTIFICATEFILE", "CACERTIFICATEPATH", "VALID", "INTERFACE", "LINK",
  "PACKET", "BYTEIN", "BYTEOUT", "PACKETIN", "PACKETOUT", "SPEED",
  "SATURATION", "UPLOAD", "DOWNLOAD", "TOTAL", "UP", "DOWN", "IDFILE",
  "STATEFILE", "SEND", "EXPECT", "CYCLE", "COUNT", "REMINDER", "REPEAT",
  "LIMITS", "SENDEXPECTBUFFER", "EXPECTBUFFER", "FILECONTENTBUFFER",
  "HTTPCONTENTBUFFER", "PROGRAMOUTPUT", "NETWORKTIMEOUT", "PROGRAMTIMEOUT",
  "STARTTIMEOUT", "STOPTIMEOUT", "RESTARTTIMEOUT", "EXECTIMEOUT",
  "PIDFILE", "START", "STOP", "PATHTOK", "RSAKEY", "HOST", "HOSTNAME",
  "PORT", "IPV4", "IPV6", "TYPE", "UDP", "TCP", "TCPSSL", "PROTOCOL",
  "CONNECTION", "ALERT", "NOALERT", "MAILFORMAT", "UNIXSOCKET",
  "SIGNATURE", "TIMEOUT", "RETRY", "RESTART", "CHECKSUM", "EVERY",
  "NOTEVERY", "DEFAULT", "HTTP", "HTTPS", "APACHESTATUS", "FTP", "SMTP",
  "SMTPS", "POP", "POPS", "IMAP", "IMAPS", "CLAMAV", "NNTP", "NTP3",
  "MYSQL", "MYSQLS", "DNS", "WEBSOCKET", "MQTT", "SSH", "DWP", "LDAP2",
  "LDAP3", "RDATE", "RSYNC", "TNS", "PGSQL", "POSTFIXPOLICY", "SIP",
  "LMTP", "GPS", "RADIUS", "MEMCACHE", "REDIS", "MONGODB", "SIEVE",
  "SPAMASSASSIN", "FAIL2BAN", "STRING", "PATH", "MAILADDR", "MAILFROM",
  "MAILREPLYTO", "MAILSUBJECT", "MAILBODY", "SERVICENAME", "STRINGNAME",
  "HOSTGROUPNAME", "NUMBER", "PERCENT", "LOGLIMIT", "CLOSELIMIT",
  "DNSLIMIT", "KEEPALIVELIMIT", "REPLYLIMIT", "REQUESTLIMIT", "STARTLIMIT",
  "WAITLIMIT", "GRACEFULLIMIT", "CLEANUPLIMIT", "REAL", "CHECKPROC",
  "CHECKFILESYS", "CHECKFILE", "CHECKDIR", "CHECKHOST", "CHECKSYSTEM",
  "CHECKFIFO", "CHECKPROGRAM", "CHECKNET", "THREADS", "CHILDREN", "METHOD",
  "GET", "HEAD", "STATUS", "ORIGIN", "VERSIONOPT", "READ", "WRITE",
  "OPERATION", "SERVICETIME", "DISK", "RESOURCE", "MEMORY", "TOTALMEMORY",
  "LOADAVG1", "LOADAVG5", "LOADAVG15", "SWAP", "MODE", "ACTIVE", "PASSIVE",
  "MANUAL", "ONREBOOT", "NOSTART", "LASTSTATE", "CORE", "CPU", "TOTALCPU",
  "CPUUSER", "CPUSYSTEM", "CPUWAIT", "CPUNICE", "CPUHARDIRQ", "CPUSOFTIRQ",
  "CPUSTEAL", "CPUGUEST", "CPUGUESTNICE", "GROUP", "REQUEST", "DEPENDS",
  "BASEDIR", "SLOT", "EVENTQUEUE", "SECRET", "HOSTHEADER", "UID", "EUID",
  "GID", "MMONIT", "INSTANCE", "USERNAME", "PASSWORD", "DATABASE", "TIME",
  "ATIME", "CTIME", "MTIME", "CHANGED", "MILLISECOND", "SECOND", "MINUTE",
  "HOUR", "DAY", "MONTH", "SSLV2", "SSLV3", "TLSV1", "TLSV11", "TLSV12",
  "TLSV13", "CERTMD5", "AUTO", "NOSSLV2", "NOSSLV3", "NOTLSV1", "NOTLSV11",
  "NOTLSV12", "NOTLSV13", "BYTE", "KILOBYTE", "MEGABYTE", "GIGABYTE",
  "INODE", "SPACE", "TFREE", "PERMISSION", "SIZE", "NOT", "IGNORE",
  "ACTION", "UPTIME", "RESPONSETIME", "REGEXMATCH", "REGEXNOMATCH", "EXEC",
  "UNMONITOR", "PING", "PING4", "PING6", "ICMP", "ICMPECHO", "NONEXIST",
  "EXIST", "INVALID", "DATA", "RECOVERED", "PASSED", "SUCCEEDED", "URL",
  "CONTENT", "PID", "PPID", "FSFLAG", "REGISTER", "CREDENTIALS",
  "URLOBJECT", "ADDRESSOBJECT", "TARGET", "TIMESPEC", "HTTPHEADER",
  "MAXFORWARD", "FIPS", "SECURITY", "ATTRIBUTE", "FILEDESCRIPTORS",
  "HARDLINK", "PAGEIN", "PAGEOUT", "GREATER", "GREATEROREQUAL", "LESS",
  "LESSOREQUAL", "EQUAL", "NOTEQUAL", "'{'", "'}'", "':'", "'['", "']'",
  "'@'", "$accept", "cfgfile", "statement_list", "statement",
  "optproclist", "optproc", "optfilelist", "optfile", "optfilesyslist",
  "optfilesys", "optdirlist", "optdir", "opthostlist", "opthost",
  "optnetlist", "optnet", "optsystemlist", "optsystem", "optfifolist",
  "optfifo", "optprogramlist", "optprogram", "setalert", "setdaemon",
  "setterminal", "startdelay", "setinit", "setonreboot", "setexpectbuffer",
  "setlimits", "limitlist", "limit", "setfips", "setlog", "logtoken",
  "seteventqueue", "setidfile", "setstatefile", "setpid", "setmmonits",
  "mmonitlist", "mmonit", "mmonitoptlist", "mmonitopt", "credentials",
  "setssl", "ssl", "ssloptionlist", "ssloption", "sslexpire",
  "expireoperator", "sslchecksum", "checksumoperator", "sslversionlist",
  "sslversion", "certmd5", "setmailservers", "setmailformat",
  "mailserverlist", "mailserver", "mailserveroptlist", "mailserveropt",
  "sethttpd", "httpdlist", "httpdoption", "pemfile", "clientpemfile",
  "allowselfcert", "httpdport", "httpdsocket", "httpdsocketoptionlist",
  "httpdsocketoption", "sigenable", "sigdisable", "signature",
  "bindaddress", "allow", "$@1", "$@2", "$@3", "$@4", "allowuserlist",
  "allowuser", "readonly", "checkproc", "checkfile", "checkfilesys",
  "checkdir", "checkhost", "checknet", "checksystem", "checkfifo",
  "checkprogram", "start", "stop", "restart", "argumentlist",
  "useroptionlist", "argument", "useroption", "username", "password",
  "database", "hostname", "connection", "connectionoptlist",
  "connectionopt", "connectionurl", "connectionurloptlist",
  "connectionurlopt", "connectionunix", "connectionuxoptlist",
  "connectionuxopt", "icmp", "icmpoptlist", "icmpopt", "host", "port",
  "unixsocket", "ip", "type", "typeoptlist", "typeopt", "outgoing",
  "protocol", "sendexpect", "websocketlist", "websocket", "smtplist",
  "smtp", "mqttlist", "mqtt", "mysqllist", "mysql", "postgresqllist",
  "postgresql", "siplist", "sip", "httplist", "http", "status", "method",
  "request", "responsesum", "hostheader", "httpheaderlist", "secret",
  "radiuslist", "radius", "apache_stat_list", "apache_stat", "exist",
  "pid", "ppid", "uptime", "responsetime", "icmpcount", "icmpsize",
  "icmptimeout", "icmpoutgoing", "stoptimeout", "starttimeout",
  "restarttimeout", "programtimeout", "nettimeout", "connectiontimeout",
  "retry", "actionrate", "urloption", "urloperator", "alert", "alertmail",
  "noalertmail", "eventoptionlist", "eventoption", "formatlist",
  "formatoptionlist", "formatoption", "every", "mode", "onreboot", "group",
  "hostgrouplist", "depend", "dependlist", "dependant", "statusvalue",
  "resourceprocess", "resourceprocesslist", "resourceprocessopt",
  "resourcesystem", "resourcesystemlist", "resourcesystemopt",
  "resourcecpuproc", "resourcecpu", "resourcecpuid", "resourcemem",
  "resourcememproc", "resourceswap", "resourcepage", "resourcethreads",
  "resourcechild", "resourceload", "resourceloadavg", "coremultiplier",
  "resourceread", "resourcewrite", "value", "timestamptype", "timestamp",
  "operator", "time", "totaltime", "currenttime", "exectimeout", "repeat",
  "action", "action1", "action2", "rateXcycles", "rateXYcycles", "rate1",
  "rate2", "recovery_success", "recovery_failure", "checksum", "hashtype",
  "inode", "space", "read", "write", "servicetime", "fsflag", "unit",
  "permission", "programmatch", "match", "matchflagnot", "size",
  "hardlink", "uid", "euid", "secattr", "secattr_operator",
  "secattr_value", "filedescriptorssystem", "filedescriptorsprocess",
  "filedescriptorsprocesstotal", "gid", "linkstatus", "linkspeed",
  "linksaturation", "upload", "download", "icmptype", "reminder", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-1404)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#define YYTABLE_NINF (-767)

#define yytable_value_is_error(Yyn) \
  0

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
static const yytype_int16 yypact[] =
{
     910,    83,   -88,   -80,   -41,     2,    18,    39,    56,   133,
     144,   302,   910, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404,   253,   211, -1404, -1404,   407,   139,   337,
     378,   159,   319,   394,   401,   243,   132,   272,   282, -1404,
      64,   -47,    26,   500,   514,   533,   612, -1404,   555,   560,
     137, -1404, -1404,   726,   449,  1114,  1185,  1302,  1441,  1662,
    1185,  1675,   585,   634,    24, -1404,  1278, -1404, -1404, -1404,
   -1404, -1404,   635, -1404, -1404,   891, -1404, -1404, -1404,   531,
     587, -1404,   282,   418,   734, -1404,   456,   463,  1636,   719,
     646,   669,    99,   490,   675,   684,   694,   695,   583,   715,
     717,   131,   583,   583,   720,   583,   -99,   572,   590,   362,
     723,   732, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,   -39, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,    25,
    -139, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,   192, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404,    37, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,    29, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404,   516, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404,  1737, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,   -74, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,   842,
   -1404,   746,   816,   761, -1404,   801,    10,   744,   775,   832,
     836,   626,   795, -1404,   788,   803,   647, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,    91,
     443, -1404, -1404, -1404, -1404, -1404,   674,   680, -1404, -1404,
      90, -1404,   764, -1404,   252,   418,   693, -1404,   843,   891,
    1636, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,  1293, -1404,   838, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404,   530, -1404, -1404,
   -1404,   454,   708,   888,   688,   688,   688,   688,   581,   688,
     688, -1404, -1404, -1404,   688,   688,   450,   728,   688,   870,
      67,   729,   688,  1779, -1404, -1404, -1404, -1404, -1404, -1404,
     824, -1404, -1404,   544,   554, -1404,   592,   980, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,   732, -1404,
     737,  1636,   719,   145, -1404, -1404, -1404, -1404,    15,   688,
     728,   470,   688,   688,   847, -1404,   470,   851,   169,   688,
     688,   688,  -146,   780,   786,   601,   -52,   386,  1056,   767,
     688,   688,   688,   800,  1066,   688,   688, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404,   688,   688,   688,
    1591, -1404, -1404,   688, -1404, -1404, -1404, -1404,   688,   954,
    -153,   988, -1404,  1044,   118,  1006, -1404, -1404, -1404, -1404,
   -1404, -1404,  1008, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404,   929,  1024, -1404,
    1025,  1027,  1038,   855,  1040,  1045, -1404, -1404, -1404, -1404,
   -1404, -1404,  1165, -1404, -1404, -1404,   877,   879,   882,   883,
     884,   885,   890,   892,   894,   898, -1404, -1404,   900,   901,
     903,   906,   907,   908,   911,   912,   913,   914, -1404, -1404,
   -1404, -1404, -1404, -1404,  1047,  1048, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,   537,  1363,  1110, -1404,  1161,
    1075,   176,   246,   200, -1404, -1404, -1404,  1097,  1112,   284,
     293,   312,   949,   963,  1169, -1404,   688,  1113, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,  1115,  1116,   -29,   -29,   688,
     688,   -29,   -29,   -29,   -29,   870,   870,   870,  1117,     6,
   -1404, -1404,  1261,   984,  1169, -1404,   328,    75, -1404,  1271,
   -1404,   688,  1125,   201, -1404,  1128,   238, -1404,  1129,   256,
   -1404, -1404, -1404,  1636,  1439, -1404, -1404, -1404, -1404,  1130,
    1182,   870,   870,   870,   870,  1183,  1134, -1404, -1404,   834,
    1137,  1138,   861,   873,   878,   209,   239,   289,   870,   688,
     310,   688,   -29, -1404, -1404, -1404,  1204, -1404, -1404, -1404,
    1204,   870,   870,   870,  1140,  1145,  1147,   688,   688,   870,
     -29,   -29,   326,  1149,  1151, -1404,  1299,   -29,  1155,   870,
     870,  1092,  1184, -1404,   816,    27, -1404, -1404, -1404, -1404,
   -1404, -1404,  1188,  1190,  1193,  1194,  1196,  1165,   162, -1404,
   -1404,   106,  1203,  1205,  1206,  1208,  1209,  1029,  1020,  1212,
    1214, -1404,  1213,  1216,  1217,  1218,  1220,  1221,  1224,  1225,
    1230,  1232, -1404,  1126,   -85, -1404,  1110,   719, -1404,  1152,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,   870,   870,
     870,   870,   870,   870, -1404,   928,  1234, -1404,    74,  1236,
    1303, -1404, -1404, -1404, -1404,   635,   635,   374,   453,   275,
     491,  1237,  1240,  1384,  1392,  1394,   940, -1404,  1340,   623,
   -1404, -1404,    74, -1404, -1404, -1404, -1404,   928,    54,  1250,
     623,   -29,  1171, -1404,  1173, -1404,  1207, -1404,  1565,  1110,
     870,    -5,  1433,  1434,  1435,  1440,   870,   635,   870,   870,
     870,   940,   870,   870, -1404, -1404, -1404, -1404,  1262,   635,
    1264,   635,  1219,  1227,  1446,   475,    54,  1301,   -29,   536,
     320,   320,   320,  1176, -1404,   320,   320,   320, -1404,  1451,
    1458,  1460,  1328,   129,   228,  1330,  1332,  1486,   552,   697,
      54,  1339,  1258,  1259,   623,  1342,   870,  1492,  1493,   870,
     870,  1191,  1191, -1404,  1359,  1196,  1196,  1196,  1165, -1404,
    1196, -1404, -1404, -1404, -1404,   515,   570,  1350, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
    1226,   635,   635,   635,   635,   839,   868,   874,   887,   893,
     897, -1404, -1404, -1404,   719, -1404, -1404,  1498,  1499,  1501,
    1503,  1505,  1507,    19, -1404, -1404,   870, -1404,   448,  1371,
    1382,   603,  1937,  1374,  1376,   688, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404,  1524,   870,  1525,  1297,  1297,  1349,   635,
    1352,   635, -1404, -1404, -1404, -1404, -1404, -1404,   623,   623,
     623, -1404, -1404, -1404, -1404, -1404,   870, -1404, -1404, -1404,
   -1404, -1404, -1404,   583, -1404, -1404,  1534,    19,   448,  1540,
     870,  1541,   870,  1534, -1404, -1404, -1404, -1404,  1110,   719,
    1542,  1397,  1543,   623,   623,   623,   623,  1544,   870,  1546,
    1547,  1548,   870,  1551,  1552,   870,  1297,   870,  1297,   870,
     870,   623,    54,  1407,  1556,   870,   705,   870,   870,  1420,
    1412,  1413,  1414, -1404, -1404, -1404, -1404, -1404, -1404,  1562,
    1564,  1569, -1404,   320,  1570,  1571,  1572,   320,   623,   623,
     623,   870,  1297,  1297,  1297,  1297,   336,   367,   623, -1404,
   -1404, -1404, -1404,  1577,   870, -1404, -1404,  1534, -1404,  1578,
     623,   623,  1580,  1582,  1447,  1448, -1404,  1196,  1196,  1196,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,   623,   623,   623,   623,   623,
     623,    43,   470, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
    1586,  1596,  1461, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,  1597, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404,  1089, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,   182, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404,  1370, -1404,  1454,   623,  1602,   510, -1404, -1404,
   -1404, -1404,  1297, -1404,  1297, -1404, -1404,  1534,  1603,   619,
     108, -1404,  1605,  1612,   623,  1615,   623,  1616, -1404,   719,
   -1404,   623,   870,   623,  1534, -1404, -1404, -1404,   623,  1617,
     623,   623,   623,  1618,   623,   623,  1622,   870,  1625,   870,
    1626,  1627, -1404,  1629,   870,   623,  1631,   870,   870,  1632,
    1639, -1404, -1404,  1410, -1404,   623,   623,   623,  1641,   623,
     623,   623,  1642,  1534,  1648,  1534,  1650,   870,   870,   870,
     870,   412,   494,   727,   731,  1534,   623,  1653, -1404,   623,
   -1404,  1534,   623,   623, -1404, -1404,  1534,  1534,  1534,  1534,
    1534,  1534,  1315,  1511,   623,   623, -1404,   623,  1175,   173,
     173,  1516,   688,   688,   688,   688,   688,   688,   688,   688,
     688,   688, -1404, -1404,  1089, -1404,   916,   916,   113,   113,
    1527,  1528,  1509,  1529,   182, -1404,   916,   568,   305,  1452,
   -1404,   917,  1534,   623, -1404, -1404, -1404, -1404, -1404,   623,
    1515,   360,  1609,   595, -1404, -1404,   623,   623,  1648,   623,
    1534,   623, -1404,  1534,  1670,  1534, -1404, -1404,   623, -1404,
   -1404,  1534,   623, -1404, -1404,   623,  1671,   623,  1672,   623,
     623,   623,  1674,  1534,   623,  1676,  1691,   623,   623, -1404,
    1534,  1534,  1534,   623,  1648,  1648,  1648,   623, -1404,   140,
   -1404, -1404,   623,  1692,  1693,  1694,  1697,   706, -1404, -1404,
   -1404,   870,   706,   870,   706,   870,   706,   870, -1404,  1534,
     623,  1534, -1404,  1534, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404,  1554, -1404,  1534,  1534,  1534, -1404, -1404, -1404,
    1561,   977,   688,  1019,  1566, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404,  1555,  1558,  1559,  1560,  1563,
    1568,  1579,  1581,  1583,  1584, -1404, -1404, -1404, -1404,  1620,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,  1587, -1404, -1404, -1404, -1404,   290,  1590, -1404,  1588,
   -1404, -1404, -1404, -1404, -1404,  1534,  1534,  1478,  1609,  1621,
   -1404,   870,   870,   870,  1648,  1648, -1404,  1534, -1404,  1534,
   -1404,   623, -1404,  1534, -1404,  1534,  1534,   623,  1534,   623,
    1534,  1534,  1534,   623, -1404,  1534,   623,   623,  1534,  1534,
   -1404, -1404, -1404,  1534, -1404, -1404, -1404,  1648,  1716, -1404,
    1534,   623,   623,   623,   623,   870,  1727,   870,  1733,   870,
    1734,   870,  1740, -1404,  1534, -1404, -1404,  1508, -1404, -1404,
   -1404, -1404, -1404, -1404,  1595, -1404, -1404, -1404,  -131,  1598,
    1604,  1606,  1607,  1608,  1610,  1613,  1619,  1623,  1634,    22,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,    23,
   -1404, -1404,  1743,  1744,  1753, -1404, -1404, -1404, -1404,  1534,
   -1404, -1404, -1404,  1534, -1404,  1534, -1404, -1404, -1404,  1534,
   -1404,  1534,  1534, -1404, -1404, -1404, -1404,   870, -1404,  1534,
    1534,  1534,  1534,  1762,   623,  1765,   623,  1766,   623,  1768,
     623, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404,  1191,  1191,  1191,  1638,
   -1404,  1713,   623,   623,   623, -1404, -1404, -1404, -1404, -1404,
   -1404,  1780, -1404, -1404, -1404, -1404,   623,  1534,   623,  1534,
     623,  1534,   623,  1534,  1647,  1649,  1677, -1404, -1404, -1404,
   -1404, -1404,   623,  1534, -1404,  1534, -1404,  1534, -1404,  1534,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
static const yytype_int16 yydefact[] =
{
       2,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     3,     4,     6,     8,     9,    20,    22,    19,
      21,    23,    10,    11,    17,    18,    16,    12,     7,    13,
      14,    15,    33,    59,    80,   102,   120,   135,   152,   167,
     185,   234,   235,     0,     0,   312,   206,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   230,
       0,   641,     0,     0,     0,     0,     0,   374,     0,     0,
       0,     1,     5,    24,    25,    26,    27,    28,    32,    29,
      30,    31,   204,   303,   594,   299,   311,   203,   259,   239,
     240,   212,   802,   241,   607,     0,   207,   208,   209,     0,
       0,   246,   242,   254,   232,   231,     0,     0,     0,   863,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    34,    35,    36,    37,    48,    49,    50,    38,
      39,    40,    47,    51,    52,   641,   606,    53,    54,    55,
      56,    57,    58,    41,    42,    43,    44,    45,    46,   820,
     820,    60,    61,    62,    63,    64,    66,    68,    67,    76,
      77,    78,    79,    65,    72,    69,    75,    73,    74,    70,
      71,     0,    81,    82,    83,    84,    85,    86,    88,    87,
      92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
      89,    90,    91,     0,   103,   104,   105,   106,   107,   109,
     111,   110,   116,   117,   118,   119,   108,   112,   115,   113,
     114,     0,   121,   122,   123,   124,   125,   126,   127,   128,
     129,   130,   131,   132,   133,   134,     0,   136,   137,   138,
     139,   145,   149,   146,   147,   148,   150,   151,   140,   141,
     142,   143,   144,     0,   153,   154,   155,   156,   165,   157,
     158,   159,   160,   161,   162,   163,   164,   166,   168,   169,
     170,   171,   172,   174,   176,   175,   181,   182,   183,   184,
     173,   177,   180,   178,   179,     0,   186,   187,   188,   189,
     190,   191,   192,   193,   194,   195,   196,   197,   198,     0,
     202,     0,   301,     0,   300,   398,     0,     0,     0,     0,
       0,   257,     0,   325,     0,     0,     0,   314,   313,   315,
     316,   317,   321,   322,   340,   341,   318,   319,   320,     0,
       0,   803,   804,   805,   806,   210,     0,     0,   647,   648,
       0,   643,   236,   238,   245,   254,     0,   243,     0,     0,
       0,   625,   612,   613,   627,   628,   635,   633,   615,   637,
     614,   636,   632,   639,   621,   623,   638,   629,   634,   611,
     640,   618,   622,   626,   619,   624,   617,   616,   630,   631,
     620,     0,   609,     0,   199,   363,   364,   365,   366,   369,
     368,   367,   370,   371,   375,   388,   389,   592,   384,   372,
     373,   451,     0,     0,   730,   730,   730,   730,     0,   730,
     730,   711,   712,   713,   730,   730,     0,     0,   730,   766,
     451,     0,   730,   766,   668,   670,   671,   672,   673,   674,
     714,   675,   676,   588,   586,   608,   590,     0,   650,   651,
     652,   653,   654,   655,   656,   657,   658,   664,   661,   662,
       0,     0,   863,   783,   724,   725,   726,   727,   783,   730,
     821,     0,   730,   730,     0,   821,     0,     0,     0,   730,
     730,   730,     0,   730,   730,     0,   451,   451,     0,     0,
     730,   730,   730,     0,     0,   730,   730,   697,   688,   689,
     690,   691,   692,   693,   694,   695,   696,   730,   730,   730,
     766,   678,   684,   730,   681,   682,   683,   680,   730,     0,
       0,     0,   303,     0,     0,     0,   283,   285,   287,   289,
     291,   293,     0,   295,   284,   286,   288,   290,   292,   294,
     307,   308,   309,   310,   304,   305,   306,     0,     0,   297,
       0,     0,     0,   357,   345,     0,   342,   323,   337,   339,
     259,   324,   361,   328,   336,   338,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   256,   260,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   211,   213,
     645,   646,   298,   644,     0,     0,   659,   247,   249,   250,
     251,   252,   244,   255,   233,     0,     0,   641,   610,   864,
       0,     0,     0,   592,   385,   386,   376,     0,     0,     0,
       0,     0,     0,     0,     0,   428,   730,     0,   737,   731,
     732,   733,   734,   735,   736,     0,     0,     0,     0,   730,
     730,     0,     0,     0,     0,   766,   766,   766,     0,     0,
     767,   768,     0,     0,     0,   428,     0,     0,   669,     0,
     715,   730,     0,   588,   378,     0,   586,   380,     0,   590,
     382,   649,   663,     0,     0,   603,   784,   785,   786,     0,
       0,   766,   766,   766,   766,     0,     0,   601,   602,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   766,   730,
       0,   730,     0,   444,   444,   444,     0,   444,   444,   444,
       0,   766,   766,   766,     0,     0,     0,   730,   730,   766,
       0,     0,     0,     0,     0,   679,     0,     0,     0,   766,
     766,     0,     0,   205,   302,   279,   395,   394,   396,   296,
     595,   399,   346,   347,   348,     0,     0,   361,     0,   362,
     326,   327,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   281,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   237,     0,     0,   642,   641,   863,   865,     0,
     390,   392,   391,   393,   387,   377,   452,   454,   766,   766,
     766,   766,   766,   766,   418,     0,     0,   402,   766,     0,
       0,   708,   709,   723,   722,   802,   802,     0,     0,   802,
     802,     0,     0,     0,     0,     0,   738,   764,     0,     0,
     418,   402,   766,   834,   835,   832,   833,     0,   723,     0,
       0,     0,     0,   379,     0,   381,     0,   383,     0,   641,
     766,   766,     0,     0,     0,     0,   766,   802,   766,   766,
     766,   738,   766,   766,   815,   814,   819,   818,   723,   802,
     723,   802,   723,     0,     0,     0,   723,     0,     0,   802,
     766,   766,   766,     0,   444,   766,   766,   766,   444,     0,
       0,     0,     0,   802,   802,     0,     0,     0,   802,   802,
     723,     0,     0,     0,     0,     0,   766,     0,     0,   766,
     766,   279,   279,   280,     0,     0,     0,     0,   361,   360,
     350,   358,   344,   258,   335,     0,     0,     0,   329,   267,
     269,   268,   266,   270,   263,   264,   261,   262,   271,   272,
     265,   802,   802,   802,   802,     0,     0,     0,     0,     0,
       0,   248,   660,   253,   863,   200,   593,     0,     0,     0,
       0,     0,     0,   766,   836,   837,   766,   453,   766,     0,
       0,     0,     0,     0,     0,   730,   429,   430,   431,   432,
     434,   433,   435,     0,   766,     0,   747,   747,   723,   802,
     723,   802,   701,   700,   703,   702,   685,   686,     0,     0,
       0,   739,   740,   741,   742,   743,   766,   765,   759,   760,
     754,   758,   757,     0,   761,   762,   772,   766,   766,     0,
     766,     0,   766,   772,   710,   589,   587,   591,   641,   863,
       0,     0,     0,     0,     0,     0,     0,     0,   766,     0,
       0,     0,   766,     0,     0,   766,   747,   766,   747,   766,
     766,     0,   723,     0,     0,   766,   802,   766,   766,     0,
       0,     0,     0,   445,   450,   446,   447,   448,   449,     0,
       0,     0,   862,   766,     0,     0,     0,   766,     0,     0,
       0,   766,   747,   747,   747,   747,   802,   802,     0,   699,
     698,   705,   704,     0,   766,   706,   707,   772,   687,     0,
       0,     0,     0,     0,     0,     0,   276,   352,   354,   356,
     343,   359,   330,   332,   331,   333,   334,   282,   214,   215,
     216,   217,   218,   219,   220,   221,   224,   225,   222,   223,
     226,   227,   228,   229,   201,     0,     0,     0,     0,     0,
       0,     0,     0,   423,   425,   424,   419,   421,   422,   420,
       0,     0,     0,   455,   456,   413,   415,   414,   403,   404,
     405,   411,   406,   407,   410,   409,   412,   408,     0,   503,
     504,   459,   457,   460,   467,   537,   537,     0,   471,   511,
     511,   488,   489,   475,   476,   466,   485,   486,   519,   519,
     468,     0,   515,   500,   469,   477,   478,   492,   494,   501,
     527,   490,   532,   479,   472,   557,   480,   493,   481,   495,
     499,   470,     0,   597,     0,     0,     0,     0,   748,   716,
     719,   718,   747,   721,   747,   577,   578,   772,     0,   749,
       0,   576,     0,     0,     0,     0,     0,     0,   667,   863,
     604,     0,   766,     0,   772,   823,   825,   729,     0,     0,
       0,     0,     0,     0,     0,     0,     0,   766,     0,   766,
       0,     0,   801,     0,   766,     0,     0,   766,   766,     0,
       0,   585,   582,     0,   583,     0,     0,     0,     0,     0,
       0,     0,     0,   772,   777,   772,     0,   766,   766,   766,
     766,     0,     0,     0,     0,   772,     0,     0,   677,     0,
     666,   772,     0,     0,   277,   278,   772,   772,   772,   772,
     772,   772,   274,     0,     0,     0,   464,     0,   458,   473,
     474,     0,   730,   730,   730,   730,   730,   730,   730,   730,
     730,   730,   562,   563,   465,   560,   497,   498,   483,   484,
       0,     0,     0,     0,   502,   505,   482,   487,   496,   491,
     596,     0,   772,     0,   599,   598,   717,   720,   575,     0,
       0,   749,   751,     0,   763,   773,     0,     0,   777,     0,
     772,     0,   605,   772,     0,   772,   808,   782,     0,   813,
     812,   772,     0,   817,   816,     0,     0,     0,     0,     0,
       0,     0,     0,   772,     0,     0,     0,     0,     0,   584,
     772,   772,   772,     0,   777,   777,   777,     0,   845,     0,
     847,   846,     0,     0,     0,     0,     0,     0,   744,   745,
     746,   766,     0,   766,     0,   766,     0,   766,   848,   772,
       0,   772,   810,   772,   809,   826,   827,   828,   829,   843,
     844,   275,     0,   600,   772,   772,   772,   462,   463,   461,
       0,     0,   730,     0,     0,   554,   539,   540,   538,   543,
     544,   541,   542,   545,   564,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   561,   513,   514,   512,     0,
     521,   522,   520,   509,   507,   510,   508,   506,   517,   518,
     516,     0,   529,   530,   531,   528,     0,     0,   533,     0,
     559,   558,   580,   581,   426,   772,   772,     0,   751,     0,
     755,   769,   769,   769,   777,   777,   427,   772,   840,   772,
     807,     0,   780,   772,   824,   772,   772,     0,   772,     0,
     772,   772,   772,     0,   787,   772,     0,     0,   772,   772,
     437,   438,   439,   772,   441,   442,   443,   777,     0,   778,
     772,     0,     0,     0,     0,   766,     0,   766,     0,   766,
       0,   766,     0,   838,   772,   665,   811,     0,   416,   830,
     400,   552,   548,   549,     0,   551,   550,   553,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   279,
     397,   535,   534,   536,   556,   842,   579,   750,   756,     0,
     770,   771,     0,     0,     0,   417,   401,   831,   841,   772,
     822,   728,   796,   772,   798,   772,   799,   800,   789,   772,
     788,   772,   772,   792,   791,   436,   440,   769,   849,   772,
     772,   772,   772,     0,     0,     0,     0,     0,     0,     0,
       0,   839,   273,   547,   555,   546,   565,   566,   567,   568,
     569,   570,   571,   572,   573,   574,   279,   279,   279,     0,
     752,     0,     0,     0,     0,   781,   795,   797,   790,   794,
     793,     0,   853,   850,   859,   856,     0,   772,     0,   772,
       0,   772,     0,   772,     0,     0,     0,   523,   753,   774,
     775,   776,     0,   772,   854,   772,   851,   772,   860,   772,
     857,   524,   525,   526,   779,   855,   852,   861,   858
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
   -1404, -1404, -1404,  1800, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,  1690, -1404, -1404,  1468, -1404,   -83,  1266, -1404,  -853,
   -1404,  -317,  -866, -1404,  -342,  -343, -1404, -1404, -1404,  1736,
    1305, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404,   104,  -718,  -683, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404, -1404,  1157,  1243,  1355,  -105,  -412,  -392,  -591,
    -516,  -369, -1404, -1404,  1741,  1003, -1404,  1745,  1011, -1404,
   -1404,  1179, -1404, -1404,  -140, -1404,  -341,  1181,  1408, -1404,
    -841, -1404, -1404, -1404,  -764,  -723, -1404,   505,   672, -1404,
   -1404, -1404,   664, -1404, -1404, -1404, -1404, -1404,   678, -1404,
   -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
     522,   852, -1404, -1404,  1758,  -739, -1404, -1404, -1404, -1404,
    1192,  1186,  1187,  1235, -1404,  -332,  -229,  1519,  -653,  -453,
    1614,  1840, -1404,  -321,  -353,  -141,  1500,  -306,  1730,  1804,
    1898,  1909, -1404,  1917, -1404,  1399, -1404, -1404, -1404,  1431,
   -1404, -1404,  1358, -1404, -1404, -1404, -1404, -1404, -1404, -1404,
   -1404, -1404,  -216, -1404, -1404, -1404, -1404,   473,  -296,   430,
    -399,  1014,  -563,  -322,   521,   375, -1196,  -360, -1296, -1403,
   -1379,  -423, -1354,  -152,  -800, -1404,  1406, -1404, -1404, -1404,
   -1404, -1404, -1404,   175,   496, -1404, -1404,  1706, -1404,   464,
     955, -1404, -1404, -1404,  1051, -1404, -1404, -1404,  1050, -1404,
   -1404, -1404, -1404, -1404,  1167,  -443
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,    11,    12,    13,    73,   132,    74,   161,    75,   182,
      76,   204,    77,   222,    78,   237,    79,   254,    80,   268,
      81,   286,    14,    15,    16,   300,    17,    18,    19,    20,
     330,   579,    21,    22,    60,    23,    24,    25,    26,    27,
     102,   103,   344,   587,   347,    28,   530,   329,   567,  1124,
    1422,   531,   894,   920,   532,   533,    29,    30,    84,    85,
     302,   534,    31,    86,   318,   319,   320,   321,   322,   323,
     741,   908,   324,   325,   326,   327,   328,   736,   895,   896,
     897,   900,   901,   740,    32,    33,    34,    35,    36,    37,
      38,    39,    40,   133,   134,   135,   397,   603,   398,   605,
     535,   536,  1474,   539,   136,   948,  1138,   137,   943,  1126,
     138,   788,   956,   228,   860,  1043,   614,   787,   615,  1139,
     957,  1298,  1429,  1141,   958,   959,  1324,  1325,  1316,  1458,
    1326,  1470,  1318,  1462,  1327,  1475,  1328,  1478,  1299,  1438,
    1439,  1440,  1441,  1442,  1443,  1558,  1480,  1329,  1481,  1314,
    1315,   139,   140,   141,   142,  1044,  1045,  1046,  1047,  1048,
     657,   654,   660,   606,   305,   961,   962,   143,  1129,   679,
     144,   145,   146,   381,   382,   109,   340,   341,   147,   148,
     149,   150,   764,   151,   448,   449,   297,   152,   423,   424,
     266,   500,   501,   425,   502,   503,   504,   426,   505,   506,
     427,   428,   429,   430,   651,   431,   432,   795,   463,   173,
     625,   986,  1401,  1199,  1342,  1490,   995,   996,  1345,   640,
     641,   642,  1582,  1211,  1390,   174,   670,   194,   195,   196,
     197,   198,   199,   335,   175,   298,   176,   464,   177,   178,
     153,   154,   155,   817,   946,   267,   156,   157,   158,   248,
     249,   250,   251,   252,   864,   384
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
     649,   591,   590,   317,   452,   604,   626,   627,   628,   665,
     631,   632,   774,   683,  1344,   633,   634,   433,   434,   638,
     436,   653,   656,   647,   659,  1084,  1085,   589,   598,   596,
     607,   453,   540,   541,   583,   476,   542,   507,   666,   667,
     668,   604,   604,   468,   604,  1636,  1637,  1638,   106,   960,
     891,   892,   311,   437,   902,  1011,   106,   722,  1121,  -766,
     676,    62,   774,   680,   681,   774,   932,   807,   774,    63,
     685,   686,   687,   960,   690,   692,   104,   716,   403,   644,
     720,   704,   705,   706,  1640,  1292,   710,   711,  1580,  1580,
    1580,    41,    42,  1529,    43,  1136,    44,    45,   712,   713,
     714,    46,    47,   110,   717,   508,   111,  1140,    64,   718,
     721,  1343,  1581,  1581,  1581,   671,    48,   953,   954,   556,
     557,   558,   303,   793,   465,   559,   560,   904,   561,   562,
     664,   563,   564,   949,   950,   794,   644,   401,  1583,  1584,
      49,    50,   688,  1528,   725,  1136,   466,   639,    51,   607,
      52,    65,   543,   544,   119,   677,   678,  1140,   808,   509,
      53,   951,   674,   608,  1624,   952,    83,    66,   666,   667,
     668,   639,   953,   954,  1062,  1641,    54,   403,    55,   674,
     120,   403,  1091,  1625,  1142,   402,   988,   989,    67,   403,
     556,   557,   558,  1344,  1459,   438,   559,   560,   468,   561,
     562,   990,   563,   564,  1580,    68,   639,   105,   991,  1144,
      96,   510,   803,   804,   805,  1090,   107,   789,   988,   989,
     693,   694,   695,   696,   450,  1143,   639,   818,  1581,   933,
     797,   798,   612,   990,  1142,   336,   337,   338,   339,   794,
     991,   387,   388,   598,   454,   455,   456,   457,   832,   833,
     834,   835,   821,  1651,   454,   455,   456,   457,   458,  1144,
     726,   588,   727,   108,  1320,   854,   454,   455,   456,   457,
     475,   451,   565,  1064,  1430,  1143,   671,   672,   869,   870,
     871,    56,    69,   403,   507,   311,   877,   459,   460,   583,
     855,   513,   858,    70,   112,  1147,   887,   888,   600,   652,
     417,    57,    71,   419,  1122,   404,   405,    58,   875,   876,
     461,   598,   477,   406,   407,   419,   673,   408,   770,   409,
     410,   411,   412,   413,   935,   545,   462,   905,   771,   906,
     893,    97,    98,   414,   415,   893,   655,  1039,   462,   514,
     515,   955,   828,   565,   403,  1147,  1669,  1670,  1671,  1431,
     585,   643,  1432,    83,   658,   937,   938,   939,   940,   941,
     942,   848,  1321,  1322,   416,   963,   609,   907,   611,  1091,
    1091,  1091,   992,   794,   469,   470,  1684,   471,   993,   994,
      59,  1271,  1040,   331,   332,   333,   334,  1433,   772,   999,
     609,   850,   611,  1434,   417,  1001,  1323,   418,   773,   514,
     515,   582,   566,   794,   992,    82,   669,  1010,  1012,   419,
     993,   994,  1273,  1017,   420,  1019,  1020,  1021,  1041,  1023,
    1024,   601,   601,   602,   602,   472,   778,    87,   972,   421,
     669,   422,  1571,  1034,  1572,   780,   779,  1049,  1050,  1051,
     443,   852,  1054,  1055,  1056,   781,  1344,  1344,  1344,    88,
     473,   474,   159,   794,   782,   417,   767,  1073,  1340,   601,
    1003,   602,   856,  1079,   783,  1132,  1082,  1083,   607,    91,
     419,    92,   639,   903,   794,   598,  1344,   601,   880,   602,
      89,   311,   331,   332,   333,   334,  1435,  1121,    99,   100,
     794,  1114,   516,   517,   518,   519,   520,   521,   522,   523,
     524,   525,   526,   527,   528,   529,   216,   949,   950,   568,
     280,   569,   570,   571,   572,   573,   574,   575,   576,   577,
    1130,    90,   478,  1131,  1077,  1148,   968,   122,   123,   331,
     332,   333,   334,  1133,  1134,   951,   607,    93,   794,   952,
     218,  1196,    54,   124,   282,    94,   953,   954,  1496,   125,
     608,   126,   127,    95,   861,   862,  1194,   865,   866,   867,
     479,   444,   445,  1208,  1397,   586,  1220,   480,   481,   482,
     483,   200,   217,   101,  1212,  1213,   281,  1215,  1097,  1217,
     113,   601,  1042,   602,  1524,  1525,  1526,   955,   988,   989,
     331,   332,   333,   334,   114,  1229,   813,   814,  1476,  1233,
     639,  1477,  1236,   990,  1238,   970,  1240,  1241,  1334,  1243,
     991,  1127,  1246,   115,  1249,  1250,  1145,   794,  1205,  1206,
    1207,   331,   332,   333,   334,   934,  1125,  1032,   600,   116,
    1258,  1137,   389,   390,  1262,   117,   815,   816,  1266,   794,
     118,  1312,   652,   128,   974,  1200,  1402,   129,  1398,  1399,
    1400,  1277,   655,  1224,  1225,  1226,  1227,  1092,   697,   698,
     699,   700,   130,   299,   131,  1127,  1145,  1093,   403,  1293,
     643,  1242,   395,   396,   342,   609,   610,   611,   554,   555,
    1125,  1137,   336,   337,   338,   339,   395,   396,  1009,  1037,
     658,  1151,  1152,  1153,  1585,  1586,   395,   396,  1263,  1264,
    1265,   988,   989,  1639,  1237,  1069,  1239,   346,  1275,  1403,
    1405,  1407,  1094,   160,  1128,   955,   990,  1340,   301,  1146,
    1280,  1281,  1095,   991,  1053,   395,   396,  1606,  1057,   121,
    1398,  1399,  1400,  1122,   395,   396,   635,   636,   612,   343,
    1267,  1268,  1269,  1270,   348,   331,   332,   333,   334,   484,
     774,   601,   613,   602,   578,  1286,  1287,  1288,  1289,  1290,
    1291,   395,   396,   629,   630,   601,   349,   602,  1128,  1146,
    1664,  1665,  1666,   350,   992,   601,  1352,   602,   677,   678,
     993,   994,   383,  1436,  1436,   440,   441,   442,  1313,   385,
     331,   332,   333,   334,   514,   515,  1471,  1341,  1312,  1354,
    1456,  1456,  1460,  1460,   122,   123,   331,   332,   333,   334,
    1468,  1472,   386,   601,  1366,   602,  1368,   604,   391,    54,
     124,  1372,   702,   703,  1375,  1376,   125,   392,   126,   127,
     454,   455,   456,   457,  1535,  1332,   393,  1335,   394,  1537,
     601,  1539,   602,  1541,  1393,  1394,  1395,  1396,   765,   311,
    1071,  1218,   707,   708,  1348,   513,  1350,   399,  1247,   400,
    1123,  1353,   671,  1355,   435,  1135,   439,  1219,  1357,   511,
    1359,  1360,  1361,   446,  1363,  1364,  1491,  1492,  1493,  1404,
    1336,   447,  1337,  1406,   538,  1373,   546,   992,  1209,   331,
     332,   333,   334,   993,   994,  1380,  1381,  1382,   512,  1384,
    1385,  1386,   673,  1445,  1446,  1447,  1448,  1449,  1450,  1451,
    1452,  1453,  1454,   537,  1123,  1135,  1409,     1,   547,  1411,
     128,   618,  1413,  1414,   129,  1278,   165,   186,   208,   548,
    1437,  1437,   272,   549,  1424,  1425,   550,  1426,   551,   130,
     552,   131,  1398,  1399,  1400,  1313,   553,  1457,  1457,  1461,
    1461,   331,   332,   333,   334,  1428,  1427,  1469,  1473,   331,
     332,   333,   334,  1398,  1399,  1400,   580,  1398,  1399,  1400,
     966,   967,   581,  1485,   973,   975,   838,   839,  1536,  1486,
    1538,   584,  1540,   593,  1542,   594,  1494,  1495,   617,  1497,
     599,  1499,   619,   620,   621,   622,   623,   624,  1503,  1087,
    1088,  1089,  1505,   842,   843,  1506,   637,  1508,   616,  1510,
    1511,  1512,  1018,   618,  1515,   844,   845,  1518,  1519,   618,
     846,   847,   639,  1523,  1026,   650,  1028,  1527,   646,   179,
     201,   219,  1530,  1554,  1038,   283,   336,   337,   338,   339,
     689,   661,   514,   515,   914,   915,   691,   663,  1063,  1065,
    1544,   916,   917,  1070,  1072,  1338,   516,   517,   518,   519,
     520,   521,   522,   523,   524,   525,   526,   527,   528,   529,
     944,   945,  1356,  1102,  1103,     2,     3,     4,     5,     6,
       7,     8,     9,    10,   619,   620,   621,   622,   623,   624,
     619,   620,   621,   622,   623,   624,  1098,  1099,  1100,  1101,
     701,   796,  1104,  1105,   799,   800,   801,   802,  1106,  1107,
     709,  1388,  1613,  1391,  1615,   682,  1617,   181,  1619,   684,
     819,  1108,  1109,  1408,   180,   202,   220,  1110,  1111,  1412,
     284,  1112,  1113,   719,  1415,  1416,  1417,  1418,  1419,  1420,
     723,  1589,   514,   515,  1202,   725,  1204,  1593,   728,  1595,
     729,  1482,  1483,  1599,  1552,  1553,  1601,  1602,   849,   851,
     853,  1555,  1556,   857,   730,   859,   731,   735,   732,  1301,
     733,  1609,  1610,  1611,  1612,   981,   982,   983,   984,   985,
    1484,   734,  -349,   878,   879,   881,   739,   737,   203,   742,
     885,   743,   122,   123,   744,   745,   746,   747,  1498,   762,
     763,  1500,   748,  1502,   749,   106,   750,    54,   124,  1504,
     751,  1248,   752,   753,   125,   754,   126,   127,   755,   756,
     757,  1514,   768,   758,   759,   760,   761,   769,  1520,  1521,
    1522,   162,   183,   205,   223,   238,   255,   269,   287,   776,
     784,  1272,  1274,  1302,  1303,  1304,  1305,  1306,  1307,  1308,
    1309,  1310,  1311,   786,  1657,   777,  1659,  1543,  1661,  1545,
    1663,  1546,   785,   122,   123,   790,   809,   791,   792,   806,
     969,   971,  1548,  1549,  1550,   810,   820,   822,    54,   124,
     824,   826,   830,   831,   836,   125,   837,   126,   127,   840,
     841,   863,   872,   306,  1004,   307,  1673,   873,  1675,   874,
    1677,   882,  1679,   883,   884,   221,   308,   886,   128,   309,
     310,   311,   129,   312,   313,   514,   515,   163,   184,   206,
     224,   239,   256,   270,   288,   889,   890,   130,  1033,   131,
    -351,  1036,  -353,  1575,  1576,  -355,   898,   351,   899,   352,
     353,   354,   355,   356,   357,  1587,   909,  1588,   910,   911,
     912,  1590,   913,  1591,  1592,   918,  1594,   919,  1596,  1597,
    1598,   931,   314,  1600,   965,   921,  1603,  1604,   922,   923,
     924,  1605,   925,   926,   315,   316,   927,   928,  1608,   128,
     122,   123,   929,   129,   930,   358,   947,   936,   964,   978,
     976,   359,  1621,   977,   360,    54,   124,   979,   130,   980,
     131,   987,   125,  1002,   126,   127,  1005,   351,  1006,   352,
     353,   354,   355,   356,   357,   516,   517,   518,   519,   520,
     521,   522,   523,   524,   525,   526,   527,   528,   529,   164,
     185,   207,   225,   240,   257,   271,   289,  1645,  1013,  1014,
    1015,  1646,  1007,  1647,   236,  1016,  1025,  1648,  1027,  1649,
    1650,  1031,  1052,  1029,  1035,   358,  1058,  1652,  1653,  1654,
    1655,   359,  1030,  1059,   360,  1060,   516,   517,   518,   519,
     520,   521,   361,   523,   524,   525,   526,   527,   528,   529,
     362,  1061,  1066,   351,  1067,   352,   353,   354,   355,   356,
     357,  1068,  1074,  1075,  1076,  1078,   128,  1080,  1081,   893,
     129,  1086,  1096,  1115,  1116,  1674,  1117,  1676,  1118,  1678,
    1119,  1680,  1120,  1149,   363,   130,   364,   131,   365,   122,
     123,  1685,   366,  1686,  1150,  1687,  1192,  1688,  1193,  1195,
    1197,   358,  1198,  1201,    54,   124,  1203,   359,  1210,  1222,
     360,   125,   361,   126,   127,  1214,  1216,  1221,  1223,  1228,
     362,  1230,  1231,  1232,   367,   368,  1234,  1235,   369,   370,
    1244,  1245,  1251,   371,  1252,  1253,  1254,  1255,   372,  1256,
     373,   374,   375,   376,  1257,  1259,  1260,  1261,   377,   378,
     379,   380,  1276,  1279,   363,  1282,   364,  1283,   365,  1284,
    1285,  1294,   366,   166,   187,   209,   229,   241,   259,   273,
     290,  1295,  1297,  1296,   597,  1330,  1331,  1333,  1339,   351,
    1346,   352,   353,   354,   355,   356,   357,  1347,   361,  1421,
    1349,  1351,  1358,  1362,   367,   368,   362,  1365,   369,   370,
    1367,  1369,  1370,   371,  1371,   128,  1374,  1377,   372,   129,
     373,   374,   375,   376,  1378,  1379,  1383,  1387,   377,   378,
     379,   380,  1389,  1423,   130,  1392,   131,   358,  1410,  1444,
     363,  1465,   364,   359,   365,   253,   360,  1487,   366,  1463,
    1464,  1479,  1466,  1489,   766,  1501,  1507,  1509,   285,  1513,
     351,  1516,   352,   353,   354,   355,   356,   357,   167,   188,
     210,   230,   242,   260,   274,   291,  1517,  1531,  1532,  1533,
     367,   368,  1534,  1551,   369,   370,  1547,  1559,  1557,   371,
    1560,  1561,  1562,  1577,   372,  1563,   373,   374,   375,   376,
    1564,  1569,  1607,  1579,   377,   378,   379,   380,   358,  1570,
    1574,  1565,  1614,  1566,   359,  1567,  1568,   360,  1616,  1618,
     122,   123,  1573,   639,   361,  1620,  1622,  1623,  1642,  1643,
     829,  1626,   362,   122,   123,    54,   124,  1627,  1644,  1628,
    1629,  1630,   125,  1631,   126,   127,  1632,  1656,    54,   124,
    1658,  1660,  1633,  1662,  1668,   125,  1634,   126,   127,   485,
    1667,   411,   412,   413,   486,  1672,   363,  1635,   364,  1681,
     365,  1682,   345,   487,   366,   488,   489,   490,   491,   492,
     493,   494,   495,   496,   168,   189,   211,   231,   243,   261,
     275,   292,    72,   592,   998,   361,   738,   724,   226,  1683,
     304,   997,   227,   362,   812,   811,   367,   368,   645,  1467,
     369,   370,  1317,  1319,  1300,   371,  1455,   258,   775,   823,
     372,    61,   373,   374,   375,   376,   827,   662,   825,   595,
     377,   378,   379,   380,   648,  1022,   128,   363,   715,   364,
     129,   365,  1488,  1578,   675,   366,   467,   868,  1000,   128,
       0,     0,     0,   129,     0,   130,  1008,   131,   169,   190,
     212,   232,   244,   262,   276,   293,     0,     0,   130,   403,
     131,     0,     0,   498,   499,     0,     0,   367,   368,     0,
       0,   369,   370,     0,     0,     0,   371,     0,     0,     0,
       0,   372,     0,   373,   374,   375,   376,     0,     0,     0,
       0,   377,   378,   379,   380,   485,     0,   411,   412,   413,
     486,   639,     0,     0,     0,     0,     0,     0,     0,   487,
       0,   488,   489,   490,   491,   492,   493,   494,   495,   496,
       0,     0,     0,   404,   405,     0,     0,     0,     0,     0,
       0,   406,   407,     0,     0,   408,     0,   409,   410,   411,
     412,   413,   170,   191,   213,   233,   245,   263,   277,   294,
       0,   414,   415,   171,   192,   214,   234,   246,   264,   278,
     295,   172,   193,   215,   235,   247,   265,   279,   296,     0,
       0,     0,     0,   418,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,   497,     0,   498,
     499,  1154,  1155,  1156,  1157,  1158,  1159,  1160,  1161,  1162,
    1163,  1164,  1165,  1166,  1167,  1168,  1169,  1170,  1171,  1172,
    1173,  1174,  1175,  1176,  1177,  1178,  1179,  1180,  1181,  1182,
    1183,  1184,  1185,  1186,  1187,  1188,  1189,  1190,  1191
};

static const yytype_int16 yycheck[] =
{
     423,   344,   344,    86,   145,   397,   405,   406,   407,   452,
     409,   410,   603,   466,  1210,   414,   415,   122,   123,   418,
     125,   433,   434,   422,   436,   891,   892,   344,   381,   350,
      82,     6,    22,    23,   340,     6,    26,   253,    23,    24,
      25,   433,   434,     6,   436,    23,    24,    25,    95,   788,
      23,    24,    33,   152,   737,    60,    95,   510,    39,     5,
     459,   149,   653,   462,   463,   656,   151,    61,   659,   149,
     469,   470,   471,   812,   473,   474,    12,   500,   152,   420,
     233,   480,   481,   482,    61,    42,   485,   486,  1491,  1492,
    1493,     8,     9,  1389,    11,   948,    13,    14,   497,   498,
     499,    18,    19,    77,   503,   179,    80,   948,   149,   508,
     263,     3,  1491,  1492,  1493,   261,    33,    98,    99,    28,
      29,    30,    98,   152,   263,    34,    35,    21,    37,    38,
     451,    40,    41,    59,    60,   164,   477,     6,  1492,  1493,
      57,    58,   288,     3,   101,   998,   285,   152,    65,    82,
      67,   149,   142,   143,    17,   308,   309,   998,   152,   233,
      77,    87,   458,    96,   295,    91,   142,   149,    23,    24,
      25,   152,    98,    99,    45,   152,    93,   152,    95,   475,
      43,   152,   900,   314,   948,    54,    78,    79,   149,   152,
      28,    29,    30,  1389,    81,   294,    34,    35,     6,    37,
      38,    93,    40,    41,  1607,   149,   152,   143,   100,   948,
      78,   285,   635,   636,   637,   898,   263,   616,    78,    79,
     272,   273,   274,   275,   263,   948,   152,   152,  1607,   314,
     629,   630,   284,    93,   998,   145,   146,   147,   148,   164,
     100,   142,   143,   596,   229,   230,   231,   232,   671,   672,
     673,   674,   651,  1607,   229,   230,   231,   232,   233,   998,
     142,   344,   144,   310,    82,   688,   229,   230,   231,   232,
     233,   310,   181,    45,   101,   998,   261,   262,   701,   702,
     703,   198,   149,   152,   500,    33,   709,   262,   263,   595,
     689,    39,   691,   149,   268,   948,   719,   720,    98,    98,
     263,   218,     0,   278,   285,   174,   175,   224,   707,   708,
     285,   664,   283,   182,   183,   278,   301,   186,   142,   188,
     189,   190,   191,   192,   767,   315,   301,   221,   152,   223,
     308,   199,   200,   202,   203,   308,    98,    17,   301,   226,
     227,   267,   663,   181,   152,   998,  1642,  1643,  1644,   176,
      98,   284,   179,   142,    98,   778,   779,   780,   781,   782,
     783,   152,   180,   181,   233,   788,   221,   261,   223,  1087,
    1088,  1089,   264,   164,   182,   183,  1672,   185,   270,   271,
     297,    45,    62,   254,   255,   256,   257,   214,   142,   812,
     221,   152,   223,   220,   263,   818,   214,   266,   152,   226,
     227,   311,   311,   164,   264,   152,   261,   830,   831,   278,
     270,   271,    45,   836,   283,   838,   839,   840,    98,   842,
     843,   221,   221,   223,   223,   233,   142,    20,   153,   298,
     261,   300,   142,   856,   144,   142,   152,   860,   861,   862,
      78,   152,   865,   866,   867,   152,  1642,  1643,  1644,   310,
     258,   259,     3,   164,   142,   263,   597,   880,    98,   221,
     820,   223,   152,   886,   152,    17,   889,   890,    82,   310,
     278,   152,   152,   311,   164,   828,  1672,   221,   152,   223,
     143,    33,   254,   255,   256,   257,   313,    39,   216,   217,
     164,   934,   240,   241,   242,   243,   244,   245,   246,   247,
     248,   249,   250,   251,   252,   253,    76,    59,    60,    66,
      80,    68,    69,    70,    71,    72,    73,    74,    75,    76,
     943,   143,     6,   946,   884,   948,   152,    78,    79,   254,
     255,   256,   257,    85,    86,    87,    82,   143,   164,    91,
      76,   964,    93,    94,    80,   144,    98,    99,  1348,   100,
      96,   102,   103,   310,   694,   695,   955,   697,   698,   699,
      44,   199,   200,   986,   152,   313,  1009,    51,    52,    53,
      54,    75,    76,   291,   997,   998,    80,  1000,   920,  1002,
      80,   221,   262,   223,  1384,  1385,  1386,   267,    78,    79,
     254,   255,   256,   257,    80,  1018,   268,   269,   293,  1022,
     152,   296,  1025,    93,  1027,   152,  1029,  1030,    98,  1032,
     100,   943,  1035,    80,  1037,  1038,   948,   164,   978,   979,
     980,   254,   255,   256,   257,   766,   943,   152,    98,    17,
    1053,   948,   142,   143,  1057,    80,   308,   309,  1061,   164,
      80,  1157,    98,   194,   153,   967,   152,   198,   236,   237,
     238,  1074,    98,  1013,  1014,  1015,  1016,   142,   272,   273,
     274,   275,   213,    78,   215,   997,   998,   152,   152,  1122,
     284,  1031,   142,   143,   143,   221,   222,   223,    31,    32,
     997,   998,   145,   146,   147,   148,   142,   143,   829,   153,
      98,    88,    89,    90,  1494,  1495,   142,   143,  1058,  1059,
    1060,    78,    79,  1569,  1026,   153,  1028,   289,  1068,  1272,
    1273,  1274,   142,   264,   943,   267,    93,    98,    84,   948,
    1080,  1081,   152,   100,   864,   142,   143,  1527,   868,     3,
     236,   237,   238,   285,   142,   143,   286,   287,   284,   152,
    1062,  1063,  1064,  1065,    10,   254,   255,   256,   257,   233,
    1341,   221,   298,   223,   311,  1115,  1116,  1117,  1118,  1119,
    1120,   142,   143,   182,   183,   221,   310,   223,   997,   998,
    1636,  1637,  1638,   310,   264,   221,  1219,   223,   308,   309,
     270,   271,    63,  1299,  1300,   195,   196,   197,  1157,   143,
     254,   255,   256,   257,   226,   227,   228,  1209,  1314,  1222,
    1316,  1317,  1318,  1319,    78,    79,   254,   255,   256,   257,
    1326,  1327,   143,   221,  1237,   223,  1239,  1209,   143,    93,
      94,  1244,    55,    56,  1247,  1248,   100,   143,   102,   103,
     229,   230,   231,   232,  1397,  1195,   142,  1197,   143,  1402,
     221,  1404,   223,  1406,  1267,  1268,  1269,  1270,   311,    33,
     153,  1003,    52,    53,  1214,    39,  1216,   142,   153,   142,
     943,  1221,   261,  1223,   144,   948,   294,  1008,  1228,    27,
    1230,  1231,  1232,   150,  1234,  1235,   281,   282,   283,   152,
    1202,   149,  1204,   152,    83,  1245,   142,   264,   993,   254,
     255,   256,   257,   270,   271,  1255,  1256,  1257,   152,  1259,
    1260,  1261,   301,  1302,  1303,  1304,  1305,  1306,  1307,  1308,
    1309,  1310,  1311,   152,   997,   998,  1276,     7,   143,  1279,
     194,   233,  1282,  1283,   198,  1077,    74,    75,    76,    97,
    1299,  1300,    80,    97,  1294,  1295,   310,  1297,   143,   213,
     152,   215,   236,   237,   238,  1314,   143,  1316,  1317,  1318,
    1319,   254,   255,   256,   257,  1298,  1298,  1326,  1327,   254,
     255,   256,   257,   236,   237,   238,   292,   236,   237,   238,
     795,   796,   292,  1333,   799,   800,   142,   143,  1401,  1339,
    1403,   217,  1405,   290,  1407,   142,  1346,  1347,   100,  1349,
     152,  1351,   304,   305,   306,   307,   308,   309,  1358,   895,
     896,   897,  1362,   142,   143,  1365,   278,  1367,   300,  1369,
    1370,  1371,   837,   233,  1374,   142,   143,  1377,  1378,   233,
     142,   143,   152,  1383,   849,   201,   851,  1387,   299,    74,
      75,    76,  1392,  1432,   859,    80,   145,   146,   147,   148,
     260,    61,   226,   227,    15,    16,   260,   310,   873,   874,
    1410,    31,    32,   878,   879,  1207,   240,   241,   242,   243,
     244,   245,   246,   247,   248,   249,   250,   251,   252,   253,
     142,   143,  1224,   234,   235,   165,   166,   167,   168,   169,
     170,   171,   172,   173,   304,   305,   306,   307,   308,   309,
     304,   305,   306,   307,   308,   309,   921,   922,   923,   924,
      44,   628,   234,   235,   631,   632,   633,   634,   234,   235,
      44,  1263,  1535,  1265,  1537,   268,  1539,     3,  1541,   268,
     647,   234,   235,  1275,    74,    75,    76,   234,   235,  1281,
      80,   234,   235,   179,  1286,  1287,  1288,  1289,  1290,  1291,
     152,  1501,   226,   227,   969,   101,   971,  1507,   142,  1509,
     142,   234,   235,  1513,   177,   178,  1516,  1517,   685,   686,
     687,   142,   143,   690,   235,   692,   142,   312,   143,    80,
     143,  1531,  1532,  1533,  1534,   235,   236,   237,   238,   239,
    1332,   143,   142,   710,   711,   712,    21,   142,     3,   312,
     717,   312,    78,    79,   312,   312,   312,   312,  1350,   152,
     152,  1353,   312,  1355,   312,    95,   312,    93,    94,  1361,
     312,  1036,   312,   312,   100,   312,   102,   103,   312,   312,
     312,  1373,    61,   312,   312,   312,   312,   152,  1380,  1381,
    1382,    74,    75,    76,    77,    78,    79,    80,    81,   142,
     291,  1066,  1067,   154,   155,   156,   157,   158,   159,   160,
     161,   162,   163,    84,  1614,   143,  1616,  1409,  1618,  1411,
    1620,  1413,   299,    78,    79,   152,     5,   152,   152,   152,
     797,   798,  1424,  1425,  1426,   291,     5,   152,    93,    94,
     152,   152,   152,   101,   101,   100,   152,   102,   103,   152,
     152,    87,   152,    15,   821,    17,  1656,   152,  1658,   152,
    1660,   152,  1662,   152,     5,     3,    28,   152,   194,    31,
      32,    33,   198,    35,    36,   226,   227,    74,    75,    76,
      77,    78,    79,    80,    81,   233,   142,   213,   855,   215,
     142,   858,   142,  1485,  1486,   142,   142,    44,   142,    46,
      47,    48,    49,    50,    51,  1497,   143,  1499,   143,   143,
     142,  1503,   143,  1505,  1506,   143,  1508,   143,  1510,  1511,
    1512,   235,    84,  1515,    61,   152,  1518,  1519,   152,   152,
     152,  1523,   152,   152,    96,    97,   152,   152,  1530,   194,
      78,    79,   152,   198,   152,    92,   152,   235,   152,     5,
     153,    98,  1544,   153,   101,    93,    94,     5,   213,     5,
     215,    61,   100,   153,   102,   103,   235,    44,   235,    46,
      47,    48,    49,    50,    51,   240,   241,   242,   243,   244,
     245,   246,   247,   248,   249,   250,   251,   252,   253,    74,
      75,    76,    77,    78,    79,    80,    81,  1589,     5,     5,
       5,  1593,   235,  1595,     3,     5,   184,  1599,   184,  1601,
    1602,     5,   276,   234,   153,    92,     5,  1609,  1610,  1611,
    1612,    98,   235,     5,   101,     5,   240,   241,   242,   243,
     244,   245,   179,   247,   248,   249,   250,   251,   252,   253,
     187,   153,   152,    44,   152,    46,    47,    48,    49,    50,
      51,     5,   153,   235,   235,   153,   194,     5,     5,   308,
     198,   142,   152,     5,     5,  1657,     5,  1659,     5,  1661,
       5,  1663,     5,   142,   221,   213,   223,   215,   225,    78,
      79,  1673,   229,  1675,   142,  1677,   152,  1679,   152,     5,
       5,    92,   235,   184,    93,    94,   184,    98,     4,   142,
     101,   100,   179,   102,   103,     5,     5,     5,     5,     5,
     187,     5,     5,     5,   261,   262,     5,     5,   265,   266,
     153,     5,   142,   270,   152,   152,   152,     5,   275,     5,
     277,   278,   279,   280,     5,     5,     5,     5,   285,   286,
     287,   288,     5,     5,   221,     5,   223,     5,   225,   142,
     142,     5,   229,    74,    75,    76,    77,    78,    79,    80,
      81,     5,     5,   142,   311,   235,   152,     5,     5,    44,
       5,    46,    47,    48,    49,    50,    51,     5,   179,   304,
       5,     5,     5,     5,   261,   262,   187,     5,   265,   266,
       5,     5,     5,   270,     5,   194,     5,     5,   275,   198,
     277,   278,   279,   280,     5,   235,     5,     5,   285,   286,
     287,   288,     4,   142,   213,     5,   215,    92,     5,   143,
     221,   152,   223,    98,   225,     3,   101,   152,   229,   142,
     142,   219,   143,    64,   311,     5,     5,     5,     3,     5,
      44,     5,    46,    47,    48,    49,    50,    51,    74,    75,
      76,    77,    78,    79,    80,    81,     5,     5,     5,     5,
     261,   262,     5,   142,   265,   266,   152,   152,   142,   270,
     152,   152,   152,   235,   275,   152,   277,   278,   279,   280,
     152,   101,     6,   102,   285,   286,   287,   288,    92,   142,
     142,   152,     5,   152,    98,   152,   152,   101,     5,     5,
      78,    79,   152,   152,   179,     5,   238,   152,     5,     5,
     311,   153,   187,    78,    79,    93,    94,   153,     5,   153,
     153,   153,   100,   153,   102,   103,   153,     5,    93,    94,
       5,     5,   153,     5,    61,   100,   153,   102,   103,   188,
     142,   190,   191,   192,   193,     5,   221,   153,   223,   142,
     225,   142,   102,   202,   229,   204,   205,   206,   207,   208,
     209,   210,   211,   212,    74,    75,    76,    77,    78,    79,
      80,    81,    12,   345,   811,   179,   550,   512,    77,   142,
      84,   810,    77,   187,   645,   644,   261,   262,   420,  1324,
     265,   266,  1160,  1169,  1156,   270,  1314,    79,   603,   653,
     275,     1,   277,   278,   279,   280,   659,   448,   656,   349,
     285,   286,   287,   288,   423,   841,   194,   221,   500,   223,
     198,   225,  1341,  1488,   458,   229,   160,   700,   817,   194,
      -1,    -1,    -1,   198,    -1,   213,   311,   215,    74,    75,
      76,    77,    78,    79,    80,    81,    -1,    -1,   213,   152,
     215,    -1,    -1,   302,   303,    -1,    -1,   261,   262,    -1,
      -1,   265,   266,    -1,    -1,    -1,   270,    -1,    -1,    -1,
      -1,   275,    -1,   277,   278,   279,   280,    -1,    -1,    -1,
      -1,   285,   286,   287,   288,   188,    -1,   190,   191,   192,
     193,   152,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   202,
      -1,   204,   205,   206,   207,   208,   209,   210,   211,   212,
      -1,    -1,    -1,   174,   175,    -1,    -1,    -1,    -1,    -1,
      -1,   182,   183,    -1,    -1,   186,    -1,   188,   189,   190,
     191,   192,    74,    75,    76,    77,    78,    79,    80,    81,
      -1,   202,   203,    74,    75,    76,    77,    78,    79,    80,
      81,    74,    75,    76,    77,    78,    79,    80,    81,    -1,
      -1,    -1,    -1,   266,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,   300,    -1,   302,
     303,   104,   105,   106,   107,   108,   109,   110,   111,   112,
     113,   114,   115,   116,   117,   118,   119,   120,   121,   122,
     123,   124,   125,   126,   127,   128,   129,   130,   131,   132,
     133,   134,   135,   136,   137,   138,   139,   140,   141
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_int16 yystos[] =
{
       0,     7,   165,   166,   167,   168,   169,   170,   171,   172,
     173,   317,   318,   319,   338,   339,   340,   342,   343,   344,
     345,   348,   349,   351,   352,   353,   354,   355,   361,   372,
     373,   378,   400,   401,   402,   403,   404,   405,   406,   407,
     408,     8,     9,    11,    13,    14,    18,    19,    33,    57,
      58,    65,    67,    77,    93,    95,   198,   218,   224,   297,
     350,   487,   149,   149,   149,   149,   149,   149,   149,   149,
     149,     0,   319,   320,   322,   324,   326,   328,   330,   332,
     334,   336,   152,   142,   374,   375,   379,    20,   310,   143,
     143,   310,   152,   143,   144,   310,    78,   199,   200,   216,
     217,   291,   356,   357,    12,   143,    95,   263,   310,   491,
      77,    80,   268,    80,    80,    80,    17,    80,    80,    17,
      43,     3,    78,    79,    94,   100,   102,   103,   194,   198,
     213,   215,   321,   409,   410,   411,   420,   423,   426,   467,
     468,   469,   470,   483,   486,   487,   488,   494,   495,   496,
     497,   499,   503,   556,   557,   558,   562,   563,   564,     3,
     264,   323,   409,   410,   411,   467,   483,   486,   494,   495,
     496,   497,   499,   525,   541,   550,   552,   554,   555,   556,
     564,     3,   325,   409,   410,   411,   467,   483,   486,   494,
     495,   496,   497,   499,   543,   544,   545,   546,   547,   548,
     550,   556,   564,     3,   327,   409,   410,   411,   467,   483,
     486,   494,   495,   496,   497,   499,   525,   550,   555,   556,
     564,     3,   329,   409,   410,   411,   420,   423,   429,   483,
     486,   494,   495,   496,   497,   499,     3,   331,   409,   410,
     411,   483,   486,   494,   495,   496,   497,   499,   565,   566,
     567,   568,   569,     3,   333,   409,   410,   411,   470,   483,
     486,   494,   495,   496,   497,   499,   506,   561,   335,   409,
     410,   411,   467,   483,   486,   494,   495,   496,   497,   499,
     525,   550,   555,   556,   564,     3,   337,   409,   410,   411,
     483,   486,   494,   495,   496,   497,   499,   502,   551,    78,
     341,    84,   376,    98,   375,   480,    15,    17,    28,    31,
      32,    33,    35,    36,    84,    96,    97,   362,   380,   381,
     382,   383,   384,   385,   388,   389,   390,   391,   392,   363,
     346,   254,   255,   256,   257,   549,   145,   146,   147,   148,
     492,   493,   143,   152,   358,   357,   289,   360,    10,   310,
     310,    44,    46,    47,    48,    49,    50,    51,    92,    98,
     101,   179,   187,   221,   223,   225,   229,   261,   262,   265,
     266,   270,   275,   277,   278,   279,   280,   285,   286,   287,
     288,   489,   490,    63,   571,   143,   143,   142,   143,   142,
     143,   143,   143,   142,   143,   142,   143,   412,   414,   142,
     142,     6,    54,   152,   174,   175,   182,   183,   186,   188,
     189,   190,   191,   192,   202,   203,   233,   263,   266,   278,
     283,   298,   300,   504,   505,   509,   513,   516,   517,   518,
     519,   521,   522,   412,   412,   144,   412,   152,   294,   294,
     195,   196,   197,    78,   199,   200,   150,   149,   500,   501,
     263,   310,   491,     6,   229,   230,   231,   232,   233,   262,
     263,   285,   301,   524,   553,   263,   285,   553,     6,   182,
     183,   185,   233,   258,   259,   233,     6,   283,     6,    44,
      51,    52,    53,    54,   233,   188,   193,   202,   204,   205,
     206,   207,   208,   209,   210,   211,   212,   300,   302,   303,
     507,   508,   510,   511,   512,   514,   515,   518,   179,   233,
     285,    27,   152,    39,   226,   227,   240,   241,   242,   243,
     244,   245,   246,   247,   248,   249,   250,   251,   252,   253,
     362,   367,   370,   371,   377,   416,   417,   152,    83,   419,
      22,    23,    26,   142,   143,   315,   142,   143,    97,    97,
     310,   143,   152,   143,    31,    32,    28,    29,    30,    34,
      35,    37,    38,    40,    41,   181,   311,   364,    66,    68,
      69,    70,    71,    72,    73,    74,    75,    76,   311,   347,
     292,   292,   311,   493,   217,    98,   313,   359,   362,   367,
     370,   371,   360,   290,   142,   492,   489,   311,   490,   152,
      98,   221,   223,   413,   414,   415,   479,    82,    96,   221,
     222,   223,   284,   298,   432,   434,   300,   100,   233,   304,
     305,   306,   307,   308,   309,   526,   526,   526,   526,   182,
     183,   526,   526,   526,   526,   286,   287,   278,   526,   152,
     535,   536,   537,   284,   432,   434,   299,   526,   505,   537,
     201,   520,    98,   413,   477,    98,   413,   476,    98,   413,
     478,    61,   501,   310,   489,   571,    23,    24,    25,   261,
     542,   261,   262,   301,   524,   542,   526,   308,   309,   485,
     526,   526,   268,   485,   268,   526,   526,   526,   288,   260,
     526,   260,   526,   272,   273,   274,   275,   272,   273,   274,
     275,    44,    55,    56,   526,   526,   526,    52,    53,    44,
     526,   526,   526,   526,   526,   508,   537,   526,   526,   179,
     233,   263,   485,   152,   376,   101,   142,   144,   142,   142,
     235,   142,   143,   143,   143,   312,   393,   142,   363,    21,
     399,   386,   312,   312,   312,   312,   312,   312,   312,   312,
     312,   312,   312,   312,   312,   312,   312,   312,   312,   312,
     312,   312,   152,   152,   498,   311,   311,   491,    61,   152,
     142,   152,   142,   152,   415,   479,   142,   143,   142,   152,
     142,   152,   142,   152,   291,   299,    84,   433,   427,   526,
     152,   152,   152,   152,   164,   523,   523,   526,   526,   523,
     523,   523,   523,   537,   537,   537,   152,    61,   152,     5,
     291,   433,   427,   268,   269,   308,   309,   559,   152,   523,
       5,   526,   152,   477,   152,   476,   152,   478,   489,   311,
     152,   101,   537,   537,   537,   537,   101,   152,   142,   143,
     152,   152,   142,   143,   142,   143,   142,   143,   152,   523,
     152,   523,   152,   523,   537,   526,   152,   523,   526,   523,
     430,   430,   430,    87,   570,   430,   430,   430,   570,   537,
     537,   537,   152,   152,   152,   526,   526,   537,   523,   523,
     152,   523,   152,   152,     5,   523,   152,   537,   537,   233,
     142,    23,    24,   308,   368,   394,   395,   396,   142,   142,
     397,   398,   399,   311,    21,   221,   223,   261,   387,   143,
     143,   143,   142,   143,    15,    16,    31,    32,   143,   143,
     369,   152,   152,   152,   152,   152,   152,   152,   152,   152,
     152,   235,   151,   314,   491,   571,   235,   537,   537,   537,
     537,   537,   537,   424,   142,   143,   560,   152,   421,    59,
      60,    87,    91,    98,    99,   267,   428,   436,   440,   441,
     471,   481,   482,   537,   152,    61,   549,   549,   152,   523,
     152,   523,   153,   549,   153,   549,   153,   153,     5,     5,
       5,   235,   236,   237,   238,   239,   527,    61,    78,    79,
      93,   100,   264,   270,   271,   532,   533,   424,   421,   537,
     560,   537,   153,   533,   523,   235,   235,   235,   311,   491,
     537,    60,   537,     5,     5,     5,     5,   537,   549,   537,
     537,   537,   527,   537,   537,   184,   549,   184,   549,   234,
     235,     5,   152,   523,   537,   153,   523,   153,   549,    17,
      62,    98,   262,   431,   471,   472,   473,   474,   475,   537,
     537,   537,   276,   430,   537,   537,   537,   430,     5,     5,
       5,   153,    45,   549,    45,   549,   152,   152,     5,   153,
     549,   153,   549,   537,   153,   235,   235,   533,   153,   537,
       5,     5,   537,   537,   368,   368,   142,   397,   397,   397,
     399,   398,   142,   152,   142,   152,   152,   370,   549,   549,
     549,   549,   234,   235,   234,   235,   234,   235,   234,   235,
     234,   235,   234,   235,   571,     5,     5,     5,     5,     5,
       5,    39,   285,   362,   365,   367,   425,   481,   482,   484,
     537,   537,    17,    85,    86,   362,   365,   367,   422,   435,
     436,   439,   440,   441,   471,   481,   482,   484,   537,   142,
     142,    88,    89,    90,   104,   105,   106,   107,   108,   109,
     110,   111,   112,   113,   114,   115,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
     130,   131,   132,   133,   134,   135,   136,   137,   138,   139,
     140,   141,   152,   152,   526,     5,   537,     5,   235,   529,
     529,   184,   549,   184,   549,   533,   533,   533,   537,   412,
       4,   539,   537,   537,     5,   537,     5,   537,   539,   491,
     571,     5,   142,     5,   533,   533,   533,   533,     5,   537,
       5,     5,     5,   537,     5,     5,   537,   529,   537,   529,
     537,   537,   533,   537,   153,     5,   537,   153,   549,   537,
     537,   142,   152,   152,   152,     5,     5,     5,   537,     5,
       5,     5,   537,   533,   533,   533,   537,   529,   529,   529,
     529,    45,   549,    45,   549,   533,     5,   537,   539,     5,
     533,   533,     5,     5,   142,   142,   533,   533,   533,   533,
     533,   533,    42,   485,     5,     5,   142,     5,   437,   454,
     454,    80,   154,   155,   156,   157,   158,   159,   160,   161,
     162,   163,   416,   417,   465,   466,   444,   444,   448,   448,
      82,   180,   181,   214,   442,   443,   446,   450,   452,   463,
     235,   152,   533,     5,    98,   533,   529,   529,   539,     5,
      98,   413,   530,     3,   532,   534,     5,     5,   533,     5,
     533,     5,   571,   533,   537,   533,   539,   533,     5,   533,
     533,   533,     5,   533,   533,     5,   537,     5,   537,     5,
       5,     5,   537,   533,     5,   537,   537,     5,     5,   235,
     533,   533,   533,     5,   533,   533,   533,     5,   539,     4,
     540,   539,     5,   537,   537,   537,   537,   152,   236,   237,
     238,   528,   152,   528,   152,   528,   152,   528,   539,   533,
       5,   533,   539,   533,   533,   539,   539,   539,   539,   539,
     539,   304,   366,   142,   533,   533,   533,   370,   371,   438,
     101,   176,   179,   214,   220,   313,   416,   417,   455,   456,
     457,   458,   459,   460,   143,   526,   526,   526,   526,   526,
     526,   526,   526,   526,   526,   466,   416,   417,   445,    81,
     416,   417,   449,   142,   142,   152,   143,   443,   416,   417,
     447,   228,   416,   417,   418,   451,   293,   296,   453,   219,
     462,   464,   234,   235,   539,   533,   533,   152,   530,    64,
     531,   281,   282,   283,   533,   533,   540,   533,   539,   533,
     539,     5,   539,   533,   539,   533,   533,     5,   533,     5,
     533,   533,   533,     5,   539,   533,     5,     5,   533,   533,
     539,   539,   539,   533,   540,   540,   540,   533,     3,   534,
     533,     5,     5,     5,     5,   528,   537,   528,   537,   528,
     537,   528,   537,   539,   533,   539,   539,   152,   539,   539,
     539,   142,   177,   178,   526,   142,   143,   142,   461,   152,
     152,   152,   152,   152,   152,   152,   152,   152,   152,   101,
     142,   142,   144,   152,   142,   539,   539,   235,   531,   102,
     535,   536,   538,   538,   538,   540,   540,   539,   539,   533,
     539,   539,   539,   533,   539,   533,   539,   539,   539,   533,
     539,   533,   533,   539,   539,   539,   540,     6,   539,   533,
     533,   533,   533,   537,     5,   537,     5,   537,     5,   537,
       5,   539,   238,   152,   295,   314,   153,   153,   153,   153,
     153,   153,   153,   153,   153,   153,    23,    24,    25,   368,
      61,   152,     5,     5,     5,   539,   539,   539,   539,   539,
     539,   538,   539,   539,   539,   539,     5,   533,     5,   533,
       5,   533,     5,   533,   368,   368,   368,   142,    61,   534,
     534,   534,     5,   533,   539,   533,   539,   533,   539,   533,
     539,   142,   142,   142,   534,   539,   539,   539,   539
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_int16 yyr1[] =
{
       0,   316,   317,   317,   318,   318,   319,   319,   319,   319,
     319,   319,   319,   319,   319,   319,   319,   319,   319,   319,
     319,   319,   319,   319,   319,   319,   319,   319,   319,   319,
     319,   319,   319,   320,   320,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   321,
     321,   321,   321,   321,   321,   321,   321,   321,   321,   322,
     322,   323,   323,   323,   323,   323,   323,   323,   323,   323,
     323,   323,   323,   323,   323,   323,   323,   323,   323,   323,
     324,   324,   325,   325,   325,   325,   325,   325,   325,   325,
     325,   325,   325,   325,   325,   325,   325,   325,   325,   325,
     325,   325,   326,   326,   327,   327,   327,   327,   327,   327,
     327,   327,   327,   327,   327,   327,   327,   327,   327,   327,
     328,   328,   329,   329,   329,   329,   329,   329,   329,   329,
     329,   329,   329,   329,   329,   330,   330,   331,   331,   331,
     331,   331,   331,   331,   331,   331,   331,   331,   331,   331,
     331,   331,   332,   332,   333,   333,   333,   333,   333,   333,
     333,   333,   333,   333,   333,   333,   333,   334,   334,   335,
     335,   335,   335,   335,   335,   335,   335,   335,   335,   335,
     335,   335,   335,   335,   335,   336,   336,   337,   337,   337,
     337,   337,   337,   337,   337,   337,   337,   337,   337,   338,
     338,   338,   339,   340,   341,   341,   342,   343,   343,   343,
     344,   345,   346,   346,   347,   347,   347,   347,   347,   347,
     347,   347,   347,   347,   347,   347,   347,   347,   347,   347,
     348,   349,   349,   349,   350,   350,   351,   351,   351,   352,
     353,   354,   355,   356,   356,   357,   358,   358,   359,   359,
     359,   359,   359,   359,   360,   360,   361,   362,   362,   363,
     363,   364,   364,   364,   364,   364,   364,   364,   364,   364,
     364,   364,   364,   365,   366,   366,   367,   367,   367,   368,
     368,   369,   369,   370,   370,   370,   370,   370,   370,   370,
     370,   370,   370,   370,   370,   370,   371,   372,   373,   374,
     374,   375,   375,   376,   376,   377,   377,   377,   377,   377,
     377,   378,   379,   379,   380,   380,   380,   380,   380,   380,
     380,   380,   380,   381,   382,   383,   384,   385,   386,   386,
     387,   387,   387,   387,   387,   387,   388,   388,   389,   389,
     390,   390,   391,   392,   392,   392,   392,   392,   392,   393,
     392,   394,   392,   395,   392,   396,   392,   392,   397,   397,
     398,   399,   399,   400,   400,   400,   400,   401,   402,   402,
     403,   404,   405,   405,   406,   407,   408,   408,   409,   409,
     410,   410,   411,   411,   412,   412,   413,   413,   414,   414,
     415,   415,   415,   415,   416,   416,   417,   418,   419,   419,
     420,   420,   421,   421,   422,   422,   422,   422,   422,   422,
     422,   422,   422,   422,   422,   422,   423,   423,   424,   424,
     425,   425,   425,   425,   425,   425,   426,   426,   427,   427,
     428,   428,   428,   428,   428,   428,   429,   429,   429,   429,
     429,   429,   429,   429,   430,   430,   431,   431,   431,   431,
     431,   432,   432,   433,   434,   435,   435,   436,   436,   436,
     437,   437,   438,   438,   439,   440,   440,   440,   440,   440,
     440,   440,   440,   440,   440,   440,   440,   440,   440,   440,
     440,   440,   440,   440,   440,   440,   440,   440,   440,   440,
     440,   440,   440,   440,   440,   440,   440,   440,   440,   440,
     440,   440,   440,   441,   441,   442,   442,   443,   443,   443,
     443,   444,   444,   445,   445,   446,   446,   447,   447,   448,
     448,   449,   449,   449,   449,   449,   449,   450,   450,   451,
     451,   451,   452,   452,   453,   453,   453,   454,   454,   455,
     455,   455,   455,   455,   455,   455,   455,   456,   457,   457,
     458,   458,   459,   460,   461,   461,   462,   463,   463,   464,
     465,   465,   466,   466,   466,   466,   466,   466,   466,   466,
     466,   466,   466,   466,   466,   467,   467,   468,   469,   470,
     471,   471,   472,   473,   474,   475,   476,   476,   477,   477,
     478,   478,   479,   479,   480,   480,   481,   482,   483,   483,
     484,   485,   485,   486,   486,   486,   486,   487,   488,   489,
     489,   490,   490,   490,   490,   490,   490,   490,   490,   490,
     490,   490,   490,   490,   490,   490,   490,   490,   490,   490,
     490,   490,   490,   490,   490,   490,   490,   490,   490,   490,
     490,   491,   491,   492,   492,   493,   493,   493,   493,   494,
     494,   494,   495,   495,   495,   496,   496,   496,   497,   498,
     498,   499,   500,   500,   501,   502,   502,   503,   504,   504,
     505,   505,   505,   505,   505,   505,   505,   506,   507,   507,
     508,   508,   508,   508,   508,   509,   509,   510,   511,   511,
     511,   511,   511,   511,   511,   511,   511,   511,   512,   512,
     513,   513,   513,   513,   514,   514,   515,   515,   516,   517,
     518,   519,   519,   519,   520,   520,   521,   521,   521,   522,
     522,   522,   523,   523,   524,   524,   524,   524,   525,   525,
     526,   526,   526,   526,   526,   526,   526,   526,   527,   527,
     527,   527,   527,   527,   528,   528,   528,   529,   529,   530,
     530,   531,   531,   531,   532,   532,   532,   532,   532,   532,
     532,   532,   533,   534,   535,   536,   537,   537,   537,   538,
     538,   538,   539,   539,   539,   539,   539,   540,   540,   540,
     541,   541,   541,   542,   542,   542,   542,   543,   543,   543,
     543,   544,   544,   544,   544,   545,   545,   546,   546,   547,
     547,   548,   549,   549,   549,   549,   549,   550,   550,   551,
     551,   551,   552,   552,   552,   552,   552,   552,   552,   552,
     553,   553,   554,   554,   555,   555,   556,   556,   557,   557,
     558,   558,   559,   559,   559,   559,   560,   560,   561,   561,
     562,   562,   563,   564,   564,   565,   565,   565,   566,   567,
     568,   568,   568,   568,   568,   568,   569,   569,   569,   569,
     569,   569,   570,   571,   571,   571
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     0,     1,     1,     2,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     0,     2,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     0,
       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     0,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     0,     2,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     0,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     0,     2,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     0,     2,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     4,
       7,     8,     4,     3,     0,     3,     2,     3,     3,     3,
       4,     5,     0,     2,     4,     4,     4,     4,     4,     4,
       4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
       2,     3,     3,     5,     1,     1,     4,     6,     4,     3,
       3,     3,     3,     2,     3,     2,     0,     2,     3,     1,
       1,     1,     1,     3,     0,     2,     5,     1,     4,     0,
       2,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     5,     0,     1,     4,     5,     5,     0,
       1,     0,     2,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     2,     5,     5,     1,
       2,     2,     4,     0,     2,     1,     1,     1,     1,     1,
       1,     3,     0,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     2,     2,     1,     3,     3,     0,     2,
       2,     2,     2,     2,     2,     1,     2,     2,     2,     2,
       1,     1,     2,     5,     4,     2,     3,     3,     3,     0,
       4,     0,     5,     0,     5,     0,     5,     2,     1,     2,
       1,     0,     1,     4,     4,     4,     4,     4,     4,     4,
       4,     4,     4,     4,     2,     4,     5,     6,     3,     4,
       3,     4,     3,     4,     1,     2,     1,     2,     1,     1,
       2,     2,     2,     2,     2,     2,     2,     2,     0,     2,
       9,     9,     0,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     9,     9,     0,     2,
       1,     1,     1,     1,     1,     1,     8,     8,     0,     2,
       1,     1,     1,     1,     1,     1,     9,     8,     8,     8,
       9,     8,     8,     8,     0,     2,     1,     1,     1,     1,
       1,     0,     2,     2,     2,     1,     1,     2,     3,     2,
       0,     2,     1,     1,     2,     3,     2,     2,     2,     2,
       2,     2,     2,     3,     3,     2,     2,     2,     2,     2,
       2,     2,     3,     3,     3,     2,     2,     3,     2,     2,
       2,     3,     2,     2,     2,     2,     3,     3,     3,     2,
       2,     2,     3,     2,     2,     1,     2,     2,     2,     2,
       2,     0,     2,     1,     1,     0,     2,     1,     1,     0,
       2,     1,     1,     4,     5,     5,     5,     0,     2,     1,
       1,     1,     0,     2,     2,     2,     2,     0,     2,     1,
       1,     1,     1,     1,     1,     1,     3,     3,     2,     2,
       2,     2,     2,     2,     0,     2,     2,     0,     2,     1,
       1,     2,     1,     1,     2,     4,     4,     4,     4,     4,
       4,     4,     4,     4,     4,     7,     6,     6,     6,     9,
       4,     4,     2,     2,     3,     2,     0,     3,     0,     3,
       0,     3,     0,     3,     0,     3,     3,     2,     7,     7,
       3,     1,     1,     3,     6,     7,     1,     2,     2,     1,
       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     0,     4,     1,     2,     2,     2,     1,     1,     3,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     0,
       2,     2,     1,     2,     1,     8,     6,     6,     1,     2,
       1,     1,     1,     1,     1,     1,     1,     6,     1,     2,
       1,     1,     1,     1,     1,     4,     4,     4,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     4,     4,
       4,     4,     4,     4,     4,     4,     4,     4,     3,     3,
       4,     1,     1,     1,     0,     1,     5,     6,     5,     5,
       6,     5,     1,     1,     1,     1,     1,     1,     9,     6,
       0,     1,     1,     1,     1,     1,     1,     1,     0,     1,
       1,     1,     1,     1,     1,     1,     1,     0,     1,     0,
       3,     0,     3,     4,     1,     4,     5,     1,     1,     1,
       1,     1,     1,     1,     2,     3,     0,     1,     1,     0,
       1,     1,     0,     2,     6,     6,     6,     0,     2,     6,
       8,    10,     7,     0,     1,     1,     1,     8,     9,     9,
      10,     9,     9,    10,    10,    10,     9,    10,     9,     9,
       9,     6,     0,     1,     1,     1,     1,     8,     7,     7,
       7,     8,     7,     7,     4,     4,     7,     7,     4,     4,
       0,     1,     9,     6,     8,     6,     8,     8,     8,     8,
       9,     9,     1,     1,     1,     1,     1,     1,     8,     9,
       8,     9,     9,     8,     8,     7,     7,     7,     7,     9,
      10,    11,    12,    10,    11,    12,    10,    11,    12,    10,
      11,    12,     2,     0,     2,     3
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Backward compatibility with an undocumented macro.
   Use YYerror or YYUNDEF. */
#define YYERRCODE YYUNDEF


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)




# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Kind, Value); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo,
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  FILE *yyoutput = yyo;
  YY_USE (yyoutput);
  if (!yyvaluep)
    return;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo,
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  YYFPRINTF (yyo, "%s %s (",
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));

  yy_symbol_value_print (yyo, yykind, yyvaluep);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
                 int yyrule)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
                       &yyvsp[(yyi + 1) - (yynrhs)]);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args) ((void) 0)
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
  YY_USE (yyvaluep);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/* Lookahead token kind.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;
/* Number of syntax errors so far.  */
int yynerrs;




/*----------.
| yyparse.  |
`----------*/

int
yyparse (void)
{
    yy_state_fast_t yystate = 0;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus = 0;

    /* Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* Their size.  */
    YYPTRDIFF_T yystacksize = YYINITDEPTH;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

    /* The semantic value stack: array, bottom, top.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs = yyvsa;
    YYSTYPE *yyvsp = yyvs;

  int yyn;
  /* The return value of yyparse.  */
  int yyresult;
  /* Lookahead symbol kind.  */
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yysetstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  YY_IGNORE_USELESS_CAST_BEGIN
  *yyssp = YY_CAST (yy_state_t, yystate);
  YY_IGNORE_USELESS_CAST_END
  YY_STACK_PRINT (yyss, yyssp);

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    YYNOMEM;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        yy_state_t *yyss1 = yyss;
        YYSTYPE *yyvs1 = yyvs;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * YYSIZEOF (*yyssp),
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yy_state_t *yyss1 = yyss;
        union yyalloc *yyptr =
          YY_CAST (union yyalloc *,
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
        if (! yyptr)
          YYNOMEM;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YY_IGNORE_USELESS_CAST_BEGIN
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
                  YY_CAST (long, yystacksize)));
      YY_IGNORE_USELESS_CAST_END

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:
  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex ();
    }

  if (yychar <= YYEOF)
    {
      yychar = YYEOF;
      yytoken = YYSYMBOL_YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else if (yychar == YYerror)
    {
      /* The scanner already issued an error message, process directly
         to error recovery.  But do not keep the error token as
         lookahead, it is too special and may lead us to an endless
         loop in error recovery. */
      yychar = YYUNDEF;
      yytoken = YYSYMBOL_YYerror;
      goto yyerrlab1;
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  /* Discard the shifted token.  */
  yychar = YYEMPTY;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 199: /* setalert: SET alertmail formatlist reminder  */
#line 650 "src/p.y"
                                                    {
                        mailset.events = Event_All;
                        addmail((yyvsp[-2].string), &mailset, &Run.maillist);
                  }
#line 3304 "src/y.tab.c"
    break;

  case 200: /* setalert: SET alertmail '{' eventoptionlist '}' formatlist reminder  */
#line 654 "src/p.y"
                                                                            {
                        addmail((yyvsp[-5].string), &mailset, &Run.maillist);
                  }
#line 3312 "src/y.tab.c"
    break;

  case 201: /* setalert: SET alertmail NOT '{' eventoptionlist '}' formatlist reminder  */
#line 657 "src/p.y"
                                                                                {
                        mailset.events = ~mailset.events;
                        addmail((yyvsp[-6].string), &mailset, &Run.maillist);
                  }
#line 3321 "src/y.tab.c"
    break;

  case 202: /* setdaemon: SET DAEMON NUMBER startdelay  */
#line 663 "src/p.y"
                                               {
                        if (! (Run.flags & Run_Daemon) || ihp.daemon) {
                                int one_year = 31556952;
                                ihp.daemon     = true;
                                Run.flags      |= Run_Daemon;
                                if (((yyvsp[-1].number) <= 0) || ((yyvsp[-1].number) > one_year)) {
                                        yyerror2("Invalid Poll time seconds.");
                                }
                                Run.polltime   = (yyvsp[-1].number);
                                Run.startdelay = (yyvsp[0].number);
                        }
                  }
#line 3338 "src/y.tab.c"
    break;

  case 203: /* setterminal: SET TERMINAL BATCH  */
#line 677 "src/p.y"
                                     {
                        Run.flags |= Run_Batch;
                  }
#line 3346 "src/y.tab.c"
    break;

  case 204: /* startdelay: %empty  */
#line 682 "src/p.y"
                              {
                        (yyval.number) = 0;
                  }
#line 3354 "src/y.tab.c"
    break;

  case 205: /* startdelay: START DELAY NUMBER  */
#line 685 "src/p.y"
                                     {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 3362 "src/y.tab.c"
    break;

  case 206: /* setinit: SET INIT  */
#line 690 "src/p.y"
                           {
                        Run.flags |= Run_Foreground;
                  }
#line 3370 "src/y.tab.c"
    break;

  case 207: /* setonreboot: SET ONREBOOT START  */
#line 695 "src/p.y"
                                     {
                        Run.onreboot = Onreboot_Start;
                  }
#line 3378 "src/y.tab.c"
    break;

  case 208: /* setonreboot: SET ONREBOOT NOSTART  */
#line 698 "src/p.y"
                                       {
                        Run.onreboot = Onreboot_Nostart;
                  }
#line 3386 "src/y.tab.c"
    break;

  case 209: /* setonreboot: SET ONREBOOT LASTSTATE  */
#line 701 "src/p.y"
                                         {
                        Run.onreboot = Onreboot_Laststate;
                  }
#line 3394 "src/y.tab.c"
    break;

  case 210: /* setexpectbuffer: SET EXPECTBUFFER NUMBER unit  */
#line 706 "src/p.y"
                                               {
                        yydeprecated("'set expectbuffer' is deprecated, use 'set limits { sendExpectBuffer: ... }' instead");
                        Run.limits.sendExpectBuffer = (yyvsp[-1].number) * (yyvsp[0].number);
                  }
#line 3403 "src/y.tab.c"
    break;

  case 214: /* limit: SENDEXPECTBUFFER ':' NUMBER unit  */
#line 719 "src/p.y"
                                                   {
                        if ((yyvsp[-1].number) <= 0) {
                                yyerror2("The sendExpectBuffer value must be > 0");
                        } else {
                                long long value = (yyvsp[-1].number) * (yyvsp[0].number64);
                                if (value > INT_MAX)
                                        yyerror2("The sendExpectBuffer value must be <= %d", INT_MAX);
                                else
                                        Run.limits.sendExpectBuffer = (yyvsp[-1].number) * (yyvsp[0].number);
                        }
                  }
#line 3419 "src/y.tab.c"
    break;

  case 215: /* limit: FILECONTENTBUFFER ':' NUMBER unit  */
#line 730 "src/p.y"
                                                    {
                        if ((yyvsp[-1].number) <= 0) {
                                yyerror2("The fileContentBuffer value must be > 0");
                        } else {
                                Run.limits.fileContentBuffer = (yyvsp[-1].number) * (yyvsp[0].number64);
                        }
                  }
#line 3431 "src/y.tab.c"
    break;

  case 216: /* limit: HTTPCONTENTBUFFER ':' NUMBER unit  */
#line 737 "src/p.y"
                                                    {
                        if ((yyvsp[-1].number) <= 0) {
                                yyerror2("The httpContentBuffer value must be > 0");
                        } else {
                                long long value = (yyvsp[-1].number) * (yyvsp[0].number64);
                                if (value > INT_MAX)
                                        yyerror2("The httpContentBuffer value must be <= %d", INT_MAX);
                                else
                                        Run.limits.httpContentBuffer = (yyvsp[-1].number) * (yyvsp[0].number);
                        }
                  }
#line 3447 "src/y.tab.c"
    break;

  case 217: /* limit: PROGRAMOUTPUT ':' NUMBER unit  */
#line 748 "src/p.y"
                                                {
                        if ((yyvsp[-1].number) <= 0) {
                                yyerror2("The programOutput value must be > 0");
                        } else {
                                long long value = (yyvsp[-1].number) * (yyvsp[0].number64);
                                if (value > INT_MAX)
                                        yyerror2("The programOutput value must be <= %d", INT_MAX);
                                else
                                        Run.limits.programOutput = (yyvsp[-1].number) * (yyvsp[0].number);
                        }
                  }
#line 3463 "src/y.tab.c"
    break;

  case 218: /* limit: NETWORKTIMEOUT ':' NUMBER MILLISECOND  */
#line 759 "src/p.y"
                                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The networkTimeout value must be > 0");
                        else
                                Run.limits.networkTimeout = (yyvsp[-1].number);
                  }
#line 3474 "src/y.tab.c"
    break;

  case 219: /* limit: NETWORKTIMEOUT ':' NUMBER SECOND  */
#line 765 "src/p.y"
                                                   {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The networkTimeout value must be > 0");
                        else
                                Run.limits.networkTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3485 "src/y.tab.c"
    break;

  case 220: /* limit: PROGRAMTIMEOUT ':' NUMBER MILLISECOND  */
#line 771 "src/p.y"
                                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The programTimeout value must be > 0");
                        else
                                Run.limits.programTimeout = (yyvsp[-1].number);
                  }
#line 3496 "src/y.tab.c"
    break;

  case 221: /* limit: PROGRAMTIMEOUT ':' NUMBER SECOND  */
#line 777 "src/p.y"
                                                   {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The programTimeout value must be > 0");
                        else
                                Run.limits.programTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3507 "src/y.tab.c"
    break;

  case 222: /* limit: STOPTIMEOUT ':' NUMBER MILLISECOND  */
#line 783 "src/p.y"
                                                     {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The stopTimeout value must be > 0");
                        else
                                Run.limits.stopTimeout = (yyvsp[-1].number);
                  }
#line 3518 "src/y.tab.c"
    break;

  case 223: /* limit: STOPTIMEOUT ':' NUMBER SECOND  */
#line 789 "src/p.y"
                                                {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The stopTimeout value must be > 0");
                        else
                                Run.limits.stopTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3529 "src/y.tab.c"
    break;

  case 224: /* limit: STARTTIMEOUT ':' NUMBER MILLISECOND  */
#line 795 "src/p.y"
                                                      {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The startTimeout value must be > 0");
                        else
                                Run.limits.startTimeout = (yyvsp[-1].number);
                  }
#line 3540 "src/y.tab.c"
    break;

  case 225: /* limit: STARTTIMEOUT ':' NUMBER SECOND  */
#line 801 "src/p.y"
                                                 {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The startTimeout value must be > 0");
                        else
                                Run.limits.startTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3551 "src/y.tab.c"
    break;

  case 226: /* limit: RESTARTTIMEOUT ':' NUMBER MILLISECOND  */
#line 807 "src/p.y"
                                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The restartTimeout value must be > 0");
                        else
                                Run.limits.restartTimeout = (yyvsp[-1].number);
                  }
#line 3562 "src/y.tab.c"
    break;

  case 227: /* limit: RESTARTTIMEOUT ':' NUMBER SECOND  */
#line 813 "src/p.y"
                                                   {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The restartTimeout value must be > 0");
                        else
                                Run.limits.restartTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3573 "src/y.tab.c"
    break;

  case 228: /* limit: EXECTIMEOUT ':' NUMBER MILLISECOND  */
#line 819 "src/p.y"
                                                     {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The execTimeout value must be > 0");
                        else
                                Run.limits.execTimeout = (yyvsp[-1].number);
                  }
#line 3584 "src/y.tab.c"
    break;

  case 229: /* limit: EXECTIMEOUT ':' NUMBER SECOND  */
#line 825 "src/p.y"
                                                {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The execTimeout value must be > 0");
                        else
                                Run.limits.execTimeout = (yyvsp[-1].number) * 1000;
                  }
#line 3595 "src/y.tab.c"
    break;

  case 230: /* setfips: SET FIPS  */
#line 833 "src/p.y"
                           {
                        Run.flags |= Run_FipsEnabled;
                  }
#line 3603 "src/y.tab.c"
    break;

  case 231: /* setlog: SET logtoken PATH  */
#line 838 "src/p.y"
                                      {
                        struct stat sb;
                        if (! Run.files.log || ihp.logfile) {
                                ihp.logfile = true;
                                setlogfile((yyvsp[0].string));
                                Run.flags |= Run_Log;
                                if (stat(Run.files.log, &sb) == -1) {
                                        if (errno == ENOENT) {
                                                // Regular file doesn't exist yet, will be created by Monit later => reset the syslog flag
                                                Run.flags &= ~Run_UseSyslog;
                                        } else {
                                                yywarning2("Can't get the log file information -- %s", STRERROR);
                                        }
                                } else if (sb.st_mode & S_IFREG) {
                                        // Regular file, exists already => reset the syslog flag
                                        Run.flags &= ~Run_UseSyslog;
                                } else {
                                        // The log file is not regular file (e.g. device) => set syslog flag to disable the "View Logfile" functionality in the HTTP API
                                        Run.flags |= Run_UseSyslog;
                                }
                        } else {
                                FREE((yyvsp[0].string));
                        }
                  }
#line 3632 "src/y.tab.c"
    break;

  case 232: /* setlog: SET logtoken SYSLOG  */
#line 862 "src/p.y"
                                      {
                        setsyslog(NULL);
                  }
#line 3640 "src/y.tab.c"
    break;

  case 233: /* setlog: SET logtoken SYSLOG FACILITY STRING  */
#line 865 "src/p.y"
                                                      {
                        setsyslog((yyvsp[0].string));
                        FREE((yyvsp[0].string));
                  }
#line 3649 "src/y.tab.c"
    break;

  case 235: /* logtoken: LOGFILE  */
#line 872 "src/p.y"
                          {
                        yydeprecated("'set logfile' is deprecated, use 'set log' instead");
                  }
#line 3657 "src/y.tab.c"
    break;

  case 236: /* seteventqueue: SET EVENTQUEUE BASEDIR PATH  */
#line 877 "src/p.y"
                                              {
                        Run.eventlist_dir = (yyvsp[0].string);
                  }
#line 3665 "src/y.tab.c"
    break;

  case 237: /* seteventqueue: SET EVENTQUEUE BASEDIR PATH SLOT NUMBER  */
#line 880 "src/p.y"
                                                          {
                        Run.eventlist_dir = (yyvsp[-2].string);
                        Run.eventlist_slots = (yyvsp[0].number);
                  }
#line 3674 "src/y.tab.c"
    break;

  case 238: /* seteventqueue: SET EVENTQUEUE SLOT NUMBER  */
#line 884 "src/p.y"
                                             {
                        Run.eventlist_dir = Str_dup(MYEVENTLISTBASE);
                        Run.eventlist_slots = (yyvsp[0].number);
                  }
#line 3683 "src/y.tab.c"
    break;

  case 239: /* setidfile: SET IDFILE PATH  */
#line 890 "src/p.y"
                                  {
                        if (! Run.files.id || ihp.idfile) {
                                ihp.idfile = true;
                                setidfile((yyvsp[0].string));
                        } else {
                                FREE((yyvsp[0].string));
                        }
                  }
#line 3696 "src/y.tab.c"
    break;

  case 240: /* setstatefile: SET STATEFILE PATH  */
#line 900 "src/p.y"
                                     {
                        if (! Run.files.state || ihp.statefile) {
                                ihp.statefile = true;
                                setstatefile((yyvsp[0].string));
                        } else {
                                FREE((yyvsp[0].string));
                        }
                  }
#line 3709 "src/y.tab.c"
    break;

  case 241: /* setpid: SET PIDFILE PATH  */
#line 910 "src/p.y"
                                   {
                        if (! Run.files.pidfile || ihp.pidfile) {
                                ihp.pidfile = true;
                                setpidfile((yyvsp[0].string));
                        } else {
                                FREE((yyvsp[0].string));
                        }
                  }
#line 3722 "src/y.tab.c"
    break;

  case 245: /* mmonit: URLOBJECT mmonitoptlist  */
#line 927 "src/p.y"
                                          {
                        mmonitset.url = (yyvsp[-1].url);
                        addmmonit(&mmonitset);
                  }
#line 3731 "src/y.tab.c"
    break;

  case 248: /* mmonitopt: TIMEOUT NUMBER SECOND  */
#line 937 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                mmonitset.timeout = (yyvsp[-1].number) * 1000; // net timeout is in milliseconds internally
                  }
#line 3742 "src/y.tab.c"
    break;

  case 255: /* credentials: REGISTER CREDENTIALS  */
#line 951 "src/p.y"
                                       {
                        Run.flags &= ~Run_MmonitCredentials;
                  }
#line 3750 "src/y.tab.c"
    break;

  case 256: /* setssl: SET SSLTOKEN '{' ssloptionlist '}'  */
#line 956 "src/p.y"
                                                     {
                        _setSSLOptions(&(Run.ssl));
                  }
#line 3758 "src/y.tab.c"
    break;

  case 257: /* ssl: SSLTOKEN  */
#line 961 "src/p.y"
                           {
                        sslset.flags = SSL_Enabled;
                  }
#line 3766 "src/y.tab.c"
    break;

  case 261: /* ssloption: VERIFY ':' ENABLE  */
#line 971 "src/p.y"
                                    {
                        sslset.flags = SSL_Enabled;
                        sslset.verify = true;
                  }
#line 3775 "src/y.tab.c"
    break;

  case 262: /* ssloption: VERIFY ':' DISABLE  */
#line 975 "src/p.y"
                                     {
                        sslset.flags = SSL_Enabled;
                        sslset.verify = false;
                  }
#line 3784 "src/y.tab.c"
    break;

  case 263: /* ssloption: SELFSIGNED ':' ALLOW  */
#line 979 "src/p.y"
                                       {
                        sslset.flags = SSL_Enabled;
                        sslset.allowSelfSigned = true;
                  }
#line 3793 "src/y.tab.c"
    break;

  case 264: /* ssloption: SELFSIGNED ':' REJECTOPT  */
#line 983 "src/p.y"
                                           {
                        sslset.flags = SSL_Enabled;
                        sslset.allowSelfSigned = false;
                  }
#line 3802 "src/y.tab.c"
    break;

  case 265: /* ssloption: VERSIONOPT ':' sslversionlist  */
#line 987 "src/p.y"
                                                {
                        sslset.flags = SSL_Enabled;
                  }
#line 3810 "src/y.tab.c"
    break;

  case 266: /* ssloption: CIPHER ':' STRING  */
#line 990 "src/p.y"
                                    {
                        FREE(sslset.ciphers);
                        sslset.ciphers = (yyvsp[0].string);
                  }
#line 3819 "src/y.tab.c"
    break;

  case 267: /* ssloption: PEMFILE ':' PATH  */
#line 994 "src/p.y"
                                   {
                        _setPEM(&(sslset.pemfile), (yyvsp[0].string), "SSL server PEM file", true);
                  }
#line 3827 "src/y.tab.c"
    break;

  case 268: /* ssloption: PEMCHAIN ':' PATH  */
#line 997 "src/p.y"
                                    {
                        _setPEM(&(sslset.pemchain), (yyvsp[0].string), "SSL certificate chain PEM file", true);
                  }
#line 3835 "src/y.tab.c"
    break;

  case 269: /* ssloption: PEMKEY ':' PATH  */
#line 1000 "src/p.y"
                                  {
                        _setPEM(&(sslset.pemkey), (yyvsp[0].string), "SSL server private key PEM file", true);
                  }
#line 3843 "src/y.tab.c"
    break;

  case 270: /* ssloption: CLIENTPEMFILE ':' PATH  */
#line 1003 "src/p.y"
                                         {
                        _setPEM(&(sslset.clientpemfile), (yyvsp[0].string), "SSL client PEM file", true);
                  }
#line 3851 "src/y.tab.c"
    break;

  case 271: /* ssloption: CACERTIFICATEFILE ':' PATH  */
#line 1006 "src/p.y"
                                             {
                        _setPEM(&(sslset.CACertificateFile), (yyvsp[0].string), "SSL CA certificates file", true);
                  }
#line 3859 "src/y.tab.c"
    break;

  case 272: /* ssloption: CACERTIFICATEPATH ':' PATH  */
#line 1009 "src/p.y"
                                             {
                        _setPEM(&(sslset.CACertificatePath), (yyvsp[0].string), "SSL CA certificates directory", false);
                  }
#line 3867 "src/y.tab.c"
    break;

  case 273: /* sslexpire: CERTIFICATE VALID expireoperator NUMBER DAY  */
#line 1014 "src/p.y"
                                                              {
                        sslset.flags = SSL_Enabled;
                        portset.target.net.ssl.certificate.minimumDays = (yyvsp[-1].number);
                  }
#line 3876 "src/y.tab.c"
    break;

  case 276: /* sslchecksum: CERTIFICATE CHECKSUM checksumoperator STRING  */
#line 1024 "src/p.y"
                                                               {
                        sslset.flags = SSL_Enabled;
                        sslset.checksum = (yyvsp[0].string);
                        switch (cleanup_hash_string(sslset.checksum)) {
                                case 32:
                                        sslset.checksumType = Hash_Md5;
                                        break;
                                case 40:
                                        sslset.checksumType = Hash_Sha1;
                                        break;
                                case 64:
                                        sslset.checksumType = Hash_Sha256;
                                        break;
                                default:
                                        yyerror2("Unknown checksum type: [%s] is not MD5, SHA1, nor SHA256", sslset.checksum);
                        }
                  }
#line 3898 "src/y.tab.c"
    break;

  case 277: /* sslchecksum: CERTIFICATE CHECKSUM MD5HASH checksumoperator STRING  */
#line 1041 "src/p.y"
                                                                       {
                        sslset.flags = SSL_Enabled;
                        sslset.checksum = (yyvsp[0].string);
                        if (cleanup_hash_string(sslset.checksum) != 32)
                                yyerror2("Unknown checksum type: [%s] is not MD5", sslset.checksum);
                        sslset.checksumType = Hash_Md5;
                  }
#line 3910 "src/y.tab.c"
    break;

  case 278: /* sslchecksum: CERTIFICATE CHECKSUM SHA1HASH checksumoperator STRING  */
#line 1048 "src/p.y"
                                                                        {
                        sslset.flags = SSL_Enabled;
                        sslset.checksum = (yyvsp[0].string);
                        if (cleanup_hash_string(sslset.checksum) != 40)
                                yyerror2("Unknown checksum type: [%s] is not SHA1", sslset.checksum);
                        sslset.checksumType = Hash_Sha1;
                  }
#line 3922 "src/y.tab.c"
    break;

  case 283: /* sslversion: SSLV2  */
#line 1065 "src/p.y"
                        {
#if defined OPENSSL_NO_SSL2 || ! defined HAVE_SSLV2 || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support SSL version 2");
#else
                        yydeprecated("'sslv2' is deprecated and insecure, use 'tlsv1.2' or later instead");
                        _setSSLVersion(SSL_V2);
#endif
                  }
#line 3935 "src/y.tab.c"
    break;

  case 284: /* sslversion: NOSSLV2  */
#line 1073 "src/p.y"
                          {
                        _unsetSSLVersion(SSL_V2);
                  }
#line 3943 "src/y.tab.c"
    break;

  case 285: /* sslversion: SSLV3  */
#line 1076 "src/p.y"
                        {
#if defined OPENSSL_NO_SSL3 || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support SSL version 3");
#else
                        yydeprecated("'sslv3' is deprecated and insecure, use 'tlsv1.2' or later instead");
                        _setSSLVersion(SSL_V3);
#endif
                  }
#line 3956 "src/y.tab.c"
    break;

  case 286: /* sslversion: NOSSLV3  */
#line 1084 "src/p.y"
                          {
                        _unsetSSLVersion(SSL_V3);
                  }
#line 3964 "src/y.tab.c"
    break;

  case 287: /* sslversion: TLSV1  */
#line 1087 "src/p.y"
                        {
#if defined OPENSSL_NO_TLS1_METHOD || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support TLS version 1.0");
#else
                        _setSSLVersion(SSL_TLSV1);
#endif
                  }
#line 3976 "src/y.tab.c"
    break;

  case 288: /* sslversion: NOTLSV1  */
#line 1094 "src/p.y"
                          {
                        _unsetSSLVersion(SSL_TLSV1);
                  }
#line 3984 "src/y.tab.c"
    break;

  case 289: /* sslversion: TLSV11  */
#line 1097 "src/p.y"
                         {
#if defined OPENSSL_NO_TLS1_1_METHOD || ! defined HAVE_TLSV1_1 || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support TLS version 1.1");
#else
                        _setSSLVersion(SSL_TLSV11);
#endif
                }
#line 3996 "src/y.tab.c"
    break;

  case 290: /* sslversion: NOTLSV11  */
#line 1104 "src/p.y"
                           {
                        _unsetSSLVersion(SSL_TLSV11);
                  }
#line 4004 "src/y.tab.c"
    break;

  case 291: /* sslversion: TLSV12  */
#line 1107 "src/p.y"
                         {
#if defined OPENSSL_NO_TLS1_2_METHOD || ! defined HAVE_TLSV1_2 || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support TLS version 1.2");
#else
                        _setSSLVersion(SSL_TLSV12);
#endif
                }
#line 4016 "src/y.tab.c"
    break;

  case 292: /* sslversion: NOTLSV12  */
#line 1114 "src/p.y"
                           {
                        _unsetSSLVersion(SSL_TLSV12);
                  }
#line 4024 "src/y.tab.c"
    break;

  case 293: /* sslversion: TLSV13  */
#line 1117 "src/p.y"
                         {
#if defined OPENSSL_NO_TLS1_3_METHOD || ! defined HAVE_TLSV1_3 || ! defined HAVE_OPENSSL
                        yyerror("Your SSL Library does not support TLS version 1.3");
#else
                        _setSSLVersion(SSL_TLSV13);
#endif
                }
#line 4036 "src/y.tab.c"
    break;

  case 294: /* sslversion: NOTLSV13  */
#line 1124 "src/p.y"
                           {
                        _unsetSSLVersion(SSL_TLSV13);
                  }
#line 4044 "src/y.tab.c"
    break;

  case 295: /* sslversion: AUTO  */
#line 1127 "src/p.y"
                       {
                        // Enable just TLS 1.2 and 1.3 by default
#if ! defined OPENSSL_NO_TLS1_2_METHOD && defined HAVE_TLSV1_2 && defined HAVE_OPENSSL
                        _setSSLVersion(SSL_TLSV12);
#endif
#if ! defined OPENSSL_NO_TLS1_3_METHOD && defined HAVE_TLSV1_3 && defined HAVE_OPENSSL
                        _setSSLVersion(SSL_TLSV13);
#endif
                  }
#line 4058 "src/y.tab.c"
    break;

  case 296: /* certmd5: CERTMD5 STRING  */
#line 1138 "src/p.y"
                                 { // Backward compatibility
                        yydeprecated("'certmd5' is deprecated, use 'certificate checksum' with SHA1 instead");
                        sslset.flags = SSL_Enabled;
                        sslset.checksum = (yyvsp[0].string);
                        if (cleanup_hash_string(sslset.checksum) != 32)
                                yyerror2("Unknown checksum type: [%s] is not MD5", sslset.checksum);
                        sslset.checksumType = Hash_Md5;
                  }
#line 4071 "src/y.tab.c"
    break;

  case 297: /* setmailservers: SET MAILSERVER mailserverlist nettimeout hostname  */
#line 1148 "src/p.y"
                                                                    {
                        Run.mailserver_timeout = (yyvsp[-1].number);
                        Run.mail_hostname = (yyvsp[0].string);
                  }
#line 4080 "src/y.tab.c"
    break;

  case 298: /* setmailformat: SET MAILFORMAT '{' formatoptionlist '}'  */
#line 1154 "src/p.y"
                                                          {
                        if (mailset.from) {
                                Run.MailFormat.from = mailset.from;
                        } else {
                                Run.MailFormat.from = Address_new();
                                Run.MailFormat.from->address = Str_dup(ALERT_FROM);
                        }
                        if (mailset.replyto)
                                Run.MailFormat.replyto = mailset.replyto;
                        Run.MailFormat.subject = mailset.subject ?  mailset.subject : Str_dup(ALERT_SUBJECT);
                        Run.MailFormat.message = mailset.message ?  mailset.message : Str_dup(ALERT_MESSAGE);
                        reset_mailset();
                  }
#line 4098 "src/y.tab.c"
    break;

  case 301: /* mailserver: STRING mailserveroptlist  */
#line 1173 "src/p.y"
                                           {
                        /* Restore the current text overridden by lookahead */
                        FREE(argyytext);
                        argyytext = Str_dup((yyvsp[-1].string));

                        mailserverset.host = (yyvsp[-1].string);
                        mailserverset.port = PORT_SMTP;
                        addmailserver(&mailserverset);
                  }
#line 4112 "src/y.tab.c"
    break;

  case 302: /* mailserver: STRING PORT NUMBER mailserveroptlist  */
#line 1182 "src/p.y"
                                                       {
                        /* Restore the current text overridden by lookahead */
                        FREE(argyytext);
                        argyytext = Str_dup((yyvsp[-3].string));

                        mailserverset.host = (yyvsp[-3].string);
                        mailserverset.port = (yyvsp[-1].number);
                        addmailserver(&mailserverset);
                  }
#line 4126 "src/y.tab.c"
    break;

  case 305: /* mailserveropt: username  */
#line 1197 "src/p.y"
                           {
                        mailserverset.username = (yyvsp[0].string);
                  }
#line 4134 "src/y.tab.c"
    break;

  case 306: /* mailserveropt: password  */
#line 1200 "src/p.y"
                           {
                        mailserverset.password = (yyvsp[0].string);
                  }
#line 4142 "src/y.tab.c"
    break;

  case 311: /* sethttpd: SET HTTPD httpdlist  */
#line 1209 "src/p.y"
                                      {
                        if (sslset.flags & SSL_Enabled) {
#ifdef HAVE_OPENSSL
                                if (sslset.pemfile) {
                                        if (sslset.pemchain || sslset.pemkey) {
                                                yyerror("SSL server option pemfile and pemchain|pemkey are mutually exclusive");
                                        } else if (! file_checkStat(sslset.pemfile, "SSL server PEM file", S_IRWXU | S_IRGRP | S_IXGRP)) {
                                                yyerror("SSL server PEM file permissions check failed");
                                        } else {
                                                _setSSLOptions(&(Run.httpd.socket.net.ssl));
                                        }
                                } else if (sslset.pemchain && sslset.pemkey) {
                                        if (! file_checkStat(sslset.pemkey, "SSL server private key PEM file", S_IRWXU | S_IRGRP | S_IXGRP)) {
                                                yyerror("SSL server private key PEM file permissions check failed");
                                        } else {
                                                _setSSLOptions(&(Run.httpd.socket.net.ssl));
                                        }
                                } else {
                                        yyerror("SSL server PEM file is required (please use ssl pemfile option)");
                                }
#else
                                yyerror("SSL is not supported");
#endif
                        }
                  }
#line 4172 "src/y.tab.c"
    break;

  case 323: /* pemfile: PEMFILE PATH  */
#line 1252 "src/p.y"
                               {
                        yydeprecated("'pemfile' is deprecated, use 'ssl { pemfile: ... }' instead");
                        _setPEM(&(sslset.pemfile), (yyvsp[0].string), "SSL server PEM file", true);
                  }
#line 4181 "src/y.tab.c"
    break;

  case 324: /* clientpemfile: CLIENTPEMFILE PATH  */
#line 1259 "src/p.y"
                                     {
                        yydeprecated("'clientpemfile' is deprecated, use 'ssl { pemfile: ... }' instead");
                        _setPEM(&(sslset.clientpemfile), (yyvsp[0].string), "SSL client PEM file", true);
                  }
#line 4190 "src/y.tab.c"
    break;

  case 325: /* allowselfcert: ALLOWSELFCERTIFICATION  */
#line 1266 "src/p.y"
                                         {
                        yydeprecated("'allowselfcertification' is deprecated, use 'ssl { selfsigned: allow }' instead");
                        sslset.flags = SSL_Enabled;
                        sslset.allowSelfSigned = true;
                  }
#line 4200 "src/y.tab.c"
    break;

  case 326: /* httpdport: PORT NUMBER readonly  */
#line 1273 "src/p.y"
                                       {
                        Run.httpd.flags |= Httpd_Net;
                        Run.httpd.socket.net.port = (yyvsp[-1].number);
                        Run.httpd.socket.net.readonly = (yyvsp[0].number);
                  }
#line 4210 "src/y.tab.c"
    break;

  case 327: /* httpdsocket: UNIXSOCKET PATH httpdsocketoptionlist  */
#line 1280 "src/p.y"
                                                        {
                        Run.httpd.flags |= Httpd_Unix;
                        Run.httpd.socket.unix.path = (yyvsp[-1].string);
                  }
#line 4219 "src/y.tab.c"
    break;

  case 330: /* httpdsocketoption: UID STRING  */
#line 1290 "src/p.y"
                               {
                        Run.httpd.flags |= Httpd_UnixUid;
                        Run.httpd.socket.unix.uid = get_uid((yyvsp[0].string), 0);
                        FREE((yyvsp[0].string));
                    }
#line 4229 "src/y.tab.c"
    break;

  case 331: /* httpdsocketoption: GID STRING  */
#line 1295 "src/p.y"
                               {
                        Run.httpd.flags |= Httpd_UnixGid;
                        Run.httpd.socket.unix.gid = get_gid((yyvsp[0].string), 0);
                        FREE((yyvsp[0].string));
                    }
#line 4239 "src/y.tab.c"
    break;

  case 332: /* httpdsocketoption: UID NUMBER  */
#line 1300 "src/p.y"
                               {
                        Run.httpd.flags |= Httpd_UnixUid;
                        Run.httpd.socket.unix.uid = get_uid(NULL, (yyvsp[0].number));
                    }
#line 4248 "src/y.tab.c"
    break;

  case 333: /* httpdsocketoption: GID NUMBER  */
#line 1304 "src/p.y"
                               {
                        Run.httpd.flags |= Httpd_UnixGid;
                        Run.httpd.socket.unix.gid = get_gid(NULL, (yyvsp[0].number));
                    }
#line 4257 "src/y.tab.c"
    break;

  case 334: /* httpdsocketoption: PERMISSION NUMBER  */
#line 1308 "src/p.y"
                                      {
                        Run.httpd.flags |= Httpd_UnixPermission;
                        Run.httpd.socket.unix.permission = check_perm((yyvsp[0].number));
                    }
#line 4266 "src/y.tab.c"
    break;

  case 335: /* httpdsocketoption: READONLY  */
#line 1312 "src/p.y"
                             {
                        Run.httpd.socket.unix.readonly = true;
                    }
#line 4274 "src/y.tab.c"
    break;

  case 340: /* signature: sigenable  */
#line 1325 "src/p.y"
                             {
                        Run.httpd.flags |= Httpd_Signature;
                  }
#line 4282 "src/y.tab.c"
    break;

  case 341: /* signature: sigdisable  */
#line 1328 "src/p.y"
                             {
                        Run.httpd.flags &= ~Httpd_Signature;
                  }
#line 4290 "src/y.tab.c"
    break;

  case 342: /* bindaddress: ADDRESS STRING  */
#line 1333 "src/p.y"
                                 {
                        if (Run.httpd.socket.net.address) {
                                yywarning2("The 'address' option can be specified only once, the last value will be used\n");
                                FREE(Run.httpd.socket.net.address);
                        }
                        Run.httpd.socket.net.address = (yyvsp[0].string);
                  }
#line 4302 "src/y.tab.c"
    break;

  case 343: /* allow: ALLOW STRING ':' STRING readonly  */
#line 1342 "src/p.y"
                                                 {
                        addcredentials((yyvsp[-3].string), (yyvsp[-1].string), Digest_Cleartext, (yyvsp[0].number));
                  }
#line 4310 "src/y.tab.c"
    break;

  case 344: /* allow: ALLOW '@' STRING readonly  */
#line 1345 "src/p.y"
                                           {
#ifdef HAVE_LIBPAM
                        addpamauth((yyvsp[-1].string), (yyvsp[0].number));
#else
                        yyerror("PAM is not supported");
                        FREE((yyvsp[-1].string));
#endif
                  }
#line 4323 "src/y.tab.c"
    break;

  case 345: /* allow: ALLOW PATH  */
#line 1353 "src/p.y"
                             {
                        addhtpasswdentry((yyvsp[0].string), NULL, Digest_Cleartext);
                        FREE((yyvsp[0].string));
                  }
#line 4332 "src/y.tab.c"
    break;

  case 346: /* allow: ALLOW CLEARTEXT PATH  */
#line 1357 "src/p.y"
                                       {
                        addhtpasswdentry((yyvsp[0].string), NULL, Digest_Cleartext);
                        FREE((yyvsp[0].string));
                  }
#line 4341 "src/y.tab.c"
    break;

  case 347: /* allow: ALLOW MD5HASH PATH  */
#line 1361 "src/p.y"
                                     {
                        addhtpasswdentry((yyvsp[0].string), NULL, Digest_Md5);
                        FREE((yyvsp[0].string));
                  }
#line 4350 "src/y.tab.c"
    break;

  case 348: /* allow: ALLOW CRYPT PATH  */
#line 1365 "src/p.y"
                                   {
                        addhtpasswdentry((yyvsp[0].string), NULL, Digest_Crypt);
                        FREE((yyvsp[0].string));
                  }
#line 4359 "src/y.tab.c"
    break;

  case 349: /* $@1: %empty  */
#line 1369 "src/p.y"
                             {
                        htpasswd_file = (yyvsp[0].string);
                        digesttype = Digest_Cleartext;
                  }
#line 4368 "src/y.tab.c"
    break;

  case 350: /* allow: ALLOW PATH $@1 allowuserlist  */
#line 1373 "src/p.y"
                                {
                        FREE(htpasswd_file);
                  }
#line 4376 "src/y.tab.c"
    break;

  case 351: /* $@2: %empty  */
#line 1376 "src/p.y"
                                       {
                        htpasswd_file = (yyvsp[0].string);
                        digesttype = Digest_Cleartext;
                  }
#line 4385 "src/y.tab.c"
    break;

  case 352: /* allow: ALLOW CLEARTEXT PATH $@2 allowuserlist  */
#line 1380 "src/p.y"
                                {
                        FREE(htpasswd_file);
                  }
#line 4393 "src/y.tab.c"
    break;

  case 353: /* $@3: %empty  */
#line 1383 "src/p.y"
                                     {
                        htpasswd_file = (yyvsp[0].string);
                        digesttype = Digest_Md5;
                  }
#line 4402 "src/y.tab.c"
    break;

  case 354: /* allow: ALLOW MD5HASH PATH $@3 allowuserlist  */
#line 1387 "src/p.y"
                                {
                        FREE(htpasswd_file);
                  }
#line 4410 "src/y.tab.c"
    break;

  case 355: /* $@4: %empty  */
#line 1390 "src/p.y"
                                   {
                        htpasswd_file = (yyvsp[0].string);
                        digesttype = Digest_Crypt;
                  }
#line 4419 "src/y.tab.c"
    break;

  case 356: /* allow: ALLOW CRYPT PATH $@4 allowuserlist  */
#line 1394 "src/p.y"
                                {
                        FREE(htpasswd_file);
                  }
#line 4427 "src/y.tab.c"
    break;

  case 357: /* allow: ALLOW STRING  */
#line 1397 "src/p.y"
                               {
                        if (! Engine_addAllow((yyvsp[0].string)))
                                yywarning2("invalid allow option: %s", (yyvsp[0].string));
                        FREE((yyvsp[0].string));
                  }
#line 4437 "src/y.tab.c"
    break;

  case 360: /* allowuser: STRING  */
#line 1408 "src/p.y"
                         {
                        addhtpasswdentry(htpasswd_file, (yyvsp[0].string), digesttype);
                        FREE((yyvsp[0].string));
                  }
#line 4446 "src/y.tab.c"
    break;

  case 361: /* readonly: %empty  */
#line 1414 "src/p.y"
                              {
                        (yyval.number) = false;
                  }
#line 4454 "src/y.tab.c"
    break;

  case 362: /* readonly: READONLY  */
#line 1417 "src/p.y"
                           {
                        (yyval.number) = true;
                  }
#line 4462 "src/y.tab.c"
    break;

  case 363: /* checkproc: CHECKPROC SERVICENAME PIDFILE PATH  */
#line 1422 "src/p.y"
                                                     {
                        createservice(Service_Process, (yyvsp[-2].string), (yyvsp[0].string), check_process);
                  }
#line 4470 "src/y.tab.c"
    break;

  case 364: /* checkproc: CHECKPROC SERVICENAME PATHTOK PATH  */
#line 1425 "src/p.y"
                                                     {
                        createservice(Service_Process, (yyvsp[-2].string), (yyvsp[0].string), check_process);
                  }
#line 4478 "src/y.tab.c"
    break;

  case 365: /* checkproc: CHECKPROC SERVICENAME REGEXMATCH STRING  */
#line 1428 "src/p.y"
                                                          {
                        createservice(Service_Process, (yyvsp[-2].string), (yyvsp[0].string), check_process);
                        matchset.ignore = false;
                        matchset.match_path = NULL;
                        matchset.match_string = Str_dup((yyvsp[0].string));
                        addmatch(&matchset, Action_Ignored, 0);
                  }
#line 4490 "src/y.tab.c"
    break;

  case 366: /* checkproc: CHECKPROC SERVICENAME REGEXMATCH PATH  */
#line 1435 "src/p.y"
                                                        {
                        createservice(Service_Process, (yyvsp[-2].string), (yyvsp[0].string), check_process);
                        matchset.ignore = false;
                        matchset.match_path = NULL;
                        matchset.match_string = Str_dup((yyvsp[0].string));
                        addmatch(&matchset, Action_Ignored, 0);
                  }
#line 4502 "src/y.tab.c"
    break;

  case 367: /* checkfile: CHECKFILE SERVICENAME PATHTOK PATH  */
#line 1444 "src/p.y"
                                                     {
                        createservice(Service_File, (yyvsp[-2].string), (yyvsp[0].string), check_file);
                  }
#line 4510 "src/y.tab.c"
    break;

  case 368: /* checkfilesys: CHECKFILESYS SERVICENAME PATHTOK PATH  */
#line 1449 "src/p.y"
                                                        {
                        createservice(Service_Filesystem, (yyvsp[-2].string), (yyvsp[0].string), check_filesystem);
                  }
#line 4518 "src/y.tab.c"
    break;

  case 369: /* checkfilesys: CHECKFILESYS SERVICENAME PATHTOK STRING  */
#line 1452 "src/p.y"
                                                          {
                        createservice(Service_Filesystem, (yyvsp[-2].string), (yyvsp[0].string), check_filesystem);
                  }
#line 4526 "src/y.tab.c"
    break;

  case 370: /* checkdir: CHECKDIR SERVICENAME PATHTOK PATH  */
#line 1457 "src/p.y"
                                                    {
                        createservice(Service_Directory, (yyvsp[-2].string), (yyvsp[0].string), check_directory);
                  }
#line 4534 "src/y.tab.c"
    break;

  case 371: /* checkhost: CHECKHOST SERVICENAME ADDRESS STRING  */
#line 1462 "src/p.y"
                                                       {
                        createservice(Service_Host, (yyvsp[-2].string), (yyvsp[0].string), check_remote_host);
                  }
#line 4542 "src/y.tab.c"
    break;

  case 372: /* checknet: CHECKNET SERVICENAME ADDRESS STRING  */
#line 1467 "src/p.y"
                                                      {
                        if (Link_isGetByAddressSupported()) {
                                createservice(Service_Net, (yyvsp[-2].string), (yyvsp[0].string), check_net);
                                current->inf.net->stats = Link_createForAddress((yyvsp[0].string));
                        } else {
                                yyerror("Network monitoring by IP address is not supported on this platform, please use 'check network <foo> with interface <bar>' instead");
                        }
                  }
#line 4555 "src/y.tab.c"
    break;

  case 373: /* checknet: CHECKNET SERVICENAME INTERFACE STRING  */
#line 1475 "src/p.y"
                                                        {
                        createservice(Service_Net, (yyvsp[-2].string), (yyvsp[0].string), check_net);
                        current->inf.net->stats = Link_createForInterface((yyvsp[0].string));
                  }
#line 4564 "src/y.tab.c"
    break;

  case 374: /* checksystem: CHECKSYSTEM SERVICENAME  */
#line 1481 "src/p.y"
                                          {
                        char *servicename = (yyvsp[0].string);
                        if (Str_sub(servicename, "$HOST")) {
                                char hostname[STRLEN];
                                if (gethostname(hostname, sizeof(hostname))) {
                                        Log_error("System hostname error -- %s\n", STRERROR);
                                        cfg_errflag++;
                                } else {
                                        Util_replaceString(&servicename, "$HOST", hostname);
                                }
                        }
                        Run.system = createservice(Service_System, servicename, NULL, check_system); // The name given in the 'check system' statement overrides system hostname
                  }
#line 4582 "src/y.tab.c"
    break;

  case 375: /* checkfifo: CHECKFIFO SERVICENAME PATHTOK PATH  */
#line 1496 "src/p.y"
                                                     {
                        createservice(Service_Fifo, (yyvsp[-2].string), (yyvsp[0].string), check_fifo);
                  }
#line 4590 "src/y.tab.c"
    break;

  case 376: /* checkprogram: CHECKPROGRAM SERVICENAME PATHTOK argumentlist programtimeout  */
#line 1501 "src/p.y"
                                                                               {
                        createservice(Service_Program, (yyvsp[-3].string), NULL, check_program);
                        current->program->timeout = (yyvsp[0].number);
                        current->program->lastOutput = StringBuffer_create(64);
                        current->program->inprogressOutput = StringBuffer_create(64);
                 }
#line 4601 "src/y.tab.c"
    break;

  case 377: /* checkprogram: CHECKPROGRAM SERVICENAME PATHTOK argumentlist useroptionlist programtimeout  */
#line 1507 "src/p.y"
                                                                                              {
                        createservice(Service_Program, (yyvsp[-4].string), NULL, check_program);
                        current->program->timeout = (yyvsp[0].number);
                        current->program->lastOutput = StringBuffer_create(64);
                        current->program->inprogressOutput = StringBuffer_create(64);
                 }
#line 4612 "src/y.tab.c"
    break;

  case 378: /* start: START argumentlist starttimeout  */
#line 1515 "src/p.y"
                                                  {
                        addcommand(START, (yyvsp[0].number));
                  }
#line 4620 "src/y.tab.c"
    break;

  case 379: /* start: START argumentlist useroptionlist starttimeout  */
#line 1518 "src/p.y"
                                                                 {
                        addcommand(START, (yyvsp[0].number));
                  }
#line 4628 "src/y.tab.c"
    break;

  case 380: /* stop: STOP argumentlist stoptimeout  */
#line 1523 "src/p.y"
                                                {
                        addcommand(STOP, (yyvsp[0].number));
                  }
#line 4636 "src/y.tab.c"
    break;

  case 381: /* stop: STOP argumentlist useroptionlist stoptimeout  */
#line 1526 "src/p.y"
                                                               {
                        addcommand(STOP, (yyvsp[0].number));
                  }
#line 4644 "src/y.tab.c"
    break;

  case 382: /* restart: RESTART argumentlist restarttimeout  */
#line 1532 "src/p.y"
                                                      {
                        addcommand(RESTART, (yyvsp[0].number));
                  }
#line 4652 "src/y.tab.c"
    break;

  case 383: /* restart: RESTART argumentlist useroptionlist restarttimeout  */
#line 1535 "src/p.y"
                                                                     {
                        addcommand(RESTART, (yyvsp[0].number));
                  }
#line 4660 "src/y.tab.c"
    break;

  case 388: /* argument: STRING  */
#line 1548 "src/p.y"
                         {
                        addargument((yyvsp[0].string));
                  }
#line 4668 "src/y.tab.c"
    break;

  case 389: /* argument: PATH  */
#line 1551 "src/p.y"
                       {
                        addargument((yyvsp[0].string));
                  }
#line 4676 "src/y.tab.c"
    break;

  case 390: /* useroption: UID STRING  */
#line 1556 "src/p.y"
                             {
                        addeuid(get_uid((yyvsp[0].string), 0));
                        FREE((yyvsp[0].string));
                  }
#line 4685 "src/y.tab.c"
    break;

  case 391: /* useroption: GID STRING  */
#line 1560 "src/p.y"
                             {
                        addegid(get_gid((yyvsp[0].string), 0));
                        FREE((yyvsp[0].string));
                  }
#line 4694 "src/y.tab.c"
    break;

  case 392: /* useroption: UID NUMBER  */
#line 1564 "src/p.y"
                             {
                        addeuid(get_uid(NULL, (yyvsp[0].number)));
                  }
#line 4702 "src/y.tab.c"
    break;

  case 393: /* useroption: GID NUMBER  */
#line 1567 "src/p.y"
                             {
                        addegid(get_gid(NULL, (yyvsp[0].number)));
                  }
#line 4710 "src/y.tab.c"
    break;

  case 394: /* username: USERNAME MAILADDR  */
#line 1572 "src/p.y"
                                    {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 4718 "src/y.tab.c"
    break;

  case 395: /* username: USERNAME STRING  */
#line 1575 "src/p.y"
                                  {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 4726 "src/y.tab.c"
    break;

  case 396: /* password: PASSWORD STRING  */
#line 1580 "src/p.y"
                                  {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 4734 "src/y.tab.c"
    break;

  case 397: /* database: DATABASE STRING  */
#line 1585 "src/p.y"
                                  {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 4742 "src/y.tab.c"
    break;

  case 398: /* hostname: %empty  */
#line 1590 "src/p.y"
                                  {
                        (yyval.string) = NULL;
                  }
#line 4750 "src/y.tab.c"
    break;

  case 399: /* hostname: HOSTNAME STRING  */
#line 1593 "src/p.y"
                                  {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 4758 "src/y.tab.c"
    break;

  case 400: /* connection: IF FAILED host port connectionoptlist rate1 THEN action1 recovery_success  */
#line 1598 "src/p.y"
                                                                                            {
                        /* This is a workaround to support content match without having to create an URL object. 'urloption' creates the Request_T object we need minus the URL object, but with enough information to perform content test.
                           TODO: Parser is in need of refactoring */
                        portset.url_request = urlrequest;
                        portset.check_invers = false;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->portlist), &portset);
                  }
#line 4773 "src/y.tab.c"
    break;

  case 401: /* connection: IF SUCCEEDED host port connectionoptlist rate1 THEN action1 recovery_failure  */
#line 1608 "src/p.y"
                                                                                               {
                        portset.url_request = urlrequest;
                        portset.check_invers = true;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->portlist), &portset);
                  }
#line 4786 "src/y.tab.c"
    break;

  case 416: /* connectionurl: IF FAILED URL URLOBJECT connectionurloptlist rate1 THEN action1 recovery_success  */
#line 1636 "src/p.y"
                                                                                                   {
                        portset.check_invers = false;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        prepare_urlrequest((yyvsp[-5].url));
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->portlist), &portset);
                  }
#line 4799 "src/y.tab.c"
    break;

  case 417: /* connectionurl: IF SUCCEEDED URL URLOBJECT connectionurloptlist rate1 THEN action1 recovery_failure  */
#line 1644 "src/p.y"
                                                                                                      {
                        portset.check_invers = true;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        prepare_urlrequest((yyvsp[-5].url));
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->portlist), &portset);
                  }
#line 4812 "src/y.tab.c"
    break;

  case 426: /* connectionunix: IF FAILED unixsocket connectionuxoptlist rate1 THEN action1 recovery_success  */
#line 1666 "src/p.y"
                                                                                               {
                        portset.check_invers = false;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->socketlist), &portset);
                  }
#line 4824 "src/y.tab.c"
    break;

  case 427: /* connectionunix: IF SUCCEEDED unixsocket connectionuxoptlist rate1 THEN action1 recovery_failure  */
#line 1673 "src/p.y"
                                                                                                  {
                        portset.check_invers = true;
                        portset.responsetime.operator = responsetimeset.operator;
                        portset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(portset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addport(&(current->socketlist), &portset);
                  }
#line 4836 "src/y.tab.c"
    break;

  case 436: /* icmp: IF FAILED ICMP icmptype icmpoptlist rate1 THEN action1 recovery_success  */
#line 1694 "src/p.y"
                                                                                          {
                        icmpset.family = Socket_Ip;
                        icmpset.check_invers = false;
                        icmpset.type = (yyvsp[-5].number);
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                  }
#line 4850 "src/y.tab.c"
    break;

  case 437: /* icmp: IF FAILED PING icmpoptlist rate1 THEN action1 recovery_success  */
#line 1703 "src/p.y"
                                                                                 {
                        icmpset.family = Socket_Ip;
                        icmpset.check_invers = false;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4863 "src/y.tab.c"
    break;

  case 438: /* icmp: IF FAILED PING4 icmpoptlist rate1 THEN action1 recovery_success  */
#line 1711 "src/p.y"
                                                                                  {
                        icmpset.family = Socket_Ip4;
                        icmpset.check_invers = false;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4876 "src/y.tab.c"
    break;

  case 439: /* icmp: IF FAILED PING6 icmpoptlist rate1 THEN action1 recovery_success  */
#line 1719 "src/p.y"
                                                                                  {
                        icmpset.family = Socket_Ip6;
                        icmpset.check_invers = false;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4889 "src/y.tab.c"
    break;

  case 440: /* icmp: IF SUCCEEDED ICMP icmptype icmpoptlist rate1 THEN action1 recovery_failure  */
#line 1727 "src/p.y"
                                                                                             {
                        icmpset.family = Socket_Ip;
                        icmpset.check_invers = true;
                        icmpset.type = (yyvsp[-5].number);
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                  }
#line 4903 "src/y.tab.c"
    break;

  case 441: /* icmp: IF SUCCEEDED PING icmpoptlist rate1 THEN action1 recovery_failure  */
#line 1736 "src/p.y"
                                                                                    {
                        icmpset.family = Socket_Ip;
                        icmpset.check_invers = true;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4916 "src/y.tab.c"
    break;

  case 442: /* icmp: IF SUCCEEDED PING4 icmpoptlist rate1 THEN action1 recovery_failure  */
#line 1744 "src/p.y"
                                                                                     {
                        icmpset.family = Socket_Ip4;
                        icmpset.check_invers = true;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4929 "src/y.tab.c"
    break;

  case 443: /* icmp: IF SUCCEEDED PING6 icmpoptlist rate1 THEN action1 recovery_failure  */
#line 1752 "src/p.y"
                                                                                     {
                        icmpset.family = Socket_Ip6;
                        icmpset.check_invers = true;
                        icmpset.responsetime.operator = responsetimeset.operator;
                        icmpset.responsetime.limit = responsetimeset.limit;
                        addeventaction(&(icmpset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addicmp(&icmpset);
                 }
#line 4942 "src/y.tab.c"
    break;

  case 451: /* host: %empty  */
#line 1773 "src/p.y"
                              {
                        portset.hostname = Str_dup(current->type == Service_Host ? current->path : LOCALHOST);
                  }
#line 4950 "src/y.tab.c"
    break;

  case 452: /* host: HOST STRING  */
#line 1776 "src/p.y"
                              {
                        portset.hostname = (yyvsp[0].string);
                  }
#line 4958 "src/y.tab.c"
    break;

  case 453: /* port: PORT NUMBER  */
#line 1781 "src/p.y"
                              {
                        portset.target.net.port = (yyvsp[0].number);
                  }
#line 4966 "src/y.tab.c"
    break;

  case 454: /* unixsocket: UNIXSOCKET PATH  */
#line 1786 "src/p.y"
                                  {
                        portset.family = Socket_Unix;
                        portset.target.unix.pathname = (yyvsp[0].string);
                  }
#line 4975 "src/y.tab.c"
    break;

  case 455: /* ip: IPV4  */
#line 1792 "src/p.y"
                       {
                        portset.family = Socket_Ip4;
                  }
#line 4983 "src/y.tab.c"
    break;

  case 456: /* ip: IPV6  */
#line 1795 "src/p.y"
                       {
                        portset.family = Socket_Ip6;
                  }
#line 4991 "src/y.tab.c"
    break;

  case 457: /* type: TYPE TCP  */
#line 1800 "src/p.y"
                           {
                        portset.type = Socket_Tcp;
                  }
#line 4999 "src/y.tab.c"
    break;

  case 458: /* type: TYPE TCPSSL typeoptlist  */
#line 1803 "src/p.y"
                                          { // The typelist is kept for backward compatibility (replaced by ssloptionlist)
                        yydeprecated("'type tcpssl' is deprecated, use 'type tcp' and 'with ssl { ... }' or the secure protocol version like 'protocol https' instead");
                        portset.type = Socket_Tcp;
                        sslset.flags = SSL_Enabled;
                  }
#line 5009 "src/y.tab.c"
    break;

  case 459: /* type: TYPE UDP  */
#line 1808 "src/p.y"
                           {
                        portset.type = Socket_Udp;
                  }
#line 5017 "src/y.tab.c"
    break;

  case 464: /* outgoing: ADDRESS STRING  */
#line 1821 "src/p.y"
                                 {
                        _parseOutgoingAddress((yyvsp[0].string), &(portset.outgoing));
                  }
#line 5025 "src/y.tab.c"
    break;

  case 465: /* protocol: PROTOCOL APACHESTATUS apache_stat_list  */
#line 1826 "src/p.y"
                                                         {
                        portset.protocol = Protocol_get(Protocol_APACHESTATUS);
                  }
#line 5033 "src/y.tab.c"
    break;

  case 466: /* protocol: PROTOCOL CLAMAV  */
#line 1829 "src/p.y"
                                  {
                        portset.protocol = Protocol_get(Protocol_CLAMAV);
                  }
#line 5041 "src/y.tab.c"
    break;

  case 467: /* protocol: PROTOCOL DEFAULT  */
#line 1832 "src/p.y"
                                   {
                        portset.protocol = Protocol_get(Protocol_DEFAULT);
                  }
#line 5049 "src/y.tab.c"
    break;

  case 468: /* protocol: PROTOCOL DNS  */
#line 1835 "src/p.y"
                               {
                        portset.protocol = Protocol_get(Protocol_DNS);
                  }
#line 5057 "src/y.tab.c"
    break;

  case 469: /* protocol: PROTOCOL DWP  */
#line 1838 "src/p.y"
                                {
                        portset.protocol = Protocol_get(Protocol_DWP);
                  }
#line 5065 "src/y.tab.c"
    break;

  case 470: /* protocol: PROTOCOL FAIL2BAN  */
#line 1841 "src/p.y"
                                    {
                        portset.protocol = Protocol_get(Protocol_FAIL2BAN);
                }
#line 5073 "src/y.tab.c"
    break;

  case 471: /* protocol: PROTOCOL FTP  */
#line 1844 "src/p.y"
                               {
                        portset.protocol = Protocol_get(Protocol_FTP);
                  }
#line 5081 "src/y.tab.c"
    break;

  case 472: /* protocol: PROTOCOL GPS  */
#line 1847 "src/p.y"
                               {
                        portset.protocol = Protocol_get(Protocol_GPS);
                  }
#line 5089 "src/y.tab.c"
    break;

  case 473: /* protocol: PROTOCOL HTTP httplist  */
#line 1850 "src/p.y"
                                         {
                        portset.protocol = Protocol_get(Protocol_HTTP);
                  }
#line 5097 "src/y.tab.c"
    break;

  case 474: /* protocol: PROTOCOL HTTPS httplist  */
#line 1853 "src/p.y"
                                          {
                        sslset.flags = SSL_Enabled;
                        portset.type = Socket_Tcp;
                        portset.protocol = Protocol_get(Protocol_HTTP);
                 }
#line 5107 "src/y.tab.c"
    break;

  case 475: /* protocol: PROTOCOL IMAP  */
#line 1858 "src/p.y"
                                {
                        portset.protocol = Protocol_get(Protocol_IMAP);
                  }
#line 5115 "src/y.tab.c"
    break;

  case 476: /* protocol: PROTOCOL IMAPS  */
#line 1861 "src/p.y"
                                 {
                        sslset.flags = SSL_Enabled;
                        portset.type = Socket_Tcp;
                        portset.protocol = Protocol_get(Protocol_IMAP);
                  }
#line 5125 "src/y.tab.c"
    break;

  case 477: /* protocol: PROTOCOL LDAP2  */
#line 1866 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_LDAP2);
                  }
#line 5133 "src/y.tab.c"
    break;

  case 478: /* protocol: PROTOCOL LDAP3  */
#line 1869 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_LDAP3);
                  }
#line 5141 "src/y.tab.c"
    break;

  case 479: /* protocol: PROTOCOL LMTP  */
#line 1872 "src/p.y"
                                {
                        portset.protocol = Protocol_get(Protocol_LMTP);
                  }
#line 5149 "src/y.tab.c"
    break;

  case 480: /* protocol: PROTOCOL MEMCACHE  */
#line 1875 "src/p.y"
                                    {
                        portset.protocol = Protocol_get(Protocol_MEMCACHE);
                  }
#line 5157 "src/y.tab.c"
    break;

  case 481: /* protocol: PROTOCOL MONGODB  */
#line 1878 "src/p.y"
                                    {
                        portset.protocol = Protocol_get(Protocol_MONGODB);
                  }
#line 5165 "src/y.tab.c"
    break;

  case 482: /* protocol: PROTOCOL MQTT mqttlist  */
#line 1881 "src/p.y"
                                         {
                        portset.protocol = Protocol_get(Protocol_MQTT);
                  }
#line 5173 "src/y.tab.c"
    break;

  case 483: /* protocol: PROTOCOL MYSQL mysqllist  */
#line 1884 "src/p.y"
                                           {
                        portset.protocol = Protocol_get(Protocol_MYSQL);
                  }
#line 5181 "src/y.tab.c"
    break;

  case 484: /* protocol: PROTOCOL MYSQLS mysqllist  */
#line 1887 "src/p.y"
                                            {
                        sslset.flags = SSL_StartTLS;
                        portset.protocol = Protocol_get(Protocol_MYSQL);
                  }
#line 5190 "src/y.tab.c"
    break;

  case 485: /* protocol: PROTOCOL NNTP  */
#line 1891 "src/p.y"
                                {
                        portset.protocol = Protocol_get(Protocol_NNTP);
                  }
#line 5198 "src/y.tab.c"
    break;

  case 486: /* protocol: PROTOCOL NTP3  */
#line 1894 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_NTP3);
                        portset.type = Socket_Udp;
                  }
#line 5207 "src/y.tab.c"
    break;

  case 487: /* protocol: PROTOCOL PGSQL postgresqllist  */
#line 1898 "src/p.y"
                                                {
                        portset.protocol = Protocol_get(Protocol_PGSQL);
                  }
#line 5215 "src/y.tab.c"
    break;

  case 488: /* protocol: PROTOCOL POP  */
#line 1901 "src/p.y"
                               {
                        portset.protocol = Protocol_get(Protocol_POP);
                  }
#line 5223 "src/y.tab.c"
    break;

  case 489: /* protocol: PROTOCOL POPS  */
#line 1904 "src/p.y"
                                {
                        sslset.flags = SSL_Enabled;
                        portset.type = Socket_Tcp;
                        portset.protocol = Protocol_get(Protocol_POP);
                  }
#line 5233 "src/y.tab.c"
    break;

  case 490: /* protocol: PROTOCOL POSTFIXPOLICY  */
#line 1909 "src/p.y"
                                         {
                        portset.protocol = Protocol_get(Protocol_POSTFIXPOLICY);
                  }
#line 5241 "src/y.tab.c"
    break;

  case 491: /* protocol: PROTOCOL RADIUS radiuslist  */
#line 1912 "src/p.y"
                                             {
                        portset.protocol = Protocol_get(Protocol_RADIUS);
                  }
#line 5249 "src/y.tab.c"
    break;

  case 492: /* protocol: PROTOCOL RDATE  */
#line 1915 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_RDATE);
                  }
#line 5257 "src/y.tab.c"
    break;

  case 493: /* protocol: PROTOCOL REDIS  */
#line 1918 "src/p.y"
                                  {
                        portset.protocol = Protocol_get(Protocol_REDIS);
                  }
#line 5265 "src/y.tab.c"
    break;

  case 494: /* protocol: PROTOCOL RSYNC  */
#line 1921 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_RSYNC);
                  }
#line 5273 "src/y.tab.c"
    break;

  case 495: /* protocol: PROTOCOL SIEVE  */
#line 1924 "src/p.y"
                                 {
                        portset.protocol = Protocol_get(Protocol_SIEVE);
                  }
#line 5281 "src/y.tab.c"
    break;

  case 496: /* protocol: PROTOCOL SIP siplist  */
#line 1927 "src/p.y"
                                       {
                        portset.protocol = Protocol_get(Protocol_SIP);
                  }
#line 5289 "src/y.tab.c"
    break;

  case 497: /* protocol: PROTOCOL SMTP smtplist  */
#line 1930 "src/p.y"
                                         {
                        portset.protocol = Protocol_get(Protocol_SMTP);
                  }
#line 5297 "src/y.tab.c"
    break;

  case 498: /* protocol: PROTOCOL SMTPS smtplist  */
#line 1933 "src/p.y"
                                          {
                        sslset.flags = SSL_Enabled;
                        portset.type = Socket_Tcp;
                        portset.protocol = Protocol_get(Protocol_SMTP);
                 }
#line 5307 "src/y.tab.c"
    break;

  case 499: /* protocol: PROTOCOL SPAMASSASSIN  */
#line 1938 "src/p.y"
                                        {
                        portset.protocol = Protocol_get(Protocol_SPAMASSASSIN);
                  }
#line 5315 "src/y.tab.c"
    break;

  case 500: /* protocol: PROTOCOL SSH  */
#line 1941 "src/p.y"
                                {
                        portset.protocol = Protocol_get(Protocol_SSH);
                  }
#line 5323 "src/y.tab.c"
    break;

  case 501: /* protocol: PROTOCOL TNS  */
#line 1944 "src/p.y"
                               {
                        portset.protocol = Protocol_get(Protocol_TNS);
                  }
#line 5331 "src/y.tab.c"
    break;

  case 502: /* protocol: PROTOCOL WEBSOCKET websocketlist  */
#line 1947 "src/p.y"
                                                   {
                        portset.protocol = Protocol_get(Protocol_WEBSOCKET);
                  }
#line 5339 "src/y.tab.c"
    break;

  case 503: /* sendexpect: SEND STRING  */
#line 1952 "src/p.y"
                              {
                        if (portset.protocol->check == check_default || portset.protocol->check == check_generic) {
                                portset.protocol = Protocol_get(Protocol_GENERIC);
                                addgeneric(&portset, (yyvsp[0].string), NULL);
                        } else {
                                yyerror("The SEND statement is not allowed in the %s protocol context", portset.protocol->name);
                        }
                  }
#line 5352 "src/y.tab.c"
    break;

  case 504: /* sendexpect: EXPECT STRING  */
#line 1960 "src/p.y"
                                {
                        if (portset.protocol->check == check_default || portset.protocol->check == check_generic) {
                                portset.protocol = Protocol_get(Protocol_GENERIC);
                                addgeneric(&portset, NULL, (yyvsp[0].string));
                        } else {
                                yyerror("The EXPECT statement is not allowed in the %s protocol context", portset.protocol->name);
                        }
                  }
#line 5365 "src/y.tab.c"
    break;

  case 507: /* websocket: ORIGIN STRING  */
#line 1974 "src/p.y"
                                {
                        portset.parameters.websocket.origin = (yyvsp[0].string);
                  }
#line 5373 "src/y.tab.c"
    break;

  case 508: /* websocket: REQUEST PATH  */
#line 1977 "src/p.y"
                               {
                        portset.parameters.websocket.request = (yyvsp[0].string);
                  }
#line 5381 "src/y.tab.c"
    break;

  case 509: /* websocket: HOST STRING  */
#line 1980 "src/p.y"
                              {
                        portset.parameters.websocket.host = (yyvsp[0].string);
                  }
#line 5389 "src/y.tab.c"
    break;

  case 510: /* websocket: VERSIONOPT NUMBER  */
#line 1983 "src/p.y"
                                    {
                        portset.parameters.websocket.version = (yyvsp[0].number);
                  }
#line 5397 "src/y.tab.c"
    break;

  case 513: /* smtp: username  */
#line 1992 "src/p.y"
                           {
                        portset.parameters.smtp.username = (yyvsp[0].string);
                  }
#line 5405 "src/y.tab.c"
    break;

  case 514: /* smtp: password  */
#line 1995 "src/p.y"
                           {
                        portset.parameters.smtp.password = (yyvsp[0].string);
                  }
#line 5413 "src/y.tab.c"
    break;

  case 517: /* mqtt: username  */
#line 2004 "src/p.y"
                           {
                        portset.parameters.mqtt.username = (yyvsp[0].string);
                  }
#line 5421 "src/y.tab.c"
    break;

  case 518: /* mqtt: password  */
#line 2007 "src/p.y"
                           {
                        portset.parameters.mqtt.password = (yyvsp[0].string);
                  }
#line 5429 "src/y.tab.c"
    break;

  case 521: /* mysql: username  */
#line 2016 "src/p.y"
                           {
                        portset.parameters.mysql.username = (yyvsp[0].string);
                  }
#line 5437 "src/y.tab.c"
    break;

  case 522: /* mysql: password  */
#line 2019 "src/p.y"
                           {
                        portset.parameters.mysql.password = (yyvsp[0].string);
                  }
#line 5445 "src/y.tab.c"
    break;

  case 523: /* mysql: RSAKEY CHECKSUM checksumoperator STRING  */
#line 2022 "src/p.y"
                                                          {
                        portset.parameters.mysql.rsaChecksum = (yyvsp[0].string);
                        switch (cleanup_hash_string(portset.parameters.mysql.rsaChecksum)) {
                                case 32:
                                        portset.parameters.mysql.rsaChecksumType = Hash_Md5;
                                        break;
                                case 40:
                                        portset.parameters.mysql.rsaChecksumType = Hash_Sha1;
                                        break;
                                case 64:
                                        portset.parameters.mysql.rsaChecksumType = Hash_Sha256;
                                        break;
                                default:
                                        yyerror2("Unknown checksum type: [%s] is not MD5, SHA1, nor SHA256", portset.parameters.mysql.rsaChecksum);
                        }
                  }
#line 5466 "src/y.tab.c"
    break;

  case 524: /* mysql: RSAKEY CHECKSUM MD5HASH checksumoperator STRING  */
#line 2038 "src/p.y"
                                                                  {
                        portset.parameters.mysql.rsaChecksum = (yyvsp[0].string);
                        if (cleanup_hash_string(portset.parameters.mysql.rsaChecksum) != 32)
                                yyerror2("Unknown checksum type: [%s] is not MD5", portset.parameters.mysql.rsaChecksum);
                        portset.parameters.mysql.rsaChecksumType = Hash_Md5;
                  }
#line 5477 "src/y.tab.c"
    break;

  case 525: /* mysql: RSAKEY CHECKSUM SHA1HASH checksumoperator STRING  */
#line 2044 "src/p.y"
                                                                   {
                        portset.parameters.mysql.rsaChecksum = (yyvsp[0].string);
                        if (cleanup_hash_string(portset.parameters.mysql.rsaChecksum) != 40)
                                yyerror2("Unknown checksum type: [%s] is not SHA1", portset.parameters.mysql.rsaChecksum);
                        portset.parameters.mysql.rsaChecksumType = Hash_Sha1;
                  }
#line 5488 "src/y.tab.c"
    break;

  case 526: /* mysql: RSAKEY CHECKSUM SHA256HASH checksumoperator STRING  */
#line 2050 "src/p.y"
                                                                     {
                        portset.parameters.mysql.rsaChecksum = (yyvsp[0].string);
                        if (cleanup_hash_string(portset.parameters.mysql.rsaChecksum) != 64)
                                yyerror2("Unknown checksum type: [%s] is not SHA256", portset.parameters.mysql.rsaChecksum);
                        portset.parameters.mysql.rsaChecksumType = Hash_Sha256;
                  }
#line 5499 "src/y.tab.c"
    break;

  case 529: /* postgresql: username  */
#line 2062 "src/p.y"
                           {
                        portset.parameters.postgresql.username = (yyvsp[0].string);
                  }
#line 5507 "src/y.tab.c"
    break;

  case 530: /* postgresql: password  */
#line 2065 "src/p.y"
                           {
                        portset.parameters.postgresql.password = (yyvsp[0].string);
                  }
#line 5515 "src/y.tab.c"
    break;

  case 531: /* postgresql: database  */
#line 2068 "src/p.y"
                           {
                        portset.parameters.postgresql.database = (yyvsp[0].string);
                  }
#line 5523 "src/y.tab.c"
    break;

  case 534: /* sip: TARGET MAILADDR  */
#line 2077 "src/p.y"
                                  {
                        portset.parameters.sip.target = (yyvsp[0].string);
                  }
#line 5531 "src/y.tab.c"
    break;

  case 535: /* sip: TARGET STRING  */
#line 2080 "src/p.y"
                                {
                        portset.parameters.sip.target = (yyvsp[0].string);
                  }
#line 5539 "src/y.tab.c"
    break;

  case 536: /* sip: MAXFORWARD NUMBER  */
#line 2083 "src/p.y"
                                    {
                        portset.parameters.sip.maxforward = verifyMaxForward((yyvsp[0].number));
                  }
#line 5547 "src/y.tab.c"
    break;

  case 539: /* http: username  */
#line 2092 "src/p.y"
                           {
                        portset.parameters.http.username = (yyvsp[0].string);
                  }
#line 5555 "src/y.tab.c"
    break;

  case 540: /* http: password  */
#line 2095 "src/p.y"
                           {
                        portset.parameters.http.password = (yyvsp[0].string);
                  }
#line 5563 "src/y.tab.c"
    break;

  case 547: /* status: STATUS operator NUMBER  */
#line 2106 "src/p.y"
                                         {
                        if ((yyvsp[0].number) < 0) {
                                yyerror2("The status value must be greater or equal to 0");
                        }
                        portset.parameters.http.operator = (yyvsp[-1].number);
                        portset.parameters.http.status = (yyvsp[0].number);
                        portset.parameters.http.hasStatus = true;
                  }
#line 5576 "src/y.tab.c"
    break;

  case 548: /* method: METHOD GET  */
#line 2116 "src/p.y"
                             {
                        portset.parameters.http.method = Http_Get;
                  }
#line 5584 "src/y.tab.c"
    break;

  case 549: /* method: METHOD HEAD  */
#line 2119 "src/p.y"
                              {
                        portset.parameters.http.method = Http_Head;
                  }
#line 5592 "src/y.tab.c"
    break;

  case 550: /* request: REQUEST PATH  */
#line 2124 "src/p.y"
                               {
                        portset.parameters.http.request = Util_urlEncode((yyvsp[0].string), false);
                        FREE((yyvsp[0].string));
                  }
#line 5601 "src/y.tab.c"
    break;

  case 551: /* request: REQUEST STRING  */
#line 2128 "src/p.y"
                                 {
                        portset.parameters.http.request = Util_urlEncode((yyvsp[0].string), false);
                        FREE((yyvsp[0].string));
                  }
#line 5610 "src/y.tab.c"
    break;

  case 552: /* responsesum: CHECKSUM STRING  */
#line 2134 "src/p.y"
                                  {
                        portset.parameters.http.checksum = (yyvsp[0].string);
                  }
#line 5618 "src/y.tab.c"
    break;

  case 553: /* hostheader: HOSTHEADER STRING  */
#line 2139 "src/p.y"
                                    {
                        addhttpheader(&portset, Str_cat("Host:%s", (yyvsp[0].string)));
                        FREE((yyvsp[0].string));
                  }
#line 5627 "src/y.tab.c"
    break;

  case 555: /* httpheaderlist: httpheaderlist HTTPHEADER  */
#line 2146 "src/p.y"
                                            {
                        addhttpheader(&portset, (yyvsp[0].string));
                 }
#line 5635 "src/y.tab.c"
    break;

  case 556: /* secret: SECRET STRING  */
#line 2151 "src/p.y"
                                {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 5643 "src/y.tab.c"
    break;

  case 559: /* radius: secret  */
#line 2160 "src/p.y"
                         {
                        portset.parameters.radius.secret = (yyvsp[0].string);
                  }
#line 5651 "src/y.tab.c"
    break;

  case 562: /* apache_stat: username  */
#line 2169 "src/p.y"
                           {
                        portset.parameters.apachestatus.username = (yyvsp[0].string);
                  }
#line 5659 "src/y.tab.c"
    break;

  case 563: /* apache_stat: password  */
#line 2172 "src/p.y"
                           {
                        portset.parameters.apachestatus.password = (yyvsp[0].string);
                  }
#line 5667 "src/y.tab.c"
    break;

  case 564: /* apache_stat: PATHTOK PATH  */
#line 2175 "src/p.y"
                               {
                        portset.parameters.apachestatus.path = (yyvsp[0].string);
                  }
#line 5675 "src/y.tab.c"
    break;

  case 565: /* apache_stat: LOGLIMIT operator NUMBER PERCENT  */
#line 2178 "src/p.y"
                                                   {
                        portset.parameters.apachestatus.loglimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.loglimit = (yyvsp[-1].number);
                  }
#line 5684 "src/y.tab.c"
    break;

  case 566: /* apache_stat: CLOSELIMIT operator NUMBER PERCENT  */
#line 2182 "src/p.y"
                                                     {
                        portset.parameters.apachestatus.closelimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.closelimit = (yyvsp[-1].number);
                  }
#line 5693 "src/y.tab.c"
    break;

  case 567: /* apache_stat: DNSLIMIT operator NUMBER PERCENT  */
#line 2186 "src/p.y"
                                                   {
                        portset.parameters.apachestatus.dnslimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.dnslimit = (yyvsp[-1].number);
                  }
#line 5702 "src/y.tab.c"
    break;

  case 568: /* apache_stat: KEEPALIVELIMIT operator NUMBER PERCENT  */
#line 2190 "src/p.y"
                                                         {
                        portset.parameters.apachestatus.keepalivelimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.keepalivelimit = (yyvsp[-1].number);
                  }
#line 5711 "src/y.tab.c"
    break;

  case 569: /* apache_stat: REPLYLIMIT operator NUMBER PERCENT  */
#line 2194 "src/p.y"
                                                     {
                        portset.parameters.apachestatus.replylimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.replylimit = (yyvsp[-1].number);
                  }
#line 5720 "src/y.tab.c"
    break;

  case 570: /* apache_stat: REQUESTLIMIT operator NUMBER PERCENT  */
#line 2198 "src/p.y"
                                                       {
                        portset.parameters.apachestatus.requestlimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.requestlimit = (yyvsp[-1].number);
                  }
#line 5729 "src/y.tab.c"
    break;

  case 571: /* apache_stat: STARTLIMIT operator NUMBER PERCENT  */
#line 2202 "src/p.y"
                                                     {
                        portset.parameters.apachestatus.startlimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.startlimit = (yyvsp[-1].number);
                  }
#line 5738 "src/y.tab.c"
    break;

  case 572: /* apache_stat: WAITLIMIT operator NUMBER PERCENT  */
#line 2206 "src/p.y"
                                                    {
                        portset.parameters.apachestatus.waitlimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.waitlimit = (yyvsp[-1].number);
                  }
#line 5747 "src/y.tab.c"
    break;

  case 573: /* apache_stat: GRACEFULLIMIT operator NUMBER PERCENT  */
#line 2210 "src/p.y"
                                                        {
                        portset.parameters.apachestatus.gracefullimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.gracefullimit = (yyvsp[-1].number);
                  }
#line 5756 "src/y.tab.c"
    break;

  case 574: /* apache_stat: CLEANUPLIMIT operator NUMBER PERCENT  */
#line 2214 "src/p.y"
                                                       {
                        portset.parameters.apachestatus.cleanuplimitOP = (yyvsp[-2].number);
                        portset.parameters.apachestatus.cleanuplimit = (yyvsp[-1].number);
                  }
#line 5765 "src/y.tab.c"
    break;

  case 575: /* exist: IF NOT EXIST rate1 THEN action1 recovery_success  */
#line 2220 "src/p.y"
                                                                   {
                        addeventaction(&(nonexistset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addnonexist(&nonexistset);
                  }
#line 5774 "src/y.tab.c"
    break;

  case 576: /* exist: IF EXIST rate1 THEN action1 recovery_success  */
#line 2224 "src/p.y"
                                                               {
                        addeventaction(&(existset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addexist(&existset);
                  }
#line 5783 "src/y.tab.c"
    break;

  case 577: /* pid: IF CHANGED PID rate1 THEN action1  */
#line 2231 "src/p.y"
                                                    {
                        addeventaction(&(pidset).action, (yyvsp[0].number), Action_Ignored);
                        addpid(&pidset);
                  }
#line 5792 "src/y.tab.c"
    break;

  case 578: /* ppid: IF CHANGED PPID rate1 THEN action1  */
#line 2237 "src/p.y"
                                                     {
                        addeventaction(&(ppidset).action, (yyvsp[0].number), Action_Ignored);
                        addppid(&ppidset);
                  }
#line 5801 "src/y.tab.c"
    break;

  case 579: /* uptime: IF UPTIME operator NUMBER time rate1 THEN action1 recovery_success  */
#line 2243 "src/p.y"
                                                                                     {
                        uptimeset.operator = (yyvsp[-6].number);
                        uptimeset.uptime = ((unsigned long long)(yyvsp[-5].number) * (yyvsp[-4].number));
                        addeventaction(&(uptimeset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        adduptime(&uptimeset);
                  }
#line 5812 "src/y.tab.c"
    break;

  case 580: /* responsetime: RESPONSETIME operator NUMBER MILLISECOND  */
#line 2251 "src/p.y"
                                                           {
                        responsetimeset.operator = (yyvsp[-2].number);
                        responsetimeset.limit = (yyvsp[-1].number);
                  }
#line 5821 "src/y.tab.c"
    break;

  case 581: /* responsetime: RESPONSETIME operator NUMBER SECOND  */
#line 2255 "src/p.y"
                                                      {
                        responsetimeset.operator = (yyvsp[-2].number);
                        responsetimeset.limit = (yyvsp[-1].number) * 1000;
                  }
#line 5830 "src/y.tab.c"
    break;

  case 582: /* icmpcount: COUNT NUMBER  */
#line 2261 "src/p.y"
                               {
                        icmpset.count = (yyvsp[0].number);
                 }
#line 5838 "src/y.tab.c"
    break;

  case 583: /* icmpsize: SIZE NUMBER  */
#line 2266 "src/p.y"
                              {
                        icmpset.size = (yyvsp[0].number);
                        if (icmpset.size < 8) {
                                yyerror2("The minimum ping size is 8 bytes");
                        } else if (icmpset.size > 1492) {
                                yyerror2("The maximum ping size is 1492 bytes");
                        }
                 }
#line 5851 "src/y.tab.c"
    break;

  case 584: /* icmptimeout: TIMEOUT NUMBER SECOND  */
#line 2276 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                icmpset.timeout = (yyvsp[-1].number) * 1000; // timeout is in milliseconds internally
                    }
#line 5862 "src/y.tab.c"
    break;

  case 585: /* icmpoutgoing: ADDRESS STRING  */
#line 2284 "src/p.y"
                                 {
                        _parseOutgoingAddress((yyvsp[0].string), &(icmpset.outgoing));
                  }
#line 5870 "src/y.tab.c"
    break;

  case 586: /* stoptimeout: %empty  */
#line 2289 "src/p.y"
                              {
                        (yyval.number) = Run.limits.stopTimeout;
                  }
#line 5878 "src/y.tab.c"
    break;

  case 587: /* stoptimeout: TIMEOUT NUMBER SECOND  */
#line 2292 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                (yyval.number) = (yyvsp[-1].number) * 1000; // milliseconds internally
                  }
#line 5889 "src/y.tab.c"
    break;

  case 588: /* starttimeout: %empty  */
#line 2300 "src/p.y"
                              {
                        (yyval.number) = Run.limits.startTimeout;
                  }
#line 5897 "src/y.tab.c"
    break;

  case 589: /* starttimeout: TIMEOUT NUMBER SECOND  */
#line 2303 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                (yyval.number) = (yyvsp[-1].number) * 1000; // milliseconds internally
                  }
#line 5908 "src/y.tab.c"
    break;

  case 590: /* restarttimeout: %empty  */
#line 2311 "src/p.y"
                              {
                        (yyval.number) = Run.limits.restartTimeout;
                  }
#line 5916 "src/y.tab.c"
    break;

  case 591: /* restarttimeout: TIMEOUT NUMBER SECOND  */
#line 2314 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                (yyval.number) = (yyvsp[-1].number) * 1000; // milliseconds internally
                  }
#line 5927 "src/y.tab.c"
    break;

  case 592: /* programtimeout: %empty  */
#line 2322 "src/p.y"
                              {
                        (yyval.number) = Run.limits.programTimeout;
                  }
#line 5935 "src/y.tab.c"
    break;

  case 593: /* programtimeout: TIMEOUT NUMBER SECOND  */
#line 2325 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                (yyval.number) = (yyvsp[-1].number) * 1000; // milliseconds internally
                  }
#line 5946 "src/y.tab.c"
    break;

  case 594: /* nettimeout: %empty  */
#line 2333 "src/p.y"
                              {
                        (yyval.number) = Run.limits.networkTimeout;
                  }
#line 5954 "src/y.tab.c"
    break;

  case 595: /* nettimeout: TIMEOUT NUMBER SECOND  */
#line 2336 "src/p.y"
                                        {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                (yyval.number) = (yyvsp[-1].number) * 1000; // net timeout is in milliseconds internally
                  }
#line 5965 "src/y.tab.c"
    break;

  case 596: /* connectiontimeout: TIMEOUT NUMBER SECOND  */
#line 2344 "src/p.y"
                                          {
                        if ((yyvsp[-1].number) <= 0)
                                yyerror2("The timeout value must be > 0");
                        else
                                portset.timeout = (yyvsp[-1].number) * 1000; // timeout is in milliseconds internally
                    }
#line 5976 "src/y.tab.c"
    break;

  case 597: /* retry: RETRY NUMBER  */
#line 2352 "src/p.y"
                               {
                        portset.retry = (yyvsp[0].number);
                  }
#line 5984 "src/y.tab.c"
    break;

  case 598: /* actionrate: IF NUMBER RESTART NUMBER CYCLE THEN action1  */
#line 2357 "src/p.y"
                                                              {
                        actionrateset.count = (yyvsp[-5].number);
                        actionrateset.cycle = (yyvsp[-3].number);
                        addeventaction(&(actionrateset).action, (yyvsp[0].number), Action_Alert);
                        addactionrate(&actionrateset);
                  }
#line 5995 "src/y.tab.c"
    break;

  case 599: /* actionrate: IF NUMBER RESTART NUMBER CYCLE THEN TIMEOUT  */
#line 2363 "src/p.y"
                                                              {
                        actionrateset.count = (yyvsp[-5].number);
                        actionrateset.cycle = (yyvsp[-3].number);
                        addeventaction(&(actionrateset).action, Action_Unmonitor, Action_Alert);
                        addactionrate(&actionrateset);
                  }
#line 6006 "src/y.tab.c"
    break;

  case 600: /* urloption: CONTENT urloperator STRING  */
#line 2371 "src/p.y"
                                             {
                        seturlrequest((yyvsp[-1].number), (yyvsp[0].string));
                        FREE((yyvsp[0].string));
                  }
#line 6015 "src/y.tab.c"
    break;

  case 601: /* urloperator: EQUAL  */
#line 2377 "src/p.y"
                           { (yyval.number) = Operator_Equal; }
#line 6021 "src/y.tab.c"
    break;

  case 602: /* urloperator: NOTEQUAL  */
#line 2378 "src/p.y"
                           { (yyval.number) = Operator_NotEqual; }
#line 6027 "src/y.tab.c"
    break;

  case 603: /* alert: alertmail formatlist reminder  */
#line 2381 "src/p.y"
                                                {
                        mailset.events = Event_All;
                        addmail((yyvsp[-2].string), &mailset, &current->maillist);
                  }
#line 6036 "src/y.tab.c"
    break;

  case 604: /* alert: alertmail '{' eventoptionlist '}' formatlist reminder  */
#line 2385 "src/p.y"
                                                                        {
                        addmail((yyvsp[-5].string), &mailset, &current->maillist);
                  }
#line 6044 "src/y.tab.c"
    break;

  case 605: /* alert: alertmail NOT '{' eventoptionlist '}' formatlist reminder  */
#line 2388 "src/p.y"
                                                                            {
                        mailset.events = ~mailset.events;
                        addmail((yyvsp[-6].string), &mailset, &current->maillist);
                  }
#line 6053 "src/y.tab.c"
    break;

  case 606: /* alert: noalertmail  */
#line 2392 "src/p.y"
                              {
                        addmail((yyvsp[0].string), &mailset, &current->maillist);
                  }
#line 6061 "src/y.tab.c"
    break;

  case 607: /* alertmail: ALERT MAILADDR  */
#line 2397 "src/p.y"
                                 { (yyval.string) = (yyvsp[0].string); }
#line 6067 "src/y.tab.c"
    break;

  case 608: /* noalertmail: NOALERT MAILADDR  */
#line 2400 "src/p.y"
                                   { (yyval.string) = (yyvsp[0].string); }
#line 6073 "src/y.tab.c"
    break;

  case 611: /* eventoption: ACTION  */
#line 2407 "src/p.y"
                                  { mailset.events |= Event_Action; }
#line 6079 "src/y.tab.c"
    break;

  case 612: /* eventoption: BYTEIN  */
#line 2408 "src/p.y"
                                  { mailset.events |= Event_ByteIn; }
#line 6085 "src/y.tab.c"
    break;

  case 613: /* eventoption: BYTEOUT  */
#line 2409 "src/p.y"
                                  { mailset.events |= Event_ByteOut; }
#line 6091 "src/y.tab.c"
    break;

  case 614: /* eventoption: CHECKSUM  */
#line 2410 "src/p.y"
                                  { mailset.events |= Event_Checksum; }
#line 6097 "src/y.tab.c"
    break;

  case 615: /* eventoption: CONNECTION  */
#line 2411 "src/p.y"
                                  { mailset.events |= Event_Connection; }
#line 6103 "src/y.tab.c"
    break;

  case 616: /* eventoption: CONTENT  */
#line 2412 "src/p.y"
                                  { mailset.events |= Event_Content; }
#line 6109 "src/y.tab.c"
    break;

  case 617: /* eventoption: DATA  */
#line 2413 "src/p.y"
                                  { mailset.events |= Event_Data; }
#line 6115 "src/y.tab.c"
    break;

  case 618: /* eventoption: EXEC  */
#line 2414 "src/p.y"
                                  { mailset.events |= Event_Exec; }
#line 6121 "src/y.tab.c"
    break;

  case 619: /* eventoption: EXIST  */
#line 2415 "src/p.y"
                                  { mailset.events |= Event_Exist; }
#line 6127 "src/y.tab.c"
    break;

  case 620: /* eventoption: FSFLAG  */
#line 2416 "src/p.y"
                                  { mailset.events |= Event_FsFlag; }
#line 6133 "src/y.tab.c"
    break;

  case 621: /* eventoption: GID  */
#line 2417 "src/p.y"
                                  { mailset.events |= Event_Gid; }
#line 6139 "src/y.tab.c"
    break;

  case 622: /* eventoption: ICMP  */
#line 2418 "src/p.y"
                                  { mailset.events |= Event_Icmp; }
#line 6145 "src/y.tab.c"
    break;

  case 623: /* eventoption: INSTANCE  */
#line 2419 "src/p.y"
                                  { mailset.events |= Event_Instance; }
#line 6151 "src/y.tab.c"
    break;

  case 624: /* eventoption: INVALID  */
#line 2420 "src/p.y"
                                  { mailset.events |= Event_Invalid; }
#line 6157 "src/y.tab.c"
    break;

  case 625: /* eventoption: LINK  */
#line 2421 "src/p.y"
                                  { mailset.events |= Event_Link; }
#line 6163 "src/y.tab.c"
    break;

  case 626: /* eventoption: NONEXIST  */
#line 2422 "src/p.y"
                                  { mailset.events |= Event_NonExist; }
#line 6169 "src/y.tab.c"
    break;

  case 627: /* eventoption: PACKETIN  */
#line 2423 "src/p.y"
                                  { mailset.events |= Event_PacketIn; }
#line 6175 "src/y.tab.c"
    break;

  case 628: /* eventoption: PACKETOUT  */
#line 2424 "src/p.y"
                                  { mailset.events |= Event_PacketOut; }
#line 6181 "src/y.tab.c"
    break;

  case 629: /* eventoption: PERMISSION  */
#line 2425 "src/p.y"
                                  { mailset.events |= Event_Permission; }
#line 6187 "src/y.tab.c"
    break;

  case 630: /* eventoption: PID  */
#line 2426 "src/p.y"
                                  { mailset.events |= Event_Pid; }
#line 6193 "src/y.tab.c"
    break;

  case 631: /* eventoption: PPID  */
#line 2427 "src/p.y"
                                  { mailset.events |= Event_PPid; }
#line 6199 "src/y.tab.c"
    break;

  case 632: /* eventoption: RESOURCE  */
#line 2428 "src/p.y"
                                  { mailset.events |= Event_Resource; }
#line 6205 "src/y.tab.c"
    break;

  case 633: /* eventoption: SATURATION  */
#line 2429 "src/p.y"
                                  { mailset.events |= Event_Saturation; }
#line 6211 "src/y.tab.c"
    break;

  case 634: /* eventoption: SIZE  */
#line 2430 "src/p.y"
                                  { mailset.events |= Event_Size; }
#line 6217 "src/y.tab.c"
    break;

  case 635: /* eventoption: SPEED  */
#line 2431 "src/p.y"
                                  { mailset.events |= Event_Speed; }
#line 6223 "src/y.tab.c"
    break;

  case 636: /* eventoption: STATUS  */
#line 2432 "src/p.y"
                                  { mailset.events |= Event_Status; }
#line 6229 "src/y.tab.c"
    break;

  case 637: /* eventoption: TIMEOUT  */
#line 2433 "src/p.y"
                                  { mailset.events |= Event_Timeout; }
#line 6235 "src/y.tab.c"
    break;

  case 638: /* eventoption: TIME  */
#line 2434 "src/p.y"
                                  { mailset.events |= Event_Timestamp; }
#line 6241 "src/y.tab.c"
    break;

  case 639: /* eventoption: UID  */
#line 2435 "src/p.y"
                                  { mailset.events |= Event_Uid; }
#line 6247 "src/y.tab.c"
    break;

  case 640: /* eventoption: UPTIME  */
#line 2436 "src/p.y"
                                  { mailset.events |= Event_Uptime; }
#line 6253 "src/y.tab.c"
    break;

  case 645: /* formatoption: MAILFROM ADDRESSOBJECT  */
#line 2447 "src/p.y"
                                         { mailset.from = (yyvsp[-1].address); }
#line 6259 "src/y.tab.c"
    break;

  case 646: /* formatoption: MAILREPLYTO ADDRESSOBJECT  */
#line 2448 "src/p.y"
                                            { mailset.replyto = (yyvsp[-1].address); }
#line 6265 "src/y.tab.c"
    break;

  case 647: /* formatoption: MAILSUBJECT  */
#line 2449 "src/p.y"
                              { mailset.subject = (yyvsp[0].string); }
#line 6271 "src/y.tab.c"
    break;

  case 648: /* formatoption: MAILBODY  */
#line 2450 "src/p.y"
                           { mailset.message = (yyvsp[0].string); }
#line 6277 "src/y.tab.c"
    break;

  case 649: /* every: EVERY NUMBER CYCLE  */
#line 2453 "src/p.y"
                                     {
                        yydeprecated("The 'every N cycles' syntax is deprecated, use cron-style 'every \"*/N * * * *\"' for periodic N minutes or 'every \"* * * * *\"' for once per minute instead");
                        _sanityCheckEveryStatement(current);
                        current->every.type = Every_SkipCycles;
                        current->every.spec.cycle.counter = current->every.spec.cycle.number = (yyvsp[-1].number);
                 }
#line 6288 "src/y.tab.c"
    break;

  case 650: /* every: EVERY TIMESPEC  */
#line 2459 "src/p.y"
                                 {
                        _sanityCheckEveryStatement(current);
                        if (Time_incron((yyvsp[0].string), Time_now()) < 0)
                                yyerror2("Invalid cron specification");
                        current->every.type = Every_Cron;
                        current->every.spec.cron = (yyvsp[0].string);
                        // Needs a heartbeat thread
                        Run.needHeartBeat |= true;
                 }
#line 6302 "src/y.tab.c"
    break;

  case 651: /* every: NOTEVERY TIMESPEC  */
#line 2468 "src/p.y"
                                    {
                        _sanityCheckEveryStatement(current);
                        if (Time_incron((yyvsp[0].string), Time_now()) < 0)
                                yyerror2("Invalid cron specification");
                        current->every.type = Every_NotInCron;
                        current->every.spec.cron = (yyvsp[0].string);
                        // Does not need a heartbeat thread
                 }
#line 6315 "src/y.tab.c"
    break;

  case 652: /* mode: MODE ACTIVE  */
#line 2478 "src/p.y"
                              {
                        current->mode = Monitor_Active;
                  }
#line 6323 "src/y.tab.c"
    break;

  case 653: /* mode: MODE PASSIVE  */
#line 2481 "src/p.y"
                               {
                        current->mode = Monitor_Passive;
                  }
#line 6331 "src/y.tab.c"
    break;

  case 654: /* mode: MODE MANUAL  */
#line 2484 "src/p.y"
                              {
                        yydeprecated("'mode manual' is deprecated, use 'onreboot laststate' instead");
                        current->onreboot = Onreboot_Laststate;
                  }
#line 6340 "src/y.tab.c"
    break;

  case 655: /* onreboot: ONREBOOT START  */
#line 2490 "src/p.y"
                                 {
                        current->onreboot = Onreboot_Start;
                  }
#line 6348 "src/y.tab.c"
    break;

  case 656: /* onreboot: ONREBOOT NOSTART  */
#line 2493 "src/p.y"
                                   {
                        current->onreboot = Onreboot_Nostart;
                        current->monitor = Monitor_Not;
                  }
#line 6357 "src/y.tab.c"
    break;

  case 657: /* onreboot: ONREBOOT LASTSTATE  */
#line 2497 "src/p.y"
                                     {
                        current->onreboot = Onreboot_Laststate;
                  }
#line 6365 "src/y.tab.c"
    break;

  case 658: /* group: GROUP STRINGNAME  */
#line 2502 "src/p.y"
                                   {
                        addservicegroup((yyvsp[0].string));
                        FREE((yyvsp[0].string));
                  }
#line 6374 "src/y.tab.c"
    break;

  case 660: /* hostgrouplist: hostgrouplist HOSTGROUPNAME  */
#line 2509 "src/p.y"
                                              {
                        addhostgroup((yyvsp[0].string));
                 }
#line 6382 "src/y.tab.c"
    break;

  case 664: /* dependant: SERVICENAME  */
#line 2522 "src/p.y"
                              { adddependant((yyvsp[0].string)); }
#line 6388 "src/y.tab.c"
    break;

  case 665: /* statusvalue: IF STATUS operator NUMBER rate1 THEN action1 recovery_success  */
#line 2525 "src/p.y"
                                                                                {
                        statusset.initialized = true;
                        statusset.operator = (yyvsp[-5].number);
                        statusset.return_value = (yyvsp[-4].number);
                        addeventaction(&(statusset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addstatus(&statusset);
                   }
#line 6400 "src/y.tab.c"
    break;

  case 666: /* statusvalue: IF CHANGED STATUS rate1 THEN action1  */
#line 2532 "src/p.y"
                                                       {
                        statusset.initialized = false;
                        statusset.operator = Operator_Changed;
                        statusset.return_value = 0;
                        addeventaction(&(statusset).action, (yyvsp[0].number), Action_Ignored);
                        addstatus(&statusset);
                   }
#line 6412 "src/y.tab.c"
    break;

  case 667: /* resourceprocess: IF resourceprocesslist rate1 THEN action1 recovery_success  */
#line 2541 "src/p.y"
                                                                             {
                        addeventaction(&(resourceset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addresource(&resourceset);
                   }
#line 6421 "src/y.tab.c"
    break;

  case 677: /* resourcesystem: IF resourcesystemlist rate1 THEN action1 recovery_success  */
#line 2560 "src/p.y"
                                                                            {
                        addeventaction(&(resourceset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addresource(&resourceset);
                   }
#line 6430 "src/y.tab.c"
    break;

  case 685: /* resourcecpuproc: CPU operator value PERCENT  */
#line 2577 "src/p.y"
                                             {
                        resourceset.resource_id = Resource_CpuPercent;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6440 "src/y.tab.c"
    break;

  case 686: /* resourcecpuproc: TOTALCPU operator value PERCENT  */
#line 2582 "src/p.y"
                                                  {
                        resourceset.resource_id = Resource_CpuPercentTotal;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6450 "src/y.tab.c"
    break;

  case 687: /* resourcecpu: resourcecpuid operator value PERCENT  */
#line 2589 "src/p.y"
                                                       {
                        resourceset.resource_id = (yyvsp[-3].number);
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6460 "src/y.tab.c"
    break;

  case 688: /* resourcecpuid: CPUUSER  */
#line 2596 "src/p.y"
                          {
                        if (System_Info.statisticsAvailable & Statistics_CpuUser)
                                (yyval.number) = Resource_CpuUser;
                        else
                                yywarning2("The CPU user usage statistics is not available on this system\n");
                  }
#line 6471 "src/y.tab.c"
    break;

  case 689: /* resourcecpuid: CPUSYSTEM  */
#line 2602 "src/p.y"
                            {
                        if (System_Info.statisticsAvailable & Statistics_CpuSystem)
                                (yyval.number) = Resource_CpuSystem;
                        else
                                yywarning2("The CPU system usage statistics is not available on this system\n");
                  }
#line 6482 "src/y.tab.c"
    break;

  case 690: /* resourcecpuid: CPUWAIT  */
#line 2608 "src/p.y"
                          {
                        if (System_Info.statisticsAvailable & Statistics_CpuIOWait)
                                (yyval.number) = Resource_CpuWait;
                        else
                                yywarning2("The CPU I/O wait usage statistics is not available on this system\n");
                  }
#line 6493 "src/y.tab.c"
    break;

  case 691: /* resourcecpuid: CPUNICE  */
#line 2614 "src/p.y"
                          {
                        if (System_Info.statisticsAvailable & Statistics_CpuNice)
                                (yyval.number) = Resource_CpuNice;
                        else
                                yywarning2("The CPU nice usage statistics is not available on this system\n");
                  }
#line 6504 "src/y.tab.c"
    break;

  case 692: /* resourcecpuid: CPUHARDIRQ  */
#line 2620 "src/p.y"
                             {
                        if (System_Info.statisticsAvailable & Statistics_CpuHardIRQ)
                                (yyval.number) = Resource_CpuHardIRQ;
                        else
                                yywarning2("The CPU hardware IRQ usage statistics is not available on this system\n");
                  }
#line 6515 "src/y.tab.c"
    break;

  case 693: /* resourcecpuid: CPUSOFTIRQ  */
#line 2626 "src/p.y"
                             {
                        if (System_Info.statisticsAvailable & Statistics_CpuSoftIRQ)
                                (yyval.number) = Resource_CpuSoftIRQ;
                        else
                                yywarning2("The CPU software IRQ usage statistics is not available on this system\n");
                  }
#line 6526 "src/y.tab.c"
    break;

  case 694: /* resourcecpuid: CPUSTEAL  */
#line 2632 "src/p.y"
                           {
                        if (System_Info.statisticsAvailable & Statistics_CpuSteal)
                                (yyval.number) = Resource_CpuSteal;
                        else
                                yywarning2("The CPU steal usage statistics is not available on this system\n");
                  }
#line 6537 "src/y.tab.c"
    break;

  case 695: /* resourcecpuid: CPUGUEST  */
#line 2638 "src/p.y"
                           {
                        if (System_Info.statisticsAvailable & Statistics_CpuGuest)
                                (yyval.number) = Resource_CpuGuest;
                        else
                                yywarning2("The CPU guest usage statistics is not available on this system\n");
                  }
#line 6548 "src/y.tab.c"
    break;

  case 696: /* resourcecpuid: CPUGUESTNICE  */
#line 2644 "src/p.y"
                               {
                        if (System_Info.statisticsAvailable & Statistics_CpuGuestNice)
                                (yyval.number) = Resource_CpuGuestNice;
                        else
                                yywarning2("The CPU guest nice usage statistics is not available on this system\n");
                  }
#line 6559 "src/y.tab.c"
    break;

  case 697: /* resourcecpuid: CPU  */
#line 2650 "src/p.y"
                      {
                        (yyval.number) = Resource_CpuPercent;
                  }
#line 6567 "src/y.tab.c"
    break;

  case 698: /* resourcemem: MEMORY operator value unit  */
#line 2655 "src/p.y"
                                             {
                        resourceset.resource_id = Resource_MemoryKbyte;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real) * (yyvsp[0].number);
                  }
#line 6577 "src/y.tab.c"
    break;

  case 699: /* resourcemem: MEMORY operator value PERCENT  */
#line 2660 "src/p.y"
                                                {
                        resourceset.resource_id = Resource_MemoryPercent;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6587 "src/y.tab.c"
    break;

  case 700: /* resourcememproc: MEMORY operator value unit  */
#line 2667 "src/p.y"
                                             {
                        resourceset.resource_id = Resource_MemoryKbyte;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real) * (yyvsp[0].number);
                  }
#line 6597 "src/y.tab.c"
    break;

  case 701: /* resourcememproc: MEMORY operator value PERCENT  */
#line 2672 "src/p.y"
                                                {
                        resourceset.resource_id = Resource_MemoryPercent;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6607 "src/y.tab.c"
    break;

  case 702: /* resourcememproc: TOTALMEMORY operator value unit  */
#line 2677 "src/p.y"
                                                  {
                        resourceset.resource_id = Resource_MemoryKbyteTotal;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real) * (yyvsp[0].number);
                  }
#line 6617 "src/y.tab.c"
    break;

  case 703: /* resourcememproc: TOTALMEMORY operator value PERCENT  */
#line 2682 "src/p.y"
                                                      {
                        resourceset.resource_id = Resource_MemoryPercentTotal;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6627 "src/y.tab.c"
    break;

  case 704: /* resourceswap: SWAP operator value unit  */
#line 2689 "src/p.y"
                                           {
                        resourceset.resource_id = Resource_SwapKbyte;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real) * (yyvsp[0].number);
                  }
#line 6637 "src/y.tab.c"
    break;

  case 705: /* resourceswap: SWAP operator value PERCENT  */
#line 2694 "src/p.y"
                                              {
                        resourceset.resource_id = Resource_SwapPercent;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].real);
                  }
#line 6647 "src/y.tab.c"
    break;

  case 706: /* resourcepage: PAGEIN operator NUMBER SECOND  */
#line 2701 "src/p.y"
                                                {
                        resourceset.resource_id = Resource_Pagein;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].number);
                  }
#line 6657 "src/y.tab.c"
    break;

  case 707: /* resourcepage: PAGEOUT operator NUMBER SECOND  */
#line 2706 "src/p.y"
                                                 {
                        resourceset.resource_id = Resource_Pageout;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].number);
                  }
#line 6667 "src/y.tab.c"
    break;

  case 708: /* resourcethreads: THREADS operator NUMBER  */
#line 2713 "src/p.y"
                                          {
                        resourceset.resource_id = Resource_Threads;
                        resourceset.operator = (yyvsp[-1].number);
                        resourceset.limit = (yyvsp[0].number);
                  }
#line 6677 "src/y.tab.c"
    break;

  case 709: /* resourcechild: CHILDREN operator NUMBER  */
#line 2720 "src/p.y"
                                           {
                        resourceset.resource_id = Resource_Children;
                        resourceset.operator = (yyvsp[-1].number);
                        resourceset.limit = (yyvsp[0].number);
                  }
#line 6687 "src/y.tab.c"
    break;

  case 710: /* resourceload: resourceloadavg coremultiplier operator value  */
#line 2727 "src/p.y"
                                                                {
                        switch ((yyvsp[-3].number)) {
                                case Resource_LoadAverage1m:
                                        resourceset.resource_id = (yyvsp[-2].number) > 1 ? Resource_LoadAveragePerCore1m : (yyvsp[-3].number);
                                        break;
                                case Resource_LoadAverage5m:
                                        resourceset.resource_id = (yyvsp[-2].number) > 1 ? Resource_LoadAveragePerCore5m : (yyvsp[-3].number);
                                        break;
                                case Resource_LoadAverage15m:
                                        resourceset.resource_id = (yyvsp[-2].number) > 1 ? Resource_LoadAveragePerCore15m : (yyvsp[-3].number);
                                        break;
                                default:
                                        resourceset.resource_id = (yyvsp[-3].number);
                                        break;
                        }
                        resourceset.operator = (yyvsp[-1].number);
                        resourceset.limit = (yyvsp[0].real);
                  }
#line 6710 "src/y.tab.c"
    break;

  case 711: /* resourceloadavg: LOADAVG1  */
#line 2747 "src/p.y"
                            { (yyval.number) = Resource_LoadAverage1m; }
#line 6716 "src/y.tab.c"
    break;

  case 712: /* resourceloadavg: LOADAVG5  */
#line 2748 "src/p.y"
                            { (yyval.number) = Resource_LoadAverage5m; }
#line 6722 "src/y.tab.c"
    break;

  case 713: /* resourceloadavg: LOADAVG15  */
#line 2749 "src/p.y"
                            { (yyval.number) = Resource_LoadAverage15m; }
#line 6728 "src/y.tab.c"
    break;

  case 714: /* coremultiplier: %empty  */
#line 2752 "src/p.y"
                              { (yyval.number) = 1; }
#line 6734 "src/y.tab.c"
    break;

  case 715: /* coremultiplier: CORE  */
#line 2753 "src/p.y"
                              { (yyval.number) = System_Info.cpu.count; }
#line 6740 "src/y.tab.c"
    break;

  case 716: /* resourceread: READ operator value unit currenttime  */
#line 2757 "src/p.y"
                                                       {
                        resourceset.resource_id = Resource_ReadBytes;
                        resourceset.operator = (yyvsp[-3].number);
                        resourceset.limit = (yyvsp[-2].real) * (yyvsp[-1].number);
                  }
#line 6750 "src/y.tab.c"
    break;

  case 717: /* resourceread: DISK READ operator value unit currenttime  */
#line 2762 "src/p.y"
                                                            {
                        resourceset.resource_id = Resource_ReadBytesPhysical;
                        resourceset.operator = (yyvsp[-3].number);
                        resourceset.limit = (yyvsp[-2].real) * (yyvsp[-1].number);
                  }
#line 6760 "src/y.tab.c"
    break;

  case 718: /* resourceread: DISK READ operator NUMBER OPERATION  */
#line 2767 "src/p.y"
                                                      {
                        resourceset.resource_id = Resource_ReadOperations;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].number);
                  }
#line 6770 "src/y.tab.c"
    break;

  case 719: /* resourcewrite: WRITE operator value unit currenttime  */
#line 2774 "src/p.y"
                                                        {
                        resourceset.resource_id = Resource_WriteBytes;
                        resourceset.operator = (yyvsp[-3].number);
                        resourceset.limit = (yyvsp[-2].real) * (yyvsp[-1].number);
                  }
#line 6780 "src/y.tab.c"
    break;

  case 720: /* resourcewrite: DISK WRITE operator value unit currenttime  */
#line 2779 "src/p.y"
                                                             {
                        resourceset.resource_id = Resource_WriteBytesPhysical;
                        resourceset.operator = (yyvsp[-3].number);
                        resourceset.limit = (yyvsp[-2].real) * (yyvsp[-1].number);
                  }
#line 6790 "src/y.tab.c"
    break;

  case 721: /* resourcewrite: DISK WRITE operator NUMBER OPERATION  */
#line 2784 "src/p.y"
                                                       {
                        resourceset.resource_id = Resource_WriteOperations;
                        resourceset.operator = (yyvsp[-2].number);
                        resourceset.limit = (yyvsp[-1].number);
                  }
#line 6800 "src/y.tab.c"
    break;

  case 722: /* value: REAL  */
#line 2791 "src/p.y"
                       { (yyval.real) = (yyvsp[0].real); }
#line 6806 "src/y.tab.c"
    break;

  case 723: /* value: NUMBER  */
#line 2792 "src/p.y"
                         { (yyval.real) = (float) (yyvsp[0].number); }
#line 6812 "src/y.tab.c"
    break;

  case 724: /* timestamptype: TIME  */
#line 2795 "src/p.y"
                        { (yyval.number) = Timestamp_Default; }
#line 6818 "src/y.tab.c"
    break;

  case 725: /* timestamptype: ATIME  */
#line 2796 "src/p.y"
                        { (yyval.number) = Timestamp_Access; }
#line 6824 "src/y.tab.c"
    break;

  case 726: /* timestamptype: CTIME  */
#line 2797 "src/p.y"
                        { (yyval.number) = Timestamp_Change; }
#line 6830 "src/y.tab.c"
    break;

  case 727: /* timestamptype: MTIME  */
#line 2798 "src/p.y"
                        { (yyval.number) = Timestamp_Modification; }
#line 6836 "src/y.tab.c"
    break;

  case 728: /* timestamp: IF timestamptype operator NUMBER time rate1 THEN action1 recovery_success  */
#line 2801 "src/p.y"
                                                                                            {
                        timestampset.type = (yyvsp[-7].number);
                        timestampset.operator = (yyvsp[-6].number);
                        timestampset.time = ((yyvsp[-5].number) * (yyvsp[-4].number));
                        addeventaction(&(timestampset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addtimestamp(&timestampset);
                  }
#line 6848 "src/y.tab.c"
    break;

  case 729: /* timestamp: IF CHANGED timestamptype rate1 THEN action1  */
#line 2808 "src/p.y"
                                                              {
                        timestampset.type = (yyvsp[-3].number);
                        timestampset.test_changes = true;
                        addeventaction(&(timestampset).action, (yyvsp[0].number), Action_Ignored);
                        addtimestamp(&timestampset);
                  }
#line 6859 "src/y.tab.c"
    break;

  case 730: /* operator: %empty  */
#line 2816 "src/p.y"
                                 { (yyval.number) = Operator_Equal; }
#line 6865 "src/y.tab.c"
    break;

  case 731: /* operator: GREATER  */
#line 2817 "src/p.y"
                                 { (yyval.number) = Operator_Greater; }
#line 6871 "src/y.tab.c"
    break;

  case 732: /* operator: GREATEROREQUAL  */
#line 2818 "src/p.y"
                                 { (yyval.number) = Operator_GreaterOrEqual; }
#line 6877 "src/y.tab.c"
    break;

  case 733: /* operator: LESS  */
#line 2819 "src/p.y"
                                 { (yyval.number) = Operator_Less; }
#line 6883 "src/y.tab.c"
    break;

  case 734: /* operator: LESSOREQUAL  */
#line 2820 "src/p.y"
                                 { (yyval.number) = Operator_LessOrEqual; }
#line 6889 "src/y.tab.c"
    break;

  case 735: /* operator: EQUAL  */
#line 2821 "src/p.y"
                                 { (yyval.number) = Operator_Equal; }
#line 6895 "src/y.tab.c"
    break;

  case 736: /* operator: NOTEQUAL  */
#line 2822 "src/p.y"
                                 { (yyval.number) = Operator_NotEqual; }
#line 6901 "src/y.tab.c"
    break;

  case 737: /* operator: CHANGED  */
#line 2823 "src/p.y"
                                 { (yyval.number) = Operator_Changed; }
#line 6907 "src/y.tab.c"
    break;

  case 738: /* time: %empty  */
#line 2826 "src/p.y"
                              { (yyval.number) = Time_Second; }
#line 6913 "src/y.tab.c"
    break;

  case 739: /* time: SECOND  */
#line 2827 "src/p.y"
                              { (yyval.number) = Time_Second; }
#line 6919 "src/y.tab.c"
    break;

  case 740: /* time: MINUTE  */
#line 2828 "src/p.y"
                              { (yyval.number) = Time_Minute; }
#line 6925 "src/y.tab.c"
    break;

  case 741: /* time: HOUR  */
#line 2829 "src/p.y"
                              { (yyval.number) = Time_Hour; }
#line 6931 "src/y.tab.c"
    break;

  case 742: /* time: DAY  */
#line 2830 "src/p.y"
                              { (yyval.number) = Time_Day; }
#line 6937 "src/y.tab.c"
    break;

  case 743: /* time: MONTH  */
#line 2831 "src/p.y"
                              { (yyval.number) = Time_Month; }
#line 6943 "src/y.tab.c"
    break;

  case 744: /* totaltime: MINUTE  */
#line 2834 "src/p.y"
                              { (yyval.number) = Time_Minute; }
#line 6949 "src/y.tab.c"
    break;

  case 745: /* totaltime: HOUR  */
#line 2835 "src/p.y"
                              { (yyval.number) = Time_Hour; }
#line 6955 "src/y.tab.c"
    break;

  case 746: /* totaltime: DAY  */
#line 2836 "src/p.y"
                              { (yyval.number) = Time_Day; }
#line 6961 "src/y.tab.c"
    break;

  case 747: /* currenttime: %empty  */
#line 2838 "src/p.y"
                              { (yyval.number) = Time_Second; }
#line 6967 "src/y.tab.c"
    break;

  case 748: /* currenttime: SECOND  */
#line 2839 "src/p.y"
                              { (yyval.number) = Time_Second; }
#line 6973 "src/y.tab.c"
    break;

  case 749: /* exectimeout: %empty  */
#line 2842 "src/p.y"
                              {
                        timeout = Run.limits.execTimeout;
                  }
#line 6981 "src/y.tab.c"
    break;

  case 750: /* exectimeout: TIMEOUT NUMBER SECOND  */
#line 2845 "src/p.y"
                                        {
                        if ((yyvsp[0].number) < 0) {
                                yyerror2("The timeout must be greater or equal to 0");
                        }
                        timeout = (yyvsp[-1].number) * 1000; // milliseconds internally
                  }
#line 6992 "src/y.tab.c"
    break;

  case 751: /* repeat: %empty  */
#line 2853 "src/p.y"
                              {
                        repeat = 0;
                  }
#line 7000 "src/y.tab.c"
    break;

  case 752: /* repeat: REPEAT EVERY CYCLE  */
#line 2856 "src/p.y"
                                     {
                        repeat = 1;
                  }
#line 7008 "src/y.tab.c"
    break;

  case 753: /* repeat: REPEAT EVERY NUMBER CYCLE  */
#line 2859 "src/p.y"
                                            {
                        if ((yyvsp[-1].number) < 0) {
                                yyerror2("The number of repeat cycles must be greater or equal to 0");
                        }
                        repeat = (yyvsp[-1].number);
                  }
#line 7019 "src/y.tab.c"
    break;

  case 754: /* action: ALERT  */
#line 2867 "src/p.y"
                        {
                        (yyval.number) = Action_Alert;
                  }
#line 7027 "src/y.tab.c"
    break;

  case 755: /* action: EXEC argumentlist exectimeout repeat  */
#line 2870 "src/p.y"
                                                       {
                        (yyval.number) = Action_Exec;
                  }
#line 7035 "src/y.tab.c"
    break;

  case 756: /* action: EXEC argumentlist useroptionlist exectimeout repeat  */
#line 2874 "src/p.y"
                  {
                        (yyval.number) = Action_Exec;
                  }
#line 7043 "src/y.tab.c"
    break;

  case 757: /* action: IGNORE  */
#line 2877 "src/p.y"
                         {
                        (yyval.number) = Action_Ignored;
                  }
#line 7051 "src/y.tab.c"
    break;

  case 758: /* action: RESTART  */
#line 2880 "src/p.y"
                          {
                        (yyval.number) = Action_Restart;
                  }
#line 7059 "src/y.tab.c"
    break;

  case 759: /* action: START  */
#line 2883 "src/p.y"
                        {
                        (yyval.number) = Action_Start;
                  }
#line 7067 "src/y.tab.c"
    break;

  case 760: /* action: STOP  */
#line 2886 "src/p.y"
                       {
                        (yyval.number) = Action_Stop;
                  }
#line 7075 "src/y.tab.c"
    break;

  case 761: /* action: UNMONITOR  */
#line 2889 "src/p.y"
                            {
                        (yyval.number) = Action_Unmonitor;
                  }
#line 7083 "src/y.tab.c"
    break;

  case 762: /* action1: action  */
#line 2894 "src/p.y"
                         {
                        (yyval.number) = (yyvsp[0].number);
                        if ((yyvsp[0].number) == Action_Exec && command) {
                                repeat1 = repeat;
                                repeat = 0;
                                command->timeout = timeout;
                                timeout = 0;
                                command1 = command;
                                command = NULL;
                        }
                  }
#line 7099 "src/y.tab.c"
    break;

  case 763: /* action2: action  */
#line 2907 "src/p.y"
                         {
                        (yyval.number) = (yyvsp[0].number);
                        if ((yyvsp[0].number) == Action_Exec && command) {
                                repeat2 = repeat;
                                repeat = 0;
                                command->timeout = timeout;
                                timeout = 0;
                                command2 = command;
                                command = NULL;
                        }
                  }
#line 7115 "src/y.tab.c"
    break;

  case 764: /* rateXcycles: NUMBER CYCLE  */
#line 2920 "src/p.y"
                               {
                        if ((yyvsp[-1].number) < 1 || (unsigned long)(yyvsp[-1].number) > BITMAP_MAX) {
                                yyerror2("The number of cycles must be between 1 and %zu", BITMAP_MAX);
                        } else {
                                rate.count  = (yyvsp[-1].number);
                                rate.cycles = (yyvsp[-1].number);
                        }
                  }
#line 7128 "src/y.tab.c"
    break;

  case 765: /* rateXYcycles: NUMBER NUMBER CYCLE  */
#line 2930 "src/p.y"
                                      {
                        if ((yyvsp[-1].number) < 1 || (unsigned long)(yyvsp[-1].number) > BITMAP_MAX) {
                                yyerror2("The number of cycles must be between 1 and %zu", BITMAP_MAX);
                        } else if ((yyvsp[-2].number) < 1 || (yyvsp[-2].number) > (yyvsp[-1].number)) {
                                yyerror2("The number of events must be between 1 and less then poll cycles");
                        } else {
                                rate.count  = (yyvsp[-2].number);
                                rate.cycles = (yyvsp[-1].number);
                        }
                  }
#line 7143 "src/y.tab.c"
    break;

  case 767: /* rate1: rateXcycles  */
#line 2943 "src/p.y"
                              {
                        rate1.count = rate.count;
                        rate1.cycles = rate.cycles;
                        reset_rateset(&rate);
                  }
#line 7153 "src/y.tab.c"
    break;

  case 768: /* rate1: rateXYcycles  */
#line 2948 "src/p.y"
                               {
                        rate1.count = rate.count;
                        rate1.cycles = rate.cycles;
                        reset_rateset(&rate);
                }
#line 7163 "src/y.tab.c"
    break;

  case 770: /* rate2: rateXcycles  */
#line 2956 "src/p.y"
                              {
                        rate2.count = rate.count;
                        rate2.cycles = rate.cycles;
                        reset_rateset(&rate);
                  }
#line 7173 "src/y.tab.c"
    break;

  case 771: /* rate2: rateXYcycles  */
#line 2961 "src/p.y"
                               {
                        rate2.count = rate.count;
                        rate2.cycles = rate.cycles;
                        reset_rateset(&rate);
                }
#line 7183 "src/y.tab.c"
    break;

  case 772: /* recovery_success: %empty  */
#line 2968 "src/p.y"
                               {
                        (yyval.number) = Action_Alert;
                  }
#line 7191 "src/y.tab.c"
    break;

  case 773: /* recovery_success: ELSE action2  */
#line 2971 "src/p.y"
                               {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7199 "src/y.tab.c"
    break;

  case 774: /* recovery_success: ELSE IF RECOVERED rate2 THEN action2  */
#line 2974 "src/p.y"
                                                       {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7207 "src/y.tab.c"
    break;

  case 775: /* recovery_success: ELSE IF PASSED rate2 THEN action2  */
#line 2977 "src/p.y"
                                                    {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7215 "src/y.tab.c"
    break;

  case 776: /* recovery_success: ELSE IF SUCCEEDED rate2 THEN action2  */
#line 2980 "src/p.y"
                                                       {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7223 "src/y.tab.c"
    break;

  case 777: /* recovery_failure: %empty  */
#line 2985 "src/p.y"
                               {
                        (yyval.number) = Action_Alert;
                  }
#line 7231 "src/y.tab.c"
    break;

  case 778: /* recovery_failure: ELSE action2  */
#line 2988 "src/p.y"
                               {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7239 "src/y.tab.c"
    break;

  case 779: /* recovery_failure: ELSE IF FAILED rate2 THEN action2  */
#line 2991 "src/p.y"
                                                    {
                        (yyval.number) = (yyvsp[0].number);
                  }
#line 7247 "src/y.tab.c"
    break;

  case 780: /* checksum: IF FAILED hashtype CHECKSUM rate1 THEN action1 recovery_success  */
#line 2996 "src/p.y"
                                                                                  {
                        addeventaction(&(checksumset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addchecksum(&checksumset);
                  }
#line 7256 "src/y.tab.c"
    break;

  case 781: /* checksum: IF FAILED hashtype CHECKSUM EXPECT STRING rate1 THEN action1 recovery_success  */
#line 3001 "src/p.y"
                                   {
                        snprintf(checksumset.hash, sizeof(checksumset.hash), "%s", (yyvsp[-4].string));
                        FREE((yyvsp[-4].string));
                        addeventaction(&(checksumset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addchecksum(&checksumset);
                  }
#line 7267 "src/y.tab.c"
    break;

  case 782: /* checksum: IF CHANGED hashtype CHECKSUM rate1 THEN action1  */
#line 3007 "src/p.y"
                                                                  {
                        checksumset.test_changes = true;
                        addeventaction(&(checksumset).action, (yyvsp[0].number), Action_Ignored);
                        addchecksum(&checksumset);
                  }
#line 7277 "src/y.tab.c"
    break;

  case 783: /* hashtype: %empty  */
#line 3013 "src/p.y"
                               { checksumset.type = Hash_Unknown; }
#line 7283 "src/y.tab.c"
    break;

  case 784: /* hashtype: MD5HASH  */
#line 3014 "src/p.y"
                               { checksumset.type = Hash_Md5; }
#line 7289 "src/y.tab.c"
    break;

  case 785: /* hashtype: SHA1HASH  */
#line 3015 "src/p.y"
                               { checksumset.type = Hash_Sha1; }
#line 7295 "src/y.tab.c"
    break;

  case 786: /* hashtype: SHA256HASH  */
#line 3016 "src/p.y"
                               { checksumset.type = Hash_Sha256; }
#line 7301 "src/y.tab.c"
    break;

  case 787: /* inode: IF INODE operator NUMBER rate1 THEN action1 recovery_success  */
#line 3019 "src/p.y"
                                                                               {
                        filesystemset.resource = Resource_Inode;
                        filesystemset.operator = (yyvsp[-5].number);
                        filesystemset.limit_absolute = (yyvsp[-4].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7313 "src/y.tab.c"
    break;

  case 788: /* inode: IF INODE operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3026 "src/p.y"
                                                                                      {
                        filesystemset.resource = Resource_Inode;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_percent = (yyvsp[-5].real);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7325 "src/y.tab.c"
    break;

  case 789: /* inode: IF INODE TFREE operator NUMBER rate1 THEN action1 recovery_success  */
#line 3033 "src/p.y"
                                                                                     {
                        filesystemset.resource = Resource_InodeFree;
                        filesystemset.operator = (yyvsp[-5].number);
                        filesystemset.limit_absolute = (yyvsp[-4].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7337 "src/y.tab.c"
    break;

  case 790: /* inode: IF INODE TFREE operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3040 "src/p.y"
                                                                                            {
                        filesystemset.resource = Resource_InodeFree;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_percent = (yyvsp[-5].real);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7349 "src/y.tab.c"
    break;

  case 791: /* space: IF SPACE operator value unit rate1 THEN action1 recovery_success  */
#line 3049 "src/p.y"
                                                                                   {
                        filesystemset.resource = Resource_Space;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].real) * (yyvsp[-4].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7361 "src/y.tab.c"
    break;

  case 792: /* space: IF SPACE operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3056 "src/p.y"
                                                                                      {
                        filesystemset.resource = Resource_Space;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_percent = (yyvsp[-5].real);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7373 "src/y.tab.c"
    break;

  case 793: /* space: IF SPACE TFREE operator value unit rate1 THEN action1 recovery_success  */
#line 3063 "src/p.y"
                                                                                         {
                        filesystemset.resource = Resource_SpaceFree;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].real) * (yyvsp[-4].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7385 "src/y.tab.c"
    break;

  case 794: /* space: IF SPACE TFREE operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3070 "src/p.y"
                                                                                            {
                        filesystemset.resource = Resource_SpaceFree;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_percent = (yyvsp[-5].real);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7397 "src/y.tab.c"
    break;

  case 795: /* read: IF READ operator value unit currenttime rate1 THEN action1 recovery_success  */
#line 3079 "src/p.y"
                                                                                              {
                        filesystemset.resource = Resource_ReadBytes;
                        filesystemset.operator = (yyvsp[-7].number);
                        filesystemset.limit_absolute = (yyvsp[-6].real) * (yyvsp[-5].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7409 "src/y.tab.c"
    break;

  case 796: /* read: IF READ operator NUMBER OPERATION rate1 THEN action1 recovery_success  */
#line 3086 "src/p.y"
                                                                                        {
                        filesystemset.resource = Resource_ReadOperations;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7421 "src/y.tab.c"
    break;

  case 797: /* write: IF WRITE operator value unit currenttime rate1 THEN action1 recovery_success  */
#line 3095 "src/p.y"
                                                                                               {
                        filesystemset.resource = Resource_WriteBytes;
                        filesystemset.operator = (yyvsp[-7].number);
                        filesystemset.limit_absolute = (yyvsp[-6].real) * (yyvsp[-5].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7433 "src/y.tab.c"
    break;

  case 798: /* write: IF WRITE operator NUMBER OPERATION rate1 THEN action1 recovery_success  */
#line 3102 "src/p.y"
                                                                                         {
                        filesystemset.resource = Resource_WriteOperations;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7445 "src/y.tab.c"
    break;

  case 799: /* servicetime: IF SERVICETIME operator NUMBER MILLISECOND rate1 THEN action1 recovery_success  */
#line 3111 "src/p.y"
                                                                                                 {
                        filesystemset.resource = Resource_ServiceTime;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].number);
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7457 "src/y.tab.c"
    break;

  case 800: /* servicetime: IF SERVICETIME operator value SECOND rate1 THEN action1 recovery_success  */
#line 3118 "src/p.y"
                                                                                           {
                        filesystemset.resource = Resource_ServiceTime;
                        filesystemset.operator = (yyvsp[-6].number);
                        filesystemset.limit_absolute = (yyvsp[-5].real) * 1000;
                        addeventaction(&(filesystemset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addfilesystem(&filesystemset);
                  }
#line 7469 "src/y.tab.c"
    break;

  case 801: /* fsflag: IF CHANGED FSFLAG rate1 THEN action1  */
#line 3127 "src/p.y"
                                                       {
                        addeventaction(&(fsflagset).action, (yyvsp[0].number), Action_Ignored);
                        addfsflag(&fsflagset);
                  }
#line 7478 "src/y.tab.c"
    break;

  case 802: /* unit: %empty  */
#line 3133 "src/p.y"
                               { (yyval.number64) = Unit_Byte; }
#line 7484 "src/y.tab.c"
    break;

  case 803: /* unit: BYTE  */
#line 3134 "src/p.y"
                               { (yyval.number64) = Unit_Byte; }
#line 7490 "src/y.tab.c"
    break;

  case 804: /* unit: KILOBYTE  */
#line 3135 "src/p.y"
                               { (yyval.number64) = Unit_Kilobyte; }
#line 7496 "src/y.tab.c"
    break;

  case 805: /* unit: MEGABYTE  */
#line 3136 "src/p.y"
                               { (yyval.number64) = Unit_Megabyte; }
#line 7502 "src/y.tab.c"
    break;

  case 806: /* unit: GIGABYTE  */
#line 3137 "src/p.y"
                               { (yyval.number64) = Unit_Gigabyte; }
#line 7508 "src/y.tab.c"
    break;

  case 807: /* permission: IF FAILED PERMISSION NUMBER rate1 THEN action1 recovery_success  */
#line 3140 "src/p.y"
                                                                                  {
                        permset.perm = check_perm((yyvsp[-4].number));
                        addeventaction(&(permset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addperm(&permset);
                  }
#line 7518 "src/y.tab.c"
    break;

  case 808: /* permission: IF CHANGED PERMISSION rate1 THEN action1 recovery_success  */
#line 3145 "src/p.y"
                                                                            {
                        permset.test_changes = true;
                        addeventaction(&(permset).action, (yyvsp[-1].number), Action_Ignored);
                        addperm(&permset);
                  }
#line 7528 "src/y.tab.c"
    break;

  case 809: /* programmatch: IF CONTENT urloperator STRING rate1 THEN action1  */
#line 3152 "src/p.y"
                                                                   {
                        matchset.not = (yyvsp[-4].number) == Operator_Equal ? false : true;
                        matchset.ignore = false;
                        matchset.match_path = NULL;
                        matchset.match_string = (yyvsp[-3].string);
                        addmatch(&matchset, (yyvsp[0].number), 0);
                  }
#line 7540 "src/y.tab.c"
    break;

  case 810: /* programmatch: IF CONTENT CHANGED rate1 THEN action1 recovery_success  */
#line 3159 "src/p.y"
                                                                         {
                        addoutputchange(false, (yyvsp[-1].number), (yyvsp[0].number));
                  }
#line 7548 "src/y.tab.c"
    break;

  case 811: /* programmatch: IF CONTENT NOT CHANGED rate1 THEN action1 recovery_success  */
#line 3162 "src/p.y"
                                                                             {
                        addoutputchange(true, (yyvsp[-1].number), (yyvsp[0].number));
                  }
#line 7556 "src/y.tab.c"
    break;

  case 812: /* match: IF CONTENT urloperator PATH rate1 THEN action1  */
#line 3167 "src/p.y"
                                                                 {
                        matchset.not = (yyvsp[-4].number) == Operator_Equal ? false : true;
                        matchset.ignore = false;
                        matchset.match_path = (yyvsp[-3].string);
                        matchset.match_string = NULL;
                        addmatchpath(&matchset, (yyvsp[0].number));
                        FREE((yyvsp[-3].string));
                  }
#line 7569 "src/y.tab.c"
    break;

  case 813: /* match: IF CONTENT urloperator STRING rate1 THEN action1  */
#line 3175 "src/p.y"
                                                                   {
                        matchset.not = (yyvsp[-4].number) == Operator_Equal ? false : true;
                        matchset.ignore = false;
                        matchset.match_path = NULL;
                        matchset.match_string = (yyvsp[-3].string);
                        addmatch(&matchset, (yyvsp[0].number), 0);
                  }
#line 7581 "src/y.tab.c"
    break;

  case 814: /* match: IGNORE CONTENT urloperator PATH  */
#line 3182 "src/p.y"
                                                  {
                        matchset.not = (yyvsp[-1].number) == Operator_Equal ? false : true;
                        matchset.ignore = true;
                        matchset.match_path = (yyvsp[0].string);
                        matchset.match_string = NULL;
                        addmatchpath(&matchset, Action_Ignored);
                        FREE((yyvsp[0].string));
                  }
#line 7594 "src/y.tab.c"
    break;

  case 815: /* match: IGNORE CONTENT urloperator STRING  */
#line 3190 "src/p.y"
                                                    {
                        matchset.not = (yyvsp[-1].number) == Operator_Equal ? false : true;
                        matchset.ignore = true;
                        matchset.match_path = NULL;
                        matchset.match_string = (yyvsp[0].string);
                        addmatch(&matchset, Action_Ignored, 0);
                  }
#line 7606 "src/y.tab.c"
    break;

  case 816: /* match: IF matchflagnot REGEXMATCH PATH rate1 THEN action1  */
#line 3198 "src/p.y"
                                                                     {
                        yydeprecated("'if match' with path is deprecated, use 'if content' instead");
                        matchset.ignore = false;
                        matchset.match_path = (yyvsp[-3].string);
                        matchset.match_string = NULL;
                        addmatchpath(&matchset, (yyvsp[0].number));
                        FREE((yyvsp[-3].string));
                  }
#line 7619 "src/y.tab.c"
    break;

  case 817: /* match: IF matchflagnot REGEXMATCH STRING rate1 THEN action1  */
#line 3206 "src/p.y"
                                                                       {
                        yydeprecated("'if match' is deprecated, use 'if content' instead");
                        matchset.ignore = false;
                        matchset.match_path = NULL;
                        matchset.match_string = (yyvsp[-3].string);
                        addmatch(&matchset, (yyvsp[0].number), 0);
                  }
#line 7631 "src/y.tab.c"
    break;

  case 818: /* match: IGNORE matchflagnot REGEXMATCH PATH  */
#line 3213 "src/p.y"
                                                      {
                        yydeprecated("'ignore match' is deprecated, use 'ignore content' instead");
                        matchset.ignore = true;
                        matchset.match_path = (yyvsp[0].string);
                        matchset.match_string = NULL;
                        addmatchpath(&matchset, Action_Ignored);
                        FREE((yyvsp[0].string));
                  }
#line 7644 "src/y.tab.c"
    break;

  case 819: /* match: IGNORE matchflagnot REGEXMATCH STRING  */
#line 3221 "src/p.y"
                                                        {
                        yydeprecated("'ignore match' is deprecated, use 'ignore content' instead");
                        matchset.ignore = true;
                        matchset.match_path = NULL;
                        matchset.match_string = (yyvsp[0].string);
                        addmatch(&matchset, Action_Ignored, 0);
                  }
#line 7656 "src/y.tab.c"
    break;

  case 820: /* matchflagnot: %empty  */
#line 3230 "src/p.y"
                              {
                        matchset.not = false;
                  }
#line 7664 "src/y.tab.c"
    break;

  case 821: /* matchflagnot: NOT  */
#line 3233 "src/p.y"
                      {
                        matchset.not = true;
                  }
#line 7672 "src/y.tab.c"
    break;

  case 822: /* size: IF SIZE operator NUMBER unit rate1 THEN action1 recovery_success  */
#line 3239 "src/p.y"
                                                                                   {
                        sizeset.operator = (yyvsp[-6].number);
                        sizeset.size = ((unsigned long long)(yyvsp[-5].number) * (yyvsp[-4].number));
                        addeventaction(&(sizeset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addsize(&sizeset);
                  }
#line 7683 "src/y.tab.c"
    break;

  case 823: /* size: IF CHANGED SIZE rate1 THEN action1  */
#line 3245 "src/p.y"
                                                     {
                        sizeset.test_changes = true;
                        addeventaction(&(sizeset).action, (yyvsp[0].number), Action_Ignored);
                        addsize(&sizeset);
                  }
#line 7693 "src/y.tab.c"
    break;

  case 824: /* hardlink: IF HARDLINK operator NUMBER rate1 THEN action1 recovery_success  */
#line 3252 "src/p.y"
                                                                                  {
                        nlinkset.operator = (yyvsp[-5].number);
                        nlinkset.nlink = ((unsigned long long)(yyvsp[-4].number));
                        addeventaction(&(nlinkset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addnlink(&nlinkset);
                  }
#line 7704 "src/y.tab.c"
    break;

  case 825: /* hardlink: IF CHANGED HARDLINK rate1 THEN action1  */
#line 3258 "src/p.y"
                                                         {
                        nlinkset.test_changes = true;
                        addeventaction(&(nlinkset).action, (yyvsp[0].number), Action_Ignored);
                        addnlink(&nlinkset);
                  }
#line 7714 "src/y.tab.c"
    break;

  case 826: /* uid: IF FAILED UID STRING rate1 THEN action1 recovery_success  */
#line 3266 "src/p.y"
                                                                           {
                        uidset.uid = get_uid((yyvsp[-4].string), 0);
                        addeventaction(&(uidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        current->uid = adduid(&uidset);
                        FREE((yyvsp[-4].string));
                  }
#line 7725 "src/y.tab.c"
    break;

  case 827: /* uid: IF FAILED UID NUMBER rate1 THEN action1 recovery_success  */
#line 3272 "src/p.y"
                                                                           {
                    uidset.uid = get_uid(NULL, (yyvsp[-4].number));
                    addeventaction(&(uidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                    current->uid = adduid(&uidset);
                  }
#line 7735 "src/y.tab.c"
    break;

  case 828: /* euid: IF FAILED EUID STRING rate1 THEN action1 recovery_success  */
#line 3279 "src/p.y"
                                                                            {
                        uidset.uid = get_uid((yyvsp[-4].string), 0);
                        addeventaction(&(uidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        current->euid = adduid(&uidset);
                        FREE((yyvsp[-4].string));
                  }
#line 7746 "src/y.tab.c"
    break;

  case 829: /* euid: IF FAILED EUID NUMBER rate1 THEN action1 recovery_success  */
#line 3285 "src/p.y"
                                                                            {
                        uidset.uid = get_uid(NULL, (yyvsp[-4].number));
                        addeventaction(&(uidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        current->euid = adduid(&uidset);
                  }
#line 7756 "src/y.tab.c"
    break;

  case 830: /* secattr: IF FAILED SECURITY ATTRIBUTE secattr_value rate1 THEN action1 recovery_success  */
#line 3292 "src/p.y"
                                                                                                 {
                        addsecurityattribute((yyvsp[-4].string), StringOperator_NotEqual, (yyvsp[-1].number), (yyvsp[0].number));
                  }
#line 7764 "src/y.tab.c"
    break;

  case 831: /* secattr: IF SECURITY ATTRIBUTE secattr_operator secattr_value rate1 THEN action1 recovery_success  */
#line 3295 "src/p.y"
                                                                                                           {
                        addsecurityattribute((yyvsp[-4].string), (yyvsp[-5].number), (yyvsp[-1].number), (yyvsp[0].number));
                  }
#line 7772 "src/y.tab.c"
    break;

  case 832: /* secattr_operator: EQUAL  */
#line 3300 "src/p.y"
                         {
                        (yyval.number) = StringOperator_Equal;
                }
#line 7780 "src/y.tab.c"
    break;

  case 833: /* secattr_operator: NOTEQUAL  */
#line 3303 "src/p.y"
                           {
                        (yyval.number) = StringOperator_NotEqual;
                }
#line 7788 "src/y.tab.c"
    break;

  case 834: /* secattr_operator: REGEXMATCH  */
#line 3306 "src/p.y"
                             {
                        (yyval.number) = StringOperator_RegexMatch;
                }
#line 7796 "src/y.tab.c"
    break;

  case 835: /* secattr_operator: REGEXNOMATCH  */
#line 3309 "src/p.y"
                               {
                        (yyval.number) = StringOperator_RegexNoMatch;
                }
#line 7804 "src/y.tab.c"
    break;

  case 836: /* secattr_value: STRING  */
#line 3314 "src/p.y"
                         {
                        (yyval.string) = (yyvsp[0].string);
                  }
#line 7812 "src/y.tab.c"
    break;

  case 837: /* secattr_value: PATH  */
#line 3317 "src/p.y"
                       {
                        (yyval.string) = (yyvsp[0].string);
                }
#line 7820 "src/y.tab.c"
    break;

  case 838: /* filedescriptorssystem: IF FILEDESCRIPTORS operator NUMBER rate1 THEN action1 recovery_success  */
#line 3322 "src/p.y"
                                                                                               {
                        if (System_Info.statisticsAvailable & Statistics_FiledescriptorsPerSystem)
                                addfiledescriptors((yyvsp[-5].number), false, (long long)(yyvsp[-4].number), -1., (yyvsp[-1].number), (yyvsp[0].number));
                        else
                                yywarning("The per-system filedescriptors statistics is not available on this system\n");
                  }
#line 7831 "src/y.tab.c"
    break;

  case 839: /* filedescriptorssystem: IF FILEDESCRIPTORS operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3328 "src/p.y"
                                                                                                {
                        if (System_Info.statisticsAvailable & Statistics_FiledescriptorsPerSystem)
                                addfiledescriptors((yyvsp[-6].number), false, -1LL, (yyvsp[-5].real), (yyvsp[-1].number), (yyvsp[0].number));
                        else
                                yywarning("The per-system filedescriptors statistics is not available on this system\n");
                  }
#line 7842 "src/y.tab.c"
    break;

  case 840: /* filedescriptorsprocess: IF FILEDESCRIPTORS operator NUMBER rate1 THEN action1 recovery_success  */
#line 3336 "src/p.y"
                                                                                                {
                        if (System_Info.statisticsAvailable & Statistics_FiledescriptorsPerProcess)
                                addfiledescriptors((yyvsp[-5].number), false, (long long)(yyvsp[-4].number), -1., (yyvsp[-1].number), (yyvsp[0].number));
                        else
                                yywarning("The per-process filedescriptors statistics is not available on this system\n");
                  }
#line 7853 "src/y.tab.c"
    break;

  case 841: /* filedescriptorsprocess: IF FILEDESCRIPTORS operator value PERCENT rate1 THEN action1 recovery_success  */
#line 3342 "src/p.y"
                                                                                                {
                        if (System_Info.statisticsAvailable & Statistics_FiledescriptorsPerProcessMax)
                                addfiledescriptors((yyvsp[-6].number), false, -1LL, (yyvsp[-5].real), (yyvsp[-1].number), (yyvsp[0].number));
                        else
                                yywarning("The per-process filedescriptors maximum is not exposed on this system, so we cannot compute usage %%, please use the test with absolute value\n");
                  }
#line 7864 "src/y.tab.c"
    break;

  case 842: /* filedescriptorsprocesstotal: IF TOTAL FILEDESCRIPTORS operator NUMBER rate1 THEN action1 recovery_success  */
#line 3350 "src/p.y"
                                                                                                           {
                        if (System_Info.statisticsAvailable & Statistics_FiledescriptorsPerProcess)
                                addfiledescriptors((yyvsp[-5].number), true, (long long)(yyvsp[-4].number), -1., (yyvsp[-1].number), (yyvsp[0].number));
                        else
                                yywarning("The per-process filedescriptors statistics is not available on this system\n");
                  }
#line 7875 "src/y.tab.c"
    break;

  case 843: /* gid: IF FAILED GID STRING rate1 THEN action1 recovery_success  */
#line 3358 "src/p.y"
                                                                           {
                        gidset.gid = get_gid((yyvsp[-4].string), 0);
                        addeventaction(&(gidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        current->gid = addgid(&gidset);
                        FREE((yyvsp[-4].string));
                  }
#line 7886 "src/y.tab.c"
    break;

  case 844: /* gid: IF FAILED GID NUMBER rate1 THEN action1 recovery_success  */
#line 3364 "src/p.y"
                                                                           {
                        gidset.gid = get_gid(NULL, (yyvsp[-4].number));
                        addeventaction(&(gidset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        current->gid = addgid(&gidset);
                  }
#line 7896 "src/y.tab.c"
    break;

  case 845: /* linkstatus: IF FAILED LINK rate1 THEN action1 recovery_success  */
#line 3371 "src/p.y"
                                                                  { /* Deprecated */
                        yydeprecated("'if failed link' is deprecated, use 'if link down' instead");
                        addeventaction(&(linkstatusset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addlinkstatus(current, &linkstatusset);
                  }
#line 7906 "src/y.tab.c"
    break;

  case 846: /* linkstatus: IF LINK DOWN rate1 THEN action1 recovery_success  */
#line 3376 "src/p.y"
                                                                {
                        linkstatusset.check_invers = false;
                        addeventaction(&(linkstatusset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addlinkstatus(current, &linkstatusset);
                  }
#line 7916 "src/y.tab.c"
    break;

  case 847: /* linkstatus: IF LINK UP rate1 THEN action1 recovery_failure  */
#line 3381 "src/p.y"
                                                              {
                        linkstatusset.check_invers = true;
                        addeventaction(&(linkstatusset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addlinkstatus(current, &linkstatusset);
                  }
#line 7926 "src/y.tab.c"
    break;

  case 848: /* linkspeed: IF CHANGED LINK rate1 THEN action1 recovery_success  */
#line 3388 "src/p.y"
                                                                   {
                        addeventaction(&(linkspeedset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addlinkspeed(current, &linkspeedset);
                  }
#line 7935 "src/y.tab.c"
    break;

  case 849: /* linksaturation: IF SATURATION operator NUMBER PERCENT rate1 THEN action1 recovery_success  */
#line 3393 "src/p.y"
                                                                                           {
                        linksaturationset.operator = (yyvsp[-6].number);
                        linksaturationset.limit = (unsigned long long)(yyvsp[-5].number);
                        addeventaction(&(linksaturationset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addlinksaturation(current, &linksaturationset);
                  }
#line 7946 "src/y.tab.c"
    break;

  case 850: /* upload: IF UPLOAD operator NUMBER unit currenttime rate1 THEN action1 recovery_success  */
#line 3401 "src/p.y"
                                                                                                 {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-6].number) * (yyvsp[-5].number));
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadbyteslist), &bandwidthset);
                  }
#line 7959 "src/y.tab.c"
    break;

  case 851: /* upload: IF TOTAL UPLOAD operator NUMBER unit totaltime rate1 THEN action1 recovery_success  */
#line 3409 "src/p.y"
                                                                                                     {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-6].number) * (yyvsp[-5].number));
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadbyteslist), &bandwidthset);
                  }
#line 7972 "src/y.tab.c"
    break;

  case 852: /* upload: IF TOTAL UPLOAD operator NUMBER unit NUMBER totaltime rate1 THEN action1 recovery_success  */
#line 3417 "src/p.y"
                                                                                                            {
                        bandwidthset.operator = (yyvsp[-8].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-7].number) * (yyvsp[-6].number));
                        bandwidthset.rangecount = (yyvsp[-5].number);
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadbyteslist), &bandwidthset);
                  }
#line 7985 "src/y.tab.c"
    break;

  case 853: /* upload: IF UPLOAD operator NUMBER PACKET currenttime rate1 THEN action1 recovery_success  */
#line 3425 "src/p.y"
                                                                                                   {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-6].number);
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadpacketslist), &bandwidthset);
                  }
#line 7998 "src/y.tab.c"
    break;

  case 854: /* upload: IF TOTAL UPLOAD operator NUMBER PACKET totaltime rate1 THEN action1 recovery_success  */
#line 3433 "src/p.y"
                                                                                                       {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-6].number);
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadpacketslist), &bandwidthset);
                  }
#line 8011 "src/y.tab.c"
    break;

  case 855: /* upload: IF TOTAL UPLOAD operator NUMBER PACKET NUMBER totaltime rate1 THEN action1 recovery_success  */
#line 3441 "src/p.y"
                                                                                                              {
                        bandwidthset.operator = (yyvsp[-8].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-7].number);
                        bandwidthset.rangecount = (yyvsp[-5].number);
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->uploadpacketslist), &bandwidthset);
                  }
#line 8024 "src/y.tab.c"
    break;

  case 856: /* download: IF DOWNLOAD operator NUMBER unit currenttime rate1 THEN action1 recovery_success  */
#line 3451 "src/p.y"
                                                                                                   {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-6].number) * (yyvsp[-5].number));
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadbyteslist), &bandwidthset);
                  }
#line 8037 "src/y.tab.c"
    break;

  case 857: /* download: IF TOTAL DOWNLOAD operator NUMBER unit totaltime rate1 THEN action1 recovery_success  */
#line 3459 "src/p.y"
                                                                                                       {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-6].number) * (yyvsp[-5].number));
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadbyteslist), &bandwidthset);
                  }
#line 8050 "src/y.tab.c"
    break;

  case 858: /* download: IF TOTAL DOWNLOAD operator NUMBER unit NUMBER totaltime rate1 THEN action1 recovery_success  */
#line 3467 "src/p.y"
                                                                                                              {
                        bandwidthset.operator = (yyvsp[-8].number);
                        bandwidthset.limit = ((unsigned long long)(yyvsp[-7].number) * (yyvsp[-6].number));
                        bandwidthset.rangecount = (yyvsp[-5].number);
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadbyteslist), &bandwidthset);
                  }
#line 8063 "src/y.tab.c"
    break;

  case 859: /* download: IF DOWNLOAD operator NUMBER PACKET currenttime rate1 THEN action1 recovery_success  */
#line 3475 "src/p.y"
                                                                                                     {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-6].number);
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadpacketslist), &bandwidthset);
                  }
#line 8076 "src/y.tab.c"
    break;

  case 860: /* download: IF TOTAL DOWNLOAD operator NUMBER PACKET totaltime rate1 THEN action1 recovery_success  */
#line 3483 "src/p.y"
                                                                                                         {
                        bandwidthset.operator = (yyvsp[-7].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-6].number);
                        bandwidthset.rangecount = 1;
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadpacketslist), &bandwidthset);
                  }
#line 8089 "src/y.tab.c"
    break;

  case 861: /* download: IF TOTAL DOWNLOAD operator NUMBER PACKET NUMBER totaltime rate1 THEN action1 recovery_success  */
#line 3491 "src/p.y"
                                                                                                                {
                        bandwidthset.operator = (yyvsp[-8].number);
                        bandwidthset.limit = (unsigned long long)(yyvsp[-7].number);
                        bandwidthset.rangecount = (yyvsp[-5].number);
                        bandwidthset.range = (yyvsp[-4].number);
                        addeventaction(&(bandwidthset).action, (yyvsp[-1].number), (yyvsp[0].number));
                        addbandwidth(&(current->downloadpacketslist), &bandwidthset);
                  }
#line 8102 "src/y.tab.c"
    break;

  case 862: /* icmptype: TYPE ICMPECHO  */
#line 3501 "src/p.y"
                                { (yyval.number) = ICMP_ECHO; }
#line 8108 "src/y.tab.c"
    break;

  case 863: /* reminder: %empty  */
#line 3504 "src/p.y"
                                        { mailset.reminder = 0; }
#line 8114 "src/y.tab.c"
    break;

  case 864: /* reminder: REMINDER NUMBER  */
#line 3505 "src/p.y"
                                        { mailset.reminder = (yyvsp[0].number); }
#line 8120 "src/y.tab.c"
    break;

  case 865: /* reminder: REMINDER NUMBER CYCLE  */
#line 3506 "src/p.y"
                                        { mailset.reminder = (yyvsp[-1].number); }
#line 8126 "src/y.tab.c"
    break;


#line 8130 "src/y.tab.c"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;

  *++yyvsp = yyval;

  /* Now 'shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror (YY_("syntax error"));
    }

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval);
          yychar = YYEMPTY;
        }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  /* Pop stack until we find a state that shifts the error token.  */
  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYSYMBOL_YYerror;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;


      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif

  return yyresult;
}

#line 3509 "src/p.y"



/* -------------------------------------------------------- Parser interface */


/**
 * Syntactic error routine
 *
 * This routine is automatically called by the lexer!
 */
void yyerror(const char *s, ...) {
        assert(s);
        char *msg = NULL;
        va_list ap;
        va_start(ap, s);
        msg = Str_vcat(s, ap);
        va_end(ap);
        Log_error("%s:%i: %s '%s'\n", currentfile, lineno, msg, yytext);
        cfg_errflag++;
        FREE(msg);
}


/**
 * Syntactical warning routine
 */
void yywarning(const char *s, ...) {
        assert(s);
        char *msg = NULL;
        va_list ap;
        va_start(ap, s);
        msg = Str_vcat(s, ap);
        va_end(ap);
        Log_warning("%s:%i: %s '%s'\n", currentfile, lineno, msg, yytext);
        FREE(msg);
}


/**
 * Argument error routine
 */
void yyerror2(const char *s, ...) {
        assert(s);
        char *msg = NULL;
        va_list ap;
        va_start(ap, s);
        msg = Str_vcat(s, ap);
        va_end(ap);
        Log_error("%s:%i: %s '%s'\n", argcurrentfile, arglineno, msg, argyytext);
        cfg_errflag++;
        FREE(msg);
}


/**
 * Argument warning routine
 */
void yywarning2(const char *s, ...) {
        assert(s);
        char *msg = NULL;
        va_list ap;
        va_start(ap, s);
        msg = Str_vcat(s, ap);
        va_end(ap);
        Log_warning("%s:%i: %s '%s'\n", argcurrentfile, arglineno, msg, argyytext);
        FREE(msg);
}


/*
 * The Parser hook - start parsing the control file
 * Returns true if parsing succeeded, otherwise false
 */
bool parse(char *controlfile) {
        assert(controlfile);

        if ((yyin = fopen(controlfile,"r")) == (FILE *)NULL) {
                Log_error("Cannot open the control file '%s' -- %s\n", controlfile, STRERROR);
                return false;
        }

        currentfile = Str_dup(controlfile);

        available_statistics(&System_Info);

        /*
         * Creation of the global service list is synchronized
         */
        LOCK(Run.mutex)
        {
                preparse();
                yyparse();
                fclose(yyin);
                postparse();
        }
        END_LOCK;

        FREE(currentfile);

        if (argyytext != NULL)
                FREE(argyytext);

        /*
         * Secure check the monitrc file. The run control file must have the
         * same uid as the REAL uid of this process, it must have permissions
         * no greater than 700 and it must not be a symbolic link.
         */
        if (! file_checkStat(controlfile, "control file", S_IRUSR|S_IWUSR|S_IXUSR))
                return false;

        return cfg_errflag == 0;
}


/* ----------------------------------------------------------------- Private */

        
static void yydeprecated(const char *s, ...) {
        assert(s);
        char *msg = NULL;
        va_list ap;
        va_start(ap, s);
        msg = Str_vcat(s, ap);
        va_end(ap);
        Log_warning("%s:%i: %s\n", currentfile, lineno, msg);
        FREE(msg);
}
                

/**
 * Initialize objects used by the parser.
 */
static void preparse(void) {
        Service_List = tail = current = NULL;
        /* Set instance incarnation ID */
        time(&Run.incarnation);
        /* Reset lexer */
        buffer_stack_ptr            = 0;
        lineno                      = 1;
        arglineno                   = 1;
        argcurrentfile              = NULL;
        argyytext                   = NULL;
        /* Reset parser */
        Run.limits.sendExpectBuffer  = LIMIT_SENDEXPECTBUFFER;
        Run.limits.fileContentBuffer = LIMIT_FILECONTENTBUFFER;
        Run.limits.httpContentBuffer = LIMIT_HTTPCONTENTBUFFER;
        Run.limits.programOutput     = LIMIT_PROGRAMOUTPUT;
        Run.limits.networkTimeout    = LIMIT_NETWORKTIMEOUT;
        Run.limits.programTimeout    = LIMIT_PROGRAMTIMEOUT;
        Run.limits.stopTimeout       = LIMIT_STOPTIMEOUT;
        Run.limits.startTimeout      = LIMIT_STARTTIMEOUT;
        Run.limits.restartTimeout    = LIMIT_RESTARTTIMEOUT;
        Run.limits.execTimeout       = LIMIT_EXECTIMEOUT;
        Run.onreboot                 = Onreboot_Start;
        Run.mmonitcredentials        = NULL;
        Run.httpd.flags              = Httpd_Disabled | Httpd_Signature;
        Run.httpd.credentials        = NULL;
        memset(&(Run.httpd.socket), 0, sizeof(Run.httpd.socket));
        Run.mailserver_timeout       = SMTP_TIMEOUT;
        Run.eventlist_dir            = NULL;
        Run.eventlist_slots          = -1;
        Run.system                   = NULL;
        Run.needHeartBeat            = false;
        Run.mmonits                  = NULL;
        Run.maillist                 = NULL;
        Run.mailservers              = NULL;
        Run.MailFormat.from          = NULL;
        Run.MailFormat.replyto       = NULL;
        Run.MailFormat.subject       = NULL;
        Run.MailFormat.message       = NULL;
        depend_list                  = NULL;
        Run.flags |= Run_HandlerInit | Run_MmonitCredentials;
        for (int i = 0; i <= Handler_Max; i++)
                Run.handler_queue[i] = 0;

        /*
         * Initialize objects
         */
        reset_uidset();
        reset_gidset();
        reset_statusset();
        reset_sizeset();
        reset_nlinkset();
        reset_mailset();
        reset_sslset();
        reset_mailserverset();
        reset_mmonitset();
        reset_responsetimeset();
        reset_portset();
        reset_permset();
        reset_icmpset();
        reset_linkstatusset();
        reset_linkspeedset();
        reset_linksaturationset();
        reset_bandwidthset();
        reset_rateset(&rate);
        reset_rateset(&rate1);
        reset_rateset(&rate2);
        reset_filesystemset();
        reset_resourceset();
        reset_checksumset();
        reset_timestampset();
        reset_actionrateset();
}


/*
 * Check that values are reasonable after parsing
 */
static void postparse(void) {
        if (cfg_errflag)
                return;

        /* If defined - add the last service to the service list */
        if (current) {
                addservice(current);
                current = NULL;
        }

        /* Check that we do not start monit in daemon mode without having a poll time */
        if (Run.polltime <= 0 && ((Run.flags & Run_Daemon) || (Run.flags & Run_Foreground))) {
                Log_error("Poll time is invalid or not defined. Please define poll time in the control file\nas a number (> 0)  or use the -d option when starting monit\n");
                cfg_errflag++;
        }

        if (Run.files.log)
                Run.flags |= Run_Log;

        /* Add the default general system service if not specified explicitly: service name default to hostname */
        if (! Run.system) {
                char hostname[STRLEN];
                if (gethostname(hostname, sizeof(hostname))) {
                        Log_error("Cannot get system hostname -- please add 'check system <name>'\n");
                        cfg_errflag++;
                }
                if (Util_existService(hostname)) {
                        Log_error("'check system' not defined in control file, failed to add automatic configuration (service name %s is used already) -- please add 'check system <name>' manually\n", hostname);
                        cfg_errflag++;
                }
                Run.system = createservice(Service_System, Str_dup(hostname), NULL, check_system);
                addservice(Run.system);
        }
        addeventaction(&(Run.system->action_MONIT_START), Action_Start, Action_Ignored);
        addeventaction(&(Run.system->action_MONIT_STOP), Action_Stop,  Action_Ignored);

        if (Run.mmonits) {
                if (Run.httpd.flags & Httpd_Net) {
                        if (Run.flags & Run_MmonitCredentials) {
                                Auth_T c;
                                for (c = Run.httpd.credentials; c; c = c->next) {
                                        if (c->digesttype == Digest_Cleartext && ! c->is_readonly) {
                                                Run.mmonitcredentials = c;
                                                break;
                                        }
                                }
                                if (! Run.mmonitcredentials)
                                        Log_warning("M/Monit registration with credentials enabled, but no suitable credentials found in monit configuration file -- please add 'allow user:password' option to 'set httpd' statement\n");
                        }
                } else if (Run.httpd.flags & Httpd_Unix) {
                        Log_warning("M/Monit enabled but Monit httpd is using unix socket -- please change 'set httpd' statement to use TCP port in order to be able to manage services on Monit\n");
                } else {
                        Log_warning("M/Monit enabled but no httpd allowed -- please add 'set httpd' statement\n");
                }
        }

        // Should Monit run with a heartbeat thread? It's also set to true if 'every cron' was parsed
        Run.needHeartBeat |= (Run.mmonits != NULL);

        /* Check the sanity of any dependency graph */
        check_depend();

#if defined HAVE_OPENSSL && defined OPENSSL_FIPS
        Ssl_setFipsMode(Run.flags & Run_FipsEnabled);
#endif

        Processor_setHttpPostLimit();
}


static bool _parseOutgoingAddress(char *ip, Outgoing_T *outgoing) {
        struct addrinfo *result, hints = {.ai_flags = AI_NUMERICHOST};
        int status = getaddrinfo(ip, NULL, &hints, &result);
        if (status == 0) {
                outgoing->ip = ip;
                outgoing->addrlen = result->ai_addrlen;
                memcpy(&(outgoing->addr), result->ai_addr, result->ai_addrlen);
                freeaddrinfo(result);
                return true;
        } else {
                yyerror2("IP address parsing failed for %s -- %s", ip, status == EAI_SYSTEM ? STRERROR : gai_strerror(status));
        }
        return false;
}


/*
 * Create a new service object and add any current objects to the
 * service list.
 */
static Service_T createservice(Service_Type type, char *name, char *value, State_Type (*check)(Service_T s)) {
        assert(name);

        check_name(name);

        if (current)
                addservice(current);

        NEW(current);
        current->type = type;
        switch (type) {
                case Service_Directory:
                        NEW(current->inf.directory);
                        break;
                case Service_Fifo:
                        NEW(current->inf.fifo);
                        break;
                case Service_File:
                        NEW(current->inf.file);
                        break;
                case Service_Filesystem:
                        NEW(current->inf.filesystem);
                        break;
                case Service_Net:
                        NEW(current->inf.net);
                        break;
                case Service_Process:
                        NEW(current->inf.process);
                        break;
                default:
                        break;
        }
        Util_resetInfo(current);

        if (type == Service_Program) {
                NEW(current->program);
                current->program->args = command;
                command = NULL;
                current->program->timeout = Run.limits.programTimeout;
        }

        /* Set default values */
        current->onrebootRestored = false;
        current->mode     = Monitor_Active;
        current->monitor  = Monitor_Init;
        current->onreboot = Run.onreboot;
        current->name     = name;
        current->name_urlescaped = Util_urlEncode(name, false);
        current->name_htmlescaped = escapeHTML(StringBuffer_create(16), name);
        current->check    = check;
        current->path     = value;

        /* Initialize general event handlers */
        addeventaction(&(current)->action_DATA,     Action_Alert,     Action_Alert);
        addeventaction(&(current)->action_EXEC,     Action_Alert,     Action_Alert);
        addeventaction(&(current)->action_INVALID,  Action_Restart,   Action_Alert);

        /* Initialize internal event handlers */
        addeventaction(&(current)->action_ACTION,       Action_Alert, Action_Ignored);

        gettimeofday(&current->collected, NULL);

        return current;
}


/*
 * Add a service object to the Service_List
 */
static void addservice(Service_T s) {
        assert(s);

        // Test sanity check
        switch (s->type) {
                case Service_Host:
                        // Verify that a remote service has a port or an icmp list
                        if (! s->portlist && ! s->icmplist) {
                                Log_error("'check host' statement is incomplete: Please specify a port number to test\n or an icmp test at the remote host: '%s'\n", s->name);
                                cfg_errflag++;
                        }
                        break;
                case Service_Program:
                        // Verify that a program test has a status test
                        if (! s->statuslist && ! s->matchlist && ! s->outputchangelist) {
                                Log_error("'check program %s' is incomplete: Please add a 'status' or 'content' test\n", s->name);
                                cfg_errflag++;
                        }
                        char program[PATH_MAX];
                        strncpy(program, s->program->args->arg[0], sizeof(program) - 1);
                        // Require that the program exist before creating the Command object
                        if (File_isExecutable(program)) {
                                s->program->C = Command_new(program, NULL);
                                for (int i = 1; i < s->program->args->length; i++) {
                                        Command_appendArgument(s->program->C, s->program->args->arg[i]);
                                        snprintf(program + strlen(program), sizeof(program) - strlen(program) - 1, " %s", s->program->args->arg[i]);
                                }
                                s->path = Str_dup(program);
                                if (s->program->args->has_uid)
                                        Command_setUid(s->program->C, s->program->args->uid);
                                if (s->program->args->has_gid)
                                        Command_setGid(s->program->C, s->program->args->gid);
                                // Set environment
                                Command_setEnv(s->program->C, "MONIT_SERVICE", s->name);
                        } else {
                                Log_error("A 'check program' statement requires the program to exist '%s'\n", program);
                                cfg_errflag++;
                        }
                        break;
                case Service_Net:
                        if (! s->linkstatuslist) {
                                // Add link status test if not defined
                                addeventaction(&(linkstatusset).action, Action_Alert, Action_Alert);
                                addlinkstatus(s, &linkstatusset);
                        }
                        break;
                case Service_Filesystem:
                        if (! s->nonexistlist && ! s->existlist) {
                                // Add non-existence test if not defined
                                addeventaction(&(nonexistset).action, Action_Restart, Action_Alert);
                                addnonexist(&nonexistset);
                        }
                        if (! s->fsflaglist) {
                                // Add filesystem flags change test if not defined
                                addeventaction(&(fsflagset).action, Action_Alert, Action_Ignored);
                                addfsflag(&fsflagset);
                        }
                        break;
                case Service_Directory:
                case Service_Fifo:
                case Service_File:
                case Service_Process:
                        if (! s->nonexistlist && ! s->existlist) {
                                // Add existence test if not defined
                                addeventaction(&(nonexistset).action, Action_Restart, Action_Alert);
                                addnonexist(&nonexistset);
                        }
                        break;
                default:
                        break;
        }

        // No "every" statement was used, monitor each cycle
        if (s->every.type == Every_Initializing)
                s->every.type = Every_Cycle;

        /* Add the service to the end of the service list */
        if (tail != NULL) {
                tail->next = s;
                tail->next_conf = s;
        } else {
                Service_List = s;
                Service_List_Conf = s;
        }
        tail = s;
}


/*
 * Add entry to service group list
 */
static void addservicegroup(char *name) {
        ServiceGroup_T g;

        assert(name);

        /* Check if service group with the same name is defined already */
        for (g = Service_Group_List; g; g = g->next)
                if (IS(g->name, name))
                        break;

        if (! g) {
                NEW(g);
                g->name = Str_dup(name);
                g->members = List_new();
                g->next = Service_Group_List;
                Service_Group_List = g;
        }

        List_append(g->members, current);
}


/*
 * Add entry to M/Monit hostgroup membership list
 */
static void addhostgroup(char *name) {
        if (! mmonitset.hostgroups)
                mmonitset.hostgroups = List_new();
        List_append(mmonitset.hostgroups, name);
}


/*
 * Add a dependant entry to the current service dependant list
 */
static void adddependant(char *dependant) {
        Dependant_T d;

        assert(dependant);

        NEW(d);

        if (current->dependantlist)
                d->next = current->dependantlist;

        d->dependant = dependant;
        d->dependant_urlescaped = Util_urlEncode(dependant, false);
        d->dependant_htmlescaped = escapeHTML(StringBuffer_create(16), dependant);
        current->dependantlist = d;

}


/*
 * Add the given mailaddress with the appropriate alert notification
 * values and mail attributes to the given mailinglist.
 */
static void addmail(char *mailto, Mail_T f, Mail_T *l) {
        Mail_T m;

        assert(mailto);

        NEW(m);
        m->to       = mailto;
        m->from     = f->from;
        m->replyto  = f->replyto;
        m->subject  = f->subject;
        m->message  = f->message;
        m->events   = f->events;
        m->reminder = f->reminder;

        m->next = *l;
        *l = m;

        reset_mailset();
}


/*
 * Add the given portset to the current service's portlist
 */
static void addport(Port_T *list, Port_T port) {
        assert(port);

        if (port->protocol->check == check_radius && port->type != Socket_Udp)
                yyerror("Radius protocol test supports UDP only");

        Port_T p;
        NEW(p);
        p->is_available       = Connection_Init;
        p->check_invers       = port->check_invers;
        p->type               = port->type;
        p->socket             = port->socket;
        p->family             = port->family;
        p->action             = port->action;
        p->timeout            = port->timeout;
        p->retry              = port->retry;
        p->protocol           = port->protocol;
        p->hostname           = port->hostname;
        p->url_request        = port->url_request;
        p->outgoing           = port->outgoing;

        if (p->family == Socket_Unix) {
                p->target.unix.pathname = port->target.unix.pathname;
        } else {
                p->target.net.port = port->target.net.port;
                if (sslset.flags) {
#ifdef HAVE_OPENSSL
                        p->target.net.ssl.certificate.minimumDays = port->target.net.ssl.certificate.minimumDays;
                        if (sslset.flags && (p->target.net.port == 25 || p->target.net.port == 143 || p->target.net.port == 587))
                                sslset.flags = SSL_StartTLS;
                        _setSSLOptions(&(p->target.net.ssl.options));
#else
                        yyerror("SSL check cannot be activated -- Monit was not built with SSL support");
#endif
                }
        }
        memcpy(&p->parameters, &port->parameters, sizeof(port->parameters));

        if (p->protocol->check == check_http) {
                if (p->parameters.http.checksum) {
                        cleanup_hash_string(p->parameters.http.checksum);
                        if (strlen(p->parameters.http.checksum) == 32)
                                p->parameters.http.hashtype = Hash_Md5;
                        else if (strlen(p->parameters.http.checksum) == 40)
                                p->parameters.http.hashtype = Hash_Sha1;
                        else if (strlen(p->parameters.http.checksum) == 64)
                                p->parameters.http.hashtype = Hash_Sha256;
                        else
                                yyerror2("invalid checksum [%s]", p->parameters.http.checksum);
                } else {
                        p->parameters.http.hashtype = Hash_Unknown;
                }
                if (! p->parameters.http.method) {
                        p->parameters.http.method = Http_Get;
                } else if (p->parameters.http.method == Http_Head) {
                        // Sanity check: if content or checksum test is used, the method Http_Head is not allowed, as we need the content
                        if ((p->url_request && p->url_request->regex) || p->parameters.http.checksum) {
                                yyerror2("if response content or checksum test is enabled, the HEAD method is not allowed");
                        }
                }
        } else if (p->protocol->check == check_mysql) {
                if (p->parameters.mysql.rsaChecksum) {
                        if (! p->parameters.mysql.username)
                                yyerror2("the rsakey checksum test requires credentials to be defined");
                        if (p->target.net.ssl.options.flags != SSL_Disabled)
                                yyerror2("the rsakey checksum test can be used just with unsecured mysql protocol");
                }
        }

        p->responsetime.limit    = responsetimeset.limit;
        p->responsetime.current  = responsetimeset.current;
        p->responsetime.operator = responsetimeset.operator;

        p->next = *list;
        *list = p;

        reset_sslset();
        reset_responsetimeset();
        reset_portset();

}


static void addhttpheader(Port_T port, char *header) {
        if (! port->parameters.http.headers) {
                port->parameters.http.headers = List_new();
        }
        if (Str_startsWith(header, "Connection:") && ! Str_sub(header, "close")) {
                yywarning("We don't recommend setting the Connection header. Monit will always close the connection even if 'keep-alive' is set\n");
        }
        List_append(port->parameters.http.headers, header);
}


/*
 * Add a new resource object to the current service resource list
 */
static void addresource(Resource_T rr) {
        assert(rr);
        if (Run.flags & Run_ProcessEngineEnabled) {
                Resource_T r;
                NEW(r);
                r->resource_id = rr->resource_id;
                r->limit       = rr->limit;
                r->action      = rr->action;
                r->operator    = rr->operator;
                r->next        = current->resourcelist;
                current->resourcelist = r;
        } else {
                yywarning("Cannot activate service check. The process status engine was disabled. On certain systems you must run monit as root to utilize this feature)\n");
        }
        reset_resourceset();
}


/*
 * Add a new file object to the current service timestamp list
 */
static void addtimestamp(Timestamp_T ts) {
        assert(ts);

        Timestamp_T t;
        NEW(t);
        t->type         = ts->type;
        t->operator     = ts->operator;
        t->time         = ts->time;
        t->action       = ts->action;
        t->test_changes = ts->test_changes;

        t->next = current->timestamplist;
        current->timestamplist = t;

        reset_timestampset();
}


/*
 * Add a new object to the current service actionrate list
 */
static void addactionrate(ActionRate_T ar) {
        ActionRate_T a;

        assert(ar);

        if (ar->count > ar->cycle)
                yyerror2("The number of restarts must be less than poll cycles");
        if (ar->count <= 0 || ar->cycle <= 0)
                yyerror2("Zero or negative values not allowed in a action rate statement");

        NEW(a);
        a->count  = ar->count;
        a->cycle  = ar->cycle;
        a->action = ar->action;

        a->next = current->actionratelist;
        current->actionratelist = a;

        reset_actionrateset();
}



/*
 * Add a new Size object to the current service size list
 */
static void addsize(Size_T ss) {
        Size_T s;
        struct stat buf;

        assert(ss);

        NEW(s);
        s->operator     = ss->operator;
        s->size         = ss->size;
        s->action       = ss->action;
        s->test_changes = ss->test_changes;
        /* Get the initial size for future comparison, if the file exists */
        if (s->test_changes) {
                s->initialized = ! stat(current->path, &buf);
                if (s->initialized)
                        s->size = (unsigned long long)buf.st_size;
        }

        s->next = current->sizelist;
        current->sizelist = s;

        reset_sizeset();
}


/*
 * Add a new NLink object to the current service nlink list
 */
static void addnlink(NLink_T ss) {
        NLink_T s;
        struct stat buf;
    
        assert(ss);
    
        NEW(s);
        s->operator     = ss->operator;
        s->nlink        = ss->nlink;
        s->action       = ss->action;
        s->test_changes = ss->test_changes;
        /* Get the initial size for future comparison */
        if (s->test_changes) {
                s->initialized = ! stat(current->path, &buf);
                if (s->initialized)
                        s->nlink = (unsigned long long)buf.st_nlink;
        }
    
        s->next = current->nlinklist;
        current->nlinklist = s;
    
        reset_nlinkset();
}


/*
 * Add a new Uptime object to the current service uptime list
 */
static void adduptime(Uptime_T uu) {
        Uptime_T u;

        assert(uu);

        NEW(u);
        u->operator = uu->operator;
        u->uptime = uu->uptime;
        u->action = uu->action;

        u->next = current->uptimelist;
        current->uptimelist = u;

        reset_uptimeset();
}


/*
 * Add a new Pid object to the current service pid list
 */
static void addpid(Pid_T pp) {
        assert(pp);

        Pid_T p;
        NEW(p);
        p->action = pp->action;

        p->next = current->pidlist;
        current->pidlist = p;

        reset_pidset();
}


/*
 * Add a new PPid object to the current service ppid list
 */
static void addppid(Pid_T pp) {
        assert(pp);

        Pid_T p;
        NEW(p);
        p->action = pp->action;

        p->next = current->ppidlist;
        current->ppidlist = p;

        reset_ppidset();
}


/*
 * Add a new Fsflag object to the current service fsflag list
 */
static void addfsflag(FsFlag_T ff) {
        assert(ff);

        FsFlag_T f;
        NEW(f);
        f->action = ff->action;

        f->next = current->fsflaglist;
        current->fsflaglist = f;

        reset_fsflagset();
}


/*
 * Add a new Nonexist object to the current service list
 */
static void addnonexist(NonExist_T ff) {
        assert(ff);

        NonExist_T f;
        NEW(f);
        f->action = ff->action;

        f->next = current->nonexistlist;
        current->nonexistlist = f;

        reset_nonexistset();
}


static void addexist(Exist_T rule) {
        assert(rule);
        Exist_T r;
        NEW(r);
        r->action = rule->action;
        r->next = current->existlist;
        current->existlist = r;
        reset_existset();
}


/*
 * Set Checksum object in the current service
 */
static void addchecksum(Checksum_T cs) {
        assert(cs);

        cs->initialized = true;

        if (STR_UNDEF(cs->hash)) {
                if (cs->type == Hash_Unknown)
                        cs->type = Hash_Default;
                if (! (Checksum_getChecksum(current->path, cs->type, cs->hash, sizeof(cs->hash)))) {
                        /* If the file doesn't exist, set dummy value */
                        if (cs->type == Hash_Md5)
                                snprintf(cs->hash, sizeof(cs->hash), "00000000000000000000000000000000");
                        else if (cs->type == Hash_Sha1)
                                snprintf(cs->hash, sizeof(cs->hash), "0000000000000000000000000000000000000000");
                        else if (cs->type == Hash_Sha256)
                                snprintf(cs->hash, sizeof(cs->hash), "0000000000000000000000000000000000000000000000000000000000000000");
                        cs->initialized = false;
                        yywarning2("Cannot compute a checksum for file %s", current->path);
                }
        }

        int len = cleanup_hash_string(cs->hash);
        if (cs->type == Hash_Unknown) {
                if (len == 32) {
                        cs->type = Hash_Md5;
                } else if (len == 40) {
                        cs->type = Hash_Sha1;
                } else if (len == 64) {
                        cs->type = Hash_Sha256;
                } else {
                        yyerror2("Unknown checksum type [%s] for file %s", cs->hash, current->path);
                        reset_checksumset();
                        return;
                }
        } else if ((cs->type == Hash_Md5 && len != 32) || (cs->type == Hash_Sha1 && len != 40)) {
                yyerror2("Invalid checksum [%s] for file %s", cs->hash, current->path);
                reset_checksumset();
                return;
        }

        Checksum_T c;
        NEW(c);
        c->type         = cs->type;
        c->test_changes = cs->test_changes;
        c->initialized  = cs->initialized;
        c->action       = cs->action;
        snprintf(c->hash, sizeof(c->hash), "%s", cs->hash);

        current->checksum = c;

        reset_checksumset();

}


/*
 * Set Perm object in the current service
 */
static void addperm(Perm_T ps) {
        assert(ps);

        Perm_T p;
        NEW(p);
        p->action = ps->action;
        p->test_changes = ps->test_changes;
        if (p->test_changes) {
                if (! File_exist(current->path))
                        DEBUG("The path '%s' used in the PERMISSION statement refer to a non-existing object\n", current->path);
                else if ((p->perm = File_mod(current->path)) < 0)
                        yyerror2("Cannot get the timestamp for '%s'", current->path);
                else
                        p->perm &= 07777;
        } else {
                p->perm = ps->perm;
        }
        current->perm = p;
        reset_permset();
}


static void addlinkstatus(Service_T s, LinkStatus_T L) {
        assert(L);

        LinkStatus_T l;

        // Sanity check: we don't support link up/down tests mix
        for (l = s->linkstatuslist; l; l = l->next) {
                if (l->check_invers != L->check_invers)
                        yyerror2("Mixing link up and down tests is not supported");
        }
                        
        if (L->check_invers)
                s->inverseStatus = true;

        NEW(l);
        l->check_invers = L->check_invers;
        l->action = L->action;

        l->next = s->linkstatuslist;
        s->linkstatuslist = l;

        reset_linkstatusset();
}


static void addlinkspeed(Service_T s, LinkSpeed_T L) {
        assert(L);

        LinkSpeed_T l;
        NEW(l);
        l->action = L->action;

        l->next = s->linkspeedlist;
        s->linkspeedlist = l;

        reset_linkspeedset();
}


static void addlinksaturation(Service_T s, LinkSaturation_T L) {
        assert(L);

        LinkSaturation_T l;
        NEW(l);
        l->operator = L->operator;
        l->limit = L->limit;
        l->action = L->action;

        l->next = s->linksaturationlist;
        s->linksaturationlist = l;

        reset_linksaturationset();
}


/*
 * Return Bandwidth object
 */
static void addbandwidth(Bandwidth_T *list, Bandwidth_T b) {
        assert(list);
        assert(b);

        if (b->rangecount * b->range > 24 * Time_Hour) {
                yyerror2("Maximum range for total test is 24 hours");
        } else if (b->range == Time_Minute && b->rangecount > 60) {
                yyerror2("Maximum value for [minute(s)] unit is 60");
        } else if (b->range == Time_Hour && b->rangecount > 24) {
                yyerror2("Maximum value for [hour(s)] unit is 24");
        } else if (b->range == Time_Day && b->rangecount > 1) {
                yyerror2("Maximum value for [day(s)] unit is 1");
        } else {
                if (b->range == Time_Day) {
                        // translate last day -> last 24 hours
                        b->rangecount = 24;
                        b->range = Time_Hour;
                }
                Bandwidth_T bandwidth;
                NEW(bandwidth);
                bandwidth->operator = b->operator;
                bandwidth->limit = b->limit;
                bandwidth->rangecount = b->rangecount;
                bandwidth->range = b->range;
                bandwidth->action = b->action;
                bandwidth->next = *list;
                *list = bandwidth;
        }
        reset_bandwidthset();
}


static void appendmatch(Match_T *list, Match_T item) {
        if (*list) {
                /* Find the end of the list (keep the same patterns order as in the config file) */
                Match_T last;
                for (last = *list; last->next; last = last->next)
                        ;
                last->next = item;
        } else {
                *list = item;
        }
}


/*
 * Set Match object in the current service
 */
static void addmatch(Match_T ms, int actionnumber, int linenumber) {
        Match_T m;

        assert(ms);

        NEW(m);
        NEW(m->regex_comp);

        m->match_string = ms->match_string;
        m->match_path   = ms->match_path ? Str_dup(ms->match_path) : NULL;
        m->action       = ms->action;
        m->not          = ms->not;
        m->ignore       = ms->ignore;
        m->next         = NULL;

        addeventaction(&(m->action), actionnumber, Action_Ignored);

        int reg_return = regcomp(m->regex_comp, ms->match_string, REG_NOSUB|REG_EXTENDED);

        if (reg_return != 0) {
                char errbuf[STRLEN];
                regerror(reg_return, ms->regex_comp, errbuf, STRLEN);
                if (m->match_path != NULL)
                        yyerror2("Regex '%s' parsing error: %s on line %i of", ms->match_string, errbuf, linenumber);
                else
                        yyerror("Regex '%s' parsing error: %s", ms->match_string, errbuf);
        }
        appendmatch(m->ignore ? &current->matchignorelist : &current->matchlist, m);
}


static void addmatchpath(Match_T ms, Action_Type actionnumber) {
        assert(ms->match_path);

        FILE *handle = fopen(ms->match_path, "r");
        if (handle == NULL) {
                yyerror2("Cannot read regex match file (%s)", ms->match_path);
                return;
        }

        // The addeventaction() called from addmatch() will reset the command1 to NULL, but we need to duplicate the command for each line, thus need to save it here
        command_t savecommand = command1;
        for (int linenumber = 1; ! feof(handle); linenumber++) {
                char buf[2048];

                if (! fgets(buf, sizeof(buf), handle))
                        continue;

                size_t len = strlen(buf);

                if (len == 0 || buf[0] == '\n')
                        continue;

                if (buf[len - 1] == '\n')
                        buf[len - 1] = 0;

                ms->match_string = Str_dup(buf);

                if (actionnumber == Action_Exec) {
                        if (command1 == NULL) {
                                assert(savecommand);
                                command1 = copycommand(savecommand);
                        }
                }

                addmatch(ms, actionnumber, linenumber);
        }
        if (actionnumber == Action_Exec && savecommand)
                gccmd(&savecommand);

        fclose(handle);
}


/*
 * Set output change object in the current service
 */
static void addoutputchange(bool check_invers, Action_Type failed, Action_Type succeeded) {
        OutputChange_T outputchange;

        NEW(outputchange);
        addeventaction(&(outputchange->action), failed, succeeded);
        outputchange->previous = NULL;
        outputchange->check_invers = check_invers;

        outputchange->next = current->outputchangelist;
        current->outputchangelist = outputchange;
}


/*
 * Set exit status test object in the current service
 */
static void addstatus(Status_T status) {
        Status_T s;
        assert(status);
        NEW(s);
        s->initialized = status->initialized;
        s->return_value = status->return_value;
        s->operator = status->operator;
        s->action = status->action;
        s->next = current->statuslist;
        current->statuslist = s;

        reset_statusset();
}


/*
 * Set Uid object in the current service
 */
static Uid_T adduid(Uid_T u) {
        assert(u);

        Uid_T uid;
        NEW(uid);
        uid->uid = u->uid;
        uid->action = u->action;
        reset_uidset();
        return uid;
}


/*
 * Set Gid object in the current service
 */
static Gid_T addgid(Gid_T g) {
        assert(g);

        Gid_T gid;
        NEW(gid);
        gid->gid = g->gid;
        gid->action = g->action;
        reset_gidset();
        return gid;
}


/*
 * Add a new filesystem to the current service's filesystem list
 */
static void addfilesystem(FileSystem_T ds) {
        FileSystem_T dev;

        assert(ds);

        NEW(dev);
        dev->resource           = ds->resource;
        dev->operator           = ds->operator;
        dev->limit_absolute     = ds->limit_absolute;
        dev->limit_percent      = ds->limit_percent;
        dev->action             = ds->action;

        dev->next               = current->filesystemlist;
        current->filesystemlist = dev;

        reset_filesystemset();

}


/*
 * Add a new icmp object to the current service's icmp list
 */
static void addicmp(Icmp_T is) {
        Icmp_T icmp;

        assert(is);

        NEW(icmp);
        icmp->family        = is->family;
        icmp->type          = is->type;
        icmp->size          = is->size;
        icmp->count         = is->count;
        icmp->timeout       = is->timeout;
        icmp->action        = is->action;
        icmp->outgoing      = is->outgoing;
        icmp->check_invers  = is->check_invers;
        icmp->is_available  = Connection_Init;

        icmp->responsetime.limit    = responsetimeset.limit;
        icmp->responsetime.current  = responsetimeset.current;
        icmp->responsetime.operator = responsetimeset.operator;

        icmp->next          = current->icmplist;
        current->icmplist   = icmp;

        reset_responsetimeset();
        reset_icmpset();
}


/*
 * Set EventAction object
 */
static void addeventaction(EventAction_T *_ea, Action_Type failed, Action_Type succeeded) {
        EventAction_T ea;

        assert(_ea);

        NEW(ea);
        NEW(ea->failed);
        NEW(ea->succeeded);

        ea->failed->id = failed;
        ea->failed->repeat = repeat1;
        ea->failed->count = rate1.count;
        ea->failed->cycles = rate1.cycles;
        if (failed == Action_Exec) {
                assert(command1);
                ea->failed->exec = command1;
                command1 = NULL;
        }

        ea->succeeded->id = succeeded;
        ea->succeeded->repeat = repeat2;
        ea->succeeded->count = rate2.count;
        ea->succeeded->cycles = rate2.cycles;
        if (succeeded == Action_Exec) {
                assert(command2);
                ea->succeeded->exec = command2;
                command2 = NULL;
        }
        *_ea = ea;
        reset_rateset(&rate);
        reset_rateset(&rate1);
        reset_rateset(&rate2);
        repeat = repeat1 = repeat2 = 0;
}


/*
 * Add a generic protocol handler to
 */
static void addgeneric(Port_T port, char *send, char *expect) {
        Generic_T g = port->parameters.generic.sendexpect;
        if (! g) {
                NEW(g);
                port->parameters.generic.sendexpect = g;
        } else {
                while (g->next)
                        g = g->next;
                NEW(g->next);
                g = g->next;
        }
        if (send) {
                g->send = send;
                g->expect = NULL;
        } else if (expect) {
                int reg_return;
                NEW(g->expect);
                reg_return = regcomp(g->expect, expect, REG_NOSUB|REG_EXTENDED);
                FREE(expect);
                if (reg_return != 0) {
                        char errbuf[STRLEN];
                        regerror(reg_return, g->expect, errbuf, STRLEN);
                        yyerror2("Regex parsing error: %s", errbuf);
                }
                g->send = NULL;
        }
}


/*
 * Add the current command object to the current service object's
 * start or stop program.
 */
static void addcommand(int what, unsigned int cmdtimeout) {

        switch (what) {
                case START:   current->start = command; break;
                case STOP:    current->stop = command; break;
                case RESTART: current->restart = command; break;
        }

        command->timeout = cmdtimeout;

        command = NULL;

}


/*
 * Add a new argument to the argument list
 */
static void addargument(char *argument) {

        assert(argument);

        if (! command) {
                check_exec(argument);
                NEW(command);
        }

        if (command->length + 1 >= ARGMAX) {
                yyerror("Exceeded maximum number of program arguments");
                FREE(argument);
        } else {
                command->arg[command->length++] = argument;
                command->arg[command->length] = NULL;
        }
}


/*
 * Setup a url request for the current port object
 */
static void prepare_urlrequest(URL_T U) {

        assert(U);

        /* Only the HTTP protocol is supported for URLs currently. See also the lexer if this is to be changed in the future */
        portset.protocol = Protocol_get(Protocol_HTTP);

        if (urlrequest == NULL)
                NEW(urlrequest);
        urlrequest->url = U;
        portset.hostname = Str_dup(U->hostname);
        portset.target.net.port = U->port;
        portset.url_request = urlrequest;
        portset.type = Socket_Tcp;
        portset.parameters.http.request = Str_cat("%s%s%s", U->path, U->query ? "?" : "", U->query ? U->query : "");
        if (IS(U->protocol, "https"))
                sslset.flags = SSL_Enabled;
}


/*
 * Set the url request for a port
 */
static void  seturlrequest(int operator, char *regex) {

        assert(regex);

        if (! urlrequest)
                NEW(urlrequest);
        urlrequest->operator = operator;
        int reg_return;
        NEW(urlrequest->regex);
        reg_return = regcomp(urlrequest->regex, regex, REG_NOSUB|REG_EXTENDED);
        if (reg_return != 0) {
                char errbuf[STRLEN];
                regerror(reg_return, urlrequest->regex, errbuf, STRLEN);
                yyerror2("Regex parsing error: %s", errbuf);
        }
}


/*
 * Add a new data recipient server to the mmonit server list
 */
static void addmmonit(Mmonit_T mmonit) {
        assert(mmonit->url);

        Mmonit_T c;
        NEW(c);
        c->url = mmonit->url;
        c->compress = MmonitCompress_Init;
        _setSSLOptions(&(c->ssl));
        if (IS(c->url->protocol, "https")) {
#ifdef HAVE_OPENSSL
                c->ssl.flags = SSL_Enabled;
#else
                yyerror("SSL check cannot be activated -- SSL disabled");
#endif
        }
        c->timeout = mmonit->timeout;
        c->hostgroups = mmonit->hostgroups;
        c->next = NULL;

        if (Run.mmonits) {
                Mmonit_T C;
                for (C = Run.mmonits; C->next; C = C->next)
                        /* Empty */ ;
                C->next = c;
        } else {
                Run.mmonits = c;
        }
        reset_sslset();
        reset_mmonitset();
}


/*
 * Add a new smtp server to the mail server list
 */
static void addmailserver(MailServer_T mailserver) {

        MailServer_T s;

        assert(mailserver->host);

        NEW(s);
        s->host        = mailserver->host;
        s->port        = mailserver->port;
        s->username    = mailserver->username;
        s->password    = mailserver->password;

        if (sslset.flags && (mailserver->port == 25 || mailserver->port == 587))
                sslset.flags = SSL_StartTLS;
        _setSSLOptions(&(s->ssl));

        s->next = NULL;

        if (Run.mailservers) {
                MailServer_T l;
                for (l = Run.mailservers; l->next; l = l->next)
                        /* empty */;
                l->next = s;
        } else {
                Run.mailservers = s;
        }
        reset_mailserverset();
}


/*
 * Return uid if found on the system. If the parameter user is NULL
 * the uid parameter is used for looking up the user id on the system,
 * otherwise the user parameter is used.
 */
static uid_t get_uid(char *user, uid_t uid) {
        char buf[4096];
        struct passwd pwd, *result = NULL;
        if (user) {
                if (getpwnam_r(user, &pwd, buf, sizeof(buf), &result) != 0 || ! result) {
                        yyerror2("Requested user not found on the system");
                        return(0);
                }
        } else {
                if (getpwuid_r(uid, &pwd, buf, sizeof(buf), &result) != 0 || ! result) {
                        yyerror2("Requested uid not found on the system");
                        return(0);
                }
        }
        return(pwd.pw_uid);
}


/*
 * Return gid if found on the system. If the parameter group is NULL
 * the gid parameter is used for looking up the group id on the system,
 * otherwise the group parameter is used.
 */
static gid_t get_gid(char *group, gid_t gid) {
        struct group *grd;

        if (group) {
                grd = getgrnam(group);

                if (! grd) {
                        yyerror2("Requested group not found on the system");
                        return(0);
                }

        } else {

                if (! (grd = getgrgid(gid))) {
                        yyerror2("Requested gid not found on the system");
                        return(0);
                }

        }

        return(grd->gr_gid);

}


/*
 * Add a new user id to the current command object.
 */
static void addeuid(uid_t uid) {
        if (! getuid()) {
                command->has_uid = true;
                command->uid = uid;
        } else {
                yyerror("UID statement requires root privileges");
        }
}


/*
 * Add a new group id to the current command object.
 */
static void addegid(gid_t gid) {
        if (! getuid()) {
                command->has_gid = true;
                command->gid = gid;
        } else {
                yyerror("GID statement requires root privileges");
        }
}


/*
 * Reset the logfile if changed
 */
static void setlogfile(char *logfile) {
        if (Run.files.log) {
                if (IS(Run.files.log, logfile)) {
                        FREE(logfile);
                        return;
                } else {
                        FREE(Run.files.log);
                }
        }
        Run.files.log = logfile;
}


/*
 * Reset the pidfile if changed
 */
static void setpidfile(char *pidfile) {
        if (Run.files.pidfile) {
                if (IS(Run.files.pidfile, pidfile)) {
                        FREE(pidfile);
                        return;
                } else {
                        FREE(Run.files.pidfile);
                        Run.files.pidfile_changed = true;
                }
        }
        Run.files.pidfile = pidfile;
}


/*
 * Reset the idfile if changed
 */
static void setidfile(char *idfile) {
        if (Run.files.id) {
                if (IS(Run.files.id, idfile)) {
                        FREE(idfile);
                        return;
                } else {
                        FREE(Run.files.id);
                }
        }
        Run.files.id = idfile;
}


/*
 * Reset the statefile if changed
 */
static void setstatefile(char *statefile) {
        if (Run.files.state) {
                if (IS(Run.files.state, statefile)) {
                        FREE(statefile);
                        return;
                } else {
                        FREE(Run.files.state);
                }
        }
        Run.files.state = statefile;
}


/*
 * Read a apache htpasswd file and add credentials found for username
 */
static void addhtpasswdentry(char *filename, char *username, Digest_Type dtype) {
        char *ht_username = NULL;
        char *ht_passwd = NULL;
        char buf[STRLEN];
        FILE *handle = NULL;
        int credentials_added = 0;
        char realpath[PATH_MAX] = {};

        assert(filename);

        // Check that the htpasswd is a real file and not e.g. a directory
        if (filename[0] != SEPARATOR_CHAR) {
                if (! File_realPath(filename, realpath)) {
                        yyerror2("Error getting path for the htpasswd file '%s' -- %s\n", filename, STRERROR);
                        return;
                }
        }
        if (! File_isFile(filename)) {
                yyerror2("The htpasswd file '%s' is not a file", filename);
                return;
        }

        if (! (handle = fopen(filename, "r"))) {
                if (username)
                        yyerror2("Cannot read htpasswd (%s) for user %s", filename, username);
                else
                        yyerror2("Cannot read htpasswd (%s)", filename);
                return;
        }

        while (! feof(handle)) {
                char *colonindex = NULL;

                if (! fgets(buf, STRLEN, handle))
                        continue;

                Str_rtrim(buf);
                Str_curtail(buf, "#");

                if (NULL == (colonindex = strchr(buf, ':')))
                continue;

                ht_passwd = Str_dup(colonindex+1);
                *colonindex = '\0';

                /* In case we have a file in /etc/passwd or /etc/shadow style we
                 *  want to remove ":.*$" and Crypt and MD5 hashed dont have a colon
                 */

                if ((NULL != (colonindex = strchr(ht_passwd, ':'))) && (dtype != Digest_Cleartext))
                        *colonindex = '\0';

                ht_username = Str_dup(buf);

                if (username == NULL) {
                        if (addcredentials(ht_username, ht_passwd, dtype, false))
                                credentials_added++;
                } else if (Str_cmp(username, ht_username) == 0)  {
                        if (addcredentials(ht_username, ht_passwd, dtype, false))
                                credentials_added++;
                } else {
                        FREE(ht_passwd);
                        FREE(ht_username);
                }
        }

        if (credentials_added == 0) {
                if (username == NULL)
                        yywarning2("htpasswd file (%s) has no usable credentials", filename);
                else
                        yywarning2("htpasswd file (%s) has no usable credentials for user %s", filename, username);
        }
        fclose(handle);
}


#ifdef HAVE_LIBPAM
static void addpamauth(char* groupname, int readonly) {
        Auth_T prev = NULL;

        assert(groupname);

        if (! Run.httpd.credentials)
                NEW(Run.httpd.credentials);

        Auth_T c = Run.httpd.credentials;
        do {
                if (c->groupname != NULL && IS(c->groupname, groupname)) {
                        yywarning2("PAM group %s was added already, entry ignored", groupname);
                        FREE(groupname);
                        return;
                }
                prev = c;
                c = c->next;
        } while (c != NULL);

        NEW(prev->next);
        c = prev->next;

        c->next        = NULL;
        c->uname       = NULL;
        c->passwd      = NULL;
        c->groupname   = groupname;
        c->digesttype  = Digest_Pam;
        c->is_readonly = readonly;

        DEBUG("Adding PAM group '%s'\n", groupname);

        return;
}
#endif


/*
 * Add Basic Authentication credentials
 */
static bool addcredentials(char *uname, char *passwd, Digest_Type dtype, bool readonly) {
        Auth_T c;

        assert(uname);
        assert(passwd);

        if (! Run.httpd.credentials) {
                NEW(Run.httpd.credentials);
                c = Run.httpd.credentials;
        } else {
                if (Util_getUserCredentials(uname) != NULL) {
                        yywarning2("Credentials for user %s were already added, entry ignored", uname);
                        FREE(uname);
                        FREE(passwd);
                        return false;
                }
                c = Run.httpd.credentials;
                while (c->next != NULL)
                        c = c->next;
                NEW(c->next);
                c = c->next;
        }

        c->next        = NULL;
        c->uname       = uname;
        c->passwd      = passwd;
        c->groupname   = NULL;
        c->digesttype  = dtype;
        c->is_readonly = readonly;

        DEBUG("Adding credentials for user '%s'\n", uname);

        return true;

}


/*
 * Set the syslog and the facilities to be used
 */
static void setsyslog(char *facility) {

        if (! Run.files.log || ihp.logfile) {
                ihp.logfile = true;
                setlogfile(Str_dup("syslog"));
                Run.flags |= Run_UseSyslog;
                Run.flags |= Run_Log;
        }

        if (facility) {
                if (IS(facility,"log_local0"))
                        Run.facility = LOG_LOCAL0;
                else if (IS(facility, "log_local1"))
                        Run.facility = LOG_LOCAL1;
                else if (IS(facility, "log_local2"))
                        Run.facility = LOG_LOCAL2;
                else if (IS(facility, "log_local3"))
                        Run.facility = LOG_LOCAL3;
                else if (IS(facility, "log_local4"))
                        Run.facility = LOG_LOCAL4;
                else if (IS(facility, "log_local5"))
                        Run.facility = LOG_LOCAL5;
                else if (IS(facility, "log_local6"))
                        Run.facility = LOG_LOCAL6;
                else if (IS(facility, "log_local7"))
                        Run.facility = LOG_LOCAL7;
                else if (IS(facility, "log_daemon"))
                        Run.facility = LOG_DAEMON;
                else if (IS(facility, "log_user"))
                        Run.facility = LOG_USER;
                else
                        yyerror2("Invalid syslog facility");
        } else {
                Run.facility = LOG_USER;
        }

}


/*
 * Reset the current sslset for reuse
 */
static void reset_sslset(void) {
        memset(&sslset, 0, sizeof(struct SslOptions_T));
        sslset.version = sslset.verify = sslset.allowSelfSigned = -1;
}


/*
 * Reset the current mailset for reuse
 */
static void reset_mailset(void) {
        memset(&mailset, 0, sizeof(struct Mail_T));
}


/*
 * Reset the mailserver set to default values
 */
static void reset_mailserverset(void) {
        memset(&mailserverset, 0, sizeof(struct MailServer_T));
        mailserverset.port = PORT_SMTP;
}


/*
 * Reset the mmonit set to default values
 */
static void reset_mmonitset(void) {
        memset(&mmonitset, 0, sizeof(struct Mmonit_T));
        mmonitset.timeout = Run.limits.networkTimeout;
}


/*
 * Reset the Port set to default values
 */
static void reset_portset(void) {
        memset(&portset, 0, sizeof(struct Port_T));
        portset.check_invers = false;
        portset.socket = -1;
        portset.type = Socket_Tcp;
        portset.family = Socket_Ip;
        portset.timeout = Run.limits.networkTimeout;
        portset.retry = 1;
        portset.protocol = Protocol_get(Protocol_DEFAULT);
        urlrequest = NULL;
}


/*
 * Reset the Proc set to default values
 */
static void reset_resourceset(void) {
        resourceset.resource_id = 0;
        resourceset.limit = 0;
        resourceset.action = NULL;
        resourceset.operator = Operator_Equal;
}


/*
 * Reset the Timestamp set to default values
 */
static void reset_timestampset(void) {
        timestampset.type = Timestamp_Default;
        timestampset.operator = Operator_Equal;
        timestampset.time = 0;
        timestampset.test_changes = false;
        timestampset.initialized = false;
        timestampset.action = NULL;
}


/*
 * Reset the ActionRate set to default values
 */
static void reset_actionrateset(void) {
        actionrateset.count = 0;
        actionrateset.cycle = 0;
        actionrateset.action = NULL;
}


/*
 * Reset the Size set to default values
 */
static void reset_sizeset(void) {
        sizeset.operator = Operator_Equal;
        sizeset.size = 0;
        sizeset.test_changes = false;
        sizeset.action = NULL;
}


/*
 * Reset the NLink set to default values
 */
static void reset_nlinkset(void) {
        nlinkset.operator = Operator_Equal;
        nlinkset.nlink = 0;
        nlinkset.test_changes = false;
        nlinkset.action = NULL;
}


/*
 * Reset the Uptime set to default values
 */
static void reset_uptimeset(void) {
        uptimeset.operator = Operator_Equal;
        uptimeset.uptime = 0;
        uptimeset.action = NULL;
}


static void reset_responsetimeset(void) {
        responsetimeset.operator = Operator_Less;
        responsetimeset.current = 0.;
        responsetimeset.limit = -1.;
}


static void reset_linkstatusset(void) {
        linkstatusset.check_invers = false;
        linkstatusset.action = NULL;
}


static void reset_linkspeedset(void) {
        linkspeedset.action = NULL;
}


static void reset_linksaturationset(void) {
        linksaturationset.limit = 0.;
        linksaturationset.operator = Operator_Equal;
        linksaturationset.action = NULL;
}


/*
 * Reset the Bandwidth set to default values
 */
static void reset_bandwidthset(void) {
        bandwidthset.operator = Operator_Equal;
        bandwidthset.limit = 0ULL;
        bandwidthset.action = NULL;
}


/*
 * Reset the Pid set to default values
 */
static void reset_pidset(void) {
        pidset.action = NULL;
}


/*
 * Reset the PPid set to default values
 */
static void reset_ppidset(void) {
        ppidset.action = NULL;
}


/*
 * Reset the Fsflag set to default values
 */
static void reset_fsflagset(void) {
        fsflagset.action = NULL;
}


/*
 * Reset the Nonexist set to default values
 */
static void reset_nonexistset(void) {
        nonexistset.action = NULL;
}


static void reset_existset(void) {
        existset.action = NULL;
}


/*
 * Reset the Checksum set to default values
 */
static void reset_checksumset(void) {
        checksumset.type         = Hash_Unknown;
        checksumset.test_changes = false;
        checksumset.action       = NULL;
        *checksumset.hash        = 0;
}


/*
 * Reset the Perm set to default values
 */
static void reset_permset(void) {
        permset.test_changes = false;
        permset.perm = 0;
        permset.action = NULL;
}


/*
 * Reset the Status set to default values
 */
static void reset_statusset(void) {
        statusset.initialized = false;
        statusset.return_value = 0;
        statusset.operator = Operator_Equal;
        statusset.action = NULL;
}


/*
 * Reset the Uid set to default values
 */
static void reset_uidset(void) {
        uidset.uid = 0;
        uidset.action = NULL;
}


/*
 * Reset the Gid set to default values
 */
static void reset_gidset(void) {
        gidset.gid = 0;
        gidset.action = NULL;
}


/*
 * Reset the Filesystem set to default values
 */
static void reset_filesystemset(void) {
        filesystemset.resource = 0;
        filesystemset.operator = Operator_Equal;
        filesystemset.limit_absolute = -1;
        filesystemset.limit_percent = -1.;
        filesystemset.action = NULL;
}


/*
 * Reset the ICMP set to default values
 */
static void reset_icmpset(void) {
        memset(&icmpset, 0, sizeof(struct Icmp_T));
        icmpset.type = ICMP_ECHO;
        icmpset.size = ICMP_SIZE;
        icmpset.count = ICMP_ATTEMPT_COUNT;
        icmpset.timeout = Run.limits.networkTimeout;
}


/*
 * Reset the Rate set to default values
 */
static void reset_rateset(struct rate_t *r) {
        r->count = 1;
        r->cycles = 1;
}


/* ---------------------------------------------------------------- Checkers */


/*
 * Check for unique service name
 */
static void check_name(char *name) {
        assert(name);

        if (Util_existService(name) || (current && IS(name, current->name)))
                yyerror2("Service name conflict, %s already defined", name);
        if (name && *name == '/')
                yyerror2("Service name '%s' must not start with '/' -- ", name);
}


/*
 * Permission statement semantic check
 */
static int check_perm(int perm) {
        int result;
        char *status;
        char buf[STRLEN];

        snprintf(buf, STRLEN, "%d", perm);

        result = (int)strtol(buf, &status, 8);

        if (*status != '\0' || result < 0 || result > 07777)
                yyerror2("Permission statements must have an octal value between 0 and 7777");

        return result;
}


/*
 * Check the dependency graph for errors
 * by doing a topological sort, thereby finding any cycles.
 * Assures that graph is a Directed Acyclic Graph (DAG).
 */
static void check_depend(void) {
        Service_T depends_on = NULL;
        Service_T* dlt = &depend_list; /* the current tail of it                                 */
        bool done;                /* no unvisited nodes left?                               */
        bool found_some;          /* last iteration found anything new ?                    */
        depend_list = NULL;            /* depend_list will be the topological sorted Service_List */

        do {
                done = true;
                found_some = false;
                for (Service_T s = Service_List; s; s = s->next) {
                        Dependant_T d;
                        if (s->visited)
                                continue;
                        done = false; // still unvisited nodes
                        depends_on = NULL;
                        for (d = s->dependantlist; d; d = d->next) {
                                Service_T dp = Util_getService(d->dependant);
                                if (! dp) {
                                        Log_error("Depending service '%s' is not defined in the control file\n", d->dependant);
                                        exit(1);
                                }
                                if (! dp->visited) {
                                        depends_on = dp;
                                }
                        }

                        if (! depends_on) {
                                s->visited = true;
                                found_some = true;
                                *dlt = s;
                                dlt = &s->next_depend;
                        }
                }
        } while (found_some && ! done);

        if (! done) {
                assert(depends_on);
                Log_error("Found a depend loop in the control file involving the service '%s'\n", depends_on->name);
                exit(1);
        }

        assert(depend_list);
        Service_List = depend_list;

        for (Service_T s = depend_list; s; s = s->next_depend)
                s->next = s->next_depend;
}


// Check and warn if the executable does not exist
static void check_exec(char *exec) {
        if (! File_exist(exec))
                yywarning2("Program does not exist:");
        else if (! File_isExecutable(exec))
                yywarning2("Program is not executable:");
}


/* Return a valid max forward value for SIP header */
static int verifyMaxForward(int mf) {
        if (mf == 0) {
                return INT_MAX; // Differentiate uninitialized (0) and explicit zero
        } else if (mf > 0 && mf <= 255) {
                return mf;
        }
        yywarning2("SIP max forward is outside the range [0..255]. Setting max forward to 70");
        return 70;
}


/* -------------------------------------------------------------------- Misc */


/*
 * Cleans up a hash string, tolower and remove byte separators
 */
static int cleanup_hash_string(char *hashstring) {
        int i = 0, j = 0;

        assert(hashstring);

        while (hashstring[i]) {
                if (isxdigit((int)hashstring[i])) {
                        hashstring[j] = tolower((int)hashstring[i]);
                        j++;
                }
                i++;
        }
        hashstring[j] = 0;
        return j;
}


/* Return deep copy of the command */
static command_t copycommand(command_t source) {
        int i;
        command_t copy = NULL;

        NEW(copy);
        copy->length = source->length;
        copy->has_uid = source->has_uid;
        copy->uid = source->uid;
        copy->has_gid = source->has_gid;
        copy->gid = source->gid;
        copy->timeout = source->timeout;
        for (i = 0; i < copy->length; i++)
                copy->arg[i] = Str_dup(source->arg[i]);
        copy->arg[copy->length] = NULL;

        return copy;
}


static void _setPEM(char **store, char *path, const char *description, bool isFile) {
        if (*store) {
                yyerror2("Duplicate %s", description);
                FREE(path);
        } else if (! File_exist(path)) {
                yyerror2("%s doesn't exist", description);
                FREE(path);
        } else if (! (isFile ? File_isFile(path) : File_isDirectory(path))) {
                yyerror2("%s is not a %s", description, isFile ? "file" : "directory");
                FREE(path);
        } else if (! File_isReadable(path)) {
                yyerror2("Cannot read %s", description);
                FREE(path);
        } else {
                sslset.flags = SSL_Enabled;
                *store = path;
        }
}


static void _setSSLOptions(SslOptions_T options) {
        options->allowSelfSigned = sslset.allowSelfSigned;
        options->CACertificateFile = sslset.CACertificateFile;
        options->CACertificatePath = sslset.CACertificatePath;
        options->checksum = sslset.checksum;
        options->checksumType = sslset.checksumType;
        options->ciphers = sslset.ciphers;
        options->clientpemfile = sslset.clientpemfile;
        options->flags = sslset.flags;
        options->pemfile = sslset.pemfile;
        options->pemchain = sslset.pemchain;
        options->pemkey = sslset.pemkey;
        options->verify = sslset.verify;
        options->version = sslset.version;
        reset_sslset();
}


#ifdef HAVE_OPENSSL
static void _setSSLVersion(short version) {
        sslset.flags = SSL_Enabled;
        if (sslset.version == -1)
                sslset.version = version;
        else
                sslset.version |= version;
}
#endif


static void _unsetSSLVersion(short version) {
        if (sslset.version != -1)
                sslset.version &= ~version;
}


static void addsecurityattribute(char *value, StringOperator_Type operator, Action_Type failed, Action_Type succeeded) {
        SecurityAttribute_T attr;
        NEW(attr);

        if (operator == StringOperator_RegexMatch || operator == StringOperator_RegexNoMatch) {
                NEW(attr->regex_comp);

                int reg_return = regcomp(attr->regex_comp, value, REG_NOSUB|REG_EXTENDED);
                if (reg_return != 0) {
                        char errbuf[STRLEN];
                        regerror(reg_return, attr->regex_comp, errbuf, STRLEN);
                        yyerror2("Regex parsing error of '%s': %s", value, errbuf);
                        FREE(value);
                        FREE(attr->regex_comp);
                        FREE(attr);
                        return;
                }
        }

        addeventaction(&(attr->action), failed, succeeded);
        attr->operator = operator;
        attr->attribute = value;
        attr->next = current->secattrlist;
        current->secattrlist = attr;
}


static void addfiledescriptors(Operator_Type operator, bool total, long long value_absolute, float value_percent, Action_Type failed, Action_Type succeeded) {
        Filedescriptors_T fds;
        NEW(fds);
        addeventaction(&(fds->action), failed, succeeded);
        fds->total = total;
        fds->limit_absolute = value_absolute;
        fds->limit_percent = value_percent;
        fds->operator = operator;
        fds->next = current->filedescriptorslist;
        current->filedescriptorslist = fds;
}

static void _sanityCheckEveryStatement(Service_T s) {
        if (s->every.type != Every_Initializing) {
                yywarning2("The 'every' statement can be specified only once, the last value will be used\n");
                switch (s->every.type) {
                        case Every_Cron:
                        case Every_NotInCron:
                                FREE(s->every.spec.cron);
                                break;
                        default:
                                break;
                }
        }
}

// Turn back on unreachable code warnings
#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
