From 6af65f230e97421cc57a4846bc2e94ca26ec09bb Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Wed, 15 May 2024 18:01:20 +0300 Subject: [PATCH] Use classic names for bison generated files (in oc2/ only) --- oc2/CMakeLists.txt | 2 +- oc2/Makefile.am | 9 ++-- oc2/{dapy.c => dap.tab.c} | 4 +- oc2/dap.y | 2 +- oc2/daplex.c | 2 +- oc2/dapparse.c | 2 +- oc2/dapy.h | 87 --------------------------------------- 7 files changed, 9 insertions(+), 99 deletions(-) rename oc2/{dapy.c => dap.tab.c} (99%) 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/dapy.c b/oc2/dap.tab.c similarity index 99% rename from oc2/dapy.c rename to oc2/dap.tab.c index c9883f9802..6079f4b6cf 100644 --- a/oc2/dapy.c +++ b/oc2/dap.tab.c @@ -72,7 +72,7 @@ #include "config.h" #include "dapparselex.h" -#include "dapy.h" +#include "dap.tab.h" int dapdebug = 0; #line 79 "dapy.c" /* yacc.c:339 */ @@ -94,7 +94,7 @@ int dapdebug = 0; #endif /* In a future release of Bison, this section will be replaced - by #include "dapy.h". */ + by #include "dap.tab.h". */ #ifndef YY_DAP_DAP_TAB_H_INCLUDED # define YY_DAP_DAP_TAB_H_INCLUDED /* Debug traces. */ diff --git a/oc2/dap.y b/oc2/dap.y index 0305015429..fa544743a7 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.h b/oc2/dapy.h deleted file mode 100644 index d11cfc9876..0000000000 --- a/oc2/dapy.h +++ /dev/null @@ -1,87 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015 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. */ - -#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 */