#ifndef lint
static const char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
#endif

#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYPATCH 20110908

#define YYEMPTY        (-1)
#define yyclearin      (yychar = YYEMPTY)
#define yyerrok        (yyerrflag = 0)
#define YYRECOVERING() (yyerrflag != 0)

#define YYPREFIX "yy"

#define YYPURE 1

#line 42 "dexpr-parser.y"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "token.h"
#include "date-core-strpf.h"
#include "dexpr.h"

extern int yylex(YYSTYPE *yylval_param);
extern int yyerror(dexpr_t *cur __attribute__((unused)), const char *errmsg);
extern char *yytext;

/* grrrrr, bug in bison */
extern int yyparse();

#define YYENABLE_NLS		0
#define YYLTYPE_IS_TRIVIAL	1
#define YYSTACK_USE_ALLOCA	1

int
yyerror(dexpr_t *cur __attribute__((unused)), const char *errmsg)
{
	fputs("dexpr-parser: ", stderr);
	fputs(errmsg, stderr);
	if (errno) {
		fputc(':', stderr);
		fputc(' ', stderr);
		fputs(strerror(errno), stderr);
	}
	fputc('\n', stderr);
	return -1;
}

/* static stuff */
static struct dexkv_s ckv[1];

static char *const *ckv_fmt = NULL;
static size_t ckv_nfmt = 0;
#line 81 "dexpr-parser.y"
#ifdef YYSTYPE
#undef  YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
typedef union {
	dexpr_t dex;
	char *sval;
} YYSTYPE;
#endif /* !YYSTYPE_IS_DECLARED */
#line 69 "dexpr-parser.c"

/* compatibility with bison */
#ifdef YYPARSE_PARAM
/* compatibility with FreeBSD */
# ifdef YYPARSE_PARAM_TYPE
#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
# else
#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
# endif
#else
# define YYPARSE_DECL() yyparse(dexpr_t * cur)
#endif

/* Parameters sent to lex. */
#ifdef YYLEX_PARAM
# define YYLEX_DECL() yylex(YYSTYPE *yylval, void *YYLEX_PARAM)
# define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
# define YYLEX_DECL() yylex(YYSTYPE *yylval)
# define YYLEX yylex(&yylval)
#endif

/* Parameters sent to yyerror. */
#define YYERROR_DECL() yyerror(dexpr_t * cur, const char *s)
#define YYERROR_CALL(msg) yyerror(cur, msg)

extern int YYPARSE_DECL();

