
/*  A Bison parser, made from dateyacc.y
 by  GNU Bison version 1.25
  */

#define YYBISON 1  /* Identify Bison output.  */

#define	DAY_NAME	258
#define	MONTH_NAME	259
#define	NUM9	260
#define	NUM23	261
#define	NUM59	262
#define	NUM99	263
#define	NUM2359	264
#define	NUM9999	265
#define	NUM235959	266
#define	NUM991231	267
#define	NUM99991231	268
#define	AMPM	269
#define	STD_ZONE	270
#define	DST_ZONE	271
#define	DST_SUFFIX	272

#line 40 "dateyacc.y"

#ifdef RCSIDENT
static char rcsident[] = "$Header: /usr/local/cvsroot/Yenta/App/C/Savant/savutil/parsedate/dateyacc.c,v 1.2 1998/10/29 05:29:22 amu Exp $";
#endif

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>

#define	yymaxdepth date_maxdepth
#define	yyparse	date_parse
#define	yylex	date_lex
#define	yyerror	date_error
#define	yylval	date_lval
#define	yychar	date_char
#define	yydebug	date_debug
#define	yypact	date_pact
#define	yyr1	date_r1
#define	yyr2	date_r2
#define	yydef	date_def
#define	yychk	date_chk
#define	yypgo	date_pgo
#define	yyact	date_act
#define	yyexca	date_exca
#define yyerrflag date_errflag
#define yynerrs	date_nerrs
#define	yyps	date_ps
#define	yypv	date_pv
#define	yys	date_s
#define	yy_yys	date_yys
#define	yystate	date_state
#define	yytmp	date_tmp
#define	yyv	date_v
#define	yy_yyv	date_yyv
#define	yyval	date_val
#define	yylloc	date_lloc
#define yyreds	date_reds
#define yytoks	date_toks
#define yylhs	date_yylhs
#define yylen	date_yylen
#define yydefred date_yydefred
#define yydgoto	date_yydgoto
#define yysindex date_yysindex
#define yyrindex date_yyrindex
#define yygindex date_yygindex
#define yytable	 date_yytable
#define yycheck	 date_yycheck

#define yyans date_ans
#define yyinbuf date_inbuf

#include "parsedate.h"
struct parsedate yyans;

/* No error routine is needed here. */
#define date_error(s)

#line 100 "dateyacc.y"
typedef union {
    int IntVal;
} YYSTYPE;
#include <stdio.h>

#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif



#define	YYFINAL		187
#define	YYFLAG		-32768
#define	YYNTBASE	23

#define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 42)

static const char 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,    22,     2,    19,    18,    20,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,    21,     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,     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
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     4,     6,     8,    10,    13,    17,    22,    26,
    31,    34,    38,    43,    47,    52,    54,    57,    61,    64,
    68,    71,    75,    80,    83,    87,    91,    95,    99,   102,
   106,   111,   113,   116,   120,   125,   128,   132,   136,   140,
   144,   147,   151,   156,   158,   161,   165,   168,   172,   176,
   181,   186,   190,   195,   200,   202,   204,   208,   212,   217,
   219,   221,   224,   227,   231,   235,   238,   242,   244,   246,
   248,   251,   254,   257,   261,   265,   269,   273,   277,   281,
   283,   285,   287,   289,   292,   294,   297,   300,   304,   306,
   308,   312,   316,   322,   328,   332,   336,   342,   348,   352,
   356,   358,   360,   362,   365,   368,   372,   374,   377,   380,
   384,   387,   391,   395,   400,   404,   409,   415,   420,   424,
   429,   433,   438,   444,   449,   451,   455,   459,   461,   465,
   469,   471
};

