From 7b901e80dff8b7557b264c219713bc87763e32bb Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Wed, 15 May 2024 18:01:20 +0300 Subject: [PATCH 1/5] Use classic names for bison generated files (in oc2/ only) --- oc2/CMakeLists.txt | 2 +- oc2/Makefile.am | 9 +- oc2/dap.y | 2 +- oc2/daplex.c | 2 +- oc2/dapparse.c | 2 +- oc2/dapy.c | 2413 -------------------------------------------- oc2/dapy.h | 99 -- 7 files changed, 7 insertions(+), 2522 deletions(-) delete mode 100644 oc2/dapy.c delete mode 100644 oc2/dapy.h diff --git a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt index 01b2e998ee..3ae1d76ac1 100644 --- a/oc2/CMakeLists.txt +++ b/oc2/CMakeLists.txt @@ -4,7 +4,7 @@ # University Corporation for Atmospheric Research/Unidata. # See netcdf-c/COPYRIGHT file for more info. -set(oc_SOURCES oc.c daplex.c dapparse.c dapy.c occompile.c occurlfunctions.c ocdata.c ocdebug.c ocdump.c ocinternal.c ocnode.c ochttp.c ocread.c ocutil.c xxdr.c) +set(oc_SOURCES oc.c daplex.c dapparse.c dap.tab.c occompile.c occurlfunctions.c ocdata.c ocdebug.c ocdump.c ocinternal.c ocnode.c ochttp.c ocread.c ocutil.c xxdr.c) add_library(oc2 OBJECT ${oc_SOURCES}) diff --git a/oc2/Makefile.am b/oc2/Makefile.am index cf74b3deac..703c6f136a 100644 --- a/oc2/Makefile.am +++ b/oc2/Makefile.am @@ -21,7 +21,7 @@ ocread.c ocutil.c \ xxdr.c HDRS=oc.h ocx.h \ -dapparselex.h dapy.h \ +dapparselex.h dap.tab.h \ occompile.h occonstraints.h occurlfunctions.h \ ocdata.h ocdatatypes.h ocdebug.h ocdump.h \ ocinternal.h ocnode.h \ @@ -40,8 +40,5 @@ liboc_la_CPPFLAGS = $(AM_CPPFLAGS) # autoconf will forcibly delete files of the name *.tab.* makeparser:: - rm -f dap.tab.c dap.tab.h dapy.c dapy.h - bison --debug -d -p dap dap.y - sed -e 's/dap[.]tab[.]c/dapy.c/g' -e 's/dap[.]tab[.]h/dapy.h/g' dapy.c - mv dap.tab.h dapy.h - rm -f dap.tab.c + rm -f dap.tab.c dap.tab.h + bison --debug --defines -p dap dap.y diff --git a/oc2/dap.y b/oc2/dap.y index 11bb9db353..0cef981c0e 100644 --- a/oc2/dap.y +++ b/oc2/dap.y @@ -11,7 +11,7 @@ %{ #include "config.h" #include "dapparselex.h" -#include "dapy.h" +#include "dap.tab.h" int dapdebug = 0; %} diff --git a/oc2/daplex.c b/oc2/daplex.c index 84ea4c967c..e6c6e36c3a 100644 --- a/oc2/daplex.c +++ b/oc2/daplex.c @@ -8,7 +8,7 @@ #include "oc.h" #include "dapparselex.h" -#include "dapy.h" +#include "dap.tab.h" #undef URLCVT /* NEVER turn this on */ diff --git a/oc2/dapparse.c b/oc2/dapparse.c index 84103c5661..b63a490e71 100644 --- a/oc2/dapparse.c +++ b/oc2/dapparse.c @@ -4,7 +4,7 @@ #include "config.h" #include "dapparselex.h" -#include "dapy.h" +#include "dap.tab.h" #include /* Forward */ diff --git a/oc2/dapy.c b/oc2/dapy.c deleted file mode 100644 index ec27df86fa..0000000000 --- a/oc2/dapy.c +++ /dev/null @@ -1,2413 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output, and Bison version. */ -#define YYBISON 30802 - -/* Bison version string. */ -#define YYBISON_VERSION "3.8.2" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse dapparse -#define yylex daplex -#define yyerror daperror -#define yydebug dapdebug -#define yynerrs dapnerrs - -/* First part of user prologue. */ -#line 11 "dap.y" - -#include "config.h" -#include "dapparselex.h" -#include "dapy.h" -int dapdebug = 0; - -#line 83 "dapy.c" - -# ifndef YY_CAST -# ifdef __cplusplus -# define YY_CAST(Type, Val) static_cast (Val) -# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) -# else -# define YY_CAST(Type, Val) ((Type) (Val)) -# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) -# endif -# endif -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -#include "dapy.h" -/* Symbol kind. */ -enum yysymbol_kind_t -{ - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_SCAN_ALIAS = 3, /* SCAN_ALIAS */ - YYSYMBOL_SCAN_ARRAY = 4, /* SCAN_ARRAY */ - YYSYMBOL_SCAN_ATTR = 5, /* SCAN_ATTR */ - YYSYMBOL_SCAN_BYTE = 6, /* SCAN_BYTE */ - YYSYMBOL_SCAN_CODE = 7, /* SCAN_CODE */ - YYSYMBOL_SCAN_DATASET = 8, /* SCAN_DATASET */ - YYSYMBOL_SCAN_DATA = 9, /* SCAN_DATA */ - YYSYMBOL_SCAN_ERROR = 10, /* SCAN_ERROR */ - YYSYMBOL_SCAN_FLOAT32 = 11, /* SCAN_FLOAT32 */ - YYSYMBOL_SCAN_FLOAT64 = 12, /* SCAN_FLOAT64 */ - YYSYMBOL_SCAN_GRID = 13, /* SCAN_GRID */ - YYSYMBOL_SCAN_INT16 = 14, /* SCAN_INT16 */ - YYSYMBOL_SCAN_INT32 = 15, /* SCAN_INT32 */ - YYSYMBOL_SCAN_MAPS = 16, /* SCAN_MAPS */ - YYSYMBOL_SCAN_MESSAGE = 17, /* SCAN_MESSAGE */ - YYSYMBOL_SCAN_SEQUENCE = 18, /* SCAN_SEQUENCE */ - YYSYMBOL_SCAN_STRING = 19, /* SCAN_STRING */ - YYSYMBOL_SCAN_STRUCTURE = 20, /* SCAN_STRUCTURE */ - YYSYMBOL_SCAN_UINT16 = 21, /* SCAN_UINT16 */ - YYSYMBOL_SCAN_UINT32 = 22, /* SCAN_UINT32 */ - YYSYMBOL_SCAN_URL = 23, /* SCAN_URL */ - YYSYMBOL_SCAN_PTYPE = 24, /* SCAN_PTYPE */ - YYSYMBOL_SCAN_PROG = 25, /* SCAN_PROG */ - YYSYMBOL_WORD_WORD = 26, /* WORD_WORD */ - YYSYMBOL_WORD_STRING = 27, /* WORD_STRING */ - YYSYMBOL_28_ = 28, /* '{' */ - YYSYMBOL_29_ = 29, /* '}' */ - YYSYMBOL_30_ = 30, /* ';' */ - YYSYMBOL_31_ = 31, /* ':' */ - YYSYMBOL_32_ = 32, /* '[' */ - YYSYMBOL_33_ = 33, /* ']' */ - YYSYMBOL_34_ = 34, /* '=' */ - YYSYMBOL_35_ = 35, /* ',' */ - YYSYMBOL_YYACCEPT = 36, /* $accept */ - YYSYMBOL_start = 37, /* start */ - YYSYMBOL_dataset = 38, /* dataset */ - YYSYMBOL_attr = 39, /* attr */ - YYSYMBOL_err = 40, /* err */ - YYSYMBOL_datasetbody = 41, /* datasetbody */ - YYSYMBOL_declarations = 42, /* declarations */ - YYSYMBOL_declaration = 43, /* declaration */ - YYSYMBOL_base_type = 44, /* base_type */ - YYSYMBOL_array_decls = 45, /* array_decls */ - YYSYMBOL_array_decl = 46, /* array_decl */ - YYSYMBOL_datasetname = 47, /* datasetname */ - YYSYMBOL_var_name = 48, /* var_name */ - YYSYMBOL_attributebody = 49, /* attributebody */ - YYSYMBOL_attr_list = 50, /* attr_list */ - YYSYMBOL_attribute = 51, /* attribute */ - YYSYMBOL_bytes = 52, /* bytes */ - YYSYMBOL_int16 = 53, /* int16 */ - YYSYMBOL_uint16 = 54, /* uint16 */ - YYSYMBOL_int32 = 55, /* int32 */ - YYSYMBOL_uint32 = 56, /* uint32 */ - YYSYMBOL_float32 = 57, /* float32 */ - YYSYMBOL_float64 = 58, /* float64 */ - YYSYMBOL_strs = 59, /* strs */ - YYSYMBOL_urls = 60, /* urls */ - YYSYMBOL_url = 61, /* url */ - YYSYMBOL_str_or_id = 62, /* str_or_id */ - YYSYMBOL_alias = 63, /* alias */ - YYSYMBOL_errorbody = 64, /* errorbody */ - YYSYMBOL_errorcode = 65, /* errorcode */ - YYSYMBOL_errormsg = 66, /* errormsg */ - YYSYMBOL_errorptype = 67, /* errorptype */ - YYSYMBOL_errorprog = 68, /* errorprog */ - YYSYMBOL_name = 69 /* name */ -}; -typedef enum yysymbol_kind_t yysymbol_kind_t; - - - - -#ifdef short -# undef short -#endif - -/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure - and (if available) are included - so that the code can choose integer types of a good width. */ - -#ifndef __PTRDIFF_MAX__ -# include /* INFRINGES ON USER NAME SPACE */ -# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_STDINT_H -# endif -#endif - -/* Narrow types that promote to a signed type and that can represent a - signed or unsigned integer of at least N bits. In tables they can - save space and decrease cache pressure. Promoting to a signed type - helps avoid bugs in integer arithmetic. */ - -#ifdef __INT_LEAST8_MAX__ -typedef __INT_LEAST8_TYPE__ yytype_int8; -#elif defined YY_STDINT_H -typedef int_least8_t yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef __INT_LEAST16_MAX__ -typedef __INT_LEAST16_TYPE__ yytype_int16; -#elif defined YY_STDINT_H -typedef int_least16_t yytype_int16; -#else -typedef short yytype_int16; -#endif - -/* Work around bug in HP-UX 11.23, which defines these macros - incorrectly for preprocessor constants. This workaround can likely - be removed in 2023, as HPE has promised support for HP-UX 11.23 - (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of - . */ -#ifdef __hpux -# undef UINT_LEAST8_MAX -# undef UINT_LEAST16_MAX -# define UINT_LEAST8_MAX 255 -# define UINT_LEAST16_MAX 65535 -#endif - -#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST8_MAX <= INT_MAX) -typedef uint_least8_t yytype_uint8; -#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX -typedef unsigned char yytype_uint8; -#else -typedef short yytype_uint8; -#endif - -#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST16_MAX <= INT_MAX) -typedef uint_least16_t yytype_uint16; -#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX -typedef unsigned short yytype_uint16; -#else -typedef int yytype_uint16; -#endif - -#ifndef YYPTRDIFF_T -# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -# define YYPTRDIFF_T __PTRDIFF_TYPE__ -# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -# elif defined PTRDIFF_MAX -# ifndef ptrdiff_t -# include /* INFRINGES ON USER NAME SPACE */ -# endif -# define YYPTRDIFF_T ptrdiff_t -# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -# else -# define YYPTRDIFF_T long -# define YYPTRDIFF_MAXIMUM LONG_MAX -# endif -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM \ - YY_CAST (YYPTRDIFF_T, \ - (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ - ? YYPTRDIFF_MAXIMUM \ - : YY_CAST (YYSIZE_T, -1))) - -#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - - -/* Stored state numbers (used for stacks). */ -typedef yytype_uint8 yy_state_t; - -/* State numbers in computations. */ -typedef int yy_state_fast_t; - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - - -#ifndef YY_ATTRIBUTE_PURE -# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define YY_ATTRIBUTE_PURE -# endif -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# else -# define YY_ATTRIBUTE_UNUSED -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YY_USE(E) ((void) (E)) -#else -# define YY_USE(E) /* empty */ -#endif - -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ -# define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") -# define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") -#endif -#ifndef YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_END -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if 1 - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* 1 */ - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yy_state_t yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 9 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 369 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 36 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 34 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 106 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 201 - -/* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 282 - - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_int8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 35, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 31, 30, - 2, 34, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 32, 2, 33, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 28, 2, 29, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27 -}; - -#if YYDEBUG -/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = -{ - 0, 54, 54, 55, 56, 57, 58, 62, 66, 70, - 75, 81, 82, 88, 90, 92, 94, 97, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 115, 116, 120, - 121, 122, 123, 128, 129, 133, 136, 137, 142, 143, - 147, 148, 150, 152, 154, 156, 158, 160, 162, 164, - 166, 167, 172, 173, 177, 178, 182, 183, 187, 188, - 192, 193, 196, 197, 200, 201, 204, 205, 209, 210, - 214, 218, 219, 230, 234, 238, 238, 239, 239, 240, - 240, 241, 241, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270 -}; -#endif - -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) - -#if 1 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; - -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "\"end of file\"", "error", "\"invalid token\"", "SCAN_ALIAS", - "SCAN_ARRAY", "SCAN_ATTR", "SCAN_BYTE", "SCAN_CODE", "SCAN_DATASET", - "SCAN_DATA", "SCAN_ERROR", "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_GRID", - "SCAN_INT16", "SCAN_INT32", "SCAN_MAPS", "SCAN_MESSAGE", "SCAN_SEQUENCE", - "SCAN_STRING", "SCAN_STRUCTURE", "SCAN_UINT16", "SCAN_UINT32", - "SCAN_URL", "SCAN_PTYPE", "SCAN_PROG", "WORD_WORD", "WORD_STRING", "'{'", - "'}'", "';'", "':'", "'['", "']'", "'='", "','", "$accept", "start", - "dataset", "attr", "err", "datasetbody", "declarations", "declaration", - "base_type", "array_decls", "array_decl", "datasetname", "var_name", - "attributebody", "attr_list", "attribute", "bytes", "int16", "uint16", - "int32", "uint32", "float32", "float64", "strs", "urls", "url", - "str_or_id", "alias", "errorbody", "errorcode", "errormsg", "errorptype", - "errorprog", "name", YY_NULLPTR -}; - -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) -{ - return yytname[yysymbol]; -} -#endif - -#define YYPACT_NINF (-91) - -#define yypact_value_is_default(Yyn) \ - ((Yyn) == YYPACT_NINF) - -#define YYTABLE_NINF (-1) - -#define yytable_value_is_error(Yyn) \ - 0 - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 6, -91, -91, -91, -91, 9, -22, 7, -16, -91, - -91, 10, -91, -91, -91, 20, -91, 37, -91, 191, - -6, 14, -91, -91, -91, -91, 17, -91, -91, 18, - -91, 19, -91, -91, -91, 271, -91, 320, -91, 27, - -91, -91, 320, -91, -91, -91, -91, 320, 320, -91, - 320, 320, -91, -91, -91, 320, -91, 320, 320, 320, - -91, -91, -91, -91, -91, 24, 43, 35, 39, 50, - 74, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, 55, -91, -91, -91, 60, 67, - 68, 70, 71, 73, 295, 77, 78, 295, -91, -91, - 65, 79, 66, 80, 76, 69, 127, -91, 4, -91, - -91, -20, -91, -13, -91, -12, -91, -10, -91, -9, - -91, 32, -91, -91, -91, 33, -91, 34, 42, -91, - -91, 218, -91, 81, 82, 75, 83, 346, 320, 320, - -91, -91, 159, -91, -91, 84, -91, 88, -91, 89, - -91, 90, -91, 91, -91, 295, -91, 92, -91, 93, - -91, 295, -91, -91, 95, 94, 96, 105, 97, -91, - 98, 103, 100, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, 102, -91, 99, -91, 12, -91, 111, - 109, -91, -91, -91, -91, 118, 244, -91, 320, 106, - -91 -}; - -/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_int8 yydefact[] = -{ - 0, 6, 8, 7, 9, 0, 0, 0, 0, 1, - 11, 2, 37, 38, 4, 75, 5, 0, 3, 0, - 0, 77, 17, 18, 23, 24, 0, 19, 21, 0, - 26, 0, 20, 22, 25, 0, 12, 0, 51, 84, - 85, 86, 87, 103, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 104, 97, 98, 99, 100, 101, 102, - 106, 105, 83, 36, 39, 0, 0, 0, 0, 79, - 0, 11, 11, 34, 84, 87, 91, 92, 94, 95, - 98, 100, 101, 102, 0, 33, 35, 27, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 40, 38, - 0, 0, 0, 81, 0, 0, 0, 10, 0, 73, - 52, 0, 62, 0, 64, 0, 54, 0, 58, 0, - 72, 0, 66, 71, 56, 0, 60, 0, 0, 68, - 70, 0, 76, 0, 0, 0, 0, 0, 0, 0, - 32, 13, 0, 28, 41, 0, 46, 0, 47, 0, - 42, 0, 44, 0, 48, 0, 43, 0, 45, 0, - 49, 0, 50, 78, 0, 0, 0, 0, 0, 27, - 83, 0, 0, 53, 63, 65, 55, 59, 67, 57, - 61, 69, 80, 0, 74, 0, 15, 0, 29, 0, - 0, 82, 11, 14, 30, 0, 0, 31, 0, 0, - 16 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -91, -91, -91, -91, -91, -91, -69, -15, -91, -17, - -91, -91, -37, -91, 54, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -7, -90, -91, -91, -91, - -91, -91, -91, -18 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_uint8 yydefgoto[] = -{ - 0, 5, 6, 7, 8, 11, 17, 36, 37, 108, - 143, 84, 85, 14, 19, 64, 111, 117, 125, 119, - 127, 113, 115, 121, 128, 129, 130, 65, 16, 21, - 69, 103, 136, 86 -}; - -/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 87, 66, 105, 106, 122, 140, 10, 1, 12, 9, - 144, 2, 15, 140, 3, 145, 4, 146, 148, 18, - 150, 152, 147, 149, 89, 151, 153, 20, 67, 90, - 91, 68, 92, 93, 141, 13, 142, 94, 22, 95, - 96, 97, 193, 23, 142, 70, 71, 72, 24, 25, - 26, 27, 28, 88, 98, 29, 30, 31, 32, 33, - 34, 100, 154, 156, 158, 178, 35, 155, 157, 159, - 22, 99, 160, 101, 102, 23, 123, 161, 104, 123, - 24, 25, 26, 27, 28, 107, 109, 29, 30, 31, - 32, 33, 34, 110, 112, 132, 114, 116, 138, 118, - 134, 168, 169, 124, 126, 135, 133, 137, 164, 165, - 173, 163, 166, 66, 174, 175, 176, 177, 179, 180, - 183, 185, 167, 196, 172, 182, 184, 186, 22, 189, - 192, 188, 191, 23, 190, 195, 200, 123, 24, 25, - 26, 27, 28, 123, 194, 29, 30, 31, 32, 33, - 34, 197, 187, 131, 181, 0, 139, 0, 0, 0, - 0, 199, 74, 40, 41, 75, 43, 44, 45, 46, - 76, 77, 49, 78, 79, 52, 53, 54, 80, 56, - 81, 82, 83, 60, 61, 170, 0, 0, 0, 0, - 0, 0, 38, 171, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 0, 38, - 63, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 22, 0, 162, 0, 0, - 23, 0, 0, 0, 0, 24, 25, 26, 27, 28, - 0, 0, 29, 30, 31, 32, 33, 34, 0, 0, - 0, 0, 73, 198, 74, 40, 41, 75, 43, 44, - 45, 46, 76, 77, 49, 78, 79, 52, 53, 54, - 80, 56, 81, 82, 83, 60, 61, 62, 74, 40, - 41, 75, 43, 44, 45, 46, 76, 77, 49, 78, - 79, 52, 53, 54, 80, 56, 81, 82, 83, 60, - 61, 62, 120, 74, 40, 41, 75, 43, 44, 45, - 46, 76, 77, 49, 78, 79, 52, 53, 54, 80, - 56, 81, 82, 83, 60, 61, 62, 22, 0, 0, - 0, 0, 23, 0, 0, 0, 0, 24, 25, 26, - 27, 28, 0, 0, 29, 30, 31, 32, 33, 34 -}; - -static const yytype_int16 yycheck[] = -{ - 37, 19, 71, 72, 94, 1, 28, 1, 1, 0, - 30, 5, 28, 1, 8, 35, 10, 30, 30, 9, - 30, 30, 35, 35, 42, 35, 35, 7, 34, 47, - 48, 17, 50, 51, 30, 28, 32, 55, 1, 57, - 58, 59, 30, 6, 32, 28, 28, 28, 11, 12, - 13, 14, 15, 26, 30, 18, 19, 20, 21, 22, - 23, 26, 30, 30, 30, 155, 29, 35, 35, 35, - 1, 28, 30, 34, 24, 6, 94, 35, 4, 97, - 11, 12, 13, 14, 15, 30, 26, 18, 19, 20, - 21, 22, 23, 26, 26, 30, 26, 26, 29, 26, - 34, 138, 139, 26, 26, 25, 27, 31, 26, 34, - 26, 30, 29, 131, 26, 26, 26, 26, 26, 26, - 26, 16, 137, 192, 142, 30, 30, 30, 1, 26, - 31, 33, 30, 6, 34, 26, 30, 155, 11, 12, - 13, 14, 15, 161, 33, 18, 19, 20, 21, 22, - 23, 33, 169, 99, 161, -1, 29, -1, -1, -1, - -1, 198, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, - -1, -1, 1, 34, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, -1, 1, - 29, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 1, -1, 29, -1, -1, - 6, -1, -1, -1, -1, 11, 12, 13, 14, 15, - -1, -1, 18, 19, 20, 21, 22, 23, -1, -1, - -1, -1, 1, 29, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 1, -1, -1, - -1, -1, 6, -1, -1, -1, -1, 11, 12, 13, - 14, 15, -1, -1, 18, 19, 20, 21, 22, 23 -}; - -/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of - state STATE-NUM. */ -static const yytype_int8 yystos[] = -{ - 0, 1, 5, 8, 10, 37, 38, 39, 40, 0, - 28, 41, 1, 28, 49, 28, 64, 42, 9, 50, - 7, 65, 1, 6, 11, 12, 13, 14, 15, 18, - 19, 20, 21, 22, 23, 29, 43, 44, 1, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 29, 51, 63, 69, 34, 17, 66, - 28, 28, 28, 1, 3, 6, 11, 12, 14, 15, - 19, 21, 22, 23, 47, 48, 69, 48, 26, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 30, 28, - 26, 34, 24, 67, 4, 42, 42, 30, 45, 26, - 26, 52, 26, 57, 26, 58, 26, 53, 26, 55, - 27, 59, 62, 69, 26, 54, 26, 56, 60, 61, - 62, 50, 30, 27, 34, 25, 68, 31, 29, 29, - 1, 30, 32, 46, 30, 35, 30, 35, 30, 35, - 30, 35, 30, 35, 30, 35, 30, 35, 30, 35, - 30, 35, 29, 30, 26, 34, 29, 43, 48, 48, - 26, 34, 69, 26, 26, 26, 26, 26, 62, 26, - 26, 61, 30, 26, 30, 16, 30, 45, 33, 26, - 34, 30, 31, 30, 33, 26, 42, 33, 29, 48, - 30 -}; - -/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr1[] = -{ - 0, 36, 37, 37, 37, 37, 37, 38, 39, 40, - 41, 42, 42, 43, 43, 43, 43, 43, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 45, 45, 46, - 46, 46, 46, 47, 47, 48, 49, 49, 50, 50, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, - 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, - 61, 62, 62, 63, 64, 65, 65, 66, 66, 67, - 67, 68, 68, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69 -}; - -/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr2[] = -{ - 0, 2, 2, 3, 2, 2, 1, 1, 1, 1, - 5, 0, 2, 4, 7, 6, 11, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 2, 3, - 4, 5, 1, 1, 1, 1, 3, 1, 0, 2, - 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 1, 1, 3, 7, 0, 4, 0, 4, 0, - 4, 0, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 -}; - - -enum { YYENOMEM = -2 }; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (parsestate, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - - - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Kind, Value, parsestate); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) -{ - FILE *yyoutput = yyo; - YY_USE (yyoutput); - YY_USE (parsestate); - if (!yyvaluep) - return; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) -{ - YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - - yy_symbol_value_print (yyo, yykind, yyvaluep, parsestate); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule, DAPparsestate* parsestate) -{ - int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)], parsestate); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, parsestate); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -/* Context of a parse error. */ -typedef struct -{ - yy_state_t *yyssp; - yysymbol_kind_t yytoken; -} yypcontext_t; - -/* Put in YYARG at most YYARGN of the expected tokens given the - current YYCTX, and return the number of tokens stored in YYARG. If - YYARG is null, return the number of expected tokens (guaranteed to - be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. - Return 0 if there are more than YYARGN expected tokens, yet fill - YYARG up to YYARGN. */ -static int -yypcontext_expected_tokens (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - 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; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); - } - } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; -} - - - - -#ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -yystrlen (const char *yystr) -{ - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -#endif - -#ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (yyres) - return yystpcpy (yyres, yystr) - yyres; - else - return yystrlen (yystr); -} -#endif - - -static int -yy_syntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - /* There are many possibilities here to consider: - - 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 (yyctx->yytoken != YYSYMBOL_YYEMPTY) - { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens (yyctx, - yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; - } - return yycount; -} - -/* 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 YYENOMEM if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - const yypcontext_t *yyctx) -{ - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; - - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - 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_ - } - - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen (yyformat) - 2 * yycount + 1; - { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } - } - - 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, yytname[yyarg[yyi++]]); - yyformat += 2; - } - else - { - ++yyp; - ++yyformat; - } - } - return 0; -} - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep, DAPparsestate* parsestate) -{ - YY_USE (yyvaluep); - YY_USE (parsestate); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (DAPparsestate* parsestate) -{ -/* Lookahead token kind. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs = 0; - - yy_state_fast_t yystate = 0; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; - - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; - - /* The state stack: array, bottom, top. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; - - /* The semantic value stack: array, bottom, top. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; - - int yyn; - /* The return value of yyparse. */ - int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yychar = YYEMPTY; /* Cause a token to be read. */ - - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yysetstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST (yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - YYNOMEM; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); - if (! yyptr) - YYNOMEM; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (&yylval, parsestate); - } - - if (yychar <= YYEOF) - { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - /* Discard the shifted token. */ - yychar = YYEMPTY; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 6: /* start: error */ -#line 58 "dap.y" - {dap_unrecognizedresponse(parsestate); YYABORT;} -#line 1585 "dapy.c" - break; - - case 7: /* dataset: SCAN_DATASET */ -#line 63 "dap.y" - {dap_tagparse(parsestate,SCAN_DATASET);} -#line 1591 "dapy.c" - break; - - case 8: /* attr: SCAN_ATTR */ -#line 67 "dap.y" - {dap_tagparse(parsestate,SCAN_ATTR);} -#line 1597 "dapy.c" - break; - - case 9: /* err: SCAN_ERROR */ -#line 71 "dap.y" - {dap_tagparse(parsestate,SCAN_ERROR);} -#line 1603 "dapy.c" - break; - - case 10: /* datasetbody: '{' declarations '}' datasetname ';' */ -#line 76 "dap.y" - {dap_datasetbody(parsestate,yyvsp[-1],yyvsp[-3]);} -#line 1609 "dapy.c" - break; - - case 11: /* declarations: %empty */ -#line 81 "dap.y" - {yyval=dap_declarations(parsestate,null,null);} -#line 1615 "dapy.c" - break; - - case 12: /* declarations: declarations declaration */ -#line 82 "dap.y" - {yyval=dap_declarations(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1621 "dapy.c" - break; - - case 13: /* declaration: base_type var_name array_decls ';' */ -#line 89 "dap.y" - {yyval=dap_makebase(parsestate,yyvsp[-2],yyvsp[-3],yyvsp[-1]);} -#line 1627 "dapy.c" - break; - - case 14: /* declaration: SCAN_STRUCTURE '{' declarations '}' var_name array_decls ';' */ -#line 91 "dap.y" - {if((yyval=dap_makestructure(parsestate,yyvsp[-2],yyvsp[-1],yyvsp[-4]))==null) {YYABORT;}} -#line 1633 "dapy.c" - break; - - case 15: /* declaration: SCAN_SEQUENCE '{' declarations '}' var_name ';' */ -#line 93 "dap.y" - {if((yyval=dap_makesequence(parsestate,yyvsp[-1],yyvsp[-3]))==null) {YYABORT;}} -#line 1639 "dapy.c" - break; - - case 16: /* declaration: SCAN_GRID '{' SCAN_ARRAY ':' declaration SCAN_MAPS ':' declarations '}' var_name ';' */ -#line 96 "dap.y" - {if((yyval=dap_makegrid(parsestate,yyvsp[-1],yyvsp[-6],yyvsp[-3]))==null) {YYABORT;}} -#line 1645 "dapy.c" - break; - - case 17: /* declaration: error */ -#line 98 "dap.y" - {dapsemanticerror(parsestate,OC_EBADTYPE,"Unrecognized type"); YYABORT;} -#line 1651 "dapy.c" - break; - - case 18: /* base_type: SCAN_BYTE */ -#line 103 "dap.y" - {yyval=(Object)SCAN_BYTE;} -#line 1657 "dapy.c" - break; - - case 19: /* base_type: SCAN_INT16 */ -#line 104 "dap.y" - {yyval=(Object)SCAN_INT16;} -#line 1663 "dapy.c" - break; - - case 20: /* base_type: SCAN_UINT16 */ -#line 105 "dap.y" - {yyval=(Object)SCAN_UINT16;} -#line 1669 "dapy.c" - break; - - case 21: /* base_type: SCAN_INT32 */ -#line 106 "dap.y" - {yyval=(Object)SCAN_INT32;} -#line 1675 "dapy.c" - break; - - case 22: /* base_type: SCAN_UINT32 */ -#line 107 "dap.y" - {yyval=(Object)SCAN_UINT32;} -#line 1681 "dapy.c" - break; - - case 23: /* base_type: SCAN_FLOAT32 */ -#line 108 "dap.y" - {yyval=(Object)SCAN_FLOAT32;} -#line 1687 "dapy.c" - break; - - case 24: /* base_type: SCAN_FLOAT64 */ -#line 109 "dap.y" - {yyval=(Object)SCAN_FLOAT64;} -#line 1693 "dapy.c" - break; - - case 25: /* base_type: SCAN_URL */ -#line 110 "dap.y" - {yyval=(Object)SCAN_URL;} -#line 1699 "dapy.c" - break; - - case 26: /* base_type: SCAN_STRING */ -#line 111 "dap.y" - {yyval=(Object)SCAN_STRING;} -#line 1705 "dapy.c" - break; - - case 27: /* array_decls: %empty */ -#line 115 "dap.y" - {yyval=dap_arraydecls(parsestate,null,null);} -#line 1711 "dapy.c" - break; - - case 28: /* array_decls: array_decls array_decl */ -#line 116 "dap.y" - {yyval=dap_arraydecls(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1717 "dapy.c" - break; - - case 29: /* array_decl: '[' WORD_WORD ']' */ -#line 120 "dap.y" - {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} -#line 1723 "dapy.c" - break; - - case 30: /* array_decl: '[' '=' WORD_WORD ']' */ -#line 121 "dap.y" - {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} -#line 1729 "dapy.c" - break; - - case 31: /* array_decl: '[' name '=' WORD_WORD ']' */ -#line 122 "dap.y" - {yyval=dap_arraydecl(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1735 "dapy.c" - break; - - case 32: /* array_decl: error */ -#line 124 "dap.y" - {dapsemanticerror(parsestate,OC_EDIMSIZE,"Illegal dimension declaration"); YYABORT;} -#line 1741 "dapy.c" - break; - - case 33: /* datasetname: var_name */ -#line 128 "dap.y" - {yyval=yyvsp[0];} -#line 1747 "dapy.c" - break; - - case 34: /* datasetname: error */ -#line 130 "dap.y" - {dapsemanticerror(parsestate,OC_EDDS,"Illegal dataset declaration"); YYABORT;} -#line 1753 "dapy.c" - break; - - case 35: /* var_name: name */ -#line 133 "dap.y" - {yyval=yyvsp[0];} -#line 1759 "dapy.c" - break; - - case 36: /* attributebody: '{' attr_list '}' */ -#line 136 "dap.y" - {dap_attributebody(parsestate,yyvsp[-1]);} -#line 1765 "dapy.c" - break; - - case 37: /* attributebody: error */ -#line 138 "dap.y" - {dapsemanticerror(parsestate,OC_EDAS,"Illegal DAS body"); YYABORT;} -#line 1771 "dapy.c" - break; - - case 38: /* attr_list: %empty */ -#line 142 "dap.y" - {yyval=dap_attrlist(parsestate,null,null);} -#line 1777 "dapy.c" - break; - - case 39: /* attr_list: attr_list attribute */ -#line 143 "dap.y" - {yyval=dap_attrlist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1783 "dapy.c" - break; - - case 40: /* attribute: alias ';' */ -#line 147 "dap.y" - {yyval=null;} -#line 1789 "dapy.c" - break; - - case 41: /* attribute: SCAN_BYTE name bytes ';' */ -#line 149 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_BYTE);} -#line 1795 "dapy.c" - break; - - case 42: /* attribute: SCAN_INT16 name int16 ';' */ -#line 151 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT16);} -#line 1801 "dapy.c" - break; - - case 43: /* attribute: SCAN_UINT16 name uint16 ';' */ -#line 153 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT16);} -#line 1807 "dapy.c" - break; - - case 44: /* attribute: SCAN_INT32 name int32 ';' */ -#line 155 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT32);} -#line 1813 "dapy.c" - break; - - case 45: /* attribute: SCAN_UINT32 name uint32 ';' */ -#line 157 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT32);} -#line 1819 "dapy.c" - break; - - case 46: /* attribute: SCAN_FLOAT32 name float32 ';' */ -#line 159 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT32);} -#line 1825 "dapy.c" - break; - - case 47: /* attribute: SCAN_FLOAT64 name float64 ';' */ -#line 161 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT64);} -#line 1831 "dapy.c" - break; - - case 48: /* attribute: SCAN_STRING name strs ';' */ -#line 163 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_STRING);} -#line 1837 "dapy.c" - break; - - case 49: /* attribute: SCAN_URL name urls ';' */ -#line 165 "dap.y" - {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_URL);} -#line 1843 "dapy.c" - break; - - case 50: /* attribute: name '{' attr_list '}' */ -#line 166 "dap.y" - {yyval=dap_attrset(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1849 "dapy.c" - break; - - case 51: /* attribute: error */ -#line 168 "dap.y" - {dapsemanticerror(parsestate,OC_EDAS,"Illegal attribute"); YYABORT;} -#line 1855 "dapy.c" - break; - - case 52: /* bytes: WORD_WORD */ -#line 172 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_BYTE);} -#line 1861 "dapy.c" - break; - - case 53: /* bytes: bytes ',' WORD_WORD */ -#line 174 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_BYTE);} -#line 1867 "dapy.c" - break; - - case 54: /* int16: WORD_WORD */ -#line 177 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT16);} -#line 1873 "dapy.c" - break; - - case 55: /* int16: int16 ',' WORD_WORD */ -#line 179 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT16);} -#line 1879 "dapy.c" - break; - - case 56: /* uint16: WORD_WORD */ -#line 182 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT16);} -#line 1885 "dapy.c" - break; - - case 57: /* uint16: uint16 ',' WORD_WORD */ -#line 184 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT16);} -#line 1891 "dapy.c" - break; - - case 58: /* int32: WORD_WORD */ -#line 187 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT32);} -#line 1897 "dapy.c" - break; - - case 59: /* int32: int32 ',' WORD_WORD */ -#line 189 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT32);} -#line 1903 "dapy.c" - break; - - case 60: /* uint32: WORD_WORD */ -#line 192 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT32);} -#line 1909 "dapy.c" - break; - - case 61: /* uint32: uint32 ',' WORD_WORD */ -#line 193 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT32);} -#line 1915 "dapy.c" - break; - - case 62: /* float32: WORD_WORD */ -#line 196 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT32);} -#line 1921 "dapy.c" - break; - - case 63: /* float32: float32 ',' WORD_WORD */ -#line 197 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT32);} -#line 1927 "dapy.c" - break; - - case 64: /* float64: WORD_WORD */ -#line 200 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT64);} -#line 1933 "dapy.c" - break; - - case 65: /* float64: float64 ',' WORD_WORD */ -#line 201 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT64);} -#line 1939 "dapy.c" - break; - - case 66: /* strs: str_or_id */ -#line 204 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_STRING);} -#line 1945 "dapy.c" - break; - - case 67: /* strs: strs ',' str_or_id */ -#line 205 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_STRING);} -#line 1951 "dapy.c" - break; - - case 68: /* urls: url */ -#line 209 "dap.y" - {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_URL);} -#line 1957 "dapy.c" - break; - - case 69: /* urls: urls ',' url */ -#line 210 "dap.y" - {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_URL);} -#line 1963 "dapy.c" - break; - - case 70: /* url: str_or_id */ -#line 214 "dap.y" - {yyval=yyvsp[0];} -#line 1969 "dapy.c" - break; - - case 71: /* str_or_id: name */ -#line 218 "dap.y" - {yyval=yyvsp[0];} -#line 1975 "dapy.c" - break; - - case 72: /* str_or_id: WORD_STRING */ -#line 219 "dap.y" - {yyval=yyvsp[0];} -#line 1981 "dapy.c" - break; - - case 73: /* alias: SCAN_ALIAS WORD_WORD WORD_WORD */ -#line 230 "dap.y" - {yyval=yyvsp[-1]; yyval=yyvsp[0]; yyval=null;} -#line 1987 "dapy.c" - break; - - case 74: /* errorbody: '{' errorcode errormsg errorptype errorprog '}' ';' */ -#line 235 "dap.y" - {dap_errorbody(parsestate,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2]);} -#line 1993 "dapy.c" - break; - - case 75: /* errorcode: %empty */ -#line 238 "dap.y" - {yyval=null;} -#line 1999 "dapy.c" - break; - - case 76: /* errorcode: SCAN_CODE '=' WORD_WORD ';' */ -#line 238 "dap.y" - {yyval=yyvsp[-1];} -#line 2005 "dapy.c" - break; - - case 77: /* errormsg: %empty */ -#line 239 "dap.y" - {yyval=null;} -#line 2011 "dapy.c" - break; - - case 78: /* errormsg: SCAN_MESSAGE '=' WORD_STRING ';' */ -#line 239 "dap.y" - {yyval=yyvsp[-1];} -#line 2017 "dapy.c" - break; - - case 79: /* errorptype: %empty */ -#line 240 "dap.y" - {yyval=null;} -#line 2023 "dapy.c" - break; - - case 80: /* errorptype: SCAN_PTYPE '=' WORD_WORD ';' */ -#line 240 "dap.y" - {yyval=yyvsp[-1];} -#line 2029 "dapy.c" - break; - - case 81: /* errorprog: %empty */ -#line 241 "dap.y" - {yyval=null;} -#line 2035 "dapy.c" - break; - - case 82: /* errorprog: SCAN_PROG '=' WORD_WORD ';' */ -#line 241 "dap.y" - {yyval=yyvsp[-1];} -#line 2041 "dapy.c" - break; - - case 83: /* name: WORD_WORD */ -#line 247 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2047 "dapy.c" - break; - - case 84: /* name: SCAN_ALIAS */ -#line 248 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2053 "dapy.c" - break; - - case 85: /* name: SCAN_ARRAY */ -#line 249 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2059 "dapy.c" - break; - - case 86: /* name: SCAN_ATTR */ -#line 250 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2065 "dapy.c" - break; - - case 87: /* name: SCAN_BYTE */ -#line 251 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2071 "dapy.c" - break; - - case 88: /* name: SCAN_DATASET */ -#line 252 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2077 "dapy.c" - break; - - case 89: /* name: SCAN_DATA */ -#line 253 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2083 "dapy.c" - break; - - case 90: /* name: SCAN_ERROR */ -#line 254 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2089 "dapy.c" - break; - - case 91: /* name: SCAN_FLOAT32 */ -#line 255 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2095 "dapy.c" - break; - - case 92: /* name: SCAN_FLOAT64 */ -#line 256 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2101 "dapy.c" - break; - - case 93: /* name: SCAN_GRID */ -#line 257 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2107 "dapy.c" - break; - - case 94: /* name: SCAN_INT16 */ -#line 258 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2113 "dapy.c" - break; - - case 95: /* name: SCAN_INT32 */ -#line 259 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2119 "dapy.c" - break; - - case 96: /* name: SCAN_MAPS */ -#line 260 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2125 "dapy.c" - break; - - case 97: /* name: SCAN_SEQUENCE */ -#line 261 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2131 "dapy.c" - break; - - case 98: /* name: SCAN_STRING */ -#line 262 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2137 "dapy.c" - break; - - case 99: /* name: SCAN_STRUCTURE */ -#line 263 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2143 "dapy.c" - break; - - case 100: /* name: SCAN_UINT16 */ -#line 264 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2149 "dapy.c" - break; - - case 101: /* name: SCAN_UINT32 */ -#line 265 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2155 "dapy.c" - break; - - case 102: /* name: SCAN_URL */ -#line 266 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2161 "dapy.c" - break; - - case 103: /* name: SCAN_CODE */ -#line 267 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2167 "dapy.c" - break; - - case 104: /* name: SCAN_MESSAGE */ -#line 268 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2173 "dapy.c" - break; - - case 105: /* name: SCAN_PROG */ -#line 269 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2179 "dapy.c" - break; - - case 106: /* name: SCAN_PTYPE */ -#line 270 "dap.y" - {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2185 "dapy.c" - break; - - -#line 2189 "dapy.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; - { - yypcontext_t yyctx - = {yyssp, yytoken}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == -1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (yymsg) - { - yysyntax_error_status - = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror (parsestate, yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } - } - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, parsestate); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - ++yynerrs; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - /* Pop stack until we find a state that shifts the error token. */ - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp, parsestate); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturnlab; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturnlab; - - -/*-----------------------------------------------------------. -| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | -`-----------------------------------------------------------*/ -yyexhaustedlab: - yyerror (parsestate, YY_("memory exhausted")); - yyresult = 2; - goto yyreturnlab; - - -/*----------------------------------------------------------. -| yyreturnlab -- parsing is finished, clean up and return. | -`----------------------------------------------------------*/ -yyreturnlab: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, parsestate); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parsestate); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - return yyresult; -} - -#line 273 "dap.y" - diff --git a/oc2/dapy.h b/oc2/dapy.h deleted file mode 100644 index 00f7aa1c47..0000000000 --- a/oc2/dapy.h +++ /dev/null @@ -1,99 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - -#ifndef YY_DAP_DAP_TAB_H_INCLUDED -# define YY_DAP_DAP_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int dapdebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - SCAN_ALIAS = 258, /* SCAN_ALIAS */ - SCAN_ARRAY = 259, /* SCAN_ARRAY */ - SCAN_ATTR = 260, /* SCAN_ATTR */ - SCAN_BYTE = 261, /* SCAN_BYTE */ - SCAN_CODE = 262, /* SCAN_CODE */ - SCAN_DATASET = 263, /* SCAN_DATASET */ - SCAN_DATA = 264, /* SCAN_DATA */ - SCAN_ERROR = 265, /* SCAN_ERROR */ - SCAN_FLOAT32 = 266, /* SCAN_FLOAT32 */ - SCAN_FLOAT64 = 267, /* SCAN_FLOAT64 */ - SCAN_GRID = 268, /* SCAN_GRID */ - SCAN_INT16 = 269, /* SCAN_INT16 */ - SCAN_INT32 = 270, /* SCAN_INT32 */ - SCAN_MAPS = 271, /* SCAN_MAPS */ - SCAN_MESSAGE = 272, /* SCAN_MESSAGE */ - SCAN_SEQUENCE = 273, /* SCAN_SEQUENCE */ - SCAN_STRING = 274, /* SCAN_STRING */ - SCAN_STRUCTURE = 275, /* SCAN_STRUCTURE */ - SCAN_UINT16 = 276, /* SCAN_UINT16 */ - SCAN_UINT32 = 277, /* SCAN_UINT32 */ - SCAN_URL = 278, /* SCAN_URL */ - SCAN_PTYPE = 279, /* SCAN_PTYPE */ - SCAN_PROG = 280, /* SCAN_PROG */ - WORD_WORD = 281, /* WORD_WORD */ - WORD_STRING = 282 /* WORD_STRING */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - - -int dapparse (DAPparsestate* parsestate); - - -#endif /* !YY_DAP_DAP_TAB_H_INCLUDED */ From 20999d2f6a4b2aefd85f5305268d7e790a6dfa27 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 17 Nov 2024 19:55:06 +0300 Subject: [PATCH 2/5] Use classic names in oc2 --- oc2/Makefile.am | 2 +- oc2/dap.tab.c | 2344 +++++++++++++++++++++++++++++++++++++++++++++++ oc2/dap.tab.h | 91 ++ 3 files changed, 2436 insertions(+), 1 deletion(-) create mode 100644 oc2/dap.tab.c create mode 100644 oc2/dap.tab.h diff --git a/oc2/Makefile.am b/oc2/Makefile.am index 703c6f136a..28f9241d1a 100644 --- a/oc2/Makefile.am +++ b/oc2/Makefile.am @@ -12,7 +12,7 @@ AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/include # OC Sources; include the dapy.[ch] to avoid the need for bison by user SRC=oc.c \ -daplex.c dapparse.c dapy.c \ +daplex.c dapparse.c dap.tab.c \ occompile.c occurlfunctions.c \ ocdata.c ocdebug.c ocdump.c \ ocinternal.c ocnode.c \ diff --git a/oc2/dap.tab.c b/oc2/dap.tab.c new file mode 100644 index 0000000000..6563e95cd2 --- /dev/null +++ b/oc2/dap.tab.c @@ -0,0 +1,2344 @@ +/* A Bison parser, made by GNU Bison 3.5.1. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.5.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + +/* Substitute the variable and function names. */ +#define yyparse dapparse +#define yylex daplex +#define yyerror daperror +#define yydebug dapdebug +#define yynerrs dapnerrs + +/* First part of user prologue. */ +#line 11 "dap.y" + +#include "config.h" +#include "dapparselex.h" +#include "dap.tab.h" +int dapdebug = 0; + +#line 82 "dap.tab.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_DAP_DAP_TAB_H_INCLUDED +# define YY_DAP_DAP_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int dapdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + SCAN_ALIAS = 258, + SCAN_ARRAY = 259, + SCAN_ATTR = 260, + SCAN_BYTE = 261, + SCAN_CODE = 262, + SCAN_DATASET = 263, + SCAN_DATA = 264, + SCAN_ERROR = 265, + SCAN_FLOAT32 = 266, + SCAN_FLOAT64 = 267, + SCAN_GRID = 268, + SCAN_INT16 = 269, + SCAN_INT32 = 270, + SCAN_MAPS = 271, + SCAN_MESSAGE = 272, + SCAN_SEQUENCE = 273, + SCAN_STRING = 274, + SCAN_STRUCTURE = 275, + SCAN_UINT16 = 276, + SCAN_UINT32 = 277, + SCAN_URL = 278, + SCAN_PTYPE = 279, + SCAN_PROG = 280, + WORD_WORD = 281, + WORD_STRING = 282 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +int dapparse (DAPparsestate* parsestate); + +#endif /* !YY_DAP_DAP_TAB_H_INCLUDED */ + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + +/* Stored state numbers (used for stacks). */ +typedef yytype_uint8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 9 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 369 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 36 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 34 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 106 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 201 + +#define YYUNDEFTOK 2 +#define YYMAXUTOK 282 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 35, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 31, 30, + 2, 34, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 32, 2, 33, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 28, 2, 29, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27 +}; + +#if YYDEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 54, 54, 55, 56, 57, 58, 62, 66, 70, + 75, 81, 82, 88, 90, 92, 94, 97, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 115, 116, 120, + 121, 122, 123, 128, 129, 133, 136, 137, 142, 143, + 147, 148, 150, 152, 154, 156, 158, 160, 162, 164, + 166, 167, 172, 173, 177, 178, 182, 183, 187, 188, + 192, 193, 196, 197, 200, 201, 204, 205, 209, 210, + 214, 218, 219, 230, 234, 238, 238, 239, 239, 240, + 240, 241, 241, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || 1 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "SCAN_ALIAS", "SCAN_ARRAY", "SCAN_ATTR", + "SCAN_BYTE", "SCAN_CODE", "SCAN_DATASET", "SCAN_DATA", "SCAN_ERROR", + "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_GRID", "SCAN_INT16", "SCAN_INT32", + "SCAN_MAPS", "SCAN_MESSAGE", "SCAN_SEQUENCE", "SCAN_STRING", + "SCAN_STRUCTURE", "SCAN_UINT16", "SCAN_UINT32", "SCAN_URL", "SCAN_PTYPE", + "SCAN_PROG", "WORD_WORD", "WORD_STRING", "'{'", "'}'", "';'", "':'", + "'['", "']'", "'='", "','", "$accept", "start", "dataset", "attr", "err", + "datasetbody", "declarations", "declaration", "base_type", "array_decls", + "array_decl", "datasetname", "var_name", "attributebody", "attr_list", + "attribute", "bytes", "int16", "uint16", "int32", "uint32", "float32", + "float64", "strs", "urls", "url", "str_or_id", "alias", "errorbody", + "errorcode", "errormsg", "errorptype", "errorprog", "name", YY_NULLPTR +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_int16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 123, 125, + 59, 58, 91, 93, 61, 44 +}; +# endif + +#define YYPACT_NINF (-91) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 6, -91, -91, -91, -91, 9, -22, 7, -16, -91, + -91, 10, -91, -91, -91, 20, -91, 37, -91, 191, + -6, 14, -91, -91, -91, -91, 17, -91, -91, 18, + -91, 19, -91, -91, -91, 271, -91, 320, -91, 27, + -91, -91, 320, -91, -91, -91, -91, 320, 320, -91, + 320, 320, -91, -91, -91, 320, -91, 320, 320, 320, + -91, -91, -91, -91, -91, 24, 43, 35, 39, 50, + 74, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, 55, -91, -91, -91, 60, 67, + 68, 70, 71, 73, 295, 77, 78, 295, -91, -91, + 65, 79, 66, 80, 76, 69, 127, -91, 4, -91, + -91, -20, -91, -13, -91, -12, -91, -10, -91, -9, + -91, 32, -91, -91, -91, 33, -91, 34, 42, -91, + -91, 218, -91, 81, 82, 75, 83, 346, 320, 320, + -91, -91, 159, -91, -91, 84, -91, 88, -91, 89, + -91, 90, -91, 91, -91, 295, -91, 92, -91, 93, + -91, 295, -91, -91, 95, 94, 96, 105, 97, -91, + 98, 103, 100, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, 102, -91, 99, -91, 12, -91, 111, + 109, -91, -91, -91, -91, 118, 244, -91, 320, 106, + -91 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 0, 6, 8, 7, 9, 0, 0, 0, 0, 1, + 11, 2, 37, 38, 4, 75, 5, 0, 3, 0, + 0, 77, 17, 18, 23, 24, 0, 19, 21, 0, + 26, 0, 20, 22, 25, 0, 12, 0, 51, 84, + 85, 86, 87, 103, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 104, 97, 98, 99, 100, 101, 102, + 106, 105, 83, 36, 39, 0, 0, 0, 0, 79, + 0, 11, 11, 34, 84, 87, 91, 92, 94, 95, + 98, 100, 101, 102, 0, 33, 35, 27, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 40, 38, + 0, 0, 0, 81, 0, 0, 0, 10, 0, 73, + 52, 0, 62, 0, 64, 0, 54, 0, 58, 0, + 72, 0, 66, 71, 56, 0, 60, 0, 0, 68, + 70, 0, 76, 0, 0, 0, 0, 0, 0, 0, + 32, 13, 0, 28, 41, 0, 46, 0, 47, 0, + 42, 0, 44, 0, 48, 0, 43, 0, 45, 0, + 49, 0, 50, 78, 0, 0, 0, 0, 0, 27, + 83, 0, 0, 53, 63, 65, 55, 59, 67, 57, + 61, 69, 80, 0, 74, 0, 15, 0, 29, 0, + 0, 82, 11, 14, 30, 0, 0, 31, 0, 0, + 16 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -91, -91, -91, -91, -91, -91, -69, -15, -91, -17, + -91, -91, -37, -91, 54, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -7, -90, -91, -91, -91, + -91, -91, -91, -18 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 5, 6, 7, 8, 11, 17, 36, 37, 108, + 143, 84, 85, 14, 19, 64, 111, 117, 125, 119, + 127, 113, 115, 121, 128, 129, 130, 65, 16, 21, + 69, 103, 136, 86 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_uint8 yytable[] = +{ + 87, 66, 105, 106, 122, 140, 10, 1, 12, 9, + 144, 2, 15, 140, 3, 145, 4, 146, 148, 18, + 150, 152, 147, 149, 89, 151, 153, 20, 67, 90, + 91, 68, 92, 93, 141, 13, 142, 94, 22, 95, + 96, 97, 193, 23, 142, 70, 71, 72, 24, 25, + 26, 27, 28, 88, 98, 29, 30, 31, 32, 33, + 34, 100, 154, 156, 158, 178, 35, 155, 157, 159, + 22, 99, 160, 101, 102, 23, 123, 161, 104, 123, + 24, 25, 26, 27, 28, 107, 109, 29, 30, 31, + 32, 33, 34, 110, 112, 132, 114, 116, 138, 118, + 134, 168, 169, 124, 126, 135, 133, 137, 164, 165, + 173, 163, 166, 66, 174, 175, 176, 177, 179, 180, + 183, 185, 167, 196, 172, 182, 184, 186, 22, 189, + 192, 188, 191, 23, 190, 195, 200, 123, 24, 25, + 26, 27, 28, 123, 194, 29, 30, 31, 32, 33, + 34, 197, 187, 131, 181, 0, 139, 0, 0, 0, + 0, 199, 74, 40, 41, 75, 43, 44, 45, 46, + 76, 77, 49, 78, 79, 52, 53, 54, 80, 56, + 81, 82, 83, 60, 61, 170, 0, 0, 0, 0, + 0, 0, 38, 171, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 0, 38, + 63, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 22, 0, 162, 0, 0, + 23, 0, 0, 0, 0, 24, 25, 26, 27, 28, + 0, 0, 29, 30, 31, 32, 33, 34, 0, 0, + 0, 0, 73, 198, 74, 40, 41, 75, 43, 44, + 45, 46, 76, 77, 49, 78, 79, 52, 53, 54, + 80, 56, 81, 82, 83, 60, 61, 62, 74, 40, + 41, 75, 43, 44, 45, 46, 76, 77, 49, 78, + 79, 52, 53, 54, 80, 56, 81, 82, 83, 60, + 61, 62, 120, 74, 40, 41, 75, 43, 44, 45, + 46, 76, 77, 49, 78, 79, 52, 53, 54, 80, + 56, 81, 82, 83, 60, 61, 62, 22, 0, 0, + 0, 0, 23, 0, 0, 0, 0, 24, 25, 26, + 27, 28, 0, 0, 29, 30, 31, 32, 33, 34 +}; + +static const yytype_int16 yycheck[] = +{ + 37, 19, 71, 72, 94, 1, 28, 1, 1, 0, + 30, 5, 28, 1, 8, 35, 10, 30, 30, 9, + 30, 30, 35, 35, 42, 35, 35, 7, 34, 47, + 48, 17, 50, 51, 30, 28, 32, 55, 1, 57, + 58, 59, 30, 6, 32, 28, 28, 28, 11, 12, + 13, 14, 15, 26, 30, 18, 19, 20, 21, 22, + 23, 26, 30, 30, 30, 155, 29, 35, 35, 35, + 1, 28, 30, 34, 24, 6, 94, 35, 4, 97, + 11, 12, 13, 14, 15, 30, 26, 18, 19, 20, + 21, 22, 23, 26, 26, 30, 26, 26, 29, 26, + 34, 138, 139, 26, 26, 25, 27, 31, 26, 34, + 26, 30, 29, 131, 26, 26, 26, 26, 26, 26, + 26, 16, 137, 192, 142, 30, 30, 30, 1, 26, + 31, 33, 30, 6, 34, 26, 30, 155, 11, 12, + 13, 14, 15, 161, 33, 18, 19, 20, 21, 22, + 23, 33, 169, 99, 161, -1, 29, -1, -1, -1, + -1, 198, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, + -1, -1, 1, 34, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, -1, 1, + 29, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 1, -1, 29, -1, -1, + 6, -1, -1, -1, -1, 11, 12, 13, 14, 15, + -1, -1, 18, 19, 20, 21, 22, 23, -1, -1, + -1, -1, 1, 29, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 1, -1, -1, + -1, -1, 6, -1, -1, -1, -1, 11, 12, 13, + 14, 15, -1, -1, 18, 19, 20, 21, 22, 23 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 1, 5, 8, 10, 37, 38, 39, 40, 0, + 28, 41, 1, 28, 49, 28, 64, 42, 9, 50, + 7, 65, 1, 6, 11, 12, 13, 14, 15, 18, + 19, 20, 21, 22, 23, 29, 43, 44, 1, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 29, 51, 63, 69, 34, 17, 66, + 28, 28, 28, 1, 3, 6, 11, 12, 14, 15, + 19, 21, 22, 23, 47, 48, 69, 48, 26, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 30, 28, + 26, 34, 24, 67, 4, 42, 42, 30, 45, 26, + 26, 52, 26, 57, 26, 58, 26, 53, 26, 55, + 27, 59, 62, 69, 26, 54, 26, 56, 60, 61, + 62, 50, 30, 27, 34, 25, 68, 31, 29, 29, + 1, 30, 32, 46, 30, 35, 30, 35, 30, 35, + 30, 35, 30, 35, 30, 35, 30, 35, 30, 35, + 30, 35, 29, 30, 26, 34, 29, 43, 48, 48, + 26, 34, 69, 26, 26, 26, 26, 26, 62, 26, + 26, 61, 30, 26, 30, 16, 30, 45, 33, 26, + 34, 30, 31, 30, 33, 26, 42, 33, 29, 48, + 30 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_int8 yyr1[] = +{ + 0, 36, 37, 37, 37, 37, 37, 38, 39, 40, + 41, 42, 42, 43, 43, 43, 43, 43, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 45, 45, 46, + 46, 46, 46, 47, 47, 48, 49, 49, 50, 50, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, + 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, + 61, 62, 62, 63, 64, 65, 65, 66, 66, 67, + 67, 68, 68, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 2, 3, 2, 2, 1, 1, 1, 1, + 5, 0, 2, 4, 7, 6, 11, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 2, 3, + 4, 5, 1, 1, 1, 1, 3, 1, 0, 2, + 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 1, 1, 3, 7, 0, 4, 0, 4, 0, + 4, 0, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (parsestate, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, parsestate); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) +{ + FILE *yyoutput = yyo; + YYUSE (yyoutput); + YYUSE (parsestate); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); +# endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) +{ + YYFPRINTF (yyo, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyo, yytype, yyvaluep, parsestate); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DAPparsestate* parsestate) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[+yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] + , parsestate); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, parsestate); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else +/* Return the length of YYSTR. */ +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (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 (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + yy_state_t *yyssp, int yytoken) +{ + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Actual size of YYARG. */ + int yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* There are many possibilities here to consider: + - 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) + { + int yyn = yypact[+*yyssp]; + YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + yysize = yysize0; + 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; + + 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]; + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + 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_ + } + + { + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + + 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. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DAPparsestate* parsestate) +{ + YYUSE (yyvaluep); + YYUSE (parsestate); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (DAPparsestate* parsestate) +{ +/* The lookahead symbol. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs; + + yy_state_fast_t yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss; + yy_state_t *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYPTRDIFF_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (&yylval, parsestate); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 6: +#line 58 "dap.y" + {dap_unrecognizedresponse(parsestate); YYABORT;} +#line 1508 "dap.tab.c" + break; + + case 7: +#line 63 "dap.y" + {dap_tagparse(parsestate,SCAN_DATASET);} +#line 1514 "dap.tab.c" + break; + + case 8: +#line 67 "dap.y" + {dap_tagparse(parsestate,SCAN_ATTR);} +#line 1520 "dap.tab.c" + break; + + case 9: +#line 71 "dap.y" + {dap_tagparse(parsestate,SCAN_ERROR);} +#line 1526 "dap.tab.c" + break; + + case 10: +#line 76 "dap.y" + {dap_datasetbody(parsestate,yyvsp[-1],yyvsp[-3]);} +#line 1532 "dap.tab.c" + break; + + case 11: +#line 81 "dap.y" + {yyval=dap_declarations(parsestate,null,null);} +#line 1538 "dap.tab.c" + break; + + case 12: +#line 82 "dap.y" + {yyval=dap_declarations(parsestate,yyvsp[-1],yyvsp[0]);} +#line 1544 "dap.tab.c" + break; + + case 13: +#line 89 "dap.y" + {yyval=dap_makebase(parsestate,yyvsp[-2],yyvsp[-3],yyvsp[-1]);} +#line 1550 "dap.tab.c" + break; + + case 14: +#line 91 "dap.y" + {if((yyval=dap_makestructure(parsestate,yyvsp[-2],yyvsp[-1],yyvsp[-4]))==null) {YYABORT;}} +#line 1556 "dap.tab.c" + break; + + case 15: +#line 93 "dap.y" + {if((yyval=dap_makesequence(parsestate,yyvsp[-1],yyvsp[-3]))==null) {YYABORT;}} +#line 1562 "dap.tab.c" + break; + + case 16: +#line 96 "dap.y" + {if((yyval=dap_makegrid(parsestate,yyvsp[-1],yyvsp[-6],yyvsp[-3]))==null) {YYABORT;}} +#line 1568 "dap.tab.c" + break; + + case 17: +#line 98 "dap.y" + {dapsemanticerror(parsestate,OC_EBADTYPE,"Unrecognized type"); YYABORT;} +#line 1574 "dap.tab.c" + break; + + case 18: +#line 103 "dap.y" + {yyval=(Object)SCAN_BYTE;} +#line 1580 "dap.tab.c" + break; + + case 19: +#line 104 "dap.y" + {yyval=(Object)SCAN_INT16;} +#line 1586 "dap.tab.c" + break; + + case 20: +#line 105 "dap.y" + {yyval=(Object)SCAN_UINT16;} +#line 1592 "dap.tab.c" + break; + + case 21: +#line 106 "dap.y" + {yyval=(Object)SCAN_INT32;} +#line 1598 "dap.tab.c" + break; + + case 22: +#line 107 "dap.y" + {yyval=(Object)SCAN_UINT32;} +#line 1604 "dap.tab.c" + break; + + case 23: +#line 108 "dap.y" + {yyval=(Object)SCAN_FLOAT32;} +#line 1610 "dap.tab.c" + break; + + case 24: +#line 109 "dap.y" + {yyval=(Object)SCAN_FLOAT64;} +#line 1616 "dap.tab.c" + break; + + case 25: +#line 110 "dap.y" + {yyval=(Object)SCAN_URL;} +#line 1622 "dap.tab.c" + break; + + case 26: +#line 111 "dap.y" + {yyval=(Object)SCAN_STRING;} +#line 1628 "dap.tab.c" + break; + + case 27: +#line 115 "dap.y" + {yyval=dap_arraydecls(parsestate,null,null);} +#line 1634 "dap.tab.c" + break; + + case 28: +#line 116 "dap.y" + {yyval=dap_arraydecls(parsestate,yyvsp[-1],yyvsp[0]);} +#line 1640 "dap.tab.c" + break; + + case 29: +#line 120 "dap.y" + {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} +#line 1646 "dap.tab.c" + break; + + case 30: +#line 121 "dap.y" + {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} +#line 1652 "dap.tab.c" + break; + + case 31: +#line 122 "dap.y" + {yyval=dap_arraydecl(parsestate,yyvsp[-3],yyvsp[-1]);} +#line 1658 "dap.tab.c" + break; + + case 32: +#line 124 "dap.y" + {dapsemanticerror(parsestate,OC_EDIMSIZE,"Illegal dimension declaration"); YYABORT;} +#line 1664 "dap.tab.c" + break; + + case 33: +#line 128 "dap.y" + {yyval=yyvsp[0];} +#line 1670 "dap.tab.c" + break; + + case 34: +#line 130 "dap.y" + {dapsemanticerror(parsestate,OC_EDDS,"Illegal dataset declaration"); YYABORT;} +#line 1676 "dap.tab.c" + break; + + case 35: +#line 133 "dap.y" + {yyval=yyvsp[0];} +#line 1682 "dap.tab.c" + break; + + case 36: +#line 136 "dap.y" + {dap_attributebody(parsestate,yyvsp[-1]);} +#line 1688 "dap.tab.c" + break; + + case 37: +#line 138 "dap.y" + {dapsemanticerror(parsestate,OC_EDAS,"Illegal DAS body"); YYABORT;} +#line 1694 "dap.tab.c" + break; + + case 38: +#line 142 "dap.y" + {yyval=dap_attrlist(parsestate,null,null);} +#line 1700 "dap.tab.c" + break; + + case 39: +#line 143 "dap.y" + {yyval=dap_attrlist(parsestate,yyvsp[-1],yyvsp[0]);} +#line 1706 "dap.tab.c" + break; + + case 40: +#line 147 "dap.y" + {yyval=null;} +#line 1712 "dap.tab.c" + break; + + case 41: +#line 149 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_BYTE);} +#line 1718 "dap.tab.c" + break; + + case 42: +#line 151 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT16);} +#line 1724 "dap.tab.c" + break; + + case 43: +#line 153 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT16);} +#line 1730 "dap.tab.c" + break; + + case 44: +#line 155 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT32);} +#line 1736 "dap.tab.c" + break; + + case 45: +#line 157 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT32);} +#line 1742 "dap.tab.c" + break; + + case 46: +#line 159 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT32);} +#line 1748 "dap.tab.c" + break; + + case 47: +#line 161 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT64);} +#line 1754 "dap.tab.c" + break; + + case 48: +#line 163 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_STRING);} +#line 1760 "dap.tab.c" + break; + + case 49: +#line 165 "dap.y" + {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_URL);} +#line 1766 "dap.tab.c" + break; + + case 50: +#line 166 "dap.y" + {yyval=dap_attrset(parsestate,yyvsp[-3],yyvsp[-1]);} +#line 1772 "dap.tab.c" + break; + + case 51: +#line 168 "dap.y" + {dapsemanticerror(parsestate,OC_EDAS,"Illegal attribute"); YYABORT;} +#line 1778 "dap.tab.c" + break; + + case 52: +#line 172 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_BYTE);} +#line 1784 "dap.tab.c" + break; + + case 53: +#line 174 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_BYTE);} +#line 1790 "dap.tab.c" + break; + + case 54: +#line 177 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT16);} +#line 1796 "dap.tab.c" + break; + + case 55: +#line 179 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT16);} +#line 1802 "dap.tab.c" + break; + + case 56: +#line 182 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT16);} +#line 1808 "dap.tab.c" + break; + + case 57: +#line 184 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT16);} +#line 1814 "dap.tab.c" + break; + + case 58: +#line 187 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT32);} +#line 1820 "dap.tab.c" + break; + + case 59: +#line 189 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT32);} +#line 1826 "dap.tab.c" + break; + + case 60: +#line 192 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT32);} +#line 1832 "dap.tab.c" + break; + + case 61: +#line 193 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT32);} +#line 1838 "dap.tab.c" + break; + + case 62: +#line 196 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT32);} +#line 1844 "dap.tab.c" + break; + + case 63: +#line 197 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT32);} +#line 1850 "dap.tab.c" + break; + + case 64: +#line 200 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT64);} +#line 1856 "dap.tab.c" + break; + + case 65: +#line 201 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT64);} +#line 1862 "dap.tab.c" + break; + + case 66: +#line 204 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_STRING);} +#line 1868 "dap.tab.c" + break; + + case 67: +#line 205 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_STRING);} +#line 1874 "dap.tab.c" + break; + + case 68: +#line 209 "dap.y" + {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_URL);} +#line 1880 "dap.tab.c" + break; + + case 69: +#line 210 "dap.y" + {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_URL);} +#line 1886 "dap.tab.c" + break; + + case 70: +#line 214 "dap.y" + {yyval=yyvsp[0];} +#line 1892 "dap.tab.c" + break; + + case 71: +#line 218 "dap.y" + {yyval=yyvsp[0];} +#line 1898 "dap.tab.c" + break; + + case 72: +#line 219 "dap.y" + {yyval=yyvsp[0];} +#line 1904 "dap.tab.c" + break; + + case 73: +#line 230 "dap.y" + {yyval=yyvsp[-1]; yyval=yyvsp[0]; yyval=null;} +#line 1910 "dap.tab.c" + break; + + case 74: +#line 235 "dap.y" + {dap_errorbody(parsestate,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2]);} +#line 1916 "dap.tab.c" + break; + + case 75: +#line 238 "dap.y" + {yyval=null;} +#line 1922 "dap.tab.c" + break; + + case 76: +#line 238 "dap.y" + {yyval=yyvsp[-1];} +#line 1928 "dap.tab.c" + break; + + case 77: +#line 239 "dap.y" + {yyval=null;} +#line 1934 "dap.tab.c" + break; + + case 78: +#line 239 "dap.y" + {yyval=yyvsp[-1];} +#line 1940 "dap.tab.c" + break; + + case 79: +#line 240 "dap.y" + {yyval=null;} +#line 1946 "dap.tab.c" + break; + + case 80: +#line 240 "dap.y" + {yyval=yyvsp[-1];} +#line 1952 "dap.tab.c" + break; + + case 81: +#line 241 "dap.y" + {yyval=null;} +#line 1958 "dap.tab.c" + break; + + case 82: +#line 241 "dap.y" + {yyval=yyvsp[-1];} +#line 1964 "dap.tab.c" + break; + + case 83: +#line 247 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 1970 "dap.tab.c" + break; + + case 84: +#line 248 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 1976 "dap.tab.c" + break; + + case 85: +#line 249 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 1982 "dap.tab.c" + break; + + case 86: +#line 250 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 1988 "dap.tab.c" + break; + + case 87: +#line 251 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 1994 "dap.tab.c" + break; + + case 88: +#line 252 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2000 "dap.tab.c" + break; + + case 89: +#line 253 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2006 "dap.tab.c" + break; + + case 90: +#line 254 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2012 "dap.tab.c" + break; + + case 91: +#line 255 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2018 "dap.tab.c" + break; + + case 92: +#line 256 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2024 "dap.tab.c" + break; + + case 93: +#line 257 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2030 "dap.tab.c" + break; + + case 94: +#line 258 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2036 "dap.tab.c" + break; + + case 95: +#line 259 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2042 "dap.tab.c" + break; + + case 96: +#line 260 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2048 "dap.tab.c" + break; + + case 97: +#line 261 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2054 "dap.tab.c" + break; + + case 98: +#line 262 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2060 "dap.tab.c" + break; + + case 99: +#line 263 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2066 "dap.tab.c" + break; + + case 100: +#line 264 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2072 "dap.tab.c" + break; + + case 101: +#line 265 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2078 "dap.tab.c" + break; + + case 102: +#line 266 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2084 "dap.tab.c" + break; + + case 103: +#line 267 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2090 "dap.tab.c" + break; + + case 104: +#line 268 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2096 "dap.tab.c" + break; + + case 105: +#line 269 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2102 "dap.tab.c" + break; + + case 106: +#line 270 "dap.y" + {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} +#line 2108 "dap.tab.c" + break; + + +#line 2112 "dap.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); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (parsestate, 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 = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (parsestate, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, parsestate); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, parsestate); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (parsestate, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ +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, parsestate); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[+*yyssp], yyvsp, parsestate); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +#line 273 "dap.y" + diff --git a/oc2/dap.tab.h b/oc2/dap.tab.h new file mode 100644 index 0000000000..9848bdf971 --- /dev/null +++ b/oc2/dap.tab.h @@ -0,0 +1,91 @@ +/* A Bison parser, made by GNU Bison 3.5.1. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +#ifndef YY_DAP_DAP_TAB_H_INCLUDED +# define YY_DAP_DAP_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int dapdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + SCAN_ALIAS = 258, + SCAN_ARRAY = 259, + SCAN_ATTR = 260, + SCAN_BYTE = 261, + SCAN_CODE = 262, + SCAN_DATASET = 263, + SCAN_DATA = 264, + SCAN_ERROR = 265, + SCAN_FLOAT32 = 266, + SCAN_FLOAT64 = 267, + SCAN_GRID = 268, + SCAN_INT16 = 269, + SCAN_INT32 = 270, + SCAN_MAPS = 271, + SCAN_MESSAGE = 272, + SCAN_SEQUENCE = 273, + SCAN_STRING = 274, + SCAN_STRUCTURE = 275, + SCAN_UINT16 = 276, + SCAN_UINT32 = 277, + SCAN_URL = 278, + SCAN_PTYPE = 279, + SCAN_PROG = 280, + WORD_WORD = 281, + WORD_STRING = 282 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +int dapparse (DAPparsestate* parsestate); + +#endif /* !YY_DAP_DAP_TAB_H_INCLUDED */ From dea9aa7e32fac04d94e78f2d5b458e6c6461831f Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 17 Nov 2024 19:55:18 +0300 Subject: [PATCH 3/5] Use classic names in libdap2 --- libdap2/CMakeLists.txt | 6 +- libdap2/Makefile.am | 10 +- libdap2/{dcetab.c => dce.tab.c} | 901 ++++++++++++++++++++------------ libdap2/{dcetab.h => dce.tab.h} | 26 +- libdap2/dceparselex.h | 4 +- 5 files changed, 583 insertions(+), 364 deletions(-) rename libdap2/{dcetab.c => dce.tab.c} (70%) rename libdap2/{dcetab.h => dce.tab.h} (69%) diff --git a/libdap2/CMakeLists.txt b/libdap2/CMakeLists.txt index 9e09abe070..7900152b68 100644 --- a/libdap2/CMakeLists.txt +++ b/libdap2/CMakeLists.txt @@ -4,11 +4,11 @@ # University Corporation for Atmospheric Research/Unidata. # See netcdf-c/COPYRIGHT file for more info. -SET(dap2_SOURCES constraints.c dapcvt.c dapodom.c daputil.c ncdaperr.c cdf.c cache.c dapdump.c dapdebug.c dapattr.c ncd2dispatch.c getvara.c dceconstraints.c dcetab.c dceparse.c dcelex.c) +SET(dap2_SOURCES constraints.c dapcvt.c dapodom.c daputil.c ncdaperr.c cdf.c cache.c dapdump.c dapdebug.c dapattr.c ncd2dispatch.c getvara.c dceconstraints.c dce.tab.c dceparse.c dcelex.c) -## +## # Turn off inclusion of particular files when using the cmake-native -# option to turn on Unity Builds. +# option to turn on Unity Builds. # # For more information, see: # * https://github.com/Unidata/netcdf-c/pull/2839/ diff --git a/libdap2/Makefile.am b/libdap2/Makefile.am index 35abca9615..fff63da406 100644 --- a/libdap2/Makefile.am +++ b/libdap2/Makefile.am @@ -17,12 +17,12 @@ LDADD= SRC= constraints.c dapcvt.c dapodom.c daputil.c \ ncdaperr.c cdf.c cache.c dapdump.c dapdebug.c dapattr.c \ -ncd2dispatch.c getvara.c dceconstraints.c dcetab.c \ +ncd2dispatch.c getvara.c dceconstraints.c dce.tab.c \ dceparse.c dcelex.c HDRS= nccommon.h constraints.h ncd2dispatch.h dapincludes.h \ dapodom.h getvara.h dapnc.h daputil.h dapdebug.h dapdump.h \ -dceconstraints.h dcetab.h dceparselex.h +dceconstraints.h dce.tab.h dceparselex.h if NETCDF_ENABLE_DAP @@ -54,7 +54,5 @@ endif # NETCDF_ENABLE_DAP EXTRA_DIST += dce.y makece:: - bison -v -d -t -p dce dce.y - rm -f dcetab.c dcetab.h - sed -e 's/dce[.]tab[.]c/dcetab.c/g' -e 's/dce[.]tab[.]h/dcetab.h/g' dcetab.c - sed -e 's/dce[.]tab[.]c/dcetab.c/g' -e 's/dce[.]tab[.]h/dcetab.h/g' dcetab.h + rm -f dce.tab.c dce.tab.h + bison --debug --defines -p dce dce.y diff --git a/libdap2/dcetab.c b/libdap2/dce.tab.c similarity index 70% rename from libdap2/dcetab.c rename to libdap2/dce.tab.c index 72361d9abd..cc02807cd5 100644 --- a/libdap2/dcetab.c +++ b/libdap2/dce.tab.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +/* A Bison parser, made by GNU Bison 3.5.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,10 +34,6 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -45,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output, and Bison version. */ -#define YYBISON 30802 +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +/* Identify Bison output. */ +#define YYBISON 1 -/* Bison version string. */ -#define YYBISON_VERSION "3.8.2" +/* Bison version. */ +#define YYBISON_VERSION "3.5.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -84,7 +83,7 @@ #include "dceconstraints.h" #include "dceparselex.h" -#line 88 "dcetab.c" +#line 87 "dce.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -107,65 +106,49 @@ # endif # endif -#include "dcetab.h" -/* Symbol kind. */ -enum yysymbol_kind_t -{ - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_SCAN_WORD = 3, /* SCAN_WORD */ - YYSYMBOL_SCAN_STRINGCONST = 4, /* SCAN_STRINGCONST */ - YYSYMBOL_SCAN_NUMBERCONST = 5, /* SCAN_NUMBERCONST */ - YYSYMBOL_6_ = 6, /* '?' */ - YYSYMBOL_7_ = 7, /* ',' */ - YYSYMBOL_8_ = 8, /* '(' */ - YYSYMBOL_9_ = 9, /* ')' */ - YYSYMBOL_10_ = 10, /* '.' */ - YYSYMBOL_11_ = 11, /* '[' */ - YYSYMBOL_12_ = 12, /* ']' */ - YYSYMBOL_13_ = 13, /* ':' */ - YYSYMBOL_14_ = 14, /* '&' */ - YYSYMBOL_15_ = 15, /* '{' */ - YYSYMBOL_16_ = 16, /* '}' */ - YYSYMBOL_17_ = 17, /* '=' */ - YYSYMBOL_18_ = 18, /* '>' */ - YYSYMBOL_19_ = 19, /* '<' */ - YYSYMBOL_20_ = 20, /* '!' */ - YYSYMBOL_21_ = 21, /* '~' */ - YYSYMBOL_YYACCEPT = 22, /* $accept */ - YYSYMBOL_constraints = 23, /* constraints */ - YYSYMBOL_optquestionmark = 24, /* optquestionmark */ - YYSYMBOL_projections = 25, /* projections */ - YYSYMBOL_selections = 26, /* selections */ - YYSYMBOL_projectionlist = 27, /* projectionlist */ - YYSYMBOL_projection = 28, /* projection */ - YYSYMBOL_function = 29, /* function */ - YYSYMBOL_segmentlist = 30, /* segmentlist */ - YYSYMBOL_segment = 31, /* segment */ - YYSYMBOL_rangelist = 32, /* rangelist */ - YYSYMBOL_range = 33, /* range */ - YYSYMBOL_range1 = 34, /* range1 */ - YYSYMBOL_clauselist = 35, /* clauselist */ - YYSYMBOL_sel_clause = 36, /* sel_clause */ - YYSYMBOL_value_list = 37, /* value_list */ - YYSYMBOL_value = 38, /* value */ - YYSYMBOL_constant = 39, /* constant */ - YYSYMBOL_var = 40, /* var */ - YYSYMBOL_indexpath = 41, /* indexpath */ - YYSYMBOL_index = 42, /* index */ - YYSYMBOL_array_indices = 43, /* array_indices */ - YYSYMBOL_boolfunction = 44, /* boolfunction */ - YYSYMBOL_arg_list = 45, /* arg_list */ - YYSYMBOL_rel_op = 46, /* rel_op */ - YYSYMBOL_ident = 47, /* ident */ - YYSYMBOL_word = 48, /* word */ - YYSYMBOL_number = 49, /* number */ - YYSYMBOL_string = 50 /* string */ -}; -typedef enum yysymbol_kind_t yysymbol_kind_t; +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_DCE_DCE_TAB_H_INCLUDED +# define YY_DCE_DCE_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int dcedebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + SCAN_WORD = 258, + SCAN_STRINGCONST = 259, + SCAN_NUMBERCONST = 260 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +int dceparse (DCEparsestate* parsestate); +#endif /* !YY_DCE_DCE_TAB_H_INCLUDED */ @@ -206,18 +189,6 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif -/* Work around bug in HP-UX 11.23, which defines these macros - incorrectly for preprocessor constants. This workaround can likely - be removed in 2023, as HPE has promised support for HP-UX 11.23 - (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of - . */ -#ifdef __hpux -# undef UINT_LEAST8_MAX -# undef UINT_LEAST16_MAX -# define UINT_LEAST8_MAX 255 -# define UINT_LEAST16_MAX 65535 -#endif - #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -277,7 +248,6 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - /* Stored state numbers (used for stacks). */ typedef yytype_int8 yy_state_t; @@ -296,7 +266,6 @@ typedef int yy_state_fast_t; # endif #endif - #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -315,23 +284,17 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YY_USE(E) ((void) (E)) +# define YYUSE(E) ((void) (E)) #else -# define YY_USE(E) /* empty */ +# define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -360,7 +323,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if !defined yyoverflow +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -425,7 +388,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* !defined yyoverflow */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -501,16 +465,14 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 87 -/* YYMAXUTOK -- Last valid token kind. */ +#define YYUNDEFTOK 2 #define YYMAXUTOK 260 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ @@ -546,7 +508,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG -/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 34, 34, 35, 36, 37, 40, 40, 43, 47, @@ -558,35 +520,33 @@ static const yytype_uint8 yyrline[] = }; #endif -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) - -#if YYDEBUG || 0 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; - +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "\"end of file\"", "error", "\"invalid token\"", "SCAN_WORD", - "SCAN_STRINGCONST", "SCAN_NUMBERCONST", "'?'", "','", "'('", "')'", - "'.'", "'['", "']'", "':'", "'&'", "'{'", "'}'", "'='", "'>'", "'<'", - "'!'", "'~'", "$accept", "constraints", "optquestionmark", "projections", - "selections", "projectionlist", "projection", "function", "segmentlist", - "segment", "rangelist", "range", "range1", "clauselist", "sel_clause", - "value_list", "value", "constant", "var", "indexpath", "index", - "array_indices", "boolfunction", "arg_list", "rel_op", "ident", "word", - "number", "string", YY_NULLPTR + "$end", "error", "$undefined", "SCAN_WORD", "SCAN_STRINGCONST", + "SCAN_NUMBERCONST", "'?'", "','", "'('", "')'", "'.'", "'['", "']'", + "':'", "'&'", "'{'", "'}'", "'='", "'>'", "'<'", "'!'", "'~'", "$accept", + "constraints", "optquestionmark", "projections", "selections", + "projectionlist", "projection", "function", "segmentlist", "segment", + "rangelist", "range", "range1", "clauselist", "sel_clause", "value_list", + "value", "constant", "var", "indexpath", "index", "array_indices", + "boolfunction", "arg_list", "rel_op", "ident", "word", "number", + "string", YY_NULLPTR }; +#endif -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_int16 yytoknum[] = { - return yytname[yysymbol]; -} -#endif + 0, 256, 257, 258, 259, 260, 63, 44, 40, 41, + 46, 91, 93, 58, 38, 123, 125, 61, 62, 60, + 33, 126 +}; +# endif #define YYPACT_NINF (-36) @@ -598,8 +558,8 @@ yysymbol_name (yysymbol_kind_t yysymbol) #define yytable_value_is_error(Yyn) \ 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { 10, -36, 8, 4, -36, -36, 46, 12, -36, 23, @@ -613,9 +573,9 @@ static const yytype_int8 yypact[] = 46, -36, -36, 53, -36, 63, -36 }; -/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 7, 6, 0, 0, 1, 57, 0, 2, 3, 8, @@ -629,7 +589,7 @@ static const yytype_int8 yydefact[] = 0, 28, 23, 0, 32, 0, 24 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -36, -36, -36, -36, 56, -36, 47, 1, -36, 28, @@ -637,17 +597,17 @@ static const yytype_int8 yypgoto[] = 33, -36, -36, 37, -36, 77, -1, -35, -36 }; -/* YYDEFGOTO[NTERM-NUM]. */ + /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - 0, 2, 3, 7, 8, 9, 10, 20, 12, 13, + -1, 2, 3, 7, 8, 9, 10, 20, 12, 13, 37, 38, 47, 14, 15, 53, 54, 22, 23, 24, 25, 48, 26, 55, 43, 16, 28, 29, 30 }; -/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 21, 56, 17, -45, 11, -46, -56, 5, 4, 36, @@ -674,8 +634,8 @@ static const yytype_int8 yycheck[] = 48, 14, 45, 6 }; -/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of - state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 6, 23, 24, 0, 3, 14, 25, 26, 27, @@ -689,7 +649,7 @@ static const yytype_int8 yystos[] = 7, 16, 12, 13, 38, 49, 12 }; -/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int8 yyr1[] = { 0, 22, 23, 23, 23, 23, 24, 24, 25, 26, @@ -700,7 +660,7 @@ static const yytype_int8 yyr1[] = 46, 46, 46, 46, 46, 46, 47, 48, 49, 50 }; -/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 yyr2[] = { 0, 2, 2, 2, 3, 0, 1, 0, 1, 1, @@ -712,15 +672,14 @@ static const yytype_int8 yyr2[] = }; -enum { YYENOMEM = -2 }; - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -742,9 +701,10 @@ enum { YYENOMEM = -2 }; } \ while (0) -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + /* Enable debugging if requested. */ @@ -761,16 +721,19 @@ do { \ YYFPRINTF Args; \ } while (0) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Kind, Value, parsestate); \ + Type, Value, parsestate); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -781,16 +744,19 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) { FILE *yyoutput = yyo; - YY_USE (yyoutput); - YY_USE (parsestate); + YYUSE (yyoutput); + YYUSE (parsestate); if (!yyvaluep) return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); +# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -800,13 +766,12 @@ yy_symbol_value_print (FILE *yyo, `---------------------------*/ static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) { YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyo, yykind, yyvaluep, parsestate); + yy_symbol_value_print (yyo, yytype, yyvaluep, parsestate); YYFPRINTF (yyo, ")"); } @@ -839,8 +804,7 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule, DCEparsestate* parsestate) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DCEparsestate* parsestate) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; @@ -852,8 +816,9 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)], parsestate); + yystos[+yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] + , parsestate); YYFPRINTF (stderr, "\n"); } } @@ -868,8 +833,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -892,34 +857,259 @@ int yydebug; #endif +#if YYERROR_VERBOSE +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else +/* Return the length of YYSTR. */ +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + while ((*yyd++ = *yys++) != '\0') + continue; + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (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 (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + yy_state_t *yyssp, int yytoken) +{ + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Actual size of YYARG. */ + int yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* There are many possibilities here to consider: + - 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) + { + int yyn = yypact[+*yyssp]; + YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + yysize = yysize0; + 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; + + 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]; + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + 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_ + } + + { + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + + 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. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep, DCEparsestate* parsestate) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DCEparsestate* parsestate) { - YY_USE (yyvaluep); - YY_USE (parsestate); + YYUSE (yyvaluep); + YYUSE (parsestate); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - /*----------. | yyparse. | `----------*/ @@ -927,7 +1117,7 @@ yydestruct (const char *yymsg, int yyparse (DCEparsestate* parsestate) { -/* Lookahead token kind. */ +/* The lookahead symbol. */ int yychar; @@ -938,38 +1128,45 @@ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ - int yynerrs = 0; + int yynerrs; - yy_state_fast_t yystate = 0; + yy_state_fast_t yystate; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; + int yyerrstatus; - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The state stack: array, bottom, top. */ + /* The state stack. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; + yy_state_t *yyss; + yy_state_t *yyssp; - /* The semantic value stack: array, bottom, top. */ + /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYPTRDIFF_T yystacksize; int yyn; - /* The return value of yyparse. */ int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; - +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; +#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -977,10 +1174,16 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); Keep to zero when no symbol should be popped. */ int yylen = 0; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; @@ -1002,11 +1205,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1034,7 +1236,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - YYNOMEM; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1045,10 +1247,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - YYNOMEM; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1067,7 +1269,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - if (yystate == YYFINAL) YYACCEPT; @@ -1088,29 +1289,18 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token\n")); + YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (&yylval, parsestate); } if (yychar <= YYEOF) { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; - } else { yytoken = YYTRANSLATE (yychar); @@ -1179,320 +1369,320 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 8: /* projections: projectionlist */ + case 8: #line 43 "dce.y" {projections(parsestate,yyvsp[0]);} -#line 1186 "dcetab.c" +#line 1376 "dce.tab.c" break; - case 9: /* selections: clauselist */ + case 9: #line 47 "dce.y" {selections(parsestate,yyvsp[0]);} -#line 1192 "dcetab.c" +#line 1382 "dce.tab.c" break; - case 10: /* projectionlist: projection */ + case 10: #line 52 "dce.y" {yyval=projectionlist(parsestate,(Object)null,yyvsp[0]);} -#line 1198 "dcetab.c" +#line 1388 "dce.tab.c" break; - case 11: /* projectionlist: projectionlist ',' projection */ + case 11: #line 54 "dce.y" {yyval=projectionlist(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1204 "dcetab.c" +#line 1394 "dce.tab.c" break; - case 12: /* projection: segmentlist */ + case 12: #line 59 "dce.y" {yyval=projection(parsestate,yyvsp[0]);} -#line 1210 "dcetab.c" +#line 1400 "dce.tab.c" break; - case 13: /* projection: function */ + case 13: #line 61 "dce.y" {yyval=projection(parsestate,yyvsp[0]);} -#line 1216 "dcetab.c" +#line 1406 "dce.tab.c" break; - case 14: /* function: ident '(' ')' */ + case 14: #line 66 "dce.y" {yyval=function(parsestate,yyvsp[-2],null);} -#line 1222 "dcetab.c" +#line 1412 "dce.tab.c" break; - case 15: /* function: ident '(' arg_list ')' */ + case 15: #line 68 "dce.y" {yyval=function(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1228 "dcetab.c" +#line 1418 "dce.tab.c" break; - case 16: /* segmentlist: segment */ + case 16: #line 73 "dce.y" {yyval=segmentlist(parsestate,null,yyvsp[0]);} -#line 1234 "dcetab.c" +#line 1424 "dce.tab.c" break; - case 17: /* segmentlist: segmentlist '.' segment */ + case 17: #line 75 "dce.y" {yyval=segmentlist(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1240 "dcetab.c" +#line 1430 "dce.tab.c" break; - case 18: /* segment: word */ + case 18: #line 80 "dce.y" {yyval=segment(parsestate,yyvsp[0],null);} -#line 1246 "dcetab.c" +#line 1436 "dce.tab.c" break; - case 19: /* segment: word rangelist */ + case 19: #line 82 "dce.y" {yyval=segment(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1252 "dcetab.c" +#line 1442 "dce.tab.c" break; - case 20: /* rangelist: range */ + case 20: #line 87 "dce.y" {yyval=rangelist(parsestate,null,yyvsp[0]);} -#line 1258 "dcetab.c" +#line 1448 "dce.tab.c" break; - case 21: /* rangelist: rangelist range */ + case 21: #line 89 "dce.y" {yyval=rangelist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1264 "dcetab.c" +#line 1454 "dce.tab.c" break; - case 22: /* range: '[' number ']' */ + case 22: #line 94 "dce.y" {yyval=range(parsestate,yyvsp[-1],null,null);} -#line 1270 "dcetab.c" +#line 1460 "dce.tab.c" break; - case 23: /* range: '[' number ':' number ']' */ + case 23: #line 96 "dce.y" {yyval=range(parsestate,yyvsp[-3],null,yyvsp[-1]);} -#line 1276 "dcetab.c" +#line 1466 "dce.tab.c" break; - case 24: /* range: '[' number ':' number ':' number ']' */ + case 24: #line 98 "dce.y" {yyval=range(parsestate,yyvsp[-5],yyvsp[-3],yyvsp[-1]);} -#line 1282 "dcetab.c" +#line 1472 "dce.tab.c" break; - case 25: /* range1: '[' number ']' */ + case 25: #line 102 "dce.y" {yyval = range1(parsestate,yyvsp[-1]);} -#line 1288 "dcetab.c" +#line 1478 "dce.tab.c" break; - case 26: /* clauselist: sel_clause */ + case 26: #line 108 "dce.y" {yyval=clauselist(parsestate,null,yyvsp[0]);} -#line 1294 "dcetab.c" +#line 1484 "dce.tab.c" break; - case 27: /* clauselist: clauselist sel_clause */ + case 27: #line 110 "dce.y" {yyval=clauselist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1300 "dcetab.c" +#line 1490 "dce.tab.c" break; - case 28: /* sel_clause: '&' value rel_op '{' value_list '}' */ + case 28: #line 115 "dce.y" {yyval=sel_clause(parsestate,1,yyvsp[-4],yyvsp[-3],yyvsp[-1]);} -#line 1306 "dcetab.c" +#line 1496 "dce.tab.c" break; - case 29: /* sel_clause: '&' value rel_op value */ + case 29: #line 117 "dce.y" {yyval=sel_clause(parsestate,2,yyvsp[-2],yyvsp[-1],yyvsp[0]);} -#line 1312 "dcetab.c" +#line 1502 "dce.tab.c" break; - case 30: /* sel_clause: '&' boolfunction */ + case 30: #line 119 "dce.y" {yyval=yyvsp[-1];} -#line 1318 "dcetab.c" +#line 1508 "dce.tab.c" break; - case 31: /* value_list: value */ + case 31: #line 124 "dce.y" {yyval=value_list(parsestate,null,yyvsp[0]);} -#line 1324 "dcetab.c" +#line 1514 "dce.tab.c" break; - case 32: /* value_list: value_list ',' value */ + case 32: #line 126 "dce.y" {yyval=value_list(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1330 "dcetab.c" +#line 1520 "dce.tab.c" break; - case 33: /* value: var */ + case 33: #line 131 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1336 "dcetab.c" +#line 1526 "dce.tab.c" break; - case 34: /* value: function */ + case 34: #line 133 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1342 "dcetab.c" +#line 1532 "dce.tab.c" break; - case 35: /* value: constant */ + case 35: #line 135 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1348 "dcetab.c" +#line 1538 "dce.tab.c" break; - case 36: /* constant: number */ + case 36: #line 140 "dce.y" {yyval=constant(parsestate,yyvsp[0],SCAN_NUMBERCONST);} -#line 1354 "dcetab.c" +#line 1544 "dce.tab.c" break; - case 37: /* constant: string */ + case 37: #line 142 "dce.y" {yyval=constant(parsestate,yyvsp[0],SCAN_STRINGCONST);} -#line 1360 "dcetab.c" +#line 1550 "dce.tab.c" break; - case 38: /* var: indexpath */ + case 38: #line 147 "dce.y" {yyval=var(parsestate,yyvsp[0]);} -#line 1366 "dcetab.c" +#line 1556 "dce.tab.c" break; - case 39: /* indexpath: index */ + case 39: #line 152 "dce.y" {yyval=indexpath(parsestate,null,yyvsp[0]);} -#line 1372 "dcetab.c" +#line 1562 "dce.tab.c" break; - case 40: /* indexpath: indexpath '.' index */ + case 40: #line 154 "dce.y" {yyval=indexpath(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1378 "dcetab.c" +#line 1568 "dce.tab.c" break; - case 41: /* index: word */ + case 41: #line 159 "dce.y" {yyval=indexer(parsestate,yyvsp[0],null);} -#line 1384 "dcetab.c" +#line 1574 "dce.tab.c" break; - case 42: /* index: word array_indices */ + case 42: #line 161 "dce.y" {yyval=indexer(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1390 "dcetab.c" +#line 1580 "dce.tab.c" break; - case 43: /* array_indices: range1 */ + case 43: #line 166 "dce.y" {yyval=array_indices(parsestate,null,yyvsp[0]);} -#line 1396 "dcetab.c" +#line 1586 "dce.tab.c" break; - case 44: /* array_indices: array_indices range1 */ + case 44: #line 168 "dce.y" {yyval=array_indices(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1402 "dcetab.c" +#line 1592 "dce.tab.c" break; - case 45: /* boolfunction: ident '(' ')' */ + case 45: #line 173 "dce.y" {yyval=function(parsestate,yyvsp[-2],null);} -#line 1408 "dcetab.c" +#line 1598 "dce.tab.c" break; - case 46: /* boolfunction: ident '(' arg_list ')' */ + case 46: #line 175 "dce.y" {yyval=function(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1414 "dcetab.c" +#line 1604 "dce.tab.c" break; - case 47: /* arg_list: value */ + case 47: #line 180 "dce.y" {yyval=arg_list(parsestate,null,yyvsp[0]);} -#line 1420 "dcetab.c" +#line 1610 "dce.tab.c" break; - case 48: /* arg_list: value_list ',' value */ + case 48: #line 182 "dce.y" {yyval=arg_list(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1426 "dcetab.c" +#line 1616 "dce.tab.c" break; - case 49: /* rel_op: '=' */ + case 49: #line 186 "dce.y" {yyval=makeselectiontag(CEO_EQ);} -#line 1432 "dcetab.c" +#line 1622 "dce.tab.c" break; - case 50: /* rel_op: '>' */ + case 50: #line 187 "dce.y" {yyval=makeselectiontag(CEO_GT);} -#line 1438 "dcetab.c" +#line 1628 "dce.tab.c" break; - case 51: /* rel_op: '<' */ + case 51: #line 188 "dce.y" {yyval=makeselectiontag(CEO_LT);} -#line 1444 "dcetab.c" +#line 1634 "dce.tab.c" break; - case 52: /* rel_op: '!' '=' */ + case 52: #line 189 "dce.y" {yyval=makeselectiontag(CEO_NEQ);} -#line 1450 "dcetab.c" +#line 1640 "dce.tab.c" break; - case 53: /* rel_op: '>' '=' */ + case 53: #line 190 "dce.y" {yyval=makeselectiontag(CEO_GE);} -#line 1456 "dcetab.c" +#line 1646 "dce.tab.c" break; - case 54: /* rel_op: '<' '=' */ + case 54: #line 191 "dce.y" {yyval=makeselectiontag(CEO_LE);} -#line 1462 "dcetab.c" +#line 1652 "dce.tab.c" break; - case 55: /* rel_op: '=' '~' */ + case 55: #line 192 "dce.y" {yyval=makeselectiontag(CEO_RE);} -#line 1468 "dcetab.c" +#line 1658 "dce.tab.c" break; - case 56: /* ident: word */ + case 56: #line 196 "dce.y" {yyval = yyvsp[0];} -#line 1474 "dcetab.c" +#line 1664 "dce.tab.c" break; - case 57: /* word: SCAN_WORD */ + case 57: #line 200 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1480 "dcetab.c" +#line 1670 "dce.tab.c" break; - case 58: /* number: SCAN_NUMBERCONST */ + case 58: #line 204 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1486 "dcetab.c" +#line 1676 "dce.tab.c" break; - case 59: /* string: SCAN_STRINGCONST */ + case 59: #line 208 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1492 "dcetab.c" +#line 1682 "dce.tab.c" break; -#line 1496 "dcetab.c" +#line 1686 "dce.tab.c" default: break; } @@ -1507,10 +1697,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1534,14 +1725,50 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; +#if ! YYERROR_VERBOSE yyerror (parsestate, 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 = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (parsestate, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif } + + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -1574,7 +1801,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; - ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -1591,14 +1817,13 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ - /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) @@ -1612,7 +1837,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp, parsestate); + yystos[yystate], yyvsp, parsestate); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1624,7 +1849,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -1635,7 +1860,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturnlab; + goto yyreturn; /*-----------------------------------. @@ -1643,22 +1868,24 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturnlab; + goto yyreturn; -/*-----------------------------------------------------------. -| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | -`-----------------------------------------------------------*/ +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ yyexhaustedlab: yyerror (parsestate, YY_("memory exhausted")); yyresult = 2; - goto yyreturnlab; + /* Fall through. */ +#endif -/*----------------------------------------------------------. -| yyreturnlab -- parsing is finished, clean up and return. | -`----------------------------------------------------------*/ -yyreturnlab: +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ +yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -1674,16 +1901,18 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parsestate); + yystos[+*yyssp], yyvsp, parsestate); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif return yyresult; } - #line 211 "dce.y" diff --git a/libdap2/dcetab.h b/libdap2/dce.tab.h similarity index 69% rename from libdap2/dcetab.h rename to libdap2/dce.tab.h index fe0ce56fbb..c762ae1c26 100644 --- a/libdap2/dcetab.h +++ b/libdap2/dce.tab.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +/* A Bison parser, made by GNU Bison 3.5.1. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,9 +31,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ #ifndef YY_DCE_DCE_TAB_H_INCLUDED # define YY_DCE_DCE_TAB_H_INCLUDED @@ -45,20 +44,15 @@ extern int dcedebug; #endif -/* Token kinds. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - SCAN_WORD = 258, /* SCAN_WORD */ - SCAN_STRINGCONST = 259, /* SCAN_STRINGCONST */ - SCAN_NUMBERCONST = 260 /* SCAN_NUMBERCONST */ + SCAN_WORD = 258, + SCAN_STRINGCONST = 259, + SCAN_NUMBERCONST = 260 }; - typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ @@ -70,8 +64,6 @@ typedef int YYSTYPE; - int dceparse (DCEparsestate* parsestate); - #endif /* !YY_DCE_DCE_TAB_H_INCLUDED */ diff --git a/libdap2/dceparselex.h b/libdap2/dceparselex.h index 41530e275f..20c4607721 100644 --- a/libdap2/dceparselex.h +++ b/libdap2/dceparselex.h @@ -10,7 +10,7 @@ struct DCEparsestate; typedef struct DCEparsestate DCEparsestate; -#include "dcetab.h" +#include "dce.tab.h" #ifdef _WIN32 @@ -51,7 +51,7 @@ struct DCEparsestate { essentially the same role as the typical bison %union declaration */ - + extern int ceerror(DCEparsestate*,char*); extern void ce_parse_error(DCEparsestate*,const char *fmt, ...); From 17a2e7a45ae633b8f2a61dc01fbbec411c29a155 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 17 Nov 2024 19:55:29 +0300 Subject: [PATCH 4/5] Use classic names in ncgen --- ncgen/CMakeLists.txt | 8 +- ncgen/Makefile.am | 12 +- ncgen/ncgen.l | 4 +- ncgen/{ncgeny.c => ncgen.tab.c} | 1353 +++++++++++++++---------------- ncgen/ncgen.tab.h | 138 ++++ ncgen/ncgen.y | 2 +- ncgen/ncgenl.c | 14 +- ncgen/ncgeny.h | 146 ---- 8 files changed, 792 insertions(+), 885 deletions(-) rename ncgen/{ncgeny.c => ncgen.tab.c} (78%) create mode 100644 ncgen/ncgen.tab.h delete mode 100644 ncgen/ncgeny.h diff --git a/ncgen/CMakeLists.txt b/ncgen/CMakeLists.txt index 0ee650dda8..f04a3f563b 100644 --- a/ncgen/CMakeLists.txt +++ b/ncgen/CMakeLists.txt @@ -17,14 +17,14 @@ SET(ncgen_FILES bindata.c bytebuffer.c cdata.c cvt.c data.c debug.c dump.c escapes.c f77data.c genbin.c genc.c genchar.c generate.c generr.c genf77.c genj.c genlib.c getfill.c jdata.c list.c -main.c ncgeny.c semantics.c +main.c ncgen.tab.c semantics.c util.c bytebuffer.h data.h debug.h dump.h generate.h generr.h genlib.h includes.h list.h -ncgen.h ncgeny.h util.h ${XGETOPTSRC}) +ncgen.h ncgen.tab.h util.h ${XGETOPTSRC}) -## +## # Turn off inclusion of particular files when using the cmake-native -# option to turn on Unity Builds. +# option to turn on Unity Builds. # # For more information, see: # * https://github.com/Unidata/netcdf-c/pull/2839/ diff --git a/ncgen/Makefile.am b/ncgen/Makefile.am index 49a3d64976..a5de69e171 100644 --- a/ncgen/Makefile.am +++ b/ncgen/Makefile.am @@ -13,10 +13,10 @@ ncgen_SOURCES = bindata.c bytebuffer.c cdata.c cvt.c data.c \ debug.c dump.c escapes.c f77data.c genbin.c \ genc.c genchar.c generate.c generr.c genf77.c \ genj.c genlib.c getfill.c jdata.c list.c \ -main.c ncgeny.c semantics.c \ +main.c ncgen.tab.c semantics.c \ util.c bytebuffer.h data.h debug.h dump.h \ generate.h generr.h genlib.h includes.h list.h \ -ncgen.h ncgeny.h util.h +ncgen.h ncgen.tab.h util.h # Obsolete OBSOLETE = odom.c odom.h jdatastd.c jdatajni.c genjni.c cdfdata.c cmldata.c @@ -63,8 +63,6 @@ makeparser:: rm -f ncgenl.c lex.ncg.c flex -Pncg -8 ncgen.l sed -e s/lex.ncg.c/ncgenl.c/g ncgenl.c - bison -pncg -t -d ncgen.y - rm -f ncgeny.c ncgeny.h - sed -e s/ncgen.tab.c/ncgeny.c/g -e s/ncgen.tab.h/ncgeny.h/g ncgeny.c - sed -e s/ncgen.tab.c/ncgeny.c/g -e s/ncgen.tab.h/ncgeny.h/g ncgeny.h - rm -f lex.ncg.c ncgen.tab.h ncgen.tab.c + rm -f lex.ncg.c + rm ncgen.tab.y ncgen.tab.h + bison --debug --defines -p ncg ncgen.y diff --git a/ncgen/ncgen.l b/ncgen/ncgen.l index 6718e5f40c..6d425a5c60 100644 --- a/ncgen/ncgen.l +++ b/ncgen/ncgen.l @@ -36,7 +36,7 @@ definition of FILL_STRING in ../ncdump/vardata.h */ #include "ncgen.h" -#include "ncgeny.h" +#include "ncgen.tab.h" #include "isnan.h" #define FILL_STRING "_" @@ -916,7 +916,7 @@ identcheck(int token) } break; default: - break; + break; } return token; } diff --git a/ncgen/ncgeny.c b/ncgen/ncgen.tab.c similarity index 78% rename from ncgen/ncgeny.c rename to ncgen/ncgen.tab.c index 3a37ff971f..03d592dd81 100644 --- a/ncgen/ncgeny.c +++ b/ncgen/ncgen.tab.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +/* A Bison parser, made by GNU Bison 3.5.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,10 +34,6 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -45,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output, and Bison version. */ -#define YYBISON 30802 +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +/* Identify Bison output. */ +#define YYBISON 1 -/* Bison version string. */ -#define YYBISON_VERSION "3.8.2" +/* Bison version. */ +#define YYBISON_VERSION "3.5.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -81,7 +80,7 @@ static char SccsId[] = "$Id: ncgen.y,v 1.42 2010/05/18 21:32:46 dmh Exp $"; */ #include "includes.h" #include "netcdf_aux.h" -#include "ncgeny.h" +#include "ncgen.tab.h" #include "ncgen.h" #ifdef USE_NETCDF4 #include "netcdf_filter.h" @@ -217,7 +216,7 @@ static void yyerror(fmt,va_alist) const char* fmt; va_dcl; extern int lex_init(void); -#line 221 "ncgeny.c" +#line 220 "ncgen.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -240,151 +239,118 @@ extern int lex_init(void); # endif # endif -#include "ncgeny.h" -/* Symbol kind. */ -enum yysymbol_kind_t +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_NCG_NCGEN_TAB_H_INCLUDED +# define YY_NCG_NCGEN_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int ncgdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + NC_UNLIMITED_K = 258, + CHAR_K = 259, + BYTE_K = 260, + SHORT_K = 261, + INT_K = 262, + FLOAT_K = 263, + DOUBLE_K = 264, + UBYTE_K = 265, + USHORT_K = 266, + UINT_K = 267, + INT64_K = 268, + UINT64_K = 269, + STRING_K = 270, + IDENT = 271, + TERMSTRING = 272, + CHAR_CONST = 273, + BYTE_CONST = 274, + SHORT_CONST = 275, + INT_CONST = 276, + INT64_CONST = 277, + UBYTE_CONST = 278, + USHORT_CONST = 279, + UINT_CONST = 280, + UINT64_CONST = 281, + FLOAT_CONST = 282, + DOUBLE_CONST = 283, + DIMENSIONS = 284, + VARIABLES = 285, + NETCDF = 286, + DATA = 287, + TYPES = 288, + COMPOUND = 289, + ENUM = 290, + OPAQUE_ = 291, + OPAQUESTRING = 292, + GROUP = 293, + PATH = 294, + FILLMARKER = 295, + NIL = 296, + _FILLVALUE = 297, + _FORMAT = 298, + _STORAGE = 299, + _CHUNKSIZES = 300, + _DEFLATELEVEL = 301, + _SHUFFLE = 302, + _ENDIANNESS = 303, + _NOFILL = 304, + _FLETCHER32 = 305, + _NCPROPS = 306, + _ISNETCDF4 = 307, + _SUPERBLOCK = 308, + _FILTER = 309, + _CODECS = 310, + _QUANTIZEBG = 311, + _QUANTIZEGBR = 312, + _QUANTIZEBR = 313, + DATASETID = 314 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE { - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_NC_UNLIMITED_K = 3, /* NC_UNLIMITED_K */ - YYSYMBOL_CHAR_K = 4, /* CHAR_K */ - YYSYMBOL_BYTE_K = 5, /* BYTE_K */ - YYSYMBOL_SHORT_K = 6, /* SHORT_K */ - YYSYMBOL_INT_K = 7, /* INT_K */ - YYSYMBOL_FLOAT_K = 8, /* FLOAT_K */ - YYSYMBOL_DOUBLE_K = 9, /* DOUBLE_K */ - YYSYMBOL_UBYTE_K = 10, /* UBYTE_K */ - YYSYMBOL_USHORT_K = 11, /* USHORT_K */ - YYSYMBOL_UINT_K = 12, /* UINT_K */ - YYSYMBOL_INT64_K = 13, /* INT64_K */ - YYSYMBOL_UINT64_K = 14, /* UINT64_K */ - YYSYMBOL_STRING_K = 15, /* STRING_K */ - YYSYMBOL_IDENT = 16, /* IDENT */ - YYSYMBOL_TERMSTRING = 17, /* TERMSTRING */ - YYSYMBOL_CHAR_CONST = 18, /* CHAR_CONST */ - YYSYMBOL_BYTE_CONST = 19, /* BYTE_CONST */ - YYSYMBOL_SHORT_CONST = 20, /* SHORT_CONST */ - YYSYMBOL_INT_CONST = 21, /* INT_CONST */ - YYSYMBOL_INT64_CONST = 22, /* INT64_CONST */ - YYSYMBOL_UBYTE_CONST = 23, /* UBYTE_CONST */ - YYSYMBOL_USHORT_CONST = 24, /* USHORT_CONST */ - YYSYMBOL_UINT_CONST = 25, /* UINT_CONST */ - YYSYMBOL_UINT64_CONST = 26, /* UINT64_CONST */ - YYSYMBOL_FLOAT_CONST = 27, /* FLOAT_CONST */ - YYSYMBOL_DOUBLE_CONST = 28, /* DOUBLE_CONST */ - YYSYMBOL_DIMENSIONS = 29, /* DIMENSIONS */ - YYSYMBOL_VARIABLES = 30, /* VARIABLES */ - YYSYMBOL_NETCDF = 31, /* NETCDF */ - YYSYMBOL_DATA = 32, /* DATA */ - YYSYMBOL_TYPES = 33, /* TYPES */ - YYSYMBOL_COMPOUND = 34, /* COMPOUND */ - YYSYMBOL_ENUM = 35, /* ENUM */ - YYSYMBOL_OPAQUE_ = 36, /* OPAQUE_ */ - YYSYMBOL_OPAQUESTRING = 37, /* OPAQUESTRING */ - YYSYMBOL_GROUP = 38, /* GROUP */ - YYSYMBOL_PATH = 39, /* PATH */ - YYSYMBOL_FILLMARKER = 40, /* FILLMARKER */ - YYSYMBOL_NIL = 41, /* NIL */ - YYSYMBOL__FILLVALUE = 42, /* _FILLVALUE */ - YYSYMBOL__FORMAT = 43, /* _FORMAT */ - YYSYMBOL__STORAGE = 44, /* _STORAGE */ - YYSYMBOL__CHUNKSIZES = 45, /* _CHUNKSIZES */ - YYSYMBOL__DEFLATELEVEL = 46, /* _DEFLATELEVEL */ - YYSYMBOL__SHUFFLE = 47, /* _SHUFFLE */ - YYSYMBOL__ENDIANNESS = 48, /* _ENDIANNESS */ - YYSYMBOL__NOFILL = 49, /* _NOFILL */ - YYSYMBOL__FLETCHER32 = 50, /* _FLETCHER32 */ - YYSYMBOL__NCPROPS = 51, /* _NCPROPS */ - YYSYMBOL__ISNETCDF4 = 52, /* _ISNETCDF4 */ - YYSYMBOL__SUPERBLOCK = 53, /* _SUPERBLOCK */ - YYSYMBOL__FILTER = 54, /* _FILTER */ - YYSYMBOL__CODECS = 55, /* _CODECS */ - YYSYMBOL__QUANTIZEBG = 56, /* _QUANTIZEBG */ - YYSYMBOL__QUANTIZEGBR = 57, /* _QUANTIZEGBR */ - YYSYMBOL__QUANTIZEBR = 58, /* _QUANTIZEBR */ - YYSYMBOL_DATASETID = 59, /* DATASETID */ - YYSYMBOL_60_ = 60, /* '{' */ - YYSYMBOL_61_ = 61, /* '}' */ - YYSYMBOL_62_ = 62, /* ';' */ - YYSYMBOL_63_ = 63, /* ',' */ - YYSYMBOL_64_ = 64, /* '=' */ - YYSYMBOL_65_ = 65, /* '(' */ - YYSYMBOL_66_ = 66, /* ')' */ - YYSYMBOL_67_ = 67, /* '*' */ - YYSYMBOL_68_ = 68, /* ':' */ - YYSYMBOL_YYACCEPT = 69, /* $accept */ - YYSYMBOL_ncdesc = 70, /* ncdesc */ - YYSYMBOL_datasetid = 71, /* datasetid */ - YYSYMBOL_rootgroup = 72, /* rootgroup */ - YYSYMBOL_groupbody = 73, /* groupbody */ - YYSYMBOL_subgrouplist = 74, /* subgrouplist */ - YYSYMBOL_namedgroup = 75, /* namedgroup */ - YYSYMBOL_76_1 = 76, /* $@1 */ - YYSYMBOL_77_2 = 77, /* $@2 */ - YYSYMBOL_typesection = 78, /* typesection */ - YYSYMBOL_typedecls = 79, /* typedecls */ - YYSYMBOL_typename = 80, /* typename */ - YYSYMBOL_type_or_attr_decl = 81, /* type_or_attr_decl */ - YYSYMBOL_typedecl = 82, /* typedecl */ - YYSYMBOL_optsemicolon = 83, /* optsemicolon */ - YYSYMBOL_enumdecl = 84, /* enumdecl */ - YYSYMBOL_enumidlist = 85, /* enumidlist */ - YYSYMBOL_enumid = 86, /* enumid */ - YYSYMBOL_opaquedecl = 87, /* opaquedecl */ - YYSYMBOL_vlendecl = 88, /* vlendecl */ - YYSYMBOL_compounddecl = 89, /* compounddecl */ - YYSYMBOL_fields = 90, /* fields */ - YYSYMBOL_field = 91, /* field */ - YYSYMBOL_primtype = 92, /* primtype */ - YYSYMBOL_dimsection = 93, /* dimsection */ - YYSYMBOL_dimdecls = 94, /* dimdecls */ - YYSYMBOL_dim_or_attr_decl = 95, /* dim_or_attr_decl */ - YYSYMBOL_dimdeclist = 96, /* dimdeclist */ - YYSYMBOL_dimdecl = 97, /* dimdecl */ - YYSYMBOL_dimd = 98, /* dimd */ - YYSYMBOL_vasection = 99, /* vasection */ - YYSYMBOL_vadecls = 100, /* vadecls */ - YYSYMBOL_vadecl_or_attr = 101, /* vadecl_or_attr */ - YYSYMBOL_vardecl = 102, /* vardecl */ - YYSYMBOL_varlist = 103, /* varlist */ - YYSYMBOL_varspec = 104, /* varspec */ - YYSYMBOL_dimspec = 105, /* dimspec */ - YYSYMBOL_dimlist = 106, /* dimlist */ - YYSYMBOL_dimref = 107, /* dimref */ - YYSYMBOL_fieldlist = 108, /* fieldlist */ - YYSYMBOL_fieldspec = 109, /* fieldspec */ - YYSYMBOL_fielddimspec = 110, /* fielddimspec */ - YYSYMBOL_fielddimlist = 111, /* fielddimlist */ - YYSYMBOL_fielddim = 112, /* fielddim */ - YYSYMBOL_varref = 113, /* varref */ - YYSYMBOL_typeref = 114, /* typeref */ - YYSYMBOL_ambiguous_ref = 115, /* ambiguous_ref */ - YYSYMBOL_attrdecllist = 116, /* attrdecllist */ - YYSYMBOL_attrdecl = 117, /* attrdecl */ - YYSYMBOL_path = 118, /* path */ - YYSYMBOL_datasection = 119, /* datasection */ - YYSYMBOL_datadecls = 120, /* datadecls */ - YYSYMBOL_datadecl = 121, /* datadecl */ - YYSYMBOL_datalist = 122, /* datalist */ - YYSYMBOL_datalist0 = 123, /* datalist0 */ - YYSYMBOL_datalist1 = 124, /* datalist1 */ - YYSYMBOL_dataitem = 125, /* dataitem */ - YYSYMBOL_constdata = 126, /* constdata */ - YYSYMBOL_econstref = 127, /* econstref */ - YYSYMBOL_function = 128, /* function */ - YYSYMBOL_arglist = 129, /* arglist */ - YYSYMBOL_simpleconstant = 130, /* simpleconstant */ - YYSYMBOL_intlist = 131, /* intlist */ - YYSYMBOL_constint = 132, /* constint */ - YYSYMBOL_conststring = 133, /* conststring */ - YYSYMBOL_constbool = 134, /* constbool */ - YYSYMBOL_varident = 135, /* varident */ - YYSYMBOL_ident = 136 /* ident */ +#line 156 "ncgen.y" + +Symbol* sym; +unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ +size_t mark; /* track indices into the sequence*/ +int nctype; /* for tracking attribute list type*/ +Datalist* datalist; +NCConstant* constant; + +#line 341 "ncgen.tab.c" + }; -typedef enum yysymbol_kind_t yysymbol_kind_t; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE ncglval; +int ncgparse (void); + +#endif /* !YY_NCG_NCGEN_TAB_H_INCLUDED */ @@ -425,18 +391,6 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif -/* Work around bug in HP-UX 11.23, which defines these macros - incorrectly for preprocessor constants. This workaround can likely - be removed in 2023, as HPE has promised support for HP-UX 11.23 - (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of - . */ -#ifdef __hpux -# undef UINT_LEAST8_MAX -# undef UINT_LEAST16_MAX -# define UINT_LEAST8_MAX 255 -# define UINT_LEAST16_MAX 65535 -#endif - #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -496,7 +450,6 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; @@ -515,7 +468,6 @@ typedef int yy_state_fast_t; # endif #endif - #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -534,23 +486,17 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YY_USE(E) ((void) (E)) +# define YYUSE(E) ((void) (E)) #else -# define YY_USE(E) /* empty */ +# define YYUSE(E) /* empty */ #endif +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") -# else -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -579,7 +525,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if 1 +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -644,7 +590,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* 1 */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -720,16 +667,14 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 276 -/* YYMAXUTOK -- Last valid token kind. */ +#define YYUNDEFTOK 2 #define YYMAXUTOK 314 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ @@ -770,7 +715,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG -/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 243, 243, 249, 251, 258, 265, 265, 268, 277, @@ -792,33 +737,26 @@ static const yytype_int16 yyrline[] = }; #endif -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) - -#if 1 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; - +#if YYDEBUG || YYERROR_VERBOSE || 1 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "\"end of file\"", "error", "\"invalid token\"", "NC_UNLIMITED_K", - "CHAR_K", "BYTE_K", "SHORT_K", "INT_K", "FLOAT_K", "DOUBLE_K", "UBYTE_K", - "USHORT_K", "UINT_K", "INT64_K", "UINT64_K", "STRING_K", "IDENT", - "TERMSTRING", "CHAR_CONST", "BYTE_CONST", "SHORT_CONST", "INT_CONST", - "INT64_CONST", "UBYTE_CONST", "USHORT_CONST", "UINT_CONST", - "UINT64_CONST", "FLOAT_CONST", "DOUBLE_CONST", "DIMENSIONS", "VARIABLES", - "NETCDF", "DATA", "TYPES", "COMPOUND", "ENUM", "OPAQUE_", "OPAQUESTRING", - "GROUP", "PATH", "FILLMARKER", "NIL", "_FILLVALUE", "_FORMAT", - "_STORAGE", "_CHUNKSIZES", "_DEFLATELEVEL", "_SHUFFLE", "_ENDIANNESS", - "_NOFILL", "_FLETCHER32", "_NCPROPS", "_ISNETCDF4", "_SUPERBLOCK", - "_FILTER", "_CODECS", "_QUANTIZEBG", "_QUANTIZEGBR", "_QUANTIZEBR", - "DATASETID", "'{'", "'}'", "';'", "','", "'='", "'('", "')'", "'*'", - "':'", "$accept", "ncdesc", "datasetid", "rootgroup", "groupbody", - "subgrouplist", "namedgroup", "$@1", "$@2", "typesection", "typedecls", - "typename", "type_or_attr_decl", "typedecl", "optsemicolon", "enumdecl", + "$end", "error", "$undefined", "NC_UNLIMITED_K", "CHAR_K", "BYTE_K", + "SHORT_K", "INT_K", "FLOAT_K", "DOUBLE_K", "UBYTE_K", "USHORT_K", + "UINT_K", "INT64_K", "UINT64_K", "STRING_K", "IDENT", "TERMSTRING", + "CHAR_CONST", "BYTE_CONST", "SHORT_CONST", "INT_CONST", "INT64_CONST", + "UBYTE_CONST", "USHORT_CONST", "UINT_CONST", "UINT64_CONST", + "FLOAT_CONST", "DOUBLE_CONST", "DIMENSIONS", "VARIABLES", "NETCDF", + "DATA", "TYPES", "COMPOUND", "ENUM", "OPAQUE_", "OPAQUESTRING", "GROUP", + "PATH", "FILLMARKER", "NIL", "_FILLVALUE", "_FORMAT", "_STORAGE", + "_CHUNKSIZES", "_DEFLATELEVEL", "_SHUFFLE", "_ENDIANNESS", "_NOFILL", + "_FLETCHER32", "_NCPROPS", "_ISNETCDF4", "_SUPERBLOCK", "_FILTER", + "_CODECS", "_QUANTIZEBG", "_QUANTIZEGBR", "_QUANTIZEBR", "DATASETID", + "'{'", "'}'", "';'", "','", "'='", "'('", "')'", "'*'", "':'", "$accept", + "ncdesc", "datasetid", "rootgroup", "groupbody", "subgrouplist", + "namedgroup", "$@1", "$@2", "typesection", "typedecls", "typename", + "type_or_attr_decl", "typedecl", "optsemicolon", "enumdecl", "enumidlist", "enumid", "opaquedecl", "vlendecl", "compounddecl", "fields", "field", "primtype", "dimsection", "dimdecls", "dim_or_attr_decl", "dimdeclist", "dimdecl", "dimd", "vasection", @@ -830,13 +768,22 @@ static const char *const yytname[] = "constdata", "econstref", "function", "arglist", "simpleconstant", "intlist", "constint", "conststring", "constbool", "varident", "ident", YY_NULLPTR }; +#endif -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_int16 yytoknum[] = { - return yytname[yysymbol]; -} -#endif + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 123, 125, 59, 44, 61, 40, 41, 42, 58 +}; +# endif #define YYPACT_NINF (-153) @@ -848,8 +795,8 @@ yysymbol_name (yysymbol_kind_t yysymbol) #define yytable_value_is_error(Yyn) \ 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -10, -24, 30, -153, -18, -153, 233, -153, -153, -153, @@ -882,9 +829,9 @@ static const yytype_int16 yypact[] = 233, -3, -153, -153, -153, -153 }; -/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 3, 0, 1, 88, 2, 35, 36, @@ -917,7 +864,7 @@ static const yytype_uint8 yydefact[] = 88, 0, 79, 73, 10, 81 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -153, -153, -153, -153, 22, -6, -153, -153, -153, -153, @@ -929,10 +876,10 @@ static const yytype_int16 yypgoto[] = -153, -152, -153, -37, -29, 2, -153, -22 }; -/* YYDEFGOTO[NTERM-NUM]. */ + /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 2, 4, 7, 23, 36, 49, 195, 260, 40, + -1, 2, 4, 7, 23, 36, 49, 195, 260, 40, 67, 134, 68, 69, 139, 70, 233, 234, 71, 72, 73, 199, 200, 24, 78, 146, 147, 148, 149, 150, 154, 184, 185, 186, 215, 216, 240, 255, 256, 229, @@ -941,9 +888,9 @@ static const yytype_int16 yydefgoto[] = 193, 115, 163, 87, 88, 89, 217, 30 }; -/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 35, 79, 107, 75, 37, 194, 76, 178, 90, 74, @@ -1038,8 +985,8 @@ static const yytype_int16 yycheck[] = 39 }; -/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of - state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 31, 70, 59, 71, 0, 60, 72, 4, 5, @@ -1072,7 +1019,7 @@ static const yytype_uint8 yystos[] = 61, 63, 66, 107, 116, 112 }; -/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 69, 70, 71, 72, 73, 74, 74, 76, 77, @@ -1093,7 +1040,7 @@ static const yytype_uint8 yyr1[] = 132, 132, 132, 132, 133, 134, 134, 135, 135, 136 }; -/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 yyr2[] = { 0, 2, 3, 1, 4, 5, 0, 2, 0, 0, @@ -1115,15 +1062,14 @@ static const yytype_int8 yyr2[] = }; -enum { YYENOMEM = -2 }; - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1145,9 +1091,10 @@ enum { YYENOMEM = -2 }; } \ while (0) -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + /* Enable debugging if requested. */ @@ -1164,16 +1111,19 @@ do { \ YYFPRINTF Args; \ } while (0) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Kind, Value); \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -1184,15 +1134,18 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YY_USE (yyoutput); + YYUSE (yyoutput); if (!yyvaluep) return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); +# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1202,13 +1155,12 @@ yy_symbol_value_print (FILE *yyo, `---------------------------*/ static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyo, yykind, yyvaluep); + yy_symbol_value_print (yyo, yytype, yyvaluep); YYFPRINTF (yyo, ")"); } @@ -1241,8 +1193,7 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; @@ -1254,8 +1205,9 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)]); + yystos[+yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] + ); YYFPRINTF (stderr, "\n"); } } @@ -1270,8 +1222,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -1294,60 +1246,12 @@ int yydebug; #endif -/* Context of a parse error. */ -typedef struct -{ - yy_state_t *yyssp; - yysymbol_kind_t yytoken; -} yypcontext_t; - -/* Put in YYARG at most YYARGN of the expected tokens given the - current YYCTX, and return the number of tokens stored in YYARG. If - YYARG is null, return the number of expected tokens (guaranteed to - be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. - Return 0 if there are more than YYARGN expected tokens, yet fill - YYARG up to YYARGN. */ -static int -yypcontext_expected_tokens (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - 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; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); - } - } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; -} - - - +#if YYERROR_VERBOSE -#ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ static YYPTRDIFF_T yystrlen (const char *yystr) @@ -1357,13 +1261,13 @@ yystrlen (const char *yystr) continue; return yylen; } +# endif # endif -#endif -#ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * @@ -1377,10 +1281,10 @@ yystpcpy (char *yydest, const char *yysrc) return yyd - 1; } +# endif # endif -#endif -#ifndef yytnamerr +# ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string @@ -1395,6 +1299,7 @@ yytnamerr (char *yyres, const char *yystr) { YYPTRDIFF_T yyn = 0; char const *yyp = yystr; + for (;;) switch (*++yyp) { @@ -1428,15 +1333,31 @@ yytnamerr (char *yyres, const char *yystr) else return yystrlen (yystr); } -#endif +# 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 -yy_syntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + yy_state_t *yyssp, int yytoken) { + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Actual size of YYARG. */ int yycount = 0; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -1460,54 +1381,52 @@ yy_syntax_error_arguments (const yypcontext_t *yyctx, one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ - if (yyctx->yytoken != YYSYMBOL_YYEMPTY) + if (yytoken != YYEMPTY) { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens (yyctx, - yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; + int yyn = yypact[+*yyssp]; + YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + yysize = yysize0; + 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; + + 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]; + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + } + } } - return yycount; -} - -/* 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 YYENOMEM if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - const yypcontext_t *yyctx) -{ - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; switch (yycount) { -#define YYCASE_(N, S) \ +# define YYCASE_(N, S) \ case N: \ yyformat = S; \ - break + break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); @@ -1515,23 +1434,17 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, 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_ +# undef YYCASE_ } - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen (yyformat) - 2 * yycount + 1; { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } + /* Don't count the "%s"s in the final size, but reserve room for + the terminator. */ + YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; } if (*yymsg_alloc < yysize) @@ -1540,7 +1453,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; + return 1; } /* Avoid sprintf, as that infringes on the user's name space. @@ -1552,7 +1465,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else @@ -1563,28 +1476,29 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, } return 0; } - +#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { - YY_USE (yyvaluep); + YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE (yykind); + YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Lookahead token kind. */ + + +/* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1593,8 +1507,6 @@ YYSTYPE yylval; int yynerrs; - - /*----------. | yyparse. | `----------*/ @@ -1602,39 +1514,43 @@ int yynerrs; int yyparse (void) { - yy_state_fast_t yystate = 0; + yy_state_fast_t yystate; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; + int yyerrstatus; - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The state stack: array, bottom, top. */ + /* The state stack. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; + yy_state_t *yyss; + yy_state_t *yyssp; - /* The semantic value stack: array, bottom, top. */ + /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYPTRDIFF_T yystacksize; int yyn; - /* The return value of yyparse. */ int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; +#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1642,10 +1558,16 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; @@ -1667,11 +1589,10 @@ yyparse (void) YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1699,7 +1620,7 @@ yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - YYNOMEM; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1710,10 +1631,10 @@ yyparse (void) YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - YYNOMEM; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1732,7 +1653,6 @@ yyparse (void) } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - if (yystate == YYFINAL) YYACCEPT; @@ -1753,29 +1673,18 @@ yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token\n")); + YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; - } else { yytoken = YYTRANSLATE (yychar); @@ -1844,19 +1753,19 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: /* ncdesc: NETCDF datasetid rootgroup */ + case 2: #line 246 "ncgen.y" {if (error_count > 0) YYABORT;} -#line 1851 "ncgeny.c" +#line 1760 "ncgen.tab.c" break; - case 3: /* datasetid: DATASETID */ + case 3: #line 249 "ncgen.y" {createrootgroup(datasetname);} -#line 1857 "ncgeny.c" +#line 1766 "ncgen.tab.c" break; - case 8: /* $@1: %empty */ + case 8: #line 268 "ncgen.y" { Symbol* id = (yyvsp[-1].sym); @@ -1865,28 +1774,28 @@ yyparse (void) yyerror("duplicate group declaration within parent group for %s", id->name); } -#line 1869 "ncgeny.c" +#line 1778 "ncgen.tab.c" break; - case 9: /* $@2: %empty */ + case 9: #line 277 "ncgen.y" {listpop(groupstack);} -#line 1875 "ncgeny.c" +#line 1784 "ncgen.tab.c" break; - case 12: /* typesection: TYPES */ + case 12: #line 283 "ncgen.y" {} -#line 1881 "ncgeny.c" +#line 1790 "ncgen.tab.c" break; - case 13: /* typesection: TYPES typedecls */ + case 13: #line 285 "ncgen.y" {markcdf4("Type specification");} -#line 1887 "ncgeny.c" +#line 1796 "ncgen.tab.c" break; - case 16: /* typename: ident */ + case 16: #line 291 "ncgen.y" { /* Use when defining a type */ (yyvsp[0].sym)->objectclass = NC_TYPE; @@ -1895,22 +1804,22 @@ yyparse (void) (yyvsp[0].sym)->name); listpush(typdefs,(void*)(yyvsp[0].sym)); } -#line 1899 "ncgeny.c" +#line 1808 "ncgen.tab.c" break; - case 17: /* type_or_attr_decl: typedecl */ + case 17: #line 300 "ncgen.y" {} -#line 1905 "ncgeny.c" +#line 1814 "ncgen.tab.c" break; - case 18: /* type_or_attr_decl: attrdecl ';' */ + case 18: #line 300 "ncgen.y" {} -#line 1911 "ncgeny.c" +#line 1820 "ncgen.tab.c" break; - case 25: /* enumdecl: primtype ENUM typename '{' enumidlist '}' */ + case 25: #line 314 "ncgen.y" { size_t i; @@ -1938,16 +1847,16 @@ yyparse (void) } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 1942 "ncgeny.c" +#line 1851 "ncgen.tab.c" break; - case 26: /* enumidlist: enumid */ + case 26: #line 343 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 1948 "ncgeny.c" +#line 1857 "ncgen.tab.c" break; - case 27: /* enumidlist: enumidlist ',' enumid */ + case 27: #line 345 "ncgen.y" { size_t i; @@ -1963,10 +1872,10 @@ yyparse (void) } listpush(stack,(void*)(yyvsp[0].sym)); } -#line 1967 "ncgeny.c" +#line 1876 "ncgen.tab.c" break; - case 28: /* enumid: ident '=' constint */ + case 28: #line 362 "ncgen.y" { (yyvsp[-2].sym)->objectclass=NC_TYPE; @@ -1974,10 +1883,10 @@ yyparse (void) (yyvsp[-2].sym)->typ.econst=(yyvsp[0].constant); (yyval.sym)=(yyvsp[-2].sym); } -#line 1978 "ncgeny.c" +#line 1887 "ncgen.tab.c" break; - case 29: /* opaquedecl: OPAQUE_ '(' INT_CONST ')' typename */ + case 29: #line 371 "ncgen.y" { vercheck(NC_OPAQUE); @@ -1988,10 +1897,10 @@ yyparse (void) (yyvsp[0].sym)->typ.size=(size_t)int32_val; (void)ncaux_class_alignment(NC_OPAQUE,&(yyvsp[0].sym)->typ.alignment); } -#line 1992 "ncgeny.c" +#line 1901 "ncgen.tab.c" break; - case 30: /* vlendecl: typeref '(' '*' ')' typename */ + case 30: #line 383 "ncgen.y" { Symbol* basetype = (yyvsp[-4].sym); @@ -2004,10 +1913,10 @@ yyparse (void) (yyvsp[0].sym)->typ.size=VLENSIZE; (void)ncaux_class_alignment(NC_VLEN,&(yyvsp[0].sym)->typ.alignment); } -#line 2008 "ncgeny.c" +#line 1917 "ncgen.tab.c" break; - case 31: /* compounddecl: COMPOUND typename '{' fields '}' */ + case 31: #line 397 "ncgen.y" { size_t i,j; @@ -2038,22 +1947,22 @@ yyparse (void) } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 2042 "ncgeny.c" +#line 1951 "ncgen.tab.c" break; - case 32: /* fields: field ';' */ + case 32: #line 429 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 2048 "ncgeny.c" +#line 1957 "ncgen.tab.c" break; - case 33: /* fields: fields field ';' */ + case 33: #line 430 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark);} -#line 2054 "ncgeny.c" +#line 1963 "ncgen.tab.c" break; - case 34: /* field: typeref fieldlist */ + case 34: #line 434 "ncgen.y" { size_t i; @@ -2066,106 +1975,106 @@ yyparse (void) f->typ.basetype = (yyvsp[-1].sym); } } -#line 2070 "ncgeny.c" +#line 1979 "ncgen.tab.c" break; - case 35: /* primtype: CHAR_K */ + case 35: #line 447 "ncgen.y" { (yyval.sym) = primsymbols[NC_CHAR]; } -#line 2076 "ncgeny.c" +#line 1985 "ncgen.tab.c" break; - case 36: /* primtype: BYTE_K */ + case 36: #line 448 "ncgen.y" { (yyval.sym) = primsymbols[NC_BYTE]; } -#line 2082 "ncgeny.c" +#line 1991 "ncgen.tab.c" break; - case 37: /* primtype: SHORT_K */ + case 37: #line 449 "ncgen.y" { (yyval.sym) = primsymbols[NC_SHORT]; } -#line 2088 "ncgeny.c" +#line 1997 "ncgen.tab.c" break; - case 38: /* primtype: INT_K */ + case 38: #line 450 "ncgen.y" { (yyval.sym) = primsymbols[NC_INT]; } -#line 2094 "ncgeny.c" +#line 2003 "ncgen.tab.c" break; - case 39: /* primtype: FLOAT_K */ + case 39: #line 451 "ncgen.y" { (yyval.sym) = primsymbols[NC_FLOAT]; } -#line 2100 "ncgeny.c" +#line 2009 "ncgen.tab.c" break; - case 40: /* primtype: DOUBLE_K */ + case 40: #line 452 "ncgen.y" { (yyval.sym) = primsymbols[NC_DOUBLE]; } -#line 2106 "ncgeny.c" +#line 2015 "ncgen.tab.c" break; - case 41: /* primtype: UBYTE_K */ + case 41: #line 453 "ncgen.y" { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; } -#line 2112 "ncgeny.c" +#line 2021 "ncgen.tab.c" break; - case 42: /* primtype: USHORT_K */ + case 42: #line 454 "ncgen.y" { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; } -#line 2118 "ncgeny.c" +#line 2027 "ncgen.tab.c" break; - case 43: /* primtype: UINT_K */ + case 43: #line 455 "ncgen.y" { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; } -#line 2124 "ncgeny.c" +#line 2033 "ncgen.tab.c" break; - case 44: /* primtype: INT64_K */ + case 44: #line 456 "ncgen.y" { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; } -#line 2130 "ncgeny.c" +#line 2039 "ncgen.tab.c" break; - case 45: /* primtype: UINT64_K */ + case 45: #line 457 "ncgen.y" { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; } -#line 2136 "ncgeny.c" +#line 2045 "ncgen.tab.c" break; - case 46: /* primtype: STRING_K */ + case 46: #line 458 "ncgen.y" { vercheck(NC_STRING); (yyval.sym) = primsymbols[NC_STRING]; } -#line 2142 "ncgeny.c" +#line 2051 "ncgen.tab.c" break; - case 48: /* dimsection: DIMENSIONS */ + case 48: #line 462 "ncgen.y" {} -#line 2148 "ncgeny.c" +#line 2057 "ncgen.tab.c" break; - case 49: /* dimsection: DIMENSIONS dimdecls */ + case 49: #line 463 "ncgen.y" {} -#line 2154 "ncgeny.c" +#line 2063 "ncgen.tab.c" break; - case 52: /* dim_or_attr_decl: dimdeclist */ + case 52: #line 470 "ncgen.y" {} -#line 2160 "ncgeny.c" +#line 2069 "ncgen.tab.c" break; - case 53: /* dim_or_attr_decl: attrdecl */ + case 53: #line 470 "ncgen.y" {} -#line 2166 "ncgeny.c" +#line 2075 "ncgen.tab.c" break; - case 56: /* dimdecl: dimd '=' constint */ + case 56: #line 478 "ncgen.y" { (yyvsp[-2].sym)->dim.declsize = (size_t)extractint((yyvsp[0].constant)); @@ -2174,10 +2083,10 @@ fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long lon #endif reclaimconstant((yyvsp[0].constant)); } -#line 2178 "ncgeny.c" +#line 2087 "ncgen.tab.c" break; - case 57: /* dimdecl: dimd '=' NC_UNLIMITED_K */ + case 57: #line 486 "ncgen.y" { (yyvsp[-2].sym)->dim.declsize = NC_UNLIMITED; @@ -2186,10 +2095,10 @@ fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long lon fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); #endif } -#line 2190 "ncgeny.c" +#line 2099 "ncgen.tab.c" break; - case 58: /* dimd: ident */ + case 58: #line 496 "ncgen.y" { (yyvsp[0].sym)->objectclass=NC_DIM; @@ -2200,34 +2109,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)=(yyvsp[0].sym); listpush(dimdefs,(void*)(yyvsp[0].sym)); } -#line 2204 "ncgeny.c" +#line 2113 "ncgen.tab.c" break; - case 60: /* vasection: VARIABLES */ + case 60: #line 508 "ncgen.y" {} -#line 2210 "ncgeny.c" +#line 2119 "ncgen.tab.c" break; - case 61: /* vasection: VARIABLES vadecls */ + case 61: #line 509 "ncgen.y" {} -#line 2216 "ncgeny.c" +#line 2125 "ncgen.tab.c" break; - case 64: /* vadecl_or_attr: vardecl */ + case 64: #line 516 "ncgen.y" {} -#line 2222 "ncgeny.c" +#line 2131 "ncgen.tab.c" break; - case 65: /* vadecl_or_attr: attrdecl */ + case 65: #line 516 "ncgen.y" {} -#line 2228 "ncgeny.c" +#line 2137 "ncgen.tab.c" break; - case 66: /* vardecl: typeref varlist */ + case 66: #line 519 "ncgen.y" { size_t i; @@ -2248,24 +2157,24 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 2252 "ncgeny.c" +#line 2161 "ncgen.tab.c" break; - case 67: /* varlist: varspec */ + case 67: #line 541 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym)); } -#line 2260 "ncgeny.c" +#line 2169 "ncgen.tab.c" break; - case 68: /* varlist: varlist ',' varspec */ + case 68: #line 545 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2266 "ncgeny.c" +#line 2175 "ncgen.tab.c" break; - case 69: /* varspec: varident dimspec */ + case 69: #line 549 "ncgen.y" { size_t i; @@ -2293,34 +2202,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); listsetlength(stack,stackbase);/* remove stack nodes*/ (yyval.sym) = var; } -#line 2297 "ncgeny.c" +#line 2206 "ncgen.tab.c" break; - case 70: /* dimspec: %empty */ + case 70: #line 577 "ncgen.y" {(yyval.mark)=listlength(stack);} -#line 2303 "ncgeny.c" +#line 2212 "ncgen.tab.c" break; - case 71: /* dimspec: '(' dimlist ')' */ + case 71: #line 578 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 2309 "ncgeny.c" +#line 2218 "ncgen.tab.c" break; - case 72: /* dimlist: dimref */ + case 72: #line 581 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2315 "ncgeny.c" +#line 2224 "ncgen.tab.c" break; - case 73: /* dimlist: dimlist ',' dimref */ + case 73: #line 583 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2321 "ncgeny.c" +#line 2230 "ncgen.tab.c" break; - case 74: /* dimref: path */ + case 74: #line 587 "ncgen.y" {Symbol* dimsym = (yyvsp[0].sym); dimsym->objectclass = NC_DIM; @@ -2332,24 +2241,24 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=dimsym; } -#line 2336 "ncgeny.c" +#line 2245 "ncgen.tab.c" break; - case 75: /* fieldlist: fieldspec */ + case 75: #line 601 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym)); } -#line 2344 "ncgeny.c" +#line 2253 "ncgen.tab.c" break; - case 76: /* fieldlist: fieldlist ',' fieldspec */ + case 76: #line 605 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2350 "ncgeny.c" +#line 2259 "ncgen.tab.c" break; - case 77: /* fieldspec: ident fielddimspec */ + case 77: #line 610 "ncgen.y" { size_t i; @@ -2377,34 +2286,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); listsetlength(stack,stackbase);/* remove stack nodes*/ (yyval.sym) = (yyvsp[-1].sym); } -#line 2381 "ncgeny.c" +#line 2290 "ncgen.tab.c" break; - case 78: /* fielddimspec: %empty */ + case 78: #line 638 "ncgen.y" {(yyval.mark)=listlength(stack);} -#line 2387 "ncgeny.c" +#line 2296 "ncgen.tab.c" break; - case 79: /* fielddimspec: '(' fielddimlist ')' */ + case 79: #line 639 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 2393 "ncgeny.c" +#line 2302 "ncgen.tab.c" break; - case 80: /* fielddimlist: fielddim */ + case 80: #line 643 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2399 "ncgeny.c" +#line 2308 "ncgen.tab.c" break; - case 81: /* fielddimlist: fielddimlist ',' fielddim */ + case 81: #line 645 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2405 "ncgeny.c" +#line 2314 "ncgen.tab.c" break; - case 82: /* fielddim: UINT_CONST */ + case 82: #line 650 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2415,10 +2324,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = uint32_val; } -#line 2419 "ncgeny.c" +#line 2328 "ncgen.tab.c" break; - case 83: /* fielddim: INT_CONST */ + case 83: #line 660 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2433,10 +2342,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = (size_t)int32_val; } -#line 2437 "ncgeny.c" +#line 2346 "ncgen.tab.c" break; - case 84: /* varref: ambiguous_ref */ + case 84: #line 680 "ncgen.y" {Symbol* vsym = (yyvsp[0].sym); if(vsym->objectclass != NC_VAR) { @@ -2445,10 +2354,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=vsym; } -#line 2449 "ncgeny.c" +#line 2358 "ncgen.tab.c" break; - case 85: /* typeref: ambiguous_ref */ + case 85: #line 691 "ncgen.y" {Symbol* tsym = (yyvsp[0].sym); if(tsym->objectclass != NC_TYPE) { @@ -2457,10 +2366,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=tsym; } -#line 2461 "ncgeny.c" +#line 2370 "ncgen.tab.c" break; - case 86: /* ambiguous_ref: path */ + case 86: #line 702 "ncgen.y" {Symbol* tvsym = (yyvsp[0].sym); Symbol* sym; /* disambiguate*/ @@ -2480,52 +2389,52 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=tvsym; } -#line 2484 "ncgeny.c" +#line 2393 "ncgen.tab.c" break; - case 87: /* ambiguous_ref: primtype */ + case 87: #line 720 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2490 "ncgeny.c" +#line 2399 "ncgen.tab.c" break; - case 88: /* attrdecllist: %empty */ + case 88: #line 727 "ncgen.y" {} -#line 2496 "ncgeny.c" +#line 2405 "ncgen.tab.c" break; - case 89: /* attrdecllist: attrdecl ';' attrdecllist */ + case 89: #line 727 "ncgen.y" {} -#line 2502 "ncgeny.c" +#line 2411 "ncgen.tab.c" break; - case 90: /* attrdecl: ':' _NCPROPS '=' conststring */ + case 90: #line 731 "ncgen.y" {(yyval.sym) = makespecial(_NCPROPS_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2508 "ncgeny.c" +#line 2417 "ncgen.tab.c" break; - case 91: /* attrdecl: ':' _ISNETCDF4 '=' constbool */ + case 91: #line 733 "ncgen.y" {(yyval.sym) = makespecial(_ISNETCDF4_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2514 "ncgeny.c" +#line 2423 "ncgen.tab.c" break; - case 92: /* attrdecl: ':' _SUPERBLOCK '=' constint */ + case 92: #line 735 "ncgen.y" {(yyval.sym) = makespecial(_SUPERBLOCK_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2520 "ncgeny.c" +#line 2429 "ncgen.tab.c" break; - case 93: /* attrdecl: ':' ident '=' datalist */ + case 93: #line 737 "ncgen.y" { (yyval.sym)=makeattribute((yyvsp[-2].sym),NULL,NULL,(yyvsp[0].datalist),ATTRGLOBAL);} -#line 2526 "ncgeny.c" +#line 2435 "ncgen.tab.c" break; - case 94: /* attrdecl: typeref ambiguous_ref ':' ident '=' datalist */ + case 94: #line 739 "ncgen.y" {Symbol* tsym = (yyvsp[-5].sym); Symbol* vsym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym); if(vsym->objectclass == NC_VAR) { @@ -2535,10 +2444,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); YYABORT; } } -#line 2539 "ncgeny.c" +#line 2448 "ncgen.tab.c" break; - case 95: /* attrdecl: ambiguous_ref ':' ident '=' datalist */ + case 95: #line 748 "ncgen.y" {Symbol* sym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym); if(sym->objectclass == NC_VAR) { @@ -2550,100 +2459,100 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); YYABORT; } } -#line 2554 "ncgeny.c" +#line 2463 "ncgen.tab.c" break; - case 96: /* attrdecl: ambiguous_ref ':' _FILLVALUE '=' datalist */ + case 96: #line 759 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);} -#line 2560 "ncgeny.c" +#line 2469 "ncgen.tab.c" break; - case 97: /* attrdecl: typeref ambiguous_ref ':' _FILLVALUE '=' datalist */ + case 97: #line 761 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),(yyvsp[-5].sym),(void*)(yyvsp[0].datalist),ISLIST);} -#line 2566 "ncgeny.c" +#line 2475 "ncgen.tab.c" break; - case 98: /* attrdecl: ambiguous_ref ':' _STORAGE '=' conststring */ + case 98: #line 763 "ncgen.y" {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2572 "ncgeny.c" +#line 2481 "ncgen.tab.c" break; - case 99: /* attrdecl: ambiguous_ref ':' _CHUNKSIZES '=' intlist */ + case 99: #line 765 "ncgen.y" {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);} -#line 2578 "ncgeny.c" +#line 2487 "ncgen.tab.c" break; - case 100: /* attrdecl: ambiguous_ref ':' _FLETCHER32 '=' constbool */ + case 100: #line 767 "ncgen.y" {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2584 "ncgeny.c" +#line 2493 "ncgen.tab.c" break; - case 101: /* attrdecl: ambiguous_ref ':' _DEFLATELEVEL '=' constint */ + case 101: #line 769 "ncgen.y" {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2590 "ncgeny.c" +#line 2499 "ncgen.tab.c" break; - case 102: /* attrdecl: ambiguous_ref ':' _SHUFFLE '=' constbool */ + case 102: #line 771 "ncgen.y" {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2596 "ncgeny.c" +#line 2505 "ncgen.tab.c" break; - case 103: /* attrdecl: ambiguous_ref ':' _ENDIANNESS '=' conststring */ + case 103: #line 773 "ncgen.y" {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2602 "ncgeny.c" +#line 2511 "ncgen.tab.c" break; - case 104: /* attrdecl: ambiguous_ref ':' _FILTER '=' conststring */ + case 104: #line 775 "ncgen.y" {(yyval.sym) = makespecial(_FILTER_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2608 "ncgeny.c" +#line 2517 "ncgen.tab.c" break; - case 105: /* attrdecl: ambiguous_ref ':' _CODECS '=' conststring */ + case 105: #line 777 "ncgen.y" {(yyval.sym) = makespecial(_CODECS_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2614 "ncgeny.c" +#line 2523 "ncgen.tab.c" break; - case 106: /* attrdecl: ambiguous_ref ':' _QUANTIZEBG '=' constint */ + case 106: #line 779 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEBG_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2620 "ncgeny.c" +#line 2529 "ncgen.tab.c" break; - case 107: /* attrdecl: ambiguous_ref ':' _QUANTIZEGBR '=' constint */ + case 107: #line 781 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEGBR_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2626 "ncgeny.c" +#line 2535 "ncgen.tab.c" break; - case 108: /* attrdecl: ambiguous_ref ':' _QUANTIZEBR '=' constint */ + case 108: #line 783 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEBR_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2632 "ncgeny.c" +#line 2541 "ncgen.tab.c" break; - case 109: /* attrdecl: ambiguous_ref ':' _NOFILL '=' constbool */ + case 109: #line 785 "ncgen.y" {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2638 "ncgeny.c" +#line 2547 "ncgen.tab.c" break; - case 110: /* attrdecl: ':' _FORMAT '=' conststring */ + case 110: #line 787 "ncgen.y" {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2644 "ncgeny.c" +#line 2553 "ncgen.tab.c" break; - case 111: /* path: ident */ + case 111: #line 792 "ncgen.y" { (yyval.sym)=(yyvsp[0].sym); @@ -2651,10 +2560,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyvsp[0].sym)->is_prefixed=0; setpathcurrent((yyvsp[0].sym)); } -#line 2655 "ncgeny.c" +#line 2564 "ncgen.tab.c" break; - case 112: /* path: PATH */ + case 112: #line 799 "ncgen.y" { (yyval.sym)=(yyvsp[0].sym); @@ -2662,269 +2571,269 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyvsp[0].sym)->is_prefixed=1; /* path is set in ncgen.l*/ } -#line 2666 "ncgeny.c" +#line 2575 "ncgen.tab.c" break; - case 114: /* datasection: DATA */ + case 114: #line 808 "ncgen.y" {} -#line 2672 "ncgeny.c" +#line 2581 "ncgen.tab.c" break; - case 115: /* datasection: DATA datadecls */ + case 115: #line 809 "ncgen.y" {} -#line 2678 "ncgeny.c" +#line 2587 "ncgen.tab.c" break; - case 118: /* datadecl: varref '=' datalist */ + case 118: #line 817 "ncgen.y" {(yyvsp[-2].sym)->data = (yyvsp[0].datalist);} -#line 2684 "ncgeny.c" +#line 2593 "ncgen.tab.c" break; - case 119: /* datalist: datalist0 */ + case 119: #line 820 "ncgen.y" {(yyval.datalist) = (yyvsp[0].datalist);} -#line 2690 "ncgeny.c" +#line 2599 "ncgen.tab.c" break; - case 120: /* datalist: datalist1 */ + case 120: #line 821 "ncgen.y" {(yyval.datalist) = (yyvsp[0].datalist);} -#line 2696 "ncgeny.c" +#line 2605 "ncgen.tab.c" break; - case 121: /* datalist0: %empty */ + case 121: #line 825 "ncgen.y" {(yyval.datalist) = builddatalist(0);} -#line 2702 "ncgeny.c" +#line 2611 "ncgen.tab.c" break; - case 122: /* datalist1: dataitem */ + case 122: #line 829 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2708 "ncgeny.c" +#line 2617 "ncgen.tab.c" break; - case 123: /* datalist1: datalist ',' dataitem */ + case 123: #line 831 "ncgen.y" {dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist); } -#line 2714 "ncgeny.c" +#line 2623 "ncgen.tab.c" break; - case 124: /* dataitem: constdata */ + case 124: #line 835 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2720 "ncgeny.c" +#line 2629 "ncgen.tab.c" break; - case 125: /* dataitem: '{' datalist '}' */ + case 125: #line 836 "ncgen.y" {(yyval.constant)=builddatasublist((yyvsp[-1].datalist));} -#line 2726 "ncgeny.c" +#line 2635 "ncgen.tab.c" break; - case 126: /* constdata: simpleconstant */ + case 126: #line 840 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2732 "ncgeny.c" +#line 2641 "ncgen.tab.c" break; - case 127: /* constdata: OPAQUESTRING */ + case 127: #line 841 "ncgen.y" {(yyval.constant)=makeconstdata(NC_OPAQUE);} -#line 2738 "ncgeny.c" +#line 2647 "ncgen.tab.c" break; - case 128: /* constdata: FILLMARKER */ + case 128: #line 842 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FILLVALUE);} -#line 2744 "ncgeny.c" +#line 2653 "ncgen.tab.c" break; - case 129: /* constdata: NIL */ + case 129: #line 843 "ncgen.y" {(yyval.constant)=makeconstdata(NC_NIL);} -#line 2750 "ncgeny.c" +#line 2659 "ncgen.tab.c" break; - case 130: /* constdata: econstref */ + case 130: #line 844 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2756 "ncgeny.c" +#line 2665 "ncgen.tab.c" break; - case 132: /* econstref: path */ + case 132: #line 849 "ncgen.y" {(yyval.constant) = makeenumconstref((yyvsp[0].sym));} -#line 2762 "ncgeny.c" +#line 2671 "ncgen.tab.c" break; - case 133: /* function: ident '(' arglist ')' */ + case 133: #line 853 "ncgen.y" {(yyval.constant)=evaluate((yyvsp[-3].sym),(yyvsp[-1].datalist));} -#line 2768 "ncgeny.c" +#line 2677 "ncgen.tab.c" break; - case 134: /* arglist: simpleconstant */ + case 134: #line 858 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2774 "ncgeny.c" +#line 2683 "ncgen.tab.c" break; - case 135: /* arglist: arglist ',' simpleconstant */ + case 135: #line 860 "ncgen.y" {dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist);} -#line 2780 "ncgeny.c" +#line 2689 "ncgen.tab.c" break; - case 136: /* simpleconstant: CHAR_CONST */ + case 136: #line 864 "ncgen.y" {(yyval.constant)=makeconstdata(NC_CHAR);} -#line 2786 "ncgeny.c" +#line 2695 "ncgen.tab.c" break; - case 137: /* simpleconstant: BYTE_CONST */ + case 137: #line 865 "ncgen.y" {(yyval.constant)=makeconstdata(NC_BYTE);} -#line 2792 "ncgeny.c" +#line 2701 "ncgen.tab.c" break; - case 138: /* simpleconstant: SHORT_CONST */ + case 138: #line 866 "ncgen.y" {(yyval.constant)=makeconstdata(NC_SHORT);} -#line 2798 "ncgeny.c" +#line 2707 "ncgen.tab.c" break; - case 139: /* simpleconstant: INT_CONST */ + case 139: #line 867 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} -#line 2804 "ncgeny.c" +#line 2713 "ncgen.tab.c" break; - case 140: /* simpleconstant: INT64_CONST */ + case 140: #line 868 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} -#line 2810 "ncgeny.c" +#line 2719 "ncgen.tab.c" break; - case 141: /* simpleconstant: UBYTE_CONST */ + case 141: #line 869 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UBYTE);} -#line 2816 "ncgeny.c" +#line 2725 "ncgen.tab.c" break; - case 142: /* simpleconstant: USHORT_CONST */ + case 142: #line 870 "ncgen.y" {(yyval.constant)=makeconstdata(NC_USHORT);} -#line 2822 "ncgeny.c" +#line 2731 "ncgen.tab.c" break; - case 143: /* simpleconstant: UINT_CONST */ + case 143: #line 871 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} -#line 2828 "ncgeny.c" +#line 2737 "ncgen.tab.c" break; - case 144: /* simpleconstant: UINT64_CONST */ + case 144: #line 872 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} -#line 2834 "ncgeny.c" +#line 2743 "ncgen.tab.c" break; - case 145: /* simpleconstant: FLOAT_CONST */ + case 145: #line 873 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FLOAT);} -#line 2840 "ncgeny.c" +#line 2749 "ncgen.tab.c" break; - case 146: /* simpleconstant: DOUBLE_CONST */ + case 146: #line 874 "ncgen.y" {(yyval.constant)=makeconstdata(NC_DOUBLE);} -#line 2846 "ncgeny.c" +#line 2755 "ncgen.tab.c" break; - case 147: /* simpleconstant: TERMSTRING */ + case 147: #line 875 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} -#line 2852 "ncgeny.c" +#line 2761 "ncgen.tab.c" break; - case 148: /* intlist: constint */ + case 148: #line 879 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2858 "ncgeny.c" +#line 2767 "ncgen.tab.c" break; - case 149: /* intlist: intlist ',' constint */ + case 149: #line 880 "ncgen.y" {(yyval.datalist)=(yyvsp[-2].datalist); dlappend((yyvsp[-2].datalist),((yyvsp[0].constant)));} -#line 2864 "ncgeny.c" +#line 2773 "ncgen.tab.c" break; - case 150: /* constint: INT_CONST */ + case 150: #line 885 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} -#line 2870 "ncgeny.c" +#line 2779 "ncgen.tab.c" break; - case 151: /* constint: UINT_CONST */ + case 151: #line 887 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} -#line 2876 "ncgeny.c" +#line 2785 "ncgen.tab.c" break; - case 152: /* constint: INT64_CONST */ + case 152: #line 889 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} -#line 2882 "ncgeny.c" +#line 2791 "ncgen.tab.c" break; - case 153: /* constint: UINT64_CONST */ + case 153: #line 891 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} -#line 2888 "ncgeny.c" +#line 2797 "ncgen.tab.c" break; - case 154: /* conststring: TERMSTRING */ + case 154: #line 895 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} -#line 2894 "ncgeny.c" +#line 2803 "ncgen.tab.c" break; - case 155: /* constbool: conststring */ + case 155: #line 899 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2900 "ncgeny.c" +#line 2809 "ncgen.tab.c" break; - case 156: /* constbool: constint */ + case 156: #line 900 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2906 "ncgeny.c" +#line 2815 "ncgen.tab.c" break; - case 157: /* varident: IDENT */ + case 157: #line 908 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2912 "ncgeny.c" +#line 2821 "ncgen.tab.c" break; - case 158: /* varident: DATA */ + case 158: #line 909 "ncgen.y" {(yyval.sym)=identkeyword((yyvsp[0].sym));} -#line 2918 "ncgeny.c" +#line 2827 "ncgen.tab.c" break; - case 159: /* ident: IDENT */ + case 159: #line 913 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2924 "ncgeny.c" +#line 2833 "ncgen.tab.c" break; -#line 2928 "ncgeny.c" +#line 2837 "ncgen.tab.c" default: break; } @@ -2939,10 +2848,11 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2966,44 +2876,50 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - yypcontext_t yyctx - = {yyssp, yytoken}; char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; - yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; - else if (yysyntax_error_status == -1) + else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (yymsg) + yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (!yymsg) { - yysyntax_error_status - = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; } else { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; } } yyerror (yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR +#endif } + + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -3036,7 +2952,6 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; - ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -3053,14 +2968,13 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ - /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) @@ -3074,7 +2988,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -3086,7 +3000,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -3097,7 +3011,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturnlab; + goto yyreturn; /*-----------------------------------. @@ -3105,22 +3019,24 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturnlab; + goto yyreturn; -/*-----------------------------------------------------------. -| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | -`-----------------------------------------------------------*/ +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturnlab; + /* Fall through. */ +#endif -/*----------------------------------------------------------. -| yyreturnlab -- parsing is finished, clean up and return. | -`----------------------------------------------------------*/ -yyreturnlab: +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ +yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -3136,18 +3052,19 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); + yystos[+*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif +#if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); +#endif return yyresult; } - #line 916 "ncgen.y" diff --git a/ncgen/ncgen.tab.h b/ncgen/ncgen.tab.h new file mode 100644 index 0000000000..2cc18ba6f3 --- /dev/null +++ b/ncgen/ncgen.tab.h @@ -0,0 +1,138 @@ +/* A Bison parser, made by GNU Bison 3.5.1. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +#ifndef YY_NCG_NCGEN_TAB_H_INCLUDED +# define YY_NCG_NCGEN_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int ncgdebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + NC_UNLIMITED_K = 258, + CHAR_K = 259, + BYTE_K = 260, + SHORT_K = 261, + INT_K = 262, + FLOAT_K = 263, + DOUBLE_K = 264, + UBYTE_K = 265, + USHORT_K = 266, + UINT_K = 267, + INT64_K = 268, + UINT64_K = 269, + STRING_K = 270, + IDENT = 271, + TERMSTRING = 272, + CHAR_CONST = 273, + BYTE_CONST = 274, + SHORT_CONST = 275, + INT_CONST = 276, + INT64_CONST = 277, + UBYTE_CONST = 278, + USHORT_CONST = 279, + UINT_CONST = 280, + UINT64_CONST = 281, + FLOAT_CONST = 282, + DOUBLE_CONST = 283, + DIMENSIONS = 284, + VARIABLES = 285, + NETCDF = 286, + DATA = 287, + TYPES = 288, + COMPOUND = 289, + ENUM = 290, + OPAQUE_ = 291, + OPAQUESTRING = 292, + GROUP = 293, + PATH = 294, + FILLMARKER = 295, + NIL = 296, + _FILLVALUE = 297, + _FORMAT = 298, + _STORAGE = 299, + _CHUNKSIZES = 300, + _DEFLATELEVEL = 301, + _SHUFFLE = 302, + _ENDIANNESS = 303, + _NOFILL = 304, + _FLETCHER32 = 305, + _NCPROPS = 306, + _ISNETCDF4 = 307, + _SUPERBLOCK = 308, + _FILTER = 309, + _CODECS = 310, + _QUANTIZEBG = 311, + _QUANTIZEGBR = 312, + _QUANTIZEBR = 313, + DATASETID = 314 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 156 "ncgen.y" + +Symbol* sym; +unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ +size_t mark; /* track indices into the sequence*/ +int nctype; /* for tracking attribute list type*/ +Datalist* datalist; +NCConstant* constant; + +#line 126 "ncgen.tab.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE ncglval; + +int ncgparse (void); + +#endif /* !YY_NCG_NCGEN_TAB_H_INCLUDED */ diff --git a/ncgen/ncgen.y b/ncgen/ncgen.y index 5f21b84f5d..4514175ab1 100644 --- a/ncgen/ncgen.y +++ b/ncgen/ncgen.y @@ -14,7 +14,7 @@ static char SccsId[] = "$Id: ncgen.y,v 1.42 2010/05/18 21:32:46 dmh Exp $"; */ #include "includes.h" #include "netcdf_aux.h" -#include "ncgeny.h" +#include "ncgen.tab.h" #include "ncgen.h" #ifdef USE_NETCDF4 #include "netcdf_filter.h" diff --git a/ncgen/ncgenl.c b/ncgen/ncgenl.c index 95ab09e2b3..05f327ca62 100644 --- a/ncgen/ncgenl.c +++ b/ncgen/ncgenl.c @@ -1,5 +1,5 @@ -#line 2 "ncgenl.c" +#line 3 "ncgenl.c" #define YY_INT_ALIGNED short int @@ -1623,7 +1623,7 @@ char *yytext; definition of FILL_STRING in ../ncdump/vardata.h */ #include "ncgen.h" -#include "ncgeny.h" +#include "ncgen.tab.h" #include "isnan.h" #define FILL_STRING "_" @@ -1731,7 +1731,7 @@ struct Specialtoken specials[] = { {NULL,0} /* null terminate */ }; -#line 1734 "ncgenl.c" +#line 1735 "ncgenl.c" /* The most correct (validating) version of UTF8 character set (Taken from: http://www.w3.org/2005/03/23-lex-U) @@ -1774,7 +1774,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})* /* Note: this definition of string will work for utf8 as well, although it is a very relaxed definition */ -#line 1777 "ncgenl.c" +#line 1778 "ncgenl.c" #define INITIAL 0 #define ST_C_COMMENT 1 @@ -1995,7 +1995,7 @@ YY_DECL { #line 226 "ncgen.l" -#line 1998 "ncgenl.c" +#line 1999 "ncgenl.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -2624,7 +2624,7 @@ YY_RULE_SETUP #line 600 "ncgen.l" ECHO; YY_BREAK -#line 2627 "ncgenl.c" +#line 2628 "ncgenl.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TEXT): yyterminate(); @@ -3950,7 +3950,7 @@ identcheck(int token) } break; default: - break; + break; } return token; } diff --git a/ncgen/ncgeny.h b/ncgen/ncgeny.h deleted file mode 100644 index eb71a91e65..0000000000 --- a/ncgen/ncgeny.h +++ /dev/null @@ -1,146 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - -#ifndef YY_NCG_NCGEN_TAB_H_INCLUDED -# define YY_NCG_NCGEN_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int ncgdebug; -#endif - -/* Token kinds. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - NC_UNLIMITED_K = 258, /* NC_UNLIMITED_K */ - CHAR_K = 259, /* CHAR_K */ - BYTE_K = 260, /* BYTE_K */ - SHORT_K = 261, /* SHORT_K */ - INT_K = 262, /* INT_K */ - FLOAT_K = 263, /* FLOAT_K */ - DOUBLE_K = 264, /* DOUBLE_K */ - UBYTE_K = 265, /* UBYTE_K */ - USHORT_K = 266, /* USHORT_K */ - UINT_K = 267, /* UINT_K */ - INT64_K = 268, /* INT64_K */ - UINT64_K = 269, /* UINT64_K */ - STRING_K = 270, /* STRING_K */ - IDENT = 271, /* IDENT */ - TERMSTRING = 272, /* TERMSTRING */ - CHAR_CONST = 273, /* CHAR_CONST */ - BYTE_CONST = 274, /* BYTE_CONST */ - SHORT_CONST = 275, /* SHORT_CONST */ - INT_CONST = 276, /* INT_CONST */ - INT64_CONST = 277, /* INT64_CONST */ - UBYTE_CONST = 278, /* UBYTE_CONST */ - USHORT_CONST = 279, /* USHORT_CONST */ - UINT_CONST = 280, /* UINT_CONST */ - UINT64_CONST = 281, /* UINT64_CONST */ - FLOAT_CONST = 282, /* FLOAT_CONST */ - DOUBLE_CONST = 283, /* DOUBLE_CONST */ - DIMENSIONS = 284, /* DIMENSIONS */ - VARIABLES = 285, /* VARIABLES */ - NETCDF = 286, /* NETCDF */ - DATA = 287, /* DATA */ - TYPES = 288, /* TYPES */ - COMPOUND = 289, /* COMPOUND */ - ENUM = 290, /* ENUM */ - OPAQUE_ = 291, /* OPAQUE_ */ - OPAQUESTRING = 292, /* OPAQUESTRING */ - GROUP = 293, /* GROUP */ - PATH = 294, /* PATH */ - FILLMARKER = 295, /* FILLMARKER */ - NIL = 296, /* NIL */ - _FILLVALUE = 297, /* _FILLVALUE */ - _FORMAT = 298, /* _FORMAT */ - _STORAGE = 299, /* _STORAGE */ - _CHUNKSIZES = 300, /* _CHUNKSIZES */ - _DEFLATELEVEL = 301, /* _DEFLATELEVEL */ - _SHUFFLE = 302, /* _SHUFFLE */ - _ENDIANNESS = 303, /* _ENDIANNESS */ - _NOFILL = 304, /* _NOFILL */ - _FLETCHER32 = 305, /* _FLETCHER32 */ - _NCPROPS = 306, /* _NCPROPS */ - _ISNETCDF4 = 307, /* _ISNETCDF4 */ - _SUPERBLOCK = 308, /* _SUPERBLOCK */ - _FILTER = 309, /* _FILTER */ - _CODECS = 310, /* _CODECS */ - _QUANTIZEBG = 311, /* _QUANTIZEBG */ - _QUANTIZEGBR = 312, /* _QUANTIZEGBR */ - _QUANTIZEBR = 313, /* _QUANTIZEBR */ - DATASETID = 314 /* DATASETID */ - }; - typedef enum yytokentype yytoken_kind_t; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 156 "ncgen.y" - -Symbol* sym; -unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ -size_t mark; /* track indices into the sequence*/ -int nctype; /* for tracking attribute list type*/ -Datalist* datalist; -NCConstant* constant; - -#line 132 "ncgeny.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ncglval; - - -int ncgparse (void); - - -#endif /* !YY_NCG_NCGEN_TAB_H_INCLUDED */ From b04e9540f913fa0213f682e47d3b3871440dd2cf Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 17 Nov 2024 17:15:19 +0000 Subject: [PATCH 5/5] Regen with bison 3.8.2 --- libdap2/dce.tab.c | 901 +++++++++++------------------- libdap2/dce.tab.h | 26 +- ncgen/ncgen.tab.c | 1351 ++++++++++++++++++++++++--------------------- ncgen/ncgen.tab.h | 136 ++--- oc2/dap.tab.c | 1115 +++++++++++++++++++------------------ oc2/dap.tab.h | 70 +-- 6 files changed, 1773 insertions(+), 1826 deletions(-) diff --git a/libdap2/dce.tab.c b/libdap2/dce.tab.c index cc02807cd5..5872072197 100644 --- a/libdap2/dce.tab.c +++ b/libdap2/dce.tab.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.5.1" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -83,7 +84,7 @@ #include "dceconstraints.h" #include "dceparselex.h" -#line 87 "dce.tab.c" +#line 88 "dce.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -106,49 +107,65 @@ # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_DCE_DCE_TAB_H_INCLUDED -# define YY_DCE_DCE_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int dcedebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - SCAN_WORD = 258, - SCAN_STRINGCONST = 259, - SCAN_NUMBERCONST = 260 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int dceparse (DCEparsestate* parsestate); +#include "dce.tab.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_SCAN_WORD = 3, /* SCAN_WORD */ + YYSYMBOL_SCAN_STRINGCONST = 4, /* SCAN_STRINGCONST */ + YYSYMBOL_SCAN_NUMBERCONST = 5, /* SCAN_NUMBERCONST */ + YYSYMBOL_6_ = 6, /* '?' */ + YYSYMBOL_7_ = 7, /* ',' */ + YYSYMBOL_8_ = 8, /* '(' */ + YYSYMBOL_9_ = 9, /* ')' */ + YYSYMBOL_10_ = 10, /* '.' */ + YYSYMBOL_11_ = 11, /* '[' */ + YYSYMBOL_12_ = 12, /* ']' */ + YYSYMBOL_13_ = 13, /* ':' */ + YYSYMBOL_14_ = 14, /* '&' */ + YYSYMBOL_15_ = 15, /* '{' */ + YYSYMBOL_16_ = 16, /* '}' */ + YYSYMBOL_17_ = 17, /* '=' */ + YYSYMBOL_18_ = 18, /* '>' */ + YYSYMBOL_19_ = 19, /* '<' */ + YYSYMBOL_20_ = 20, /* '!' */ + YYSYMBOL_21_ = 21, /* '~' */ + YYSYMBOL_YYACCEPT = 22, /* $accept */ + YYSYMBOL_constraints = 23, /* constraints */ + YYSYMBOL_optquestionmark = 24, /* optquestionmark */ + YYSYMBOL_projections = 25, /* projections */ + YYSYMBOL_selections = 26, /* selections */ + YYSYMBOL_projectionlist = 27, /* projectionlist */ + YYSYMBOL_projection = 28, /* projection */ + YYSYMBOL_function = 29, /* function */ + YYSYMBOL_segmentlist = 30, /* segmentlist */ + YYSYMBOL_segment = 31, /* segment */ + YYSYMBOL_rangelist = 32, /* rangelist */ + YYSYMBOL_range = 33, /* range */ + YYSYMBOL_range1 = 34, /* range1 */ + YYSYMBOL_clauselist = 35, /* clauselist */ + YYSYMBOL_sel_clause = 36, /* sel_clause */ + YYSYMBOL_value_list = 37, /* value_list */ + YYSYMBOL_value = 38, /* value */ + YYSYMBOL_constant = 39, /* constant */ + YYSYMBOL_var = 40, /* var */ + YYSYMBOL_indexpath = 41, /* indexpath */ + YYSYMBOL_index = 42, /* index */ + YYSYMBOL_array_indices = 43, /* array_indices */ + YYSYMBOL_boolfunction = 44, /* boolfunction */ + YYSYMBOL_arg_list = 45, /* arg_list */ + YYSYMBOL_rel_op = 46, /* rel_op */ + YYSYMBOL_ident = 47, /* ident */ + YYSYMBOL_word = 48, /* word */ + YYSYMBOL_number = 49, /* number */ + YYSYMBOL_string = 50 /* string */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; -#endif /* !YY_DCE_DCE_TAB_H_INCLUDED */ @@ -189,6 +206,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -248,6 +277,7 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + /* Stored state numbers (used for stacks). */ typedef yytype_int8 yy_state_t; @@ -266,6 +296,7 @@ typedef int yy_state_fast_t; # endif #endif + #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -284,17 +315,23 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -323,7 +360,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined yyoverflow || YYERROR_VERBOSE +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -388,8 +425,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -465,14 +501,16 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 87 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 260 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ @@ -508,7 +546,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 34, 34, 35, 36, 37, 40, 40, 43, 47, @@ -520,33 +558,35 @@ static const yytype_uint8 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "SCAN_WORD", "SCAN_STRINGCONST", - "SCAN_NUMBERCONST", "'?'", "','", "'('", "')'", "'.'", "'['", "']'", - "':'", "'&'", "'{'", "'}'", "'='", "'>'", "'<'", "'!'", "'~'", "$accept", - "constraints", "optquestionmark", "projections", "selections", - "projectionlist", "projection", "function", "segmentlist", "segment", - "rangelist", "range", "range1", "clauselist", "sel_clause", "value_list", - "value", "constant", "var", "indexpath", "index", "array_indices", - "boolfunction", "arg_list", "rel_op", "ident", "word", "number", - "string", YY_NULLPTR + "\"end of file\"", "error", "\"invalid token\"", "SCAN_WORD", + "SCAN_STRINGCONST", "SCAN_NUMBERCONST", "'?'", "','", "'('", "')'", + "'.'", "'['", "']'", "':'", "'&'", "'{'", "'}'", "'='", "'>'", "'<'", + "'!'", "'~'", "$accept", "constraints", "optquestionmark", "projections", + "selections", "projectionlist", "projection", "function", "segmentlist", + "segment", "rangelist", "range", "range1", "clauselist", "sel_clause", + "value_list", "value", "constant", "var", "indexpath", "index", + "array_indices", "boolfunction", "arg_list", "rel_op", "ident", "word", + "number", "string", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 63, 44, 40, 41, - 46, 91, 93, 58, 38, 123, 125, 61, 62, 60, - 33, 126 -}; -# endif + return yytname[yysymbol]; +} +#endif #define YYPACT_NINF (-36) @@ -558,8 +598,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { 10, -36, 8, 4, -36, -36, 46, 12, -36, 23, @@ -573,9 +613,9 @@ static const yytype_int8 yypact[] = 46, -36, -36, 53, -36, 63, -36 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 7, 6, 0, 0, 1, 57, 0, 2, 3, 8, @@ -589,7 +629,7 @@ static const yytype_int8 yydefact[] = 0, 28, 23, 0, 32, 0, 24 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -36, -36, -36, -36, 56, -36, 47, 1, -36, 28, @@ -597,17 +637,17 @@ static const yytype_int8 yypgoto[] = 33, -36, -36, 37, -36, 77, -1, -35, -36 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 3, 7, 8, 9, 10, 20, 12, 13, + 0, 2, 3, 7, 8, 9, 10, 20, 12, 13, 37, 38, 47, 14, 15, 53, 54, 22, 23, 24, 25, 48, 26, 55, 43, 16, 28, 29, 30 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 21, 56, 17, -45, 11, -46, -56, 5, 4, 36, @@ -634,8 +674,8 @@ static const yytype_int8 yycheck[] = 48, 14, 45, 6 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 6, 23, 24, 0, 3, 14, 25, 26, 27, @@ -649,7 +689,7 @@ static const yytype_int8 yystos[] = 7, 16, 12, 13, 38, 49, 12 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 22, 23, 23, 23, 23, 24, 24, 25, 26, @@ -660,7 +700,7 @@ static const yytype_int8 yyr1[] = 46, 46, 46, 46, 46, 46, 47, 48, 49, 50 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 2, 2, 3, 0, 1, 0, 1, 1, @@ -672,14 +712,15 @@ static const yytype_int8 yyr2[] = }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -701,10 +742,9 @@ static const yytype_int8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -721,19 +761,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value, parsestate); \ + Kind, Value, parsestate); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -744,19 +781,16 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) { FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (parsestate); + YY_USE (yyoutput); + YY_USE (parsestate); if (!yyvaluep) return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -766,12 +800,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DC `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DCEparsestate* parsestate) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep, parsestate); + yy_symbol_value_print (yyo, yykind, yyvaluep, parsestate); YYFPRINTF (yyo, ")"); } @@ -804,7 +839,8 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DCEparsestate* parsestate) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule, DCEparsestate* parsestate) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; @@ -816,9 +852,8 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DCEparsestate* p { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[+yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , parsestate); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], parsestate); YYFPRINTF (stderr, "\n"); } } @@ -833,8 +868,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -857,259 +892,34 @@ int yydebug; #endif -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -yystrlen (const char *yystr) -{ - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; - return yyd - 1; -} -# endif -# endif -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (yyres) - return yystpcpy (yyres, yystr) - yyres; - else - return yystrlen (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 (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - yy_state_t *yyssp, int yytoken) -{ - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Actual size of YYARG. */ - int yycount = 0; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* There are many possibilities here to consider: - - 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) - { - int yyn = yypact[+*yyssp]; - YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - yysize = yysize0; - 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; - - 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]; - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - 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_ - } - - { - /* Don't count the "%s"s in the final size, but reserve room for - the terminator. */ - YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - 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. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DCEparsestate* parsestate) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, DCEparsestate* parsestate) { - YYUSE (yyvaluep); - YYUSE (parsestate); + YY_USE (yyvaluep); + YY_USE (parsestate); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } + + /*----------. | yyparse. | `----------*/ @@ -1117,7 +927,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DCEparsestate* par int yyparse (DCEparsestate* parsestate) { -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; @@ -1128,45 +938,38 @@ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ - int yynerrs; + int yynerrs = 0; - yy_state_fast_t yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + int yyerrstatus = 0; - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYPTRDIFF_T yystacksize; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; -#endif + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1174,16 +977,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1205,10 +1002,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1236,7 +1034,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1247,10 +1045,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1269,6 +1067,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1289,18 +1088,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (&yylval, parsestate); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1369,320 +1179,320 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 8: + case 8: /* projections: projectionlist */ #line 43 "dce.y" {projections(parsestate,yyvsp[0]);} -#line 1376 "dce.tab.c" +#line 1186 "dce.tab.c" break; - case 9: + case 9: /* selections: clauselist */ #line 47 "dce.y" {selections(parsestate,yyvsp[0]);} -#line 1382 "dce.tab.c" +#line 1192 "dce.tab.c" break; - case 10: + case 10: /* projectionlist: projection */ #line 52 "dce.y" {yyval=projectionlist(parsestate,(Object)null,yyvsp[0]);} -#line 1388 "dce.tab.c" +#line 1198 "dce.tab.c" break; - case 11: + case 11: /* projectionlist: projectionlist ',' projection */ #line 54 "dce.y" {yyval=projectionlist(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1394 "dce.tab.c" +#line 1204 "dce.tab.c" break; - case 12: + case 12: /* projection: segmentlist */ #line 59 "dce.y" {yyval=projection(parsestate,yyvsp[0]);} -#line 1400 "dce.tab.c" +#line 1210 "dce.tab.c" break; - case 13: + case 13: /* projection: function */ #line 61 "dce.y" {yyval=projection(parsestate,yyvsp[0]);} -#line 1406 "dce.tab.c" +#line 1216 "dce.tab.c" break; - case 14: + case 14: /* function: ident '(' ')' */ #line 66 "dce.y" {yyval=function(parsestate,yyvsp[-2],null);} -#line 1412 "dce.tab.c" +#line 1222 "dce.tab.c" break; - case 15: + case 15: /* function: ident '(' arg_list ')' */ #line 68 "dce.y" {yyval=function(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1418 "dce.tab.c" +#line 1228 "dce.tab.c" break; - case 16: + case 16: /* segmentlist: segment */ #line 73 "dce.y" {yyval=segmentlist(parsestate,null,yyvsp[0]);} -#line 1424 "dce.tab.c" +#line 1234 "dce.tab.c" break; - case 17: + case 17: /* segmentlist: segmentlist '.' segment */ #line 75 "dce.y" {yyval=segmentlist(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1430 "dce.tab.c" +#line 1240 "dce.tab.c" break; - case 18: + case 18: /* segment: word */ #line 80 "dce.y" {yyval=segment(parsestate,yyvsp[0],null);} -#line 1436 "dce.tab.c" +#line 1246 "dce.tab.c" break; - case 19: + case 19: /* segment: word rangelist */ #line 82 "dce.y" {yyval=segment(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1442 "dce.tab.c" +#line 1252 "dce.tab.c" break; - case 20: + case 20: /* rangelist: range */ #line 87 "dce.y" {yyval=rangelist(parsestate,null,yyvsp[0]);} -#line 1448 "dce.tab.c" +#line 1258 "dce.tab.c" break; - case 21: + case 21: /* rangelist: rangelist range */ #line 89 "dce.y" {yyval=rangelist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1454 "dce.tab.c" +#line 1264 "dce.tab.c" break; - case 22: + case 22: /* range: '[' number ']' */ #line 94 "dce.y" {yyval=range(parsestate,yyvsp[-1],null,null);} -#line 1460 "dce.tab.c" +#line 1270 "dce.tab.c" break; - case 23: + case 23: /* range: '[' number ':' number ']' */ #line 96 "dce.y" {yyval=range(parsestate,yyvsp[-3],null,yyvsp[-1]);} -#line 1466 "dce.tab.c" +#line 1276 "dce.tab.c" break; - case 24: + case 24: /* range: '[' number ':' number ':' number ']' */ #line 98 "dce.y" {yyval=range(parsestate,yyvsp[-5],yyvsp[-3],yyvsp[-1]);} -#line 1472 "dce.tab.c" +#line 1282 "dce.tab.c" break; - case 25: + case 25: /* range1: '[' number ']' */ #line 102 "dce.y" {yyval = range1(parsestate,yyvsp[-1]);} -#line 1478 "dce.tab.c" +#line 1288 "dce.tab.c" break; - case 26: + case 26: /* clauselist: sel_clause */ #line 108 "dce.y" {yyval=clauselist(parsestate,null,yyvsp[0]);} -#line 1484 "dce.tab.c" +#line 1294 "dce.tab.c" break; - case 27: + case 27: /* clauselist: clauselist sel_clause */ #line 110 "dce.y" {yyval=clauselist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1490 "dce.tab.c" +#line 1300 "dce.tab.c" break; - case 28: + case 28: /* sel_clause: '&' value rel_op '{' value_list '}' */ #line 115 "dce.y" {yyval=sel_clause(parsestate,1,yyvsp[-4],yyvsp[-3],yyvsp[-1]);} -#line 1496 "dce.tab.c" +#line 1306 "dce.tab.c" break; - case 29: + case 29: /* sel_clause: '&' value rel_op value */ #line 117 "dce.y" {yyval=sel_clause(parsestate,2,yyvsp[-2],yyvsp[-1],yyvsp[0]);} -#line 1502 "dce.tab.c" +#line 1312 "dce.tab.c" break; - case 30: + case 30: /* sel_clause: '&' boolfunction */ #line 119 "dce.y" {yyval=yyvsp[-1];} -#line 1508 "dce.tab.c" +#line 1318 "dce.tab.c" break; - case 31: + case 31: /* value_list: value */ #line 124 "dce.y" {yyval=value_list(parsestate,null,yyvsp[0]);} -#line 1514 "dce.tab.c" +#line 1324 "dce.tab.c" break; - case 32: + case 32: /* value_list: value_list ',' value */ #line 126 "dce.y" {yyval=value_list(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1520 "dce.tab.c" +#line 1330 "dce.tab.c" break; - case 33: + case 33: /* value: var */ #line 131 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1526 "dce.tab.c" +#line 1336 "dce.tab.c" break; - case 34: + case 34: /* value: function */ #line 133 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1532 "dce.tab.c" +#line 1342 "dce.tab.c" break; - case 35: + case 35: /* value: constant */ #line 135 "dce.y" {yyval=value(parsestate,yyvsp[0]);} -#line 1538 "dce.tab.c" +#line 1348 "dce.tab.c" break; - case 36: + case 36: /* constant: number */ #line 140 "dce.y" {yyval=constant(parsestate,yyvsp[0],SCAN_NUMBERCONST);} -#line 1544 "dce.tab.c" +#line 1354 "dce.tab.c" break; - case 37: + case 37: /* constant: string */ #line 142 "dce.y" {yyval=constant(parsestate,yyvsp[0],SCAN_STRINGCONST);} -#line 1550 "dce.tab.c" +#line 1360 "dce.tab.c" break; - case 38: + case 38: /* var: indexpath */ #line 147 "dce.y" {yyval=var(parsestate,yyvsp[0]);} -#line 1556 "dce.tab.c" +#line 1366 "dce.tab.c" break; - case 39: + case 39: /* indexpath: index */ #line 152 "dce.y" {yyval=indexpath(parsestate,null,yyvsp[0]);} -#line 1562 "dce.tab.c" +#line 1372 "dce.tab.c" break; - case 40: + case 40: /* indexpath: indexpath '.' index */ #line 154 "dce.y" {yyval=indexpath(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1568 "dce.tab.c" +#line 1378 "dce.tab.c" break; - case 41: + case 41: /* index: word */ #line 159 "dce.y" {yyval=indexer(parsestate,yyvsp[0],null);} -#line 1574 "dce.tab.c" +#line 1384 "dce.tab.c" break; - case 42: + case 42: /* index: word array_indices */ #line 161 "dce.y" {yyval=indexer(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1580 "dce.tab.c" +#line 1390 "dce.tab.c" break; - case 43: + case 43: /* array_indices: range1 */ #line 166 "dce.y" {yyval=array_indices(parsestate,null,yyvsp[0]);} -#line 1586 "dce.tab.c" +#line 1396 "dce.tab.c" break; - case 44: + case 44: /* array_indices: array_indices range1 */ #line 168 "dce.y" {yyval=array_indices(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1592 "dce.tab.c" +#line 1402 "dce.tab.c" break; - case 45: + case 45: /* boolfunction: ident '(' ')' */ #line 173 "dce.y" {yyval=function(parsestate,yyvsp[-2],null);} -#line 1598 "dce.tab.c" +#line 1408 "dce.tab.c" break; - case 46: + case 46: /* boolfunction: ident '(' arg_list ')' */ #line 175 "dce.y" {yyval=function(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1604 "dce.tab.c" +#line 1414 "dce.tab.c" break; - case 47: + case 47: /* arg_list: value */ #line 180 "dce.y" {yyval=arg_list(parsestate,null,yyvsp[0]);} -#line 1610 "dce.tab.c" +#line 1420 "dce.tab.c" break; - case 48: + case 48: /* arg_list: value_list ',' value */ #line 182 "dce.y" {yyval=arg_list(parsestate,yyvsp[-2],yyvsp[0]);} -#line 1616 "dce.tab.c" +#line 1426 "dce.tab.c" break; - case 49: + case 49: /* rel_op: '=' */ #line 186 "dce.y" {yyval=makeselectiontag(CEO_EQ);} -#line 1622 "dce.tab.c" +#line 1432 "dce.tab.c" break; - case 50: + case 50: /* rel_op: '>' */ #line 187 "dce.y" {yyval=makeselectiontag(CEO_GT);} -#line 1628 "dce.tab.c" +#line 1438 "dce.tab.c" break; - case 51: + case 51: /* rel_op: '<' */ #line 188 "dce.y" {yyval=makeselectiontag(CEO_LT);} -#line 1634 "dce.tab.c" +#line 1444 "dce.tab.c" break; - case 52: + case 52: /* rel_op: '!' '=' */ #line 189 "dce.y" {yyval=makeselectiontag(CEO_NEQ);} -#line 1640 "dce.tab.c" +#line 1450 "dce.tab.c" break; - case 53: + case 53: /* rel_op: '>' '=' */ #line 190 "dce.y" {yyval=makeselectiontag(CEO_GE);} -#line 1646 "dce.tab.c" +#line 1456 "dce.tab.c" break; - case 54: + case 54: /* rel_op: '<' '=' */ #line 191 "dce.y" {yyval=makeselectiontag(CEO_LE);} -#line 1652 "dce.tab.c" +#line 1462 "dce.tab.c" break; - case 55: + case 55: /* rel_op: '=' '~' */ #line 192 "dce.y" {yyval=makeselectiontag(CEO_RE);} -#line 1658 "dce.tab.c" +#line 1468 "dce.tab.c" break; - case 56: + case 56: /* ident: word */ #line 196 "dce.y" {yyval = yyvsp[0];} -#line 1664 "dce.tab.c" +#line 1474 "dce.tab.c" break; - case 57: + case 57: /* word: SCAN_WORD */ #line 200 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1670 "dce.tab.c" +#line 1480 "dce.tab.c" break; - case 58: + case 58: /* number: SCAN_NUMBERCONST */ #line 204 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1676 "dce.tab.c" +#line 1486 "dce.tab.c" break; - case 59: + case 59: /* string: SCAN_STRINGCONST */ #line 208 "dce.y" {yyval = checkobject(yyvsp[0]);} -#line 1682 "dce.tab.c" +#line 1492 "dce.tab.c" break; -#line 1686 "dce.tab.c" +#line 1496 "dce.tab.c" default: break; } @@ -1697,11 +1507,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 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); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1725,50 +1534,14 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 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); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE yyerror (parsestate, 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 = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (parsestate, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -1801,6 +1574,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -1817,13 +1591,14 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -1837,7 +1612,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yydestruct ("Error: popping", - yystos[yystate], yyvsp, parsestate); + YY_ACCESSING_SYMBOL (yystate), yyvsp, parsestate); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1849,7 +1624,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -1860,7 +1635,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -1868,24 +1643,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (parsestate, YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -1901,18 +1674,16 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[+*yyssp], yyvsp, parsestate); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parsestate); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif + return yyresult; } + #line 211 "dce.y" diff --git a/libdap2/dce.tab.h b/libdap2/dce.tab.h index c762ae1c26..fe0ce56fbb 100644 --- a/libdap2/dce.tab.h +++ b/libdap2/dce.tab.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_DCE_DCE_TAB_H_INCLUDED # define YY_DCE_DCE_TAB_H_INCLUDED @@ -44,15 +45,20 @@ extern int dcedebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - SCAN_WORD = 258, - SCAN_STRINGCONST = 259, - SCAN_NUMBERCONST = 260 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + SCAN_WORD = 258, /* SCAN_WORD */ + SCAN_STRINGCONST = 259, /* SCAN_STRINGCONST */ + SCAN_NUMBERCONST = 260 /* SCAN_NUMBERCONST */ }; + typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ @@ -64,6 +70,8 @@ typedef int YYSTYPE; + int dceparse (DCEparsestate* parsestate); + #endif /* !YY_DCE_DCE_TAB_H_INCLUDED */ diff --git a/ncgen/ncgen.tab.c b/ncgen/ncgen.tab.c index 03d592dd81..8798bc0d6f 100644 --- a/ncgen/ncgen.tab.c +++ b/ncgen/ncgen.tab.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.5.1" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -216,7 +217,7 @@ static void yyerror(fmt,va_alist) const char* fmt; va_dcl; extern int lex_init(void); -#line 220 "ncgen.tab.c" +#line 221 "ncgen.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -239,118 +240,151 @@ extern int lex_init(void); # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_NCG_NCGEN_TAB_H_INCLUDED -# define YY_NCG_NCGEN_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int ncgdebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - NC_UNLIMITED_K = 258, - CHAR_K = 259, - BYTE_K = 260, - SHORT_K = 261, - INT_K = 262, - FLOAT_K = 263, - DOUBLE_K = 264, - UBYTE_K = 265, - USHORT_K = 266, - UINT_K = 267, - INT64_K = 268, - UINT64_K = 269, - STRING_K = 270, - IDENT = 271, - TERMSTRING = 272, - CHAR_CONST = 273, - BYTE_CONST = 274, - SHORT_CONST = 275, - INT_CONST = 276, - INT64_CONST = 277, - UBYTE_CONST = 278, - USHORT_CONST = 279, - UINT_CONST = 280, - UINT64_CONST = 281, - FLOAT_CONST = 282, - DOUBLE_CONST = 283, - DIMENSIONS = 284, - VARIABLES = 285, - NETCDF = 286, - DATA = 287, - TYPES = 288, - COMPOUND = 289, - ENUM = 290, - OPAQUE_ = 291, - OPAQUESTRING = 292, - GROUP = 293, - PATH = 294, - FILLMARKER = 295, - NIL = 296, - _FILLVALUE = 297, - _FORMAT = 298, - _STORAGE = 299, - _CHUNKSIZES = 300, - _DEFLATELEVEL = 301, - _SHUFFLE = 302, - _ENDIANNESS = 303, - _NOFILL = 304, - _FLETCHER32 = 305, - _NCPROPS = 306, - _ISNETCDF4 = 307, - _SUPERBLOCK = 308, - _FILTER = 309, - _CODECS = 310, - _QUANTIZEBG = 311, - _QUANTIZEGBR = 312, - _QUANTIZEBR = 313, - DATASETID = 314 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE +#include "ncgen.tab.h" +/* Symbol kind. */ +enum yysymbol_kind_t { -#line 156 "ncgen.y" - -Symbol* sym; -unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ -size_t mark; /* track indices into the sequence*/ -int nctype; /* for tracking attribute list type*/ -Datalist* datalist; -NCConstant* constant; - -#line 341 "ncgen.tab.c" - + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_NC_UNLIMITED_K = 3, /* NC_UNLIMITED_K */ + YYSYMBOL_CHAR_K = 4, /* CHAR_K */ + YYSYMBOL_BYTE_K = 5, /* BYTE_K */ + YYSYMBOL_SHORT_K = 6, /* SHORT_K */ + YYSYMBOL_INT_K = 7, /* INT_K */ + YYSYMBOL_FLOAT_K = 8, /* FLOAT_K */ + YYSYMBOL_DOUBLE_K = 9, /* DOUBLE_K */ + YYSYMBOL_UBYTE_K = 10, /* UBYTE_K */ + YYSYMBOL_USHORT_K = 11, /* USHORT_K */ + YYSYMBOL_UINT_K = 12, /* UINT_K */ + YYSYMBOL_INT64_K = 13, /* INT64_K */ + YYSYMBOL_UINT64_K = 14, /* UINT64_K */ + YYSYMBOL_STRING_K = 15, /* STRING_K */ + YYSYMBOL_IDENT = 16, /* IDENT */ + YYSYMBOL_TERMSTRING = 17, /* TERMSTRING */ + YYSYMBOL_CHAR_CONST = 18, /* CHAR_CONST */ + YYSYMBOL_BYTE_CONST = 19, /* BYTE_CONST */ + YYSYMBOL_SHORT_CONST = 20, /* SHORT_CONST */ + YYSYMBOL_INT_CONST = 21, /* INT_CONST */ + YYSYMBOL_INT64_CONST = 22, /* INT64_CONST */ + YYSYMBOL_UBYTE_CONST = 23, /* UBYTE_CONST */ + YYSYMBOL_USHORT_CONST = 24, /* USHORT_CONST */ + YYSYMBOL_UINT_CONST = 25, /* UINT_CONST */ + YYSYMBOL_UINT64_CONST = 26, /* UINT64_CONST */ + YYSYMBOL_FLOAT_CONST = 27, /* FLOAT_CONST */ + YYSYMBOL_DOUBLE_CONST = 28, /* DOUBLE_CONST */ + YYSYMBOL_DIMENSIONS = 29, /* DIMENSIONS */ + YYSYMBOL_VARIABLES = 30, /* VARIABLES */ + YYSYMBOL_NETCDF = 31, /* NETCDF */ + YYSYMBOL_DATA = 32, /* DATA */ + YYSYMBOL_TYPES = 33, /* TYPES */ + YYSYMBOL_COMPOUND = 34, /* COMPOUND */ + YYSYMBOL_ENUM = 35, /* ENUM */ + YYSYMBOL_OPAQUE_ = 36, /* OPAQUE_ */ + YYSYMBOL_OPAQUESTRING = 37, /* OPAQUESTRING */ + YYSYMBOL_GROUP = 38, /* GROUP */ + YYSYMBOL_PATH = 39, /* PATH */ + YYSYMBOL_FILLMARKER = 40, /* FILLMARKER */ + YYSYMBOL_NIL = 41, /* NIL */ + YYSYMBOL__FILLVALUE = 42, /* _FILLVALUE */ + YYSYMBOL__FORMAT = 43, /* _FORMAT */ + YYSYMBOL__STORAGE = 44, /* _STORAGE */ + YYSYMBOL__CHUNKSIZES = 45, /* _CHUNKSIZES */ + YYSYMBOL__DEFLATELEVEL = 46, /* _DEFLATELEVEL */ + YYSYMBOL__SHUFFLE = 47, /* _SHUFFLE */ + YYSYMBOL__ENDIANNESS = 48, /* _ENDIANNESS */ + YYSYMBOL__NOFILL = 49, /* _NOFILL */ + YYSYMBOL__FLETCHER32 = 50, /* _FLETCHER32 */ + YYSYMBOL__NCPROPS = 51, /* _NCPROPS */ + YYSYMBOL__ISNETCDF4 = 52, /* _ISNETCDF4 */ + YYSYMBOL__SUPERBLOCK = 53, /* _SUPERBLOCK */ + YYSYMBOL__FILTER = 54, /* _FILTER */ + YYSYMBOL__CODECS = 55, /* _CODECS */ + YYSYMBOL__QUANTIZEBG = 56, /* _QUANTIZEBG */ + YYSYMBOL__QUANTIZEGBR = 57, /* _QUANTIZEGBR */ + YYSYMBOL__QUANTIZEBR = 58, /* _QUANTIZEBR */ + YYSYMBOL_DATASETID = 59, /* DATASETID */ + YYSYMBOL_60_ = 60, /* '{' */ + YYSYMBOL_61_ = 61, /* '}' */ + YYSYMBOL_62_ = 62, /* ';' */ + YYSYMBOL_63_ = 63, /* ',' */ + YYSYMBOL_64_ = 64, /* '=' */ + YYSYMBOL_65_ = 65, /* '(' */ + YYSYMBOL_66_ = 66, /* ')' */ + YYSYMBOL_67_ = 67, /* '*' */ + YYSYMBOL_68_ = 68, /* ':' */ + YYSYMBOL_YYACCEPT = 69, /* $accept */ + YYSYMBOL_ncdesc = 70, /* ncdesc */ + YYSYMBOL_datasetid = 71, /* datasetid */ + YYSYMBOL_rootgroup = 72, /* rootgroup */ + YYSYMBOL_groupbody = 73, /* groupbody */ + YYSYMBOL_subgrouplist = 74, /* subgrouplist */ + YYSYMBOL_namedgroup = 75, /* namedgroup */ + YYSYMBOL_76_1 = 76, /* $@1 */ + YYSYMBOL_77_2 = 77, /* $@2 */ + YYSYMBOL_typesection = 78, /* typesection */ + YYSYMBOL_typedecls = 79, /* typedecls */ + YYSYMBOL_typename = 80, /* typename */ + YYSYMBOL_type_or_attr_decl = 81, /* type_or_attr_decl */ + YYSYMBOL_typedecl = 82, /* typedecl */ + YYSYMBOL_optsemicolon = 83, /* optsemicolon */ + YYSYMBOL_enumdecl = 84, /* enumdecl */ + YYSYMBOL_enumidlist = 85, /* enumidlist */ + YYSYMBOL_enumid = 86, /* enumid */ + YYSYMBOL_opaquedecl = 87, /* opaquedecl */ + YYSYMBOL_vlendecl = 88, /* vlendecl */ + YYSYMBOL_compounddecl = 89, /* compounddecl */ + YYSYMBOL_fields = 90, /* fields */ + YYSYMBOL_field = 91, /* field */ + YYSYMBOL_primtype = 92, /* primtype */ + YYSYMBOL_dimsection = 93, /* dimsection */ + YYSYMBOL_dimdecls = 94, /* dimdecls */ + YYSYMBOL_dim_or_attr_decl = 95, /* dim_or_attr_decl */ + YYSYMBOL_dimdeclist = 96, /* dimdeclist */ + YYSYMBOL_dimdecl = 97, /* dimdecl */ + YYSYMBOL_dimd = 98, /* dimd */ + YYSYMBOL_vasection = 99, /* vasection */ + YYSYMBOL_vadecls = 100, /* vadecls */ + YYSYMBOL_vadecl_or_attr = 101, /* vadecl_or_attr */ + YYSYMBOL_vardecl = 102, /* vardecl */ + YYSYMBOL_varlist = 103, /* varlist */ + YYSYMBOL_varspec = 104, /* varspec */ + YYSYMBOL_dimspec = 105, /* dimspec */ + YYSYMBOL_dimlist = 106, /* dimlist */ + YYSYMBOL_dimref = 107, /* dimref */ + YYSYMBOL_fieldlist = 108, /* fieldlist */ + YYSYMBOL_fieldspec = 109, /* fieldspec */ + YYSYMBOL_fielddimspec = 110, /* fielddimspec */ + YYSYMBOL_fielddimlist = 111, /* fielddimlist */ + YYSYMBOL_fielddim = 112, /* fielddim */ + YYSYMBOL_varref = 113, /* varref */ + YYSYMBOL_typeref = 114, /* typeref */ + YYSYMBOL_ambiguous_ref = 115, /* ambiguous_ref */ + YYSYMBOL_attrdecllist = 116, /* attrdecllist */ + YYSYMBOL_attrdecl = 117, /* attrdecl */ + YYSYMBOL_path = 118, /* path */ + YYSYMBOL_datasection = 119, /* datasection */ + YYSYMBOL_datadecls = 120, /* datadecls */ + YYSYMBOL_datadecl = 121, /* datadecl */ + YYSYMBOL_datalist = 122, /* datalist */ + YYSYMBOL_datalist0 = 123, /* datalist0 */ + YYSYMBOL_datalist1 = 124, /* datalist1 */ + YYSYMBOL_dataitem = 125, /* dataitem */ + YYSYMBOL_constdata = 126, /* constdata */ + YYSYMBOL_econstref = 127, /* econstref */ + YYSYMBOL_function = 128, /* function */ + YYSYMBOL_arglist = 129, /* arglist */ + YYSYMBOL_simpleconstant = 130, /* simpleconstant */ + YYSYMBOL_intlist = 131, /* intlist */ + YYSYMBOL_constint = 132, /* constint */ + YYSYMBOL_conststring = 133, /* conststring */ + YYSYMBOL_constbool = 134, /* constbool */ + YYSYMBOL_varident = 135, /* varident */ + YYSYMBOL_ident = 136 /* ident */ }; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ncglval; - -int ncgparse (void); +typedef enum yysymbol_kind_t yysymbol_kind_t; -#endif /* !YY_NCG_NCGEN_TAB_H_INCLUDED */ @@ -391,6 +425,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -450,6 +496,7 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; @@ -468,6 +515,7 @@ typedef int yy_state_fast_t; # endif #endif + #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -486,17 +534,23 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -525,7 +579,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined yyoverflow || YYERROR_VERBOSE +#if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -590,8 +644,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* 1 */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -667,14 +720,16 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 276 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 314 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ @@ -715,7 +770,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 243, 243, 249, 251, 258, 265, 265, 268, 277, @@ -737,26 +792,33 @@ static const yytype_int16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 1 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if 1 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "NC_UNLIMITED_K", "CHAR_K", "BYTE_K", - "SHORT_K", "INT_K", "FLOAT_K", "DOUBLE_K", "UBYTE_K", "USHORT_K", - "UINT_K", "INT64_K", "UINT64_K", "STRING_K", "IDENT", "TERMSTRING", - "CHAR_CONST", "BYTE_CONST", "SHORT_CONST", "INT_CONST", "INT64_CONST", - "UBYTE_CONST", "USHORT_CONST", "UINT_CONST", "UINT64_CONST", - "FLOAT_CONST", "DOUBLE_CONST", "DIMENSIONS", "VARIABLES", "NETCDF", - "DATA", "TYPES", "COMPOUND", "ENUM", "OPAQUE_", "OPAQUESTRING", "GROUP", - "PATH", "FILLMARKER", "NIL", "_FILLVALUE", "_FORMAT", "_STORAGE", - "_CHUNKSIZES", "_DEFLATELEVEL", "_SHUFFLE", "_ENDIANNESS", "_NOFILL", - "_FLETCHER32", "_NCPROPS", "_ISNETCDF4", "_SUPERBLOCK", "_FILTER", - "_CODECS", "_QUANTIZEBG", "_QUANTIZEGBR", "_QUANTIZEBR", "DATASETID", - "'{'", "'}'", "';'", "','", "'='", "'('", "')'", "'*'", "':'", "$accept", - "ncdesc", "datasetid", "rootgroup", "groupbody", "subgrouplist", - "namedgroup", "$@1", "$@2", "typesection", "typedecls", "typename", - "type_or_attr_decl", "typedecl", "optsemicolon", "enumdecl", + "\"end of file\"", "error", "\"invalid token\"", "NC_UNLIMITED_K", + "CHAR_K", "BYTE_K", "SHORT_K", "INT_K", "FLOAT_K", "DOUBLE_K", "UBYTE_K", + "USHORT_K", "UINT_K", "INT64_K", "UINT64_K", "STRING_K", "IDENT", + "TERMSTRING", "CHAR_CONST", "BYTE_CONST", "SHORT_CONST", "INT_CONST", + "INT64_CONST", "UBYTE_CONST", "USHORT_CONST", "UINT_CONST", + "UINT64_CONST", "FLOAT_CONST", "DOUBLE_CONST", "DIMENSIONS", "VARIABLES", + "NETCDF", "DATA", "TYPES", "COMPOUND", "ENUM", "OPAQUE_", "OPAQUESTRING", + "GROUP", "PATH", "FILLMARKER", "NIL", "_FILLVALUE", "_FORMAT", + "_STORAGE", "_CHUNKSIZES", "_DEFLATELEVEL", "_SHUFFLE", "_ENDIANNESS", + "_NOFILL", "_FLETCHER32", "_NCPROPS", "_ISNETCDF4", "_SUPERBLOCK", + "_FILTER", "_CODECS", "_QUANTIZEBG", "_QUANTIZEGBR", "_QUANTIZEBR", + "DATASETID", "'{'", "'}'", "';'", "','", "'='", "'('", "')'", "'*'", + "':'", "$accept", "ncdesc", "datasetid", "rootgroup", "groupbody", + "subgrouplist", "namedgroup", "$@1", "$@2", "typesection", "typedecls", + "typename", "type_or_attr_decl", "typedecl", "optsemicolon", "enumdecl", "enumidlist", "enumid", "opaquedecl", "vlendecl", "compounddecl", "fields", "field", "primtype", "dimsection", "dimdecls", "dim_or_attr_decl", "dimdeclist", "dimdecl", "dimd", "vasection", @@ -768,22 +830,13 @@ static const char *const yytname[] = "constdata", "econstref", "function", "arglist", "simpleconstant", "intlist", "constint", "conststring", "constbool", "varident", "ident", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 123, 125, 59, 44, 61, 40, 41, 42, 58 -}; -# endif + return yytname[yysymbol]; +} +#endif #define YYPACT_NINF (-153) @@ -795,8 +848,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -10, -24, 30, -153, -18, -153, 233, -153, -153, -153, @@ -829,9 +882,9 @@ static const yytype_int16 yypact[] = 233, -3, -153, -153, -153, -153 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 3, 0, 1, 88, 2, 35, 36, @@ -864,7 +917,7 @@ static const yytype_uint8 yydefact[] = 88, 0, 79, 73, 10, 81 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -153, -153, -153, -153, 22, -6, -153, -153, -153, -153, @@ -876,10 +929,10 @@ static const yytype_int16 yypgoto[] = -153, -152, -153, -37, -29, 2, -153, -22 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 4, 7, 23, 36, 49, 195, 260, 40, + 0, 2, 4, 7, 23, 36, 49, 195, 260, 40, 67, 134, 68, 69, 139, 70, 233, 234, 71, 72, 73, 199, 200, 24, 78, 146, 147, 148, 149, 150, 154, 184, 185, 186, 215, 216, 240, 255, 256, 229, @@ -888,9 +941,9 @@ static const yytype_int16 yydefgoto[] = 193, 115, 163, 87, 88, 89, 217, 30 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 35, 79, 107, 75, 37, 194, 76, 178, 90, 74, @@ -985,8 +1038,8 @@ static const yytype_int16 yycheck[] = 39 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 31, 70, 59, 71, 0, 60, 72, 4, 5, @@ -1019,7 +1072,7 @@ static const yytype_uint8 yystos[] = 61, 63, 66, 107, 116, 112 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { 0, 69, 70, 71, 72, 73, 74, 74, 76, 77, @@ -1040,7 +1093,7 @@ static const yytype_uint8 yyr1[] = 132, 132, 132, 132, 133, 134, 134, 135, 135, 136 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 3, 1, 4, 5, 0, 2, 0, 0, @@ -1062,14 +1115,15 @@ static const yytype_int8 yyr2[] = }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1091,10 +1145,9 @@ static const yytype_int8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -1111,19 +1164,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -1134,18 +1184,15 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1155,12 +1202,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep); + yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } @@ -1193,7 +1241,8 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; @@ -1205,9 +1254,8 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[+yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } @@ -1222,8 +1270,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -1246,12 +1294,60 @@ int yydebug; #endif -#if YYERROR_VERBOSE +/* Context of a parse error. */ +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; +} yypcontext_t; + +/* Put in YYARG at most YYARGN of the expected tokens given the + current YYCTX, and return the number of tokens stored in YYARG. If + YYARG is null, return the number of expected tokens (guaranteed to + be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. + Return 0 if there are more than YYARGN expected tokens, yet fill + YYARG up to YYARGN. */ +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + 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; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; +} -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else + + + +#ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ static YYPTRDIFF_T yystrlen (const char *yystr) @@ -1261,13 +1357,13 @@ yystrlen (const char *yystr) continue; return yylen; } -# endif # endif +#endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else +#ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * @@ -1281,10 +1377,10 @@ yystpcpy (char *yydest, const char *yysrc) return yyd - 1; } -# endif # endif +#endif -# ifndef yytnamerr +#ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string @@ -1299,7 +1395,6 @@ yytnamerr (char *yyres, const char *yystr) { YYPTRDIFF_T yyn = 0; char const *yyp = yystr; - for (;;) switch (*++yyp) { @@ -1333,31 +1428,15 @@ yytnamerr (char *yyres, const char *yystr) else return yystrlen (yystr); } -# endif +#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 (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - yy_state_t *yyssp, int yytoken) +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) { - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Actual size of YYARG. */ int yycount = 0; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -1381,52 +1460,54 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, 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 (yyctx->yytoken != YYSYMBOL_YYEMPTY) { - int yyn = yypact[+*yyssp]; - YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - yysize = yysize0; - 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; - - 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]; - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; } + return yycount; +} + +/* 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 YYENOMEM if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; switch (yycount) { -# define YYCASE_(N, S) \ +#define YYCASE_(N, S) \ case N: \ yyformat = S; \ - break + break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); @@ -1434,17 +1515,23 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, 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_ +#undef YYCASE_ } + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; { - /* Don't count the "%s"s in the final size, but reserve room for - the terminator. */ - YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } } if (*yymsg_alloc < yysize) @@ -1453,7 +1540,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; + return -1; } /* Avoid sprintf, as that infringes on the user's name space. @@ -1465,7 +1552,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr (yyp, yyarg[yyi++]); + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); yyformat += 2; } else @@ -1476,29 +1563,28 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, } return 0; } -#endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1507,6 +1593,8 @@ YYSTYPE yylval; int yynerrs; + + /*----------. | yyparse. | `----------*/ @@ -1514,43 +1602,39 @@ int yynerrs; int yyparse (void) { - yy_state_fast_t yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + int yyerrstatus = 0; - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYPTRDIFF_T yystacksize; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; -#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1558,16 +1642,10 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1589,10 +1667,11 @@ yyparse (void) YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1620,7 +1699,7 @@ yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1631,10 +1710,10 @@ yyparse (void) YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1653,6 +1732,7 @@ yyparse (void) } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1673,18 +1753,29 @@ yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1753,19 +1844,19 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: + case 2: /* ncdesc: NETCDF datasetid rootgroup */ #line 246 "ncgen.y" {if (error_count > 0) YYABORT;} -#line 1760 "ncgen.tab.c" +#line 1851 "ncgen.tab.c" break; - case 3: + case 3: /* datasetid: DATASETID */ #line 249 "ncgen.y" {createrootgroup(datasetname);} -#line 1766 "ncgen.tab.c" +#line 1857 "ncgen.tab.c" break; - case 8: + case 8: /* $@1: %empty */ #line 268 "ncgen.y" { Symbol* id = (yyvsp[-1].sym); @@ -1774,28 +1865,28 @@ yyparse (void) yyerror("duplicate group declaration within parent group for %s", id->name); } -#line 1778 "ncgen.tab.c" +#line 1869 "ncgen.tab.c" break; - case 9: + case 9: /* $@2: %empty */ #line 277 "ncgen.y" {listpop(groupstack);} -#line 1784 "ncgen.tab.c" +#line 1875 "ncgen.tab.c" break; - case 12: + case 12: /* typesection: TYPES */ #line 283 "ncgen.y" {} -#line 1790 "ncgen.tab.c" +#line 1881 "ncgen.tab.c" break; - case 13: + case 13: /* typesection: TYPES typedecls */ #line 285 "ncgen.y" {markcdf4("Type specification");} -#line 1796 "ncgen.tab.c" +#line 1887 "ncgen.tab.c" break; - case 16: + case 16: /* typename: ident */ #line 291 "ncgen.y" { /* Use when defining a type */ (yyvsp[0].sym)->objectclass = NC_TYPE; @@ -1804,22 +1895,22 @@ yyparse (void) (yyvsp[0].sym)->name); listpush(typdefs,(void*)(yyvsp[0].sym)); } -#line 1808 "ncgen.tab.c" +#line 1899 "ncgen.tab.c" break; - case 17: + case 17: /* type_or_attr_decl: typedecl */ #line 300 "ncgen.y" {} -#line 1814 "ncgen.tab.c" +#line 1905 "ncgen.tab.c" break; - case 18: + case 18: /* type_or_attr_decl: attrdecl ';' */ #line 300 "ncgen.y" {} -#line 1820 "ncgen.tab.c" +#line 1911 "ncgen.tab.c" break; - case 25: + case 25: /* enumdecl: primtype ENUM typename '{' enumidlist '}' */ #line 314 "ncgen.y" { size_t i; @@ -1847,16 +1938,16 @@ yyparse (void) } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 1851 "ncgen.tab.c" +#line 1942 "ncgen.tab.c" break; - case 26: + case 26: /* enumidlist: enumid */ #line 343 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 1857 "ncgen.tab.c" +#line 1948 "ncgen.tab.c" break; - case 27: + case 27: /* enumidlist: enumidlist ',' enumid */ #line 345 "ncgen.y" { size_t i; @@ -1872,10 +1963,10 @@ yyparse (void) } listpush(stack,(void*)(yyvsp[0].sym)); } -#line 1876 "ncgen.tab.c" +#line 1967 "ncgen.tab.c" break; - case 28: + case 28: /* enumid: ident '=' constint */ #line 362 "ncgen.y" { (yyvsp[-2].sym)->objectclass=NC_TYPE; @@ -1883,10 +1974,10 @@ yyparse (void) (yyvsp[-2].sym)->typ.econst=(yyvsp[0].constant); (yyval.sym)=(yyvsp[-2].sym); } -#line 1887 "ncgen.tab.c" +#line 1978 "ncgen.tab.c" break; - case 29: + case 29: /* opaquedecl: OPAQUE_ '(' INT_CONST ')' typename */ #line 371 "ncgen.y" { vercheck(NC_OPAQUE); @@ -1897,10 +1988,10 @@ yyparse (void) (yyvsp[0].sym)->typ.size=(size_t)int32_val; (void)ncaux_class_alignment(NC_OPAQUE,&(yyvsp[0].sym)->typ.alignment); } -#line 1901 "ncgen.tab.c" +#line 1992 "ncgen.tab.c" break; - case 30: + case 30: /* vlendecl: typeref '(' '*' ')' typename */ #line 383 "ncgen.y" { Symbol* basetype = (yyvsp[-4].sym); @@ -1913,10 +2004,10 @@ yyparse (void) (yyvsp[0].sym)->typ.size=VLENSIZE; (void)ncaux_class_alignment(NC_VLEN,&(yyvsp[0].sym)->typ.alignment); } -#line 1917 "ncgen.tab.c" +#line 2008 "ncgen.tab.c" break; - case 31: + case 31: /* compounddecl: COMPOUND typename '{' fields '}' */ #line 397 "ncgen.y" { size_t i,j; @@ -1947,22 +2038,22 @@ yyparse (void) } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 1951 "ncgen.tab.c" +#line 2042 "ncgen.tab.c" break; - case 32: + case 32: /* fields: field ';' */ #line 429 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 1957 "ncgen.tab.c" +#line 2048 "ncgen.tab.c" break; - case 33: + case 33: /* fields: fields field ';' */ #line 430 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark);} -#line 1963 "ncgen.tab.c" +#line 2054 "ncgen.tab.c" break; - case 34: + case 34: /* field: typeref fieldlist */ #line 434 "ncgen.y" { size_t i; @@ -1975,106 +2066,106 @@ yyparse (void) f->typ.basetype = (yyvsp[-1].sym); } } -#line 1979 "ncgen.tab.c" +#line 2070 "ncgen.tab.c" break; - case 35: + case 35: /* primtype: CHAR_K */ #line 447 "ncgen.y" { (yyval.sym) = primsymbols[NC_CHAR]; } -#line 1985 "ncgen.tab.c" +#line 2076 "ncgen.tab.c" break; - case 36: + case 36: /* primtype: BYTE_K */ #line 448 "ncgen.y" { (yyval.sym) = primsymbols[NC_BYTE]; } -#line 1991 "ncgen.tab.c" +#line 2082 "ncgen.tab.c" break; - case 37: + case 37: /* primtype: SHORT_K */ #line 449 "ncgen.y" { (yyval.sym) = primsymbols[NC_SHORT]; } -#line 1997 "ncgen.tab.c" +#line 2088 "ncgen.tab.c" break; - case 38: + case 38: /* primtype: INT_K */ #line 450 "ncgen.y" { (yyval.sym) = primsymbols[NC_INT]; } -#line 2003 "ncgen.tab.c" +#line 2094 "ncgen.tab.c" break; - case 39: + case 39: /* primtype: FLOAT_K */ #line 451 "ncgen.y" { (yyval.sym) = primsymbols[NC_FLOAT]; } -#line 2009 "ncgen.tab.c" +#line 2100 "ncgen.tab.c" break; - case 40: + case 40: /* primtype: DOUBLE_K */ #line 452 "ncgen.y" { (yyval.sym) = primsymbols[NC_DOUBLE]; } -#line 2015 "ncgen.tab.c" +#line 2106 "ncgen.tab.c" break; - case 41: + case 41: /* primtype: UBYTE_K */ #line 453 "ncgen.y" { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; } -#line 2021 "ncgen.tab.c" +#line 2112 "ncgen.tab.c" break; - case 42: + case 42: /* primtype: USHORT_K */ #line 454 "ncgen.y" { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; } -#line 2027 "ncgen.tab.c" +#line 2118 "ncgen.tab.c" break; - case 43: + case 43: /* primtype: UINT_K */ #line 455 "ncgen.y" { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; } -#line 2033 "ncgen.tab.c" +#line 2124 "ncgen.tab.c" break; - case 44: + case 44: /* primtype: INT64_K */ #line 456 "ncgen.y" { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; } -#line 2039 "ncgen.tab.c" +#line 2130 "ncgen.tab.c" break; - case 45: + case 45: /* primtype: UINT64_K */ #line 457 "ncgen.y" { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; } -#line 2045 "ncgen.tab.c" +#line 2136 "ncgen.tab.c" break; - case 46: + case 46: /* primtype: STRING_K */ #line 458 "ncgen.y" { vercheck(NC_STRING); (yyval.sym) = primsymbols[NC_STRING]; } -#line 2051 "ncgen.tab.c" +#line 2142 "ncgen.tab.c" break; - case 48: + case 48: /* dimsection: DIMENSIONS */ #line 462 "ncgen.y" {} -#line 2057 "ncgen.tab.c" +#line 2148 "ncgen.tab.c" break; - case 49: + case 49: /* dimsection: DIMENSIONS dimdecls */ #line 463 "ncgen.y" {} -#line 2063 "ncgen.tab.c" +#line 2154 "ncgen.tab.c" break; - case 52: + case 52: /* dim_or_attr_decl: dimdeclist */ #line 470 "ncgen.y" {} -#line 2069 "ncgen.tab.c" +#line 2160 "ncgen.tab.c" break; - case 53: + case 53: /* dim_or_attr_decl: attrdecl */ #line 470 "ncgen.y" {} -#line 2075 "ncgen.tab.c" +#line 2166 "ncgen.tab.c" break; - case 56: + case 56: /* dimdecl: dimd '=' constint */ #line 478 "ncgen.y" { (yyvsp[-2].sym)->dim.declsize = (size_t)extractint((yyvsp[0].constant)); @@ -2083,10 +2174,10 @@ fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long lon #endif reclaimconstant((yyvsp[0].constant)); } -#line 2087 "ncgen.tab.c" +#line 2178 "ncgen.tab.c" break; - case 57: + case 57: /* dimdecl: dimd '=' NC_UNLIMITED_K */ #line 486 "ncgen.y" { (yyvsp[-2].sym)->dim.declsize = NC_UNLIMITED; @@ -2095,10 +2186,10 @@ fprintf(stderr,"dimension: %s = %llu\n",(yyvsp[-2].sym)->name,(unsigned long lon fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); #endif } -#line 2099 "ncgen.tab.c" +#line 2190 "ncgen.tab.c" break; - case 58: + case 58: /* dimd: ident */ #line 496 "ncgen.y" { (yyvsp[0].sym)->objectclass=NC_DIM; @@ -2109,34 +2200,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)=(yyvsp[0].sym); listpush(dimdefs,(void*)(yyvsp[0].sym)); } -#line 2113 "ncgen.tab.c" +#line 2204 "ncgen.tab.c" break; - case 60: + case 60: /* vasection: VARIABLES */ #line 508 "ncgen.y" {} -#line 2119 "ncgen.tab.c" +#line 2210 "ncgen.tab.c" break; - case 61: + case 61: /* vasection: VARIABLES vadecls */ #line 509 "ncgen.y" {} -#line 2125 "ncgen.tab.c" +#line 2216 "ncgen.tab.c" break; - case 64: + case 64: /* vadecl_or_attr: vardecl */ #line 516 "ncgen.y" {} -#line 2131 "ncgen.tab.c" +#line 2222 "ncgen.tab.c" break; - case 65: + case 65: /* vadecl_or_attr: attrdecl */ #line 516 "ncgen.y" {} -#line 2137 "ncgen.tab.c" +#line 2228 "ncgen.tab.c" break; - case 66: + case 66: /* vardecl: typeref varlist */ #line 519 "ncgen.y" { size_t i; @@ -2157,24 +2248,24 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } listsetlength(stack,stackbase);/* remove stack nodes*/ } -#line 2161 "ncgen.tab.c" +#line 2252 "ncgen.tab.c" break; - case 67: + case 67: /* varlist: varspec */ #line 541 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym)); } -#line 2169 "ncgen.tab.c" +#line 2260 "ncgen.tab.c" break; - case 68: + case 68: /* varlist: varlist ',' varspec */ #line 545 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2175 "ncgen.tab.c" +#line 2266 "ncgen.tab.c" break; - case 69: + case 69: /* varspec: varident dimspec */ #line 549 "ncgen.y" { size_t i; @@ -2202,34 +2293,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); listsetlength(stack,stackbase);/* remove stack nodes*/ (yyval.sym) = var; } -#line 2206 "ncgen.tab.c" +#line 2297 "ncgen.tab.c" break; - case 70: + case 70: /* dimspec: %empty */ #line 577 "ncgen.y" {(yyval.mark)=listlength(stack);} -#line 2212 "ncgen.tab.c" +#line 2303 "ncgen.tab.c" break; - case 71: + case 71: /* dimspec: '(' dimlist ')' */ #line 578 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 2218 "ncgen.tab.c" +#line 2309 "ncgen.tab.c" break; - case 72: + case 72: /* dimlist: dimref */ #line 581 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2224 "ncgen.tab.c" +#line 2315 "ncgen.tab.c" break; - case 73: + case 73: /* dimlist: dimlist ',' dimref */ #line 583 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2230 "ncgen.tab.c" +#line 2321 "ncgen.tab.c" break; - case 74: + case 74: /* dimref: path */ #line 587 "ncgen.y" {Symbol* dimsym = (yyvsp[0].sym); dimsym->objectclass = NC_DIM; @@ -2241,24 +2332,24 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=dimsym; } -#line 2245 "ncgen.tab.c" +#line 2336 "ncgen.tab.c" break; - case 75: + case 75: /* fieldlist: fieldspec */ #line 601 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym)); } -#line 2253 "ncgen.tab.c" +#line 2344 "ncgen.tab.c" break; - case 76: + case 76: /* fieldlist: fieldlist ',' fieldspec */ #line 605 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2259 "ncgen.tab.c" +#line 2350 "ncgen.tab.c" break; - case 77: + case 77: /* fieldspec: ident fielddimspec */ #line 610 "ncgen.y" { size_t i; @@ -2286,34 +2377,34 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); listsetlength(stack,stackbase);/* remove stack nodes*/ (yyval.sym) = (yyvsp[-1].sym); } -#line 2290 "ncgen.tab.c" +#line 2381 "ncgen.tab.c" break; - case 78: + case 78: /* fielddimspec: %empty */ #line 638 "ncgen.y" {(yyval.mark)=listlength(stack);} -#line 2296 "ncgen.tab.c" +#line 2387 "ncgen.tab.c" break; - case 79: + case 79: /* fielddimspec: '(' fielddimlist ')' */ #line 639 "ncgen.y" {(yyval.mark)=(yyvsp[-1].mark);} -#line 2302 "ncgen.tab.c" +#line 2393 "ncgen.tab.c" break; - case 80: + case 80: /* fielddimlist: fielddim */ #line 643 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2308 "ncgen.tab.c" +#line 2399 "ncgen.tab.c" break; - case 81: + case 81: /* fielddimlist: fielddimlist ',' fielddim */ #line 645 "ncgen.y" {(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));} -#line 2314 "ncgen.tab.c" +#line 2405 "ncgen.tab.c" break; - case 82: + case 82: /* fielddim: UINT_CONST */ #line 650 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2324,10 +2415,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = uint32_val; } -#line 2328 "ncgen.tab.c" +#line 2419 "ncgen.tab.c" break; - case 83: + case 83: /* fielddim: INT_CONST */ #line 660 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2342,10 +2433,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = (size_t)int32_val; } -#line 2346 "ncgen.tab.c" +#line 2437 "ncgen.tab.c" break; - case 84: + case 84: /* varref: ambiguous_ref */ #line 680 "ncgen.y" {Symbol* vsym = (yyvsp[0].sym); if(vsym->objectclass != NC_VAR) { @@ -2354,10 +2445,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=vsym; } -#line 2358 "ncgen.tab.c" +#line 2449 "ncgen.tab.c" break; - case 85: + case 85: /* typeref: ambiguous_ref */ #line 691 "ncgen.y" {Symbol* tsym = (yyvsp[0].sym); if(tsym->objectclass != NC_TYPE) { @@ -2366,10 +2457,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=tsym; } -#line 2370 "ncgen.tab.c" +#line 2461 "ncgen.tab.c" break; - case 86: + case 86: /* ambiguous_ref: path */ #line 702 "ncgen.y" {Symbol* tvsym = (yyvsp[0].sym); Symbol* sym; /* disambiguate*/ @@ -2389,52 +2480,52 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); } (yyval.sym)=tvsym; } -#line 2393 "ncgen.tab.c" +#line 2484 "ncgen.tab.c" break; - case 87: + case 87: /* ambiguous_ref: primtype */ #line 720 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2399 "ncgen.tab.c" +#line 2490 "ncgen.tab.c" break; - case 88: + case 88: /* attrdecllist: %empty */ #line 727 "ncgen.y" {} -#line 2405 "ncgen.tab.c" +#line 2496 "ncgen.tab.c" break; - case 89: + case 89: /* attrdecllist: attrdecl ';' attrdecllist */ #line 727 "ncgen.y" {} -#line 2411 "ncgen.tab.c" +#line 2502 "ncgen.tab.c" break; - case 90: + case 90: /* attrdecl: ':' _NCPROPS '=' conststring */ #line 731 "ncgen.y" {(yyval.sym) = makespecial(_NCPROPS_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2417 "ncgen.tab.c" +#line 2508 "ncgen.tab.c" break; - case 91: + case 91: /* attrdecl: ':' _ISNETCDF4 '=' constbool */ #line 733 "ncgen.y" {(yyval.sym) = makespecial(_ISNETCDF4_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2423 "ncgen.tab.c" +#line 2514 "ncgen.tab.c" break; - case 92: + case 92: /* attrdecl: ':' _SUPERBLOCK '=' constint */ #line 735 "ncgen.y" {(yyval.sym) = makespecial(_SUPERBLOCK_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2429 "ncgen.tab.c" +#line 2520 "ncgen.tab.c" break; - case 93: + case 93: /* attrdecl: ':' ident '=' datalist */ #line 737 "ncgen.y" { (yyval.sym)=makeattribute((yyvsp[-2].sym),NULL,NULL,(yyvsp[0].datalist),ATTRGLOBAL);} -#line 2435 "ncgen.tab.c" +#line 2526 "ncgen.tab.c" break; - case 94: + case 94: /* attrdecl: typeref ambiguous_ref ':' ident '=' datalist */ #line 739 "ncgen.y" {Symbol* tsym = (yyvsp[-5].sym); Symbol* vsym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym); if(vsym->objectclass == NC_VAR) { @@ -2444,10 +2535,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); YYABORT; } } -#line 2448 "ncgen.tab.c" +#line 2539 "ncgen.tab.c" break; - case 95: + case 95: /* attrdecl: ambiguous_ref ':' ident '=' datalist */ #line 748 "ncgen.y" {Symbol* sym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym); if(sym->objectclass == NC_VAR) { @@ -2459,100 +2550,100 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); YYABORT; } } -#line 2463 "ncgen.tab.c" +#line 2554 "ncgen.tab.c" break; - case 96: + case 96: /* attrdecl: ambiguous_ref ':' _FILLVALUE '=' datalist */ #line 759 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);} -#line 2469 "ncgen.tab.c" +#line 2560 "ncgen.tab.c" break; - case 97: + case 97: /* attrdecl: typeref ambiguous_ref ':' _FILLVALUE '=' datalist */ #line 761 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),(yyvsp[-5].sym),(void*)(yyvsp[0].datalist),ISLIST);} -#line 2475 "ncgen.tab.c" +#line 2566 "ncgen.tab.c" break; - case 98: + case 98: /* attrdecl: ambiguous_ref ':' _STORAGE '=' conststring */ #line 763 "ncgen.y" {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2481 "ncgen.tab.c" +#line 2572 "ncgen.tab.c" break; - case 99: + case 99: /* attrdecl: ambiguous_ref ':' _CHUNKSIZES '=' intlist */ #line 765 "ncgen.y" {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);} -#line 2487 "ncgen.tab.c" +#line 2578 "ncgen.tab.c" break; - case 100: + case 100: /* attrdecl: ambiguous_ref ':' _FLETCHER32 '=' constbool */ #line 767 "ncgen.y" {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2493 "ncgen.tab.c" +#line 2584 "ncgen.tab.c" break; - case 101: + case 101: /* attrdecl: ambiguous_ref ':' _DEFLATELEVEL '=' constint */ #line 769 "ncgen.y" {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2499 "ncgen.tab.c" +#line 2590 "ncgen.tab.c" break; - case 102: + case 102: /* attrdecl: ambiguous_ref ':' _SHUFFLE '=' constbool */ #line 771 "ncgen.y" {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2505 "ncgen.tab.c" +#line 2596 "ncgen.tab.c" break; - case 103: + case 103: /* attrdecl: ambiguous_ref ':' _ENDIANNESS '=' conststring */ #line 773 "ncgen.y" {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2511 "ncgen.tab.c" +#line 2602 "ncgen.tab.c" break; - case 104: + case 104: /* attrdecl: ambiguous_ref ':' _FILTER '=' conststring */ #line 775 "ncgen.y" {(yyval.sym) = makespecial(_FILTER_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2517 "ncgen.tab.c" +#line 2608 "ncgen.tab.c" break; - case 105: + case 105: /* attrdecl: ambiguous_ref ':' _CODECS '=' conststring */ #line 777 "ncgen.y" {(yyval.sym) = makespecial(_CODECS_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2523 "ncgen.tab.c" +#line 2614 "ncgen.tab.c" break; - case 106: + case 106: /* attrdecl: ambiguous_ref ':' _QUANTIZEBG '=' constint */ #line 779 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEBG_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2529 "ncgen.tab.c" +#line 2620 "ncgen.tab.c" break; - case 107: + case 107: /* attrdecl: ambiguous_ref ':' _QUANTIZEGBR '=' constint */ #line 781 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEGBR_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2535 "ncgen.tab.c" +#line 2626 "ncgen.tab.c" break; - case 108: + case 108: /* attrdecl: ambiguous_ref ':' _QUANTIZEBR '=' constint */ #line 783 "ncgen.y" {(yyval.sym) = makespecial(_QUANTIZEBR_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2541 "ncgen.tab.c" +#line 2632 "ncgen.tab.c" break; - case 109: + case 109: /* attrdecl: ambiguous_ref ':' _NOFILL '=' constbool */ #line 785 "ncgen.y" {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2547 "ncgen.tab.c" +#line 2638 "ncgen.tab.c" break; - case 110: + case 110: /* attrdecl: ':' _FORMAT '=' conststring */ #line 787 "ncgen.y" {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);} -#line 2553 "ncgen.tab.c" +#line 2644 "ncgen.tab.c" break; - case 111: + case 111: /* path: ident */ #line 792 "ncgen.y" { (yyval.sym)=(yyvsp[0].sym); @@ -2560,10 +2651,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyvsp[0].sym)->is_prefixed=0; setpathcurrent((yyvsp[0].sym)); } -#line 2564 "ncgen.tab.c" +#line 2655 "ncgen.tab.c" break; - case 112: + case 112: /* path: PATH */ #line 799 "ncgen.y" { (yyval.sym)=(yyvsp[0].sym); @@ -2571,269 +2662,269 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); (yyvsp[0].sym)->is_prefixed=1; /* path is set in ncgen.l*/ } -#line 2575 "ncgen.tab.c" +#line 2666 "ncgen.tab.c" break; - case 114: + case 114: /* datasection: DATA */ #line 808 "ncgen.y" {} -#line 2581 "ncgen.tab.c" +#line 2672 "ncgen.tab.c" break; - case 115: + case 115: /* datasection: DATA datadecls */ #line 809 "ncgen.y" {} -#line 2587 "ncgen.tab.c" +#line 2678 "ncgen.tab.c" break; - case 118: + case 118: /* datadecl: varref '=' datalist */ #line 817 "ncgen.y" {(yyvsp[-2].sym)->data = (yyvsp[0].datalist);} -#line 2593 "ncgen.tab.c" +#line 2684 "ncgen.tab.c" break; - case 119: + case 119: /* datalist: datalist0 */ #line 820 "ncgen.y" {(yyval.datalist) = (yyvsp[0].datalist);} -#line 2599 "ncgen.tab.c" +#line 2690 "ncgen.tab.c" break; - case 120: + case 120: /* datalist: datalist1 */ #line 821 "ncgen.y" {(yyval.datalist) = (yyvsp[0].datalist);} -#line 2605 "ncgen.tab.c" +#line 2696 "ncgen.tab.c" break; - case 121: + case 121: /* datalist0: %empty */ #line 825 "ncgen.y" {(yyval.datalist) = builddatalist(0);} -#line 2611 "ncgen.tab.c" +#line 2702 "ncgen.tab.c" break; - case 122: + case 122: /* datalist1: dataitem */ #line 829 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2617 "ncgen.tab.c" +#line 2708 "ncgen.tab.c" break; - case 123: + case 123: /* datalist1: datalist ',' dataitem */ #line 831 "ncgen.y" {dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist); } -#line 2623 "ncgen.tab.c" +#line 2714 "ncgen.tab.c" break; - case 124: + case 124: /* dataitem: constdata */ #line 835 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2629 "ncgen.tab.c" +#line 2720 "ncgen.tab.c" break; - case 125: + case 125: /* dataitem: '{' datalist '}' */ #line 836 "ncgen.y" {(yyval.constant)=builddatasublist((yyvsp[-1].datalist));} -#line 2635 "ncgen.tab.c" +#line 2726 "ncgen.tab.c" break; - case 126: + case 126: /* constdata: simpleconstant */ #line 840 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2641 "ncgen.tab.c" +#line 2732 "ncgen.tab.c" break; - case 127: + case 127: /* constdata: OPAQUESTRING */ #line 841 "ncgen.y" {(yyval.constant)=makeconstdata(NC_OPAQUE);} -#line 2647 "ncgen.tab.c" +#line 2738 "ncgen.tab.c" break; - case 128: + case 128: /* constdata: FILLMARKER */ #line 842 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FILLVALUE);} -#line 2653 "ncgen.tab.c" +#line 2744 "ncgen.tab.c" break; - case 129: + case 129: /* constdata: NIL */ #line 843 "ncgen.y" {(yyval.constant)=makeconstdata(NC_NIL);} -#line 2659 "ncgen.tab.c" +#line 2750 "ncgen.tab.c" break; - case 130: + case 130: /* constdata: econstref */ #line 844 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2665 "ncgen.tab.c" +#line 2756 "ncgen.tab.c" break; - case 132: + case 132: /* econstref: path */ #line 849 "ncgen.y" {(yyval.constant) = makeenumconstref((yyvsp[0].sym));} -#line 2671 "ncgen.tab.c" +#line 2762 "ncgen.tab.c" break; - case 133: + case 133: /* function: ident '(' arglist ')' */ #line 853 "ncgen.y" {(yyval.constant)=evaluate((yyvsp[-3].sym),(yyvsp[-1].datalist));} -#line 2677 "ncgen.tab.c" +#line 2768 "ncgen.tab.c" break; - case 134: + case 134: /* arglist: simpleconstant */ #line 858 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2683 "ncgen.tab.c" +#line 2774 "ncgen.tab.c" break; - case 135: + case 135: /* arglist: arglist ',' simpleconstant */ #line 860 "ncgen.y" {dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist);} -#line 2689 "ncgen.tab.c" +#line 2780 "ncgen.tab.c" break; - case 136: + case 136: /* simpleconstant: CHAR_CONST */ #line 864 "ncgen.y" {(yyval.constant)=makeconstdata(NC_CHAR);} -#line 2695 "ncgen.tab.c" +#line 2786 "ncgen.tab.c" break; - case 137: + case 137: /* simpleconstant: BYTE_CONST */ #line 865 "ncgen.y" {(yyval.constant)=makeconstdata(NC_BYTE);} -#line 2701 "ncgen.tab.c" +#line 2792 "ncgen.tab.c" break; - case 138: + case 138: /* simpleconstant: SHORT_CONST */ #line 866 "ncgen.y" {(yyval.constant)=makeconstdata(NC_SHORT);} -#line 2707 "ncgen.tab.c" +#line 2798 "ncgen.tab.c" break; - case 139: + case 139: /* simpleconstant: INT_CONST */ #line 867 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} -#line 2713 "ncgen.tab.c" +#line 2804 "ncgen.tab.c" break; - case 140: + case 140: /* simpleconstant: INT64_CONST */ #line 868 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} -#line 2719 "ncgen.tab.c" +#line 2810 "ncgen.tab.c" break; - case 141: + case 141: /* simpleconstant: UBYTE_CONST */ #line 869 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UBYTE);} -#line 2725 "ncgen.tab.c" +#line 2816 "ncgen.tab.c" break; - case 142: + case 142: /* simpleconstant: USHORT_CONST */ #line 870 "ncgen.y" {(yyval.constant)=makeconstdata(NC_USHORT);} -#line 2731 "ncgen.tab.c" +#line 2822 "ncgen.tab.c" break; - case 143: + case 143: /* simpleconstant: UINT_CONST */ #line 871 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} -#line 2737 "ncgen.tab.c" +#line 2828 "ncgen.tab.c" break; - case 144: + case 144: /* simpleconstant: UINT64_CONST */ #line 872 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} -#line 2743 "ncgen.tab.c" +#line 2834 "ncgen.tab.c" break; - case 145: + case 145: /* simpleconstant: FLOAT_CONST */ #line 873 "ncgen.y" {(yyval.constant)=makeconstdata(NC_FLOAT);} -#line 2749 "ncgen.tab.c" +#line 2840 "ncgen.tab.c" break; - case 146: + case 146: /* simpleconstant: DOUBLE_CONST */ #line 874 "ncgen.y" {(yyval.constant)=makeconstdata(NC_DOUBLE);} -#line 2755 "ncgen.tab.c" +#line 2846 "ncgen.tab.c" break; - case 147: + case 147: /* simpleconstant: TERMSTRING */ #line 875 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} -#line 2761 "ncgen.tab.c" +#line 2852 "ncgen.tab.c" break; - case 148: + case 148: /* intlist: constint */ #line 879 "ncgen.y" {(yyval.datalist) = const2list((yyvsp[0].constant));} -#line 2767 "ncgen.tab.c" +#line 2858 "ncgen.tab.c" break; - case 149: + case 149: /* intlist: intlist ',' constint */ #line 880 "ncgen.y" {(yyval.datalist)=(yyvsp[-2].datalist); dlappend((yyvsp[-2].datalist),((yyvsp[0].constant)));} -#line 2773 "ncgen.tab.c" +#line 2864 "ncgen.tab.c" break; - case 150: + case 150: /* constint: INT_CONST */ #line 885 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT);} -#line 2779 "ncgen.tab.c" +#line 2870 "ncgen.tab.c" break; - case 151: + case 151: /* constint: UINT_CONST */ #line 887 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT);} -#line 2785 "ncgen.tab.c" +#line 2876 "ncgen.tab.c" break; - case 152: + case 152: /* constint: INT64_CONST */ #line 889 "ncgen.y" {(yyval.constant)=makeconstdata(NC_INT64);} -#line 2791 "ncgen.tab.c" +#line 2882 "ncgen.tab.c" break; - case 153: + case 153: /* constint: UINT64_CONST */ #line 891 "ncgen.y" {(yyval.constant)=makeconstdata(NC_UINT64);} -#line 2797 "ncgen.tab.c" +#line 2888 "ncgen.tab.c" break; - case 154: + case 154: /* conststring: TERMSTRING */ #line 895 "ncgen.y" {(yyval.constant)=makeconstdata(NC_STRING);} -#line 2803 "ncgen.tab.c" +#line 2894 "ncgen.tab.c" break; - case 155: + case 155: /* constbool: conststring */ #line 899 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2809 "ncgen.tab.c" +#line 2900 "ncgen.tab.c" break; - case 156: + case 156: /* constbool: constint */ #line 900 "ncgen.y" {(yyval.constant)=(yyvsp[0].constant);} -#line 2815 "ncgen.tab.c" +#line 2906 "ncgen.tab.c" break; - case 157: + case 157: /* varident: IDENT */ #line 908 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2821 "ncgen.tab.c" +#line 2912 "ncgen.tab.c" break; - case 158: + case 158: /* varident: DATA */ #line 909 "ncgen.y" {(yyval.sym)=identkeyword((yyvsp[0].sym));} -#line 2827 "ncgen.tab.c" +#line 2918 "ncgen.tab.c" break; - case 159: + case 159: /* ident: IDENT */ #line 913 "ncgen.y" {(yyval.sym)=(yyvsp[0].sym);} -#line 2833 "ncgen.tab.c" +#line 2924 "ncgen.tab.c" break; -#line 2837 "ncgen.tab.c" +#line 2928 "ncgen.tab.c" default: break; } @@ -2848,11 +2939,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); 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); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2876,50 +2966,44 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); 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); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { + yypcontext_t yyctx + = {yyssp, yytoken}; char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); if (yysyntax_error_status == 0) yymsgp = yymsg; - else if (yysyntax_error_status == 1) + else if (yysyntax_error_status == -1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (!yymsg) + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; } else { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; } } yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -2952,6 +3036,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2968,13 +3053,14 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -2988,7 +3074,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); yydestruct ("Error: popping", - yystos[yystate], yyvsp); + YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -3000,7 +3086,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -3011,7 +3097,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -3019,24 +3105,22 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -3052,19 +3136,18 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[+*yyssp], yyvsp); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); -#endif return yyresult; } + #line 916 "ncgen.y" diff --git a/ncgen/ncgen.tab.h b/ncgen/ncgen.tab.h index 2cc18ba6f3..616fd2c2d2 100644 --- a/ncgen/ncgen.tab.h +++ b/ncgen/ncgen.tab.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_NCG_NCGEN_TAB_H_INCLUDED # define YY_NCG_NCGEN_TAB_H_INCLUDED @@ -44,69 +45,74 @@ extern int ncgdebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - NC_UNLIMITED_K = 258, - CHAR_K = 259, - BYTE_K = 260, - SHORT_K = 261, - INT_K = 262, - FLOAT_K = 263, - DOUBLE_K = 264, - UBYTE_K = 265, - USHORT_K = 266, - UINT_K = 267, - INT64_K = 268, - UINT64_K = 269, - STRING_K = 270, - IDENT = 271, - TERMSTRING = 272, - CHAR_CONST = 273, - BYTE_CONST = 274, - SHORT_CONST = 275, - INT_CONST = 276, - INT64_CONST = 277, - UBYTE_CONST = 278, - USHORT_CONST = 279, - UINT_CONST = 280, - UINT64_CONST = 281, - FLOAT_CONST = 282, - DOUBLE_CONST = 283, - DIMENSIONS = 284, - VARIABLES = 285, - NETCDF = 286, - DATA = 287, - TYPES = 288, - COMPOUND = 289, - ENUM = 290, - OPAQUE_ = 291, - OPAQUESTRING = 292, - GROUP = 293, - PATH = 294, - FILLMARKER = 295, - NIL = 296, - _FILLVALUE = 297, - _FORMAT = 298, - _STORAGE = 299, - _CHUNKSIZES = 300, - _DEFLATELEVEL = 301, - _SHUFFLE = 302, - _ENDIANNESS = 303, - _NOFILL = 304, - _FLETCHER32 = 305, - _NCPROPS = 306, - _ISNETCDF4 = 307, - _SUPERBLOCK = 308, - _FILTER = 309, - _CODECS = 310, - _QUANTIZEBG = 311, - _QUANTIZEGBR = 312, - _QUANTIZEBR = 313, - DATASETID = 314 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + NC_UNLIMITED_K = 258, /* NC_UNLIMITED_K */ + CHAR_K = 259, /* CHAR_K */ + BYTE_K = 260, /* BYTE_K */ + SHORT_K = 261, /* SHORT_K */ + INT_K = 262, /* INT_K */ + FLOAT_K = 263, /* FLOAT_K */ + DOUBLE_K = 264, /* DOUBLE_K */ + UBYTE_K = 265, /* UBYTE_K */ + USHORT_K = 266, /* USHORT_K */ + UINT_K = 267, /* UINT_K */ + INT64_K = 268, /* INT64_K */ + UINT64_K = 269, /* UINT64_K */ + STRING_K = 270, /* STRING_K */ + IDENT = 271, /* IDENT */ + TERMSTRING = 272, /* TERMSTRING */ + CHAR_CONST = 273, /* CHAR_CONST */ + BYTE_CONST = 274, /* BYTE_CONST */ + SHORT_CONST = 275, /* SHORT_CONST */ + INT_CONST = 276, /* INT_CONST */ + INT64_CONST = 277, /* INT64_CONST */ + UBYTE_CONST = 278, /* UBYTE_CONST */ + USHORT_CONST = 279, /* USHORT_CONST */ + UINT_CONST = 280, /* UINT_CONST */ + UINT64_CONST = 281, /* UINT64_CONST */ + FLOAT_CONST = 282, /* FLOAT_CONST */ + DOUBLE_CONST = 283, /* DOUBLE_CONST */ + DIMENSIONS = 284, /* DIMENSIONS */ + VARIABLES = 285, /* VARIABLES */ + NETCDF = 286, /* NETCDF */ + DATA = 287, /* DATA */ + TYPES = 288, /* TYPES */ + COMPOUND = 289, /* COMPOUND */ + ENUM = 290, /* ENUM */ + OPAQUE_ = 291, /* OPAQUE_ */ + OPAQUESTRING = 292, /* OPAQUESTRING */ + GROUP = 293, /* GROUP */ + PATH = 294, /* PATH */ + FILLMARKER = 295, /* FILLMARKER */ + NIL = 296, /* NIL */ + _FILLVALUE = 297, /* _FILLVALUE */ + _FORMAT = 298, /* _FORMAT */ + _STORAGE = 299, /* _STORAGE */ + _CHUNKSIZES = 300, /* _CHUNKSIZES */ + _DEFLATELEVEL = 301, /* _DEFLATELEVEL */ + _SHUFFLE = 302, /* _SHUFFLE */ + _ENDIANNESS = 303, /* _ENDIANNESS */ + _NOFILL = 304, /* _NOFILL */ + _FLETCHER32 = 305, /* _FLETCHER32 */ + _NCPROPS = 306, /* _NCPROPS */ + _ISNETCDF4 = 307, /* _ISNETCDF4 */ + _SUPERBLOCK = 308, /* _SUPERBLOCK */ + _FILTER = 309, /* _FILTER */ + _CODECS = 310, /* _CODECS */ + _QUANTIZEBG = 311, /* _QUANTIZEBG */ + _QUANTIZEGBR = 312, /* _QUANTIZEGBR */ + _QUANTIZEBR = 313, /* _QUANTIZEBR */ + DATASETID = 314 /* DATASETID */ }; + typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ @@ -122,7 +128,7 @@ int nctype; /* for tracking attribute list type*/ Datalist* datalist; NCConstant* constant; -#line 126 "ncgen.tab.h" +#line 132 "ncgen.tab.h" }; typedef union YYSTYPE YYSTYPE; @@ -133,6 +139,8 @@ typedef union YYSTYPE YYSTYPE; extern YYSTYPE ncglval; + int ncgparse (void); + #endif /* !YY_NCG_NCGEN_TAB_H_INCLUDED */ diff --git a/oc2/dap.tab.c b/oc2/dap.tab.c index 6563e95cd2..ea913c8dd3 100644 --- a/oc2/dap.tab.c +++ b/oc2/dap.tab.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.5.1" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -78,7 +79,7 @@ #include "dap.tab.h" int dapdebug = 0; -#line 82 "dap.tab.c" +#line 83 "dap.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -101,71 +102,84 @@ int dapdebug = 0; # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_DAP_DAP_TAB_H_INCLUDED -# define YY_DAP_DAP_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int dapdebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - SCAN_ALIAS = 258, - SCAN_ARRAY = 259, - SCAN_ATTR = 260, - SCAN_BYTE = 261, - SCAN_CODE = 262, - SCAN_DATASET = 263, - SCAN_DATA = 264, - SCAN_ERROR = 265, - SCAN_FLOAT32 = 266, - SCAN_FLOAT64 = 267, - SCAN_GRID = 268, - SCAN_INT16 = 269, - SCAN_INT32 = 270, - SCAN_MAPS = 271, - SCAN_MESSAGE = 272, - SCAN_SEQUENCE = 273, - SCAN_STRING = 274, - SCAN_STRUCTURE = 275, - SCAN_UINT16 = 276, - SCAN_UINT32 = 277, - SCAN_URL = 278, - SCAN_PTYPE = 279, - SCAN_PROG = 280, - WORD_WORD = 281, - WORD_STRING = 282 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int dapparse (DAPparsestate* parsestate); +#include "dap.tab.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_SCAN_ALIAS = 3, /* SCAN_ALIAS */ + YYSYMBOL_SCAN_ARRAY = 4, /* SCAN_ARRAY */ + YYSYMBOL_SCAN_ATTR = 5, /* SCAN_ATTR */ + YYSYMBOL_SCAN_BYTE = 6, /* SCAN_BYTE */ + YYSYMBOL_SCAN_CODE = 7, /* SCAN_CODE */ + YYSYMBOL_SCAN_DATASET = 8, /* SCAN_DATASET */ + YYSYMBOL_SCAN_DATA = 9, /* SCAN_DATA */ + YYSYMBOL_SCAN_ERROR = 10, /* SCAN_ERROR */ + YYSYMBOL_SCAN_FLOAT32 = 11, /* SCAN_FLOAT32 */ + YYSYMBOL_SCAN_FLOAT64 = 12, /* SCAN_FLOAT64 */ + YYSYMBOL_SCAN_GRID = 13, /* SCAN_GRID */ + YYSYMBOL_SCAN_INT16 = 14, /* SCAN_INT16 */ + YYSYMBOL_SCAN_INT32 = 15, /* SCAN_INT32 */ + YYSYMBOL_SCAN_MAPS = 16, /* SCAN_MAPS */ + YYSYMBOL_SCAN_MESSAGE = 17, /* SCAN_MESSAGE */ + YYSYMBOL_SCAN_SEQUENCE = 18, /* SCAN_SEQUENCE */ + YYSYMBOL_SCAN_STRING = 19, /* SCAN_STRING */ + YYSYMBOL_SCAN_STRUCTURE = 20, /* SCAN_STRUCTURE */ + YYSYMBOL_SCAN_UINT16 = 21, /* SCAN_UINT16 */ + YYSYMBOL_SCAN_UINT32 = 22, /* SCAN_UINT32 */ + YYSYMBOL_SCAN_URL = 23, /* SCAN_URL */ + YYSYMBOL_SCAN_PTYPE = 24, /* SCAN_PTYPE */ + YYSYMBOL_SCAN_PROG = 25, /* SCAN_PROG */ + YYSYMBOL_WORD_WORD = 26, /* WORD_WORD */ + YYSYMBOL_WORD_STRING = 27, /* WORD_STRING */ + YYSYMBOL_28_ = 28, /* '{' */ + YYSYMBOL_29_ = 29, /* '}' */ + YYSYMBOL_30_ = 30, /* ';' */ + YYSYMBOL_31_ = 31, /* ':' */ + YYSYMBOL_32_ = 32, /* '[' */ + YYSYMBOL_33_ = 33, /* ']' */ + YYSYMBOL_34_ = 34, /* '=' */ + YYSYMBOL_35_ = 35, /* ',' */ + YYSYMBOL_YYACCEPT = 36, /* $accept */ + YYSYMBOL_start = 37, /* start */ + YYSYMBOL_dataset = 38, /* dataset */ + YYSYMBOL_attr = 39, /* attr */ + YYSYMBOL_err = 40, /* err */ + YYSYMBOL_datasetbody = 41, /* datasetbody */ + YYSYMBOL_declarations = 42, /* declarations */ + YYSYMBOL_declaration = 43, /* declaration */ + YYSYMBOL_base_type = 44, /* base_type */ + YYSYMBOL_array_decls = 45, /* array_decls */ + YYSYMBOL_array_decl = 46, /* array_decl */ + YYSYMBOL_datasetname = 47, /* datasetname */ + YYSYMBOL_var_name = 48, /* var_name */ + YYSYMBOL_attributebody = 49, /* attributebody */ + YYSYMBOL_attr_list = 50, /* attr_list */ + YYSYMBOL_attribute = 51, /* attribute */ + YYSYMBOL_bytes = 52, /* bytes */ + YYSYMBOL_int16 = 53, /* int16 */ + YYSYMBOL_uint16 = 54, /* uint16 */ + YYSYMBOL_int32 = 55, /* int32 */ + YYSYMBOL_uint32 = 56, /* uint32 */ + YYSYMBOL_float32 = 57, /* float32 */ + YYSYMBOL_float64 = 58, /* float64 */ + YYSYMBOL_strs = 59, /* strs */ + YYSYMBOL_urls = 60, /* urls */ + YYSYMBOL_url = 61, /* url */ + YYSYMBOL_str_or_id = 62, /* str_or_id */ + YYSYMBOL_alias = 63, /* alias */ + YYSYMBOL_errorbody = 64, /* errorbody */ + YYSYMBOL_errorcode = 65, /* errorcode */ + YYSYMBOL_errormsg = 66, /* errormsg */ + YYSYMBOL_errorptype = 67, /* errorptype */ + YYSYMBOL_errorprog = 68, /* errorprog */ + YYSYMBOL_name = 69 /* name */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; -#endif /* !YY_DAP_DAP_TAB_H_INCLUDED */ @@ -206,6 +220,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -265,6 +291,7 @@ typedef int yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + /* Stored state numbers (used for stacks). */ typedef yytype_uint8 yy_state_t; @@ -283,6 +310,7 @@ typedef int yy_state_fast_t; # endif #endif + #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -301,17 +329,23 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -340,7 +374,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined yyoverflow || YYERROR_VERBOSE +#if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -405,8 +439,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* 1 */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -482,14 +515,16 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 201 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 282 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ @@ -527,7 +562,7 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 54, 54, 55, 56, 57, 58, 62, 66, 70, @@ -544,37 +579,39 @@ static const yytype_int16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 1 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if 1 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "SCAN_ALIAS", "SCAN_ARRAY", "SCAN_ATTR", - "SCAN_BYTE", "SCAN_CODE", "SCAN_DATASET", "SCAN_DATA", "SCAN_ERROR", - "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_GRID", "SCAN_INT16", "SCAN_INT32", - "SCAN_MAPS", "SCAN_MESSAGE", "SCAN_SEQUENCE", "SCAN_STRING", - "SCAN_STRUCTURE", "SCAN_UINT16", "SCAN_UINT32", "SCAN_URL", "SCAN_PTYPE", - "SCAN_PROG", "WORD_WORD", "WORD_STRING", "'{'", "'}'", "';'", "':'", - "'['", "']'", "'='", "','", "$accept", "start", "dataset", "attr", "err", - "datasetbody", "declarations", "declaration", "base_type", "array_decls", - "array_decl", "datasetname", "var_name", "attributebody", "attr_list", - "attribute", "bytes", "int16", "uint16", "int32", "uint32", "float32", - "float64", "strs", "urls", "url", "str_or_id", "alias", "errorbody", - "errorcode", "errormsg", "errorptype", "errorprog", "name", YY_NULLPTR + "\"end of file\"", "error", "\"invalid token\"", "SCAN_ALIAS", + "SCAN_ARRAY", "SCAN_ATTR", "SCAN_BYTE", "SCAN_CODE", "SCAN_DATASET", + "SCAN_DATA", "SCAN_ERROR", "SCAN_FLOAT32", "SCAN_FLOAT64", "SCAN_GRID", + "SCAN_INT16", "SCAN_INT32", "SCAN_MAPS", "SCAN_MESSAGE", "SCAN_SEQUENCE", + "SCAN_STRING", "SCAN_STRUCTURE", "SCAN_UINT16", "SCAN_UINT32", + "SCAN_URL", "SCAN_PTYPE", "SCAN_PROG", "WORD_WORD", "WORD_STRING", "'{'", + "'}'", "';'", "':'", "'['", "']'", "'='", "','", "$accept", "start", + "dataset", "attr", "err", "datasetbody", "declarations", "declaration", + "base_type", "array_decls", "array_decl", "datasetname", "var_name", + "attributebody", "attr_list", "attribute", "bytes", "int16", "uint16", + "int32", "uint32", "float32", "float64", "strs", "urls", "url", + "str_or_id", "alias", "errorbody", "errorcode", "errormsg", "errorptype", + "errorprog", "name", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 123, 125, - 59, 58, 91, 93, 61, 44 -}; -# endif + return yytname[yysymbol]; +} +#endif #define YYPACT_NINF (-91) @@ -586,8 +623,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 6, -91, -91, -91, -91, 9, -22, 7, -16, -91, @@ -613,9 +650,9 @@ static const yytype_int16 yypact[] = -91 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 0, 6, 8, 7, 9, 0, 0, 0, 0, 1, @@ -641,7 +678,7 @@ static const yytype_int8 yydefact[] = 16 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -91, -91, -91, -91, -91, -91, -69, -15, -91, -17, @@ -650,18 +687,18 @@ static const yytype_int8 yypgoto[] = -91, -91, -91, -18 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = { - -1, 5, 6, 7, 8, 11, 17, 36, 37, 108, + 0, 5, 6, 7, 8, 11, 17, 36, 37, 108, 143, 84, 85, 14, 19, 64, 111, 117, 125, 119, 127, 113, 115, 121, 128, 129, 130, 65, 16, 21, 69, 103, 136, 86 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 87, 66, 105, 106, 122, 140, 10, 1, 12, 9, @@ -744,8 +781,8 @@ static const yytype_int16 yycheck[] = 14, 15, -1, -1, 18, 19, 20, 21, 22, 23 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 1, 5, 8, 10, 37, 38, 39, 40, 0, @@ -771,7 +808,7 @@ static const yytype_int8 yystos[] = 30 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 36, 37, 37, 37, 37, 37, 38, 39, 40, @@ -787,7 +824,7 @@ static const yytype_int8 yyr1[] = 69, 69, 69, 69, 69, 69, 69 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 2, 3, 2, 2, 1, 1, 1, 1, @@ -804,14 +841,15 @@ static const yytype_int8 yyr2[] = }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -833,10 +871,9 @@ static const yytype_int8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -853,19 +890,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value, parsestate); \ + Kind, Value, parsestate); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -876,19 +910,16 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) { FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (parsestate); + YY_USE (yyoutput); + YY_USE (parsestate); if (!yyvaluep) return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -898,12 +929,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DA `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, DAPparsestate* parsestate) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep, parsestate); + yy_symbol_value_print (yyo, yykind, yyvaluep, parsestate); YYFPRINTF (yyo, ")"); } @@ -936,7 +968,8 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DAPparsestate* parsestate) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule, DAPparsestate* parsestate) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; @@ -948,9 +981,8 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, DAPparsestate* p { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[+yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , parsestate); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], parsestate); YYFPRINTF (stderr, "\n"); } } @@ -965,8 +997,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -989,12 +1021,60 @@ int yydebug; #endif -#if YYERROR_VERBOSE +/* Context of a parse error. */ +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; +} yypcontext_t; + +/* Put in YYARG at most YYARGN of the expected tokens given the + current YYCTX, and return the number of tokens stored in YYARG. If + YYARG is null, return the number of expected tokens (guaranteed to + be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. + Return 0 if there are more than YYARGN expected tokens, yet fill + YYARG up to YYARGN. */ +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + 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; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; +} -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else + + + +#ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ static YYPTRDIFF_T yystrlen (const char *yystr) @@ -1004,13 +1084,13 @@ yystrlen (const char *yystr) continue; return yylen; } -# endif # endif +#endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else +#ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * @@ -1024,10 +1104,10 @@ yystpcpy (char *yydest, const char *yysrc) return yyd - 1; } -# endif # endif +#endif -# ifndef yytnamerr +#ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string @@ -1042,7 +1122,6 @@ yytnamerr (char *yyres, const char *yystr) { YYPTRDIFF_T yyn = 0; char const *yyp = yystr; - for (;;) switch (*++yyp) { @@ -1076,31 +1155,15 @@ yytnamerr (char *yyres, const char *yystr) else return yystrlen (yystr); } -# endif +#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 (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - yy_state_t *yyssp, int yytoken) +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) { - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Actual size of YYARG. */ int yycount = 0; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -1124,52 +1187,54 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, 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 (yyctx->yytoken != YYSYMBOL_YYEMPTY) { - int yyn = yypact[+*yyssp]; - YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - yysize = yysize0; - 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; - - 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]; - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; } + return yycount; +} + +/* 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 YYENOMEM if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; switch (yycount) { -# define YYCASE_(N, S) \ +#define YYCASE_(N, S) \ case N: \ yyformat = S; \ - break + break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); @@ -1177,17 +1242,23 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, 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_ +#undef YYCASE_ } + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; { - /* Don't count the "%s"s in the final size, but reserve room for - the terminator. */ - YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } } if (*yymsg_alloc < yysize) @@ -1196,7 +1267,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; + return -1; } /* Avoid sprintf, as that infringes on the user's name space. @@ -1208,7 +1279,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr (yyp, yyarg[yyi++]); + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); yyformat += 2; } else @@ -1219,29 +1290,32 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, } return 0; } -#endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DAPparsestate* parsestate) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, DAPparsestate* parsestate) { - YYUSE (yyvaluep); - YYUSE (parsestate); + YY_USE (yyvaluep); + YY_USE (parsestate); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } + + /*----------. | yyparse. | `----------*/ @@ -1249,7 +1323,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, DAPparsestate* par int yyparse (DAPparsestate* parsestate) { -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; @@ -1260,45 +1334,41 @@ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ - int yynerrs; + int yynerrs = 0; - yy_state_fast_t yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYPTRDIFF_T yystacksize; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; -#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1306,16 +1376,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1337,10 +1401,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1368,7 +1433,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1379,10 +1444,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1401,6 +1466,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1421,18 +1487,29 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (&yylval, parsestate); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1501,614 +1578,614 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YY_REDUCE_PRINT (yyn); switch (yyn) { - case 6: + case 6: /* start: error */ #line 58 "dap.y" {dap_unrecognizedresponse(parsestate); YYABORT;} -#line 1508 "dap.tab.c" +#line 1585 "dap.tab.c" break; - case 7: + case 7: /* dataset: SCAN_DATASET */ #line 63 "dap.y" {dap_tagparse(parsestate,SCAN_DATASET);} -#line 1514 "dap.tab.c" +#line 1591 "dap.tab.c" break; - case 8: + case 8: /* attr: SCAN_ATTR */ #line 67 "dap.y" {dap_tagparse(parsestate,SCAN_ATTR);} -#line 1520 "dap.tab.c" +#line 1597 "dap.tab.c" break; - case 9: + case 9: /* err: SCAN_ERROR */ #line 71 "dap.y" {dap_tagparse(parsestate,SCAN_ERROR);} -#line 1526 "dap.tab.c" +#line 1603 "dap.tab.c" break; - case 10: + case 10: /* datasetbody: '{' declarations '}' datasetname ';' */ #line 76 "dap.y" {dap_datasetbody(parsestate,yyvsp[-1],yyvsp[-3]);} -#line 1532 "dap.tab.c" +#line 1609 "dap.tab.c" break; - case 11: + case 11: /* declarations: %empty */ #line 81 "dap.y" {yyval=dap_declarations(parsestate,null,null);} -#line 1538 "dap.tab.c" +#line 1615 "dap.tab.c" break; - case 12: + case 12: /* declarations: declarations declaration */ #line 82 "dap.y" {yyval=dap_declarations(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1544 "dap.tab.c" +#line 1621 "dap.tab.c" break; - case 13: + case 13: /* declaration: base_type var_name array_decls ';' */ #line 89 "dap.y" {yyval=dap_makebase(parsestate,yyvsp[-2],yyvsp[-3],yyvsp[-1]);} -#line 1550 "dap.tab.c" +#line 1627 "dap.tab.c" break; - case 14: + case 14: /* declaration: SCAN_STRUCTURE '{' declarations '}' var_name array_decls ';' */ #line 91 "dap.y" {if((yyval=dap_makestructure(parsestate,yyvsp[-2],yyvsp[-1],yyvsp[-4]))==null) {YYABORT;}} -#line 1556 "dap.tab.c" +#line 1633 "dap.tab.c" break; - case 15: + case 15: /* declaration: SCAN_SEQUENCE '{' declarations '}' var_name ';' */ #line 93 "dap.y" {if((yyval=dap_makesequence(parsestate,yyvsp[-1],yyvsp[-3]))==null) {YYABORT;}} -#line 1562 "dap.tab.c" +#line 1639 "dap.tab.c" break; - case 16: + case 16: /* declaration: SCAN_GRID '{' SCAN_ARRAY ':' declaration SCAN_MAPS ':' declarations '}' var_name ';' */ #line 96 "dap.y" {if((yyval=dap_makegrid(parsestate,yyvsp[-1],yyvsp[-6],yyvsp[-3]))==null) {YYABORT;}} -#line 1568 "dap.tab.c" +#line 1645 "dap.tab.c" break; - case 17: + case 17: /* declaration: error */ #line 98 "dap.y" {dapsemanticerror(parsestate,OC_EBADTYPE,"Unrecognized type"); YYABORT;} -#line 1574 "dap.tab.c" +#line 1651 "dap.tab.c" break; - case 18: + case 18: /* base_type: SCAN_BYTE */ #line 103 "dap.y" {yyval=(Object)SCAN_BYTE;} -#line 1580 "dap.tab.c" +#line 1657 "dap.tab.c" break; - case 19: + case 19: /* base_type: SCAN_INT16 */ #line 104 "dap.y" {yyval=(Object)SCAN_INT16;} -#line 1586 "dap.tab.c" +#line 1663 "dap.tab.c" break; - case 20: + case 20: /* base_type: SCAN_UINT16 */ #line 105 "dap.y" {yyval=(Object)SCAN_UINT16;} -#line 1592 "dap.tab.c" +#line 1669 "dap.tab.c" break; - case 21: + case 21: /* base_type: SCAN_INT32 */ #line 106 "dap.y" {yyval=(Object)SCAN_INT32;} -#line 1598 "dap.tab.c" +#line 1675 "dap.tab.c" break; - case 22: + case 22: /* base_type: SCAN_UINT32 */ #line 107 "dap.y" {yyval=(Object)SCAN_UINT32;} -#line 1604 "dap.tab.c" +#line 1681 "dap.tab.c" break; - case 23: + case 23: /* base_type: SCAN_FLOAT32 */ #line 108 "dap.y" {yyval=(Object)SCAN_FLOAT32;} -#line 1610 "dap.tab.c" +#line 1687 "dap.tab.c" break; - case 24: + case 24: /* base_type: SCAN_FLOAT64 */ #line 109 "dap.y" {yyval=(Object)SCAN_FLOAT64;} -#line 1616 "dap.tab.c" +#line 1693 "dap.tab.c" break; - case 25: + case 25: /* base_type: SCAN_URL */ #line 110 "dap.y" {yyval=(Object)SCAN_URL;} -#line 1622 "dap.tab.c" +#line 1699 "dap.tab.c" break; - case 26: + case 26: /* base_type: SCAN_STRING */ #line 111 "dap.y" {yyval=(Object)SCAN_STRING;} -#line 1628 "dap.tab.c" +#line 1705 "dap.tab.c" break; - case 27: + case 27: /* array_decls: %empty */ #line 115 "dap.y" {yyval=dap_arraydecls(parsestate,null,null);} -#line 1634 "dap.tab.c" +#line 1711 "dap.tab.c" break; - case 28: + case 28: /* array_decls: array_decls array_decl */ #line 116 "dap.y" {yyval=dap_arraydecls(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1640 "dap.tab.c" +#line 1717 "dap.tab.c" break; - case 29: + case 29: /* array_decl: '[' WORD_WORD ']' */ #line 120 "dap.y" {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} -#line 1646 "dap.tab.c" +#line 1723 "dap.tab.c" break; - case 30: + case 30: /* array_decl: '[' '=' WORD_WORD ']' */ #line 121 "dap.y" {yyval=dap_arraydecl(parsestate,null,yyvsp[-1]);} -#line 1652 "dap.tab.c" +#line 1729 "dap.tab.c" break; - case 31: + case 31: /* array_decl: '[' name '=' WORD_WORD ']' */ #line 122 "dap.y" {yyval=dap_arraydecl(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1658 "dap.tab.c" +#line 1735 "dap.tab.c" break; - case 32: + case 32: /* array_decl: error */ #line 124 "dap.y" {dapsemanticerror(parsestate,OC_EDIMSIZE,"Illegal dimension declaration"); YYABORT;} -#line 1664 "dap.tab.c" +#line 1741 "dap.tab.c" break; - case 33: + case 33: /* datasetname: var_name */ #line 128 "dap.y" {yyval=yyvsp[0];} -#line 1670 "dap.tab.c" +#line 1747 "dap.tab.c" break; - case 34: + case 34: /* datasetname: error */ #line 130 "dap.y" {dapsemanticerror(parsestate,OC_EDDS,"Illegal dataset declaration"); YYABORT;} -#line 1676 "dap.tab.c" +#line 1753 "dap.tab.c" break; - case 35: + case 35: /* var_name: name */ #line 133 "dap.y" {yyval=yyvsp[0];} -#line 1682 "dap.tab.c" +#line 1759 "dap.tab.c" break; - case 36: + case 36: /* attributebody: '{' attr_list '}' */ #line 136 "dap.y" {dap_attributebody(parsestate,yyvsp[-1]);} -#line 1688 "dap.tab.c" +#line 1765 "dap.tab.c" break; - case 37: + case 37: /* attributebody: error */ #line 138 "dap.y" {dapsemanticerror(parsestate,OC_EDAS,"Illegal DAS body"); YYABORT;} -#line 1694 "dap.tab.c" +#line 1771 "dap.tab.c" break; - case 38: + case 38: /* attr_list: %empty */ #line 142 "dap.y" {yyval=dap_attrlist(parsestate,null,null);} -#line 1700 "dap.tab.c" +#line 1777 "dap.tab.c" break; - case 39: + case 39: /* attr_list: attr_list attribute */ #line 143 "dap.y" {yyval=dap_attrlist(parsestate,yyvsp[-1],yyvsp[0]);} -#line 1706 "dap.tab.c" +#line 1783 "dap.tab.c" break; - case 40: + case 40: /* attribute: alias ';' */ #line 147 "dap.y" {yyval=null;} -#line 1712 "dap.tab.c" +#line 1789 "dap.tab.c" break; - case 41: + case 41: /* attribute: SCAN_BYTE name bytes ';' */ #line 149 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_BYTE);} -#line 1718 "dap.tab.c" +#line 1795 "dap.tab.c" break; - case 42: + case 42: /* attribute: SCAN_INT16 name int16 ';' */ #line 151 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT16);} -#line 1724 "dap.tab.c" +#line 1801 "dap.tab.c" break; - case 43: + case 43: /* attribute: SCAN_UINT16 name uint16 ';' */ #line 153 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT16);} -#line 1730 "dap.tab.c" +#line 1807 "dap.tab.c" break; - case 44: + case 44: /* attribute: SCAN_INT32 name int32 ';' */ #line 155 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_INT32);} -#line 1736 "dap.tab.c" +#line 1813 "dap.tab.c" break; - case 45: + case 45: /* attribute: SCAN_UINT32 name uint32 ';' */ #line 157 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_UINT32);} -#line 1742 "dap.tab.c" +#line 1819 "dap.tab.c" break; - case 46: + case 46: /* attribute: SCAN_FLOAT32 name float32 ';' */ #line 159 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT32);} -#line 1748 "dap.tab.c" +#line 1825 "dap.tab.c" break; - case 47: + case 47: /* attribute: SCAN_FLOAT64 name float64 ';' */ #line 161 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_FLOAT64);} -#line 1754 "dap.tab.c" +#line 1831 "dap.tab.c" break; - case 48: + case 48: /* attribute: SCAN_STRING name strs ';' */ #line 163 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_STRING);} -#line 1760 "dap.tab.c" +#line 1837 "dap.tab.c" break; - case 49: + case 49: /* attribute: SCAN_URL name urls ';' */ #line 165 "dap.y" {yyval=dap_attribute(parsestate,yyvsp[-2],yyvsp[-1],(Object)SCAN_URL);} -#line 1766 "dap.tab.c" +#line 1843 "dap.tab.c" break; - case 50: + case 50: /* attribute: name '{' attr_list '}' */ #line 166 "dap.y" {yyval=dap_attrset(parsestate,yyvsp[-3],yyvsp[-1]);} -#line 1772 "dap.tab.c" +#line 1849 "dap.tab.c" break; - case 51: + case 51: /* attribute: error */ #line 168 "dap.y" {dapsemanticerror(parsestate,OC_EDAS,"Illegal attribute"); YYABORT;} -#line 1778 "dap.tab.c" +#line 1855 "dap.tab.c" break; - case 52: + case 52: /* bytes: WORD_WORD */ #line 172 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_BYTE);} -#line 1784 "dap.tab.c" +#line 1861 "dap.tab.c" break; - case 53: + case 53: /* bytes: bytes ',' WORD_WORD */ #line 174 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_BYTE);} -#line 1790 "dap.tab.c" +#line 1867 "dap.tab.c" break; - case 54: + case 54: /* int16: WORD_WORD */ #line 177 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT16);} -#line 1796 "dap.tab.c" +#line 1873 "dap.tab.c" break; - case 55: + case 55: /* int16: int16 ',' WORD_WORD */ #line 179 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT16);} -#line 1802 "dap.tab.c" +#line 1879 "dap.tab.c" break; - case 56: + case 56: /* uint16: WORD_WORD */ #line 182 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT16);} -#line 1808 "dap.tab.c" +#line 1885 "dap.tab.c" break; - case 57: + case 57: /* uint16: uint16 ',' WORD_WORD */ #line 184 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT16);} -#line 1814 "dap.tab.c" +#line 1891 "dap.tab.c" break; - case 58: + case 58: /* int32: WORD_WORD */ #line 187 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_INT32);} -#line 1820 "dap.tab.c" +#line 1897 "dap.tab.c" break; - case 59: + case 59: /* int32: int32 ',' WORD_WORD */ #line 189 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_INT32);} -#line 1826 "dap.tab.c" +#line 1903 "dap.tab.c" break; - case 60: + case 60: /* uint32: WORD_WORD */ #line 192 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_UINT32);} -#line 1832 "dap.tab.c" +#line 1909 "dap.tab.c" break; - case 61: + case 61: /* uint32: uint32 ',' WORD_WORD */ #line 193 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_UINT32);} -#line 1838 "dap.tab.c" +#line 1915 "dap.tab.c" break; - case 62: + case 62: /* float32: WORD_WORD */ #line 196 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT32);} -#line 1844 "dap.tab.c" +#line 1921 "dap.tab.c" break; - case 63: + case 63: /* float32: float32 ',' WORD_WORD */ #line 197 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT32);} -#line 1850 "dap.tab.c" +#line 1927 "dap.tab.c" break; - case 64: + case 64: /* float64: WORD_WORD */ #line 200 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_FLOAT64);} -#line 1856 "dap.tab.c" +#line 1933 "dap.tab.c" break; - case 65: + case 65: /* float64: float64 ',' WORD_WORD */ #line 201 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_FLOAT64);} -#line 1862 "dap.tab.c" +#line 1939 "dap.tab.c" break; - case 66: + case 66: /* strs: str_or_id */ #line 204 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_STRING);} -#line 1868 "dap.tab.c" +#line 1945 "dap.tab.c" break; - case 67: + case 67: /* strs: strs ',' str_or_id */ #line 205 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_STRING);} -#line 1874 "dap.tab.c" +#line 1951 "dap.tab.c" break; - case 68: + case 68: /* urls: url */ #line 209 "dap.y" {yyval=dap_attrvalue(parsestate,null,yyvsp[0],(Object)SCAN_URL);} -#line 1880 "dap.tab.c" +#line 1957 "dap.tab.c" break; - case 69: + case 69: /* urls: urls ',' url */ #line 210 "dap.y" {yyval=dap_attrvalue(parsestate,yyvsp[-2],yyvsp[0],(Object)SCAN_URL);} -#line 1886 "dap.tab.c" +#line 1963 "dap.tab.c" break; - case 70: + case 70: /* url: str_or_id */ #line 214 "dap.y" {yyval=yyvsp[0];} -#line 1892 "dap.tab.c" +#line 1969 "dap.tab.c" break; - case 71: + case 71: /* str_or_id: name */ #line 218 "dap.y" {yyval=yyvsp[0];} -#line 1898 "dap.tab.c" +#line 1975 "dap.tab.c" break; - case 72: + case 72: /* str_or_id: WORD_STRING */ #line 219 "dap.y" {yyval=yyvsp[0];} -#line 1904 "dap.tab.c" +#line 1981 "dap.tab.c" break; - case 73: + case 73: /* alias: SCAN_ALIAS WORD_WORD WORD_WORD */ #line 230 "dap.y" {yyval=yyvsp[-1]; yyval=yyvsp[0]; yyval=null;} -#line 1910 "dap.tab.c" +#line 1987 "dap.tab.c" break; - case 74: + case 74: /* errorbody: '{' errorcode errormsg errorptype errorprog '}' ';' */ #line 235 "dap.y" {dap_errorbody(parsestate,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2]);} -#line 1916 "dap.tab.c" +#line 1993 "dap.tab.c" break; - case 75: + case 75: /* errorcode: %empty */ #line 238 "dap.y" {yyval=null;} -#line 1922 "dap.tab.c" +#line 1999 "dap.tab.c" break; - case 76: + case 76: /* errorcode: SCAN_CODE '=' WORD_WORD ';' */ #line 238 "dap.y" {yyval=yyvsp[-1];} -#line 1928 "dap.tab.c" +#line 2005 "dap.tab.c" break; - case 77: + case 77: /* errormsg: %empty */ #line 239 "dap.y" {yyval=null;} -#line 1934 "dap.tab.c" +#line 2011 "dap.tab.c" break; - case 78: + case 78: /* errormsg: SCAN_MESSAGE '=' WORD_STRING ';' */ #line 239 "dap.y" {yyval=yyvsp[-1];} -#line 1940 "dap.tab.c" +#line 2017 "dap.tab.c" break; - case 79: + case 79: /* errorptype: %empty */ #line 240 "dap.y" {yyval=null;} -#line 1946 "dap.tab.c" +#line 2023 "dap.tab.c" break; - case 80: + case 80: /* errorptype: SCAN_PTYPE '=' WORD_WORD ';' */ #line 240 "dap.y" {yyval=yyvsp[-1];} -#line 1952 "dap.tab.c" +#line 2029 "dap.tab.c" break; - case 81: + case 81: /* errorprog: %empty */ #line 241 "dap.y" {yyval=null;} -#line 1958 "dap.tab.c" +#line 2035 "dap.tab.c" break; - case 82: + case 82: /* errorprog: SCAN_PROG '=' WORD_WORD ';' */ #line 241 "dap.y" {yyval=yyvsp[-1];} -#line 1964 "dap.tab.c" +#line 2041 "dap.tab.c" break; - case 83: + case 83: /* name: WORD_WORD */ #line 247 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 1970 "dap.tab.c" +#line 2047 "dap.tab.c" break; - case 84: + case 84: /* name: SCAN_ALIAS */ #line 248 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 1976 "dap.tab.c" +#line 2053 "dap.tab.c" break; - case 85: + case 85: /* name: SCAN_ARRAY */ #line 249 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 1982 "dap.tab.c" +#line 2059 "dap.tab.c" break; - case 86: + case 86: /* name: SCAN_ATTR */ #line 250 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 1988 "dap.tab.c" +#line 2065 "dap.tab.c" break; - case 87: + case 87: /* name: SCAN_BYTE */ #line 251 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 1994 "dap.tab.c" +#line 2071 "dap.tab.c" break; - case 88: + case 88: /* name: SCAN_DATASET */ #line 252 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2000 "dap.tab.c" +#line 2077 "dap.tab.c" break; - case 89: + case 89: /* name: SCAN_DATA */ #line 253 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2006 "dap.tab.c" +#line 2083 "dap.tab.c" break; - case 90: + case 90: /* name: SCAN_ERROR */ #line 254 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2012 "dap.tab.c" +#line 2089 "dap.tab.c" break; - case 91: + case 91: /* name: SCAN_FLOAT32 */ #line 255 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2018 "dap.tab.c" +#line 2095 "dap.tab.c" break; - case 92: + case 92: /* name: SCAN_FLOAT64 */ #line 256 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2024 "dap.tab.c" +#line 2101 "dap.tab.c" break; - case 93: + case 93: /* name: SCAN_GRID */ #line 257 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2030 "dap.tab.c" +#line 2107 "dap.tab.c" break; - case 94: + case 94: /* name: SCAN_INT16 */ #line 258 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2036 "dap.tab.c" +#line 2113 "dap.tab.c" break; - case 95: + case 95: /* name: SCAN_INT32 */ #line 259 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2042 "dap.tab.c" +#line 2119 "dap.tab.c" break; - case 96: + case 96: /* name: SCAN_MAPS */ #line 260 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2048 "dap.tab.c" +#line 2125 "dap.tab.c" break; - case 97: + case 97: /* name: SCAN_SEQUENCE */ #line 261 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2054 "dap.tab.c" +#line 2131 "dap.tab.c" break; - case 98: + case 98: /* name: SCAN_STRING */ #line 262 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2060 "dap.tab.c" +#line 2137 "dap.tab.c" break; - case 99: + case 99: /* name: SCAN_STRUCTURE */ #line 263 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2066 "dap.tab.c" +#line 2143 "dap.tab.c" break; - case 100: + case 100: /* name: SCAN_UINT16 */ #line 264 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2072 "dap.tab.c" +#line 2149 "dap.tab.c" break; - case 101: + case 101: /* name: SCAN_UINT32 */ #line 265 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2078 "dap.tab.c" +#line 2155 "dap.tab.c" break; - case 102: + case 102: /* name: SCAN_URL */ #line 266 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2084 "dap.tab.c" +#line 2161 "dap.tab.c" break; - case 103: + case 103: /* name: SCAN_CODE */ #line 267 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2090 "dap.tab.c" +#line 2167 "dap.tab.c" break; - case 104: + case 104: /* name: SCAN_MESSAGE */ #line 268 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2096 "dap.tab.c" +#line 2173 "dap.tab.c" break; - case 105: + case 105: /* name: SCAN_PROG */ #line 269 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2102 "dap.tab.c" +#line 2179 "dap.tab.c" break; - case 106: + case 106: /* name: SCAN_PTYPE */ #line 270 "dap.y" {yyval=dapdecode(parsestate->lexstate,yyvsp[0]);} -#line 2108 "dap.tab.c" +#line 2185 "dap.tab.c" break; -#line 2112 "dap.tab.c" +#line 2189 "dap.tab.c" default: break; } @@ -2123,11 +2200,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 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); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2151,50 +2227,44 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 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); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (parsestate, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { + yypcontext_t yyctx + = {yyssp, yytoken}; char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); if (yysyntax_error_status == 0) yymsgp = yymsg; - else if (yysyntax_error_status == 1) + else if (yysyntax_error_status == -1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (!yymsg) + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; } else { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; } } yyerror (parsestate, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -2227,6 +2297,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2243,13 +2314,14 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -2263,7 +2335,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yydestruct ("Error: popping", - yystos[yystate], yyvsp, parsestate); + YY_ACCESSING_SYMBOL (yystate), yyvsp, parsestate); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2275,7 +2347,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -2286,7 +2358,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -2294,24 +2366,22 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (parsestate, YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -2327,18 +2397,17 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[+*yyssp], yyvsp, parsestate); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parsestate); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); -#endif return yyresult; } + #line 273 "dap.y" diff --git a/oc2/dap.tab.h b/oc2/dap.tab.h index 9848bdf971..00f7aa1c47 100644 --- a/oc2/dap.tab.h +++ b/oc2/dap.tab.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.1. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_DAP_DAP_TAB_H_INCLUDED # define YY_DAP_DAP_TAB_H_INCLUDED @@ -44,37 +45,42 @@ extern int dapdebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - SCAN_ALIAS = 258, - SCAN_ARRAY = 259, - SCAN_ATTR = 260, - SCAN_BYTE = 261, - SCAN_CODE = 262, - SCAN_DATASET = 263, - SCAN_DATA = 264, - SCAN_ERROR = 265, - SCAN_FLOAT32 = 266, - SCAN_FLOAT64 = 267, - SCAN_GRID = 268, - SCAN_INT16 = 269, - SCAN_INT32 = 270, - SCAN_MAPS = 271, - SCAN_MESSAGE = 272, - SCAN_SEQUENCE = 273, - SCAN_STRING = 274, - SCAN_STRUCTURE = 275, - SCAN_UINT16 = 276, - SCAN_UINT32 = 277, - SCAN_URL = 278, - SCAN_PTYPE = 279, - SCAN_PROG = 280, - WORD_WORD = 281, - WORD_STRING = 282 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + SCAN_ALIAS = 258, /* SCAN_ALIAS */ + SCAN_ARRAY = 259, /* SCAN_ARRAY */ + SCAN_ATTR = 260, /* SCAN_ATTR */ + SCAN_BYTE = 261, /* SCAN_BYTE */ + SCAN_CODE = 262, /* SCAN_CODE */ + SCAN_DATASET = 263, /* SCAN_DATASET */ + SCAN_DATA = 264, /* SCAN_DATA */ + SCAN_ERROR = 265, /* SCAN_ERROR */ + SCAN_FLOAT32 = 266, /* SCAN_FLOAT32 */ + SCAN_FLOAT64 = 267, /* SCAN_FLOAT64 */ + SCAN_GRID = 268, /* SCAN_GRID */ + SCAN_INT16 = 269, /* SCAN_INT16 */ + SCAN_INT32 = 270, /* SCAN_INT32 */ + SCAN_MAPS = 271, /* SCAN_MAPS */ + SCAN_MESSAGE = 272, /* SCAN_MESSAGE */ + SCAN_SEQUENCE = 273, /* SCAN_SEQUENCE */ + SCAN_STRING = 274, /* SCAN_STRING */ + SCAN_STRUCTURE = 275, /* SCAN_STRUCTURE */ + SCAN_UINT16 = 276, /* SCAN_UINT16 */ + SCAN_UINT32 = 277, /* SCAN_UINT32 */ + SCAN_URL = 278, /* SCAN_URL */ + SCAN_PTYPE = 279, /* SCAN_PTYPE */ + SCAN_PROG = 280, /* SCAN_PROG */ + WORD_WORD = 281, /* WORD_WORD */ + WORD_STRING = 282 /* WORD_STRING */ }; + typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ @@ -86,6 +92,8 @@ typedef int YYSTYPE; + int dapparse (DAPparsestate* parsestate); + #endif /* !YY_DAP_DAP_TAB_H_INCLUDED */