#define TOK_EQ 257
#define TOK_NE 258
#define TOK_LT 259
#define TOK_LE 260
#define TOK_GT 261
#define TOK_GE 262
#define TOK_SPEC 263
#define TOK_STRING 264
#define TOK_DATETIME 265
#define TOK_INT 266
#define TOK_OR 267
#define TOK_AND 268
#define TOK_NOT 269
#define TOK_LPAREN 270
#define TOK_RPAREN 271
#define YYERRCODE 256
static const short yylhs[] = {                           -1,
    0,    3,    1,    1,    1,    1,    1,    2,    6,    2,
    7,    2,    8,    2,    9,    2,   10,    2,   11,    2,
    5,    5,    4,    4,    4,
};
static const short yylen[] = {                            2,
    1,    0,    2,    3,    3,    2,    3,    1,    0,    4,
    0,    4,    0,    4,    0,    4,    0,    4,    0,    4,
    0,    1,    1,    1,    1,
};
static const short yydefred[] = {                         0,
    0,    0,    0,    0,    0,    6,    0,    0,    0,   22,
   24,   23,   25,    3,    8,    0,    7,    0,    5,   17,
   19,    9,   13,   11,   15,    0,    0,    0,    0,    0,
    0,   18,   20,   10,   14,   12,   16,
};
static const short yydgoto[] = {                          3,
    4,   14,    5,   15,   16,   28,   30,   29,   31,   26,
   27,
};
static const short yysindex[] = {                      -223,
 -223, -223,    0, -251, -224,    0, -253, -223, -223,    0,
    0,    0,    0,    0,    0, -236,    0, -268,    0,    0,
    0,    0,    0,    0,    0, -221, -221, -221, -221, -221,
 -221,    0,    0,    0,    0,    0,    0,
};
static const short yyrindex[] = {                      -255,
 -255, -255,    0,   48, -230,    0,    0, -255, -255,    0,
    0,    0,    0,    0,    0,    0,    0,    1,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,
};
static const short yygindex[] = {                         0,
   11,    0,    0,    7,    0,    0,    0,    0,    0,    0,
    0,
};
#define YYTABLESIZE 272
static const short yytable[] = {                          9,
    4,    2,    2,    2,    2,    2,    2,    2,    2,    2,
    2,    6,    7,    8,    9,    8,    9,   17,   18,   19,
   20,   21,   22,   23,   24,   25,   21,   21,   21,   21,
   21,   21,   32,   33,   34,   35,   36,   37,   10,   11,
   12,   13,   11,   12,   13,    1,    2,    1,    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,    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,    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,    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,
    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,    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,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    4,    0,    0,
    0,    4,
};
static const short yycheck[] = {                        268,
    0,  257,  258,  259,  260,  261,  262,  263,  264,  265,
  266,    1,    2,  267,  268,  267,  268,  271,    8,    9,
  257,  258,  259,  260,  261,  262,  257,  258,  259,  260,
  261,  262,   26,   27,   28,   29,   30,   31,  263,  264,
  265,  266,  264,  265,  266,  269,  270,    0,   -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,   -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,   -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,   -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,
   -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,   -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,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,  267,   -1,   -1,
   -1,  271,
};
#define YYFINAL 3
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 271
#if YYDEBUG
static const char *yyname[] = {

"end-of-file",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,
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,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,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,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,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,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,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,"TOK_EQ","TOK_NE","TOK_LT",
"TOK_LE","TOK_GT","TOK_GE","TOK_SPEC","TOK_STRING","TOK_DATETIME","TOK_INT",
"TOK_OR","TOK_AND","TOK_NOT","TOK_LPAREN","TOK_RPAREN",
};
static const char *yyrule[] = {
"$accept : root",
"root : stmt",
"$$1 :",
"stmt : $$1 exp",
"stmt : stmt TOK_OR stmt",
"stmt : stmt TOK_AND stmt",
"stmt : TOK_NOT stmt",
"stmt : TOK_LPAREN stmt TOK_RPAREN",
"exp : rhs",
"$$2 :",
"exp : spec TOK_LT $$2 rhs",
"$$3 :",
"exp : spec TOK_GT $$3 rhs",
"$$4 :",
"exp : spec TOK_LE $$4 rhs",
"$$5 :",
"exp : spec TOK_GE $$5 rhs",
"$$6 :",
"exp : spec TOK_EQ $$6 rhs",
"$$7 :",
"exp : spec TOK_NE $$7 rhs",
"spec :",
"spec : TOK_SPEC",
"rhs : TOK_DATETIME",
"rhs : TOK_STRING",
"rhs : TOK_INT",

};
#endif

int      yydebug;
int      yynerrs;

/* define the initial stack-sizes */
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH  YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 500
#define YYMAXDEPTH  500
#endif
#endif

#define YYINITSTACKSIZE 500

typedef struct {
    unsigned stacksize;
    short    *s_base;
    short    *s_mark;
    short    *s_last;
    YYSTYPE  *l_base;
    YYSTYPE  *l_mark;
} YYSTACKDATA;
#line 262 "dexpr-parser.y"

/* dexpr-parser.y ends here */
#line 289 "dexpr-parser.c"

#if YYDEBUG
#include <stdio.h>		/* needed for printf */
#endif

#include <stdlib.h>	/* needed for malloc, etc */
#include <string.h>	/* needed for memset */

/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack(YYSTACKDATA *data)
{
    int i;
    unsigned newsize;
    short *newss;
    YYSTYPE *newvs;

    if ((newsize = data->stacksize) == 0)
        newsize = YYINITSTACKSIZE;
    else if (newsize >= YYMAXDEPTH)
        return -1;
    else if ((newsize *= 2) > YYMAXDEPTH)
        newsize = YYMAXDEPTH;

    i = data->s_mark - data->s_base;
    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
    if (newss == 0)
        return -1;

    data->s_base = newss;
    data->s_mark = newss + i;

    newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
    if (newvs == 0)
        return -1;

    data->l_base = newvs;
    data->l_mark = newvs + i;

    data->stacksize = newsize;
    data->s_last = data->s_base + newsize - 1;
    return 0;
}

#if YYPURE || defined(YY_NO_LEAKS)
static void yyfreestack(YYSTACKDATA *data)
{
    free(data->s_base);
    free(data->l_base);
    memset(data, 0, sizeof(*data));
}
#else
#define yyfreestack(data) /* nothing */
#endif

#define YYABORT  goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR  goto yyerrlab

int
YYPARSE_DECL()
{
    int      yyerrflag;
    int      yychar;
    YYSTYPE  yyval;
    YYSTYPE  yylval;

    /* variables for the parser stack */
    YYSTACKDATA yystack;
    int yym, yyn, yystate;
#if YYDEBUG
    const char *yys;

    if ((yys = getenv("YYDEBUG")) != 0)
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }
#endif

    yynerrs = 0;
    yyerrflag = 0;
    yychar = YYEMPTY;
    yystate = 0;