static const short yyrhs[] = {     6,
     0,     7,     0,     5,     0,    23,     0,    30,     0,    30,
    26,     0,    30,    26,    35,     0,    30,    26,    35,    33,
     0,    30,    26,    33,     0,    30,    26,    33,    35,     0,
    30,    35,     0,    30,    35,    26,     0,    30,    35,    26,
    33,     0,    30,    35,    33,     0,    30,    35,    33,    26,
     0,    27,     0,    27,    26,     0,    27,    26,    35,     0,
    27,    35,     0,    27,    35,    26,     0,    26,    30,     0,
    26,    30,    35,     0,    26,    30,    35,    33,     0,    26,
    27,     0,    26,    27,    35,     0,    26,    35,    30,     0,
    26,    35,    27,     0,    26,    35,    28,     0,    26,    28,
     0,    26,    28,    35,     0,    26,    33,    35,    30,     0,
    35,     0,    35,    30,     0,    35,    30,    26,     0,    35,
    30,    26,    33,     0,    35,    27,     0,    35,    27,    26,
     0,    35,    26,    30,     0,    35,    26,    27,     0,    35,
    26,    28,     0,    35,    28,     0,    35,    28,    26,     0,
    35,    33,    26,    30,     0,    28,     0,    28,    26,     0,
    28,    26,    35,     0,    28,    35,     0,    28,    35,    26,
     0,    33,    26,    30,     0,    33,    26,    30,    35,     0,
    33,    26,    35,    30,     0,    33,    35,    30,     0,    33,
    35,    30,    26,     0,    33,    35,    26,    30,     0,     9,
     0,    26,     0,    29,    18,    41,     0,    29,    18,    35,
     0,    29,    18,    35,    26,     0,     1,     0,     3,     0,
     3,    18,     0,    30,    33,     0,    31,    19,    33,     0,
    32,    20,    33,     0,    33,    30,     0,    33,    20,    32,
     0,    29,     0,    12,     0,    13,     0,    24,    34,     0,
    34,    24,     0,    24,    24,     0,    24,    19,    34,     0,
    34,    19,    24,     0,    24,    19,    24,     0,    24,    20,
    34,     0,    34,    20,    24,     0,    24,    20,    24,     0,
     8,     0,     9,     0,    10,     0,     4,     0,     4,    18,
     0,    37,     0,    36,    38,     0,    36,    39,     0,    36,
    38,    39,     0,     9,     0,    37,     0,     5,    21,    23,
     0,     5,    18,    23,     0,     5,    21,    23,    21,    23,
     0,     5,    18,    23,    18,    23,     0,     6,    21,    23,
     0,     6,    18,    23,     0,     6,    21,    23,    21,    23,
     0,     6,    18,    23,    18,    23,     0,     9,    21,    23,
     0,     9,    18,    23,     0,    11,     0,    14,     0,    15,
     0,    15,    17,     0,    19,    15,     0,    19,    15,    17,
     0,    16,     0,    19,    16,     0,    22,    40,     0,    19,
    22,    40,     0,    19,    40,     0,    19,    19,    40,     0,
    22,    40,    15,     0,    22,    40,    15,    17,     0,    22,
    40,    16,     0,    19,    22,    40,    15,     0,    19,    22,
    40,    15,    17,     0,    19,    22,    40,    16,     0,    19,
    40,    15,     0,    19,    40,    15,    17,     0,    19,    40,
    16,     0,    19,    19,    40,    15,     0,    19,    19,    40,
    15,    17,     0,    19,    19,    40,    16,     0,     5,     0,
     5,    21,    23,     0,     5,    18,    23,     0,     6,     0,
     6,    21,    23,     0,     6,    18,    23,     0,     9,     0,
     9,     0
};

#endif

#if YYDEBUG != 0
static const short yyrline[] = { 0,
   122,   124,   126,   128,   130,   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,   186,   187,   188,   189,   190,
   195,   198,   201,   203,   204,   206,   209,   210,   212,   219,
   225,   228,   230,   233,   236,   238,   241,   244,   246,   249,
   252,   254,   257,   260,   263,   265,   266,   267,   269,   275,
   277,   283,   288,   293,   298,   303,   308,   313,   318,   323,
   328,   334,   343,   346,   348,   350,   352,   354,   356,   358,
   360,   362,   365,   367,   369,   371,   373,   375,   377,   379,
   381,   383,   385,   387,   390,   393,   395,   397,   399,   401,
   403,   406
};
#endif


#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)

static const char * const yytname[] = {   "$","error","$undefined.","DAY_NAME",
"MONTH_NAME","NUM9","NUM23","NUM59","NUM99","NUM2359","NUM9999","NUM235959",
"NUM991231","NUM99991231","AMPM","STD_ZONE","DST_ZONE","DST_SUFFIX","'.'","'-'",
"'/'","':'","'+'","num59","num","goal","dayname","date.year","year.date","yymmdd",
"date","hyphen.date","slash.date","year","month.name","time","hour","hour.alone",
"am.pm","zone","zone.offset","time2359", NULL
};
#endif

