diff --git a/my_static_32_nc4_dap_conf.sh b/my_static_32_nc4_dap_conf.sh index 14d7aa581..7babdadd6 100644 --- a/my_static_32_nc4_dap_conf.sh +++ b/my_static_32_nc4_dap_conf.sh @@ -1,5 +1,5 @@ #!/bin/bash set -x -./configure --disable-doxygen --disable-shared --enable-dap --enable-netcdf-4 --enable-diskless CFLAGS="-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/hdf5-1.8.9/hl/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/include/ -DCURL_STATICLIB" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_static/bin -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/lib/.libs -L/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin" +./configure --disable-doxygen --disable-shared --enable-dap --enable-netcdf-4 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/hdf5-1.8.9/hl/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/include/ -DCURL_STATICLIB" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_static/bin -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/lib/.libs -L/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin" #-L/c/Users/wfisher/Desktop/curl-7.25.0/lib/.libs/libcurl.a" \ No newline at end of file diff --git a/my_static_64_nc4_conf.sh b/my_static_64_nc4_conf.sh index 90067e080..b1b301425 100644 --- a/my_static_64_nc4_conf.sh +++ b/my_static_64_nc4_conf.sh @@ -1,13 +1,6 @@ #!/bin/bash -CTMP="" -if [ $# -gt 0 ]; then - CTMP="-fno-stack-check -fno-stack-protector -mno-stack-arg-probe" - echo "Building with additional flags: $CTMP" -fi - - set -x -./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="$CTMP -ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64/" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64" +./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64" #./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_static/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64" diff --git a/ncdap_test/t_dap3a.c b/ncdap_test/t_dap3a.c index 08b7fd115..de901d6d4 100644 --- a/ncdap_test/t_dap3a.c +++ b/ncdap_test/t_dap3a.c @@ -113,8 +113,9 @@ int main() char* url; char* topsrcdir = (char*)malloc(1024*sizeof(char)); size_t len; + int i; #ifndef USE_NETCDF4 - int i,j; + int j; #endif /* location of our target url: use file:// to avoid remote @@ -125,6 +126,15 @@ int main() //topsrcdir = getenv("TOPSRCDIR"); char cwd[1024]; getcwd(cwd,sizeof(cwd)); + +#ifdef __MINGW32__ + /* Convert to MinGW-style paths if need be. */ + for(i = 0; i < strlen(cwd); i++) { + if(cwd[i] == '\\') + cwd[i] = '/'; + } +#endif + sprintf(topsrcdir,"%s/..",cwd); if(topsrcdir == NULL) { fprintf(stderr,"*** FAIL: $abs_top_srcdir not defined: location= %s:%d\n",__FILE__,__LINE__); diff --git a/ncdap_test/test_cvt.c b/ncdap_test/test_cvt.c index aee8a01fa..2f5178d54 100644 --- a/ncdap_test/test_cvt.c +++ b/ncdap_test/test_cvt.c @@ -122,6 +122,14 @@ int main() //topsrcdir = getenv("TOPSRCDIR"); char cwd[1024]; getcwd(cwd,sizeof(cwd)); +#ifdef __MINGW32__ + /* Convert to MinGW-style paths if need be. */ + for(i = 0; i < strlen(cwd); i++) { + if(cwd[i] == '\\') + cwd[i] = '/'; + } +#endif + sprintf(topsrcdir,"%s/..",cwd); if(topsrcdir == NULL) { fprintf(stderr,"*** FAIL: $abs_top_srcdir not defined: location= %s:%d\n",__FILE__,__LINE__); diff --git a/ncdap_test/test_vara.c b/ncdap_test/test_vara.c index 5c20a37c3..d5c3b1fa1 100644 --- a/ncdap_test/test_vara.c +++ b/ncdap_test/test_vara.c @@ -77,11 +77,19 @@ main() size_t count[RANK]; char* topsrcdir = (char*)malloc(sizeof(char)*1024); char url[4096]; - + int i; /* Assume that TESTS_ENVIRONMENT was set */ //topsrcdir = getenv("TOPSRCDIR"); char cwd[1024]; getcwd(cwd,sizeof(cwd)); +#ifdef __MINGW32__ + /* Convert to MinGW-style paths if need be. */ + for(i = 0; i < strlen(cwd); i++) { + if(cwd[i] == '\\') + cwd[i] = '/'; + } +#endif + sprintf(topsrcdir,"%s/..",cwd); if(topsrcdir == NULL) { fprintf(stderr,"*** FAIL: $abs_top_srcdir not defined: location= %s:%d\n",__FILE__,__LINE__); diff --git a/ncgen3/ncgentab.c b/ncgen3/ncgentab.c index 20552d418..c27e4a4bc 100644 --- a/ncgen3/ncgentab.c +++ b/ncgen3/ncgentab.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.6.2. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ -/* Bison implementation for Yacc-like parsers in C +/* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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 @@ -44,7 +45,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.6.2" +#define YYBISON_VERSION "2.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,6 +59,8 @@ /* Pull parsers. */ #define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse ncgparse @@ -68,9 +71,11 @@ #define yydebug ncgdebug #define yynerrs ncgnerrs + /* Copy the first part of user declarations. */ -/* Line 336 of yacc.c */ -#line 9 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 189 of yacc.c */ +#line 9 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" #ifdef sccs static char SccsId[] = "$Id: ncgen.y,v 1.34 2010/03/31 18:18:41 dmh Exp $"; @@ -143,16 +148,14 @@ void yyerror(char*); int yyerror(char*); #endif -/* Line 336 of yacc.c */ -#line 148 "ncgen.tab.c" -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif +/* Line 189 of yacc.c */ +#line 154 "ncgen.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -162,18 +165,12 @@ int yyerror(char*); # define YYERROR_VERBOSE 0 #endif -/* In a future release of Bison, this section will be replaced - by #include "ncgen.tab.h". */ -#ifndef NCG_NCGEN_TAB_H -# define NCG_NCGEN_TAB_H -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ncgdebug; +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 #endif + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -204,6 +201,7 @@ extern int ncgdebug; #endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -211,28 +209,12 @@ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif -extern YYSTYPE ncglval; - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int ncgparse (void *YYPARSE_PARAM); -#else -int ncgparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int ncgparse (void); -#else -int ncgparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !NCG_NCGEN_TAB_H */ /* Copy the second part of user declarations. */ -/* Line 353 of yacc.c */ -#line 236 "ncgen.tab.c" + +/* Line 264 of yacc.c */ +#line 218 "ncgen.tab.c" #ifdef short # undef short @@ -335,12 +317,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -363,24 +344,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -409,7 +390,23 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -429,26 +426,6 @@ union yyalloc #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, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ @@ -558,7 +535,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -573,7 +550,7 @@ static const char *const yytname[] = "vardecl", "type", "varlist", "varspec", "$@3", "var", "dimspec", "dimlist", "vdim", "attdecl", "$@4", "gattdecl", "$@5", "att", "gatt", "avar", "attr", "attvallist", "aconst", "attconst", "datasection", - "datadecls", "datadecl", "$@6", "constlist", "dconst", "$@7", "const", YY_NULL + "datadecls", "datadecl", "$@6", "constlist", "dconst", "$@7", "const", 0 }; #endif @@ -615,8 +592,8 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 1, 1, 1, 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -675,7 +652,8 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -689,12 +667,6 @@ static const yytype_uint8 yytable[] = 93, 66, 101, 94, 111, 0, 86, 0, 51 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-73)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 34, 4, 5, 6, 7, 8, 9, 10, 3, 26, @@ -752,18 +724,18 @@ static const yytype_uint8 yystos[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ @@ -773,38 +745,46 @@ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 + /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ while (YYID (0)) #endif -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - -/* This macro is provided for backward compatibility. */ +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif @@ -859,8 +839,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) YYSTYPE const * const yyvaluep; #endif { - FILE *yyo = yyoutput; - YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT @@ -998,6 +976,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1100,142 +1079,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1268,7 +1220,20 @@ yydestruct (yymsg, yytype, yyvaluep) } } - +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ @@ -1281,9 +1246,10 @@ YYSTYPE yylval; int yynerrs; -/*----------. -| yyparse. | -`----------*/ + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1307,6 +1273,8 @@ yyparse () #endif #endif { + + int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -1315,7 +1283,7 @@ yyparse () `yyss': related to states. `yyvs': related to semantic values. - Refer to the stacks through separate pointers, to allow yyoverflow + Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1369,6 +1337,7 @@ yyparse () The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -1460,7 +1429,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1491,8 +1460,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1546,44 +1515,49 @@ yyreduce: switch (yyn) { case 2: -/* Line 1787 of yacc.c */ -#line 114 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { init_netcdf(); } + +/* Line 1464 of yacc.c */ +#line 114 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { init_netcdf(); ;} break; case 3: -/* Line 1787 of yacc.c */ -#line 117 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 117 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (derror_count == 0) define_netcdf(netcdfname); if (derror_count > 0) exit(6); - } + ;} break; case 4: -/* Line 1787 of yacc.c */ -#line 125 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 125 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (derror_count == 0) close_netcdf(); - } + ;} break; case 11: -/* Line 1787 of yacc.c */ -#line 140 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 140 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (int_val <= 0) derror("dimension length must be positive"); dims[ndims].size = int_val; ndims++; - } + ;} break; case 12: -/* Line 1787 of yacc.c */ -#line 146 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 146 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { /* for rare case where 2^31 < dimsize < 2^32 */ if (double_val <= 0) derror("dimension length must be positive"); @@ -1593,23 +1567,25 @@ yyreduce: derror("dimension length must be an integer"); dims[ndims].size = (size_t) double_val; ndims++; - } + ;} break; case 13: -/* Line 1787 of yacc.c */ -#line 157 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 157 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (rec_dim != -1) derror("only one NC_UNLIMITED dimension allowed"); rec_dim = ndims; /* the unlimited (record) dimension */ dims[ndims].size = NC_UNLIMITED; ndims++; - } + ;} break; case 14: -/* Line 1787 of yacc.c */ -#line 165 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 165 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if ((yyvsp[(1) - (1)])->is_dim == 1) { derror( "duplicate dimension declaration for %s", @@ -1624,48 +1600,55 @@ yyreduce: (void) strcpy(dims[ndims].name, (yyvsp[(1) - (1)])->name); /* name for use in generated Fortran and C variables */ dims[ndims].lname = decodify((yyvsp[(1) - (1)])->name); - } + ;} break; case 27: -/* Line 1787 of yacc.c */ -#line 197 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_BYTE; } + +/* Line 1464 of yacc.c */ +#line 197 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_BYTE; ;} break; case 28: -/* Line 1787 of yacc.c */ -#line 198 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_CHAR; } + +/* Line 1464 of yacc.c */ +#line 198 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_CHAR; ;} break; case 29: -/* Line 1787 of yacc.c */ -#line 199 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_SHORT; } + +/* Line 1464 of yacc.c */ +#line 199 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_SHORT; ;} break; case 30: -/* Line 1787 of yacc.c */ -#line 200 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_INT; } + +/* Line 1464 of yacc.c */ +#line 200 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_INT; ;} break; case 31: -/* Line 1787 of yacc.c */ -#line 201 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_FLOAT; } + +/* Line 1464 of yacc.c */ +#line 201 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_FLOAT; ;} break; case 32: -/* Line 1787 of yacc.c */ -#line 202 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" - { type_code = NC_DOUBLE; } + +/* Line 1464 of yacc.c */ +#line 202 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + { type_code = NC_DOUBLE; ;} break; case 35: -/* Line 1787 of yacc.c */ -#line 208 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 208 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { static struct vars dummyvar; @@ -1697,21 +1680,23 @@ yyreduce: * the variable attribute "_FillValue". */ nc_getfill(type_code, &vars[nvars].fill_value); vars[nvars].has_data = 0; /* has no data (yet) */ - } + ;} break; case 36: -/* Line 1787 of yacc.c */ -#line 241 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 241 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { vars[nvars].ndims = nvdims; nvars++; - } + ;} break; case 42: -/* Line 1787 of yacc.c */ -#line 255 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 255 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (nvdims >= NC_MAX_VAR_DIMS) { derror("%s has too many dimensions",vars[nvars].name); @@ -1730,52 +1715,58 @@ yyreduce: &vars[nvars].dims); /* grow as needed */ vars[nvars].dims[nvdims] = dimnum; nvdims++; - } + ;} break; case 43: -/* Line 1787 of yacc.c */ -#line 276 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 276 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { defatt(); - } + ;} break; case 44: -/* Line 1787 of yacc.c */ -#line 280 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 280 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { equalatt(); - } + ;} break; case 45: -/* Line 1787 of yacc.c */ -#line 285 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 285 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { defatt(); - } + ;} break; case 46: -/* Line 1787 of yacc.c */ -#line 289 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 289 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { equalatt(); - } + ;} break; case 48: -/* Line 1787 of yacc.c */ -#line 297 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 297 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { varnum = NC_GLOBAL; /* handle of "global" attribute */ - } + ;} break; case 49: -/* Line 1787 of yacc.c */ -#line 303 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 303 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if ((yyvsp[(1) - (1)])->is_var == 1) varnum = (yyvsp[(1) - (1)])->vnum; else { @@ -1783,12 +1774,13 @@ yyreduce: (yyvsp[(1) - (1)])->name); YYABORT; } - } + ;} break; case 50: -/* Line 1787 of yacc.c */ -#line 313 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 313 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { /* make sure atts array will hold attributes */ grow_aarray(natts, /* must hold natts+1 atts */ @@ -1797,33 +1789,36 @@ yyreduce: (void) strcpy(atts[natts].name,(yyvsp[(1) - (1)])->name); /* name for use in generated Fortran and C variables */ atts[natts].lname = decodify((yyvsp[(1) - (1)])->name); - } + ;} break; case 53: -/* Line 1787 of yacc.c */ -#line 327 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 327 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (valtype == NC_UNSPECIFIED) valtype = atype_code; if (valtype != atype_code) derror("values for attribute must be all of same type"); - } + ;} break; case 54: -/* Line 1787 of yacc.c */ -#line 336 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 336 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_CHAR; *char_valp++ = char_val; valnum++; - } + ;} break; case 55: -/* Line 1787 of yacc.c */ -#line 342 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 342 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_CHAR; { @@ -1835,62 +1830,68 @@ yyreduce: valnum += len; char_valp += len; } - } + ;} break; case 56: -/* Line 1787 of yacc.c */ -#line 355 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 355 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_BYTE; *byte_valp++ = byte_val; valnum++; - } + ;} break; case 57: -/* Line 1787 of yacc.c */ -#line 361 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 361 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_SHORT; *short_valp++ = short_val; valnum++; - } + ;} break; case 58: -/* Line 1787 of yacc.c */ -#line 367 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 367 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_INT; *int_valp++ = int_val; valnum++; - } + ;} break; case 59: -/* Line 1787 of yacc.c */ -#line 373 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 373 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_FLOAT; *float_valp++ = float_val; valnum++; - } + ;} break; case 60: -/* Line 1787 of yacc.c */ -#line 379 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 379 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_DOUBLE; *double_valp++ = double_val; valnum++; - } + ;} break; case 66: -/* Line 1787 of yacc.c */ -#line 395 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 395 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { valtype = vars[varnum].type; /* variable type */ valnum = 0; /* values accumulated for variable */ @@ -1940,12 +1941,13 @@ yyreduce: break; default: break; } - } + ;} break; case 67: -/* Line 1787 of yacc.c */ -#line 446 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 446 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (valnum < var_len) { /* leftovers */ nc_fill(valtype, @@ -1959,12 +1961,13 @@ yyreduce: if (derror_count == 0) put_variable(rec_start); free ((char *) rec_start); - } + ;} break; case 70: -/* Line 1787 of yacc.c */ -#line 465 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 465 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if(valnum >= var_len) { if (vars[varnum].dims[0] != rec_dim) { /* not recvar */ @@ -1988,12 +1991,13 @@ yyreduce: } } not_a_string = 1; - } + ;} break; case 71: -/* Line 1787 of yacc.c */ -#line 490 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 490 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { if (not_a_string) { switch (valtype) { @@ -2018,12 +2022,13 @@ yyreduce: default: break; } } - } + ;} break; case 72: -/* Line 1787 of yacc.c */ -#line 518 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 518 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_CHAR; switch (valtype) { @@ -2048,12 +2053,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 73: -/* Line 1787 of yacc.c */ -#line 544 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 544 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { not_a_string = 0; atype_code = NC_CHAR; @@ -2107,12 +2113,13 @@ yyreduce: default: break; } } - } + ;} break; case 74: -/* Line 1787 of yacc.c */ -#line 599 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 599 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_BYTE; switch (valtype) { @@ -2137,12 +2144,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 75: -/* Line 1787 of yacc.c */ -#line 625 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 625 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_SHORT; switch (valtype) { @@ -2167,12 +2175,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 76: -/* Line 1787 of yacc.c */ -#line 651 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 651 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_INT; switch (valtype) { @@ -2197,12 +2206,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 77: -/* Line 1787 of yacc.c */ -#line 677 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 677 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_FLOAT; switch (valtype) { @@ -2227,12 +2237,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 78: -/* Line 1787 of yacc.c */ -#line 703 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 703 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { atype_code = NC_DOUBLE; switch (valtype) { @@ -2260,12 +2271,13 @@ yyreduce: default: break; } valnum++; - } + ;} break; case 79: -/* Line 1787 of yacc.c */ -#line 732 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1464 of yacc.c */ +#line 732 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" { /* store fill_value */ switch (valtype) { @@ -2296,25 +2308,15 @@ yyreduce: default: break; } valnum++; - } + ;} break; -/* Line 1787 of yacc.c */ -#line 2305 "ncgen.tab.c" + +/* Line 1464 of yacc.c */ +#line 2318 "ncgen.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 ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -2342,10 +2344,6 @@ yyreduce: | 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 ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -2353,36 +2351,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -2441,7 +2440,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -2488,7 +2487,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined yyoverflow || YYERROR_VERBOSE +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2500,13 +2499,8 @@ yyexhaustedlab: yyreturn: 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); - } + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2530,8 +2524,9 @@ yyreturn: } -/* Line 2048 of yacc.c */ -#line 767 "/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" + +/* Line 1684 of yacc.c */ +#line 767 "C:/Users/wfisher/Desktop/win_netcdf/ncgen3/ncgen.y" /* HELPER PROGRAMS */ @@ -2661,3 +2656,4 @@ clearout(void) /* reset symbol table to empty */ #define YY_NO_INPUT #include "ncgenyy.c" + diff --git a/ncgen3/ncgentab.h b/ncgen3/ncgentab.h index aafcd614e..90772e420 100644 --- a/ncgen3/ncgentab.h +++ b/ncgen3/ncgentab.h @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.6.2. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ -/* Bison interface for Yacc-like parsers in C +/* Skeleton interface for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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 @@ -30,15 +31,6 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef NCG_NCGEN_TAB_H -# define NCG_NCGEN_TAB_H -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ncgdebug; -#endif /* Tokens. */ #ifndef YYTOKENTYPE @@ -70,6 +62,7 @@ extern int ncgdebug; #endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -79,18 +72,4 @@ typedef int YYSTYPE; extern YYSTYPE ncglval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int ncgparse (void *YYPARSE_PARAM); -#else -int ncgparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int ncgparse (void); -#else -int ncgparse (); -#endif -#endif /* ! YYPARSE_PARAM */ -#endif /* !NCG_NCGEN_TAB_H */