#if YYPURE
    memset(&yystack, 0, sizeof(yystack));
#endif

    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
    yystack.s_mark = yystack.s_base;
    yystack.l_mark = yystack.l_base;
    yystate = 0;
    *yystack.s_mark = 0;

yyloop:
    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
    if (yychar < 0)
    {
        if ((yychar = YYLEX) < 0) yychar = 0;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, reading %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
    }
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: state %d, shifting to state %d\n",
                    YYPREFIX, yystate, yytable[yyn]);
#endif
        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
        {
            goto yyoverflow;
        }
        yystate = yytable[yyn];
        *++yystack.s_mark = yytable[yyn];
        *++yystack.l_mark = yylval;
        yychar = YYEMPTY;
        if (yyerrflag > 0)  --yyerrflag;
        goto yyloop;
    }
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
        yyn = yytable[yyn];
        goto yyreduce;
    }
    if (yyerrflag) goto yyinrecovery;

    yyerror(cur, "syntax error");

    goto yyerrlab;

yyerrlab:
    ++yynerrs;

yyinrecovery:
    if (yyerrflag < 3)
    {
        yyerrflag = 3;
        for (;;)
        {
            if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: state %d, error recovery shifting\
 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
#endif
                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
                {
                    goto yyoverflow;
                }
                yystate = yytable[yyn];
                *++yystack.s_mark = yytable[yyn];
                *++yystack.l_mark = yylval;
                goto yyloop;
            }
            else
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: error recovery discarding state %d\n",
                            YYPREFIX, *yystack.s_mark);
#endif
                if (yystack.s_mark <= yystack.s_base) goto yyabort;
                --yystack.s_mark;
                --yystack.l_mark;
            }
        }
    }
    else
    {
        if (yychar == 0) goto yyabort;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
        yychar = YYEMPTY;
        goto yyloop;
    }