static const short yyr1[] = {     0,
    23,    23,    24,    24,    25,    25,    25,    25,    25,    25,
    25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
    25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
    25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
    25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
    25,    25,    25,    25,    25,    25,    25,    25,    25,    25,
    26,    26,    27,    27,    27,    28,    28,    28,    29,    29,
    30,    30,    30,    31,    31,    31,    32,    32,    32,    33,
    33,    33,    34,    34,    35,    35,    35,    35,    36,    36,
    37,    37,    37,    37,    37,    37,    37,    37,    37,    37,
    37,    38,    39,    39,    39,    39,    39,    39,    39,    39,
    39,    39,    39,    39,    39,    39,    39,    39,    39,    39,
    39,    39,    39,    39,    40,    40,    40,    40,    40,    40,
    40,    41
};

static const short yyr2[] = {     0,
     1,     1,     1,     1,     1,     2,     3,     4,     3,     4,
     2,     3,     4,     3,     4,     1,     2,     3,     2,     3,
     2,     3,     4,     2,     3,     3,     3,     3,     2,     3,
     4,     1,     2,     3,     4,     2,     3,     3,     3,     3,
     2,     3,     4,     1,     2,     3,     2,     3,     3,     4,
     4,     3,     4,     4,     1,     1,     3,     3,     4,     1,
     1,     2,     2,     3,     3,     2,     3,     1,     1,     1,
     2,     2,     2,     3,     3,     3,     3,     3,     3,     1,
     1,     1,     1,     2,     1,     2,     2,     3,     1,     1,
     3,     3,     5,     5,     3,     3,     5,     5,     3,     3,
     1,     1,     1,     2,     2,     3,     1,     2,     2,     3,
     2,     3,     3,     4,     3,     4,     5,     4,     3,     4,
     3,     4,     5,     4,     1,     3,     3,     1,     3,     3,
     1,     1
};

static const short yydefact[] = {     0,
    60,    61,    83,     3,     1,     2,    80,    81,    82,   101,
    69,    70,     4,     0,    56,    16,    44,    68,     5,     0,
     0,     0,     0,    32,     0,    85,    62,    84,     0,     0,
     0,     0,     0,     0,     3,     1,     0,     0,    73,    71,
    81,    24,    29,    68,    21,     0,     0,     0,     0,    89,
    17,    19,    45,    47,     0,     6,    63,    11,     0,     0,
     0,     0,     0,    66,     0,     0,     0,     0,    72,    81,
     0,    36,    41,    33,     0,   102,   103,   107,     0,     0,
    86,    87,    92,    91,    96,    95,   100,    99,    76,    74,
    79,    77,    25,    30,    22,     0,    27,    28,    26,     0,
    18,    20,    46,    48,    89,    58,    57,     9,     7,    12,
    14,    64,    65,     0,    67,     0,    49,     0,     0,    52,
    75,    78,    39,    40,    38,    37,    42,    34,     0,   104,
   125,   128,   131,   105,   108,     0,     0,   111,   109,    88,
     0,     0,     0,     0,    23,    31,    59,    10,     8,    13,
    15,    50,    51,    54,    53,    35,    43,     0,     0,     0,
     0,   106,   112,   110,   119,   121,   113,   115,    94,    93,
    98,    97,   127,   126,   130,   129,   122,   124,   116,   118,
   120,   114,   123,   117,     0,     0,     0
};

static const short yydefgoto[] = {    13,
    62,   185,    15,    16,    17,    44,    64,    20,    21,    57,
    65,    24,    25,    26,    81,    82,   138,   107
};

