[gephex-devel] gephex--main--0.4--patch-1843
gephex at sonnenland.kexbox.org
gephex at sonnenland.kexbox.org
Wed Feb 16 19:21:53 CET 2005
Archive: gephex at gephex.org--2004
New revision: gephex--main--0.4--patch-1843
--
Revision: gephex--main--0.4--patch-1843
Archive: gephex at gephex.org--2004
Creator: The Gephex Source Archive <gephex at gephex.org>
Date: Wed Feb 16 19:19:06 CET 2005
Standard-date: 2005-02-16 18:19:06 GMT
New-files: util/src/misc/.arch-ids/libmisc.c.id
util/src/misc/libmisc.c
Renamed-files: modules/src/y4minmodule/.arch-ids/y4minmodule.c.id modules/src/y4minmodule/.arch-ids/y4minmodule.cpp.id
modules/src/y4minmodule/y4minmodule.c modules/src/y4minmodule/y4minmodule.cpp
Modified-files: aclocal/qt.m4
base/src/utils/sharedlibrary.cpp configure.ac
contrib/Makefile.am
effectvmodules/src/libeffectv/libeffectv.c
engine/src/engine/Makefile.am
modules/src/frboutmodule/Makefile.am
modules/src/frboutmodule/frboutmodule.c
modules/src/frboutmodule/x11output.c
modules/src/frboutmodule/x11stuff.c
modules/src/frboutmodule/x11stuff.h
modules/src/funparsemodule/parser.tab.c
modules/src/funparsemodule/parser.tab.h
modules/src/funparsemodule/scanner.c
modules/src/libscale/libscale.c
modules/src/y4minmodule/Makefile.am
qtgui/src/gui/Makefile.am util/include/basic_types.h
util/src/libjoystick/Makefile.am
util/src/misc/Makefile.am
New-patches: georg at gephex.org--2005-ibook/gephex--macport--0.4--base-0
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-1
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-2
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-3
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-4
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-5
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-6
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-7
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-8
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-9
georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-10
gephex at gephex.org--2004/gephex--main--0.4--patch-1843
Summary: [MERGE-REQUEST] merge macport to main
Keywords:
Patches applied:
* georg at gephex.org--2005-ibook/gephex--macport--0.4--base-0
tag of gephex at gephex.org--2004/gephex--main--0.4--patch-1837
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-1
Initial hack to make gephex compile on Mac OS X
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-2
Fixed bad memory accesses in libscale (bug #83)
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-3
Improved x11output error handling (see bug #81)
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-4
Fixed another bug in libscale (with adjustment)
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-5
Added channel flipping on big-endian machines to x11output
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-6
Fixed another bug in x11output (bug #85)
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-7
Added handling of different shared library extensions on different platforms in configure.ac
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-8
Replaced .dylib with . at SHAREDLIBEXT@ in contrib/Makefile.am
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-9
Fixed problem with shmget on mac os x
* georg at gephex.org--2005-ibook/gephex--macport--0.4--patch-10
Added doc dir to build again
* added directories
{arch}/gephex/gephex--macport
{arch}/gephex/gephex--macport/gephex--macport--0.4
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log
* added files
util/src/misc/.arch-ids/libmisc.c.id
util/src/misc/libmisc.c
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/base-0
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-1
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-10
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-2
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-3
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-4
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-5
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-6
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-7
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-8
{arch}/gephex/gephex--macport/gephex--macport--0.4/georg at gephex.org--2005-ibook/patch-log/patch-9
{arch}/gephex/gephex--main/gephex--main--0.4/gephex at gephex.org--2004/patch-log/patch-1843
* renamed files and symlinks
modules/src/y4minmodule/.arch-ids/y4minmodule.c.id
=> modules/src/y4minmodule/.arch-ids/y4minmodule.cpp.id
modules/src/y4minmodule/y4minmodule.c
=> modules/src/y4minmodule/y4minmodule.cpp
* modified files
--- orig/aclocal/qt.m4
+++ mod/aclocal/qt.m4
@@ -1,7 +1,9 @@
dnl qt.m4
dnl Adapted to GePhex by Georg Seidel <georg.seidel at web.de>
dnl Changes made:
-dnl - added check for libqt-mt.so
+dnl - added support for Darwin (made shared library extension a
+dnl new parameter
+dnl - added check for libqt-mt
dnl - added minimum version check
dnl - replaced AC_ERROR with AC_MSG_RESULT
dnl - moved evaluation of ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
@@ -11,7 +13,8 @@
dnl Original version from Rik Hemsley:
dnl Copyright (C) 2001 Rik Hemsley (rikkus) <rik at kde.org>
-dnl AM_PATH_QT(MINIMUM_VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl AM_PATH_QT(MINIMUM_VERSION, SHAREDLIBEXT,
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
AC_DEFUN([AM_PATH_QT],
[
AC_CHECKING([for Qt ...])
@@ -27,7 +30,7 @@
# the test looks inside the following files to find the qt headers, libs
# and binaries
-GUESS_QT_INC_DIRS="$QTDIR/include /usr/include /usr/include/qt /usr/include/qt3 /usr/local/include /usr/local/include/qt /usr/local/include/qt3 /usr/X11R6/include/ /usr/X11R6/include/qt /usr/X11R6/include/X11/qt /usr/X11R6/include/qt3 /usr/lib/qt/include /usr/lib/qt3/include /usr/lib/qt-3/include /usr/lib/qt-3.0/include /usr/lib/qt-3.1/include /usr/lib/qt-3.2/include /usr/lib/qt-3.3/include /usr/lib/qt-3.4/include"
+GUESS_QT_INC_DIRS="$QTDIR/include $QTDIR/include/qt /usr/include /usr/include/qt /usr/include/qt3 /usr/local/include /usr/local/include/qt /usr/local/include/qt3 /usr/X11R6/include/ /usr/X11R6/include/qt /usr/X11R6/include/X11/qt /usr/X11R6/include/qt3 /usr/lib/qt/include /usr/lib/qt3/include /usr/lib/qt-3/include /usr/lib/qt-3.0/include /usr/lib/qt-3.1/include /usr/lib/qt-3.2/include /usr/lib/qt-3.3/include /usr/lib/qt-3.4/include"
GUESS_QT_LIB_DIRS="$QTDIR/lib /usr/lib /usr/local/lib /usr/X11R6/lib /usr/local/qt/lib /usr/lib/qt/lib /usr/lib/qt3/lib /usr/lib/qt-3/lib /usr/lib/qt-3.0/lib /usr/lib/qt-3.1/lib /usr/lib/qt-3.2/lib /usr/lib/qt-3.3/lib /usr/lib/qt-3.4/lib"
@@ -88,28 +91,34 @@
if test "x$qt_libdir" != "x"
then
AC_MSG_RESULT([specified as $qt_libdir])
+ if test -e $qt_libdir/libqt.$2
+ then
+ qt_mt=no
+ else
+ qt_mt=yes
+ fi
else
for dir in $GUESS_QT_LIB_DIRS
do
- if test -e $dir/libqt.so
+ if test -e $dir/libqt.$2
then
qt_libdir=$dir
- AC_MSG_RESULT([assuming $dir/libqt.so])
+ AC_MSG_RESULT([assuming $dir/libqt.$2])
break
fi
done
-dnl if not found look for libqt-mt.so
+dnl if not found look for libqt-mt
if test "x$qt_libdir" = "x"
then
for dir in $GUESS_QT_LIB_DIRS
do
- if test -e $dir/libqt-mt.so
+ if test -e $dir/libqt-mt.$2
then
qt_mt=yes
qt_libdir=$dir
- AC_MSG_RESULT([assuming $dir/libqt-mt.so])
+ AC_MSG_RESULT([assuming $dir/libqt-mt.$2])
break
fi
done
@@ -250,9 +259,9 @@
if test "x$HAVE_QT" = "xyes"
then
- ifelse([$2], , :, [$2])
- else
ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , :, [$4])
fi
fi
--- orig/base/src/utils/sharedlibrary.cpp
+++ mod/base/src/utils/sharedlibrary.cpp
@@ -28,8 +28,6 @@
#if defined(OS_WIN32)
#include <windows.h>
-#elif defined(OS_DARWIN)
-#include <mach-o/dyld.h>
#elif defined(OS_POSIX)
#include <dlfcn.h>
#endif
@@ -47,7 +45,7 @@
#if defined(OS_WIN32)
typedef HINSTANCE HandleType;
-#elif defined(OS_DARWIN) || defined(OS_POSIX)
+#elif defined(OS_POSIX)
typedef void* HandleType;
#endif
@@ -66,10 +64,6 @@
// std::cout << "Loading '" << m_TODOName << "'" << std::endl;
#if defined(OS_WIN32)
m_impl->handle = LoadLibrary(path.c_str());
-#elif defined(OS_DARWIN)
- m_impl->handle
- = DarwinComp::dlopen(path.c_str(),
- DarwinComp::RTLD_LAZY);
#elif defined(OS_LINUX)
m_impl->handle = dlopen(path.c_str(), RTLD_NOW);
#elif defined(OS_BSD)
@@ -95,8 +89,6 @@
// std::cout << "Unloading '" << m_TODOName << "'" << std::endl;
#if defined(OS_WIN32)
FreeLibrary(m_impl->handle);
-#elif defined(OS_DARWIN)
- DarwinComp::dlclose(m_impl->handle);
#elif defined(OS_POSIX)
dlclose(m_impl->handle);
#endif
@@ -106,152 +98,9 @@
{
#if defined(OS_WIN32)
return GetProcAddress(m_impl->handle,name.c_str());
-#elif defined (OS_DARWIN)
- return DarwinComp::dlsym(m_impl->handle, name.c_str());
#elif defined(OS_POSIX)
return dlsym(m_impl->handle,name.c_str());
#endif
}
-#if defined(OS_DARWIN)
- struct DarwinComp {
- static const int RTLD_LAZY= 0x1;
- static const int RTLD_NOW= 0x2;
- static const int RTLD_LOCAL= 0x4;
- static const int RTLD_GLOBAL= 0x8;
- static const int RTLD_NOLOAD= 0x10;
- static const int RTLD_NODELETE= 0x80;
-
- /* dlopen */
- static void* dlopen(const char *path, int mode)
- {
- void *module = 0;
- NSObjectFileImage ofi = 0;
- NSObjectFileImageReturnCode ofirc;
-
- /* If we got no path, the app wants the global namespace, use -1 as the marker
- in this case */
- if (!path)
- return (void *)-1;
-
- /* Create the object file image, works for things linked with the -bundle arg to ld */
- ofirc = NSCreateObjectFileImageFromFile(path, &ofi);
- switch (ofirc)
- {
- case NSObjectFileImageSuccess:
- /* It was okay, so use NSLinkModule to link in the image */
- module = NSLinkModule(ofi, path,
- NSLINKMODULE_OPTION_RETURN_ON_ERROR
- | (mode & RTLD_GLOBAL) ? 0 : NSLINKMODULE_OPTION_PRIVATE
- | (mode & RTLD_LAZY) ? 0 : NSLINKMODULE_OPTION_BINDNOW);
- NSDestroyObjectFileImage(ofi);
- break;
- case NSObjectFileImageInappropriateFile:
- /* It may have been a dynamic library rather than a bundle, try to load it */
- module = (void *)NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- break;
- default:
- /* God knows what we got */
- //error(0, "Can not open \"%s\"", path);
- return 0;
- }
- if (!module)
- //error(0, "Can not open \"%s\"", path);
- return module;
-
- }
-
- /* dlsymIntern is used by dlsym to find the symbol */
- static void *dlsymIntern(void *handle, const char *symbol)
- {
- NSSymbol nssym = 0;
- /* If the handle is -1, if is the app global context */
- if (handle == (void *)-1)
- {
- /* Global context, use NSLookupAndBindSymbol */
- if (NSIsSymbolNameDefined(symbol))
- {
- nssym = NSLookupAndBindSymbol(symbol);
- }
-
- }
- /* Now see if the handle is a struch mach_header* or not, use NSLookupSymbol in image
- for libraries, and NSLookupSymbolInModule for bundles */
- else
- {
- /* Check for both possible magic numbers depending on x86/ppc byte order */
- if ((((struct mach_header *)handle)->magic == MH_MAGIC) ||
- (((struct mach_header *)handle)->magic == MH_CIGAM))
- {
- if (NSIsSymbolNameDefinedInImage((struct mach_header *)handle, symbol))
- {
- nssym = NSLookupSymbolInImage((struct mach_header *)handle,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
- | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
- }
-
- }
- else
- {
- nssym = NSLookupSymbolInModule(handle, symbol);
- }
- }
- if (!nssym)
- {
- //error(0, "Symbol \"%s\" Not found", symbol);
- return NULL;
- }
- return NSAddressOfSymbol(nssym);
- }
-
- static int dlclose(void *handle)
- {
- if ((((struct mach_header *)handle)->magic == MH_MAGIC) ||
- (((struct mach_header *)handle)->magic == MH_CIGAM))
- {
- //error(0, "Can't remove dynamic libraries on darwin");
- return 0;
- }
- if (!NSUnLinkModule(handle, 0))
- {
- //error(0, "unable to unlink module %s", NSNameOfModule(handle));
- return 1;
- }
- return 0;
- }
-
-
- /* dlsym, prepend the underscore and call dlsymIntern */
- static void *dlsym(void *handle, const char *symbol)
- {
- static char undersym[257]; /* Saves calls to malloc(3) */
- int sym_len = strlen(symbol);
- void *value = NULL;
- char *malloc_sym = NULL;
-
- if (sym_len < 256)
- {
- snprintf(undersym, 256, "_%s", symbol);
- value = dlsymIntern(handle, undersym);
- }
- else
- {
- malloc_sym = static_cast<char*>(malloc(sym_len + 2));
- if (malloc_sym)
- {
- sprintf(malloc_sym, "_%s", symbol);
- value = dlsymIntern(handle, malloc_sym);
- free(malloc_sym);
- }
- else
- {
- //error(0, "Unable to allocate memory");
- }
- }
- return value;
- }
- };
-#endif
-
}
--- orig/configure.ac
+++ mod/configure.ac
@@ -9,61 +9,6 @@
AC_PROG_CXX
AC_PROG_LIBTOOL
-# gcc versions <= 2.95.2 don't have the standard c++ header
-# sstream
-AM_PATH_SSTREAM(have_sstream=yes, have_sstream=no)
-# copy sstream_compat to sstream if sstream is missing:
-if test "x$have_sstream" = "xno"
-then
- AC_MSG_NOTICE([Using own sstream in util/include/compatibility])
- if ! cp $srcdir/util/include/compatibility/sstream_compat ./util/include/sstream;
- then
- AC_MSG_ERROR([Could not copy the sstream header!])
- fi
-else
- # make sure there is no sstream header
- rm -f ./util/include/sstream
-fi
-
-# check for extra libs
-
-# x11
-AC_PATH_XTRA
-AM_CONDITIONAL(HAVE_X11, test "x$no_x" != "xyes")
-AH_TEMPLATE([HAVE_X11], [build with x11 support])
-if test "x$no_x" != "xyes"; then
- AC_DEFINE(HAVE_X11)
-fi
-
-# qt
-AM_PATH_QT([2.3.0], have_qt=yes, have_qt=no)
-AM_CONDITIONAL(HAVE_QT, test "x$have_qt" = "xyes")
-
-# Checks for libraries.
-AC_CHECK_LIB(dl,dlopen,
- LIB_DL_FLAGS="-ldl"
-)
-AC_SUBST(LIB_DL_FLAGS)
-
-AC_CHECK_LIB(posix4, main,
- LIB_POSIX4_FLAGS="-lposix4"
-)
-AC_SUBST(LIB_POSIX4_FLAGS)
-
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect,
- LIB_SOCKET_FLAGS="-lsocket"
-)])
-AC_SUBST(LIB_SOCKET_FLAGS)
-
-have_nanosleep=0
-AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[AC_CHECK_LIB(rt,nanosleep,
- [LIB_EXTRA_FLAGS="-lrt"; have_nanosleep=1]
- ,[AC_CHECK_LIB(posix4,nanosleep,
- [LIB_EXTRA_FLAGS="-lposix4"; have_nanosleep=1]
-)])])
-AC_SUBST(LIB_EXTRA_FLAGS)
-
# autoheader kram:
AH_TOP([#ifndef INCLUDED_CONFIG_H
#define INCLUDED_CONFIG_H
@@ -99,13 +44,14 @@
case $host in
i[[3456]]86-*-*)
AC_DEFINE([CPU_I386])
- CPU=x86
+ CPU=xi386
AC_MSG_RESULT([80x86 processor detected (x >= 3).])
;;
*)
AC_MSG_RESULT([non x86 processor detected])
esac
+SHAREDLIBEXT=so
AC_MSG_CHECKING([for OS])
# os detection
case $host in
@@ -118,6 +64,7 @@
AC_DEFINE([OS_DARWIN])
AC_DEFINE([OS_POSIX])
AC_MSG_RESULT([Darwin detected.])
+ SHAREDLIBEXT=dylib
;;
*-*-linux*)
AC_DEFINE([OS_LINUX])
@@ -137,12 +84,74 @@
AC_DEFINE([OS_POSIX])
AC_DEFINE([OS_CYGWIN])
AC_MSG_RESULT([Cygwin detected.])
+ SHAREDLIBEXT=dll
;;
*)
AC_MSG_RESULT([Unknown OS! Assuming Posix combatibility])
AC_DEFINE([OS_POSIX])
esac
+# export the detected shared library extensions for use in
+# Makefile.am fiels
+AC_SUBST(SHAREDLIBEXT)
+AC_MSG_NOTICE([Shared library extension is "$SHAREDLIBEXT"])
+
+# gcc versions <= 2.95.2 don't have the standard c++ header
+# sstream
+AM_PATH_SSTREAM(have_sstream=yes, have_sstream=no)
+# copy sstream_compat to sstream if sstream is missing:
+if test "x$have_sstream" = "xno"
+then
+ AC_MSG_NOTICE([Using own sstream in util/include/compatibility])
+ if ! cp $srcdir/util/include/compatibility/sstream_compat ./util/include/sstream;
+ then
+ AC_MSG_ERROR([Could not copy the sstream header!])
+ fi
+else
+ # make sure there is no sstream header
+ rm -f ./util/include/sstream
+fi
+
+# check for extra libs
+
+# x11
+AC_PATH_XTRA
+AM_CONDITIONAL(HAVE_X11, test "x$no_x" != "xyes")
+AH_TEMPLATE([HAVE_X11], [build with x11 support])
+if test "x$no_x" != "xyes"; then
+ AC_DEFINE(HAVE_X11)
+fi
+
+# qt
+AM_PATH_QT([2.3.0], $SHAREDLIBEXT, have_qt=yes, have_qt=no)
+AM_CONDITIONAL(HAVE_QT, test "x$have_qt" = "xyes")
+
+# Checks for libraries.
+AC_CHECK_LIB(dl,dlopen,
+ LIB_DL_FLAGS="-ldl"
+)
+AC_SUBST(LIB_DL_FLAGS)
+
+AC_CHECK_LIB(posix4, main,
+ LIB_POSIX4_FLAGS="-lposix4"
+)
+AC_SUBST(LIB_POSIX4_FLAGS)
+
+AC_CHECK_LIB(socket, socket)
+AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect,
+ LIB_SOCKET_FLAGS="-lsocket"
+)])
+AC_SUBST(LIB_SOCKET_FLAGS)
+
+have_nanosleep=0
+AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[AC_CHECK_LIB(rt,nanosleep,
+ [LIB_EXTRA_FLAGS="-lrt"; have_nanosleep=1]
+ ,[AC_CHECK_LIB(posix4,nanosleep,
+ [LIB_EXTRA_FLAGS="-lposix4"; have_nanosleep=1]
+)])])
+AC_SUBST(LIB_EXTRA_FLAGS)
+
+
# Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST
@@ -277,11 +286,12 @@
;;
esac],[enable_mmx=yes])
- if test "x$enable_mmx" = "xyes"
+ if test "x$enable_mmx" = "xyes" && test "x$CPU" = "xi386"
then
AC_MSG_NOTICE([MMX support active])
AC_DEFINE(OPT_INCLUDE_MMX)
else
+ enable_mmx=no
AC_MSG_NOTICE([MMX support turned off])
fi
@@ -311,7 +321,7 @@
# required programs
-if test "$CPU" = "x86" && test "x$enable_mmx" = "xyes"; then
+if test "x$enable_mmx" = "xyes"; then
AC_PATH_PROG(NASM, nasm)
if test "x$NASM" = "x"; then
AC_MSG_ERROR([*** 'nasm' missing, please install or fix your \$PATH ***])
@@ -330,7 +340,7 @@
fi;
if test "x$use_ffmpeg" = "xyes"; then
- FFMPEG_CONFIGURE_FLAGS="--prefix=$prefix --disable-ffserver --disable-ffplay"
+ FFMPEG_CONFIGURE_FLAGS="--prefix=$prefix --disable-ffserver --disable-ffplay --enable-shared"
#--disable-risky"
echo Preparing ffmpeg configure call...
@@ -362,6 +372,7 @@
abs_builddir=`pwd`
AC_SUBST(FFMPEG_LDFLAGS,"${abs_builddir}/contrib/ffmpeg/libavformat/libavformat.a ${abs_builddir}/contrib/ffmpeg/libavcodec/libavcodec.a -lz")
+# AC_SUBST(FFMPEG_LDFLAGS,"-L${abs_builddir}/contrib/ffmpeg/libavcodec -lavcodec -lz -L${abs_builddir}/contrib/ffmpeg/libavformat -lavformat")
AC_SUBST(FFMPEG_CFLAGS,"-I${FFMPEG_DIR}/libavcodec -I${FFMPEG_DIR}/libavformat")
echo Calling ffmpeg configure with flags:
@@ -389,8 +400,6 @@
data/Makefile
data/gephex-wrapper
data/gephex.conf.default
-doc/Makefile
-doc/images/Makefile
engine/Makefile
engine/src/Makefile
engine/src/dllloader/Makefile
@@ -547,6 +556,9 @@
+#doc/Makefile
+#doc/images/Makefile
+
if test "x$have_qt" != "xyes"; then
AC_MSG_WARN([No QT support found.
*** The GUI (graphical user interface) will not be built!
--- orig/contrib/Makefile.am
+++ mod/contrib/Makefile.am
@@ -21,7 +21,7 @@
clean-local:
if WITH_FFMPEG
- cd ffmpeg && $(MAKE) clean
+ cd ffmpeg && $(MAKE) clean && find . -name "*. at SHAREDLIBEXT@" | xargs rm -f
endif
# cd ${srcdir}/ffmpeg && $(MAKE) $(AM_MAKEFLAGS) clean
--- orig/effectvmodules/src/libeffectv/libeffectv.c
+++ mod/effectvmodules/src/libeffectv/libeffectv.c
@@ -455,7 +455,7 @@
/*
* HSI color system utilities
*/
-static int trunc(double f)
+static int saturate(double f)
{
int i;
@@ -474,9 +474,9 @@
Gv=1+S*sin(T);
Bv=1+S*sin(T+2*M_PI/3);
T=255.999*I/2;
- *r=trunc(Rv*T);
- *g=trunc(Gv*T);
- *b=trunc(Bv*T);
+ *r=saturate(Rv*T);
+ *g=saturate(Gv*T);
+ *b=saturate(Bv*T);
}
/* We don't want no leaks */
--- orig/engine/src/engine/Makefile.am
+++ mod/engine/src/engine/Makefile.am
@@ -11,7 +11,6 @@
dllutils.h
AM_CPPFLAGS = \
- -DINST_INSTALL_PREFIX=\"$(prefix)\" \
-I @srcdir@/.. \
-I @srcdir@/../renderer \
-I @srcdir@/../model \
--- orig/modules/src/frboutmodule/Makefile.am
+++ mod/modules/src/frboutmodule/Makefile.am
@@ -15,7 +15,11 @@
x11output.c \
x11output.h \
x11stuff.h \
- x11stuff.c \
+ x11stuff.c
+endif
+
+if WITH_V4L
+V4L_sOURCES = \
vloopbackoutput.h \
vloopbackoutput.c
endif
@@ -52,7 +56,7 @@
frboutmodule.xpm \
outputdriver.h \
slist.h \
- slist.c $(X11_sOURCES) $(AALIB_sOURCES) $(SDL_sOURCES) $(GL_sOURCES)
+ slist.c $(X11_sOURCES) $(V4L_sOURCES) $(AALIB_sOURCES) $(SDL_sOURCES) $(GL_sOURCES)
frboutmodule_la_LDFLAGS = -module -avoid-version -no-undefined -L/usr/X11R6/lib -L at builddir@/../libscale -L/usr/X11R6/lib -L at builddir@/../libcolorconv
--- orig/modules/src/frboutmodule/frboutmodule.c
+++ mod/modules/src/frboutmodule/frboutmodule.c
@@ -68,7 +68,7 @@
struct OutputDriver* (*get_driver)();
};
-static s_mmx_supported = 0;
+static int s_mmx_supported = 0; //TODO: set correctly
#define MAX_NUM_DRIVERS 16
@@ -509,8 +509,7 @@
if (strcmp(driver_name, my->driver_name->text) != 0 ||
strcmp(server_name, my->server_name->text) != 0 ||
my->drv == 0)
- {
-
+ {
if (my->drv != 0)
{
get_drv_window_pos(my->drv, &my->win_xpos,&my->win_ypos);
@@ -621,7 +620,7 @@
params.invert = invert;
result = my->drv->blit(my->drv->inst,
- (const unsigned char*) inst->in_in->framebuffer,
+ (const uint8_t*) inst->in_in->framebuffer,
inst->in_in->xsize,
inst->in_in->ysize,
¶ms,
--- orig/modules/src/frboutmodule/x11output.c
+++ mod/modules/src/frboutmodule/x11output.c
@@ -26,10 +26,13 @@
#include <stdio.h>
#include <math.h> // for fabs
#include <string.h>
+#include <assert.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#include <errno.h>
+
#include "outputdriver.h"
#include "x11stuff.h"
@@ -46,8 +49,8 @@
//-----------------------------------------------------------------------
-static const int MAX_RES_X = 2560;
-static const int MAX_RES_Y = 1600;
+static const int MAX_RES_X = 1024;//2560;
+static const int MAX_RES_Y = 768;//1600;
static const int USE_XSHM = 0x01;
static const int USE_XV = 0x02;
@@ -89,7 +92,7 @@
int used_extensions; // indicates wether XShm and Xv are used
- uint_8* data;
+ uint8_t* data;
int data_size;
XImage* ximage;
@@ -120,7 +123,7 @@
char* error_text, int text_len);
static int X11_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
char* error_text, int text_len);
@@ -181,7 +184,7 @@
sh->image_width = 0;
sh->image_height = 0;
sh->shminfo.shmaddr = 0;
- sh->xv_port = -1;
+ sh->xv_port = 0xffffffff;
sh->xv_format_id = -1;
sh->xv_image = 0;
@@ -211,7 +214,11 @@
if (check_xshm_extension(sh->display))
{
- sh->used_extensions |= USE_XSHM;
+ if (init_xshm_stuff(sh, error_text, text_len) != 0)
+ sh->used_extensions |= USE_XSHM;
+ else
+ printf(" x11output: could not init XShm: '%s', turning off xshm
",
+ error_text);
}
if (check_xv_extension(sh->display))
@@ -239,10 +246,17 @@
snprintf(error_text, text_len, "Could not find matching visual
"
"XServer must be set up at 24 bit depth or 16 bit depth");
XDestroyWindow(sh->display, sh->win);
+ deinit_xv_stuff(sh);
free(sh);
return 0;
}
+ if (sh->vis.depth == 16)
+ {
+ printf(" x11output: Screen set to 16bit color-depth. You might want to "
+ "switch
to 24bit for better performance
");
+ }
+
if ((sh->used_extensions & USE_XV) == USE_XV)
{
if (init_xv_stuff(sh, error_text, text_len) == 0)
@@ -256,14 +270,6 @@
if ((sh->used_extensions & USE_XSHM) == USE_XSHM)
{
- if (init_xshm_stuff(sh, error_text, text_len) == 0)
- {
- deinit_xv_stuff(sh);
- XDestroyWindow(sh->display, sh->win);
- free(sh);
- return 0;
- }
-
if ((sh->used_extensions & USE_XV) == 0)
{
/* create shared memory ximage */
@@ -377,7 +383,7 @@
// xshm and no xv
static int X11_xshm_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
int needs_adjust,
@@ -395,7 +401,7 @@
XNextEvent(sh->display, &event);
if (event.type == sh->completion_type)
- break;
+ break;
}
}
@@ -403,23 +409,25 @@
if (needs_adjust)
{
ls_set_adjustment(sh->pal, params->brightness, params->contrast,
- params->gamma, params->invert);
+ params->gamma, params->invert);
- ls_scale32m_adjust((uint_32*)sh->ximage->data, sh->width, sh->height,
- (uint_32*)fb, width, height, params->mirrorx,
- params->mirrory, sh->pal);
+ ls_scale32m_adjust((uint32_t*)sh->ximage->data, sh->width, sh->height,
+ (const uint32_t*)fb, width, height, params->mirrorx,
+ params->mirrory, sh->pal);
}
else
{
- ls_scale32m((uint_32*)sh->ximage->data, sh->width, sh->height,
- (uint_32*)fb, width, height, params->mirrorx,
+ ls_scale32m((uint32_t*)sh->ximage->data, sh->width, sh->height,
+ (const uint32_t*)fb, width, height, params->mirrorx,
params->mirrory);
}
+ //TODO: this is a hack for big-endian machines
+ if (big_endian())
+ convert_endianness(sh->ximage->data, sh->width, sh->height);
+
if (sh->vis.depth == 16)
- {
convert_to_16_inplace(sh->ximage->data, sh->width, sh->height);
- }
// blit shared mem image
XShmPutImage(sh->display, sh->win, sh->gc, sh->ximage,
@@ -432,7 +440,7 @@
}
static int X11_xshm_xv_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
int needs_adjust,
@@ -472,6 +480,10 @@
sh->image_height = height;
}
+ //TODO: this is a hack for big-endian machines
+ if (big_endian())
+ convert_endianness((uint8_t*) fb, sh->width, sh->height);
+
if (sh->vis.depth == 24)
{
#if defined(OPT_INCLUDE_MMX)
@@ -502,7 +514,7 @@
static int X11_xv_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
int needs_adjust,
@@ -531,8 +543,21 @@
sh->data = malloc(sh->xv_image->data_size);
sh->data_size = sh->xv_image->data_size;
+
+ if (sh->data == 0)
+ {
+ snprintf(error_text, text_len,
+ "Could not allocate data for XVImage");
+ return 0;
+ }
}
+ assert(sh->data);
+
+ //TODO: this is a hack for big-endian machines
+ if (big_endian())
+ convert_endianness(sh->data, sh->width, sh->height);
+
sh->xv_image->data = sh->data;
if (sh->vis.depth == 24)
@@ -555,16 +580,16 @@
static int X11_ximage_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
int needs_adjust,
char* error_text, int text_len)
{
- unsigned char* framebuffer;
+ uint8_t* framebuffer;
- if (width != sh->width || height != sh->height
- || params->mirrorx || params->mirrory || needs_adjust)
+ if (width != sh->width || height != sh->height ||
+ params->mirrorx || params->mirrory || needs_adjust)
{
int size = sh->width*sh->height*4;
@@ -579,18 +604,25 @@
sh->data = malloc(size);
sh->data_size = size;
}
-
+
+ if (sh->data == 0)
+ {
+ snprintf(error_text, text_len,
+ "Could not allocate data for XImage");
+ return 0;
+ }
+
if (needs_adjust)
{
- ls_scale32m_adjust((uint_32*)sh->data, sh->width, sh->height,
- (uint_32*)fb, width, height, params->mirrorx,
- params->mirrory, sh->pal);
+ ls_scale32m_adjust((uint32_t*) sh->data, sh->width, sh->height,
+ (const uint32_t*) fb, width, height,
+ params->mirrorx, params->mirrory, sh->pal);
}
else
{
- ls_scale32m((uint_32*)sh->data, sh->width, sh->height,
- (uint_32*)fb, width, height, params->mirrorx,
- params->mirrory);
+ ls_scale32m((uint32_t*) sh->data, sh->width, sh->height,
+ (const uint32_t*) fb, width, height,
+ params->mirrorx, params->mirrory);
}
framebuffer = sh->data;
@@ -604,17 +636,21 @@
sh->data_size = 0;
}
- framebuffer = (unsigned char*) fb;
+ framebuffer = (uint8_t*) fb;
}
// now create an XImage using the framebuffers pixel data
+ //TODO: this is a hack for big-endian machines
+ if (big_endian())
+ convert_endianness(framebuffer, sh->width, sh->height);
+
if (sh->vis.depth == 16)
convert_to_16_inplace(framebuffer, sh->width, sh->height);
if (sh->ximage == 0 ||
- sh->image_width != width ||
- sh->image_height != height)
+ sh->image_width != sh->width ||
+ sh->image_height != sh->height)
{
if (sh->ximage)
XDestroyImage(sh->ximage);
@@ -630,8 +666,8 @@
32,
0);
- sh->image_width = width;
- sh->image_height = height;
+ sh->image_width = sh->width;
+ sh->image_height = sh->height;
}
if (sh->ximage == 0)
@@ -653,7 +689,7 @@
}
static int X11_blit(struct DriverInstance* sh,
- const unsigned char* fb,
+ const uint8_t* fb,
int width, int height,
struct blit_params* params,
char* error_text, int text_len)
@@ -722,7 +758,8 @@
{
unsigned int num_adaptors;
XvAdaptorInfo* adaptors;
- int ret, i;
+ int ret;
+ unsigned int i;
DEBUG_PRINTF("Looking for port...
");
@@ -870,20 +907,22 @@
sh->event_pending = 0;
/* allocate shared memory */
+
+ // changed flags from 0777 to 0666, see
+ // http://lists.apple.com/archives/unix-porting/2004/Apr/msg00081.html
sh->shminfo.shmid = shmget (IPC_PRIVATE,
MAX_RES_X * MAX_RES_Y * 4,
- IPC_CREAT|0777);
+ 0666 | IPC_CREAT);
if (sh->shminfo.shmid == -1)
{
- snprintf(error_text, text_len, "shmget() failed!");
+ snprintf(error_text, text_len, "shmget() failed, errno=%i!", errno);
return 0;
}
/* attach shared memory to our process */
sh->shminfo.shmaddr = shmat (sh->shminfo.shmid, 0, 0);
-
- if (sh->shminfo.shmaddr == -1)
+ if (sh->shminfo.shmaddr == (void*) -1) // TODO
{
shmctl (sh->shminfo.shmid, IPC_RMID, 0);
snprintf(error_text, text_len, "shmat() failed!");
@@ -940,10 +979,10 @@
static void deinit_xv_stuff(struct DriverInstance* sh)
{
- if (sh->xv_port != -1)
+ if (sh->xv_port != 0xffffffff)
{
XvUngrabPort(sh->display, sh->xv_port, CurrentTime);
- sh->xv_port = -1;
+ sh->xv_port = 0xffffffff;
}
if (sh->xv_image != 0)
--- orig/modules/src/frboutmodule/x11stuff.c
+++ mod/modules/src/frboutmodule/x11stuff.c
@@ -22,6 +22,8 @@
#include "x11stuff.h"
+#include <string.h>
+
int x11_win_on_top(Bool on_top,
Display* dpy,
Window win)
@@ -101,10 +103,11 @@
vinfo_templ.screen = DefaultScreen(dpy);
vinfo_templ.depth = bpp;
vinfo_templ.class = TrueColor;
- // vinfo_templ.red_mask = 0x000000ff;
- // vinfo_templ.green_mask = 0x0000ff00;
- // vinfo_templ.blue_mask = 0x00ff0000;
- // vinfo_templ.bits_per_rgb = 8;
+
+ /*vinfo_templ.red_mask = 0x000000ff;
+ vinfo_templ.green_mask = 0x0000ff00;
+ vinfo_templ.blue_mask = 0x00ff0000;
+ vinfo_templ.bits_per_rgb = 8;*/
vinfos = XGetVisualInfo(dpy, mask, &vinfo_templ, &n);
/*for (i = 0; i < n; ++i)
@@ -135,23 +138,55 @@
return find_best_visual_bpp(dpy, chosen_vis, 16);
}
- void convert_to_16_inplace(unsigned char* frb,
+ void convert_to_16_inplace(uint8_t* frb,
int width, int height)
{
- const unsigned char* src = frb;
- uint_16* dst = (uint_16*) frb;
+ const uint8_t* src = frb;
+ uint16_t* dst = (uint16_t*) frb;
int i;
for (i = width*height; i != 0; --i)
{
- unsigned char b = src[0] >> 3;
- unsigned char g = src[1] >> 2;
- unsigned char r = src[2] >> 3;
+ uint8_t b = src[0] >> 3;
+ uint8_t g = src[1] >> 2;
+ uint8_t r = src[2] >> 3;
src += 4;
*(dst++) = (r << 11) | (g << 5) | b;
}
}
+
+int big_endian()
+{
+ uint16_t tmp = 0xff11;
+
+ uint8_t* p = (uint8_t*) &tmp;
+
+ return p[0] == 0xff;
+}
+
+void convert_endianness(uint8_t* frb, int width, int height)
+{
+ uint8_t* ptr = frb;
+ int i;
+
+ for (i = width*height; i != 0; --i)
+ {
+ uint8_t b = ptr[0];
+ uint8_t g = ptr[1];
+ uint8_t r = ptr[2];
+ uint8_t a = ptr[3];
+
+ ptr[0] = a;
+ ptr[1] = r;
+ ptr[2] = g;
+ ptr[3] = b;
+
+ ptr += 4;
+ }
+}
+
+
/*
void print_visual(XVisualInfo* vinfo)
{
--- orig/modules/src/frboutmodule/x11stuff.h
+++ mod/modules/src/frboutmodule/x11stuff.h
@@ -62,7 +62,11 @@
int find_best_visual(Display* dpy,
XVisualInfo* chosen_vis);
-void convert_to_16_inplace(uint_8* frb, int width, int height);
+
+void convert_to_16_inplace(uint8_t* frb, int width, int height);
+
+int big_endian();
+void convert_endianness(uint8_t* frb, int width, int height);
//void print_visual(XVisualInfo* vinfo);
--- orig/modules/src/funparsemodule/parser.tab.c
+++ mod/modules/src/funparsemodule/parser.tab.c
@@ -1,95 +1,25 @@
-/* A Bison parser, made by GNU Bison 1.875a. */
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* A Bison parser, made from ./parser.y
+ by GNU Bison version 1.28 */
- 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 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+#define YYBISON 1 /* Identify Bison output. */
-/* 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. */
+#define NUMBER 257
+#define HOCH 258
+#define TIMES 259
+#define MODULO 260
+#define DIV 261
+#define PLUS 262
+#define MINUS 263
+#define EOL 264
+#define SEMICOLON 265
+#define KLAUF 266
+#define KLZU 267
+#define ID 268
+#define KOMMA 269
+#define PIPE 270
+#define NEGATION 271
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 1
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NUMBER = 258,
- HOCH = 259,
- TIMES = 260,
- MODULO = 261,
- DIV = 262,
- PLUS = 263,
- MINUS = 264,
- EOL = 265,
- SEMICOLON = 266,
- KLAUF = 267,
- KLZU = 268,
- ID = 269,
- KOMMA = 270,
- PIPE = 271,
- NEGATION = 272
- };
-#endif
-#define NUMBER 258
-#define HOCH 259
-#define TIMES 260
-#define MODULO 261
-#define DIV 262
-#define PLUS 263
-#define MINUS 264
-#define EOL 265
-#define SEMICOLON 266
-#define KLAUF 267
-#define KLZU 268
-#define ID 269
-#define KOMMA 270
-#define PIPE 271
-#define NEGATION 272
-
-
-
-
-/* Copy the first part of user declarations. */
#line 2 "./parser.y"
/* This source file is a part of the GePhex Project.
@@ -130,733 +60,445 @@
/*---------------------------------------------------------------------------*/
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 45 "./parser.y"
-typedef union YYSTYPE {
+#line 44 "./parser.y"
+typedef union
+{
struct slist_s_t* list;
struct expression_s_t* expr;
char* text;
double num;
} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 157 "parser.tab.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 214 of yacc.c. */
-#line 169 "parser.tab.c"
-
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- 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) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
+#include <stdio.h>
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
#endif
-
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
#endif
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 12
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 60
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 18
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 4
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 16
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 32
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 272
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char 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, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 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
+#define YYFINAL 32
+#define YYFLAG -32768
+#define YYNTBASE 18
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 271 ? yytranslate[x] : 21)
+
+static const char 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, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 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, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17
};
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned char yyprhs[] =
-{
- 0, 0, 3, 5, 7, 11, 15, 19, 23, 27,
- 31, 34, 38, 40, 45, 49, 51
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 8, 12, 16, 20, 24, 28, 31,
+ 35, 37, 42, 46, 48
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
- 19, 0, -1, 20, -1, 3, -1, 20, 8, 20,
- -1, 20, 9, 20, -1, 20, 5, 20, -1, 20,
- 7, 20, -1, 20, 4, 20, -1, 20, 6, 20,
- -1, 9, 20, -1, 16, 20, 16, -1, 14, -1,
- 14, 12, 21, 13, -1, 12, 20, 13, -1, 20,
- -1, 20, 15, 21, -1
+static const short yyrhs[] = { 19,
+ 0, 3, 0, 19, 8, 19, 0, 19, 9, 19,
+ 0, 19, 5, 19, 0, 19, 7, 19, 0, 19,
+ 4, 19, 0, 19, 6, 19, 0, 9, 19, 0,
+ 16, 19, 16, 0, 14, 0, 14, 12, 20, 13,
+ 0, 12, 19, 13, 0, 19, 0, 19, 15, 20,
+ 0
};
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
-{
- 0, 85, 85, 91, 94, 101, 108, 115, 122, 129,
- 136, 142, 149, 152, 157, 162, 166
-};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[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", "NUMBER", "HOCH", "TIMES", "MODULO", "DIV",
- "PLUS", "MINUS", "EOL", "SEMICOLON", "KLAUF", "KLZU", "ID", "KOMMA",
- "PIPE", "NEGATION", "$accept", "start", "exp", "exp_list", 0
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 85, 91, 94, 101, 108, 115, 122, 129, 136, 142,
+ 149, 152, 157, 162, 166
};
#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272
-};
-# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 18, 19, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 21, 21
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","NUMBER",
+"HOCH","TIMES","MODULO","DIV","PLUS","MINUS","EOL","SEMICOLON","KLAUF","KLZU",
+"ID","KOMMA","PIPE","NEGATION","start","exp","exp_list", NULL
};
+#endif
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 1, 1, 3, 3, 3, 3, 3, 3,
- 2, 3, 1, 4, 3, 1, 3
+static const short yyr1[] = { 0,
+ 18, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 20, 20
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const unsigned char yydefact[] =
-{
- 0, 3, 0, 0, 12, 0, 0, 2, 10, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 14,
- 15, 0, 11, 8, 6, 9, 7, 4, 5, 0,
- 13, 16
+static const short yyr2[] = { 0,
+ 1, 1, 3, 3, 3, 3, 3, 3, 2, 3,
+ 1, 4, 3, 1, 3
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
-{
- -1, 6, 20, 21
+static const short yydefact[] = { 0,
+ 2, 0, 0, 11, 0, 1, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 13, 14, 0, 10,
+ 7, 5, 8, 6, 3, 4, 0, 12, 15, 0,
+ 0, 0
};
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -12
-static const yysigned_char yypact[] =
-{
- 16, -12, 16, 16, -11, 16, 4, 2, 17, 47,
- 16, 29, -12, 16, 16, 16, 16, 16, 16, -12,
- 35, -1, -12, -12, 22, 22, 22, 17, 17, 16,
- -12, -12
+static const short yydefgoto[] = { 30,
+ 18, 19
};
-/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
-{
- -12, -12, 0, -9
+static const short yypact[] = { 14,
+-32768, 14, 14, -11, 14, 55, 2, 45, 14, 27,
+ 14, 14, 14, 14, 14, 14,-32768, 33, -9,-32768,
+-32768, 6, 6, 6, 2, 2, 14,-32768,-32768, 18,
+ 19,-32768
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
-{
- 7, 10, 8, 9, 12, 11, 13, 14, 15, 16,
- 17, 18, 30, 23, 24, 25, 26, 27, 28, 1,
- 31, 13, 14, 15, 16, 2, 13, 0, 3, 0,
- 4, 0, 5, 13, 14, 15, 16, 17, 18, 13,
- 14, 15, 16, 17, 18, 22, 0, 0, 0, 0,
- 29, 13, 14, 15, 16, 17, 18, 0, 0, 0,
- 19
+static const short yypgoto[] = {-32768,
+ 0, -7
};
-static const yysigned_char yycheck[] =
-{
- 0, 12, 2, 3, 0, 5, 4, 5, 6, 7,
- 8, 9, 13, 13, 14, 15, 16, 17, 18, 3,
- 29, 4, 5, 6, 7, 9, 4, -1, 12, -1,
- 14, -1, 16, 4, 5, 6, 7, 8, 9, 4,
- 5, 6, 7, 8, 9, 16, -1, -1, -1, -1,
- 15, 4, 5, 6, 7, 8, 9, -1, -1, -1,
- 13
+
+#define YYLAST 64
+
+
+static const short yytable[] = { 6,
+ 9, 7, 8, 28, 10, 11, 12, 13, 14, 11,
+ 21, 22, 23, 24, 25, 26, 1, 31, 32, 29,
+ 0, 0, 2, 0, 0, 3, 0, 4, 0, 5,
+ 11, 12, 13, 14, 15, 16, 11, 12, 13, 14,
+ 15, 16, 20, 0, 0, 0, 0, 27, 11, 12,
+ 13, 14, 15, 16, 0, 0, 0, 17, 11, 12,
+ 13, 14, 15, 16
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 3, 9, 12, 14, 16, 19, 20, 20, 20,
- 12, 20, 0, 4, 5, 6, 7, 8, 9, 13,
- 20, 21, 16, 20, 20, 20, 20, 20, 20, 15,
- 13, 21
+static const short yycheck[] = { 0,
+ 12, 2, 3, 13, 5, 4, 5, 6, 7, 4,
+ 11, 12, 13, 14, 15, 16, 3, 0, 0, 27,
+ -1, -1, 9, -1, -1, 12, -1, 14, -1, 16,
+ 4, 5, 6, 7, 8, 9, 4, 5, 6, 7,
+ 8, 9, 16, -1, -1, -1, -1, 15, 4, 5,
+ 6, 7, 8, 9, -1, -1, -1, 13, 4, 5,
+ 6, 7, 8, 9
};
+#define YYPURE 1
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/share/bison.simple"
+/* This file comes from bison-1.28. */
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 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 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include <alloca.h>
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include <malloc.h>
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
#endif
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
+#define YYEMPTY -2
#define YYEOF 0
-
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
+#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
-
#define YYFAIL goto yyerrlab
-
#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
+#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
- { \
- yyerror ("syntax error: cannot back up");\
- YYERROR; \
- } \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.first_line = Rhs[1].first_line; \
- Current.first_column = Rhs[1].first_column; \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
+#ifndef YYPURE
+#define YYLEX yylex()
#endif
-/* YYLEX -- calling `yylex' with the right arguments. */
-
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
-# define YYLEX yylex (&yylval)
+#define YYLEX yylex(&yylval, &yylloc)
#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
-
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "
"); \
- } \
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (cinluded). |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short *bottom, short *top)
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
-static void
-yy_stack_print (bottom, top)
- short *bottom;
- short *top;
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "
");
-}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
+/* If nonreentrant, generate the variables here */
+#ifndef YYPURE
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
#endif
-{
- int yyi;
- unsigned int yylineno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylineno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s
", yytname [yyr1[yyrule]]);
-}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
-} 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 YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
-/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
+#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
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
-# undef YYMAXDEPTH
+#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
+#define YYMAXDEPTH 10000
#endif
-
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '
- continue;
-
- return yys - yystr - 1;
-}
-# 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 '
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '
- continue;
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
- return yyd - 1;
+ while (i-- > 0)
+ *t++ = *f++;
}
-# endif
-# endif
-#endif /* !YYERROR_VERBOSE */
+#else /* __cplusplus */
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
+ while (i-- > 0)
+ *t++ = *f++;
}
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yytype, yyvaluep)
- int yytype;
- YYSTYPE *yyvaluep;
#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
+#endif
+#line 217 "/usr/share/bison.simple"
-/* Prevent warnings from -Wmissing-prototypes. */
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
+int yyparse (void *);
#else
-int
-yyparse ()
-
+int yyparse (void);
#endif
#endif
-{
- /* The lookahead symbol. */
-int yychar;
-
-/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
register int yystate;
register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
register short *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
- YYSIZE_T yystacksize = YYINITDEPTH;
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
int yylen;
- YYDPRINTF ((stderr, "Starting parse
"));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse
");
+#endif
yystate = 0;
yyerrstatus = 0;
@@ -868,96 +510,110 @@
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss;
+ yyssp = yyss - 1;
yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
- 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++;
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
- yysetstate:
- *yyssp = yystate;
+ *++yyssp = yystate;
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
{
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ int size = yyssp - yyss + 1;
#ifdef 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. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-
-
- /* 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 ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
/* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
+ if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-
- {
- short *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
#endif /* no yyoverflow */
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
- YYDPRINTF ((stderr, "Stack size increased to %lu
",
- (unsigned long int) yystacksize));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d
", yystacksize);
+#endif
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- YYDPRINTF ((stderr, "Entering state %d
", yystate));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d
", yystate);
+#endif
goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
+ yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
@@ -966,433 +622,478 @@
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yyn == YYFLAG)
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. */
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
yychar = YYLEX;
}
- if (yychar <= YYEOF)
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
{
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.
"));
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.
");
+#endif
}
else
{
- yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")
");
+ }
+#endif
}
- /* 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)
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
+
yyn = yytable[yyn];
- if (yyn <= 0)
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
+ if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
+/* Do the default action for the current state. */
yydefault:
+
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
- goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
+/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
- /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
- 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];
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s
", yytname[yyr1[yyn]]);
+ }
+#endif
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
+
+ switch (yyn) {
+
+case 1:
#line 85 "./parser.y"
- {
+{
expression_t* e = (expression_t*) parm;
*e = yyvsp[0].expr;
- ;}
- break;
-
- case 3:
+ ;
+ break;}
+case 2:
#line 91 "./parser.y"
- {
+{
yyval.expr = expression_create_const(yyvsp[0].num);
- ;}
- break;
-
- case 4:
+ ;
+ break;}
+case 3:
#line 94 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(add_fun,
args);
- ;}
- break;
-
- case 5:
+ ;
+ break;}
+case 4:
#line 101 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(sub_fun,
args);
- ;}
- break;
-
- case 6:
+ ;
+ break;}
+case 5:
#line 108 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(mul_fun,
args);
- ;}
- break;
-
- case 7:
+ ;
+ break;}
+case 6:
#line 115 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(div_fun,
args);
- ;}
- break;
-
- case 8:
+ ;
+ break;}
+case 7:
#line 122 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(pow_fun,
args);
- ;}
- break;
-
- case 9:
+ ;
+ break;}
+case 8:
#line 129 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
slist_push_front(args, yyvsp[-2].expr);
yyval.expr = expression_create_builtin(mod_fun,
args);
- ;}
- break;
-
- case 10:
+ ;
+ break;}
+case 9:
#line 136 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[0].expr);
yyval.expr = expression_create_builtin(neg_fun,
args);
- ;}
- break;
-
- case 11:
+ ;
+ break;}
+case 10:
#line 142 "./parser.y"
- {
+{
slist_t args = slist_create();
slist_push_front(args, yyvsp[-1].expr);
yyval.expr = expression_create_builtin(abs_fun,
args);
- ;}
- break;
-
- case 12:
+ ;
+ break;}
+case 11:
#line 149 "./parser.y"
- {
+{
yyval.expr = expression_create_var(yyvsp[0].text)
- ;}
- break;
-
- case 13:
+ ;
+ break;}
+case 12:
#line 152 "./parser.y"
- {
+{
yyval.expr = expression_create_fun(yyvsp[-3].text, yyvsp[-1].list);
free(yyvsp[-3].text);
- ;}
- break;
-
- case 14:
+ ;
+ break;}
+case 13:
#line 157 "./parser.y"
- {
+{
yyval.expr=yyvsp[-1].expr;
- ;}
- break;
-
- case 15:
+ ;
+ break;}
+case 14:
#line 162 "./parser.y"
- {
+{
yyval.list = slist_create();
slist_push_front(yyval.list, yyvsp[0].expr);
- ;}
- break;
-
- case 16:
+ ;
+ break;}
+case 15:
#line 166 "./parser.y"
- {
+{
yyval.list = yyvsp[0].list;
slist_push_front(yyval.list, yyvsp[-2].expr);
- ;}
- break;
-
-
- }
-
-/* Line 999 of yacc.c. */
-#line 1203 "parser.tab.c"
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
-
- YY_STACK_PRINT (yyss, yyssp);
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "
");
+ }
+#endif
*++yyvsp = yyval;
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
- /* 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. */
+ /* 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. */
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
+yyerrlab: /* here on detecting error */
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
{
++yynerrs;
-#if YYERROR_VERBOSE
+
+#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
- if (YYPACT_NINF < yyn && yyn < YYLAST)
+ if (yyn > YYFLAG && yyn < YYLAST)
{
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- char *yymsg;
- int yyx, yycount;
-
- yycount = 0;
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- yysize += yystrlen (yytname[yyx]) + 15, yycount++;
- yysize += yystrlen ("syntax error, unexpected ") + 1;
- yysize += yystrlen (yytname[yytype]);
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
{
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
+ strcpy(msg, "parse error");
- if (yycount < 5)
+ if (count < 5)
{
- yycount = 0;
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *));
- yyx++)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
{
- const char *yyq = ! yycount ? ", expecting " : " or ";
- yyp = yystpcpy (yyp, yyq);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yycount++;
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
}
}
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
+ yyerror(msg);
+ free(msg);
}
else
- yyerror ("syntax error; also virtual memory exhausted");
+ yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
+ yyerror("parse error");
}
-
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
- /* Return failure if at end of input. */
+ /* return failure if at end of input */
if (yychar == YYEOF)
- {
- /* Pop the error token. */
- YYPOPSTACK;
- /* Pop the rest of the stack. */
- while (yyss < yyssp)
- {
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- YYPOPSTACK;
- }
- YYABORT;
- }
+ YYABORT;
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
- yychar = YYEMPTY;
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).
", yychar, yytname[yychar1]);
+#endif
+ yychar = YYEMPTY;
}
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
-/*----------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action. |
-`----------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
- for (;;)
+#if YYDEBUG != 0
+ if (yydebug)
{
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "
");
+ }
+#endif
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- yyvsp--;
- yystate = *--yyssp;
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
- YY_STACK_PRINT (yyss, yyssp);
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
- YYDPRINTF ((stderr, "Shifting error token, "));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
*++yyvsp = yylval;
-
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
yystate = yyn;
goto yynewstate;
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
#endif
- return yyresult;
+ }
+ return 1;
}
-
-
#line 172 "./parser.y"
/* Grammatik endet hier */
@@ -1420,4 +1121,3 @@
return 1;
}
-
--- orig/modules/src/funparsemodule/parser.tab.h
+++ mod/modules/src/funparsemodule/parser.tab.h
@@ -1,86 +1,23 @@
-/* A Bison parser, made by GNU Bison 1.875a. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NUMBER = 258,
- HOCH = 259,
- TIMES = 260,
- MODULO = 261,
- DIV = 262,
- PLUS = 263,
- MINUS = 264,
- EOL = 265,
- SEMICOLON = 266,
- KLAUF = 267,
- KLZU = 268,
- ID = 269,
- KOMMA = 270,
- PIPE = 271,
- NEGATION = 272
- };
-#endif
-#define NUMBER 258
-#define HOCH 259
-#define TIMES 260
-#define MODULO 261
-#define DIV 262
-#define PLUS 263
-#define MINUS 264
-#define EOL 265
-#define SEMICOLON 266
-#define KLAUF 267
-#define KLZU 268
-#define ID 269
-#define KOMMA 270
-#define PIPE 271
-#define NEGATION 272
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 45 "./parser.y"
-typedef union YYSTYPE {
+typedef union
+{
struct slist_s_t* list;
struct expression_s_t* expr;
char* text;
double num;
} YYSTYPE;
-/* Line 1240 of yacc.c. */
-#line 78 "parser.tab.h"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-
+#define NUMBER 257
+#define HOCH 258
+#define TIMES 259
+#define MODULO 260
+#define DIV 261
+#define PLUS 262
+#define MINUS 263
+#define EOL 264
+#define SEMICOLON 265
+#define KLAUF 266
+#define KLZU 267
+#define ID 268
+#define KOMMA 269
+#define PIPE 270
+#define NEGATION 271
--- orig/modules/src/funparsemodule/scanner.c
+++ mod/modules/src/funparsemodule/scanner.c
@@ -1,86 +1,33 @@
#line 2 "scanner.c"
-
-#line 4 "scanner.c"
-
-#define YY_INT_ALIGNED short int
-
/* A lexical scanner generated by flex */
+/* Scanner skeleton version:
+ * $Header: /cvs/root/flex/flex/skel.c,v 1.1.1.1 1999/04/23 00:46:30 wsanchez Exp $
+ */
+
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 31
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-/* First, we deal with platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX (65535U)
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! FLEXINT_H */
#ifdef __cplusplus
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
@@ -88,17 +35,34 @@
#if __STDC__
+#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
/* Returned upon end-of-file. */
#define YY_NULL 0
@@ -113,71 +77,71 @@
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
-#define BEGIN (yy_start) = 1 + 2 *
+#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
-#define YY_START (((yy_start) - 1) / 2)
+#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin )
+#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
-#endif
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
extern int yyleng;
-
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
- #define YY_LESS_LINENO(n)
-
-/* Return all but the first "n" matched characters back to the input stream. */
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
- YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
+ *yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-#define unput(c) yyunput( c, (yytext_ptr) )
+#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
typedef unsigned int yy_size_t;
-#endif
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
+
struct yy_buffer_state
{
FILE *yy_input_file;
@@ -214,16 +178,12 @@
*/
int yy_at_bol;
- int yy_bs_lineno; /**< The line count. */
- int yy_bs_column; /**< The column count. */
-
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
-
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
@@ -237,33 +197,23 @@
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
-
};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
- *
- * Returns the top of the stack, or NULL.
*/
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
- ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
- : NULL)
+#define YY_CURRENT_BUFFER yy_current_buffer
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
+
static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
int yyleng;
/* Points to current character in buffer. */
@@ -276,99 +226,73 @@
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart (FILE *input_file );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
-void yy_delete_buffer (YY_BUFFER_STATE b );
-void yy_flush_buffer (YY_BUFFER_STATE b );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
-
-void *yyalloc (yy_size_t );
-void *yyrealloc (void *,yy_size_t );
-void yyfree (void * );
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
- if ( ! YY_CURRENT_BUFFER ){ \
- yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
- if ( ! YY_CURRENT_BUFFER ){\
- yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
}
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
typedef unsigned char YY_CHAR;
-
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
extern char *yytext;
#define yytext_ptr yytext
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[] );
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
*yy_cp = '
- (yy_c_buf_p) = yy_cp;
+ yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 17
#define YY_END_OF_BUFFER 18
-/* This struct is not used in this scanner,
- but its presence is necessary. */
-struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
-static yyconst flex_int16_t yy_accept[29] =
+static yyconst short int yy_accept[29] =
{ 0,
0, 0, 18, 16, 15, 14, 6, 11, 12, 4,
2, 9, 3, 5, 1, 8, 7, 13, 10, 15,
1, 1, 0, 13, 1, 0, 1, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -400,27 +324,27 @@
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[20] =
+static yyconst int yy_meta[20] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 1, 1, 1, 2, 2, 1
} ;
-static yyconst flex_int16_t yy_base[30] =
+static yyconst short int yy_base[30] =
{ 0,
0, 0, 31, 40, 27, 40, 40, 40, 40, 40,
40, 40, 40, 40, 9, 40, 40, 0, 40, 24,
15, 0, 26, 0, 0, 12, 10, 40, 19
} ;
-static yyconst flex_int16_t yy_def[30] =
+static yyconst short int yy_def[30] =
{ 0,
28, 1, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 29, 28, 28,
28, 15, 28, 29, 21, 28, 28, 0, 28
} ;
-static yyconst flex_int16_t yy_nxt[60] =
+static yyconst short int yy_nxt[60] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
4, 14, 15, 16, 4, 17, 18, 18, 19, 21,
@@ -430,7 +354,7 @@
28, 28, 28, 28, 28, 28, 28, 28, 28
} ;
-static yyconst flex_int16_t yy_chk[60] =
+static yyconst short int yy_chk[60] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 15,
@@ -443,9 +367,6 @@
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
@@ -454,8 +375,9 @@
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "scanner.flex"
-#line 2 "scanner.flex"
+#line 1 "./scanner.flex"
+#define INITIAL 0
+#line 2 "./scanner.flex"
/* This source file is a part of the GePhex Project.
Copyright (C) 2001-2004
@@ -491,21 +413,7 @@
#include <stdlib.h>
#include "parser.tab.h" /* Zeug vom Parser ! */
-#line 495 "scanner.c"
-
-#define INITIAL 0
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
+#line 417 "scanner.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -513,30 +421,65 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap (void );
+extern "C" int yywrap YY_PROTO(( void ));
#else
-extern int yywrap (void );
+extern int yywrap YY_PROTO(( void ));
#endif
#endif
- static void yyunput (int c,char *buf_ptr );
-
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (void );
+static int yyinput YY_PROTO(( void ));
#else
-static int input (void );
+static int input YY_PROTO(( void ));
+#endif
#endif
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
#endif
/* Amount of stuff to slurp up with each read. */
@@ -545,6 +488,7 @@
#endif
/* Copy whatever the last rule matched to the standard output. */
+
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
@@ -557,10 +501,9 @@
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ if ( yy_current_buffer->yy_is_interactive ) \
{ \
- int c = '*'; \
- size_t n; \
+ int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '
'; ++n ) \
buf[n] = (char) c; \
@@ -570,22 +513,9 @@
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(yyin); \
- } \
- }\
-\
-
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -606,18 +536,12 @@
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
-/* end tables serialization structures and prototypes */
-
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
@@ -634,30 +558,28 @@
#define YY_RULE_SETUP \
YY_USER_ACTION
-/** The main scanner function which does all the work.
- */
YY_DECL
-{
+ {
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
-#line 46 "scanner.flex"
+
+#line 46 "./scanner.flex"
-#line 650 "scanner.c"
+#line 572 "scanner.c"
- if ( (yy_init) )
+ if ( yy_init )
{
- (yy_init) = 0;
+ yy_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
@@ -665,36 +587,34 @@
if ( ! yyout )
yyout = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
- }
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
- yy_load_buffer_state( );
+ yy_load_buffer_state();
}
while ( 1 ) /* loops until end-of-file is reached */
{
- yy_cp = (yy_c_buf_p);
+ yy_cp = yy_c_buf_p;
/* Support of yytext. */
- *yy_cp = (yy_hold_char);
+ *yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = yy_start;
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
@@ -711,27 +631,29 @@
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
+
do_action: /* This label is used only to access EOF actions. */
+
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
goto yy_find_action;
case 1:
YY_RULE_SETUP
-#line 49 "scanner.flex"
+#line 49 "./scanner.flex"
{
YYSTYPE* lvalp = (YYSTYPE*) lval;
lvalp->num = atof(yytext);
@@ -740,62 +662,62 @@
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 54 "scanner.flex"
+#line 54 "./scanner.flex"
{ return PLUS; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 55 "scanner.flex"
+#line 55 "./scanner.flex"
{ return MINUS; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 56 "scanner.flex"
+#line 56 "./scanner.flex"
{ return TIMES; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 57 "scanner.flex"
+#line 57 "./scanner.flex"
{ return DIV; }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 58 "scanner.flex"
+#line 58 "./scanner.flex"
{ return MODULO; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 59 "scanner.flex"
+#line 59 "./scanner.flex"
{ return HOCH; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 60 "scanner.flex"
+#lin