From d0adc211b814a7d898e7882559b8959bf820663c Mon Sep 17 00:00:00 2001 From: Mikhail Koviazin Date: Wed, 21 Feb 2024 15:14:12 +0200 Subject: [PATCH] [AVRO-3943] Remove obsolete folders from C++ bindings (#2756) * AVRO-3943: Remove obsolete Bison/Flex files * AVRO-3943: Remove obsolete m4 files * AVRO-3943: Remove mentions of bison and flex from README --- lang/c++/LICENSE | 30 ---- lang/c++/README | 4 +- lang/c++/m4/README | 3 - lang/c++/m4/m4_ax_boost_asio.m4 | 108 ------------- lang/c++/m4/m4_ax_boost_base.m4 | 219 -------------------------- lang/c++/m4/m4_ax_boost_filesystem.m4 | 115 -------------- lang/c++/m4/m4_ax_boost_regex.m4 | 105 ------------ lang/c++/m4/m4_ax_boost_system.m4 | 117 -------------- lang/c++/m4/m4_ax_boost_thread.m4 | 146 ----------------- lang/c++/parser/AvroLex.ll | 203 ------------------------ lang/c++/parser/AvroYacc.yy | 200 ----------------------- 11 files changed, 2 insertions(+), 1248 deletions(-) delete mode 100644 lang/c++/m4/README delete mode 100644 lang/c++/m4/m4_ax_boost_asio.m4 delete mode 100644 lang/c++/m4/m4_ax_boost_base.m4 delete mode 100644 lang/c++/m4/m4_ax_boost_filesystem.m4 delete mode 100644 lang/c++/m4/m4_ax_boost_regex.m4 delete mode 100644 lang/c++/m4/m4_ax_boost_system.m4 delete mode 100644 lang/c++/m4/m4_ax_boost_thread.m4 delete mode 100644 lang/c++/parser/AvroLex.ll delete mode 100644 lang/c++/parser/AvroYacc.yy diff --git a/lang/c++/LICENSE b/lang/c++/LICENSE index d641439cded..d7f066e1d81 100644 --- a/lang/c++/LICENSE +++ b/lang/c++/LICENSE @@ -201,36 +201,6 @@ See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------- -License for the m4 macros used by the C++ implementation: - -Files: -* lang/c++/m4/m4_ax_boost_system.m4 - Copyright (c) 2008 Thomas Porschberg - Copyright (c) 2008 Michael Tindal - Copyright (c) 2008 Daniel Casimiro -* lang/c++/m4/m4_ax_boost_asio.m4 - Copyright (c) 2008 Thomas Porschberg - Copyright (c) 2008 Pete Greenwell -* lang/c++/m4/m4_ax_boost_filesystem.m4 - Copyright (c) 2009 Thomas Porschberg - Copyright (c) 2009 Michael Tindal - Copyright (c) 2009 Roman Rybalko -* lang/c++/m4/m4_ax_boost_thread.m4 - Copyright (c) 2009 Thomas Porschberg - Copyright (c) 2009 Michael Tindal -* lang/c++/m4/m4_ax_boost_regex.m4 - Copyright (c) 2008 Thomas Porschberg - Copyright (c) 2008 Michael Tindal -* lang/c++/m4/m4_ax_boost_base.m4 - Copyright (c) 2008 Thomas Porschberg - -License text: -| Copying and distribution of this file, with or without modification, are -| permitted in any medium without royalty provided the copyright notice -| and this notice are preserved. This file is offered as-is, without any -| warranty. - ---------------------------------------------------------------------- License for the AVRO_BOOT_NO_TRAIT code in the C++ implementation: File: lang/c++/api/Boost.hh diff --git a/lang/c++/README b/lang/c++/README index 6b081f13a86..84ae44701dc 100644 --- a/lang/c++/README +++ b/lang/c++/README @@ -39,8 +39,8 @@ mkdir build cd build cmake -G "Unix Makefiles" .. -If it doesn't work, either you are missing some packages (boost, flex or bison), -or you need to help configure locate them. +If it doesn't work, either you are missing boost package or you need to help +configure locate it. If the Makefile is configured correctly, then you can make and run tests: diff --git a/lang/c++/m4/README b/lang/c++/m4/README deleted file mode 100644 index 6d90a5a133e..00000000000 --- a/lang/c++/m4/README +++ /dev/null @@ -1,3 +0,0 @@ -The macros in this directory came from https://www.nongnu.org/autoconf-archive/index.html - -Please refer to the files for their licensing info. diff --git a/lang/c++/m4/m4_ax_boost_asio.m4 b/lang/c++/m4/m4_ax_boost_asio.m4 deleted file mode 100644 index d0d070b017b..00000000000 --- a/lang/c++/m4/m4_ax_boost_asio.m4 +++ /dev/null @@ -1,108 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_asio.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_ASIO -# -# DESCRIPTION -# -# Test for Asio library from the Boost C++ libraries. The macro requires a -# preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_ASIO_LIB) -# -# And sets: -# -# HAVE_BOOST_ASIO -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Pete Greenwell -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 7 - -AC_DEFUN([AX_BOOST_ASIO], -[ - AC_ARG_WITH([boost-asio], - AS_HELP_STRING([--with-boost-asio@<:@=special-lib@:>@], - [use the ASIO library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-asio=boost_system-gcc41-mt-1_34 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_asio_lib="" - else - want_boost="yes" - ax_boost_user_asio_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::ASIO library is available, - ax_cv_boost_asio, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ @%:@include - ]], - [[ - - boost::asio::io_service io; - boost::system::error_code timer_result; - boost::asio::deadline_timer t(io); - t.cancel(); - io.run_one(); - return 0; - ]]), - ax_cv_boost_asio=yes, ax_cv_boost_asio=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_asio" = "xyes"; then - AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available]) - BN=boost_system - if test "x$ax_boost_user_asio_lib" = "x"; then - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break], - [link_thread="no"]) - done - else - for ax_lib in $ax_boost_user_asio_lib $BN-$ax_boost_user_asio_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_asio="yes" break], - [link_asio="no"]) - done - - fi - if test "x$link_asio" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/lang/c++/m4/m4_ax_boost_base.m4 b/lang/c++/m4/m4_ax_boost_base.m4 deleted file mode 100644 index 34f63c751a8..00000000000 --- a/lang/c++/m4/m4_ax_boost_base.m4 +++ /dev/null @@ -1,219 +0,0 @@ -# =========================================================================== -# https://www.nongnu.org/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), - [ - if test -d $withval - then - ac_boost_lib_path="$withval" - else - AC_MSG_ERROR(--with-boost-libdir expected directory name) - fi - ], - [ac_boost_lib_path=""] -) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - BOOST_CPPFLAGS="-I$ac_boost_path/include" - else - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - if test "$ac_boost_lib_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_lib_path" - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - for ac_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test "$ac_boost_lib_path" = "" - then - BOOST_LDFLAGS="-L$best_path/lib" - fi - - if test "x$BOOST_ROOT" != "x"; then - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See https://www.randspringer.de/boost for more documentation.]]) - else - AC_MSG_ERROR([Your boost libraries seems too old (version $_version).]) - fi - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) diff --git a/lang/c++/m4/m4_ax_boost_filesystem.m4 b/lang/c++/m4/m4_ax_boost_filesystem.m4 deleted file mode 100644 index a52ce6ad166..00000000000 --- a/lang/c++/m4/m4_ax_boost_filesystem.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_FILESYSTEM -# -# DESCRIPTION -# -# Test for Filesystem library from the Boost C++ libraries. The macro -# requires a preceding call to AX_BOOST_BASE. Further documentation is -# available at . -# -# This macro calls: -# -# AC_SUBST(BOOST_FILESYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_FILESYSTEM -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# Copyright (c) 2009 Roman Rybalko -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 13 - -AC_DEFUN([AX_BOOST_FILESYSTEM], -[ - AC_ARG_WITH([boost-filesystem], - AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@], - [use the Filesystem library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_filesystem_lib="" - else - want_boost="yes" - ax_boost_user_filesystem_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - LIBS_SAVED=$LIBS - LIBS="$LIBS $BOOST_SYSTEM_LIB" - export LIBS - - AC_CACHE_CHECK(whether the Boost::Filesystem library is available, - ax_cv_boost_filesystem, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::filesystem; - path my_path( "foo/bar/data.txt" ); - return 0;]]), - ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_filesystem" = "xyes"; then - AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_filesystem_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_filesystem*.{so,dylib,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_filesystem.*\)\.so.*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.a*$;\1;' -e 's;^lib\(boost_filesystem.*\)\.dylib$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_filesystem*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_filesystem.*\)\.dll.*$;\1;' -e 's;^\(boost_filesystem.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - fi - else - for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - - fi - if test "x$link_filesystem" != "xyes"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - LIBS="$LIBS_SAVED" - fi -]) diff --git a/lang/c++/m4/m4_ax_boost_regex.m4 b/lang/c++/m4/m4_ax_boost_regex.m4 deleted file mode 100644 index 4ec2eda39f9..00000000000 --- a/lang/c++/m4/m4_ax_boost_regex.m4 +++ /dev/null @@ -1,105 +0,0 @@ -# =========================================================================== -# https://www.nongnu.org/autoconf-archive/ax_boost_regex.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_REGEX -# -# DESCRIPTION -# -# Test for Regex library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_REGEX_LIB) -# -# And sets: -# -# HAVE_BOOST_REGEX -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. - -AC_DEFUN([AX_BOOST_REGEX], -[ - AC_ARG_WITH([boost-regex], - AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@], - [use the Regex library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_regex_lib="" - else - want_boost="yes" - ax_boost_user_regex_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Regex library is available, - ax_cv_boost_regex, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - ]], - [[boost::regex r(); return 0;]]), - ax_cv_boost_regex=yes, ax_cv_boost_regex=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_regex" = "xyes"; then - AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - if test "x$ax_boost_user_regex_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - if test "x$link_regex" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - fi - if test "x$link_regex" != "xyes"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/lang/c++/m4/m4_ax_boost_system.m4 b/lang/c++/m4/m4_ax_boost_system.m4 deleted file mode 100644 index 3a4cb611b2d..00000000000 --- a/lang/c++/m4/m4_ax_boost_system.m4 +++ /dev/null @@ -1,117 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_system.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_SYSTEM -# -# DESCRIPTION -# -# Test for System library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_SYSTEM_LIB) -# -# And sets: -# -# HAVE_BOOST_SYSTEM -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2008 Michael Tindal -# Copyright (c) 2008 Daniel Casimiro -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 7 - -AC_DEFUN([AX_BOOST_SYSTEM], -[ - AC_ARG_WITH([boost-system], - AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], - [use the System library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-system=boost_system-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_system_lib="" - else - want_boost="yes" - ax_boost_user_system_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::System library is available, - ax_cv_boost_system, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[boost::system::system_category]]), - ax_cv_boost_system=yes, ax_cv_boost_system=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_system" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_system_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - if test "x$link_system" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], - [link_system="no"]) - done - - fi - if test "x$link_system" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/lang/c++/m4/m4_ax_boost_thread.m4 b/lang/c++/m4/m4_ax_boost_thread.m4 deleted file mode 100644 index bff7defa7ad..00000000000 --- a/lang/c++/m4/m4_ax_boost_thread.m4 +++ /dev/null @@ -1,146 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_THREAD -# -# DESCRIPTION -# -# Test for Thread library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_THREAD_LIB) -# -# And sets: -# -# HAVE_BOOST_THREAD -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 15 - -AC_DEFUN([AX_BOOST_THREAD], -[ - AC_ARG_WITH([boost-thread], - AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], - [use the Thread library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-thread=boost_thread-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_thread_lib="" - else - want_boost="yes" - ax_boost_user_thread_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Thread library is available, - ax_cv_boost_thread, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - if test "x$build_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$build_os" = "xming32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[boost::thread_group thrds; - return 0;]]), - ax_cv_boost_thread=yes, ax_cv_boost_thread=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$build_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$build_os" = "xming32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi - - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - case "x$build_os" in - *bsd* ) - LDFLAGS="-pthread $LDFLAGS" - break; - ;; - esac - if test "x$ax_boost_user_thread_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - fi - - else - for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - - fi - if test "x$link_thread" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - else - case "x$build_os" in - *bsd* ) - BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" - break; - ;; - esac - - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/lang/c++/parser/AvroLex.ll b/lang/c++/parser/AvroLex.ll deleted file mode 100644 index 6070e089a9e..00000000000 --- a/lang/c++/parser/AvroLex.ll +++ /dev/null @@ -1,203 +0,0 @@ -%{ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// on some systems, won't find an EOF definition -#ifndef EOF -#define EOF (-1) -#endif - -#include "AvroYacc.hh" - -// this undef is a hack for my mac implementation -#undef yyFlexLexer -#include "Compiler.hh" - -#define YY_STACK_USED 1 - -using std::cin; -using std::cout; -using std::cerr; - -%} - -%option c++ -%option noyywrap - -%{ - -int yylex(int *val, void *ctx) -{ - avro::CompilerContext *c = static_cast(ctx); - int ret = c->lexer().yylex(); - if( ret > AVRO_LEX_OUTPUT_TEXT_BEGIN && ret < AVRO_LEX_OUTPUT_TEXT_END ) { - c->setText( c->lexer().YYText()) ; - } - return ret; -} - -%} - -%x READTYPE -%x STARTTYPE -%x STARTSCHEMA -%x READNAME -%x READFIELD -%x READFIELDS -%x READFIELDNAME -%x READSYMBOLS -%x READSYMBOL -%x READSIZE -%x INUNION -%x INOBJECT -%x READMETADATA -%x SKIPJSONSTRING -%x SKIPJSONARRAY -%x SKIPJSONOBJECT - -ws [ \t\r\n] -nonws [^ \t\r\n] -delim {ws}*:{ws}* -avrotext [a-zA-Z_][a-zA-Z0-9_.]* -startunion \[ -startobject \{ -integer [0-9]+ -anytext .* - -%% -int return AVRO_LEX_INT; -long return AVRO_LEX_LONG; -null return AVRO_LEX_NULL; -boolean return AVRO_LEX_BOOL; -float return AVRO_LEX_FLOAT; -double return AVRO_LEX_DOUBLE; -string return AVRO_LEX_STRING; -bytes return AVRO_LEX_BYTES; -record return AVRO_LEX_RECORD; -enum return AVRO_LEX_ENUM; -map return AVRO_LEX_MAP; -array return AVRO_LEX_ARRAY; -fixed return AVRO_LEX_FIXED; -{avrotext} return AVRO_LEX_NAMED_TYPE; -\" yy_pop_state(); - -{avrotext} return AVRO_LEX_NAME; -\" yy_pop_state(); - -{avrotext} return AVRO_LEX_SYMBOL; -\" yy_pop_state(); - -{avrotext} return AVRO_LEX_FIELD_NAME; -\" yy_pop_state(); - -\"type\"{delim} yy_push_state(STARTSCHEMA); -\"name\"{delim}\" yy_push_state(READFIELDNAME); -\} yy_pop_state(); return AVRO_LEX_FIELD_END; -, return yytext[0]; -\"{avrotext}\"+{delim} yy_push_state(READMETADATA); return AVRO_LEX_METADATA; -{ws} ; - -\{ yy_push_state(READFIELD); return AVRO_LEX_FIELD; -\] yy_pop_state(); return AVRO_LEX_FIELDS_END; -, return yytext[0]; -{ws} ; - -\" yy_push_state(READSYMBOL); -, return yytext[0]; -\] yy_pop_state(); return AVRO_LEX_SYMBOLS_END; -{ws} ; - -{integer} yy_pop_state(); return AVRO_LEX_SIZE; - -\" yy_push_state(READTYPE); return AVRO_LEX_SIMPLE_TYPE; -{startobject} yy_push_state(INOBJECT); return yytext[0]; -\] yy_pop_state(); return yytext[0]; -, return yytext[0]; -{ws} ; - -\" yy_pop_state(); -\\. ; -[^\"\\]+ ; - -\} yy_pop_state(); -\{ yy_push_state(SKIPJSONOBJECT); -\" yy_push_state(SKIPJSONSTRING); -[^\{\}\"]+ ; - -\] yy_pop_state(); -\[ yy_push_state(SKIPJSONARRAY); -\" yy_push_state(SKIPJSONSTRING); -[^\[\]\"]+ ; - -\" yy_pop_state(); yy_push_state(SKIPJSONSTRING); -\{ yy_pop_state(); yy_push_state(SKIPJSONOBJECT); -\[ yy_pop_state(); yy_push_state(SKIPJSONARRAY); -[^\"\{\[,\}]+ yy_pop_state(); - -\"type\"{delim} yy_push_state(STARTTYPE); return AVRO_LEX_TYPE; -\"name\"{delim}\" yy_push_state(READNAME); -\"size\"{delim} yy_push_state(READSIZE); -\"items\"{delim} yy_push_state(STARTSCHEMA); return AVRO_LEX_ITEMS; -\"values\"{delim} yy_push_state(STARTSCHEMA); return AVRO_LEX_VALUES; -\"fields\"{delim}\[ yy_push_state(READFIELDS); return AVRO_LEX_FIELDS; -\"symbols\"{delim}\[ yy_push_state(READSYMBOLS); return AVRO_LEX_SYMBOLS; -, return yytext[0]; -\} yy_pop_state(); return yytext[0]; -\"{avrotext}+\"{delim} yy_push_state(READMETADATA); return AVRO_LEX_METADATA; -{ws} ; - -\" yy_pop_state(); yy_push_state(READTYPE); -{startunion} yy_pop_state(); yy_push_state(INUNION); return yytext[0]; -{startobject} yy_pop_state(); yy_push_state(INOBJECT); return yytext[0]; - -\" yy_pop_state(); yy_push_state(READTYPE); return AVRO_LEX_SIMPLE_TYPE; -{startunion} yy_pop_state(); yy_push_state(INUNION); return yytext[0]; -{startobject} yy_pop_state(); yy_push_state(INOBJECT); return yytext[0]; - -{startobject} yy_push_state(INOBJECT); return yytext[0]; -{startunion} yy_push_state(INUNION); return yytext[0]; -\" yy_push_state(READTYPE); return AVRO_LEX_SIMPLE_TYPE; -{ws} ; -<> { -#if !YY_FLEX_SUBMINOR_VERSION || YY_FLEX_SUBMINOR_VERSION < 27 -// The versions of flex before 3.5.27 do not free their stack when done, so explcitly free it. -// Note that versions before did not actually define a subminor macro. - if (yy_start_stack) { - yy_flex_free(yy_start_stack); - yy_start_stack = 0; - } -#endif -#if YY_FLEX_SUBMINOR_VERSION > 35 -// At this time, 3.5.35 is the latest version. -#warning "Warning: untested version of flex" -#endif -#if YY_FLEX_SUBMINOR_VERSION >= 31 && YY_FLEX_SUBMINOR_VERSION < 34 -// The versions of flex starting 3.5.31 do not free yy_buffer_stack, so do so -// explicitly (first yy_delete_buffer must be called to free pointers stored on the stack, then it is -// safe to remove the stack). This was fixed in 3.4.34. - if(yy_buffer_stack) { - yy_delete_buffer(YY_CURRENT_BUFFER); - yyfree(yy_buffer_stack); - yy_buffer_stack = 0; - } -#endif - yyterminate(); - } - -%% - diff --git a/lang/c++/parser/AvroYacc.yy b/lang/c++/parser/AvroYacc.yy deleted file mode 100644 index 404d39585e3..00000000000 --- a/lang/c++/parser/AvroYacc.yy +++ /dev/null @@ -1,200 +0,0 @@ -%{ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include -#include "Compiler.hh" -#include "Exception.hh" - -#define YYLEX_PARAM ctx -#define YYPARSE_PARAM ctx - -void yyerror(const char *str) -{ - throw avro::Exception(boost::format("Parser error: %1%") % str); -} - -extern void *lexer; -extern int yylex(int *, void *); - -avro::CompilerContext &context(void *ctx) { - return *static_cast(ctx); -}; - -%} - -%pure-parser -%error-verbose - -%token AVRO_LEX_INT AVRO_LEX_LONG -%token AVRO_LEX_FLOAT AVRO_LEX_DOUBLE -%token AVRO_LEX_BOOL AVRO_LEX_NULL -%token AVRO_LEX_BYTES AVRO_LEX_STRING -%token AVRO_LEX_RECORD AVRO_LEX_ENUM AVRO_LEX_ARRAY AVRO_LEX_MAP AVRO_LEX_UNION AVRO_LEX_FIXED - -%token AVRO_LEX_METADATA - -%token AVRO_LEX_SYMBOLS AVRO_LEX_SYMBOLS_END -%token AVRO_LEX_FIELDS AVRO_LEX_FIELDS_END AVRO_LEX_FIELD AVRO_LEX_FIELD_END - -%token AVRO_LEX_TYPE AVRO_LEX_ITEMS AVRO_LEX_VALUES - -// Tokens that output text: -%token AVRO_LEX_OUTPUT_TEXT_BEGIN -%token AVRO_LEX_NAME -%token AVRO_LEX_NAMED_TYPE -%token AVRO_LEX_FIELD_NAME -%token AVRO_LEX_SYMBOL -%token AVRO_LEX_SIZE -%token AVRO_LEX_OUTPUT_TEXT_END - -%token AVRO_LEX_SIMPLE_TYPE - -%% - -avroschema: - simpleprimitive | object | union_t - ; - -primitive: - AVRO_LEX_INT { context(ctx).addType(avro::AVRO_INT); } - | - AVRO_LEX_LONG { context(ctx).addType(avro::AVRO_LONG); } - | - AVRO_LEX_FLOAT { context(ctx).addType(avro::AVRO_FLOAT); } - | - AVRO_LEX_DOUBLE { context(ctx).addType(avro::AVRO_DOUBLE); } - | - AVRO_LEX_BOOL { context(ctx).addType(avro::AVRO_BOOL); } - | - AVRO_LEX_NULL { context(ctx).addType(avro::AVRO_NULL); } - | - AVRO_LEX_BYTES { context(ctx).addType(avro::AVRO_BYTES); } - | - AVRO_LEX_STRING { context(ctx).addType(avro::AVRO_STRING); } - | - AVRO_LEX_NAMED_TYPE { context(ctx).addNamedType(); } - ; - -simpleprimitive: - AVRO_LEX_SIMPLE_TYPE { context(ctx).startType(); } primitive { context(ctx).stopType(); } - ; - -primitive_t: - AVRO_LEX_TYPE primitive - ; - -array_t: - AVRO_LEX_TYPE AVRO_LEX_ARRAY { context(ctx).addType(avro::AVRO_ARRAY); } - ; - -enum_t: - AVRO_LEX_TYPE AVRO_LEX_ENUM { context(ctx).addType(avro::AVRO_ENUM); } - ; - -fixed_t: - AVRO_LEX_TYPE AVRO_LEX_FIXED { context(ctx).addType(avro::AVRO_FIXED); } - ; - -map_t: - AVRO_LEX_TYPE AVRO_LEX_MAP { context(ctx).addType(avro::AVRO_MAP); } - ; - -record_t: - AVRO_LEX_TYPE AVRO_LEX_RECORD { context(ctx).addType(avro::AVRO_RECORD); } - ; - -type_attribute: - array_t | enum_t | fixed_t | map_t | record_t | primitive_t - ; - -union_t: - '[' { context(ctx).startType(); context(ctx).addType(avro::AVRO_UNION); context(ctx).setTypesAttribute(); } - unionlist - ']' { context(ctx).stopType(); } - ; - -object: - '{' { context(ctx).startType(); } - attributelist - '}' { context(ctx).stopType(); } - ; - -name_attribute: - AVRO_LEX_NAME { context(ctx).setNameAttribute(); } - ; - -size_attribute: - AVRO_LEX_SIZE { context(ctx).setSizeAttribute(); } - ; - -values_attribute: - AVRO_LEX_VALUES { context(ctx).setValuesAttribute(); } avroschema - ; - -fields_attribute: - AVRO_LEX_FIELDS { context(ctx).setFieldsAttribute(); } fieldslist AVRO_LEX_FIELDS_END - ; - -items_attribute: - AVRO_LEX_ITEMS { context(ctx).setItemsAttribute(); } avroschema - ; - -symbols_attribute: - AVRO_LEX_SYMBOLS symbollist AVRO_LEX_SYMBOLS_END - ; - -attribute: - type_attribute | name_attribute | fields_attribute | items_attribute | size_attribute | values_attribute | symbols_attribute | AVRO_LEX_METADATA - ; - -attributelist: - attribute | attributelist ',' attribute - ; - -symbol: - AVRO_LEX_SYMBOL { context(ctx).setSymbolsAttribute(); } - ; - -symbollist: - symbol | symbollist ',' symbol - ; - -fieldsetting: - fieldname | avroschema | AVRO_LEX_METADATA - ; - -fieldsettinglist: - fieldsetting | fieldsettinglist ',' fieldsetting - ; - -fields: - AVRO_LEX_FIELD fieldsettinglist AVRO_LEX_FIELD_END - ; - -fieldname: - AVRO_LEX_FIELD_NAME { context(ctx).textContainsFieldName(); } - ; - -fieldslist: - fields | fieldslist ',' fields - ; - -unionlist: - avroschema | unionlist ',' avroschema - ;