GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
-esac
-
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$lt_target" in
+case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
AC_PROG_LD_GNU
])
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$lt_target" in
+case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1555: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1556: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1571: checking for BSD-compatible nm" >&5
+echo "configure:1572: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
+
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1607: checking whether ln -s works" >&5
+echo "configure:1609: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
-case "$target" in
-NONE) lt_target="$host" ;;
-*) lt_target="$target" ;;
-esac
-
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$lt_target" in
+case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1656 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1653 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1678: checking whether the C compiler needs -belf" >&5
+echo "configure:1675: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1683 "configure"
+#line 1680 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
# Reload cache, that may have been modified by ltconfig
exec 5>>./config.log
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1792: checking how to run the C preprocessor" >&5
+echo "configure:1789: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1807 "configure"
+#line 1804 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1824 "configure"
+#line 1821 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1841 "configure"
+#line 1838 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1877: checking for $ac_word" >&5
+echo "configure:1874: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1910: checking for $ac_word" >&5
+echo "configure:1907: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1944: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1941: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1952 "configure"
+#line 1949 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
yywrap()
; return 0; }
EOF
-if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1986: checking lex output file root" >&5
+echo "configure:1983: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2007: checking whether yytext is a pointer" >&5
+echo "configure:2004: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
cat > conftest.$ac_ext <<EOF
-#line 2019 "configure"
+#line 2016 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {
; return 0; }
EOF
-if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_prog_lex_yytext_pointer=yes
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2052: checking for $ac_word" >&5
+echo "configure:2049: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:2109: checking size of long" >&5
+echo "configure:2106: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 2117 "configure"
+#line 2114 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:2148: checking size of long long" >&5
+echo "configure:2145: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_sizeof_long_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 2156 "configure"
+#line 2153 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:2187: checking size of long double" >&5
+echo "configure:2184: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_sizeof_long_double=12
else
cat > conftest.$ac_ext <<EOF
-#line 2195 "configure"
+#line 2192 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:2206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_double=`cat conftestval`
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2238: checking for $ac_hdr" >&5
+echo "configure:2235: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2243 "configure"
+#line 2240 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2278: checking for $ac_hdr" >&5
+echo "configure:2275: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2283 "configure"
+#line 2280 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in tgetent
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2325: checking for $ac_func" >&5
+echo "configure:2322: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2330 "configure"
+#line 2327 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
:
else
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:2384: checking for tgetent in -lncurses" >&5
+echo "configure:2381: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2392 "configure"
+#line 2389 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test -z "$LIBTERMCAP"; then
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:2428: checking for tgetent in -ltermcap" >&5
+echo "configure:2425: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2436 "configure"
+#line 2433 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
save_LIBS=$LIBS
LIBS="$LIBTERMCAP $LIBS"
echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:2477: checking for readline in -lreadline" >&5
+echo "configure:2474: checking for readline in -lreadline" >&5
ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lreadline $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2485 "configure"
+#line 2482 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
readline()
; return 0; }
EOF
-if { (eval echo configure:2499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for cout in -lstdc++""... $ac_c" 1>&6
-echo "configure:2538: checking for cout in -lstdc++" >&5
+echo "configure:2535: checking for cout in -lstdc++" >&5
ac_lib_var=`echo stdc++'_'cout | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lstdc++ $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2546 "configure"
+#line 2543 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
cout()
; return 0; }
EOF
-if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2592: checking for $ac_hdr" >&5
+echo "configure:2589: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2597 "configure"
+#line 2594 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2633: checking for $ac_hdr" >&5
+echo "configure:2630: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2638 "configure"
+#line 2635 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2675: checking for $ac_hdr" >&5
+echo "configure:2672: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2680 "configure"
+#line 2677 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2712: checking for $ac_hdr" >&5
+echo "configure:2709: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2717 "configure"
+#line 2714 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for doublefactorial in -lcln""... $ac_c" 1>&6
-echo "configure:2757: checking for doublefactorial in -lcln" >&5
+echo "configure:2754: checking for doublefactorial in -lcln" >&5
saved_LIBS="${LIBS}"
if eval "test \"`echo '$''{'ginac_cv_lib_cln_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
case "${ac_cv_header_cln_cln_h}" in
"yes")
cat > conftest.$ac_ext <<EOF
-#line 2766 "configure"
+#line 2763 "configure"
#include "confdefs.h"
#include <cln/cl_integer.h>
int main() {
doublefactorial(2);
; return 0; }
EOF
-if { (eval echo configure:2773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ginac_cv_lib_cln_link="-lcln"
else
;;
*)
cat > conftest.$ac_ext <<EOF
-#line 2786 "configure"
+#line 2783 "configure"
#include "confdefs.h"
#include <cl_integer.h>
int main() {
doublefactorial(2);
; return 0; }
EOF
-if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ginac_cv_lib_cln_link="-lcln"
else
# Extract the first word of "doxygen", so it can be a program name with args.
set dummy doxygen; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2834: checking for $ac_word" >&5
+echo "configure:2831: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "latex", so it can be a program name with args.
set dummy latex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2870: checking for $ac_word" >&5
+echo "configure:2867: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LATEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "makeindex", so it can be a program name with args.
set dummy makeindex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2906: checking for $ac_word" >&5
+echo "configure:2903: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MAKEINDEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "dvips", so it can be a program name with args.
set dummy dvips; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2942: checking for $ac_word" >&5
+echo "configure:2939: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DVIPS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "fig2dev", so it can be a program name with args.
set dummy fig2dev; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2978: checking for $ac_word" >&5
+echo "configure:2975: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_FIG2DEV'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cint", so it can be a program name with args.
set dummy cint; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3046: checking for $ac_word" >&5
+echo "configure:3043: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CINT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "makecint", so it can be a program name with args.
set dummy makecint; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3082: checking for $ac_word" >&5
+echo "configure:3079: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MAKECINT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
s%@build_os@%$build_os%g
s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
s%@LN_S@%$LN_S%g
s%@LIBTOOL@%$LIBTOOL%g
s%@LEX@%$LEX%g
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
symbol.cpp pseries.cpp utils.cpp ncmul.cpp clifford.cpp structure.cpp \
color.cpp indexed.cpp idx.cpp isospin.cpp exprseq_suppl.cpp lst.cpp \
lst_suppl.cpp simp_lor.cpp coloridx.cpp lorentzidx.cpp lortensor.cpp \
+ input_parser.yy input_lexer.ll input_lexer.h \
remember.h remember.cpp debugmsg.h utils.h
libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
mul.h ncmul.h normal.h numeric.h operators.h power.h registrar.h \
relational.h pseries.h simp_lor.h structure.h symbol.h lortensor.h tinfos.h \
assertion.h
-EXTRA_DIST = container.pl function.pl structure.pl
+LFLAGS = -olex.yy.c
+YFLAGS = -d
+EXTRA_DIST = container.pl function.pl structure.pl input_parser.h
# Files which are generated by perl scripts
$(srcdir)/function.h $(srcdir)/function.cpp: $(srcdir)/function.pl
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
YACC = @YACC@
lib_LTLIBRARIES = libginac.la
-libginac_la_SOURCES = add.cpp archive.cpp basic.cpp constant.cpp ex.cpp expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp matrix.cpp mul.cpp normal.cpp numeric.cpp operators.cpp power.cpp registrar.cpp relational.cpp symbol.cpp pseries.cpp utils.cpp ncmul.cpp clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp lorentzidx.cpp lortensor.cpp remember.h remember.cpp debugmsg.h utils.h
+libginac_la_SOURCES = add.cpp archive.cpp basic.cpp constant.cpp ex.cpp expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp matrix.cpp mul.cpp normal.cpp numeric.cpp operators.cpp power.cpp registrar.cpp relational.cpp symbol.cpp pseries.cpp utils.cpp ncmul.cpp clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp lorentzidx.cpp lortensor.cpp input_parser.yy input_lexer.ll input_lexer.h remember.h remember.cpp debugmsg.h utils.h
libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE)
ginacincludedir = $(includedir)/ginac
ginacinclude_HEADERS = ginac.h add.h archive.h basic.h clifford.h color.h coloridx.h constant.h ex.h expair.h expairseq.h exprseq.h fail.h flags.h function.h idx.h indexed.h inifcns.h isospin.h lorentzidx.h lst.h matrix.h mul.h ncmul.h normal.h numeric.h operators.h power.h registrar.h relational.h pseries.h simp_lor.h structure.h symbol.h lortensor.h tinfos.h assertion.h
-EXTRA_DIST = container.pl function.pl structure.pl
+LFLAGS = -olex.yy.c
+YFLAGS = -d
+EXTRA_DIST = container.pl function.pl structure.pl input_parser.h
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = version.h
operators.lo power.lo registrar.lo relational.lo symbol.lo pseries.lo \
utils.lo ncmul.lo clifford.lo structure.lo color.lo indexed.lo idx.lo \
isospin.lo exprseq_suppl.lo lst.lo lst_suppl.lo simp_lor.lo coloridx.lo \
-lorentzidx.lo lortensor.lo remember.lo
+lorentzidx.lo lortensor.lo input_parser.lo input_lexer.lo remember.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LEXLIB = @LEXLIB@
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(ginacinclude_HEADERS)
-DIST_COMMON = Makefile.am Makefile.in version.h.in
+DIST_COMMON = Makefile.am Makefile.in input_lexer.cc input_parser.cc \
+version.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
.deps/expairseq.P .deps/exprseq.P .deps/exprseq_suppl.P .deps/fail.P \
.deps/function.P .deps/idx.P .deps/indexed.P .deps/inifcns.P \
.deps/inifcns_gamma.P .deps/inifcns_trans.P .deps/inifcns_zeta.P \
-.deps/isospin.P .deps/lorentzidx.P .deps/lortensor.P .deps/lst.P \
-.deps/lst_suppl.P .deps/matrix.P .deps/mul.P .deps/ncmul.P \
-.deps/normal.P .deps/numeric.P .deps/operators.P .deps/power.P \
-.deps/pseries.P .deps/registrar.P .deps/relational.P .deps/remember.P \
-.deps/simp_lor.P .deps/structure.P .deps/symbol.P .deps/utils.P
+.deps/input_lexer.P .deps/input_parser.P .deps/isospin.P \
+.deps/lorentzidx.P .deps/lortensor.P .deps/lst.P .deps/lst_suppl.P \
+.deps/matrix.P .deps/mul.P .deps/ncmul.P .deps/normal.P .deps/numeric.P \
+.deps/operators.P .deps/power.P .deps/pseries.P .deps/registrar.P \
+.deps/relational.P .deps/remember.P .deps/simp_lor.P .deps/structure.P \
+.deps/symbol.P .deps/utils.P
SOURCES = $(libginac_la_SOURCES)
OBJECTS = $(libginac_la_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .cpp .lo .o .s
+.SUFFIXES: .S .c .cc .cpp .ll .lo .o .s .yy
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu ginac/Makefile
libginac.la: $(libginac_la_OBJECTS) $(libginac_la_DEPENDENCIES)
$(CXXLINK) -rpath $(libdir) $(libginac_la_LDFLAGS) $(libginac_la_OBJECTS) $(libginac_la_LIBADD) $(LIBS)
+.cc.o:
+ $(CXXCOMPILE) -c $<
+.cc.lo:
+ $(LTCXXCOMPILE) -c $<
.cpp.o:
$(CXXCOMPILE) -c $<
.cpp.lo:
$(LTCXXCOMPILE) -c $<
+.ll.cc:
+ $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
+.yy.cc:
+ $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.cc
+ if test -f y.tab.h; then \
+ if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
+ else :; fi
+input_parser.hh: input_parser.cc
+
install-ginacincludeHEADERS: $(ginacinclude_HEADERS)
@$(NORMAL_INSTALL)
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
+%.o: %.cc
+ @echo '$(CXXCOMPILE) -c $<'; \
+ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.cc
+ @echo '$(LTCXXCOMPILE) -c $<'; \
+ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+
%.o: %.cpp
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -test -z "input_lexerllinput_parserhhinput_parsercc" || rm -f input_lexerll input_parserhh input_parsercc
mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
void store_remember_table(ex const & result) const;
public:
static unsigned register_new(function_options const & opt);
+ static unsigned find_function(const string &name, unsigned nparams);
unsigned getserial(void) const {return serial;}
// member variables
return registered_functions().size()-1;
}
+/** Find serial number of function by name and number of parameters.
+ * Throws exception if function was not found. */
+unsigned function::find_function(const string &name, unsigned nparams)
+{
+ vector<function_options>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
+ unsigned serial = 0;
+ while (i != end) {
+ if (i->get_name() == name && i->get_nparams() == nparams)
+ return serial;
+ i++;
+ serial++;
+ }
+ throw (std::runtime_error("no function '" + name + "' with " + ToString(nparams) + " parameters defined"));
+}
+
//////////
// static member variables
//////////
--- /dev/null
+/** @file input_lexer.h
+ *
+ * Lexical analyzer definition for reading expressions.
+ * This file must be processed with flex. */
+
+/*
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *
+ * 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __GINAC_INPUT_LEXER_H__
+#define __GINAC_INPUT_LEXER_H__
+
+#include <stdio.h>
+
+#include "config.h"
+
+// yacc stack type
+#define YYSTYPE ex
+
+// lex functions/variables
+extern int ginac_yyerror(char *s);
+extern int ginac_yylex(void);
+extern void ginac_yyrestart(FILE *f);
+#if YYTEXT_POINTER
+extern char *ginac_yytext;
+#else
+extern char ginac_yytext[];
+#endif
+
+#ifndef NO_NAMESPACE_GINAC
+namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
+
+class ex;
+
+/** Set the input string to be parsed by yyparse(). */
+extern void set_lexer_string(const string &s);
+
+/** Set the list of predefined symbols for the lexer (used internally for stream input). */
+extern void set_lexer_symbols(ex l);
+
+/** The expression parser function (used internally for stream input). */
+extern int yyparse();
+
+/** The expression returned by the parser (used internally for stream input). */
+extern ex parsed_ex;
+
+/** Get error message from the parser. */
+extern string get_parser_error(void);
+
+#ifndef NO_NAMESPACE_GINAC
+} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
+
+#endif // ndef __GINAC_INPUT_LEXER_H__
--- /dev/null
+/** @file input_lexer.ll
+ *
+ * Lexical analyzer definition for reading expressions.
+ * This file must be processed with flex. */
+
+/*
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *
+ * 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/*
+ * Definitions
+ */
+
+%{
+#include <iostream>
+#include <string>
+#include <map>
+#include <stdexcept>
+
+#include "input_lexer.h"
+#include "ex.h"
+#include "constant.h"
+#include "fail.h"
+#include "numeric.h"
+#include "symbol.h"
+
+#ifndef NO_NAMESPACE_GINAC
+using namespace GiNaC;
+namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
+
+#include "input_parser.h"
+
+#ifndef NO_NAMESPACE_GINAC
+} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
+
+// Table of all used symbols
+typedef map<string, ex> sym_tab;
+static sym_tab syms;
+
+// lex input function
+static int lexer_input(char *buf, int max_size);
+#define YY_INPUT(buf, result, max_size) (result = lexer_input(buf, max_size))
+%}
+
+ /* The code output by flex doesn't work well with namespaces, so we're doing it this way */
+%option prefix="ginac_yy"
+
+ /* Abbreviations */
+D [0-9]
+E [elEL][-+]?{D}+
+A [a-zA-Z_]
+AN [0-9a-zA-Z_]
+
+
+/*
+ * Lexical rules
+ */
+
+%%
+[ \t]+ /* skip whitespace */
+
+ /* special values */
+Pi yylval = Pi; return T_LITERAL;
+gamma yylval = gamma; return T_LITERAL;
+Catalan yylval = Catalan; return T_LITERAL;
+FAIL yylval = *new fail(); return T_LITERAL;
+I yylval = I; return T_NUMBER;
+Digits yylval = (long)Digits; return T_DIGITS;
+
+ /* comparison */
+"==" return T_EQUAL;
+"!=" return T_NOTEQ;
+"<=" return T_LESSEQ;
+">=" return T_GREATEREQ;
+
+ /* matrix delimiters */
+\[\[ return T_MATRIX_BEGIN;
+\]\] return T_MATRIX_END;
+
+ /* numbers */
+{D}+ |
+{D}+"."{D}*({E})? |
+{D}*"."{D}+({E})? |
+{D}+{E} yylval = numeric(yytext); return T_NUMBER;
+
+ /* symbols */
+{A}{AN}* {
+ if (syms.find(yytext) == syms.end())
+ syms[yytext] = *(new symbol(yytext));
+ yylval = syms[yytext];
+ return T_SYMBOL;
+ }
+
+ /* everything else */
+. return *yytext;
+
+%%
+
+
+/*
+ * Routines
+ */
+
+// The string from which we will read
+static string lexer_string;
+
+// The current position within the string
+static int curr_pos = 0;
+
+// Input function that reads from string
+static int lexer_input(char *buf, int max_size)
+{
+ int actual = lexer_string.length() - curr_pos;
+ if (actual > max_size)
+ actual = max_size;
+ if (actual <= 0)
+ return YY_NULL;
+ lexer_string.copy(buf, actual, curr_pos);
+ curr_pos += actual;
+ return actual;
+}
+
+// EOF encountered, terminate the scanner
+int ginac_yywrap()
+{
+ return 1;
+}
+
+#ifndef NO_NAMESPACE_GINAC
+namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
+
+// Set the input string
+void set_lexer_string(const string &s)
+{
+ lexer_string = s;
+ curr_pos = 0;
+}
+
+// Set the list of predefined symbols
+void set_lexer_symbols(ex l)
+{
+ syms.clear();
+ if (!is_ex_exactly_of_type(l, lst))
+ return;
+ for (int i=0; i<l.nops(); i++) {
+ if (is_ex_exactly_of_type(l.op(i), symbol))
+ syms[ex_to_symbol(l.op(i)).getname()] = l.op(i);
+ }
+}
+
+#ifndef NO_NAMESPACE_GINAC
+} // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
--- /dev/null
+/** @file input_parser.yy
+ *
+ * Input grammar definition for reading expressions.
+ * This file must be processed with yacc/bison. */
+
+/*
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *
+ * 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/*
+ * Definitions
+ */
+
+%{
+#include <stdexcept>
+
+#include "input_lexer.h"
+#include "ex.h"
+#include "relational.h"
+#include "symbol.h"
+#include "lst.h"
+#include "power.h"
+#include "exprseq.h"
+#include "matrix.h"
+#include "inifcns.h"
+
+#ifndef NO_NAMESPACE_GINAC
+namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
+
+#define YYERROR_VERBOSE 1
+
+#define yylex ginac_yylex
+#define yyerror ginac_yyerror
+
+// Parsed output expression
+ex parsed_ex;
+
+// Last error message returned by parser
+static string parser_error;
+%}
+
+/* Tokens (T_LITERAL means a literal value returned by the parser, but not
+ of class numeric or symbol (e.g. a constant or the FAIL object)) */
+%token T_NUMBER T_SYMBOL T_LITERAL T_DIGITS T_EQUAL T_NOTEQ T_LESSEQ T_GREATEREQ T_MATRIX_BEGIN T_MATRIX_END
+
+/* Operator precedence and associativity */
+%right '='
+%left T_EQUAL T_NOTEQ
+%left '<' '>' T_LESSEQ T_GREATEREQ
+%left '+' '-'
+%left '*' '/' '%'
+%nonassoc NEG
+%right '^'
+%nonassoc '!'
+
+%start input
+
+
+/*
+ * Grammar rules
+ */
+
+%%
+input : exp {
+ try {
+ parsed_ex = $1;
+ YYACCEPT;
+ } catch (exception &e) {
+ parser_error = e.what();
+ YYERROR;
+ }
+ }
+ | error {yyclearin; yyerrok;}
+ ;
+
+exp : T_NUMBER {$$ = $1;}
+ | T_SYMBOL {$$ = $1.eval();}
+ | T_LITERAL {$$ = $1;}
+ | T_DIGITS {$$ = $1;}
+ | T_SYMBOL '(' exprseq ')' {
+ unsigned i = function::find_function(ex_to_symbol($1).getname(), $3.nops());
+ $$ = function(i, static_cast<const exprseq &>(*($3.bp)));
+ }
+ | exp T_EQUAL exp {$$ = $1 == $3;}
+ | exp T_NOTEQ exp {$$ = $1 != $3;}
+ | exp '<' exp {$$ = $1 < $3;}
+ | exp T_LESSEQ exp {$$ = $1 <= $3;}
+ | exp '>' exp {$$ = $1 > $3;}
+ | exp T_GREATEREQ exp {$$ = $1 >= $3;}
+ | exp '+' exp {$$ = $1 + $3;}
+ | exp '-' exp {$$ = $1 - $3;}
+ | exp '*' exp {$$ = $1 * $3;}
+ | exp '/' exp {$$ = $1 / $3;}
+ | exp '%' exp {$$ = $1 % $3;}
+ | '-' exp %prec NEG {$$ = -$2;}
+ | '+' exp %prec NEG {$$ = $2;}
+ | exp '^' exp {$$ = pow($1, $3);}
+ | exp '!' {$$ = factorial($1);}
+ | '(' exp ')' {$$ = $2;}
+ | '[' list_or_empty ']' {$$ = $2;}
+ | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst_to_matrix($2);}
+ ;
+
+exprseq : exp {$$ = exprseq($1);}
+ | exprseq ',' exp {exprseq es(static_cast<exprseq &>(*($1.bp))); $$ = es.append($3);}
+ ;
+
+list_or_empty: /* empty */ {$$ = *new lst;}
+ | list {$$ = $1;}
+ ;
+
+list : exp {$$ = lst($1);}
+ | list ',' exp {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($3);}
+ ;
+
+matrix : T_MATRIX_BEGIN row T_MATRIX_END {$$ = lst($2);}
+ | matrix ',' T_MATRIX_BEGIN row T_MATRIX_END {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($4);}
+ ;
+
+row : exp {$$ = lst($1);}
+ | row ',' exp {lst l(static_cast<lst &>(*($1.bp))); $$ = l.append($3);}
+ ;
+
+
+/*
+ * Routines
+ */
+
+%%
+// Get last error encountered by parser
+string get_parser_error(void)
+{
+ return parser_error;
+}
+
+#ifndef NO_NAMESPACE_GINAC
+} // namespace GiNaC
+
+using GiNaC::parser_error;
+#endif // ndef NO_NAMESPACE_GINAC
+
+// Error print routine (store error string in parser_error)
+int ginac_yyerror(char *s)
+{
+ parser_error = string(s) + " at " + string(ginac_yytext);
+}
#include "matrix.h"
#include "archive.h"
+#include "numeric.h"
+#include "lst.h"
#include "utils.h"
#include "debugmsg.h"
-#include "numeric.h"
#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
return 0;
}
+/** Convert list of lists to matrix. */
+ex lst_to_matrix(const ex &l)
+{
+ if (!is_ex_of_type(l, lst))
+ throw(std::invalid_argument("argument to lst_to_matrix() must be a lst"));
+
+ // Find number of rows and columns
+ unsigned rows = l.nops(), cols = 0, i, j;
+ for (i=0; i<rows; i++)
+ if (l.op(i).nops() > cols)
+ cols = l.op(i).nops();
+
+ // Allocate and fill matrix
+ matrix &m = *new matrix(rows, cols);
+ for (i=0; i<rows; i++)
+ for (j=0; j<cols; j++)
+ if (l.op(i).nops() > j)
+ m.set(i, j, l.op(i).op(j));
+ else
+ m.set(i, j, ex(0));
+ return m;
+}
+
//////////
// global constants
//////////
return static_cast<const matrix &>(*e.bp);
}
+extern ex lst_to_matrix(const ex &l);
+
#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
#endif // ndef NO_NAMESPACE_GINAC
#include "numeric.h"
#include "power.h"
#include "relational.h"
+#include "input_lexer.h"
#include "debugmsg.h"
#include "utils.h"
return os;
}
+/** Input (parse) expression from stream. The input grammar is similar to the
+ * GiNaC output format. If 'e' contains a list of symbols upon entry, these
+ * symbols are used in the parsed expression in all places where symbols with
+ * the same names appear. All other encountered symbols will be newly created. */
istream & operator>>(istream & is, ex & e)
{
- throw(std::logic_error("input from streams not yet implemented"));
+ string s;
+ getline(is, s);
+ set_lexer_string(s);
+ set_lexer_symbols(e);
+ ginac_yyrestart(NULL);
+ if (yyparse())
+ throw (std::runtime_error(get_parser_error()));
+ else
+ e = parsed_ex;
}
#ifndef NO_NAMESPACE_GINAC
--- /dev/null
+/** @file version.h
+ *
+ * GiNaC library version information. */
+
+/*
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *
+ * 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __GINAC_VERSION_H__
+#define __GINAC_VERSION_H__
+
+/* Major, minor, and micro version number of the GiNaC library. */
+#define GINACLIB_MAJOR_VERSION 0
+#define GINACLIB_MINOR_VERSION 6
+#define GINACLIB_MICRO_VERSION 0
+
+#endif // ndef __GINAC_VERSION_H__
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
/** @file ginsh_lexer.ll
*
* Lexical analyzer definition for ginsh.
- * This file must be processed with flex.
- *
+ * This file must be processed with flex. */
+
+/*
* GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
/** @file ginsh_parser.yy
*
* Input grammar definition for ginsh.
- * This file must be processed with yacc/bison.
- *
+ * This file must be processed with yacc/bison. */
+
+/*
* GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
#include "ginsh.h"
+#define YYERROR_VERBOSE 1
+
// Original readline settings
static int orig_completion_append_character;
static char *orig_basic_word_break_characters;
static void print_help(const string &topic);
static void print_help_topics(void);
-
-static ex lst2matrix(const ex &l);
%}
/* Tokens (T_LITERAL means a literal value returned by the parser, but not
| exp '!' {$$ = factorial($1);}
| '(' exp ')' {$$ = $2;}
| '[' list_or_empty ']' {$$ = $2;}
- | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst2matrix($2);}
+ | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst_to_matrix($2);}
;
exprseq : exp {$$ = exprseq($1);}
}
-/*
- * Convert list of lists to matrix
- */
-
-static ex lst2matrix(const ex &l)
-{
- if (!is_ex_of_type(l, lst))
- throw(std::logic_error("internal error: argument to lst2matrix() is not a list"));
-
- // Find number of rows and columns
- unsigned rows = l.nops(), cols = 0, i, j;
- for (i=0; i<rows; i++)
- if (l.op(i).nops() > cols)
- cols = l.op(i).nops();
-
- // Allocate and fill matrix
- matrix &m = *new matrix(rows, cols);
- for (i=0; i<rows; i++)
- for (j=0; j<cols; j++)
- if (l.op(i).nops() > j)
- m.set(i, j, l.op(i).op(j));
- else
- m.set(i, j, ex(0));
- return m;
-}
-
-
/*
* Function name completion functions for readline
*/
/*
* Main program
*/
+
int main(int argc, char **argv)
{
// Print banner in interactive mode
GINACLIB_VERSION = @GINACLIB_VERSION@
GINSH_LIBS = @GINSH_LIBS@
LATEX = @LATEX@
+LD = @LD@
LEX = @LEX@
LIBGINACCINT = @LIBGINACCINT@
LIBTERMCAP = @LIBTERMCAP@
MAKECINT = @MAKECINT@
MAKEINDEX = @MAKEINDEX@
MAKEINFO = @MAKEINFO@
+NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@