home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
gnu
/
sh-utils-1.12-src.lha
/
sh-utils-1.12
/
lib
/
posixtm.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-05
|
24KB
|
979 lines
/* A Bison parser, made from ./posixtm.y with Bison version GNU Bison version 1.22
*/
#define YYBISON 1 /* Identify Bison output. */
#define DIGIT 258
#line 19 "./posixtm.y"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* The following block of alloca-related preprocessor directives is here
solely to allow compilation by non GNU-C compilers of the C parser
produced from this file by old versions of bison. Newer versions of
bison include a block similar to this one in bison.simple. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
#pragma alloca
#else
void *alloca ();
#endif
#endif
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
/* Some old versions of bison generate parsers that use bcopy.
That loses on systems that don't provide the function, so we have
to redefine it here. */
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
#define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
#define YYDEBUG 1
/* Lexical analyzer's current scan position in the input string. */
static char *curpos;
/* The return value. */
static struct tm t;
time_t mktime ();
#define zzparse posixtime_zzparse
static int zzlex ();
static int zzerror ();
#ifndef YYLTYPE
typedef
struct zzltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
zzltype;
#define YYLTYPE zzltype
#endif
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#include <stdio.h>
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
#define YYFINAL 15
#define YYFLAG -32768
#define YYNTBASE 5
#define YYTRANSLATE(x) ((unsigned)(x) <= 258 ? zztranslate[x] : 9)
static const char zztranslate[] = { 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, 4, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 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
};
#if YYDEBUG != 0
static const short zzprhs[] = { 0,
0, 7, 9, 12, 13, 14, 17
};
static const short zzrhs[] = { 8,
8, 8, 8, 6, 7, 0, 8, 0, 8, 8,
0, 0, 0, 4, 8, 0, 3, 3, 0
};
#endif
#if YYDEBUG != 0
static const short zzrline[] = { 0,
78, 107, 114, 121, 132, 135, 144
};
static const char * const zztname[] = { "$","error","$illegal.","DIGIT","'.'",
"date","year","seconds","digitpair",""
};
#endif
static const short zzr1[] = { 0,
5, 6, 6, 6, 7, 7, 8
};
static const short zzr2[] = { 0,
6, 1, 2, 0, 0, 2, 2
};
static const short zzdefact[] = { 0,
0, 0, 7, 0, 0, 4, 5, 2, 0, 1,
3, 6, 0, 0, 0
};
static const short zzdefgoto[] = { 13,
7, 10, 2
};
static const short zzpact[] = { 2,
5, 2,-32768, 2, 2, 2, -3, 2, 2,-32768,
-32768,-32768, 9, 10,-32768
};
static const short zzpgoto[] = {-32768,
-32768,-32768, -2
};
#define YYLAST 10
static const short zztable[] = { 4,
9, 5, 6, 8, 1, 11, 12, 3, 14, 15
};
static const short zzcheck[] = { 2,
4, 4, 5, 6, 3, 8, 9, 3, 0, 0
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
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 1, 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. */
#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 zzerrok (zzerrstatus = 0)
#define zzclearin (zzchar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT return(0)
#define YYABORT return(1)
#define YYERROR goto zzerrlab1
/* Like YYERROR except do call zzerror.
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 zzerrlab
#define YYRECOVERING() (!!zzerrstatus)
#define YYBACKUP(token, value) \
do \
if (zzchar == YYEMPTY && zzlen == 1) \
{ zzchar = (token), zzlval = (value); \
zzchar1 = YYTRANSLATE (zzchar); \
YYPOPSTACK; \
goto zzbackup; \
} \
else \
{ zzerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX zzlex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX zzlex(&zzlval, &zzlloc)
#else
#define YYLEX zzlex(&zzlval)
#endif
#endif
/* I