static const short yypact[] = {   254,
-32768,   -11,    -2,    -3,    24,-32768,-32768,   165,-32768,-32768,
-32768,-32768,-32768,     5,   275,   134,   134,     9,    51,     1,
    28,    78,   234,   265,    21,   286,-32768,-32768,   157,   157,
   157,   157,   157,   157,-32768,-32768,   339,   339,-32768,-32768,
   230,   319,   319,-32768,   312,   227,   285,    -3,    24,    29,
   319,    19,   319,    19,   326,   312,-32768,    83,   180,   180,
   339,   339,   305,-32768,   213,   335,   213,   213,-32768,-32768,
   285,    19,    19,    83,   102,-32768,    12,-32768,   208,    95,
   155,-32768,    15,    31,    40,    42,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   180,   339,-32768,-32768,   180,   190,
-32768,-32768,-32768,-32768,    13,    19,-32768,   319,   180,   180,
    19,-32768,-32768,    45,-32768,    58,   319,   339,   339,    19,
-32768,-32768,-32768,-32768,   180,-32768,-32768,   180,   339,-32768,
   123,   130,-32768,    73,-32768,    95,    95,   192,   288,-32768,
   157,   157,   157,   157,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,   157,   157,   157,
   157,-32768,   291,   311,    82,-32768,    93,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,    94,-32768,    99,-32768,
-32768,-32768,-32768,-32768,   127,   156,-32768
};

static const short yypgoto[] = {   -29,
   138,-32768,    22,     2,     4,   158,     6,-32768,   105,     8,
   154,   104,-32768,-32768,-32768,    53,   -66,-32768
};


#define	YYLAST		346


static const short yytable[] = {    83,
    84,    85,    86,    87,    88,    19,    27,    22,     3,    35,
    36,     6,  -132,   139,    29,    28,    42,    30,    43,    59,
    45,     2,    46,    37,    38,    72,    55,    73,   130,    74,
    33,    75,   141,    34,    76,    77,    78,    51,    53,    79,
    56,    31,    80,    63,    32,    71,    33,    60,    97,    34,
    98,   142,    99,     2,   100,    48,    49,   143,     7,    41,
     9,    10,   144,   108,    38,   111,   112,   113,   117,   163,
   164,   120,   123,   102,   124,   104,   125,    68,   100,   110,
     2,     3,     4,     5,     6,     2,    50,   119,    10,   162,
     7,    70,     9,   126,   127,   128,   129,    61,   181,   131,
   132,   146,   145,   133,     2,     3,    35,    36,     6,   182,
   183,   169,   170,   171,   172,   184,   149,   150,    47,    52,
    54,    61,    58,   153,   154,    66,   186,   147,   173,   174,
   175,   176,   151,   140,   157,   156,     2,    14,    48,    49,
   158,   155,    50,   159,    10,    93,    94,   160,    95,    96,
   161,    39,    14,    23,   101,   187,   103,    18,   106,   109,
    69,    14,    36,     6,   -55,   115,   118,    40,    23,    77,
    78,     0,     0,    79,    89,    91,    80,    23,   -89,   -89,
   -89,     0,    33,   -89,    14,    34,   -89,     7,    70,     9,
    90,    92,     0,     3,    35,    36,     6,     0,   114,    39,
    23,     0,    69,     0,   121,   122,   165,   166,    14,    61,
     0,   148,   131,   132,   116,    40,   133,    35,    36,     6,
   152,     0,   134,   135,    23,     0,   136,     0,     0,   137,
     3,     4,     5,     6,     0,    50,     0,    10,    35,    36,
     6,     0,     0,   -89,   -89,   -89,    61,    33,   -89,     0,
    34,   -89,    67,    68,     1,     0,     2,     3,     4,     5,
     6,     7,     8,     9,    10,    11,    12,     2,     3,    35,
    36,     6,     7,    70,     9,     0,    11,    12,     3,     4,
     5,     6,     7,    41,     9,    10,    11,    12,     3,    35,
    36,     6,     7,    70,     9,     0,    11,    12,     0,   -90,
   -90,   -90,   167,   168,   -90,   177,   178,   -90,     3,     4,
     5,     6,     0,    50,     0,    10,    48,    49,     0,     7,
    41,     9,    10,    48,    49,   179,   180,    50,     0,    10,
    48,    49,     0,     0,   105,     0,    10,     2,     3,    35,
    36,     6,     3,    35,    36,     6
};