yyreduce:
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
                YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
    yym = yylen[yyn];
    if (yym)
        yyval = yystack.l_mark[1-yym];
    else
        memset(&yyval, 0, sizeof yyval);
    switch (yyn)
    {
case 1:
#line 116 "dexpr-parser.y"
	{
		*cur = yyval.dex;
		YYACCEPT;
	}
break;
case 2:
#line 122 "dexpr-parser.y"
	{
		memset(ckv, 0, sizeof(*ckv));
	}
break;
case 3:
#line 124 "dexpr-parser.y"
	{
		yyval.dex = calloc(1, sizeof(struct dexpr_s));
		yyval.dex->type = DEX_VAL;
		yyval.dex->kv[0] = *ckv;
	}
break;
case 4:
#line 129 "dexpr-parser.y"
	{
		yyval.dex = calloc(1, sizeof(struct dexpr_s));
		yyval.dex->type = DEX_DISJ;
		yyval.dex->left = yystack.l_mark[-2].dex;
		yyval.dex->right = yystack.l_mark[0].dex;
	}
break;
case 5:
#line 135 "dexpr-parser.y"
	{
		yyval.dex = calloc(1, sizeof(struct dexpr_s));
		yyval.dex->type = DEX_CONJ;
		yyval.dex->left = yystack.l_mark[-2].dex;
		yyval.dex->right = yystack.l_mark[0].dex;
	}
break;
case 6:
#line 141 "dexpr-parser.y"
	{
		(yyval.dex = yystack.l_mark[0].dex)->nega = 1;
	}
break;
case 7:
#line 144 "dexpr-parser.y"
	{
		yyval.dex = yystack.l_mark[-1].dex;
	}
break;
case 9:
#line 151 "dexpr-parser.y"
	{ ckv->op = OP_LT; }
break;
case 11:
#line 152 "dexpr-parser.y"
	{ ckv->op = OP_GT; }
break;
case 13:
#line 153 "dexpr-parser.y"
	{ ckv->op = OP_LE; }
break;
case 15:
#line 154 "dexpr-parser.y"
	{ ckv->op = OP_GE; }
break;
case 17:
#line 155 "dexpr-parser.y"
	{ ckv->op = OP_EQ; }
break;
case 19:
#line 156 "dexpr-parser.y"
	{ ckv->op = OP_NE; }
break;
case 22:
#line 161 "dexpr-parser.y"
	{
		struct dt_spec_s sp = __tok_spec(yystack.l_mark[0].sval, NULL);
		ckv->sp = sp;
	}
break;
case 23:
#line 168 "dexpr-parser.y"
	{
		ckv->d = dt_io_strpdt(yystack.l_mark[0].sval, ckv_fmt, ckv_nfmt, NULL);
		if (ckv->d.typ == DT_UNK) {
			/* one more try */
			ckv->d = dt_strpdt(yystack.l_mark[0].sval, NULL, NULL);
		}
		ckv->sp.spfl = DT_SPFL_N_STD;
	}
break;
case 24:
#line 176 "dexpr-parser.y"
	{
		switch (ckv->sp.spfl) {
		case DT_SPFL_N_YEAR:
		case DT_SPFL_N_MON:
		case DT_SPFL_N_DCNT_WEEK:
		case DT_SPFL_N_DCNT_MON:
		case DT_SPFL_N_DCNT_YEAR:
		case DT_SPFL_N_WCNT_MON:
		case DT_SPFL_N_WCNT_YEAR:
			ckv->s = strtol(yystack.l_mark[0].sval, NULL, 10);
			break;
		case DT_SPFL_S_WDAY:
			switch (ckv->sp.abbr) {
			case DT_SPMOD_NORM:
				ckv->s = strtoarri(
					yystack.l_mark[0].sval, NULL,
					dut_abbr_wday, dut_nabbr_wday);
				break;
			case DT_SPMOD_LONG:
				ckv->s = strtoarri(
					yystack.l_mark[0].sval, NULL,
					dut_long_wday, dut_nlong_wday);
				break;
			case DT_SPMOD_ABBR: {
				const char *pos;
				if ((pos = strchr(
					     dut_abab_wday, *yystack.l_mark[0].sval)) != NULL) {
					ckv->s = pos - dut_abab_wday;
					break;
				}
			}
			case DT_SPMOD_ILL:
			default:
				ckv->s = -1;
				break;
			}
			break;
		case DT_SPFL_S_MON:
			switch (ckv->sp.abbr) {
			case DT_SPMOD_NORM:
				ckv->s = strtoarri(
					yystack.l_mark[0].sval, NULL,
					dut_abbr_mon, dut_nabbr_mon);
				break;
			case DT_SPMOD_LONG:
				ckv->s = strtoarri(
					yystack.l_mark[0].sval, NULL,
					dut_long_mon, dut_nlong_mon);
				break;
			case DT_SPMOD_ABBR: {
				const char *pos;
				if ((pos = strchr(
					     dut_abab_mon, *yystack.l_mark[0].sval)) != NULL) {
					ckv->s = pos - dut_abab_mon;
					break;
				}
			}
			case DT_SPMOD_ILL:
			default:
				ckv->s = -1;
				break;
			}
			break;
		default:
			break;
		}
	}
break;
case 25:
#line 243 "dexpr-parser.y"
	{
		switch (ckv->sp.spfl) {
		case DT_SPFL_N_YEAR:
		case DT_SPFL_N_MON:
		case DT_SPFL_N_DCNT_WEEK:
		case DT_SPFL_N_DCNT_MON:
		case DT_SPFL_N_DCNT_YEAR:
		case DT_SPFL_N_WCNT_MON:
		case DT_SPFL_N_WCNT_YEAR:
			ckv->s = strtol(yystack.l_mark[0].sval, NULL, 10);
			break;
		default:
			/* the rest can hardly have ints as inputs */
			YYERROR;
		}
	}
break;
#line 684 "dexpr-parser.c"
    }
    yystack.s_mark -= yym;
    yystate = *yystack.s_mark;
    yystack.l_mark -= yym;
    yym = yylhs[yyn];
    if (yystate == 0 && yym == 0)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: after reduction, shifting from state 0 to\
 state %d\n", YYPREFIX, YYFINAL);
#endif
        yystate = YYFINAL;
        *++yystack.s_mark = YYFINAL;
        *++yystack.l_mark = yyval;
        if (yychar < 0)
        {
            if ((yychar = YYLEX) < 0) yychar = 0;
#if YYDEBUG
            if (yydebug)
            {
                yys = 0;
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                if (!yys) yys = "illegal-symbol";
                printf("%sdebug: state %d, reading %d (%s)\n",
                        YYPREFIX, YYFINAL, yychar, yys);
            }
#endif
        }
        if (yychar == 0) goto yyaccept;
        goto yyloop;
    }
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn];
    else
        yystate = yydgoto[yym];
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
#endif
    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
    {
        goto yyoverflow;
    }
    *++yystack.s_mark = (short) yystate;
    *++yystack.l_mark = yyval;
    goto yyloop;

yyoverflow:
    yyerror(cur, "yacc stack overflow");

yyabort:
    yyfreestack(&yystack);
    return (1);

yyaccept:
    yyfreestack(&yystack);
    return (0);
}
