mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
Setting for FrameworkBenchmarks participations
This commit is contained in:
parent
4b40d0f4af
commit
13e5dd2f97
3
configure
vendored
3
configure
vendored
|
@ -29361,7 +29361,7 @@ See include/ulib/internal/config.h for further configuration information
|
|||
|
||||
# SECTION 16: `AC_OUTPUT([FILE...])' read Makefile.in and write Makefile
|
||||
|
||||
ac_config_files="$ac_config_files Makefile rpm.sh ULib.spec m4/Makefile doc/Makefile include/Makefile contrib/Makefile src/ulib/Makefile src/ulib/ULib.rc src/ulib/ULib.pc src/ulib/lemon/Makefile src/ulib/orm/driver/Makefile src/ulib/net/server/plugin/Makefile src/ulib/net/server/plugin/v8/Makefile src/ulib/net/server/plugin/php/Makefile src/ulib/net/server/plugin/ruby/Makefile src/ulib/net/server/plugin/usp/Makefile src/ulib/net/server/plugin/mod_shib/Makefile src/ulib/net/server/plugin/mod_geoip/Makefile src/ulib/net/server/plugin/usp/usp_compile.sh src/ulib/net/server/plugin/page_speed/Makefile include/ulib/Makefile contrib/HCSP/Makefile contrib/RSIGN/Makefile contrib/signer/Makefile examples/Makefile examples/IR/Makefile examples/csp/Makefile examples/lcsp/Makefile examples/rsign/Makefile examples/WiAuth/Makefile examples/xml2txt/Makefile examples/uclient/Makefile examples/userver/Makefile examples/PEC_log/Makefile examples/workflow/Makefile examples/doc_parse/Makefile examples/lrp_session/Makefile examples/http_header/Makefile examples/test_manager/Makefile examples/doc_classifier/Makefile examples/form_completion/Makefile examples/simple_client_server/Makefile examples/download_accelerator/Makefile examples/XAdES/Makefile examples/XAdES/XAdES.spec examples/xml2txt/xml2txt.spec examples/IR/searchengine-bin.spec examples/lcsp/lcsp.spec examples/lcsp/lcsp_rpc.spec examples/csp/cspclient.spec examples/csp/cspclient_rpc.spec examples/rsign/rsignclient.spec examples/rsign/rsignclient_rpc.spec examples/userver/web_server.spec examples/userver/wagsmserver.spec examples/workflow/workflow.spec examples/PEC_log/PEC_log.spec examples/userver/tsaserver.spec examples/userver/cspserver.spec examples/userver/rsignserver.spec examples/doc_parse/doc_parse.spec tests/Makefile tests/base/Makefile tests/debug/Makefile tests/ulib/Makefile tests/examples/Makefile tests/contrib/Makefile"
|
||||
ac_config_files="$ac_config_files Makefile rpm.sh ULib.spec m4/Makefile doc/Makefile include/Makefile contrib/Makefile src/ulib/Makefile src/ulib/ULib.rc src/ulib/ULib.pc src/ulib/orm/driver/Makefile src/ulib/net/server/plugin/Makefile src/ulib/net/server/plugin/v8/Makefile src/ulib/net/server/plugin/php/Makefile src/ulib/net/server/plugin/ruby/Makefile src/ulib/net/server/plugin/usp/Makefile src/ulib/net/server/plugin/mod_shib/Makefile src/ulib/net/server/plugin/mod_geoip/Makefile src/ulib/net/server/plugin/usp/usp_compile.sh src/ulib/net/server/plugin/page_speed/Makefile include/ulib/Makefile contrib/HCSP/Makefile contrib/RSIGN/Makefile contrib/signer/Makefile examples/Makefile examples/IR/Makefile examples/csp/Makefile examples/lcsp/Makefile examples/rsign/Makefile examples/WiAuth/Makefile examples/xml2txt/Makefile examples/uclient/Makefile examples/userver/Makefile examples/PEC_log/Makefile examples/workflow/Makefile examples/doc_parse/Makefile examples/lrp_session/Makefile examples/http_header/Makefile examples/test_manager/Makefile examples/doc_classifier/Makefile examples/form_completion/Makefile examples/simple_client_server/Makefile examples/download_accelerator/Makefile examples/XAdES/Makefile examples/XAdES/XAdES.spec examples/xml2txt/xml2txt.spec examples/IR/searchengine-bin.spec examples/lcsp/lcsp.spec examples/lcsp/lcsp_rpc.spec examples/csp/cspclient.spec examples/csp/cspclient_rpc.spec examples/rsign/rsignclient.spec examples/rsign/rsignclient_rpc.spec examples/userver/web_server.spec examples/userver/wagsmserver.spec examples/workflow/workflow.spec examples/PEC_log/PEC_log.spec examples/userver/tsaserver.spec examples/userver/cspserver.spec examples/userver/rsignserver.spec examples/doc_parse/doc_parse.spec tests/Makefile tests/base/Makefile tests/debug/Makefile tests/ulib/Makefile tests/examples/Makefile tests/contrib/Makefile"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
|
@ -31047,7 +31047,6 @@ do
|
|||
"src/ulib/Makefile") CONFIG_FILES="$CONFIG_FILES src/ulib/Makefile" ;;
|
||||
"src/ulib/ULib.rc") CONFIG_FILES="$CONFIG_FILES src/ulib/ULib.rc" ;;
|
||||
"src/ulib/ULib.pc") CONFIG_FILES="$CONFIG_FILES src/ulib/ULib.pc" ;;
|
||||
"src/ulib/lemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/ulib/lemon/Makefile" ;;
|
||||
"src/ulib/orm/driver/Makefile") CONFIG_FILES="$CONFIG_FILES src/ulib/orm/driver/Makefile" ;;
|
||||
"src/ulib/net/server/plugin/Makefile") CONFIG_FILES="$CONFIG_FILES src/ulib/net/server/plugin/Makefile" ;;
|
||||
"src/ulib/net/server/plugin/v8/Makefile") CONFIG_FILES="$CONFIG_FILES src/ulib/net/server/plugin/v8/Makefile" ;;
|
||||
|
|
|
@ -2237,7 +2237,6 @@ AC_OUTPUT(Makefile \
|
|||
src/ulib/Makefile \
|
||||
src/ulib/ULib.rc \
|
||||
src/ulib/ULib.pc \
|
||||
src/ulib/lemon/Makefile \
|
||||
src/ulib/orm/driver/Makefile \
|
||||
src/ulib/net/server/plugin/Makefile \
|
||||
src/ulib/net/server/plugin/v8/Makefile \
|
||||
|
|
|
@ -255,6 +255,39 @@ public:
|
|||
static bool loadDriver() { return loadDriver(UString::getStringNull(), UString::getStringNull()); }
|
||||
static bool loadDriver(const UString& driver_list) { return loadDriver(UString::getStringNull(), driver_list); }
|
||||
|
||||
static bool isSQLite()
|
||||
{
|
||||
U_TRACE(0, "UOrmDriver::isSQLite()")
|
||||
|
||||
U_INTERNAL_ASSERT_MAJOR(env_driver_len, 0)
|
||||
|
||||
if (U_STREQ(env_driver, env_driver_len, "sqlite")) U_RETURN(true);
|
||||
|
||||
U_RETURN(false);
|
||||
}
|
||||
|
||||
static bool isMYSQL()
|
||||
{
|
||||
U_TRACE(0, "UOrmDriver::isMYSQL()")
|
||||
|
||||
U_INTERNAL_ASSERT_MAJOR(env_driver_len, 0)
|
||||
|
||||
if (U_STREQ(env_driver, env_driver_len, "mysql")) U_RETURN(true);
|
||||
|
||||
U_RETURN(false);
|
||||
}
|
||||
|
||||
static bool isPGSQL()
|
||||
{
|
||||
U_TRACE(0, "UOrmDriver::isPGSQL()")
|
||||
|
||||
U_INTERNAL_ASSERT_MAJOR(env_driver_len, 0)
|
||||
|
||||
if (U_STREQ(env_driver, env_driver_len, "pgsql")) U_RETURN(true);
|
||||
|
||||
U_RETURN(false);
|
||||
}
|
||||
|
||||
void reset(USqlStatement* pstmt) // Resets a prepared statement on client and server to state after creation
|
||||
{
|
||||
U_TRACE(0, "UOrmDriver::reset(%p)", pstmt)
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in Makefile
|
||||
|
||||
EXTRA_DIST = base/* container/* db/* debug/* dynamic/* flex/* internal/* ldap/* mime/* net/* pcre/* \
|
||||
replace/* ssl/* ssh/* ui/* utility/* xml/expat/* xml/libxml2/* zip/* \
|
||||
lemon/Makefile.* lemon/*.c lemon/*.cpp lemon/*.y \
|
||||
replace/* ssl/* ssh/* ui/* utility/* xml/expat/* xml/libxml2/* zip/* lemon/*.cpp \
|
||||
orm/driver/*.cpp orm/driver/Makefile.* \
|
||||
net/server/plugin/*.cpp net/server/plugin/Makefile.* \
|
||||
*.cpp all_c.c ULib.pc.in ULib.rc.in utility/*_store.bin
|
||||
|
|
|
@ -591,8 +591,7 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
MAINTAINERCLEANFILES = Makefile.in Makefile
|
||||
EXTRA_DIST = base/* container/* db/* debug/* dynamic/* flex/* internal/* ldap/* mime/* net/* pcre/* \
|
||||
replace/* ssl/* ssh/* ui/* utility/* xml/expat/* xml/libxml2/* zip/* \
|
||||
lemon/Makefile.* lemon/*.c lemon/*.cpp lemon/*.y \
|
||||
replace/* ssl/* ssh/* ui/* utility/* xml/expat/* xml/libxml2/* zip/* lemon/*.cpp \
|
||||
orm/driver/*.cpp orm/driver/Makefile.* \
|
||||
net/server/plugin/*.cpp net/server/plugin/Makefile.* \
|
||||
*.cpp all_c.c ULib.pc.in ULib.rc.in utility/*_store.bin
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
## Makefile.am for LEMON parser generator
|
||||
|
||||
AUTOMAKE_OPTIONS = ## dist-shar dist-zip
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
DEFAULT_INCLUDES = -I.
|
||||
|
||||
EXTRA_DIST = expression.* skeleton.c
|
||||
|
||||
lemon_SOURCES = lemon.c
|
||||
|
||||
noinst_PROGRAMS = lemon
|
||||
|
||||
## expression.cpp: expression.y
|
||||
## ./lemon expression.y
|
||||
## mv expression.c expression.cpp
|
||||
|
||||
clean-local:
|
||||
-rm -rf core .libs *.bb* *.da *.gcov *.la *.exe gmon.out
|
|
@ -1,611 +0,0 @@
|
|||
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
noinst_PROGRAMS = lemon$(EXEEXT)
|
||||
subdir = src/ulib/lemon
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/depcomp
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_package.m4 \
|
||||
$(top_srcdir)/m4/ac_compilation_environment.m4 \
|
||||
$(top_srcdir)/m4/ac_compilation_options.m4 \
|
||||
$(top_srcdir)/m4/ac_cxx_old_iostream.m4 \
|
||||
$(top_srcdir)/m4/ac_fallocate.m4 \
|
||||
$(top_srcdir)/m4/ac_try_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/socket_SO_RCVTIMEO.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ulib/internal/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_lemon_OBJECTS = lemon.$(OBJEXT)
|
||||
lemon_OBJECTS = $(am_lemon_OBJECTS)
|
||||
lemon_LDADD = $(LDADD)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(lemon_SOURCES)
|
||||
DIST_SOURCES = $(lemon_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX11 = @HAVE_CXX11@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MODULE_LIBTOOL_OPTIONS = @MODULE_LIBTOOL_OPTIONS@
|
||||
MYSQL_CONFIG = @MYSQL_CONFIG@
|
||||
MYSQL_INCLUDE = @MYSQL_INCLUDE@
|
||||
MYSQL_LDFLAGS = @MYSQL_LDFLAGS@
|
||||
MYSQL_LIBS = @MYSQL_LIBS@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PAGESPEED_ROOT_DIR = @PAGESPEED_ROOT_DIR@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PGSQL_INCLUDE = @PGSQL_INCLUDE@
|
||||
PGSQL_LDFLAGS = @PGSQL_LDFLAGS@
|
||||
PGSQL_LIBS = @PGSQL_LIBS@
|
||||
PG_CONFIG = @PG_CONFIG@
|
||||
PHPCONFIG = @PHPCONFIG@
|
||||
PHPCONFIGINCLUDES = @PHPCONFIGINCLUDES@
|
||||
PHPCONFIGLDFLAGS = @PHPCONFIGLDFLAGS@
|
||||
PHPCONFIGLIBS = @PHPCONFIGLIBS@
|
||||
POW_LIB = @POW_LIB@
|
||||
PRG_LDFLAGS = @PRG_LDFLAGS@
|
||||
RANLIB = @RANLIB@
|
||||
RPM_CONFIGURE = @RPM_CONFIGURE@
|
||||
RUBYCONFIGINCLUDES = @RUBYCONFIGINCLUDES@
|
||||
RUBYCONFIGLDFLAGS = @RUBYCONFIGLDFLAGS@
|
||||
RUBYCONFIGLIBS = @RUBYCONFIGLIBS@
|
||||
RUBYCPPFLAGS = @RUBYCPPFLAGS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SQLITE3_INCLUDE = @SQLITE3_INCLUDE@
|
||||
SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@
|
||||
SQLITE3_LIBS = @SQLITE3_LIBS@
|
||||
STATIC_SERVLET_MAKE = @STATIC_SERVLET_MAKE@
|
||||
STRIP = @STRIP@
|
||||
ULIB = @ULIB@
|
||||
ULIB_LIBS = @ULIB_LIBS@
|
||||
ULIB_VERSION = @ULIB_VERSION@
|
||||
USP_FLAGS = @USP_FLAGS@
|
||||
USP_LDFLAGS = @USP_LDFLAGS@
|
||||
USP_LIBS = @USP_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
XLEX = @XLEX@
|
||||
XYACC = @XYACC@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
cpp = @cpp@
|
||||
cv_path_ruby = @cv_path_ruby@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mcpp = @mcpp@
|
||||
mkdir_p = @mkdir_p@
|
||||
ms_librarian = @ms_librarian@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = ## dist-shar dist-zip
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
DEFAULT_INCLUDES = -I.
|
||||
EXTRA_DIST = expression.* skeleton.c
|
||||
lemon_SOURCES = lemon.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ulib/lemon/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign src/ulib/lemon/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
lemon$(EXEEXT): $(lemon_OBJECTS) $(lemon_DEPENDENCIES) $(EXTRA_lemon_DEPENDENCIES)
|
||||
@rm -f lemon$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(lemon_OBJECTS) $(lemon_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lemon.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-local clean-noinstPROGRAMS cscopelist \
|
||||
ctags distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am
|
||||
|
||||
|
||||
clean-local:
|
||||
-rm -rf core .libs *.bb* *.da *.gcov *.la *.exe gmon.out
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,501 +0,0 @@
|
|||
%include {
|
||||
#include <ulib/tokenizer.h>
|
||||
#include <ulib/dynamic/dynamic.h>
|
||||
#include <ulib/utility/string_ext.h>
|
||||
|
||||
typedef long (*lPFv)(void);
|
||||
typedef long (*lPFll)(long, long);
|
||||
|
||||
typedef UVector<UString> Items;
|
||||
|
||||
extern void* expressionParserAlloc(void* (*mallocProc)(size_t));
|
||||
extern void expressionParserFree(void* p, void (*freeProc)(void*));
|
||||
extern void expressionParserTrace(FILE* stream, char* zPrefix);
|
||||
extern void expressionParser(void* yyp, int yymajor, UString* yyminor, UString* result);
|
||||
|
||||
extern void token_destructor(UString* token);
|
||||
|
||||
void token_destructor(UString* token) {
|
||||
U_TRACE(0, "::token_destructor(%.*S)", U_STRING_TO_TRACE(*token))
|
||||
|
||||
delete token;
|
||||
}
|
||||
|
||||
} /* %include */
|
||||
|
||||
%name expressionParser
|
||||
%extra_argument { UString* result }
|
||||
|
||||
%token_prefix U_TK_
|
||||
%token_type { UString* }
|
||||
%token_destructor { token_destructor($$); }
|
||||
|
||||
%destructor params {
|
||||
U_TRACE(0, "::params_destructor(%p)", $$)
|
||||
delete $$;
|
||||
}
|
||||
|
||||
%parse_accept {
|
||||
U_TRACE(0, "::parse_accept()")
|
||||
U_INTERNAL_ASSERT_POINTER(result)
|
||||
U_INTERNAL_DUMP("result = %.*S", U_STRING_TO_TRACE(*result))
|
||||
}
|
||||
%parse_failure {
|
||||
U_TRACE(0, "::parse_failure()")
|
||||
U_INTERNAL_ASSERT_POINTER(result)
|
||||
result->clear();
|
||||
U_WARNING("Parse failure!");
|
||||
}
|
||||
%syntax_error {
|
||||
U_TRACE(0, "::syntax_error()")
|
||||
U_INTERNAL_ASSERT_POINTER(result)
|
||||
result->clear();
|
||||
U_WARNING("Syntax error!");
|
||||
}
|
||||
%stack_overflow {
|
||||
U_TRACE(0, "::stack_overflow()")
|
||||
U_WARNING("Parse stack overflow");
|
||||
}
|
||||
|
||||
%left AND.
|
||||
%left OR.
|
||||
%nonassoc EQ NE GT GE LT LE STARTS_WITH ENDS_WITH IS_PRESENT CONTAINS.
|
||||
%left PLUS MINUS.
|
||||
%left MULT DIV MOD.
|
||||
%right NOT.
|
||||
%nonassoc FN_CALL .
|
||||
|
||||
%default_type { UString* }
|
||||
|
||||
%type params { Items* }
|
||||
|
||||
%type booleanCond { int }
|
||||
%type equalityCond { int }
|
||||
%type relationalCond { int }
|
||||
%type additiveCond { int }
|
||||
%type multiplicativeCond { int }
|
||||
|
||||
input ::= booleanExpression(B). {
|
||||
U_TRACE(0, "input ::= booleanExpression(B)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(result)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S result = %.*S", U_STRING_TO_TRACE(*B), U_STRING_TO_TRACE(*result))
|
||||
|
||||
*result = *B;
|
||||
|
||||
delete B;
|
||||
}
|
||||
|
||||
booleanExpression(A) ::= booleanExpression(B) booleanCond(C) equalityExpression(D). {
|
||||
U_TRACE(0, "booleanExpression(A) ::= booleanExpression(B) booleanCond(C) equalityExpression(D)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(D)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %d D = %.*S", U_STRING_TO_TRACE(*B), C, U_STRING_TO_TRACE(*D))
|
||||
|
||||
bool Bbo = (B->empty() == false),
|
||||
Dbo = (D->empty() == false),
|
||||
bo = (C == U_TK_AND ? Bbo && Dbo
|
||||
: Bbo || Dbo);
|
||||
|
||||
A = (bo ? U_NEW(UString(U_CONSTANT_TO_PARAM("true"))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
delete D;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
booleanExpression(A) ::= equalityExpression(B). {
|
||||
U_TRACE(0, "booleanExpression(A) ::= equalityExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
equalityExpression(A) ::= equalityExpression(B) equalityCond(C) relationalExpression(D). {
|
||||
U_TRACE(0, "equalityExpression(A) ::= equalityExpression(B) equalityCond(C) relationalExpression(D)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(D)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %d D = %.*S", U_STRING_TO_TRACE(*B), C, U_STRING_TO_TRACE(*D))
|
||||
|
||||
bool bo = false,
|
||||
Bbo = (B->empty() == false),
|
||||
Dbo = (D->empty() == false);
|
||||
|
||||
int cmp = (Bbo && Dbo ? B->compare(D->rep) : Bbo - Dbo);
|
||||
|
||||
switch (C)
|
||||
{
|
||||
case U_TK_EQ: bo = (cmp == 0); break;
|
||||
case U_TK_NE: bo = (cmp != 0); break;
|
||||
|
||||
case U_TK_ENDS_WITH: if (Bbo && Dbo) bo = UStringExt::endsWith( *B, *D); break;
|
||||
case U_TK_STARTS_WITH: if (Bbo && Dbo) bo = UStringExt::startsWith(*B, *D); break;
|
||||
case U_TK_CONTAINS: if (Bbo && Dbo) bo = (B->find(*D) != U_NOT_FOUND); break;
|
||||
case U_TK_IS_PRESENT: if (Bbo && Dbo) bo = Items(*B).isContained(*D); break;
|
||||
}
|
||||
|
||||
U_INTERNAL_DUMP("bo = %b cmp = %d", bo, cmp)
|
||||
|
||||
A = (bo ? U_NEW(UString(U_CONSTANT_TO_PARAM("true"))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
delete D;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
equalityExpression(A) ::= relationalExpression(B). {
|
||||
U_TRACE(0, "equalityExpression(A) ::= relationalExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
relationalExpression(A) ::= relationalExpression(B) relationalCond(C) additiveExpression(D). {
|
||||
U_TRACE(0, "relationalExpression(A) ::= relationalExpression(B) relationalCond(C) additiveExpression(D)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(D)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %d D = %.*S", U_STRING_TO_TRACE(*B), C, U_STRING_TO_TRACE(*D))
|
||||
|
||||
bool bo = false,
|
||||
Bbo = (B->empty() == false),
|
||||
Dbo = (D->empty() == false);
|
||||
|
||||
int cmp = (Bbo && Dbo ? B->compare(D->rep) : Bbo - Dbo);
|
||||
|
||||
switch (C)
|
||||
{
|
||||
case U_TK_LT: bo = (cmp < 0); break;
|
||||
case U_TK_LE: bo = (cmp <= 0); break;
|
||||
case U_TK_GT: bo = (cmp > 0); break;
|
||||
case U_TK_GE: bo = (cmp >= 0); break;
|
||||
}
|
||||
|
||||
U_INTERNAL_DUMP("bo = %b cmp = %d", bo, cmp)
|
||||
|
||||
A = (bo ? U_NEW(UString(U_CONSTANT_TO_PARAM("true"))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
delete D;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
relationalExpression(A) ::= additiveExpression(B). {
|
||||
U_TRACE(0, "relationalExpression(A) ::= additiveExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
additiveExpression(A) ::= additiveExpression(B) additiveCond(C) multiplicativeExpression(D). {
|
||||
U_TRACE(0, "additiveExpression(A) ::= additiveExpression(B) additiveCond(C) multiplicativeExpression(D)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(D)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %d D = %.*S", U_STRING_TO_TRACE(*B), C, U_STRING_TO_TRACE(*D))
|
||||
|
||||
long Blo = B->strtol(),
|
||||
Dlo = D->strtol(),
|
||||
lo = (C == U_TK_PLUS ? Blo + Dlo
|
||||
: Blo - Dlo);
|
||||
|
||||
A = U_NEW(UString(UStringExt::stringFromNumber(lo)));
|
||||
|
||||
delete B;
|
||||
delete D;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
additiveExpression(A) ::= multiplicativeExpression(B). {
|
||||
U_TRACE(0, "additiveExpression(A) ::= multiplicativeExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
multiplicativeExpression(A) ::= multiplicativeExpression(B) multiplicativeCond(C) unaryExpression(D). {
|
||||
U_TRACE(0, "multiplicativeExpression(A) ::= multiplicativeExpression(B) multiplicativeCond(C) unaryExpression(D)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(D)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %d D = %.*S", U_STRING_TO_TRACE(*B), C, U_STRING_TO_TRACE(*D))
|
||||
|
||||
long lo,
|
||||
Blo = B->strtol(),
|
||||
Dlo = D->strtol();
|
||||
|
||||
if (Dlo == 0) A = U_NEW(UString(U_STRING_FROM_CONSTANT("0")));
|
||||
else
|
||||
{
|
||||
lo = (C == U_TK_MULT ? Blo * Dlo :
|
||||
C == U_TK_DIV ? Blo / Dlo :
|
||||
Blo % Dlo);
|
||||
|
||||
A = U_NEW(UString(UStringExt::stringFromNumber(lo)));
|
||||
}
|
||||
|
||||
delete B;
|
||||
delete D;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
multiplicativeExpression(A) ::= unaryExpression(B). {
|
||||
U_TRACE(0, "multiplicativeExpression(A) ::= unaryExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
unaryExpression(A) ::= NOT primaryExpression(B). {
|
||||
U_TRACE(0, "unaryExpression(A) ::= NOT primaryExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = (B->empty() ? U_NEW(UString(U_CONSTANT_TO_PARAM("true"))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
unaryExpression(A) ::= primaryExpression(B). {
|
||||
U_TRACE(0, "unaryExpression(A) ::= primaryExpression(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
primaryExpression(A) ::= LPAREN booleanExpression(B) RPAREN. {
|
||||
U_TRACE(0, "primaryExpression(A) ::= LPAREN booleanExpression(B) RPAREN")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
primaryExpression(A) ::= value(B). {
|
||||
U_TRACE(0, "primaryExpression(A) ::= value(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
value(A) ::= VALUE(B). {
|
||||
U_TRACE(0, "value(A) ::= VALUE(B)")
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %p", A, B)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
A = B;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
value(A) ::= value(B) VALUE(C). {
|
||||
U_TRACE(0, "value(A) ::= value(B) VALUE(C)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(C)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %.*S", U_STRING_TO_TRACE(*B), U_STRING_TO_TRACE(*C))
|
||||
|
||||
A = B;
|
||||
*A += *C;
|
||||
|
||||
delete C;
|
||||
|
||||
U_INTERNAL_DUMP("A = %.*S", U_STRING_TO_TRACE(*A))
|
||||
}
|
||||
|
||||
booleanCond(A) ::= OR. {
|
||||
U_TRACE(0, "booleanCond(A) ::= OR")
|
||||
A = U_TK_OR;
|
||||
}
|
||||
booleanCond(A) ::= AND. {
|
||||
U_TRACE(0, "booleanCond(A) ::= AND")
|
||||
A = U_TK_AND;
|
||||
}
|
||||
equalityCond(A) ::= EQ. {
|
||||
U_TRACE(0, "equalityCond(A) ::= EQ")
|
||||
A = U_TK_EQ;
|
||||
}
|
||||
equalityCond(A) ::= NE. {
|
||||
U_TRACE(0, "equalityCond(A) ::= NE")
|
||||
A = U_TK_NE;
|
||||
}
|
||||
equalityCond(A) ::= STARTS_WITH. {
|
||||
U_TRACE(0, "equalityCond(A) ::= STARTS_WITH")
|
||||
A = U_TK_STARTS_WITH;
|
||||
}
|
||||
equalityCond(A) ::= ENDS_WITH. {
|
||||
U_TRACE(0, "equalityCond(A) ::= ENDS_WITH")
|
||||
A = U_TK_ENDS_WITH;
|
||||
}
|
||||
equalityCond(A) ::= IS_PRESENT. {
|
||||
U_TRACE(0, "equalityCond(A) ::= IS_PRESENT")
|
||||
A = U_TK_IS_PRESENT;
|
||||
}
|
||||
equalityCond(A) ::= CONTAINS. {
|
||||
U_TRACE(0, "equalityCond(A) ::= CONTAINS")
|
||||
A = U_TK_CONTAINS;
|
||||
}
|
||||
relationalCond(A) ::= GT. {
|
||||
U_TRACE(0, "relationalCond(A) ::= GT")
|
||||
A = U_TK_GT;
|
||||
}
|
||||
relationalCond(A) ::= GE. {
|
||||
U_TRACE(0, "relationalCond(A) ::= GE")
|
||||
A = U_TK_GE;
|
||||
}
|
||||
relationalCond(A) ::= LT. {
|
||||
U_TRACE(0, "relationalCond(A) ::= LT")
|
||||
A = U_TK_LT;
|
||||
}
|
||||
relationalCond(A) ::= LE. {
|
||||
U_TRACE(0, "relationalCond(A) ::= LE")
|
||||
A = U_TK_LE;
|
||||
}
|
||||
additiveCond(A) ::= PLUS. {
|
||||
U_TRACE(0, "additiveCond(A) ::= PLUS")
|
||||
A = U_TK_PLUS;
|
||||
}
|
||||
additiveCond(A) ::= MINUS. {
|
||||
U_TRACE(0, "additiveCond(A) ::= MINUS")
|
||||
A = U_TK_MINUS;
|
||||
}
|
||||
multiplicativeCond(A) ::= MULT. {
|
||||
U_TRACE(0, "multiplicativeCond(A) ::= MULT")
|
||||
A = U_TK_MULT;
|
||||
}
|
||||
multiplicativeCond(A) ::= DIV. {
|
||||
U_TRACE(0, "multiplicativeCond(A) ::= DIV")
|
||||
A = U_TK_DIV;
|
||||
}
|
||||
multiplicativeCond(A) ::= MOD. {
|
||||
U_TRACE(0, "multiplicativeCond(A) ::= MOD")
|
||||
A = U_TK_MOD;
|
||||
}
|
||||
|
||||
primaryExpression(A) ::= FN_CALL(B) LPAREN RPAREN. {
|
||||
U_TRACE(0, "primaryExpression(A) ::= FN_CALL(B) LPAREN RPAREN")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %.*S", A, U_STRING_TO_TRACE(*B))
|
||||
|
||||
long lo;
|
||||
#ifdef __MINGW32__
|
||||
lPFv addr = (lPFv) ::GetProcAddress((HMODULE)0, B->c_str());
|
||||
#else
|
||||
lPFv addr = (lPFv) U_SYSCALL(dlsym, "%p,%S", RTLD_DEFAULT, B->c_str());
|
||||
#endif
|
||||
|
||||
A = (addr ? (lo = (*addr)(), U_NEW(UString(UStringExt::stringFromNumber(lo)))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
}
|
||||
|
||||
primaryExpression(A) ::= FN_CALL(B) LPAREN params(C) RPAREN. {
|
||||
U_TRACE(0, "primaryExpression(A) ::= FN_CALL(B) LPAREN params(C) RPAREN")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(C)
|
||||
|
||||
U_INTERNAL_DUMP("B = %.*S C = %p", U_STRING_TO_TRACE(*B), C)
|
||||
|
||||
long lo, lo0, lo1;
|
||||
#ifdef __MINGW32__
|
||||
lPFll addr = (lPFll) ::GetProcAddress((HMODULE)0, B->c_str());
|
||||
#else
|
||||
lPFll addr = (lPFll) U_SYSCALL(dlsym, "%p,%S", RTLD_DEFAULT, B->c_str());
|
||||
#endif
|
||||
|
||||
A = (addr ? (lo0 = (*C)[0].strtol(), lo1 = (*C)[1].strtol(), lo = (*addr)(lo0, lo1), U_NEW(UString(UStringExt::stringFromNumber(lo)))) : U_NEW(UString));
|
||||
|
||||
delete B;
|
||||
}
|
||||
|
||||
params(A) ::= VALUE(B). {
|
||||
U_TRACE(0, "params(A) ::= VALUE(B)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
|
||||
U_INTERNAL_DUMP("A = %p B = %.*S", A, U_STRING_TO_TRACE(*B))
|
||||
|
||||
A = U_NEW(Items);
|
||||
|
||||
A->push_back(*B);
|
||||
|
||||
delete B;
|
||||
}
|
||||
|
||||
params(A) ::= params(B) COMMA VALUE(C). {
|
||||
U_TRACE(0, "params(A) ::= params(B) COMMA VALUE(C)")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(B)
|
||||
U_INTERNAL_ASSERT_POINTER(C)
|
||||
|
||||
U_INTERNAL_DUMP("B = %p C = %.*S", B, U_STRING_TO_TRACE(*C))
|
||||
|
||||
B->push_back(*C);
|
||||
|
||||
A = B;
|
||||
|
||||
delete C;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,771 +0,0 @@
|
|||
/* Driver template for the LEMON parser generator.
|
||||
** The author disclaims copyright to this source code.
|
||||
*/
|
||||
/* First off, code is include which follows the "include" declaration
|
||||
** in the input file. */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
%%
|
||||
/* Next is all token values, in a form suitable for use by makeheaders.
|
||||
** This section will be null unless lemon is run with the -m switch.
|
||||
*/
|
||||
/*
|
||||
** These constants (all generated automatically by the parser generator)
|
||||
** specify the various kinds of tokens (terminals) that the parser
|
||||
** understands.
|
||||
**
|
||||
** Each symbol here is a terminal symbol in the grammar.
|
||||
*/
|
||||
%%
|
||||
/* Make sure the INTERFACE macro is defined.
|
||||
*/
|
||||
#ifndef INTERFACE
|
||||
# define INTERFACE 1
|
||||
#endif
|
||||
/* The next thing included is series of defines which control
|
||||
** various aspects of the generated parser.
|
||||
** YYCODETYPE is the data type used for storing terminal
|
||||
** and nonterminal numbers. "unsigned char" is
|
||||
** used if there are fewer than 250 terminals
|
||||
** and nonterminals. "int" is used otherwise.
|
||||
** YYNOCODE is a number of type YYCODETYPE which corresponds
|
||||
** to no legal terminal or nonterminal number. This
|
||||
** number is used to fill in empty slots of the hash
|
||||
** table.
|
||||
** YYFALLBACK If defined, this indicates that one or more tokens
|
||||
** have fall-back values which should be used if the
|
||||
** original value of the token will not parse.
|
||||
** YYACTIONTYPE is the data type used for storing terminal
|
||||
** and nonterminal numbers. "unsigned char" is
|
||||
** used if there are fewer than 250 rules and
|
||||
** states combined. "int" is used otherwise.
|
||||
** ParseTOKENTYPE is the data type used for minor tokens given
|
||||
** directly to the parser from the tokenizer.
|
||||
** YYMINORTYPE is the data type used for all minor tokens.
|
||||
** This is typically a union of many types, one of
|
||||
** which is ParseTOKENTYPE. The entry in the union
|
||||
** for base tokens is called "yy0".
|
||||
** YYSTACKDEPTH is the maximum depth of the parser's stack. If
|
||||
** zero the stack is dynamically sized using realloc()
|
||||
** ParseARG_SDECL A static variable declaration for the %extra_argument
|
||||
** ParseARG_PDECL A parameter declaration for the %extra_argument
|
||||
** ParseARG_STORE Code to store %extra_argument into yypParser
|
||||
** ParseARG_FETCH Code to extract %extra_argument from yypParser
|
||||
** YYNSTATE the combined number of states.
|
||||
** YYNRULE the number of rules in the grammar
|
||||
** YYERRORSYMBOL is the code number of the error symbol. If not
|
||||
** defined, then do no error processing.
|
||||
*/
|
||||
%%
|
||||
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
|
||||
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
|
||||
#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
|
||||
|
||||
/* Next are that tables used to determine what action to take based on the
|
||||
** current state and lookahead token. These tables are used to implement
|
||||
** functions that take a state number and lookahead value and return an
|
||||
** action integer.
|
||||
**
|
||||
** Suppose the action integer is N. Then the action is determined as
|
||||
** follows
|
||||
**
|
||||
** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
|
||||
** token onto the stack and goto state N.
|
||||
**
|
||||
** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
|
||||
**
|
||||
** N == YYNSTATE+YYNRULE A syntax error has occurred.
|
||||
**
|
||||
** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
|
||||
**
|
||||
** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
|
||||
** slots in the yy_action[] table.
|
||||
**
|
||||
** The action table is constructed as a single large table named yy_action[].
|
||||
** Given state S and lookahead X, the action is computed as
|
||||
**
|
||||
** yy_action[ yy_shift_ofst[S] + X ]
|
||||
**
|
||||
** If the index value yy_shift_ofst[S]+X is out of range or if the value
|
||||
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
|
||||
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
|
||||
** and that yy_default[S] should be used instead.
|
||||
**
|
||||
** The formula above is for computing the action when the lookahead is
|
||||
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
|
||||
** a reduce action) then the yy_reduce_ofst[] array is used in place of
|
||||
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
|
||||
** YY_SHIFT_USE_DFLT.
|
||||
**
|
||||
** The following are the tables generated in this section:
|
||||
**
|
||||
** yy_action[] A single table containing all actions.
|
||||
** yy_lookahead[] A table containing the lookahead for each entry in
|
||||
** yy_action. Used to detect hash collisions.
|
||||
** yy_shift_ofst[] For each state, the offset into yy_action for
|
||||
** shifting terminals.
|
||||
** yy_reduce_ofst[] For each state, the offset into yy_action for
|
||||
** shifting non-terminals after a reduce.
|
||||
** yy_default[] Default action for each state.
|
||||
*/
|
||||
%%
|
||||
#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
|
||||
|
||||
/* The next table maps tokens into fallback tokens. If a construct
|
||||
** like the following:
|
||||
**
|
||||
** %fallback ID X Y Z.
|
||||
**
|
||||
** appears in the grammer, then ID becomes a fallback token for X, Y,
|
||||
** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
|
||||
** but it does not parse, the type of the token is changed to ID and
|
||||
** the parse is retried before an error is thrown.
|
||||
*/
|
||||
#ifdef YYFALLBACK
|
||||
static const YYCODETYPE yyFallback[] = {
|
||||
%%
|
||||
};
|
||||
#endif /* YYFALLBACK */
|
||||
|
||||
/* The following structure represents a single element of the
|
||||
** parser's stack. Information stored includes:
|
||||
**
|
||||
** + The state number for the parser at this level of the stack.
|
||||
**
|
||||
** + The value of the token stored at this level of the stack.
|
||||
** (In other words, the "major" token.)
|
||||
**
|
||||
** + The semantic value stored at this level of the stack. This is
|
||||
** the information used by the action routines in the grammar.
|
||||
** It is sometimes called the "minor" token.
|
||||
*/
|
||||
struct yyStackEntry {
|
||||
int stateno; /* The state-number */
|
||||
int major; /* The major token value. This is the code
|
||||
** number for the token at this stack level */
|
||||
YYMINORTYPE minor; /* The user-supplied minor token value. This
|
||||
** is the value of the token */
|
||||
};
|
||||
typedef struct yyStackEntry yyStackEntry;
|
||||
|
||||
/* The state of the parser is completely contained in an instance of
|
||||
** the following structure */
|
||||
struct yyParser {
|
||||
int yyidx; /* Index of top element in stack */
|
||||
int yyerrcnt; /* Shifts left before out of the error */
|
||||
ParseARG_SDECL /* A place to hold %extra_argument */
|
||||
#if YYSTACKDEPTH<=0
|
||||
int yystksz; /* Current side of the stack */
|
||||
yyStackEntry *yystack; /* The parser's stack */
|
||||
#else
|
||||
yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
|
||||
#endif
|
||||
};
|
||||
typedef struct yyParser yyParser;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <stdio.h>
|
||||
static FILE *yyTraceFILE = 0;
|
||||
static char *yyTracePrompt = 0;
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#ifndef NDEBUG
|
||||
/*
|
||||
** Turn parser tracing on by giving a stream to which to write the trace
|
||||
** and a prompt to preface each trace message. Tracing is turned off
|
||||
** by making either argument NULL
|
||||
**
|
||||
** Inputs:
|
||||
** <ul>
|
||||
** <li> A FILE* to which trace output should be written.
|
||||
** If NULL, then tracing is turned off.
|
||||
** <li> A prefix string written at the beginning of every
|
||||
** line of trace output. If NULL, then tracing is
|
||||
** turned off.
|
||||
** </ul>
|
||||
**
|
||||
** Outputs:
|
||||
** None.
|
||||
*/
|
||||
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
|
||||
yyTraceFILE = TraceFILE;
|
||||
yyTracePrompt = zTracePrompt;
|
||||
if( yyTraceFILE==0 ) yyTracePrompt = 0;
|
||||
else if( yyTracePrompt==0 ) yyTraceFILE = 0;
|
||||
}
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#ifndef NDEBUG
|
||||
/* For tracing shifts, the names of all terminals and nonterminals
|
||||
** are required. The following table supplies these names */
|
||||
static const char *const yyTokenName[] = {
|
||||
%%
|
||||
};
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#ifndef NDEBUG
|
||||
/* For tracing reduce actions, the names of all rules are required.
|
||||
*/
|
||||
static const char *const yyRuleName[] = {
|
||||
%%
|
||||
};
|
||||
#endif /* NDEBUG */
|
||||
|
||||
|
||||
#if YYSTACKDEPTH<=0
|
||||
/*
|
||||
** Try to increase the size of the parser stack.
|
||||
*/
|
||||
static void yyGrowStack(yyParser *p){
|
||||
int newSize;
|
||||
yyStackEntry *pNew;
|
||||
|
||||
newSize = p->yystksz*2 + 100;
|
||||
pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
|
||||
if( pNew ){
|
||||
p->yystack = pNew;
|
||||
p->yystksz = newSize;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
|
||||
yyTracePrompt, p->yystksz);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** This function allocates a new parser.
|
||||
** The only argument is a pointer to a function which works like
|
||||
** malloc.
|
||||
**
|
||||
** Inputs:
|
||||
** A pointer to the function used to allocate memory.
|
||||
**
|
||||
** Outputs:
|
||||
** A pointer to a parser. This pointer is used in subsequent calls
|
||||
** to Parse and ParseFree.
|
||||
*/
|
||||
void *ParseAlloc(void *(*mallocProc)(size_t)){
|
||||
yyParser *pParser;
|
||||
pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
|
||||
if( pParser ){
|
||||
pParser->yyidx = -1;
|
||||
#if YYSTACKDEPTH<=0
|
||||
yyGrowStack(pParser);
|
||||
#endif
|
||||
}
|
||||
return pParser;
|
||||
}
|
||||
|
||||
/* The following function deletes the value associated with a
|
||||
** symbol. The symbol can be either a terminal or nonterminal.
|
||||
** "yymajor" is the symbol code, and "yypminor" is a pointer to
|
||||
** the value.
|
||||
*/
|
||||
static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
|
||||
switch( yymajor ){
|
||||
/* Here is inserted the actions which take place when a
|
||||
** terminal or non-terminal is destroyed. This can happen
|
||||
** when the symbol is popped from the stack during a
|
||||
** reduce or during error processing or when a parser is
|
||||
** being destroyed before it is finished parsing.
|
||||
**
|
||||
** Note: during a reduce, the only symbols destroyed are those
|
||||
** which appear on the RHS of the rule, but which are not used
|
||||
** inside the C code.
|
||||
*/
|
||||
%%
|
||||
default: break; /* If no destructor action specified: do nothing */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Pop the parser's stack once.
|
||||
**
|
||||
** If there is a destructor routine associated with the token which
|
||||
** is popped from the stack, then call it.
|
||||
**
|
||||
** Return the major token number for the symbol popped.
|
||||
*/
|
||||
static int yy_pop_parser_stack(yyParser *pParser){
|
||||
YYCODETYPE yymajor;
|
||||
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
|
||||
|
||||
if( pParser->yyidx<0 ) return 0;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE && pParser->yyidx>=0 ){
|
||||
fprintf(yyTraceFILE,"%sPopping %s\n",
|
||||
yyTracePrompt,
|
||||
yyTokenName[yytos->major]);
|
||||
}
|
||||
#endif
|
||||
yymajor = yytos->major;
|
||||
yy_destructor( yymajor, &yytos->minor);
|
||||
pParser->yyidx--;
|
||||
return yymajor;
|
||||
}
|
||||
|
||||
/*
|
||||
** Deallocate and destroy a parser. Destructors are all called for
|
||||
** all stack elements before shutting the parser down.
|
||||
**
|
||||
** Inputs:
|
||||
** <ul>
|
||||
** <li> A pointer to the parser. This should be a pointer
|
||||
** obtained from ParseAlloc.
|
||||
** <li> A pointer to a function used to reclaim memory obtained
|
||||
** from malloc.
|
||||
** </ul>
|
||||
*/
|
||||
void ParseFree(
|
||||
void *p, /* The parser to be deleted */
|
||||
void (*freeProc)(void*) /* Function used to reclaim memory */
|
||||
){
|
||||
yyParser *pParser = (yyParser*)p;
|
||||
if( pParser==0 ) return;
|
||||
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
|
||||
#if YYSTACKDEPTH<=0
|
||||
free(pParser->yystack);
|
||||
#endif
|
||||
(*freeProc)((void*)pParser);
|
||||
}
|
||||
|
||||
/*
|
||||
** Find the appropriate action for a parser given the terminal
|
||||
** look-ahead token iLookAhead.
|
||||
**
|
||||
** If the look-ahead token is YYNOCODE, then check to see if the action is
|
||||
** independent of the look-ahead. If it is, return the action, otherwise
|
||||
** return YY_NO_ACTION.
|
||||
*/
|
||||
static int yy_find_shift_action(
|
||||
yyParser *pParser, /* The parser */
|
||||
YYCODETYPE iLookAhead /* The look-ahead token */
|
||||
){
|
||||
int i;
|
||||
int stateno = pParser->yystack[pParser->yyidx].stateno;
|
||||
|
||||
if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
|
||||
return yy_default[stateno];
|
||||
}
|
||||
assert( iLookAhead!=YYNOCODE );
|
||||
i += iLookAhead;
|
||||
if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
|
||||
if( iLookAhead>0 ){
|
||||
#ifdef YYFALLBACK
|
||||
int iFallback; /* Fallback token */
|
||||
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
|
||||
&& (iFallback = yyFallback[iLookAhead])!=0 ){
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
|
||||
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
|
||||
}
|
||||
#endif
|
||||
return yy_find_shift_action(pParser, iFallback);
|
||||
}
|
||||
#endif
|
||||
#ifdef YYWILDCARD
|
||||
{
|
||||
int j = i - iLookAhead + YYWILDCARD;
|
||||
if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
|
||||
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
|
||||
}
|
||||
#endif /* NDEBUG */
|
||||
return yy_action[j];
|
||||
}
|
||||
}
|
||||
#endif /* YYWILDCARD */
|
||||
}
|
||||
return yy_default[stateno];
|
||||
}else{
|
||||
return yy_action[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Find the appropriate action for a parser given the non-terminal
|
||||
** look-ahead token iLookAhead.
|
||||
**
|
||||
** If the look-ahead token is YYNOCODE, then check to see if the action is
|
||||
** independent of the look-ahead. If it is, return the action, otherwise
|
||||
** return YY_NO_ACTION.
|
||||
*/
|
||||
static int yy_find_reduce_action(
|
||||
int stateno, /* Current state number */
|
||||
YYCODETYPE iLookAhead /* The look-ahead token */
|
||||
){
|
||||
int i;
|
||||
assert( stateno<=YY_REDUCE_MAX );
|
||||
i = yy_reduce_ofst[stateno];
|
||||
assert( i!=YY_REDUCE_USE_DFLT );
|
||||
assert( iLookAhead!=YYNOCODE );
|
||||
i += iLookAhead;
|
||||
assert( i>=0 && i<YY_SZ_ACTTAB );
|
||||
assert( yy_lookahead[i]==iLookAhead );
|
||||
return yy_action[i];
|
||||
}
|
||||
|
||||
/*
|
||||
** The following routine is called if the stack overflows.
|
||||
*/
|
||||
static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
|
||||
ParseARG_FETCH;
|
||||
yypParser->yyidx--;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
|
||||
}
|
||||
#endif
|
||||
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
|
||||
/* Here code is inserted which will execute if the parser
|
||||
** stack every overflows */
|
||||
%%
|
||||
ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
|
||||
}
|
||||
|
||||
/*
|
||||
** Perform a shift action.
|
||||
*/
|
||||
static void yy_shift(
|
||||
yyParser *yypParser, /* The parser to be shifted */
|
||||
int yyNewState, /* The new state to shift in */
|
||||
int yyMajor, /* The major token to shift in */
|
||||
YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
|
||||
){
|
||||
yyStackEntry *yytos;
|
||||
yypParser->yyidx++;
|
||||
#if YYSTACKDEPTH>0
|
||||
if( yypParser->yyidx>=YYSTACKDEPTH ){
|
||||
yyStackOverflow(yypParser, yypMinor);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if( yypParser->yyidx>=yypParser->yystksz ){
|
||||
yyGrowStack(yypParser);
|
||||
if( yypParser->yyidx>=yypParser->yystksz ){
|
||||
yyStackOverflow(yypParser, yypMinor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
yytos = &yypParser->yystack[yypParser->yyidx];
|
||||
yytos->stateno = yyNewState;
|
||||
yytos->major = yyMajor;
|
||||
yytos->minor = *yypMinor;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE && yypParser->yyidx>0 ){
|
||||
int i;
|
||||
fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
|
||||
fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
|
||||
for(i=1; i<=yypParser->yyidx; i++)
|
||||
fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
|
||||
fprintf(yyTraceFILE,"\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* The following table contains information about every rule that
|
||||
** is used during the reduce.
|
||||
*/
|
||||
static const struct {
|
||||
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
|
||||
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
|
||||
} yyRuleInfo[] = {
|
||||
%%
|
||||
};
|
||||
|
||||
static void yy_accept(yyParser*); /* Forward Declaration */
|
||||
|
||||
/*
|
||||
** Perform a reduce action and the shift that must immediately
|
||||
** follow the reduce.
|
||||
*/
|
||||
static void yy_reduce(
|
||||
yyParser *yypParser, /* The parser */
|
||||
int yyruleno /* Number of the rule by which to reduce */
|
||||
){
|
||||
int yygoto; /* The next state */
|
||||
int yyact; /* The next action */
|
||||
YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
|
||||
yyStackEntry *yymsp; /* The top of the parser's stack */
|
||||
int yysize; /* Amount to pop the stack */
|
||||
ParseARG_FETCH;
|
||||
yymsp = &yypParser->yystack[yypParser->yyidx];
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE && yyruleno>=0
|
||||
&& yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
|
||||
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
|
||||
yyRuleName[yyruleno]);
|
||||
}
|
||||
#endif /* NDEBUG */
|
||||
|
||||
/* Silence complaints from purify about yygotominor being uninitialized
|
||||
** in some cases when it is copied into the stack after the following
|
||||
** switch. yygotominor is uninitialized when a rule reduces that does
|
||||
** not set the value of its left-hand side nonterminal. Leaving the
|
||||
** value of the nonterminal uninitialized is utterly harmless as long
|
||||
** as the value is never used. So really the only thing this code
|
||||
** accomplishes is to quieten purify.
|
||||
**
|
||||
** 2007-01-16: The wireshark project (www.wireshark.org) reports that
|
||||
** without this code, their parser segfaults. I'm not sure what there
|
||||
** parser is doing to make this happen. This is the second bug report
|
||||
** from wireshark this week. Clearly they are stressing Lemon in ways
|
||||
** that it has not been previously stressed... (SQLite ticket #2172)
|
||||
*/
|
||||
memset(&yygotominor, 0, sizeof(yygotominor));
|
||||
|
||||
|
||||
switch( yyruleno ){
|
||||
/* Beginning here are the reduction cases. A typical example
|
||||
** follows:
|
||||
** case 0:
|
||||
** #line <lineno> <grammarfile>
|
||||
** { ... } // User supplied code
|
||||
** #line <lineno> <thisfile>
|
||||
** break;
|
||||
*/
|
||||
%%
|
||||
};
|
||||
yygoto = yyRuleInfo[yyruleno].lhs;
|
||||
yysize = yyRuleInfo[yyruleno].nrhs;
|
||||
yypParser->yyidx -= yysize;
|
||||
yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
|
||||
if( yyact < YYNSTATE ){
|
||||
#ifdef NDEBUG
|
||||
/* If we are not debugging and the reduce action popped at least
|
||||
** one element off the stack, then we can push the new element back
|
||||
** onto the stack here, and skip the stack overflow test in yy_shift().
|
||||
** That gives a significant speed improvement. */
|
||||
if( yysize ){
|
||||
yypParser->yyidx++;
|
||||
yymsp -= yysize-1;
|
||||
yymsp->stateno = yyact;
|
||||
yymsp->major = yygoto;
|
||||
yymsp->minor = yygotominor;
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
yy_shift(yypParser,yyact,yygoto,&yygotominor);
|
||||
}
|
||||
}else{
|
||||
assert( yyact == YYNSTATE + YYNRULE + 1 );
|
||||
yy_accept(yypParser);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** The following code executes when the parse fails
|
||||
*/
|
||||
static void yy_parse_failed(
|
||||
yyParser *yypParser /* The parser */
|
||||
){
|
||||
ParseARG_FETCH;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
|
||||
}
|
||||
#endif
|
||||
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
|
||||
/* Here code is inserted which will be executed whenever the
|
||||
** parser fails */
|
||||
%%
|
||||
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
|
||||
}
|
||||
|
||||
/*
|
||||
** The following code executes when a syntax error first occurs.
|
||||
*/
|
||||
static void yy_syntax_error(
|
||||
yyParser *yypParser, /* The parser */
|
||||
int yymajor, /* The major type of the error token */
|
||||
YYMINORTYPE yyminor /* The minor type of the error token */
|
||||
){
|
||||
ParseARG_FETCH;
|
||||
#define TOKEN (yyminor.yy0)
|
||||
%%
|
||||
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
|
||||
}
|
||||
|
||||
/*
|
||||
** The following is executed when the parser accepts
|
||||
*/
|
||||
static void yy_accept(
|
||||
yyParser *yypParser /* The parser */
|
||||
){
|
||||
ParseARG_FETCH;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
|
||||
}
|
||||
#endif
|
||||
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
|
||||
/* Here code is inserted which will be executed whenever the
|
||||
** parser accepts */
|
||||
%%
|
||||
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
|
||||
}
|
||||
|
||||
/* The main parser program.
|
||||
** The first argument is a pointer to a structure obtained from
|
||||
** "ParseAlloc" which describes the current state of the parser.
|
||||
** The second argument is the major token number. The third is
|
||||
** the minor token. The fourth optional argument is whatever the
|
||||
** user wants (and specified in the grammar) and is available for
|
||||
** use by the action routines.
|
||||
**
|
||||
** Inputs:
|
||||
** <ul>
|
||||
** <li> A pointer to the parser (an opaque structure.)
|
||||
** <li> The major token number.
|
||||
** <li> The minor token number.
|
||||
** <li> An option argument of a grammar-specified type.
|
||||
** </ul>
|
||||
**
|
||||
** Outputs:
|
||||
** None.
|
||||
*/
|
||||
void Parse(
|
||||
void *yyp, /* The parser */
|
||||
int yymajor, /* The major token code number */
|
||||
ParseTOKENTYPE yyminor /* The value for the token */
|
||||
ParseARG_PDECL /* Optional %extra_argument parameter */
|
||||
){
|
||||
YYMINORTYPE yyminorunion;
|
||||
int yyact; /* The parser action. */
|
||||
int yyendofinput; /* True if we are at the end of input */
|
||||
#ifdef YYERRORSYMBOL
|
||||
int yyerrorhit = 0; /* True if yymajor has invoked an error */
|
||||
#endif
|
||||
yyParser *yypParser; /* The parser */
|
||||
|
||||
/* (re)initialize the parser, if necessary */
|
||||
yypParser = (yyParser*)yyp;
|
||||
if( yypParser->yyidx<0 ){
|
||||
#if YYSTACKDEPTH<=0
|
||||
if( yypParser->yystksz <=0 ){
|
||||
memset(&yyminorunion, 0, sizeof(yyminorunion));
|
||||
yyStackOverflow(yypParser, &yyminorunion);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
yypParser->yyidx = 0;
|
||||
yypParser->yyerrcnt = -1;
|
||||
yypParser->yystack[0].stateno = 0;
|
||||
yypParser->yystack[0].major = 0;
|
||||
}
|
||||
yyminorunion.yy0 = yyminor;
|
||||
yyendofinput = (yymajor==0);
|
||||
ParseARG_STORE;
|
||||
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
|
||||
}
|
||||
#endif
|
||||
|
||||
do{
|
||||
yyact = yy_find_shift_action(yypParser,yymajor);
|
||||
if( yyact<YYNSTATE ){
|
||||
assert( !yyendofinput ); /* Impossible to shift the $ token */
|
||||
yy_shift(yypParser,yyact,yymajor,&yyminorunion);
|
||||
yypParser->yyerrcnt--;
|
||||
yymajor = YYNOCODE;
|
||||
}else if( yyact < YYNSTATE + YYNRULE ){
|
||||
yy_reduce(yypParser,yyact-YYNSTATE);
|
||||
}else{
|
||||
assert( yyact == YY_ERROR_ACTION );
|
||||
#ifdef YYERRORSYMBOL
|
||||
int yymx;
|
||||
#endif
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
|
||||
}
|
||||
#endif
|
||||
#ifdef YYERRORSYMBOL
|
||||
/* A syntax error has occurred.
|
||||
** The response to an error depends upon whether or not the
|
||||
** grammar defines an error token "ERROR".
|
||||
**
|
||||
** This is what we do if the grammar does define ERROR:
|
||||
**
|
||||
** * Call the %syntax_error function.
|
||||
**
|
||||
** * Begin popping the stack until we enter a state where
|
||||
** it is legal to shift the error symbol, then shift
|
||||
** the error symbol.
|
||||
**
|
||||
** * Set the error count to three.
|
||||
**
|
||||
** * Begin accepting and shifting new tokens. No new error
|
||||
** processing will occur until three tokens have been
|
||||
** shifted successfully.
|
||||
**
|
||||
*/
|
||||
if( yypParser->yyerrcnt<0 ){
|
||||
yy_syntax_error(yypParser,yymajor,yyminorunion);
|
||||
}
|
||||
yymx = yypParser->yystack[yypParser->yyidx].major;
|
||||
if( yymx==YYERRORSYMBOL || yyerrorhit ){
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
fprintf(yyTraceFILE,"%sDiscard input token %s\n",
|
||||
yyTracePrompt,yyTokenName[yymajor]);
|
||||
}
|
||||
#endif
|
||||
yy_destructor(yymajor,&yyminorunion);
|
||||
yymajor = YYNOCODE;
|
||||
}else{
|
||||
while(
|
||||
yypParser->yyidx >= 0 &&
|
||||
yymx != YYERRORSYMBOL &&
|
||||
(yyact = yy_find_reduce_action(
|
||||
yypParser->yystack[yypParser->yyidx].stateno,
|
||||
YYERRORSYMBOL)) >= YYNSTATE
|
||||
){
|
||||
yy_pop_parser_stack(yypParser);
|
||||
}
|
||||
if( yypParser->yyidx < 0 || yymajor==0 ){
|
||||
yy_destructor(yymajor,&yyminorunion);
|
||||
yy_parse_failed(yypParser);
|
||||
yymajor = YYNOCODE;
|
||||
}else if( yymx!=YYERRORSYMBOL ){
|
||||
YYMINORTYPE u2;
|
||||
u2.YYERRSYMDT = 0;
|
||||
yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
|
||||
}
|
||||
}
|
||||
yypParser->yyerrcnt = 3;
|
||||
yyerrorhit = 1;
|
||||
#else /* YYERRORSYMBOL is not defined */
|
||||
/* This is what we do if the grammar does not define ERROR:
|
||||
**
|
||||
** * Report an error message, and throw away the input token.
|
||||
**
|
||||
** * If the input token is $, then fail the parse.
|
||||
**
|
||||
** As before, subsequent error messages are suppressed until
|
||||
** three input tokens have been successfully shifted.
|
||||
*/
|
||||
if( yypParser->yyerrcnt<=0 ){
|
||||
yy_syntax_error(yypParser,yymajor,yyminorunion);
|
||||
}
|
||||
yypParser->yyerrcnt = 3;
|
||||
yy_destructor(yymajor,&yyminorunion);
|
||||
if( yyendofinput ){
|
||||
yy_parse_failed(yypParser);
|
||||
}
|
||||
yymajor = YYNOCODE;
|
||||
#endif
|
||||
}
|
||||
}while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
|
||||
return;
|
||||
}
|
|
@ -23,6 +23,8 @@ static void usp_fork_fortune()
|
|||
|
||||
if (pstmt_fortune == 0) U_ERROR("usp_fork_fortune(): we cound't connect to db");
|
||||
|
||||
if (UOrmDriver::isPGSQL()) *psql_fortune << "BEGIN ISOLATION LEVEL SERIALIZABLE; COMMIT";
|
||||
|
||||
pfortune = U_NEW(Fortune);
|
||||
|
||||
pstmt_fortune->into(*pfortune);
|
||||
|
|
|
@ -26,6 +26,8 @@ static void usp_fork_query()
|
|||
|
||||
if (pstmt_query == 0) U_ERROR("usp_fork_query(): we cound't connect to db");
|
||||
|
||||
if (UOrmDriver::isPGSQL()) *psql_query << "BEGIN TRANSACTION";
|
||||
|
||||
pworld_query = U_NEW(World);
|
||||
|
||||
pstmt_query->use( pworld_query->id);
|
||||
|
|
|
@ -242,10 +242,6 @@ UOrmDriver* UOrmDriverMySql::handlerConnect(const UString& option)
|
|||
(void) U_SYSCALL(mysql_set_character_set, "%p,%S", (MYSQL*)pdrv->connection, ptr);
|
||||
}
|
||||
|
||||
#if !defined(U_PIPELINE_HOMOGENEOUS_DISABLE) && !defined(U_LOG_ENABLE) && !defined(U_CACHE_REQUEST_DISABLE) && !defined(USE_LIBZ)
|
||||
(void) U_SYSCALL(mysql_real_query, "%p,%S,%lu", (MYSQL*)UOrmDriver::connection, U_CONSTANT_TO_PARAM("BEGIN TRANSACTION"));
|
||||
#endif
|
||||
|
||||
U_RETURN_POINTER(pdrv, UOrmDriver);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,10 +105,6 @@ UOrmDriver* UOrmDriverPgSql::handlerConnect(const UString& option)
|
|||
|
||||
// (void) U_SYSCALL(PQsetClientEncoding, "%p,%S", (PGconn*)pdrv->connection, "UTF8");
|
||||
|
||||
#if !defined(U_PIPELINE_HOMOGENEOUS_DISABLE) && !defined(U_LOG_ENABLE) && !defined(U_CACHE_REQUEST_DISABLE) && !defined(USE_LIBZ)
|
||||
(void) U_SYSCALL(PQexec, "%p,%S", (PGconn*)UOrmDriver::connection, "BEGIN ISOLATION LEVEL SERIALIZABLE; COMMIT; BEGIN TRANSACTION");
|
||||
#endif
|
||||
|
||||
U_RETURN_POINTER(pdrv, UOrmDriver);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ static void usp_fork_fortune()
|
|||
|
||||
if (pstmt_fortune == 0) U_ERROR("usp_fork_fortune(): we cound't connect to db");
|
||||
|
||||
if (UOrmDriver::isPGSQL()) *psql_fortune << "BEGIN ISOLATION LEVEL SERIALIZABLE; COMMIT";
|
||||
|
||||
pfortune = U_NEW(Fortune);
|
||||
|
||||
pstmt_fortune->into(*pfortune);
|
||||
|
|
|
@ -26,6 +26,8 @@ static void usp_fork_query()
|
|||
|
||||
if (pstmt_query == 0) U_ERROR("usp_fork_query(): we cound't connect to db");
|
||||
|
||||
if (UOrmDriver::isPGSQL()) *psql_query << "BEGIN TRANSACTION";
|
||||
|
||||
pworld_query = U_NEW(World);
|
||||
|
||||
pstmt_query->use( pworld_query->id);
|
||||
|
|
Loading…
Reference in New Issue
Block a user