static const short yycheck[] = {    29,
    30,    31,    32,    33,    34,     0,    18,     0,     4,     5,
     6,     7,     0,    80,    18,    18,    15,    21,    15,    19,
    15,     3,    15,    19,    20,    24,    18,    24,    17,    24,
    18,    24,    18,    21,    14,    15,    16,    16,    17,    19,
    19,    18,    22,    22,    21,    24,    18,    20,    47,    21,
    47,    21,    47,     3,    47,     5,     6,    18,     8,     9,
    10,    11,    21,    56,    20,    58,    59,    60,    63,   136,
   137,    66,    71,    52,    71,    54,    71,    20,    71,    58,
     3,     4,     5,     6,     7,     3,     9,    66,    11,    17,
     8,     9,    10,    72,    73,    74,    75,    20,    17,     5,
     6,    96,    95,     9,     3,     4,     5,     6,     7,    17,
    17,   141,   142,   143,   144,    17,   109,   110,    15,    16,
    17,    20,    19,   118,   119,    22,     0,   106,   158,   159,
   160,   161,   111,    81,   129,   128,     3,     0,     5,     6,
    18,   120,     9,    21,    11,    42,    43,    18,    45,    46,
    21,    14,    15,     0,    51,     0,    53,     0,    55,    56,
    23,    24,     6,     7,     0,    61,    63,    14,    15,    15,
    16,    -1,    -1,    19,    37,    38,    22,    24,    14,    15,
    16,    -1,    18,    19,    47,    21,    22,     8,     9,    10,
    37,    38,    -1,     4,     5,     6,     7,    -1,    61,    62,
    47,    -1,    65,    -1,    67,    68,    15,    16,    71,    20,
    -1,   108,     5,     6,    61,    62,     9,     5,     6,     7,
   117,    -1,    15,    16,    71,    -1,    19,    -1,    -1,    22,
     4,     5,     6,     7,    -1,     9,    -1,    11,     5,     6,
     7,    -1,    -1,    14,    15,    16,    20,    18,    19,    -1,
    21,    22,    19,    20,     1,    -1,     3,     4,     5,     6,
     7,     8,     9,    10,    11,    12,    13,     3,     4,     5,
     6,     7,     8,     9,    10,    -1,    12,    13,     4,     5,
     6,     7,     8,     9,    10,    11,    12,    13,     4,     5,
     6,     7,     8,     9,    10,    -1,    12,    13,    -1,    14,
    15,    16,    15,    16,    19,    15,    16,    22,     4,     5,
     6,     7,    -1,     9,    -1,    11,     5,     6,    -1,     8,
     9,    10,    11,     5,     6,    15,    16,     9,    -1,    11,
     5,     6,    -1,    -1,     9,    -1,    11,     3,     4,     5,
     6,     7,     4,     5,     6,     7
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/local/share/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 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 2, 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, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	return(0)
#define YYABORT 	return(1)
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    { yychar = (token), yylval = (value);			\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

#ifndef YYPURE
#define YYLEX		yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX		yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX		yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX		yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	yychar;			/*  the lookahead symbol		*/
YYSTYPE	yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

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

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
int yyparse (void);
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_memcpy (to, from, count)
     char *to;
     char *from;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_memcpy (char *to, char *from, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 196 "/usr/local/share/bison.simple"

/* The user can define YYPARSE_PARAM as the name of an argument to be passed
   into yyparse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef YYPARSE_PARAM
#ifdef __cplusplus
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* not __cplusplus */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#endif /* not __cplusplus */
#else /* not YYPARSE_PARAM */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */

int
yyparse(YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YYSTYPE *yyvsp;
  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */

  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/

  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YYLSP_NEEDED
  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YYPURE
  int yychar;
  YYSTYPE yylval;
  int yynerrs;
#ifdef YYLSP_NEEDED
  YYLTYPE yylloc;
#endif
#endif

  YYSTYPE yyval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int yylen;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Starting parse\n");
#endif

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YYLSP_NEEDED
  yylsp = yyls;
#endif

/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
yynewstate:

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Give user a chance to reallocate the stack */
      /* Use copies of these so that the &'s don't force the real ones into memory. */
      YYSTYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
#ifdef YYLSP_NEEDED
      /* This used to be a conditional around just the two extra args,
	 but that might be undefined if yyoverflow is a macro.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yyls1, size * sizeof (*yylsp),
		 &yystacksize);
#else
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yystacksize);
#endif

      yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  yyerror("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  goto yybackup;
 yybackup:

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

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

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

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

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

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 55:
#line 182 "dateyacc.y"
{ yyans.hour   = yyvsp[0].IntVal / 100;
	  yyans.minute = yyvsp[0].IntVal % 100;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 60:
#line 191 "dateyacc.y"
{ extern char *yyinbuf;
	  if (yyans.error == NULL) yyans.error = yyinbuf;
	;
    break;}
case 61:
#line 197 "dateyacc.y"
{ yyans.c_weekday = yyvsp[0].IntVal; ;
    break;}
case 62:
#line 199 "dateyacc.y"
{ yyans.c_weekday = yyvsp[-1].IntVal; ;
    break;}
case 69:
#line 214 "dateyacc.y"
{ yyans.year  = (yyvsp[0].IntVal / 10000) + 1900;	/* ajs */
	  yyans.month = (yyvsp[0].IntVal % 10000) / 100;	/* ajs */
	  yyans.day   = (yyvsp[0].IntVal % 100);		/* ajs */
	;
    break;}
case 70:
#line 220 "dateyacc.y"
{ yyans.year  = (yyvsp[0].IntVal / 10000);		/* ajs */
	  yyans.month = (yyvsp[0].IntVal % 10000) / 100;	/* ajs */
	  yyans.day   = (yyvsp[0].IntVal % 100);		/* ajs */
	;
    break;}
case 71:
#line 227 "dateyacc.y"
{ yyans.day = yyvsp[-1].IntVal; ;
    break;}
case 72:
#line 229 "dateyacc.y"
{ yyans.day = yyvsp[0].IntVal; ;
    break;}
case 73:
#line 231 "dateyacc.y"
{ yyans.month = yyvsp[-1].IntVal; yyans.day = yyvsp[0].IntVal; ;
    break;}
case 74:
#line 235 "dateyacc.y"
{ yyans.day = yyvsp[-2].IntVal; ;
    break;}
case 75:
#line 237 "dateyacc.y"
{ yyans.day = yyvsp[0].IntVal; ;
    break;}
case 76:
#line 239 "dateyacc.y"
{ yyans.month = yyvsp[-2].IntVal; yyans.day = yyvsp[0].IntVal; ;
    break;}
case 77:
#line 243 "dateyacc.y"
{ yyans.day = yyvsp[-2].IntVal; ;
    break;}
case 78:
#line 245 "dateyacc.y"
{ yyans.day = yyvsp[0].IntVal; ;
    break;}
case 79:
#line 247 "dateyacc.y"
{ yyans.month = yyvsp[-2].IntVal; yyans.day = yyvsp[0].IntVal; ;
    break;}
case 80:
#line 251 "dateyacc.y"
{ yyans.year = 1900 + yyvsp[0].IntVal; ;
    break;}
case 81:
#line 253 "dateyacc.y"
{ yyans.year = yyvsp[0].IntVal; ;
    break;}
case 82:
#line 255 "dateyacc.y"
{ yyans.year = yyvsp[0].IntVal; ;
    break;}
case 83:
#line 259 "dateyacc.y"
{ yyans.month = yyvsp[0].IntVal; ;
    break;}
case 84:
#line 261 "dateyacc.y"
{ yyans.month = yyvsp[-1].IntVal; ;
    break;}
case 89:
#line 271 "dateyacc.y"
{ yyans.hour   = yyvsp[0].IntVal / 100;
	  yyans.minute = yyvsp[0].IntVal % 100;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 91:
#line 279 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal;
	  yyans.minute = yyvsp[0].IntVal;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 92:
#line 284 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal;
	  yyans.minute = yyvsp[0].IntVal;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 93:
#line 289 "dateyacc.y"
{ yyans.hour   = yyvsp[-4].IntVal;
	  yyans.minute = yyvsp[-2].IntVal;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 94:
#line 294 "dateyacc.y"
{ yyans.hour   = yyvsp[-4].IntVal;
	  yyans.minute = yyvsp[-2].IntVal;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 95:
#line 299 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal;
	  yyans.minute = yyvsp[0].IntVal;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 96:
#line 304 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal;
	  yyans.minute = yyvsp[0].IntVal;
	  yyans.second = -1;		/* unspecified */
	;
    break;}
case 97:
#line 309 "dateyacc.y"
{ yyans.hour   = yyvsp[-4].IntVal;
	  yyans.minute = yyvsp[-2].IntVal;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 98:
#line 314 "dateyacc.y"
{ yyans.hour   = yyvsp[-4].IntVal;
	  yyans.minute = yyvsp[-2].IntVal;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 99:
#line 319 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal / 100;
	  yyans.minute = yyvsp[-2].IntVal % 100;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 100:
#line 324 "dateyacc.y"
{ yyans.hour   = yyvsp[-2].IntVal / 100;
	  yyans.minute = yyvsp[-2].IntVal % 100;
	  yyans.second = yyvsp[0].IntVal;
	;
    break;}
case 101:
#line 329 "dateyacc.y"
{ yyans.hour   = yyvsp[0].IntVal / 10000;
	  yyans.minute = (yyvsp[0].IntVal % 10000) / 100;
	  yyans.second = yyvsp[0].IntVal % 100;
	;
    break;}
case 102:
#line 336 "dateyacc.y"
{ if (yyans.hour < 1 || yyans.hour > 12)
	    yyans.hour = -1;		/* invalid */
	  else
	  { if (yyans.hour == 12) yyans.hour = 0;
	    yyans.hour += yyvsp[0].IntVal;		/* 0 for AM, 12 for PM */
	} ;
    break;}
case 103:
#line 345 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 104:
#line 347 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal + 60; yyans.dst = 1; ;
    break;}
case 105:
#line 349 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 106:
#line 351 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal + 60; yyans.dst = 1; ;
    break;}
case 107:
#line 353 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 1; ;
    break;}
case 108:
#line 355 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 1; ;
    break;}
case 109:
#line 357 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 110:
#line 359 "dateyacc.y"
{ yyans.zone = yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 111:
#line 361 "dateyacc.y"
{ yyans.zone = - yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 112:
#line 363 "dateyacc.y"
{ yyans.zone = - yyvsp[0].IntVal; yyans.dst = 0; ;
    break;}
case 113:
#line 366 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 114:
#line 368 "dateyacc.y"
{ yyans.zone = yyvsp[-2].IntVal; yyans.dst = 0; ;
    break;}
case 115:
#line 370 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 116:
#line 372 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 117:
#line 374 "dateyacc.y"
{ yyans.zone = yyvsp[-2].IntVal; yyans.dst = 0; ;
    break;}
case 118:
#line 376 "dateyacc.y"
{ yyans.zone = yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 119:
#line 378 "dateyacc.y"
{ yyans.zone = - yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 120:
#line 380 "dateyacc.y"
{ yyans.zone = - yyvsp[-2].IntVal; yyans.dst = 0; ;
    break;}
case 121:
#line 382 "dateyacc.y"
{ yyans.zone = - yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 122:
#line 384 "dateyacc.y"
{ yyans.zone = - yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 123:
#line 386 "dateyacc.y"
{ yyans.zone = - yyvsp[-2].IntVal; yyans.dst = 0; ;
    break;}
case 124:
#line 388 "dateyacc.y"
{ yyans.zone = - yyvsp[-1].IntVal; yyans.dst = 0; ;
    break;}
case 125:
#line 392 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[0].IntVal; ;
    break;}
case 126:
#line 394 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
    break;}
case 127:
#line 396 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
    break;}
case 128:
#line 398 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[0].IntVal; ;
    break;}
case 129:
#line 400 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
    break;}
case 130:
#line 402 "dateyacc.y"
{ yyval.IntVal = 60 * yyvsp[-2].IntVal + yyvsp[0].IntVal; ;
    break;}
case 131:
#line 404 "dateyacc.y"
{ yyval.IntVal = 60 * (yyvsp[0].IntVal / 100) | (yyvsp[0].IntVal % 100); ;
    break;}
case 132:
#line 408 "dateyacc.y"
{ yyans.hour   = yyvsp[0].IntVal / 100;	/* ajs */
	  yyans.minute = yyvsp[0].IntVal % 100;	/* ajs */
	  yyans.second = -1;		/* ajs */
	;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/local/share/bison.simple"

  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;

#ifdef YYLSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = yylloc.first_line;
      yylsp->first_column = yylloc.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#endif

  /* 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.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;

yyerrlab:   /* here on detecting error */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
	  for (x = (yyn < 0 ? -yyn : 0);
	       x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (yyn < 0 ? -yyn : 0);
		       x < (sizeof(yytname) / sizeof(char *)); x++)
		    if (yycheck[x + yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      yyerror(msg);
	      free(msg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

  goto yyerrlab1;
yyerrlab1:   /* here on error raised explicitly by an action */

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

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif

      yychar = YYEMPTY;
    }

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

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;

yyerrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

yyerrhandle:

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;
}
#line 413 "dateyacc.y"

